diff --git a/head b/head index e5209205ced..1c1bba2109d 100644 --- a/head +++ b/head @@ -1 +1 @@ -579fe684ce5500480bf7561d27b7a3ac9bbc7c88 +1eadef6a63051424cda6de9ed82664b49b7be145 diff --git a/upstream/.github/workflows/ci.yaml b/upstream/.github/workflows/ci.yaml index c791d90b75c..fd0ae8788f1 100644 --- a/upstream/.github/workflows/ci.yaml +++ b/upstream/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0 with: - version: v1.61.0 + version: v1.57.2 args: --timeout=10m - name: yamllint run: | diff --git a/upstream/.github/workflows/codeql-analysis.yml b/upstream/.github/workflows/codeql-analysis.yml index e2b259f9de2..3938c671ec5 100644 --- a/upstream/.github/workflows/codeql-analysis.yml +++ b/upstream/.github/workflows/codeql-analysis.yml @@ -49,20 +49,16 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: egress-policy: audit - name: Checkout repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - name: Setup go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 - with: - go-version: '1.22.x' + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 + uses: github/codeql-action/init@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -70,7 +66,7 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: | ~/.cache/go-build @@ -96,4 +92,4 @@ jobs: make -j 4 all - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 + uses: github/codeql-action/analyze@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1 diff --git a/upstream/.github/workflows/dependency-review.yml b/upstream/.github/workflows/dependency-review.yml index b362633e6dc..bb377e05999 100644 --- a/upstream/.github/workflows/dependency-review.yml +++ b/upstream/.github/workflows/dependency-review.yml @@ -17,13 +17,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: egress-policy: audit - name: 'Checkout Repository' - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: 'Dependency Review' - uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 + uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 with: fail-on-severity: low diff --git a/upstream/.github/workflows/scorecard.yml b/upstream/.github/workflows/scorecard.yml index 26407912ed7..0a651e4129c 100644 --- a/upstream/.github/workflows/scorecard.yml +++ b/upstream/.github/workflows/scorecard.yml @@ -29,16 +29,16 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: egress-policy: audit - name: "Checkout code" - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 with: results_file: results.sarif results_format: sarif @@ -53,7 +53,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 + uses: github/codeql-action/upload-sarif@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1 with: sarif_file: results.sarif diff --git a/upstream/.github/workflows/woke.yml b/upstream/.github/workflows/woke.yml index 443ba93e313..abd498d453e 100644 --- a/upstream/.github/workflows/woke.yml +++ b/upstream/.github/workflows/woke.yml @@ -11,15 +11,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: egress-policy: audit - name: 'Checkout' - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3 + uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # v44.3.0 with: write_output_files: true files: | diff --git a/upstream/.golangci.yml b/upstream/.golangci.yml index 3dfaf597ef3..72e9dbee8e5 100644 --- a/upstream/.golangci.yml +++ b/upstream/.golangci.yml @@ -1,10 +1,5 @@ # Documentation: https://golangci-lint.run/usage/configuration/ - linters-settings: - gosec: - excludes: - - G601 - exclude-generated: true errcheck: exclude-functions: - (*github.com/tektoncd/pipeline/vendor/go.uber.org/zap.SugaredLogger).Sync @@ -85,13 +80,12 @@ linters: - gocyclo - godot - godox - - err113 + - goerr113 - gofumpt - gomnd - gomoddirectives - ireturn - lll - - mnd - nestif - nlreturn - nonamedreturns diff --git a/upstream/DEVELOPMENT.md b/upstream/DEVELOPMENT.md index 51ccc7abcbc..00658792995 100644 --- a/upstream/DEVELOPMENT.md +++ b/upstream/DEVELOPMENT.md @@ -283,7 +283,7 @@ as follows. The recommended minimum development configuration is: -- Kubernetes version 1.28 or later +- Kubernetes version 1.27 or later - 4 (virtual) CPU nodes - 8 GB of (actual or virtualized) platform memory - Node autoscaling, up to 3 nodes @@ -341,7 +341,7 @@ optional: As a convenience, the [Tekton plumbing project](https://github.com/tek --region=us-central1 \ --machine-type=e2-standard-4 \ --num-nodes=1 \ - --cluster-version=1.28 + --cluster-version=1.27 ``` > **Note**: The recommended [GCE machine type](https://cloud.google.com/compute/docs/machine-types) is `'e2-standard-4'`. diff --git a/upstream/Makefile b/upstream/Makefile index c3676d263c5..519e8b11fee 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -9,8 +9,7 @@ TESTPKGS = $(shell env GO111MODULE=on $(GO) list -f \ BIN = $(CURDIR)/.bin WOKE ?= go run -modfile go.mod github.com/get-woke/woke -# Get golangci_version from tools/go.mod -GOLANGCI_VERSION := $(shell cat tools/go.mod | grep golangci-lint | awk '{ print $$3 }') +GOLANGCI_VERSION = v1.57.2 WOKE_VERSION = v0.19.0 GO = go @@ -166,10 +165,9 @@ $(BIN)/errcheck: PACKAGE=github.com/kisielk/errcheck errcheck: | $(ERRCHECK) ; $(info $(M) running errcheck…) ## Run errcheck $Q $(ERRCHECK) ./... -GOLANGCILINT = $(BIN)/golangci-lint-$(GOLANGCI_VERSION) -$(BIN)/golangci-lint-$(GOLANGCI_VERSION): ; $(info $(M) getting golangci-lint $(GOLANGCI_VERSION)) - cd tools; go mod download github.com/golangci/golangci-lint && go mod tidy - cd tools; go build -o $(BIN)/golangci-lint-$(GOLANGCI_VERSION) github.com/golangci/golangci-lint/cmd/golangci-lint +GOLANGCILINT = $(BIN)/golangci-lint +$(BIN)/golangci-lint: ; $(info $(M) getting golangci-lint $(GOLANGCI_VERSION)) + cd tools; GOBIN=$(BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) .PHONY: golangci-lint golangci-lint: | $(GOLANGCILINT) ; $(info $(M) running golangci-lint…) @ ## Run golangci-lint diff --git a/upstream/OWNERS_ALIASES b/upstream/OWNERS_ALIASES index 8a0aa0b41e1..ca9443a941d 100644 --- a/upstream/OWNERS_ALIASES +++ b/upstream/OWNERS_ALIASES @@ -1,11 +1,13 @@ aliases: pipeline-approvers: - afrittoli + - bobcatfish - dibyom - ImJasonH - vdemeester - pritidesai - jerop + - lbernick - abayer - wlynch - yongxuanzhang @@ -14,6 +16,7 @@ aliases: pipeline-reviewers: - afrittoli + - bobcatfish - dibyom - vdemeester - pritidesai @@ -23,16 +26,19 @@ aliases: apis-approvers: - afrittoli + - bobcatfish - dibyom - ImJasonH - vdemeester - pritidesai - jerop + - lbernick - abayer - wlynch productivity-approvers: - afrittoli + - bobcatfish - vdemeester # Alumni ❤️ @@ -42,5 +48,3 @@ aliases: # aaron-prindle # sbwsg # dlorenc -# lbernick -# bobcatfish \ No newline at end of file diff --git a/upstream/README.md b/upstream/README.md index d9692f738cb..a73f36dbe0b 100644 --- a/upstream/README.md +++ b/upstream/README.md @@ -44,7 +44,6 @@ Tekton Pipelines are **Typed**: - Starting from the v0.45.x release of Tekton: **Kubernetes version 1.24 or later** - Starting from the v0.51.x release of Tekton: **Kubernetes version 1.25 or later** - Starting from the v0.59.x release of Tekton: **Kubernetes version 1.27 or later** -- Starting from the v0.61.x release of Tekton: **Kubernetes version 1.28 or later** ### Read the docs diff --git a/upstream/cmd/controller/main.go b/upstream/cmd/controller/main.go index 6b0733329be..664eafe21cc 100644 --- a/upstream/cmd/controller/main.go +++ b/upstream/cmd/controller/main.go @@ -56,7 +56,6 @@ func main() { flag.StringVar(&opts.Images.ShellImage, "shell-image", "", "The container image containing a shell") flag.StringVar(&opts.Images.ShellImageWin, "shell-image-win", "", "The container image containing a windows shell") flag.StringVar(&opts.Images.WorkingDirInitImage, "workingdirinit-image", "", "The container image containing our working dir init binary.") - flag.DurationVar(&opts.ResyncPeriod, "resync-period", controller.DefaultResyncPeriod, "The period between two resync run (going through all objects)") // This parses flags. cfg := injection.ParseAndGetRESTConfigOrDie() @@ -99,8 +98,6 @@ func main() { }() ctx = filteredinformerfactory.WithSelectors(ctx, v1beta1.ManagedByLabelKey) - ctx = controller.WithResyncPeriod(ctx, opts.ResyncPeriod) - sharedmain.MainWithConfig(ctx, ControllerLogKey, cfg, taskrun.NewController(opts, clock.RealClock{}), pipelinerun.NewController(opts, clock.RealClock{}), diff --git a/upstream/cmd/entrypoint/main.go b/upstream/cmd/entrypoint/main.go index 44c8fe5de3a..adf7a0a9d4a 100644 --- a/upstream/cmd/entrypoint/main.go +++ b/upstream/cmd/entrypoint/main.go @@ -17,6 +17,7 @@ limitations under the License. package main import ( + "context" "encoding/json" "errors" "flag" @@ -32,7 +33,6 @@ import ( "github.com/tektoncd/pipeline/cmd/entrypoint/subcommands" featureFlags "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/credentials" "github.com/tektoncd/pipeline/pkg/credentials/dockercreds" "github.com/tektoncd/pipeline/pkg/credentials/gitcreds" @@ -50,12 +50,10 @@ var ( terminationPath = flag.String("termination_path", "/tekton/termination", "If specified, file to write upon termination") results = flag.String("results", "", "If specified, list of file names that might contain task results") stepResults = flag.String("step_results", "", "step results if specified") - whenExpressions = flag.String("when_expressions", "", "when expressions if specified") timeout = flag.Duration("timeout", time.Duration(0), "If specified, sets timeout for step") stdoutPath = flag.String("stdout_path", "", "If specified, file to copy stdout to") stderrPath = flag.String("stderr_path", "", "If specified, file to copy stderr to") breakpointOnFailure = flag.Bool("breakpoint_on_failure", false, "If specified, expect steps to not skip on failure") - debugBeforeStep = flag.Bool("debug_before_step", false, "If specified, wait for a debugger to attach before executing the step") onError = flag.String("on_error", "", "Set to \"continue\" to ignore an error and continue when a container terminates with a non-zero exit code."+ " Set to \"stopAndFail\" to declare a failure with a step error and stop executing the rest of the steps.") stepMetadataDir = flag.String("step_metadata_dir", "", "If specified, create directory to store the step metadata e.g. /tekton/steps//") @@ -66,8 +64,25 @@ var ( const ( defaultWaitPollingInterval = time.Second + breakpointExitSuffix = ".breakpointexit" ) +func checkForBreakpointOnFailure(e entrypoint.Entrypointer, breakpointExitPostFile string) { + if e.BreakpointOnFailure { + if waitErr := e.Waiter.Wait(context.Background(), breakpointExitPostFile, false, false); waitErr != nil { + log.Println("error occurred while waiting for " + breakpointExitPostFile + " : " + waitErr.Error()) + } + // get exitcode from .breakpointexit + exitCode, readErr := e.BreakpointExitCode(breakpointExitPostFile) + // if readErr exists, the exitcode with default to 0 as we would like + // to encourage to continue running the next steps in the taskRun + if readErr != nil { + log.Println("error occurred while reading breakpoint exit code : " + readErr.Error()) + } + os.Exit(exitCode) + } +} + func main() { // Add credential flags originally introduced with our legacy credentials helper // image (creds-init). @@ -123,12 +138,6 @@ func main() { log.Fatal(err) } } - var when v1.StepWhenExpressions - if len(*whenExpressions) > 0 { - if err := json.Unmarshal([]byte(*whenExpressions), &when); err != nil { - log.Fatal(err) - } - } var spireWorkloadAPI spire.EntrypointerAPIClient if enableSpire != nil && *enableSpire && socketPath != nil && *socketPath != "" { @@ -153,9 +162,7 @@ func main() { Results: strings.Split(*results, ","), StepResults: strings.Split(*stepResults, ","), Timeout: timeout, - StepWhenExpressions: when, BreakpointOnFailure: *breakpointOnFailure, - DebugBeforeStep: *debugBeforeStep, OnError: *onError, StepMetadataDir: *stepMetadataDir, SpireWorkloadAPI: spireWorkloadAPI, @@ -169,10 +176,8 @@ func main() { } if err := e.Go(); err != nil { + breakpointExitPostFile := e.PostFile + breakpointExitSuffix switch t := err.(type) { //nolint:errorlint // checking for multiple types with errors.As is ugly. - case entrypoint.DebugBeforeStepError: - log.Println("Skipping execute step script because before step breakpoint fail-continue") - os.Exit(1) case entrypoint.SkipError: log.Print("Skipping step because a previous step failed") os.Exit(1) @@ -196,7 +201,7 @@ func main() { // in both cases has an ExitStatus() method with the // same signature. if status, ok := t.Sys().(syscall.WaitStatus); ok { - e.CheckForBreakpointOnFailure() + checkForBreakpointOnFailure(e, breakpointExitPostFile) // ignore a step error i.e. do not exit if a container terminates with a non-zero exit code when onError is set to "continue" if e.OnError != entrypoint.ContinueOnError { os.Exit(status.ExitStatus()) @@ -207,7 +212,7 @@ func main() { log.Fatalf("Error executing command (ExitError): %v", err) } default: - e.CheckForBreakpointOnFailure() + checkForBreakpointOnFailure(e, breakpointExitPostFile) log.Fatalf("Error executing command: %v", err) } } diff --git a/upstream/cmd/resolvers/main.go b/upstream/cmd/resolvers/main.go index a5f0cadf7ab..f66e9cd0a89 100644 --- a/upstream/cmd/resolvers/main.go +++ b/upstream/cmd/resolvers/main.go @@ -17,47 +17,27 @@ limitations under the License. package main import ( - "flag" "os" "strings" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1alpha1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/bundle" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/cluster" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/git" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/http" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/hub" - hubresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/hub" - "k8s.io/client-go/rest" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/cluster" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/git" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/http" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/hub" filteredinformerfactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered" - "knative.dev/pkg/controller" - "knative.dev/pkg/injection" "knative.dev/pkg/injection/sharedmain" "knative.dev/pkg/signals" ) func main() { - flag.IntVar(&controller.DefaultThreadsPerController, "threads-per-controller", controller.DefaultThreadsPerController, "Threads (goroutines) to create per controller") - ctx := filteredinformerfactory.WithSelectors(signals.NewContext(), v1alpha1.ManagedByLabelKey) tektonHubURL := buildHubURL(os.Getenv("TEKTON_HUB_API"), "") - artifactHubURL := buildHubURL(os.Getenv("ARTIFACT_HUB_API"), hubresolution.DefaultArtifactHubURL) - - // This parses flags. - cfg := injection.ParseAndGetRESTConfigOrDie() - - if cfg.QPS == 0 { - cfg.QPS = 2 * rest.DefaultQPS - } - if cfg.Burst == 0 { - cfg.Burst = rest.DefaultBurst - } - // multiply by no of controllers being created - cfg.QPS = 5 * cfg.QPS - cfg.Burst = 5 * cfg.Burst + artifactHubURL := buildHubURL(os.Getenv("ARTIFACT_HUB_API"), hub.DefaultArtifactHubURL) - sharedmain.MainWithConfig(ctx, "controller", cfg, + sharedmain.MainWithContext(ctx, "controller", framework.NewController(ctx, &git.Resolver{}), framework.NewController(ctx, &hub.Resolver{TektonHubURL: tektonHubURL, ArtifactHubURL: artifactHubURL}), framework.NewController(ctx, &bundle.Resolver{}), diff --git a/upstream/cmd/sidecarlogresults/main.go b/upstream/cmd/sidecarlogresults/main.go index b63d3c4feb3..c66ce1133e0 100644 --- a/upstream/cmd/sidecarlogresults/main.go +++ b/upstream/cmd/sidecarlogresults/main.go @@ -32,19 +32,14 @@ func main() { var resultsDir string var resultNames string var stepResultsStr string - var stepNames string - flag.StringVar(&resultsDir, "results-dir", pipeline.DefaultResultPath, "Path to the results directory. Default is /tekton/results") flag.StringVar(&resultNames, "result-names", "", "comma separated result names to expect from the steps running in the pod. eg. foo,bar,baz") flag.StringVar(&stepResultsStr, "step-results", "", "json containing a map of step Name as key and list of result Names. eg. {\"stepName\":[\"foo\",\"bar\",\"baz\"]}") - flag.StringVar(&stepNames, "step-names", "", "comma separated step names. eg. foo,bar,baz") flag.Parse() - - var expectedResults []string - // strings.Split returns [""] instead of [] for empty string, we don't want pass [""] to other methods. - if len(resultNames) > 0 { - expectedResults = strings.Split(resultNames, ",") + if resultNames == "" { + log.Fatal("result-names were not provided") } + expectedResults := strings.Split(resultNames, ",") expectedStepResults := map[string][]string{} if err := json.Unmarshal([]byte(stepResultsStr), &expectedStepResults); err != nil { log.Fatal(err) @@ -53,13 +48,4 @@ func main() { if err != nil { log.Fatal(err) } - - var names []string - if len(stepNames) > 0 { - names = strings.Split(stepNames, ",") - } - err = sidecarlogresults.LookForArtifacts(os.Stdout, names, pod.RunDir) - if err != nil { - log.Fatal(err) - } } diff --git a/upstream/cmd/webhook/main.go b/upstream/cmd/webhook/main.go index 7281f0af421..02128320bc1 100644 --- a/upstream/cmd/webhook/main.go +++ b/upstream/cmd/webhook/main.go @@ -60,7 +60,6 @@ var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{ v1beta1.SchemeGroupVersion.WithKind("TaskRun"): &v1beta1.TaskRun{}, v1beta1.SchemeGroupVersion.WithKind("PipelineRun"): &v1beta1.PipelineRun{}, v1beta1.SchemeGroupVersion.WithKind("CustomRun"): &v1beta1.CustomRun{}, - v1beta1.SchemeGroupVersion.WithKind("StepAction"): &v1beta1.StepAction{}, // v1 v1.SchemeGroupVersion.WithKind("Task"): &v1.Task{}, v1.SchemeGroupVersion.WithKind("Pipeline"): &v1.Pipeline{}, @@ -154,7 +153,6 @@ func newConfigValidationController(name string) func(context.Context, configmap. func newConversionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl { var ( - v1alpha1GroupVersion = v1alpha1.SchemeGroupVersion.Version v1beta1GroupVersion = v1beta1.SchemeGroupVersion.Version v1GroupVersion = v1.SchemeGroupVersion.Version resolutionv1alpha1GroupVersion = resolutionv1alpha1.SchemeGroupVersion.Version @@ -172,14 +170,6 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro // conversions to and from all types. // "Zygotes" are the supported versions. map[schema.GroupKind]conversion.GroupKindConversion{ - v1beta1.Kind("StepAction"): { - DefinitionName: pipeline.StepActionResource.String(), - HubVersion: v1alpha1GroupVersion, - Zygotes: map[string]conversion.ConvertibleObject{ - v1alpha1GroupVersion: &v1alpha1.StepAction{}, - v1beta1GroupVersion: &v1beta1.StepAction{}, - }, - }, v1.Kind("Task"): { DefinitionName: pipeline.TaskResource.String(), HubVersion: v1beta1GroupVersion, diff --git a/upstream/config/300-crds/300-stepaction.yaml b/upstream/config/300-crds/300-stepaction.yaml index 5f91f9629b3..a27eaf20179 100644 --- a/upstream/config/300-crds/300-stepaction.yaml +++ b/upstream/config/300-crds/300-stepaction.yaml @@ -26,24 +26,6 @@ spec: preserveUnknownFields: false versions: - name: v1alpha1 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - # One can use x-kubernetes-preserve-unknown-fields: true - # at the root of the schema (and inside any properties, additionalProperties) - # to get the traditional CRD behaviour that nothing is pruned, despite - # setting spec.preserveUnknownProperties: false. - # - # See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/ - # See issue: https://github.com/knative/serving/issues/912 - x-kubernetes-preserve-unknown-fields: true - # Opt into the status subresource so metadata.generation - # starts to increment - subresources: - status: {} - - name: v1beta1 served: true storage: true schema: diff --git a/upstream/config/config-feature-flags.yaml b/upstream/config/config-feature-flags.yaml index 398f37d1880..bea6994cc99 100644 --- a/upstream/config/config-feature-flags.yaml +++ b/upstream/config/config-feature-flags.yaml @@ -107,7 +107,8 @@ data: enforce-nonfalsifiability: "none" # Setting this flag will determine how Tekton pipelines will handle extracting results from the task. # Acceptable values are "termination-message" or "sidecar-logs". - # "sidecar-logs" is now a beta feature. + # "sidecar-logs" is an experimental feature and thus should still be considered + # an alpha feature. results-from: "termination-message" # Setting this flag will determine the upper limit of each task result # This flag is optional and only associated with the previous flag, results-from @@ -136,7 +137,3 @@ data: # "pipelinerun" for Pipelinerun and "taskrun" for Taskrun. Or a combination of # these. disable-inline-spec: "" - # Setting this flag to "true" will enable the use of concise resolver syntax - enable-concise-resolver-syntax: "false" - # Setthing this flag to "true" will enable native Kubernetes Sidecar support - enable-kubernetes-sidecar: "false" diff --git a/upstream/config/config-observability.yaml b/upstream/config/config-observability.yaml index facda374d83..f1f800beb06 100644 --- a/upstream/config/config-observability.yaml +++ b/upstream/config/config-observability.yaml @@ -59,4 +59,3 @@ data: metrics.pipelinerun.level: "pipeline" metrics.pipelinerun.duration-type: "histogram" metrics.count.enable-reason: "false" - metrics.running-pipelinerun.level: "" diff --git a/upstream/config/controller.yaml b/upstream/config/controller.yaml index 4e70e1c4a53..dad4866396b 100644 --- a/upstream/config/controller.yaml +++ b/upstream/config/controller.yaml @@ -112,7 +112,6 @@ spec: value: tekton.dev/pipeline securityContext: allowPrivilegeEscalation: false - readOnlyRootFilesystem: true capabilities: drop: - "ALL" diff --git a/upstream/config/events.yaml b/upstream/config/events.yaml index 03914c8a346..088c0e28c15 100644 --- a/upstream/config/events.yaml +++ b/upstream/config/events.yaml @@ -90,7 +90,6 @@ spec: value: /etc/ssl/certs securityContext: allowPrivilegeEscalation: false - readOnlyRootFilesystem: true capabilities: drop: - "ALL" diff --git a/upstream/config/resolvers/200-clusterrole.yaml b/upstream/config/resolvers/200-clusterrole.yaml index 4364334095d..3215d74b145 100644 --- a/upstream/config/resolvers/200-clusterrole.yaml +++ b/upstream/config/resolvers/200-clusterrole.yaml @@ -26,9 +26,9 @@ rules: resources: ["resolutionrequests", "resolutionrequests/status"] verbs: ["get", "list", "watch", "update", "patch"] - apiGroups: ["tekton.dev"] - resources: ["tasks", "pipelines", "stepactions"] + resources: ["tasks", "pipelines"] verbs: ["get", "list"] # Read-only access to these. - apiGroups: [""] - resources: ["secrets", "serviceaccounts"] + resources: ["secrets"] verbs: ["get", "list", "watch"] diff --git a/upstream/config/resolvers/bundleresolver-config.yaml b/upstream/config/resolvers/bundleresolver-config.yaml index d48372ddd11..62e53fec96a 100644 --- a/upstream/config/resolvers/bundleresolver-config.yaml +++ b/upstream/config/resolvers/bundleresolver-config.yaml @@ -22,7 +22,5 @@ metadata: app.kubernetes.io/instance: default app.kubernetes.io/part-of: tekton-pipelines data: - # the default service account name to use for bundle requests. - default-service-account: "default" # The default layer kind in the bundle image. default-kind: "task" diff --git a/upstream/config/webhook.yaml b/upstream/config/webhook.yaml index e80a5bc93df..41922fa1c1b 100644 --- a/upstream/config/webhook.yaml +++ b/upstream/config/webhook.yaml @@ -126,7 +126,6 @@ spec: value: tekton.dev/pipeline securityContext: allowPrivilegeEscalation: false - readOnlyRootFilesystem: true capabilities: drop: - "ALL" diff --git a/upstream/docs/additional-configs.md b/upstream/docs/additional-configs.md index 6b307bbd151..be60c6c3b2d 100644 --- a/upstream/docs/additional-configs.md +++ b/upstream/docs/additional-configs.md @@ -237,7 +237,7 @@ The example below customizes the following: - the default service account from `default` to `tekton`. - the default timeout from 60 minutes to 20 minutes. - the default `app.kubernetes.io/managed-by` label is applied to all Pods created to execute `TaskRuns`. -- the default Pod template to include a node selector to select the node where the Pod will be scheduled by default. A list of supported fields is available [here](./podtemplates.md#supported-fields). +- the default Pod template to include a node selector to select the node where the Pod will be scheduled by default. A list of supported fields is available [here](https://github.com/tektoncd/pipeline/blob/main/docs/podtemplates.md#supported-fields). For more information, see [`PodTemplate` in `TaskRuns`](./taskruns.md#specifying-a-pod-template) or [`PodTemplate` in `PipelineRuns`](./pipelineruns.md#specifying-a-pod-template). - the default `Workspace` configuration can be set for any `Workspaces` that a Task declares but that a TaskRun does not explicitly provide. - the default maximum combinations of `Parameters` in a `Matrix` that can be used to fan out a `PipelineTask`. For @@ -333,8 +333,6 @@ enables [beta features](#beta-features). When using v1 APIs, setting this field allows only stable features, and setting it to "beta" allows only beta features. Set this field to "alpha" to allow [alpha features](#alpha-features) to be used. -- `enable-kubernetes-sidecar`: Set this flag to `"true"` to enable native kubernetes sidecar support. This will allow Tekton sidecars to run as Kubernetes sidecars. Must be using Kubernetes v1.29 or greater. - For example: ```yaml @@ -377,13 +375,17 @@ Features currently in "alpha" are: | [Hermetic Execution Mode](./hermetic.md) | [TEP-0025](https://github.com/tektoncd/community/blob/main/teps/0025-hermekton.md) | [v0.25.0](https://github.com/tektoncd/pipeline/releases/tag/v0.25.0) | | | [Windows Scripts](./tasks.md#windows-scripts) | [TEP-0057](https://github.com/tektoncd/community/blob/main/teps/0057-windows-support.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | | | [Debug](./debug.md) | [TEP-0042](https://github.com/tektoncd/community/blob/main/teps/0042-taskrun-breakpoint-on-failure.md) | [v0.26.0](https://github.com/tektoncd/pipeline/releases/tag/v0.26.0) | | +| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | | [StdoutConfig and StderrConfig](./tasks#redirecting-step-output-streams-with-stdoutConfig-and-stderrConfig) | [TEP-0011](https://github.com/tektoncd/community/blob/main/teps/0011-redirecting-step-output-streams.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | | | [Trusted Resources](./trusted-resources.md) | [TEP-0091](https://github.com/tektoncd/community/blob/main/teps/0091-trusted-resources.md) | [v0.49.0](https://github.com/tektoncd/pipeline/releases/tag/v0.49.0) | `trusted-resources-verification-no-match-policy` | +| [Larger Results via Sidecar Logs](#enabling-larger-results-using-sidecar-logs) | [TEP-0127](https://github.com/tektoncd/community/blob/main/teps/0127-larger-results-via-sidecar-logs.md) | [v0.43.0](https://github.com/tektoncd/pipeline/releases/tag/v0.43.0) | `results-from` | | [Configure Default Resolver](./resolution.md#configuring-built-in-resolvers) | [TEP-0133](https://github.com/tektoncd/community/blob/main/teps/0133-configure-default-resolver.md) | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | | | [Coschedule](./affinityassistants.md) | [TEP-0135](https://github.com/tektoncd/community/blob/main/teps/0135-coscheduling-pipelinerun-pods.md) | [v0.51.0](https://github.com/tektoncd/pipeline/releases/tag/v0.51.0) | `coschedule` | | [keep pod on cancel](./taskruns.md#cancelling-a-taskrun) | N/A | [v0.52.0](https://github.com/tektoncd/pipeline/releases/tag/v0.52.0) | `keep-pod-on-cancel` | | [CEL in WhenExpression](./pipelines.md#use-cel-expression-in-whenexpression) | [TEP-0145](https://github.com/tektoncd/community/blob/main/teps/0145-cel-in-whenexpression.md) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | `enable-cel-in-whenexpression` | | [Param Enum](./taskruns.md#parameter-enums) | [TEP-0144](https://github.com/tektoncd/community/blob/main/teps/0144-param-enum.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-param-enum` | +| [Reusable Steps via StepActions](./stepactions.md) | [TEP-0142](https://github.com/tektoncd/community/blob/main/teps/0142-enable-step-reusability.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-step-actions` | +| [Ignore Task Failure](./pipelines.md#using-the-onerror-field) | [TEP-0050](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) | N/A | | ### Beta Features @@ -401,10 +403,6 @@ Features currently in "beta" are: | [Isolated `Step` & `Sidecar` `Workspaces`](./workspaces.md#isolated-workspaces) | [TEP-0029](https://github.com/tektoncd/community/blob/main/teps/0029-step-workspaces.md) | [v0.24.0](https://github.com/tektoncd/pipeline/releases/tag/v0.24.0) | [v0.50.0](https://github.com/tektoncd/pipeline/releases/tag/v0.50.0) | | | [Matrix](./matrix.md) | [TEP-0090](https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | | | [Task-level Resource Requirements](compute-resources.md#task-level-compute-resources-configuration) | [TEP-0104](https://github.com/tektoncd/community/blob/main/teps/0104-tasklevel-resource-requirements.md) | [v0.39.0](https://github.com/tektoncd/pipeline/releases/tag/v0.39.0) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | | -| [Reusable Steps via StepActions](./stepactions.md) | [TEP-0142](https://github.com/tektoncd/community/blob/main/teps/0142-enable-step-reusability.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-step-actions` | -| [Larger Results via Sidecar Logs](#enabling-larger-results-using-sidecar-logs) | [TEP-0127](https://github.com/tektoncd/community/blob/main/teps/0127-larger-results-via-sidecar-logs.md) | [v0.43.0](https://github.com/tektoncd/pipeline/releases/tag/v0.43.0) | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | `results-from` | -| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | | -| [Ignore Task Failure](./pipelines.md#using-the-onerror-field) | [TEP-0050](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) | [v0.55.0](https://github.com/tektoncd/pipeline/releases/tag/v0.55.0) | [v0.62.0](https://github.com/tektoncd/pipeline/releases/tag/v0.62.0) | N/A | ## Enabling larger results using sidecar logs @@ -461,8 +459,7 @@ Out-of-the-box, Tekton Pipelines Controller is configured for relatively small-s To allow TaskRuns and PipelineRuns to run in namespaces with [restricted pod security standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/), set the "set-security-context" feature flag to "true" in the [feature-flags configMap](#customizing-the-pipelines-controller-behavior). This configuration option applies a [SecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) -to any containers injected into TaskRuns by the Pipelines controller. If the [Affinity Assistants](affinityassistants.md) feature is enabled, the SecurityContext is also applied to those containers. -This SecurityContext may not be supported in all Kubernetes implementations (for example, OpenShift). +to any containers injected into TaskRuns by the Pipelines controller. This SecurityContext may not be supported in all Kubernetes implementations (for example, OpenShift). **Note**: running TaskRuns and PipelineRuns in the "tekton-pipelines" namespace is discouraged. diff --git a/upstream/docs/artifacts.md b/upstream/docs/artifacts.md index 8f5533f68c6..233dec1c53a 100644 --- a/upstream/docs/artifacts.md +++ b/upstream/docs/artifacts.md @@ -8,9 +8,8 @@ weight: 201 # Artifacts - [Overview](#overview) -- [Artifact Provenance Data](#artifact-provenance-data) +- [Artifact Provenance Data](#passing-artifacts-between-steps) - [Passing Artifacts between Steps](#passing-artifacts-between-steps) - - [Passing Artifacts between Tasks](#passing-artifacts-between-tasks) @@ -25,7 +24,6 @@ Artifacts fall into two categories: - Inputs: Artifacts downloaded and used by the Step/Task. - Outputs: Artifacts created and uploaded by the Step/Task. - Example Structure: ```json { @@ -106,108 +104,13 @@ spec: EOF ``` -The content is written by the `Step` to a file `$(artifacts.path)`: - -```yaml -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: step-artifacts- -spec: - taskSpec: - description: | - A simple task that populates artifacts to TaskRun stepState - steps: - - name: artifacts-producer - image: bash:latest - script: | - cat > $(artifacts.path) << EOF - { - "inputs":[ - { - "name":"source", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:oci/nginx:stable-alpine3.17-slim?repository_url=docker.io/library", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF -``` - It is recommended to use [purl format](https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst) for artifacts uri as shown in the example. -### Output Artifacts in SLSA Provenance - -Artifacts are classified as either: - -- Build Outputs - packages, images, etc. that are being published by the build. -- Build Byproducts - logs, caches, etc. that are incidental artifacts that are produced by the build. - -By default, Tekton Chains will consider all output artifacts as `byProducts` when generating in the [SLSA provenance](https://slsa.dev/spec/v1.0/provenance). In order to treat an artifact as a [subject](https://slsa.dev/spec/v1.0/provenance#schema) of the build, you must set a boolean field `"buildOutput": true` for the output artifact. - -e.g. -```yaml -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: step-artifacts- -spec: - taskSpec: - description: | - A simple task that populates artifacts to TaskRun stepState - steps: - - name: artifacts-producer - image: bash:latest - script: | - cat > $(artifacts.path) << EOF - { - "outputs":[ - { - "name":"image", - "buildOutput": true, - "values":[ - { - "uri":"pkg:oci/nginx:stable-alpine3.17-slim?repository_url=docker.io/library", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF -``` - -This informs Tekton Chains your desire to handle the artifact. - -> [!TIP] -> When authoring a `StepAction` or a `Task`, you can parametrize this field to allow users to indicate their desire depending on what they are uploading - this can be useful for actions that may produce either a build output or a byproduct depending on the context! - ### Passing Artifacts between Steps You can pass artifacts from one step to the next using: + - Specific Artifact: `$(steps..inputs.)` or `$(steps..outputs.)` +- Default (First) Artifact: `$(steps..inputs)` or `$(steps..outputs)` (if is omitted) The example below shows how to access the previous' step artifacts from another step in the same task @@ -259,12 +162,12 @@ spec: - name: artifacts-consumer image: bash:latest script: | - echo $(steps.artifacts-producer.outputs.image) + echo $(steps.artifacts-producer.outputs) ``` -The resolved value of `$(steps..outputs.)` is the values of an artifact. For this example, -`$(steps.artifacts-producer.outputs.image)` is resolved to +The resolved value of `$(steps..outputs.)` or `$(steps..outputs)` is the values of an artifact. For this example, +`$(steps.artifacts-producer.outputs)` is resolved to ```json [ { @@ -279,278 +182,62 @@ The resolved value of `$(steps..outputs.)` is Upon resolution and execution of the `TaskRun`, the `Status` will look something like: - -```json -{ - "artifacts": { - "inputs": [ +```yaml +"steps": [ { - "name": "source", - "values": [ + "container": "step-artifacts-producer", + "imageID": "docker.io/library/bash@sha256:5353512b79d2963e92a2b97d9cb52df72d32f94661aa825fcfa0aede73304743", + "inputs": [ { - "digest": { - "sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - }, - "uri": "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c" + "name": "source", + "values": [ + { + "digest": { + "sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" + }, + "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", + } + ] } - ] - } - ], - "outputs": [ - { - "name": "image", - "values": [ + ], + "name": "artifacts-producer", + "outputs": [ { - "digest": { - "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", - "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48" - }, - "uri": "pkg:oci/nginx:stable-alpine3.17-slim?repository_url=docker.io/library" + "name": "image", + "values": [ + { + "digest": { + "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", + "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48" + }, + "uri":"pkg:oci/nginx:stable-alpine3.17-slim?repository_url=docker.io/library", + } + ] } - ] - } - ] - }, - "steps": [ - { - "container": "step-artifacts-producer", - "imageID": "docker.io/library/bash@sha256:5353512b79d2963e92a2b97d9cb52df72d32f94661aa825fcfa0aede73304743", - "inputs": [ - { - "name": "source", - "values": [ - { - "digest": { - "sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - }, - "uri": "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c" - } - ] - } - ], - "name": "artifacts-producer", - "outputs": [ - { - "name": "image", - "values": [ - { - "digest": { - "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", - "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48" - }, - "uri": "pkg:oci/nginx:stable-alpine3.17-slim?repository_url=docker.io/library" - } - ] - } - ], - "terminated": { - "containerID": "containerd://010f02d103d1db48531327a1fe09797c87c1d50b6a216892319b3af93e0f56e7", - "exitCode": 0, - "finishedAt": "2024-03-18T17:05:06Z", - "message": "...", - "reason": "Completed", - "startedAt": "2024-03-18T17:05:06Z" - }, - "terminationReason": "Completed" - }, - { - "container": "step-artifacts-consumer", - "imageID": "docker.io/library/bash@sha256:5353512b79d2963e92a2b97d9cb52df72d32f94661aa825fcfa0aede73304743", - "name": "artifacts-consumer", - "terminated": { - "containerID": "containerd://42428aa7e5a507eba924239f213d185dd4bc0882b6f217a79e6792f7fec3586e", - "exitCode": 0, - "finishedAt": "2024-03-18T17:05:06Z", - "reason": "Completed", - "startedAt": "2024-03-18T17:05:06Z" + ], + "terminated": { + "containerID": "containerd://010f02d103d1db48531327a1fe09797c87c1d50b6a216892319b3af93e0f56e7", + "exitCode": 0, + "finishedAt": "2024-03-18T17:05:06Z", + "message": "...", + "reason": "Completed", + "startedAt": "2024-03-18T17:05:06Z" + }, + "terminationReason": "Completed" }, - "terminationReason": "Completed" - } - ] -} - -``` - -### Passing Artifacts between Tasks -You can pass artifacts from one task to the another using: - -- Specific Artifact: `$(tasks..inputs.)` or `$(tasks..outputs.)` - -The example below shows how to access the previous' task artifacts from another task in a pipeline - -```yaml -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - generateName: pipelinerun-consume-tasks-artifacts -spec: - pipelineSpec: - tasks: - - name: produce-artifacts-task - taskSpec: - description: | - A simple task that produces artifacts - steps: - - name: produce-artifacts - image: bash:latest - script: | - #!/usr/bin/env bash - cat > $(artifacts.path) << EOF - { - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF - - name: consume-artifacts - runAfter: - - produce-artifacts-task - taskSpec: - steps: - - name: artifacts-consumer-python - image: python:latest - script: | - #!/usr/bin/env python3 - import json - data = json.loads('$(tasks.produce-artifacts-task.outputs.image)') - if data[0]['uri'] != "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c": - exit(1) -``` - - -Similar to Step Artifacts. The resolved value of `$(tasks..outputs.)` is the values of an artifact. For this example, -`$(tasks.produce-artifacts-task.outputs.image)` is resolved to -```json -[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } -] -``` -Upon resolution and execution of the `TaskRun`, the `Status` will look something like: -```json -{ - "artifacts": { - "inputs": [ - { - "name": "input-artifacts", - "values": [ - { - "digest": { - "sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - }, - "uri": "pkg:example.github.com/inputs" - } - ] - } - ], - "outputs": [ - { - "name": "image", - "values": [ - { - "digest": { - "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", - "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48" - }, - "uri": "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c" - } - ] - } - ] - }, - "completionTime": "2024-05-28T14:10:58Z", - "conditions": [ { - "lastTransitionTime": "2024-05-28T14:10:58Z", - "message": "All Steps have completed executing", - "reason": "Succeeded", - "status": "True", - "type": "Succeeded" - } - ], - "podName": "pipelinerun-consume-tasks-a41ee44e4f964e95adfd3aea417d52f90-pod", - "provenance": { - "featureFlags": { - "AwaitSidecarReadiness": true, - "Coschedule": "workspaces", - "DisableAffinityAssistant": false, - "DisableCredsInit": false, - "DisableInlineSpec": "", - "EnableAPIFields": "beta", - "EnableArtifacts": true, - "EnableCELInWhenExpression": false, - "EnableConciseResolverSyntax": false, - "EnableKeepPodOnCancel": false, - "EnableParamEnum": false, - "EnableProvenanceInStatus": true, - "EnableStepActions": true, - "EnableTektonOCIBundles": false, - "EnforceNonfalsifiability": "none", - "MaxResultSize": 4096, - "RequireGitSSHSecretKnownHosts": false, - "ResultExtractionMethod": "termination-message", - "RunningInEnvWithInjectedSidecars": true, - "ScopeWhenExpressionsToTask": false, - "SendCloudEventsForRuns": false, - "SetSecurityContext": false, - "VerificationNoMatchPolicy": "ignore" - } - }, - "startTime": "2024-05-28T14:10:48Z", - "steps": [ - { - "container": "step-produce-artifacts", - "imageID": "docker.io/library/bash@sha256:23f90212fd89e4c292d7b41386ef1a6ac2b8a02bbc6947680bfe184cbc1a2899", - "name": "produce-artifacts", + "container": "step-artifacts-consumer", + "imageID": "docker.io/library/bash@sha256:5353512b79d2963e92a2b97d9cb52df72d32f94661aa825fcfa0aede73304743", + "name": "artifacts-consumer", "terminated": { - "containerID": "containerd://1291ce07b175a7897beee6ba62eaa1528427bacb1f76b31435eeba68828c445a", + "containerID": "containerd://42428aa7e5a507eba924239f213d185dd4bc0882b6f217a79e6792f7fec3586e", "exitCode": 0, - "finishedAt": "2024-05-28T14:10:57Z", - "message": "...", + "finishedAt": "2024-03-18T17:05:06Z", "reason": "Completed", - "startedAt": "2024-05-28T14:10:57Z" + "startedAt": "2024-03-18T17:05:06Z" }, "terminationReason": "Completed" } ], - "taskSpec": { - "description": "A simple task that produces artifacts\n", - "steps": [ - { - "computeResources": {}, - "image": "bash:latest", - "name": "produce-artifacts", - "script": "#!/usr/bin/env bash\ncat > /tekton/artifacts/provenance.json << EOF\n{\n \"inputs\":[\n {\n \"name\":\"input-artifacts\",\n \"values\":[\n {\n \"uri\":\"pkg:example.github.com/inputs\",\n \"digest\":{\n \"sha256\":\"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0\"\n }\n }\n ]\n }\n ],\n \"outputs\":[\n {\n \"name\":\"image\",\n \"values\":[\n {\n \"uri\":\"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c\",\n \"digest\":{\n \"sha256\":\"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48\",\n \"sha1\":\"95588b8f34c31eb7d62c92aaa4e6506639b06ef2\"\n }\n }\n ]\n }\n ]\n}\nEOF\n" - } - ] - } -} -``` + +``` \ No newline at end of file diff --git a/upstream/docs/cluster-resolver.md b/upstream/docs/cluster-resolver.md index 1a43f579449..fc545420ce8 100644 --- a/upstream/docs/cluster-resolver.md +++ b/upstream/docs/cluster-resolver.md @@ -13,11 +13,11 @@ This Resolver responds to type `cluster`. ## Parameters -| Param Name | Description | Example Value | -|-------------|-------------------------------------------------------|----------------------------------| -| `kind` | The kind of resource to fetch. | `task`, `pipeline`, `stepaction` | -| `name` | The name of the resource to fetch. | `some-pipeline`, `some-task` | -| `namespace` | The namespace in the cluster containing the resource. | `default`, `other-namespace` | +| Param Name | Description | Example Value | +|-------------|-------------------------------------------------------|------------------------------| +| `kind` | The kind of resource to fetch. | `task`, `pipeline` | +| `name` | The name of the resource to fetch. | `some-pipeline`, `some-task` | +| `namespace` | The namespace in the cluster containing the resource. | `default`, `other-namespace` | ## Requirements @@ -37,7 +37,7 @@ for the name, namespace and defaults that the resolver ships with. | Option Name | Description | Example Values | |----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| -| `default-kind` | The default resource kind to fetch if not specified in parameters. | `task`, `pipeline`, `stepaction` | +| `default-kind` | The default resource kind to fetch if not specified in parameters. | `task`, `pipeline` | | `default-namespace` | The default namespace to fetch resources from if not specified in parameters. | `default`, `some-namespace` | | `allowed-namespaces` | An optional comma-separated list of namespaces which the resolver is allowed to access. Defaults to empty, meaning all namespaces are allowed. | `default,some-namespace`, (empty) | | `blocked-namespaces` | An optional comma-separated list of namespaces which the resolver is blocked from accessing. If the value is a `*` all namespaces will be disallowed and allowed namespace will need to be explicitely listed in `allowed-namespaces`. Defaults to empty, meaning all namespaces are allowed. | `default,other-namespace`, `*`, (empty) | @@ -63,27 +63,6 @@ spec: value: namespace-containing-task ``` -### StepAction Resolution - -```yaml -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: remote-stepaction-reference -spec: - steps: - - name: step-action-example - ref - resolver: cluster - params: - - name: kind - value: stepaction - - name: name - value: some-stepaction - - name: namespace - value: namespace-containing-stepaction -``` - ### Pipeline resolution ```yaml diff --git a/upstream/docs/debug.md b/upstream/docs/debug.md index dae54e86bd7..ff3d62a9ff4 100644 --- a/upstream/docs/debug.md +++ b/upstream/docs/debug.md @@ -13,8 +13,7 @@ weight: 108 - [Breakpoint on Failure](#breakpoint-on-failure) - [Failure of a Step](#failure-of-a-step) - [Halting a Step on failure](#halting-a-step-on-failure) - - [Exiting onfailure breakpoint](#exiting-onfailure-breakpoint) - - [Breakpoint before step](#breakpoint-before-step) + - [Exiting breakpoint](#exiting-breakpoint) - [Debug Environment](#debug-environment) - [Mounts](#mounts) - [Debug Scripts](#debug-scripts) @@ -60,26 +59,12 @@ stopping write of the `.err` file and waiting on a signal by the user t In this breakpoint, which is essentially a limbo state the TaskRun finds itself in, the user can interact with the step environment using a CLI or an IDE. -#### Exiting onfailure breakpoint +#### Exiting breakpoint To exit a step which has been paused upon failure, the step would wait on a file similar to `.breakpointexit` which would unpause and exit the step container. eg: Step 0 fails and is paused. Writing `0.breakpointexit` in `/tekton/run` would unpause and exit the step container. -### Breakpoint before step - - -TaskRun will be stuck waiting for user debugging before the step execution. -When beforeStep-Breakpoint takes effect, the user can see the following information -from the corresponding step container log: -``` -debug before step breakpoint has taken effect, waiting for user's decision: -1) continue, use cmd: /tekton/debug/scripts/debug-beforestep-continue -2) fail-continue, use cmd: /tekton/debug/scripts/debug-beforestep-fail-continue -``` -1. Executing /tekton/debug/scripts/debug-beforestep-continue will continue to execute the step program -2. Executing /tekton/debug/scripts/debug-beforestep-fail-continue will not continue to execute the task, and will mark the step as failed - ## Debug Environment Additional environment augmentations made available to the TaskRun Pod to aid in troubleshooting and managing step lifecycle. @@ -95,13 +80,7 @@ to reflect step number. eg: Step 0 will have `/tekton/debug/info/0`, Step 1 will ### Debug Scripts `/tekton/debug/scripts/debug-continue` : Mark the step as completed with success by writing to `/tekton/run`. eg: User wants to exit -onfailure breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.breakpointexit`. +breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0.breakpointexit`. `/tekton/debug/scripts/debug-fail-continue` : Mark the step as completed with failure by writing to `/tekton/run`. eg: User wants to exit -onfailure breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.breakpointexit.err`. - -`/tekton/debug/scripts/debug-beforestep-continue` : Mark the step continue to execute by writing to `/tekton/run`. eg: User wants to exit -before step breakpoint for before step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.beforestepexit`. - -`/tekton/debug/scripts/debug-beforestep-fail-continue` : Mark the step not continue to execute by writing to `/tekton/run`. eg: User wants to exit -before step breakpoint for before step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.beforestepexit.err`. +breakpoint for failed step 0. Running this script would create `/tekton/run/0.err` and `/tekton/run/0.breakpointexit`. diff --git a/upstream/docs/deprecations.md b/upstream/docs/deprecations.md index 2421432ee42..8f51ee1ac46 100644 --- a/upstream/docs/deprecations.md +++ b/upstream/docs/deprecations.md @@ -23,11 +23,11 @@ The following features are deprecated but have not yet been removed. |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------| | [Several fields of Task.Step are deprecated](https://github.com/tektoncd/pipeline/issues/4737) | v0.36.0 | Beta | Feb 25, 2023 | | [ClusterTask is deprecated](https://github.com/tektoncd/pipeline/issues/4476) | v0.41.0 | Beta | July 13, 2023 | +| [`pipelineRef.bundle` and `taskRef.bundle` are deprecated](https://github.com/tektoncd/pipeline/issues/5514) | v0.41.0 | Alpha | July 13, 2023 | | [The `config-trusted-resources` configMap is deprecated](https://github.com/tektoncd/pipeline/issues/5852) | v0.45.0 | Alpha | v0.46.0 | | [The `default-cloud-events-sink` setting in the `config-defaults` configMap is deprecated](https://github.com/tektoncd/pipeline/pull/6883) in favour of the new `config-events` configMap. | v0.50.0 | N/A | v0.59.0 | | [v1beta1 Tasks, TaskRuns, Pipelines, and PipelineRuns are deprecated in favor of v1](https://github.com/tektoncd/pipeline/issues/5541) | v0.50.0 | Beta | v0.62.0 | | [The `disable-affinity-assistant` feature flag is deprecated in favor of the `coschedule` feature flag](https://github.com/tektoncd/pipeline/issues/6988) | v0.51.0 | N/A | April 27, 2024 | -| The `resolver framework` is [deprecated](https://github.com/tektoncd/pipeline/pull/7945) in favor of an [upgraded framework](https://github.com/tektoncd/pipeline/pull/7910) | v0.60.0 | N/A | v0.72. | ### v1beta1 deprecation @@ -66,4 +66,4 @@ See [TEP-0074](https://github.com/tektoncd/community/blob/main/teps/0074-depreca - The generic pipelineResources functions including inputs and outputs resources and the `from` type -- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325) +- [TaskRun.Status.ResourcesResult is deprecated and tombstoned #6301](https://github.com/tektoncd/pipeline/issues/6325) \ No newline at end of file diff --git a/upstream/docs/developers/taskruns.md b/upstream/docs/developers/taskruns.md index 5b35692bde8..1b702433233 100644 --- a/upstream/docs/developers/taskruns.md +++ b/upstream/docs/developers/taskruns.md @@ -284,54 +284,4 @@ There are known issues with the existing implementation of sidecars: but an Error when the sidecar exits with an error. This is only apparent when using `kubectl` to get the pods of a TaskRun, not when describing the Pod using `kubectl describe pod ...` nor when looking at the TaskRun, but can be - quite confusing. - -## Breakpoint on Failure - -Halting a TaskRun execution on Failure of a step. - -### Failure of a Step - -The entrypoint binary is used to manage the lifecycle of a step. Steps are aligned beforehand by the TaskRun controller -allowing each step to run in a particular order. This is done using `-wait_file` and the `-post_file` flags. The former -let's the entrypoint binary know that it has to wait on creation of a particular file before starting execution of the step. -And the latter provides information on the step number and signal the next step on completion of the step. - -On success of a step, the `-post-file` is written as is, signalling the next step which would have the same argument given -for `-wait_file` to resume the entrypoint process and move ahead with the step. - -On failure of a step, the `-post_file` is written with appending `.err` to it denoting that the previous step has failed with -and error. The subsequent steps are skipped in this case as well, marking the TaskRun as a failure. - -### Halting a Step on failure - -The failed step writes `.err` to `/tekton/run` and stops running completely. To be able to debug a step we would -need it to continue running (not exit), not skip the next steps and signal health of the step. By disabling step skipping, -stopping write of the `.err` file and waiting on a signal by the user to disable the halt, we would be simulating a -"breakpoint". - -In this breakpoint, which is essentially a limbo state the TaskRun finds itself in, the user can interact with the step -environment using a CLI or an IDE. - -### Exiting onfailure breakpoint - -To exit a step which has been paused upon failure, the step would wait on a file similar to `.breakpointexit` which -would unpause and exit the step container. eg: Step 0 fails and is paused. Writing `0.breakpointexit` in `/tekton/run` -would unpause and exit the step container. - -## Breakpoint before step - -TaskRun will be stuck waiting for user debugging before the step execution. - -### Halting a Step before execution - -The step program will be executed after all the `-wait_file` monitoring ends. If want the user to enter the debugging before the step is executed, -need to pass a parameter `debug_before_step` to `entrypoint`, -and `entrypoint` will end the monitoring of `waitFiles` back pause, -waiting to listen to the `/tekton/run/0/out.beforestepexit` file - -### Exiting before step breakpoint - -`entrypoint` listening `/tekton/run/{{ stepID }}/out.beforestepexit` or `/tekton/run/{{ stepID }}/out.beforestepexit.err` to -decide whether to proceed this step, `out.beforestepexit` means continue with step, -`out.beforestepexit.err` means do not continue with the step. \ No newline at end of file + quite confusing. \ No newline at end of file diff --git a/upstream/docs/git-resolver.md b/upstream/docs/git-resolver.md index 826f9a9c0f9..7ec56fda7da 100644 --- a/upstream/docs/git-resolver.md +++ b/upstream/docs/git-resolver.md @@ -114,6 +114,10 @@ Note that not all `go-scm` implementations have been tested with the `git` resol * BitBucket Server * BitBucket Cloud +Fetching from multiple Git providers with different configuration is not +supported. You can use the [http resolver](./http-resolver.md) to fetch URL +from another provider with different credentials. + #### Task Resolution ```yaml @@ -191,118 +195,6 @@ spec: value: Ranni ``` -### Specifying Configuration for Multiple Git Providers - -It is possible to specify configurations for multiple providers and even multiple configurations for same provider to use in -different tekton resources. Firstly, details need to be added in configmap with the unique identifier key prefix. -To use them in tekton resources, pass the unique key mentioned in configmap as an extra param to resolver with key -`configKey` and value will be the unique key. If no `configKey` param is passed, `default` will be used. Default -configuration to be used for git resolver can be specified in configmap by either mentioning no unique identifier or -using identifier `default` - -**Note**: `configKey` should not contain `.` while specifying configurations in configmap - -### Example Configmap - -Multiple configurations can be specified in `git-resolver-config` configmap like this. All keys mentioned above are supported. - -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: git-resolver-config - namespace: tekton-pipelines-resolvers - labels: - app.kubernetes.io/component: resolvers - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: tekton-pipelines -data: - # configuration 1, default one to use if no configKey provided or provided with value default - fetch-timeout: "1m" - default-url: "https://github.com/tektoncd/catalog.git" - default-revision: "main" - scm-type: "github" - server-url: "" - api-token-secret-name: "" - api-token-secret-key: "" - api-token-secret-namespace: "default" - default-org: "" - - # configuration 2, will be used if configKey param passed with value test1 - test1.fetch-timeout: "5m" - test1.default-url: "" - test1.default-revision: "stable" - test1.scm-type: "github" - test1.server-url: "api.internal-github.com" - test1.api-token-secret-name: "test1-secret" - test1.api-token-secret-key: "token" - test1.api-token-secret-namespace: "test1" - test1.default-org: "tektoncd" - - # configuration 3, will be used if configKey param passed with value test2 - test2.fetch-timeout: "10m" - test2.default-url: "" - test2.default-revision: "stable" - test2.scm-type: "gitlab" - test2.server-url: "api.internal-gitlab.com" - test2.api-token-secret-name: "test2-secret" - test2.api-token-secret-key: "pat" - test2.api-token-secret-namespace: "test2" - test2.default-org: "tektoncd-infra" -``` - -#### Task Resolution - -A specific configurations from the configMap can be selected by passing the parameter `configKey` with the value -matching one of the configuration keys used in the configMap. - -```yaml -apiVersion: tekton.dev/v1beta1 -kind: TaskRun -metadata: - name: git-api-demo-tr -spec: - taskRef: - resolver: git - params: - - name: org - value: tektoncd - - name: repo - value: catalog - - name: revision - value: main - - name: pathInRepo - value: task/git-clone/0.6/git-clone.yaml - - name: configKey - value: test1 -``` - -#### Pipeline resolution - -```yaml -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - name: git-api-demo-pr -spec: - pipelineRef: - resolver: git - params: - - name: org - value: tektoncd - - name: repo - value: catalog - - name: revision - value: main - - name: pathInRepo - value: pipeline/simple/0.1/simple.yaml - - name: configKey - value: test2 - params: - - name: name - value: Ranni -``` - ## `ResolutionRequest` Status `ResolutionRequest.Status.RefSource` field captures the source where the remote resource came from. It includes the 3 subfields: `url`, `digest` and `entrypoint`. - `url` diff --git a/upstream/docs/how-to-write-a-resolver.md b/upstream/docs/how-to-write-a-resolver.md index c126d16b87e..0237fa11daf 100644 --- a/upstream/docs/how-to-write-a-resolver.md +++ b/upstream/docs/how-to-write-a-resolver.md @@ -54,7 +54,7 @@ You'll also need the following: - A computer with [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl) and [`ko`](https://github.com/google/ko) installed. -- A Kubernetes cluster running at least Kubernetes 1.28. A [`kind` +- A Kubernetes cluster running at least Kubernetes 1.27. A [`kind` cluster](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) should work fine for following the guide on your local machine. - An image registry that you can push images to. If you're using `kind` @@ -97,29 +97,6 @@ a little bit of boilerplate. Create `cmd/demoresolver/main.go` with the following setup code: -{{% tabs %}} - -{{% tab "Latest Framework" %}} -```go -package main - -import ( - "context" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "knative.dev/pkg/injection/sharedmain" -) - -func main() { - sharedmain.Main("controller", - framework.NewController(context.Background(), &resolver{}), - ) -} - -type resolver struct {} -``` -{{% /tab %}} - -{{% tab "Previous Framework (Deprecated)" %}} ```go package main @@ -138,10 +115,6 @@ func main() { type resolver struct {} ``` -{{% /tab %}} - -{{% /tabs %}} - This won't compile yet but you can download the dependencies by running: ```bash @@ -216,24 +189,6 @@ example resolver. We'll also need to add another import for this package at the top: -{{% tabs %}} - -{{% tab "Latest Framework" %}} -```go -import ( - "context" - - // Add this one; it defines LabelKeyResolverType we use in GetSelector - "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "knative.dev/pkg/injection/sharedmain" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" -) -``` -{{% /tab %}} - -{{% tab "Previous Framework (Deprecated)" %}} - ```go import ( "context" @@ -246,184 +201,40 @@ import ( ) ``` -{{% /tab %}} +## The `ValidateParams` method -{{% /tabs %}} - -## The `Validate` method - -The `Validate` method checks that the resolution-spec submitted as part of +The `ValidateParams` method checks that the params submitted as part of a resolution request are valid. Our example resolver doesn't expect -any params in the spec so we'll simply ensure that the there are no params. -Our example resolver also expects format for the `url` to be `demoscheme://` so we'll validate this format. -In the previous version, this was instead called `ValidateParams` method. See below -for the differences. - -{{% tabs %}} - -{{% tab "Latest Framework" %}} +any params so we'll simply ensure that the given map is empty. ```go -// Validate ensures that the resolution spec from a request is as expected. -func (r *resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return errors.New("no params allowed") - } - url := req.URL - u, err := neturl.ParseRequestURI(url) - if err != nil { - return err - } - if u.Scheme != "demoscheme" { - return fmt.Errorf("Invalid Scheme. Want %s, Got %s", "demoscheme", u.Scheme) - } - if u.Path == "" { - return errors.New("Empty path.") - } - return nil -} -``` - -You'll also need to add the `net/url` as `neturl` and `"errors"` package to your list of imports at -the top of the file. - -``` -{{% /tab %}} - -{{% tab "Previous Framework (Deprecated)" %}} - -```go -// ValidateParams ensures that the params from a request are as expected. -func (r *resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - if len(req.Params) > 0 { +// ValidateParams ensures parameters from a request are as expected. +func (r *resolver) ValidateParams(ctx context.Context, params map[string]string) error { + if len(params) > 0 { return errors.New("no params allowed") } return nil } ``` -{{% /tab %}} - -{{% /tabs %}} - You'll also need to add the `"errors"` package to your list of imports at the top of the file. ## The `Resolve` method We implement the `Resolve` method to do the heavy lifting of fetching -the contents of a file and returning them. It takes in the resolution request spec as input. -For this example we're just going to return a hard-coded string of YAML. Since Tekton Pipelines +the contents of a file and returning them. For this example we're just +going to return a hard-coded string of YAML. Since Tekton Pipelines currently only supports fetching Pipeline resources via remote resolution that's what we'll return. - The method signature we're implementing here has a `framework.ResolvedResource` interface as one of its return values. This is another type we have to implement but it has a small footprint: -{{% tabs %}} - -{{% tab "Latest Framework" %}} - - ```go -// Resolve uses the given resolution spec to resolve the requested file or resource. -func (r *resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (framework.ResolvedResource, error) { - return &myResolvedResource{}, nil -} - -// our hard-coded resolved file to return -const pipeline = ` -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: my-pipeline -spec: - tasks: - - name: hello-world - taskSpec: - steps: - - image: alpine:3.15.1 - script: | - echo "hello world" -` - -// myResolvedResource wraps the data we want to return to Pipelines -type myResolvedResource struct {} - -// Data returns the bytes of our hard-coded Pipeline -func (*myResolvedResource) Data() []byte { - return []byte(pipeline) -} - -// Annotations returns any metadata needed alongside the data. None atm. -func (*myResolvedResource) Annotations() map[string]string { - return nil -} - -// RefSource is the source reference of the remote data that records where the remote -// file came from including the url, digest and the entrypoint. None atm. -func (*myResolvedResource) RefSource() *pipelinev1.RefSource { - return nil -} -``` - -{{% /tab %}} - -{{% tab "Previous Framework (Deprecated)" %}} - - -```go -// Resolve uses the given resolution spec to resolve the requested file or resource. -func (r *resolver) Resolve(ctx context.Context, params []pipelinev1.Param) (framework.ResolvedResource, error) { - return &myResolvedResource{}, nil -} - -// our hard-coded resolved file to return -const pipeline = ` -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: my-pipeline -spec: - tasks: - - name: hello-world - taskSpec: - steps: - - image: alpine:3.15.1 - script: | - echo "hello world" -` - -// myResolvedResource wraps the data we want to return to Pipelines -type myResolvedResource struct {} - -// Data returns the bytes of our hard-coded Pipeline -func (*myResolvedResource) Data() []byte { - return []byte(pipeline) -} - -// Annotations returns any metadata needed alongside the data. None atm. -func (*myResolvedResource) Annotations() map[string]string { - return nil -} - -// RefSource is the source reference of the remote data that records where the remote -// file came from including the url, digest and the entrypoint. None atm. -func (*myResolvedResource) RefSource() *pipelinev1.RefSource { - return nil -} -``` - - -{{% /tab %}} - -{{% /tabs %}} - -```go -// Resolve uses the given resolution spec to resolve the requested file or resource. -func (r *resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (framework.ResolvedResource, error) { +// Resolve uses the given params to resolve the requested file or resource. +func (r *resolver) Resolve(ctx context.Context, params map[string]string) (framework.ResolvedResource, error) { return &myResolvedResource{}, nil } @@ -482,7 +293,6 @@ func (*myResolvedResource) RefSource() *pipelinev1.RefSource { } ``` - ## The deployment configuration Finally, our resolver needs some deployment configuration so that it can diff --git a/upstream/docs/install.md b/upstream/docs/install.md index 25fd35ff1d5..df0c6575888 100644 --- a/upstream/docs/install.md +++ b/upstream/docs/install.md @@ -21,7 +21,7 @@ This guide explains how to install Tekton Pipelines. ## Prerequisites -- A [Kubernetes cluster][k8s] running version 1.28 or later. +- A [Kubernetes cluster][k8s] running version 1.25 or later. - [Kubectl][]. - Grant `cluster-admin` privileges to the current user. See the [Kubernetes role-based access control (RBAC) docs][rbac] for more information. diff --git a/upstream/docs/matrix.md b/upstream/docs/matrix.md index 3da515c36a5..6db2baaf27b 100644 --- a/upstream/docs/matrix.md +++ b/upstream/docs/matrix.md @@ -1004,8 +1004,8 @@ status: ``` [cel]: https://github.com/tektoncd/experimental/tree/1609827ea81d05c8d00f8933c5c9d6150cd36989/cel -[pr-with-matrix]: https://github.com/tektoncd/pipeline/blob/main/examples/v1/pipelineruns/beta/pipelinerun-with-matrix.yaml -[pr-with-matrix-and-results]: https://github.com/tektoncd/pipeline/blob/main/examples/v1/pipelineruns/beta/pipelinerun-with-matrix-and-results.yaml -[pr-with-matrix-context-variables]: https://github.com/tektoncd/pipeline/blob/main/examples/v1/pipelineruns/beta/pipelinerun-with-matrix-context-variables.yaml -[pr-with-matrix-emitting-results]: https://github.com/tektoncd/pipeline/blob/main/examples/v1/pipelineruns/beta/pipelinerun-with-matrix-emitting-results.yaml +[pr-with-matrix]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix.yaml +[pr-with-matrix-and-results]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix-and-results.yaml +[pr-with-matrix-context-variables]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix-context-variables.yaml +[pr-with-matrix-emitting-results]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix-emitting-results.yaml [retries]: pipelines.md#using-the-retries-field diff --git a/upstream/docs/metrics.md b/upstream/docs/metrics.md index 2e0e826989e..3df1df461ce 100644 --- a/upstream/docs/metrics.md +++ b/upstream/docs/metrics.md @@ -11,24 +11,24 @@ The following pipeline metrics are available at `controller-service` on port `90 We expose several kinds of exporters, including Prometheus, Google Stackdriver, and many others. You can set them up using [observability configuration](../config/config-observability.yaml). -| Name | Type | Labels/Tags | Status | -|-----------------------------------------------------------------------------------------| ----------- |-------------------------------------------------| ----------- | +| Name | Type | Labels/Tags | Status | +|-----------------------------------------------------------------------------------------| ----------- | ----------- | ----------- | | `tekton_pipelines_controller_pipelinerun_duration_seconds_[bucket, sum, count]` | Histogram/LastValue(Gauge) | `*pipeline`=<pipeline_name>
`*pipelinerun`=<pipelinerun_name>
`status`=<status>
`namespace`=<pipelinerun-namespace> | experimental | -| `tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_[bucket, sum, count]` | Histogram/LastValue(Gauge) | `*pipeline`=<pipeline_name>
`*pipelinerun`=<pipelinerun_name>
`status`=<status>
`*task`=<task_name>
`*taskrun`=<taskrun_name>
`namespace`=<pipelineruns-taskruns-namespace>
`*reason`=<reason> | experimental | -| `tekton_pipelines_controller_pipelinerun_count` | Counter | `status`=<status>
`*reason`=<reason> | deprecate | -| `tekton_pipelines_controller_pipelinerun_total` | Counter | `status`=<status> | experimental | -| `tekton_pipelines_controller_running_pipelineruns_count` | Gauge | | deprecate | -| `tekton_pipelines_controller_running_pipelineruns` | Gauge | | experimental | -| `tekton_pipelines_controller_taskrun_duration_seconds_[bucket, sum, count]` | Histogram/LastValue(Gauge) | `status`=<status>
`*task`=<task_name>
`*taskrun`=<taskrun_name>
`namespace`=<pipelineruns-taskruns-namespace>
`*reason`=<reason> | experimental | -| `tekton_pipelines_controller_taskrun_count` | Counter | `status`=<status>
`*reason`=<reason> | deprecate | -| `tekton_pipelines_controller_taskrun_total` | Counter | `status`=<status> | experimental | -| `tekton_pipelines_controller_running_taskruns_count` | Gauge | | deprecate | -| `tekton_pipelines_controller_running_taskruns` | Gauge | | experimental | -| `tekton_pipelines_controller_running_taskruns_throttled_by_quota_count` | Gauge |
`namespace`=<pipelinerun-namespace> | deprecate | -| `tekton_pipelines_controller_running_taskruns_throttled_by_node_count` | Gauge |
`namespace`=<pipelinerun-namespace> | deprecate | -| `tekton_pipelines_controller_running_taskruns_throttled_by_quota` | Gauge |
`namespace`=<pipelinerun-namespace> | experimental | -| `tekton_pipelines_controller_running_taskruns_throttled_by_node` | Gauge |
`namespace`=<pipelinerun-namespace> | experimental | -| `tekton_pipelines_controller_client_latency_[bucket, sum, count]` | Histogram | | experimental | +| `tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_[bucket, sum, count]` | Histogram/LastValue(Gauge) | `*pipeline`=<pipeline_name>
`*pipelinerun`=<pipelinerun_name>
`status`=<status>
`*task`=<task_name>
`*taskrun`=<taskrun_name>
`namespace`=<pipelineruns-taskruns-namespace>| experimental | +| `tekton_pipelines_controller_pipelinerun_count` | Counter | `status`=<status> | deprecate | +| `tekton_pipelines_controller_pipelinerun_total` | Counter | `status`=<status> | experimental | +| `tekton_pipelines_controller_running_pipelineruns_count` | Gauge | | deprecate | +| `tekton_pipelines_controller_running_pipelineruns` | Gauge | | experimental | +| `tekton_pipelines_controller_taskrun_duration_seconds_[bucket, sum, count]` | Histogram/LastValue(Gauge) | `status`=<status>
`*task`=<task_name>
`*taskrun`=<taskrun_name>
`namespace`=<pipelineruns-taskruns-namespace> | experimental | +| `tekton_pipelines_controller_taskrun_count` | Counter | `status`=<status> | deprecate | +| `tekton_pipelines_controller_taskrun_total` | Counter | `status`=<status> | experimental | +| `tekton_pipelines_controller_running_taskruns_count` | Gauge | | deprecate | +| `tekton_pipelines_controller_running_taskruns` | Gauge | | experimental | +| `tekton_pipelines_controller_running_taskruns_throttled_by_quota_count` | Gauge | | deprecate | +| `tekton_pipelines_controller_running_taskruns_throttled_by_node_count` | Gauge | | deprecate | +| `tekton_pipelines_controller_running_taskruns_throttled_by_quota` | Gauge | | experimental | +| `tekton_pipelines_controller_running_taskruns_throttled_by_node` | Gauge | | experimental | +| `tekton_pipelines_controller_client_latency_[bucket, sum, count]` | Histogram | | experimental | The Labels/Tag marked as "*" are optional. And there's a choice between Histogram and LastValue(Gauge) for pipelinerun and taskrun duration metrics. @@ -41,31 +41,25 @@ A sample config-map has been provided as [config-observability](./../config/conf metrics.taskrun.level: "task" metrics.taskrun.duration-type: "histogram" metrics.pipelinerun.level: "pipeline" - metrics.running-pipelinerun.level: "" metrics.pipelinerun.duration-type: "histogram" metrics.count.enable-reason: "false" ``` Following values are available in the configmap: -| configmap data | value | description | -| -- | ----------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------| -| metrics.taskrun.level | `taskrun` | Level of metrics is taskrun | -| metrics.taskrun.level | `task` | Level of metrics is task and taskrun label isn't present in the metrics | -| metrics.taskrun.level | `namespace` | Level of metrics is namespace, and task and taskrun label isn't present in the metrics -| metrics.pipelinerun.level | `pipelinerun` | Level of metrics is pipelinerun | -| metrics.pipelinerun.level | `pipeline` | Level of metrics is pipeline and pipelinerun label isn't present in the metrics | -| metrics.pipelinerun.level | `namespace` | Level of metrics is namespace, pipeline and pipelinerun label isn't present in the metrics | -| metrics.running-pipelinerun.level | `pipelinerun` | Level of running-pipelinerun metrics is pipelinerun | -| metrics.running-pipelinerun.level | `pipeline` | Level of running-pipelinerun metrics is pipeline and pipelinerun label isn't present in the metrics | -| metrics.running-pipelinerun.level | `namespace` | Level of running-pipelinerun metrics is namespace, pipeline and pipelinerun label isn't present in the metrics | -| metrics.running-pipelinerun.level | `` | Level of running-pipelinerun metrics is cluster, namespace, pipeline and pipelinerun label isn't present in the metrics. | -| metrics.taskrun.duration-type | `histogram` | `tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds` and `tekton_pipelines_controller_taskrun_duration_seconds` is of type histogram | +| configmap data | value | description | +| ---------- | ----------- | ----------- | +| metrics.taskrun.level | `taskrun` | Level of metrics is taskrun | +| metrics.taskrun.level | `task` | Level of metrics is task and taskrun label isn't present in the metrics | +| metrics.taskrun.level | `namespace` | Level of metrics is namespace, and task and taskrun label isn't present in the metrics +| metrics.pipelinerun.level | `pipelinerun` | Level of metrics is pipelinerun | +| metrics.pipelinerun.level | `pipeline` | Level of metrics is pipeline and pipelinerun label isn't present in the metrics | +| metrics.pipelinerun.level | `namespace` | Level of metrics is namespace, pipeline and pipelinerun label isn't present in the metrics | +| metrics.taskrun.duration-type | `histogram` | `tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds` and `tekton_pipelines_controller_taskrun_duration_seconds` is of type histogram | | metrics.taskrun.duration-type | `lastvalue` | `tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds` and `tekton_pipelines_controller_taskrun_duration_seconds` is of type gauge or lastvalue | -| metrics.pipelinerun.duration-type | `histogram` | `tekton_pipelines_controller_pipelinerun_duration_seconds` is of type histogram | -| metrics.pipelinerun.duration-type | `lastvalue` | `tekton_pipelines_controller_pipelinerun_duration_seconds` is of type gauge or lastvalue | -| metrics.count.enable-reason | `false` | Sets if the `reason` label should be included on count metrics | -| metrics.taskrun.throttle.enable-namespace | `false` | Sets if the `namespace` label should be included on the `tekton_pipelines_controller_running_taskruns_throttled_by_quota` metric | +| metrics.pipelinerun.duration-type | `histogram` | `tekton_pipelines_controller_pipelinerun_duration_seconds` is of type histogram | +| metrics.pipelinerun.duration-type | `lastvalue` | `tekton_pipelines_controller_pipelinerun_duration_seconds` is of type gauge or lastvalue | +| metrics.count.enable-reason | `false` | Sets if the `reason` label should be included on count metrics | Histogram value isn't available when pipelinerun or taskrun labels are selected. The Lastvalue or Gauge will be provided. Histogram would serve no purpose because it would generate a single bar. TaskRun and PipelineRun level metrics aren't recommended because they lead to an unbounded cardinality which degrades the observability database. diff --git a/upstream/docs/migrating-v1beta1-to-v1.md b/upstream/docs/migrating-v1beta1-to-v1.md index 925488d9135..badb5503b2f 100644 --- a/upstream/docs/migrating-v1beta1-to-v1.md +++ b/upstream/docs/migrating-v1beta1-to-v1.md @@ -50,9 +50,6 @@ In Tekton `v1`, the following fields have been changed: `PipelineResources` and the `resources` fields of Task, TaskRun, Pipeline and PipelineRun have been removed. Please use `Tasks` instead. For more information, see [Replacing PipelineResources](https://github.com/tektoncd/pipeline/blob/main/docs/pipelineresources.md) ## Replacing `taskRef.bundle` and `pipelineRef.bundle` with Bundle Resolver - -**Note: `taskRef.bundle` and `pipelineRef.bundle` are now removed from `v1beta1`. This is kept for "history" purposes**. - Bundle resolver in remote resolution should be used instead of `taskRun.spec.taskRef.bundle` and `pipelineRun.spec.pipelineRef.bundle`. The [`enable-bundles-resolver`](https://github.com/tektoncd/pipeline/blob/main/docs/install.md#customizing-the-pipelines-controller-behavior) feature flag must be enabled to use this feature. diff --git a/upstream/docs/pipeline-api.md b/upstream/docs/pipeline-api.md index d013bca86cb..c8e57271de6 100644 --- a/upstream/docs/pipeline-api.md +++ b/upstream/docs/pipeline-api.md @@ -304,22 +304,6 @@ resource being requested. For example: repo URL, commit SHA, path to file, the kind of authentication to leverage, etc.

- - -url
- -string - - - -(Optional) -

URL is the runtime url passed to the resolver -to help it figure out how to resolver the resource being -requested. -This is currently at an ALPHA stability level and subject to -alpha API compatibility policies.

- - @@ -374,22 +358,6 @@ resource being requested. For example: repo URL, commit SHA, path to file, the kind of authentication to leverage, etc.

- - -url
- -string - - - -(Optional) -

URL is the runtime url passed to the resolver -to help it figure out how to resolver the resource being -requested. -This is currently at an ALPHA stability level and subject to -alpha API compatibility policies.

- -

ResolutionRequestStatus @@ -1370,7 +1338,6 @@ string -

The artifact’s identifying category name

@@ -1383,18 +1350,7 @@ string -

A collection of values related to the artifact

- - - - -buildOutput
- -bool - - - -

Indicate if the artifact is a build output or a by-product

+

The artifact’s identifying category name

@@ -1440,9 +1396,6 @@ string

Artifacts

-

-(Appears on:TaskRunStatusFields) -

Artifacts represents the collection of input and output artifacts associated with a task run or a similar process. Artifacts in this context are units of data or resources @@ -1899,7 +1852,7 @@ If Enum is not set, no input validation is performed for the param.

ParamSpecs ([]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamSpec alias)

-(Appears on:PipelineSpec, TaskSpec, StepActionSpec, StepActionSpec) +(Appears on:PipelineSpec, TaskSpec, StepActionSpec)

ParamSpecs is a list of ParamSpec

@@ -3449,7 +3402,7 @@ ParamType

Provenance

-(Appears on:PipelineRunStatusFields, StepState, TaskRunStatusFields) +(Appears on:PipelineRunStatusFields, TaskRunStatusFields)

Provenance contains metadata about resources used in the TaskRun/PipelineRun @@ -4147,23 +4100,6 @@ other Step or Sidecar that does not also request this Workspace will not have access to it.

- - -restartPolicy
- - -Kubernetes core/v1.ContainerRestartPolicy - - - - -(Optional) -

RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an -initContainer and must have it’s policy set to “Always”. It is currently -left optional to help support Kubernetes versions prior to 1.29 when this feature -was introduced.

- -

SidecarState @@ -4679,20 +4615,6 @@ It cannot be used when referencing StepActions using [v1.Step.Ref]. The Results declared by the StepActions will be stored here instead.

- - -when
- - -WhenExpressions - - - - -(Optional) -

When is a list of when expressions that need to be true for the task to run

- -

StepOutputConfig @@ -4728,11 +4650,11 @@ string

StepResult

-(Appears on:Step, StepActionSpec, Step, StepActionSpec) +(Appears on:Step, StepActionSpec, Step)

StepResult used to describe the Results of a Step.

-

This is field is at an BETA stability level and gated by “enable-step-actions” feature flag.

+

This is field is at an ALPHA stability level and gated by “enable-step-actions” feature flag.

@@ -4870,18 +4792,6 @@ string - - - - - - - -
-provenance
- - -Provenance - - -
-
terminationReason
string @@ -5142,17 +5052,6 @@ string failed step will not exit

-beforeSteps
- -[]string - -
-(Optional) -

TaskKind @@ -5957,20 +5856,6 @@ All TaskRunStatus stored in RetriesStatus will have no date within the RetriesSt -artifacts
- - -Artifacts - - - - -(Optional) -

Artifacts are the list of artifacts written out by the task’s containers

- - - - sidecars
@@ -6334,7 +6219,7 @@ More info about CEL syntax: WhenExpressions ([]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression alias)

-(Appears on:PipelineTask, Step) +(Appears on:PipelineTask)

WhenExpressions are used to specify whether a Task should be executed or skipped @@ -8478,8 +8363,6 @@ Resource Types:

  • PipelineRun
  • -StepAction -
  • Task
  • TaskRun @@ -9307,11 +9190,14 @@ PipelineRunStatus -

    StepAction +

    Task

    -

    StepAction represents the actionable components of Step. -The Step can only reference it from the cluster or using remote resolution.

    +

    Task represents a collection of sequential steps that are run as part of a +Pipeline using a set of inputs and producing a set of outputs. Tasks execute +when TaskRuns are created that provide the input parameters and resources and +output resources the Task requires.

    +

    Deprecated: Please use v1.Task instead.

    @@ -9336,7 +9222,7 @@ tekton.dev/v1beta1 kind
    string - +
    StepActionTask
    @@ -9357,183 +9243,156 @@ Refer to the Kubernetes API documentation for the fields of the spec
    - -StepActionSpec + +TaskSpec
    (Optional) -

    Spec holds the desired state of the Step from the client

    +

    Spec holds the desired state of the Task from the client



    - - - -
    -description
    +resources
    -string + +TaskResources +
    (Optional) -

    Description is a user-facing description of the stepaction that may be -used to populate a UI.

    +

    Resources is a list input and output resource to run the task +Resources are represented in TaskRuns as bindings to instances of +PipelineResources.

    +

    Deprecated: Unused, preserved only for backwards compatibility

    -image
    +params
    -string + +ParamSpecs +
    (Optional) -

    Image reference name to run for this StepAction. -More info: https://kubernetes.io/docs/concepts/containers/images

    +

    Params is a list of input parameters required to run the task. Params +must be supplied as inputs in TaskRuns unless they declare a default +value.

    -command
    +displayName
    -[]string +string
    (Optional) -

    Entrypoint array. Not executed within a shell. -The image’s ENTRYPOINT is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

    +

    DisplayName is a user-facing name of the task that may be +used to populate a UI.

    -args
    +description
    -[]string +string
    (Optional) -

    Arguments to the entrypoint. -The image’s CMD is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

    +

    Description is a user-facing description of the task that may be +used to populate a UI.

    -env
    +steps
    - -[]Kubernetes core/v1.EnvVar + +[]Step
    -(Optional) -

    List of environment variables to set in the container. -Cannot be updated.

    -
    -script
    - -string - -
    -(Optional) -

    Script is the contents of an executable file to execute.

    -

    If Script is not empty, the Step cannot have an Command and the Args will be passed to the Script.

    +

    Steps are the steps of the build; each step is run sequentially with the +source mounted into /workspace.

    -workingDir
    +volumes
    -string + +[]Kubernetes core/v1.Volume +
    -(Optional) -

    Step’s working directory. -If not specified, the container runtime’s default will be used, which -might be configured in the container image. -Cannot be updated.

    +

    Volumes is a collection of volumes that are available to mount into the +steps of the build.

    -params
    +stepTemplate
    - -ParamSpecs + +StepTemplate
    -(Optional) -

    Params is a list of input parameters required to run the stepAction. -Params must be supplied as inputs in Steps unless they declare a defaultvalue.

    +

    StepTemplate can be used as the basis for all step containers within the +Task, so that the steps inherit settings on the base container.

    -results
    +sidecars
    - -[]StepResult + +[]Sidecar
    -(Optional) -

    Results are values that this StepAction can output

    +

    Sidecars are run alongside the Task’s step containers. They begin before +the steps start and end after the steps complete.

    -securityContext
    +workspaces
    - -Kubernetes core/v1.SecurityContext + +[]WorkspaceDeclaration
    -(Optional) -

    SecurityContext defines the security options the Step should be run with. -If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. -More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -The value set in StepAction will take precedence over the value from Task.

    +

    Workspaces are the volumes that this Task requires.

    -volumeMounts
    +results
    - -[]Kubernetes core/v1.VolumeMount + +[]TaskResult
    -(Optional) -

    Volumes to mount into the Step’s filesystem. -Cannot be updated.

    +

    Results are values that this Task can output

    @@ -9541,14 +9400,13 @@ Cannot be updated.

    -

    Task +

    TaskRun

    -

    Task represents a collection of sequential steps that are run as part of a -Pipeline using a set of inputs and producing a set of outputs. Tasks execute -when TaskRuns are created that provide the input parameters and resources and -output resources the Task requires.

    -

    Deprecated: Please use v1.Task instead.

    +

    TaskRun represents a single execution of a Task. TaskRuns are how the steps +specified in a Task are executed; they specify the parameters and resources +used to run the steps in a Task.

    +

    Deprecated: Please use v1.TaskRun instead.

    @@ -9573,7 +9431,7 @@ tekton.dev/v1beta1 kind
    string - + - - - -
    TaskTaskRun
    @@ -9594,217 +9452,8 @@ Refer to the Kubernetes API documentation for the fields of the spec
    - -TaskSpec - - -
    -(Optional) -

    Spec holds the desired state of the Task from the client

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -resources
    - - -TaskResources - - -
    -(Optional) -

    Resources is a list input and output resource to run the task -Resources are represented in TaskRuns as bindings to instances of -PipelineResources.

    -

    Deprecated: Unused, preserved only for backwards compatibility

    -
    -params
    - - -ParamSpecs - - -
    -(Optional) -

    Params is a list of input parameters required to run the task. Params -must be supplied as inputs in TaskRuns unless they declare a default -value.

    -
    -displayName
    - -string - -
    -(Optional) -

    DisplayName is a user-facing name of the task that may be -used to populate a UI.

    -
    -description
    - -string - -
    -(Optional) -

    Description is a user-facing description of the task that may be -used to populate a UI.

    -
    -steps
    - - -[]Step - - -
    -

    Steps are the steps of the build; each step is run sequentially with the -source mounted into /workspace.

    -
    -volumes
    - - -[]Kubernetes core/v1.Volume - - -
    -

    Volumes is a collection of volumes that are available to mount into the -steps of the build.

    -
    -stepTemplate
    - - -StepTemplate - - -
    -

    StepTemplate can be used as the basis for all step containers within the -Task, so that the steps inherit settings on the base container.

    -
    -sidecars
    - - -[]Sidecar - - -
    -

    Sidecars are run alongside the Task’s step containers. They begin before -the steps start and end after the steps complete.

    -
    -workspaces
    - - -[]WorkspaceDeclaration - - -
    -

    Workspaces are the volumes that this Task requires.

    -
    -results
    - - -[]TaskResult - - -
    -

    Results are values that this Task can output

    -
    -
    -

    TaskRun -

    -
    -

    TaskRun represents a single execution of a Task. TaskRuns are how the steps -specified in a Task are executed; they specify the parameters and resources -used to run the steps in a Task.

    -

    Deprecated: Please use v1.TaskRun instead.

    -
    - - - - - - - - - - - - - - - - - - - - - - @@ -10070,7 +9719,6 @@ string @@ -10083,18 +9731,7 @@ string - - - - @@ -11233,8 +10870,7 @@ string @@ -12823,7 +12459,7 @@ ParamType

    Provenance

    -(Appears on:PipelineRunStatusFields, StepState, TaskRunStatusFields) +(Appears on:PipelineRunStatusFields, TaskRunStatusFields)

    Provenance contains metadata about resources used in the TaskRun/PipelineRun @@ -13523,23 +13159,6 @@ other Step or Sidecar that does not also request this Workspace will not have access to it.

    - - - -
    FieldDescription
    -apiVersion
    -string
    - -tekton.dev/v1beta1 - -
    -kind
    -string -
    TaskRun
    -metadata
    - - -Kubernetes meta/v1.ObjectMeta - - -
    -(Optional) -Refer to the Kubernetes API documentation for the fields of the -metadata field. -
    -spec
    - - -TaskRunSpec + +TaskRunSpec
    -

    The artifact’s identifying category name

    -

    A collection of values related to the artifact

    -
    -buildOutput
    - -bool - -
    -

    Indicate if the artifact is a build output or a by-product

    +

    The artifact’s identifying category name

    (Optional)

    Bundle url reference to a Tekton Bundle.

    -

    Deprecated: Please use ResolverRef with the bundles resolver instead. -The field is staying there for go client backward compatibility, but is not used/allowed anymore.

    +

    Deprecated: Please use ResolverRef with the bundles resolver instead.

    -restartPolicy
    - - -Kubernetes core/v1.ContainerRestartPolicy - - -
    -(Optional) -

    RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an -initContainer and must have it’s policy set to “Always”. It is currently -left optional to help support Kubernetes versions prior to 1.29 when this feature -was introduced.

    -

    SidecarState @@ -14181,209 +13800,6 @@ It cannot be used when referencing StepActions using [v1beta1.Step.Ref]. The Results declared by the StepActions will be stored here instead.

    - - -when
    - - -WhenExpressions - - - - - - - - -

    StepActionObject -

    -
    -

    StepActionObject is implemented by StepAction

    -
    -

    StepActionSpec -

    -

    -(Appears on:StepAction) -

    -
    -

    StepActionSpec contains the actionable components of a step.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FieldDescription
    -description
    - -string - -
    -(Optional) -

    Description is a user-facing description of the stepaction that may be -used to populate a UI.

    -
    -image
    - -string - -
    -(Optional) -

    Image reference name to run for this StepAction. -More info: https://kubernetes.io/docs/concepts/containers/images

    -
    -command
    - -[]string - -
    -(Optional) -

    Entrypoint array. Not executed within a shell. -The image’s ENTRYPOINT is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

    -
    -args
    - -[]string - -
    -(Optional) -

    Arguments to the entrypoint. -The image’s CMD is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

    -
    -env
    - - -[]Kubernetes core/v1.EnvVar - - -
    -(Optional) -

    List of environment variables to set in the container. -Cannot be updated.

    -
    -script
    - -string - -
    -(Optional) -

    Script is the contents of an executable file to execute.

    -

    If Script is not empty, the Step cannot have an Command and the Args will be passed to the Script.

    -
    -workingDir
    - -string - -
    -(Optional) -

    Step’s working directory. -If not specified, the container runtime’s default will be used, which -might be configured in the container image. -Cannot be updated.

    -
    -params
    - - -ParamSpecs - - -
    -(Optional) -

    Params is a list of input parameters required to run the stepAction. -Params must be supplied as inputs in Steps unless they declare a defaultvalue.

    -
    -results
    - - -[]StepResult - - -
    -(Optional) -

    Results are values that this StepAction can output

    -
    -securityContext
    - - -Kubernetes core/v1.SecurityContext - - -
    -(Optional) -

    SecurityContext defines the security options the Step should be run with. -If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. -More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -The value set in StepAction will take precedence over the value from Task.

    -
    -volumeMounts
    - - -[]Kubernetes core/v1.VolumeMount - - -
    -(Optional) -

    Volumes to mount into the Step’s filesystem. -Cannot be updated.

    -

    StepOutputConfig @@ -14491,18 +13907,6 @@ string -provenance
    - - -Provenance - - - - - - - - inputs
    @@ -14937,17 +14341,6 @@ string failed step will not exit

    - - -beforeSteps
    - -[]string - - - -(Optional) - -

    TaskKind @@ -15035,8 +14428,7 @@ string (Optional)

    Bundle url reference to a Tekton Bundle.

    -

    Deprecated: Please use ResolverRef with the bundles resolver instead. -The field is staying there for go client backward compatibility, but is not used/allowed anymore.

    +

    Deprecated: Please use ResolverRef with the bundles resolver instead.

    @@ -16337,7 +15729,7 @@ More info about CEL syntax:
    WhenExpressions ([]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WhenExpression alias)

    -(Appears on:PipelineTask, Step) +(Appears on:PipelineTask)

    WhenExpressions are used to specify whether a Task should be executed or skipped diff --git a/upstream/docs/pipelineruns.md b/upstream/docs/pipelineruns.md index 6507066cde7..716bbb040b3 100644 --- a/upstream/docs/pipelineruns.md +++ b/upstream/docs/pipelineruns.md @@ -158,6 +158,10 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks` You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features). +In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag. + +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: pipelineRef: @@ -170,6 +174,17 @@ spec: - name: kind value: Pipeline ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} + ```yaml + spec: + pipelineRef: + name: mypipeline + bundle: docker.io/myrepo/mycatalog:v1.0 + ``` +{{% /tab %}} +{{< /tabs >}} The syntax and caveats are similar to using `Tekton Bundles` for `Task` references in [Pipelines](pipelines.md#tekton-bundles) or [TaskRuns](taskruns.md#tekton-bundles). diff --git a/upstream/docs/pipelines.md b/upstream/docs/pipelines.md index a8fab09577b..ebc0b2f9b0b 100644 --- a/upstream/docs/pipelines.md +++ b/upstream/docs/pipelines.md @@ -369,45 +369,6 @@ any resolved `param` value against the `enum` specified in each `PipelineTask` b See usage in this [example](../examples/v1/pipelineruns/alpha/param-enum.yaml) -#### Propagated Params - -Like with embedded [pipelineruns](pipelineruns.md#propagated-parameters), you can propagate `params` declared in the `pipeline` down to the inlined `pipelineTasks` and its inlined `Steps`. Wherever a resource (e.g. a `pipelineTask`) or a `StepAction` is referenced, the parameters need to be passed explicitly. - -For example, the following is a valid yaml. - -```yaml -apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: pipelien-propagated-params -spec: - params: - - name: HELLO - default: "Hello World!" - - name: BYE - default: "Bye World!" - tasks: - - name: echo-hello - taskSpec: - steps: - - name: echo - image: ubuntu - script: | - #!/usr/bin/env bash - echo "$(params.HELLO)" - - name: echo-bye - taskSpec: - steps: - - name: echo-action - ref: - name: step-action-echo - params: - - name: msg - value: "$(params.BYE)" -``` -The same rules defined in [pipelineruns](pipelineruns.md#propagated-parameters) apply here. - - ## Adding `Tasks` to the `Pipeline` Your `Pipeline` definition must reference at least one [`Task`](tasks.md). @@ -624,24 +585,45 @@ There is currently a hard limit of 20 objects in a bundle. You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features). +In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag. + + +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} +```yaml +spec: + taskRef: + resolver: bundles + params: + - name: bundle + value: docker.io/myrepo/mycatalog + - name: name + value: echo-task + - name: kind + value: Task +``` +{{% /tab %}} + +{{% tab "v1beta1" %}} ```yaml spec: tasks: - name: hello-world taskRef: - resolver: bundles - params: - - name: bundle - value: docker.io/myrepo/mycatalog - - name: name - value: echo-task - - name: kind - value: Task + name: echo-task + bundle: docker.com/myrepo/mycatalog ``` +{{% /tab %}} +{{< /tabs >}} + +Here, the `bundle` field is the full reference url to the artifact. The name is the +`metadata.name` field of the `Task`. You may also specify a `tag` as you would with a Docker image which will give you a fixed, repeatable reference to a `Task`. +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: taskRef: @@ -654,9 +636,24 @@ spec: - name: kind value: Task ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} +```yaml +spec: + tasks: + - name: hello-world + taskRef: + name: echo-task + bundle: docker.com/myrepo/mycatalog:v1.0.1 +``` +{{% /tab %}} +{{< /tabs >}} You may also specify a fixed digest instead of a tag. +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: taskRef: @@ -669,6 +666,19 @@ spec: - name: kind value: Task ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} +```yaml +spec: + tasks: + - name: hello-world + taskRef: + name: echo-task + bundle: docker.io/myrepo/mycatalog@sha256:abc123 +``` +{{% /tab %}} +{{< /tabs >}} Any of the above options will fetch the image using the `ImagePullSecrets` attached to the `ServiceAccount` specified in the `PipelineRun`. @@ -741,6 +751,8 @@ tasks: ### Using the `onError` field +> :seedling: **Specifying `onError` in `PipelineTasks` is an [alpha](additional-configs.md#alpha-features) feature.** The `enable-api-fields` feature flag must be set to `"alpha"` to specify `onError` in a `PipelineTask`. + When a `PipelineTask` fails, the rest of the `PipelineTasks` are skipped and the `PipelineRun` is declared a failure. If you would like to ignore such `PipelineTask` failure and continue executing the rest of the `PipelineTasks`, you can specify `onError` for such a `PipelineTask`. @@ -1265,10 +1277,6 @@ Tasks can emit [`Results`](tasks.md#emitting-results) when they execute. A Pipel 1. A Pipeline can pass the `Result` of a `Task` into the `Parameters` or `when` expressions of another. 2. A Pipeline can itself emit `Results` and include data from the `Results` of its Tasks. -> **Note** Tekton does not enforce that results are produced at Task level. If a pipeline attempts to -> consume a result that was declared by a Task, but not produced, it will fail. [TEP-0048](https://github.com/tektoncd/community/blob/main/teps/0048-task-results-without-results.md) -> propopses introducing default values for results to help Pipeline authors manage this case. - ### Passing one Task's `Results` into the `Parameters` or `when` expressions of another Sharing `Results` between `Tasks` in a `Pipeline` happens via diff --git a/upstream/docs/podtemplates.md b/upstream/docs/podtemplates.md index 53bb70ca6e3..af0888d4bb9 100644 --- a/upstream/docs/podtemplates.md +++ b/upstream/docs/podtemplates.md @@ -23,6 +23,20 @@ See the following for examples of specifying a Pod template: - [Specifying a Pod template for a `TaskRun`](./taskruns.md#specifying-a-pod-template) - [Specifying a Pod template for a `PipelineRun`](./pipelineruns.md#specifying-a-pod-template) +## Affinity Assistant Pod templates + +The Pod templates specified in the `TaskRuns` and `PipelineRuns `also apply to +the [affinity assistant Pods](#./workspaces.md#specifying-workspace-order-in-a-pipeline-and-affinity-assistants) +that are created when using Workspaces, but only on select fields. + +The supported fields are: `tolerations`, `nodeSelector`, and +`imagePullSecrets` (see the table below for more details). + +Similarily to Pod templates, you have the option to define a global affinity +assistant Pod template [in your Tekton config](./additional-configs.md#customizing-basic-execution-parameters) +using the key `default-affinity-assistant-pod-template`. The merge strategy is +the same as the one described above. + ## Supported fields Pod templates support fields listed in the table below. @@ -142,20 +156,6 @@ roleRef: apiGroup: rbac.authorization.k8s.io ``` -# Affinity Assistant Pod templates - -The Pod templates specified in the `TaskRuns` and `PipelineRuns `also apply to -the [affinity assistant Pods](#./workspaces.md#specifying-workspace-order-in-a-pipeline-and-affinity-assistants) -that are created when using Workspaces, but only on selected fields. - -The supported fields for affinity assistant pods are: `tolerations`, `nodeSelector`, `securityContext`, -`priorityClassName` and `imagePullSecrets` (see the table above for more details about the fields). - -Similarly to global Pod Template, you have the option to define a global affinity -assistant Pod template [in your Tekton config](./additional-configs.md#customizing-basic-execution-parameters) -using the key `default-affinity-assistant-pod-template`. The merge strategy is -the same as the one described above for the supported fields. - --- Except as otherwise noted, the content of this page is licensed under the diff --git a/upstream/docs/resolution-getting-started.md b/upstream/docs/resolution-getting-started.md index 590fa3d828e..f27ea7894a5 100644 --- a/upstream/docs/resolution-getting-started.md +++ b/upstream/docs/resolution-getting-started.md @@ -18,7 +18,7 @@ with a Pipeline stored in a git repo. - A computer with [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl). -- A Kubernetes cluster running at least Kubernetes 1.28. A [`kind` +- A Kubernetes cluster running at least Kubernetes 1.27. A [`kind` cluster](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) should work fine for following the guide on your local machine. - An image registry that you can push images to. If you're using `kind` @@ -125,7 +125,7 @@ EOF kubectl apply -f ./pipelinerun.yaml ``` -## Step 4: Monitor the PipelineRun +## Step 6: Monitor the PipelineRun First let's watch the PipelineRun to see if it succeeds: diff --git a/upstream/docs/resolver-reference.md b/upstream/docs/resolver-reference.md index 9d38bc87606..68fa6fc9273 100644 --- a/upstream/docs/resolver-reference.md +++ b/upstream/docs/resolver-reference.md @@ -21,33 +21,13 @@ a resolver](./how-to-write-a-resolver.md). Implementing this interface is required. It provides just enough configuration for the framework to get a resolver running. -{{% tabs %}} - -{{% tab "Upgraded Framework" %}} - -| Method to Implement | Description | -|----------------------|-------------| -| Initialize | Use this method to perform any setup required before the resolver starts receiving requests. | -| GetName | Use this method to return a name to refer to your Resolver by. e.g. `"Git"` | -| GetSelector | Use this method to specify the labels that a resolution request must have to be routed to your resolver. | -| Validate | Use this method to validate the resolution Spec given to your resolver. | -| Resolve | Use this method to perform get the resource based on the ResolutionRequestSpec as input and return it, along with any metadata about it in annotations | - -{{% /tab %}} - -{{% tab "Previous Framework (Deprecated)" %}} - | Method to Implement | Description | |----------------------|-------------| | Initialize | Use this method to perform any setup required before the resolver starts receiving requests. | | GetName | Use this method to return a name to refer to your Resolver by. e.g. `"Git"` | | GetSelector | Use this method to specify the labels that a resolution request must have to be routed to your resolver. | -| ValidateParams | Use this method to validate the params given to your resolver. | -| Resolve | Use this method to perform get the resource based on params as input and return it, along with any metadata about it in annotations | - -{{% /tab %}} - -{{% /tabs %}} +| ValidateParams | Use this method to validate the parameters given to your resolver. | +| Resolve | Use this method to perform get the resource and return it, along with any metadata about it in annotations | ## The `ConfigWatcher` Interface @@ -58,7 +38,7 @@ api endpoints or base urls, service account names to use, etc... | Method to Implement | Description | |---------------------|-------------| -| GetConfigName | Use this method to return the name of the configmap admins will use to configure this resolver. Once this interface is implemented your `Validate` and `Resolve` methods will be able to access your latest resolver configuration by calling `framework.GetResolverConfigFromContext(ctx)`. Note that this configmap must exist when your resolver starts - put a default one in your resolver's `config/` directory. | +| GetConfigName | Use this method to return the name of the configmap admins will use to configure this resolver. Once this interface is implemented your `ValidateParams` and `Resolve` methods will be able to access your latest resolver configuration by calling `framework.GetResolverConfigFromContext(ctx)`. Note that this configmap must exist when your resolver starts - put a default one in your resolver's `config/` directory. | ## The `TimedResolution` Interface diff --git a/upstream/docs/resolver-template/README.md b/upstream/docs/resolver-template/README.md index 1469403a20f..fbd6a8b5355 100644 --- a/upstream/docs/resolver-template/README.md +++ b/upstream/docs/resolver-template/README.md @@ -19,19 +19,11 @@ You can use this as a template to quickly get a new Resolver up and running with your own preferred storage backend. To reuse the template, simply copy this entire subdirectory to a new -directory. - -The entire program for the `latest` framework is defined in -[`./cmd/resolver/main.go`](./cmd/resolver/main.go) and provides stub -implementations of all the methods defined by the [`framework.Resolver` -interface](../../pkg/remoteresolution/resolver/framework/interface.go). - -If you choose to use the previous framework (deprecated) is defined in +directory. The entire program is defined in [`./cmd/demoresolver/main.go`](./cmd/demoresolver/main.go) and provides stub implementations of all the methods defined by the [`framework.Resolver` interface](../../pkg/resolution/resolver/framework/interface.go). - Once copied you'll need to run `go mod init` and `go mod tidy` at the root of your project. We don't need this in `tektoncd/resolution` because this submodule relies on the `go.mod` and `go.sum` defined at the root of the repo. diff --git a/upstream/docs/resolver-template/cmd/demoresolver/main.go b/upstream/docs/resolver-template/cmd/demoresolver/main.go index 881be8ba961..4c11d7164c2 100644 --- a/upstream/docs/resolver-template/cmd/demoresolver/main.go +++ b/upstream/docs/resolver-template/cmd/demoresolver/main.go @@ -32,7 +32,6 @@ func main() { ) } -// Deprecated type resolver struct{} // Initialize sets up any dependencies needed by the resolver. None atm. diff --git a/upstream/docs/resolver-template/cmd/resolver/main.go b/upstream/docs/resolver-template/cmd/resolver/main.go deleted file mode 100644 index 1484b62a0d7..00000000000 --- a/upstream/docs/resolver-template/cmd/resolver/main.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "context" - "errors" - "fmt" - neturl "net/url" - - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/common" - frameworkV1 "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - filteredinformerfactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered" - "knative.dev/pkg/injection/sharedmain" -) - -func main() { - ctx := filteredinformerfactory.WithSelectors(context.Background(), v1beta1.ManagedByLabelKey) - sharedmain.MainWithContext(ctx, "controller", - framework.NewController(ctx, &resolver{}), - ) -} - -type resolver struct{} - -// Initialize sets up any dependencies needed by the resolver. None atm. -func (r *resolver) Initialize(context.Context) error { - return nil -} - -// GetName returns a string name to refer to this resolver by. -func (r *resolver) GetName(context.Context) string { - return "Demo" -} - -// GetSelector returns a map of labels to match requests to this resolver. -func (r *resolver) GetSelector(context.Context) map[string]string { - return map[string]string{ - common.LabelKeyResolverType: "demo", - } -} - -// Validate ensures resolution spec from a request is as expected. -func (r *resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return errors.New("no params allowed") - } - u, err := neturl.ParseRequestURI(req.URL) - if err != nil { - return err - } - if u.Scheme != "demoscheme" { - return fmt.Errorf("Invalid Scheme. Want %s, Got %s", "demoscheme", u.Scheme) - } - return nil -} - -// Resolve uses the given resolution spec to resolve the requested file or resource. -func (r *resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (frameworkV1.ResolvedResource, error) { - return &myResolvedResource{}, nil -} - -// our hard-coded resolved file to return -const pipeline = ` -apiVersion: tekton.dev/v1 -kind: Pipeline -metadata: - name: my-pipeline -spec: - tasks: - - name: hello-world - taskSpec: - steps: - - image: alpine:3.15.1 - script: | - echo "hello world" -` - -// myResolvedResource wraps the data we want to return to Pipelines -type myResolvedResource struct{} - -// Data returns the bytes of our hard-coded Pipeline -func (*myResolvedResource) Data() []byte { - return []byte(pipeline) -} - -// Annotations returns any metadata needed alongside the data. None atm. -func (*myResolvedResource) Annotations() map[string]string { - return nil -} - -// RefSource is the source reference of the remote data that records where the remote -// file came from including the url, digest and the entrypoint. None atm. -func (*myResolvedResource) RefSource() *pipelinev1.RefSource { - return nil -} diff --git a/upstream/docs/resolver-template/cmd/resolver/main_test.go b/upstream/docs/resolver-template/cmd/resolver/main_test.go deleted file mode 100644 index 46c6eedb160..00000000000 --- a/upstream/docs/resolver-template/cmd/resolver/main_test.go +++ /dev/null @@ -1,207 +0,0 @@ -/* - Copyright 2024 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package main - -import ( - "encoding/base64" - "errors" - "testing" - "time" - - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - frtesting "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework/testing" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/test" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "knative.dev/pkg/apis/duck/v1" - _ "knative.dev/pkg/system/testing" -) - -func TestResolver(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - r := &resolver{} - - request := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: "demo", - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: "demoscheme://foo/bar", - }, - } - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - - expectedStatus := &v1beta1.ResolutionRequestStatus{ - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString([]byte(pipeline)), - }, - } - - // If you want to test scenarios where an error should occur, pass a non-nil error to RunResolverReconcileTest - var expectedErr error - - frtesting.RunResolverReconcileTest(ctx, t, d, r, request, expectedStatus, expectedErr) -} - -func TestResolver_Failure_Wrong_Scheme(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - r := &resolver{} - - request := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: "demo", - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: "wrongscheme://foo/bar", - }, - } - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - - expectedStatus := &v1beta1.ResolutionRequestStatus{ - Status: v1.Status{ - Conditions: v1.Conditions{ - { - Type: "Succeeded", - Status: "False", - Reason: "ResolutionFailed", - Message: `invalid resource request "foo/rr": Invalid Scheme. Want demoscheme, Got wrongscheme`, - }, - }, - }, - } - - // If you want to test scenarios where an error should occur, pass a non-nil error to RunResolverReconcileTest - expectedErr := errors.New(`invalid resource request "foo/rr": Invalid Scheme. Want demoscheme, Got wrongscheme`) - frtesting.RunResolverReconcileTest(ctx, t, d, r, request, expectedStatus, expectedErr) -} - -func TestResolver_Failure_InvalidUrl(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - r := &resolver{} - - request := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: "demo", - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: "foo/bar", - }, - } - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - - expectedStatus := &v1beta1.ResolutionRequestStatus{ - Status: v1.Status{ - Conditions: v1.Conditions{ - { - Type: "Succeeded", - Status: "False", - Reason: "ResolutionFailed", - Message: `invalid resource request "foo/rr": parse "foo/bar": invalid URI for request`, - }, - }, - }, - } - - // If you want to test scenarios where an error should occur, pass a non-nil error to RunResolverReconcileTest - expectedErr := errors.New(`invalid resource request "foo/rr": parse "foo/bar": invalid URI for request`) - frtesting.RunResolverReconcileTest(ctx, t, d, r, request, expectedStatus, expectedErr) -} - -func TestResolver_Failure_InvalidParams(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - r := &resolver{} - - request := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: "demo", - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: "foo", - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - } - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - - expectedStatus := &v1beta1.ResolutionRequestStatus{ - Status: v1.Status{ - Conditions: v1.Conditions{ - { - Type: "Succeeded", - Status: "False", - Reason: "ResolutionFailed", - Message: `invalid resource request "foo/rr": no params allowed`, - }, - }, - }, - } - - // If you want to test scenarios where an error should occur, pass a non-nil error to RunResolverReconcileTest - expectedErr := errors.New(`invalid resource request "foo/rr": no params allowed`) - frtesting.RunResolverReconcileTest(ctx, t, d, r, request, expectedStatus, expectedErr) -} diff --git a/upstream/docs/stepactions.md b/upstream/docs/stepactions.md index d78932fc283..afaa35ce003 100644 --- a/upstream/docs/stepactions.md +++ b/upstream/docs/stepactions.md @@ -18,12 +18,11 @@ weight: 201 - [Declaring VolumeMounts](#declaring-volumemounts) - [Referencing a StepAction](#referencing-a-stepaction) - [Specifying Remote StepActions](#specifying-remote-stepactions) - - [Controlling Step Execution with when Expressions](#controlling-step-execution-with-when-expressions) - [Known Limitations](#known-limitations) - [Cannot pass Step Results between Steps](#cannot-pass-step-results-between-steps) ## Overview -> :seedling: **`StepActions` is an [beta](additional-configs.md#beta-features) feature.** +> :seedling: **`StepActions` is an [alpha](additional-configs.md#alpha-features) feature.** > The `enable-step-actions` feature flag must be set to `"true"` to specify a `StepAction` in a `Step`. A `StepAction` is the reusable and scriptable unit of work that is performed by a `Step`. @@ -63,7 +62,7 @@ A `StepAction` definition supports the following fields: The example below demonstrates the use of most of the above-mentioned fields: ```yaml -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: example-stepaction-name @@ -83,7 +82,7 @@ Like with `Tasks`, a `StepAction` must declare all the parameters that it uses. `Parameters` are passed to the `StepAction` from its corresponding `Step` referencing it. ```yaml -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: stepaction-using-params @@ -522,104 +521,3 @@ spec: ``` The default resolver type can be configured by the `default-resolver-type` field in the `config-defaults` ConfigMap (`alpha` feature). See [additional-configs.md](./additional-configs.md) for details. - -### Controlling Step Execution with when Expressions - -You can define `when` in a `step` to control its execution. - -The components of `when` expressions are `input`, `operator`, `values`, `cel`: - -| Component | Description | Syntax | -|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `input` | Input for the `when` expression, defaults to an empty string if not provided. | * Static values e.g. `"ubuntu"`
    * Variables (parameters or results) e.g. `"$(params.image)"` or `"$(tasks.task1.results.image)"` or `"$(tasks.task1.results.array-results[1])"` | -| `operator` | `operator` represents an `input`'s relationship to a set of `values`, a valid `operator` must be provided. | `in` or `notin` | -| `values` | An array of string values, the `values` array must be provided and has to be non-empty. | * An array param e.g. `["$(params.images[*])"]`
    * An array result of a task `["$(tasks.task1.results.array-results[*])"]`
    * An array result of a step`["(steps.step1.results.array-results[*])"]`
    * `values` can contain static values e.g. `"ubuntu"`
    * `values` can contain variables (parameters or results) or a Workspaces's `bound` state e.g. `["$(params.image)"]` or `["$(steps.step1.results.image)"]` or `["$(tasks.task1.results.array-results[1])"]` or `["$(steps.step1.results.array-results[1])"]` | -| `cel` | The Common Expression Language (CEL) implements common semantics for expression evaluation, enabling different applications to more easily interoperate. This is an `alpha` feature, `enable-cel-in-whenexpression` needs to be set to true to use this feature. | [cel-syntax](https://github.com/google/cel-spec/blob/master/doc/langdef.md#syntax) - -The below example shows how to use when expressions to control step executions: - -```yaml -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: my-pvc-2 -spec: - resources: - requests: - storage: 5Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce ---- -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: step-when-example -spec: - workspaces: - - name: custom - persistentVolumeClaim: - claimName: my-pvc-2 - taskSpec: - description: | - A simple task that shows how to use when determine if a step should be executed - steps: - - name: should-execute - image: bash:latest - script: | - #!/usr/bin/env bash - echo "executed..." - when: - - input: "$(workspaces.custom.bound)" - operator: in - values: [ "true" ] - - name: should-skip - image: bash:latest - script: | - #!/usr/bin/env bash - echo skipskipskip - when: - - input: "$(workspaces.custom2.bound)" - operator: in - values: [ "true" ] - - name: should-continue - image: bash:latest - script: | - #!/usr/bin/env bash - echo blabalbaba - - name: produce-step - image: alpine - results: - - name: result2 - type: string - script: | - echo -n "foo" | tee $(step.results.result2.path) - - name: run-based-on-step-results - image: alpine - script: | - echo "wooooooo" - when: - - input: "$(steps.produce-step.results.result2)" - operator: in - values: [ "bar" ] - workspaces: - - name: custom -``` - -The StepState for a skipped step looks like something similar to the below: -```yaml - { - "container": "step-run-based-on-step-results", - "imageID": "docker.io/library/alpine@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b", - "name": "run-based-on-step-results", - "terminated": { - "containerID": "containerd://bf81162e79cf66a2bbc03e3654942d3464db06ff368c0be263a8a70f363a899b", - "exitCode": 0, - "finishedAt": "2024-03-26T03:57:47Z", - "reason": "Completed", - "startedAt": "2024-03-26T03:57:47Z" - }, - "terminationReason": "Skipped" - } -``` -Where `terminated.exitCode` is `0` and `terminationReason` is `Skipped` to indicate the Step exited successfully and was skipped. \ No newline at end of file diff --git a/upstream/docs/taskruns.md b/upstream/docs/taskruns.md index 1dd4d040a6c..ae93416eb5e 100644 --- a/upstream/docs/taskruns.md +++ b/upstream/docs/taskruns.md @@ -120,6 +120,10 @@ A `Tekton Bundle` is an OCI artifact that contains Tekton resources like `Tasks` You can reference a `Tekton bundle` in a `TaskRef` in both `v1` and `v1beta1` using [remote resolution](./bundle-resolver.md#pipeline-resolution). The example syntax shown below for `v1` uses remote resolution and requires enabling [beta features](./additional-configs.md#beta-features). +In `v1beta1`, you can also reference a `Tekton bundle` using OCI bundle syntax, which has been deprecated in favor of remote resolution. The example shown below for `v1beta1` uses OCI bundle syntax, and requires enabling `enable-tekton-oci-bundles: "true"` feature flag. + +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: taskRef: @@ -132,9 +136,25 @@ spec: - name: kind value: Task ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} +```yaml +spec: +taskRef: + name: echo-task + bundle: docker.io/myrepo/mycatalog +``` +{{% /tab %}} +{{< /tabs >}} + +Here, the `bundle` field is the full reference url to the artifact. The name is the +`metadata.name` field of the `Task`. You may also specify a `tag` as you would with a Docker image which will give you a repeatable reference to a `Task`. +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: taskRef: @@ -147,9 +167,22 @@ spec: - name: kind value: Task ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} +```yaml +spec: +taskRef: + name: echo-task + bundle: docker.io/myrepo/mycatalog:v1.0.1 +``` +{{% /tab %}} +{{< /tabs >}} You may also specify a fixed digest instead of a tag which ensures the referenced task is constant. +{{< tabs >}} +{{% tab "v1 & v1beta1" %}} ```yaml spec: taskRef: @@ -162,6 +195,17 @@ spec: - name: kind value: Task ``` +{{% /tab %}} + +{{% tab "v1beta1" %}} +```yaml +spec: +taskRef: + name: echo-task + bundle: docker.io/myrepo/mycatalog@sha256:abc123 +``` +{{% /tab %}} +{{< /tabs >}} A working example can be found [here](../examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml). @@ -374,7 +418,7 @@ may be overridden by a TaskRun's StepSpecs and SidecarSpecs. ### Specifying Task-level `ComputeResources` -**([beta only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#beta-features))** +**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#alpha-features))** Task-level compute resources can be configured in `TaskRun.ComputeResources`, or `PipelineRun.TaskRunSpecs.ComputeResources`. @@ -599,7 +643,7 @@ and reasons. ### Configuring Task Steps and Sidecars in a TaskRun -**([beta only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#beta-features))** +**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#alpha-features))** A TaskRun can specify `StepSpecs` or `SidecarSpecs` to configure Step or Sidecar specified in a Task. Only named Steps and Sidecars may be configured. @@ -802,21 +846,20 @@ steps: The following tables shows how to read the overall status of a `TaskRun`: -| `status` | `reason` | `message` | `completionTime` is set | Description | -|:---------|:-----------------------|:------------------------------------------------------------------|:-----------------------:|--------------------------------------------------------------------------------------------------:| -| Unknown | Started | n/a | No | The TaskRun has just been picked up by the controller. | -| Unknown | Pending | n/a | No | The TaskRun is waiting on a Pod in status Pending. | -| Unknown | Running | n/a | No | The TaskRun has been validated and started to perform its work. | -| Unknown | TaskRunCancelled | n/a | No | The user requested the TaskRun to be cancelled. Cancellation has not been done yet. | -| True | Succeeded | n/a | Yes | The TaskRun completed successfully. | -| False | Failed | n/a | Yes | The TaskRun failed because one of the steps failed. | -| False | \[Error message\] | n/a | No | The TaskRun encountered a non-permanent error, and it's still running. It may ultimately succeed. | -| False | \[Error message\] | n/a | Yes | The TaskRun failed with a permanent error (usually validation). | -| False | TaskRunCancelled | n/a | Yes | The TaskRun was cancelled successfully. | -| False | TaskRunCancelled | TaskRun cancelled as the PipelineRun it belongs to has timed out. | Yes | The TaskRun was cancelled because the PipelineRun timed out. | -| False | TaskRunTimeout | n/a | Yes | The TaskRun timed out. | -| False | TaskRunImagePullFailed | n/a | Yes | The TaskRun failed due to one of its steps not being able to pull the image. | -| False | FailureIgnored | n/a | Yes | The TaskRun failed but the failure was ignored. | +`status` | `reason` | `message` | `completionTime` is set | Description +:--------|:-----------------------|:------------------------------------------------------------------|:-----------------------:|-------------------------------------------------------------------------------------------------: +Unknown | Started | n/a | No | The TaskRun has just been picked up by the controller. +Unknown | Pending | n/a | No | The TaskRun is waiting on a Pod in status Pending. +Unknown | Running | n/a | No | The TaskRun has been validated and started to perform its work. +Unknown | TaskRunCancelled | n/a | No | The user requested the TaskRun to be cancelled. Cancellation has not been done yet. +True | Succeeded | n/a | Yes | The TaskRun completed successfully. +False | Failed | n/a | Yes | The TaskRun failed because one of the steps failed. +False | \[Error message\] | n/a | No | The TaskRun encountered a non-permanent error, and it's still running. It may ultimately succeed. +False | \[Error message\] | n/a | Yes | The TaskRun failed with a permanent error (usually validation). +False | TaskRunCancelled | n/a | Yes | The TaskRun was cancelled successfully. +False | TaskRunCancelled | TaskRun cancelled as the PipelineRun it belongs to has timed out. | Yes | The TaskRun was cancelled because the PipelineRun timed out. +False | TaskRunTimeout | n/a | Yes | The TaskRun timed out. +False | TaskRunImagePullFailed | n/a | Yes | The TaskRun failed due to one of its steps not being able to pull the image. When a `TaskRun` changes status, [events](events.md#taskruns) are triggered accordingly. @@ -909,18 +952,6 @@ spec: onFailure: "enabled" ``` -### Breakpoint before step - -If you want to set a breakpoint before the step is executed, you can add the step name to the `beforeSteps` field in the following way: - -```yaml -spec: - debug: - breakpoints: - beforeSteps: - - {{ stepName }} -``` - Upon failure of a step, the TaskRun Pod execution is halted. If this TaskRun Pod continues to run without any lifecycle change done by the user (running the debug-continue or debug-fail-continue script) the TaskRun would be subject to [TaskRunTimeout](#configuring-the-failure-timeout). @@ -943,10 +974,6 @@ perform :- `debug-fail-continue`: Mark the step as a failure and exit the breakpoint. -`debug-beforestep-continue`: Mark the step continue to execute - -`debug-beforestep-fail-continue`: Mark the step not continue to execute - *More information on the inner workings of debug can be found in the [Debug documentation](debug.md)* ## Code examples diff --git a/upstream/docs/tasks.md b/upstream/docs/tasks.md index d01c29dd915..0529e5ff8ee 100644 --- a/upstream/docs/tasks.md +++ b/upstream/docs/tasks.md @@ -858,12 +858,6 @@ precise string you want returned from your `Task` into the result files that you The stored results can be used [at the `Task` level](./pipelines.md#passing-one-tasks-results-into-the-parameters-or-when-expressions-of-another) or [at the `Pipeline` level](./pipelines.md#emitting-results-from-a-pipeline). -> **Note** Tekton does not enforce Task results unless there is a consumer: when a Task declares a result, -> it may complete successfully even if no result was actually produced. When a Task that declares results is -> used in a Pipeline, and a component of the Pipeline attempts to consume the Task's result, if the result -> was not produced the pipeline will fail. [TEP-0048](https://github.com/tektoncd/community/blob/main/teps/0048-task-results-without-results.md) -> propopses introducing default values for results to help Pipeline authors manage this case. - #### Emitting Object `Results` Emitting a task result of type `object` is implemented based on the [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md#emitting-object-results). @@ -1023,7 +1017,7 @@ As a general rule-of-thumb, if a result needs to be larger than a kilobyte, you #### Larger `Results` using sidecar logs -This is a beta feature which is guarded behind its own feature flag. The `results-from` feature flag must be set to +This is an alpha feature which is guarded behind its own feature flag. The `results-from` feature flag must be set to [`"sidecar-logs"`](./install.md#enabling-larger-results-using-sidecar-logs) to enable larger results using sidecar logs. Instead of using termination messages to store results, the taskrun controller injects a sidecar container which monitors @@ -1113,11 +1107,6 @@ to run alongside the `Steps` in your `Task`. You can use `Sidecars` to provide a `Sidecars` spin up before your `Task` executes and are deleted after the `Task` execution completes. For further information, see [`Sidecars` in `TaskRuns`](taskruns.md#specifying-sidecars). -**Note**: Starting in v0.62 you can enable native Kubernetes sidecar support using the `enable-kubernetes-sidecar` feature flag ([see instructions](./additional-configs.md#customizing-the-pipelines-controller-behavior)). If kubernetes does not wait for your sidecar application to be ready, use a `startupProbe` to help kubernetes identify when it is ready. - -Refer to the detailed instructions listed in [additional config](additional-configs.md#enabling-larger-results-using-sidecar-logs) -to learn how to enable this feature. - In the example below, a `Step` uses a Docker-in-Docker `Sidecar` to build a Docker image: ```yaml diff --git a/upstream/docs/tekton-controller-flags.md b/upstream/docs/tekton-controller-flags.md deleted file mode 100644 index 34d62b3cd1d..00000000000 --- a/upstream/docs/tekton-controller-flags.md +++ /dev/null @@ -1,82 +0,0 @@ - - -# Tekton Controllers flags - -The different controllers `tektoncd/pipeline` ships comes with a set of flags -that can be changed (in the `yaml` payloads) for advanced use cases. This page -is documenting them. - -## Common set of flags - -The following flags are available on all "controllers", aka `controller`, `webhook`, `events` and `resolvers`. - -``` - -add_dir_header - If true, adds the file directory to the header of the log messages - -alsologtostderr - log to standard error as well as files (no effect when -logtostderr=true) - -cluster string - Defaults to the current cluster in kubeconfig. - -disable-ha - Whether to disable high-availability functionality for this component. This flag will be deprecated and removed when we have promoted this feature to stable, so do not pass it without filing an issue upstream! - -kube-api-burst int - Maximum burst for throttle. - -kube-api-qps float - Maximum QPS to the server from the client. - -kubeconfig string - Path to a kubeconfig. Only required if out-of-cluster. - -log_backtrace_at value - when logging hits line file:N, emit a stack trace - -log_dir string - If non-empty, write log files in this directory (no effect when -logtostderr=true) - -log_file string - If non-empty, use this log file (no effect when -logtostderr=true) - -log_file_max_size uint - Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) - -logtostderr - log to standard error instead of files (default true) - -one_output - If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true) - -server string - The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - -skip_headers - If true, avoid header prefixes in the log messages - -skip_log_headers - If true, avoid headers when opening log files (no effect when -logtostderr=true) - -stderrthreshold value - logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false) (default 2) - -v value - number for the log level verbosity - -vmodule value - comma-separated list of pattern=N settings for file-filtered logging -``` - -## `controller` - -The main controller binary has additional flags to configure its behavior. - -``` - -entrypoint-image string - The container image containing our entrypoint binary. - -namespace string - Namespace to restrict informer to. Optional, defaults to all namespaces. - -nop-image string - The container image used to stop sidecars - -resync-period duration - The period between two resync run (going through all objects) (default 10h0m0s) - -shell-image string - The container image containing a shell - -shell-image-win string - The container image containing a windows shell - -sidecarlogresults-image string - The container image containing the binary for accessing results. - -threads-per-controller int - Threads (goroutines) to create per controller (default 2) - -workingdirinit-image string - The container image containing our working dir init binary. -``` diff --git a/upstream/docs/variables.md b/upstream/docs/variables.md index 8b3b9a77031..df3dadd818f 100644 --- a/upstream/docs/variables.md +++ b/upstream/docs/variables.md @@ -15,67 +15,63 @@ For instructions on using variable substitutions see the relevant section of [th ## Variables available in a `Pipeline` -| Variable | Description | -|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `params.` | The value of the parameter at runtime. | -| `params['']` | (see above) | -| `params[""]` | (see above) | -| `params.[*]` | Get the whole param array or object. | -| `params[''][*]` | (see above) | -| `params[""][*]` | (see above) | -| `params.[i]` | Get the i-th element of param array. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | -| `params[''][i]` | (see above) | -| `params[""][i]` | (see above) | -| `params.[*]` | Get the value of the whole object param. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | -| `params..` | Get the value of an individual child of an object param. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | -| `tasks..matrix.length` | The length of the `Matrix` combination count. | -| `tasks..results.` | The value of the `Task's` result. Can alter `Task` execution order within a `Pipeline`.) | -| `tasks..results.[i]` | The ith value of the `Task's` array result. Can alter `Task` execution order within a `Pipeline`.) | -| `tasks..results.[*]` | The array value of the `Task's` result. Can alter `Task` execution order within a `Pipeline`. Cannot be used in `script`.) | -| `tasks..results..key` | The `key` value of the `Task's` object result. Can alter `Task` execution order within a `Pipeline`.) | -| `tasks..matrix..length` | The length of the matrixed `Task's` results. (Can alter `Task` execution order within a `Pipeline`.) | -| `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if the `Workspace` declaration has `optional: true` and the Workspace binding was omitted by the PipelineRun. | -| `context.pipelineRun.name` | The name of the `PipelineRun` that this `Pipeline` is running in. | -| `context.pipelineRun.namespace` | The namespace of the `PipelineRun` that this `Pipeline` is running in. | -| `context.pipelineRun.uid` | The uid of the `PipelineRun` that this `Pipeline` is running in. | -| `context.pipeline.name` | The name of this `Pipeline` . | -| `tasks..status` | The execution status of the specified `pipelineTask`, only available in `finally` tasks. The execution status can be set to any one of the values (`Succeeded`, `Failed`, or `None`) described [here](pipelines.md#using-execution-status-of-pipelinetask). | -| `tasks..reason` | The execution reason of the specified `pipelineTask`, only available in `finally` tasks. The reason can be set to any one of the values (`Failed`, `TaskRunCancelled`, `TaskRunTimeout`, `FailureIgnored`, etc ) described [here](taskruns.md#monitoring-execution-status). | -| `tasks.status` | An aggregate status of all the `pipelineTasks` under the `tasks` section (excluding the `finally` section). This variable is only available in the `finally` tasks and can have any one of the values (`Succeeded`, `Failed`, `Completed`, or `None`) described [here](pipelines.md#using-aggregate-execution-status-of-all-tasks). | -| `context.pipelineTask.retries` | The retries of this `PipelineTask`. | -| `tasks..outputs.` | The value of a specific output artifact of the `Task` | -| `tasks..inputs.` | The value of a specific input artifact of the `Task` | +| Variable | Description | +| -------- | ----------- | +| `params.` | The value of the parameter at runtime. | +| `params['']` | (see above) | +| `params[""]` | (see above) | +| `params.[*]` | Get the whole param array or object.| +| `params[''][*]` | (see above) | +| `params[""][*]` | (see above) | +| `params.[i]` | Get the i-th element of param array. This is alpha feature, set `enable-api-fields` to `alpha` to use it.| +| `params[''][i]` | (see above) | +| `params[""][i]` | (see above) | +| `params.[*]` | Get the value of the whole object param. This is alpha feature, set `enable-api-fields` to `alpha` to use it.| +| `params..` | Get the value of an individual child of an object param. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | +| `tasks..matrix.length` | The length of the `Matrix` combination count. | +| `tasks..results.` | The value of the `Task's` result. Can alter `Task` execution order within a `Pipeline`.) | +| `tasks..results.[i]` | The ith value of the `Task's` array result. Can alter `Task` execution order within a `Pipeline`.) | +| `tasks..results.[*]` | The array value of the `Task's` result. Can alter `Task` execution order within a `Pipeline`. Cannot be used in `script`.) | +| `tasks..results..key` | The `key` value of the `Task's` object result. Can alter `Task` execution order within a `Pipeline`.) | +| `tasks..matrix..length` | The length of the matrixed `Task's` results. (Can alter `Task` execution order within a `Pipeline`.) | +| `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if the `Workspace` declaration has `optional: true` and the Workspace binding was omitted by the PipelineRun. | +| `context.pipelineRun.name` | The name of the `PipelineRun` that this `Pipeline` is running in. | +| `context.pipelineRun.namespace` | The namespace of the `PipelineRun` that this `Pipeline` is running in. | +| `context.pipelineRun.uid` | The uid of the `PipelineRun` that this `Pipeline` is running in. | +| `context.pipeline.name` | The name of this `Pipeline` . | +| `tasks..status` | The execution status of the specified `pipelineTask`, only available in `finally` tasks. The execution status can be set to any one of the values (`Succeeded`, `Failed`, or `None`) described [here](pipelines.md#using-execution-status-of-pipelinetask)| +| `tasks.status` | An aggregate status of all the `pipelineTasks` under the `tasks` section (excluding the `finally` section). This variable is only available in the `finally` tasks and can have any one of the values (`Succeeded`, `Failed`, `Completed`, or `None`) described [here](pipelines.md#using-aggregate-execution-status-of-all-tasks). | +| `context.pipelineTask.retries` | The retries of this `PipelineTask`. | ## Variables available in a `Task` -| Variable | Description | -|----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------| -| `params.` | The value of the parameter at runtime. | -| `params['']` | (see above) | -| `params[""]` | (see above) | -| `params.[*]` | Get the whole param array or object. | -| `params[''][*]` | (see above) | -| `params[""][*]` | (see above) | -| `params.[i]` | Get the i-th element of param array. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | -| `params[''][i]` | (see above) | -| `params[""][i]` | (see above) | +| Variable | Description | +| -------- | ----------- | +| `params.` | The value of the parameter at runtime. | +| `params['']` | (see above) | +| `params[""]` | (see above) | +| `params.[*]` | Get the whole param array or object.| +| `params[''][*]` | (see above) | +| `params[""][*]` | (see above) | +| `params.[i]` | Get the i-th element of param array. This is alpha feature, set `enable-api-fields` to `alpha` to use it.| +| `params[''][i]` | (see above) | +| `params[""][i]` | (see above) | | `params..` | Get the value of an individual child of an object param. This is alpha feature, set `enable-api-fields` to `alpha` to use it. | -| `results..path` | The path to the file where the `Task` writes its results data. | -| `results[''].path` | (see above) | -| `results[""].path` | (see above) | -| `workspaces..path` | The path to the mounted `Workspace`. Empty string if an optional `Workspace` has not been provided by the TaskRun. | -| `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if an optional`Workspace` has not been provided by the TaskRun. | -| `workspaces..claim` | The name of the `PersistentVolumeClaim` specified as a volume source for the `Workspace`. Empty string for other volume types. | -| `workspaces..volume` | The name of the volume populating the `Workspace`. | -| `credentials.path` | The path to credentials injected from Secrets with matching annotations. | -| `context.taskRun.name` | The name of the `TaskRun` that this `Task` is running in. | -| `context.taskRun.namespace` | The namespace of the `TaskRun` that this `Task` is running in. | -| `context.taskRun.uid` | The uid of the `TaskRun` that this `Task` is running in. | -| `context.task.name` | The name of this `Task`. | -| `context.task.retry-count` | The current retry number of this `Task`. | -| `steps.step-.exitCode.path` | The path to the file where a Step's exit code is stored. | -| `steps.step-unnamed-.exitCode.path` | The path to the file where a Step's exit code is stored for a step without any name. | -| `artifacts.path` | The path to the file where the `Task` writes its artifacts data. | +| `results..path` | The path to the file where the `Task` writes its results data. | +| `results[''].path` | (see above) | +| `results[""].path` | (see above) | +| `workspaces..path` | The path to the mounted `Workspace`. Empty string if an optional `Workspace` has not been provided by the TaskRun. | +| `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if an optional`Workspace` has not been provided by the TaskRun. | +| `workspaces..claim` | The name of the `PersistentVolumeClaim` specified as a volume source for the `Workspace`. Empty string for other volume types. | +| `workspaces..volume` | The name of the volume populating the `Workspace`. | +| `credentials.path` | The path to credentials injected from Secrets with matching annotations. | +| `context.taskRun.name` | The name of the `TaskRun` that this `Task` is running in. | +| `context.taskRun.namespace` | The namespace of the `TaskRun` that this `Task` is running in. | +| `context.taskRun.uid` | The uid of the `TaskRun` that this `Task` is running in. | +| `context.task.name` | The name of this `Task`. | +| `context.task.retry-count` | The current retry number of this `Task`. | +| `steps.step-.exitCode.path` | The path to the file where a Step's exit code is stored. | +| `steps.step-unnamed-.exitCode.path` | The path to the file where a Step's exit code is stored for a step without any name. | ## Fields that accept variable substitutions diff --git a/upstream/docs/windows.md b/upstream/docs/windows.md index 93c95f6b7b4..fc3b39bd1dc 100644 --- a/upstream/docs/windows.md +++ b/upstream/docs/windows.md @@ -36,12 +36,12 @@ In order to ensure that Tasks are scheduled to a node with the correct host OS, ### Node Selectors -Node selectors are the simplest way to schedule pods to a Windows or Linux node. By default, Kubernetes nodes include a label `kubernetes.io/os` to identify the host OS. The Kubelet populates this with `runtime.GOOS` as defined by Go. Use `spec.podTemplate.nodeSelector` (or `spec.taskRunSpecs[i].podTemplate.nodeSelector` in a PipelineRun) to schedule Tasks to a node with a specific label and value. +Node selectors are the simplest way to schedule pods to a Windows or Linux node. By default, Kubernetes nodes include a label `kubernetes.io/os` to identify the host OS. The Kubelet populates this with `runtime.GOOS` as defined by Go. Use `spec.podTemplate.nodeSelector` (or `spec.taskRunSpecs[i].taskPodTemplate.nodeSelector` in a PipelineRun) to schedule Tasks to a node with a specific label and value. For example: ``` yaml -apiVersion: tekton.dev/v1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: windows-taskrun @@ -52,7 +52,7 @@ spec: nodeSelector: kubernetes.io/os: windows --- -apiVersion: tekton.dev/v1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: linux-taskrun @@ -71,7 +71,7 @@ Node affinity can be used as an alternative method of defining the OS requiremen For example: ```yaml -apiVersion: tekton.dev/v1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: windows-taskrun @@ -89,7 +89,7 @@ spec: values: - windows --- -apiVersion: tekton.dev/v1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: linux-taskrun diff --git a/upstream/examples/v1/pipelineruns/4808-regression.yaml b/upstream/examples/v1/pipelineruns/4808-regression.yaml index f1258cba7ce..375f3f3389d 100644 --- a/upstream/examples/v1/pipelineruns/4808-regression.yaml +++ b/upstream/examples/v1/pipelineruns/4808-regression.yaml @@ -11,7 +11,7 @@ spec: type: string steps: - name: print-result - image: mirror.gcr.io/bash + image: bash:latest env: - name: PARAM_TO_PRINT value: $(params.TO_PRINT) @@ -39,7 +39,7 @@ spec: description: A result string steps: - name: gen-result - image: mirror.gcr.io/bash + image: bash:latest env: - name: PARAM_STRING_LENGTH value: $(params.STRING_LENGTH) diff --git a/upstream/examples/v1/pipelineruns/6139-regression.yaml b/upstream/examples/v1/pipelineruns/6139-regression.yaml index 3fef69f8a97..4fc16c0ed1a 100644 --- a/upstream/examples/v1/pipelineruns/6139-regression.yaml +++ b/upstream/examples/v1/pipelineruns/6139-regression.yaml @@ -15,7 +15,7 @@ spec: results: - name: result-one steps: - - image: mirror.gcr.io/alpine + - image: alpine script: | #!/bin/sh echo "Hello world!" @@ -28,7 +28,7 @@ spec: results: - name: result-two steps: - - image: mirror.gcr.io/alpine + - image: alpine script: | #!/bin/sh echo "Goodbye world!" @@ -43,7 +43,7 @@ spec: results: - name: result-three steps: - - image: mirror.gcr.io/alpine + - image: alpine script: | #!/bin/sh echo "Shutdown world!" diff --git a/upstream/examples/v1/pipelineruns/alpha/consume-artifacts-from-task.yaml b/upstream/examples/v1/pipelineruns/alpha/consume-artifacts-from-task.yaml deleted file mode 100644 index 6ca60999c7f..00000000000 --- a/upstream/examples/v1/pipelineruns/alpha/consume-artifacts-from-task.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - generateName: pipelinerun-consume-tasks-artifacts -spec: - pipelineSpec: - tasks: - - name: produce-artifacts-task - taskSpec: - description: | - A simple task that produces artifacts - steps: - - name: produce-artifacts - image: bash:latest - script: | - #!/usr/bin/env bash - cat > $(artifacts.path) << EOF - { - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF - - name: consume-artifacts - runAfter: - - produce-artifacts-task - taskSpec: - steps: - - name: artifacts-consumer-python - image: python:latest - script: | - #!/usr/bin/env python3 - import json - data = json.loads('$(tasks.produce-artifacts-task.outputs.image)') - if data[0]['uri'] != "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c": - exit(1) \ No newline at end of file diff --git a/upstream/examples/v1/pipelineruns/alpha/ignore-task-error.yaml b/upstream/examples/v1/pipelineruns/alpha/ignore-task-error.yaml new file mode 100644 index 00000000000..a7ee3656c3e --- /dev/null +++ b/upstream/examples/v1/pipelineruns/alpha/ignore-task-error.yaml @@ -0,0 +1,25 @@ +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: + generateName: pipelinerun-with-failing-task- +spec: + pipelineSpec: + tasks: + - name: echo-continue + onError: continue + taskSpec: + steps: + - name: write + image: alpine + script: | + echo "this is a failing task" + exit 1 + - name: echo + runAfter: + - echo-continue + taskSpec: + steps: + - name: write + image: alpine + script: | + echo "this is a success task" diff --git a/upstream/examples/v1/pipelineruns/alpha/param-enum.yaml b/upstream/examples/v1/pipelineruns/alpha/param-enum.yaml index af35cb5acb2..9f6758bc891 100644 --- a/upstream/examples/v1/pipelineruns/alpha/param-enum.yaml +++ b/upstream/examples/v1/pipelineruns/alpha/param-enum.yaml @@ -9,7 +9,7 @@ spec: enum: ["v1", "v2", "v3"] steps: - name: build - image: mirror.gcr.io/bash + image: bash:latest script: | echo "$(params.message)" --- diff --git a/upstream/examples/v1/pipelineruns/alpha/pipelinerun-large-results.yaml b/upstream/examples/v1/pipelineruns/alpha/pipelinerun-large-results.yaml index 6f81715dd77..be1da100bf7 100644 --- a/upstream/examples/v1/pipelineruns/alpha/pipelinerun-large-results.yaml +++ b/upstream/examples/v1/pipelineruns/alpha/pipelinerun-large-results.yaml @@ -20,7 +20,7 @@ spec: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | # produce a result - a random string with 2,500 characters - result1 tr -dc A-Za-z0-9 $(results.suffix.path) - name: do-something @@ -25,7 +25,7 @@ spec: - name: arg steps: - name: do-something - image: mirror.gcr.io/alpine + image: alpine script: | echo "$(params.arg)" | grep "prefix:suffix" params: diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-results.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-results.yaml index 3da5ae4cc86..ceae7eb5de3 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-results.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-results.yaml @@ -13,7 +13,7 @@ spec: description: the sum of the first and second operand steps: - name: add - image: mirror.gcr.io/alpine + image: alpine env: - name: OP1 value: $(params.first) diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-task-execution-status.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-task-execution-status.yaml index 73c7022724e..03374bb7206 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-task-execution-status.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-task-execution-status.yaml @@ -10,7 +10,7 @@ spec: - name: task1 # successful task taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: hello script: | echo "Hello World!" @@ -21,7 +21,7 @@ spec: values: ["true"] taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: success script: | exit 0 @@ -37,7 +37,7 @@ spec: - name: task1Status - name: task2Status steps: - - image: mirror.gcr.io/alpine + - image: alpine name: verify-dag-task-status script: | if [[ $(params.task1Status) != "Succeeded" || $(params.task2Status) != "None" ]]; then @@ -51,7 +51,7 @@ spec: params: - name: aggregateStatus steps: - - image: mirror.gcr.io/alpine + - image: alpine name: verify-aggregate-tasks-status script: | if [[ $(params.aggregateStatus) != "Completed" ]]; then diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml index 183a8cac004..e70184d1a71 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml @@ -5,7 +5,7 @@ metadata: spec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo bar > $(workspaces.task-ws.path)/foo workspaces: - name: task-ws @@ -24,10 +24,10 @@ spec: - name: local-ws steps: - name: read-1 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.local-ws.path)/$(params.directory1)/foo | grep bar - name: read-2 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.local-ws.path)/$(params.directory2)/foo | grep bar --- apiVersion: tekton.dev/v1 diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-using-parameterized-subpath-of-workspace.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-using-parameterized-subpath-of-workspace.yaml index e0dd0c66f55..6028a16e959 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-using-parameterized-subpath-of-workspace.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-using-parameterized-subpath-of-workspace.yaml @@ -5,7 +5,7 @@ metadata: spec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo bar > $(workspaces.task-ws.path)/foo workspaces: - name: task-ws @@ -24,10 +24,10 @@ spec: - name: local-ws steps: - name: read-1 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.local-ws.path)/$(params.directory1)/foo | grep bar - name: read-2 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.local-ws.path)/$(params.directory2)/foo | grep bar --- apiVersion: tekton.dev/v1 diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-extra-params.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-extra-params.yaml index 4cc2b08d372..7e2472700a9 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-extra-params.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-extra-params.yaml @@ -35,7 +35,7 @@ spec: description: The second integer steps: - name: sum - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(inputs.params.a)" + "$(inputs.params.b)" )) diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-final-results.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-final-results.yaml index e8e9d3d3004..e3226a82795 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-final-results.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-final-results.yaml @@ -58,7 +58,7 @@ spec: description: The product of the two provided integers steps: - name: product - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(params.a)" * "$(params.b)" )) | tee $(results.product.path) diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-final-tasks.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-final-tasks.yaml index c89852f0fb5..f410943e7ef 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-final-tasks.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-final-tasks.yaml @@ -116,18 +116,18 @@ spec: - name: source steps: - name: check-application-dir-has-source - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ ! -d "$(workspaces.source.path)/application/" ]; then echo "Something went wrong and could not find application source under $(workspaces.source.path)/application/" exit 1 fi - name: cleanup-workspace - image: mirror.gcr.io/ubuntu + image: ubuntu script: | rm -rf $(workspaces.source.path)/application/ - name: verify-application-dir-has-gone - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ -d "$(workspaces.source.path)/application/" ]; then echo "Something went wrong cleaning up and the application source still exists under $(workspaces.source.path)/application/" @@ -174,7 +174,7 @@ spec: - name: commit steps: - name: check-commit-initialized - image: mirror.gcr.io/alpine + image: alpine script: | if [[ ! $(params.commit) ]]; then exit 1 diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml index d1d227f7430..c4668041b2c 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml @@ -106,7 +106,7 @@ spec: description: A result message steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.message) | tee $(workspaces.task-ws.path)/message $(results.message.path) workspaces: - name: task-ws @@ -127,7 +127,7 @@ spec: description: Input message in upper case steps: - name: to-upper - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.w.path)/$(params.input-path) | tr '[:lower:]' '[:upper:]' | tee $(workspaces.w.path)/upper $(results.message.path) workspaces: - name: w @@ -148,7 +148,7 @@ spec: description: Input message in lower case steps: - name: to-lower - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.w.path)/$(params.input-path) | tr '[:upper:]' '[:lower:]' | tee $(workspaces.w.path)/lower $(results.message.path) workspaces: - name: w @@ -166,7 +166,7 @@ spec: type: string steps: - name: report-result - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.result-to-report) --- apiVersion: tekton.dev/v1 @@ -176,10 +176,10 @@ metadata: spec: steps: - name: validate-upper - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.files.path)/upper | grep HELLO\ TEKTON - name: validate-lower - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.files.path)/lower | grep hello\ tekton workspaces: - name: files diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-params.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-params.yaml index 232965eae9a..5a86ef4841b 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-params.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-params.yaml @@ -47,7 +47,7 @@ spec: description: The second integer steps: - name: sum - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(inputs.params.a)" + "$(inputs.params.b)" )) @@ -71,7 +71,7 @@ spec: description: The second integer steps: - name: product - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(inputs.params.a)" * "$(inputs.params.b)" )) diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml index 45431740245..60316328506 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml @@ -12,7 +12,7 @@ spec: app: "example" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "Good Morning!" @@ -38,7 +38,7 @@ spec: default: "Hello World!" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "$(params.MESSAGE)" @@ -70,7 +70,7 @@ spec: default: "Hello World!" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "$(params.MESSAGE)" diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec.yaml index d97f93f01dd..c7dd4455244 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-pipelinespec.yaml @@ -9,7 +9,7 @@ spec: default: "Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu command: - echo args: diff --git a/upstream/examples/v1/pipelineruns/pipelinerun-with-when-expressions.yaml b/upstream/examples/v1/pipelineruns/pipelinerun-with-when-expressions.yaml index fd0768a7d78..1033bd5d99f 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun-with-when-expressions.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun-with-when-expressions.yaml @@ -32,7 +32,7 @@ spec: description: The workspace to create the readme file in steps: - name: write-new-stuff - image: mirror.gcr.io/ubuntu + image: ubuntu script: 'touch $(workspaces.source.path)/README.md' - name: check-file params: @@ -54,7 +54,7 @@ spec: description: indicates whether the file exists or is missing steps: - name: check-file - image: mirror.gcr.io/alpine + image: alpine script: | if test -f $(workspaces.source.path)/$(params.path); then printf yes | tee $(results.exists.path) @@ -69,7 +69,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: 'echo file exists' - name: sample-task-with-array-values when: @@ -79,7 +79,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/alpine + image: alpine script: 'echo hello' - name: task-should-be-skipped-1 when: @@ -89,7 +89,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: task-should-be-skipped-2 # when expression using parameter, evaluates to false when: @@ -99,7 +99,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: task-should-be-skipped-3 # task with when expression and run after runAfter: @@ -111,7 +111,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: task-should-be-skipped-4 # task with when expression using array parameter, evaluates to false when: @@ -121,7 +121,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/alpine + image: alpine script: exit 1 finally: - name: finally-task-should-be-skipped-1 # when expression using execution status, evaluates to false @@ -132,7 +132,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: finally-task-should-be-skipped-2 # when expression using task result, evaluates to false when: @@ -142,7 +142,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: finally-task-should-be-skipped-3 # when expression using parameter, evaluates to false when: @@ -152,7 +152,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: finally-task-should-be-skipped-4 # when expression using tasks execution status, evaluates to false when: @@ -162,7 +162,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: finally-task-should-be-skipped-5 # when expression using tasks execution status, evaluates to false when: @@ -172,7 +172,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: exit 1 - name: finally-task-should-be-executed # when expression using execution status, tasks execution status, param, and results when: @@ -191,7 +191,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: 'echo finally done' params: - name: path diff --git a/upstream/examples/v1/pipelineruns/pipelinerun.yaml b/upstream/examples/v1/pipelineruns/pipelinerun.yaml index fb7c43fcd33..6c4a6617364 100644 --- a/upstream/examples/v1/pipelineruns/pipelinerun.yaml +++ b/upstream/examples/v1/pipelineruns/pipelinerun.yaml @@ -161,7 +161,7 @@ spec: securityContext: runAsUser: 0 - name: write-url - image: mirror.gcr.io/bash:5.1.4@sha256:c523c636b722339f41b6a431b44588ab2f762c5de5ec3bd7964420ff982fb1d9 + image: docker.io/library/bash:5.1.4@sha256:c523c636b722339f41b6a431b44588ab2f762c5de5ec3bd7964420ff982fb1d9 script: | set -e image="$(params.IMAGE)" diff --git a/upstream/examples/v1/pipelineruns/propagating-workspaces-in-pipelines.yaml b/upstream/examples/v1/pipelineruns/propagating-workspaces-in-pipelines.yaml deleted file mode 100644 index c59740378ba..00000000000 --- a/upstream/examples/v1/pipelineruns/propagating-workspaces-in-pipelines.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Pipeline -metadata: - name: workspace-example -spec: - workspaces: - - name: shared-data - tasks: - - name: t1 - taskSpec: - steps: - - image: mirror.gcr.io/ubuntu - command: ["ls"] - args: ["$(workspaces.shared-data.path)"] ---- -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: workspace-example-run -spec: - pipelineRef: - name: workspace-example - workspaces: - - name: shared-data - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 16Mi - volumeMode: Filesystem diff --git a/upstream/examples/v1/pipelineruns/propagating-workspaces.yaml b/upstream/examples/v1/pipelineruns/propagating-workspaces.yaml index aa2c64ad47c..3b7474f9514 100644 --- a/upstream/examples/v1/pipelineruns/propagating-workspaces.yaml +++ b/upstream/examples/v1/pipelineruns/propagating-workspaces.yaml @@ -57,7 +57,7 @@ spec: taskSpec: steps: - name: fetch-and-write-secure - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ "hunter2" = "$(cat $(workspaces.password-vault.path)/password)" ]; then cp $(workspaces.recipe-store.path)/recipe.txt $(workspaces.shared-data.path) @@ -72,5 +72,5 @@ spec: taskSpec: steps: - name: print-secrets - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.shared-data.path)/$(params.filename) diff --git a/upstream/examples/v1/pipelineruns/propagating_params_implicit_parameters.yaml b/upstream/examples/v1/pipelineruns/propagating_params_implicit_parameters.yaml index dde58ab75c4..e1d8fc147ce 100644 --- a/upstream/examples/v1/pipelineruns/propagating_params_implicit_parameters.yaml +++ b/upstream/examples/v1/pipelineruns/propagating_params_implicit_parameters.yaml @@ -12,7 +12,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "$(params.HELLO)" @@ -21,7 +21,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "And Finally ... $(params.HELLO)" diff --git a/upstream/examples/v1/pipelineruns/propagating_params_in_pipeline.yaml b/upstream/examples/v1/pipelineruns/propagating_params_in_pipeline.yaml deleted file mode 100644 index e91b5d04cd8..00000000000 --- a/upstream/examples/v1/pipelineruns/propagating_params_in_pipeline.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Pipeline -metadata: - name: propagating-params-in-pipeline -spec: - params: - - name: HELLO - default: "Pipeline Hello World!" - tasks: - - name: echo-hello - taskSpec: - steps: - - name: echo - image: mirror.gcr.io/ubuntu - script: | - #!/usr/bin/env bash - echo "$(params.HELLO)" - finally: - - name: echo-hello-finally - taskSpec: - steps: - - name: echo - image: mirror.gcr.io/ubuntu - script: | - #!/usr/bin/env bash - echo "And Finally ... $(params.HELLO)" ---- -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - generateName: propagating-params-in-pipeline- -spec: - params: - - name: HELLO - value: "Hello from pipeline run" - pipelineRef: - name: propagating-params-in-pipeline \ No newline at end of file diff --git a/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence.yaml b/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence.yaml index 3adc9e6528e..273397e8d7a 100644 --- a/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence.yaml +++ b/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence.yaml @@ -15,7 +15,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "$(params.HELLO)" @@ -27,7 +27,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "And finally.. $(params.HELLO)" diff --git a/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence_default_only.yaml b/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence_default_only.yaml index 835c48c30ec..697c5793a3f 100644 --- a/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence_default_only.yaml +++ b/upstream/examples/v1/pipelineruns/propagating_params_with_scope_precedence_default_only.yaml @@ -15,7 +15,7 @@ spec: default: "Default Hello World!" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "$(params.HELLO)" @@ -27,7 +27,7 @@ spec: default: "Default Hello World!" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "And finally... $(params.HELLO)" diff --git a/upstream/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml b/upstream/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml index a8b4fc2e30a..d0a16eae5ab 100644 --- a/upstream/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml +++ b/upstream/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml @@ -8,7 +8,7 @@ spec: type: string steps: - name: uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo "1001" | tee $(results.uid.path) @@ -27,7 +27,7 @@ spec: taskSpec: steps: - name: show-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo $(tasks.add-uid.results.uid) diff --git a/upstream/examples/v1/pipelineruns/propagating_workspaces_with_referenced_resources.yaml b/upstream/examples/v1/pipelineruns/propagating_workspaces_with_referenced_resources.yaml index acf31687a53..01bdc63e23f 100644 --- a/upstream/examples/v1/pipelineruns/propagating_workspaces_with_referenced_resources.yaml +++ b/upstream/examples/v1/pipelineruns/propagating_workspaces_with_referenced_resources.yaml @@ -8,7 +8,7 @@ spec: - name: shared-data steps: - name: fetch-and-write - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo hi >> $(workspaces.shared-data.path)/recipe.txt --- @@ -38,7 +38,7 @@ spec: taskSpec: steps: - name: print-secrets - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.shared-data.path)/recipe.txt runAfter: - fetch-the-recipe diff --git a/upstream/examples/v1/pipelineruns/task_results_example.yaml b/upstream/examples/v1/pipelineruns/task_results_example.yaml index b0c67e5d2f1..17a35e159d4 100644 --- a/upstream/examples/v1/pipelineruns/task_results_example.yaml +++ b/upstream/examples/v1/pipelineruns/task_results_example.yaml @@ -58,7 +58,7 @@ spec: description: The sum of the two provided integers steps: - name: sum - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(params.a)" + "$(params.b)" )) | tee $(results.sum.path) @@ -85,7 +85,7 @@ spec: description: The product of the two provided integers steps: - name: product - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n $(( "$(params.a)" * "$(params.b)" )) | tee $(results.product.path) diff --git a/upstream/examples/v1/pipelineruns/using-optional-workspaces-in-when-expressions.yaml b/upstream/examples/v1/pipelineruns/using-optional-workspaces-in-when-expressions.yaml index 596067f5daa..6fca152a139 100644 --- a/upstream/examples/v1/pipelineruns/using-optional-workspaces-in-when-expressions.yaml +++ b/upstream/examples/v1/pipelineruns/using-optional-workspaces-in-when-expressions.yaml @@ -47,7 +47,7 @@ spec: - name: message-of-the-day optional: true steps: - - image: mirror.gcr.io/alpine + - image: alpine script: | #!/usr/bin/env ash for f in "$(workspaces.message-of-the-day.path)"/* ; do @@ -63,6 +63,6 @@ spec: taskSpec: steps: - name: print-default - image: mirror.gcr.io/alpine + image: alpine script: | echo "No message-of-the-day workspace was provided. This is the default MOTD instead!" diff --git a/upstream/examples/v1/pipelineruns/using-retries-and-retry-count-variables.yaml b/upstream/examples/v1/pipelineruns/using-retries-and-retry-count-variables.yaml index 67eb21388d8..cbaa64facc3 100644 --- a/upstream/examples/v1/pipelineruns/using-retries-and-retry-count-variables.yaml +++ b/upstream/examples/v1/pipelineruns/using-retries-and-retry-count-variables.yaml @@ -19,7 +19,7 @@ spec: - name: pipelineTask-retries - name: pipelineTask-retry-count steps: - - image: mirror.gcr.io/alpine + - image: alpine:3.12.0 script: | #!/usr/bin/env sh if [ "$(params.pipelineTask-retry-count)" == "$(params.pipelineTask-retries)" ]; then @@ -33,6 +33,6 @@ spec: - retry-me taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: | echo "hello world" diff --git a/upstream/examples/v1/pipelineruns/using_context_variables.yaml b/upstream/examples/v1/pipelineruns/using_context_variables.yaml index 151909d11da..7d7de6661ff 100644 --- a/upstream/examples/v1/pipelineruns/using_context_variables.yaml +++ b/upstream/examples/v1/pipelineruns/using_context_variables.yaml @@ -28,12 +28,12 @@ spec: - name: pipelineRun-namespace - name: pipelineTask-retries steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: print-uid script: | echo "TaskRun UID: $(context.taskRun.uid)" echo "PipelineRun UID from params: $(params.pipeline-uid)" - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: print-names script: | echo "Task name: $(context.task.name)" @@ -41,7 +41,7 @@ spec: echo "Pipeline name from params: $(params.pipeline-name)" echo "PipelineRun name from params: $(params.pipelineRun-name)" echo "PipelineRun namespace from params: $(params.pipelineRun-namespace)" - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: print-retries script: | echo "PipelineTask retries from params: $(params.pipelineTask-retries)" diff --git a/upstream/examples/v1/pipelineruns/workspace-from-volumeclaimtemplate.yaml b/upstream/examples/v1/pipelineruns/workspace-from-volumeclaimtemplate.yaml index 9b37da6523d..a789709ee6f 100644 --- a/upstream/examples/v1/pipelineruns/workspace-from-volumeclaimtemplate.yaml +++ b/upstream/examples/v1/pipelineruns/workspace-from-volumeclaimtemplate.yaml @@ -8,7 +8,7 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo bar > $(workspaces.task-ws.path)/foo workspaces: - name: task-ws @@ -21,7 +21,7 @@ spec: taskSpec: steps: - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.myws.path)/foo | grep bar workspaces: - name: myws diff --git a/upstream/examples/v1/pipelineruns/workspaces-projected.yaml b/upstream/examples/v1/pipelineruns/workspaces-projected.yaml index d6c71f04aa1..56b3c9b871a 100644 --- a/upstream/examples/v1/pipelineruns/workspaces-projected.yaml +++ b/upstream/examples/v1/pipelineruns/workspaces-projected.yaml @@ -56,7 +56,7 @@ spec: - name: filedrop steps: - name: fetch-and-write - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ "hunter2" = "$(cat $(workspaces.secure-store.path)/password)" ]; then cp $(workspaces.secure-store.path)/recipe.txt $(workspaces.filedrop.path) @@ -77,7 +77,7 @@ spec: - name: filename steps: - name: print-secrets - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.storage.path)/$(params.filename) --- apiVersion: tekton.dev/v1 diff --git a/upstream/examples/v1/pipelineruns/workspaces.yaml b/upstream/examples/v1/pipelineruns/workspaces.yaml index 7c5b8b40f45..38d6116de39 100644 --- a/upstream/examples/v1/pipelineruns/workspaces.yaml +++ b/upstream/examples/v1/pipelineruns/workspaces.yaml @@ -56,7 +56,7 @@ spec: - name: filedrop steps: - name: fetch-and-write - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ "hunter2" = "$(cat $(workspaces.super-secret-password.path)/password)" ]; then cp $(workspaces.secure-store.path)/recipe.txt $(workspaces.filedrop.path) @@ -77,7 +77,7 @@ spec: - name: filename steps: - name: print-secrets - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.storage.path)/$(params.filename) --- apiVersion: tekton.dev/v1 diff --git a/upstream/examples/v1/taskruns/beta/large-task-result.yaml b/upstream/examples/v1/taskruns/alpha/large-task-result.yaml similarity index 93% rename from upstream/examples/v1/taskruns/beta/large-task-result.yaml rename to upstream/examples/v1/taskruns/alpha/large-task-result.yaml index 9ff63507da7..4401fc10208 100644 --- a/upstream/examples/v1/taskruns/beta/large-task-result.yaml +++ b/upstream/examples/v1/taskruns/alpha/large-task-result.yaml @@ -14,13 +14,13 @@ spec: - name: result5 steps: - name: step1 - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash cat /dev/urandom | head -c 2500 | base64 | tee $(results.result1.path) #about 1 K result cat /dev/urandom | head -c 2500 | base64 | tee $(results.result2.path) #about 4 K result - name: step2 - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash cat /dev/urandom | head -c 2500 | base64 | tee $(results.result3.path) #about 1 K result diff --git a/upstream/examples/v1/taskruns/alpha/param-enum.yaml b/upstream/examples/v1/taskruns/alpha/param-enum.yaml index 7aac281d218..77deb40549f 100644 --- a/upstream/examples/v1/taskruns/alpha/param-enum.yaml +++ b/upstream/examples/v1/taskruns/alpha/param-enum.yaml @@ -9,7 +9,7 @@ spec: default: "v1" steps: - name: build - image: mirror.gcr.io/bash + image: bash:3.2 script: | echo "$(params.message)" --- diff --git a/upstream/examples/v1/taskruns/alpha/produce-consume-artifacts.yaml b/upstream/examples/v1/taskruns/alpha/produce-consume-artifacts.yaml index 3238649b2ea..e270b1b85ff 100644 --- a/upstream/examples/v1/taskruns/alpha/produce-consume-artifacts.yaml +++ b/upstream/examples/v1/taskruns/alpha/produce-consume-artifacts.yaml @@ -6,12 +6,9 @@ spec: taskSpec: description: | A simple task that populates artifacts to TaskRun stepState - params: - - name: buildOutput - default: true steps: - name: artifacts-producer - image: mirror.gcr.io/bash + image: bash:latest script: | cat > $(step.artifacts.path) << EOF { @@ -20,7 +17,7 @@ spec: "name":"input-artifacts", "values":[ { - "uri":"pkg:example.github.com/inputs", + "uri":"git:jjjsss", "digest":{ "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" } @@ -31,10 +28,9 @@ spec: "outputs":[ { "name":"image", - "buildOutput": $(params.buildOutput), "values":[ { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", + "uri":"pkg:balba", "digest":{ "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" @@ -46,13 +42,14 @@ spec: } EOF - name: artifacts-consumer - image: mirror.gcr.io/bash + image: bash:latest script: | + echo $(steps.artifacts-producer.outputs) echo $(steps.artifacts-producer.inputs.input-artifacts) - name: artifacts-consumer-python - image: mirror.gcr.io/python:3.12.4 + image: python:latest script: | #!/usr/bin/env python3 import json - data = json.loads('$(steps.artifacts-producer.outputs.image)') + data = json.loads('$(steps.artifacts-producer.outputs)') print(data[0]['uri']) diff --git a/upstream/examples/v1/taskruns/alpha/step-stream-results.yaml b/upstream/examples/v1/taskruns/alpha/step-stream-results.yaml index 2e315f9c4a6..c94d7d9d9ed 100644 --- a/upstream/examples/v1/taskruns/alpha/step-stream-results.yaml +++ b/upstream/examples/v1/taskruns/alpha/step-stream-results.yaml @@ -20,7 +20,7 @@ spec: image: gcr.io/go-containerregistry/crane args: - digest - - mirror.gcr.io/bash + - docker.io/library/bash stdoutConfig: path: $(results.digest.path) stderrConfig: @@ -28,7 +28,7 @@ spec: # This step redirects stdout and stderr to the path for the Task # result `combined`. - name: error - image: mirror.gcr.io/bash + image: docker.io/library/bash onError: continue script: echo "combined message" && nonsense stdoutConfig: @@ -38,7 +38,7 @@ spec: # This step prints out the contents of the task results # if they exist - name: log-results - image: mirror.gcr.io/bash + image: docker.io/library/bash script: | if [[ -f $(results.digest.path) ]] then diff --git a/upstream/examples/v1/taskruns/alpha/step-stream-volumes.yaml b/upstream/examples/v1/taskruns/alpha/step-stream-volumes.yaml index 0924e6ad2c6..2505c7855fe 100644 --- a/upstream/examples/v1/taskruns/alpha/step-stream-volumes.yaml +++ b/upstream/examples/v1/taskruns/alpha/step-stream-volumes.yaml @@ -10,7 +10,7 @@ spec: - name: data steps: - name: echo - image: mirror.gcr.io/bash + image: docker.io/library/bash volumeMounts: - name: data mountPath: /data @@ -18,7 +18,7 @@ spec: stdoutConfig: path: /data/step-echo-stdout - name: error - image: mirror.gcr.io/bash + image: docker.io/library/bash onError: continue volumeMounts: - name: data @@ -29,7 +29,7 @@ spec: stderrConfig: path: /data/step-error-stderr - name: combined - image: mirror.gcr.io/bash + image: docker.io/library/bash onError: continue volumeMounts: - name: data @@ -40,7 +40,7 @@ spec: stderrConfig: path: /data/step-combined - name: cat - image: mirror.gcr.io/bash + image: docker.io/library/bash volumeMounts: - name: data mountPath: /data @@ -48,7 +48,7 @@ spec: stdoutConfig: path: /data/step-cat-stdout - name: log-data - image: mirror.gcr.io/bash + image: docker.io/library/bash volumeMounts: - name: data mountPath: /data diff --git a/upstream/examples/v1/taskruns/alpha/step-stream-workspace.yaml b/upstream/examples/v1/taskruns/alpha/step-stream-workspace.yaml index 24d055c0204..d8f632d115e 100644 --- a/upstream/examples/v1/taskruns/alpha/step-stream-workspace.yaml +++ b/upstream/examples/v1/taskruns/alpha/step-stream-workspace.yaml @@ -18,7 +18,7 @@ spec: - name: data args: - digest - - mirror.gcr.io/bash + - docker.io/library/bash stdoutConfig: path: $(results.digest.path) - image: gcr.io/go-containerregistry/crane @@ -26,7 +26,7 @@ spec: - name: data args: - digest - - mirror.gcr.io/bash + - docker.io/library/bash stdoutConfig: path: $(workspaces.data.path)/stdout.txt - image: gcr.io/go-containerregistry/crane @@ -43,26 +43,26 @@ spec: - wrong stderrConfig: path: $(results.error2.path) - - image: mirror.gcr.io/bash + - image: docker.io/library/bash workspaces: - name: data onError: continue args: - -c - "echo foobar >$(workspaces.data.path)/foobar.txt" - - image: mirror.gcr.io/bash + - image: docker.io/library/bash onError: continue args: - -c - "2>$(results.error.path) >&2 echo -n fooerr" - - image: mirror.gcr.io/bash + - image: docker.io/library/bash workspaces: - name: data workingDir: $(workspaces.data.path) onError: continue script: | echo local >out.txt - - image: mirror.gcr.io/bash + - image: docker.io/library/bash workspaces: - name: data onError: continue diff --git a/upstream/examples/v1/taskruns/beta/stepaction-git-resolver.yaml b/upstream/examples/v1/taskruns/alpha/stepaction-git-resolver.yaml similarity index 62% rename from upstream/examples/v1/taskruns/beta/stepaction-git-resolver.yaml rename to upstream/examples/v1/taskruns/alpha/stepaction-git-resolver.yaml index 3bdaf7df327..346f515be67 100644 --- a/upstream/examples/v1/taskruns/beta/stepaction-git-resolver.yaml +++ b/upstream/examples/v1/taskruns/alpha/stepaction-git-resolver.yaml @@ -6,11 +6,11 @@ metadata: spec: params: - name: pathInRepo - value: stepaction/git-clone/0.1/git-clone.yaml + value: basic_step.yaml - name: revision value: main - name: repoUrl - value: https://github.com/tektoncd/catalog.git + value: https://github.com/chitrangpatel/repo1M.git TaskSpec: steps: - name: action-runner @@ -23,10 +23,3 @@ spec: value: $(params.revision) - name: pathInRepo value: $(params.pathInRepo) - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: revision - value: master - - name: output-path - value: /workspace diff --git a/upstream/examples/v1/taskruns/beta/stepaction-params.yaml b/upstream/examples/v1/taskruns/alpha/stepaction-params.yaml similarity index 97% rename from upstream/examples/v1/taskruns/beta/stepaction-params.yaml rename to upstream/examples/v1/taskruns/alpha/stepaction-params.yaml index c40c89cf6c6..52402bbdfe6 100644 --- a/upstream/examples/v1/taskruns/beta/stepaction-params.yaml +++ b/upstream/examples/v1/taskruns/alpha/stepaction-params.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: step-action @@ -40,7 +40,7 @@ spec: value: $(params.object-param.key2) - name: objectparamkey3 value: $(params.object-param.key3) - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/bin/bash ARRAYVALUE=("${arrayparam0}" "${arrayparam1}" "${arrayparam2}" "${stringparam}" "${objectparamkey1}" "${objectparamkey2}" "${objectparamkey3}") diff --git a/upstream/examples/v1/taskruns/beta/stepaction-passing-results.yaml b/upstream/examples/v1/taskruns/alpha/stepaction-passing-results.yaml similarity index 95% rename from upstream/examples/v1/taskruns/beta/stepaction-passing-results.yaml rename to upstream/examples/v1/taskruns/alpha/stepaction-passing-results.yaml index 56857a4a1bc..e02a771c746 100644 --- a/upstream/examples/v1/taskruns/beta/stepaction-passing-results.yaml +++ b/upstream/examples/v1/taskruns/alpha/stepaction-passing-results.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: step-action @@ -15,7 +15,7 @@ spec: type: string IMAGE_DIGEST: type: string - image: mirror.gcr.io/bash + image: bash:3.2 env: - name: STRINGPARAM value: $(params.param2) @@ -75,7 +75,7 @@ spec: type: string IMAGE_DIGEST: type: string - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "[\"image1\", \"image2\", \"image3\"]" | tee $(step.results.result1.path) echo -n "foo" | tee $(step.results.result2.path) diff --git a/upstream/examples/v1/taskruns/beta/stepaction-results.yaml b/upstream/examples/v1/taskruns/alpha/stepaction-results.yaml similarity index 89% rename from upstream/examples/v1/taskruns/beta/stepaction-results.yaml rename to upstream/examples/v1/taskruns/alpha/stepaction-results.yaml index a12336b3023..7ea048830a7 100644 --- a/upstream/examples/v1/taskruns/beta/stepaction-results.yaml +++ b/upstream/examples/v1/taskruns/alpha/stepaction-results.yaml @@ -1,9 +1,9 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: step-action spec: - image: mirror.gcr.io/alpine + image: alpine results: - name: result1 - name: result2 diff --git a/upstream/examples/v1/taskruns/alpha/stepaction-when.yaml b/upstream/examples/v1/taskruns/alpha/stepaction-when.yaml deleted file mode 100644 index 17ce0508adb..00000000000 --- a/upstream/examples/v1/taskruns/alpha/stepaction-when.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: my-pvc-2 -spec: - resources: - requests: - storage: 5Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce ---- -apiVersion: tekton.dev/v1alpha1 -kind: StepAction -metadata: - name: step-action-when -spec: - image: alpine - script: | - echo "I am a Step Action!!!" ---- -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: when-in-steps- -spec: - workspaces: - - name: custom - persistentVolumeClaim: - claimName: my-pvc-2 - taskSpec: - description: | - A simple task to demotrate how when expressions work in steps. - steps: - - name: should-execute - ref: - name: "step-action-when" - when: - - input: "$(workspaces.custom.bound)" - operator: in - values: ["true"] - - name: should-skip - image: bash:latest - script: | - #!/usr/bin/env bash - echo skipskipskip - when: - - input: "$(workspaces.custom2.bound)" - operator: in - values: ["true"] - - name: should-continue - image: bash:latest - script: | - #!/usr/bin/env bash - echo blabalbaba - - name: produce-step - image: alpine - results: - - name: result2 - type: string - script: | - echo -n "foo" | tee $(step.results.result2.path) - - name: run-based-on-step-results - image: alpine - script: | - echo "wooooooo" - when: - - input: "$(steps.produce-step.results.result2)" - operator: in - values: ["bar"] - workspaces: - - name: custom \ No newline at end of file diff --git a/upstream/examples/v1/taskruns/beta/stepaction.yaml b/upstream/examples/v1/taskruns/alpha/stepaction.yaml similarity index 81% rename from upstream/examples/v1/taskruns/beta/stepaction.yaml rename to upstream/examples/v1/taskruns/alpha/stepaction.yaml index 9cb5aff50c9..3acc1e263f4 100644 --- a/upstream/examples/v1/taskruns/beta/stepaction.yaml +++ b/upstream/examples/v1/taskruns/alpha/stepaction.yaml @@ -1,9 +1,9 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1alpha1 kind: StepAction metadata: name: step-action spec: - image: mirror.gcr.io/alpine + image: alpine script: | echo "I am a Step Action!!!" --- diff --git a/upstream/examples/v1/taskruns/alpha/task-artifacts.yaml b/upstream/examples/v1/taskruns/alpha/task-artifacts.yaml deleted file mode 100644 index 7357bdf245f..00000000000 --- a/upstream/examples/v1/taskruns/alpha/task-artifacts.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: task-run-artifacts -spec: - taskSpec: - description: | - A simple task that produces artifacts - steps: - - name: produce-artifacts - image: bash:latest - script: | - #!/usr/bin/env bash - cat > $(artifacts.path) << EOF - { - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF \ No newline at end of file diff --git a/upstream/examples/v1/taskruns/array-default.yaml b/upstream/examples/v1/taskruns/array-default.yaml index 45f6fc8cd90..a6cb4216c1c 100644 --- a/upstream/examples/v1/taskruns/array-default.yaml +++ b/upstream/examples/v1/taskruns/array-default.yaml @@ -23,7 +23,7 @@ spec: steps: # this step should echo "foo bar foo-default bar-default baz" - name: echo-params - image: mirror.gcr.io/bash + image: bash:3.2 args: [ "echo", "$(params.array-to-echo[*])", diff --git a/upstream/examples/v1/taskruns/authenticating-git-commands.yaml b/upstream/examples/v1/taskruns/authenticating-git-commands.yaml index c8d01221a33..4752c0f0b83 100644 --- a/upstream/examples/v1/taskruns/authenticating-git-commands.yaml +++ b/upstream/examples/v1/taskruns/authenticating-git-commands.yaml @@ -63,7 +63,7 @@ spec: emptyDir: {} sidecars: - name: server - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 volumeMounts: @@ -106,7 +106,7 @@ spec: - name: setup # This Step is only necessary as part of the test, it's not something you'll # ever need in a real-world scenario involving an external git repo. - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 volumeMounts: @@ -125,7 +125,7 @@ spec: sleep 1 done - name: git-clone-and-push - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 workingDir: /root diff --git a/upstream/examples/v1/taskruns/beta/authenticating-git-commands.yaml b/upstream/examples/v1/taskruns/beta/authenticating-git-commands.yaml index 6e732b0bec9..b059545b8a1 100644 --- a/upstream/examples/v1/taskruns/beta/authenticating-git-commands.yaml +++ b/upstream/examples/v1/taskruns/beta/authenticating-git-commands.yaml @@ -67,7 +67,7 @@ spec: mountPath: /messages sidecars: - name: server - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 script: | @@ -107,7 +107,7 @@ spec: - name: setup # This Step is only necessary as part of the test, it's not something you'll # ever need in a real-world scenario involving an external git repo. - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 script: | @@ -123,7 +123,7 @@ spec: sleep 1 done - name: git-clone-and-push - image: docker.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 securityContext: runAsUser: 0 workingDir: /root diff --git a/upstream/examples/v1/taskruns/beta/emit-array-results.yaml b/upstream/examples/v1/taskruns/beta/emit-array-results.yaml index a55c1cd49f8..ac384cd8bf2 100644 --- a/upstream/examples/v1/taskruns/beta/emit-array-results.yaml +++ b/upstream/examples/v1/taskruns/beta/emit-array-results.yaml @@ -12,12 +12,12 @@ spec: description: The array results steps: - name: write-array - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"hello\",\"world\"]" | tee $(results.array-results.path) - name: check-results-array - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/bin/bash VALUE=$(cat $(results.array-results.path)) diff --git a/upstream/examples/v1/taskruns/beta/param_array_indexing.yaml b/upstream/examples/v1/taskruns/beta/param_array_indexing.yaml index ec49c4e50b9..c654fbeb260 100644 --- a/upstream/examples/v1/taskruns/beta/param_array_indexing.yaml +++ b/upstream/examples/v1/taskruns/beta/param_array_indexing.yaml @@ -15,14 +15,14 @@ spec: steps: # this step should echo "foo" - name: echo-params-1 - image: mirror.gcr.io/bash + image: bash:3.2 args: [ "echo", "$(params.array-to-echo[0])", ] # this step should echo "bar" - name: echo-params-2 - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/bin/bash VALUE=$(params.array-to-echo[1]) diff --git a/upstream/examples/v1/taskruns/beta/propagated-object-parameters.yaml b/upstream/examples/v1/taskruns/beta/propagated-object-parameters.yaml index 7bf2531406f..ecb1c0b00b8 100644 --- a/upstream/examples/v1/taskruns/beta/propagated-object-parameters.yaml +++ b/upstream/examples/v1/taskruns/beta/propagated-object-parameters.yaml @@ -11,7 +11,7 @@ spec: taskSpec: steps: - name: echo-object-params - image: mirror.gcr.io/bash + image: bash args: [ "echo", "--url=$(params.gitrepo.url)", diff --git a/upstream/examples/v1/taskruns/beta/stepactions-steptemplate.yaml b/upstream/examples/v1/taskruns/beta/stepactions-steptemplate.yaml deleted file mode 100644 index 98f9420f4b9..00000000000 --- a/upstream/examples/v1/taskruns/beta/stepactions-steptemplate.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: StepAction -metadata: - name: step-action -spec: - image: mirror.gcr.io/alpine - command: ["env"] ---- -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: task-run -spec: - taskSpec: - steps: - - ref: - name: step-action - stepTemplate: - env: - - name: foo - value: bar \ No newline at end of file diff --git a/upstream/examples/v1/taskruns/beta/workspace-in-sidecar.yaml b/upstream/examples/v1/taskruns/beta/workspace-in-sidecar.yaml index 4fdae720aa3..47b4236369d 100644 --- a/upstream/examples/v1/taskruns/beta/workspace-in-sidecar.yaml +++ b/upstream/examples/v1/taskruns/beta/workspace-in-sidecar.yaml @@ -17,7 +17,7 @@ spec: workspaces: - name: signals steps: - - image: mirror.gcr.io/alpine + - image: alpine:3.12.0 computeResources: requests: memory: "16Mi" @@ -33,7 +33,7 @@ spec: echo "Sidecar responded: ${response}" echo "Step Done." sidecars: - - image: mirror.gcr.io/alpine + - image: alpine:3.12.0 computeResources: requests: memory: "16Mi" diff --git a/upstream/examples/v1/taskruns/beta/workspace-isolation.yaml b/upstream/examples/v1/taskruns/beta/workspace-isolation.yaml index 6e9cc990953..37e6f891537 100644 --- a/upstream/examples/v1/taskruns/beta/workspace-isolation.yaml +++ b/upstream/examples/v1/taskruns/beta/workspace-isolation.yaml @@ -18,7 +18,7 @@ spec: - name: signals steps: - name: await-sidecar-signal - image: mirror.gcr.io/alpine + image: alpine:3.12.0 workspaces: - name: signals script: | @@ -32,7 +32,7 @@ spec: done echo "Saw ready file" - name: check-signals-access - image: mirror.gcr.io/alpine + image: alpine:3.12.0 script: | #!/usr/bin/env ash if [ -f "$(workspaces.signals.path)"/start ] ; then @@ -41,7 +41,7 @@ spec: fi sidecars: - name: await-step-signal - image: mirror.gcr.io/alpine + image: alpine:3.12.0 workspaces: - name: signals script: | diff --git a/upstream/examples/v1/taskruns/configmap.yaml b/upstream/examples/v1/taskruns/configmap.yaml index 44ee9e4227f..df5a4bd12a1 100644 --- a/upstream/examples/v1/taskruns/configmap.yaml +++ b/upstream/examples/v1/taskruns/configmap.yaml @@ -13,7 +13,7 @@ spec: taskSpec: steps: - name: secret - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $(cat /config/test.data) == $TEST_DATA ]] diff --git a/upstream/examples/v1/taskruns/creds-init-only-mounts-provided-credentials.yaml b/upstream/examples/v1/taskruns/creds-init-only-mounts-provided-credentials.yaml index b29958bbdbf..f2c324000d1 100644 --- a/upstream/examples/v1/taskruns/creds-init-only-mounts-provided-credentials.yaml +++ b/upstream/examples/v1/taskruns/creds-init-only-mounts-provided-credentials.yaml @@ -30,7 +30,7 @@ spec: taskSpec: steps: - name: check-credentials - image: mirror.gcr.io/alpine + image: alpine script: | #!/usr/bin/env ash set -xe diff --git a/upstream/examples/v1/taskruns/custom-env.yaml b/upstream/examples/v1/taskruns/custom-env.yaml index 0d8c5d13ad9..93bc0961da8 100644 --- a/upstream/examples/v1/taskruns/custom-env.yaml +++ b/upstream/examples/v1/taskruns/custom-env.yaml @@ -5,7 +5,7 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | #!/usr/bin/env bash [[ $MY_VAR1 == foo ]] diff --git a/upstream/examples/v1/taskruns/custom-volume.yaml b/upstream/examples/v1/taskruns/custom-volume.yaml index f40af276ea8..5d62cb1daa2 100644 --- a/upstream/examples/v1/taskruns/custom-volume.yaml +++ b/upstream/examples/v1/taskruns/custom-volume.yaml @@ -6,7 +6,7 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo some stuff > /im/a/custom/mount/path/file @@ -14,7 +14,7 @@ spec: - name: custom mountPath: /im/a/custom/mount/path - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash cat /short/and/stout/file | grep stuff diff --git a/upstream/examples/v1/taskruns/default_task_params.yaml b/upstream/examples/v1/taskruns/default_task_params.yaml deleted file mode 100644 index 0a8f426e5f6..00000000000 --- a/upstream/examples/v1/taskruns/default_task_params.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Task -metadata: - # This has to be explicit instead of `generateName`, since it will be referenced - # by the TaskRun - name: example-default-task-param -spec: - params: - - name: input - default: "No input provided, but that's okay!" - steps: - - name: echo-input - image: mirror.gcr.io/ubuntu - script: | - echo "$(params.input)" ---- -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - generateName: default-task-params-run- -spec: - taskRef: - name: example-default-task-param - # # Uncomment this block to override the default param value! - # params: - # - name: input - # value: "You can supply the param from the TaskRun if the default not what you want" diff --git a/upstream/examples/v1/taskruns/entrypoint-resolution.yaml b/upstream/examples/v1/taskruns/entrypoint-resolution.yaml index 022a6505d9c..b5b1a65d1eb 100644 --- a/upstream/examples/v1/taskruns/entrypoint-resolution.yaml +++ b/upstream/examples/v1/taskruns/entrypoint-resolution.yaml @@ -13,37 +13,37 @@ spec: # Multi-arch image with no command defined, but with args. We'll look # up the commands and pass it to the entrypoint binary via env var, then # append the specified args. - - image: mirror.gcr.io/ubuntu + - image: ubuntu args: ['-c', 'echo', 'hello'] # Multi-arch image, but since we specify `script` we don't need to look it # up and pass it down. - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo hello # Multi-arch image, but since we specify `command` and `args` we don't # need to look it up and pass it down. - - image: mirror.gcr.io/ubuntu + - image: ubuntu command: ['sh', '-c'] args: ['echo hello'] # Single-platform image with no command defined. We should look up the one # and only command value and pass it to the Pod. - - image: docker.io/amd64/ubuntu + - image: amd64/ubuntu # Single-platform image with no command defined, but with args. We'll look # up the one command and pass it to the entrypoint binary, then append the # specified args. - - image: docker.io/amd64/ubuntu + - image: amd64/ubuntu args: ['-c', 'echo', 'hello'] # Single-platform image, but since we specify `script` we don't need to # look it up and pass it down. - - image: docker.io/amd64/ubuntu + - image: amd64/ubuntu script: echo hello # Single-platform image, but since we specify `command` and `args` we # don't need to look it up and pass it down. - - image: docker.io/amd64/ubuntu + - image: amd64/ubuntu command: ['sh', '-c'] args: ['echo hello'] diff --git a/upstream/examples/v1/taskruns/home-is-set.yaml b/upstream/examples/v1/taskruns/home-is-set.yaml index 26c22751369..20a3ae4ab72 100644 --- a/upstream/examples/v1/taskruns/home-is-set.yaml +++ b/upstream/examples/v1/taskruns/home-is-set.yaml @@ -5,7 +5,7 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu env: - name: HOME value: /tekton/home diff --git a/upstream/examples/v1/taskruns/home-volume.yaml b/upstream/examples/v1/taskruns/home-volume.yaml index 235738c2441..a33d76192c4 100644 --- a/upstream/examples/v1/taskruns/home-volume.yaml +++ b/upstream/examples/v1/taskruns/home-volume.yaml @@ -6,13 +6,13 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo some stuff > /tekton/home/stuff - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat /tekton/home/stuff - name: override-homevol - image: mirror.gcr.io/ubuntu + image: ubuntu # /tekton/home/stuff *doesn't* exist, because the specified volumeMount # conflicts with it, and the user's explicit declaration wins the tie. script: | diff --git a/upstream/examples/v1/taskruns/ignore-step-error.yaml b/upstream/examples/v1/taskruns/ignore-step-error.yaml index 38a12872b84..95ceff08337 100644 --- a/upstream/examples/v1/taskruns/ignore-step-error.yaml +++ b/upstream/examples/v1/taskruns/ignore-step-error.yaml @@ -6,14 +6,14 @@ spec: taskSpec: steps: # exit with 1 and ignore non zero exit code - - image: mirror.gcr.io/alpine + - image: alpine onError: continue name: exit-with-1 script: | exit 1 # check if the /tekton/steps/step-/exitCode got created and contains the exit code # check if the symlink /tekton/steps/0/ got created - - image: mirror.gcr.io/alpine + - image: alpine name: verify-step-path script: | exitCode=`cat $(steps.step-exit-with-1.exitCode.path)` diff --git a/upstream/examples/v1/taskruns/no-ci/default-workspaces.yaml b/upstream/examples/v1/taskruns/no-ci/default-workspaces.yaml index 89822dfa03e..00371ab8495 100644 --- a/upstream/examples/v1/taskruns/no-ci/default-workspaces.yaml +++ b/upstream/examples/v1/taskruns/no-ci/default-workspaces.yaml @@ -7,11 +7,11 @@ spec: - name: source steps: - name: write-file - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo "Hello, world!" > /workspace/source/hello.txt || exit 0 - name: read-file - image: mirror.gcr.io/ubuntu + image: ubuntu script: | grep "Hello, world" /workspace/source/hello.txt --- diff --git a/upstream/examples/v1/taskruns/no-ci/limitrange.yaml b/upstream/examples/v1/taskruns/no-ci/limitrange.yaml index 0b853da4eb6..5a7b5160574 100644 --- a/upstream/examples/v1/taskruns/no-ci/limitrange.yaml +++ b/upstream/examples/v1/taskruns/no-ci/limitrange.yaml @@ -25,7 +25,7 @@ metadata: spec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu command: - echo args: diff --git a/upstream/examples/v1/taskruns/object-param-result.yaml b/upstream/examples/v1/taskruns/object-param-result.yaml index fdde89ecdec..0960e910f73 100644 --- a/upstream/examples/v1/taskruns/object-param-result.yaml +++ b/upstream/examples/v1/taskruns/object-param-result.yaml @@ -24,7 +24,7 @@ spec: IMAGE_DIGEST: {type: string} steps: - name: validate-object-params - image: mirror.gcr.io/bash + image: bash args: [ "$(params.gitrepo.url)", "$(params.gitrepo.commit)" @@ -43,7 +43,7 @@ spec: echo "validate the params.gitrepo.commit successfully" fi - name: write-object-result - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n "{\"IMAGE_URL\":\"ar.com\", \"IMAGE_DIGEST\":\"sha234\"}" > $(results.object-results.path) diff --git a/upstream/examples/v1/taskruns/optional-workspaces.yaml b/upstream/examples/v1/taskruns/optional-workspaces.yaml index 237fc9c9c7e..9089b977d27 100644 --- a/upstream/examples/v1/taskruns/optional-workspaces.yaml +++ b/upstream/examples/v1/taskruns/optional-workspaces.yaml @@ -14,7 +14,7 @@ spec: optional: true steps: - name: check-workspaces - image: mirror.gcr.io/alpine + image: alpine:3.12.0 script: | if [ "$(workspaces.source-code.bound)" == "true" ]; then printf "Source code workspace was provided at %s!\n" "$(workspaces.source-code.path)" diff --git a/upstream/examples/v1/taskruns/propagating_params_implicit.yaml b/upstream/examples/v1/taskruns/propagating_params_implicit.yaml index effb2ef9b76..7782b02f0af 100644 --- a/upstream/examples/v1/taskruns/propagating_params_implicit.yaml +++ b/upstream/examples/v1/taskruns/propagating_params_implicit.yaml @@ -10,6 +10,6 @@ spec: # There are no explicit params defined here. They are derived from the TaskRun. steps: - name: default - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo $(params.message) diff --git a/upstream/examples/v1/taskruns/propagating_workspaces.yaml b/upstream/examples/v1/taskruns/propagating_workspaces.yaml index ac0982a93c0..2c65241f0d1 100644 --- a/upstream/examples/v1/taskruns/propagating_workspaces.yaml +++ b/upstream/examples/v1/taskruns/propagating_workspaces.yaml @@ -6,7 +6,7 @@ spec: taskSpec: steps: - name: simple-step - image: mirror.gcr.io/ubuntu + image: ubuntu command: - echo args: diff --git a/upstream/examples/v1/taskruns/readonly-internal-dir.yaml b/upstream/examples/v1/taskruns/readonly-internal-dir.yaml index 6a5872a884f..6e72fb5c986 100644 --- a/upstream/examples/v1/taskruns/readonly-internal-dir.yaml +++ b/upstream/examples/v1/taskruns/readonly-internal-dir.yaml @@ -7,9 +7,9 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: exit 0 - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | set +e # dont fail the script on error @@ -19,7 +19,7 @@ spec: echo "able to write to run directory of non-current step" exit 1 fi - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | set +e # dont fail the script on error diff --git a/upstream/examples/v1/taskruns/run-steps-as-non-root.yaml b/upstream/examples/v1/taskruns/run-steps-as-non-root.yaml index fabc85444fa..7ac6ae2c631 100644 --- a/upstream/examples/v1/taskruns/run-steps-as-non-root.yaml +++ b/upstream/examples/v1/taskruns/run-steps-as-non-root.yaml @@ -7,7 +7,7 @@ spec: # no securityContext specified so will use # securityContext from TaskRun podTemplate - name: show-user-1001 - image: mirror.gcr.io/ubuntu + image: ubuntu command: - ps args: @@ -15,7 +15,7 @@ spec: # securityContext specified so will run as # user 2000 instead of 1001 - name: show-user-2000 - image: mirror.gcr.io/ubuntu + image: ubuntu command: - ps args: diff --git a/upstream/examples/v1/taskruns/secret-env.yaml b/upstream/examples/v1/taskruns/secret-env.yaml index e3eb35f4ccb..b56be0d3233 100644 --- a/upstream/examples/v1/taskruns/secret-env.yaml +++ b/upstream/examples/v1/taskruns/secret-env.yaml @@ -13,7 +13,7 @@ spec: taskSpec: steps: - name: secret - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $SECRET_PASSWORD == SECRET_PASSWORD ]] diff --git a/upstream/examples/v1/taskruns/secret-volume-params.yaml b/upstream/examples/v1/taskruns/secret-volume-params.yaml index 4976e5da4de..a8fed24b11d 100644 --- a/upstream/examples/v1/taskruns/secret-volume-params.yaml +++ b/upstream/examples/v1/taskruns/secret-volume-params.yaml @@ -16,7 +16,7 @@ spec: description: Name of secret type: string steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | #!/usr/bin/env bash SECRET_PASSWORD=$(cat /var/secret/ninja) diff --git a/upstream/examples/v1/taskruns/secret-volume.yaml b/upstream/examples/v1/taskruns/secret-volume.yaml index 9cade7c451a..cc365220732 100644 --- a/upstream/examples/v1/taskruns/secret-volume.yaml +++ b/upstream/examples/v1/taskruns/secret-volume.yaml @@ -12,7 +12,7 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | #!/usr/bin/env bash SECRET_PASSWORD=$(cat /var/secret/ninja) diff --git a/upstream/examples/v1/taskruns/sidecar-interp.yaml b/upstream/examples/v1/taskruns/sidecar-interp.yaml index 2330bedbbe3..f8bd4e15cc5 100644 --- a/upstream/examples/v1/taskruns/sidecar-interp.yaml +++ b/upstream/examples/v1/taskruns/sidecar-interp.yaml @@ -12,7 +12,7 @@ spec: emptyDir: {} sidecars: - name: value-sidecar - image: mirror.gcr.io/ubuntu + image: ubuntu command: - /bin/bash args: @@ -23,7 +23,7 @@ spec: mountPath: /shared steps: - name: check-value - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/bin/bash VALUE=$(cat /shared/value) diff --git a/upstream/examples/v1/taskruns/sidecar-ready-script.yaml b/upstream/examples/v1/taskruns/sidecar-ready-script.yaml index 9c925c4740d..8c1e17ea5e1 100644 --- a/upstream/examples/v1/taskruns/sidecar-ready-script.yaml +++ b/upstream/examples/v1/taskruns/sidecar-ready-script.yaml @@ -6,17 +6,16 @@ spec: taskSpec: sidecars: - name: slow-sidecar - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo "hello from sidecar" > /shared/message - sleep 2 volumeMounts: - name: shared mountPath: /shared steps: - name: check-ready - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat /shared/message volumeMounts: - name: shared diff --git a/upstream/examples/v1/taskruns/sidecar-ready.yaml b/upstream/examples/v1/taskruns/sidecar-ready.yaml index 45ac9572439..66c5b5cc491 100644 --- a/upstream/examples/v1/taskruns/sidecar-ready.yaml +++ b/upstream/examples/v1/taskruns/sidecar-ready.yaml @@ -6,7 +6,7 @@ spec: taskSpec: sidecars: - name: slow-sidecar - image: mirror.gcr.io/ubuntu + image: ubuntu command: ['sleep', 'infinity'] # The sidecar takes 5s to report as Ready, even after it starts. If the # step runs as soon as the sidecar starts, it will fail because @@ -18,22 +18,13 @@ spec: - -c - sleep 5 && touch /shared/ready timeoutSeconds: 10 - # Adding startup probe for k8s native sidecar support - # Readiness Probe is not honored for k8s native sidecar support - startupProbe: - exec: - command: - - sh - - -c - - sleep 5 && touch /shared/ready - timeoutSeconds: 10 volumeMounts: - name: shared mountPath: /shared steps: - name: check-ready - image: mirror.gcr.io/ubuntu + image: ubuntu # The step will only succeed if the sidecar has written this file, which # it does 5s after it starts, before it reports Ready. script: cat /shared/ready diff --git a/upstream/examples/v1/taskruns/step-script.yaml b/upstream/examples/v1/taskruns/step-script.yaml index fafe88f5831..47b59dc1866 100644 --- a/upstream/examples/v1/taskruns/step-script.yaml +++ b/upstream/examples/v1/taskruns/step-script.yaml @@ -10,10 +10,10 @@ spec: steps: - name: noshebang - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo "no shebang" - name: bash - image: mirror.gcr.io/ubuntu + image: ubuntu env: - name: FOO value: foooooooo @@ -33,7 +33,7 @@ spec: done - name: place-file - image: mirror.gcr.io/ubuntu + image: ubuntu securityContext: runAsUser: 8000 script: | @@ -41,13 +41,13 @@ spec: echo "echo Hello from script file" > /workspace/hello chmod +x /workspace/hello - name: run-file - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash /workspace/hello - name: contains-eof - image: mirror.gcr.io/ubuntu + image: ubuntu securityContext: runAsUser: 16000 workingDir: /workspace @@ -59,26 +59,26 @@ spec: cat file - name: node - image: mirror.gcr.io/node:lts-alpine3.20 + image: node script: | #!/usr/bin/env node console.log("Hello from Node!") - name: python - image: mirror.gcr.io/python:3.12.4 + image: python script: | #!/usr/bin/env python3 print("Hello from Python!") - name: perl - image: mirror.gcr.io/perl:devel-bullseye + image: perl:devel-bullseye script: | #!/usr/bin/perl print "Hello from Perl!" # Test that param values are replaced. - name: params-applied - image: mirror.gcr.io/python:3.12.4 + image: python script: | #!/usr/bin/env python3 v = '$(params.PARAM)' @@ -89,7 +89,7 @@ spec: # Test that args are allowed and passed to the script as expected. - name: args-allowed - image: mirror.gcr.io/ubuntu + image: ubuntu args: ['hello', 'world'] script: | #!/usr/bin/env bash @@ -99,7 +99,7 @@ spec: # Test that multiple dollar signs next to each other are not replaced by Kubernetes - name: dollar-signs-allowed - image: mirror.gcr.io/python:3.12.4 + image: python script: | #!/usr/bin/env python3 if '$' != '\u0024': @@ -118,7 +118,7 @@ spec: # Test that bash scripts with variable evaluations work as expected - name: bash-variable-evaluations - image: mirror.gcr.io/bash + image: bash:5.1.8 script: | #!/usr/bin/env bash set -xe diff --git a/upstream/examples/v1/taskruns/steps-run-in-order.yaml b/upstream/examples/v1/taskruns/steps-run-in-order.yaml index a38b230c9fa..af39b00fd0f 100644 --- a/upstream/examples/v1/taskruns/steps-run-in-order.yaml +++ b/upstream/examples/v1/taskruns/steps-run-in-order.yaml @@ -5,8 +5,8 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox # NB: command is not set, so it must be looked up from the registry. args: ['-c', 'sleep 3 && touch foo'] - - image: mirror.gcr.io/busybox + - image: busybox args: ['-c', 'ls', 'foo'] diff --git a/upstream/examples/v1/taskruns/steptemplate-env-merge.yaml b/upstream/examples/v1/taskruns/steptemplate-env-merge.yaml index a07cd6d0349..6b730f4c381 100644 --- a/upstream/examples/v1/taskruns/steptemplate-env-merge.yaml +++ b/upstream/examples/v1/taskruns/steptemplate-env-merge.yaml @@ -25,7 +25,7 @@ spec: steps: # Test the environment variables are set in the task - name: foo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $FOO == "foo" ]] @@ -33,7 +33,7 @@ spec: - name: FOO value: $(params.FOO) - name: foobar - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $FOOBAR == "foobar" ]] @@ -41,7 +41,7 @@ spec: - name: FOOBAR value: $(params.FOOBAR) - name: bar - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $BAR == "bar" ]] @@ -50,13 +50,13 @@ spec: value: $(params.BAR) # Use the env var from the stepTemplate - name: qux-no-override - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $QUX == "original" ]] # Override the env var in the stepTemplate - name: qux-override - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash [[ $QUX == "override" ]] diff --git a/upstream/examples/v1/taskruns/task-result.yaml b/upstream/examples/v1/taskruns/task-result.yaml index 6c249dda873..116dea49daa 100644 --- a/upstream/examples/v1/taskruns/task-result.yaml +++ b/upstream/examples/v1/taskruns/task-result.yaml @@ -13,12 +13,12 @@ spec: description: The current date in human readable format steps: - name: print-date-unix-timestamp - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash date +%s | tee $(results.current-date-unix-timestamp.path) - name: print-date-human-readable - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash date | tee $(results.current-date-human-readable.path) diff --git a/upstream/examples/v1/taskruns/task-volume-args.yaml b/upstream/examples/v1/taskruns/task-volume-args.yaml index 7b938a084bd..8476f279bf1 100644 --- a/upstream/examples/v1/taskruns/task-volume-args.yaml +++ b/upstream/examples/v1/taskruns/task-volume-args.yaml @@ -17,7 +17,7 @@ spec: type: string steps: - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash cat /configmap/test.data diff --git a/upstream/examples/v1/taskruns/template-volume.yaml b/upstream/examples/v1/taskruns/template-volume.yaml index 425a03bc9ba..ba20638ddf7 100644 --- a/upstream/examples/v1/taskruns/template-volume.yaml +++ b/upstream/examples/v1/taskruns/template-volume.yaml @@ -6,7 +6,7 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo some stuff > /im/a/custom/mount/path/file @@ -14,7 +14,7 @@ spec: - name: custom mountPath: /im/a/custom/mount/path - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash cat /short/and/stout/file diff --git a/upstream/examples/v1/taskruns/unnamed-steps.yaml b/upstream/examples/v1/taskruns/unnamed-steps.yaml index 72abcb863cc..bc5c3cdc25a 100644 --- a/upstream/examples/v1/taskruns/unnamed-steps.yaml +++ b/upstream/examples/v1/taskruns/unnamed-steps.yaml @@ -5,9 +5,9 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: 'true' - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: 'true' - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: 'true' diff --git a/upstream/examples/v1/taskruns/using_context_variables.yaml b/upstream/examples/v1/taskruns/using_context_variables.yaml index 1380fb6fdb5..572e2aa7507 100644 --- a/upstream/examples/v1/taskruns/using_context_variables.yaml +++ b/upstream/examples/v1/taskruns/using_context_variables.yaml @@ -5,11 +5,11 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: print-uid script: | echo "TaskRunUID name: $(context.taskRun.uid)" - - image: mirror.gcr.io/ubuntu + - image: ubuntu name: print-names script: | echo "Task name: $(context.task.name)" diff --git a/upstream/examples/v1/taskruns/workingdir.yaml b/upstream/examples/v1/taskruns/workingdir.yaml index 68c20f14901..5d4c3b77274 100644 --- a/upstream/examples/v1/taskruns/workingdir.yaml +++ b/upstream/examples/v1/taskruns/workingdir.yaml @@ -6,14 +6,14 @@ spec: taskSpec: steps: - name: default - image: mirror.gcr.io/ubuntu + image: ubuntu workingDir: /workspace script: | #!/usr/bin/env bash [[ $PWD == /workspace ]] - name: override - image: mirror.gcr.io/ubuntu + image: ubuntu workingDir: '/a/path/too/far' script: | #!/usr/bin/env bash diff --git a/upstream/examples/v1/taskruns/workspace-in-sidecar.yaml b/upstream/examples/v1/taskruns/workspace-in-sidecar.yaml index deba1867656..ef6407b71ab 100644 --- a/upstream/examples/v1/taskruns/workspace-in-sidecar.yaml +++ b/upstream/examples/v1/taskruns/workspace-in-sidecar.yaml @@ -18,7 +18,7 @@ spec: workspaces: - name: signals steps: - - image: mirror.gcr.io/alpine + - image: alpine:3.12.0 computeResources: requests: memory: "16Mi" @@ -34,7 +34,7 @@ spec: echo "Sidecar responded: ${response}" echo "Step Done." sidecars: - - image: mirror.gcr.io/alpine + - image: alpine:3.12.0 computeResources: requests: memory: "16Mi" diff --git a/upstream/examples/v1/taskruns/workspace-readonly.yaml b/upstream/examples/v1/taskruns/workspace-readonly.yaml index b23f5b5bab5..ff11a427fdf 100644 --- a/upstream/examples/v1/taskruns/workspace-readonly.yaml +++ b/upstream/examples/v1/taskruns/workspace-readonly.yaml @@ -29,19 +29,19 @@ spec: readOnly: true steps: - name: write-allowed - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo "hello" > $(workspaces.write-allowed.path)/foo - name: read-allowed - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.write-allowed.path)/foo | grep "hello" - name: write-disallowed - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo "goodbye" > $(workspaces.write-disallowed.path)/foo || touch write-failed.txt test -f write-failed.txt - name: read-again # We should get "hello" when reading again because writing "goodbye" to # the file should have been disallowed. - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.write-disallowed.path)/foo | grep "hello" diff --git a/upstream/examples/v1/taskruns/workspace-volume.yaml b/upstream/examples/v1/taskruns/workspace-volume.yaml index 64d3ae58eed..980bc7499e3 100644 --- a/upstream/examples/v1/taskruns/workspace-volume.yaml +++ b/upstream/examples/v1/taskruns/workspace-volume.yaml @@ -6,14 +6,14 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo some stuff > /workspace/stuff - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat /workspace/stuff - name: override-workspace - image: mirror.gcr.io/ubuntu + image: ubuntu # /workspace/stuff *doesn't* exist. script: | #!/usr/bin/env bash diff --git a/upstream/examples/v1/taskruns/workspace-with-volumeClaimTemplate.yaml b/upstream/examples/v1/taskruns/workspace-with-volumeClaimTemplate.yaml index 53cc8a10d9c..7cc86e2d9f7 100644 --- a/upstream/examples/v1/taskruns/workspace-with-volumeClaimTemplate.yaml +++ b/upstream/examples/v1/taskruns/workspace-with-volumeClaimTemplate.yaml @@ -6,7 +6,7 @@ spec: taskSpec: steps: - name: list-files - image: mirror.gcr.io/ubuntu + image: ubuntu script: ls $(workspaces.read-allowed.path) workspaces: - name: read-allowed diff --git a/upstream/examples/v1/taskruns/workspace.yaml b/upstream/examples/v1/taskruns/workspace.yaml index 7f678e680c3..818a5176482 100644 --- a/upstream/examples/v1/taskruns/workspace.yaml +++ b/upstream/examples/v1/taskruns/workspace.yaml @@ -55,28 +55,28 @@ spec: taskSpec: steps: - name: write - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(workspaces.custom.volume) > $(workspaces.custom.path)/foo - name: read - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.custom.path)/foo | grep $(workspaces.custom.volume) - name: write2 - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(workspaces.custom2.path) > $(workspaces.custom2.path)/foo - name: read2 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.custom2.path)/foo | grep $(workspaces.custom2.path) - name: write3 - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(workspaces.custom3.path) > $(workspaces.custom3.path)/foo - name: read3 - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.custom3.path)/foo | grep $(workspaces.custom3.path) - name: readconfigmap - image: mirror.gcr.io/ubuntu + image: ubuntu script: cat $(workspaces.custom4.path)/my-message.txt | grep "hello world" - name: readsecret - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash set -xe diff --git a/upstream/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml b/upstream/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml index 458043ca5dd..3ea557489e6 100644 --- a/upstream/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml +++ b/upstream/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml @@ -7,7 +7,7 @@ metadata: spec: steps: - name: task-two-step-one - image: mirror.gcr.io/ubuntu + image: ubuntu command: ["/bin/bash"] args: ['-c', 'echo success'] --- diff --git a/upstream/examples/v1beta1/taskruns/clustertask.yaml b/upstream/examples/v1beta1/taskruns/clustertask.yaml index 1dd8b6b8696..79a4ecd1a89 100644 --- a/upstream/examples/v1beta1/taskruns/clustertask.yaml +++ b/upstream/examples/v1beta1/taskruns/clustertask.yaml @@ -6,7 +6,7 @@ metadata: name: clustertask-v1beta1 spec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo hello --- apiVersion: tekton.dev/v1beta1 diff --git a/upstream/examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml b/upstream/examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml new file mode 100644 index 00000000000..ac659ad8520 --- /dev/null +++ b/upstream/examples/v1beta1/taskruns/no-ci/tekton-bundles.yaml @@ -0,0 +1,9 @@ +# TODO: Move the example image to a tekton owned repo. +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: + name: remote-task-reference +spec: + taskRef: + name: hello-world + bundle: docker.io/ptasci67/example-oci@sha256:053a6cb9f3711d4527dd0d37ac610e8727ec0288a898d5dfbd79b25bcaa29828 diff --git a/upstream/go.mod b/upstream/go.mod index 1a85fb966af..b2a697d1967 100644 --- a/upstream/go.mod +++ b/upstream/go.mod @@ -1,58 +1,66 @@ module github.com/tektoncd/pipeline -go 1.22 -toolchain go1.22.5 +go 1.21 require ( - github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20220720053627-e327d0730470 // Waiting for https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43/files to merge github.com/cloudevents/sdk-go/v2 v2.15.2 - github.com/containerd/containerd v1.7.20 + github.com/containerd/containerd v1.7.15 github.com/go-git/go-git/v5 v5.12.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-containerregistry v0.19.2 + github.com/google/go-containerregistry v0.19.1 github.com/google/uuid v1.6.0 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v1.0.2 - github.com/jenkins-x/go-scm v1.14.37 + github.com/jenkins-x/go-scm v1.14.30 github.com/mitchellh/go-homedir v1.1.0 github.com/opencontainers/image-spec v1.1.0 github.com/pkg/errors v0.9.1 - github.com/sigstore/sigstore v1.8.4 - github.com/spiffe/go-spiffe/v2 v2.3.0 - github.com/spiffe/spire-api-sdk v1.10.0 + github.com/sigstore/sigstore v1.8.3 + github.com/spiffe/go-spiffe/v2 v2.2.0 + github.com/spiffe/spire-api-sdk v1.9.4 github.com/tektoncd/plumbing v0.0.0-20220817140952-3da8ce01aeeb go.opencensus.io v0.24.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 - k8s.io/api v0.29.6 - k8s.io/apimachinery v0.29.7 - k8s.io/client-go v0.29.6 - k8s.io/code-generator v0.29.7 + k8s.io/api v0.28.5 + k8s.io/apimachinery v0.29.0 + k8s.io/client-go v0.28.5 + k8s.io/code-generator v0.28.5 k8s.io/klog v1.0.0 - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 - knative.dev/pkg v0.0.0-20240416145024-0f34a8815650 + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 + knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 sigs.k8s.io/yaml v1.4.0 ) +// TODO: Remove this once https://github.com/knative/pkg/issues/2759 is fixed +replace ( + k8s.io/api => k8s.io/api v0.28.5 + k8s.io/apimachinery => k8s.io/apimachinery v0.28.5 + k8s.io/client-go => k8s.io/client-go v0.28.5 + k8s.io/code-generator => k8s.io/code-generator v0.28.5 +) + require ( code.gitea.io/sdk/gitea v0.18.0 github.com/go-jose/go-jose/v3 v3.0.3 github.com/goccy/kpoward v0.1.0 github.com/google/cel-go v0.20.1 github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20240108195214-a0658aa1d0cc - github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.4 - github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.4 - github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.4 - github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.4 - go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 - go.opentelemetry.io/otel/sdk v1.28.0 - go.opentelemetry.io/otel/trace v1.28.0 - k8s.io/utils v0.0.0-20240102154912-e7106e64919e + github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240108195214-a0658aa1d0cc + github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 + github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 + github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3 + github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3 + go.opentelemetry.io/otel v1.26.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 + go.opentelemetry.io/otel/sdk v1.26.0 + go.opentelemetry.io/otel/trace v1.26.0 + k8s.io/utils v0.0.0-20230726121419-3b25d923346b ) require ( @@ -68,58 +76,51 @@ require ( ) require ( - cloud.google.com/go v0.113.0 // indirect - cloud.google.com/go/auth v0.4.1 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect - cloud.google.com/go/compute/metadata v0.5.0 // indirect - cloud.google.com/go/iam v1.1.8 // indirect - cloud.google.com/go/kms v1.17.1 // indirect - cloud.google.com/go/longrunning v0.5.7 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/kms v1.15.8 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/Microsoft/hcsshim v0.11.7 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect + github.com/Microsoft/hcsshim v0.11.4 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/kms v1.32.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.30.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/containerd/platforms v0.2.1 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davidmz/go-pageant v1.0.2 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.10.2 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-fed/httpsig v1.1.0 // indirect - github.com/go-jose/go-jose/v4 v4.0.2 // indirect + github.com/go-jose/go-jose/v4 v4.0.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.0 // indirect github.com/google/gnostic-models v0.6.8 // indirect - github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240108195214-a0658aa1d0cc // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.4 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.7 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/vault/api v1.14.0 // indirect + github.com/hashicorp/vault/api v1.12.2 // indirect github.com/jellydator/ttlcache/v3 v3.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/letsencrypt/boulder v0.0.0-20230907030200-6d76a0f91e1e // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/ryanuber/go-glob v1.0.0 // indirect @@ -130,21 +131,16 @@ require ( github.com/zeebo/errs v1.3.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect + go.opentelemetry.io/otel/metric v1.26.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect ) -// TODO: Remove this once github.com/google/go-containerregistry uses github.com/aws/aws-sdk-go-v2 >v1.23.0 -replace ( - github.com/aws/aws-sdk-go-v2/service/ecr => github.com/aws/aws-sdk-go-v2/service/ecr v1.27.3 - github.com/aws/aws-sdk-go-v2/service/ecrpublic => github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.23.3 -) - require ( + cloud.google.com/go/compute v1.24.0 // indirect contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect @@ -156,39 +152,39 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.16 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.16 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect + github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.9 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 // indirect github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 // indirect - github.com/aws/smithy-go v1.20.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/bluekeyes/go-gitdiff v0.7.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/docker/cli v24.0.7+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v26.1.5+incompatible // indirect + github.com/docker/docker v26.0.0+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.8.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.1 // 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 @@ -198,13 +194,13 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/hashicorp/go-version v1.7.0 + github.com/hashicorp/go-version v1.6.0 github.com/imdario/mergo v0.3.13 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.16.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -214,9 +210,9 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.52.3 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -228,27 +224,28 @@ require ( github.com/vbatts/tar-split v0.11.3 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sync v0.10.0 - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.181.0 // indirect - google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/grpc v1.67.0 - google.golang.org/protobuf v1.34.2 + golang.org/x/tools v0.17.0 // indirect + google.golang.org/api v0.171.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/grpc v1.63.2 + google.golang.org/protobuf v1.33.0 gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.29.2 // indirect - k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/apiextensions-apiserver v0.28.5 // indirect + k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect + k8s.io/klog/v2 v2.100.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/structured-merge-diff/v4 v4.2.3 // indirect ) replace github.com/ahmetb/gen-crd-api-reference-docs => github.com/tektoncd/ahmetb-gen-crd-api-reference-docs v0.3.1-0.20220729140133-6ce2d5aafcb4 // Waiting for https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43/files to merge diff --git a/upstream/go.sum b/upstream/go.sum index e5c800de483..6c3a4ab7e29 100644 --- a/upstream/go.sum +++ b/upstream/go.sum @@ -20,29 +20,26 @@ cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECH cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.113.0 h1:g3C70mn3lWfckKBiCVsAshabrDg01pQ0pnX1MNtnMkA= -cloud.google.com/go v0.113.0/go.mod h1:glEqlogERKYeePz6ZdkcLJ28Q2I6aERgDDErBg9GzO8= -cloud.google.com/go/auth v0.4.1 h1:Z7YNIhlWRtrnKlZke7z3GMqzvuYzdc2z98F9D1NV5Hg= -cloud.google.com/go/auth v0.4.1/go.mod h1:QVBuVEKpCn4Zp58hzRGvL0tjRGU0YqdRTdCHM1IHnro= -cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= -cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= -cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= +cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0= -cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= -cloud.google.com/go/kms v1.17.1 h1:5k0wXqkxL+YcXd4viQzTqCgzzVKKxzgrK+rCZJytEQs= -cloud.google.com/go/kms v1.17.1/go.mod h1:DCMnCF/apA6fZk5Cj4XsD979OyHAqFasPuA5Sd0kGlQ= -cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= -cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/kms v1.15.8 h1:szIeDCowID8th2i8XE4uRev5PMxQFqW+JjwYxL9h6xs= +cloud.google.com/go/kms v1.15.8/go.mod h1:WoUHcDjD9pluCg7pNds131awnH429QGvRM3N/4MyoVs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -64,12 +61,12 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 h1:n1DH8TPV4qqPTje2RcUBYwtrTWlabVp4n46+74X2pn4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0/go.mod h1:HDcZnuGbiyppErN6lB+idp4CKhjbc8gwjto6OPpyggM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 h1:DRiANoJTiW6obBQe3SqZizkuV1PEgfiiGivmVocDy64= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0/go.mod h1:qLIye2hwb/ZouqhpSD9Zn3SJipvpEnz1Ywl3VUk9Y0s= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= @@ -78,12 +75,9 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw= github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk= github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= @@ -95,17 +89,15 @@ github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 h1:w77/uPk80ZET2F+AfQExZy github.com/Azure/go-autorest/autorest/azure/cli v0.4.6/go.mod h1:piCfgPho7BiIDdEQ1+g4VmKyD5y+p/XtSNqE6Hc4QD0= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -119,8 +111,8 @@ github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= -github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= @@ -128,8 +120,8 @@ github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg3 github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ= -github.com/Microsoft/hcsshim v0.11.7/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= +github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= +github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -161,56 +153,52 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.53.10 h1:3enP5l5WtezT9Ql+XZqs56JBf5YUd/FEzTCg///OIGY= -github.com/aws/aws-sdk-go v1.53.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.51.6 h1:Ld36dn9r7P9IjU8WZSaswQ8Y/XUCRpewim5980DwYiU= +github.com/aws/aws-sdk-go v1.51.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.26.0 h1:/Ce4OCiM3EkpW7Y+xUnfAFpchU78K7/Ug01sZni9PgA= github.com/aws/aws-sdk-go-v2 v1.26.0/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I= -github.com/aws/aws-sdk-go-v2 v1.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo= -github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= -github.com/aws/aws-sdk-go-v2/config v1.27.16 h1:knpCuH7laFVGYTNd99Ns5t+8PuRjDn4HnnZK48csipM= -github.com/aws/aws-sdk-go-v2/config v1.27.16/go.mod h1:vutqgRhDUktwSge3hrC3nkuirzkJ4E/mLj5GvI0BQas= +github.com/aws/aws-sdk-go-v2/config v1.27.9 h1:gRx/NwpNEFSk+yQlgmk1bmxxvQ5TyJ76CWXs9XScTqg= +github.com/aws/aws-sdk-go-v2/config v1.27.9/go.mod h1:dK1FQfpwpql83kbD873E9vz4FyAxuJtR22wzoXn3qq0= github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.16 h1:7d2QxY83uYl0l58ceyiSpxg9bSbStqBC6BeEeHEchwo= -github.com/aws/aws-sdk-go-v2/credentials v1.17.16/go.mod h1:Ae6li/6Yc6eMzysRL2BXlPYvnrLLBg3D11/AmOjw50k= +github.com/aws/aws-sdk-go-v2/credentials v1.17.9 h1:N8s0/7yW+h8qR8WaRlPQeJ6czVMNQVNtNdUqf6cItao= +github.com/aws/aws-sdk-go-v2/credentials v1.17.9/go.mod h1:446YhIdmSV0Jf/SLafGZalQo+xr2iw7/fzXGDPTU1yQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 h1:dQLK4TjtnlRGb0czOht2CevZ5l6RSyRWAnKeGd7VAFE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3/go.mod h1:TL79f2P6+8Q7dTsILpiVST+AL9lkF6PPGI167Ny0Cjw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 h1:af5YzcLf80tv4Em4jWVD75lpnOHSBkPUZxZfGkrI3HI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0/go.mod h1:nQ3how7DMnFMWiU1SpECohgC82fpn4cKZ875NDMmwtA= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 h1:0ScVK/4qZ8CIW0k8jOeFVsyS/sAiXpYxRBLolMkuLQM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4/go.mod h1:84KyjNZdHC6QZW08nfHI6yZgPd+qRgaWcYsyLUo3QY8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 h1:lf/8VTF2cM+N4SLzaYJERKEWAXq8MOMpZfU6wEPWsPk= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod h1:4SjkU7QiqK2M9oozyMzfZ/23LmUY+h3oFqhdeP5OMiI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 h1:sHmMWWX5E7guWEFQ9SVo6A3S4xpPrWnd77a6y4WM6PU= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4/go.mod h1:WjpDrhWisWOIoS9n3nk67A3Ll1vfULJ9Kq6h29HTD48= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 h1:4OYVp0705xu8yjdyoWix0r9wPIRXnIzzOoUpQVHIJ/g= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod h1:vd7ESTEvI76T2Na050gODNmNU7+OyKrIKroYTu4ABiI= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/ecr v1.27.3 h1:gfgt0D8MGL3gHrJPEv4rcWptA4Nz7uYn25ls8lLiANw= -github.com/aws/aws-sdk-go-v2/service/ecr v1.27.3/go.mod h1:O5Fvd41s5KfDG093xLM7FhGiH6EmhmEli5D5MQH3TWw= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.23.3 h1:gaq/4fd2/bQeJ33m4csgL7DJHrrmvGhqnrsxchNr46c= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.23.3/go.mod h1:vn+Rz9fAFGJtDXbBmYdTc71Q8iF/W/uK1/ec93hinD8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= +github.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 h1:wlTgmb/sCmVRJrN5De3CiHj4v/bTCgL5+qpdEd0CPtw= +github.com/aws/aws-sdk-go-v2/service/ecr v1.18.11/go.mod h1:Ce1q2jlNm8BVpjLaOnwnm5v2RClAbK6txwPljFzyW6c= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 h1:yflJrGmi1pXtP9lOpOeaNZyc0vXnJTuP2sor3nJcGGo= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2/go.mod h1:uHtRE7aqXNmpeYL+7Ec7LacH5zC9+w2T5MBOeEKDdu0= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 h1:Wx0rlZoEJR7JwlSZcHnEa7CNjrSIyVxMFWGAaXy4fJY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod h1:aVMHdE0aHO3v+f/iw01fmXV/5DbfQ3Bi9nN7nd9bE9Y= -github.com/aws/aws-sdk-go-v2/service/kms v1.32.1 h1:FARrQLRQXpCFYylIUVF1dRij6YbPCmtwudq9NBk4kFc= -github.com/aws/aws-sdk-go-v2/service/kms v1.32.1/go.mod h1:8lETO9lelSG2B6KMXFh2OwPPqGV6WQM3RqLAEjP1xaU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 h1:b+E7zIUHMmcB4Dckjpkapoy47W6C9QBv/zoUP+Hn8Kc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6/go.mod h1:S2fNV0rxrP78NhPbCZeQgY8H9jdDMeGtwcfZIRxzBqU= +github.com/aws/aws-sdk-go-v2/service/kms v1.30.0 h1:yS0JkEdV6h9JOo8sy2JSpjX+i7vsKifU8SIeHrqiDhU= +github.com/aws/aws-sdk-go-v2/service/kms v1.30.0/go.mod h1:+I8VUUSVD4p5ISQtzpgSva4I8cJ4SQ4b1dcBcof7O+g= github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 h1:aD7AGQhvPuAxlSUfo0CWU7s6FpkbyykMhGYMvlqTjVs= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.9/go.mod h1:c1qtZUWtygI6ZdvKppzCSXsDOq5I4luJPZ0Ud3juFCA= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 h1:mnbuWHOcM70/OFUlZZ5rcdfA8PflGXXiefU/O+1S3+8= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3/go.mod h1:5HFu51Elk+4oRBZVxmHrSds5jFXmFj8C3w7DVF2gnrs= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 h1:Pav5q3cA260Zqez42T9UhIlsd9QeypszRPwC9LdSSsQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3/go.mod h1:9lmoVDVLz/yUZwLaQ676TK02fhCu4+PgRSmMaKR1ozk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 h1:uLq0BKatTmDzWa/Nu4WO0M1AaQDaPpwTKAeByEc6WFM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3/go.mod h1:b+qdhjnxj8GSR6t5YfphOffeoQSQ1KmpoVVuBn+PWxs= github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 h1:69tpbPED7jKPyzMcrwSvhWcJ9bPnZsZs18NT40JwM0g= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.10/go.mod h1:0Aqn1MnEuitqfsCNyKsdKLhDUOr4txD/g19EfiUqgws= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 h1:J/PpTf/hllOjx8Xu9DMflff3FajfLxqM5+tepvVXmxg= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5/go.mod h1:0ih0Z83YDH/QeQ6Ori2yGE2XvWYv/Xm+cZc01LC6oK0= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= -github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= -github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7 h1:G5IT+PEpFY0CDb3oITDP9tkmLrHkVD8Ny+elUmBqVYI= github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230510185313-f5e39e5f34c7/go.mod h1:VVALgT1UESBh91dY0GprHnT1Z7mKd96VDk8qVy+bmu0= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -246,8 +234,8 @@ github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91 github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -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/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 h1:krfRl01rzPzxSxyLyrChD+U+MzsBXbm0OwYYB67uF+4= github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589/go.mod h1:OuDyvmLnMCwa2ep4Jkm6nyA0ocJuZlGyk2gGseVzERM= @@ -304,8 +292,8 @@ github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= github.com/containerd/containerd v1.5.2/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.7.20 h1:Sl6jQYk3TRavaU83h66QMbI2Nqg9Jm6qzwX57Vsn1SQ= -github.com/containerd/containerd v1.7.20/go.mod h1:52GsS5CwquuqPuLncsXwG0t2CiUce+KsNHJZQJvAgR0= +github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes= +github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -335,8 +323,6 @@ github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3 github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= -github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/containerd/stargz-snapshotter/estargz v0.7.0/go.mod h1:83VWDqHnurTKliEB0YvWMiCfLDwv4Cjj1X9Vk98GJZw= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= @@ -404,6 +390,8 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v20.10.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -413,8 +401,8 @@ github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v26.1.5+incompatible h1:NEAxTwEjxV6VbBMBoGG3zPqbiJosIApZjxlbrG9q3/g= -github.com/docker/docker v26.1.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU= +github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= @@ -425,17 +413,17 @@ github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.10.2 h1:hIovbnmBTLjHXkqEBUz3HGpXZdM7ZrE9fJIZIqlJLqE= +github.com/emicklei/go-restful/v3 v3.10.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= @@ -450,15 +438,14 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 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/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= +github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -485,8 +472,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= -github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= -github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= +github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U= +github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -500,9 +487,12 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/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-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -511,6 +501,7 @@ 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.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= 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/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= @@ -519,6 +510,7 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh 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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= @@ -545,8 +537,8 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= 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-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -580,11 +572,13 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= 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= @@ -606,8 +600,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.6.0/go.mod h1:euCCtNbZ6tKqi1E72vwDj2xZcN5ttKpZLfa/wSo5iLw= -github.com/google/go-containerregistry v0.19.2 h1:TannFKE1QSajsP6hPWb5oJNgKe1IKjHukIKDUmvsV6w= -github.com/google/go-containerregistry v0.19.2/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= +github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY= +github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20240108195214-a0658aa1d0cc h1:eJ9J17+23quNw5z6O9AdTH+irI7JI+6eQX9TswViyvk= github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20240108195214-a0658aa1d0cc/go.mod h1:Ek+8PQrShkA7aHEj3/zSW33wU0V/Bx3zW/gFh7l21xY= github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20240108195214-a0658aa1d0cc h1:fHDosK/RhxYQpWBRo+bbawVuR402odSaNToA0Pp+ojw= @@ -633,6 +627,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -643,14 +638,15 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= -github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -667,8 +663,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -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/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -680,16 +676,17 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= -github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -704,8 +701,8 @@ github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjG github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -717,12 +714,12 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU= -github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk= +github.com/hashicorp/vault/api v1.12.2 h1:7YkCTE5Ni90TcmYHDBExdt4WGJxhpzaHqR6uGbQb/rE= +github.com/hashicorp/vault/api v1.12.2/go.mod h1:LSGf1NGT1BnvFFnKVtnvcaLBM2Lz+gJdpL6HUYed8KE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -734,8 +731,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jellydator/ttlcache/v3 v3.2.0 h1:6lqVJ8X3ZaUwvzENqPAobDsXNExfUJd61u++uW8a3LE= github.com/jellydator/ttlcache/v3 v3.2.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4= -github.com/jenkins-x/go-scm v1.14.37 h1:Tq59JXyg5p4iuvIKf6+EA+Yzgxgpn/yG/yfM1mL8DDg= -github.com/jenkins-x/go-scm v1.14.37/go.mod h1:MRLj/i0mhpMtqwwZV+x78SkEB8mx9rv3ebdRg9WunS8= +github.com/jenkins-x/go-scm v1.14.30 h1:UWhpY1906IQn4FtFo5CAuhpZtsHLnIjYlKinmDkBvXo= +github.com/jenkins-x/go-scm v1.14.30/go.mod h1:9MGEHpudIt+JypKTf4zUHpiRggl5piIb9xcLu+1FrbU= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -773,8 +770,8 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.0/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= +github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -856,11 +853,11 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -868,18 +865,43 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= +github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc= +github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= +github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= +github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= +github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= +github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -920,6 +942,7 @@ github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -942,15 +965,15 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -961,8 +984,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.52.3 h1:5f8uj6ZwHSscOGNdIQg6OiZv/ybiK2CO2q2drVZAQSA= -github.com/prometheus/common v0.52.3/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= +github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -984,8 +1007,10 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -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/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -1008,16 +1033,16 @@ github.com/shurcooL/githubv4 v0.0.0-20190718010115-4ba037080260/go.mod h1:hAF0iL github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk= github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sigstore/sigstore v1.8.4 h1:g4ICNpiENFnWxjmBzBDWUn62rNFeny/P77HUC8da32w= -github.com/sigstore/sigstore v1.8.4/go.mod h1:1jIKtkTFEeISen7en+ZPWdDHazqhxco/+v9CNjc7oNg= -github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.4 h1:okxaVlaTrQowE1FA4UQ3rw54f7BUjdnzERIxbZTBZuc= -github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.4/go.mod h1:jkcPErmnCECuSJajUaUq5pwCMOeBF19VzQo6bv4l1D0= -github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.4 h1:1G6uLTZaqvu867DbgH7p75L6Y7Tu8LLnYJGZnWsTUu8= -github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.4/go.mod h1:QtKKb8DChi1mRi9xSNr8ImSQu6m+0MZAV0sYIoPOta0= -github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.4 h1:fjnDR5Lw9ElfOSRUGKkgwjaynqj93nLu0twAw+QxhHE= -github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.4/go.mod h1:9KFn5MwelyNoFXu3gNyVzvN/yAhcL6FE053oxih9+vM= -github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.4 h1:QEXOb+feQmNOyLVT+FrghBqKKK4QDMP5dyic8RZHXdE= -github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.4/go.mod h1:ohOhV9zclcIpNAWS0kq2ASB3EPPuRce2HjgXXaU3pKQ= +github.com/sigstore/sigstore v1.8.3 h1:G7LVXqL+ekgYtYdksBks9B38dPoIsbscjQJX/MGWkA4= +github.com/sigstore/sigstore v1.8.3/go.mod h1:mqbTEariiGA94cn6G3xnDiV6BD8eSLdL/eA7bvJ0fVs= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 h1:LTfPadUAo+PDRUbbdqbeSl2OuoFQwUFTnJ4stu+nwWw= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3/go.mod h1:QV/Lxlxm0POyhfyBtIbTWxNeF18clMlkkyL9mu45y18= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 h1:xgbPRCr2npmmsuVVteJqi/ERw9+I13Wou7kq0Yk4D8g= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3/go.mod h1:G4+I83FILPX6MtnoaUdmv/bRGEVtR3JdLeJa/kXdk/0= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3 h1:vDl2fqPT0h3D/k6NZPlqnKFd1tz3335wm39qjvpZNJc= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3/go.mod h1:9uOJXbXEXj+M6QjMKH5PaL5WDMu43rHfbIMgXzA8eKI= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3 h1:h9G8j+Ds21zqqulDbA/R/ft64oQQIyp8S7wJYABYSlg= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3/go.mod h1:zgCeHOuqF6k7A7TTEvftcA9V3FRzB7mrPtHOhXAQBnc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1057,10 +1082,10 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spiffe/go-spiffe/v2 v2.3.0 h1:g2jYNb/PDMB8I7mBGL2Zuq/Ur6hUhoroxGQFyD6tTj8= -github.com/spiffe/go-spiffe/v2 v2.3.0/go.mod h1:Oxsaio7DBgSNqhAO9i/9tLClaVlfRok7zvJnTV8ZyIY= -github.com/spiffe/spire-api-sdk v1.10.0 h1:QFZ8fucWhbV4y4TKWKLxGc7SNrCLThn2t5qpVNIiiRY= -github.com/spiffe/spire-api-sdk v1.10.0/go.mod h1:4uuhFlN6KBWjACRP3xXwrOTNnvaLp1zJs8Lribtr4fI= +github.com/spiffe/go-spiffe/v2 v2.2.0 h1:9Vf06UsvsDbLYK/zJ4sYsIsHmMFknUD+feA7IYoWMQY= +github.com/spiffe/go-spiffe/v2 v2.2.0/go.mod h1:Urzb779b3+IwDJD2ZbN8fVl3Aa8G4N/PiUe6iXC0XxU= +github.com/spiffe/spire-api-sdk v1.9.4 h1:SbC37G2vwX/ojULl+avWvye4ITHYBorcC7+8ExWpNjA= +github.com/spiffe/spire-api-sdk v1.9.4/go.mod h1:4uuhFlN6KBWjACRP3xXwrOTNnvaLp1zJs8Lribtr4fI= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= @@ -1130,6 +1155,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= @@ -1157,18 +1183,18 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/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.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 h1:QY7/0NeRPKlzusf40ZE4t1VlMKbqSNT7cJRYzWuja0s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0/go.mod h1:HVkSiDhTM9BoUJU8qE6j2eSWLLXvi1USXjyd2BXT8PY= -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/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= +go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 h1:1wp/gyxsuYtuE/JFxsQRtcCDtMrO2qMvlfXALU5wkzI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0/go.mod h1:gbTHmghkGgqxMomVQQMur1Nba4M0MQ8AYThXDUjsJ38= +go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= +go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= +go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= +go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= +go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= +go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= @@ -1210,12 +1236,14 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1253,10 +1281,15 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1293,6 +1326,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -1307,18 +1341,27 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1333,8 +1376,9 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1349,8 +1393,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1422,6 +1466,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1438,8 +1483,11 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1449,21 +1497,29 @@ golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1473,18 +1529,21 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1541,19 +1600,26 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.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/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1581,8 +1647,8 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.181.0 h1:rPdjwnWgiPPOJx3IcSAQ2III5aX5tCer6wMpa/xmZi4= -google.golang.org/api v0.181.0/go.mod h1:MnQ+M0CFsfUwA5beZ+g/vCBCPXvtmZwRz2qzZk8ih1k= +google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1590,6 +1656,8 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1637,12 +1705,12 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 h1:rIo7ocm2roD9DcFIX67Ym8icoGCKSARAiPljFhh5suQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1670,8 +1738,8 @@ google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= -google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1688,8 +1756,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1749,28 +1818,19 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.29.6 h1:eDxIl8+PeEpwbe2YyS5RXJ9vdn4hnKWMBf4WUJP9DQM= -k8s.io/api v0.29.6/go.mod h1:ZuUPMhJV74DJXapldbg6upaHfiOjrBb+0ffUbBi1jaw= -k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg= -k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.29.7 h1:ICXzya58Q7hyEEfnTrbmdfX1n1schSepX2KUfC2/ykc= -k8s.io/apimachinery v0.29.7/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/api v0.28.5 h1:XIPNr3nBgTEaCdEiwZ+dXaO9SB4NeTOZ2pNDRrFgfb4= +k8s.io/api v0.28.5/go.mod h1:98zkTCc60iSnqqCIyCB1GI7PYDiRDYTSfL0PRIxpM4c= +k8s.io/apiextensions-apiserver v0.28.5 h1:YKW9O9T/0Gkyl6LTFDLIhCbouSRh+pHt2vMLB38Snfc= +k8s.io/apiextensions-apiserver v0.28.5/go.mod h1:7p7TQ0X9zCJLNFlOTi5dncAi2dkPsdsrcvu5ILa7PEk= +k8s.io/apimachinery v0.28.5 h1:EEj2q1qdTcv2p5wl88KavAn3VlFRjREgRu8Sm/EuMPY= +k8s.io/apimachinery v0.28.5/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.29.6 h1:5E2ebuB/p0F0THuQatyvhDvPL2SIeqwTPrtnrwKob/8= -k8s.io/client-go v0.29.6/go.mod h1:jHZcrQqDplyv20v7eu+iFM4gTpglZSZoMVcKrh8sRGg= -k8s.io/code-generator v0.29.7 h1:NEwmKOJVNObCh3upBLEojL1QuJMzGplOTYZnee4h0TY= -k8s.io/code-generator v0.29.7/go.mod h1:7TYnI0dYItL2cKuhhgPSuF3WED9uMdELgbVXFfn/joE= +k8s.io/client-go v0.28.5 h1:6UNmc33vuJhh3+SAOEKku3QnKa+DtPKGnhO2MR0IEbk= +k8s.io/client-go v0.28.5/go.mod h1:+pt086yx1i0HAlHzM9S+RZQDqdlzuXFl4hY01uhpcpA= +k8s.io/code-generator v0.28.5 h1:6LXs+I/LOMGNLVI7z8xImLjI98o9vcwiHiQY6PyqpmU= +k8s.io/code-generator v0.28.5/go.mod h1:OQAfl6bZikQ/tK6faJ18Vyzo54rUII2NmjurHyiN1g4= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= @@ -1779,24 +1839,28 @@ k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 h1:izq7u3SJBdOAuA5YYe1/PIp9jczrih/jGlKRRt0G7bQ= -k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 h1:iu3o/SxaHVI7tKPtkGzD3M9IzrE21j+CUKH98NQJ8Ms= +k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/pkg v0.0.0-20240416145024-0f34a8815650 h1:m2ahFUO0L2VrgGDYdyOUFdE6xBd3pLXAJozLJwqLRQM= -knative.dev/pkg v0.0.0-20240416145024-0f34a8815650/go.mod h1:soFw5ss08G4PU3JiFDKqiZRd2U7xoqcfNpJP1coIXkY= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 h1:H6+JJN23fhwYWCHY1339sY6uhIyoUwDy1a8dN233fdk= +knative.dev/pkg v0.0.0-20240116073220-b488e7be5902/go.mod h1:NYk8mMYoLkO7CQWnNkti4YGGnvLxN6MIDbUvtgeo0C0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -1806,9 +1870,10 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -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/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/upstream/hack/update-deps.sh b/upstream/hack/update-deps.sh index 64866ea7959..65a15ab118e 100755 --- a/upstream/hack/update-deps.sh +++ b/upstream/hack/update-deps.sh @@ -22,7 +22,7 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri cd ${REPO_ROOT_DIR} -KNATIVE_VERSION="release-1.14" +KNATIVE_VERSION="release-1.13" # The list of dependencies that we track at HEAD and periodically # float forward in this repository. diff --git a/upstream/internal/artifactref/artifactref.go b/upstream/internal/artifactref/artifactref.go index cd8e1162ce3..b5a46a73023 100644 --- a/upstream/internal/artifactref/artifactref.go +++ b/upstream/internal/artifactref/artifactref.go @@ -2,17 +2,10 @@ package artifactref import "regexp" -// case 1: steps..inputs. -// case 2: steps..outputs. -const stepArtifactUsagePattern = `\$\(steps\.([^.]+)\.(?:inputs|outputs)\.([^.)]+)\)` - -// case 1: tasks..inputs. -// case 2: tasks..outputs. -const taskArtifactUsagePattern = `\$\(tasks\.([^.]+)\.(?:inputs|outputs)\.([^.)]+)\)` - -const StepArtifactPathPattern = `step.artifacts.path` - -const TaskArtifactPathPattern = `artifacts.path` +// case 1: steps..inputs +// case 2: steps..outputs +// case 3: steps..inputs. +// case 4: steps..outputs. +const stepArtifactUsagePattern = `\$\(steps\.([^.]+)\.(?:inputs|outputs)(?:\.([^.^\)]+))?\)` var StepArtifactRegex = regexp.MustCompile(stepArtifactUsagePattern) -var TaskArtifactRegex = regexp.MustCompile(taskArtifactUsagePattern) diff --git a/upstream/internal/sidecarlogresults/sidecarlogresults.go b/upstream/internal/sidecarlogresults/sidecarlogresults.go index 823fe448075..e9ce11b86db 100644 --- a/upstream/internal/sidecarlogresults/sidecarlogresults.go +++ b/upstream/internal/sidecarlogresults/sidecarlogresults.go @@ -28,8 +28,6 @@ import ( "strings" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/result" "golang.org/x/sync/errgroup" corev1 "k8s.io/api/core/v1" @@ -37,19 +35,13 @@ import ( ) // ErrSizeExceeded indicates that the result exceeded its maximum allowed size -var ( - ErrSizeExceeded = errors.New("results size exceeds configured limit") - stepDir = pipeline.StepsDir -) +var ErrSizeExceeded = errors.New("results size exceeds configured limit") type SidecarLogResultType string const ( - taskResultType SidecarLogResultType = "task" - stepResultType SidecarLogResultType = "step" - - stepArtifactType SidecarLogResultType = "stepArtifact" - taskArtifactType SidecarLogResultType = "taskArtifact" + taskResultType SidecarLogResultType = "task" + stepResultType SidecarLogResultType = "step" sidecarResultNameSeparator string = "." ) @@ -149,6 +141,8 @@ func LookForResults(w io.Writer, runDir string, resultsDir string, resultNames [ results := make(chan SidecarLogResult) g := new(errgroup.Group) for _, resultFile := range resultNames { + resultFile := resultFile + g.Go(func() error { newResult, err := readResults(resultsDir, resultFile, "", taskResultType) if err != nil { @@ -163,7 +157,10 @@ func LookForResults(w io.Writer, runDir string, resultsDir string, resultNames [ } for sName, sresults := range stepResults { + sresults := sresults + sName := sName for _, resultName := range sresults { + resultName := resultName stepResultsDir := filepath.Join(stepResultsDir, sName, "results") g.Go(func() error { @@ -200,37 +197,6 @@ func LookForResults(w io.Writer, runDir string, resultsDir string, resultNames [ return nil } -// LookForArtifacts searches for and processes artifacts within a specified run directory. -// It looks for "provenance.json" files within the "artifacts" subdirectory of each named step. -// If the provenance file exists, the function extracts artifact information, formats it into a -// JSON string, and encodes it for output alongside relevant metadata (step name, artifact type). -func LookForArtifacts(w io.Writer, names []string, runDir string) error { - if err := waitForStepsToFinish(runDir); err != nil { - return err - } - - for _, name := range names { - p := filepath.Join(stepDir, name, "artifacts", "provenance.json") - if exist, err := fileExists(p); err != nil { - return err - } else if !exist { - continue - } - subRes, err := extractArtifactsFromFile(p) - if err != nil { - return err - } - values, err := json.Marshal(&subRes) - if err != nil { - return err - } - if err := encode(w, SidecarLogResult{Name: name, Value: string(values), Type: stepArtifactType}); err != nil { - return err - } - } - return nil -} - // GetResultsFromSidecarLogs extracts results from the logs of the results sidecar func GetResultsFromSidecarLogs(ctx context.Context, clientset kubernetes.Interface, namespace string, name string, container string, podPhase corev1.PodPhase) ([]result.RunResult, error) { sidecarLogResults := []result.RunResult{} @@ -284,12 +250,8 @@ func parseResults(resultBytes []byte, maxResultLimit int) (result.RunResult, err resultType = result.TaskRunResultType case stepResultType: resultType = result.StepResultType - case stepArtifactType: - resultType = result.StepArtifactsResultType - case taskArtifactType: - resultType = result.TaskRunArtifactsResultType default: - return result.RunResult{}, fmt.Errorf("invalid sidecar result type %v. Must be %v or %v or %v", res.Type, taskResultType, stepResultType, stepArtifactType) + return result.RunResult{}, fmt.Errorf("invalid sidecar result type %v. Must be %v or %v", res.Type, taskResultType, stepResultType) } runResult = result.RunResult{ Key: res.Name, @@ -298,19 +260,3 @@ func parseResults(resultBytes []byte, maxResultLimit int) (result.RunResult, err } return runResult, nil } - -func parseArtifacts(fileContent []byte) (v1.Artifacts, error) { - var as v1.Artifacts - if err := json.Unmarshal(fileContent, &as); err != nil { - return as, fmt.Errorf("invalid artifacts : %w", err) - } - return as, nil -} - -func extractArtifactsFromFile(filename string) (v1.Artifacts, error) { - b, err := os.ReadFile(filename) - if err != nil { - return v1.Artifacts{}, fmt.Errorf("error reading the results file %w", err) - } - return parseArtifacts(b) -} diff --git a/upstream/internal/sidecarlogresults/sidecarlogresults_test.go b/upstream/internal/sidecarlogresults/sidecarlogresults_test.go index ed3d7ba1dbf..2f6a3de8dad 100644 --- a/upstream/internal/sidecarlogresults/sidecarlogresults_test.go +++ b/upstream/internal/sidecarlogresults/sidecarlogresults_test.go @@ -29,10 +29,10 @@ import ( "testing" "github.com/google/go-cmp/cmp" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/result" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" fakekubeclientset "k8s.io/client-go/kubernetes/fake" ) @@ -80,7 +80,7 @@ func TestLookForResults_FanOutAndWait(t *testing.T) { sort.Slice(wantResults, func(i int, j int) bool { return wantResults[i] < wantResults[j] }) sort.Slice(got.Bytes(), func(i int, j int) bool { return got.Bytes()[i] < got.Bytes()[j] }) if d := cmp.Diff(wantResults, got.Bytes()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -143,7 +143,7 @@ func TestLookForResults(t *testing.T) { t.Fatalf("Did not expect any error but got: %v", err) } if d := cmp.Diff(want, got.Bytes()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -213,7 +213,7 @@ func TestLookForStepResults(t *testing.T) { t.Fatalf("Did not expect any error but got: %v", err) } if d := cmp.Diff(want, got.Bytes()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -285,98 +285,27 @@ func TestParseResults(t *testing.T) { Name: "result1", Value: "foo", Type: "task", - }, - { + }, { Name: "result2", Value: `{"IMAGE_URL":"ar.com", "IMAGE_DIGEST":"sha234"}`, Type: "task", - }, - { + }, { Name: "result3", Value: `["hello","world"]`, Type: "task", - }, - { + }, { Name: "step-foo.result1", Value: "foo", Type: "step", - }, - { + }, { Name: "step-foo.result2", Value: `{"IMAGE_URL":"ar.com", "IMAGE_DIGEST":"sha234"}`, Type: "step", - }, - { + }, { Name: "step-foo.result3", Value: `["hello","world"]`, Type: "step", }, - { - Name: "step-artifacts-result", - Value: `{ - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - }`, - Type: "stepArtifact", - }, - { - Name: "task-run-artifacts-result", - Value: `{ - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - }`, - Type: "taskArtifact", - }, } podLogs := []string{} for _, r := range results { @@ -407,70 +336,6 @@ func TestParseResults(t *testing.T) { Key: "step-foo.result3", Value: `["hello","world"]`, ResultType: result.StepResultType, - }, { - Key: "step-artifacts-result", - Value: `{ - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - }`, - ResultType: result.StepArtifactsResultType, - }, { - Key: "task-run-artifacts-result", - Value: `{ - "inputs":[ - { - "name":"input-artifacts", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - }`, - ResultType: result.TaskRunArtifactsResultType, }} stepResults := []result.RunResult{} for _, plog := range podLogs { @@ -489,7 +354,7 @@ func TestParseResults_InvalidType(t *testing.T) { results := []SidecarLogResult{{ Name: "result1", Value: "foo", - Type: "invalid", + Type: "not task or step", }} podLogs := []string{} for _, r := range results { @@ -498,7 +363,7 @@ func TestParseResults_InvalidType(t *testing.T) { } for _, plog := range podLogs { _, err := parseResults([]byte(plog), 4096) - wantErr := errors.New("invalid sidecar result type invalid. Must be task or step or stepArtifact") + wantErr := errors.New("invalid sidecar result type not task or step. Must be task or step") if d := cmp.Diff(wantErr.Error(), err.Error()); d != "" { t.Fatal(diff.PrintWantGot(d)) } @@ -532,7 +397,7 @@ func TestParseResults_Failure(t *testing.T) { func TestGetResultsFromSidecarLogs(t *testing.T) { for _, c := range []struct { desc string - podPhase corev1.PodPhase + podPhase v1.PodPhase wantError bool }{{ desc: "pod pending to start", @@ -546,7 +411,7 @@ func TestGetResultsFromSidecarLogs(t *testing.T) { t.Run(c.desc, func(t *testing.T) { ctx := context.Background() clientset := fakekubeclientset.NewSimpleClientset() - pod := &corev1.Pod{ + pod := &v1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", @@ -555,15 +420,15 @@ func TestGetResultsFromSidecarLogs(t *testing.T) { Name: "pod", Namespace: "foo", }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ + Spec: v1.PodSpec{ + Containers: []v1.Container{ { Name: "container", Image: "image", }, }, }, - Status: corev1.PodStatus{ + Status: v1.PodStatus{ Phase: c.podPhase, }, } @@ -609,166 +474,6 @@ func TestExtractStepAndResultFromSidecarResultName_Error(t *testing.T) { } } -func TestLookForArtifacts(t *testing.T) { - base := basicArtifacts() - modified := base.DeepCopy() - modified.Outputs[0].Name = "tests" - type Arg struct { - stepName string - artifacts *v1.Artifacts - customContent []byte - } - tests := []struct { - desc string - wantErr bool - args []Arg - expected []SidecarLogResult - }{ - { - desc: "one step produces artifacts, read success", - args: []Arg{{stepName: "first", artifacts: &base}}, - expected: []SidecarLogResult{{ - Name: "first", - Type: stepArtifactType, - Value: mustJSON(&base), - }}, - }, - { - desc: "two step produce artifacts, read success", - args: []Arg{{stepName: "first", artifacts: &base}, {stepName: "second", artifacts: modified}}, - expected: []SidecarLogResult{{ - Name: "first", - Type: stepArtifactType, - Value: mustJSON(&base), - }, { - Name: "second", - Type: stepArtifactType, - Value: mustJSON(modified), - }}, - }, - { - desc: "one step produces artifacts, one step does not, read success", - args: []Arg{{stepName: "first", artifacts: &base}, {stepName: "second"}}, - expected: []SidecarLogResult{{ - Name: "first", - Type: stepArtifactType, - Value: mustJSON(&base), - }}, - }, - { - desc: "two step produces, one read success, one not, error out and result is not empty.", - args: []Arg{{stepName: "first", artifacts: &base}, {stepName: "second", artifacts: modified, customContent: []byte("this is to break json")}}, - expected: []SidecarLogResult{{ - Name: "first", - Type: stepArtifactType, - Value: mustJSON(&base), - }}, - wantErr: true, - }, - { - desc: "two step produces, first read fails, error out and result is empty.", - args: []Arg{{stepName: "first", artifacts: modified, customContent: []byte("this is to break json")}, {stepName: "second", artifacts: &base}}, - expected: []SidecarLogResult{}, - wantErr: true, - }, - } - - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - dir := t.TempDir() - curStepDir := stepDir - stepDir = dir - t.Cleanup(func() { - stepDir = curStepDir - }) - - var names []string - for _, arg := range tc.args { - names = append(names, arg.stepName) - if err := os.MkdirAll(filepath.Join(dir, arg.stepName, "artifacts"), os.ModePerm); err != nil { - t.Errorf("failed to create artifacts folder, err: %v", err) - } - if _, err := os.Create(filepath.Join(dir, arg.stepName, "out")); err != nil { - t.Errorf("failed to file, err: %v", err) - } - if arg.artifacts != nil { - if err := writeArtifacts(filepath.Join(dir, arg.stepName, "artifacts", "provenance.json"), arg.artifacts); err != nil { - t.Errorf("failed to write artifacts to provenance.json, err: %v", err) - } - } - if arg.customContent != nil { - if err := os.WriteFile(filepath.Join(dir, arg.stepName, "artifacts", "provenance.json"), arg.customContent, os.ModePerm); err != nil { - t.Errorf("failed to write customContent to provenance.json, err: %v", err) - } - } - } - var buf bytes.Buffer - err := LookForArtifacts(&buf, names, dir) - if (err != nil) != tc.wantErr { - t.Errorf("error checking failed, wantErr: %v, got: %v", tc.wantErr, err) - } - want := "" - for _, logResult := range tc.expected { - want += mustJSON(logResult) + "\n" - } - got := buf.String() - - if d := cmp.Diff(want, got); d != "" { - t.Error(diff.PrintWantGot(d)) - } - }) - } -} - -func writeArtifacts(path string, artifacts *v1.Artifacts) error { - f, err := os.Create(path) - if err != nil { - return err - } - defer f.Close() - res := json.NewEncoder(f).Encode(artifacts) - return res -} - -func basicArtifacts() v1.Artifacts { - data := `{ - "inputs":[ - { - "name":"inputs", - "values":[ - { - "uri":"pkg:example.github.com/inputs", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "values":[ - { - "uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } -` - var ars v1.Artifacts - err := json.Unmarshal([]byte(data), &ars) - if err != nil { - panic(err) - } - return ars -} - func createStepResult(t *testing.T, dir, stepName, resultName, resultValue string) { t.Helper() resultDir := filepath.Join(dir, stepName, "results") @@ -802,11 +507,3 @@ func createRun(t *testing.T, dir string, causeErr bool) { t.Fatal(err) } } - -func mustJSON(data any) string { - marshal, err := json.Marshal(data) - if err != nil { - panic(err) - } - return string(marshal) -} diff --git a/upstream/pkg/apis/config/feature_flags.go b/upstream/pkg/apis/config/feature_flags.go index d0db62052cf..f8c057801a0 100644 --- a/upstream/pkg/apis/config/feature_flags.go +++ b/upstream/pkg/apis/config/feature_flags.go @@ -102,16 +102,12 @@ const ( EnableCELInWhenExpression = "enable-cel-in-whenexpression" // EnableStepActions is the flag to enable the use of StepActions in Steps EnableStepActions = "enable-step-actions" + // EnableArtifacts is the flag to enable the use of Artifacts in Steps EnableArtifacts = "enable-artifacts" + // EnableParamEnum is the flag to enabled enum in params EnableParamEnum = "enable-param-enum" - // EnableConciseResolverSyntax is the flag to enable concise resolver syntax - EnableConciseResolverSyntax = "enable-concise-resolver-syntax" - // EnableKubernetesSidecar is the flag to enable kubernetes sidecar support - EnableKubernetesSidecar = "enable-kubernetes-sidecar" - // DefaultEnableKubernetesSidecar is the default value for EnableKubernetesSidecar - DefaultEnableKubernetesSidecar = false // DisableInlineSpec is the flag to disable embedded spec // in Taskrun or Pipelinerun @@ -122,16 +118,16 @@ const ( runningInEnvWithInjectedSidecarsKey = "running-in-environment-with-injected-sidecars" awaitSidecarReadinessKey = "await-sidecar-readiness" requireGitSSHSecretKnownHostsKey = "require-git-ssh-secret-known-hosts" //nolint:gosec - // enableTektonOCIBundles = "enable-tekton-oci-bundles" - enableAPIFields = "enable-api-fields" - sendCloudEventsForRuns = "send-cloudevents-for-runs" - enforceNonfalsifiability = "enforce-nonfalsifiability" - verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy" - enableProvenanceInStatus = "enable-provenance-in-status" - resultExtractionMethod = "results-from" - maxResultSize = "max-result-size" - setSecurityContextKey = "set-security-context" - coscheduleKey = "coschedule" + enableTektonOCIBundles = "enable-tekton-oci-bundles" + enableAPIFields = "enable-api-fields" + sendCloudEventsForRuns = "send-cloudevents-for-runs" + enforceNonfalsifiability = "enforce-nonfalsifiability" + verificationNoMatchPolicy = "trusted-resources-verification-no-match-policy" + enableProvenanceInStatus = "enable-provenance-in-status" + resultExtractionMethod = "results-from" + maxResultSize = "max-result-size" + setSecurityContextKey = "set-security-context" + coscheduleKey = "coschedule" ) // DefaultFeatureFlags holds all the default configurations for the feature flags configmap. @@ -155,13 +151,13 @@ var ( // DefaultEnableStepActions is the default PerFeatureFlag value for EnableStepActions DefaultEnableStepActions = PerFeatureFlag{ Name: EnableStepActions, - Stability: BetaAPIFields, - Enabled: DefaultBetaFeatureEnabled, + Stability: AlphaAPIFields, + Enabled: DefaultAlphaFeatureEnabled, } - // DefaultEnableArtifacts is the default PerFeatureFlag value for EnableArtifacts + // DefaultEnableArtifacts is the default PerFeatureFlag value for EnableStepActions DefaultEnableArtifacts = PerFeatureFlag{ - Name: EnableArtifacts, + Name: EnableStepActions, Stability: AlphaAPIFields, Enabled: DefaultAlphaFeatureEnabled, } @@ -172,13 +168,6 @@ var ( Stability: AlphaAPIFields, Enabled: DefaultAlphaFeatureEnabled, } - - // DefaultEnableConciseResolverSyntax is the default PerFeatureFlag value for EnableConciseResolverSyntax - DefaultEnableConciseResolverSyntax = PerFeatureFlag{ - Name: EnableConciseResolverSyntax, - Stability: AlphaAPIFields, - Enabled: DefaultAlphaFeatureEnabled, - } ) // FeatureFlags holds the features configurations @@ -188,31 +177,29 @@ type FeatureFlags struct { DisableCredsInit bool RunningInEnvWithInjectedSidecars bool RequireGitSSHSecretKnownHosts bool - // EnableTektonOCIBundles bool // Deprecated: this is now ignored - // ScopeWhenExpressionsToTask bool // Deprecated: this is now ignored - EnableAPIFields string - SendCloudEventsForRuns bool - AwaitSidecarReadiness bool - EnforceNonfalsifiability string - EnableKeepPodOnCancel bool + EnableTektonOCIBundles bool + ScopeWhenExpressionsToTask bool + EnableAPIFields string + SendCloudEventsForRuns bool + AwaitSidecarReadiness bool + EnforceNonfalsifiability string + EnableKeepPodOnCancel bool // VerificationNoMatchPolicy is the feature flag for "trusted-resources-verification-no-match-policy" // VerificationNoMatchPolicy can be set to "ignore", "warn" and "fail" values. // ignore: skip trusted resources verification when no matching verification policies found // warn: skip trusted resources verification when no matching verification policies found and log a warning // fail: fail the taskrun or pipelines run if no matching verification policies found - VerificationNoMatchPolicy string - EnableProvenanceInStatus bool - ResultExtractionMethod string - MaxResultSize int - SetSecurityContext bool - Coschedule string - EnableCELInWhenExpression bool - EnableStepActions bool - EnableParamEnum bool - EnableArtifacts bool - DisableInlineSpec string - EnableConciseResolverSyntax bool - EnableKubernetesSidecar bool + VerificationNoMatchPolicy string + EnableProvenanceInStatus bool + ResultExtractionMethod string + MaxResultSize int + SetSecurityContext bool + Coschedule string + EnableCELInWhenExpression bool + EnableStepActions bool + EnableParamEnum bool + EnableArtifacts bool + DisableInlineSpec string } // GetFeatureFlagsConfigName returns the name of the configmap containing all @@ -307,20 +294,27 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) { if err := setPerFeatureFlag(EnableParamEnum, DefaultEnableParamEnum, &tc.EnableParamEnum); err != nil { return nil, err } + if err := setPerFeatureFlag(EnableArtifacts, DefaultEnableArtifacts, &tc.EnableArtifacts); err != nil { return nil, err } - if err := setFeatureInlineSpec(cfgMap, DisableInlineSpec, DefaultDisableInlineSpec, &tc.DisableInlineSpec); err != nil { return nil, err } - if err := setPerFeatureFlag(EnableConciseResolverSyntax, DefaultEnableConciseResolverSyntax, &tc.EnableConciseResolverSyntax); err != nil { - return nil, err - } - if err := setFeature(EnableKubernetesSidecar, DefaultEnableKubernetesSidecar, &tc.EnableKubernetesSidecar); err != nil { - return nil, err - } + // Given that they are alpha features, Tekton Bundles and Custom Tasks should be switched on if + // enable-api-fields is "alpha". If enable-api-fields is not "alpha" then fall back to the value of + // each feature's individual flag. + // + // Note: the user cannot enable "alpha" while disabling bundles or custom tasks - that would + // defeat the purpose of having a single shared gate for all alpha features. + if tc.EnableAPIFields == AlphaAPIFields { + tc.EnableTektonOCIBundles = true + } else { + if err := setFeature(enableTektonOCIBundles, DefaultEnableTektonOciBundles, &tc.EnableTektonOCIBundles); err != nil { + return nil, err + } + } return &tc, nil } diff --git a/upstream/pkg/apis/config/feature_flags_test.go b/upstream/pkg/apis/config/feature_flags_test.go index 30c0e06a8e0..0cefc572368 100644 --- a/upstream/pkg/apis/config/feature_flags_test.go +++ b/upstream/pkg/apis/config/feature_flags_test.go @@ -43,6 +43,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { RequireGitSSHSecretKnownHosts: false, DisableCredsInit: config.DefaultDisableCredsInit, AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness, + EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles, EnableAPIFields: config.DefaultEnableAPIFields, SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns, VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig, @@ -57,7 +58,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { EnableStepActions: config.DefaultEnableStepActions.Enabled, EnableParamEnum: config.DefaultEnableParamEnum.Enabled, DisableInlineSpec: config.DefaultDisableInlineSpec, - EnableConciseResolverSyntax: config.DefaultEnableConciseResolverSyntax.Enabled, }, fileName: config.GetFeatureFlagsConfigName(), }, @@ -67,6 +67,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { RunningInEnvWithInjectedSidecars: false, AwaitSidecarReadiness: false, RequireGitSSHSecretKnownHosts: true, + EnableTektonOCIBundles: true, EnableAPIFields: "alpha", SendCloudEventsForRuns: true, EnforceNonfalsifiability: "spire", @@ -82,8 +83,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { EnableArtifacts: true, EnableParamEnum: true, DisableInlineSpec: "pipeline,pipelinerun,taskrun", - EnableConciseResolverSyntax: true, - EnableKubernetesSidecar: true, }, fileName: "feature-flags-all-flags-set", }, @@ -92,6 +91,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { EnableAPIFields: "alpha", // These are prescribed as true by enabling "alpha" API fields, even // if the submitted text value is "false". + EnableTektonOCIBundles: true, EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability, DisableAffinityAssistant: config.DefaultDisableAffinityAssistant, DisableCredsInit: config.DefaultDisableCredsInit, @@ -109,7 +109,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { EnableCELInWhenExpression: config.DefaultEnableCELInWhenExpression.Enabled, EnableStepActions: config.DefaultEnableStepActions.Enabled, EnableParamEnum: config.DefaultEnableParamEnum.Enabled, - EnableArtifacts: config.DefaultEnableArtifacts.Enabled, DisableInlineSpec: config.DefaultDisableInlineSpec, }, fileName: "feature-flags-enable-api-fields-overrides-bundles-and-custom-tasks", @@ -117,6 +116,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { { expectedConfig: &config.FeatureFlags{ EnableAPIFields: "stable", + EnableTektonOCIBundles: true, EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability, DisableAffinityAssistant: config.DefaultDisableAffinityAssistant, DisableCredsInit: config.DefaultDisableCredsInit, @@ -138,6 +138,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { { expectedConfig: &config.FeatureFlags{ EnableAPIFields: "beta", + EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles, EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability, DisableAffinityAssistant: config.DefaultDisableAffinityAssistant, DisableCredsInit: config.DefaultDisableCredsInit, @@ -160,6 +161,7 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) { expectedConfig: &config.FeatureFlags{ EnableAPIFields: config.DefaultEnableAPIFields, EnforceNonfalsifiability: config.EnforceNonfalsifiabilityWithSpire, + EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles, VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig, RunningInEnvWithInjectedSidecars: config.DefaultRunningInEnvWithInjectedSidecars, AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness, @@ -215,6 +217,7 @@ func TestNewFeatureFlagsFromEmptyConfigMap(t *testing.T) { RunningInEnvWithInjectedSidecars: config.DefaultRunningInEnvWithInjectedSidecars, AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness, RequireGitSSHSecretKnownHosts: config.DefaultRequireGitSSHSecretKnownHosts, + EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles, EnableAPIFields: config.DefaultEnableAPIFields, SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns, EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability, @@ -312,12 +315,6 @@ func TestNewFeatureFlagsConfigMapErrors(t *testing.T) { }, { fileName: "feature-flags-invalid-enable-artifacts", want: `failed parsing feature flags config "invalid": strconv.ParseBool: parsing "invalid": invalid syntax for feature enable-artifacts`, - }, { - fileName: "feature-flags-invalid-enable-concise-resolver-syntax", - want: `failed parsing feature flags config "invalid": strconv.ParseBool: parsing "invalid": invalid syntax for feature enable-concise-resolver-syntax`, - }, { - fileName: "feature-flags-invalid-enable-kubernetes-sidecar", - want: `failed parsing feature flags config "invalid": strconv.ParseBool: parsing "invalid": invalid syntax`, }} { t.Run(tc.fileName, func(t *testing.T) { cm := test.ConfigMapFromTestFile(t, tc.fileName) @@ -332,6 +329,7 @@ func TestNewFeatureFlagsConfigMapErrors(t *testing.T) { } func TestGetVerificationNoMatchPolicy(t *testing.T) { + ctx := context.Background() tcs := []struct { name, noMatchPolicy, expected string }{{ @@ -350,7 +348,6 @@ func TestGetVerificationNoMatchPolicy(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() store := config.NewStore(logging.FromContext(ctx).Named("config-store")) featureflags := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -414,7 +411,7 @@ func TestIsSpireEnabled(t *testing.T) { Data: tc.configmap, } store.OnConfigChanged(featureflags) - ctx := store.ToContext(ctx) + ctx = store.ToContext(ctx) got := config.IsSpireEnabled(ctx) if tc.want != got { diff --git a/upstream/pkg/apis/config/metrics.go b/upstream/pkg/apis/config/metrics.go index f86d4a136a2..2b18f6d0c38 100644 --- a/upstream/pkg/apis/config/metrics.go +++ b/upstream/pkg/apis/config/metrics.go @@ -29,9 +29,6 @@ const ( // metricsPipelinerunLevel determines to what level to aggregate metrics // for pipelinerun metricsPipelinerunLevelKey = "metrics.pipelinerun.level" - // metricsRunningPipelinerunLevelKey determines to what level to aggregate metrics - // for running pipelineruns - metricsRunningPipelinerunLevelKey = "metrics.running-pipelinerun.level" // metricsDurationTaskrunType determines what type of // metrics to use for aggregating duration for taskrun metricsDurationTaskrunType = "metrics.taskrun.duration-type" @@ -42,9 +39,6 @@ const ( // countWithReasonKey sets if the reason label should be included on count metrics countWithReasonKey = "metrics.count.enable-reason" - // throttledWithNamespaceKey sets if the namespace label should be included on the taskrun throttled metrics - throttledWithNamespaceKey = "metrics.taskrun.throttle.enable-namespace" - // DefaultTaskrunLevel determines to what level to aggregate metrics // when it isn't specified in configmap DefaultTaskrunLevel = TaskrunLevelAtTask @@ -58,9 +52,6 @@ const ( // DefaultPipelinerunLevel determines to what level to aggregate metrics // when it isn't specified in configmap DefaultPipelinerunLevel = PipelinerunLevelAtPipeline - // DefaultRunningPipelinerunLevel determines to what level to aggregate metrics - // when it isn't specified in configmap - DefaultRunningPipelinerunLevel = "" // PipelinerunLevelAtPipelinerun specify that aggregation will be done at // pipelinerun level PipelinerunLevelAtPipelinerun = "pipelinerun" @@ -102,11 +93,9 @@ var DefaultMetrics, _ = newMetricsFromMap(map[string]string{}) type Metrics struct { TaskrunLevel string PipelinerunLevel string - RunningPipelinerunLevel string DurationTaskrunType string DurationPipelinerunType string CountWithReason bool - ThrottleWithNamespace bool } // GetMetricsConfigName returns the name of the configmap containing all @@ -137,11 +126,9 @@ func newMetricsFromMap(cfgMap map[string]string) (*Metrics, error) { tc := Metrics{ TaskrunLevel: DefaultTaskrunLevel, PipelinerunLevel: DefaultPipelinerunLevel, - RunningPipelinerunLevel: DefaultRunningPipelinerunLevel, DurationTaskrunType: DefaultDurationTaskrunType, DurationPipelinerunType: DefaultDurationPipelinerunType, CountWithReason: false, - ThrottleWithNamespace: false, } if taskrunLevel, ok := cfgMap[metricsTaskrunLevelKey]; ok { @@ -151,9 +138,6 @@ func newMetricsFromMap(cfgMap map[string]string) (*Metrics, error) { if pipelinerunLevel, ok := cfgMap[metricsPipelinerunLevelKey]; ok { tc.PipelinerunLevel = pipelinerunLevel } - if runningPipelinerunLevel, ok := cfgMap[metricsRunningPipelinerunLevelKey]; ok { - tc.RunningPipelinerunLevel = runningPipelinerunLevel - } if durationTaskrun, ok := cfgMap[metricsDurationTaskrunType]; ok { tc.DurationTaskrunType = durationTaskrun } @@ -165,10 +149,6 @@ func newMetricsFromMap(cfgMap map[string]string) (*Metrics, error) { tc.CountWithReason = true } - if throttleWithNamespace, ok := cfgMap[throttledWithNamespaceKey]; ok && throttleWithNamespace != "false" { - tc.ThrottleWithNamespace = true - } - return &tc, nil } diff --git a/upstream/pkg/apis/config/metrics_test.go b/upstream/pkg/apis/config/metrics_test.go index 62872897af1..4508a5c71e3 100644 --- a/upstream/pkg/apis/config/metrics_test.go +++ b/upstream/pkg/apis/config/metrics_test.go @@ -36,11 +36,9 @@ func TestNewMetricsFromConfigMap(t *testing.T) { expectedConfig: &config.Metrics{ TaskrunLevel: config.TaskrunLevelAtTaskrun, PipelinerunLevel: config.PipelinerunLevelAtPipelinerun, - RunningPipelinerunLevel: config.DefaultRunningPipelinerunLevel, DurationTaskrunType: config.DurationPipelinerunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeHistogram, CountWithReason: false, - ThrottleWithNamespace: false, }, fileName: config.GetMetricsConfigName(), }, @@ -48,11 +46,9 @@ func TestNewMetricsFromConfigMap(t *testing.T) { expectedConfig: &config.Metrics{ TaskrunLevel: config.TaskrunLevelAtNS, PipelinerunLevel: config.PipelinerunLevelAtNS, - RunningPipelinerunLevel: config.PipelinerunLevelAtNS, DurationTaskrunType: config.DurationTaskrunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, CountWithReason: false, - ThrottleWithNamespace: false, }, fileName: "config-observability-namespacelevel", }, @@ -60,26 +56,12 @@ func TestNewMetricsFromConfigMap(t *testing.T) { expectedConfig: &config.Metrics{ TaskrunLevel: config.TaskrunLevelAtNS, PipelinerunLevel: config.PipelinerunLevelAtNS, - RunningPipelinerunLevel: config.DefaultRunningPipelinerunLevel, DurationTaskrunType: config.DurationTaskrunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, CountWithReason: true, - ThrottleWithNamespace: false, }, fileName: "config-observability-reason", }, - { - expectedConfig: &config.Metrics{ - TaskrunLevel: config.TaskrunLevelAtNS, - PipelinerunLevel: config.PipelinerunLevelAtNS, - RunningPipelinerunLevel: config.PipelinerunLevelAtPipeline, - DurationTaskrunType: config.DurationTaskrunTypeHistogram, - DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, - CountWithReason: true, - ThrottleWithNamespace: true, - }, - fileName: "config-observability-throttle", - }, } for _, tc := range testCases { @@ -92,11 +74,9 @@ func TestNewMetricsFromEmptyConfigMap(t *testing.T) { expectedConfig := &config.Metrics{ TaskrunLevel: config.TaskrunLevelAtTask, PipelinerunLevel: config.PipelinerunLevelAtPipeline, - RunningPipelinerunLevel: config.DefaultRunningPipelinerunLevel, DurationTaskrunType: config.DurationPipelinerunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeHistogram, CountWithReason: false, - ThrottleWithNamespace: false, } verifyConfigFileWithExpectedMetricsConfig(t, MetricsConfigEmptyName, expectedConfig) } diff --git a/upstream/pkg/apis/config/testdata/config-observability-namespacelevel.yaml b/upstream/pkg/apis/config/testdata/config-observability-namespacelevel.yaml index 65a72ede515..5029ee0099f 100644 --- a/upstream/pkg/apis/config/testdata/config-observability-namespacelevel.yaml +++ b/upstream/pkg/apis/config/testdata/config-observability-namespacelevel.yaml @@ -27,5 +27,4 @@ data: metrics.taskrun.level: "namespace" metrics.taskrun.duration-type: "histogram" metrics.pipelinerun.level: "namespace" - metrics.running-pipelinerun.level: "namespace" metrics.pipelinerun.duration-type: "lastvalue" diff --git a/upstream/pkg/apis/config/testdata/config-observability-throttle.yaml b/upstream/pkg/apis/config/testdata/config-observability-throttle.yaml deleted file mode 100644 index 08fe6ac9d5a..00000000000 --- a/upstream/pkg/apis/config/testdata/config-observability-throttle.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2019 The Tekton Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: config-observability - namespace: tekton-pipelines - labels: - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: tekton-pipelines -data: - metrics.backend-destination: prometheus - metrics.stackdriver-project-id: "" - metrics.allow-stackdriver-custom-metrics: "false" - metrics.taskrun.level: "namespace" - metrics.taskrun.duration-type: "histogram" - metrics.pipelinerun.level: "namespace" - metrics.running-pipelinerun.level: "pipeline" - metrics.pipelinerun.duration-type: "lastvalue" - metrics.count.enable-reason: "true" - metrics.taskrun.throttle.enable-namespace: "true" diff --git a/upstream/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml b/upstream/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml index a01101604a1..6b539bc16da 100644 --- a/upstream/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml +++ b/upstream/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml @@ -37,5 +37,3 @@ data: enable-param-enum: "true" enable-artifacts: "true" disable-inline-spec: "pipeline,pipelinerun,taskrun" - enable-concise-resolver-syntax: "true" - enable-kubernetes-sidecar: "true" diff --git a/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-concise-resolver-syntax.yaml b/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-concise-resolver-syntax.yaml deleted file mode 100644 index 4945e2f6f76..00000000000 --- a/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-concise-resolver-syntax.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2024 The Tekton Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: feature-flags - namespace: tekton-pipelines -data: - enable-concise-resolver-syntax: "invalid" diff --git a/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-kubernetes-sidecar.yaml b/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-kubernetes-sidecar.yaml deleted file mode 100644 index cc78bf080d8..00000000000 --- a/upstream/pkg/apis/config/testdata/feature-flags-invalid-enable-kubernetes-sidecar.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2024 The Tekton Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: feature-flags - namespace: tekton-pipelines -data: - enable-kubernetes-sidecar: "invalid" diff --git a/upstream/pkg/apis/pipeline/errors/errors.go b/upstream/pkg/apis/pipeline/errors/errors.go index fbd487bba33..f81dd2e5f82 100644 --- a/upstream/pkg/apis/pipeline/errors/errors.go +++ b/upstream/pkg/apis/pipeline/errors/errors.go @@ -13,12 +13,7 @@ limitations under the License. package errors -import ( - "errors" - "strings" - - apierrors "k8s.io/apimachinery/pkg/api/errors" -) +import "errors" const UserErrorLabel = "[User error] " @@ -76,10 +71,3 @@ func GetErrorMessage(err error) string { } return err.Error() } - -// IsImmutableTaskRunSpecError returns true if the error is the taskrun spec is immutable -func IsImmutableTaskRunSpecError(err error) bool { - // The TaskRun may have completed and the spec field is immutable. - // validation code: https://github.com/tektoncd/pipeline/blob/v0.62.0/pkg/apis/pipeline/v1/taskrun_validation.go#L136-L138 - return apierrors.IsBadRequest(err) && strings.Contains(err.Error(), "no updates are allowed") -} diff --git a/upstream/pkg/apis/pipeline/options.go b/upstream/pkg/apis/pipeline/options.go index aef10b995e1..2e75adca4c1 100644 --- a/upstream/pkg/apis/pipeline/options.go +++ b/upstream/pkg/apis/pipeline/options.go @@ -16,11 +16,8 @@ limitations under the License. package pipeline -import "time" - // Options holds options passed to the Tekton Pipeline controllers // typically via command-line flags. type Options struct { - Images Images - ResyncPeriod time.Duration + Images Images } diff --git a/upstream/pkg/apis/pipeline/paths.go b/upstream/pkg/apis/pipeline/paths.go index efb28ea9025..fb2b3bcf87c 100644 --- a/upstream/pkg/apis/pipeline/paths.go +++ b/upstream/pkg/apis/pipeline/paths.go @@ -30,6 +30,4 @@ const ( StepsDir = "/tekton/steps" ScriptDir = "/tekton/scripts" - - ArtifactsDir = "/tekton/artifacts" ) diff --git a/upstream/pkg/apis/pipeline/pod/affinity_assitant_template.go b/upstream/pkg/apis/pipeline/pod/affinity_assitant_template.go index 214ec6a8700..2dace6398ac 100644 --- a/upstream/pkg/apis/pipeline/pod/affinity_assitant_template.go +++ b/upstream/pkg/apis/pipeline/pod/affinity_assitant_template.go @@ -42,19 +42,6 @@ type AffinityAssistantTemplate struct { // +optional // +listType=atomic ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - - // SecurityContext sets the security context for the pod - // +optional - SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` - - // If specified, indicates the pod's priority. "system-node-critical" and - // "system-cluster-critical" are two special keywords which indicate the - // highest priorities with the former being the highest priority. Any other - // name must be defined by creating a PriorityClass object with that name. - // If not specified, the pod priority will be default or zero if there is no - // default. - // +optional - PriorityClassName *string `json:"priorityClassName,omitempty"` } // Equals checks if this Template is identical to the given Template. diff --git a/upstream/pkg/apis/pipeline/pod/template.go b/upstream/pkg/apis/pipeline/pod/template.go index 6bc37fecd7f..855a6ea9b8d 100644 --- a/upstream/pkg/apis/pipeline/pod/template.go +++ b/upstream/pkg/apis/pipeline/pod/template.go @@ -148,11 +148,9 @@ func (tpl *Template) ToAffinityAssistantTemplate() *AffinityAssistantTemplate { } return &AffinityAssistantTemplate{ - NodeSelector: tpl.NodeSelector, - Tolerations: tpl.Tolerations, - ImagePullSecrets: tpl.ImagePullSecrets, - SecurityContext: tpl.SecurityContext, - PriorityClassName: tpl.PriorityClassName, + NodeSelector: tpl.NodeSelector, + Tolerations: tpl.Tolerations, + ImagePullSecrets: tpl.ImagePullSecrets, } } @@ -249,13 +247,6 @@ func MergeAAPodTemplateWithDefault(tpl, defaultTpl *AAPodTemplate) *AAPodTemplat if tpl.ImagePullSecrets == nil { tpl.ImagePullSecrets = defaultTpl.ImagePullSecrets } - if tpl.SecurityContext == nil { - tpl.SecurityContext = defaultTpl.SecurityContext - } - if tpl.PriorityClassName == nil { - tpl.PriorityClassName = defaultTpl.PriorityClassName - } - return tpl } } diff --git a/upstream/pkg/apis/pipeline/pod/template_test.go b/upstream/pkg/apis/pipeline/pod/template_test.go index 4e09e5068a3..64eaf704877 100644 --- a/upstream/pkg/apis/pipeline/pod/template_test.go +++ b/upstream/pkg/apis/pipeline/pod/template_test.go @@ -163,62 +163,7 @@ func TestMergePodTemplateWithDefault(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := MergePodTemplateWithDefault(tc.tpl, tc.defaultTpl) if !reflect.DeepEqual(result, tc.expected) { - t.Errorf("mergePodTemplateWithDefault%v, %v) = %v, want %v", tc.tpl, tc.defaultTpl, result, tc.expected) - } - }) - } -} - -func TestMergeAAPodTemplateWithDefault(t *testing.T) { - priority1 := "low-priority" - priority2 := "high-priority" - type testCase struct { - name string - tpl *AAPodTemplate - defaultTpl *AAPodTemplate - expected *AAPodTemplate - } - - testCases := []testCase{ - { - name: "defaultTpl is nil", - tpl: &AAPodTemplate{ - NodeSelector: map[string]string{"foo": "bar"}, - }, - defaultTpl: nil, - expected: &AAPodTemplate{ - NodeSelector: map[string]string{"foo": "bar"}, - }, - }, - { - name: "tpl is nil", - tpl: nil, - defaultTpl: &AAPodTemplate{ - NodeSelector: map[string]string{"foo": "bar"}, - }, - expected: &AAPodTemplate{ - NodeSelector: map[string]string{"foo": "bar"}, - }, - }, - { - name: "override default priorityClassName", - tpl: &AAPodTemplate{ - PriorityClassName: &priority2, - }, - defaultTpl: &AAPodTemplate{ - PriorityClassName: &priority1, - }, - expected: &AAPodTemplate{ - PriorityClassName: &priority2, - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - result := MergeAAPodTemplateWithDefault(tc.tpl, tc.defaultTpl) - if !reflect.DeepEqual(result, tc.expected) { - t.Errorf("mergeAAPodTemplateWithDefault(%v, %v) = %v, want %v", tc.tpl, tc.defaultTpl, result, tc.expected) + t.Errorf("mergeByName(%v, %v) = %v, want %v", tc.tpl, tc.defaultTpl, result, tc.expected) } }) } diff --git a/upstream/pkg/apis/pipeline/pod/zz_generated.deepcopy.go b/upstream/pkg/apis/pipeline/pod/zz_generated.deepcopy.go index 098b0fbeb13..450128e3a9d 100644 --- a/upstream/pkg/apis/pipeline/pod/zz_generated.deepcopy.go +++ b/upstream/pkg/apis/pipeline/pod/zz_generated.deepcopy.go @@ -47,16 +47,6 @@ func (in *AffinityAssistantTemplate) DeepCopyInto(out *AffinityAssistantTemplate *out = make([]v1.LocalObjectReference, len(*in)) copy(*out, *in) } - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(v1.PodSecurityContext) - (*in).DeepCopyInto(*out) - } - if in.PriorityClassName != nil { - in, out := &in.PriorityClassName, &out.PriorityClassName - *out = new(string) - **out = **in - } return } diff --git a/upstream/pkg/apis/pipeline/register.go b/upstream/pkg/apis/pipeline/register.go index 9971a9b79d6..ff713753d06 100644 --- a/upstream/pkg/apis/pipeline/register.go +++ b/upstream/pkg/apis/pipeline/register.go @@ -34,18 +34,12 @@ const ( // TaskRunLabelKey is used as the label identifier for a TaskRun TaskRunLabelKey = GroupName + "/taskRun" - // TaskRunLabelKey is used as the label identifier for a TaskRun - TaskRunUIDLabelKey = GroupName + "/taskRunUID" - // PipelineLabelKey is used as the label identifier for a Pipeline PipelineLabelKey = GroupName + "/pipeline" // PipelineRunLabelKey is used as the label identifier for a PipelineRun PipelineRunLabelKey = GroupName + "/pipelineRun" - // PipelineRunLabelKey is used as the label identifier for a PipelineRun - PipelineRunUIDLabelKey = GroupName + "/pipelineRunUID" - // PipelineTaskLabelKey is used as the label identifier for a PipelineTask PipelineTaskLabelKey = GroupName + "/pipelineTask" diff --git a/upstream/pkg/apis/pipeline/v1/artifact_types.go b/upstream/pkg/apis/pipeline/v1/artifact_types.go index 6281c3e1e45..07e43ebe171 100644 --- a/upstream/pkg/apis/pipeline/v1/artifact_types.go +++ b/upstream/pkg/apis/pipeline/v1/artifact_types.go @@ -1,37 +1,13 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 v1 -import ( - "github.com/google/go-cmp/cmp" -) - // Algorithm Standard cryptographic hash algorithm type Algorithm string // Artifact represents an artifact within a system, potentially containing multiple values // associated with it. type Artifact struct { - // The artifact's identifying category name - Name string `json:"name,omitempty"` - // A collection of values related to the artifact - Values []ArtifactValue `json:"values,omitempty"` - // Indicate if the artifact is a build output or a by-product - BuildOutput bool `json:"buildOutput,omitempty"` + Name string `json:"name,omitempty"` // The artifact's identifying category name + Values []ArtifactValue `json:"values,omitempty"` // A collection of values related to the artifact } // ArtifactValue represents a specific value or data element within an Artifact. @@ -51,85 +27,3 @@ type Artifacts struct { Inputs []Artifact `json:"inputs,omitempty"` Outputs []Artifact `json:"outputs,omitempty"` } - -func (a *Artifacts) Merge(another *Artifacts) { - inputMap := make(map[string][]ArtifactValue) - var newInputs []Artifact - - for _, v := range a.Inputs { - inputMap[v.Name] = v.Values - } - if another != nil { - for _, v := range another.Inputs { - _, ok := inputMap[v.Name] - if !ok { - inputMap[v.Name] = []ArtifactValue{} - } - for _, vv := range v.Values { - exists := false - for _, av := range inputMap[v.Name] { - if cmp.Equal(vv, av) { - exists = true - break - } - } - if !exists { - inputMap[v.Name] = append(inputMap[v.Name], vv) - } - } - } - } - - for k, v := range inputMap { - newInputs = append(newInputs, Artifact{ - Name: k, - Values: v, - }) - } - - outputMap := make(map[string]Artifact) - var newOutputs []Artifact - for _, v := range a.Outputs { - outputMap[v.Name] = v - } - - if another != nil { - for _, v := range another.Outputs { - _, ok := outputMap[v.Name] - if !ok { - outputMap[v.Name] = Artifact{Name: v.Name, Values: []ArtifactValue{}, BuildOutput: v.BuildOutput} - } - // only update buildOutput to true. - // Do not convert to false if it was true before. - if v.BuildOutput { - art := outputMap[v.Name] - art.BuildOutput = v.BuildOutput - outputMap[v.Name] = art - } - for _, vv := range v.Values { - exists := false - for _, av := range outputMap[v.Name].Values { - if cmp.Equal(vv, av) { - exists = true - break - } - } - if !exists { - art := outputMap[v.Name] - art.Values = append(art.Values, vv) - outputMap[v.Name] = art - } - } - } - } - - for _, v := range outputMap { - newOutputs = append(newOutputs, Artifact{ - Name: v.Name, - Values: v.Values, - BuildOutput: v.BuildOutput, - }) - } - a.Inputs = newInputs - a.Outputs = newOutputs -} diff --git a/upstream/pkg/apis/pipeline/v1/artifact_types_test.go b/upstream/pkg/apis/pipeline/v1/artifact_types_test.go deleted file mode 100644 index 979b73286ad..00000000000 --- a/upstream/pkg/apis/pipeline/v1/artifact_types_test.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 v1 - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/tektoncd/pipeline/test/diff" -) - -func TestArtifactsMerge(t *testing.T) { - type testCase struct { - name string - a1 Artifacts - a2 Artifacts - expected Artifacts - } - - testCases := []testCase{ - { - name: "Merges inputs and outputs with deduplication", - a1: Artifacts{ - Inputs: []Artifact{ - { - Name: "input1", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - Uri: "pkg:maven/org.apache.commons/commons-lang3/3.12.0", - }, - }, - }, - { - Name: "input2", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "d596377f2d54b3f8b4619f137d08892989893b886742759144582c94157526f1"}, - Uri: "pkg:pypi/requests/2.28.2", - }, - }, - }, - }, - Outputs: []Artifact{ - { - Name: "output1", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "47de7a85905970a45132f48a9247879a15c483477e23a637504694e611135b40e"}, - Uri: "pkg:npm/lodash/4.17.21", - }, - }, - }, - }, - }, - a2: Artifacts{ - Inputs: []Artifact{ - { - Name: "input1", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - Uri: "pkg:maven/org.apache.commons/commons-lang3/3.12.0", - }, - { - Digest: map[Algorithm]string{"sha256": "97c13e1812b666824266111701398e56e30d14418a2d9b35987f516a66e2129f"}, - Uri: "pkg:nuget/Microsoft.Extensions.Logging/7.0.0", - }, - }, - }, - { - Name: "input3", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "13c2b709e3a100726680e53e19666656a89a2f2490e917ba15d6b15475ab7b79"}, - Uri: "pkg:debian/openssl/1.1.1", - }, - }, - }, - }, - Outputs: []Artifact{ - { - Name: "output1", - BuildOutput: true, - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "698c4539633943f7889f41605003d7fa63833722ebd2b37c7e75df1d3d06941a"}, - Uri: "pkg:nuget/Newtonsoft.Json/13.0.3", - }, - }, - }, - { - Name: "output2", - BuildOutput: true, - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "7e406d83706c7193df3e38b66d350e55df6f13d2a28a1d35917a043533a70f5c"}, - Uri: "pkg:pypi/pandas/2.0.1", - }, - }, - }, - }, - }, - expected: Artifacts{ - Inputs: []Artifact{ - { - Name: "input1", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - Uri: "pkg:maven/org.apache.commons/commons-lang3/3.12.0", - }, - { - Digest: map[Algorithm]string{"sha256": "97c13e1812b666824266111701398e56e30d14418a2d9b35987f516a66e2129f"}, - Uri: "pkg:nuget/Microsoft.Extensions.Logging/7.0.0", - }, - }, - }, - { - Name: "input2", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "d596377f2d54b3f8b4619f137d08892989893b886742759144582c94157526f1"}, - Uri: "pkg:pypi/requests/2.28.2", - }, - }, - }, - { - Name: "input3", - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "13c2b709e3a100726680e53e19666656a89a2f2490e917ba15d6b15475ab7b79"}, - Uri: "pkg:debian/openssl/1.1.1", - }, - }, - }, - }, - Outputs: []Artifact{ - { - Name: "output1", - BuildOutput: true, - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "47de7a85905970a45132f48a9247879a15c483477e23a637504694e611135b40e"}, - Uri: "pkg:npm/lodash/4.17.21", - }, - { - Digest: map[Algorithm]string{"sha256": "698c4539633943f7889f41605003d7fa63833722ebd2b37c7e75df1d3d06941a"}, - Uri: "pkg:nuget/Newtonsoft.Json/13.0.3", - }, - }, - }, - { - Name: "output2", - BuildOutput: true, - Values: []ArtifactValue{ - { - Digest: map[Algorithm]string{"sha256": "7e406d83706c7193df3e38b66d350e55df6f13d2a28a1d35917a043533a70f5c"}, - Uri: "pkg:pypi/pandas/2.0.1", - }, - }, - }, - }, - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - tc.a1.Merge(&tc.a2) - got := tc.a1 - if d := cmp.Diff(tc.expected, got, cmpopts.SortSlices(func(a, b Artifact) bool { return a.Name > b.Name })); d != "" { - t.Errorf("TestArtifactsMerge() did not produce expected artifacts for test %s: %s", tc.name, diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1/container_types.go b/upstream/pkg/apis/pipeline/v1/container_types.go index 2dc4a8984f9..9f0c48ae9af 100644 --- a/upstream/pkg/apis/pipeline/v1/container_types.go +++ b/upstream/pkg/apis/pipeline/v1/container_types.go @@ -152,10 +152,6 @@ type Step struct { // +optional // +listType=atomic Results []StepResult `json:"results,omitempty"` - - // When is a list of when expressions that need to be true for the task to run - // +optional - When StepWhenExpressions `json:"when,omitempty"` } // Ref can be used to refer to a specific instance of a StepAction. @@ -543,43 +539,10 @@ type Sidecar struct { // +optional // +listType=atomic Workspaces []WorkspaceUsage `json:"workspaces,omitempty"` - - // RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an - // initContainer and must have it's policy set to "Always". It is currently - // left optional to help support Kubernetes versions prior to 1.29 when this feature - // was introduced. - // +optional - RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` } // ToK8sContainer converts the Sidecar to a Kubernetes Container struct func (s *Sidecar) ToK8sContainer() *corev1.Container { - if s.RestartPolicy == nil { - return &corev1.Container{ - Name: s.Name, - Image: s.Image, - Command: s.Command, - Args: s.Args, - WorkingDir: s.WorkingDir, - Ports: s.Ports, - EnvFrom: s.EnvFrom, - Env: s.Env, - Resources: s.ComputeResources, - VolumeMounts: s.VolumeMounts, - VolumeDevices: s.VolumeDevices, - LivenessProbe: s.LivenessProbe, - ReadinessProbe: s.ReadinessProbe, - StartupProbe: s.StartupProbe, - Lifecycle: s.Lifecycle, - TerminationMessagePath: s.TerminationMessagePath, - TerminationMessagePolicy: s.TerminationMessagePolicy, - ImagePullPolicy: s.ImagePullPolicy, - SecurityContext: s.SecurityContext, - Stdin: s.Stdin, - StdinOnce: s.StdinOnce, - TTY: s.TTY, - } - } return &corev1.Container{ Name: s.Name, Image: s.Image, @@ -594,7 +557,6 @@ func (s *Sidecar) ToK8sContainer() *corev1.Container { VolumeDevices: s.VolumeDevices, LivenessProbe: s.LivenessProbe, ReadinessProbe: s.ReadinessProbe, - RestartPolicy: s.RestartPolicy, StartupProbe: s.StartupProbe, Lifecycle: s.Lifecycle, TerminationMessagePath: s.TerminationMessagePath, @@ -631,7 +593,6 @@ func (s *Sidecar) SetContainerFields(c corev1.Container) { s.Stdin = c.Stdin s.StdinOnce = c.StdinOnce s.TTY = c.TTY - s.RestartPolicy = c.RestartPolicy } // GetVarSubstitutionExpressions walks all the places a substitution reference can be used diff --git a/upstream/pkg/apis/pipeline/v1/container_types_test.go b/upstream/pkg/apis/pipeline/v1/container_types_test.go index fd7c558eafa..06948f9acaa 100644 --- a/upstream/pkg/apis/pipeline/v1/container_types_test.go +++ b/upstream/pkg/apis/pipeline/v1/container_types_test.go @@ -120,35 +120,3 @@ func TestSidecarGetVarSubstitutionExpressions(t *testing.T) { t.Fatalf("Unexpected result (-want, +got): %s", d) } } - -func TestSidecarRestartPolicyToK8sContainer(t *testing.T) { - always := corev1.ContainerRestartPolicyAlways - s := Sidecar{ - Name: "sidecarName", - RestartPolicy: &always, - } - - expectedContainer := corev1.Container{ - Name: "sidecarName", - RestartPolicy: &always, - } - - c := s.ToK8sContainer() - - if !(c.RestartPolicy == expectedContainer.RestartPolicy) { - t.Fatalf("Unexpected result with RestartPolicy") - } - - s = Sidecar{ - Name: "sidecarName", - } - - expectedContainer = corev1.Container{ - Name: "sidecarName", - } - - c = s.ToK8sContainer() - if !(c.RestartPolicy == expectedContainer.RestartPolicy) { - t.Fatalf("Unexpected result without RestartPolicy") - } -} diff --git a/upstream/pkg/apis/pipeline/v1/container_validation.go b/upstream/pkg/apis/pipeline/v1/container_validation.go index ec55189bc32..bfee6884b0b 100644 --- a/upstream/pkg/apis/pipeline/v1/container_validation.go +++ b/upstream/pkg/apis/pipeline/v1/container_validation.go @@ -18,9 +18,6 @@ package v1 import ( "context" - "errors" - "fmt" - "regexp" "strings" "github.com/tektoncd/pipeline/pkg/apis/config" @@ -28,72 +25,38 @@ import ( "knative.dev/pkg/apis" ) -func validateRef(ctx context.Context, refName string, refResolver ResolverName, refParams Params) (errs *apis.FieldError) { +// Validate ensures that a supplied Ref field is populated +// correctly. No errors are returned for a nil Ref. +func (ref *Ref) Validate(ctx context.Context) (errs *apis.FieldError) { + if ref == nil { + return errs + } + switch { - case refResolver != "" || refParams != nil: - if refParams != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) - if refName != "" { - errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) - } - if refResolver == "" { - errs = errs.Also(apis.ErrMissingField("resolver")) - } - errs = errs.Also(ValidateParameters(ctx, refParams)) - } - if refResolver != "" { + case ref.Resolver != "" || ref.Params != nil: + if ref.Resolver != "" { errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) - if refName != "" { - // make sure that the name is url-like. - err := RefNameLikeUrl(refName) - if err == nil && !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - // If name is url-like then concise resolver syntax must be enabled - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(err, "name")) - } + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) } } - case refName != "": - // ref name can be a Url-like format. - if err := RefNameLikeUrl(refName); err == nil { - // If name is url-like then concise resolver syntax must be enabled - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) + if ref.Params != nil { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) } - // In stage1 of concise remote resolvers syntax, this is a required field. - // TODO: remove this check when implementing stage 2 where this is optional. - if refResolver == "" { + if ref.Resolver == "" { errs = errs.Also(apis.ErrMissingField("resolver")) } - // Or, it must be a valid k8s name - } else { - // ref name must be a valid k8s name - if errSlice := validation.IsQualifiedName(refName); len(errSlice) != 0 { - errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) - } + errs = errs.Also(ValidateParameters(ctx, ref.Params)) + } + case ref.Name != "": + // ref name must be a valid k8s name + if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { + errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) } default: errs = errs.Also(apis.ErrMissingField("name")) } return errs } - -// Validate ensures that a supplied Ref field is populated -// correctly. No errors are returned for a nil Ref. -func (ref *Ref) Validate(ctx context.Context) (errs *apis.FieldError) { - if ref == nil { - return errs - } - return validateRef(ctx, ref.Name, ref.Resolver, ref.Params) -} - -// RefNameLikeUrl checks if the name is url parsable and returns an error if it isn't. -func RefNameLikeUrl(name string) error { - schemeRegex := regexp.MustCompile(`[\w-]+:\/\/*`) - if !schemeRegex.MatchString(name) { - return errors.New("invalid URI for request") - } - return nil -} diff --git a/upstream/pkg/apis/pipeline/v1/container_validation_test.go b/upstream/pkg/apis/pipeline/v1/container_validation_test.go index 74fbec19190..60c95f88120 100644 --- a/upstream/pkg/apis/pipeline/v1/container_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/container_validation_test.go @@ -21,22 +21,12 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/test/diff" "knative.dev/pkg/apis" ) -func enableConciseResolverSyntax(ctx context.Context) context.Context { - return config.ToContext(ctx, &config.Config{ - FeatureFlags: &config.FeatureFlags{ - EnableConciseResolverSyntax: true, - EnableAPIFields: config.BetaAPIFields, - }, - }) -} - func TestRef_Valid(t *testing.T) { tests := []struct { name string @@ -47,10 +37,6 @@ func TestRef_Valid(t *testing.T) { }, { name: "simple ref", ref: &v1.Ref{Name: "refname"}, - }, { - name: "ref name - consice syntax", - ref: &v1.Ref{Name: "foo://baz:ver", ResolverRef: v1.ResolverRef{Resolver: "git"}}, - wc: enableConciseResolverSyntax, }, { name: "beta feature: valid resolver", ref: &v1.Ref{ResolverRef: v1.ResolverRef{Resolver: "git"}}, @@ -107,45 +93,29 @@ func TestRef_Invalid(t *testing.T) { }, wantErr: apis.ErrMissingField("resolver"), }, { - name: "ref with resolver and k8s style name", + name: "ref resolver disallowed in conjunction with ref name", ref: &v1.Ref{ Name: "foo", ResolverRef: v1.ResolverRef{ Resolver: "git", }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), }, { - name: "ref with url-like name without resolver", + name: "ref params disallowed in conjunction with ref name", ref: &v1.Ref{ - Name: "https://foo.com/bar", - }, - wantErr: apis.ErrMissingField("resolver"), - wc: enableConciseResolverSyntax, - }, { - name: "ref params disallowed in conjunction with pipelineref name", - ref: &v1.Ref{ - Name: "https://foo/bar", + Name: "bar", ResolverRef: v1.ResolverRef{ - Resolver: "git", - Params: v1.Params{{Name: "foo", Value: v1.ParamValue{StringVal: "bar"}}}, + Params: v1.Params{{ + Name: "foo", + Value: v1.ParamValue{ + Type: v1.ParamTypeString, + StringVal: "bar", + }, + }}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - wc: enableConciseResolverSyntax, - }, { - name: "ref with url-like name without enable-concise-resolver-syntax", - ref: &v1.Ref{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), - }, { - name: "ref without enable-concise-resolver-syntax", - ref: &v1.Ref{Name: "https://foo.com/bar", ResolverRef: v1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }, + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), }, { name: "invalid ref name", ref: &v1.Ref{Name: "_foo"}, diff --git a/upstream/pkg/apis/pipeline/v1/merge.go b/upstream/pkg/apis/pipeline/v1/merge.go index b916d8caeb5..6331edd0765 100644 --- a/upstream/pkg/apis/pipeline/v1/merge.go +++ b/upstream/pkg/apis/pipeline/v1/merge.go @@ -46,11 +46,6 @@ func MergeStepsWithStepTemplate(template *StepTemplate, steps []Step) ([]Step, e } for i, s := range steps { - // If the stepaction has not been fetched yet then do not merge. - // Skip over to the next one - if s.Ref != nil { - continue - } merged := corev1.Container{} err := mergeObjWithTemplateBytes(md, s.ToK8sContainer(), &merged) if err != nil { @@ -74,7 +69,6 @@ func MergeStepsWithStepTemplate(template *StepTemplate, steps []Step) ([]Step, e Results: s.Results, Params: s.Params, Ref: s.Ref, - When: s.When, Workspaces: s.Workspaces, } newStep.SetContainerFields(merged) @@ -92,6 +86,7 @@ func MergeStepsWithSpecs(steps []Step, overrides []TaskRunStepSpec) ([]Step, err stepNameToOverride[o.Name] = o } for i, s := range steps { + s := s o, found := stepNameToOverride[s.Name] if !found { continue @@ -118,6 +113,7 @@ func MergeSidecarsWithSpecs(sidecars []Sidecar, overrides []TaskRunSidecarSpec) sidecarNameToOverride[o.Name] = o } for i, s := range sidecars { + s := s o, found := sidecarNameToOverride[s.Name] if !found { continue diff --git a/upstream/pkg/apis/pipeline/v1/merge_test.go b/upstream/pkg/apis/pipeline/v1/merge_test.go index 07c24e0ab5a..339d4defaa0 100644 --- a/upstream/pkg/apis/pipeline/v1/merge_test.go +++ b/upstream/pkg/apis/pipeline/v1/merge_test.go @@ -26,7 +26,6 @@ import ( "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/selection" ) func TestMergeStepsWithStepTemplate(t *testing.T) { @@ -146,8 +145,7 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { }}, }}, expected: []v1.Step{{ - Command: []string{"/somecmd"}, - Image: "some-image", + Command: []string{"/somecmd"}, Image: "some-image", OnError: "foo", Results: []v1.StepResult{{ Name: "result", @@ -157,30 +155,11 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { }}, }}, }, { - name: "step-ref-should-not-be-merged-with-steptemplate", + name: "ref-should-not-be-removed", template: &v1.StepTemplate{ SecurityContext: &corev1.SecurityContext{ RunAsNonRoot: pointer.Bool(true), }, - VolumeMounts: []corev1.VolumeMount{{ - Name: "data", - MountPath: "/workspace/data", - }}, - Env: []corev1.EnvVar{{ - Name: "KEEP_THIS", - Value: "A_VALUE", - }, { - Name: "SOME_KEY_1", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "A_KEY", - LocalObjectReference: corev1.LocalObjectReference{Name: "A_NAME"}, - }, - }, - }, { - Name: "SOME_KEY_2", - Value: "VALUE_2", - }}, }, steps: []v1.Step{{ Ref: &v1.Ref{Name: "my-step-action"}, @@ -193,6 +172,9 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { }}, }}, expected: []v1.Step{{ + SecurityContext: &corev1.SecurityContext{ + RunAsNonRoot: pointer.Bool(true), + }, Ref: &v1.Ref{Name: "my-step-action"}, OnError: "foo", Results: []v1.StepResult{{ @@ -258,17 +240,6 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { }, }}, }}, - }, { - name: "when", - template: nil, - steps: []v1.Step{{ - Image: "some-image", - When: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo", "bar"}}}, - }}, - expected: []v1.Step{{ - Image: "some-image", - When: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo", "bar"}}}, - }}, }, { name: "isolated workspaces", template: &v1.StepTemplate{ diff --git a/upstream/pkg/apis/pipeline/v1/openapi_generated.go b/upstream/pkg/apis/pipeline/v1/openapi_generated.go index d05c2178e31..f9380013f7d 100644 --- a/upstream/pkg/apis/pipeline/v1/openapi_generated.go +++ b/upstream/pkg/apis/pipeline/v1/openapi_generated.go @@ -162,24 +162,11 @@ func schema_pkg_apis_pipeline_pod_AffinityAssistantTemplate(ref common.Reference }, }, }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext sets the security context for the pod", - Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), - }, - }, - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.Toleration"}, } } @@ -408,14 +395,13 @@ func schema_pkg_apis_pipeline_v1_Artifact(ref common.ReferenceCallback) common.O Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "The artifact's identifying category name", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, "values": { SchemaProps: spec.SchemaProps{ - Description: "A collection of values related to the artifact", + Description: "The artifact's identifying category name", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -427,13 +413,6 @@ func schema_pkg_apis_pipeline_v1_Artifact(ref common.ReferenceCallback) common.O }, }, }, - "buildOutput": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate if the artifact is a build output or a by-product", - Type: []string{"boolean"}, - Format: "", - }, - }, }, }, }, @@ -607,6 +586,7 @@ func schema_pkg_apis_pipeline_v1_EmbeddedTask(ref common.ReferenceCallback) comm "spec": { SchemaProps: spec.SchemaProps{ Description: "Spec is a specification of a custom task", + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -868,7 +848,8 @@ func schema_pkg_apis_pipeline_v1_Param(ref common.ReferenceCallback) common.Open }, "value": { SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"), + Default: map[string]interface{}{}, + Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"), }, }, }, @@ -1168,6 +1149,7 @@ func schema_pkg_apis_pipeline_v1_PipelineResult(ref common.ReferenceCallback) co "value": { SchemaProps: spec.SchemaProps{ Description: "Value the expression used to retrieve the value", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"), }, }, @@ -1293,6 +1275,7 @@ func schema_pkg_apis_pipeline_v1_PipelineRunResult(ref common.ReferenceCallback) "value": { SchemaProps: spec.SchemaProps{ Description: "Value is the result returned from the execution of this PipelineRun", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"), }, }, @@ -2766,13 +2749,6 @@ func schema_pkg_apis_pipeline_v1_Sidecar(ref common.ReferenceCallback) common.Op }, }, }, - "restartPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an initContainer and must have it's policy set to \"Always\". It is currently left optional to help support Kubernetes versions prior to 1.29 when this feature was introduced.", - Type: []string{"string"}, - Format: "", - }, - }, }, Required: []string{"name"}, }, @@ -3150,26 +3126,12 @@ func schema_pkg_apis_pipeline_v1_Step(ref common.ReferenceCallback) common.OpenA }, }, }, - "when": { - SchemaProps: spec.SchemaProps{ - Description: "When is a list of when expressions that need to be true for the task to run", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"), - }, - }, - }, - }, - }, }, Required: []string{"name"}, }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Ref", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepOutputConfig", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceUsage", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Ref", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepOutputConfig", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceUsage", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, } } @@ -3197,7 +3159,7 @@ func schema_pkg_apis_pipeline_v1_StepResult(ref common.ReferenceCallback) common return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "StepResult used to describe the Results of a Step.\n\nThis is field is at an BETA stability level and gated by \"enable-step-actions\" feature flag.", + Description: "StepResult used to describe the Results of a Step.\n\nThis is field is at an ALPHA stability level and gated by \"enable-step-actions\" feature flag.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -3302,11 +3264,6 @@ func schema_pkg_apis_pipeline_v1_StepState(ref common.ReferenceCallback) common. }, }, }, - "provenance": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance"), - }, - }, "terminationReason": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, @@ -3343,7 +3300,7 @@ func schema_pkg_apis_pipeline_v1_StepState(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifact", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifact", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, } } @@ -3574,25 +3531,6 @@ func schema_pkg_apis_pipeline_v1_TaskBreakpoints(ref common.ReferenceCallback) c Format: "", }, }, - "beforeSteps": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, }, }, }, @@ -3915,6 +3853,7 @@ func schema_pkg_apis_pipeline_v1_TaskRunResult(ref common.ReferenceCallback) com "value": { SchemaProps: spec.SchemaProps{ Description: "Value the given value of the result", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"), }, }, @@ -4238,17 +4177,6 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatus(ref common.ReferenceCallback) com }, }, }, - "artifacts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Artifacts are the list of artifacts written out by the task's containers", - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts"), - }, - }, "sidecars": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -4301,7 +4229,7 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatus(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SidecarState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "knative.dev/pkg/apis.Condition"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SidecarState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "knative.dev/pkg/apis.Condition"}, } } @@ -4389,17 +4317,6 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatusFields(ref common.ReferenceCallbac }, }, }, - "artifacts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Artifacts are the list of artifacts written out by the task's containers", - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts"), - }, - }, "sidecars": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -4452,7 +4369,7 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatusFields(ref common.ReferenceCallbac }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SidecarState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SidecarState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepState", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } diff --git a/upstream/pkg/apis/pipeline/v1/param_types_test.go b/upstream/pkg/apis/pipeline/v1/param_types_test.go index 7191439c7e3..ae7d779f437 100644 --- a/upstream/pkg/apis/pipeline/v1/param_types_test.go +++ b/upstream/pkg/apis/pipeline/v1/param_types_test.go @@ -308,6 +308,7 @@ type ParamValuesHolder struct { AOrS v1.ParamValue `json:"val"` } +//nolint:musttag func TestParamValues_UnmarshalJSON(t *testing.T) { cases := []struct { input map[string]interface{} @@ -398,6 +399,7 @@ func TestParamValues_UnmarshalJSON_Directly(t *testing.T) { } } +//nolint:musttag func TestParamValues_UnmarshalJSON_Error(t *testing.T) { cases := []struct { desc string @@ -415,6 +417,7 @@ func TestParamValues_UnmarshalJSON_Error(t *testing.T) { } } +//nolint:musttag func TestParamValues_MarshalJSON(t *testing.T) { cases := []struct { input v1.ParamValue @@ -452,7 +455,7 @@ func TestArrayReference(t *testing.T) { }} for _, tt := range tests { if d := cmp.Diff(tt.expectedResult, v1.ArrayReference(tt.p)); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -499,7 +502,7 @@ func TestExtractNames(t *testing.T) { }} for _, tt := range tests { if d := cmp.Diff(tt.want, v1.Params.ExtractNames(tt.params)); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -562,7 +565,7 @@ func TestParams_ReplaceVariables(t *testing.T) { t.Run(tt.name, func(t *testing.T) { got := tt.ps.ReplaceVariables(tt.stringReplacements, tt.arrayReplacements, tt.objectReplacements) if d := cmp.Diff(tt.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -682,10 +685,10 @@ func TestParseTaskandResultName(t *testing.T) { pipelineTaskName, resultName := tc.param.ParseTaskandResultName() if d := cmp.Diff(tc.pipelineTaskName, pipelineTaskName); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tc.resultName, resultName); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -709,7 +712,7 @@ func TestGetNames(t *testing.T) { t.Run(tc.name, func(t *testing.T) { got := tc.params.GetNames() if d := cmp.Diff(tc.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -770,7 +773,7 @@ func TestSortByType(t *testing.T) { s, a, o := tc.params.SortByType() got := []v1.ParamSpecs{s, a, o} if d := cmp.Diff(tc.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -804,7 +807,7 @@ func TestValidateNoDuplicateNames(t *testing.T) { t.Run(tc.name, func(t *testing.T) { got := tc.params.ValidateNoDuplicateNames() if d := cmp.Diff(tc.expectedError.Error(), got.Error()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } diff --git a/upstream/pkg/apis/pipeline/v1/pipeline_types_test.go b/upstream/pkg/apis/pipeline/v1/pipeline_types_test.go index 7ecfb6ff25e..61771b90f2a 100644 --- a/upstream/pkg/apis/pipeline/v1/pipeline_types_test.go +++ b/upstream/pkg/apis/pipeline/v1/pipeline_types_test.go @@ -86,7 +86,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskContinue, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "valid PipelineTask with onError:stopAndFail", p: PipelineTask{ @@ -94,7 +94,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskStopAndFail, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "invalid OnError value", p: PipelineTask{ @@ -103,7 +103,7 @@ func TestPipelineTask_OnError(t *testing.T) { TaskRef: &TaskRef{Name: "foo"}, }, expectedError: apis.ErrInvalidValue("invalid-val", "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""), - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "OnError:stopAndFail and retries coexist - success", p: PipelineTask{ @@ -112,7 +112,7 @@ func TestPipelineTask_OnError(t *testing.T) { Retries: 1, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "OnError:continue and retries coexists - failure", p: PipelineTask{ @@ -122,6 +122,15 @@ func TestPipelineTask_OnError(t *testing.T) { TaskRef: &TaskRef{Name: "foo"}, }, expectedError: apis.ErrGeneric("PipelineTask OnError cannot be set to \"continue\" when Retries is greater than 0"), + wc: cfgtesting.EnableAlphaAPIFields, + }, { + name: "setting OnError in beta API version - failure", + p: PipelineTask{ + Name: "foo", + OnError: PipelineTaskContinue, + TaskRef: &TaskRef{Name: "foo"}, + }, + expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"beta\""), wc: cfgtesting.EnableBetaAPIFields, }, { name: "setting OnError in stable API version - failure", @@ -130,7 +139,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskContinue, TaskRef: &TaskRef{Name: "foo"}, }, - expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), + expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), wc: cfgtesting.EnableStableAPIFields, }} for _, tt := range tests { @@ -572,7 +581,6 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { name string task PipelineTask expectedError apis.FieldError - configMap map[string]string }{{ name: "pipeline task - invalid taskSpec", task: PipelineTask{ @@ -604,58 +612,15 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { Paths: []string{"taskRef.name"}, }, }, { - name: "pipeline task - taskRef with resolver and k8s style name", + name: "pipeline task - taskRef with resolver and name", task: PipelineTask{ Name: "foo", TaskRef: &TaskRef{Name: "foo", ResolverRef: ResolverRef{Resolver: "git"}}, }, - expectedError: apis.FieldError{ - Message: `invalid value: invalid URI for request`, - Paths: []string{"taskRef.name"}, - }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, - }, { - name: "pipeline task - taskRef with url-like name without enable-concise-resolver-syntax", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar"}, - }, - expectedError: *apis.ErrMissingField("taskRef.resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - Paths: []string{"taskRef"}, - }), - }, { - name: "pipeline task - taskRef without enable-concise-resolver-syntax", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar", ResolverRef: ResolverRef{Resolver: "git"}}, - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - Paths: []string{"taskRef"}, - }, - }, { - name: "pipeline task - taskRef with url-like name without resolver", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar"}, - }, - expectedError: apis.FieldError{ - Message: `missing field(s)`, - Paths: []string{"taskRef.resolver"}, - }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, - }, { - name: "pipeline task - taskRef with name and params", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo/bar", ResolverRef: ResolverRef{Resolver: "git", Params: Params{{Name: "foo", Value: ParamValue{StringVal: "bar"}}}}}, - }, expectedError: apis.FieldError{ Message: `expected exactly one, got both`, - Paths: []string{"taskRef.name", "taskRef.params"}, + Paths: []string{"taskRef.name", "taskRef.resolver"}, }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, }, { name: "pipeline task - taskRef with resolver params but no resolver", task: PipelineTask{ @@ -669,8 +634,7 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ctx := cfgtesting.SetFeatureFlags(context.Background(), t, tt.configMap) - err := tt.task.validateTask(ctx) + err := tt.task.validateTask(context.Background()) if err == nil { t.Error("PipelineTask.validateTask() did not return error for invalid pipeline task") } diff --git a/upstream/pkg/apis/pipeline/v1/pipeline_validation.go b/upstream/pkg/apis/pipeline/v1/pipeline_validation.go index c17293a02b9..35c0509435b 100644 --- a/upstream/pkg/apis/pipeline/v1/pipeline_validation.go +++ b/upstream/pkg/apis/pipeline/v1/pipeline_validation.go @@ -22,7 +22,6 @@ import ( "slices" "strings" - "github.com/tektoncd/pipeline/internal/artifactref" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/validate" "github.com/tektoncd/pipeline/pkg/internal/resultref" @@ -90,7 +89,6 @@ func (ps *PipelineSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateTasksAndFinallySection(ps)) errs = errs.Also(validateFinalTasks(ps.Tasks, ps.Finally)) errs = errs.Also(validateWhenExpressions(ctx, ps.Tasks, ps.Finally)) - errs = errs.Also(validateArtifactReference(ctx, ps.Tasks, ps.Finally)) errs = errs.Also(validateMatrix(ctx, ps.Tasks).ViaField("tasks")) errs = errs.Also(validateMatrix(ctx, ps.Finally).ViaField("finally")) return errs @@ -153,10 +151,10 @@ func (l PipelineTaskList) Validate(ctx context.Context, taskNames sets.String, p } // validateUsageOfDeclaredPipelineTaskParameters validates that all parameters referenced in the pipeline Task are declared by the pipeline Task. -func (l PipelineTaskList) validateUsageOfDeclaredPipelineTaskParameters(ctx context.Context, additionalParams []ParamSpec, path string) (errs *apis.FieldError) { +func (l PipelineTaskList) validateUsageOfDeclaredPipelineTaskParameters(ctx context.Context, path string) (errs *apis.FieldError) { for i, t := range l { if t.TaskSpec != nil { - errs = errs.Also(ValidateUsageOfDeclaredParameters(ctx, t.TaskSpec.Steps, append(t.TaskSpec.Params, additionalParams...)).ViaFieldIndex(path, i)) + errs = errs.Also(ValidateUsageOfDeclaredParameters(ctx, t.TaskSpec.Steps, t.TaskSpec.Params).ViaFieldIndex(path, i)) } } return errs @@ -192,7 +190,7 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) { } if pt.OnError != "" { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.BetaAPIFields)) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.AlphaAPIFields)) if pt.OnError != PipelineTaskContinue && pt.OnError != PipelineTaskStopAndFail { errs = errs.Also(apis.ErrInvalidValue(pt.OnError, "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\"")) } @@ -387,8 +385,8 @@ func validatePipelineWorkspacesDeclarations(wss []PipelineWorkspaceDeclaration) // validatePipelineParameterUsage validates that parameters referenced in the Pipeline are declared by the Pipeline func (ps *PipelineSpec) validatePipelineParameterUsage(ctx context.Context) (errs *apis.FieldError) { - errs = errs.Also(PipelineTaskList(ps.Tasks).validateUsageOfDeclaredPipelineTaskParameters(ctx, ps.Params, "tasks")) - errs = errs.Also(PipelineTaskList(ps.Finally).validateUsageOfDeclaredPipelineTaskParameters(ctx, ps.Params, "finally")) + errs = errs.Also(PipelineTaskList(ps.Tasks).validateUsageOfDeclaredPipelineTaskParameters(ctx, "tasks")) + errs = errs.Also(PipelineTaskList(ps.Finally).validateUsageOfDeclaredPipelineTaskParameters(ctx, "finally")) errs = errs.Also(validatePipelineTaskParameterUsage(ps.Tasks, ps.Params).ViaField("tasks")) errs = errs.Also(validatePipelineTaskParameterUsage(ps.Finally, ps.Params).ViaField("finally")) return errs @@ -513,13 +511,9 @@ func (pt *PipelineTask) GetVarSubstitutionExpressions() []string { return allExpressions } -// containsExecutionStatusRef checks if a specified param has a reference to execution status or reason -// $(tasks..status), $(tasks.status), or $(tasks..reason) func containsExecutionStatusRef(p string) bool { - if strings.HasPrefix(p, "tasks.") { - if strings.HasSuffix(p, ".status") || strings.HasSuffix(p, ".reason") { - return true - } + if strings.HasPrefix(p, "tasks.") && strings.HasSuffix(p, ".status") { + return true } return false } @@ -593,7 +587,7 @@ func containsExecutionStatusReferences(expressions []string) bool { if !LooksLikeContainsResultRefs(expressions) { for _, e := range expressions { // check if it contains context variable accessing execution status - $(tasks.taskname.status) - // or an aggregate status - $(tasks.status) or reason - $(tasks.taskname.reason) + // or an aggregate status - $(tasks.status) if containsExecutionStatusRef(e) { return true } @@ -610,17 +604,10 @@ func validateExecutionStatusVariablesExpressions(expressions []string, ptNames s if expression == PipelineTasksAggregateStatus { continue } - // check if it contains context variable accessing execution status - $(tasks.taskname.status) | $(tasks.taskname.reason) + // check if it contains context variable accessing execution status - $(tasks.taskname.status) if containsExecutionStatusRef(expression) { - var pt string - if strings.HasSuffix(expression, ".status") { - // strip tasks. and .status from tasks.taskname.status to further verify task name - pt = strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".status") - } - if strings.HasSuffix(expression, ".reason") { - // strip tasks. and .reason from tasks.taskname.reason to further verify task name - pt = strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".reason") - } + // strip tasks. and .status from tasks.taskname.status to further verify task name + pt := strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".status") // report an error if the task name does not exist in the list of dag tasks if !ptNames.Has(pt) { errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("pipeline task %s is not defined in the pipeline", pt), fieldPath)) @@ -628,7 +615,6 @@ func validateExecutionStatusVariablesExpressions(expressions []string, ptNames s } } } - return errs } @@ -900,28 +886,6 @@ func validateStringResults(results []TaskResult, resultName string) (errs *apis. return errs } -// validateArtifactReference ensure that the feature flag enableArtifacts is set to true when using artifacts -func validateArtifactReference(ctx context.Context, tasks []PipelineTask, finalTasks []PipelineTask) (errs *apis.FieldError) { - if config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { - return errs - } - for i, t := range tasks { - for _, v := range t.Params.extractValues() { - if len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(v, -1)) > 0 { - return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "").ViaField("params").ViaFieldIndex("tasks", i)) - } - } - } - for i, t := range finalTasks { - for _, v := range t.Params.extractValues() { - if len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(v, -1)) > 0 { - return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "").ViaField("params").ViaFieldIndex("finally", i)) - } - } - } - return errs -} - // GetIndexingReferencesToArrayParams returns all strings referencing indices of PipelineRun array parameters // from parameters, workspaces, and when expressions defined in the Pipeline's Tasks and Finally Tasks. // For example, if a Task in the Pipeline has a parameter with a value "$(params.array-param-name[1])", diff --git a/upstream/pkg/apis/pipeline/v1/pipeline_validation_test.go b/upstream/pkg/apis/pipeline/v1/pipeline_validation_test.go index 2dd9b22d55b..609aba85a1d 100644 --- a/upstream/pkg/apis/pipeline/v1/pipeline_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/pipeline_validation_test.go @@ -58,8 +58,7 @@ func TestPipeline_Validate_Success(t *testing.T) { p: &Pipeline{ ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, Spec: PipelineSpec{ - Tasks: []PipelineTask{{ - Name: "foo", + Tasks: []PipelineTask{{Name: "foo", TaskSpec: &EmbeddedTask{ TypeMeta: runtime.TypeMeta{ APIVersion: "example.dev/v0", @@ -67,8 +66,7 @@ func TestPipeline_Validate_Success(t *testing.T) { }, Spec: runtime.RawExtension{ Raw: []byte(`{"field1":123,"field2":"value"}`), - }, - }, + }}, }}, }, }, @@ -116,65 +114,6 @@ func TestPipeline_Validate_Success(t *testing.T) { }, }, }, - }, { - name: "propagating params into Step", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Type: ParamTypeArray, - Default: &ParamValue{ - Type: ParamTypeArray, - ArrayVal: []string{"hello", "pipeline"}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words[*])"}, - }}, - }}, - }}, - }, - }, - }, { - name: "propagating object params with pipelinespec and taskspec", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Default: &ParamValue{ - Type: ParamTypeObject, - ObjectVal: map[string]string{"hello": "pipeline"}, - }, - Type: ParamTypeObject, - Properties: map[string]PropertySpec{ - "hello": {Type: ParamTypeString}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, - }}, - }}, - }}, - }, - }, }, { name: "param with different type of values without matrix", p: &Pipeline{ @@ -200,7 +139,7 @@ func TestPipeline_Validate_Success(t *testing.T) { Name: "echo", Image: "ubuntu", Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, + Args: []string{"hello"}, }}, }}, Params: Params{ @@ -227,7 +166,7 @@ func TestPipeline_Validate_Success(t *testing.T) { Name: "echo", Image: "ubuntu", Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, + Args: []string{"hello"}, }}, }}, }}, @@ -258,7 +197,7 @@ func TestPipeline_Validate_Success(t *testing.T) { Name: "echo", Image: "ubuntu", Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, + Args: []string{"hello"}, }}, }}, Params: Params{ @@ -285,7 +224,7 @@ func TestPipeline_Validate_Success(t *testing.T) { Name: "echo", Image: "ubuntu", Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, + Args: []string{"hello"}, }}, }}, Matrix: &Matrix{ @@ -298,31 +237,6 @@ func TestPipeline_Validate_Success(t *testing.T) { }}, }, }, - }, { - name: "valid pipeline with pipeline task and final task referencing artifacts in task params with enable-artifacts flag true", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag false", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }, { - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "true", - "enable-api-fields": "alpha"}) - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -512,8 +426,7 @@ func TestPipeline_Validate_Failure(t *testing.T) { return cfgtesting.SetFeatureFlags(ctx, t, map[string]string{ "disable-inline-spec": "pipeline", - "enable-api-fields": "alpha", - }) + "enable-api-fields": "alpha"}) }, }, { name: "pipelineSpec when disable-inline-spec all", @@ -533,8 +446,7 @@ func TestPipeline_Validate_Failure(t *testing.T) { return cfgtesting.SetFeatureFlags(ctx, t, map[string]string{ "disable-inline-spec": "pipeline,taskrun,pipelinerun", - "enable-api-fields": "alpha", - }) + "enable-api-fields": "alpha"}) }, }, { name: "taskSpec when disable-inline-spec", @@ -576,78 +488,6 @@ func TestPipeline_Validate_Failure(t *testing.T) { }, }) }, - }, { - name: "propagating params with pipelinespec and taskspec", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Type: ParamTypeArray, - Default: &ParamValue{ - Type: ParamTypeArray, - ArrayVal: []string{"hello", "pipeline"}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.random-words[*])"}, - }}, - }}, - }}, - }, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.random-words[*])"`, - Paths: []string{"spec.tasks[0].steps[0].args[0]"}, - }, - }, { - name: "propagating params to taskRef", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "hello", - Type: ParamTypeString, - Default: &ParamValue{ - Type: ParamTypeString, - StringVal: "hi", - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskRef: &TaskRef{ - Name: "remote-task", - }, - Params: Params{{ - Name: "param1", - Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(params.param1)", - }, - }, { - Name: "holla", - Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(params.hello)", - }, - }}, - }}, - }, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.param1)"`, - Paths: []string{"spec.tasks[0].params[param1]"}, - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1306,59 +1146,6 @@ func TestPipelineSpec_Validate_Failure(t *testing.T) { Message: `missing field(s)`, Paths: []string{"tasks[1].when[0]", "finally[0].when[0]"}, }, - }, { - name: "invalid pipeline with one pipeline task referencing artifacts in task params with enable-artifacts flag false", - ps: &PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag false", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }, { - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-artifacts should be set to true to use artifacts feature.`, - Paths: []string{"tasks[1].params"}, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "false", - "enable-api-fields": "alpha"}) - }, - }, { - name: "invalid pipeline with one final pipeline task referencing artifacts in params with enable-artifacts flag false", - ps: &PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag false", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }}, - Finally: []PipelineTask{{ - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "false", - "enable-api-fields": "alpha"}) - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-artifacts should be set to true to use artifacts feature.`, - Paths: []string{"finally[0].params"}, - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1578,66 +1365,64 @@ func TestFinallyTaskResultsToPipelineResults_Success(t *testing.T) { name string p *Pipeline wc func(context.Context) context.Context - }{ - { - name: "valid pipeline with pipeline results", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Results: []PipelineResult{{ - Name: "initialized", - Value: *NewStructuredValues("$(tasks.clone-app-repo.results.initialized)"), - }}, - Tasks: []PipelineTask{{ - Name: "clone-app-repo", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "initialized", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo", Image: "bar", - }}, + }{{ + name: "valid pipeline with pipeline results", + p: &Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: PipelineSpec{ + Results: []PipelineResult{{ + Name: "initialized", + Value: *NewStructuredValues("$(tasks.clone-app-repo.results.initialized)"), + }}, + Tasks: []PipelineTask{{ + Name: "clone-app-repo", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "initialized", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo", Image: "bar", }}, }}, - }, + }}, }, - }, { - name: "referencing existent finally task result", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Results: []PipelineResult{{ - Name: "initialized", - Value: *NewStructuredValues("$(finally.check-git-commit.results.init)"), - }}, - Tasks: []PipelineTask{{ - Name: "clone-app-repo", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "current-date-unix-timestamp", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo", Image: "bar", - }}, + }}, { + name: "referencing existent finally task result", + p: &Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: PipelineSpec{ + Results: []PipelineResult{{ + Name: "initialized", + Value: *NewStructuredValues("$(finally.check-git-commit.results.init)"), + }}, + Tasks: []PipelineTask{{ + Name: "clone-app-repo", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "current-date-unix-timestamp", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo", Image: "bar", }}, }}, - Finally: []PipelineTask{{ - Name: "check-git-commit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "init", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo2", Image: "bar", - }}, + }}, + Finally: []PipelineTask{{ + Name: "check-git-commit", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "init", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo2", Image: "bar", }}, }}, - }, + }}, }, }, + }, } for _, tt := range tests { @@ -1881,8 +1666,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.baz)", "and", "$(params.foo-is-baz)"}}, - }}, - }, + }}}, }}, }, { name: "valid star array parameter variables in matrix", @@ -1897,8 +1681,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.baz[*])", "and", "$(params.foo-is-baz[*])"}}, - }}, - }, + }}}, }}, }, { name: "array param - using the whole variable as a param's value that is intended to be array type", @@ -1924,13 +1707,9 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Include: IncludeParamsList{{ Name: "build-1", - Params: Params{ - { - Name: "a-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.baz)"}, - }, - }, - }}, - }, + Params: Params{{ + Name: "a-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.baz)"}}, + }}}}, }}, }, { name: "object param - using single individual variable in string param", @@ -2022,8 +1801,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.key1)", "and", "$(params.myObject.key2)"}}, - }}, - }, + }}}, }}, }, { name: "object param - using the whole variable as a param's value that is intended to be object type", @@ -2205,8 +1983,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2223,8 +2000,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.foo)", "and", "$(params.does-not-exist)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2242,9 +2018,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.foo)"}}, }, { - Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}, - }}, - }, + Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}}}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2265,8 +2039,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { }, { Name: "b-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.does-not-exist)"}, }}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2405,8 +2178,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.key1)"}}, }, { Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.non-exist-key)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.myObject.non-exist-key)"`, @@ -3547,7 +3319,6 @@ func TestValidateFinalTasks_Failure(t *testing.T) { }) } } - func TestContextValid(t *testing.T) { tests := []struct { name string @@ -3563,8 +3334,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun name", @@ -3577,8 +3347,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun namespace", @@ -3591,8 +3360,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.namespace)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun uid", @@ -3605,8 +3373,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.uid)"}}, - }}, - }, + }}}, }}, }, { name: "valid array context variables for Pipeline and PipelineRun names", @@ -3619,8 +3386,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.name)", "and", "$(context.pipelineRun.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineTask retries", @@ -3633,8 +3399,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{StringVal: "$(context.pipelineTask.retries)"}, - }}, - }, + }}}, }}, }, { name: "valid array context variable for PipelineTask retries", @@ -3647,8 +3412,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineTask.retries)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for Pipeline name in include params", @@ -3662,10 +3426,8 @@ func TestContextValid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.name)"}, - }}, - }}, - }, + Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.name)"}}}, + }}}, }}, }, { name: "valid string context variable for PipelineTask retries in matrix include", @@ -3679,10 +3441,8 @@ func TestContextValid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.retries)"}, - }}, - }}, - }, + Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.retries)"}}}, + }}}, }}, }} for _, tt := range tests { @@ -3710,8 +3470,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipeline.missing)"`, @@ -3731,8 +3490,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineRun.missing)"`, @@ -3752,8 +3510,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipelineTask.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineTask.missing)"`, @@ -3773,8 +3530,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.missing-foo)", "$(context.pipelineTask.missing-foo)", "$(context.pipelineRun.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric(`non-existent variable in "$(context.pipeline.missing)"`, "value"). Also(apis.ErrGeneric(`non-existent variable in "$(context.pipelineRun.missing)"`, "value")). @@ -3791,10 +3547,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipeline.missing)"`, @@ -3809,10 +3563,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineRun.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineRun.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineRun.missing)"`, @@ -3827,10 +3579,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineTask.missing)"`, @@ -3866,8 +3616,6 @@ func TestPipelineTasksExecutionStatus(t *testing.T) { TaskRef: &TaskRef{Name: "bar-task"}, Params: Params{{ Name: "foo-status", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.foo.status)"}, - }, { - Name: "foo-reason", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.foo.reason)"}, }, { Name: "tasks-status", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.status)"}, }}, @@ -3875,10 +3623,6 @@ func TestPipelineTasksExecutionStatus(t *testing.T) { Input: "$(tasks.foo.status)", Operator: selection.In, Values: []string{"Failure"}, - }, { - Input: "$(tasks.foo.reason)", - Operator: selection.In, - Values: []string{"Failed"}, }, { Input: "$(tasks.status)", Operator: selection.In, @@ -4116,8 +3860,7 @@ func TestMatrixIncompatibleAPIVersions(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, } tests := []struct { name string @@ -4180,8 +3923,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, }}, @@ -4195,8 +3937,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "barfoo", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"bar", "foo"}}, }}, @@ -4209,16 +3950,14 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.foo-task.results.a-result)"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, Matrix: &Matrix{ Params: Params{{ Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.bar-task.results.b-result)"}}, - }}, - }, + }}}, }}, }, { name: "parameters in matrix contain whole array results references", @@ -4228,8 +3967,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.foo-task.results.a-task-results[*])"}}, - }}, - }, + }}}, }}, }, { name: "results from matrixed task consumed in tasks through parameters", @@ -4239,8 +3977,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4256,8 +3993,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }}, finally: PipelineTaskList{{ Name: "b-task", @@ -4274,8 +4010,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4298,8 +4033,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4317,8 +4051,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }}, finally: PipelineTaskList{{ Name: "b-task", @@ -4337,8 +4070,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4367,8 +4099,7 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "echoarrayurl", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ @@ -4390,8 +4121,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4400,8 +4130,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4435,8 +4164,7 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "task-consuming-results", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ @@ -4466,16 +4194,14 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4484,8 +4210,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4518,8 +4243,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4528,24 +4252,21 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, Matrix: &Matrix{ Params: Params{{ Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4554,8 +4275,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.array-result.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.array-result.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4588,8 +4308,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4598,24 +4317,21 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, Matrix: &Matrix{ Params: Params{{ Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "task-consuming-results", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4624,8 +4340,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, Params: Params{{ Name: "b-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.matrix-emitting-results-embedded.results.report-url[0])"}, @@ -4642,16 +4357,14 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4660,8 +4373,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4767,144 +4479,144 @@ func TestGetIndexingReferencesToArrayParams(t *testing.T) { name string spec PipelineSpec want sets.String - }{ - { - name: "references in task params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeString}, - }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[1])")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("$(params.second-param[0])")}, - {Name: "first-task-third-param", Value: *NewStructuredValues("static value")}, - }, - }}, + }{{ + name: "references in task params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeString}, }, - want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), - }, { - name: "references in when expression", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeString}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[1])")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("$(params.second-param[0])")}, + {Name: "first-task-third-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - When: []WhenExpression{{ - Input: "$(params.first-param[1])", - Operator: selection.In, - Values: []string{"$(params.second-param[0])"}, - }}, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), + }, { + name: "references in when expression", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeString}, }, - want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), - }, { - name: "nested references in task params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(input.workspace.$(params.first-param[0]))")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("$(input.workspace.$(params.second-param[1]))")}, - }, + Tasks: []PipelineTask{{ + When: []WhenExpression{{ + Input: "$(params.first-param[1])", + Operator: selection.In, + Values: []string{"$(params.second-param[0])"}, }}, + }}, + }, + want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), + }, { + name: "nested references in task params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "array parameter", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default", "array", "value")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(input.workspace.$(params.first-param[0]))")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("$(input.workspace.$(params.second-param[1]))")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("firstelement", "$(params.first-param)")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("firstelement", "$(params.second-param[0])")}, - }, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "array parameter", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default", "array", "value")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.second-param[0])"), - }, { - name: "references in finally params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("firstelement", "$(params.first-param)")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("firstelement", "$(params.second-param[0])")}, }, - Finally: []PipelineTask{{ - Params: Params{ - {Name: "final-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, - {Name: "final-task-second-param", Value: *NewStructuredValues("$(params.second-param[1])")}, - }, - }}, + }}, + }, + want: sets.NewString("$(params.second-param[0])"), + }, { + name: "references in finally params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "references in finally when expressions", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Finally: []PipelineTask{{ + Params: Params{ + {Name: "final-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, + {Name: "final-task-second-param", Value: *NewStructuredValues("$(params.second-param[1])")}, }, - Finally: []PipelineTask{{ - When: WhenExpressions{{ - Input: "$(params.first-param[0])", - Operator: selection.In, - Values: []string{"$(params.second-param[1])"}, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "references in finally when expressions", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, + }, + Finally: []PipelineTask{{ + When: WhenExpressions{{ + Input: "$(params.first-param[0])", + Operator: selection.In, + Values: []string{"$(params.second-param[1])"}, }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "parameter references with bracket notation and special characters", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second/param", Type: ParamTypeArray}, + {Name: "third.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "fourth/param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "parameter references with bracket notation and special characters", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second/param", Type: ParamTypeArray}, - {Name: "third.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "fourth/param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, + {Name: "first-task-second-param", Value: *NewStructuredValues(`$(params["second.param"][0])`)}, + {Name: "first-task-third-param", Value: *NewStructuredValues(`$(params['third.param'][1])`)}, + {Name: "first-task-fourth-param", Value: *NewStructuredValues(`$(params['fourth/param'][1])`)}, + {Name: "first-task-fifth-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, - {Name: "first-task-second-param", Value: *NewStructuredValues(`$(params["second.param"][0])`)}, - {Name: "first-task-third-param", Value: *NewStructuredValues(`$(params['third.param'][1])`)}, - {Name: "first-task-fourth-param", Value: *NewStructuredValues(`$(params['fourth/param'][1])`)}, - {Name: "first-task-fifth-param", Value: *NewStructuredValues("static value")}, - }, - }}, + }}, + }, + want: sets.NewString(`$(params["first.param"][0])`, `$(params["second.param"][0])`, `$(params['third.param'][1])`, `$(params['fourth/param'][1])`), + }, { + name: "single parameter in workspace subpath", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString(`$(params["first.param"][0])`, `$(params["second.param"][0])`, `$(params['third.param'][1])`, `$(params['fourth/param'][1])`), - }, { - name: "single parameter in workspace subpath", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("static value")}, - }, - Workspaces: []WorkspacePipelineTaskBinding{ - { - Name: "first-workspace", - Workspace: "first-workspace", - SubPath: "$(params.second-param[1])", - }, + Workspaces: []WorkspacePipelineTaskBinding{ + { + Name: "first-workspace", + Workspace: "first-workspace", + SubPath: "$(params.second-param[1])", }, - }}, - }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, + }}, }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() got := tt.spec.GetIndexingReferencesToArrayParams() diff --git a/upstream/pkg/apis/pipeline/v1/pipelineref_validation.go b/upstream/pkg/apis/pipeline/v1/pipelineref_validation.go index c23db32a50a..9fa7c9894d0 100644 --- a/upstream/pkg/apis/pipeline/v1/pipelineref_validation.go +++ b/upstream/pkg/apis/pipeline/v1/pipelineref_validation.go @@ -19,6 +19,7 @@ package v1 import ( "context" + "github.com/tektoncd/pipeline/pkg/apis/config" "knative.dev/pkg/apis" ) @@ -26,7 +27,28 @@ import ( // correctly. No errors are returned for a nil PipelineRef. func (ref *PipelineRef) Validate(ctx context.Context) (errs *apis.FieldError) { if ref == nil { - return errs + return } - return validateRef(ctx, ref.Name, ref.Resolver, ref.Params) + + if ref.Resolver != "" || ref.Params != nil { + if ref.Resolver != "" { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) + } + } + if ref.Params != nil { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) + } + if ref.Resolver == "" { + errs = errs.Also(apis.ErrMissingField("resolver")) + } + errs = errs.Also(ValidateParameters(ctx, ref.Params)) + } + } else if ref.Name == "" { + errs = errs.Also(apis.ErrMissingField("name")) + } + return } diff --git a/upstream/pkg/apis/pipeline/v1/pipelineref_validation_test.go b/upstream/pkg/apis/pipeline/v1/pipelineref_validation_test.go index 06bceb31fc9..114eb6a0f10 100644 --- a/upstream/pkg/apis/pipeline/v1/pipelineref_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/pipelineref_validation_test.go @@ -37,13 +37,6 @@ func TestPipelineRef_Invalid(t *testing.T) { name: "pipelineRef without Pipeline Name", ref: &v1.PipelineRef{}, wantErr: apis.ErrMissingField("name"), - }, { - name: "invalid pipelineref name", - ref: &v1.PipelineRef{Name: "_foo"}, - wantErr: &apis.FieldError{ - Message: `invalid value: name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')`, - Paths: []string{"name"}, - }, }, { name: "pipelineref resolver disallowed without beta feature gate", ref: &v1.PipelineRef{ @@ -72,45 +65,31 @@ func TestPipelineRef_Invalid(t *testing.T) { wantErr: apis.ErrMissingField("resolver"), withContext: cfgtesting.EnableBetaAPIFields, }, { - name: "pipelineRef with resolver and k8s style name", + name: "pipelineref resolver disallowed in conjunction with pipelineref name", ref: &v1.PipelineRef{ Name: "foo", ResolverRef: v1.ResolverRef{ - Resolver: "git", + Resolver: "bar", }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - withContext: enableConciseResolverSyntax, - }, { - name: "pipelineRef with url-like name without resolver", - ref: &v1.PipelineRef{ - Name: "https://foo.com/bar", - }, - wantErr: apis.ErrMissingField("resolver"), - withContext: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), + withContext: cfgtesting.EnableBetaAPIFields, }, { - name: "pipelineRef params disallowed in conjunction with pipelineref name", + name: "pipelineref params disallowed in conjunction with pipelineref name", ref: &v1.PipelineRef{ - Name: "https://foo/bar", + Name: "bar", ResolverRef: v1.ResolverRef{ - Resolver: "git", - Params: v1.Params{{Name: "foo", Value: v1.ParamValue{StringVal: "bar"}}}, + Params: v1.Params{{ + Name: "foo", + Value: v1.ParamValue{ + Type: v1.ParamTypeString, + StringVal: "bar", + }, + }}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - withContext: enableConciseResolverSyntax, - }, { - name: "pipelineRef with url-like name without enable-concise-resolver-syntax", - ref: &v1.PipelineRef{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), - }, { - name: "pipelineRef without enable-concise-resolver-syntax", - ref: &v1.PipelineRef{Name: "https://foo.com/bar", ResolverRef: v1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }, + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), + withContext: cfgtesting.EnableBetaAPIFields, }} for _, tc := range tests { diff --git a/upstream/pkg/apis/pipeline/v1/pipelinerun_validation.go b/upstream/pkg/apis/pipeline/v1/pipelinerun_validation.go index 16330aa2153..d45b00ab8e3 100644 --- a/upstream/pkg/apis/pipeline/v1/pipelinerun_validation.go +++ b/upstream/pkg/apis/pipeline/v1/pipelinerun_validation.go @@ -27,7 +27,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/validate" "github.com/tektoncd/pipeline/pkg/internal/resultref" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" "knative.dev/pkg/webhook/resourcesemantics" @@ -56,9 +55,6 @@ func (pr *PipelineRun) Validate(ctx context.Context) *apis.FieldError { // Validate pipelinerun spec func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { - // Validate the spec changes - errs = errs.Also(ps.ValidateUpdate(ctx)) - // Must have exactly one of pipelineRef and pipelineSpec. if ps.PipelineRef == nil && ps.PipelineSpec == nil { errs = errs.Also(apis.ErrMissingOneOf("pipelineRef", "pipelineSpec")) @@ -128,31 +124,6 @@ func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) return errs } -// ValidateUpdate validates the update of a PipelineRunSpec -func (ps *PipelineRunSpec) ValidateUpdate(ctx context.Context) (errs *apis.FieldError) { - if !apis.IsInUpdate(ctx) { - return - } - oldObj, ok := apis.GetBaseline(ctx).(*PipelineRun) - if !ok || oldObj == nil { - return - } - old := &oldObj.Spec - - // If already in the done state, the spec cannot be modified. Otherwise, only the status field can be modified. - tips := "Once the PipelineRun is complete, no updates are allowed" - if !oldObj.IsDone() { - old = old.DeepCopy() - old.Status = ps.Status - tips = "Once the PipelineRun has started, only status updates are allowed" - } - if !equality.Semantic.DeepEqual(old, ps) { - errs = errs.Also(apis.ErrInvalidValue(tips, "")) - } - - return -} - func (ps *PipelineRunSpec) validatePipelineRunParameters(ctx context.Context) (errs *apis.FieldError) { if len(ps.Params) == 0 { return errs @@ -315,11 +286,11 @@ func (ps *PipelineRunSpec) validatePipelineTimeout(timeout time.Duration, errorM func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *apis.FieldError) { if trs.StepSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.BetaAPIFields).ViaField("stepSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.AlphaAPIFields).ViaField("stepSpecs")) errs = errs.Also(validateStepSpecs(trs.StepSpecs).ViaField("stepSpecs")) } if trs.SidecarSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.BetaAPIFields).ViaField("sidecarSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.AlphaAPIFields).ViaField("sidecarSpecs")) errs = errs.Also(validateSidecarSpecs(trs.SidecarSpecs).ViaField("sidecarSpecs")) } if trs.ComputeResources != nil { diff --git a/upstream/pkg/apis/pipeline/v1/pipelinerun_validation_test.go b/upstream/pkg/apis/pipeline/v1/pipelinerun_validation_test.go index 42a38ed7c3f..8e7f24a0e87 100644 --- a/upstream/pkg/apis/pipeline/v1/pipelinerun_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/pipelinerun_validation_test.go @@ -22,7 +22,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" @@ -32,7 +31,6 @@ import ( corev1resources "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" ) func TestPipelineRun_Invalid(t *testing.T) { @@ -972,7 +970,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].stepSpecs[1].name"), withContext: cfgtesting.EnableAlphaAPIFields, }, { - name: "stepSpecs disallowed without beta feature gate", + name: "stepSpecs disallowed without alpha feature gate", spec: v1.PipelineRunSpec{ PipelineRef: &v1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1.PipelineTaskRunSpec{ @@ -988,9 +986,9 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { - name: "sidecarSpec disallowed without beta feature gate", + name: "sidecarSpec disallowed without alpha feature gate", spec: v1.PipelineRunSpec{ PipelineRef: &v1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1.PipelineTaskRunSpec{ @@ -1006,7 +1004,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { name: "missing stepSpecs name", spec: v1.PipelineRunSpec{ @@ -1079,7 +1077,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { "taskRunSpecs[0].stepSpecs.resources", "taskRunSpecs[0].computeResources", ), - withContext: cfgtesting.EnableBetaAPIFields, + withContext: cfgtesting.EnableAlphaAPIFields, }, { name: "computeResources disallowed without beta feature gate", spec: v1.PipelineRunSpec{ @@ -1142,7 +1140,7 @@ func TestPipelineRunSpec_Validate(t *testing.T) { }, }}, }, - withContext: cfgtesting.EnableBetaAPIFields, + withContext: cfgtesting.EnableAlphaAPIFields, }, { name: "valid sidecar and task-level (taskRunSpecs.resources) resource requirements configured", spec: v1.PipelineRunSpec{ @@ -1165,7 +1163,7 @@ func TestPipelineRunSpec_Validate(t *testing.T) { }}, }}, }, - withContext: cfgtesting.EnableBetaAPIFields, + withContext: cfgtesting.EnableAlphaAPIFields, }} for _, ps := range tests { @@ -1513,180 +1511,3 @@ func TestPipelineRunSpecBetaFeatures(t *testing.T) { }) } } - -func TestPipelineRunSpec_ValidateUpdate(t *testing.T) { - tests := []struct { - name string - isCreate bool - isUpdate bool - baselinePipelineRun *v1.PipelineRun - pipelineRun *v1.PipelineRun - expectedError apis.FieldError - }{ - { - name: "is create ctx", - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{}, - }, - isCreate: true, - isUpdate: false, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, no changes", - baselinePipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "", - }, - }, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is nil, skip validation", - baselinePipelineRun: nil, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Timeouts: &v1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, status changes from Empty to Cancelled", - baselinePipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "", - }, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "Cancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, timeouts changes", - baselinePipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "", - Timeouts: &v1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 0}, - }, - }, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Timeouts: &v1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun has started, only status updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is unknown, status changes from PipelineRunPending to Empty, and timeouts changes", - baselinePipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "PipelineRunPending", - Timeouts: &v1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 0}, - }, - }, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "", - Timeouts: &v1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun has started, only status updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is done, status changes", - baselinePipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "PipelineRunPending", - }, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionTrue}, - }, - }, - }, - }, - pipelineRun: &v1.PipelineRun{ - Spec: v1.PipelineRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun is complete, no updates are allowed`, - Paths: []string{""}, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{}, - Defaults: &config.Defaults{}, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselinePipelineRun) - } - pr := tt.pipelineRun - err := pr.Spec.ValidateUpdate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("PipelineRunSpec.ValidateUpdate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1/result_types.go b/upstream/pkg/apis/pipeline/v1/result_types.go index b36bf6fc658..6361d7a362d 100644 --- a/upstream/pkg/apis/pipeline/v1/result_types.go +++ b/upstream/pkg/apis/pipeline/v1/result_types.go @@ -40,7 +40,7 @@ type TaskResult struct { // StepResult used to describe the Results of a Step. // -// This is field is at an BETA stability level and gated by "enable-step-actions" feature flag. +// This is field is at an ALPHA stability level and gated by "enable-step-actions" feature flag. type StepResult struct { // Name the given name Name string `json:"name"` diff --git a/upstream/pkg/apis/pipeline/v1/result_validation_test.go b/upstream/pkg/apis/pipeline/v1/result_validation_test.go index e927230f037..ed71596b90b 100644 --- a/upstream/pkg/apis/pipeline/v1/result_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/result_validation_test.go @@ -297,10 +297,10 @@ func TestExtractStepResultName(t *testing.T) { t.Errorf("Did not expect an error but got: %v", err) } if d := cmp.Diff(tt.wantStep, gotStep); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tt.wantResult, gotResult); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -320,7 +320,7 @@ func TestExtractStepResultNameError(t *testing.T) { t.Run(tt.name, func(t *testing.T) { gotStep, gotResult, err := v1.ExtractStepResultName(tt.value) if d := cmp.Diff(tt.wantErr.Error(), err.Error()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if gotStep != "" { t.Errorf("Expected an empty string but got: %v", gotStep) diff --git a/upstream/pkg/apis/pipeline/v1/resultref_test.go b/upstream/pkg/apis/pipeline/v1/resultref_test.go index 914f4bff5a1..a5790b290fb 100644 --- a/upstream/pkg/apis/pipeline/v1/resultref_test.go +++ b/upstream/pkg/apis/pipeline/v1/resultref_test.go @@ -761,7 +761,7 @@ func TestHasResultReferenceWhenExpression(t *testing.T) { } got := v1.NewResultRefs(expressions) if d := cmp.Diff(tt.wantRef, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -870,8 +870,7 @@ func TestPipelineTaskResultRefs(t *testing.T) { Value: *v1.NewStructuredValues("$(tasks.pt5.results.r5)", "$(tasks.pt6.results.r6)"), }, { Value: *v1.NewStructuredValues("$(tasks.pt7.results.r7)", "$(tasks.pt8.results.r8)"), - }}, - }, + }}}, TaskSpec: &v1.EmbeddedTask{ TaskSpec: v1.TaskSpec{ Steps: []v1.Step{ @@ -951,12 +950,11 @@ func TestParseResultName(t *testing.T) { name string input string want []string - }{ - { - name: "array indexing", - input: "anArrayResult[1]", - want: []string{"anArrayResult", "1"}, - }, + }{{ + name: "array indexing", + input: "anArrayResult[1]", + want: []string{"anArrayResult", "1"}, + }, { name: "array star reference", input: "anArrayResult[*]", @@ -978,38 +976,37 @@ func TestGetVarSubstitutionExpressionsForPipelineResult(t *testing.T) { name string result v1.PipelineResult want []string - }{ - { - name: "get string result expressions", - result: v1.PipelineResult{ - Name: "string result", - Type: v1.ResultsTypeString, - Value: *v1.NewStructuredValues("$(tasks.task1.results.result1) and $(tasks.task2.results.result2)"), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, - }, { - name: "get array result expressions", - result: v1.PipelineResult{ - Name: "array result", - Type: v1.ResultsTypeString, - Value: *v1.NewStructuredValues("$(tasks.task1.results.result1)", "$(tasks.task2.results.result2)"), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, - }, { - name: "get object result expressions", - result: v1.PipelineResult{ - Name: "object result", - Type: v1.ResultsTypeString, - Value: *v1.NewObject(map[string]string{ - "key1": "$(tasks.task1.results.result1)", - "key2": "$(tasks.task2.results.result2) and another one $(tasks.task3.results.result3)", - "key3": "no ref here", - }), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2", "tasks.task3.results.result3"}, + }{{ + name: "get string result expressions", + result: v1.PipelineResult{ + Name: "string result", + Type: v1.ResultsTypeString, + Value: *v1.NewStructuredValues("$(tasks.task1.results.result1) and $(tasks.task2.results.result2)"), + }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, + }, { + name: "get array result expressions", + result: v1.PipelineResult{ + Name: "array result", + Type: v1.ResultsTypeString, + Value: *v1.NewStructuredValues("$(tasks.task1.results.result1)", "$(tasks.task2.results.result2)"), + }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, + }, { + name: "get object result expressions", + result: v1.PipelineResult{ + Name: "object result", + Type: v1.ResultsTypeString, + Value: *v1.NewObject(map[string]string{ + "key1": "$(tasks.task1.results.result1)", + "key2": "$(tasks.task2.results.result2) and another one $(tasks.task3.results.result3)", + "key3": "no ref here", + }), }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2", "tasks.task3.results.result3"}, + }, } - sortStrings := func(x, y string) bool { + var sortStrings = func(x, y string) bool { return x < y } for _, tt := range tests { diff --git a/upstream/pkg/apis/pipeline/v1/swagger.json b/upstream/pkg/apis/pipeline/v1/swagger.json index 73544e75d84..8993af2ffff 100644 --- a/upstream/pkg/apis/pipeline/v1/swagger.json +++ b/upstream/pkg/apis/pipeline/v1/swagger.json @@ -28,14 +28,6 @@ "default": "" } }, - "priorityClassName": { - "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - "type": "string" - }, - "securityContext": { - "description": "SecurityContext sets the security context for the pod", - "$ref": "#/definitions/v1.PodSecurityContext" - }, "tolerations": { "description": "If specified, the pod's tolerations.", "type": "array", @@ -163,16 +155,11 @@ "description": "TaskRunStepArtifact represents an artifact produced or used by a step within a task run. It directly uses the Artifact type for its structure.", "type": "object", "properties": { - "buildOutput": { - "description": "Indicate if the artifact is a build output or a by-product", - "type": "boolean" - }, "name": { - "description": "The artifact's identifying category name", "type": "string" }, "values": { - "description": "A collection of values related to the artifact", + "description": "The artifact's identifying category name", "type": "array", "items": { "default": {}, @@ -302,6 +289,7 @@ }, "spec": { "description": "Spec is a specification of a custom task", + "default": {}, "$ref": "#/definitions/k8s.io.apimachinery.pkg.runtime.RawExtension" }, "stepTemplate": { @@ -393,6 +381,7 @@ "default": "" }, "value": { + "default": {}, "$ref": "#/definitions/v1.ParamValue" } } @@ -564,6 +553,7 @@ }, "value": { "description": "Value the expression used to retrieve the value", + "default": {}, "$ref": "#/definitions/v1.ParamValue" } } @@ -634,6 +624,7 @@ }, "value": { "description": "Value is the result returned from the execution of this PipelineRun", + "default": {}, "$ref": "#/definitions/v1.ParamValue" } } @@ -1338,10 +1329,6 @@ "description": "Periodic probe of Sidecar service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "$ref": "#/definitions/v1.Probe" }, - "restartPolicy": { - "description": "RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an initContainer and must have it's policy set to \"Always\". It is currently left optional to help support Kubernetes versions prior to 1.29 when this feature was introduced.", - "type": "string" - }, "script": { "description": "Script is the contents of an executable file to execute.\n\nIf Script is not empty, the Step cannot have an Command or Args.", "type": "string" @@ -1598,14 +1585,6 @@ "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, - "when": { - "description": "When is a list of when expressions that need to be true for the task to run", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1.WhenExpression" - } - }, "workingDir": { "description": "Step's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" @@ -1632,7 +1611,7 @@ } }, "v1.StepResult": { - "description": "StepResult used to describe the Results of a Step.\n\nThis is field is at an BETA stability level and gated by \"enable-step-actions\" feature flag.", + "description": "StepResult used to describe the Results of a Step.\n\nThis is field is at an ALPHA stability level and gated by \"enable-step-actions\" feature flag.", "type": "object", "required": [ "name" @@ -1688,9 +1667,6 @@ "$ref": "#/definitions/v1.Artifact" } }, - "provenance": { - "$ref": "#/definitions/v1.Provenance" - }, "results": { "type": "array", "items": { @@ -1829,14 +1805,6 @@ "description": "TaskBreakpoints defines the breakpoint config for a particular Task", "type": "object", "properties": { - "beforeSteps": { - "type": "array", - "items": { - "type": "string", - "default": "" - }, - "x-kubernetes-list-type": "atomic" - }, "onFailure": { "description": "if enabled, pause TaskRun on failure of a step failed step will not exit", "type": "string" @@ -2019,6 +1987,7 @@ }, "value": { "description": "Value the given value of the result", + "default": {}, "$ref": "#/definitions/v1.ParamValue" } } @@ -2139,11 +2108,6 @@ "default": "" } }, - "artifacts": { - "description": "Artifacts are the list of artifacts written out by the task's containers", - "$ref": "#/definitions/v1.Artifacts", - "x-kubernetes-list-type": "atomic" - }, "completionTime": { "description": "CompletionTime is the time the build completed.", "$ref": "#/definitions/v1.Time" @@ -2233,11 +2197,6 @@ "podName" ], "properties": { - "artifacts": { - "description": "Artifacts are the list of artifacts written out by the task's containers", - "$ref": "#/definitions/v1.Artifacts", - "x-kubernetes-list-type": "atomic" - }, "completionTime": { "description": "CompletionTime is the time the build completed.", "$ref": "#/definitions/v1.Time" diff --git a/upstream/pkg/apis/pipeline/v1/task_validation.go b/upstream/pkg/apis/pipeline/v1/task_validation.go index 4232d295d2b..95708574409 100644 --- a/upstream/pkg/apis/pipeline/v1/task_validation.go +++ b/upstream/pkg/apis/pipeline/v1/task_validation.go @@ -260,9 +260,6 @@ func validateSteps(ctx context.Context, steps []Step) (errs *apis.FieldError) { errs = errs.Also(ValidateStepResultsVariables(ctx, s.Results, s.Script).ViaIndex(idx)) errs = errs.Also(ValidateStepResults(ctx, s.Results).ViaIndex(idx).ViaField("results")) } - if len(s.When) > 0 { - errs = errs.Also(s.When.validate(ctx).ViaIndex(idx)) - } } return errs } @@ -315,10 +312,7 @@ func errorIfStepResultReferenceinField(value, fieldName string) (errs *apis.Fiel } func stepArtifactReferenceExists(src string) bool { - return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+artifactref.StepArtifactPathPattern+")") -} -func taskArtifactReferenceExists(src string) bool { - return len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+artifactref.TaskArtifactPathPattern+")") + return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$(step.artifacts.path)") } func errorIfStepArtifactReferencedInField(value, fieldName string) (errs *apis.FieldError) { if stepArtifactReferenceExists(value) { @@ -384,8 +378,17 @@ func validateStepResultReference(s Step) (errs *apis.FieldError) { } func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.FieldError) { - if err := validateArtifactsReferencesInStep(ctx, s); err != nil { - return err + if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { + var t []string + t = append(t, s.Script) + t = append(t, s.Command...) + t = append(t, s.Args...) + for _, e := range s.Env { + t = append(t, e.Value) + } + if slices.ContainsFunc(t, stepArtifactReferenceExists) { + return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "")) + } } if s.Ref != nil { @@ -453,11 +456,6 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true in order to use Results in Steps.", config.EnableStepActions), "") } } - if len(s.When) > 0 { - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableStepActions && isCreateOrUpdateAndDiverged(ctx, s) { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true in order to use When in Steps.", config.EnableStepActions), "") - } - } if s.Image == "" { errs = errs.Also(apis.ErrMissingField("Image")) } @@ -540,22 +538,6 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi return errs } -func validateArtifactsReferencesInStep(ctx context.Context, s Step) *apis.FieldError { - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { - var t []string - t = append(t, s.Script) - t = append(t, s.Command...) - t = append(t, s.Args...) - for _, e := range s.Env { - t = append(t, e.Value) - } - if slices.ContainsFunc(t, stepArtifactReferenceExists) || slices.ContainsFunc(t, taskArtifactReferenceExists) { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "") - } - } - return nil -} - // ValidateParameterTypes validates all the types within a slice of ParamSpecs func ValidateParameterTypes(ctx context.Context, params []ParamSpec) (errs *apis.FieldError) { for _, p := range params { diff --git a/upstream/pkg/apis/pipeline/v1/task_validation_test.go b/upstream/pkg/apis/pipeline/v1/task_validation_test.go index 0ea6993648a..8f3c02b221a 100644 --- a/upstream/pkg/apis/pipeline/v1/task_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/task_validation_test.go @@ -29,9 +29,7 @@ import ( "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/utils/pointer" "knative.dev/pkg/apis" ) @@ -335,41 +333,6 @@ func TestTaskSpecValidate(t *testing.T) { hello world`, }}, }, - }, { - name: "step template included in validation with stepaction", - fields: fields{ - Steps: []v1.Step{{ - Name: "astep", - Ref: &v1.Ref{ - Name: "stepAction", - }, - }}, - StepTemplate: &v1.StepTemplate{ - Image: "some-image", - SecurityContext: &corev1.SecurityContext{ - RunAsNonRoot: pointer.Bool(true), - }, - VolumeMounts: []corev1.VolumeMount{{ - Name: "data", - MountPath: "/workspace/data", - }}, - Env: []corev1.EnvVar{{ - Name: "KEEP_THIS", - Value: "A_VALUE", - }, { - Name: "SOME_KEY_1", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "A_KEY", - LocalObjectReference: corev1.LocalObjectReference{Name: "A_NAME"}, - }, - }, - }, { - Name: "SOME_KEY_2", - Value: "VALUE_2", - }}, - }, - }, }, { name: "valid step with parameterized script", fields: fields{ @@ -1787,7 +1750,7 @@ func TestTaskSpecValidateSuccessWithArtifactsRefFlagEnabled(t *testing.T) { name: "reference step artifacts in Env", Steps: []v1.Step{{ Image: "busybox", - Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs.image)"}}, + Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs)"}}, }}, }, { @@ -1869,7 +1832,7 @@ func TestTaskSpecValidateErrorWithArtifactsRefFlagNotEnabled(t *testing.T) { { name: "Cannot reference step artifacts in Env without setting enable-artifacts to true", Steps: []v1.Step{{ - Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs.image)"}}, + Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs)"}}, }}, expectedError: apis.FieldError{ Message: fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), @@ -3128,85 +3091,3 @@ func TestTaskSpecValidate_StepResults_Error(t *testing.T) { }) } } - -func TestTaskSpecValidate_StepWhen_Error(t *testing.T) { - tests := []struct { - name string - ts *v1.TaskSpec - isCreate bool - Results []v1.StepResult - isUpdate bool - baselineTaskRun *v1.TaskRun - expectedError apis.FieldError - EnableStepAction bool - EnableCEL bool - }{ - { - name: "step when not allowed without enable step actions - create event", - ts: &v1.TaskSpec{Steps: []v1.Step{{ - Image: "my-image", - When: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo"}}}, - }}}, - isCreate: true, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true in order to use When in Steps.", - Paths: []string{"steps[0]"}, - }, - }, - { - name: "step when not allowed without enable step actions - update and diverged event", - ts: &v1.TaskSpec{Steps: []v1.Step{{ - Image: "my-image", - When: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo"}}}, - }}}, - isUpdate: true, - baselineTaskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Image: "my-image", - Results: []v1.StepResult{{Name: "a-result"}}, - }}, - }, - }, - }, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true in order to use When in Steps.", - Paths: []string{"steps[0]"}, - }, - }, - { - name: "cel not allowed if EnableCELInWhenExpression is false", - ts: &v1.TaskSpec{Steps: []v1.Step{{ - Image: "my-image", - When: v1.StepWhenExpressions{{CEL: "'d'=='d'"}}, - }}}, - EnableStepAction: true, - expectedError: apis.FieldError{ - Message: `feature flag enable-cel-in-whenexpression should be set to true to use CEL: 'd'=='d' in WhenExpression`, - Paths: []string{"steps[0].when[0]"}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{ - EnableStepActions: tt.EnableStepAction, - EnableCELInWhenExpression: tt.EnableCEL, - }, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselineTaskRun) - } - tt.ts.SetDefaults(ctx) - err := tt.ts.Validate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("StepActionSpec.Validate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1/taskref_validation.go b/upstream/pkg/apis/pipeline/v1/taskref_validation.go index bbc5fbbfc48..4f4e0330350 100644 --- a/upstream/pkg/apis/pipeline/v1/taskref_validation.go +++ b/upstream/pkg/apis/pipeline/v1/taskref_validation.go @@ -18,7 +18,10 @@ package v1 import ( "context" + "strings" + "github.com/tektoncd/pipeline/pkg/apis/config" + "k8s.io/apimachinery/pkg/util/validation" "knative.dev/pkg/apis" ) @@ -28,5 +31,32 @@ func (ref *TaskRef) Validate(ctx context.Context) (errs *apis.FieldError) { if ref == nil { return errs } - return validateRef(ctx, ref.Name, ref.Resolver, ref.Params) + + switch { + case ref.Resolver != "" || ref.Params != nil: + if ref.Resolver != "" { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) + } + } + if ref.Params != nil { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) + } + if ref.Resolver == "" { + errs = errs.Also(apis.ErrMissingField("resolver")) + } + errs = errs.Also(ValidateParameters(ctx, ref.Params)) + } + case ref.Name != "": + // TaskRef name must be a valid k8s name + if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { + errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) + } + default: + errs = errs.Also(apis.ErrMissingField("name")) + } + return errs } diff --git a/upstream/pkg/apis/pipeline/v1/taskref_validation_test.go b/upstream/pkg/apis/pipeline/v1/taskref_validation_test.go index a98827470e5..d2c721bc6a1 100644 --- a/upstream/pkg/apis/pipeline/v1/taskref_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/taskref_validation_test.go @@ -120,45 +120,31 @@ func TestTaskRef_Invalid(t *testing.T) { wantErr: apis.ErrMissingField("resolver"), wc: cfgtesting.EnableBetaAPIFields, }, { - name: "taskRef with resolver and k8s style name", + name: "taskref resolver disallowed in conjunction with taskref name", taskRef: &v1.TaskRef{ Name: "foo", ResolverRef: v1.ResolverRef{ Resolver: "git", }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - wc: enableConciseResolverSyntax, - }, { - name: "taskRef with url-like name without resolver", - taskRef: &v1.TaskRef{ - Name: "https://foo.com/bar", - }, - wantErr: apis.ErrMissingField("resolver"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), + wc: cfgtesting.EnableBetaAPIFields, }, { - name: "taskRef params disallowed in conjunction with pipelineref name", + name: "taskref params disallowed in conjunction with taskref name", taskRef: &v1.TaskRef{ - Name: "https://foo/bar", + Name: "bar", ResolverRef: v1.ResolverRef{ - Resolver: "git", - Params: v1.Params{{Name: "foo", Value: v1.ParamValue{StringVal: "bar"}}}, + Params: v1.Params{{ + Name: "foo", + Value: v1.ParamValue{ + Type: v1.ParamTypeString, + StringVal: "bar", + }, + }}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - wc: enableConciseResolverSyntax, - }, { - name: "taskRef with url-like name without enable-concise-resolver-syntax", - taskRef: &v1.TaskRef{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), - }, { - name: "taskRef without enable-concise-resolver-syntax", - taskRef: &v1.TaskRef{Name: "https://foo.com/bar", ResolverRef: v1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }, + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), + wc: cfgtesting.EnableBetaAPIFields, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { diff --git a/upstream/pkg/apis/pipeline/v1/taskrun_types.go b/upstream/pkg/apis/pipeline/v1/taskrun_types.go index b5305937260..615eaaa788c 100644 --- a/upstream/pkg/apis/pipeline/v1/taskrun_types.go +++ b/upstream/pkg/apis/pipeline/v1/taskrun_types.go @@ -26,7 +26,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/clock" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -122,9 +121,6 @@ type TaskBreakpoints struct { // failed step will not exit // +optional OnFailure string `json:"onFailure,omitempty"` - // +optional - // +listType=atomic - BeforeSteps []string `json:"beforeSteps,omitempty"` } // NeedsDebugOnFailure return true if the TaskRun is configured to debug on failure @@ -135,28 +131,14 @@ func (trd *TaskRunDebug) NeedsDebugOnFailure() bool { return trd.Breakpoints.OnFailure == EnabledOnFailureBreakpoint } -// NeedsDebugBeforeStep return true if the step is configured to debug before execution -func (trd *TaskRunDebug) NeedsDebugBeforeStep(stepName string) bool { - if trd.Breakpoints == nil { - return false - } - beforeStepSets := sets.NewString(trd.Breakpoints.BeforeSteps...) - return beforeStepSets.Has(stepName) -} - // StepNeedsDebug return true if the step is configured to debug func (trd *TaskRunDebug) StepNeedsDebug(stepName string) bool { - return trd.NeedsDebugOnFailure() || trd.NeedsDebugBeforeStep(stepName) + return trd.NeedsDebugOnFailure() } // NeedsDebug return true if defined onfailure or have any before, after steps func (trd *TaskRunDebug) NeedsDebug() bool { - return trd.NeedsDebugOnFailure() || trd.HaveBeforeSteps() -} - -// HaveBeforeSteps return true if have any before steps -func (trd *TaskRunDebug) HaveBeforeSteps() bool { - return trd.Breakpoints != nil && len(trd.Breakpoints.BeforeSteps) > 0 + return trd.NeedsDebugOnFailure() } // TaskRunInputs holds the input values that this task was invoked with. @@ -297,11 +279,6 @@ type TaskRunStatusFields struct { // +listType=atomic Results []TaskRunResult `json:"results,omitempty"` - // Artifacts are the list of artifacts written out by the task's containers - // +optional - // +listType=atomic - Artifacts *Artifacts `json:"artifacts,omitempty"` - // The list has one entry per sidecar in the manifest. Each entry is // represents the imageid of the corresponding sidecar. // +listType=atomic @@ -382,7 +359,6 @@ type StepState struct { Container string `json:"container,omitempty"` ImageID string `json:"imageID,omitempty"` Results []TaskRunStepResult `json:"results,omitempty"` - Provenance *Provenance `json:"provenance,omitempty"` TerminationReason string `json:"terminationReason,omitempty"` Inputs []TaskRunStepArtifact `json:"inputs,omitempty"` Outputs []TaskRunStepArtifact `json:"outputs,omitempty"` diff --git a/upstream/pkg/apis/pipeline/v1/taskrun_types_test.go b/upstream/pkg/apis/pipeline/v1/taskrun_types_test.go index a4b84be3549..63c16ae2a40 100644 --- a/upstream/pkg/apis/pipeline/v1/taskrun_types_test.go +++ b/upstream/pkg/apis/pipeline/v1/taskrun_types_test.go @@ -31,10 +31,8 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" ) -var ( - now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) - testClock = clock.NewFakePassiveClock(now) -) +var now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) +var testClock = clock.NewFakePassiveClock(now) func TestTaskRun_GetPipelineRunPVCName(t *testing.T) { tests := []struct { @@ -369,7 +367,7 @@ func TestHasTimedOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.taskRun.HasTimedOut(context.Background(), testClock) if d := cmp.Diff(tc.expectedStatus, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -409,57 +407,6 @@ func TestInitializeTaskRunConditions(t *testing.T) { } } -func TestIsDebugBeforeStep(t *testing.T) { - type args struct { - stepName string - trd *v1.TaskRunDebug - } - testCases := []struct { - name string - args args - want bool - }{ - { - name: "empty breakpoints", - args: args{ - stepName: "step1", - trd: &v1.TaskRunDebug{}, - }, - want: false, - }, { - name: "breakpoint before step", - args: args{ - stepName: "step1", - trd: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"step1", "step2"}, - }, - }, - }, - want: true, - }, { - name: "step not in before step breakpoint", - args: args{ - stepName: "step3", - trd: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"step1", "step2"}, - }, - }, - }, - want: false, - }, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - result := tc.args.trd.NeedsDebugBeforeStep(tc.args.stepName) - if d := cmp.Diff(result, tc.want); d != "" { - t.Fatal(diff.PrintWantGot(d)) - } - }) - } -} - func TestIsStepNeedDebug(t *testing.T) { type args struct { stepName string @@ -488,24 +435,13 @@ func TestIsStepNeedDebug(t *testing.T) { }, }, want: true, - }, { - name: "breakpoint before step", - args: args{ - stepName: "step1", - trd: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"step1"}, - }, - }, - }, - want: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { result := tc.args.trd.StepNeedsDebug(tc.args.stepName) if d := cmp.Diff(tc.want, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -536,23 +472,13 @@ func TestIsNeedDebug(t *testing.T) { }, }, want: true, - }, { - name: "breakpoint before step", - args: args{ - trd: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"step1"}, - }, - }, - }, - want: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { result := tc.args.trd.NeedsDebug() if d := cmp.Diff(tc.want, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -585,7 +511,7 @@ func TestTaskRunIsRetriable(t *testing.T) { wantIsRetriable: false, }} { retriesStatus := []v1.TaskRunStatus{} - for range tc.numRetriesStatus { + for i := 0; i < tc.numRetriesStatus; i++ { retriesStatus = append(retriesStatus, retryStatus) } t.Run(tc.name, func(t *testing.T) { diff --git a/upstream/pkg/apis/pipeline/v1/taskrun_validation.go b/upstream/pkg/apis/pipeline/v1/taskrun_validation.go index e162672a666..771d684d40c 100644 --- a/upstream/pkg/apis/pipeline/v1/taskrun_validation.go +++ b/upstream/pkg/apis/pipeline/v1/taskrun_validation.go @@ -26,7 +26,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/validate" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/strings/slices" "knative.dev/pkg/apis" @@ -51,9 +50,6 @@ func (tr *TaskRun) Validate(ctx context.Context) *apis.FieldError { // Validate taskrun spec func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { - // Validate the spec changes - errs = errs.Also(ts.ValidateUpdate(ctx)) - // Must have exactly one of taskRef and taskSpec. if ts.TaskRef == nil && ts.TaskSpec == nil { errs = errs.Also(apis.ErrMissingOneOf("taskRef", "taskSpec")) @@ -84,11 +80,11 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateDebug(ts.Debug).ViaField("debug")) } if ts.StepSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.BetaAPIFields).ViaField("stepSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.AlphaAPIFields).ViaField("stepSpecs")) errs = errs.Also(validateStepSpecs(ts.StepSpecs).ViaField("stepSpecs")) } if ts.SidecarSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.BetaAPIFields).ViaField("sidecarSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.AlphaAPIFields).ViaField("sidecarSpecs")) errs = errs.Also(validateSidecarSpecs(ts.SidecarSpecs).ViaField("sidecarSpecs")) } if ts.ComputeResources != nil { @@ -122,34 +118,6 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { return errs } -// ValidateUpdate validates the update of a TaskRunSpec -func (ts *TaskRunSpec) ValidateUpdate(ctx context.Context) (errs *apis.FieldError) { - if !apis.IsInUpdate(ctx) { - return - } - oldObj, ok := apis.GetBaseline(ctx).(*TaskRun) - if !ok || oldObj == nil { - return - } - old := &oldObj.Spec - - // If already in the done state, the spec cannot be modified. - // Otherwise, only the status, statusMessage field can be modified. - tips := "Once the TaskRun is complete, no updates are allowed" - if !oldObj.IsDone() { - old = old.DeepCopy() - old.Status = ts.Status - old.StatusMessage = ts.StatusMessage - tips = "Once the TaskRun has started, only status and statusMessage updates are allowed" - } - - if !equality.Semantic.DeepEqual(old, ts) { - errs = errs.Also(apis.ErrInvalidValue(tips, "")) - } - - return -} - // validateInlineParameters validates that any parameters called in the // Task spec are declared in the TaskRun. // This is crucial for propagated parameters because the parameters could @@ -256,21 +224,9 @@ func validateDebug(db *TaskRunDebug) (errs *apis.FieldError) { if db == nil || db.Breakpoints == nil { return errs } - - if db.Breakpoints.OnFailure == "" { - errs = errs.Also(apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "breakpoints.onFailure")) - } - if db.Breakpoints.OnFailure != "" && db.Breakpoints.OnFailure != EnabledOnFailureBreakpoint { errs = errs.Also(apis.ErrInvalidValue(db.Breakpoints.OnFailure+" is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "breakpoints.onFailure")) } - beforeSteps := sets.NewString() - for i, step := range db.Breakpoints.BeforeSteps { - if beforeSteps.Has(step) { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("before step must be unique, the same step: %s is defined multiple times at", step), fmt.Sprintf("breakpoints.beforeSteps[%d]", i))) - } - beforeSteps.Insert(step) - } return errs } diff --git a/upstream/pkg/apis/pipeline/v1/taskrun_validation_test.go b/upstream/pkg/apis/pipeline/v1/taskrun_validation_test.go index 9d3018b7367..978b3164a1c 100644 --- a/upstream/pkg/apis/pipeline/v1/taskrun_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/taskrun_validation_test.go @@ -22,7 +22,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" @@ -32,7 +31,6 @@ import ( corev1resources "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" ) func TestTaskRun_Invalidate(t *testing.T) { @@ -418,7 +416,7 @@ func TestTaskRun_Validate(t *testing.T) { }, wc: cfgtesting.EnableAlphaAPIFields, }, { - name: "beta feature: valid step and sidecar specs", + name: "alpha feature: valid step and sidecar specs", taskRun: &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "tr"}, Spec: v1.TaskRunSpec{ @@ -437,7 +435,7 @@ func TestTaskRun_Validate(t *testing.T) { }}, }, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -706,36 +704,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("turnOn is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "debug.breakpoints.onFailure"), wc: cfgtesting.EnableAlphaAPIFields, }, { - name: "invalid breakpoint duplicate before steps", - spec: v1.TaskRunSpec{ - TaskRef: &v1.TaskRef{ - Name: "my-task", - }, - Debug: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"step-1", "step-1"}, - OnFailure: "enabled", - }, - }, - }, - wantErr: apis.ErrGeneric("before step must be unique, the same step: step-1 is defined multiple times at", "debug.breakpoints.beforeSteps[1]"), - wc: cfgtesting.EnableAlphaAPIFields, - }, { - name: "empty onFailure breakpoint", - spec: v1.TaskRunSpec{ - TaskRef: &v1.TaskRef{ - Name: "my-task", - }, - Debug: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - OnFailure: "", - }, - }, - }, - wantErr: apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "debug.breakpoints.onFailure"), - wc: cfgtesting.EnableAlphaAPIFields, - }, { - name: "stepSpecs disallowed without beta feature gate", + name: "stepSpecs disallowed without alpha feature gate", spec: v1.TaskRunSpec{ TaskRef: &v1.TaskRef{ Name: "foo", @@ -748,9 +717,9 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }}, }, wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), + wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), }, { - name: "sidecarSpec disallowed without beta feature gate", + name: "sidecarSpec disallowed without alpha feature gate", spec: v1.TaskRunSpec{ TaskRef: &v1.TaskRef{ Name: "foo", @@ -763,7 +732,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }}, }, wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), + wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), }, { name: "duplicate stepSpecs names", spec: v1.TaskRunSpec{ @@ -846,7 +815,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { "stepSpecs.resources", "computeResources", ), - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "computeResources disallowed without beta feature gate", spec: v1.TaskRunSpec{ @@ -985,148 +954,3 @@ func TestTaskRunSpec_Validate(t *testing.T) { }) } } - -func TestTaskRunSpec_ValidateUpdate(t *testing.T) { - tests := []struct { - name string - isCreate bool - isUpdate bool - baselineTaskRun *v1.TaskRun - taskRun *v1.TaskRun - expectedError apis.FieldError - }{ - { - name: "is create ctx", - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{}, - }, - isCreate: true, - isUpdate: false, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, no changes", - baselineTaskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is nil, skip validation", - baselineTaskRun: nil, - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Timeout: &metav1.Duration{Duration: 1}, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, only status changes", - baselineTaskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "", - StatusMessage: "", - }, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "TaskRunCancelled", - StatusMessage: "TaskRun is cancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, status and timeout changes", - baselineTaskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "", - StatusMessage: "", - Timeout: &metav1.Duration{Duration: 0}, - }, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "TaskRunCancelled", - StatusMessage: "TaskRun is cancelled", - Timeout: &metav1.Duration{Duration: 1}, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the TaskRun has started, only status and statusMessage updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is done, status changes", - baselineTaskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "", - }, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionTrue}, - }, - }, - }, - }, - taskRun: &v1.TaskRun{ - Spec: v1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the TaskRun is complete, no updates are allowed`, - Paths: []string{""}, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{}, - Defaults: &config.Defaults{}, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselineTaskRun) - } - tr := tt.taskRun - err := tr.Spec.ValidateUpdate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("TaskRunSpec.ValidateUpdate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1/when_types.go b/upstream/pkg/apis/pipeline/v1/when_types.go index 0a128d8f9e5..66e7164a779 100644 --- a/upstream/pkg/apis/pipeline/v1/when_types.go +++ b/upstream/pkg/apis/pipeline/v1/when_types.go @@ -98,8 +98,6 @@ func (we *WhenExpression) GetVarSubstitutionExpressions() ([]string, bool) { // All of them need to evaluate to True for a guarded Task to be executed. type WhenExpressions []WhenExpression -type StepWhenExpressions = WhenExpressions - // AllowsExecution evaluates an Input's relationship to an array of Values, based on the Operator, // to determine whether all the When Expressions are True. If they are all True, the guarded Task is // executed, otherwise it is skipped. diff --git a/upstream/pkg/apis/pipeline/v1/when_validation.go b/upstream/pkg/apis/pipeline/v1/when_validation.go index a62621a69ff..2a058299a7d 100644 --- a/upstream/pkg/apis/pipeline/v1/when_validation.go +++ b/upstream/pkg/apis/pipeline/v1/when_validation.go @@ -48,7 +48,7 @@ func (wes WhenExpressions) validateWhenExpressionsFields(ctx context.Context) (e func (we *WhenExpression) validateWhenExpressionFields(ctx context.Context) *apis.FieldError { if we.CEL != "" { if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableCELInWhenExpression { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use CEL: %s in WhenExpression", config.EnableCELInWhenExpression, we.CEL), "") + return apis.ErrGeneric("feature flag %s should be set to true to use CEL: %s in WhenExpression", config.EnableCELInWhenExpression, we.CEL) } if we.Input != "" || we.Operator != "" || len(we.Values) != 0 { return apis.ErrGeneric(fmt.Sprintf("cel and input+operator+values cannot be set in one WhenExpression: %v", we)) diff --git a/upstream/pkg/apis/pipeline/v1/workspace_validation_test.go b/upstream/pkg/apis/pipeline/v1/workspace_validation_test.go index f588e710bef..cd93c678500 100644 --- a/upstream/pkg/apis/pipeline/v1/workspace_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1/workspace_validation_test.go @@ -50,7 +50,7 @@ func TestWorkspaceBindingValidateValid(t *testing.T) { }, Spec: corev1.PersistentVolumeClaimSpec{ AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, - Resources: corev1.VolumeResourceRequirements{ + Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ "storage": resource.MustParse("1Gi"), }, diff --git a/upstream/pkg/apis/pipeline/v1/zz_generated.deepcopy.go b/upstream/pkg/apis/pipeline/v1/zz_generated.deepcopy.go index c3057d33561..16e483fcec1 100644 --- a/upstream/pkg/apis/pipeline/v1/zz_generated.deepcopy.go +++ b/upstream/pkg/apis/pipeline/v1/zz_generated.deepcopy.go @@ -1248,11 +1248,6 @@ func (in *Sidecar) DeepCopyInto(out *Sidecar) { *out = make([]WorkspaceUsage, len(*in)) copy(*out, *in) } - if in.RestartPolicy != nil { - in, out := &in.RestartPolicy, &out.RestartPolicy - *out = new(corev1.ContainerRestartPolicy) - **out = **in - } return } @@ -1390,13 +1385,6 @@ func (in *Step) DeepCopyInto(out *Step) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.When != nil { - in, out := &in.When, &out.When - *out = make(WhenExpressions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } return } @@ -1460,11 +1448,6 @@ func (in *StepState) DeepCopyInto(out *StepState) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Provenance != nil { - in, out := &in.Provenance, &out.Provenance - *out = new(Provenance) - (*in).DeepCopyInto(*out) - } if in.Inputs != nil { in, out := &in.Inputs, &out.Inputs *out = make([]Artifact, len(*in)) @@ -1580,11 +1563,6 @@ func (in *Task) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TaskBreakpoints) DeepCopyInto(out *TaskBreakpoints) { *out = *in - if in.BeforeSteps != nil { - in, out := &in.BeforeSteps, &out.BeforeSteps - *out = make([]string, len(*in)) - copy(*out, *in) - } return } @@ -1710,7 +1688,7 @@ func (in *TaskRunDebug) DeepCopyInto(out *TaskRunDebug) { if in.Breakpoints != nil { in, out := &in.Breakpoints, &out.Breakpoints *out = new(TaskBreakpoints) - (*in).DeepCopyInto(*out) + **out = **in } return } @@ -1939,11 +1917,6 @@ func (in *TaskRunStatusFields) DeepCopyInto(out *TaskRunStatusFields) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Artifacts != nil { - in, out := &in.Artifacts, &out.Artifacts - *out = new(Artifacts) - (*in).DeepCopyInto(*out) - } if in.Sidecars != nil { in, out := &in.Sidecars, &out.Sidecars *out = make([]SidecarState, len(*in)) diff --git a/upstream/pkg/apis/pipeline/v1alpha1/openapi_generated.go b/upstream/pkg/apis/pipeline/v1alpha1/openapi_generated.go index cbcdc1ddf82..93704735c87 100644 --- a/upstream/pkg/apis/pipeline/v1alpha1/openapi_generated.go +++ b/upstream/pkg/apis/pipeline/v1alpha1/openapi_generated.go @@ -109,24 +109,11 @@ func schema_pkg_apis_pipeline_pod_AffinityAssistantTemplate(ref common.Reference }, }, }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext sets the security context for the pod", - Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), - }, - }, - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.Toleration"}, } } @@ -404,6 +391,7 @@ func schema_pkg_apis_pipeline_v1alpha1_EmbeddedRunSpec(ref common.ReferenceCallb "spec": { SchemaProps: spec.SchemaProps{ Description: "Spec is a specification of a custom task", + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, diff --git a/upstream/pkg/apis/pipeline/v1alpha1/run_types_test.go b/upstream/pkg/apis/pipeline/v1alpha1/run_types_test.go index 50d8cd59689..f805882352d 100644 --- a/upstream/pkg/apis/pipeline/v1alpha1/run_types_test.go +++ b/upstream/pkg/apis/pipeline/v1alpha1/run_types_test.go @@ -34,10 +34,8 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" ) -var ( - now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) - testClock = clock.NewFakePassiveClock(now) -) +var now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) +var testClock = clock.NewFakePassiveClock(now) func TestGetParams(t *testing.T) { for _, c := range []struct { @@ -345,7 +343,7 @@ func TestRunGetTimeOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.run.GetTimeout() if d := cmp.Diff(tc.expectedValue, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -368,8 +366,7 @@ func TestRunHasTimedOut(t *testing.T) { RunStatusFields: v1alpha1.RunStatusFields{ StartTime: &metav1.Time{Time: now}, }, - }, - }, + }}, expectedValue: false, }, { name: "runWithStartTimeNoTimeout2", @@ -379,8 +376,7 @@ func TestRunHasTimedOut(t *testing.T) { RunStatusFields: v1alpha1.RunStatusFields{ StartTime: &metav1.Time{Time: now.Add(-1 * (apisconfig.DefaultTimeoutMinutes + 1) * time.Minute)}, }, - }, - }, + }}, expectedValue: true, }, { name: "runWithStartTimeAndTimeout", @@ -389,8 +385,7 @@ func TestRunHasTimedOut(t *testing.T) { Spec: v1alpha1.RunSpec{Timeout: &metav1.Duration{Duration: 10 * time.Second}}, Status: v1alpha1.RunStatus{RunStatusFields: v1alpha1.RunStatusFields{ StartTime: &metav1.Time{Time: now.Add(-1 * (apisconfig.DefaultTimeoutMinutes + 1) * time.Minute)}, - }}, - }, + }}}, expectedValue: true, }, { name: "runWithNoStartTimeAndTimeout", @@ -406,8 +401,7 @@ func TestRunHasTimedOut(t *testing.T) { Spec: v1alpha1.RunSpec{Timeout: &metav1.Duration{Duration: 10 * time.Second}}, Status: v1alpha1.RunStatus{RunStatusFields: v1alpha1.RunStatusFields{ StartTime: &metav1.Time{Time: now}, - }}, - }, + }}}, expectedValue: false, }} @@ -415,7 +409,7 @@ func TestRunHasTimedOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.run.HasTimedOut(testClock) if d := cmp.Diff(tc.expectedValue, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } diff --git a/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion.go b/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion.go index b2896d0de8f..a02bf76096a 100644 --- a/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion.go +++ b/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion.go @@ -15,9 +15,7 @@ package v1alpha1 import ( "context" - "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -25,63 +23,20 @@ var _ apis.Convertible = (*StepAction)(nil) // ConvertTo implements apis.Convertible func (s *StepAction) ConvertTo(ctx context.Context, to apis.Convertible) error { - if apis.IsInDelete(ctx) { - return nil - } - switch sink := to.(type) { - case *v1beta1.StepAction: - sink.ObjectMeta = s.ObjectMeta - return s.Spec.ConvertTo(ctx, &sink.Spec) - default: - return fmt.Errorf("unknown version, got: %T", sink) - } + return nil } // ConvertTo implements apis.Convertible -func (ss *StepActionSpec) ConvertTo(ctx context.Context, sink *v1beta1.StepActionSpec) error { - sink.Description = ss.Description - sink.Image = ss.Image - sink.Command = ss.Command - sink.Args = ss.Args - sink.Env = ss.Env - sink.Script = ss.Script - sink.WorkingDir = ss.WorkingDir - sink.Params = ss.Params - sink.Results = ss.Results - sink.SecurityContext = ss.SecurityContext - sink.VolumeMounts = ss.VolumeMounts - +func (ss *StepActionSpec) ConvertTo(ctx context.Context, sink *StepActionSpec) error { return nil } // ConvertFrom implements apis.Convertible func (s *StepAction) ConvertFrom(ctx context.Context, from apis.Convertible) error { - if apis.IsInDelete(ctx) { - return nil - } - switch source := from.(type) { - case *v1beta1.StepAction: - s.ObjectMeta = source.ObjectMeta - return s.Spec.ConvertFrom(ctx, &source.Spec) - default: - return fmt.Errorf("unknown version, got: %T", source) - } + return nil } // ConvertFrom implements apis.Convertible -func (ss *StepActionSpec) ConvertFrom(ctx context.Context, source *v1beta1.StepActionSpec) error { - ss.Description = source.Description - ss.Image = source.Image - ss.Command = source.Command - ss.Args = source.Args - ss.Env = source.Env - ss.Script = source.Script - ss.WorkingDir = source.WorkingDir - - ss.Params = source.Params - ss.Results = source.Results - ss.SecurityContext = source.SecurityContext - ss.VolumeMounts = source.VolumeMounts - +func (ss *StepActionSpec) ConvertFrom(ctx context.Context, source *StepActionSpec) error { return nil } diff --git a/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion_test.go b/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion_test.go deleted file mode 100644 index 9193b6e7b32..00000000000 --- a/upstream/pkg/apis/pipeline/v1alpha1/stepaction_conversion_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package v1alpha1_test - -import ( - "context" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/test/diff" - "github.com/tektoncd/pipeline/test/parse" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestPipelineConversionBadType(t *testing.T) { - good, bad := &v1alpha1.StepAction{}, &v1beta1.Task{} - - if err := good.ConvertTo(context.Background(), bad); err == nil { - t.Errorf("ConvertTo() = %#v, wanted error", bad) - } - - if err := good.ConvertFrom(context.Background(), bad); err == nil { - t.Errorf("ConvertFrom() = %#v, wanted error", good) - } -} - -func TestStepActionConversion(t *testing.T) { - stepActionWithAllFieldsYaml := ` -metadata: - name: foo - namespace: bar -spec: - name: all-fields - image: foo - command: ["hello"] - args: ["world"] - results: - - name: result1 - - name: result2 - script: | - echo "I am a Step Action!!!" >> $(step.results.result1.path) - echo "I am a hidden step action!!!" >> $(step.results.result2.path) - workingDir: "/dir" - envFrom: - - prefix: prefix - params: - - name: string-param - type: string - default: "a string param" - - name: array-param - type: array - default: - - an - - array - - param - - name: object-param - type: object - properties: - key1: - type: string - key2: - type: string - key3: - type: string - default: - key1: "step-action default key1" - key2: "step-action default key2" - key3: "step-action default key3" - volumeMounts: - - name: data - mountPath: /data - securityContext: - privileged: true -` - - stepActionV1alpha1 := parse.MustParseV1alpha1StepAction(t, stepActionWithAllFieldsYaml) - stepActionV1beta1 := parse.MustParseV1beta1StepAction(t, stepActionWithAllFieldsYaml) - - var ignoreTypeMeta = cmpopts.IgnoreFields(metav1.TypeMeta{}, "Kind", "APIVersion") - - tests := []struct { - name string - v1AlphaStepAction *v1alpha1.StepAction - v1Beta1StepAction *v1beta1.StepAction - }{{ - name: "stepAction conversion with all fields", - v1AlphaStepAction: stepActionV1alpha1, - v1Beta1StepAction: stepActionV1beta1, - }} - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - v1Beta1StepAction := &v1beta1.StepAction{} - if err := test.v1AlphaStepAction.ConvertTo(context.Background(), v1Beta1StepAction); err != nil { - t.Errorf("ConvertTo() = %v", err) - return - } - t.Logf("ConvertTo() = %#v", v1Beta1StepAction) - if d := cmp.Diff(test.v1Beta1StepAction, v1Beta1StepAction, ignoreTypeMeta); d != "" { - t.Errorf("expected v1Task is different from what's converted: %s", d) - } - gotV1alpha1 := &v1alpha1.StepAction{} - if err := gotV1alpha1.ConvertFrom(context.Background(), v1Beta1StepAction); err != nil { - t.Errorf("ConvertFrom() = %v", err) - } - t.Logf("ConvertFrom() = %#v", gotV1alpha1) - if d := cmp.Diff(test.v1AlphaStepAction, gotV1alpha1, ignoreTypeMeta); d != "" { - t.Errorf("roundtrip %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1alpha1/swagger.json b/upstream/pkg/apis/pipeline/v1alpha1/swagger.json index 12ecda6393c..4da8930fc32 100644 --- a/upstream/pkg/apis/pipeline/v1alpha1/swagger.json +++ b/upstream/pkg/apis/pipeline/v1alpha1/swagger.json @@ -28,14 +28,6 @@ "default": "" } }, - "priorityClassName": { - "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - "type": "string" - }, - "securityContext": { - "description": "SecurityContext sets the security context for the pod", - "$ref": "#/definitions/v1.PodSecurityContext" - }, "tolerations": { "description": "If specified, the pod's tolerations.", "type": "array", @@ -193,6 +185,7 @@ }, "spec": { "description": "Spec is a specification of a custom task", + "default": {}, "$ref": "#/definitions/k8s.io.apimachinery.pkg.runtime.RawExtension" } } diff --git a/upstream/pkg/apis/pipeline/v1beta1/artifact_types.go b/upstream/pkg/apis/pipeline/v1beta1/artifact_types.go index 23778a90bbc..ec50bde8a16 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/artifact_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/artifact_types.go @@ -6,12 +6,8 @@ type Algorithm string // Artifact represents an artifact within a system, potentially containing multiple values // associated with it. type Artifact struct { - // The artifact's identifying category name - Name string `json:"name,omitempty"` - // A collection of values related to the artifact - Values []ArtifactValue `json:"values,omitempty"` - // Indicate if the artifact is a build output or a by-product - BuildOutput bool `json:"buildOutput,omitempty"` + Name string `json:"name,omitempty"` // The artifact's identifying category name + Values []ArtifactValue `json:"values,omitempty"` // A collection of values related to the artifact } // ArtifactValue represents a specific value or data element within an Artifact. diff --git a/upstream/pkg/apis/pipeline/v1beta1/container_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/container_conversion.go index 5b61377bcc8..2e828bc5add 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/container_conversion.go +++ b/upstream/pkg/apis/pipeline/v1beta1/container_conversion.go @@ -72,11 +72,6 @@ func (s Step) convertTo(ctx context.Context, sink *v1.Step) { sink.Params = append(sink.Params, new) } sink.Results = s.Results - for _, w := range s.When { - new := v1.WhenExpression{} - w.convertTo(ctx, &new) - sink.When = append(sink.When, new) - } } func (s *Step) convertFrom(ctx context.Context, source v1.Step) { @@ -116,11 +111,6 @@ func (s *Step) convertFrom(ctx context.Context, source v1.Step) { s.Params = append(s.Params, new) } s.Results = source.Results - for _, w := range source.When { - new := WhenExpression{} - new.convertFrom(ctx, w) - s.When = append(s.When, new) - } } func (s StepTemplate) convertTo(ctx context.Context, sink *v1.StepTemplate) { diff --git a/upstream/pkg/apis/pipeline/v1beta1/container_types.go b/upstream/pkg/apis/pipeline/v1beta1/container_types.go index 95f852bf496..4494184d7aa 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/container_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/container_types.go @@ -247,8 +247,6 @@ type Step struct { // +optional // +listType=atomic Results []v1.StepResult `json:"results,omitempty"` - - When StepWhenExpressions `json:"when,omitempty"` } // Ref can be used to refer to a specific instance of a StepAction. @@ -747,43 +745,10 @@ type Sidecar struct { // +optional // +listType=atomic Workspaces []WorkspaceUsage `json:"workspaces,omitempty"` - - // RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an - // initContainer and must have it's policy set to "Always". It is currently - // left optional to help support Kubernetes versions prior to 1.29 when this feature - // was introduced. - // +optional - RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` } // ToK8sContainer converts the Sidecar to a Kubernetes Container struct func (s *Sidecar) ToK8sContainer() *corev1.Container { - if s.RestartPolicy == nil { - return &corev1.Container{ - Name: s.Name, - Image: s.Image, - Command: s.Command, - Args: s.Args, - WorkingDir: s.WorkingDir, - Ports: s.Ports, - EnvFrom: s.EnvFrom, - Env: s.Env, - Resources: s.Resources, - VolumeMounts: s.VolumeMounts, - VolumeDevices: s.VolumeDevices, - LivenessProbe: s.LivenessProbe, - ReadinessProbe: s.ReadinessProbe, - StartupProbe: s.StartupProbe, - Lifecycle: s.Lifecycle, - TerminationMessagePath: s.TerminationMessagePath, - TerminationMessagePolicy: s.TerminationMessagePolicy, - ImagePullPolicy: s.ImagePullPolicy, - SecurityContext: s.SecurityContext, - Stdin: s.Stdin, - StdinOnce: s.StdinOnce, - TTY: s.TTY, - } - } return &corev1.Container{ Name: s.Name, Image: s.Image, @@ -798,7 +763,6 @@ func (s *Sidecar) ToK8sContainer() *corev1.Container { VolumeDevices: s.VolumeDevices, LivenessProbe: s.LivenessProbe, ReadinessProbe: s.ReadinessProbe, - RestartPolicy: s.RestartPolicy, StartupProbe: s.StartupProbe, Lifecycle: s.Lifecycle, TerminationMessagePath: s.TerminationMessagePath, @@ -835,5 +799,4 @@ func (s *Sidecar) SetContainerFields(c corev1.Container) { s.Stdin = c.Stdin s.StdinOnce = c.StdinOnce s.TTY = c.TTY - s.RestartPolicy = c.RestartPolicy } diff --git a/upstream/pkg/apis/pipeline/v1beta1/container_validation.go b/upstream/pkg/apis/pipeline/v1beta1/container_validation.go index dc1b60d15ba..bab6f8bc4d5 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/container_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/container_validation.go @@ -18,9 +18,6 @@ package v1beta1 import ( "context" - "errors" - "fmt" - "regexp" "strings" "github.com/tektoncd/pipeline/pkg/apis/config" @@ -28,72 +25,38 @@ import ( "knative.dev/pkg/apis" ) -func validateRef(ctx context.Context, refName string, refResolver ResolverName, refParams Params) (errs *apis.FieldError) { +// Validate ensures that a supplied Ref field is populated +// correctly. No errors are returned for a nil Ref. +func (ref *Ref) Validate(ctx context.Context) (errs *apis.FieldError) { + if ref == nil { + return errs + } + switch { - case refResolver != "" || refParams != nil: - if refParams != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) - if refName != "" { - errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) - } - if refResolver == "" { - errs = errs.Also(apis.ErrMissingField("resolver")) - } - errs = errs.Also(ValidateParameters(ctx, refParams)) - } - if refResolver != "" { + case ref.Resolver != "" || ref.Params != nil: + if ref.Resolver != "" { errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) - if refName != "" { - // make sure that the name is url-like. - err := RefNameLikeUrl(refName) - if err == nil && !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - // If name is url-like then concise resolver syntax must be enabled - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(err, "name")) - } + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) } } - case refName != "": - // ref name can be a Url-like format. - if err := RefNameLikeUrl(refName); err == nil { - // If name is url-like then concise resolver syntax must be enabled - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) + if ref.Params != nil { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) } - // In stage1 of concise remote resolvers syntax, this is a required field. - // TODO: remove this check when implementing stage 2 where this is optional. - if refResolver == "" { + if ref.Resolver == "" { errs = errs.Also(apis.ErrMissingField("resolver")) } - // Or, it must be a valid k8s name - } else { - // ref name must be a valid k8s name - if errSlice := validation.IsQualifiedName(refName); len(errSlice) != 0 { - errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) - } + errs = errs.Also(ValidateParameters(ctx, ref.Params)) + } + case ref.Name != "": + // Ref name must be a valid k8s name + if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { + errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) } default: errs = errs.Also(apis.ErrMissingField("name")) } return errs } - -// Validate ensures that a supplied Ref field is populated -// correctly. No errors are returned for a nil Ref. -func (ref *Ref) Validate(ctx context.Context) (errs *apis.FieldError) { - if ref == nil { - return errs - } - return validateRef(ctx, ref.Name, ref.Resolver, ref.Params) -} - -// RefNameLikeUrl checks if the name is url parsable and returns an error if it isn't. -func RefNameLikeUrl(name string) error { - schemeRegex := regexp.MustCompile(`[\w-]+:\/\/*`) - if !schemeRegex.MatchString(name) { - return errors.New("invalid URI for request") - } - return nil -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/container_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/container_validation_test.go index cc423d3bd52..95e7e4a28c0 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/container_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/container_validation_test.go @@ -21,22 +21,12 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/diff" "knative.dev/pkg/apis" ) -func enableConciseResolverSyntax(ctx context.Context) context.Context { - return config.ToContext(ctx, &config.Config{ - FeatureFlags: &config.FeatureFlags{ - EnableConciseResolverSyntax: true, - EnableAPIFields: config.BetaAPIFields, - }, - }) -} - func TestRef_Valid(t *testing.T) { tests := []struct { name string @@ -47,10 +37,6 @@ func TestRef_Valid(t *testing.T) { }, { name: "simple ref", ref: &v1beta1.Ref{Name: "refname"}, - }, { - name: "ref name - consice syntax", - ref: &v1beta1.Ref{Name: "foo://baz:ver", ResolverRef: v1beta1.ResolverRef{Resolver: "git"}}, - wc: enableConciseResolverSyntax, }, { name: "beta feature: valid resolver", ref: &v1beta1.Ref{ResolverRef: v1beta1.ResolverRef{Resolver: "git"}}, @@ -107,45 +93,29 @@ func TestRef_Invalid(t *testing.T) { }, wantErr: apis.ErrMissingField("resolver"), }, { - name: "ref with resolver and k8s style name", + name: "ref resolver disallowed in conjunction with ref name", ref: &v1beta1.Ref{ Name: "foo", ResolverRef: v1beta1.ResolverRef{ Resolver: "git", }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), }, { - name: "ref with url-like name without resolver", + name: "ref params disallowed in conjunction with ref name", ref: &v1beta1.Ref{ - Name: "https://foo.com/bar", - }, - wantErr: apis.ErrMissingField("resolver"), - wc: enableConciseResolverSyntax, - }, { - name: "ref params disallowed in conjunction with pipelineref name", - ref: &v1beta1.Ref{ - Name: "https://foo/bar", + Name: "bar", ResolverRef: v1beta1.ResolverRef{ - Resolver: "git", - Params: v1beta1.Params{{Name: "foo", Value: v1beta1.ParamValue{StringVal: "bar"}}}, + Params: v1beta1.Params{{ + Name: "foo", + Value: v1beta1.ParamValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", + }, + }}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - wc: enableConciseResolverSyntax, - }, { - name: "ref with url-like name without enable-concise-resolver-syntax", - ref: &v1beta1.Ref{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), - }, { - name: "ref without enable-concise-resolver-syntax", - ref: &v1beta1.Ref{Name: "https://foo.com/bar", ResolverRef: v1beta1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }, + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), }, { name: "invalid ref name", ref: &v1beta1.Ref{Name: "_foo"}, diff --git a/upstream/pkg/apis/pipeline/v1beta1/customrun_types_test.go b/upstream/pkg/apis/pipeline/v1beta1/customrun_types_test.go index 011ce02264b..39b66c008e6 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/customrun_types_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/customrun_types_test.go @@ -376,7 +376,7 @@ func TestRunGetTimeOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.customRun.GetTimeout() if d := cmp.Diff(tc.expectedValue, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -399,8 +399,7 @@ func TestRunHasTimedOut(t *testing.T) { CustomRunStatusFields: v1beta1.CustomRunStatusFields{ StartTime: &metav1.Time{Time: now}, }, - }, - }, + }}, expectedValue: false, }, { name: "runWithStartTimeNoTimeout2", @@ -410,8 +409,7 @@ func TestRunHasTimedOut(t *testing.T) { CustomRunStatusFields: v1beta1.CustomRunStatusFields{ StartTime: &metav1.Time{Time: now.Add(-1 * (apisconfig.DefaultTimeoutMinutes + 1) * time.Minute)}, }, - }, - }, + }}, expectedValue: true, }, { name: "runWithStartTimeAndTimeout", @@ -420,8 +418,7 @@ func TestRunHasTimedOut(t *testing.T) { Spec: v1beta1.CustomRunSpec{Timeout: &metav1.Duration{Duration: 10 * time.Second}}, Status: v1beta1.CustomRunStatus{CustomRunStatusFields: v1beta1.CustomRunStatusFields{ StartTime: &metav1.Time{Time: now.Add(-1 * (apisconfig.DefaultTimeoutMinutes + 1) * time.Minute)}, - }}, - }, + }}}, expectedValue: true, }, { name: "runWithNoStartTimeAndTimeout", @@ -437,8 +434,7 @@ func TestRunHasTimedOut(t *testing.T) { Spec: v1beta1.CustomRunSpec{Timeout: &metav1.Duration{Duration: 10 * time.Second}}, Status: v1beta1.CustomRunStatus{CustomRunStatusFields: v1beta1.CustomRunStatusFields{ StartTime: &metav1.Time{Time: now}, - }}, - }, + }}}, expectedValue: false, }} @@ -446,7 +442,7 @@ func TestRunHasTimedOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.customRun.HasTimedOut(testClock) if d := cmp.Diff(tc.expectedValue, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } diff --git a/upstream/pkg/apis/pipeline/v1beta1/merge.go b/upstream/pkg/apis/pipeline/v1beta1/merge.go index 62111ee7ccb..42d9ffa868c 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/merge.go +++ b/upstream/pkg/apis/pipeline/v1beta1/merge.go @@ -47,11 +47,6 @@ func MergeStepsWithStepTemplate(template *StepTemplate, steps []Step) ([]Step, e } for i, s := range steps { - // If the stepaction has not been fetched yet then do not merge. - // Skip over to the next one - if s.Ref != nil { - continue - } merged := corev1.Container{} err := mergeObjWithTemplateBytes(md, s.ToK8sContainer(), &merged) if err != nil { @@ -66,7 +61,7 @@ func MergeStepsWithStepTemplate(template *StepTemplate, steps []Step) ([]Step, e amendConflictingContainerFields(&merged, s) // Pass through original step Script, for later conversion. - newStep := Step{Script: s.Script, OnError: s.OnError, Timeout: s.Timeout, StdoutConfig: s.StdoutConfig, StderrConfig: s.StderrConfig, When: s.When} + newStep := Step{Script: s.Script, OnError: s.OnError, Timeout: s.Timeout, StdoutConfig: s.StdoutConfig, StderrConfig: s.StderrConfig} newStep.SetContainerFields(merged) steps[i] = newStep } @@ -82,6 +77,7 @@ func MergeStepsWithOverrides(steps []Step, overrides []TaskRunStepOverride) ([]S stepNameToOverride[o.Name] = o } for i, s := range steps { + s := s o, found := stepNameToOverride[s.Name] if !found { continue @@ -108,6 +104,7 @@ func MergeSidecarsWithOverrides(sidecars []Sidecar, overrides []TaskRunSidecarOv sidecarNameToOverride[o.Name] = o } for i, s := range sidecars { + s := s o, found := sidecarNameToOverride[s.Name] if !found { continue diff --git a/upstream/pkg/apis/pipeline/v1beta1/merge_test.go b/upstream/pkg/apis/pipeline/v1beta1/merge_test.go index fe177e431b2..08fff766f65 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/merge_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/merge_test.go @@ -20,13 +20,10 @@ import ( "testing" "github.com/google/go-cmp/cmp" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/selection" - "k8s.io/utils/pointer" ) func TestMergeStepsWithStepTemplate(t *testing.T) { @@ -130,52 +127,6 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { MountPath: "/workspace/data", }}, }}, - }, { - name: "step-ref-should-not-be-merged-with-steptemplate", - template: &v1beta1.StepTemplate{ - SecurityContext: &corev1.SecurityContext{ - RunAsNonRoot: pointer.Bool(true), - }, - VolumeMounts: []corev1.VolumeMount{{ - Name: "data", - MountPath: "/workspace/data", - }}, - Env: []corev1.EnvVar{{ - Name: "KEEP_THIS", - Value: "A_VALUE", - }, { - Name: "SOME_KEY_1", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "A_KEY", - LocalObjectReference: corev1.LocalObjectReference{Name: "A_NAME"}, - }, - }, - }, { - Name: "SOME_KEY_2", - Value: "VALUE_2", - }}, - }, - steps: []v1beta1.Step{{ - Ref: &v1beta1.Ref{Name: "my-step-action"}, - OnError: "foo", - Results: []v1.StepResult{{ - Name: "result", - }}, - Params: v1beta1.Params{{ - Name: "param", - }}, - }}, - expected: []v1beta1.Step{{ - Ref: &v1beta1.Ref{Name: "my-step-action"}, - OnError: "foo", - Results: []v1.StepResult{{ - Name: "result", - }}, - Params: v1beta1.Params{{ - Name: "param", - }}, - }}, }, { name: "merge-env-by-step", template: &v1beta1.StepTemplate{ @@ -232,17 +183,6 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { }, }}, }}, - }, { - name: "when", - template: nil, - steps: []v1beta1.Step{{ - Image: "some-image", - When: v1beta1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo", "bar"}}}, - }}, - expected: []v1beta1.Step{{ - Image: "some-image", - When: v1beta1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo", "bar"}}}, - }}, }} { t.Run(tc.name, func(t *testing.T) { result, err := v1beta1.MergeStepsWithStepTemplate(tc.template, tc.steps) diff --git a/upstream/pkg/apis/pipeline/v1beta1/openapi_generated.go b/upstream/pkg/apis/pipeline/v1beta1/openapi_generated.go index 145e72b083a..d938565b86d 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/openapi_generated.go +++ b/upstream/pkg/apis/pipeline/v1beta1/openapi_generated.go @@ -87,9 +87,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.SidecarState": schema_pkg_apis_pipeline_v1beta1_SidecarState(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.SkippedTask": schema_pkg_apis_pipeline_v1beta1_SkippedTask(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Step": schema_pkg_apis_pipeline_v1beta1_Step(ref), - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepAction": schema_pkg_apis_pipeline_v1beta1_StepAction(ref), - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepActionList": schema_pkg_apis_pipeline_v1beta1_StepActionList(ref), - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepActionSpec": schema_pkg_apis_pipeline_v1beta1_StepActionSpec(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepOutputConfig": schema_pkg_apis_pipeline_v1beta1_StepOutputConfig(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepState": schema_pkg_apis_pipeline_v1beta1_StepState(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepTemplate": schema_pkg_apis_pipeline_v1beta1_StepTemplate(ref), @@ -189,24 +186,11 @@ func schema_pkg_apis_pipeline_pod_AffinityAssistantTemplate(ref common.Reference }, }, }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext sets the security context for the pod", - Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), - }, - }, - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.Toleration"}, } } @@ -435,14 +419,13 @@ func schema_pkg_apis_pipeline_v1beta1_Artifact(ref common.ReferenceCallback) com Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "The artifact's identifying category name", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, "values": { SchemaProps: spec.SchemaProps{ - Description: "A collection of values related to the artifact", + Description: "The artifact's identifying category name", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -454,13 +437,6 @@ func schema_pkg_apis_pipeline_v1beta1_Artifact(ref common.ReferenceCallback) com }, }, }, - "buildOutput": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate if the artifact is a build output or a by-product", - Type: []string{"boolean"}, - Format: "", - }, - }, }, }, }, @@ -1040,6 +1016,7 @@ func schema_pkg_apis_pipeline_v1beta1_EmbeddedCustomRunSpec(ref common.Reference "spec": { SchemaProps: spec.SchemaProps{ Description: "Spec is a specification of a custom task", + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -1073,6 +1050,7 @@ func schema_pkg_apis_pipeline_v1beta1_EmbeddedTask(ref common.ReferenceCallback) "spec": { SchemaProps: spec.SchemaProps{ Description: "Spec is a specification of a custom task", + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -1410,7 +1388,8 @@ func schema_pkg_apis_pipeline_v1beta1_Param(ref common.ReferenceCallback) common }, "value": { SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamValue"), + Default: map[string]interface{}{}, + Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamValue"), }, }, }, @@ -1710,7 +1689,7 @@ func schema_pkg_apis_pipeline_v1beta1_PipelineRef(ref common.ReferenceCallback) }, "bundle": { SchemaProps: spec.SchemaProps{ - Description: "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead. The field is staying there for go client backward compatibility, but is not used/allowed anymore.", + Description: "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead.", Type: []string{"string"}, Format: "", }, @@ -1815,6 +1794,7 @@ func schema_pkg_apis_pipeline_v1beta1_PipelineResult(ref common.ReferenceCallbac "value": { SchemaProps: spec.SchemaProps{ Description: "Value the expression used to retrieve the value", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamValue"), }, }, @@ -1940,6 +1920,7 @@ func schema_pkg_apis_pipeline_v1beta1_PipelineRunResult(ref common.ReferenceCall "value": { SchemaProps: spec.SchemaProps{ Description: "Value is the result returned from the execution of this PipelineRun", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamValue"), }, }, @@ -3637,13 +3618,6 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm }, }, }, - "restartPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an initContainer and must have it's policy set to \"Always\". It is currently left optional to help support Kubernetes versions prior to 1.29 when this feature was introduced.", - Type: []string{"string"}, - Format: "", - }, - }, }, Required: []string{"name"}, }, @@ -4105,285 +4079,12 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. }, }, }, - "when": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WhenExpression"), - }, - }, - }, - }, - }, }, Required: []string{"name"}, }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Param", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Ref", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepOutputConfig", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WhenExpression", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceUsage", "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, - } -} - -func schema_pkg_apis_pipeline_v1beta1_StepAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StepAction represents the actionable components of Step. The Step can only reference it from the cluster or using remote resolution.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec holds the desired state of the Step from the client", - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepActionSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepActionSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_pipeline_v1beta1_StepActionList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StepActionList contains a list of StepActions", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepAction"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepAction", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_pipeline_v1beta1_StepActionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StepActionSpec contains the actionable components of a step.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "description": { - SchemaProps: spec.SchemaProps{ - Description: "Description is a user-facing description of the stepaction that may be used to populate a UI.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Image reference name to run for this StepAction. More info: https://kubernetes.io/docs/concepts/containers/images", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "args": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "env": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of environment variables to set in the container. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.EnvVar"), - }, - }, - }, - }, - }, - "script": { - SchemaProps: spec.SchemaProps{ - Description: "Script is the contents of an executable file to execute.\n\nIf Script is not empty, the Step cannot have an Command and the Args will be passed to the Script.", - Type: []string{"string"}, - Format: "", - }, - }, - "workingDir": { - SchemaProps: spec.SchemaProps{ - Description: "Step's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "params": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Params is a list of input parameters required to run the stepAction. Params must be supplied as inputs in Steps unless they declare a defaultvalue.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamSpec"), - }, - }, - }, - }, - }, - "results": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Results are values that this StepAction can output", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult"), - }, - }, - }, - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext defines the security options the Step should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ The value set in StepAction will take precedence over the value from Task.", - Ref: ref("k8s.io/api/core/v1.SecurityContext"), - }, - }, - "volumeMounts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Volumes to mount into the Step's filesystem. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.VolumeMount"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeMount"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Param", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Ref", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.StepOutputConfig", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceUsage", "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, } } @@ -4463,11 +4164,6 @@ func schema_pkg_apis_pipeline_v1beta1_StepState(ref common.ReferenceCallback) co }, }, }, - "provenance": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Provenance"), - }, - }, "inputs": { SchemaProps: spec.SchemaProps{ Type: []string{"array"}, @@ -4498,7 +4194,7 @@ func schema_pkg_apis_pipeline_v1beta1_StepState(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Artifact", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Provenance", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskRunResult", "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Artifact", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskRunResult", "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, } } @@ -4822,25 +4518,6 @@ func schema_pkg_apis_pipeline_v1beta1_TaskBreakpoints(ref common.ReferenceCallba Format: "", }, }, - "beforeSteps": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, }, }, }, @@ -4926,7 +4603,7 @@ func schema_pkg_apis_pipeline_v1beta1_TaskRef(ref common.ReferenceCallback) comm }, "bundle": { SchemaProps: spec.SchemaProps{ - Description: "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead. The field is staying there for go client backward compatibility, but is not used/allowed anymore.", + Description: "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead.", Type: []string{"string"}, Format: "", }, @@ -5432,6 +5109,7 @@ func schema_pkg_apis_pipeline_v1beta1_TaskRunResult(ref common.ReferenceCallback "value": { SchemaProps: spec.SchemaProps{ Description: "Value the given value of the result", + Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamValue"), }, }, @@ -6619,13 +6297,6 @@ func schema_pkg_apis_resolution_v1beta1_ResolutionRequestSpec(ref common.Referen }, }, }, - "url": { - SchemaProps: spec.SchemaProps{ - Description: "URL is the runtime url passed to the resolver to help it figure out how to resolver the resource being requested. This is currently at an ALPHA stability level and subject to alpha API compatibility policies.", - Type: []string{"string"}, - Format: "", - }, - }, }, }, }, diff --git a/upstream/pkg/apis/pipeline/v1beta1/param_types_test.go b/upstream/pkg/apis/pipeline/v1beta1/param_types_test.go index 244bd27249d..8f15dae7545 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/param_types_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/param_types_test.go @@ -307,6 +307,7 @@ type ParamValuesHolder struct { AOrS v1beta1.ParamValue `json:"val"` } +//nolint:musttag func TestParamValues_UnmarshalJSON(t *testing.T) { cases := []struct { input map[string]interface{} @@ -397,6 +398,7 @@ func TestParamValues_UnmarshalJSON_Directly(t *testing.T) { } } +//nolint:musttag func TestParamValues_UnmarshalJSON_Error(t *testing.T) { cases := []struct { desc string @@ -414,6 +416,7 @@ func TestParamValues_UnmarshalJSON_Error(t *testing.T) { } } +//nolint:musttag func TestParamValues_MarshalJSON(t *testing.T) { cases := []struct { input v1beta1.ParamValue @@ -451,7 +454,7 @@ func TestArrayReference(t *testing.T) { }} for _, tt := range tests { if d := cmp.Diff(tt.expectedResult, v1beta1.ArrayReference(tt.p)); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -482,7 +485,7 @@ func TestArrayOrString(t *testing.T) { } if d := cmp.Diff(tt.expected, expected); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -529,7 +532,7 @@ func TestExtractNames(t *testing.T) { }} for _, tt := range tests { if d := cmp.Diff(tt.want, v1beta1.Params.ExtractNames(tt.params)); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -592,7 +595,7 @@ func TestParams_ReplaceVariables(t *testing.T) { t.Run(tt.name, func(t *testing.T) { got := tt.ps.ReplaceVariables(tt.stringReplacements, tt.arrayReplacements, tt.objectReplacements) if d := cmp.Diff(tt.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipeline_types_test.go b/upstream/pkg/apis/pipeline/v1beta1/pipeline_types_test.go index 7d9c130ac7b..d0dc19b4cdf 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipeline_types_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipeline_types_test.go @@ -86,7 +86,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskContinue, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "valid PipelineTask with onError:stopAndFail", p: PipelineTask{ @@ -94,7 +94,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskStopAndFail, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "invalid OnError value", p: PipelineTask{ @@ -103,7 +103,7 @@ func TestPipelineTask_OnError(t *testing.T) { TaskRef: &TaskRef{Name: "foo"}, }, expectedError: apis.ErrInvalidValue("invalid-val", "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\""), - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "OnError:stopAndFail and retries coexist - success", p: PipelineTask{ @@ -112,7 +112,7 @@ func TestPipelineTask_OnError(t *testing.T) { Retries: 1, TaskRef: &TaskRef{Name: "foo"}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }, { name: "OnError:continue and retries coexists - failure", p: PipelineTask{ @@ -122,6 +122,15 @@ func TestPipelineTask_OnError(t *testing.T) { TaskRef: &TaskRef{Name: "foo"}, }, expectedError: apis.ErrGeneric("PipelineTask OnError cannot be set to \"continue\" when Retries is greater than 0"), + wc: cfgtesting.EnableAlphaAPIFields, + }, { + name: "setting OnError in beta API version - failure", + p: PipelineTask{ + Name: "foo", + OnError: PipelineTaskContinue, + TaskRef: &TaskRef{Name: "foo"}, + }, + expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"beta\""), wc: cfgtesting.EnableBetaAPIFields, }, { name: "setting OnError in stable API version - failure", @@ -130,7 +139,7 @@ func TestPipelineTask_OnError(t *testing.T) { OnError: PipelineTaskContinue, TaskRef: &TaskRef{Name: "foo"}, }, - expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), + expectedError: apis.ErrGeneric("OnError requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), wc: cfgtesting.EnableStableAPIFields, }} for _, tt := range tests { @@ -497,6 +506,39 @@ func TestPipelineTask_ValidateCustomTask(t *testing.T) { } } +func TestPipelineTask_ValidateBundle_Failure(t *testing.T) { + tests := []struct { + name string + p PipelineTask + expectedError apis.FieldError + }{{ + name: "bundle - invalid reference", + p: PipelineTask{ + Name: "foo", + TaskRef: &TaskRef{Name: "bar", Bundle: "invalid reference"}, + }, + expectedError: *apis.ErrInvalidValue("invalid bundle reference (could not parse reference: invalid reference)", "taskRef.bundle"), + }, { + name: "bundle - missing taskRef name", + p: PipelineTask{ + Name: "foo", + TaskRef: &TaskRef{Bundle: "valid-bundle"}, + }, + expectedError: *apis.ErrMissingField("taskRef.name"), + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.p.validateBundle() + if err == nil { + t.Error("PipelineTask.ValidateBundles() did not return error for invalid bundle in a pipelineTask") + } + if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { + t.Errorf("Pipeline.ValidateBundles() errors diff %s", diff.PrintWantGot(d)) + } + }) + } +} + func TestPipelineTask_ValidateRegularTask_Success(t *testing.T) { tests := []struct { name string @@ -551,6 +593,13 @@ func TestPipelineTask_ValidateRegularTask_Success(t *testing.T) { TaskRef: &TaskRef{ResolverRef: ResolverRef{Resolver: "bar", Params: Params{}}}, }, configMap: map[string]string{"enable-api-fields": "beta"}, + }, { + name: "pipeline task - use of bundle with the feature flag set", + tasks: PipelineTask{ + Name: "foo", + TaskRef: &TaskRef{Name: "bar", Bundle: "docker.io/foo"}, + }, + configMap: map[string]string{"enable-tekton-oci-bundles": "true"}, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -568,7 +617,6 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { name string task PipelineTask expectedError apis.FieldError - configMap map[string]string }{{ name: "pipeline task - invalid taskSpec", task: PipelineTask{ @@ -600,58 +648,22 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { Paths: []string{"taskRef.name"}, }, }, { - name: "pipeline task - taskRef with resolver and k8s style name", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "foo", ResolverRef: ResolverRef{Resolver: "git"}}, - }, - expectedError: apis.FieldError{ - Message: `invalid value: invalid URI for request`, - Paths: []string{"taskRef.name"}, - }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, - }, { - name: "pipeline task - taskRef with url-like name without enable-concise-resolver-syntax", + name: "pipeline task - use of bundle without the feature flag set", task: PipelineTask{ Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar"}, + TaskRef: &TaskRef{Name: "bar", Bundle: "docker.io/foo"}, }, - expectedError: *apis.ErrMissingField("taskRef.resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - Paths: []string{"taskRef"}, - }), + expectedError: *apis.ErrGeneric("bundle requires \"enable-tekton-oci-bundles\" feature gate to be true but it is false"), }, { - name: "pipeline task - taskRef without enable-concise-resolver-syntax", + name: "pipeline task - taskRef with resolver and name", task: PipelineTask{ Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar", ResolverRef: ResolverRef{Resolver: "git"}}, - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - Paths: []string{"taskRef"}, - }, - }, { - name: "pipeline task - taskRef with url-like name without resolver", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo.com/bar"}, - }, - expectedError: apis.FieldError{ - Message: `missing field(s)`, - Paths: []string{"taskRef.resolver"}, - }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, - }, { - name: "pipeline task - taskRef with name and params", - task: PipelineTask{ - Name: "foo", - TaskRef: &TaskRef{Name: "https://foo/bar", ResolverRef: ResolverRef{Resolver: "git", Params: Params{{Name: "foo", Value: ParamValue{StringVal: "bar"}}}}}, + TaskRef: &TaskRef{Name: "foo", ResolverRef: ResolverRef{Resolver: "git"}}, }, expectedError: apis.FieldError{ Message: `expected exactly one, got both`, - Paths: []string{"taskRef.name", "taskRef.params"}, + Paths: []string{"taskRef.name", "taskRef.resolver"}, }, - configMap: map[string]string{"enable-concise-resolver-syntax": "true"}, }, { name: "pipeline task - taskRef with resolver params but no resolver", task: PipelineTask{ @@ -665,8 +677,7 @@ func TestPipelineTask_ValidateRegularTask_Failure(t *testing.T) { }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ctx := cfgtesting.SetFeatureFlags(context.Background(), t, tt.configMap) - err := tt.task.validateTask(ctx) + err := tt.task.validateTask(context.Background()) if err == nil { t.Error("PipelineTask.validateTask() did not return error for invalid pipeline task") } @@ -698,8 +709,7 @@ func TestPipelineTask_Validate_Failure(t *testing.T) { p: PipelineTask{Name: "foo", TaskSpec: &EmbeddedTask{ TypeMeta: runtime.TypeMeta{ APIVersion: "example.com", - }, - }}, + }}}, expectedError: *apis.ErrInvalidValue("custom task spec must specify kind", "taskSpec.kind"), }, { name: "custom task reference in taskref missing apiversion", @@ -710,9 +720,19 @@ func TestPipelineTask_Validate_Failure(t *testing.T) { p: PipelineTask{Name: "foo", TaskSpec: &EmbeddedTask{ TypeMeta: runtime.TypeMeta{ Kind: "Example", - }, - }}, + }}}, expectedError: *apis.ErrInvalidValue("custom task spec must specify apiVersion", "taskSpec.apiVersion"), + }, { + name: "invalid bundle without bundle name", + p: PipelineTask{ + Name: "invalid-bundle", + TaskRef: &TaskRef{Bundle: "bundle"}, + }, + expectedError: apis.FieldError{ + Message: `missing field(s)`, + Paths: []string{"taskRef.name"}, + }, + wc: enableFeatures(t, []string{"enable-tekton-oci-bundles"}), }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -768,44 +788,35 @@ func TestPipelineTaskList_Deps(t *testing.T) { }, }, { name: "valid pipeline with Task Results deps", - tasks: []PipelineTask{ - { - Name: "task-1", - }, { - Name: "task-2", - Params: Params{ - { - Value: ParamValue{ - Type: "string", - StringVal: "$(tasks.task-1.results.result)", - }, - }, - }, - }, + tasks: []PipelineTask{{ + Name: "task-1", + }, { + Name: "task-2", + Params: Params{{ + Value: ParamValue{ + Type: "string", + StringVal: "$(tasks.task-1.results.result)", + }}, + }}, }, expectedDeps: map[string][]string{ "task-2": {"task-1"}, }, }, { name: "valid pipeline with Task Results in Matrix deps", - tasks: []PipelineTask{ - { - Name: "task-1", - }, { - Name: "task-2", - Matrix: &Matrix{ - Params: Params{ - { - Value: ParamValue{ - Type: ParamTypeArray, - ArrayVal: []string{ - "$(tasks.task-1.results.result)", - }, - }, + tasks: []PipelineTask{{ + Name: "task-1", + }, { + Name: "task-2", + Matrix: &Matrix{ + Params: Params{{ + Value: ParamValue{ + Type: ParamTypeArray, + ArrayVal: []string{ + "$(tasks.task-1.results.result)", }, - }, - }, - }, + }}, + }}}, }, expectedDeps: map[string][]string{ "task-2": {"task-1"}, @@ -843,38 +854,67 @@ func TestPipelineTaskList_Validate(t *testing.T) { expectedError *apis.FieldError wc func(context.Context) context.Context }{{ - name: "validate all valid custom task, and regular task", + name: "validate all three valid custom task, bundle, and regular task", tasks: PipelineTaskList{{ Name: "valid-custom-task", TaskRef: &TaskRef{APIVersion: "example.com", Kind: "custom"}, + }, { + Name: "valid-bundle", + TaskRef: &TaskRef{Bundle: "bundle", Name: "bundle"}, }, { Name: "valid-task", TaskRef: &TaskRef{Name: "task"}, }}, path: "tasks", + wc: enableFeatures(t, []string{"enable-tekton-oci-bundles"}), }, { - name: "validate list of tasks with valid custom task and invalid regular task", + name: "validate list of tasks with valid custom task and bundle but invalid regular task", tasks: PipelineTaskList{{ Name: "valid-custom-task", TaskRef: &TaskRef{APIVersion: "example.com", Kind: "custom"}, + }, { + Name: "valid-bundle", + TaskRef: &TaskRef{Bundle: "bundle", Name: "bundle"}, }, { Name: "invalid-task-without-name", TaskRef: &TaskRef{Name: ""}, }}, path: "tasks", - expectedError: apis.ErrGeneric(`missing field(s)`, "tasks[1].taskRef.name"), + expectedError: apis.ErrGeneric(`missing field(s)`, "tasks[2].taskRef.name"), + wc: enableFeatures(t, []string{"enable-tekton-oci-bundles"}), + }, { + name: "validate list of tasks with valid custom task but invalid bundle and invalid regular task", + tasks: PipelineTaskList{{ + Name: "valid-custom-task", + TaskRef: &TaskRef{APIVersion: "example.com", Kind: "custom"}, + }, { + Name: "invalid-bundle", + TaskRef: &TaskRef{Bundle: "bundle"}, + }, { + Name: "invalid-task-without-name", + TaskRef: &TaskRef{Name: ""}, + }}, + path: "tasks", + expectedError: apis.ErrGeneric(`missing field(s)`, "tasks[2].taskRef.name").Also( + apis.ErrGeneric(`missing field(s)`, "tasks[1].taskRef.name")), + wc: enableFeatures(t, []string{"enable-tekton-oci-bundles"}), }, { - name: "validate all invalid tasks - custom task and regular task", + name: "validate all three invalid tasks - custom task, bundle and regular task", tasks: PipelineTaskList{{ Name: "invalid-custom-task", TaskRef: &TaskRef{APIVersion: "example.com"}, + }, { + Name: "invalid-bundle", + TaskRef: &TaskRef{Bundle: "bundle"}, }, { Name: "invalid-task", TaskRef: &TaskRef{Name: ""}, }}, path: "tasks", - expectedError: apis.ErrGeneric(`missing field(s)`, "tasks[1].taskRef.name").Also( + expectedError: apis.ErrGeneric(`missing field(s)`, "tasks[2].taskRef.name").Also( + apis.ErrGeneric(`missing field(s)`, "tasks[1].taskRef.name")).Also( apis.ErrGeneric(`invalid value: custom task ref must specify kind`, "tasks[0].taskRef.kind")), + wc: enableFeatures(t, []string{"enable-tekton-oci-bundles"}), }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -907,8 +947,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, }}, @@ -919,15 +958,12 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { pt: &PipelineTask{ Name: "task", Matrix: &Matrix{ - Include: IncludeParamsList{ - { - Name: "duplicate-param", - Params: Params{{ - Name: "duplicate", Value: ParamValue{Type: ParamTypeString, StringVal: "foo"}, - }}, - }, - }, - }, + Include: IncludeParamsList{{ + Name: "duplicate-param", + Params: Params{{ + Name: "duplicate", Value: ParamValue{Type: ParamTypeString, StringVal: "foo"}, + }}}, + }}, Params: Params{{ Name: "duplicate", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, }}, @@ -942,8 +978,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, }, { Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo-1", "bar-1"}}, - }}, - }, + }}}, }, wantErrs: &apis.FieldError{ Message: `parameter names must be unique, the parameter "foobar" is also defined at`, @@ -956,8 +991,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "barfoo", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"bar", "foo"}}, }}, @@ -967,17 +1001,14 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { pt: &PipelineTask{ Name: "task", Matrix: &Matrix{ - Include: IncludeParamsList{ - { - Name: "invalid-include", - Params: Params{{ - Name: "foobar", Value: ParamValue{Type: ParamTypeString, StringVal: "foo"}, - }, { - Name: "foobar", Value: ParamValue{Type: ParamTypeString, StringVal: "foo-1"}, - }}, - }, - }, - }, + Include: IncludeParamsList{{ + Name: "invalid-include", + Params: Params{{ + Name: "foobar", Value: ParamValue{Type: ParamTypeString, StringVal: "foo"}, + }, { + Name: "foobar", Value: ParamValue{Type: ParamTypeString, StringVal: "foo-1"}, + }}}, + }}, }, wantErrs: &apis.FieldError{ Message: `parameter names must be unique, the parameter "foobar" is also defined at`, @@ -997,8 +1028,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Name: "foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.foobar[*])"}, }, { Name: "bar", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.barfoo[*])"}, - }}, - }, + }}}, }, }, { name: "parameters in matrix contain result references", @@ -1007,8 +1037,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.foo-task.results.a-result)"}}, - }}, - }, + }}}, }, }, { name: "count of combinations of parameters in the matrix exceeds the maximum", @@ -1019,8 +1048,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac", "windows"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "firefox", "safari"}}, - }}, - }, + }}}, }, wantErrs: &apis.FieldError{ Message: "expected 0 <= 9 <= 4", @@ -1035,8 +1063,7 @@ func TestPipelineTask_ValidateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "firefox"}}, - }}, - }, + }}}, }, }, { name: "valid matrix emitting string results consumed in aggregate by another pipelineTask", @@ -1209,8 +1236,7 @@ func TestPipelineTask_IsMatrixed(t *testing.T) { }, }, expected: true, - }, - { + }, { name: "matrixed with include", arg: arg{ Matrix: &Matrix{ @@ -1219,14 +1245,12 @@ func TestPipelineTask_IsMatrixed(t *testing.T) { Params: Params{{ Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-1"}, }, { - Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile1"}, - }}, + Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile1"}}}, }}, }, }, expected: true, - }, - { + }, { name: "matrixed with params and include", arg: arg{ Matrix: &Matrix{ @@ -1236,8 +1260,7 @@ func TestPipelineTask_IsMatrixed(t *testing.T) { Include: IncludeParamsList{{ Name: "common-package", Params: Params{{ - Name: "package", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/common/package/"}, - }}, + Name: "package", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/common/package/"}}}, }}, }, }, @@ -1262,37 +1285,36 @@ func TestEmbeddedTask_IsCustomTask(t *testing.T) { name string et *EmbeddedTask want bool - }{ - { - name: "not a custom task - APIVersion and Kind are not set", - et: &EmbeddedTask{}, - want: false, - }, { - name: "not a custom task - APIVersion is not set", - et: &EmbeddedTask{ - TypeMeta: runtime.TypeMeta{ - Kind: "Example", - }, + }{{ + name: "not a custom task - APIVersion and Kind are not set", + et: &EmbeddedTask{}, + want: false, + }, { + name: "not a custom task - APIVersion is not set", + et: &EmbeddedTask{ + TypeMeta: runtime.TypeMeta{ + Kind: "Example", }, - want: false, - }, { - name: "not a custom task - Kind is not set", - et: &EmbeddedTask{ - TypeMeta: runtime.TypeMeta{ - APIVersion: "example/v0", - }, + }, + want: false, + }, { + name: "not a custom task - Kind is not set", + et: &EmbeddedTask{ + TypeMeta: runtime.TypeMeta{ + APIVersion: "example/v0", }, - want: false, - }, { - name: "custom task - APIVersion and Kind are set", - et: &EmbeddedTask{ - TypeMeta: runtime.TypeMeta{ - Kind: "Example", - APIVersion: "example/v0", - }, + }, + want: false, + }, { + name: "custom task - APIVersion and Kind are set", + et: &EmbeddedTask{ + TypeMeta: runtime.TypeMeta{ + Kind: "Example", + APIVersion: "example/v0", }, - want: true, }, + want: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1312,8 +1334,7 @@ func TestPipelineChecksum(t *testing.T) { pipeline: &Pipeline{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1beta1", - Kind: "Pipeline", - }, + Kind: "Pipeline"}, ObjectMeta: metav1.ObjectMeta{ Name: "pipeline", Namespace: "pipeline-ns", @@ -1328,8 +1349,7 @@ func TestPipelineChecksum(t *testing.T) { pipeline: &Pipeline{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1beta1", - Kind: "Pipeline", - }, + Kind: "Pipeline"}, ObjectMeta: metav1.ObjectMeta{ Name: "pipeline", Namespace: "pipeline-ns", diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation.go b/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation.go index 8f8d6a1f002..f1c34eee5e5 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/tektoncd/pipeline/internal/artifactref" + "github.com/google/go-containerregistry/pkg/name" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/validate" "github.com/tektoncd/pipeline/pkg/internal/resultref" @@ -92,7 +92,6 @@ func (ps *PipelineSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateTasksAndFinallySection(ps)) errs = errs.Also(validateFinalTasks(ps.Tasks, ps.Finally)) errs = errs.Also(validateWhenExpressions(ctx, ps.Tasks, ps.Finally)) - errs = errs.Also(validateArtifactReference(ctx, ps.Tasks, ps.Finally)) errs = errs.Also(validateMatrix(ctx, ps.Tasks).ViaField("tasks")) errs = errs.Also(validateMatrix(ctx, ps.Finally).ViaField("finally")) return errs @@ -154,10 +153,10 @@ func (l PipelineTaskList) Validate(ctx context.Context, taskNames sets.String, p } // validateUsageOfDeclaredPipelineTaskParameters validates that all parameters referenced in the pipeline Task are declared by the pipeline Task. -func (l PipelineTaskList) validateUsageOfDeclaredPipelineTaskParameters(ctx context.Context, additionalParams []ParamSpec, path string) (errs *apis.FieldError) { +func (l PipelineTaskList) validateUsageOfDeclaredPipelineTaskParameters(ctx context.Context, path string) (errs *apis.FieldError) { for i, t := range l { if t.TaskSpec != nil { - errs = errs.Also(ValidateUsageOfDeclaredParameters(ctx, t.TaskSpec.Steps, append(t.TaskSpec.Params, additionalParams...)).ViaFieldIndex(path, i)) + errs = errs.Also(ValidateUsageOfDeclaredParameters(ctx, t.TaskSpec.Steps, t.TaskSpec.Params).ViaFieldIndex(path, i)) } } return errs @@ -197,7 +196,7 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) { } if pt.OnError != "" { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.BetaAPIFields)) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "OnError", config.AlphaAPIFields)) if pt.OnError != PipelineTaskContinue && pt.OnError != PipelineTaskStopAndFail { errs = errs.Also(apis.ErrInvalidValue(pt.OnError, "OnError", "PipelineTask OnError must be either \"continue\" or \"stopAndFail\"")) } @@ -206,6 +205,7 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) { } } + cfg := config.FromContextOrDefaults(ctx) // Pipeline task having taskRef/taskSpec with APIVersion is classified as custom task switch { case pt.TaskRef != nil && !taskKinds[pt.TaskRef.Kind]: @@ -216,6 +216,9 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(pt.validateCustomTask()) case pt.TaskSpec != nil && pt.TaskSpec.APIVersion != "": errs = errs.Also(pt.validateCustomTask()) + // If EnableTektonOCIBundles feature flag is on, validate bundle specifications + case cfg.FeatureFlags.EnableTektonOCIBundles && pt.TaskRef != nil && pt.TaskRef.Bundle != "": + errs = errs.Also(pt.validateBundle()) default: errs = errs.Also(pt.validateTask(ctx)) } @@ -353,6 +356,21 @@ func (pt PipelineTask) validateCustomTask() (errs *apis.FieldError) { return errs } +// validateBundle validates bundle specifications - checking name and bundle +func (pt PipelineTask) validateBundle() (errs *apis.FieldError) { + // bundle requires a TaskRef to be specified + if (pt.TaskRef != nil && pt.TaskRef.Bundle != "") && pt.TaskRef.Name == "" { + errs = errs.Also(apis.ErrMissingField("taskRef.name")) + } + // If a bundle url is specified, ensure it is parsable + if pt.TaskRef != nil && pt.TaskRef.Bundle != "" { + if _, err := name.ParseReference(pt.TaskRef.Bundle); err != nil { + errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("invalid bundle reference (%s)", err.Error()), "taskRef.bundle")) + } + } + return errs +} + // validateTask validates a pipeline task or a final task for taskRef and taskSpec func (pt PipelineTask) validateTask(ctx context.Context) (errs *apis.FieldError) { if pt.TaskSpec != nil { @@ -385,8 +403,8 @@ func validatePipelineWorkspacesDeclarations(wss []PipelineWorkspaceDeclaration) // validatePipelineParameterUsage validates that parameters referenced in the Pipeline are declared by the Pipeline func (ps *PipelineSpec) validatePipelineParameterUsage(ctx context.Context) (errs *apis.FieldError) { - errs = errs.Also(PipelineTaskList(ps.Tasks).validateUsageOfDeclaredPipelineTaskParameters(ctx, ps.Params, "tasks")) - errs = errs.Also(PipelineTaskList(ps.Finally).validateUsageOfDeclaredPipelineTaskParameters(ctx, ps.Params, "finally")) + errs = errs.Also(PipelineTaskList(ps.Tasks).validateUsageOfDeclaredPipelineTaskParameters(ctx, "tasks")) + errs = errs.Also(PipelineTaskList(ps.Finally).validateUsageOfDeclaredPipelineTaskParameters(ctx, "finally")) errs = errs.Also(validatePipelineTaskParameterUsage(ps.Tasks, ps.Params).ViaField("tasks")) errs = errs.Also(validatePipelineTaskParameterUsage(ps.Finally, ps.Params).ViaField("finally")) return errs @@ -495,13 +513,9 @@ func (pt *PipelineTask) extractAllParams() Params { return allParams } -// containsExecutionStatusRef checks if a specified param has a reference to execution status or reason -// $(tasks..status), $(tasks.status), or $(tasks..reason) func containsExecutionStatusRef(p string) bool { - if strings.HasPrefix(p, "tasks.") { - if strings.HasSuffix(p, ".status") || strings.HasSuffix(p, ".reason") { - return true - } + if strings.HasPrefix(p, "tasks.") && strings.HasSuffix(p, ".status") { + return true } return false } @@ -592,17 +606,10 @@ func validateExecutionStatusVariablesExpressions(expressions []string, ptNames s if expression == PipelineTasksAggregateStatus { continue } - // check if it contains context variable accessing execution status - $(tasks.taskname.status) | $(tasks.taskname.reason) + // check if it contains context variable accessing execution status - $(tasks.taskname.status) if containsExecutionStatusRef(expression) { - var pt string - if strings.HasSuffix(expression, ".status") { - // strip tasks. and .status from tasks.taskname.status to further verify task name - pt = strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".status") - } - if strings.HasSuffix(expression, ".reason") { - // strip tasks. and .reason from tasks.taskname.reason to further verify task name - pt = strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".reason") - } + // strip tasks. and .status from tasks.taskname.status to further verify task name + pt := strings.TrimSuffix(strings.TrimPrefix(expression, "tasks."), ".status") // report an error if the task name does not exist in the list of dag tasks if !ptNames.Has(pt) { errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("pipeline task %s is not defined in the pipeline", pt), fieldPath)) @@ -879,28 +886,6 @@ func validateStringResults(results []TaskResult, resultName string) (errs *apis. return errs } -// validateArtifactReference ensure that the feature flag enableArtifacts is set to true when using artifacts -func validateArtifactReference(ctx context.Context, tasks []PipelineTask, finalTasks []PipelineTask) (errs *apis.FieldError) { - if config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { - return errs - } - for i, t := range tasks { - for _, v := range t.Params.extractValues() { - if len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(v, -1)) > 0 { - return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "").ViaField("params").ViaFieldIndex("tasks", i)) - } - } - } - for i, t := range finalTasks { - for _, v := range t.Params.extractValues() { - if len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(v, -1)) > 0 { - return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "").ViaField("params").ViaFieldIndex("finally", i)) - } - } - } - return errs -} - // GetIndexingReferencesToArrayParams returns all strings referencing indices of PipelineRun array parameters // from parameters, workspaces, and when expressions defined in the Pipeline's Tasks and Finally Tasks. // For example, if a Task in the Pipeline has a parameter with a value "$(params.array-param-name[1])", diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go index 8faf62c9182..adb5810009b 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go @@ -25,11 +25,13 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" "github.com/tektoncd/pipeline/test/diff" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/util/sets" "knative.dev/pkg/apis" + logtesting "knative.dev/pkg/logging/testing" ) func TestPipeline_Validate_Success(t *testing.T) { @@ -58,8 +60,7 @@ func TestPipeline_Validate_Success(t *testing.T) { p: &Pipeline{ ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, Spec: PipelineSpec{ - Tasks: []PipelineTask{{ - Name: "foo", + Tasks: []PipelineTask{{Name: "foo", TaskSpec: &EmbeddedTask{ TypeMeta: runtime.TypeMeta{ APIVersion: "example.dev/v0", @@ -67,8 +68,7 @@ func TestPipeline_Validate_Success(t *testing.T) { }, Spec: runtime.RawExtension{ Raw: []byte(`{"field1":123,"field2":"value"}`), - }, - }, + }}, }}, }, }, @@ -116,90 +116,6 @@ func TestPipeline_Validate_Success(t *testing.T) { }, }, }, - }, { - name: "propagating params into Step", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Type: ParamTypeArray, - Default: &ParamValue{ - Type: ParamTypeArray, - ArrayVal: []string{"hello", "pipeline"}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words[*])"}, - }}, - }}, - }}, - }, - }, - }, { - name: "propagating object params with pipelinespec and taskspec", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Default: &ParamValue{ - Type: ParamTypeObject, - ObjectVal: map[string]string{"hello": "pipeline"}, - }, - Type: ParamTypeObject, - Properties: map[string]PropertySpec{ - "hello": {Type: ParamTypeString}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.pipeline-words.hello)"}, - }}, - }}, - }}, - }, - }, - }, { - name: "valid pipeline with pipeline task and final task referencing artifacts in task params with enable-artifacts flag true", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag true", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }, { - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "true", - "enable-api-fields": "alpha"}) - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -389,8 +305,7 @@ func TestPipeline_Validate_Failure(t *testing.T) { return cfgtesting.SetFeatureFlags(ctx, t, map[string]string{ "disable-inline-spec": "pipeline", - "enable-api-fields": "alpha", - }) + "enable-api-fields": "alpha"}) }, }, { name: "pipelineSpec when disable-inline-spec all", @@ -410,8 +325,7 @@ func TestPipeline_Validate_Failure(t *testing.T) { return cfgtesting.SetFeatureFlags(ctx, t, map[string]string{ "disable-inline-spec": "pipeline,taskrun,pipelinerun", - "enable-api-fields": "alpha", - }) + "enable-api-fields": "alpha"}) }, }, { name: "taskSpec when disable-inline-spec", @@ -453,78 +367,6 @@ func TestPipeline_Validate_Failure(t *testing.T) { }, }) }, - }, { - name: "propagating params with pipelinespec and taskspec", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "pipeline-words", - Type: ParamTypeArray, - Default: &ParamValue{ - Type: ParamTypeArray, - ArrayVal: []string{"hello", "pipeline"}, - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Steps: []Step{{ - Name: "echo", - Image: "ubuntu", - Command: []string{"echo"}, - Args: []string{"$(params.random-words[*])"}, - }}, - }}, - }}, - }, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.random-words[*])"`, - Paths: []string{"spec.tasks[0].steps[0].args[0]"}, - }, - }, { - name: "propagating params to taskRef", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinename", - }, - Spec: PipelineSpec{ - Params: ParamSpecs{{ - Name: "hello", - Type: ParamTypeString, - Default: &ParamValue{ - Type: ParamTypeString, - StringVal: "hi", - }, - }}, - Tasks: []PipelineTask{{ - Name: "echoit", - TaskRef: &TaskRef{ - Name: "remote-task", - }, - Params: Params{{ - Name: "param1", - Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(params.param1)", - }, - }, { - Name: "holla", - Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(params.hello)", - }, - }}, - }}, - }, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.param1)"`, - Paths: []string{"spec.tasks[0].params[param1]"}, - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1224,59 +1066,6 @@ func TestPipelineSpec_Validate_Failure(t *testing.T) { Message: `must not set the field(s)`, Paths: []string{"finally[0].taskSpec.resources"}, }, - }, { - name: "invalid pipeline with one pipeline task referencing artifacts in task params with enable-artifacts flag false", - ps: &PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag false", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }, { - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-artifacts should be set to true to use artifacts feature.`, - Paths: []string{"tasks[1].params"}, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "false", - "enable-api-fields": "alpha"}) - }, - }, { - name: "invalid pipeline with one final pipeline task referencing artifacts in params with enable-artifacts flag false", - ps: &PipelineSpec{ - Description: "this is an invalid pipeline referencing artifacts with enable-artifacts flag false", - Tasks: []PipelineTask{{ - Name: "pre-task", - TaskRef: &TaskRef{Name: "foo-task"}, - }}, - Finally: []PipelineTask{{ - Name: "consume-artifacts-task", - Params: Params{{Name: "aaa", Value: ParamValue{ - Type: ParamTypeString, - StringVal: "$(tasks.produce-artifacts-task.outputs.image)", - }}}, - TaskSpec: &EmbeddedTask{TaskSpec: getTaskSpec()}, - }}, - }, - wc: func(ctx context.Context) context.Context { - return cfgtesting.SetFeatureFlags(ctx, t, - map[string]string{ - "enable-artifacts": "false", - "enable-api-fields": "alpha"}) - }, - expectedError: apis.FieldError{ - Message: `feature flag enable-artifacts should be set to true to use artifacts feature.`, - Paths: []string{"finally[0].params"}, - }, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1496,66 +1285,64 @@ func TestFinallyTaskResultsToPipelineResults_Success(t *testing.T) { name string p *Pipeline wc func(context.Context) context.Context - }{ - { - name: "valid pipeline with pipeline results", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Results: []PipelineResult{{ - Name: "initialized", - Value: *NewStructuredValues("$(tasks.clone-app-repo.results.initialized)"), - }}, - Tasks: []PipelineTask{{ - Name: "clone-app-repo", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "initialized", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo", Image: "bar", - }}, + }{{ + name: "valid pipeline with pipeline results", + p: &Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: PipelineSpec{ + Results: []PipelineResult{{ + Name: "initialized", + Value: *NewStructuredValues("$(tasks.clone-app-repo.results.initialized)"), + }}, + Tasks: []PipelineTask{{ + Name: "clone-app-repo", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "initialized", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo", Image: "bar", }}, }}, - }, + }}, }, - }, { - name: "referencing existent finally task result", - p: &Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: PipelineSpec{ - Results: []PipelineResult{{ - Name: "initialized", - Value: *NewStructuredValues("$(finally.check-git-commit.results.init)"), - }}, - Tasks: []PipelineTask{{ - Name: "clone-app-repo", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "current-date-unix-timestamp", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo", Image: "bar", - }}, + }}, { + name: "referencing existent finally task result", + p: &Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: PipelineSpec{ + Results: []PipelineResult{{ + Name: "initialized", + Value: *NewStructuredValues("$(finally.check-git-commit.results.init)"), + }}, + Tasks: []PipelineTask{{ + Name: "clone-app-repo", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "current-date-unix-timestamp", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo", Image: "bar", }}, }}, - Finally: []PipelineTask{{ - Name: "check-git-commit", - TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ - Results: []TaskResult{{ - Name: "init", - Type: "string", - }}, - Steps: []Step{{ - Name: "foo2", Image: "bar", - }}, + }}, + Finally: []PipelineTask{{ + Name: "check-git-commit", + TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ + Results: []TaskResult{{ + Name: "init", + Type: "string", + }}, + Steps: []Step{{ + Name: "foo2", Image: "bar", }}, }}, - }, + }}, }, }, + }, } for _, tt := range tests { @@ -1799,8 +1586,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.baz)", "and", "$(params.foo-is-baz)"}}, - }}, - }, + }}}, }}, }, { name: "valid star array parameter variables in matrix", @@ -1815,8 +1601,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.baz[*])", "and", "$(params.foo-is-baz[*])"}}, - }}, - }, + }}}, }}, }, { name: "array param - using the whole variable as a param's value that is intended to be array type", @@ -1842,13 +1627,9 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Include: IncludeParamsList{{ Name: "build-1", - Params: Params{ - { - Name: "a-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.baz)"}, - }, - }, - }}, - }, + Params: Params{{ + Name: "a-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.baz)"}}, + }}}}, }}, }, { name: "object param - using single individual variable in string param", @@ -1940,8 +1721,7 @@ func TestValidatePipelineParameterVariables_Success(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.key1)", "and", "$(params.myObject.key2)"}}, - }}, - }, + }}}, }}, }, { name: "object param - using the whole variable as a param's value that is intended to be object type", @@ -2123,8 +1903,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2141,8 +1920,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.foo)", "and", "$(params.does-not-exist)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2160,9 +1938,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.foo)"}}, }, { - Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}, - }}, - }, + Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.does-not-exist)"}}}}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2183,8 +1959,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { }, { Name: "b-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(params.does-not-exist)"}, }}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.does-not-exist)"`, @@ -2323,8 +2098,7 @@ func TestValidatePipelineDeclaredParameterUsage_Failure(t *testing.T) { Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.key1)"}}, }, { Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(params.myObject.non-exist-key)"}}, - }}, - }, + }}}, }}, expectedError: apis.FieldError{ Message: `non-existent variable in "$(params.myObject.non-exist-key)"`, @@ -2352,8 +2126,7 @@ func TestValidatePipelineParameterVariables_Failure(t *testing.T) { expectedError apis.FieldError configMap map[string]string }{ - { - name: "param enum with array type - failure", + {name: "param enum with array type - failure", params: []ParamSpec{{ Name: "param2", Type: ParamTypeArray, @@ -2578,8 +2351,7 @@ func TestValidatePipelineParameterVariables_Failure(t *testing.T) { Message: `parameter names must be unique, the parameter "duplicate-param" is also defined at`, Paths: []string{"[0].params[1].name, [0].params[2].name"}, }, - }, - } + }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ctx := context.Background() @@ -3482,8 +3254,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun name", @@ -3496,8 +3267,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun namespace", @@ -3510,8 +3280,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.namespace)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineRun uid", @@ -3524,8 +3293,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.uid)"}}, - }}, - }, + }}}, }}, }, { name: "valid array context variables for Pipeline and PipelineRun names", @@ -3538,8 +3306,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.name)", "and", "$(context.pipelineRun.name)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for PipelineTask retries", @@ -3552,8 +3319,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{StringVal: "$(context.pipelineTask.retries)"}, - }}, - }, + }}}, }}, }, { name: "valid array context variable for PipelineTask retries", @@ -3566,8 +3332,7 @@ func TestContextValid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-mat", Value: ParamValue{ArrayVal: []string{"$(context.pipelineTask.retries)"}}, - }}, - }, + }}}, }}, }, { name: "valid string context variable for Pipeline name in include params", @@ -3581,10 +3346,8 @@ func TestContextValid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.name)"}, - }}, - }}, - }, + Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.name)"}}}, + }}}, }}, }, { name: "valid string context variable for PipelineTask retries in matrix include", @@ -3598,10 +3361,8 @@ func TestContextValid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.retries)"}, - }}, - }}, - }, + Name: "a-param-mat", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.retries)"}}}, + }}}, }}, }} for _, tt := range tests { @@ -3629,8 +3390,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipeline.missing)"`, @@ -3650,8 +3410,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipelineRun.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineRun.missing)"`, @@ -3671,8 +3430,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param-foo", Value: ParamValue{ArrayVal: []string{"$(context.pipelineTask.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineTask.missing)"`, @@ -3692,8 +3450,7 @@ func TestContextInvalid(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{ArrayVal: []string{"$(context.pipeline.missing-foo)", "$(context.pipelineTask.missing-foo)", "$(context.pipelineRun.missing-foo)"}}, - }}, - }, + }}}, }}, expectedError: *apis.ErrGeneric(`non-existent variable in "$(context.pipeline.missing)"`, "value"). Also(apis.ErrGeneric(`non-existent variable in "$(context.pipelineRun.missing)"`, "value")). @@ -3710,10 +3467,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipeline.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipeline.missing)"`, @@ -3728,10 +3483,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineRun.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineRun.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineRun.missing)"`, @@ -3746,10 +3499,8 @@ func TestContextInvalid(t *testing.T) { Include: IncludeParamsList{{ Name: "build-1", Params: Params{{ - Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.missing)"}, - }}, - }}, - }, + Name: "a-param-foo", Value: ParamValue{Type: ParamTypeString, StringVal: "$(context.pipelineTask.missing)"}}}, + }}}, }}, expectedError: *apis.ErrGeneric("").Also(&apis.FieldError{ Message: `non-existent variable in "$(context.pipelineTask.missing)"`, @@ -3785,8 +3536,6 @@ func TestPipelineTasksExecutionStatus(t *testing.T) { TaskRef: &TaskRef{Name: "bar-task"}, Params: Params{{ Name: "foo-status", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.foo.status)"}, - }, { - Name: "foo-reason", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.foo.reason)"}, }, { Name: "tasks-status", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.status)"}, }}, @@ -3794,10 +3543,6 @@ func TestPipelineTasksExecutionStatus(t *testing.T) { Input: "$(tasks.foo.status)", Operator: selection.In, Values: []string{"Failure"}, - }, { - Input: "$(tasks.foo.reason)", - Operator: selection.In, - Values: []string{"Failed"}, }, { Input: "$(tasks.status)", Operator: selection.In, @@ -4035,8 +3780,7 @@ func TestMatrixIncompatibleAPIVersions(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, } tests := []struct { name string @@ -4099,8 +3843,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, }}, @@ -4114,8 +3857,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, Params: Params{{ Name: "barfoo", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"bar", "foo"}}, }}, @@ -4128,16 +3870,14 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.foo-task.results.a-result)"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, Matrix: &Matrix{ Params: Params{{ Name: "b-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.bar-task.results.b-result)"}}, - }}, - }, + }}}, }}, }, { name: "parameters in matrix contain whole array results references", @@ -4147,8 +3887,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"$(tasks.foo-task.results.a-task-results[*])"}}, - }}, - }, + }}}, }}, }, { name: "results from matrixed task consumed in tasks through parameters", @@ -4158,8 +3897,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4175,8 +3913,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }}, finally: PipelineTaskList{{ Name: "b-task", @@ -4193,8 +3930,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4217,8 +3953,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4236,8 +3971,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }}, finally: PipelineTaskList{{ Name: "b-task", @@ -4256,8 +3990,7 @@ func Test_validateMatrix(t *testing.T) { Matrix: &Matrix{ Params: Params{{ Name: "a-param", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }}, - }, + }}}, }, { Name: "b-task", TaskRef: &TaskRef{Name: "b-task"}, @@ -4286,8 +4019,7 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "echoarrayurl", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ @@ -4309,8 +4041,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4319,8 +4050,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4354,8 +4084,7 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "task-consuming-results", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ @@ -4385,16 +4114,14 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4403,8 +4130,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4437,8 +4163,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4447,24 +4172,21 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, Matrix: &Matrix{ Params: Params{{ Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4473,8 +4195,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.array-result.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.array-result.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4507,8 +4228,7 @@ func Test_validateMatrix(t *testing.T) { Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4517,24 +4237,21 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, Matrix: &Matrix{ Params: Params{{ Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "task-consuming-results", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "report-url", Type: ResultsTypeString, @@ -4543,8 +4260,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-report-url", Image: "alpine", Script: ` | - echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`, - }}, + echo -n "https://api.example/get-report/$(params.platform)-$(params.browser)" | tee $(results.report-url.path)`}}, }}, Params: Params{{ Name: "b-param", Value: ParamValue{Type: ParamTypeString, StringVal: "$(tasks.matrix-emitting-results-embedded.results.report-url[0])"}, @@ -4561,16 +4277,14 @@ func Test_validateMatrix(t *testing.T) { Name: "platform", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"linux", "mac"}}, }, { Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "safari"}}, - }}, - }, + }}}, }, { Name: "taskwithresult", TaskSpec: &EmbeddedTask{TaskSpec: TaskSpec{ Params: ParamSpecs{{ Name: "platform", }, { - Name: "browser", - }}, + Name: "browser"}}, Results: []TaskResult{{ Name: "array-result", Type: ResultsTypeArray, @@ -4579,8 +4293,7 @@ func Test_validateMatrix(t *testing.T) { Name: "produce-array-result", Image: "alpine", Script: ` | - echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`, - }}, + echo -n "[\"${params.platform}\",\"${params.browser}\"]" | tee $(results.array-result.path)`}}, }}, }, { Name: "task-consuming-results", @@ -4620,6 +4333,22 @@ func getTaskSpec() TaskSpec { } } +func enableFeatures(t *testing.T, features []string) func(context.Context) context.Context { + t.Helper() + return func(ctx context.Context) context.Context { + s := config.NewStore(logtesting.TestLogger(t)) + data := make(map[string]string) + for _, f := range features { + data[f] = "true" + } + s.OnConfigChanged(&corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName()}, + Data: data, + }) + return s.ToContext(ctx) + } +} + // TestPipelineWithBetaFields tests the beta API-driven features of // PipelineSpec are correctly governed `enable-api-fields`, which must // be set to "alpha" or "beta". @@ -4689,144 +4418,144 @@ func TestGetIndexingReferencesToArrayParams(t *testing.T) { name string spec PipelineSpec want sets.String - }{ - { - name: "references in task params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeString}, - }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[1])")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("$(params.second-param[0])")}, - {Name: "first-task-third-param", Value: *NewStructuredValues("static value")}, - }, - }}, + }{{ + name: "references in task params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeString}, }, - want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), - }, { - name: "references in when expression", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeString}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[1])")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("$(params.second-param[0])")}, + {Name: "first-task-third-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - WhenExpressions: []WhenExpression{{ - Input: "$(params.first-param[1])", - Operator: selection.In, - Values: []string{"$(params.second-param[0])"}, - }}, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), + }, { + name: "references in when expression", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeString}, }, - want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), - }, { - name: "nested references in task params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(input.workspace.$(params.first-param[0]))")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("$(input.workspace.$(params.second-param[1]))")}, - }, + Tasks: []PipelineTask{{ + WhenExpressions: []WhenExpression{{ + Input: "$(params.first-param[1])", + Operator: selection.In, + Values: []string{"$(params.second-param[0])"}, }}, + }}, + }, + want: sets.NewString("$(params.first-param[1])", "$(params.second-param[0])"), + }, { + name: "nested references in task params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "array parameter", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default", "array", "value")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(input.workspace.$(params.first-param[0]))")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("$(input.workspace.$(params.second-param[1]))")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("firstelement", "$(params.first-param)")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("firstelement", "$(params.second-param[0])")}, - }, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "array parameter", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default", "array", "value")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.second-param[0])"), - }, { - name: "references in finally params", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("firstelement", "$(params.first-param)")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("firstelement", "$(params.second-param[0])")}, }, - Finally: []PipelineTask{{ - Params: Params{ - {Name: "final-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, - {Name: "final-task-second-param", Value: *NewStructuredValues("$(params.second-param[1])")}, - }, - }}, + }}, + }, + want: sets.NewString("$(params.second-param[0])"), + }, { + name: "references in finally params", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "references in finally when expressions", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Finally: []PipelineTask{{ + Params: Params{ + {Name: "final-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, + {Name: "final-task-second-param", Value: *NewStructuredValues("$(params.second-param[1])")}, }, - Finally: []PipelineTask{{ - WhenExpressions: WhenExpressions{{ - Input: "$(params.first-param[0])", - Operator: selection.In, - Values: []string{"$(params.second-param[1])"}, - }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "references in finally when expressions", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, + }, + Finally: []PipelineTask{{ + WhenExpressions: WhenExpressions{{ + Input: "$(params.first-param[0])", + Operator: selection.In, + Values: []string{"$(params.second-param[1])"}, }}, + }}, + }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, { + name: "parameter references with bracket notation and special characters", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second/param", Type: ParamTypeArray}, + {Name: "third.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "fourth/param", Type: ParamTypeArray}, }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), - }, { - name: "parameter references with bracket notation and special characters", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second/param", Type: ParamTypeArray}, - {Name: "third.param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "fourth/param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, + {Name: "first-task-second-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, + {Name: "first-task-third-param", Value: *NewStructuredValues(`$(params['third.param'][1])`)}, + {Name: "first-task-fourth-param", Value: *NewStructuredValues(`$(params['fourth/param'][1])`)}, + {Name: "first-task-fifth-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, - {Name: "first-task-second-param", Value: *NewStructuredValues(`$(params["first.param"][0])`)}, - {Name: "first-task-third-param", Value: *NewStructuredValues(`$(params['third.param'][1])`)}, - {Name: "first-task-fourth-param", Value: *NewStructuredValues(`$(params['fourth/param'][1])`)}, - {Name: "first-task-fifth-param", Value: *NewStructuredValues("static value")}, - }, - }}, + }}, + }, + want: sets.NewString(`$(params["first.param"][0])`, `$(params["first.param"][0])`, `$(params['third.param'][1])`, `$(params['fourth/param'][1])`), + }, { + name: "single parameter in workspace subpath", + spec: PipelineSpec{ + Params: []ParamSpec{ + {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, + {Name: "second-param", Type: ParamTypeArray}, }, - want: sets.NewString(`$(params["first.param"][0])`, `$(params["first.param"][0])`, `$(params['third.param'][1])`, `$(params['fourth/param'][1])`), - }, { - name: "single parameter in workspace subpath", - spec: PipelineSpec{ - Params: []ParamSpec{ - {Name: "first-param", Type: ParamTypeArray, Default: NewStructuredValues("default-value", "default-value-again")}, - {Name: "second-param", Type: ParamTypeArray}, + Tasks: []PipelineTask{{ + Params: Params{ + {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, + {Name: "first-task-second-param", Value: *NewStructuredValues("static value")}, }, - Tasks: []PipelineTask{{ - Params: Params{ - {Name: "first-task-first-param", Value: *NewStructuredValues("$(params.first-param[0])")}, - {Name: "first-task-second-param", Value: *NewStructuredValues("static value")}, - }, - Workspaces: []WorkspacePipelineTaskBinding{ - { - Name: "first-workspace", - Workspace: "first-workspace", - SubPath: "$(params.second-param[1])", - }, + Workspaces: []WorkspacePipelineTaskBinding{ + { + Name: "first-workspace", + Workspace: "first-workspace", + SubPath: "$(params.second-param[1])", }, - }}, - }, - want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, + }}, }, + want: sets.NewString("$(params.first-param[0])", "$(params.second-param[1])"), + }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() got := tt.spec.GetIndexingReferencesToArrayParams() diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_conversion.go index efa399b6b85..ae794c8b738 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_conversion.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_conversion.go @@ -23,11 +23,14 @@ import ( ) func (pr PipelineRef) convertTo(ctx context.Context, sink *v1.PipelineRef) { - sink.Name = pr.Name + if pr.Bundle == "" { + sink.Name = pr.Name + } sink.APIVersion = pr.APIVersion new := v1.ResolverRef{} pr.ResolverRef.convertTo(ctx, &new) sink.ResolverRef = new + pr.convertBundleToResolver(sink) } func (pr *PipelineRef) convertFrom(ctx context.Context, source v1.PipelineRef) { @@ -37,3 +40,24 @@ func (pr *PipelineRef) convertFrom(ctx context.Context, source v1.PipelineRef) { new.convertFrom(ctx, source.ResolverRef) pr.ResolverRef = new } + +// convertBundleToResolver converts v1beta1 bundle string to a remote reference with the bundle resolver in v1. +// The conversion from Resolver to Bundle is not being supported since remote resolution would be turned on by +// default and it will be in beta before the stored version of CRD getting swapped to v1. +func (pr PipelineRef) convertBundleToResolver(sink *v1.PipelineRef) { + if pr.Bundle != "" { + sink.ResolverRef = v1.ResolverRef{ + Resolver: "bundles", + Params: v1.Params{{ + Name: "bundle", + Value: v1.ParamValue{StringVal: pr.Bundle, Type: v1.ParamTypeString}, + }, { + Name: "name", + Value: v1.ParamValue{StringVal: pr.Name, Type: v1.ParamTypeString}, + }, { + Name: "kind", + Value: v1.ParamValue{StringVal: "Pipeline", Type: v1.ParamTypeString}, + }}, + } + } +} diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_types.go b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_types.go index cf83442be63..ab943a3242f 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_types.go @@ -23,11 +23,9 @@ type PipelineRef struct { // API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty"` - // Bundle url reference to a Tekton Bundle. // // Deprecated: Please use ResolverRef with the bundles resolver instead. - // The field is staying there for go client backward compatibility, but is not used/allowed anymore. // +optional Bundle string `json:"bundle,omitempty"` diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation.go b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation.go index efe352d6371..a0b7e02f18b 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation.go @@ -19,10 +19,9 @@ package v1beta1 import ( "context" "fmt" - "strings" + "github.com/google/go-containerregistry/pkg/name" "github.com/tektoncd/pipeline/pkg/apis/config" - "k8s.io/apimachinery/pkg/util/validation" "knative.dev/pkg/apis" ) @@ -32,56 +31,50 @@ func (ref *PipelineRef) Validate(ctx context.Context) (errs *apis.FieldError) { if ref == nil { return errs } - if apis.IsInCreate(ctx) && ref.Bundle != "" { - errs = errs.Also(apis.ErrDisallowedFields("bundle")) - } - switch { - case ref.Resolver != "" || ref.Params != nil: + + if ref.Resolver != "" || ref.Params != nil { + if ref.Resolver != "" { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) + } + if ref.Bundle != "" { + errs = errs.Also(apis.ErrMultipleOneOf("bundle", "resolver")) + } + } if ref.Params != nil { errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) if ref.Name != "" { errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) } + if ref.Bundle != "" { + errs = errs.Also(apis.ErrMultipleOneOf("bundle", "params")) + } if ref.Resolver == "" { errs = errs.Also(apis.ErrMissingField("resolver")) } errs = errs.Also(ValidateParameters(ctx, ref.Params)) } - if ref.Resolver != "" { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) - if ref.Name != "" { - // make sure that the name is url-like. - err := RefNameLikeUrl(ref.Name) - if err == nil && !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - // If name is url-like then concise resolver syntax must be enabled - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(err, "name")) - } - } + } else { + if ref.Name == "" { + errs = errs.Also(apis.ErrMissingField("name")) } - case ref.Name != "": - // ref name can be a Url-like format. - if err := RefNameLikeUrl(ref.Name); err == nil { - // If name is url-like then concise resolver syntax must be enabled - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - // In stage1 of concise remote resolvers syntax, this is a required field. - // TODO: remove this check when implementing stage 2 where this is optional. - if ref.Resolver == "" { - errs = errs.Also(apis.ErrMissingField("resolver")) - } - // Or, it must be a valid k8s name - } else { - // ref name must be a valid k8s name - if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { - errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) + if ref.Bundle != "" { + errs = errs.Also(validateBundleFeatureFlag(ctx, "bundle", true).ViaField("bundle")) + if _, err := name.ParseReference(ref.Bundle); err != nil { + errs = errs.Also(apis.ErrInvalidValue("invalid bundle reference", "bundle", err.Error())) } } - default: - errs = errs.Also(apis.ErrMissingField("name")) } return //nolint:nakedret } + +func validateBundleFeatureFlag(ctx context.Context, featureName string, wantValue bool) *apis.FieldError { + flagValue := config.FromContextOrDefaults(ctx).FeatureFlags.EnableTektonOCIBundles + if flagValue != wantValue { + var errs *apis.FieldError + message := fmt.Sprintf(`%s requires "enable-tekton-oci-bundles" feature gate to be %t but it is %t`, featureName, wantValue, flagValue) + return errs.Also(apis.ErrGeneric(message)) + } + return nil +} diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation_test.go index 27842341476..82549d20ca9 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelineref_validation_test.go @@ -21,10 +21,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/diff" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" + logtesting "knative.dev/pkg/logging/testing" ) func TestPipelineRef_Invalid(t *testing.T) { @@ -34,16 +38,31 @@ func TestPipelineRef_Invalid(t *testing.T) { wantErr *apis.FieldError withContext func(context.Context) context.Context }{{ + name: "use of bundle without the feature flag set", + ref: &v1beta1.PipelineRef{ + Name: "my-pipeline", + Bundle: "docker.io/foo", + }, + wantErr: apis.ErrGeneric("bundle requires \"enable-tekton-oci-bundles\" feature gate to be true but it is false"), + }, { + name: "bundle missing name", + ref: &v1beta1.PipelineRef{ + Bundle: "docker.io/foo", + }, + wantErr: apis.ErrMissingField("name"), + withContext: enableTektonOCIBundles(t), + }, { + name: "invalid bundle reference", + ref: &v1beta1.PipelineRef{ + Name: "my-pipeline", + Bundle: "not a valid reference", + }, + wantErr: apis.ErrInvalidValue("invalid bundle reference", "bundle", "could not parse reference: not a valid reference"), + withContext: enableTektonOCIBundles(t), + }, { name: "pipelineRef without Pipeline Name", ref: &v1beta1.PipelineRef{}, wantErr: apis.ErrMissingField("name"), - }, { - name: "invalid pipelineref name", - ref: &v1beta1.PipelineRef{Name: "_foo"}, - wantErr: &apis.FieldError{ - Message: `invalid value: name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')`, - Paths: []string{"name"}, - }, }, { name: "pipelineref resolver disallowed without beta feature gate", ref: &v1beta1.PipelineRef{ @@ -72,45 +91,57 @@ func TestPipelineRef_Invalid(t *testing.T) { wantErr: apis.ErrMissingField("resolver"), withContext: cfgtesting.EnableBetaAPIFields, }, { - name: "pipelineRef with resolver and k8s style name", + name: "pipelineref resolver disallowed in conjunction with pipelineref name", ref: &v1beta1.PipelineRef{ Name: "foo", ResolverRef: v1beta1.ResolverRef{ - Resolver: "git", + Resolver: "bar", }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - withContext: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), + withContext: cfgtesting.EnableBetaAPIFields, }, { - name: "pipelineRef with url-like name without resolver", + name: "pipelineref resolver disallowed in conjunction with pipelineref bundle", ref: &v1beta1.PipelineRef{ - Name: "https://foo.com/bar", + Bundle: "foo", + ResolverRef: v1beta1.ResolverRef{ + Resolver: "baz", + }, }, - wantErr: apis.ErrMissingField("resolver"), - withContext: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("bundle", "resolver"), + withContext: enableTektonOCIBundles(t), }, { - name: "pipelineRef params disallowed in conjunction with pipelineref name", + name: "pipelineref params disallowed in conjunction with pipelineref name", ref: &v1beta1.PipelineRef{ - Name: "https://foo/bar", + Name: "bar", ResolverRef: v1beta1.ResolverRef{ - Resolver: "git", - Params: []v1beta1.Param{{Name: "foo", Value: v1beta1.ParamValue{StringVal: "bar"}}}, + Params: v1beta1.Params{{ + Name: "foo", + Value: v1beta1.ParamValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", + }, + }}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - withContext: enableConciseResolverSyntax, - }, { - name: "pipelineRef with url-like name without enable-concise-resolver-syntax", - ref: &v1beta1.PipelineRef{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), + withContext: cfgtesting.EnableBetaAPIFields, }, { - name: "pipelineRef without enable-concise-resolver-syntax", - ref: &v1beta1.PipelineRef{Name: "https://foo.com/bar", ResolverRef: v1beta1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, + name: "pipelineref params disallowed in conjunction with pipelineref bundle", + ref: &v1beta1.PipelineRef{ + Bundle: "bar", + ResolverRef: v1beta1.ResolverRef{ + Params: v1beta1.Params{{ + Name: "foo", + Value: v1beta1.ParamValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", + }, + }}, + }, }, + wantErr: apis.ErrMultipleOneOf("bundle", "params").Also(apis.ErrMissingField("resolver")), + withContext: enableTektonOCIBundles(t), }} for _, tc := range tests { @@ -173,3 +204,17 @@ func TestPipelineRef_Valid(t *testing.T) { }) } } + +func enableTektonOCIBundles(t *testing.T) func(context.Context) context.Context { + t.Helper() + return func(ctx context.Context) context.Context { + s := config.NewStore(logtesting.TestLogger(t)) + s.OnConfigChanged(&corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName()}, + Data: map[string]string{ + "enable-tekton-oci-bundles": "true", + }, + }) + return s.ToContext(ctx) + } +} diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go index d0812253a8e..04397c0708b 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go @@ -88,14 +88,13 @@ var ( }, }, }, - Sidecars: []v1beta1.SidecarState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 1, - Reason: "Error", - Message: "Error", - }, + Sidecars: []v1beta1.SidecarState{{ContainerState: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + ExitCode: 1, + Reason: "Error", + Message: "Error", }, + }, Name: "error", ImageID: "image-id", ContainerName: "sidecar-error", @@ -269,21 +268,17 @@ func TestPipelineRunConversion(t *testing.T) { }, HostNetwork: false, }, - StepOverrides: []v1beta1.TaskRunStepOverride{ - { - Name: "test-so", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "test-so", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{ - { - Name: "test-so", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Name: "test-so", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, Metadata: &v1beta1.PipelineTaskMetadata{ Labels: map[string]string{ @@ -320,8 +315,7 @@ func TestPipelineRunConversion(t *testing.T) { Value: *v1beta1.NewObject(map[string]string{ "pkey1": "val1", "pkey2": "rae", - }), - }, { + })}, { Name: "pipeline-result-2", Value: *v1beta1.NewObject(map[string]string{ "pkey1": "val2", @@ -466,6 +460,38 @@ func TestPipelineRunConversionFromDeprecated(t *testing.T) { }, }, }, + }, { + name: "bundle", + in: &v1beta1.PipelineRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ + Name: "test-bundle-name", + Bundle: "test-bundle", + }, + }, + }, + want: &v1beta1.PipelineRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ + ResolverRef: v1beta1.ResolverRef{ + Resolver: "bundles", + Params: v1beta1.Params{ + {Name: "bundle", Value: v1beta1.ParamValue{StringVal: "test-bundle", Type: "string"}}, + {Name: "name", Value: v1beta1.ParamValue{StringVal: "test-bundle-name", Type: "string"}}, + {Name: "kind", Value: v1beta1.ParamValue{StringVal: "Pipeline", Type: "string"}}, + }, + }, + }, + }, + }, }} for _, test := range tests { versions := []apis.Convertible{&v1.PipelineRun{}} diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go index 834c7493df4..7113b653620 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go @@ -26,7 +26,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/validate" "github.com/tektoncd/pipeline/pkg/internal/resultref" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/strings/slices" @@ -61,9 +60,6 @@ func (pr *PipelineRun) Validate(ctx context.Context) *apis.FieldError { // Validate pipelinerun spec func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { - // Validate the spec changes - errs = errs.Also(ps.ValidateUpdate(ctx)) - // Must have exactly one of pipelineRef and pipelineSpec. if ps.PipelineRef == nil && ps.PipelineSpec == nil { errs = errs.Also(apis.ErrMissingOneOf("pipelineRef", "pipelineSpec")) @@ -149,31 +145,6 @@ func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) return errs } -// ValidateUpdate validates the update of a PipelineRunSpec -func (ps *PipelineRunSpec) ValidateUpdate(ctx context.Context) (errs *apis.FieldError) { - if !apis.IsInUpdate(ctx) { - return - } - oldObj, ok := apis.GetBaseline(ctx).(*PipelineRun) - if !ok || oldObj == nil { - return - } - old := &oldObj.Spec - - // If already in the done state, the spec cannot be modified. Otherwise, only the status field can be modified. - tips := "Once the PipelineRun is complete, no updates are allowed" - if !oldObj.IsDone() { - old = old.DeepCopy() - old.Status = ps.Status - tips = "Once the PipelineRun has started, only status updates are allowed" - } - if !equality.Semantic.DeepEqual(old, ps) { - errs = errs.Also(apis.ErrInvalidValue(tips, "")) - } - - return -} - func (ps *PipelineRunSpec) validatePipelineRunParameters(ctx context.Context) (errs *apis.FieldError) { if len(ps.Params) == 0 { return errs @@ -364,11 +335,11 @@ func (ps *PipelineRunSpec) validatePipelineTimeout(timeout time.Duration, errorM func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *apis.FieldError) { if trs.StepOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.BetaAPIFields).ViaField("stepOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.AlphaAPIFields).ViaField("stepOverrides")) errs = errs.Also(validateStepOverrides(trs.StepOverrides).ViaField("stepOverrides")) } if trs.SidecarOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.BetaAPIFields).ViaField("sidecarOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.AlphaAPIFields).ViaField("sidecarOverrides")) errs = errs.Also(validateSidecarOverrides(trs.SidecarOverrides).ViaField("sidecarOverrides")) } if trs.ComputeResources != nil { diff --git a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go index 1d7199fddee..15e044591a4 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go @@ -22,7 +22,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" @@ -32,7 +31,6 @@ import ( corev1resources "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" ) func TestPipelineRun_Invalid(t *testing.T) { @@ -507,21 +505,6 @@ func TestPipelineRun_Invalid(t *testing.T) { }, }, want: &apis.FieldError{Message: "must not set the field(s)", Paths: []string{"spec.resources"}}, - }, { - name: "uses bundle (deprecated) on creation is disallowed", - pr: v1beta1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pipelinerunname", - }, - Spec: v1beta1.PipelineRunSpec{ - PipelineRef: &v1beta1.PipelineRef{ - Name: "foo", - Bundle: "example.com/foo/bar", - }, - }, - }, - want: &apis.FieldError{Message: "must not set the field(s)", Paths: []string{"spec.pipelineRef.bundle"}}, - wc: apis.WithinCreate, }} for _, tc := range tests { @@ -951,7 +934,7 @@ func TestPipelineRun_Validate(t *testing.T) { }, }, }, { - name: "beta feature: sidecar and step overrides", + name: "alpha feature: sidecar and step overrides", pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pr", @@ -961,27 +944,23 @@ func TestPipelineRun_Validate(t *testing.T) { TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "bar", - StepOverrides: []v1beta1.TaskRunStepOverride{ - { - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{ - { - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, }, }, }, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }} for _, ts := range tests { @@ -1015,8 +994,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { TaskRef: &v1beta1.TaskRef{ Name: "mytask", }, - }}, - }, + }}}, }, wantErr: apis.ErrMultipleOneOf("pipelineRef", "pipelineSpec"), }, { @@ -1111,45 +1089,41 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].stepOverrides[1].name"), withContext: cfgtesting.EnableAlphaAPIFields, }, { - name: "stepOverride disallowed without alpha or beta feature gate", + name: "stepOverride disallowed without alpha feature gate", spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "bar", - StepOverrides: []v1beta1.TaskRunStepOverride{ - { - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, }, }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { - name: "sidecarOverride disallowed without alpha or beta feature gate", + name: "sidecarOverride disallowed without alpha feature gate", spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "bar", - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{ - { - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, }, }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { name: "missing stepOverride name", spec: v1beta1.PipelineRunSpec{ @@ -1157,12 +1131,10 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "bar", - StepOverrides: []v1beta1.TaskRunStepOverride{ - { - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, }, }, @@ -1191,12 +1163,10 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "bar", - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{ - { - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, }, }, @@ -1210,13 +1180,11 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ { PipelineTaskName: "pipelineTask", - StepOverrides: []v1beta1.TaskRunStepOverride{ - { - Name: "stepOverride", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "stepOverride", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, }, ComputeResources: &corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("2Gi")}, @@ -1694,179 +1662,3 @@ func TestPipelineRunSpecBetaFeatures(t *testing.T) { }) } } -func TestPipelineRunSpec_ValidateUpdate(t *testing.T) { - tests := []struct { - name string - isCreate bool - isUpdate bool - baselinePipelineRun *v1beta1.PipelineRun - pipelineRun *v1beta1.PipelineRun - expectedError apis.FieldError - }{ - { - name: "is create ctx", - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{}, - }, - isCreate: true, - isUpdate: false, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, no changes", - baselinePipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "", - }, - }, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is nil, skip validation", - baselinePipelineRun: nil, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Timeouts: &v1beta1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, status changes from Empty to Cancelled", - baselinePipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "", - }, - Status: v1beta1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "Cancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, timeouts changes", - baselinePipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "", - Timeouts: &v1beta1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 0}, - }, - }, - Status: v1beta1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Timeouts: &v1beta1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun has started, only status updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is unknown, status changes from PipelineRunPending to Empty, and timeouts changes", - baselinePipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "PipelineRunPending", - Timeouts: &v1beta1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 0}, - }, - }, - Status: v1beta1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "", - Timeouts: &v1beta1.TimeoutFields{ - Pipeline: &metav1.Duration{Duration: 1}, - }, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun has started, only status updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is done, status changes", - baselinePipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "PipelineRunPending", - }, - Status: v1beta1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionTrue}, - }, - }, - }, - }, - pipelineRun: &v1beta1.PipelineRun{ - Spec: v1beta1.PipelineRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the PipelineRun is complete, no updates are allowed`, - Paths: []string{""}, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{}, - Defaults: &config.Defaults{}, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselinePipelineRun) - } - pr := tt.pipelineRun - err := pr.Spec.ValidateUpdate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("PipelineRunSpec.ValidateUpdate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/register.go b/upstream/pkg/apis/pipeline/v1beta1/register.go index c33fa8a848b..6154ae5dad5 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/register.go +++ b/upstream/pkg/apis/pipeline/v1beta1/register.go @@ -58,8 +58,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PipelineRunList{}, &CustomRun{}, &CustomRunList{}, - &StepAction{}, - &StepActionList{}, ) // &Condition{}, // &ConditionList{}, diff --git a/upstream/pkg/apis/pipeline/v1beta1/resultref_test.go b/upstream/pkg/apis/pipeline/v1beta1/resultref_test.go index 628219a393b..aa46dd09a7f 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/resultref_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/resultref_test.go @@ -542,7 +542,7 @@ func TestHasResultReferenceWhenExpression(t *testing.T) { } got := v1beta1.NewResultRefs(expressions) if d := cmp.Diff(tt.wantRef, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -651,8 +651,7 @@ func TestPipelineTaskResultRefs(t *testing.T) { Value: *v1beta1.NewStructuredValues("$(tasks.pt5.results.r5)", "$(tasks.pt6.results.r6)"), }, { Value: *v1beta1.NewStructuredValues("$(tasks.pt7.results.r7)", "$(tasks.pt8.results.r8)"), - }}, - }, + }}}, } refs := v1beta1.PipelineTaskResultRefs(&pt) expectedRefs := []*v1beta1.ResultRef{{ @@ -697,12 +696,11 @@ func TestParseResultName(t *testing.T) { name string input string want []string - }{ - { - name: "array indexing", - input: "anArrayResult[1]", - want: []string{"anArrayResult", "1"}, - }, + }{{ + name: "array indexing", + input: "anArrayResult[1]", + want: []string{"anArrayResult", "1"}, + }, { name: "array star reference", input: "anArrayResult[*]", @@ -724,38 +722,37 @@ func TestGetVarSubstitutionExpressionsForPipelineResult(t *testing.T) { name string result v1beta1.PipelineResult want []string - }{ - { - name: "get string result expressions", - result: v1beta1.PipelineResult{ - Name: "string result", - Type: v1beta1.ResultsTypeString, - Value: *v1beta1.NewStructuredValues("$(tasks.task1.results.result1) and $(tasks.task2.results.result2)"), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, - }, { - name: "get array result expressions", - result: v1beta1.PipelineResult{ - Name: "array result", - Type: v1beta1.ResultsTypeString, - Value: *v1beta1.NewStructuredValues("$(tasks.task1.results.result1)", "$(tasks.task2.results.result2)"), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, - }, { - name: "get object result expressions", - result: v1beta1.PipelineResult{ - Name: "object result", - Type: v1beta1.ResultsTypeString, - Value: *v1beta1.NewObject(map[string]string{ - "key1": "$(tasks.task1.results.result1)", - "key2": "$(tasks.task2.results.result2) and another one $(tasks.task3.results.result3)", - "key3": "no ref here", - }), - }, - want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2", "tasks.task3.results.result3"}, + }{{ + name: "get string result expressions", + result: v1beta1.PipelineResult{ + Name: "string result", + Type: v1beta1.ResultsTypeString, + Value: *v1beta1.NewStructuredValues("$(tasks.task1.results.result1) and $(tasks.task2.results.result2)"), + }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, + }, { + name: "get array result expressions", + result: v1beta1.PipelineResult{ + Name: "array result", + Type: v1beta1.ResultsTypeString, + Value: *v1beta1.NewStructuredValues("$(tasks.task1.results.result1)", "$(tasks.task2.results.result2)"), + }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2"}, + }, { + name: "get object result expressions", + result: v1beta1.PipelineResult{ + Name: "object result", + Type: v1beta1.ResultsTypeString, + Value: *v1beta1.NewObject(map[string]string{ + "key1": "$(tasks.task1.results.result1)", + "key2": "$(tasks.task2.results.result2) and another one $(tasks.task3.results.result3)", + "key3": "no ref here", + }), }, + want: []string{"tasks.task1.results.result1", "tasks.task2.results.result2", "tasks.task3.results.result3"}, + }, } - sortStrings := func(x, y string) bool { + var sortStrings = func(x, y string) bool { return x < y } for _, tt := range tests { diff --git a/upstream/pkg/apis/pipeline/v1beta1/stepaction_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/stepaction_conversion.go deleted file mode 100644 index 6d8afd26f33..00000000000 --- a/upstream/pkg/apis/pipeline/v1beta1/stepaction_conversion.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2023 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - "knative.dev/pkg/apis" -) - -var _ apis.Convertible = (*StepAction)(nil) - -// ConvertTo implements apis.Convertible -func (s *StepAction) ConvertTo(ctx context.Context, to apis.Convertible) error { - return nil -} - -// ConvertTo implements apis.Convertible -func (ss *StepActionSpec) ConvertTo(ctx context.Context, sink *StepActionSpec) error { - return nil -} - -// ConvertFrom implements apis.Convertible -func (s *StepAction) ConvertFrom(ctx context.Context, from apis.Convertible) error { - return nil -} - -// ConvertFrom implements apis.Convertible -func (ss *StepActionSpec) ConvertFrom(ctx context.Context, source *StepActionSpec) error { - return nil -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/stepaction_defaults.go b/upstream/pkg/apis/pipeline/v1beta1/stepaction_defaults.go deleted file mode 100644 index 0274a66bc2e..00000000000 --- a/upstream/pkg/apis/pipeline/v1beta1/stepaction_defaults.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2023 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - "knative.dev/pkg/apis" -) - -var _ apis.Defaultable = (*StepAction)(nil) - -// SetDefaults implements apis.Defaultable -func (s *StepAction) SetDefaults(ctx context.Context) { - s.Spec.SetDefaults(ctx) -} - -// SetDefaults set any defaults for the StepAction spec -func (ss *StepActionSpec) SetDefaults(ctx context.Context) { - for i := range ss.Params { - ss.Params[i].SetDefaults(ctx) - } - for i := range ss.Results { - ss.Results[i].SetDefaults(ctx) - } -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/stepaction_types.go b/upstream/pkg/apis/pipeline/v1beta1/stepaction_types.go deleted file mode 100644 index ab000a6db01..00000000000 --- a/upstream/pkg/apis/pipeline/v1beta1/stepaction_types.go +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2023 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "knative.dev/pkg/apis" - "knative.dev/pkg/kmeta" -) - -// +genclient -// +genclient:noStatus -// +genreconciler:krshapedlogic=false -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// StepAction represents the actionable components of Step. -// The Step can only reference it from the cluster or using remote resolution. -// -// +k8s:openapi-gen=true -type StepAction struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata"` - - // Spec holds the desired state of the Step from the client - // +optional - Spec StepActionSpec `json:"spec"` -} - -var _ kmeta.OwnerRefable = (*StepAction)(nil) - -// StepAction returns the step action's spec -func (s *StepAction) StepActionSpec() StepActionSpec { - return s.Spec -} - -// StepActionMetadata returns the step action's ObjectMeta -func (s *StepAction) StepActionMetadata() metav1.ObjectMeta { - return s.ObjectMeta -} - -// Copy returns a deep copy of the stepaction -func (s *StepAction) Copy() StepActionObject { - return s.DeepCopy() -} - -// GetGroupVersionKind implements kmeta.OwnerRefable. -func (*StepAction) GetGroupVersionKind() schema.GroupVersionKind { - return SchemeGroupVersion.WithKind("StepAction") -} - -// Checksum computes the sha256 checksum of the stepaction object. -// Prior to computing the checksum, it performs some preprocessing on the -// metadata of the object where it removes system provided annotations. -// Only the name, namespace, generateName, user-provided labels and annotations -// and the taskSpec are included for the checksum computation. -func (s *StepAction) Checksum() ([]byte, error) { - objectMeta := checksum.PrepareObjectMeta(s) - preprocessedStepaction := StepAction{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "tekton.dev/v1beta1", - Kind: "StepAction", - }, - ObjectMeta: objectMeta, - Spec: s.Spec, - } - sha256Checksum, err := checksum.ComputeSha256Checksum(preprocessedStepaction) - if err != nil { - return nil, err - } - return sha256Checksum, nil -} - -// StepActionList contains a list of StepActions -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type StepActionList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - Items []StepAction `json:"items"` -} - -// StepActionSpec contains the actionable components of a step. -type StepActionSpec struct { - // Description is a user-facing description of the stepaction that may be - // used to populate a UI. - // +optional - Description string `json:"description,omitempty"` - // Image reference name to run for this StepAction. - // More info: https://kubernetes.io/docs/concepts/containers/images - // +optional - Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` - // Entrypoint array. Not executed within a shell. - // The image's ENTRYPOINT is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - // +listType=atomic - Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` - // Arguments to the entrypoint. - // The image's CMD is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - // +listType=atomic - Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` - // List of environment variables to set in the container. - // Cannot be updated. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - // +listType=atomic - Env []corev1.EnvVar `json:"env,omitempty" patchMergeKey:"name" patchStrategy:"merge" protobuf:"bytes,7,rep,name=env"` - // Script is the contents of an executable file to execute. - // - // If Script is not empty, the Step cannot have an Command and the Args will be passed to the Script. - // +optional - Script string `json:"script,omitempty"` - // Step's working directory. - // If not specified, the container runtime's default will be used, which - // might be configured in the container image. - // Cannot be updated. - // +optional - WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` - // Params is a list of input parameters required to run the stepAction. - // Params must be supplied as inputs in Steps unless they declare a defaultvalue. - // +optional - // +listType=atomic - Params v1.ParamSpecs `json:"params,omitempty"` - // Results are values that this StepAction can output - // +optional - // +listType=atomic - Results []v1.StepResult `json:"results,omitempty"` - // SecurityContext defines the security options the Step should be run with. - // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - // The value set in StepAction will take precedence over the value from Task. - // +optional - SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` - // Volumes to mount into the Step's filesystem. - // Cannot be updated. - // +optional - // +patchMergeKey=mountPath - // +patchStrategy=merge - // +listType=atomic - VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchMergeKey:"mountPath" patchStrategy:"merge" protobuf:"bytes,9,rep,name=volumeMounts"` -} - -// ToStep converts the StepActionSpec to a Step struct -func (ss *StepActionSpec) ToStep() *v1.Step { - return &v1.Step{ - Image: ss.Image, - Command: ss.Command, - Args: ss.Args, - WorkingDir: ss.WorkingDir, - Script: ss.Script, - Env: ss.Env, - VolumeMounts: ss.VolumeMounts, - SecurityContext: ss.SecurityContext, - Results: ss.Results, - } -} - -// StepActionObject is implemented by StepAction -type StepActionObject interface { - apis.Defaultable - StepActionMetadata() metav1.ObjectMeta - StepActionSpec() StepActionSpec - Copy() StepActionObject -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation.go b/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation.go deleted file mode 100644 index 0955c7e4f70..00000000000 --- a/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2023 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "strings" - - "github.com/tektoncd/pipeline/pkg/apis/config" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/validate" - "github.com/tektoncd/pipeline/pkg/substitution" - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" - "knative.dev/pkg/apis" - "knative.dev/pkg/webhook/resourcesemantics" -) - -var ( - _ apis.Validatable = (*StepAction)(nil) - _ resourcesemantics.VerbLimited = (*StepAction)(nil) -) - -// SupportedVerbs returns the operations that validation should be called for -func (s *StepAction) SupportedVerbs() []admissionregistrationv1.OperationType { - return []admissionregistrationv1.OperationType{admissionregistrationv1.Create, admissionregistrationv1.Update} -} - -// Validate implements apis.Validatable -func (s *StepAction) Validate(ctx context.Context) (errs *apis.FieldError) { - errs = validate.ObjectMetadata(s.GetObjectMeta()).ViaField("metadata") - errs = errs.Also(s.Spec.Validate(apis.WithinSpec(ctx)).ViaField("spec")) - return errs -} - -// Validate implements apis.Validatable -func (ss *StepActionSpec) Validate(ctx context.Context) (errs *apis.FieldError) { - if ss.Image == "" { - errs = errs.Also(apis.ErrMissingField("Image")) - } - - if ss.Script != "" { - if len(ss.Command) > 0 { - errs = errs.Also(&apis.FieldError{ - Message: "script cannot be used with command", - Paths: []string{"script"}, - }) - } - - cleaned := strings.TrimSpace(ss.Script) - if strings.HasPrefix(cleaned, "#!win") { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "windows script support", config.AlphaAPIFields).ViaField("script")) - } - errs = errs.Also(validateNoParamSubstitutionsInScript(ss.Script)) - } - errs = errs.Also(validateUsageOfDeclaredParameters(ctx, *ss)) - errs = errs.Also(v1.ValidateParameterTypes(ctx, ss.Params).ViaField("params")) - errs = errs.Also(validateParameterVariables(ctx, *ss, ss.Params)) - errs = errs.Also(v1.ValidateStepResultsVariables(ctx, ss.Results, ss.Script)) - errs = errs.Also(v1.ValidateStepResults(ctx, ss.Results).ViaField("results")) - errs = errs.Also(validateVolumeMounts(ss.VolumeMounts, ss.Params).ViaField("volumeMounts")) - return errs -} - -// validateNoParamSubstitutionsInScript validates that param substitutions are not invoked in the script -func validateNoParamSubstitutionsInScript(script string) *apis.FieldError { - _, present, errString := substitution.ExtractVariablesFromString(script, "params") - if errString != "" || present { - return &apis.FieldError{ - Message: "param substitution in scripts is not allowed.", - Paths: []string{"script"}, - } - } - return nil -} - -// validateUsageOfDeclaredParameters validates that all parameters referenced in the Task are declared by the Task. -func validateUsageOfDeclaredParameters(ctx context.Context, sas StepActionSpec) *apis.FieldError { - params := sas.Params - var errs *apis.FieldError - _, _, objectParams := params.SortByType() - allParameterNames := sets.NewString(params.GetNames()...) - errs = errs.Also(validateStepActionVariables(ctx, sas, "params", allParameterNames)) - errs = errs.Also(ValidateObjectUsage(ctx, sas, objectParams)) - errs = errs.Also(v1.ValidateObjectParamsHaveProperties(ctx, params)) - return errs -} - -func validateVolumeMounts(volumeMounts []corev1.VolumeMount, params v1.ParamSpecs) (errs *apis.FieldError) { - if len(volumeMounts) == 0 { - return - } - paramNames := sets.String{} - for _, p := range params { - paramNames.Insert(p.Name) - } - for idx, v := range volumeMounts { - matches, _ := substitution.ExtractVariableExpressions(v.Name, "params") - if len(matches) != 1 { - errs = errs.Also(apis.ErrInvalidValue(v.Name, "name", "expect the Name to be a single param reference").ViaIndex(idx)) - return errs - } else if matches[0] != v.Name { - errs = errs.Also(apis.ErrInvalidValue(v.Name, "name", "expect the Name to be a single param reference").ViaIndex(idx)) - return errs - } - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(v.Name, "params", paramNames).ViaIndex(idx)) - } - return errs -} - -// validateParameterVariables validates all variables within a slice of ParamSpecs against a StepAction -func validateParameterVariables(ctx context.Context, sas StepActionSpec, params v1.ParamSpecs) *apis.FieldError { - var errs *apis.FieldError - errs = errs.Also(params.ValidateNoDuplicateNames()) - stringParams, arrayParams, objectParams := params.SortByType() - stringParameterNames := sets.NewString(stringParams.GetNames()...) - arrayParameterNames := sets.NewString(arrayParams.GetNames()...) - errs = errs.Also(v1.ValidateNameFormat(stringParameterNames.Insert(arrayParameterNames.List()...), objectParams)) - return errs.Also(validateStepActionArrayUsage(sas, "params", arrayParameterNames)) -} - -// ValidateObjectUsage validates the usage of individual attributes of an object param and the usage of the entire object -func ValidateObjectUsage(ctx context.Context, sas StepActionSpec, params v1.ParamSpecs) (errs *apis.FieldError) { - objectParameterNames := sets.NewString() - for _, p := range params { - // collect all names of object type params - objectParameterNames.Insert(p.Name) - - // collect all keys for this object param - objectKeys := sets.NewString() - for key := range p.Properties { - objectKeys.Insert(key) - } - - // check if the object's key names are referenced correctly i.e. param.objectParam.key1 - errs = errs.Also(validateStepActionVariables(ctx, sas, "params\\."+p.Name, objectKeys)) - } - - return errs.Also(validateStepActionObjectUsageAsWhole(sas, "params", objectParameterNames)) -} - -// validateStepActionObjectUsageAsWhole returns an error if the StepAction contains references to the entire input object params in fields where these references are prohibited -func validateStepActionObjectUsageAsWhole(sas StepActionSpec, prefix string, vars sets.String) *apis.FieldError { - errs := substitution.ValidateNoReferencesToEntireProhibitedVariables(sas.Image, prefix, vars).ViaField("image") - errs = errs.Also(substitution.ValidateNoReferencesToEntireProhibitedVariables(sas.Script, prefix, vars).ViaField("script")) - for i, cmd := range sas.Command { - errs = errs.Also(substitution.ValidateNoReferencesToEntireProhibitedVariables(cmd, prefix, vars).ViaFieldIndex("command", i)) - } - for i, arg := range sas.Args { - errs = errs.Also(substitution.ValidateNoReferencesToEntireProhibitedVariables(arg, prefix, vars).ViaFieldIndex("args", i)) - } - for _, env := range sas.Env { - errs = errs.Also(substitution.ValidateNoReferencesToEntireProhibitedVariables(env.Value, prefix, vars).ViaFieldKey("env", env.Name)) - } - for i, vm := range sas.VolumeMounts { - errs = errs.Also(substitution.ValidateNoReferencesToEntireProhibitedVariables(vm.Name, prefix, vars).ViaFieldIndex("volumeMounts", i)) - } - return errs -} - -// validateStepActionArrayUsage returns an error if the Step contains references to the input array params in fields where these references are prohibited -func validateStepActionArrayUsage(sas StepActionSpec, prefix string, arrayParamNames sets.String) *apis.FieldError { - errs := substitution.ValidateNoReferencesToProhibitedVariables(sas.Image, prefix, arrayParamNames).ViaField("image") - errs = errs.Also(substitution.ValidateNoReferencesToProhibitedVariables(sas.Script, prefix, arrayParamNames).ViaField("script")) - for i, cmd := range sas.Command { - errs = errs.Also(substitution.ValidateVariableReferenceIsIsolated(cmd, prefix, arrayParamNames).ViaFieldIndex("command", i)) - } - for i, arg := range sas.Args { - errs = errs.Also(substitution.ValidateVariableReferenceIsIsolated(arg, prefix, arrayParamNames).ViaFieldIndex("args", i)) - } - for _, env := range sas.Env { - errs = errs.Also(substitution.ValidateNoReferencesToProhibitedVariables(env.Value, prefix, arrayParamNames).ViaFieldKey("env", env.Name)) - } - for i, vm := range sas.VolumeMounts { - errs = errs.Also(substitution.ValidateNoReferencesToProhibitedVariables(vm.Name, prefix, arrayParamNames).ViaFieldIndex("volumeMounts", i)) - } - return errs -} - -// validateStepActionVariables returns an error if the StepAction contains references to any unknown variables -func validateStepActionVariables(ctx context.Context, sas StepActionSpec, prefix string, vars sets.String) *apis.FieldError { - errs := substitution.ValidateNoReferencesToUnknownVariables(sas.Image, prefix, vars).ViaField("image") - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(sas.Script, prefix, vars).ViaField("script")) - for i, cmd := range sas.Command { - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(cmd, prefix, vars).ViaFieldIndex("command", i)) - } - for i, arg := range sas.Args { - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(arg, prefix, vars).ViaFieldIndex("args", i)) - } - for _, env := range sas.Env { - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(env.Value, prefix, vars).ViaFieldKey("env", env.Name)) - } - for i, vm := range sas.VolumeMounts { - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(vm.Name, prefix, vars).ViaFieldIndex("volumeMounts", i)) - } - return errs -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation_test.go deleted file mode 100644 index 49efacdf91a..00000000000 --- a/upstream/pkg/apis/pipeline/v1beta1/stepaction_validation_test.go +++ /dev/null @@ -1,975 +0,0 @@ -/* -Copyright 2023 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1_test - -import ( - "context" - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/apis" -) - -func TestStepActionValidate(t *testing.T) { - tests := []struct { - name string - sa *v1beta1.StepAction - wc func(context.Context) context.Context - }{{ - name: "valid step action", - sa: &v1beta1.StepAction{ - ObjectMeta: metav1.ObjectMeta{Name: "stepaction"}, - Spec: v1beta1.StepActionSpec{ - Image: "my-image", - Script: ` - #!/usr/bin/env bash - echo hello`, - }, - }, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := context.Background() - if tt.wc != nil { - ctx = tt.wc(ctx) - } - err := tt.sa.Validate(ctx) - if err != nil { - t.Errorf("StepAction.Validate() returned error for valid StepAction: %v", err) - } - }) - } -} - -func TestStepActionSpecValidate(t *testing.T) { - type fields struct { - Image string - Command []string - Args []string - Script string - Env []corev1.EnvVar - Params []v1.ParamSpec - Results []v1.StepResult - VolumeMounts []corev1.VolumeMount - } - tests := []struct { - name string - fields fields - }{{ - name: "step action with command", - fields: fields{ - Image: "myimage", - Command: []string{"ls"}, - Args: []string{"-lh"}, - }, - }, { - name: "step action with script", - fields: fields{ - Image: "myimage", - Script: "echo hi", - }, - }, { - name: "step action with env", - fields: fields{ - Image: "myimage", - Script: "echo hi", - Env: []corev1.EnvVar{{ - Name: "HOME", - Value: "/tekton/home", - }}, - }, - }, { - name: "valid params type explicit", - fields: fields{ - Image: "myimage", - Params: []v1.ParamSpec{{ - Name: "stringParam", - Type: v1.ParamTypeString, - Description: "param", - Default: v1.NewStructuredValues("default"), - }, { - Name: "objectParam", - Type: v1.ParamTypeObject, - Description: "param", - Properties: map[string]v1.PropertySpec{ - "key1": {}, - "key2": {}, - }, - Default: v1.NewObject(map[string]string{ - "key1": "var1", - "key2": "var2", - }), - }, { - Name: "objectParamWithoutDefault", - Type: v1.ParamTypeObject, - Description: "param", - Properties: map[string]v1.PropertySpec{ - "key1": {}, - "key2": {}, - }, - }, { - Name: "objectParamWithDefaultPartialKeys", - Type: v1.ParamTypeObject, - Description: "param", - Properties: map[string]v1.PropertySpec{ - "key1": {}, - "key2": {}, - }, - Default: v1.NewObject(map[string]string{ - "key1": "default", - }), - }}, - }, - }, { - name: "valid string param usage", - fields: fields{ - Image: "url", - Params: []v1.ParamSpec{{ - Name: "baz", - }, { - Name: "foo-is-baz", - }}, - Args: []string{"--flag=$(params.baz) && $(params.foo-is-baz)"}, - }, - }, { - name: "valid array param usage", - fields: fields{ - Image: "url", - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"$(params.baz)", "middle string", "$(params.foo-is-baz)"}, - }, - }, { - name: "valid object param usage", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "some-git-image", - Args: []string{"-url=$(params.gitrepo.url)", "-commit=$(params.gitrepo.commit)"}, - }, - }, { - name: "valid star array usage", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Image: "myimage", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"$(params.baz[*])", "middle string", "$(params.foo-is-baz[*])"}, - }, - }, { - name: "valid result", - fields: fields{ - Image: "my-image", - Args: []string{"arg"}, - Results: []v1.StepResult{{ - Name: "MY-RESULT", - Description: "my great result", - }}, - }, - }, { - name: "valid result type string", - fields: fields{ - Image: "my-image", - Args: []string{"arg"}, - Results: []v1.StepResult{{ - Name: "MY-RESULT", - Type: "string", - Description: "my great result", - }}, - }, - }, { - name: "valid result type array", - fields: fields{ - Image: "my-image", - Args: []string{"arg"}, - Results: []v1.StepResult{{ - Name: "MY-RESULT", - Type: v1.ResultsTypeArray, - Description: "my great result", - }}, - }, - }, { - name: "valid result type object", - fields: fields{ - Image: "my-image", - Args: []string{"arg"}, - Results: []v1.StepResult{{ - Name: "MY-RESULT", - Type: v1.ResultsTypeObject, - Description: "my great result", - Properties: map[string]v1.PropertySpec{ - "url": {Type: "string"}, - "commit": {Type: "string"}, - }, - }}, - }, - }, { - name: "valid volumeMounts", - fields: fields{ - Image: "my-image", - Args: []string{"arg"}, - Params: []v1.ParamSpec{{ - Name: "foo", - }, { - Name: "array-params", - Type: v1.ParamTypeArray, - }, { - Name: "object-params", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "key": {Type: "string"}, - }, - }, - }, - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.foo)", - MountPath: "/config", - }, { - Name: "$(params.array-params[0])", - MountPath: "/config", - }, { - Name: "$(params.object-params.key)", - MountPath: "/config", - }}, - }, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - sa := &v1beta1.StepActionSpec{ - Image: tt.fields.Image, - Command: tt.fields.Command, - Args: tt.fields.Args, - Script: tt.fields.Script, - Env: tt.fields.Env, - Params: tt.fields.Params, - Results: tt.fields.Results, - VolumeMounts: tt.fields.VolumeMounts, - } - ctx := context.Background() - sa.SetDefaults(ctx) - if err := sa.Validate(ctx); err != nil { - t.Errorf("StepActionSpec.Validate() = %v", err) - } - }) - } -} - -func TestStepActionValidateError(t *testing.T) { - type fields struct { - Image string - Command []string - Args []string - Script string - Env []corev1.EnvVar - Params []v1.ParamSpec - Results []v1.StepResult - VolumeMounts []corev1.VolumeMount - } - tests := []struct { - name string - fields fields - expectedError apis.FieldError - }{{ - name: "inexistent image field", - fields: fields{ - Args: []string{"flag"}, - }, - expectedError: apis.FieldError{ - Message: `missing field(s)`, - Paths: []string{"spec.Image"}, - }, - }, { - name: "object used in a string field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "$(params.gitrepo)", - Args: []string{"echo"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo)"`, - Paths: []string{"spec.image"}, - }, - }, { - name: "object star used in a string field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "$(params.gitrepo[*])", - Args: []string{"echo"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo[*])"`, - Paths: []string{"spec.image"}, - }, - }, { - name: "object used in a field that can accept array type", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "myimage", - Args: []string{"$(params.gitrepo)"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo)"`, - Paths: []string{"spec.args[0]"}, - }, - }, { - name: "object star used in a field that can accept array type", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "some-git-image", - Args: []string{"$(params.gitrepo[*])"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo[*])"`, - Paths: []string{"spec.args[0]"}, - }, - }, { - name: "non-existent individual key of an object param is used in task step", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "some-git-image", - Args: []string{"$(params.gitrepo.non-exist-key)"}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.gitrepo.non-exist-key)"`, - Paths: []string{"spec.args[0]"}, - }, - }, { - name: "Inexistent param variable with existing", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "foo", - Description: "param", - Default: v1.NewStructuredValues("default"), - }}, - Image: "myimage", - Args: []string{"$(params.foo) && $(params.inexistent)"}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.foo) && $(params.inexistent)"`, - Paths: []string{"spec.args[0]"}, - }, - }, { - name: "invalid param reference in volumeMount.Name - not a param reference", - fields: fields{ - Image: "myimage", - Params: []v1.ParamSpec{{ - Name: "foo", - }}, - VolumeMounts: []corev1.VolumeMount{{ - Name: "params.foo", - MountPath: "/path", - }}, - }, - expectedError: apis.FieldError{ - Message: `invalid value: params.foo`, - Paths: []string{"spec.volumeMounts[0].name"}, - Details: `expect the Name to be a single param reference`, - }, - }, { - name: "invalid param reference in volumeMount.Name - nested reference", - fields: fields{ - Image: "myimage", - Params: []v1.ParamSpec{{ - Name: "foo", - }}, - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.foo)-foo", - MountPath: "/path", - }}, - }, - expectedError: apis.FieldError{ - Message: `invalid value: $(params.foo)-foo`, - Paths: []string{"spec.volumeMounts[0].name"}, - Details: `expect the Name to be a single param reference`, - }, - }, { - name: "invalid param reference in volumeMount.Name - multiple params references", - fields: fields{ - Image: "myimage", - Params: []v1.ParamSpec{{ - Name: "foo", - }, { - Name: "bar", - }}, - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.foo)$(params.bar)", - MountPath: "/path", - }}, - }, - expectedError: apis.FieldError{ - Message: `invalid value: $(params.foo)$(params.bar)`, - Paths: []string{"spec.volumeMounts[0].name"}, - Details: `expect the Name to be a single param reference`, - }, - }, { - name: "invalid param reference in volumeMount.Name - not defined in params", - fields: fields{ - Image: "myimage", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.foo)", - MountPath: "/path", - }}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.foo)"`, - Paths: []string{"spec.volumeMounts[0]"}, - }, - }, { - name: "invalid param reference in volumeMount.Name - array used in a volumeMounts name field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeArray, - }}, - Image: "image", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.gitrepo)", - }}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo)"`, - Paths: []string{"spec.volumeMounts[0]"}, - }, - }, { - name: "invalid param reference in volumeMount.Name - object used in a volumeMounts name field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "image", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.gitrepo)", - }}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.gitrepo)"`, - Paths: []string{"spec.volumeMounts[0]"}, - }, - }, { - name: "invalid param reference in volumeMount.Name - object key not existent in params", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "gitrepo", - Type: v1.ParamTypeObject, - Properties: map[string]v1.PropertySpec{ - "url": {}, - "commit": {}, - }, - }}, - Image: "image", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.gitrepo.foo)", - }}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "$(params.gitrepo.foo)"`, - Paths: []string{"spec.volumeMounts[0]"}, - }, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - sa := &v1beta1.StepAction{ - ObjectMeta: metav1.ObjectMeta{Name: "foo"}, - Spec: v1beta1.StepActionSpec{ - Image: tt.fields.Image, - Command: tt.fields.Command, - Args: tt.fields.Args, - Script: tt.fields.Script, - Env: tt.fields.Env, - Params: tt.fields.Params, - Results: tt.fields.Results, - VolumeMounts: tt.fields.VolumeMounts, - }, - } - ctx := context.Background() - sa.SetDefaults(ctx) - err := sa.Validate(ctx) - if err == nil { - t.Fatalf("Expected an error, got nothing for %v", sa) - } - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("StepActionSpec.Validate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} - -func TestStepActionSpecValidateError(t *testing.T) { - type fields struct { - Image string - Command []string - Args []string - Script string - Env []corev1.EnvVar - Params []v1.ParamSpec - Results []v1.StepResult - } - tests := []struct { - name string - fields fields - expectedError apis.FieldError - }{{ - name: "inexistent image field", - fields: fields{ - Args: []string{"flag"}, - }, - expectedError: apis.FieldError{ - Message: `missing field(s)`, - Paths: []string{"Image"}, - }, - }, { - name: "command and script both used.", - fields: fields{ - Image: "my-image", - Command: []string{"ls"}, - Script: "echo hi", - }, - expectedError: apis.FieldError{ - Message: `script cannot be used with command`, - Paths: []string{"script"}, - }, - }, { - name: "windows script without alpha.", - fields: fields{ - Image: "my-image", - Script: "#!win", - }, - expectedError: apis.FieldError{ - Message: `windows script support requires "enable-api-fields" feature gate to be "alpha" but it is "beta"`, - Paths: []string{}, - }, - }, { - name: "step script refers to nonexistent result", - fields: fields{ - Image: "my-image", - Script: ` - #!/usr/bin/env bash - date | tee $(results.non-exist.path)`, - Results: []v1.StepResult{{Name: "a-result"}}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "\n\t\t\t#!/usr/bin/env bash\n\t\t\tdate | tee $(results.non-exist.path)"`, - Paths: []string{"script"}, - }, - }, { - name: "step script refers to nonexistent stepresult", - fields: fields{ - Image: "my-image", - Script: ` - #!/usr/bin/env bash - date | tee $(step.results.non-exist.path)`, - Results: []v1.StepResult{{Name: "a-result"}}, - }, - expectedError: apis.FieldError{ - Message: `non-existent variable in "\n\t\t\t#!/usr/bin/env bash\n\t\t\tdate | tee $(step.results.non-exist.path)"`, - Paths: []string{"script"}, - }, - }, { - name: "invalid param name format", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "_validparam1", - Description: "valid param name format", - }, { - Name: "valid_param2", - Description: "valid param name format", - }, { - Name: "", - Description: "invalid param name format", - }, { - Name: "a^b", - Description: "invalid param name format", - }, { - Name: "0ab", - Description: "invalid param name format", - }, { - Name: "f oo", - Description: "invalid param name format", - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: fmt.Sprintf("The format of following array and string variable names is invalid: %s", []string{"", "0ab", "a^b", "f oo"}), - Paths: []string{"params"}, - Details: "String/Array Names: \nMust only contain alphanumeric characters, hyphens (-), underscores (_), and dots (.)\nMust begin with a letter or an underscore (_)", - }, - }, { - name: "invalid object param format - object param name and key name shouldn't contain dots.", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "invalid.name1", - Description: "object param name contains dots", - Properties: map[string]v1.PropertySpec{ - "invalid.key1": {}, - "mykey2": {}, - }, - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: fmt.Sprintf("Object param name and key name format is invalid: %v", map[string][]string{ - "invalid.name1": {"invalid.key1"}, - }), - Paths: []string{"params"}, - Details: "Object Names: \nMust only contain alphanumeric characters, hyphens (-), underscores (_) \nMust begin with a letter or an underscore (_)", - }, - }, { - name: "duplicated param names", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "foo", - Type: v1.ParamTypeString, - Description: "parameter", - Default: v1.NewStructuredValues("value1"), - }, { - Name: "foo", - Type: v1.ParamTypeString, - Description: "parameter", - Default: v1.NewStructuredValues("value2"), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `parameter appears more than once`, - Paths: []string{"params[foo]"}, - }, - }, { - name: "invalid param type", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "validparam", - Type: v1.ParamTypeString, - Description: "parameter", - Default: v1.NewStructuredValues("default"), - }, { - Name: "param-with-invalid-type", - Type: "invalidtype", - Description: "invalidtypedesc", - Default: v1.NewStructuredValues("default"), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `invalid value: invalidtype`, - Paths: []string{"params.param-with-invalid-type.type"}, - }, - }, { - name: "param mismatching default/type 1", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeArray, - Description: "param", - Default: v1.NewStructuredValues("default"), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `"array" type does not match default value's type: "string"`, - Paths: []string{"params.task.type", "params.task.default.type"}, - }, - }, { - name: "param mismatching default/type 2", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeString, - Description: "param", - Default: v1.NewStructuredValues("default", "array"), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `"string" type does not match default value's type: "array"`, - Paths: []string{"params.task.type", "params.task.default.type"}, - }, - }, { - name: "param mismatching default/type 3", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeArray, - Description: "param", - Default: v1.NewObject(map[string]string{ - "key1": "var1", - "key2": "var2", - }), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `"array" type does not match default value's type: "object"`, - Paths: []string{"params.task.type", "params.task.default.type"}, - }, - }, { - name: "param mismatching default/type 4", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeObject, - Description: "param", - Properties: map[string]v1.PropertySpec{"key1": {}}, - Default: v1.NewStructuredValues("var"), - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: `"object" type does not match default value's type: "string"`, - Paths: []string{"params.task.type", "params.task.default.type"}, - }, - }, { - name: "PropertySpec type is set with unsupported type", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeObject, - Description: "param", - Properties: map[string]v1.PropertySpec{ - "key1": {Type: "number"}, - "key2": {Type: "string"}, - }, - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: fmt.Sprintf("The value type specified for these keys %v is invalid", []string{"key1"}), - Paths: []string{"params.task.properties"}, - }, - }, { - name: "Properties is missing", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "task", - Type: v1.ParamTypeObject, - Description: "param", - }}, - Image: "myImage", - }, - expectedError: apis.FieldError{ - Message: "missing field(s)", - Paths: []string{"task.properties"}, - }, - }, { - name: "array used in unaccepted field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Image: "$(params.baz)", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"$(params.baz)", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.baz)"`, - Paths: []string{"image"}, - }, - }, { - name: "array star used in unaccepted field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Image: "$(params.baz[*])", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"$(params.baz)", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable type invalid in "$(params.baz[*])"`, - Paths: []string{"image"}, - }, - }, { - name: "array not properly isolated", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Image: "someimage", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"not isolated: $(params.baz)", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable is not properly isolated in "not isolated: $(params.baz)"`, - Paths: []string{"args[0]"}, - }, - }, { - name: "array star not properly isolated", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeArray, - }}, - Image: "someimage", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"not isolated: $(params.baz[*])", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable is not properly isolated in "not isolated: $(params.baz[*])"`, - Paths: []string{"args[0]"}, - }, - }, { - name: "inferred array not properly isolated", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Default: v1.NewStructuredValues("implied", "array", "type"), - }, { - Name: "foo-is-baz", - Default: v1.NewStructuredValues("implied", "array", "type"), - }}, - Image: "someimage", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"not isolated: $(params.baz)", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable is not properly isolated in "not isolated: $(params.baz)"`, - Paths: []string{"args[0]"}, - }, - }, { - name: "inferred array star not properly isolated", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Default: v1.NewStructuredValues("implied", "array", "type"), - }, { - Name: "foo-is-baz", - Default: v1.NewStructuredValues("implied", "array", "type"), - }}, - Image: "someimage", - Command: []string{"$(params.foo-is-baz)"}, - Args: []string{"not isolated: $(params.baz[*])", "middle string", "url"}, - }, - expectedError: apis.FieldError{ - Message: `variable is not properly isolated in "not isolated: $(params.baz[*])"`, - Paths: []string{"args[0]"}, - }, - }, { - name: "params used in script field", - fields: fields{ - Params: []v1.ParamSpec{{ - Name: "baz", - Type: v1.ParamTypeArray, - }, { - Name: "foo-is-baz", - Type: v1.ParamTypeString, - }}, - Script: "$(params.baz[0]), $(params.foo-is-baz)", - Image: "my-image", - }, - expectedError: apis.FieldError{ - Message: `param substitution in scripts is not allowed.`, - Paths: []string{"script"}, - }, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - sa := v1beta1.StepActionSpec{ - Image: tt.fields.Image, - Command: tt.fields.Command, - Args: tt.fields.Args, - Script: tt.fields.Script, - Env: tt.fields.Env, - Params: tt.fields.Params, - Results: tt.fields.Results, - } - ctx := context.Background() - sa.SetDefaults(ctx) - err := sa.Validate(ctx) - if err == nil { - t.Fatalf("Expected an error, got nothing for %v", sa) - } - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("StepActionSpec.Validate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/swagger.json b/upstream/pkg/apis/pipeline/v1beta1/swagger.json index 7e2d8d9d95c..622b1d680c3 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/swagger.json +++ b/upstream/pkg/apis/pipeline/v1beta1/swagger.json @@ -28,14 +28,6 @@ "default": "" } }, - "priorityClassName": { - "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - "type": "string" - }, - "securityContext": { - "description": "SecurityContext sets the security context for the pod", - "$ref": "#/definitions/v1.PodSecurityContext" - }, "tolerations": { "description": "If specified, the pod's tolerations.", "type": "array", @@ -163,16 +155,11 @@ "description": "TaskRunStepArtifact represents an artifact produced or used by a step within a task run. It directly uses the Artifact type for its structure.", "type": "object", "properties": { - "buildOutput": { - "description": "Indicate if the artifact is a build output or a by-product", - "type": "boolean" - }, "name": { - "description": "The artifact's identifying category name", "type": "string" }, "values": { - "description": "A collection of values related to the artifact", + "description": "The artifact's identifying category name", "type": "array", "items": { "default": {}, @@ -488,6 +475,7 @@ }, "spec": { "description": "Spec is a specification of a custom task", + "default": {}, "$ref": "#/definitions/k8s.io.apimachinery.pkg.runtime.RawExtension" } } @@ -547,6 +535,7 @@ }, "spec": { "description": "Spec is a specification of a custom task", + "default": {}, "$ref": "#/definitions/k8s.io.apimachinery.pkg.runtime.RawExtension" }, "stepTemplate": { @@ -673,6 +662,7 @@ "default": "" }, "value": { + "default": {}, "$ref": "#/definitions/v1beta1.ParamValue" } } @@ -839,7 +829,7 @@ "type": "string" }, "bundle": { - "description": "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead. The field is staying there for go client backward compatibility, but is not used/allowed anymore.", + "description": "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead.", "type": "string" }, "name": { @@ -904,6 +894,7 @@ }, "value": { "description": "Value the expression used to retrieve the value", + "default": {}, "$ref": "#/definitions/v1beta1.ParamValue" } } @@ -974,6 +965,7 @@ }, "value": { "description": "Value is the result returned from the execution of this PipelineRun", + "default": {}, "$ref": "#/definitions/v1beta1.ParamValue" } } @@ -1730,10 +1722,6 @@ "$ref": "#/definitions/v1.Param" }, "x-kubernetes-list-type": "atomic" - }, - "url": { - "description": "URL is the runtime url passed to the resolver to help it figure out how to resolver the resource being requested. This is currently at an ALPHA stability level and subject to alpha API compatibility policies.", - "type": "string" } } }, @@ -1945,10 +1933,6 @@ "default": {}, "$ref": "#/definitions/v1.ResourceRequirements" }, - "restartPolicy": { - "description": "RestartPolicy refers to kubernetes RestartPolicy. It can only be set for an initContainer and must have it's policy set to \"Always\". It is currently left optional to help support Kubernetes versions prior to 1.29 when this feature was introduced.", - "type": "string" - }, "script": { "description": "Script is the contents of an executable file to execute.\n\nIf Script is not empty, the Step cannot have an Command or Args.", "type": "string" @@ -2256,13 +2240,6 @@ "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, - "when": { - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1beta1.WhenExpression" - } - }, "workingDir": { "description": "Step's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" @@ -2278,141 +2255,6 @@ } } }, - "v1beta1.StepAction": { - "description": "StepAction represents the actionable components of Step. The Step can only reference it from the cluster or using remote resolution.", - "type": "object", - "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": { - "default": {}, - "$ref": "#/definitions/v1.ObjectMeta" - }, - "spec": { - "description": "Spec holds the desired state of the Step from the client", - "default": {}, - "$ref": "#/definitions/v1beta1.StepActionSpec" - } - } - }, - "v1beta1.StepActionList": { - "description": "StepActionList contains a list of StepActions", - "type": "object", - "required": [ - "items" - ], - "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" - }, - "items": { - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1beta1.StepAction" - } - }, - "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": { - "default": {}, - "$ref": "#/definitions/v1.ListMeta" - } - } - }, - "v1beta1.StepActionSpec": { - "description": "StepActionSpec contains the actionable components of a step.", - "type": "object", - "properties": { - "args": { - "description": "Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "type": "array", - "items": { - "type": "string", - "default": "" - }, - "x-kubernetes-list-type": "atomic" - }, - "command": { - "description": "Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "type": "array", - "items": { - "type": "string", - "default": "" - }, - "x-kubernetes-list-type": "atomic" - }, - "description": { - "description": "Description is a user-facing description of the stepaction that may be used to populate a UI.", - "type": "string" - }, - "env": { - "description": "List of environment variables to set in the container. Cannot be updated.", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1.EnvVar" - }, - "x-kubernetes-list-type": "atomic", - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "image": { - "description": "Image reference name to run for this StepAction. More info: https://kubernetes.io/docs/concepts/containers/images", - "type": "string" - }, - "params": { - "description": "Params is a list of input parameters required to run the stepAction. Params must be supplied as inputs in Steps unless they declare a defaultvalue.", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1.ParamSpec" - }, - "x-kubernetes-list-type": "atomic" - }, - "results": { - "description": "Results are values that this StepAction can output", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1.StepResult" - }, - "x-kubernetes-list-type": "atomic" - }, - "script": { - "description": "Script is the contents of an executable file to execute.\n\nIf Script is not empty, the Step cannot have an Command and the Args will be passed to the Script.", - "type": "string" - }, - "securityContext": { - "description": "SecurityContext defines the security options the Step should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ The value set in StepAction will take precedence over the value from Task.", - "$ref": "#/definitions/v1.SecurityContext" - }, - "volumeMounts": { - "description": "Volumes to mount into the Step's filesystem. Cannot be updated.", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/v1.VolumeMount" - }, - "x-kubernetes-list-type": "atomic", - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge" - }, - "workingDir": { - "description": "Step's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - "type": "string" - } - } - }, "v1beta1.StepOutputConfig": { "description": "StepOutputConfig stores configuration for a step output stream.", "type": "object", @@ -2450,9 +2292,6 @@ "$ref": "#/definitions/v1beta1.Artifact" } }, - "provenance": { - "$ref": "#/definitions/v1beta1.Provenance" - }, "results": { "type": "array", "items": { @@ -2647,14 +2486,6 @@ "description": "TaskBreakpoints defines the breakpoint config for a particular Task", "type": "object", "properties": { - "beforeSteps": { - "type": "array", - "items": { - "type": "string", - "default": "" - }, - "x-kubernetes-list-type": "atomic" - }, "onFailure": { "description": "if enabled, pause TaskRun on failure of a step failed step will not exit", "type": "string" @@ -2698,7 +2529,7 @@ "type": "string" }, "bundle": { - "description": "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead. The field is staying there for go client backward compatibility, but is not used/allowed anymore.", + "description": "Bundle url reference to a Tekton Bundle.\n\nDeprecated: Please use ResolverRef with the bundles resolver instead.", "type": "string" }, "kind": { @@ -2970,6 +2801,7 @@ }, "value": { "description": "Value the given value of the result", + "default": {}, "$ref": "#/definitions/v1beta1.ParamValue" } } diff --git a/upstream/pkg/apis/pipeline/v1beta1/task_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/task_conversion.go index 9a0d4fe503d..4c026e10b60 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/task_conversion.go +++ b/upstream/pkg/apis/pipeline/v1beta1/task_conversion.go @@ -212,7 +212,7 @@ func serializeTaskDeprecations(meta *metav1.ObjectMeta, spec *TaskSpec, taskName existingDeprecations := taskDeprecations{} if str, ok := meta.Annotations[TaskDeprecationsAnnotationKey]; ok { if err := json.Unmarshal([]byte(str), &existingDeprecations); err != nil { - return fmt.Errorf("error serializing key %s from metadata: %w", TaskDeprecationsAnnotationKey, err) + return fmt.Errorf("error deserializing key %s from metadata: %w", TaskDeprecationsAnnotationKey, err) } } if taskDeprecation != nil { @@ -238,7 +238,7 @@ func deserializeTaskDeprecations(meta *metav1.ObjectMeta, spec *TaskSpec, taskNa if len(spec.Steps) != len(td.DeprecatedSteps) { return errors.New("length of deserialized steps mismatch the length of target steps") } - for i := range len(spec.Steps) { + for i := 0; i < len(spec.Steps); i++ { spec.Steps[i].DeprecatedPorts = td.DeprecatedSteps[i].DeprecatedPorts spec.Steps[i].DeprecatedLivenessProbe = td.DeprecatedSteps[i].DeprecatedLivenessProbe spec.Steps[i].DeprecatedReadinessProbe = td.DeprecatedSteps[i].DeprecatedReadinessProbe diff --git a/upstream/pkg/apis/pipeline/v1beta1/task_conversion_test.go b/upstream/pkg/apis/pipeline/v1beta1/task_conversion_test.go index 64aaca8ab10..ddf97617f8c 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/task_conversion_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/task_conversion_test.go @@ -95,22 +95,6 @@ spec: properties: key: type: string -` - stepWhenTaskYAML := ` -metadata: - name: foo - namespace: bar -spec: - displayName: "task-step-when" - description: test - steps: - - image: foo - name: should-execute - image: bash:latest - when: - - input: "$(workspaces.custom.bound)" - operator: in - values: ["true"] ` stepActionTaskYAML := ` metadata: @@ -346,9 +330,6 @@ spec: stepResultTaskV1beta1 := parse.MustParseV1beta1Task(t, stepResultTaskYAML) stepResultTaskV1 := parse.MustParseV1Task(t, stepResultTaskYAML) - stepWhenTaskV1beta1 := parse.MustParseV1beta1Task(t, stepWhenTaskYAML) - stepWhenTaskV1 := parse.MustParseV1Task(t, stepWhenTaskYAML) - stepActionTaskV1beta1 := parse.MustParseV1beta1Task(t, stepActionTaskYAML) stepActionTaskV1 := parse.MustParseV1Task(t, stepActionTaskYAML) @@ -394,10 +375,6 @@ spec: name: "step results in task", v1beta1Task: stepResultTaskV1beta1, v1Task: stepResultTaskV1, - }, { - name: "step when in task", - v1beta1Task: stepWhenTaskV1beta1, - v1Task: stepWhenTaskV1, }, { name: "step action in task", v1beta1Task: stepActionTaskV1beta1, diff --git a/upstream/pkg/apis/pipeline/v1beta1/task_validation.go b/upstream/pkg/apis/pipeline/v1beta1/task_validation.go index 4d03a950125..9ef0db6909a 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/task_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/task_validation.go @@ -249,9 +249,6 @@ func validateSteps(ctx context.Context, steps []Step) (errs *apis.FieldError) { errs = errs.Also(v1.ValidateStepResultsVariables(ctx, s.Results, s.Script).ViaIndex(idx)) errs = errs.Also(v1.ValidateStepResults(ctx, s.Results).ViaIndex(idx).ViaField("results")) } - if len(s.When) > 0 { - errs = errs.Also(s.When.validate(ctx).ViaIndex(idx)) - } } return errs } @@ -304,11 +301,7 @@ func errorIfStepResultReferenceinField(value, fieldName string) (errs *apis.Fiel } func stepArtifactReferenceExists(src string) bool { - return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+artifactref.StepArtifactPathPattern+")") -} - -func taskArtifactReferenceExists(src string) bool { - return len(artifactref.TaskArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$("+artifactref.TaskArtifactPathPattern+")") + return len(artifactref.StepArtifactRegex.FindAllStringSubmatch(src, -1)) > 0 || strings.Contains(src, "$(step.artifacts.path)") } func errorIfStepArtifactReferencedInField(value, fieldName string) (errs *apis.FieldError) { @@ -375,8 +368,17 @@ func validateStepResultReference(s Step) (errs *apis.FieldError) { } func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.FieldError) { - if err := validateArtifactsReferencesInStep(ctx, s); err != nil { - return err + if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { + var t []string + t = append(t, s.Script) + t = append(t, s.Command...) + t = append(t, s.Args...) + for _, e := range s.Env { + t = append(t, e.Value) + } + if slices.ContainsFunc(t, stepArtifactReferenceExists) { + return errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "")) + } } if s.Ref != nil { @@ -444,11 +446,6 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true in order to use Results in Steps.", config.EnableStepActions), "") } } - if len(s.When) > 0 { - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableStepActions && isCreateOrUpdateAndDiverged(ctx, s) { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true in order to use When in Steps.", config.EnableStepActions), "") - } - } if s.Image == "" { errs = errs.Also(apis.ErrMissingField("Image")) } @@ -532,22 +529,6 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi return errs } -func validateArtifactsReferencesInStep(ctx context.Context, s Step) *apis.FieldError { - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableArtifacts { - var t []string - t = append(t, s.Script) - t = append(t, s.Command...) - t = append(t, s.Args...) - for _, e := range s.Env { - t = append(t, e.Value) - } - if slices.ContainsFunc(t, stepArtifactReferenceExists) || slices.ContainsFunc(t, taskArtifactReferenceExists) { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), "") - } - } - return nil -} - // ValidateParameterTypes validates all the types within a slice of ParamSpecs func ValidateParameterTypes(ctx context.Context, params []ParamSpec) (errs *apis.FieldError) { for _, p := range params { diff --git a/upstream/pkg/apis/pipeline/v1beta1/task_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/task_validation_test.go index fec9351b99e..4f36224b78e 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/task_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/task_validation_test.go @@ -33,9 +33,7 @@ import ( "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/utils/pointer" "knative.dev/pkg/apis" ) @@ -339,41 +337,6 @@ func TestTaskSpecValidate(t *testing.T) { hello world`, }}, }, - }, { - name: "step template included in validation with stepaction", - fields: fields{ - Steps: []v1beta1.Step{{ - Name: "astep", - Ref: &v1beta1.Ref{ - Name: "stepAction", - }, - }}, - StepTemplate: &v1beta1.StepTemplate{ - Image: "some-image", - SecurityContext: &corev1.SecurityContext{ - RunAsNonRoot: pointer.Bool(true), - }, - VolumeMounts: []corev1.VolumeMount{{ - Name: "data", - MountPath: "/workspace/data", - }}, - Env: []corev1.EnvVar{{ - Name: "KEEP_THIS", - Value: "A_VALUE", - }, { - Name: "SOME_KEY_1", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "A_KEY", - LocalObjectReference: corev1.LocalObjectReference{Name: "A_NAME"}, - }, - }, - }, { - Name: "SOME_KEY_2", - Value: "VALUE_2", - }}, - }, - }, }, { name: "valid step with parameterized script", fields: fields{ @@ -797,7 +760,8 @@ func TestTaskValidateError(t *testing.T) { Spec: v1beta1.TaskSpec{ Params: tt.fields.Params, Steps: tt.fields.Steps, - }} + }, + } ctx := cfgtesting.EnableAlphaAPIFields(context.Background()) task.SetDefaults(ctx) err := task.Validate(ctx) @@ -1117,7 +1081,8 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "mystep", Image: "my-image", WorkingDir: "/foo/bar/src/", - }}, + }, + }, }, expectedError: apis.FieldError{ Message: `variable type invalid in "$(params.baz[*])"`, @@ -1470,43 +1435,44 @@ func TestTaskSpecValidateErrorWithStepActionRef_CreateUpdateEvent(t *testing.T) isCreate bool isUpdate bool expectedError apis.FieldError - }{{ - name: "is create ctx", - Steps: []v1beta1.Step{{ - Ref: &v1beta1.Ref{ - Name: "stepAction", + }{ + { + name: "is create ctx", + Steps: []v1beta1.Step{{ + Ref: &v1beta1.Ref{ + Name: "stepAction", + }, + }}, + isCreate: true, + isUpdate: false, + expectedError: apis.FieldError{ + Message: "feature flag enable-step-actions should be set to true to reference StepActions in Steps.", + Paths: []string{"steps[0]"}, }, - }}, - isCreate: true, - isUpdate: false, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true to reference StepActions in Steps.", - Paths: []string{"steps[0]"}, - }, - }, { - name: "is update ctx", - Steps: []v1beta1.Step{{ - Ref: &v1beta1.Ref{ - Name: "stepAction", + }, { + name: "is update ctx", + Steps: []v1beta1.Step{{ + Ref: &v1beta1.Ref{ + Name: "stepAction", + }, + }}, + isCreate: false, + isUpdate: true, + expectedError: apis.FieldError{ + Message: "feature flag enable-step-actions should be set to true to reference StepActions in Steps.", + Paths: []string{"steps[0]"}, }, - }}, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true to reference StepActions in Steps.", - Paths: []string{"steps[0]"}, + }, { + name: "ctx is not create or update", + Steps: []v1beta1.Step{{ + Ref: &v1beta1.Ref{ + Name: "stepAction", + }, + }}, + isCreate: false, + isUpdate: false, + expectedError: apis.FieldError{}, }, - }, { - name: "ctx is not create or update", - Steps: []v1beta1.Step{{ - Ref: &v1beta1.Ref{ - Name: "stepAction", - }, - }}, - isCreate: false, - isUpdate: false, - expectedError: apis.FieldError{}, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1682,85 +1648,86 @@ func TestTaskSpecValidateErrorWithStepResultRef(t *testing.T) { name string Steps []v1beta1.Step expectedError apis.FieldError - }{{ - name: "Cannot reference step results in image", - Steps: []v1beta1.Step{{ - Image: "$(steps.prevStep.results.resultName)", - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].image"}, - }, - }, { - name: "Cannot reference step results in script", - Steps: []v1beta1.Step{{ - Image: "my-img", - Script: "echo $(steps.prevStep.results.resultName)", - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].script"}, - }, - }, { - name: "Cannot reference step results in workingDir", - Steps: []v1beta1.Step{{ - Image: "my-img", - WorkingDir: "$(steps.prevStep.results.resultName)", - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].workingDir"}, - }, - }, { - name: "Cannot reference step results in envFrom", - Steps: []v1beta1.Step{{ - Image: "my-img", - EnvFrom: []corev1.EnvFromSource{{ - Prefix: "$(steps.prevStep.results.resultName)", - ConfigMapRef: &corev1.ConfigMapEnvSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(steps.prevStep.results.resultName)", + }{ + { + name: "Cannot reference step results in image", + Steps: []v1beta1.Step{{ + Image: "$(steps.prevStep.results.resultName)", + }}, + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].image"}, + }, + }, { + name: "Cannot reference step results in script", + Steps: []v1beta1.Step{{ + Image: "my-img", + Script: "echo $(steps.prevStep.results.resultName)", + }}, + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].script"}, + }, + }, { + name: "Cannot reference step results in workingDir", + Steps: []v1beta1.Step{{ + Image: "my-img", + WorkingDir: "$(steps.prevStep.results.resultName)", + }}, + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].workingDir"}, + }, + }, { + name: "Cannot reference step results in envFrom", + Steps: []v1beta1.Step{{ + Image: "my-img", + EnvFrom: []corev1.EnvFromSource{{ + Prefix: "$(steps.prevStep.results.resultName)", + ConfigMapRef: &corev1.ConfigMapEnvSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(steps.prevStep.results.resultName)", + }, }, - }, - SecretRef: &corev1.SecretEnvSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(steps.prevStep.results.resultName)", + SecretRef: &corev1.SecretEnvSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(steps.prevStep.results.resultName)", + }, }, - }, + }}, }}, - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].envFrom.configMapRef", "steps[0].envFrom.prefix", "steps[0].envFrom.secretRef"}, - }, - }, { - name: "Cannot reference step results in VolumeMounts", - Steps: []v1beta1.Step{{ - Image: "my-img", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(steps.prevStep.results.resultName)", - MountPath: "$(steps.prevStep.results.resultName)", - SubPath: "$(steps.prevStep.results.resultName)", + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].envFrom.configMapRef", "steps[0].envFrom.prefix", "steps[0].envFrom.secretRef"}, + }, + }, { + name: "Cannot reference step results in VolumeMounts", + Steps: []v1beta1.Step{{ + Image: "my-img", + VolumeMounts: []corev1.VolumeMount{{ + Name: "$(steps.prevStep.results.resultName)", + MountPath: "$(steps.prevStep.results.resultName)", + SubPath: "$(steps.prevStep.results.resultName)", + }}, }}, - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].volumeMounts.name", "steps[0].volumeMounts.mountPath", "steps[0].volumeMounts.subPath"}, - }, - }, { - name: "Cannot reference step results in VolumeDevices", - Steps: []v1beta1.Step{{ - Image: "my-img", - VolumeDevices: []corev1.VolumeDevice{{ - Name: "$(steps.prevStep.results.resultName)", - DevicePath: "$(steps.prevStep.results.resultName)", + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].volumeMounts.name", "steps[0].volumeMounts.mountPath", "steps[0].volumeMounts.subPath"}, + }, + }, { + name: "Cannot reference step results in VolumeDevices", + Steps: []v1beta1.Step{{ + Image: "my-img", + VolumeDevices: []corev1.VolumeDevice{{ + Name: "$(steps.prevStep.results.resultName)", + DevicePath: "$(steps.prevStep.results.resultName)", + }}, }}, - }}, - expectedError: apis.FieldError{ - Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", - Paths: []string{"steps[0].volumeDevices.name", "steps[0].volumeDevices.devicePath"}, + expectedError: apis.FieldError{ + Message: "stepResult substitutions are only allowed in env, command and args. Found usage in", + Paths: []string{"steps[0].volumeDevices.name", "steps[0].volumeDevices.devicePath"}, + }, }, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -2014,70 +1981,72 @@ func TestIncompatibleAPIVersions(t *testing.T) { name string requiredVersion string spec v1beta1.TaskSpec - }{{ - name: "step workspace requires beta", - requiredVersion: "beta", - spec: v1beta1.TaskSpec{ - Workspaces: []v1beta1.WorkspaceDeclaration{{ - Name: "foo", - }}, - Steps: []v1beta1.Step{{ - Image: "foo", - Workspaces: []v1beta1.WorkspaceUsage{{ + }{ + { + name: "step workspace requires beta", + requiredVersion: "beta", + spec: v1beta1.TaskSpec{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "foo", }}, - }}, - }, - }, { - name: "sidecar workspace requires beta", - requiredVersion: "beta", - spec: v1beta1.TaskSpec{ - Workspaces: []v1beta1.WorkspaceDeclaration{{ - Name: "foo", - }}, - Steps: []v1beta1.Step{{ - Image: "foo", - }}, - Sidecars: []v1beta1.Sidecar{{ - Image: "foo", - Workspaces: []v1beta1.WorkspaceUsage{{ + Steps: []v1beta1.Step{{ + Image: "foo", + Workspaces: []v1beta1.WorkspaceUsage{{ + Name: "foo", + }}, + }}, + }, + }, { + name: "sidecar workspace requires beta", + requiredVersion: "beta", + spec: v1beta1.TaskSpec{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "foo", }}, - }}, - }, - }, { - name: "windows script support requires alpha", - requiredVersion: "alpha", - spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{ - Image: "my-image", - Script: ` + Steps: []v1beta1.Step{{ + Image: "foo", + }}, + Sidecars: []v1beta1.Sidecar{{ + Image: "foo", + Workspaces: []v1beta1.WorkspaceUsage{{ + Name: "foo", + }}, + }}, + }, + }, { + name: "windows script support requires alpha", + requiredVersion: "alpha", + spec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + Image: "my-image", + Script: ` #!win powershell -File script-1`, - }}, - }, - }, { - name: "stdout stream support requires alpha", - requiredVersion: "alpha", - spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{ - Image: "foo", - StdoutConfig: &v1beta1.StepOutputConfig{ - Path: "/tmp/stdout.txt", - }, - }}, + }}, + }, + }, { + name: "stdout stream support requires alpha", + requiredVersion: "alpha", + spec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + Image: "foo", + StdoutConfig: &v1beta1.StepOutputConfig{ + Path: "/tmp/stdout.txt", + }, + }}, + }, + }, { + name: "stderr stream support requires alpha", + requiredVersion: "alpha", + spec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + Image: "foo", + StderrConfig: &v1beta1.StepOutputConfig{ + Path: "/tmp/stderr.txt", + }, + }}, + }, }, - }, { - name: "stderr stream support requires alpha", - requiredVersion: "alpha", - spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{ - Image: "foo", - StderrConfig: &v1beta1.StepOutputConfig{ - Path: "/tmp/stderr.txt", - }, - }}, - }}, } { for _, version := range versions { testName := fmt.Sprintf("(using %s) %s", version, tt.name) @@ -2115,161 +2084,165 @@ func TestGetArrayIndexParamRefs(t *testing.T) { name string taskspec *v1beta1.TaskSpec want sets.String - }{{ - name: "steps reference", - taskspec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "array-params", - Default: v1beta1.NewStructuredValues("bar", "foo"), - }}, - Steps: []v1beta1.Step{{ - Name: "$(params.array-params[10])", - Image: "$(params.array-params[11])", - Command: []string{"$(params.array-params[12])"}, - Args: []string{"$(params.array-params[13])"}, - Script: "echo $(params.array-params[14])", - Env: []corev1.EnvVar{{ - Value: "$(params.array-params[15])", - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - Key: "$(params.array-params[16])", - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[17])", + }{ + { + name: "steps reference", + taskspec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "array-params", + Default: v1beta1.NewStructuredValues("bar", "foo"), + }}, + Steps: []v1beta1.Step{{ + Name: "$(params.array-params[10])", + Image: "$(params.array-params[11])", + Command: []string{"$(params.array-params[12])"}, + Args: []string{"$(params.array-params[13])"}, + Script: "echo $(params.array-params[14])", + Env: []corev1.EnvVar{{ + Value: "$(params.array-params[15])", + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + Key: "$(params.array-params[16])", + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(params.array-params[17])", + }, + }, + ConfigMapKeyRef: &corev1.ConfigMapKeySelector{ + Key: "$(params.array-params[18])", + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(params.array-params[19])", + }, }, }, - ConfigMapKeyRef: &corev1.ConfigMapKeySelector{ - Key: "$(params.array-params[18])", + }}, + EnvFrom: []corev1.EnvFromSource{{ + Prefix: "$(params.array-params[20])", + ConfigMapRef: &corev1.ConfigMapEnvSource{ LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[19])", + Name: "$(params.array-params[21])", }, }, - }, - }}, - EnvFrom: []corev1.EnvFromSource{{ - Prefix: "$(params.array-params[20])", - ConfigMapRef: &corev1.ConfigMapEnvSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[21])", - }, - }, - SecretRef: &corev1.SecretEnvSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[22])", + SecretRef: &corev1.SecretEnvSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(params.array-params[22])", + }, }, - }, - }}, - WorkingDir: "$(params.array-params[23])", - VolumeMounts: []corev1.VolumeMount{{ - Name: "$(params.array-params[24])", - MountPath: "$(params.array-params[25])", - SubPath: "$(params.array-params[26])", + }}, + WorkingDir: "$(params.array-params[23])", + VolumeMounts: []corev1.VolumeMount{{ + Name: "$(params.array-params[24])", + MountPath: "$(params.array-params[25])", + SubPath: "$(params.array-params[26])", + }}, }}, - }}, - StepTemplate: &v1beta1.StepTemplate{ - Image: "$(params.array-params[27])", + StepTemplate: &v1beta1.StepTemplate{ + Image: "$(params.array-params[27])", + }, }, - }, - want: sets.NewString("$(params.array-params[10])", "$(params.array-params[11])", "$(params.array-params[12])", "$(params.array-params[13])", "$(params.array-params[14])", - "$(params.array-params[15])", "$(params.array-params[16])", "$(params.array-params[17])", "$(params.array-params[18])", "$(params.array-params[19])", "$(params.array-params[20])", - "$(params.array-params[21])", "$(params.array-params[22])", "$(params.array-params[23])", "$(params.array-params[24])", "$(params.array-params[25])", "$(params.array-params[26])", "$(params.array-params[27])"), - }, { - name: "stepTemplate reference", - taskspec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "array-params", - Default: v1beta1.NewStructuredValues("bar", "foo"), - }}, - StepTemplate: &v1beta1.StepTemplate{ - Image: "$(params.array-params[3])", + want: sets.NewString("$(params.array-params[10])", "$(params.array-params[11])", "$(params.array-params[12])", "$(params.array-params[13])", "$(params.array-params[14])", + "$(params.array-params[15])", "$(params.array-params[16])", "$(params.array-params[17])", "$(params.array-params[18])", "$(params.array-params[19])", "$(params.array-params[20])", + "$(params.array-params[21])", "$(params.array-params[22])", "$(params.array-params[23])", "$(params.array-params[24])", "$(params.array-params[25])", "$(params.array-params[26])", "$(params.array-params[27])"), + }, { + name: "stepTemplate reference", + taskspec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "array-params", + Default: v1beta1.NewStructuredValues("bar", "foo"), + }}, + StepTemplate: &v1beta1.StepTemplate{ + Image: "$(params.array-params[3])", + }, }, - }, - want: sets.NewString("$(params.array-params[3])"), - }, { - name: "volumes references", - taskspec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "array-params", - Default: v1beta1.NewStructuredValues("bar", "foo"), - }}, - Volumes: []corev1.Volume{{ - Name: "$(params.array-params[10])", - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[11])", - }, - Items: []corev1.KeyToPath{{ - Key: "$(params.array-params[12])", - Path: "$(params.array-params[13])", - }, - }, - }, - Secret: &corev1.SecretVolumeSource{ - SecretName: "$(params.array-params[14])", - Items: []corev1.KeyToPath{{ - Key: "$(params.array-params[15])", - Path: "$(params.array-params[16])", - }}, - }, - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: "$(params.array-params[17])", - }, - Projected: &corev1.ProjectedVolumeSource{ - Sources: []corev1.VolumeProjection{{ - ConfigMap: &corev1.ConfigMapProjection{ + want: sets.NewString("$(params.array-params[3])"), + }, { + name: "volumes references", + taskspec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "array-params", + Default: v1beta1.NewStructuredValues("bar", "foo"), + }}, + Volumes: []corev1.Volume{ + { + Name: "$(params.array-params[10])", + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[18])", + Name: "$(params.array-params[11])", }, - }, - Secret: &corev1.SecretProjection{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "$(params.array-params[19])", + Items: []corev1.KeyToPath{ + { + Key: "$(params.array-params[12])", + Path: "$(params.array-params[13])", + }, }, }, - ServiceAccountToken: &corev1.ServiceAccountTokenProjection{ - Audience: "$(params.array-params[20])", + Secret: &corev1.SecretVolumeSource{ + SecretName: "$(params.array-params[14])", + Items: []corev1.KeyToPath{{ + Key: "$(params.array-params[15])", + Path: "$(params.array-params[16])", + }}, + }, + PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ + ClaimName: "$(params.array-params[17])", + }, + Projected: &corev1.ProjectedVolumeSource{ + Sources: []corev1.VolumeProjection{{ + ConfigMap: &corev1.ConfigMapProjection{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(params.array-params[18])", + }, + }, + Secret: &corev1.SecretProjection{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "$(params.array-params[19])", + }, + }, + ServiceAccountToken: &corev1.ServiceAccountTokenProjection{ + Audience: "$(params.array-params[20])", + }, + }}, + }, + CSI: &corev1.CSIVolumeSource{ + NodePublishSecretRef: &corev1.LocalObjectReference{ + Name: "$(params.array-params[21])", + }, + VolumeAttributes: map[string]string{"key": "$(params.array-params[22])"}, }, - }}, - }, - CSI: &corev1.CSIVolumeSource{ - NodePublishSecretRef: &corev1.LocalObjectReference{ - Name: "$(params.array-params[21])", }, - VolumeAttributes: map[string]string{"key": "$(params.array-params[22])"}, }, }, }, + want: sets.NewString("$(params.array-params[10])", "$(params.array-params[11])", "$(params.array-params[12])", "$(params.array-params[13])", "$(params.array-params[14])", + "$(params.array-params[15])", "$(params.array-params[16])", "$(params.array-params[17])", "$(params.array-params[18])", "$(params.array-params[19])", "$(params.array-params[20])", + "$(params.array-params[21])", "$(params.array-params[22])"), + }, { + name: "workspaces references", + taskspec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "array-params", + Default: v1beta1.NewStructuredValues("bar", "foo"), + }}, + Workspaces: []v1beta1.WorkspaceDeclaration{{ + MountPath: "$(params.array-params[3])", + }}, }, - }, - want: sets.NewString("$(params.array-params[10])", "$(params.array-params[11])", "$(params.array-params[12])", "$(params.array-params[13])", "$(params.array-params[14])", - "$(params.array-params[15])", "$(params.array-params[16])", "$(params.array-params[17])", "$(params.array-params[18])", "$(params.array-params[19])", "$(params.array-params[20])", - "$(params.array-params[21])", "$(params.array-params[22])"), - }, { - name: "workspaces references", - taskspec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "array-params", - Default: v1beta1.NewStructuredValues("bar", "foo"), - }}, - Workspaces: []v1beta1.WorkspaceDeclaration{{ - MountPath: "$(params.array-params[3])", - }}, - }, - want: sets.NewString("$(params.array-params[3])"), - }, { - name: "sidecar references", - taskspec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "array-params", - Default: v1beta1.NewStructuredValues("bar", "foo"), - }}, - Sidecars: []v1beta1.Sidecar{{ - Script: "$(params.array-params[3])", - }, + want: sets.NewString("$(params.array-params[3])"), + }, { + name: "sidecar references", + taskspec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "array-params", + Default: v1beta1.NewStructuredValues("bar", "foo"), + }}, + Sidecars: []v1beta1.Sidecar{ + { + Script: "$(params.array-params[3])", + }, + }, }, + want: sets.NewString("$(params.array-params[3])"), }, - want: sets.NewString("$(params.array-params[3])"), - }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { @@ -2623,7 +2596,7 @@ func TestTaskSpecValidateSuccessWithArtifactsRefFlagEnabled(t *testing.T) { name: "reference step artifacts in Env", Steps: []v1beta1.Step{{ Image: "busybox", - Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs.image)"}}, + Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs)"}}, }}, }, { @@ -2705,7 +2678,7 @@ func TestTaskSpecValidateErrorWithArtifactsRefFlagNotEnabled(t *testing.T) { { name: "Cannot reference step artifacts in Env without setting enable-artifacts to true", Steps: []v1beta1.Step{{ - Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs.image)"}}, + Env: []corev1.EnvVar{{Name: "AAA", Value: "$(steps.aaa.outputs)"}}, }}, expectedError: apis.FieldError{ Message: fmt.Sprintf("feature flag %s should be set to true to use artifacts feature.", config.EnableArtifacts), @@ -2905,85 +2878,3 @@ func TestTaskSpecValidateErrorWithArtifactsRef(t *testing.T) { }) } } - -func TestTaskSpecValidate_StepWhen_Error(t *testing.T) { - tests := []struct { - name string - ts *v1beta1.TaskSpec - isCreate bool - Results []v1.StepResult - isUpdate bool - baselineTaskRun *v1beta1.TaskRun - expectedError apis.FieldError - EnableStepAction bool - EnableCEL bool - }{ - { - name: "step when not allowed without enable step actions - create event", - ts: &v1beta1.TaskSpec{Steps: []v1beta1.Step{{ - Image: "my-image", - When: v1beta1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo"}}}, - }}}, - isCreate: true, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true in order to use When in Steps.", - Paths: []string{"steps[0]"}, - }, - }, - { - name: "step when not allowed without enable step actions - update and diverged event", - ts: &v1beta1.TaskSpec{Steps: []v1beta1.Step{{ - Image: "my-image", - When: v1beta1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo"}}}, - }}}, - isUpdate: true, - baselineTaskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{ - Image: "my-image", - Results: []v1.StepResult{{Name: "a-result"}}, - }}, - }, - }, - }, - expectedError: apis.FieldError{ - Message: "feature flag enable-step-actions should be set to true in order to use When in Steps.", - Paths: []string{"steps[0]"}, - }, - }, - { - name: "cel not allowed if EnableCELInWhenExpression is false", - ts: &v1beta1.TaskSpec{Steps: []v1beta1.Step{{ - Image: "my-image", - When: v1beta1.StepWhenExpressions{{CEL: "'d'=='d'"}}, - }}}, - EnableStepAction: true, - expectedError: apis.FieldError{ - Message: `feature flag enable-cel-in-whenexpression should be set to true to use CEL: 'd'=='d' in WhenExpression`, - Paths: []string{"steps[0].when[0]"}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{ - EnableStepActions: tt.EnableStepAction, - EnableCELInWhenExpression: tt.EnableCEL, - }, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselineTaskRun) - } - tt.ts.SetDefaults(ctx) - err := tt.ts.Validate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("StepActionSpec.Validate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskref_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/taskref_conversion.go index 1b163970b31..c089e9e0dbf 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskref_conversion.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskref_conversion.go @@ -23,12 +23,15 @@ import ( ) func (tr TaskRef) convertTo(ctx context.Context, sink *v1.TaskRef) { - sink.Name = tr.Name + if tr.Bundle == "" { + sink.Name = tr.Name + } sink.Kind = v1.TaskKind(tr.Kind) sink.APIVersion = tr.APIVersion new := v1.ResolverRef{} tr.ResolverRef.convertTo(ctx, &new) sink.ResolverRef = new + tr.convertBundleToResolver(sink) } // ConvertFrom converts v1beta1 TaskRef from v1 TaskRef @@ -40,3 +43,25 @@ func (tr *TaskRef) ConvertFrom(ctx context.Context, source v1.TaskRef) { new.convertFrom(ctx, source.ResolverRef) tr.ResolverRef = new } + +// convertBundleToResolver converts v1beta1 bundle string to a remote reference with the bundle resolver in v1. +// The conversion from Resolver to Bundle is not being supported since remote resolution would be turned on by +// default and it will be in beta before the stored version of CRD getting swapped to v1. +func (tr TaskRef) convertBundleToResolver(sink *v1.TaskRef) { + if tr.Bundle != "" { + sink.Kind = "" + sink.ResolverRef = v1.ResolverRef{ + Resolver: "bundles", + Params: v1.Params{{ + Name: "bundle", + Value: v1.ParamValue{StringVal: tr.Bundle, Type: v1.ParamTypeString}, + }, { + Name: "name", + Value: v1.ParamValue{StringVal: tr.Name, Type: v1.ParamTypeString}, + }, { + Name: "kind", + Value: v1.ParamValue{StringVal: "Task", Type: v1.ParamTypeString}, + }}, + } + } +} diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskref_types.go b/upstream/pkg/apis/pipeline/v1beta1/taskref_types.go index 9781a4a2133..f8f231cd961 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskref_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskref_types.go @@ -32,7 +32,6 @@ type TaskRef struct { // Bundle url reference to a Tekton Bundle. // // Deprecated: Please use ResolverRef with the bundles resolver instead. - // The field is staying there for go client backward compatibility, but is not used/allowed anymore. // +optional Bundle string `json:"bundle,omitempty"` diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskref_validation.go b/upstream/pkg/apis/pipeline/v1beta1/taskref_validation.go index 866dfadd27d..a3e2bb036c3 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskref_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskref_validation.go @@ -18,9 +18,9 @@ package v1beta1 import ( "context" - "fmt" "strings" + "github.com/google/go-containerregistry/pkg/name" "github.com/tektoncd/pipeline/pkg/apis/config" "k8s.io/apimachinery/pkg/util/validation" "knative.dev/pkg/apis" @@ -32,56 +32,46 @@ func (ref *TaskRef) Validate(ctx context.Context) (errs *apis.FieldError) { if ref == nil { return errs } - if apis.IsInCreate(ctx) && ref.Bundle != "" { - errs = errs.Also(apis.ErrDisallowedFields("bundle")) - } + switch { case ref.Resolver != "" || ref.Params != nil: + if ref.Resolver != "" { + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) + if ref.Name != "" { + errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver")) + } + if ref.Bundle != "" { + errs = errs.Also(apis.ErrMultipleOneOf("bundle", "resolver")) + } + } if ref.Params != nil { errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) if ref.Name != "" { errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) } + if ref.Bundle != "" { + errs = errs.Also(apis.ErrMultipleOneOf("bundle", "params")) + } if ref.Resolver == "" { errs = errs.Also(apis.ErrMissingField("resolver")) } errs = errs.Also(ValidateParameters(ctx, ref.Params)) } - if ref.Resolver != "" { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "resolver", config.BetaAPIFields).ViaField("resolver")) - if ref.Name != "" { - // make sure that the name is url-like. - err := RefNameLikeUrl(ref.Name) - if err == nil && !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - // If name is url-like then concise resolver syntax must be enabled - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(err, "name")) - } - } + case ref.Bundle != "": + if ref.Name == "" { + errs = errs.Also(apis.ErrMissingField("name")) } - case ref.Name != "": - // ref name can be a Url-like format. - if err := RefNameLikeUrl(ref.Name); err == nil { - // If name is url-like then concise resolver syntax must be enabled - if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableConciseResolverSyntax { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use concise resolver syntax", config.EnableConciseResolverSyntax), "")) - } - // In stage1 of concise remote resolvers syntax, this is a required field. - // TODO: remove this check when implementing stage 2 where this is optional. - if ref.Resolver == "" { - errs = errs.Also(apis.ErrMissingField("resolver")) - } - // Or, it must be a valid k8s name - } else { - // ref name must be a valid k8s name - if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { - errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) - } + errs = errs.Also(validateBundleFeatureFlag(ctx, "bundle", true).ViaField("bundle")) + if _, err := name.ParseReference(ref.Bundle); err != nil { + errs = errs.Also(apis.ErrInvalidValue("invalid bundle reference", "bundle", err.Error())) } default: - errs = errs.Also(apis.ErrMissingField("name")) + if ref.Name == "" { + errs = errs.Also(apis.ErrMissingField("name")) + } else if errSlice := validation.IsQualifiedName(ref.Name); len(errSlice) != 0 { + // TaskRef name must be a valid k8s name + errs = errs.Also(apis.ErrInvalidValue(strings.Join(errSlice, ","), "name")) + } } - return //nolint:nakedret + return errs } diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskref_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/taskref_validation_test.go index 5c44529ae22..7d1f4f488ff 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskref_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskref_validation_test.go @@ -60,6 +60,12 @@ func TestTaskRef_Valid(t *testing.T) { StringVal: "baz", }, }}}}, + }, { + name: "valid bundle", + taskRef: &v1beta1.TaskRef{ + Name: "bundled-task", + Bundle: "gcr.io/my-bundle"}, + wc: enableTektonOCIBundles(t), }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -85,45 +91,85 @@ func TestTaskRef_Invalid(t *testing.T) { taskRef: &v1beta1.TaskRef{}, wantErr: apis.ErrMissingField("name"), }, { - name: "taskRef with resolver and k8s style name", + name: "use of bundle without the feature flag set", + taskRef: &v1beta1.TaskRef{ + Name: "my-task", + Bundle: "docker.io/foo", + }, + wantErr: apis.ErrGeneric("bundle requires \"enable-tekton-oci-bundles\" feature gate to be true but it is false"), + }, { + name: "bundle missing name", + taskRef: &v1beta1.TaskRef{ + Bundle: "docker.io/foo", + }, + wantErr: apis.ErrMissingField("name"), + wc: enableTektonOCIBundles(t), + }, { + name: "invalid bundle reference", + taskRef: &v1beta1.TaskRef{ + Name: "my-task", + Bundle: "invalid reference", + }, + wantErr: apis.ErrInvalidValue("invalid bundle reference", "bundle", "could not parse reference: invalid reference"), + wc: enableTektonOCIBundles(t), + }, { + name: "taskref params disallowed without resolver", taskRef: &v1beta1.TaskRef{ - Name: "foo", ResolverRef: v1beta1.ResolverRef{ - Resolver: "git", + Params: v1beta1.Params{}, }, }, - wantErr: apis.ErrInvalidValue(`invalid URI for request`, "name"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMissingField("resolver"), }, { - name: "taskRef with url-like name without resolver", + name: "taskref resolver disallowed in conjunction with taskref name", taskRef: &v1beta1.TaskRef{ - Name: "https://foo.com/bar", + Name: "foo", + ResolverRef: v1beta1.ResolverRef{ + Resolver: "git", + }, }, - wantErr: apis.ErrMissingField("resolver"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("name", "resolver"), }, { - name: "taskRef params disallowed in conjunction with pipelineref name", + name: "taskref resolver disallowed in conjunction with taskref bundle", taskRef: &v1beta1.TaskRef{ - Name: "https://foo/bar", + Bundle: "bar", ResolverRef: v1beta1.ResolverRef{ Resolver: "git", - Params: v1beta1.Params{{Name: "foo", Value: v1beta1.ParamValue{StringVal: "bar"}}}, }, }, - wantErr: apis.ErrMultipleOneOf("name", "params"), - wc: enableConciseResolverSyntax, + wantErr: apis.ErrMultipleOneOf("bundle", "resolver"), + wc: enableTektonOCIBundles(t), }, { - name: "taskRef with url-like name without enable-concise-resolver-syntax", - taskRef: &v1beta1.TaskRef{Name: "https://foo.com/bar"}, - wantErr: apis.ErrMissingField("resolver").Also(&apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, - }), + name: "taskref params disallowed in conjunction with taskref name", + taskRef: &v1beta1.TaskRef{ + Name: "bar", + ResolverRef: v1beta1.ResolverRef{ + Params: v1beta1.Params{{ + Name: "foo", + Value: v1beta1.ParamValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", + }, + }}, + }, + }, + wantErr: apis.ErrMultipleOneOf("name", "params").Also(apis.ErrMissingField("resolver")), }, { - name: "taskRef without enable-concise-resolver-syntax", - taskRef: &v1beta1.TaskRef{Name: "https://foo.com/bar", ResolverRef: v1beta1.ResolverRef{Resolver: "git"}}, - wantErr: &apis.FieldError{ - Message: `feature flag enable-concise-resolver-syntax should be set to true to use concise resolver syntax`, + name: "taskref params disallowed in conjunction with taskref bundle", + taskRef: &v1beta1.TaskRef{ + Bundle: "bar", + ResolverRef: v1beta1.ResolverRef{ + Params: v1beta1.Params{{ + Name: "foo", + Value: v1beta1.ParamValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", + }, + }}, + }, }, + wantErr: apis.ErrMultipleOneOf("bundle", "params").Also(apis.ErrMissingField("resolver")), + wc: enableTektonOCIBundles(t), }, { name: "invalid taskref name", taskRef: &v1beta1.TaskRef{Name: "_foo"}, diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion.go index fb01170254f..e9b1bed4f7a 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion.go @@ -214,18 +214,10 @@ func (trd *TaskRunDebug) convertFrom(ctx context.Context, source v1.TaskRunDebug func (tbp TaskBreakpoints) convertTo(ctx context.Context, sink *v1.TaskBreakpoints) { sink.OnFailure = tbp.OnFailure - if len(tbp.BeforeSteps) > 0 { - sink.BeforeSteps = make([]string, 0) - sink.BeforeSteps = append(sink.BeforeSteps, tbp.BeforeSteps...) - } } func (tbp *TaskBreakpoints) convertFrom(ctx context.Context, source v1.TaskBreakpoints) { tbp.OnFailure = source.OnFailure - if len(source.BeforeSteps) > 0 { - tbp.BeforeSteps = make([]string, 0) - tbp.BeforeSteps = append(tbp.BeforeSteps, source.BeforeSteps...) - } } func (trso TaskRunStepOverride) convertTo(ctx context.Context, sink *v1.TaskRunStepSpec) { @@ -353,12 +345,6 @@ func (ss StepState) convertTo(ctx context.Context, sink *v1.StepState) { sink.ImageID = ss.ImageID sink.Results = nil - if ss.Provenance != nil { - new := v1.Provenance{} - ss.Provenance.convertTo(ctx, &new) - sink.Provenance = &new - } - if ss.ContainerState.Terminated != nil { sink.TerminationReason = ss.ContainerState.Terminated.Reason } @@ -393,11 +379,6 @@ func (ss *StepState) convertFrom(ctx context.Context, source v1.StepState) { new.convertFrom(ctx, r) ss.Results = append(ss.Results, new) } - if source.Provenance != nil { - new := Provenance{} - new.convertFrom(ctx, *source.Provenance) - ss.Provenance = &new - } for _, o := range source.Outputs { new := TaskRunStepArtifact{} new.convertFrom(ctx, o) diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go index ff387e7d03b..b9e1565dda9 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go @@ -50,322 +50,296 @@ func TestTaskRunConversion(t *testing.T) { tests := []struct { name string in *v1beta1.TaskRun - }{ - { - name: "simple taskrun", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - Spec: v1beta1.TaskRunSpec{ - TaskRef: &v1beta1.TaskRef{Name: "test-task"}, - }, - }, - }, { - name: "taskrun conversion deprecated step fields", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - Spec: v1beta1.TaskRunSpec{ - TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{ - DeprecatedLivenessProbe: &corev1.Probe{InitialDelaySeconds: 1}, - DeprecatedReadinessProbe: &corev1.Probe{InitialDelaySeconds: 2}, - DeprecatedPorts: []corev1.ContainerPort{{Name: "port"}}, - DeprecatedStartupProbe: &corev1.Probe{InitialDelaySeconds: 3}, - DeprecatedLifecycle: &corev1.Lifecycle{PostStart: &corev1.LifecycleHandler{Exec: &corev1.ExecAction{ - Command: []string{"lifecycle command"}, - }}}, - DeprecatedTerminationMessagePath: "path", - DeprecatedTerminationMessagePolicy: corev1.TerminationMessagePolicy("policy"), - DeprecatedStdin: true, - DeprecatedStdinOnce: true, - DeprecatedTTY: true, - }}, - StepTemplate: &v1beta1.StepTemplate{ - DeprecatedName: "name", - DeprecatedLivenessProbe: &corev1.Probe{InitialDelaySeconds: 1}, - DeprecatedReadinessProbe: &corev1.Probe{InitialDelaySeconds: 2}, - DeprecatedPorts: []corev1.ContainerPort{{Name: "port"}}, - DeprecatedStartupProbe: &corev1.Probe{InitialDelaySeconds: 3}, - DeprecatedLifecycle: &corev1.Lifecycle{PostStart: &corev1.LifecycleHandler{Exec: &corev1.ExecAction{ - Command: []string{"lifecycle command"}, - }}}, - DeprecatedTerminationMessagePath: "path", - DeprecatedTerminationMessagePolicy: corev1.TerminationMessagePolicy("policy"), - DeprecatedStdin: true, - DeprecatedStdinOnce: true, - DeprecatedTTY: true, - }, - }, - }, + }{{ + name: "simple taskrun", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", }, - }, { - name: "taskrun with step Results in step state", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - Spec: v1beta1.TaskRunSpec{}, - Status: v1beta1.TaskRunStatus{ - TaskRunStatusFields: v1beta1.TaskRunStatusFields{ - Steps: []v1beta1.StepState{{ - Results: []v1beta1.TaskRunStepResult{{ - Name: "foo", - Type: v1beta1.ResultsTypeString, - Value: v1beta1.ResultValue{ - Type: v1beta1.ParamTypeString, - StringVal: "bar", - }, - }}, - }}, + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "test-task"}, + }, + }, + }, { + name: "taskrun conversion deprecated step fields", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.TaskRunSpec{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + DeprecatedLivenessProbe: &corev1.Probe{InitialDelaySeconds: 1}, + DeprecatedReadinessProbe: &corev1.Probe{InitialDelaySeconds: 2}, + DeprecatedPorts: []corev1.ContainerPort{{Name: "port"}}, + DeprecatedStartupProbe: &corev1.Probe{InitialDelaySeconds: 3}, + DeprecatedLifecycle: &corev1.Lifecycle{PostStart: &corev1.LifecycleHandler{Exec: &corev1.ExecAction{ + Command: []string{"lifecycle command"}, + }}}, + DeprecatedTerminationMessagePath: "path", + DeprecatedTerminationMessagePolicy: corev1.TerminationMessagePolicy("policy"), + DeprecatedStdin: true, + DeprecatedStdinOnce: true, + DeprecatedTTY: true, + }}, + StepTemplate: &v1beta1.StepTemplate{ + DeprecatedName: "name", + DeprecatedLivenessProbe: &corev1.Probe{InitialDelaySeconds: 1}, + DeprecatedReadinessProbe: &corev1.Probe{InitialDelaySeconds: 2}, + DeprecatedPorts: []corev1.ContainerPort{{Name: "port"}}, + DeprecatedStartupProbe: &corev1.Probe{InitialDelaySeconds: 3}, + DeprecatedLifecycle: &corev1.Lifecycle{PostStart: &corev1.LifecycleHandler{Exec: &corev1.ExecAction{ + Command: []string{"lifecycle command"}, + }}}, + DeprecatedTerminationMessagePath: "path", + DeprecatedTerminationMessagePolicy: corev1.TerminationMessagePolicy("policy"), + DeprecatedStdin: true, + DeprecatedStdinOnce: true, + DeprecatedTTY: true, }, }, }, - }, { - name: "taskrun with provenance in step state", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - Spec: v1beta1.TaskRunSpec{}, - Status: v1beta1.TaskRunStatus{ - TaskRunStatusFields: v1beta1.TaskRunStatusFields{ - Steps: []v1beta1.StepState{{ - Provenance: &v1beta1.Provenance{ - RefSource: &v1beta1.RefSource{ - URI: "test-uri", - Digest: map[string]string{"sha256": "digest"}, - }, + }, + }, { + name: "taskrun with step Results in step state", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.TaskRunSpec{}, + Status: v1beta1.TaskRunStatus{ + TaskRunStatusFields: v1beta1.TaskRunStatusFields{ + Steps: []v1beta1.StepState{{ + Results: []v1beta1.TaskRunStepResult{{ + Name: "foo", + Type: v1beta1.ResultsTypeString, + Value: v1beta1.ResultValue{ + Type: v1beta1.ParamTypeString, + StringVal: "bar", }, }}, - }, + }}, }, }, - }, { - name: "taskrun conversion all non deprecated fields", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", + }, + }, { + name: "taskrun conversion all non deprecated fields", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.TaskRunSpec{ + Debug: &v1beta1.TaskRunDebug{ + Breakpoints: &v1beta1.TaskBreakpoints{ + OnFailure: "enabled", + }, }, - Spec: v1beta1.TaskRunSpec{ - Debug: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - OnFailure: "enabled", - BeforeSteps: []string{"step-1", "step-2"}, - }, + Params: v1beta1.Params{{ + Name: "param-task-1", + Value: v1beta1.ParamValue{ + ArrayVal: []string{"value-task-1"}, + Type: "string", }, - Params: v1beta1.Params{{ - Name: "param-task-1", - Value: v1beta1.ParamValue{ - ArrayVal: []string{"value-task-1"}, - Type: "string", - }, + }}, + ServiceAccountName: "test-sa", + TaskRef: &v1beta1.TaskRef{Name: "test-task"}, + TaskSpec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "param-name", + Type: "string", }}, - ServiceAccountName: "test-sa", - TaskRef: &v1beta1.TaskRef{Name: "test-task"}, - TaskSpec: &v1beta1.TaskSpec{ - Params: []v1beta1.ParamSpec{{ - Name: "param-name", - Type: "string", - }}, + }, + Status: "test-task-run-spec-status", + StatusMessage: v1beta1.TaskRunSpecStatusMessage("test-status-message"), + Timeout: &metav1.Duration{Duration: 5 * time.Second}, + PodTemplate: &pod.Template{ + NodeSelector: map[string]string{ + "label": "value", }, - Status: "test-task-run-spec-status", - StatusMessage: v1beta1.TaskRunSpecStatusMessage("test-status-message"), - Timeout: &metav1.Duration{Duration: 5 * time.Second}, - PodTemplate: &pod.Template{ - NodeSelector: map[string]string{ - "label": "value", + }, + Workspaces: []v1beta1.WorkspaceBinding{{ + Name: "workspace-volumeclaimtemplate", + SubPath: "/foo/bar/baz", + VolumeClaimTemplate: &corev1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc", }, + Spec: corev1.PersistentVolumeClaimSpec{}, }, - Workspaces: []v1beta1.WorkspaceBinding{ - { - Name: "workspace-volumeclaimtemplate", - SubPath: "/foo/bar/baz", - VolumeClaimTemplate: &corev1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pvc", + }, { + Name: "workspace-pvc", + PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{}, + }, { + Name: "workspace-emptydir", + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, { + Name: "workspace-configmap", + ConfigMap: &corev1.ConfigMapVolumeSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "configbar", + }, + }, + }, { + Name: "workspace-secret", + Secret: &corev1.SecretVolumeSource{SecretName: "sname"}, + }, { + Name: "workspace-projected", + Projected: &corev1.ProjectedVolumeSource{ + Sources: []corev1.VolumeProjection{{ + ConfigMap: &corev1.ConfigMapProjection{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "projected-configmap", }, - Spec: corev1.PersistentVolumeClaimSpec{}, }, - }, { - Name: "workspace-pvc", - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{}, - }, { - Name: "workspace-emptydir", - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, { - Name: "workspace-configmap", - ConfigMap: &corev1.ConfigMapVolumeSource{ + Secret: &corev1.SecretProjection{ LocalObjectReference: corev1.LocalObjectReference{ - Name: "configbar", + Name: "projected-secret", }, }, - }, { - Name: "workspace-secret", - Secret: &corev1.SecretVolumeSource{SecretName: "sname"}, - }, { - Name: "workspace-projected", - Projected: &corev1.ProjectedVolumeSource{ - Sources: []corev1.VolumeProjection{{ - ConfigMap: &corev1.ConfigMapProjection{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "projected-configmap", - }, - }, - Secret: &corev1.SecretProjection{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "projected-secret", - }, - }, - ServiceAccountToken: &corev1.ServiceAccountTokenProjection{ - Audience: "projected-sat", - }, - }}, - }, - }, { - Name: "workspace-csi", - CSI: &corev1.CSIVolumeSource{ - NodePublishSecretRef: &corev1.LocalObjectReference{ - Name: "projected-csi", - }, - VolumeAttributes: map[string]string{"key": "attribute-val"}, + ServiceAccountToken: &corev1.ServiceAccountTokenProjection{ + Audience: "projected-sat", }, - }, - }, - StepOverrides: []v1beta1.TaskRunStepOverride{{ - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, }}, }, - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ - Name: "task-1", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }}, - }, - ComputeResources: &corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceMemory: corev1resources.MustParse("1Gi"), + }, { + Name: "workspace-csi", + CSI: &corev1.CSIVolumeSource{ + NodePublishSecretRef: &corev1.LocalObjectReference{ + Name: "projected-csi", }, + VolumeAttributes: map[string]string{"key": "attribute-val"}, }, }, - Status: v1beta1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: []apis.Condition{ - { - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: "Completed", - Message: "All tasks finished running", - }, + }, + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, + }, + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Name: "task-1", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, + }}, + }, + ComputeResources: &corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceMemory: corev1resources.MustParse("1Gi"), + }, + }, + }, + Status: v1beta1.TaskRunStatus{ + Status: duckv1.Status{ + Conditions: []apis.Condition{ + { + Type: apis.ConditionSucceeded, + Status: corev1.ConditionTrue, + Reason: "Completed", + Message: "All tasks finished running", }, - ObservedGeneration: 1, }, - TaskRunStatusFields: v1beta1.TaskRunStatusFields{ - PodName: "pod-name", - StartTime: &metav1.Time{Time: time.Now()}, - CompletionTime: &metav1.Time{Time: time.Now().Add(1 * time.Minute)}, - Steps: []v1beta1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 123, - }}, - Name: "failure", - ContainerName: "step-failure", - ImageID: "image-id", - }}, - Sidecars: []v1beta1.SidecarState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 123, - }, - }, - Name: "failure", - ContainerName: "step-failure", - ImageID: "image-id", - }}, - RetriesStatus: []v1beta1.TaskRunStatus{{ - Status: duckv1.Status{ - Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - }}, - }, - }}, - TaskRunResults: []v1beta1.TaskRunResult{{ - Name: "resultName", - Type: v1beta1.ResultsTypeObject, - Value: *v1beta1.NewObject(map[string]string{"hello": "world"}), - }}, - TaskSpec: &v1beta1.TaskSpec{ - Description: "test", - Steps: []v1beta1.Step{{ - Image: "foo", + ObservedGeneration: 1, + }, + TaskRunStatusFields: v1beta1.TaskRunStatusFields{ + PodName: "pod-name", + StartTime: &metav1.Time{Time: time.Now()}, + CompletionTime: &metav1.Time{Time: time.Now().Add(1 * time.Minute)}, + Steps: []v1beta1.StepState{{ + ContainerState: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + ExitCode: 123, }}, - Volumes: []corev1.Volume{{}}, - Params: []v1beta1.ParamSpec{{ - Name: "param-1", - Type: v1beta1.ParamTypeString, - Description: "My first param", + + Name: "failure", + ContainerName: "step-failure", + ImageID: "image-id", + }}, + Sidecars: []v1beta1.SidecarState{{ + ContainerState: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + ExitCode: 123, + }}, + + Name: "failure", + ContainerName: "step-failure", + ImageID: "image-id", + }}, + RetriesStatus: []v1beta1.TaskRunStatus{{ + Status: duckv1.Status{ + Conditions: []apis.Condition{{ + Type: apis.ConditionSucceeded, + Status: corev1.ConditionFalse, }}, }, - Provenance: &v1beta1.Provenance{ - RefSource: &v1beta1.RefSource{ - URI: "test-uri", - Digest: map[string]string{"sha256": "digest"}, - }, - FeatureFlags: config.DefaultFeatureFlags.DeepCopy(), - }, + }}, + TaskRunResults: []v1beta1.TaskRunResult{{ + Name: "resultName", + Type: v1beta1.ResultsTypeObject, + Value: *v1beta1.NewObject(map[string]string{"hello": "world"}), + }}, + TaskSpec: &v1beta1.TaskSpec{ + Description: "test", + Steps: []v1beta1.Step{{ + Image: "foo", + }}, + Volumes: []corev1.Volume{{}}, + Params: []v1beta1.ParamSpec{{ + Name: "param-1", + Type: v1beta1.ParamTypeString, + Description: "My first param", + }}, }, - }, + Provenance: &v1beta1.Provenance{ + RefSource: &v1beta1.RefSource{ + URI: "test-uri", + Digest: map[string]string{"sha256": "digest"}, + }, + FeatureFlags: config.DefaultFeatureFlags.DeepCopy(), + }}, + }, + }, + }, { + name: "taskrun with stepArtifacts in step state", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", }, - }, { - name: "taskrun with stepArtifacts in step state", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - Spec: v1beta1.TaskRunSpec{}, - Status: v1beta1.TaskRunStatus{ - TaskRunStatusFields: v1beta1.TaskRunStatusFields{ - Steps: []v1beta1.StepState{{ - Inputs: []v1beta1.TaskRunStepArtifact{{ - Name: "Input", - Values: []v1beta1.ArtifactValue{ - { - Uri: "git:example.com", - Digest: map[v1beta1.Algorithm]string{ - "sha256": "49149151d283ac77d3fd4594825242f076c999903261bd95f79a8b261811c11a", - "sha1": "22b80854ba81d11d980794952f2343fedf2189d5", - }, + Spec: v1beta1.TaskRunSpec{}, + Status: v1beta1.TaskRunStatus{ + TaskRunStatusFields: v1beta1.TaskRunStatusFields{ + Steps: []v1beta1.StepState{{ + Inputs: []v1beta1.TaskRunStepArtifact{{ + Name: "Input", + Values: []v1beta1.ArtifactValue{ + {Uri: "git:example.com", + Digest: map[v1beta1.Algorithm]string{ + "sha256": "49149151d283ac77d3fd4594825242f076c999903261bd95f79a8b261811c11a", + "sha1": "22b80854ba81d11d980794952f2343fedf2189d5", }, }, - }}, - Outputs: []v1beta1.TaskRunStepArtifact{{ - Name: "Output", - Values: []v1beta1.ArtifactValue{ - { - Uri: "docker:example.aaa/bbb:latest", - Digest: map[v1beta1.Algorithm]string{ - "sha256": "f05a847a269ccafc90af40ad55aedef62d165227475e4d95ef6812f7c5daa21a", - }, + }, + }}, + Outputs: []v1beta1.TaskRunStepArtifact{{ + Name: "Output", + Values: []v1beta1.ArtifactValue{ + {Uri: "docker:example.aaa/bbb:latest", + Digest: map[v1beta1.Algorithm]string{ + "sha256": "f05a847a269ccafc90af40ad55aedef62d165227475e4d95ef6812f7c5daa21a", }, }, - }}, + }, }}, - }, + }}, }, }, }, + }, } for _, test := range tests { @@ -536,6 +510,37 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { }, }, }, + }}, + }, { + name: "bundle", + in: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{ + Name: "test-bundle-name", + Bundle: "test-bundle", + }, + }, + }, + want: &v1beta1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "bar", + }, + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{ + ResolverRef: v1beta1.ResolverRef{ + Resolver: "bundles", + Params: v1beta1.Params{ + {Name: "bundle", Value: v1beta1.ParamValue{StringVal: "test-bundle", Type: "string"}}, + {Name: "name", Value: v1beta1.ParamValue{StringVal: "test-bundle-name", Type: "string"}}, + {Name: "kind", Value: v1beta1.ParamValue{StringVal: "Task", Type: "string"}}, + }, + }, + }, }, }, }, { @@ -743,8 +748,7 @@ func TestTaskRunConvertTo(t *testing.T) { }}, }, }, - }, - }} + }}} for _, test := range tests { versions := []apis.Convertible{&v1.TaskRun{}} for _, version := range versions { @@ -809,8 +813,7 @@ func TestTaskRunConvertFrom(t *testing.T) { }}, }, }, - }, - }} + }}} for _, test := range tests { versions := []apis.Convertible{&v1beta1.TaskRun{}} for _, version := range versions { diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_types.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_types.go index 2cd76f0e570..551a5856ed6 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_types.go @@ -28,7 +28,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/clock" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -127,9 +126,6 @@ type TaskBreakpoints struct { // failed step will not exit // +optional OnFailure string `json:"onFailure,omitempty"` - // +optional - // +listType=atomic - BeforeSteps []string `json:"beforeSteps,omitempty"` } // NeedsDebugOnFailure return true if the TaskRun is configured to debug on failure @@ -140,28 +136,14 @@ func (trd *TaskRunDebug) NeedsDebugOnFailure() bool { return trd.Breakpoints.OnFailure == EnabledOnFailureBreakpoint } -// NeedsDebugBeforeStep return true if the step is configured to debug before execution -func (trd *TaskRunDebug) NeedsDebugBeforeStep(stepName string) bool { - if trd.Breakpoints == nil { - return false - } - beforeStepSets := sets.NewString(trd.Breakpoints.BeforeSteps...) - return beforeStepSets.Has(stepName) -} - // StepNeedsDebug return true if the step is configured to debug func (trd *TaskRunDebug) StepNeedsDebug(stepName string) bool { - return trd.NeedsDebugOnFailure() || trd.NeedsDebugBeforeStep(stepName) -} - -// HaveBeforeSteps return true if have any before steps -func (trd *TaskRunDebug) HaveBeforeSteps() bool { - return trd.Breakpoints != nil && len(trd.Breakpoints.BeforeSteps) > 0 + return trd.NeedsDebugOnFailure() } // NeedsDebug return true if defined onfailure or have any before, after steps func (trd *TaskRunDebug) NeedsDebug() bool { - return trd.NeedsDebugOnFailure() || trd.HaveBeforeSteps() + return trd.NeedsDebugOnFailure() } var taskRunCondSet = apis.NewBatchConditionSet() @@ -390,7 +372,6 @@ type StepState struct { ContainerName string `json:"container,omitempty"` ImageID string `json:"imageID,omitempty"` Results []TaskRunStepResult `json:"results,omitempty"` - Provenance *Provenance `json:"provenance,omitempty"` Inputs []TaskRunStepArtifact `json:"inputs,omitempty"` Outputs []TaskRunStepArtifact `json:"outputs,omitempty"` } diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_types_test.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_types_test.go index e9c61e4bfb1..d2aa439e04e 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_types_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_types_test.go @@ -427,7 +427,7 @@ func TestHasTimedOut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { result := tc.taskRun.HasTimedOut(context.Background(), testClock) if d := cmp.Diff(tc.expectedStatus, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -467,57 +467,6 @@ func TestInitializeTaskRunConditions(t *testing.T) { } } -func TestIsDebugBeforeStep(t *testing.T) { - type args struct { - stepName string - trd *v1beta1.TaskRunDebug - } - testCases := []struct { - name string - args args - want bool - }{ - { - name: "empty breakpoints", - args: args{ - stepName: "step1", - trd: &v1beta1.TaskRunDebug{}, - }, - want: false, - }, { - name: "breakpoint before step", - args: args{ - stepName: "step1", - trd: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - BeforeSteps: []string{"step1", "step2"}, - }, - }, - }, - want: true, - }, { - name: "step not in before step breakpoint", - args: args{ - stepName: "step3", - trd: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - BeforeSteps: []string{"step1", "step2"}, - }, - }, - }, - want: false, - }, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - result := tc.args.trd.NeedsDebugBeforeStep(tc.args.stepName) - if d := cmp.Diff(result, tc.want); d != "" { - t.Fatal(diff.PrintWantGot(d)) - } - }) - } -} - func TestIsStepNeedDebug(t *testing.T) { type args struct { stepName string @@ -546,24 +495,13 @@ func TestIsStepNeedDebug(t *testing.T) { }, }, want: true, - }, { - name: "breakpoint before step", - args: args{ - stepName: "step1", - trd: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - BeforeSteps: []string{"step1"}, - }, - }, - }, - want: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { result := tc.args.trd.StepNeedsDebug(tc.args.stepName) if d := cmp.Diff(tc.want, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -594,23 +532,13 @@ func TestIsNeedDebug(t *testing.T) { }, }, want: true, - }, { - name: "breakpoint before step", - args: args{ - trd: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - BeforeSteps: []string{"step1"}, - }, - }, - }, - want: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { result := tc.args.trd.NeedsDebug() if d := cmp.Diff(tc.want, result); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -643,7 +571,7 @@ func TestTaskRunIsRetriable(t *testing.T) { wantIsRetriable: false, }} { retriesStatus := []v1beta1.TaskRunStatus{} - for range tc.numRetriesStatus { + for i := 0; i < tc.numRetriesStatus; i++ { retriesStatus = append(retriesStatus, retryStatus) } t.Run(tc.name, func(t *testing.T) { diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation.go index ae14965c770..b44b3d42e2c 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation.go @@ -26,7 +26,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/validate" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/strings/slices" "knative.dev/pkg/apis" @@ -51,9 +50,6 @@ func (tr *TaskRun) Validate(ctx context.Context) *apis.FieldError { // Validate taskrun spec func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { - // Validate the spec changes - errs = errs.Also(ts.ValidateUpdate(ctx)) - // Must have exactly one of taskRef and taskSpec. if ts.TaskRef == nil && ts.TaskSpec == nil { errs = errs.Also(apis.ErrMissingOneOf("taskRef", "taskSpec")) @@ -84,11 +80,11 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateDebug(ts.Debug).ViaField("debug")) } if ts.StepOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.BetaAPIFields).ViaField("stepOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.AlphaAPIFields).ViaField("stepOverrides")) errs = errs.Also(validateStepOverrides(ts.StepOverrides).ViaField("stepOverrides")) } if ts.SidecarOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.BetaAPIFields).ViaField("sidecarOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.AlphaAPIFields).ViaField("sidecarOverrides")) errs = errs.Also(validateSidecarOverrides(ts.SidecarOverrides).ViaField("sidecarOverrides")) } if ts.ComputeResources != nil { @@ -122,34 +118,6 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { return errs } -// ValidateUpdate validates the update of a TaskRunSpec -func (ts *TaskRunSpec) ValidateUpdate(ctx context.Context) (errs *apis.FieldError) { - if !apis.IsInUpdate(ctx) { - return - } - oldObj, ok := apis.GetBaseline(ctx).(*TaskRun) - if !ok || oldObj == nil { - return - } - old := &oldObj.Spec - - // If already in the done state, the spec cannot be modified. - // Otherwise, only the status, statusMessage field can be modified. - tips := "Once the TaskRun is complete, no updates are allowed" - if !oldObj.IsDone() { - old = old.DeepCopy() - old.Status = ts.Status - old.StatusMessage = ts.StatusMessage - tips = "Once the TaskRun has started, only status and statusMessage updates are allowed" - } - - if !equality.Semantic.DeepEqual(old, ts) { - errs = errs.Also(apis.ErrInvalidValue(tips, "")) - } - - return -} - // validateInlineParameters validates that any parameters called in the // Task spec are declared in the TaskRun. // This is crucial for propagated parameters because the parameters could @@ -256,21 +224,9 @@ func validateDebug(db *TaskRunDebug) (errs *apis.FieldError) { if db == nil || db.Breakpoints == nil { return errs } - - if db.Breakpoints.OnFailure == "" { - errs = errs.Also(apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "breakpoints.onFailure")) - } - if db.Breakpoints.OnFailure != "" && db.Breakpoints.OnFailure != EnabledOnFailureBreakpoint { errs = errs.Also(apis.ErrInvalidValue(db.Breakpoints.OnFailure+" is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "breakpoints.onFailure")) } - beforeSteps := sets.NewString() - for i, step := range db.Breakpoints.BeforeSteps { - if beforeSteps.Has(step) { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("before step must be unique, the same step: %s is defined multiple times at", step), fmt.Sprintf("breakpoints.beforeSteps[%d]", i))) - } - beforeSteps.Insert(step) - } return errs } diff --git a/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go index a80339f31b9..3bab6c0e77c 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go @@ -22,7 +22,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" cfgtesting "github.com/tektoncd/pipeline/pkg/apis/config/testing" pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" @@ -32,7 +31,6 @@ import ( corev1resources "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" ) func EnableForbiddenEnv(ctx context.Context) context.Context { @@ -145,21 +143,6 @@ func TestTaskRun_Invalidate(t *testing.T) { Message: `missing field(s)`, Paths: []string{"spec.task-words.properties"}, }, - }, { - name: "uses bundle (deprecated) on creation is disallowed", - taskRun: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "taskrunrunname", - }, - Spec: v1beta1.TaskRunSpec{ - TaskRef: &v1beta1.TaskRef{ - Name: "foo", - Bundle: "example.com/foo/bar", - }, - }, - }, - want: &apis.FieldError{Message: "must not set the field(s)", Paths: []string{"spec.taskRef.bundle"}}, - wc: apis.WithinCreate, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -448,7 +431,7 @@ func TestTaskRun_Validate(t *testing.T) { }, }, }, { - name: "beta feature: valid step and sidecar overrides", + name: "alpha feature: valid step and sidecar overrides", taskRun: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "tr"}, Spec: v1beta1.TaskRunSpec{ @@ -467,7 +450,7 @@ func TestTaskRun_Validate(t *testing.T) { }}, }, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -701,34 +684,35 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("turnOn is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "debug.breakpoints.onFailure"), wc: cfgtesting.EnableAlphaAPIFields, }, { - name: "invalid breakpoint duplicate before steps", + name: "stepOverride disallowed without alpha feature gate", spec: v1beta1.TaskRunSpec{ TaskRef: &v1beta1.TaskRef{ - Name: "my-task", + Name: "foo", }, - Debug: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - BeforeSteps: []string{"step-1", "step-1"}, - OnFailure: "enabled", + StepOverrides: []v1beta1.TaskRunStepOverride{{ + Name: "foo", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, }, - }, + }}, }, - wantErr: apis.ErrGeneric("before step must be unique, the same step: step-1 is defined multiple times at", "debug.breakpoints.beforeSteps[1]"), - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableStableAPIFields, + wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), }, { - name: "empty onFailure breakpoint", + name: "sidecarOverride disallowed without alpha feature gate", spec: v1beta1.TaskRunSpec{ TaskRef: &v1beta1.TaskRef{ - Name: "my-task", + Name: "foo", }, - Debug: &v1beta1.TaskRunDebug{ - Breakpoints: &v1beta1.TaskBreakpoints{ - OnFailure: "", + SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ + Name: "foo", + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, }, - }, + }}, }, - wantErr: apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "debug.breakpoints.onFailure"), - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableStableAPIFields, + wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), }, { name: "duplicate stepOverride names", spec: v1beta1.TaskRunSpec{ @@ -941,7 +925,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { }, }}, }, - wc: cfgtesting.EnableBetaAPIFields, + wc: cfgtesting.EnableAlphaAPIFields, }} for _, ts := range tests { @@ -956,148 +940,3 @@ func TestTaskRunSpec_Validate(t *testing.T) { }) } } - -func TestTaskRunSpec_ValidateUpdate(t *testing.T) { - tests := []struct { - name string - isCreate bool - isUpdate bool - baselineTaskRun *v1beta1.TaskRun - taskRun *v1beta1.TaskRun - expectedError apis.FieldError - }{ - { - name: "is create ctx", - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{}, - }, - isCreate: true, - isUpdate: false, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, no changes", - baselineTaskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is nil, skip validation", - baselineTaskRun: nil, - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Timeout: &metav1.Duration{Duration: 1}, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, only status changes", - baselineTaskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "", - StatusMessage: "", - }, - Status: v1beta1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "TaskRunCancelled", - StatusMessage: "TaskRun is cancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{}, - }, { - name: "is update ctx, baseline is unknown, status and timeout changes", - baselineTaskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "", - StatusMessage: "", - Timeout: &metav1.Duration{Duration: 0}, - }, - Status: v1beta1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown}, - }, - }, - }, - }, - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "TaskRunCancelled", - StatusMessage: "TaskRun is cancelled", - Timeout: &metav1.Duration{Duration: 1}, - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the TaskRun has started, only status and statusMessage updates are allowed`, - Paths: []string{""}, - }, - }, { - name: "is update ctx, baseline is done, status changes", - baselineTaskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "", - }, - Status: v1beta1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - {Type: apis.ConditionSucceeded, Status: corev1.ConditionTrue}, - }, - }, - }, - }, - taskRun: &v1beta1.TaskRun{ - Spec: v1beta1.TaskRunSpec{ - Status: "TaskRunCancelled", - }, - }, - isCreate: false, - isUpdate: true, - expectedError: apis.FieldError{ - Message: `invalid value: Once the TaskRun is complete, no updates are allowed`, - Paths: []string{""}, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: &config.FeatureFlags{}, - Defaults: &config.Defaults{}, - }) - if tt.isCreate { - ctx = apis.WithinCreate(ctx) - } - if tt.isUpdate { - ctx = apis.WithinUpdate(ctx, tt.baselineTaskRun) - } - tr := tt.taskRun - err := tr.Spec.ValidateUpdate(ctx) - if d := cmp.Diff(tt.expectedError.Error(), err.Error(), cmpopts.IgnoreUnexported(apis.FieldError{})); d != "" { - t.Errorf("TaskRunSpec.ValidateUpdate() errors diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/apis/pipeline/v1beta1/when_types.go b/upstream/pkg/apis/pipeline/v1beta1/when_types.go index ad24f8e62e2..f792ec199c8 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/when_types.go +++ b/upstream/pkg/apis/pipeline/v1beta1/when_types.go @@ -98,8 +98,6 @@ func (we *WhenExpression) GetVarSubstitutionExpressions() ([]string, bool) { // All of them need to evaluate to True for a guarded Task to be executed. type WhenExpressions []WhenExpression -type StepWhenExpressions = WhenExpressions - // AllowsExecution evaluates an Input's relationship to an array of Values, based on the Operator, // to determine whether all the When Expressions are True. If they are all True, the guarded Task is // executed, otherwise it is skipped. diff --git a/upstream/pkg/apis/pipeline/v1beta1/when_validation.go b/upstream/pkg/apis/pipeline/v1beta1/when_validation.go index aa6b4b4cbd7..33855040b2b 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/when_validation.go +++ b/upstream/pkg/apis/pipeline/v1beta1/when_validation.go @@ -48,7 +48,7 @@ func (wes WhenExpressions) validateWhenExpressionsFields(ctx context.Context) (e func (we *WhenExpression) validateWhenExpressionFields(ctx context.Context) *apis.FieldError { if we.CEL != "" { if !config.FromContextOrDefaults(ctx).FeatureFlags.EnableCELInWhenExpression { - return apis.ErrGeneric(fmt.Sprintf("feature flag %s should be set to true to use CEL: %s in WhenExpression", config.EnableCELInWhenExpression, we.CEL), "") + return apis.ErrGeneric("feature flag %s should be set to true to use CEL: %s in WhenExpression", config.EnableCELInWhenExpression, we.CEL) } if we.Input != "" || we.Operator != "" || len(we.Values) != 0 { return apis.ErrGeneric(fmt.Sprintf("cel and input+operator+values cannot be set in one WhenExpression: %v", we)) diff --git a/upstream/pkg/apis/pipeline/v1beta1/workspace_validation_test.go b/upstream/pkg/apis/pipeline/v1beta1/workspace_validation_test.go index 8eb0dc471be..43d621ff632 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/workspace_validation_test.go +++ b/upstream/pkg/apis/pipeline/v1beta1/workspace_validation_test.go @@ -49,7 +49,7 @@ func TestWorkspaceBindingValidateValid(t *testing.T) { }, Spec: corev1.PersistentVolumeClaimSpec{ AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, - Resources: corev1.VolumeResourceRequirements{ + Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ "storage": resource.MustParse("1Gi"), }, diff --git a/upstream/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go b/upstream/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go index 8c2afe35a6f..807595a1925 100644 --- a/upstream/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go +++ b/upstream/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go @@ -1696,11 +1696,6 @@ func (in *Sidecar) DeepCopyInto(out *Sidecar) { *out = make([]WorkspaceUsage, len(*in)) copy(*out, *in) } - if in.RestartPolicy != nil { - in, out := &in.RestartPolicy, &out.RestartPolicy - *out = new(corev1.ContainerRestartPolicy) - **out = **in - } return } @@ -1863,13 +1858,6 @@ func (in *Step) DeepCopyInto(out *Step) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.When != nil { - in, out := &in.When, &out.When - *out = make(WhenExpressions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } return } @@ -1883,125 +1871,6 @@ func (in *Step) DeepCopy() *Step { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StepAction) DeepCopyInto(out *StepAction) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepAction. -func (in *StepAction) DeepCopy() *StepAction { - if in == nil { - return nil - } - out := new(StepAction) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StepAction) 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 *StepActionList) DeepCopyInto(out *StepActionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]StepAction, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepActionList. -func (in *StepActionList) DeepCopy() *StepActionList { - if in == nil { - return nil - } - out := new(StepActionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StepActionList) 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 *StepActionSpec) DeepCopyInto(out *StepActionSpec) { - *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]corev1.EnvVar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Params != nil { - in, out := &in.Params, &out.Params - *out = make(pipelinev1.ParamSpecs, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Results != nil { - in, out := &in.Results, &out.Results - *out = make([]pipelinev1.StepResult, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(corev1.SecurityContext) - (*in).DeepCopyInto(*out) - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]corev1.VolumeMount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepActionSpec. -func (in *StepActionSpec) DeepCopy() *StepActionSpec { - if in == nil { - return nil - } - out := new(StepActionSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StepOutputConfig) DeepCopyInto(out *StepOutputConfig) { *out = *in @@ -2029,11 +1898,6 @@ func (in *StepState) DeepCopyInto(out *StepState) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Provenance != nil { - in, out := &in.Provenance, &out.Provenance - *out = new(Provenance) - (*in).DeepCopyInto(*out) - } if in.Inputs != nil { in, out := &in.Inputs, &out.Inputs *out = make([]Artifact, len(*in)) @@ -2174,11 +2038,6 @@ func (in *Task) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TaskBreakpoints) DeepCopyInto(out *TaskBreakpoints) { *out = *in - if in.BeforeSteps != nil { - in, out := &in.BeforeSteps, &out.BeforeSteps - *out = make([]string, len(*in)) - copy(*out, *in) - } return } @@ -2369,7 +2228,7 @@ func (in *TaskRunDebug) DeepCopyInto(out *TaskRunDebug) { if in.Breakpoints != nil { in, out := &in.Breakpoints, &out.Breakpoints *out = new(TaskBreakpoints) - (*in).DeepCopyInto(*out) + **out = **in } return } diff --git a/upstream/pkg/apis/resolution/v1beta1/resolution_request_types.go b/upstream/pkg/apis/resolution/v1beta1/resolution_request_types.go index f78a4a493c3..60b51fa0498 100644 --- a/upstream/pkg/apis/resolution/v1beta1/resolution_request_types.go +++ b/upstream/pkg/apis/resolution/v1beta1/resolution_request_types.go @@ -64,13 +64,6 @@ type ResolutionRequestSpec struct { // +optional // +listType=atomic Params []pipelinev1.Param `json:"params,omitempty"` - // URL is the runtime url passed to the resolver - // to help it figure out how to resolver the resource being - // requested. - // This is currently at an ALPHA stability level and subject to - // alpha API compatibility policies. - // +optional - URL string `json:"url,omitempty"` } // ResolutionRequestStatus are all the fields in a ResolutionRequest's diff --git a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go index 326e2fbb252..a142026b2ba 100644 --- a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go +++ b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go @@ -44,10 +44,6 @@ func (c *FakeTektonV1beta1) PipelineRuns(namespace string) v1beta1.PipelineRunIn return &FakePipelineRuns{c, namespace} } -func (c *FakeTektonV1beta1) StepActions(namespace string) v1beta1.StepActionInterface { - return &FakeStepActions{c, namespace} -} - func (c *FakeTektonV1beta1) Tasks(namespace string) v1beta1.TaskInterface { return &FakeTasks{c, namespace} } diff --git a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_stepaction.go b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_stepaction.go deleted file mode 100644 index 048c9e56c34..00000000000 --- a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_stepaction.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeStepActions implements StepActionInterface -type FakeStepActions struct { - Fake *FakeTektonV1beta1 - ns string -} - -var stepactionsResource = v1beta1.SchemeGroupVersion.WithResource("stepactions") - -var stepactionsKind = v1beta1.SchemeGroupVersion.WithKind("StepAction") - -// Get takes name of the stepAction, and returns the corresponding stepAction object, and an error if there is any. -func (c *FakeStepActions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StepAction, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(stepactionsResource, c.ns, name), &v1beta1.StepAction{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.StepAction), err -} - -// List takes label and field selectors, and returns the list of StepActions that match those selectors. -func (c *FakeStepActions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StepActionList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(stepactionsResource, stepactionsKind, c.ns, opts), &v1beta1.StepActionList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.StepActionList{ListMeta: obj.(*v1beta1.StepActionList).ListMeta} - for _, item := range obj.(*v1beta1.StepActionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested stepActions. -func (c *FakeStepActions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(stepactionsResource, c.ns, opts)) - -} - -// Create takes the representation of a stepAction and creates it. Returns the server's representation of the stepAction, and an error, if there is any. -func (c *FakeStepActions) Create(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.CreateOptions) (result *v1beta1.StepAction, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(stepactionsResource, c.ns, stepAction), &v1beta1.StepAction{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.StepAction), err -} - -// Update takes the representation of a stepAction and updates it. Returns the server's representation of the stepAction, and an error, if there is any. -func (c *FakeStepActions) Update(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.UpdateOptions) (result *v1beta1.StepAction, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(stepactionsResource, c.ns, stepAction), &v1beta1.StepAction{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.StepAction), err -} - -// Delete takes name of the stepAction and deletes it. Returns an error if one occurs. -func (c *FakeStepActions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(stepactionsResource, c.ns, name, opts), &v1beta1.StepAction{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStepActions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(stepactionsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.StepActionList{}) - return err -} - -// Patch applies the patch and returns the patched stepAction. -func (c *FakeStepActions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StepAction, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(stepactionsResource, c.ns, name, pt, data, subresources...), &v1beta1.StepAction{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.StepAction), err -} diff --git a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go index 87f277c5c7a..b9f3554be3e 100644 --- a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go +++ b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go @@ -26,8 +26,6 @@ type PipelineExpansion interface{} type PipelineRunExpansion interface{} -type StepActionExpansion interface{} - type TaskExpansion interface{} type TaskRunExpansion interface{} diff --git a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go index fcd65e7ce35..0974d31771a 100644 --- a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go +++ b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go @@ -32,7 +32,6 @@ type TektonV1beta1Interface interface { CustomRunsGetter PipelinesGetter PipelineRunsGetter - StepActionsGetter TasksGetter TaskRunsGetter } @@ -58,10 +57,6 @@ func (c *TektonV1beta1Client) PipelineRuns(namespace string) PipelineRunInterfac return newPipelineRuns(c, namespace) } -func (c *TektonV1beta1Client) StepActions(namespace string) StepActionInterface { - return newStepActions(c, namespace) -} - func (c *TektonV1beta1Client) Tasks(namespace string) TaskInterface { return newTasks(c, namespace) } diff --git a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/stepaction.go b/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/stepaction.go deleted file mode 100644 index 388f0629540..00000000000 --- a/upstream/pkg/client/clientset/versioned/typed/pipeline/v1beta1/stepaction.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" - 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" -) - -// StepActionsGetter has a method to return a StepActionInterface. -// A group's client should implement this interface. -type StepActionsGetter interface { - StepActions(namespace string) StepActionInterface -} - -// StepActionInterface has methods to work with StepAction resources. -type StepActionInterface interface { - Create(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.CreateOptions) (*v1beta1.StepAction, error) - Update(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.UpdateOptions) (*v1beta1.StepAction, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StepAction, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StepActionList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StepAction, err error) - StepActionExpansion -} - -// stepActions implements StepActionInterface -type stepActions struct { - client rest.Interface - ns string -} - -// newStepActions returns a StepActions -func newStepActions(c *TektonV1beta1Client, namespace string) *stepActions { - return &stepActions{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the stepAction, and returns the corresponding stepAction object, and an error if there is any. -func (c *stepActions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StepAction, err error) { - result = &v1beta1.StepAction{} - err = c.client.Get(). - Namespace(c.ns). - Resource("stepactions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StepActions that match those selectors. -func (c *stepActions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StepActionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.StepActionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("stepactions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested stepActions. -func (c *stepActions) 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("stepactions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a stepAction and creates it. Returns the server's representation of the stepAction, and an error, if there is any. -func (c *stepActions) Create(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.CreateOptions) (result *v1beta1.StepAction, err error) { - result = &v1beta1.StepAction{} - err = c.client.Post(). - Namespace(c.ns). - Resource("stepactions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(stepAction). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a stepAction and updates it. Returns the server's representation of the stepAction, and an error, if there is any. -func (c *stepActions) Update(ctx context.Context, stepAction *v1beta1.StepAction, opts v1.UpdateOptions) (result *v1beta1.StepAction, err error) { - result = &v1beta1.StepAction{} - err = c.client.Put(). - Namespace(c.ns). - Resource("stepactions"). - Name(stepAction.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(stepAction). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the stepAction and deletes it. Returns an error if one occurs. -func (c *stepActions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("stepactions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *stepActions) 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("stepactions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched stepAction. -func (c *stepActions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StepAction, err error) { - result = &v1beta1.StepAction{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("stepactions"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/upstream/pkg/client/informers/externalversions/factory.go b/upstream/pkg/client/informers/externalversions/factory.go index 839585d5076..081412ecce7 100644 --- a/upstream/pkg/client/informers/externalversions/factory.go +++ b/upstream/pkg/client/informers/externalversions/factory.go @@ -42,7 +42,6 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration - transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -81,14 +80,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -193,7 +184,6 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/upstream/pkg/client/informers/externalversions/generic.go b/upstream/pkg/client/informers/externalversions/generic.go index fe44a25ab11..cec37e05376 100644 --- a/upstream/pkg/client/informers/externalversions/generic.go +++ b/upstream/pkg/client/informers/externalversions/generic.go @@ -81,8 +81,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Pipelines().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("pipelineruns"): return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().PipelineRuns().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("stepactions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().StepActions().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("tasks"): return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Tasks().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("taskruns"): diff --git a/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go b/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go index 2821b942ca9..307843a8014 100644 --- a/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go +++ b/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go @@ -32,8 +32,6 @@ type Interface interface { Pipelines() PipelineInformer // PipelineRuns returns a PipelineRunInformer. PipelineRuns() PipelineRunInformer - // StepActions returns a StepActionInformer. - StepActions() StepActionInformer // Tasks returns a TaskInformer. Tasks() TaskInformer // TaskRuns returns a TaskRunInformer. @@ -71,11 +69,6 @@ func (v *version) PipelineRuns() PipelineRunInformer { return &pipelineRunInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StepActions returns a StepActionInformer. -func (v *version) StepActions() StepActionInformer { - return &stepActionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Tasks returns a TaskInformer. func (v *version) Tasks() TaskInformer { return &taskInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/stepaction.go b/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/stepaction.go deleted file mode 100644 index 4ec8578199e..00000000000 --- a/upstream/pkg/client/informers/externalversions/pipeline/v1beta1/stepaction.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - time "time" - - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" - internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// StepActionInformer provides access to a shared informer and lister for -// StepActions. -type StepActionInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.StepActionLister -} - -type stepActionInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewStepActionInformer constructs a new informer for StepAction type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewStepActionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredStepActionInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredStepActionInformer constructs a new informer for StepAction type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredStepActionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1beta1().StepActions(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1beta1().StepActions(namespace).Watch(context.TODO(), options) - }, - }, - &pipelinev1beta1.StepAction{}, - resyncPeriod, - indexers, - ) -} - -func (f *stepActionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredStepActionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *stepActionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1beta1.StepAction{}, f.defaultInformer) -} - -func (f *stepActionInformer) Lister() v1beta1.StepActionLister { - return v1beta1.NewStepActionLister(f.Informer().GetIndexer()) -} diff --git a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/fake/fake.go b/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/fake/fake.go deleted file mode 100644 index 7372bf60da5..00000000000 --- a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/fake/fake.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package fake - -import ( - context "context" - - fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - stepaction "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/stepaction" - controller "knative.dev/pkg/controller" - injection "knative.dev/pkg/injection" -) - -var Get = stepaction.Get - -func init() { - injection.Fake.RegisterInformer(withInformer) -} - -func withInformer(ctx context.Context) (context.Context, controller.Informer) { - f := fake.Get(ctx) - inf := f.Tekton().V1beta1().StepActions() - return context.WithValue(ctx, stepaction.Key{}, inf), inf.Informer() -} diff --git a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/fake/fake.go b/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/fake/fake.go deleted file mode 100644 index 209d758a1de..00000000000 --- a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/fake/fake.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package fake - -import ( - context "context" - - factoryfiltered "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/filtered" - filtered "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered" - controller "knative.dev/pkg/controller" - injection "knative.dev/pkg/injection" - logging "knative.dev/pkg/logging" -) - -var Get = filtered.Get - -func init() { - injection.Fake.RegisterFilteredInformers(withInformer) -} - -func withInformer(ctx context.Context) (context.Context, []controller.Informer) { - untyped := ctx.Value(factoryfiltered.LabelKey{}) - if untyped == nil { - logging.FromContext(ctx).Panic( - "Unable to fetch labelkey from context.") - } - labelSelectors := untyped.([]string) - infs := []controller.Informer{} - for _, selector := range labelSelectors { - f := factoryfiltered.Get(ctx, selector) - inf := f.Tekton().V1beta1().StepActions() - ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) - infs = append(infs, inf.Informer()) - } - return ctx, infs -} diff --git a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/stepaction.go b/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/stepaction.go deleted file mode 100644 index efc517d9ded..00000000000 --- a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/filtered/stepaction.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package filtered - -import ( - context "context" - - v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - filtered "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/filtered" - controller "knative.dev/pkg/controller" - injection "knative.dev/pkg/injection" - logging "knative.dev/pkg/logging" -) - -func init() { - injection.Default.RegisterFilteredInformers(withInformer) -} - -// Key is used for associating the Informer inside the context.Context. -type Key struct { - Selector string -} - -func withInformer(ctx context.Context) (context.Context, []controller.Informer) { - untyped := ctx.Value(filtered.LabelKey{}) - if untyped == nil { - logging.FromContext(ctx).Panic( - "Unable to fetch labelkey from context.") - } - labelSelectors := untyped.([]string) - infs := []controller.Informer{} - for _, selector := range labelSelectors { - f := filtered.Get(ctx, selector) - inf := f.Tekton().V1beta1().StepActions() - ctx = context.WithValue(ctx, Key{Selector: selector}, inf) - infs = append(infs, inf.Informer()) - } - return ctx, infs -} - -// Get extracts the typed informer from the context. -func Get(ctx context.Context, selector string) v1beta1.StepActionInformer { - untyped := ctx.Value(Key{Selector: selector}) - if untyped == nil { - logging.FromContext(ctx).Panicf( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.StepActionInformer with selector %s from context.", selector) - } - return untyped.(v1beta1.StepActionInformer) -} diff --git a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/stepaction.go b/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/stepaction.go deleted file mode 100644 index ffb873d1965..00000000000 --- a/upstream/pkg/client/injection/informers/pipeline/v1beta1/stepaction/stepaction.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package stepaction - -import ( - context "context" - - v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - controller "knative.dev/pkg/controller" - injection "knative.dev/pkg/injection" - logging "knative.dev/pkg/logging" -) - -func init() { - injection.Default.RegisterInformer(withInformer) -} - -// Key is used for associating the Informer inside the context.Context. -type Key struct{} - -func withInformer(ctx context.Context) (context.Context, controller.Informer) { - f := factory.Get(ctx) - inf := f.Tekton().V1beta1().StepActions() - return context.WithValue(ctx, Key{}, inf), inf.Informer() -} - -// Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.StepActionInformer { - untyped := ctx.Value(Key{}) - if untyped == nil { - logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.StepActionInformer from context.") - } - return untyped.(v1beta1.StepActionInformer) -} diff --git a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/controller.go b/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/controller.go deleted file mode 100644 index b5caba0fdb6..00000000000 --- a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/controller.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package stepaction - -import ( - context "context" - fmt "fmt" - reflect "reflect" - strings "strings" - - versionedscheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" - stepaction "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/stepaction" - zap "go.uber.org/zap" - corev1 "k8s.io/api/core/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - scheme "k8s.io/client-go/kubernetes/scheme" - v1 "k8s.io/client-go/kubernetes/typed/core/v1" - record "k8s.io/client-go/tools/record" - kubeclient "knative.dev/pkg/client/injection/kube/client" - controller "knative.dev/pkg/controller" - logging "knative.dev/pkg/logging" - logkey "knative.dev/pkg/logging/logkey" - reconciler "knative.dev/pkg/reconciler" -) - -const ( - defaultControllerAgentName = "stepaction-controller" - defaultFinalizerName = "stepactions.tekton.dev" -) - -// NewImpl returns a controller.Impl that handles queuing and feeding work from -// the queue through an implementation of controller.Reconciler, delegating to -// the provided Interface and optional Finalizer methods. OptionsFn is used to return -// controller.ControllerOptions to be used by the internal reconciler. -func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl { - logger := logging.FromContext(ctx) - - // Check the options function input. It should be 0 or 1. - if len(optionsFns) > 1 { - logger.Fatal("Up to one options function is supported, found: ", len(optionsFns)) - } - - stepactionInformer := stepaction.Get(ctx) - - lister := stepactionInformer.Lister() - - var promoteFilterFunc func(obj interface{}) bool - var promoteFunc = func(bkt reconciler.Bucket) {} - - rec := &reconcilerImpl{ - LeaderAwareFuncs: reconciler.LeaderAwareFuncs{ - PromoteFunc: func(bkt reconciler.Bucket, enq func(reconciler.Bucket, types.NamespacedName)) error { - - // Signal promotion event - promoteFunc(bkt) - - all, err := lister.List(labels.Everything()) - if err != nil { - return err - } - for _, elt := range all { - if promoteFilterFunc != nil { - if ok := promoteFilterFunc(elt); !ok { - continue - } - } - enq(bkt, types.NamespacedName{ - Namespace: elt.GetNamespace(), - Name: elt.GetName(), - }) - } - return nil - }, - }, - Client: client.Get(ctx), - Lister: lister, - reconciler: r, - finalizerName: defaultFinalizerName, - } - - ctrType := reflect.TypeOf(r).Elem() - ctrTypeName := fmt.Sprintf("%s.%s", ctrType.PkgPath(), ctrType.Name()) - ctrTypeName = strings.ReplaceAll(ctrTypeName, "/", ".") - - logger = logger.With( - zap.String(logkey.ControllerType, ctrTypeName), - zap.String(logkey.Kind, "tekton.dev.StepAction"), - ) - - impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger}) - agentName := defaultControllerAgentName - - // Pass impl to the options. Save any optional results. - for _, fn := range optionsFns { - opts := fn(impl) - if opts.ConfigStore != nil { - rec.configStore = opts.ConfigStore - } - if opts.FinalizerName != "" { - rec.finalizerName = opts.FinalizerName - } - if opts.AgentName != "" { - agentName = opts.AgentName - } - if opts.DemoteFunc != nil { - rec.DemoteFunc = opts.DemoteFunc - } - if opts.PromoteFilterFunc != nil { - promoteFilterFunc = opts.PromoteFilterFunc - } - if opts.PromoteFunc != nil { - promoteFunc = opts.PromoteFunc - } - } - - rec.Recorder = createRecorder(ctx, agentName) - - return impl -} - -func createRecorder(ctx context.Context, agentName string) record.EventRecorder { - logger := logging.FromContext(ctx) - - recorder := controller.GetEventRecorder(ctx) - if recorder == nil { - // Create event broadcaster - logger.Debug("Creating event broadcaster") - eventBroadcaster := record.NewBroadcaster() - watches := []watch.Interface{ - eventBroadcaster.StartLogging(logger.Named("event-broadcaster").Infof), - eventBroadcaster.StartRecordingToSink( - &v1.EventSinkImpl{Interface: kubeclient.Get(ctx).CoreV1().Events("")}), - } - recorder = eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: agentName}) - go func() { - <-ctx.Done() - for _, w := range watches { - w.Stop() - } - }() - } - - return recorder -} - -func init() { - versionedscheme.AddToScheme(scheme.Scheme) -} diff --git a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/reconciler.go b/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/reconciler.go deleted file mode 100644 index db1600a9be0..00000000000 --- a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/reconciler.go +++ /dev/null @@ -1,365 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package stepaction - -import ( - context "context" - json "encoding/json" - fmt "fmt" - - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - zap "go.uber.org/zap" - v1 "k8s.io/api/core/v1" - errors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - sets "k8s.io/apimachinery/pkg/util/sets" - record "k8s.io/client-go/tools/record" - controller "knative.dev/pkg/controller" - logging "knative.dev/pkg/logging" - reconciler "knative.dev/pkg/reconciler" -) - -// Interface defines the strongly typed interfaces to be implemented by a -// controller reconciling v1beta1.StepAction. -type Interface interface { - // ReconcileKind implements custom logic to reconcile v1beta1.StepAction. Any changes - // to the objects .Status or .Finalizers will be propagated to the stored - // object. It is recommended that implementors do not call any update calls - // for the Kind inside of ReconcileKind, it is the responsibility of the calling - // controller to propagate those properties. The resource passed to ReconcileKind - // will always have an empty deletion timestamp. - ReconcileKind(ctx context.Context, o *v1beta1.StepAction) reconciler.Event -} - -// Finalizer defines the strongly typed interfaces to be implemented by a -// controller finalizing v1beta1.StepAction. -type Finalizer interface { - // FinalizeKind implements custom logic to finalize v1beta1.StepAction. Any changes - // to the objects .Status or .Finalizers will be ignored. Returning a nil or - // Normal type reconciler.Event will allow the finalizer to be deleted on - // the resource. The resource passed to FinalizeKind will always have a set - // deletion timestamp. - FinalizeKind(ctx context.Context, o *v1beta1.StepAction) reconciler.Event -} - -// ReadOnlyInterface defines the strongly typed interfaces to be implemented by a -// controller reconciling v1beta1.StepAction if they want to process resources for which -// they are not the leader. -type ReadOnlyInterface interface { - // ObserveKind implements logic to observe v1beta1.StepAction. - // This method should not write to the API. - ObserveKind(ctx context.Context, o *v1beta1.StepAction) reconciler.Event -} - -type doReconcile func(ctx context.Context, o *v1beta1.StepAction) reconciler.Event - -// reconcilerImpl implements controller.Reconciler for v1beta1.StepAction resources. -type reconcilerImpl struct { - // LeaderAwareFuncs is inlined to help us implement reconciler.LeaderAware. - reconciler.LeaderAwareFuncs - - // Client is used to write back status updates. - Client versioned.Interface - - // Listers index properties about resources. - Lister pipelinev1beta1.StepActionLister - - // Recorder is an event recorder for recording Event resources to the - // Kubernetes API. - Recorder record.EventRecorder - - // configStore allows for decorating a context with config maps. - // +optional - configStore reconciler.ConfigStore - - // reconciler is the implementation of the business logic of the resource. - reconciler Interface - - // finalizerName is the name of the finalizer to reconcile. - finalizerName string -} - -// Check that our Reconciler implements controller.Reconciler. -var _ controller.Reconciler = (*reconcilerImpl)(nil) - -// Check that our generated Reconciler is always LeaderAware. -var _ reconciler.LeaderAware = (*reconcilerImpl)(nil) - -func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister pipelinev1beta1.StepActionLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { - // Check the options function input. It should be 0 or 1. - if len(options) > 1 { - logger.Fatal("Up to one options struct is supported, found: ", len(options)) - } - - // Fail fast when users inadvertently implement the other LeaderAware interface. - // For the typed reconcilers, Promote shouldn't take any arguments. - if _, ok := r.(reconciler.LeaderAware); ok { - logger.Fatalf("%T implements the incorrect LeaderAware interface. Promote() should not take an argument as genreconciler handles the enqueuing automatically.", r) - } - - rec := &reconcilerImpl{ - LeaderAwareFuncs: reconciler.LeaderAwareFuncs{ - PromoteFunc: func(bkt reconciler.Bucket, enq func(reconciler.Bucket, types.NamespacedName)) error { - all, err := lister.List(labels.Everything()) - if err != nil { - return err - } - for _, elt := range all { - // TODO: Consider letting users specify a filter in options. - enq(bkt, types.NamespacedName{ - Namespace: elt.GetNamespace(), - Name: elt.GetName(), - }) - } - return nil - }, - }, - Client: client, - Lister: lister, - Recorder: recorder, - reconciler: r, - finalizerName: defaultFinalizerName, - } - - for _, opts := range options { - if opts.ConfigStore != nil { - rec.configStore = opts.ConfigStore - } - if opts.FinalizerName != "" { - rec.finalizerName = opts.FinalizerName - } - if opts.DemoteFunc != nil { - rec.DemoteFunc = opts.DemoteFunc - } - } - - return rec -} - -// Reconcile implements controller.Reconciler -func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error { - logger := logging.FromContext(ctx) - - // Initialize the reconciler state. This will convert the namespace/name - // string into a distinct namespace and name, determine if this instance of - // the reconciler is the leader, and any additional interfaces implemented - // by the reconciler. Returns an error is the resource key is invalid. - s, err := newState(key, r) - if err != nil { - logger.Error("Invalid resource key: ", key) - return nil - } - - // If we are not the leader, and we don't implement either ReadOnly - // observer interfaces, then take a fast-path out. - if s.isNotLeaderNorObserver() { - return controller.NewSkipKey(key) - } - - // If configStore is set, attach the frozen configuration to the context. - if r.configStore != nil { - ctx = r.configStore.ToContext(ctx) - } - - // Add the recorder to context. - ctx = controller.WithEventRecorder(ctx, r.Recorder) - - // Get the resource with this namespace/name. - - getter := r.Lister.StepActions(s.namespace) - - original, err := getter.Get(s.name) - - if errors.IsNotFound(err) { - // The resource may no longer exist, in which case we stop processing and call - // the ObserveDeletion handler if appropriate. - logger.Debugf("Resource %q no longer exists", key) - if del, ok := r.reconciler.(reconciler.OnDeletionInterface); ok { - return del.ObserveDeletion(ctx, types.NamespacedName{ - Namespace: s.namespace, - Name: s.name, - }) - } - return nil - } else if err != nil { - return err - } - - // Don't modify the informers copy. - resource := original.DeepCopy() - - var reconcileEvent reconciler.Event - - name, do := s.reconcileMethodFor(resource) - // Append the target method to the logger. - logger = logger.With(zap.String("targetMethod", name)) - switch name { - case reconciler.DoReconcileKind: - // Set and update the finalizer on resource if r.reconciler - // implements Finalizer. - if resource, err = r.setFinalizerIfFinalizer(ctx, resource); err != nil { - return fmt.Errorf("failed to set finalizers: %w", err) - } - - // Reconcile this copy of the resource and then write back any status - // updates regardless of whether the reconciliation errored out. - reconcileEvent = do(ctx, resource) - - case reconciler.DoFinalizeKind: - // For finalizing reconcilers, if this resource being marked for deletion - // and reconciled cleanly (nil or normal event), remove the finalizer. - reconcileEvent = do(ctx, resource) - - if resource, err = r.clearFinalizer(ctx, resource, reconcileEvent); err != nil { - return fmt.Errorf("failed to clear finalizers: %w", err) - } - - case reconciler.DoObserveKind: - // Observe any changes to this resource, since we are not the leader. - reconcileEvent = do(ctx, resource) - - } - - // Report the reconciler event, if any. - if reconcileEvent != nil { - var event *reconciler.ReconcilerEvent - if reconciler.EventAs(reconcileEvent, &event) { - logger.Infow("Returned an event", zap.Any("event", reconcileEvent)) - r.Recorder.Event(resource, event.EventType, event.Reason, event.Error()) - - // the event was wrapped inside an error, consider the reconciliation as failed - if _, isEvent := reconcileEvent.(*reconciler.ReconcilerEvent); !isEvent { - return reconcileEvent - } - return nil - } - - if controller.IsSkipKey(reconcileEvent) { - // This is a wrapped error, don't emit an event. - } else if ok, _ := controller.IsRequeueKey(reconcileEvent); ok { - // This is a wrapped error, don't emit an event. - } else { - logger.Errorw("Returned an error", zap.Error(reconcileEvent)) - r.Recorder.Event(resource, v1.EventTypeWarning, "InternalError", reconcileEvent.Error()) - } - return reconcileEvent - } - - return nil -} - -// updateFinalizersFiltered will update the Finalizers of the resource. -// TODO: this method could be generic and sync all finalizers. For now it only -// updates defaultFinalizerName or its override. -func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1beta1.StepAction, desiredFinalizers sets.Set[string]) (*v1beta1.StepAction, error) { - // Don't modify the informers copy. - existing := resource.DeepCopy() - - var finalizers []string - - // If there's nothing to update, just return. - existingFinalizers := sets.New[string](existing.Finalizers...) - - if desiredFinalizers.Has(r.finalizerName) { - if existingFinalizers.Has(r.finalizerName) { - // Nothing to do. - return resource, nil - } - // Add the finalizer. - finalizers = append(existing.Finalizers, r.finalizerName) - } else { - if !existingFinalizers.Has(r.finalizerName) { - // Nothing to do. - return resource, nil - } - // Remove the finalizer. - existingFinalizers.Delete(r.finalizerName) - finalizers = sets.List(existingFinalizers) - } - - mergePatch := map[string]interface{}{ - "metadata": map[string]interface{}{ - "finalizers": finalizers, - "resourceVersion": existing.ResourceVersion, - }, - } - - patch, err := json.Marshal(mergePatch) - if err != nil { - return resource, err - } - - patcher := r.Client.TektonV1beta1().StepActions(resource.Namespace) - - resourceName := resource.Name - updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{}) - if err != nil { - r.Recorder.Eventf(existing, v1.EventTypeWarning, "FinalizerUpdateFailed", - "Failed to update finalizers for %q: %v", resourceName, err) - } else { - r.Recorder.Eventf(updated, v1.EventTypeNormal, "FinalizerUpdate", - "Updated %q finalizers", resource.GetName()) - } - return updated, err -} - -func (r *reconcilerImpl) setFinalizerIfFinalizer(ctx context.Context, resource *v1beta1.StepAction) (*v1beta1.StepAction, error) { - if _, ok := r.reconciler.(Finalizer); !ok { - return resource, nil - } - - finalizers := sets.New[string](resource.Finalizers...) - - // If this resource is not being deleted, mark the finalizer. - if resource.GetDeletionTimestamp().IsZero() { - finalizers.Insert(r.finalizerName) - } - - // Synchronize the finalizers filtered by r.finalizerName. - return r.updateFinalizersFiltered(ctx, resource, finalizers) -} - -func (r *reconcilerImpl) clearFinalizer(ctx context.Context, resource *v1beta1.StepAction, reconcileEvent reconciler.Event) (*v1beta1.StepAction, error) { - if _, ok := r.reconciler.(Finalizer); !ok { - return resource, nil - } - if resource.GetDeletionTimestamp().IsZero() { - return resource, nil - } - - finalizers := sets.New[string](resource.Finalizers...) - - if reconcileEvent != nil { - var event *reconciler.ReconcilerEvent - if reconciler.EventAs(reconcileEvent, &event) { - if event.EventType == v1.EventTypeNormal { - finalizers.Delete(r.finalizerName) - } - } - } else { - finalizers.Delete(r.finalizerName) - } - - // Synchronize the finalizers filtered by r.finalizerName. - return r.updateFinalizersFiltered(ctx, resource, finalizers) -} diff --git a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/state.go b/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/state.go deleted file mode 100644 index fa6e4b914f8..00000000000 --- a/upstream/pkg/client/injection/reconciler/pipeline/v1beta1/stepaction/state.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by injection-gen. DO NOT EDIT. - -package stepaction - -import ( - fmt "fmt" - - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - types "k8s.io/apimachinery/pkg/types" - cache "k8s.io/client-go/tools/cache" - reconciler "knative.dev/pkg/reconciler" -) - -// state is used to track the state of a reconciler in a single run. -type state struct { - // key is the original reconciliation key from the queue. - key string - // namespace is the namespace split from the reconciliation key. - namespace string - // name is the name split from the reconciliation key. - name string - // reconciler is the reconciler. - reconciler Interface - // roi is the read only interface cast of the reconciler. - roi ReadOnlyInterface - // isROI (Read Only Interface) the reconciler only observes reconciliation. - isROI bool - // isLeader the instance of the reconciler is the elected leader. - isLeader bool -} - -func newState(key string, r *reconcilerImpl) (*state, error) { - // Convert the namespace/name string into a distinct namespace and name. - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - return nil, fmt.Errorf("invalid resource key: %s", key) - } - - roi, isROI := r.reconciler.(ReadOnlyInterface) - - isLeader := r.IsLeaderFor(types.NamespacedName{ - Namespace: namespace, - Name: name, - }) - - return &state{ - key: key, - namespace: namespace, - name: name, - reconciler: r.reconciler, - roi: roi, - isROI: isROI, - isLeader: isLeader, - }, nil -} - -// isNotLeaderNorObserver checks to see if this reconciler with the current -// state is enabled to do any work or not. -// isNotLeaderNorObserver returns true when there is no work possible for the -// reconciler. -func (s *state) isNotLeaderNorObserver() bool { - if !s.isLeader && !s.isROI { - // If we are not the leader, and we don't implement the ReadOnly - // interface, then take a fast-path out. - return true - } - return false -} - -func (s *state) reconcileMethodFor(o *v1beta1.StepAction) (string, doReconcile) { - if o.GetDeletionTimestamp().IsZero() { - if s.isLeader { - return reconciler.DoReconcileKind, s.reconciler.ReconcileKind - } else if s.isROI { - return reconciler.DoObserveKind, s.roi.ObserveKind - } - } else if fin, ok := s.reconciler.(Finalizer); s.isLeader && ok { - return reconciler.DoFinalizeKind, fin.FinalizeKind - } - return "unknown", nil -} diff --git a/upstream/pkg/client/listers/pipeline/v1beta1/expansion_generated.go b/upstream/pkg/client/listers/pipeline/v1beta1/expansion_generated.go index 0fe1994d1d8..db5d996e615 100644 --- a/upstream/pkg/client/listers/pipeline/v1beta1/expansion_generated.go +++ b/upstream/pkg/client/listers/pipeline/v1beta1/expansion_generated.go @@ -46,14 +46,6 @@ type PipelineRunListerExpansion interface{} // PipelineRunNamespaceLister. type PipelineRunNamespaceListerExpansion interface{} -// StepActionListerExpansion allows custom methods to be added to -// StepActionLister. -type StepActionListerExpansion interface{} - -// StepActionNamespaceListerExpansion allows custom methods to be added to -// StepActionNamespaceLister. -type StepActionNamespaceListerExpansion interface{} - // TaskListerExpansion allows custom methods to be added to // TaskLister. type TaskListerExpansion interface{} diff --git a/upstream/pkg/client/listers/pipeline/v1beta1/stepaction.go b/upstream/pkg/client/listers/pipeline/v1beta1/stepaction.go deleted file mode 100644 index 1925738258d..00000000000 --- a/upstream/pkg/client/listers/pipeline/v1beta1/stepaction.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// StepActionLister helps list StepActions. -// All objects returned here must be treated as read-only. -type StepActionLister interface { - // List lists all StepActions in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.StepAction, err error) - // StepActions returns an object that can list and get StepActions. - StepActions(namespace string) StepActionNamespaceLister - StepActionListerExpansion -} - -// stepActionLister implements the StepActionLister interface. -type stepActionLister struct { - indexer cache.Indexer -} - -// NewStepActionLister returns a new StepActionLister. -func NewStepActionLister(indexer cache.Indexer) StepActionLister { - return &stepActionLister{indexer: indexer} -} - -// List lists all StepActions in the indexer. -func (s *stepActionLister) List(selector labels.Selector) (ret []*v1beta1.StepAction, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.StepAction)) - }) - return ret, err -} - -// StepActions returns an object that can list and get StepActions. -func (s *stepActionLister) StepActions(namespace string) StepActionNamespaceLister { - return stepActionNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// StepActionNamespaceLister helps list and get StepActions. -// All objects returned here must be treated as read-only. -type StepActionNamespaceLister interface { - // List lists all StepActions in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.StepAction, err error) - // Get retrieves the StepAction from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.StepAction, error) - StepActionNamespaceListerExpansion -} - -// stepActionNamespaceLister implements the StepActionNamespaceLister -// interface. -type stepActionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all StepActions in the indexer for a given namespace. -func (s stepActionNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.StepAction, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.StepAction)) - }) - return ret, err -} - -// Get retrieves the StepAction from the indexer for a given namespace and name. -func (s stepActionNamespaceLister) Get(name string) (*v1beta1.StepAction, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("stepaction"), name) - } - return obj.(*v1beta1.StepAction), nil -} diff --git a/upstream/pkg/client/resolution/informers/externalversions/factory.go b/upstream/pkg/client/resolution/informers/externalversions/factory.go index d6e309712f3..840022745d4 100644 --- a/upstream/pkg/client/resolution/informers/externalversions/factory.go +++ b/upstream/pkg/client/resolution/informers/externalversions/factory.go @@ -42,7 +42,6 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration - transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -81,14 +80,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -193,7 +184,6 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/upstream/pkg/client/resource/informers/externalversions/factory.go b/upstream/pkg/client/resource/informers/externalversions/factory.go index f03f0976e5e..6f20faef324 100644 --- a/upstream/pkg/client/resource/informers/externalversions/factory.go +++ b/upstream/pkg/client/resource/informers/externalversions/factory.go @@ -42,7 +42,6 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration - transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -81,14 +80,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -193,7 +184,6 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/upstream/pkg/container/step_replacements.go b/upstream/pkg/container/step_replacements.go index e30c3335bac..921995157a2 100644 --- a/upstream/pkg/container/step_replacements.go +++ b/upstream/pkg/container/step_replacements.go @@ -31,7 +31,6 @@ func ApplyStepReplacements(step *v1.Step, stringReplacements map[string]string, if step.StderrConfig != nil { step.StderrConfig.Path = substitution.ApplyReplacements(step.StderrConfig.Path, stringReplacements) } - step.When = step.When.ReplaceVariables(stringReplacements, arrayReplacements) applyStepReplacements(step, stringReplacements, arrayReplacements) } diff --git a/upstream/pkg/container/step_replacements_test.go b/upstream/pkg/container/step_replacements_test.go index ba45fee8901..4da6e4acf70 100644 --- a/upstream/pkg/container/step_replacements_test.go +++ b/upstream/pkg/container/step_replacements_test.go @@ -23,7 +23,6 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/container" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/selection" ) func TestApplyStepReplacements(t *testing.T) { @@ -44,12 +43,6 @@ func TestApplyStepReplacements(t *testing.T) { Args: []string{"$(array.replace.me)"}, WorkingDir: "$(replace.me)", OnError: "$(replace.me)", - When: v1.StepWhenExpressions{{ - Input: "$(replace.me)", - Operator: selection.In, - Values: []string{"$(array.replace.me)"}, - CEL: "'$(replace.me)=bar'", - }}, EnvFrom: []corev1.EnvFromSource{{ ConfigMapRef: &corev1.ConfigMapEnvSource{ LocalObjectReference: corev1.LocalObjectReference{ @@ -101,12 +94,6 @@ func TestApplyStepReplacements(t *testing.T) { Args: []string{"val1", "val2"}, WorkingDir: "replaced!", OnError: "replaced!", - When: v1.StepWhenExpressions{{ - Input: "replaced!", - Operator: selection.In, - Values: []string{"val1", "val2"}, - CEL: "'replaced!=bar'", - }}, EnvFrom: []corev1.EnvFromSource{{ ConfigMapRef: &corev1.ConfigMapEnvSource{ LocalObjectReference: corev1.LocalObjectReference{ diff --git a/upstream/pkg/entrypoint/entrypointer.go b/upstream/pkg/entrypoint/entrypointer.go index b3913665a75..8ae4c1f2cfd 100644 --- a/upstream/pkg/entrypoint/entrypointer.go +++ b/upstream/pkg/entrypoint/entrypointer.go @@ -40,8 +40,6 @@ import ( "github.com/tektoncd/pipeline/pkg/result" "github.com/tektoncd/pipeline/pkg/spire" "github.com/tektoncd/pipeline/pkg/termination" - - "github.com/google/cel-go/cel" "go.uber.org/zap" ) @@ -52,22 +50,6 @@ const ( FailOnError = "stopAndFail" ) -const ( - breakpointExitSuffix = ".breakpointexit" - breakpointBeforeStepSuffix = ".beforestepexit" -) - -// DebugBeforeStepError is an error means mark before step breakpoint failure -type DebugBeforeStepError string - -func (e DebugBeforeStepError) Error() string { - return string(e) -} - -var ( - errDebugBeforeStep = DebugBeforeStepError("before step breakpoint error file, user decided to skip the current step execution") -) - // ScriptDir for testing var ScriptDir = pipeline.ScriptDir @@ -138,8 +120,6 @@ type Entrypointer struct { Timeout *time.Duration // BreakpointOnFailure helps determine if entrypoint execution needs to adapt debugging requirements BreakpointOnFailure bool - // DebugBeforeStep help user attach container before execution - DebugBeforeStep bool // OnError defines exiting behavior of the entrypoint // set it to "stopAndFail" to indicate the entrypoint to exit the taskRun if the container exits with non zero exit code // set it to "continue" to indicate the entrypoint to continue executing the rest of the steps irrespective of the container exit code @@ -152,12 +132,6 @@ type Entrypointer struct { ResultsDirectory string // ResultExtractionMethod is the method using which the controller extracts the results from the task pod. ResultExtractionMethod string - - // StepWhenExpressions a list of when expression to decide if the step should be skipped - StepWhenExpressions v1.StepWhenExpressions - - // ArtifactsDirectory is the directory to find artifacts, defaults to pipeline.ArtifactsDir - ArtifactsDirectory string } // Waiter encapsulates waiting for files to exist. @@ -219,17 +193,13 @@ func (e Entrypointer) Go() error { } } - var err error - if e.DebugBeforeStep { - err = e.waitBeforeStepDebug() - } - output = append(output, result.RunResult{ Key: "StartedAt", Value: time.Now().Format(timeFormat), ResultType: result.InternalTektonResultType, }) + var err error if e.Timeout != nil && *e.Timeout < time.Duration(0) { err = errors.New("negative timeout specified") } @@ -254,26 +224,11 @@ func (e Entrypointer) Go() error { logger.Error("Error while waiting for cancellation", zap.Error(err)) } }() - allowExec, err1 := e.allowExec() - - switch { - case err1 != nil: - err = err1 - case allowExec: - err = e.Runner.Run(ctx, e.Command...) - default: - logger.Info("Step was skipped due to when expressions were evaluated to false.") - output = append(output, e.outputRunResult(pod.TerminationReasonSkipped)) - e.WritePostFile(e.PostFile, nil) - e.WriteExitCodeFile(e.StepMetadataDir, "0") - return nil - } + err = e.Runner.Run(ctx, e.Command...) } var ee *exec.ExitError switch { - case err != nil && errors.Is(err, errDebugBeforeStep): - e.WritePostFile(e.PostFile, err) case err != nil && errors.Is(err, ErrContextCanceled): logger.Info("Step was canceling") output = append(output, e.outputRunResult(pod.TerminationReasonCancelled)) @@ -325,13 +280,19 @@ func (e Entrypointer) Go() error { } if e.ResultExtractionMethod == config.ResultExtractionMethodTerminationMessage { - e.appendArtifactOutputs(&output, logger) + fp := filepath.Join(e.StepMetadataDir, "artifacts", "provenance.json") + + artifacts, err := readArtifacts(fp) + if err != nil { + logger.Fatalf("Error while handling artifacts: %s", err) + } + output = append(output, artifacts...) } return err } -func readArtifacts(fp string, resultType result.ResultType) ([]result.RunResult, error) { +func readArtifacts(fp string) ([]result.RunResult, error) { file, err := os.ReadFile(fp) if os.IsNotExist(err) { return []result.RunResult{}, nil @@ -339,85 +300,7 @@ func readArtifacts(fp string, resultType result.ResultType) ([]result.RunResult, if err != nil { return nil, err } - return []result.RunResult{{Key: fp, Value: string(file), ResultType: resultType}}, nil -} - -func (e Entrypointer) appendArtifactOutputs(output *[]result.RunResult, logger *zap.SugaredLogger) { - // step artifacts - fp := filepath.Join(e.StepMetadataDir, "artifacts", "provenance.json") - artifacts, err := readArtifacts(fp, result.StepArtifactsResultType) - if err != nil { - logger.Fatalf("Error while handling step artifacts: %s", err) - } - *output = append(*output, artifacts...) - - artifactsDir := pipeline.ArtifactsDir - // task artifacts - if e.ArtifactsDirectory != "" { - artifactsDir = e.ArtifactsDirectory - } - fp = filepath.Join(artifactsDir, "provenance.json") - artifacts, err = readArtifacts(fp, result.TaskRunArtifactsResultType) - if err != nil { - logger.Fatalf("Error while handling task artifacts: %s", err) - } - *output = append(*output, artifacts...) -} - -func (e Entrypointer) allowExec() (bool, error) { - when := e.StepWhenExpressions - m := map[string]bool{} - - for _, we := range when { - if we.CEL == "" { - continue - } - b, ok := m[we.CEL] - if ok && !b { - return false, nil - } - - env, err := cel.NewEnv() - if err != nil { - return false, err - } - ast, iss := env.Compile(we.CEL) - if iss.Err() != nil { - return false, iss.Err() - } - // Generate an evaluable instance of the Ast within the environment - prg, err := env.Program(ast) - if err != nil { - return false, err - } - // Evaluate the CEL expression - out, _, err := prg.Eval(map[string]interface{}{}) - if err != nil { - return false, err - } - - b, ok = out.Value().(bool) - if !ok { - return false, fmt.Errorf("the CEL expression %s is not evaluated to a boolean", we.CEL) - } - if !b { - return false, err - } - m[we.CEL] = true - } - return when.AllowsExecution(m), nil -} - -func (e Entrypointer) waitBeforeStepDebug() error { - log.Println(`debug before step breakpoint has taken effect, waiting for user's decision: -1) continue, use cmd: /tekton/debug/scripts/debug-beforestep-continue -2) fail-continue, use cmd: /tekton/debug/scripts/debug-beforestep-fail-continue`) - breakpointBeforeStepPostFile := e.PostFile + breakpointBeforeStepSuffix - if waitErr := e.Waiter.Wait(context.Background(), breakpointBeforeStepPostFile, false, false); waitErr != nil { - log.Println("error occurred while waiting for " + breakpointBeforeStepPostFile + " : " + errDebugBeforeStep.Error()) - return errDebugBeforeStep - } - return nil + return []result.RunResult{{Key: fp, Value: string(file), ResultType: result.ArtifactsResultType}}, nil } func (e Entrypointer) readResultsFromDisk(ctx context.Context, resultDir string, resultType result.ResultType) error { @@ -498,28 +381,6 @@ func (e Entrypointer) waitingCancellation(ctx context.Context, cancel context.Ca return nil } -// CheckForBreakpointOnFailure if step up breakpoint on failure -// waiting breakpointExitPostFile to be written -func (e Entrypointer) CheckForBreakpointOnFailure() { - if e.BreakpointOnFailure { - log.Println(`debug onFailure breakpoint has taken effect, waiting for user's decision: -1) continue, use cmd: /tekton/debug/scripts/debug-continue -2) fail-continue, use cmd: /tekton/debug/scripts/debug-fail-continue`) - breakpointExitPostFile := e.PostFile + breakpointExitSuffix - if waitErr := e.Waiter.Wait(context.Background(), breakpointExitPostFile, false, false); waitErr != nil { - log.Println("error occurred while waiting for " + breakpointExitPostFile + " : " + waitErr.Error()) - } - // get exitcode from .breakpointexit - exitCode, readErr := e.BreakpointExitCode(breakpointExitPostFile) - // if readErr exists, the exitcode with default to 0 as we would like - // to encourage to continue running the next steps in the taskRun - if readErr != nil { - log.Println("error occurred while reading breakpoint exit code : " + readErr.Error()) - } - os.Exit(exitCode) - } -} - // loadStepResult reads the step result file and returns the string, array or object result value. func loadStepResult(stepDir string, stepName string, resultName string) (v1.ResultValue, error) { v := v1.ResultValue{} @@ -624,13 +485,6 @@ func (e *Entrypointer) applyStepResultSubstitutions(stepDir string) error { if err := replaceEnv(stepDir); err != nil { return err } - - // replace when - newWhen, err := replaceWhen(stepDir, e.StepWhenExpressions) - if err != nil { - return err - } - e.StepWhenExpressions = newWhen // command + args newCommand, err := replaceCommandAndArgs(e.Command, stepDir) if err != nil { @@ -640,58 +494,6 @@ func (e *Entrypointer) applyStepResultSubstitutions(stepDir string) error { return nil } -func replaceWhen(stepDir string, when v1.StepWhenExpressions) (v1.StepWhenExpressions, error) { - for i, w := range when { - var newValues []string - flag: - for _, v := range when[i].Values { - matches := resultref.StepResultRegex.FindAllStringSubmatch(v, -1) - newV := v - for _, m := range matches { - replaceWithString, replaceWithArray, err := findReplacement(stepDir, m[0]) - if err != nil { - return v1.WhenExpressions{}, err - } - // replaceWithString and replaceWithArray are mutually exclusive - if len(replaceWithArray) > 0 { - if v != m[0] { - // it has to be exact in "$(steps..results.[*])" format, without anything else in the original string - return nil, errors.New("value must be in \"$(steps..results.[*])\" format, when using array results") - } - newValues = append(newValues, replaceWithArray...) - continue flag - } - newV = strings.ReplaceAll(newV, m[0], replaceWithString) - } - newValues = append(newValues, newV) - } - when[i].Values = newValues - - matches := resultref.StepResultRegex.FindAllStringSubmatch(w.Input, -1) - v := when[i].Input - for _, m := range matches { - replaceWith, _, err := findReplacement(stepDir, m[0]) - if err != nil { - return v1.StepWhenExpressions{}, err - } - v = strings.ReplaceAll(v, m[0], replaceWith) - } - when[i].Input = v - - matches = resultref.StepResultRegex.FindAllStringSubmatch(w.CEL, -1) - c := when[i].CEL - for _, m := range matches { - replaceWith, _, err := findReplacement(stepDir, m[0]) - if err != nil { - return v1.StepWhenExpressions{}, err - } - c = strings.ReplaceAll(c, m[0], replaceWith) - } - when[i].CEL = c - } - return when, nil -} - // outputRunResult returns the run reason for a termination func (e Entrypointer) outputRunResult(terminationReason string) result.RunResult { return result.RunResult{ @@ -738,6 +540,7 @@ func getArtifactValues(dir string, template string) (string, error) { } // $(steps.stepName.outputs.artifactName) <- artifacts.Output[artifactName].Values + // $(steps.stepName.outputs) <- artifacts.Output[0].Values var t []v1.Artifact if artifactTemplate.Type == "outputs" { t = artifacts.Outputs @@ -745,6 +548,13 @@ func getArtifactValues(dir string, template string) (string, error) { t = artifacts.Inputs } + if artifactTemplate.ArtifactName == "" { + marshal, err := json.Marshal(t[0].Values) + if err != nil { + return "", err + } + return string(marshal), err + } for _, ar := range t { if ar.Name == artifactTemplate.ArtifactName { marshal, err := json.Marshal(ar.Values) @@ -758,7 +568,8 @@ func getArtifactValues(dir string, template string) (string, error) { } // parseArtifactTemplate parses an artifact template string and extracts relevant information into an ArtifactTemplate struct. -// The artifact template is expected to be in the format "$(steps..outputs.)". +// +// The artifact template is expected to be in the format "$(steps.{step-name}.outputs.{artifact-name})" or "$(steps.{step-name}.outputs)". func parseArtifactTemplate(template string) (ArtifactTemplate, error) { if template == "" { return ArtifactTemplate{}, errors.New("template is empty") diff --git a/upstream/pkg/entrypoint/entrypointer_test.go b/upstream/pkg/entrypoint/entrypointer_test.go index b5c423d1376..40aa53158f3 100644 --- a/upstream/pkg/entrypoint/entrypointer_test.go +++ b/upstream/pkg/entrypoint/entrypointer_test.go @@ -32,6 +32,7 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -40,10 +41,7 @@ import ( "github.com/tektoncd/pipeline/pkg/spire" "github.com/tektoncd/pipeline/pkg/termination" "github.com/tektoncd/pipeline/test/diff" - - "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/selection" "knative.dev/pkg/logging" ) @@ -142,9 +140,7 @@ func TestEntrypointer(t *testing.T) { for _, c := range []struct { desc, entrypoint, postFile, stepDir, stepDirLink string waitFiles, args []string - waitDebugFiles []string breakpointOnFailure bool - debugBeforeStep bool }{{ desc: "do nothing", }, { @@ -175,17 +171,6 @@ func TestEntrypointer(t *testing.T) { }, { desc: "breakpointOnFailure to wait or not to wait ", breakpointOnFailure: true, - }, { - desc: "breakpointBeforeStep to wait or not to wait", - debugBeforeStep: true, - waitFiles: []string{"waitforme"}, - waitDebugFiles: []string{".beforestepexit"}, - }, { - desc: "all breakpoints to wait or not to wait", - breakpointOnFailure: true, - debugBeforeStep: true, - waitFiles: []string{"waitforme", ".beforestepexit"}, - waitDebugFiles: []string{".beforestepexit"}, }} { t.Run(c.desc, func(t *testing.T) { fw, fr, fpw := &fakeWaiter{}, &fakeRunner{}, &fakePostWriter{} @@ -207,7 +192,6 @@ func TestEntrypointer(t *testing.T) { TerminationPath: terminationPath, Timeout: &timeout, BreakpointOnFailure: c.breakpointOnFailure, - DebugBeforeStep: c.debugBeforeStep, StepMetadataDir: c.stepDir, }.Go() if err != nil { @@ -221,7 +205,7 @@ func TestEntrypointer(t *testing.T) { if len(c.waitFiles) > 0 { if fw.waited == nil { t.Error("Wanted waited file, got nil") - } else if !reflect.DeepEqual(fw.waited, append(c.waitFiles, c.waitDebugFiles...)) { + } else if !reflect.DeepEqual(fw.waited, c.waitFiles) { t.Errorf("Waited for %v, want %v", fw.waited, c.waitFiles) } } @@ -280,47 +264,6 @@ func TestEntrypointer(t *testing.T) { } } -func TestCheckForBreakpointOnFailure(t *testing.T) { - testCases := []struct { - name string - breakpointOnFailure bool - }{ - { - name: "set breakpoint on failure and exit with code 0", - breakpointOnFailure: true, - }, - { - name: "unset breakpoint on failure", - breakpointOnFailure: false, - }, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - tmp, err := os.CreateTemp("", "1*.breakpoint") - if err != nil { - t.Fatalf("error while creating temp file for testing exit code written by breakpoint") - } - breakpointFile, err := os.Create(tmp.Name() + breakpointExitSuffix) - if err != nil { - t.Fatalf("failed to create breakpoint waiting file, err: %v", err) - } - // write exit code to file - if err = os.WriteFile(breakpointFile.Name(), []byte("0"), 0700); err != nil { - t.Fatalf("failed writing to temp file create temp file for testing exit code written by breakpoint, err: %v", err) - } - e := Entrypointer{ - BreakpointOnFailure: tc.breakpointOnFailure, - PostFile: tmp.Name(), - Waiter: &fakeWaiter{}, - } - defer func() { - recover() - }() - e.CheckForBreakpointOnFailure() - }) - } -} - func TestReadResultsFromDisk(t *testing.T) { for _, c := range []struct { desc string @@ -483,7 +426,6 @@ func TestEntrypointer_OnError(t *testing.T) { desc, postFile, onError string runner Runner expectedError bool - debugBeforeStep bool }{{ desc: "the step is exiting with 1, ignore the step error when onError is set to continue", runner: &fakeExitErrorRunner{}, @@ -508,13 +450,6 @@ func TestEntrypointer_OnError(t *testing.T) { postFile: "step-one", onError: FailOnError, expectedError: false, - }, { - desc: "the step set debug before step, and before step breakpoint fail-continue", - runner: &fakeRunner{}, - postFile: "step-one", - onError: errDebugBeforeStep.Error(), - debugBeforeStep: true, - expectedError: true, }} { t.Run(c.desc, func(t *testing.T) { fpw := &fakePostWriter{} @@ -525,7 +460,7 @@ func TestEntrypointer_OnError(t *testing.T) { terminationPath = terminationFile.Name() defer os.Remove(terminationFile.Name()) } - entry := Entrypointer{ + err := Entrypointer{ Command: []string{"echo", "some", "args"}, WaitFiles: []string{}, PostFile: c.postFile, @@ -534,23 +469,12 @@ func TestEntrypointer_OnError(t *testing.T) { PostWriter: fpw, TerminationPath: terminationPath, OnError: c.onError, - DebugBeforeStep: c.debugBeforeStep, - } - if c.expectedError && (c.debugBeforeStep) { - entry.Waiter = &fakeErrorWaiter{} - } - err := entry.Go() + }.Go() if c.expectedError && err == nil { t.Fatalf("Entrypointer didn't fail") } - if c.expectedError && (c.debugBeforeStep) { - if err.Error() != c.onError { - t.Errorf("breakpoint fail-continue, want err: %s but got: %s", c.onError, err.Error()) - } - } - if c.onError == ContinueOnError { switch { case fpw.wrote == nil: @@ -838,34 +762,31 @@ func TestApplyStepResultSubstitutions_Env(t *testing.T) { envValue string want string wantErr bool - }{ - { - name: "string param", - stepName: "foo", - resultName: "res", - result: "Hello", - envValue: "$(steps.foo.results.res)", - want: "Hello", - wantErr: false, - }, - { - name: "array param", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - envValue: "$(steps.foo.results.res[1])", - want: "World", - wantErr: false, - }, - { - name: "object param", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - envValue: "$(steps.foo.results.res.hello)", - want: "World", - wantErr: false, - }, + }{{ + name: "string param", + stepName: "foo", + resultName: "res", + result: "Hello", + envValue: "$(steps.foo.results.res)", + want: "Hello", + wantErr: false, + }, { + name: "array param", + stepName: "foo", + resultName: "res", + result: "[\"Hello\",\"World\"]", + envValue: "$(steps.foo.results.res[1])", + want: "World", + wantErr: false, + }, { + name: "object param", + stepName: "foo", + resultName: "res", + result: "{\"hello\":\"World\"}", + envValue: "$(steps.foo.results.res.hello)", + want: "World", + wantErr: false, + }, { name: "interpolation multiple matches", stepName: "foo", @@ -874,8 +795,7 @@ func TestApplyStepResultSubstitutions_Env(t *testing.T) { envValue: "$(steps.foo.results.res.first)-$(steps.foo.results.res.second)", want: "hello-world", wantErr: false, - }, - { + }, { name: "bad-result-format", stepName: "foo", resultName: "res", @@ -883,8 +803,7 @@ func TestApplyStepResultSubstitutions_Env(t *testing.T) { envValue: "echo $(steps.foo.results.res.hello.bar)", want: "echo $(steps.foo.results.res.hello.bar)", wantErr: true, - }, - } + }} stepDir := createTmpDir(t, "env-steps") for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { @@ -925,325 +844,87 @@ func TestApplyStepResultSubstitutions_Command(t *testing.T) { command []string want []string wantErr bool - }{ - { - name: "string param", - stepName: "foo", - resultName: "res1", - result: "Hello", - command: []string{"$(steps.foo.results.res1)"}, - want: []string{"Hello"}, - wantErr: false, - }, { - name: "array param", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - command: []string{"$(steps.foo.results.res[1])"}, - want: []string{"World"}, - wantErr: false, - }, { - name: "array param no index", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - command: []string{"start", "$(steps.foo.results.res[*])", "stop"}, - want: []string{"start", "Hello", "World", "stop"}, - wantErr: false, - }, { - name: "object param", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - command: []string{"$(steps.foo.results.res.hello)"}, - want: []string{"World"}, - wantErr: false, - }, { - name: "bad-result-format", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - command: []string{"echo $(steps.foo.results.res.hello.bar)"}, - want: []string{"echo $(steps.foo.results.res.hello.bar)"}, - wantErr: true, - }, { - name: "array param no index, with extra string", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - command: []string{"start", "$(steps.foo.results.res[*])bbb", "stop"}, - want: []string{"start", "$(steps.foo.results.res[*])bbb", "stop"}, - wantErr: true, - }, { - name: "array param, multiple matches", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - command: []string{"$(steps.foo.results.res[0])-$(steps.foo.results.res[1])"}, - want: []string{"Hello-World"}, - wantErr: false, - }, { - name: "object param, multiple matches", - stepName: "foo", - resultName: "res", - result: `{"first":"hello", "second":"world"}`, - command: []string{"$(steps.foo.results.res.first)-$(steps.foo.results.res.second)"}, - want: []string{"hello-world"}, - wantErr: false, - }, - } - stepDir := createTmpDir(t, "command-steps") - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resultPath := filepath.Join(stepDir, pod.GetContainerName(tc.stepName), "results") - err := os.MkdirAll(resultPath, 0o750) - if err != nil { - log.Fatal(err) - } - resultFile := filepath.Join(resultPath, tc.resultName) - err = os.WriteFile(resultFile, []byte(tc.result), 0o666) - if err != nil { - log.Fatal(err) - } - e := Entrypointer{ - Command: tc.command, - } - err = e.applyStepResultSubstitutions(stepDir) - if tc.wantErr == false && err != nil { - t.Fatalf("Did not expect and error but got: %v", err) - } else if tc.wantErr == true && err == nil { - t.Fatalf("Expected and error but did not get any.") - } - got := e.Command - if d := cmp.Diff(tc.want, got); d != "" { - t.Errorf("Entrypointer error diff %s", diff.PrintWantGot(d)) - } - }) - } -} - -func TestApplyStepWhenSubstitutions_Input(t *testing.T) { - testCases := []struct { - name string - stepName string - resultName string - result string - want v1.StepWhenExpressions - when v1.StepWhenExpressions - wantErr bool }{{ name: "string param", stepName: "foo", - resultName: "res", + resultName: "res1", result: "Hello", - when: v1.StepWhenExpressions{{Input: "$(steps.foo.results.res)"}}, - want: v1.StepWhenExpressions{{Input: "Hello"}}, + command: []string{"$(steps.foo.results.res1)"}, + want: []string{"Hello"}, wantErr: false, }, { name: "array param", stepName: "foo", resultName: "res", result: "[\"Hello\",\"World\"]", - when: v1.StepWhenExpressions{{Input: "$(steps.foo.results.res[1])"}}, - want: v1.StepWhenExpressions{{Input: "World"}}, - wantErr: false, - }, { - name: "object param", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{Input: "$(steps.foo.results.res.hello)"}}, - want: v1.StepWhenExpressions{{Input: "World"}}, - wantErr: false, - }, { - name: "bad-result-format", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{Input: "$(steps.foo.results.res.hello.bar)"}}, - want: v1.StepWhenExpressions{{Input: "$(steps.foo.results.res.hello.bar)"}}, - wantErr: true, - }} - stepDir := createTmpDir(t, "when-input") - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resultPath := filepath.Join(stepDir, pod.GetContainerName(tc.stepName), "results") - err := os.MkdirAll(resultPath, 0750) - if err != nil { - log.Fatal(err) - } - resultFile := filepath.Join(resultPath, tc.resultName) - err = os.WriteFile(resultFile, []byte(tc.result), 0666) - if err != nil { - log.Fatal(err) - } - e := Entrypointer{ - Command: []string{}, - StepWhenExpressions: tc.when, - } - err = e.applyStepResultSubstitutions(stepDir) - if tc.wantErr == false && err != nil { - t.Fatalf("Did not expect and error but got: %v", err) - } else if tc.wantErr == true && err == nil { - t.Fatalf("Expected and error but did not get any.") - } - got := e.StepWhenExpressions - if d := cmp.Diff(got, tc.want); d != "" { - t.Errorf("applyStepResultSubstitutions(): got %v; want %v", got, tc.want) - } - }) - } -} - -func TestApplyStepWhenSubstitutions_CEL(t *testing.T) { - testCases := []struct { - name string - stepName string - resultName string - result string - want v1.StepWhenExpressions - when v1.StepWhenExpressions - wantErr bool - }{{ - name: "string param", - stepName: "foo", - resultName: "res", - result: "Hello", - when: v1.StepWhenExpressions{{CEL: "$(steps.foo.results.res)"}}, - want: v1.StepWhenExpressions{{CEL: "Hello"}}, + command: []string{"$(steps.foo.results.res[1])"}, + want: []string{"World"}, wantErr: false, }, { - name: "array param", + name: "array param no index", stepName: "foo", resultName: "res", result: "[\"Hello\",\"World\"]", - when: v1.StepWhenExpressions{{CEL: "$(steps.foo.results.res[1])"}}, - want: v1.StepWhenExpressions{{CEL: "World"}}, + command: []string{"start", "$(steps.foo.results.res[*])", "stop"}, + want: []string{"start", "Hello", "World", "stop"}, wantErr: false, }, { name: "object param", stepName: "foo", resultName: "res", result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{CEL: "$(steps.foo.results.res.hello)"}}, - want: v1.StepWhenExpressions{{CEL: "World"}}, + command: []string{"$(steps.foo.results.res.hello)"}, + want: []string{"World"}, wantErr: false, }, { name: "bad-result-format", stepName: "foo", resultName: "res", result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{CEL: "$(steps.foo.results.res.hello.bar)"}}, - want: v1.StepWhenExpressions{{CEL: "$(steps.foo.results.res.hello.bar)"}}, + command: []string{"echo $(steps.foo.results.res.hello.bar)"}, + want: []string{"echo $(steps.foo.results.res.hello.bar)"}, wantErr: true, - }} - stepDir := createTmpDir(t, "when-CEL") - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resultPath := filepath.Join(stepDir, pod.GetContainerName(tc.stepName), "results") - err := os.MkdirAll(resultPath, 0750) - if err != nil { - log.Fatal(err) - } - resultFile := filepath.Join(resultPath, tc.resultName) - err = os.WriteFile(resultFile, []byte(tc.result), 0666) - if err != nil { - log.Fatal(err) - } - e := Entrypointer{ - Command: []string{}, - StepWhenExpressions: tc.when, - } - err = e.applyStepResultSubstitutions(stepDir) - if tc.wantErr == false && err != nil { - t.Fatalf("Did not expect and error but got: %v", err) - } else if tc.wantErr == true && err == nil { - t.Fatalf("Expected and error but did not get any.") - } - got := e.StepWhenExpressions - if d := cmp.Diff(got, tc.want); d != "" { - t.Errorf("applyStepResultSubstitutions(): got %v; want %v", got, tc.want) - } - }) - } -} - -func TestApplyStepWhenSubstitutions_Values(t *testing.T) { - testCases := []struct { - name string - stepName string - resultName string - result string - want v1.StepWhenExpressions - when v1.StepWhenExpressions - wantErr bool - }{{ - name: "string param", + }, { + name: "array param no index, with extra string", stepName: "foo", resultName: "res", - result: "Hello", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res)"}}}, - want: v1.StepWhenExpressions{{Values: []string{"Hello"}}}, - wantErr: false, + result: "[\"Hello\",\"World\"]", + command: []string{"start", "$(steps.foo.results.res[*])bbb", "stop"}, + want: []string{"start", "$(steps.foo.results.res[*])bbb", "stop"}, + wantErr: true, }, { - name: "array param, reference an element", + name: "array param, multiple matches", stepName: "foo", resultName: "res", result: "[\"Hello\",\"World\"]", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res[1])"}}}, - want: v1.StepWhenExpressions{{Values: []string{"World"}}}, + command: []string{"$(steps.foo.results.res[0])-$(steps.foo.results.res[1])"}, + want: []string{"Hello-World"}, wantErr: false, }, { - name: "array param, reference whole array", + name: "object param, multiple matches", stepName: "foo", resultName: "res", - result: "[\"Hello\",\"World\"]", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res[*])"}}}, - want: v1.StepWhenExpressions{{Values: []string{"Hello", "World"}}}, + result: `{"first":"hello", "second":"world"}`, + command: []string{"$(steps.foo.results.res.first)-$(steps.foo.results.res.second)"}, + want: []string{"hello-world"}, wantErr: false, }, - { - name: "array param, reference whole array with concatenation, error", - stepName: "foo", - resultName: "res", - result: "[\"Hello\",\"World\"]", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res[*])1"}}}, - want: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res[*])1"}}}, - wantErr: true, - }, - { - name: "object param", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res.hello)"}}}, - want: v1.StepWhenExpressions{{Values: []string{"World"}}}, - wantErr: false, - }, { - name: "bad-result-format", - stepName: "foo", - resultName: "res", - result: "{\"hello\":\"World\"}", - when: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res.hello.bar)"}}}, - want: v1.StepWhenExpressions{{Values: []string{"$(steps.foo.results.res.hello.bar)"}}}, - wantErr: true, - }} - stepDir := createTmpDir(t, "when-values") + } + stepDir := createTmpDir(t, "command-steps") for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { resultPath := filepath.Join(stepDir, pod.GetContainerName(tc.stepName), "results") - err := os.MkdirAll(resultPath, 0750) + err := os.MkdirAll(resultPath, 0o750) if err != nil { log.Fatal(err) } resultFile := filepath.Join(resultPath, tc.resultName) - err = os.WriteFile(resultFile, []byte(tc.result), 0666) + err = os.WriteFile(resultFile, []byte(tc.result), 0o666) if err != nil { log.Fatal(err) } e := Entrypointer{ - Command: []string{}, - StepWhenExpressions: tc.when, + Command: tc.command, } err = e.applyStepResultSubstitutions(stepDir) if tc.wantErr == false && err != nil { @@ -1251,148 +932,14 @@ func TestApplyStepWhenSubstitutions_Values(t *testing.T) { } else if tc.wantErr == true && err == nil { t.Fatalf("Expected and error but did not get any.") } - got := e.StepWhenExpressions - if d := cmp.Diff(got, tc.want); d != "" { - t.Errorf("applyStepResultSubstitutions(): got %v; want %v", got, tc.want) + got := e.Command + if d := cmp.Diff(tc.want, got); d != "" { + t.Errorf("Entrypointer error diff %s", diff.PrintWantGot(d)) } }) } } -func TestAllowExec(t *testing.T) { - tests := []struct { - name string - whenExpressions v1.StepWhenExpressions - expected bool - wantErr bool - }{{ - name: "in expression", - whenExpressions: v1.StepWhenExpressions{ - { - Input: "foo", - Operator: selection.In, - Values: []string{"foo", "bar"}, - }, - }, - expected: true, - }, { - name: "notin expression", - whenExpressions: v1.StepWhenExpressions{ - { - Input: "foobar", - Operator: selection.NotIn, - Values: []string{"foobar"}, - }, - }, - expected: false, - }, { - name: "multiple expressions - false", - whenExpressions: v1.StepWhenExpressions{ - { - Input: "foobar", - Operator: selection.In, - Values: []string{"foobar"}, - }, { - Input: "foo", - Operator: selection.In, - Values: []string{"bar"}, - }, - }, - expected: false, - }, { - name: "multiple expressions - true", - whenExpressions: v1.StepWhenExpressions{ - { - Input: "foobar", - Operator: selection.In, - Values: []string{"foobar"}, - }, { - Input: "foo", - Operator: selection.NotIn, - Values: []string{"bar"}, - }, - }, - expected: true, - }, { - name: "CEL is true", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "'foo'=='foo'", - }, - }, - expected: true, - }, { - name: "CEL is false", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "'foo'!='foo'", - }, - }, - expected: false, - }, - { - name: "multiple expressions - 1. CEL is true 2. In Op is false, expect false", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "'foo'=='foo'", - }, - { - Input: "foo", - Operator: selection.In, - Values: []string{"bar"}, - }, - }, - expected: false, - }, - { - name: "multiple expressions - 1. CEL is true 2. CEL is false, expect false", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "'foo'=='foo'", - }, - { - CEL: "'xxx'!='xxx'", - }, - }, - expected: false, - }, - { - name: "CEL is not evaluated to bool", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "'foo'", - }, - }, - expected: false, - wantErr: true, - }, - { - name: "CEL cannot be compiled", - whenExpressions: v1.StepWhenExpressions{ - { - CEL: "foo==foo", - }, - }, - expected: false, - wantErr: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - e := Entrypointer{ - StepWhenExpressions: tc.whenExpressions, - } - allowExec, err := e.allowExec() - if d := cmp.Diff(allowExec, tc.expected); d != "" { - t.Errorf("expected equlity of execution evalution, but got: %t, want: %t", allowExec, tc.expected) - } - if (err != nil) != tc.wantErr { - t.Errorf("error checking failed, err %v", err) - } - }) - } -} func TestIsContextDeadlineError(t *testing.T) { ctxErr := ContextError(context.DeadlineExceeded.Error()) if !IsContextDeadlineError(ctxErr) { @@ -1425,7 +972,6 @@ func TestTerminationReason(t *testing.T) { expectedExitCode *string expectedWrotefile *string expectedStatus []result.RunResult - when v1.WhenExpressions }{ { desc: "reason completed", @@ -1487,7 +1033,7 @@ func TestTerminationReason(t *testing.T) { }, }, { - desc: "reason skipped due to previous step error", + desc: "reason skipped", waitFiles: []string{"file"}, expectedRunErr: ErrSkipPreviousStepFailed, expectedWrotefile: ptr("postfile.err"), @@ -1503,23 +1049,6 @@ func TestTerminationReason(t *testing.T) { }, }, }, - { - desc: "reason skipped due to when expressions evaluation", - expectedExitCode: ptr("0"), - expectedWrotefile: ptr("postfile"), - when: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"bar"}}}, - expectedStatus: []result.RunResult{ - { - Key: "Reason", - Value: pod.TerminationReasonSkipped, - ResultType: result.InternalTektonResultType, - }, - { - Key: "StartedAt", - ResultType: result.InternalTektonResultType, - }, - }, - }, } for _, test := range tests { @@ -1549,7 +1078,6 @@ func TestTerminationReason(t *testing.T) { BreakpointOnFailure: false, StepMetadataDir: tmpFolder, OnError: test.onError, - StepWhenExpressions: test.when, } err = e.Go() @@ -1582,7 +1110,7 @@ func TestReadArtifactsFileDoesNotExist(t *testing.T) { t.Run("readArtifact file doesn't exist, empty result, no error.", func(t *testing.T) { dir := createTmpDir(t, "") fp := filepath.Join(dir, "provenance.json") - got, err := readArtifacts(fp, result.StepArtifactsResultType) + got, err := readArtifacts(fp) if err != nil { t.Fatalf("Did not expect and error but got: %v", err) @@ -1599,11 +1127,11 @@ func TestReadArtifactsFileExistNoError(t *testing.T) { t.Run("readArtifact file exist", func(t *testing.T) { dir := createTmpDir(t, "") fp := filepath.Join(dir, "provenance.json") - err := os.WriteFile(fp, []byte{}, 0o755) + err := os.WriteFile(fp, []byte{}, 0755) if err != nil { t.Fatalf("Did not expect and error but got: %v", err) } - got, err := readArtifacts(fp, result.StepArtifactsResultType) + got, err := readArtifacts(fp) if err != nil { t.Fatalf("Did not expect and error but got: %v", err) @@ -1623,11 +1151,11 @@ func TestReadArtifactsFileExistReadError(t *testing.T) { } dir := createTmpDir(t, "") fp := filepath.Join(dir, "provenance.json") - err := os.WriteFile(fp, []byte{}, 0o000) + err := os.WriteFile(fp, []byte{}, 0000) if err != nil { t.Fatalf("Did not expect and error but got: %v", err) } - got, err := readArtifacts(fp, result.StepArtifactsResultType) + got, err := readArtifacts(fp) if err == nil { t.Fatalf("expecting error but got nil") @@ -1660,18 +1188,18 @@ func TestLoadStepArtifacts(t *testing.T) { }{ { desc: "read artifact success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: v1.Artifacts{ Inputs: []v1.Artifact{{Name: "inputs", Values: []v1.ArtifactValue{{ Digest: map[v1.Algorithm]string{"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"}, Uri: "pkg:example.github.com/inputs", }}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{ + Outputs: []v1.Artifact{{Name: "output", Values: []v1.ArtifactValue{{ Digest: map[v1.Algorithm]string{"sha256": "64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"}, Uri: "docker:example.registry.com/outputs", }}}}, }, - mode: 0o755, + mode: 0755, }, { desc: "read artifact file doesn't exist, error", @@ -1681,26 +1209,26 @@ func TestLoadStepArtifacts(t *testing.T) { { desc: "read artifact, mal-formatted json, error", fileContent: `{\\`, - mode: 0o755, + mode: 0755, wantErr: true, }, { desc: "read artifact, file cannot be read, error", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, - mode: 0o000, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + mode: 0000, wantErr: true, }, } for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - if tc.mode == 0o000 && os.Getuid() == 0 { + if tc.mode == 0000 && os.Getuid() == 0 { t.Skipf("Test doesn't work when running with root") } dir := createTmpDir(t, "") name := "step-name" artifactsPath := getStepArtifactsPath(dir, name) if tc.fileContent != "" { - err := os.MkdirAll(filepath.Dir(artifactsPath), 0o755) + err := os.MkdirAll(filepath.Dir(artifactsPath), 0755) if err != nil { t.Fatalf("fail to create dir %v", err) } @@ -1729,7 +1257,7 @@ func TestParseArtifactTemplate(t *testing.T) { wantErr bool }{ { - desc: "valid outputs template", + desc: "valid outputs template with artifact name", input: "$(steps.name.outputs.aaa)", want: ArtifactTemplate{ ContainerName: "step-name", @@ -1738,7 +1266,15 @@ func TestParseArtifactTemplate(t *testing.T) { }, }, { - desc: "valid inputs template", + desc: "valid outputs template without artifact name", + input: "$(steps.name.outputs)", + want: ArtifactTemplate{ + Type: "outputs", + ContainerName: "step-name", + }, + }, + { + desc: "valid inputs template with artifact name", input: "$(steps.name.inputs.aaa)", want: ArtifactTemplate{ ContainerName: "step-name", @@ -1746,6 +1282,19 @@ func TestParseArtifactTemplate(t *testing.T) { ArtifactName: "aaa", }, }, + { + desc: "valid outputs template without artifact name", + input: "$(steps.name.inputs)", + want: ArtifactTemplate{ + Type: "inputs", + ContainerName: "step-name", + }, + }, + { + desc: "invalid template without artifact name, no prefix and suffix", + input: "steps.name.outputs", + wantErr: true, + }, { desc: "invalid template with artifact name, no prefix and suffix", input: "steps.name.outputs.aaa", @@ -1812,52 +1361,80 @@ func TestGetArtifactValues(t *testing.T) { mode os.FileMode template string }{ + { + desc: "read outputs artifact without artifact name, success", + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + want: `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, + mode: 0755, + template: fmt.Sprintf("$(steps.%s.outputs)", name), + }, + { + desc: "read inputs artifact without artifact name, success", + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + want: `[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]`, + mode: 0755, + template: fmt.Sprintf("$(steps.%s.inputs)", name), + }, + { + desc: "read outputs artifact without artifact name, multiple outputs, default to first", + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, + want: `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, + mode: 0755, + template: fmt.Sprintf("$(steps.%s.outputs)", name), + }, + { + desc: "read inputs artifact without artifact name, multiple outputs, default to first", + fileContent: `{"outputs":[{"name":"out","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"inputs":[{"name":"in","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/inputs"}]},{"name":"in2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/inputs"}]}]}`, + want: `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/inputs"}]`, + mode: 0755, + template: fmt.Sprintf("$(steps.%s.inputs)", name), + }, { desc: "read outputs artifact with artifact name, success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, - mode: 0o755, - template: fmt.Sprintf("$(steps.%s.outputs.image)", name), + mode: 0755, + template: fmt.Sprintf("$(steps.%s.outputs.output)", name), }, { desc: "read inputs artifact with artifact name, success", fileContent: `{"outputs":[{"name":"outputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/outputs"}]}],"inputs":[{"name":"input","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/inputs"}]}]}`, want: `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/inputs"}]`, - mode: 0o755, + mode: 0755, template: fmt.Sprintf("$(steps.%s.inputs.input)", name), }, { desc: "read outputs artifact with artifact name, multiple outputs, success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, want: `[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]`, - mode: 0o755, + mode: 0755, template: fmt.Sprintf("$(steps.%s.outputs.output2)", name), }, { desc: "read inputs artifact with artifact name, multiple inputs, success", fileContent: `{"outputs":[{"name":"outputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/outputs"}]}],"inputs":[{"name":"input","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/inputs"}]},{"name":"input2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/inputs"}]}]}`, want: `[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/inputs"}]`, - mode: 0o755, + mode: 0755, template: fmt.Sprintf("$(steps.%s.inputs.input2)", name), }, { desc: "invalid template", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, - mode: 0o755, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, + mode: 0755, template: fmt.Sprintf("$(steps.%s.outputs.output2.333)", name), wantErr: true, }, { desc: "fail to load artifacts", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, - mode: 0o000, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, + mode: 0000, template: fmt.Sprintf("$(steps.%s.outputs.output2.333)", name), wantErr: true, }, { desc: "template not found", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, - mode: 0o755, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]},{"name":"output2","values":[{"digest":{"sha256":"22222157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f13402222"},"uri":"docker2:example.registry.com/outputs"}]}]}`, + mode: 0755, template: fmt.Sprintf("$(steps.%s.outputs.output3)", name), wantErr: true, }, @@ -1865,13 +1442,13 @@ func TestGetArtifactValues(t *testing.T) { for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - if tc.mode == 0o000 && os.Getuid() == 0 { + if tc.mode == 0000 && os.Getuid() == 0 { t.Skipf("Test doesn't work when running with root") } dir := createTmpDir(t, "") artifactsPath := getStepArtifactsPath(dir, "step-"+name) if tc.fileContent != "" { - err := os.MkdirAll(filepath.Dir(artifactsPath), 0o755) + err := os.MkdirAll(filepath.Dir(artifactsPath), 0755) if err != nil { t.Fatalf("fail to create dir %v", err) } @@ -1914,10 +1491,10 @@ func TestApplyStepArtifactSubstitutionsCommandSuccess(t *testing.T) { }{ { desc: "apply substitution to command from script file, success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: `echo [{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, - mode: 0o755, - scriptContent: fmt.Sprintf("echo $(steps.%s.outputs.image)", stepName), + mode: 0755, + scriptContent: fmt.Sprintf("echo $(steps.%s.outputs)", stepName), scriptFile: filepath.Join(scriptDir, "foo.sh"), command: []string{filepath.Join(scriptDir, "foo.sh")}, }, @@ -1927,7 +1504,7 @@ func TestApplyStepArtifactSubstitutionsCommandSuccess(t *testing.T) { stepDir := createTmpDir(t, "") artifactsPath := getStepArtifactsPath(stepDir, "step-"+stepName) if tc.fileContent != "" { - err := os.MkdirAll(filepath.Dir(artifactsPath), 0o755) + err := os.MkdirAll(filepath.Dir(artifactsPath), 0755) if err != nil { t.Fatalf("fail to create stepDir %v", err) } @@ -1937,7 +1514,7 @@ func TestApplyStepArtifactSubstitutionsCommandSuccess(t *testing.T) { } } if tc.scriptContent != "" { - err := os.WriteFile(tc.scriptFile, []byte(tc.scriptContent), 0o755) + err := os.WriteFile(tc.scriptFile, []byte(tc.scriptContent), 0755) if err != nil { t.Fatalf("failed to write script to scriptFile %v", err) } @@ -1958,7 +1535,6 @@ func TestApplyStepArtifactSubstitutionsCommandSuccess(t *testing.T) { }) } } - func TestApplyStepArtifactSubstitutionsCommand(t *testing.T) { stepName := "name" scriptDir := createTmpDir(t, "script") @@ -1980,49 +1556,49 @@ func TestApplyStepArtifactSubstitutionsCommand(t *testing.T) { }{ { desc: "apply substitution script, fail to read artifacts", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: []string{filepath.Join(scriptDir, "foo2.sh")}, - mode: 0o000, + mode: 0000, wantErr: true, - scriptContent: fmt.Sprintf("echo $(steps.%s.outputs.image)", stepName), + scriptContent: fmt.Sprintf("echo $(steps.%s.outputs)", stepName), scriptFile: filepath.Join(scriptDir, "foo2.sh"), command: []string{filepath.Join(scriptDir, "foo2.sh")}, }, { desc: "apply substitution to command from script file , no matches success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: []string{filepath.Join(scriptDir, "bar.sh")}, - mode: 0o755, + mode: 0755, scriptContent: "echo 123", scriptFile: filepath.Join(scriptDir, "bar.sh"), command: []string{filepath.Join(scriptDir, "bar.sh")}, }, { desc: "apply substitution to inline command, success", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, want: []string{"echo", `[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, "|", "jq", "."}, - mode: 0o755, - command: []string{"echo", fmt.Sprintf("$(steps.%s.outputs.image)", stepName), "|", "jq", "."}, + mode: 0755, + command: []string{"echo", fmt.Sprintf("$(steps.%s.outputs)", stepName), "|", "jq", "."}, }, { desc: "apply substitution to inline command, fail to read, command no change", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, - want: []string{"echo", fmt.Sprintf("$(steps.%s.outputs.image)", stepName), "|", "jq", "."}, - mode: 0o000, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + want: []string{"echo", fmt.Sprintf("$(steps.%s.outputs)", stepName), "|", "jq", "."}, + mode: 0000, wantErr: true, - command: []string{"echo", fmt.Sprintf("$(steps.%s.outputs.image)", stepName), "|", "jq", "."}, + command: []string{"echo", fmt.Sprintf("$(steps.%s.outputs)", stepName), "|", "jq", "."}, }, } for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - if tc.mode == 0o000 && os.Getuid() == 0 { + if tc.mode == 0000 && os.Getuid() == 0 { t.Skipf("Test doesn't work when running with root") } stepDir := createTmpDir(t, "") artifactsPath := getStepArtifactsPath(stepDir, "step-"+stepName) if tc.fileContent != "" { - err := os.MkdirAll(filepath.Dir(artifactsPath), 0o755) + err := os.MkdirAll(filepath.Dir(artifactsPath), 0755) if err != nil { t.Fatalf("fail to create stepDir %v", err) } @@ -2032,7 +1608,7 @@ func TestApplyStepArtifactSubstitutionsCommand(t *testing.T) { } } if tc.scriptContent != "" { - err := os.WriteFile(tc.scriptFile, []byte(tc.scriptContent), 0o755) + err := os.WriteFile(tc.scriptFile, []byte(tc.scriptContent), 0755) if err != nil { t.Fatalf("failed to write script to scriptFile %v", err) } @@ -2070,40 +1646,40 @@ func TestApplyStepArtifactSubstitutionsEnv(t *testing.T) { }{ { desc: "apply substitution to env, no matches, no changes", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, - mode: 0o755, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + mode: 0755, envKey: "aaa", envValue: "bbb", want: "bbb", }, { desc: "apply substitution to env, matches found, has change", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, - mode: 0o755, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + mode: 0755, envKey: "aaa", - envValue: fmt.Sprintf("abc-$(steps.%s.outputs.image)", stepName), + envValue: fmt.Sprintf("abc-$(steps.%s.outputs)", stepName), want: `abc-[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]`, }, { desc: "apply substitution to env, matches found, read artifacts failed.", - fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"image","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, - mode: 0o000, + fileContent: `{"inputs":[{"name":"inputs","values":[{"digest":{"sha256":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"},"uri":"pkg:example.github.com/inputs"}]}],"outputs":[{"name":"output","values":[{"digest":{"sha256":"64d0b157fdf2d7f6548836dd82085fd8401c9481a9f59e554f1b337f134074b0"},"uri":"docker:example.registry.com/outputs"}]}]}`, + mode: 0000, envKey: "aaa", - envValue: fmt.Sprintf("abc-$(steps.%s.outputs.image)", stepName), - want: fmt.Sprintf("abc-$(steps.%s.outputs.image)", stepName), + envValue: fmt.Sprintf("abc-$(steps.%s.outputs)", stepName), + want: fmt.Sprintf("abc-$(steps.%s.outputs)", stepName), wantErr: true, }, } for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - if tc.mode == 0o000 && os.Getuid() == 0 { + if tc.mode == 0000 && os.Getuid() == 0 { t.Skipf("Test doesn't work when running with root") } stepDir := createTmpDir(t, "") artifactsPath := getStepArtifactsPath(stepDir, "step-"+stepName) if tc.fileContent != "" { - err := os.MkdirAll(filepath.Dir(artifactsPath), 0o755) + err := os.MkdirAll(filepath.Dir(artifactsPath), 0755) if err != nil { t.Fatalf("fail to create stepDir %v", err) } @@ -2307,7 +1883,7 @@ func getMockSpireClient(ctx context.Context) (spire.EntrypointerAPIClient, spire // bootstrap with about 20 calls to sign which should be enough for testing id := sc.GetIdentity(tr) - for range 20 { + for i := 0; i < 20; i++ { sc.SignIdentities = append(sc.SignIdentities, id) } diff --git a/upstream/pkg/internal/affinityassistant/affinityassistant_types.go b/upstream/pkg/internal/affinityassistant/affinityassistant_types.go index 15afe705b98..e4fddb4e23d 100644 --- a/upstream/pkg/internal/affinityassistant/affinityassistant_types.go +++ b/upstream/pkg/internal/affinityassistant/affinityassistant_types.go @@ -54,9 +54,3 @@ func GetAffinityAssistantBehavior(ctx context.Context) (AffinityAssistantBehavio return "", fmt.Errorf("unknown combination of disable-affinity-assistant: %v and coschedule: %v", disableAA, coschedule) } - -// ContainerConfig defines AffinityAssistant container configuration -type ContainerConfig struct { - Image string - SetSecurityContext bool -} diff --git a/upstream/pkg/internal/defaultresourcerequirements/transformer.go b/upstream/pkg/internal/defaultresourcerequirements/transformer.go deleted file mode 100644 index 69af7f842d1..00000000000 --- a/upstream/pkg/internal/defaultresourcerequirements/transformer.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 defaultresourcerequirements - -import ( - "context" - "strings" - - "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/pod" - corev1 "k8s.io/api/core/v1" -) - -// NewTransformer returns a pod.Transformer that will modify container resources if needed -func NewTransformer(ctx context.Context) pod.Transformer { - // update init container and containers resource requirements - // resource limits and requests values are taken from a config map - configDefaults := config.FromContextOrDefaults(ctx).Defaults - return func(pod *corev1.Pod) (*corev1.Pod, error) { - return updateResourceRequirements(configDefaults.DefaultContainerResourceRequirements, pod), nil - } -} - -// updates init containers and containers resource requirements of a pod base of config_defaults configmap. -func updateResourceRequirements(resourceRequirementsMap map[string]corev1.ResourceRequirements, pod *corev1.Pod) *corev1.Pod { - if len(resourceRequirementsMap) == 0 { - return pod - } - - // collect all the available container names from the resource requirement map - // some of the container names: place-scripts, prepare, working-dir-initializer - // some of the container names with prefix: prefix-scripts, prefix-sidecar-scripts - containerNames := []string{} - containerNamesWithPrefix := []string{} - for containerName := range resourceRequirementsMap { - // skip the default key - if containerName == config.ResourceRequirementDefaultContainerKey { - continue - } - - if strings.HasPrefix(containerName, "prefix-") { - containerNamesWithPrefix = append(containerNamesWithPrefix, containerName) - } else { - containerNames = append(containerNames, containerName) - } - } - - // update the containers resource requirements which does not have resource requirements - for _, containerName := range containerNames { - resourceRequirements := resourceRequirementsMap[containerName] - if resourceRequirements.Size() == 0 { - continue - } - - // update init containers - for index := range pod.Spec.InitContainers { - targetContainer := pod.Spec.InitContainers[index] - if containerName == targetContainer.Name && targetContainer.Resources.Size() == 0 { - pod.Spec.InitContainers[index].Resources = resourceRequirements - } - } - // update containers - for index := range pod.Spec.Containers { - targetContainer := pod.Spec.Containers[index] - if containerName == targetContainer.Name && targetContainer.Resources.Size() == 0 { - pod.Spec.Containers[index].Resources = resourceRequirements - } - } - } - - // update the containers resource requirements which does not have resource requirements with the mentioned prefix - for _, containerPrefix := range containerNamesWithPrefix { - resourceRequirements := resourceRequirementsMap[containerPrefix] - if resourceRequirements.Size() == 0 { - continue - } - - // get actual container name, remove "prefix-" string and append "-" at the end - // append '-' in the container prefix - containerPrefix = strings.Replace(containerPrefix, "prefix-", "", 1) - containerPrefix += "-" - - // update init containers - for index := range pod.Spec.InitContainers { - targetContainer := pod.Spec.InitContainers[index] - if strings.HasPrefix(targetContainer.Name, containerPrefix) && targetContainer.Resources.Size() == 0 { - pod.Spec.InitContainers[index].Resources = resourceRequirements - } - } - // update containers - for index := range pod.Spec.Containers { - targetContainer := pod.Spec.Containers[index] - if strings.HasPrefix(targetContainer.Name, containerPrefix) && targetContainer.Resources.Size() == 0 { - pod.Spec.Containers[index].Resources = resourceRequirements - } - } - } - - // reset of the containers resource requirements which has empty resource requirements - if resourceRequirements, found := resourceRequirementsMap[config.ResourceRequirementDefaultContainerKey]; found && resourceRequirements.Size() != 0 { - // update init containers - for index := range pod.Spec.InitContainers { - if pod.Spec.InitContainers[index].Resources.Size() == 0 { - pod.Spec.InitContainers[index].Resources = resourceRequirements - } - } - // update containers - for index := range pod.Spec.Containers { - if pod.Spec.Containers[index].Resources.Size() == 0 { - pod.Spec.Containers[index].Resources = resourceRequirements - } - } - } - - return pod -} diff --git a/upstream/pkg/internal/defaultresourcerequirements/transformer_test.go b/upstream/pkg/internal/defaultresourcerequirements/transformer_test.go deleted file mode 100644 index 6febc92e63c..00000000000 --- a/upstream/pkg/internal/defaultresourcerequirements/transformer_test.go +++ /dev/null @@ -1,416 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 defaultresourcerequirements - -import ( - "context" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestNewTransformer(t *testing.T) { - testPod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, - Spec: corev1.PodSpec{ - InitContainers: []corev1.Container{ - {Name: "place-scripts"}, - {Name: "prepare"}, - {Name: "working-dir-initializer"}, - {Name: "test-01"}, - {Name: "foo"}, - }, - Containers: []corev1.Container{ - {Name: "scripts-01"}, - {Name: "scripts-02"}, - {Name: "sidecar-scripts-01"}, - {Name: "sidecar-scripts-02"}, - {Name: "test-01"}, - {Name: "foo"}, - }, - }, - } - - tcs := []struct { - name string - targetPod *corev1.Pod - resourceRequirements map[string]corev1.ResourceRequirements - getExpectedPod func() *corev1.Pod - }{ - // verifies with no resource requirements data from a config map - { - name: "test-with-no-data", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{}, - getExpectedPod: func() *corev1.Pod { - return testPod.DeepCopy() - }, - }, - - // verifies with empty resource requirements data from a config map - { - name: "test-with-empty-resource-requirements", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{ - "default": {}, - "place-scripts": {}, - "prefix-scripts": {}, - }, - getExpectedPod: func() *corev1.Pod { - return testPod.DeepCopy() - }, - }, - - // verifies only with 'default' resource requirements data from a config map - { - name: "test-with-default-set", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{ - "default": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - }, - }, - getExpectedPod: func() *corev1.Pod { - expectedPod := testPod.DeepCopy() - defaultResource := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - } - expectedPod.Spec = corev1.PodSpec{ - InitContainers: []corev1.Container{ - {Name: "place-scripts", Resources: defaultResource}, - {Name: "prepare", Resources: defaultResource}, - {Name: "working-dir-initializer", Resources: defaultResource}, - {Name: "test-01", Resources: defaultResource}, - {Name: "foo", Resources: defaultResource}, - }, - Containers: []corev1.Container{ - {Name: "scripts-01", Resources: defaultResource}, - {Name: "scripts-02", Resources: defaultResource}, - {Name: "sidecar-scripts-01", Resources: defaultResource}, - {Name: "sidecar-scripts-02", Resources: defaultResource}, - {Name: "test-01", Resources: defaultResource}, - {Name: "foo", Resources: defaultResource}, - }, - } - return expectedPod - }, - }, - - // verifies only with 'place-scripts' resource requirements data from a config map - { - name: "test-with-place-scripts-set", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{ - "place-scripts": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - corev1.ResourceCPU: resource.MustParse("200m"), - }, - }, - }, - getExpectedPod: func() *corev1.Pod { - expectedPod := testPod.DeepCopy() - expectedPod.Spec.InitContainers = []corev1.Container{ - { - Name: "place-scripts", - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - corev1.ResourceCPU: resource.MustParse("200m"), - }, - }, - }, - {Name: "prepare"}, - {Name: "working-dir-initializer"}, - {Name: "test-01"}, - {Name: "foo"}, - } - return expectedPod - }, - }, - - // verifies only with 'prefix-scripts' resource requirements data from a config map - { - name: "test-with-prefix-scripts-set", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{ - "prefix-scripts": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - corev1.ResourceCPU: resource.MustParse("200m"), - }, - }, - }, - getExpectedPod: func() *corev1.Pod { - expectedPod := testPod.DeepCopy() - prefixScripts := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - corev1.ResourceCPU: resource.MustParse("200m"), - }, - } - expectedPod.Spec.Containers = []corev1.Container{ - {Name: "scripts-01", Resources: prefixScripts}, - {Name: "scripts-02", Resources: prefixScripts}, - {Name: "sidecar-scripts-01"}, - {Name: "sidecar-scripts-02"}, - {Name: "test-01"}, - {Name: "foo"}, - } - return expectedPod - }, - }, - - // verifies with 'working-dir-initializer', 'prefix-sidecar-scripts', and 'default' resource requirements data from a config map - { - name: "test-with_name_prefix_and_default-set", - targetPod: testPod.DeepCopy(), - resourceRequirements: map[string]corev1.ResourceRequirements{ - "working-dir-initializer": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("400m"), - corev1.ResourceMemory: resource.MustParse("512Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("256Mi"), - corev1.ResourceCPU: resource.MustParse("250m"), - }, - }, - "prefix-sidecar-scripts": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1Gi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), - corev1.ResourceCPU: resource.MustParse("500m"), - }, - }, - "default": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - }, - "prefix-test": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("100m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), - }, - }, - "foo": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("200m"), - corev1.ResourceMemory: resource.MustParse("64Mi"), - }, - }, - }, - getExpectedPod: func() *corev1.Pod { - expectedPod := testPod.DeepCopy() - workDirResourceReqs := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("400m"), - corev1.ResourceMemory: resource.MustParse("512Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("256Mi"), - corev1.ResourceCPU: resource.MustParse("250m"), - }, - } - sideCarResourceReqs := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1Gi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), - corev1.ResourceCPU: resource.MustParse("500m"), - }, - } - defaultResourceReqs := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - } - - testResourceReqs := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("100m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), - }, - } - fooResourceReqs := corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("200m"), - corev1.ResourceMemory: resource.MustParse("64Mi"), - }, - } - - expectedPod.Spec = corev1.PodSpec{ - InitContainers: []corev1.Container{ - {Name: "place-scripts", Resources: defaultResourceReqs}, - {Name: "prepare", Resources: defaultResourceReqs}, - {Name: "working-dir-initializer", Resources: workDirResourceReqs}, - {Name: "test-01", Resources: testResourceReqs}, - {Name: "foo", Resources: fooResourceReqs}, - }, - Containers: []corev1.Container{ - {Name: "scripts-01", Resources: defaultResourceReqs}, - {Name: "scripts-02", Resources: defaultResourceReqs}, - {Name: "sidecar-scripts-01", Resources: sideCarResourceReqs}, - {Name: "sidecar-scripts-02", Resources: sideCarResourceReqs}, - {Name: "test-01", Resources: testResourceReqs}, - {Name: "foo", Resources: fooResourceReqs}, - }, - } - return expectedPod - }, - }, - - // verifies with existing data - { - name: "test-with-existing-data", - targetPod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, - Spec: corev1.PodSpec{ - InitContainers: []corev1.Container{ - {Name: "place-scripts"}, - {Name: "prepare", Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - }}, - {Name: "working-dir-initializer"}, - }, - Containers: []corev1.Container{ - {Name: "scripts-01"}, - {Name: "scripts-02"}, - {Name: "sidecar-scripts-01"}, - {Name: "sidecar-scripts-02"}, - }, - }, - }, - resourceRequirements: map[string]corev1.ResourceRequirements{ - "prepare": { - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("512Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - }, - }, - getExpectedPod: func() *corev1.Pod { - expectedPod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, - Spec: corev1.PodSpec{ - InitContainers: []corev1.Container{ - {Name: "place-scripts"}, - {Name: "prepare", Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("256Mi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - }}, - {Name: "working-dir-initializer"}, - }, - Containers: []corev1.Container{ - {Name: "scripts-01"}, - {Name: "scripts-02"}, - {Name: "sidecar-scripts-01"}, - {Name: "sidecar-scripts-02"}, - }, - }, - } - return expectedPod - }, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() - // add default container resource requirements on the context - ctx = config.ToContext(ctx, &config.Config{ - Defaults: &config.Defaults{ - DefaultContainerResourceRequirements: tc.resourceRequirements, - }, - }) - - // get the transformer and call the transformer - transformer := NewTransformer(ctx) - transformedPod, err := transformer(tc.targetPod) - if err != nil { - t.Errorf("unexpected error %s", err) - } - - expectedPod := tc.getExpectedPod() - if d := cmp.Diff(expectedPod, transformedPod); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/pipelinerunmetrics/metrics.go b/upstream/pkg/pipelinerunmetrics/metrics.go index 225c689d746..18d2e560fdc 100644 --- a/upstream/pkg/pipelinerunmetrics/metrics.go +++ b/upstream/pkg/pipelinerunmetrics/metrics.go @@ -39,13 +39,6 @@ import ( "knative.dev/pkg/metrics" ) -const ( - runningPRLevelPipelinerun = "pipelinerun" - runningPRLevelPipeline = "pipeline" - runningPRLevelNamespace = "namespace" - runningPRLevelCluster = "" -) - var ( pipelinerunTag = tag.MustNewKey("pipelinerun") pipelineTag = tag.MustNewKey("pipeline") @@ -112,7 +105,6 @@ const ( type Recorder struct { mutex sync.Mutex initialized bool - cfg *config.Metrics insertTag func(pipeline, pipelinerun string) []tag.Mutator @@ -141,7 +133,6 @@ func NewRecorder(ctx context.Context) (*Recorder, error) { } cfg := config.FromContextOrDefaults(ctx) - r.cfg = cfg.Metrics errRegistering = viewRegister(cfg.Metrics) if errRegistering != nil { r.initialized = false @@ -157,6 +148,7 @@ func viewRegister(cfg *config.Metrics) error { defer r.mutex.Unlock() var prunTag []tag.Key + switch cfg.PipelinerunLevel { case config.PipelinerunLevelAtPipelinerun: prunTag = []tag.Key{pipelinerunTag, pipelineTag} @@ -171,18 +163,6 @@ func viewRegister(cfg *config.Metrics) error { return errors.New("invalid config for PipelinerunLevel: " + cfg.PipelinerunLevel) } - var runningPRTag []tag.Key - switch cfg.RunningPipelinerunLevel { - case config.PipelinerunLevelAtPipelinerun: - runningPRTag = []tag.Key{pipelinerunTag, pipelineTag, namespaceTag} - case config.PipelinerunLevelAtPipeline: - runningPRTag = []tag.Key{pipelineTag, namespaceTag} - case config.PipelinerunLevelAtNS: - runningPRTag = []tag.Key{namespaceTag} - default: - runningPRTag = []tag.Key{} - } - distribution := view.Distribution(10, 30, 60, 300, 900, 1800, 3600, 5400, 10800, 21600, 43200, 86400) if cfg.PipelinerunLevel == config.PipelinerunLevelAtPipelinerun { @@ -197,12 +177,6 @@ func viewRegister(cfg *config.Metrics) error { } } - prCountViewTags := []tag.Key{statusTag} - if cfg.CountWithReason { - prCountViewTags = append(prCountViewTags, reasonTag) - prunTag = append(prunTag, reasonTag) - } - prDurationView = &view.View{ Description: prDuration.Description(), Measure: prDuration, @@ -210,6 +184,10 @@ func viewRegister(cfg *config.Metrics) error { TagKeys: append([]tag.Key{statusTag, namespaceTag}, prunTag...), } + prCountViewTags := []tag.Key{statusTag} + if cfg.CountWithReason { + prCountViewTags = append(prCountViewTags, reasonTag) + } prCountView = &view.View{ Description: prCount.Description(), Measure: prCount, @@ -232,7 +210,6 @@ func viewRegister(cfg *config.Metrics) error { Description: runningPRs.Description(), Measure: runningPRs, Aggregation: view.LastValue(), - TagKeys: runningPRTag, } runningPRsWaitingOnPipelineResolutionCountView = &view.View{ @@ -282,8 +259,8 @@ func viewUnregister() { runningPRsWaitingOnTaskResolutionView) } -// OnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so -func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, +// MetricsOnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so +func MetricsOnStore(logger *zap.SugaredLogger) func(name string, value interface{}) { return func(name string, value interface{}) { if name == config.GetMetricsConfigName() { @@ -292,8 +269,6 @@ func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, logger.Error("Failed to do type insertion for extracting metrics config") return } - r.updateConfig(cfg) - // Update metrics according to configuration viewUnregister() err := viewRegister(cfg) if err != nil { @@ -305,10 +280,8 @@ func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, } func pipelinerunInsertTag(pipeline, pipelinerun string) []tag.Mutator { - return []tag.Mutator{ - tag.Insert(pipelineTag, pipeline), - tag.Insert(pipelinerunTag, pipelinerun), - } + return []tag.Mutator{tag.Insert(pipelineTag, pipeline), + tag.Insert(pipelinerunTag, pipelinerun)} } func pipelineInsertTag(pipeline, pipelinerun string) []tag.Mutator { @@ -337,16 +310,9 @@ func getPipelineTagName(pr *v1.PipelineRun) string { return pipelineName } -func (r *Recorder) updateConfig(cfg *config.Metrics) { - r.mutex.Lock() - defer r.mutex.Unlock() - - r.cfg = cfg -} - // DurationAndCount logs the duration of PipelineRun execution and // count for number of PipelineRuns succeed or failed -// returns an error if it fails to log the metrics +// returns an error if its failed to log the metrics func (r *Recorder) DurationAndCount(pr *v1.PipelineRun, beforeCondition *apis.Condition) error { if !r.initialized { return fmt.Errorf("ignoring the metrics recording for %s , failed to initialize the metrics recorder", pr.Name) @@ -383,10 +349,8 @@ func (r *Recorder) DurationAndCount(pr *v1.PipelineRun, beforeCondition *apis.Co ctx, err := tag.New( context.Background(), - append([]tag.Mutator{ - tag.Insert(namespaceTag, pr.Namespace), - tag.Insert(statusTag, status), tag.Insert(reasonTag, reason), - }, r.insertTag(pipelineName, pr.Name)...)...) + append([]tag.Mutator{tag.Insert(namespaceTag, pr.Namespace), + tag.Insert(statusTag, status), tag.Insert(reasonTag, reason)}, r.insertTag(pipelineName, pr.Name)...)...) if err != nil { return err } @@ -399,10 +363,11 @@ func (r *Recorder) DurationAndCount(pr *v1.PipelineRun, beforeCondition *apis.Co } // RunningPipelineRuns logs the number of PipelineRuns running right now -// returns an error if it fails to log the metrics +// returns an error if its failed to log the metrics func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error { r.mutex.Lock() defer r.mutex.Unlock() + if !r.initialized { return errors.New("ignoring the metrics recording, failed to initialize the metrics recorder") } @@ -415,38 +380,9 @@ func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error { var runningPipelineRuns int var trsWaitResolvingTaskRef int var prsWaitResolvingPipelineRef int - countMap := map[string]int{} for _, pr := range prs { - pipelineName := getPipelineTagName(pr) - pipelineRunKey := "" - mutators := []tag.Mutator{ - tag.Insert(namespaceTag, pr.Namespace), - tag.Insert(pipelineTag, pipelineName), - tag.Insert(pipelinerunTag, pr.Name), - } - if r.cfg != nil { - switch r.cfg.RunningPipelinerunLevel { - case runningPRLevelPipelinerun: - pipelineRunKey = pipelineRunKey + "#" + pr.Name - fallthrough - case runningPRLevelPipeline: - pipelineRunKey = pipelineRunKey + "#" + pipelineName - fallthrough - case runningPRLevelNamespace: - pipelineRunKey = pipelineRunKey + "#" + pr.Namespace - case runningPRLevelCluster: - default: - return fmt.Errorf("RunningPipelineRunLevel value \"%s\" is not valid ", r.cfg.RunningPipelinerunLevel) - } - } - ctx_, err_ := tag.New(context.Background(), mutators...) - if err_ != nil { - return err - } if !pr.IsDone() { - countMap[pipelineRunKey]++ - metrics.Record(ctx_, runningPRs.M(float64(countMap[pipelineRunKey]))) runningPipelineRuns++ succeedCondition := pr.Status.GetCondition(apis.ConditionSucceeded) if succeedCondition != nil && succeedCondition.Status == corev1.ConditionUnknown { @@ -457,13 +393,6 @@ func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error { prsWaitResolvingPipelineRef++ } } - } else { - // In case there are no running PipelineRuns for the pipelineRunKey, set the metric value to 0 to ensure - // the metric is set for the key. - if _, exists := countMap[pipelineRunKey]; !exists { - countMap[pipelineRunKey] = 0 - metrics.Record(ctx_, runningPRs.M(0)) - } } } @@ -476,6 +405,7 @@ func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error { metrics.Record(ctx, runningPRsWaitingOnTaskResolutionCount.M(float64(trsWaitResolvingTaskRef))) metrics.Record(ctx, runningPRsWaitingOnTaskResolution.M(float64(trsWaitResolvingTaskRef))) metrics.Record(ctx, runningPRsCount.M(float64(runningPipelineRuns))) + metrics.Record(ctx, runningPRs.M(float64(runningPipelineRuns))) return nil } diff --git a/upstream/pkg/pipelinerunmetrics/metrics_test.go b/upstream/pkg/pipelinerunmetrics/metrics_test.go index 418563e09f4..6048d5e7bbf 100644 --- a/upstream/pkg/pipelinerunmetrics/metrics_test.go +++ b/upstream/pkg/pipelinerunmetrics/metrics_test.go @@ -23,9 +23,6 @@ import ( "testing" "time" - "go.opencensus.io/metric/metricproducer" - "go.opencensus.io/stats/view" - "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/config" @@ -53,7 +50,6 @@ func getConfigContext(countWithReason bool) context.Context { Metrics: &config.Metrics{ TaskrunLevel: config.TaskrunLevelAtTaskrun, PipelinerunLevel: config.PipelinerunLevelAtPipelinerun, - RunningPipelinerunLevel: config.DefaultRunningPipelinerunLevel, DurationTaskrunType: config.DefaultDurationTaskrunType, DurationPipelinerunType: config.DefaultDurationPipelinerunType, CountWithReason: countWithReason, @@ -62,21 +58,6 @@ func getConfigContext(countWithReason bool) context.Context { return config.ToContext(ctx, cfg) } -func getConfigContextRunningPRLevel(runningPipelinerunLevel string) context.Context { - ctx := context.Background() - cfg := &config.Config{ - Metrics: &config.Metrics{ - TaskrunLevel: config.TaskrunLevelAtTaskrun, - PipelinerunLevel: config.PipelinerunLevelAtPipelinerun, - DurationTaskrunType: config.DefaultDurationTaskrunType, - DurationPipelinerunType: config.DefaultDurationPipelinerunType, - CountWithReason: false, - RunningPipelinerunLevel: runningPipelinerunLevel, - }, - } - return config.ToContext(ctx, cfg) -} - func TestUninitializedMetrics(t *testing.T) { metrics := Recorder{} @@ -88,7 +69,7 @@ func TestUninitializedMetrics(t *testing.T) { } } -func TestOnStore(t *testing.T) { +func TestMetricsOnStore(t *testing.T) { log := zap.NewExample() defer log.Sync() logger := log.Sugar() @@ -100,7 +81,7 @@ func TestOnStore(t *testing.T) { } // We check that there's no change when incorrect config is passed - OnStore(logger, metrics)(config.GetMetricsConfigName(), &config.Store{}) + MetricsOnStore(logger)(config.GetMetricsConfigName(), &config.Store{}) // Comparing function assign to struct with the one which should yield same value if reflect.ValueOf(metrics.insertTag).Pointer() != reflect.ValueOf(pipelinerunInsertTag).Pointer() { t.Fatal("metrics recorder shouldn't change during this OnStore call") @@ -113,7 +94,7 @@ func TestOnStore(t *testing.T) { DurationTaskrunType: config.DurationTaskrunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, } - OnStore(logger, metrics)(config.GetMetricsConfigName(), cfg) + MetricsOnStore(logger)(config.GetMetricsConfigName(), cfg) if reflect.ValueOf(metrics.insertTag).Pointer() != reflect.ValueOf(pipelinerunInsertTag).Pointer() { t.Fatal("metrics recorder shouldn't change during this OnStore call") } @@ -124,7 +105,7 @@ func TestOnStore(t *testing.T) { DurationTaskrunType: config.DurationTaskrunTypeHistogram, DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, } - OnStore(logger, metrics)(config.GetMetricsConfigName(), cfg) + MetricsOnStore(logger)(config.GetMetricsConfigName(), cfg) if reflect.ValueOf(metrics.insertTag).Pointer() != reflect.ValueOf(nilInsertTag).Pointer() { t.Fatal("metrics recorder didn't change during OnStore call") } @@ -360,7 +341,6 @@ func TestRecordPipelineRunDurationCount(t *testing.T) { "pipeline": "pipeline-1", "pipelinerun": "pipelinerun-1", "namespace": "ns", - "reason": "Failed", "status": "failed", }, expectedCountTags: map[string]string{ @@ -397,7 +377,6 @@ func TestRecordPipelineRunDurationCount(t *testing.T) { "pipelinerun": "pipelinerun-1", "namespace": "ns", "status": "cancelled", - "reason": ReasonCancelled.String(), }, expectedCountTags: map[string]string{ "status": "cancelled", @@ -523,204 +502,6 @@ func TestRecordRunningPipelineRunsCount(t *testing.T) { metricstest.CheckLastValueData(t, "running_pipelineruns", map[string]string{}, 1) } -func TestRecordRunningPipelineRunsCountAtPipelineRunLevel(t *testing.T) { - unregisterMetrics() - - newPipelineRun := func(status corev1.ConditionStatus, pipelineRun, namespace string) *v1.PipelineRun { - return &v1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{Name: pipelineRun, Namespace: namespace}, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: status, - }}, - }, - }, - } - } - - ctx, _ := ttesting.SetupFakeContext(t) - informer := fakepipelineruninformer.Get(ctx) - // Add N randomly-named PipelineRuns with differently-succeeded statuses. - for _, pipelineRun := range []*v1.PipelineRun{ - newPipelineRun(corev1.ConditionUnknown, "testpr1", "testns1"), - newPipelineRun(corev1.ConditionUnknown, "testpr1", "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testpr2", "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testpr1", "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testpr2", "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testpr3", "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testpr4", "testns3"), - } { - if err := informer.Informer().GetIndexer().Add(pipelineRun); err != nil { - t.Fatalf("Adding TaskRun to informer: %v", err) - } - } - - ctx = getConfigContextRunningPRLevel("pipelinerun") - recorder, err := NewRecorder(ctx) - if err != nil { - t.Fatalf("NewRecorder: %v", err) - } - - if err := recorder.RunningPipelineRuns(informer.Lister()); err != nil { - t.Errorf("RunningPipelineRuns: %v", err) - } - - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns1", "pipeline": "anonymous", "pipelinerun": "testpr1"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns2", "pipeline": "anonymous", "pipelinerun": "testpr1"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns2", "pipeline": "anonymous", "pipelinerun": "testpr2"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3", "pipeline": "anonymous", "pipelinerun": "testpr1"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3", "pipeline": "anonymous", "pipelinerun": "testpr2"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3", "pipeline": "anonymous", "pipelinerun": "testpr3"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3", "pipeline": "anonymous", "pipelinerun": "testpr4"}, 1) -} - -func TestRecordRunningPipelineRunsCountAtPipelineLevel(t *testing.T) { - unregisterMetrics() - - newPipelineRun := func(status corev1.ConditionStatus, namespace string) *v1.PipelineRun { - return &v1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("pipelinerun-"), Namespace: namespace}, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: status, - }}, - }, - }, - } - } - - ctx, _ := ttesting.SetupFakeContext(t) - informer := fakepipelineruninformer.Get(ctx) - // Add N randomly-named PipelineRuns with differently-succeeded statuses. - for _, pipelineRun := range []*v1.PipelineRun{ - newPipelineRun(corev1.ConditionUnknown, "testns1"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - } { - if err := informer.Informer().GetIndexer().Add(pipelineRun); err != nil { - t.Fatalf("Adding TaskRun to informer: %v", err) - } - } - - ctx = getConfigContextRunningPRLevel("pipeline") - recorder, err := NewRecorder(ctx) - if err != nil { - t.Fatalf("NewRecorder: %v", err) - } - - if err := recorder.RunningPipelineRuns(informer.Lister()); err != nil { - t.Errorf("RunningPipelineRuns: %v", err) - } - - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns1", "pipeline": "anonymous"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns2", "pipeline": "anonymous"}, 2) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3", "pipeline": "anonymous"}, 4) -} - -func TestRecordRunningPipelineRunsCountAtNamespaceLevel(t *testing.T) { - unregisterMetrics() - - newPipelineRun := func(status corev1.ConditionStatus, namespace string) *v1.PipelineRun { - return &v1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("pipelinerun-"), Namespace: namespace}, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: status, - }}, - }, - }, - } - } - - ctx, _ := ttesting.SetupFakeContext(t) - informer := fakepipelineruninformer.Get(ctx) - // Add N randomly-named PipelineRuns with differently-succeeded statuses. - for _, pipelineRun := range []*v1.PipelineRun{ - newPipelineRun(corev1.ConditionUnknown, "testns1"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - } { - if err := informer.Informer().GetIndexer().Add(pipelineRun); err != nil { - t.Fatalf("Adding TaskRun to informer: %v", err) - } - } - - ctx = getConfigContextRunningPRLevel("namespace") - recorder, err := NewRecorder(ctx) - if err != nil { - t.Fatalf("NewRecorder: %v", err) - } - - if err := recorder.RunningPipelineRuns(informer.Lister()); err != nil { - t.Errorf("RunningPipelineRuns: %v", err) - } - - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns1"}, 1) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns2"}, 2) - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{"namespace": "testns3"}, 4) -} - -func TestRecordRunningPipelineRunsCountAtClusterLevel(t *testing.T) { - unregisterMetrics() - - newPipelineRun := func(status corev1.ConditionStatus, namespace string) *v1.PipelineRun { - return &v1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("pipelinerun-"), Namespace: namespace}, - Status: v1.PipelineRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: status, - }}, - }, - }, - } - } - - ctx, _ := ttesting.SetupFakeContext(t) - informer := fakepipelineruninformer.Get(ctx) - // Add N randomly-named PipelineRuns with differently-succeeded statuses. - for _, pipelineRun := range []*v1.PipelineRun{ - newPipelineRun(corev1.ConditionUnknown, "testns1"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns2"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - newPipelineRun(corev1.ConditionUnknown, "testns3"), - } { - if err := informer.Informer().GetIndexer().Add(pipelineRun); err != nil { - t.Fatalf("Adding TaskRun to informer: %v", err) - } - } - - ctx = getConfigContextRunningPRLevel("") - recorder, err := NewRecorder(ctx) - if err != nil { - t.Fatalf("NewRecorder: %v", err) - } - - if err := recorder.RunningPipelineRuns(informer.Lister()); err != nil { - t.Errorf("RunningPipelineRuns: %v", err) - } - - checkLastValueDataForTags(t, "running_pipelineruns", map[string]string{}, 7) -} - func TestRecordRunningPipelineRunsResolutionWaitCounts(t *testing.T) { multiplier := 3 for _, tc := range []struct { @@ -771,7 +552,7 @@ func TestRecordRunningPipelineRunsResolutionWaitCounts(t *testing.T) { unregisterMetrics() ctx, _ := ttesting.SetupFakeContext(t) informer := fakepipelineruninformer.Get(ctx) - for range multiplier { + for i := 0; i < multiplier; i++ { pr := &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("pipelinerun-")}, Status: v1.PipelineRunStatus{ @@ -813,40 +594,3 @@ func unregisterMetrics() { r = nil errRegistering = nil } - -// We have to write this function as knative package does not provide the feature to validate multiple records for same metric. -func checkLastValueDataForTags(t *testing.T, name string, wantTags map[string]string, expected float64) { - t.Helper() - for _, producer := range metricproducer.GlobalManager().GetAll() { - meter := producer.(view.Meter) - data, err := meter.RetrieveData(name) - if err != nil || len(data) == 0 { - continue - } - val := getLastValueData(data, wantTags) - if expected != val.Value { - t.Error("Value did not match for ", name, wantTags, ", expected", expected, "got", val.Value) - } - } -} - -// Returns the LastValueData from the matching row. If no row is matched then returns nil -func getLastValueData(rows []*view.Row, wantTags map[string]string) *view.LastValueData { - for _, row := range rows { - if len(wantTags) != len(row.Tags) { - continue - } - matched := true - for _, got := range row.Tags { - n := got.Key.Name() - if wantTags[n] != got.Value { - matched = false - break - } - } - if matched { - return row.Data.(*view.LastValueData) - } - } - return nil -} diff --git a/upstream/pkg/pod/creds_init_test.go b/upstream/pkg/pod/creds_init_test.go index 33f2e32a0be..c7dcacf81c3 100644 --- a/upstream/pkg/pod/creds_init_test.go +++ b/upstream/pkg/pod/creds_init_test.go @@ -335,8 +335,8 @@ func TestCredsInit(t *testing.T) { eventObj := &corev1.Event{} kubeclient := fakek8s.NewSimpleClientset(c.objs...) recorder := record.NewFakeRecorder(1000) - ctx := controller.WithEventRecorder(c.ctx, recorder) - args, volumes, volumeMounts, err := credsInit(ctx, eventObj, serviceAccountName, namespace, kubeclient) + c.ctx = controller.WithEventRecorder(c.ctx, recorder) + args, volumes, volumeMounts, err := credsInit(c.ctx, eventObj, serviceAccountName, namespace, kubeclient) if err != nil { t.Fatalf("credsInit: %v", err) } diff --git a/upstream/pkg/pod/entrypoint.go b/upstream/pkg/pod/entrypoint.go index fd4893bc6ed..5997131e5bd 100644 --- a/upstream/pkg/pod/entrypoint.go +++ b/upstream/pkg/pod/entrypoint.go @@ -126,7 +126,7 @@ var ( // Additionally, Step timeouts are added as entrypoint flag. func orderContainers(ctx context.Context, commonExtraEntrypointArgs []string, steps []corev1.Container, taskSpec *v1.TaskSpec, breakpointConfig *v1.TaskRunDebug, waitForReadyAnnotation, enableKeepPodOnCancel bool) ([]corev1.Container, error) { if len(steps) == 0 { - return nil, errors.New("no steps specified") + return nil, errors.New("No steps specified") } for i, s := range steps { @@ -171,17 +171,7 @@ func orderContainers(ctx context.Context, commonExtraEntrypointArgs []string, st } // add step results stepResultArgs := stepResultArgument(taskSpec.Steps[i].Results) - argsForEntrypoint = append(argsForEntrypoint, stepResultArgs...) - if len(taskSpec.Steps[i].When) > 0 { - // marshal and pass to the entrypoint and unmarshal it there. - marshal, err := json.Marshal(taskSpec.Steps[i].When) - - if err != nil { - return nil, fmt.Errorf("faile to resolve when %w", err) - } - argsForEntrypoint = append(argsForEntrypoint, "--when_expressions", string(marshal)) - } } argsForEntrypoint = append(argsForEntrypoint, resultArgument(steps, taskSpec.Results)...) } @@ -189,9 +179,6 @@ func orderContainers(ctx context.Context, commonExtraEntrypointArgs []string, st if breakpointConfig != nil && breakpointConfig.NeedsDebugOnFailure() { argsForEntrypoint = append(argsForEntrypoint, "-breakpoint_on_failure") } - if breakpointConfig != nil && breakpointConfig.NeedsDebugBeforeStep(s.Name) { - argsForEntrypoint = append(argsForEntrypoint, "-debug_before_step") - } cmd, args := s.Command, s.Args if len(cmd) > 0 { @@ -355,8 +342,8 @@ func IsContainerStep(name string) bool { return strings.HasPrefix(name, stepPref // represents a sidecar. func IsContainerSidecar(name string) bool { return strings.HasPrefix(name, sidecarPrefix) } -// TrimStepPrefix returns the container name, stripped of its step prefix. -func TrimStepPrefix(name string) string { return strings.TrimPrefix(name, stepPrefix) } +// trimStepPrefix returns the container name, stripped of its step prefix. +func trimStepPrefix(name string) string { return strings.TrimPrefix(name, stepPrefix) } // TrimSidecarPrefix returns the container name, stripped of its sidecar // prefix. diff --git a/upstream/pkg/pod/entrypoint_lookup_impl_test.go b/upstream/pkg/pod/entrypoint_lookup_impl_test.go index caf0985ed44..6c6178a8b16 100644 --- a/upstream/pkg/pod/entrypoint_lookup_impl_test.go +++ b/upstream/pkg/pod/entrypoint_lookup_impl_test.go @@ -68,7 +68,7 @@ func (f *fakeHTTP) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } // Check auth if we've fetching the image. - if strings.HasPrefix(r.URL.Path, "/v2/task") && r.Method == http.MethodGet { + if strings.HasPrefix(r.URL.Path, "/v2/task") && r.Method == "GET" { u, p, ok := r.BasicAuth() if !ok || username != u || password != p { w.WriteHeader(http.StatusUnauthorized) @@ -114,11 +114,9 @@ func TestGetImageWithImagePullSecrets(t *testing.T) { task := &pipelinev1.Task{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1", - Kind: "Task", - }, + Kind: "Task"}, ObjectMeta: metav1.ObjectMeta{ - Name: "test-create-image", - }, + Name: "test-create-image"}, } ref, err := remotetest.CreateImageWithAnnotations(u.Host+"/task/test-create-image", remotetest.DefaultObjectAnnotationMapper, task) diff --git a/upstream/pkg/pod/entrypoint_test.go b/upstream/pkg/pod/entrypoint_test.go index d2923af47ce..296bedc3cd8 100644 --- a/upstream/pkg/pod/entrypoint_test.go +++ b/upstream/pkg/pod/entrypoint_test.go @@ -22,16 +22,14 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/test/diff" - - "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/selection" fakek8s "k8s.io/client-go/kubernetes/fake" k8stesting "k8s.io/client-go/testing" ) @@ -256,82 +254,6 @@ func TestOrderContainersWithDebugOnFailure(t *testing.T) { } } -func TestTestOrderContainersWithDebugBeforeStep(t *testing.T) { - steps := []corev1.Container{{ - Name: "my-task", - Image: "step-1", - Command: []string{"cmd"}, - Args: []string{"arg1", "arg2"}, - }} - want := []corev1.Container{{ - Name: "my-task", - Image: "step-1", - Command: []string{entrypointBinary}, - Args: []string{ - "-wait_file", "/tekton/downward/ready", - "-wait_file_content", - "-post_file", "/tekton/run/0/out", - "-termination_path", "/tekton/termination", - "-step_metadata_dir", "/tekton/run/0/status", "-debug_before_step", - "-entrypoint", "cmd", "--", - "arg1", "arg2", - }, - VolumeMounts: []corev1.VolumeMount{downwardMount}, - TerminationMessagePath: "/tekton/termination", - }} - taskRunDebugConfig := &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - BeforeSteps: []string{"my-task"}, - }, - } - got, err := orderContainers(context.Background(), []string{}, steps, nil, taskRunDebugConfig, true, false) - if err != nil { - t.Fatalf("orderContainers: %v", err) - } - if d := cmp.Diff(want, got); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } -} - -func TestTestOrderContainersWithAllBreakpoints(t *testing.T) { - steps := []corev1.Container{{ - Name: "my-task", - Image: "step-1", - Command: []string{"cmd"}, - Args: []string{"arg1", "arg2"}, - }} - want := []corev1.Container{{ - Name: "my-task", - Image: "step-1", - Command: []string{entrypointBinary}, - Args: []string{ - "-wait_file", "/tekton/downward/ready", - "-wait_file_content", - "-post_file", "/tekton/run/0/out", - "-termination_path", "/tekton/termination", - "-step_metadata_dir", "/tekton/run/0/status", - "-breakpoint_on_failure", "-debug_before_step", - "-entrypoint", "cmd", "--", - "arg1", "arg2", - }, - VolumeMounts: []corev1.VolumeMount{downwardMount}, - TerminationMessagePath: "/tekton/termination", - }} - taskRunDebugConfig := &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - OnFailure: "enabled", - BeforeSteps: []string{"my-task"}, - }, - } - got, err := orderContainers(context.Background(), []string{}, steps, nil, taskRunDebugConfig, true, false) - if err != nil { - t.Fatalf("orderContainers: %v", err) - } - if d := cmp.Diff(want, got); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } -} - func TestOrderContainersWithEnabelKeepPodOnCancel(t *testing.T) { steps := []corev1.Container{{ Image: "step-1", @@ -439,46 +361,6 @@ func TestEntryPointStepActionResults(t *testing.T) { t.Errorf("Diff %s", diff.PrintWantGot(d)) } } -func TestEntryPointStepWhen(t *testing.T) { - containers := []corev1.Container{{ - Image: "step-1", - Command: []string{"cmd"}, - Args: []string{"arg1", "arg2"}, - }} - ts := v1.TaskSpec{Steps: []v1.Step{ - { - Name: "Test-When", - Image: "step-1", - Command: []string{"cmd"}, - Args: []string{"arg1", "arg2"}, - When: v1.StepWhenExpressions{{Input: "foo", Operator: selection.In, Values: []string{"foo", "bar"}}}, - }, - }} - got, err := orderContainers(context.Background(), []string{}, containers, &ts, nil, true, false) - if err != nil { - t.Fatalf("orderContainers: %v", err) - } - want := []corev1.Container{{ - Image: "step-1", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", "/tekton/downward/ready", - "-wait_file_content", - "-post_file", "/tekton/run/0/out", - "-termination_path", "/tekton/termination", - "-step_metadata_dir", "/tekton/run/0/status", - "--when_expressions", - `[{"input":"foo","operator":"in","values":["foo","bar"]}]`, - "-entrypoint", "cmd", "--", - "arg1", "arg2", - }, - VolumeMounts: []corev1.VolumeMount{downwardMount}, - TerminationMessagePath: "/tekton/termination", - }} - if d := cmp.Diff(want, got); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } -} func TestEntryPointResults(t *testing.T) { taskSpec := v1.TaskSpec{ diff --git a/upstream/pkg/pod/pod.go b/upstream/pkg/pod/pod.go index 61c40ef92ae..9b117e50b8b 100644 --- a/upstream/pkg/pod/pod.go +++ b/upstream/pkg/pod/pod.go @@ -26,7 +26,6 @@ import ( "strconv" "strings" - "github.com/tektoncd/pipeline/internal/artifactref" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" @@ -60,8 +59,8 @@ const ( // SpiffeCsiDriver is the CSI storage plugin needed for injection of SPIFFE workload api. SpiffeCsiDriver = "csi.spiffe.io" - // OsSelectorLabel is the label Kubernetes uses for OS-specific workloads (https://kubernetes.io/docs/reference/labels-annotations-taints/#kubernetes-io-os) - OsSelectorLabel = "kubernetes.io/os" + // osSelectorLabel is the label Kubernetes uses for OS-specific workloads (https://kubernetes.io/docs/reference/labels-annotations-taints/#kubernetes-io-os) + osSelectorLabel = "kubernetes.io/os" // TerminationReasonTimeoutExceeded indicates a step execution timed out. TerminationReasonTimeoutExceeded = "TimeoutExceeded" @@ -74,11 +73,6 @@ const ( // TerminationReasonCancelled indicates a step was cancelled. TerminationReasonCancelled = "Cancelled" - - StepArtifactPathPattern = "step.artifacts.path" - - // K8s version to determine if to use native k8s sidecar or Tekton sidecar - SidecarK8sMinorVersionCheck = 29 ) // These are effectively const, but Go doesn't have such an annotation. @@ -104,9 +98,6 @@ var ( Name: "tekton-internal-steps", MountPath: pipeline.StepsDir, ReadOnly: true, - }, { - Name: "tekton-internal-artifacts", - MountPath: pipeline.ArtifactsDir, }} implicitVolumes = []corev1.Volume{{ Name: "tekton-internal-workspace", @@ -120,9 +111,6 @@ var ( }, { Name: "tekton-internal-steps", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, - }, { - Name: "tekton-internal-artifacts", - VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, }} // MaxActiveDeadlineSeconds is a maximum permitted value to be used for a task with no timeout @@ -132,10 +120,10 @@ var ( allowPrivilegeEscalation = false runAsNonRoot = true - // LinuxSecurityContext allow init containers to run in namespaces + // The following security contexts allow init containers to run in namespaces // with "restricted" pod security admission // See https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted - LinuxSecurityContext = &corev1.SecurityContext{ + linuxSecurityContext = &corev1.SecurityContext{ AllowPrivilegeEscalation: &allowPrivilegeEscalation, Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, @@ -145,7 +133,7 @@ var ( Type: corev1.SeccompProfileTypeRuntimeDefault, }, } - WindowsSecurityContext = &corev1.SecurityContext{ + windowsSecurityContext = &corev1.SecurityContext{ RunAsNonRoot: &runAsNonRoot, } ) @@ -213,18 +201,15 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta tasklevel.ApplyTaskLevelComputeResources(steps, taskRun.Spec.ComputeResources) } windows := usesWindows(taskRun) - if sidecarLogsResultsEnabled { - if taskSpec.Results != nil || artifactsPathReferenced(steps) { - // create a results sidecar - resultsSidecar, err := createResultsSidecar(taskSpec, b.Images.SidecarLogResultsImage, setSecurityContext, windows) - if err != nil { - return nil, err - } - taskSpec.Sidecars = append(taskSpec.Sidecars, resultsSidecar) - commonExtraEntrypointArgs = append(commonExtraEntrypointArgs, "-result_from", config.ResultExtractionMethodSidecarLogs) + if sidecarLogsResultsEnabled && taskSpec.Results != nil { + // create a results sidecar + resultsSidecar, err := createResultsSidecar(taskSpec, b.Images.SidecarLogResultsImage, setSecurityContext, windows) + if err != nil { + return nil, err } + taskSpec.Sidecars = append(taskSpec.Sidecars, resultsSidecar) + commonExtraEntrypointArgs = append(commonExtraEntrypointArgs, "-result_from", config.ResultExtractionMethodSidecarLogs) } - sidecars, err := v1.MergeSidecarsWithSpecs(taskSpec.Sidecars, taskRun.Spec.SidecarSpecs) if err != nil { return nil, err @@ -246,7 +231,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta initContainers = append(initContainers, *scriptsInit) volumes = append(volumes, scriptsVolume) } - if alphaAPIEnabled && taskRun.Spec.Debug != nil && taskRun.Spec.Debug.NeedsDebug() { + if alphaAPIEnabled && taskRun.Spec.Debug != nil { volumes = append(volumes, debugScriptsVolume, debugInfoVolume) } // Initialize any workingDirs under /workspace. @@ -336,7 +321,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta // Each step should only mount their own volume as RW, // all other steps should be mounted RO. volumes = append(volumes, runVolume(i)) - for j := range stepContainers { + for j := 0; j < len(stepContainers); j++ { s.VolumeMounts = append(s.VolumeMounts, runMount(j, i != j)) } @@ -354,30 +339,25 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta stepContainers[i].VolumeMounts = vms } - if sidecarLogsResultsEnabled { + if sidecarLogsResultsEnabled && taskSpec.Results != nil { // Mount implicit volumes onto sidecarContainers // so that they can access /tekton/results and /tekton/run. - if taskSpec.Results != nil || artifactsPathReferenced(steps) { - for i, s := range sidecarContainers { - if s.Name != pipeline.ReservedResultsSidecarName { - continue - } - for j := range stepContainers { - s.VolumeMounts = append(s.VolumeMounts, runMount(j, true)) - } - requestedVolumeMounts := map[string]bool{} - for _, vm := range s.VolumeMounts { - requestedVolumeMounts[filepath.Clean(vm.MountPath)] = true - } - var toAdd []corev1.VolumeMount - for _, imp := range volumeMounts { - if !requestedVolumeMounts[filepath.Clean(imp.MountPath)] { - toAdd = append(toAdd, imp) - } + for i, s := range sidecarContainers { + for j := 0; j < len(stepContainers); j++ { + s.VolumeMounts = append(s.VolumeMounts, runMount(j, true)) + } + requestedVolumeMounts := map[string]bool{} + for _, vm := range s.VolumeMounts { + requestedVolumeMounts[filepath.Clean(vm.MountPath)] = true + } + var toAdd []corev1.VolumeMount + for _, imp := range volumeMounts { + if !requestedVolumeMounts[filepath.Clean(imp.MountPath)] { + toAdd = append(toAdd, imp) } - vms := append(s.VolumeMounts, toAdd...) //nolint:gocritic - sidecarContainers[i].VolumeMounts = vms } + vms := append(s.VolumeMounts, toAdd...) //nolint:gocritic + sidecarContainers[i].VolumeMounts = vms } } @@ -431,41 +411,11 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta } mergedPodContainers := stepContainers - mergedPodInitContainers := initContainers - - // Check if current k8s version is less than 1.29 - // Since Kubernetes Major version cannot be 0 and if it's 2 then sidecar will be in - // we are only concerned about major version 1 and if the minor is less than 29 then - // we need to do the current logic - useTektonSidecar := true - if config.FromContextOrDefaults(ctx).FeatureFlags.EnableKubernetesSidecar { - // Go through the logic for enable-kubernetes feature flag - // Kubernetes Version - dc := b.KubeClient.Discovery() - sv, err := dc.ServerVersion() - if err != nil { - return nil, err - } - svMinorInt, _ := strconv.Atoi(sv.Minor) - svMajorInt, _ := strconv.Atoi(sv.Major) - if svMajorInt >= 1 && svMinorInt >= SidecarK8sMinorVersionCheck { - // Add RestartPolicy and Merge into initContainer - useTektonSidecar = false - for i := range sidecarContainers { - sc := &sidecarContainers[i] - always := corev1.ContainerRestartPolicyAlways - sc.RestartPolicy = &always - sc.Name = names.SimpleNameGenerator.RestrictLength(fmt.Sprintf("%v%v", sidecarPrefix, sc.Name)) - mergedPodInitContainers = append(mergedPodInitContainers, *sc) - } - } - } - if useTektonSidecar { - // Merge sidecar containers with step containers. - for _, sc := range sidecarContainers { - sc.Name = names.SimpleNameGenerator.RestrictLength(fmt.Sprintf("%v%v", sidecarPrefix, sc.Name)) - mergedPodContainers = append(mergedPodContainers, sc) - } + + // Merge sidecar containers with step containers. + for _, sc := range sidecarContainers { + sc.Name = names.SimpleNameGenerator.RestrictLength(fmt.Sprintf("%v%v", sidecarPrefix, sc.Name)) + mergedPodContainers = append(mergedPodContainers, sc) } var dnsPolicy corev1.DNSPolicy @@ -514,7 +464,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta }, Spec: corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: mergedPodInitContainers, + InitContainers: initContainers, Containers: mergedPodContainers, ServiceAccountName: taskRun.Spec.ServiceAccountName, Volumes: volumes, @@ -544,9 +494,106 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta } } + // update init container and containers resource requirements + // resource limits values are taken from a config map + configDefaults := config.FromContextOrDefaults(ctx).Defaults + updateResourceRequirements(configDefaults.DefaultContainerResourceRequirements, newPod) + return newPod, nil } +// updates init containers and containers resource requirements of a pod base of config_defaults configmap. +func updateResourceRequirements(resourceRequirementsMap map[string]corev1.ResourceRequirements, pod *corev1.Pod) { + if len(resourceRequirementsMap) == 0 { + return + } + + // collect all the available container names from the resource requirement map + // some of the container names: place-scripts, prepare, working-dir-initializer + // some of the container names with prefix: prefix-scripts, prefix-sidecar-scripts + containerNames := []string{} + containerNamesWithPrefix := []string{} + for containerName := range resourceRequirementsMap { + // skip the default key + if containerName == config.ResourceRequirementDefaultContainerKey { + continue + } + + if strings.HasPrefix(containerName, "prefix-") { + containerNamesWithPrefix = append(containerNamesWithPrefix, containerName) + } else { + containerNames = append(containerNames, containerName) + } + } + + // update the containers resource requirements which does not have resource requirements + for _, containerName := range containerNames { + resourceRequirements := resourceRequirementsMap[containerName] + if resourceRequirements.Size() == 0 { + continue + } + + // update init containers + for index := range pod.Spec.InitContainers { + targetContainer := pod.Spec.InitContainers[index] + if containerName == targetContainer.Name && targetContainer.Resources.Size() == 0 { + pod.Spec.InitContainers[index].Resources = resourceRequirements + } + } + // update containers + for index := range pod.Spec.Containers { + targetContainer := pod.Spec.Containers[index] + if containerName == targetContainer.Name && targetContainer.Resources.Size() == 0 { + pod.Spec.Containers[index].Resources = resourceRequirements + } + } + } + + // update the containers resource requirements which does not have resource requirements with the mentioned prefix + for _, containerPrefix := range containerNamesWithPrefix { + resourceRequirements := resourceRequirementsMap[containerPrefix] + if resourceRequirements.Size() == 0 { + continue + } + + // get actual container name, remove "prefix-" string and append "-" at the end + // append '-' in the container prefix + containerPrefix = strings.Replace(containerPrefix, "prefix-", "", 1) + containerPrefix += "-" + + // update init containers + for index := range pod.Spec.InitContainers { + targetContainer := pod.Spec.InitContainers[index] + if strings.HasPrefix(targetContainer.Name, containerPrefix) && targetContainer.Resources.Size() == 0 { + pod.Spec.InitContainers[index].Resources = resourceRequirements + } + } + // update containers + for index := range pod.Spec.Containers { + targetContainer := pod.Spec.Containers[index] + if strings.HasPrefix(targetContainer.Name, containerPrefix) && targetContainer.Resources.Size() == 0 { + pod.Spec.Containers[index].Resources = resourceRequirements + } + } + } + + // reset of the containers resource requirements which has empty resource requirements + if resourceRequirements, found := resourceRequirementsMap[config.ResourceRequirementDefaultContainerKey]; found && resourceRequirements.Size() != 0 { + // update init containers + for index := range pod.Spec.InitContainers { + if pod.Spec.InitContainers[index].Resources.Size() == 0 { + pod.Spec.InitContainers[index].Resources = resourceRequirements + } + } + // update containers + for index := range pod.Spec.Containers { + if pod.Spec.Containers[index].Resources.Size() == 0 { + pod.Spec.Containers[index].Resources = resourceRequirements + } + } + } +} + // makeLabels constructs the labels we will propagate from TaskRuns to Pods. func makeLabels(s *v1.TaskRun) map[string]string { labels := make(map[string]string, len(s.ObjectMeta.Labels)+1) @@ -561,7 +608,6 @@ func makeLabels(s *v1.TaskRun) map[string]string { // NB: Set this *after* passing through TaskRun Labels. If the TaskRun // specifies this label, it should be overridden by this value. labels[pipeline.TaskRunLabelKey] = s.Name - labels[pipeline.TaskRunUIDLabelKey] = string(s.UID) return labels } @@ -607,9 +653,9 @@ func entrypointInitContainer(image string, steps []v1.Step, setSecurityContext, command = append(command, StepName(s.Name, i)) } volumeMounts := []corev1.VolumeMount{binMount, internalStepsMount} - securityContext := LinuxSecurityContext + securityContext := linuxSecurityContext if windows { - securityContext = WindowsSecurityContext + securityContext = windowsSecurityContext } // Rewrite steps with entrypoint binary. Append the entrypoint init @@ -641,19 +687,8 @@ func createResultsSidecar(taskSpec v1.TaskSpec, image string, setSecurityContext for _, r := range taskSpec.Results { names = append(names, r.Name) } - - stepNames := make([]string, 0, len(taskSpec.Steps)) - var artifactProducerSteps []string - for i, s := range taskSpec.Steps { - stepName := StepName(s.Name, i) - stepNames = append(stepNames, stepName) - if artifactPathReferencedInStep(s) { - artifactProducerSteps = append(artifactProducerSteps, GetContainerName(s.Name)) - } - } - resultsStr := strings.Join(names, ",") - command := []string{"/ko-app/sidecarlogresults", "-results-dir", pipeline.DefaultResultPath, "-result-names", resultsStr, "-step-names", strings.Join(artifactProducerSteps, ",")} + command := []string{"/ko-app/sidecarlogresults", "-results-dir", pipeline.DefaultResultPath, "-result-names", resultsStr} // create a map of container Name to step results stepResults := map[string][]string{} @@ -679,9 +714,9 @@ func createResultsSidecar(taskSpec v1.TaskSpec, image string, setSecurityContext Image: image, Command: command, } - securityContext := LinuxSecurityContext + securityContext := linuxSecurityContext if windows { - securityContext = WindowsSecurityContext + securityContext = windowsSecurityContext } if setSecurityContext { sidecar.SecurityContext = securityContext @@ -696,42 +731,6 @@ func usesWindows(tr *v1.TaskRun) bool { if tr.Spec.PodTemplate == nil || tr.Spec.PodTemplate.NodeSelector == nil { return false } - osSelector := tr.Spec.PodTemplate.NodeSelector[OsSelectorLabel] + osSelector := tr.Spec.PodTemplate.NodeSelector[osSelectorLabel] return osSelector == "windows" } - -func artifactsPathReferenced(steps []v1.Step) bool { - for _, step := range steps { - if artifactPathReferencedInStep(step) { - return true - } - } - return false -} - -func artifactPathReferencedInStep(step v1.Step) bool { - // `$(step.artifacts.path)` in taskRun.Spec.TaskSpec.Steps and `taskSpec.steps` are substituted when building the pod while when setting status for taskRun - // neither of them is substituted, so we need two forms to check if artifactsPath is referenced in steps. - unresolvedPath := "$(" + artifactref.StepArtifactPathPattern + ")" - - path := filepath.Join(pipeline.StepsDir, GetContainerName(step.Name), "artifacts", "provenance.json") - if strings.Contains(step.Script, path) || strings.Contains(step.Script, unresolvedPath) { - return true - } - for _, arg := range step.Args { - if strings.Contains(arg, path) || strings.Contains(arg, unresolvedPath) { - return true - } - } - for _, c := range step.Command { - if strings.Contains(c, path) || strings.Contains(c, unresolvedPath) { - return true - } - } - for _, e := range step.Env { - if strings.Contains(e.Value, path) || strings.Contains(e.Value, unresolvedPath) { - return true - } - } - return false -} diff --git a/upstream/pkg/pod/pod_test.go b/upstream/pkg/pod/pod_test.go index 4b5fc667cc0..0ff4e0f0154 100644 --- a/upstream/pkg/pod/pod_test.go +++ b/upstream/pkg/pod/pod_test.go @@ -37,9 +37,6 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/version" - fakediscovery "k8s.io/client-go/discovery/fake" fakek8s "k8s.io/client-go/kubernetes/fake" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -1940,7 +1937,7 @@ _EOF_ }, }, { - desc: "sidecar logs enabled, artifacts not enabled", + desc: "sidecar logs enabled", featureFlags: map[string]string{"results-from": "sidecar-logs"}, ts: v1.TaskSpec{ Results: []v1.TaskResult{{ @@ -1994,8 +1991,6 @@ _EOF_ "/tekton/results", "-result-names", "foo", - "-step-names", - "", "-step-results", "{}", }, @@ -2015,7 +2010,7 @@ _EOF_ }, }, { - desc: "sidecar logs enabled with step results, artifacts not enabled", + desc: "sidecar logs enabled with step results", featureFlags: map[string]string{"results-from": "sidecar-logs"}, ts: v1.TaskSpec{ Results: []v1.TaskResult{{ @@ -2075,8 +2070,6 @@ _EOF_ "/tekton/results", "-result-names", "foo", - "-step-names", - "", "-step-results", "{\"step-name\":[\"step-foo\"]}", }, @@ -2096,7 +2089,7 @@ _EOF_ }, }, { - desc: "sidecar logs enabled and artifacts not enabled, set security context is true", + desc: "sidecar logs enabled with security context", featureFlags: map[string]string{"results-from": "sidecar-logs", "set-security-context": "true"}, ts: v1.TaskSpec{ Results: []v1.TaskResult{{ @@ -2150,8 +2143,6 @@ _EOF_ "/tekton/results", "-result-names", "foo", - "-step-names", - "", "-step-results", "{}", }, @@ -2162,248 +2153,7 @@ _EOF_ {Name: "tekton-internal-bin", ReadOnly: true, MountPath: "/tekton/bin"}, {Name: "tekton-internal-run-0", ReadOnly: true, MountPath: "/tekton/run/0"}, }, implicitVolumeMounts...), - SecurityContext: LinuxSecurityContext, - }}, - Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ - Name: "tekton-creds-init-home-0", - VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}}, - }), - ActiveDeadlineSeconds: &defaultActiveDeadlineSeconds, - }, - }, - { - desc: "sidecar logs enabled and artifacts referenced", - featureFlags: map[string]string{"results-from": "sidecar-logs", "enable-artifacts": "true"}, - ts: v1.TaskSpec{ - Results: []v1.TaskResult{{ - Name: "foo", - Type: v1.ResultsTypeString, - }}, - Steps: []v1.Step{{ - Name: "name", - Image: "image", - Command: []string{"echo", "aaa", ">>>", "/tekton/steps/step-name/artifacts/provenance.json"}, // avoid entrypoint lookup. - }}, - }, - want: &corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{ - entrypointInitContainer(images.EntrypointImage, []v1.Step{{Name: "name"}}, false /* setSecurityContext */, false /* windows */), - }, - Containers: []corev1.Container{{ - Name: "step-name", - Image: "image", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", - "/tekton/downward/ready", - "-wait_file_content", - "-post_file", - "/tekton/run/0/out", - "-termination_path", - "/tekton/termination", - "-step_metadata_dir", - "/tekton/run/0/status", - "-result_from", - "sidecar-logs", - "-results", - "foo", - "-entrypoint", - "echo", - "--", - "aaa", - ">>>", - "/tekton/steps/step-name/artifacts/provenance.json", - }, - VolumeMounts: append([]corev1.VolumeMount{binROMount, runMount(0, false), downwardMount, { - Name: "tekton-creds-init-home-0", - MountPath: "/tekton/creds", - }}, implicitVolumeMounts...), - TerminationMessagePath: "/tekton/termination", - }, { - Name: pipeline.ReservedResultsSidecarContainerName, - Image: "", - Command: []string{ - "/ko-app/sidecarlogresults", - "-results-dir", - "/tekton/results", - "-result-names", - "foo", - "-step-names", - "step-name", - "-step-results", - "{}", - }, - Resources: corev1.ResourceRequirements{ - Requests: nil, - }, - VolumeMounts: append([]corev1.VolumeMount{ - {Name: "tekton-internal-bin", ReadOnly: true, MountPath: "/tekton/bin"}, - {Name: "tekton-internal-run-0", ReadOnly: true, MountPath: "/tekton/run/0"}, - }, implicitVolumeMounts...), - }}, - Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ - Name: "tekton-creds-init-home-0", - VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}}, - }), - ActiveDeadlineSeconds: &defaultActiveDeadlineSeconds, - }, - }, - { - desc: "sidecar logs enabled with step results, artifacts referenced", - featureFlags: map[string]string{"results-from": "sidecar-logs", "enable-artifacts": "true"}, - ts: v1.TaskSpec{ - Results: []v1.TaskResult{{ - Name: "foo", - Type: v1.ResultsTypeString, - }}, - Steps: []v1.Step{{ - Name: "name", - Results: []v1.StepResult{{ - Name: "step-foo", - Type: v1.ResultsTypeString, - }}, - Image: "image", - Command: []string{"echo", "aaa", ">>>", "/tekton/steps/step-name/artifacts/provenance.json"}, // - }}, - }, - want: &corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{ - entrypointInitContainer(images.EntrypointImage, []v1.Step{{Name: "name"}}, false /* setSecurityContext */, false /* windows */), - }, - Containers: []corev1.Container{{ - Name: "step-name", - Image: "image", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", - "/tekton/downward/ready", - "-wait_file_content", - "-post_file", - "/tekton/run/0/out", - "-termination_path", - "/tekton/termination", - "-step_metadata_dir", - "/tekton/run/0/status", - "-result_from", - "sidecar-logs", - "-step_results", - "step-foo", - "-results", - "foo", - "-entrypoint", - "echo", - "--", - "aaa", - ">>>", - "/tekton/steps/step-name/artifacts/provenance.json", - }, - VolumeMounts: append([]corev1.VolumeMount{binROMount, runMount(0, false), downwardMount, { - Name: "tekton-creds-init-home-0", - MountPath: "/tekton/creds", - }}, implicitVolumeMounts...), - TerminationMessagePath: "/tekton/termination", - }, { - Name: pipeline.ReservedResultsSidecarContainerName, - Image: "", - Command: []string{ - "/ko-app/sidecarlogresults", - "-results-dir", - "/tekton/results", - "-result-names", - "foo", - "-step-names", - "step-name", - "-step-results", - "{\"step-name\":[\"step-foo\"]}", - }, - Resources: corev1.ResourceRequirements{ - Requests: nil, - }, - VolumeMounts: append([]corev1.VolumeMount{ - {Name: "tekton-internal-bin", ReadOnly: true, MountPath: "/tekton/bin"}, - {Name: "tekton-internal-run-0", ReadOnly: true, MountPath: "/tekton/run/0"}, - }, implicitVolumeMounts...), - }}, - Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ - Name: "tekton-creds-init-home-0", - VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}}, - }), - ActiveDeadlineSeconds: &defaultActiveDeadlineSeconds, - }, - }, - { - desc: "sidecar logs enabled, artifacts referenced and security context set ", - featureFlags: map[string]string{"results-from": "sidecar-logs", "set-security-context": "true", "enable-artifacts": "true"}, - ts: v1.TaskSpec{ - Results: []v1.TaskResult{{ - Name: "foo", - Type: v1.ResultsTypeString, - }}, - Steps: []v1.Step{{ - Name: "name", - Image: "image", - Command: []string{"echo", "aaa", ">>>", "/tekton/steps/step-name/artifacts/provenance.json"}, - }}, - }, - want: &corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{ - entrypointInitContainer(images.EntrypointImage, []v1.Step{{Name: "name"}}, true /* setSecurityContext */, false /* windows */), - }, - Containers: []corev1.Container{{ - Name: "step-name", - Image: "image", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", - "/tekton/downward/ready", - "-wait_file_content", - "-post_file", - "/tekton/run/0/out", - "-termination_path", - "/tekton/termination", - "-step_metadata_dir", - "/tekton/run/0/status", - "-result_from", - "sidecar-logs", - "-results", - "foo", - "-entrypoint", - "echo", - "--", - "aaa", - ">>>", - "/tekton/steps/step-name/artifacts/provenance.json", - }, - VolumeMounts: append([]corev1.VolumeMount{binROMount, runMount(0, false), downwardMount, { - Name: "tekton-creds-init-home-0", - MountPath: "/tekton/creds", - }}, implicitVolumeMounts...), - TerminationMessagePath: "/tekton/termination", - }, { - Name: pipeline.ReservedResultsSidecarContainerName, - Image: "", - Command: []string{ - "/ko-app/sidecarlogresults", - "-results-dir", - "/tekton/results", - "-result-names", - "foo", - "-step-names", - "step-name", - "-step-results", - "{}", - }, - Resources: corev1.ResourceRequirements{ - Requests: nil, - }, - VolumeMounts: append([]corev1.VolumeMount{ - {Name: "tekton-internal-bin", ReadOnly: true, MountPath: "/tekton/bin"}, - {Name: "tekton-internal-run-0", ReadOnly: true, MountPath: "/tekton/run/0"}, - }, implicitVolumeMounts...), - SecurityContext: LinuxSecurityContext, + SecurityContext: linuxSecurityContext, }}, Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ Name: "tekton-creds-init-home-0", @@ -3251,17 +3001,14 @@ func verifyTaskLevelComputeResources(expectedComputeResources []ExpectedComputeR func TestMakeLabels(t *testing.T) { taskRunName := "task-run-name" - taskRunUID := types.UID("taskrunuid") want := map[string]string{ - pipeline.TaskRunLabelKey: taskRunName, - "foo": "bar", - "hello": "world", - pipeline.TaskRunUIDLabelKey: string(taskRunUID), + pipeline.TaskRunLabelKey: taskRunName, + "foo": "bar", + "hello": "world", } got := makeLabels(&v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Name: taskRunName, - UID: taskRunUID, Labels: map[string]string{ "foo": "bar", "hello": "world", @@ -3424,7 +3171,7 @@ func TestPrepareInitContainers(t *testing.T) { WorkingDir: "/", Command: []string{"/ko-app/entrypoint", "init", "/ko-app/entrypoint", entrypointBinary, "step-foo", "step-bar"}, VolumeMounts: []corev1.VolumeMount{binMount, internalStepsMount}, - SecurityContext: LinuxSecurityContext, + SecurityContext: linuxSecurityContext, }, }, { name: "nothing-special-two-steps-windows", @@ -3456,7 +3203,7 @@ func TestPrepareInitContainers(t *testing.T) { WorkingDir: "/", Command: []string{"/ko-app/entrypoint", "init", "/ko-app/entrypoint", entrypointBinary, "step-foo", "step-bar"}, VolumeMounts: []corev1.VolumeMount{binMount, internalStepsMount}, - SecurityContext: WindowsSecurityContext, + SecurityContext: windowsSecurityContext, }, }} for _, tc := range tcs { @@ -3485,13 +3232,13 @@ func TestUsesWindows(t *testing.T) { }, { name: "uses linux", taskRun: &v1.TaskRun{Spec: v1.TaskRunSpec{PodTemplate: &pod.Template{NodeSelector: map[string]string{ - OsSelectorLabel: "linux", + osSelectorLabel: "linux", }}}}, want: false, }, { name: "uses windows", taskRun: &v1.TaskRun{Spec: v1.TaskRunSpec{PodTemplate: &pod.Template{NodeSelector: map[string]string{ - OsSelectorLabel: "windows", + osSelectorLabel: "windows", }}}}, want: true, }} @@ -3505,265 +3252,377 @@ func TestUsesWindows(t *testing.T) { } } -func Test_artifactsPathReferenced(t *testing.T) { - tests := []struct { - name string - steps []v1.Step - want bool - }{ - { - name: "No Steps", - steps: []v1.Step{}, - want: false, +func TestUpdateResourceRequirements(t *testing.T) { + testPod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, + Spec: corev1.PodSpec{ + InitContainers: []corev1.Container{ + {Name: "place-scripts"}, + {Name: "prepare"}, + {Name: "working-dir-initializer"}, + {Name: "test-01"}, + {Name: "foo"}, + }, + Containers: []corev1.Container{ + {Name: "scripts-01"}, + {Name: "scripts-02"}, + {Name: "sidecar-scripts-01"}, + {Name: "sidecar-scripts-02"}, + {Name: "test-01"}, + {Name: "foo"}, + }, }, + } + + tcs := []struct { + name string + targetPod *corev1.Pod + resourceRequirements map[string]corev1.ResourceRequirements + getExpectedPod func() *corev1.Pod + }{ + // verifies with no resource requirements data from a config map { - name: "No Reference", - steps: []v1.Step{ - { - Name: "name", - Script: "echo hello", - Command: []string{"echo", "hello"}, - }, + name: "test-with-no-data", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{}, + getExpectedPod: func() *corev1.Pod { + return testPod.DeepCopy() }, - want: false, }, + + // verifies with empty resource requirements data from a config map { - name: "Reference in Script", - steps: []v1.Step{ - { - Name: "name", - Script: "echo aaa >> /tekton/steps/step-name/artifacts/provenance.json", - }, + name: "test-with-empty-resource-requirements", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{ + "default": {}, + "place-scripts": {}, + "prefix-scripts": {}, + }, + getExpectedPod: func() *corev1.Pod { + return testPod.DeepCopy() }, - want: true, }, + + // verifies only with 'default' resource requirements data from a config map { - name: "Reference in Args", - steps: []v1.Step{ - { - Name: "name", - Command: []string{"cat"}, - Args: []string{"/tekton/steps/step-name/artifacts/provenance.json"}, + name: "test-with-default-set", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{ + "default": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + }, }, }, - want: true, + getExpectedPod: func() *corev1.Pod { + expectedPod := testPod.DeepCopy() + defaultResource := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + }, + } + expectedPod.Spec = corev1.PodSpec{ + InitContainers: []corev1.Container{ + {Name: "place-scripts", Resources: defaultResource}, + {Name: "prepare", Resources: defaultResource}, + {Name: "working-dir-initializer", Resources: defaultResource}, + {Name: "test-01", Resources: defaultResource}, + {Name: "foo", Resources: defaultResource}, + }, + Containers: []corev1.Container{ + {Name: "scripts-01", Resources: defaultResource}, + {Name: "scripts-02", Resources: defaultResource}, + {Name: "sidecar-scripts-01", Resources: defaultResource}, + {Name: "sidecar-scripts-02", Resources: defaultResource}, + {Name: "test-01", Resources: defaultResource}, + {Name: "foo", Resources: defaultResource}, + }, + } + return expectedPod + }, }, + + // verifies only with 'place-scripts' resource requirements data from a config map { - name: "Reference in Command", - steps: []v1.Step{ - { - Name: "name", - Command: []string{"cat", "/tekton/steps/step-name/artifacts/provenance.json"}, + name: "test-with-place-scripts-set", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{ + "place-scripts": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + corev1.ResourceCPU: resource.MustParse("200m"), + }, }, }, - want: true, - }, - { - name: "Reference in Env", - steps: []v1.Step{ - { - Name: "name", - Env: []corev1.EnvVar{ - { - Name: "MY_VAR", - Value: "/tekton/steps/step-name/artifacts/provenance.json", + getExpectedPod: func() *corev1.Pod { + expectedPod := testPod.DeepCopy() + expectedPod.Spec.InitContainers = []corev1.Container{ + { + Name: "place-scripts", + Resources: corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + corev1.ResourceCPU: resource.MustParse("200m"), + }, }, }, - }, + {Name: "prepare"}, + {Name: "working-dir-initializer"}, + {Name: "test-01"}, + {Name: "foo"}, + } + return expectedPod }, - want: true, }, + + // verifies only with 'prefix-scripts' resource requirements data from a config map { - name: "Unresolved reference in Script", - steps: []v1.Step{ - { - Name: "name", - Script: "echo aaa >> $(step.artifacts.path)", + name: "test-with-prefix-scripts-set", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{ + "prefix-scripts": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + corev1.ResourceCPU: resource.MustParse("200m"), + }, }, }, - want: true, - }, - { - name: "Unresolved reference in Args", - steps: []v1.Step{ - { - Name: "name", - Command: []string{"cat"}, - Args: []string{"$(step.artifacts.path)"}, - }, + getExpectedPod: func() *corev1.Pod { + expectedPod := testPod.DeepCopy() + prefixScripts := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + corev1.ResourceCPU: resource.MustParse("200m"), + }, + } + expectedPod.Spec.Containers = []corev1.Container{ + {Name: "scripts-01", Resources: prefixScripts}, + {Name: "scripts-02", Resources: prefixScripts}, + {Name: "sidecar-scripts-01"}, + {Name: "sidecar-scripts-02"}, + {Name: "test-01"}, + {Name: "foo"}, + } + return expectedPod }, - want: true, }, + + // verifies with 'working-dir-initializer', 'prefix-sidecar-scripts', and 'default' resource requirements data from a config map { - name: "Unresolved reference in Command", - steps: []v1.Step{ - { - Name: "name", - Command: []string{"cat", "$(step.artifacts.path)"}, + name: "test-with_name_prefix_and_default-set", + targetPod: testPod.DeepCopy(), + resourceRequirements: map[string]corev1.ResourceRequirements{ + "working-dir-initializer": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("400m"), + corev1.ResourceMemory: resource.MustParse("512Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("256Mi"), + corev1.ResourceCPU: resource.MustParse("250m"), + }, }, - }, - want: true, - }, - { - name: "Unresolved reference in Env", - steps: []v1.Step{ - { - Name: "name", - Env: []corev1.EnvVar{ - { - Name: "MY_VAR", - Value: "$(step.artifacts.path)", - }, + "prefix-sidecar-scripts": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1Gi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceCPU: resource.MustParse("500m"), + }, + }, + "default": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), }, }, + "prefix-test": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("100m"), + corev1.ResourceMemory: resource.MustParse("32Mi"), + }, + }, + "foo": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("200m"), + corev1.ResourceMemory: resource.MustParse("64Mi"), + }, + }, + }, + getExpectedPod: func() *corev1.Pod { + expectedPod := testPod.DeepCopy() + workDirResourceReqs := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("400m"), + corev1.ResourceMemory: resource.MustParse("512Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("256Mi"), + corev1.ResourceCPU: resource.MustParse("250m"), + }, + } + sideCarResourceReqs := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1Gi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceCPU: resource.MustParse("500m"), + }, + } + defaultResourceReqs := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + }, + } + + testResourceReqs := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("100m"), + corev1.ResourceMemory: resource.MustParse("32Mi"), + }, + } + fooResourceReqs := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("200m"), + corev1.ResourceMemory: resource.MustParse("64Mi"), + }, + } + + expectedPod.Spec = corev1.PodSpec{ + InitContainers: []corev1.Container{ + {Name: "place-scripts", Resources: defaultResourceReqs}, + {Name: "prepare", Resources: defaultResourceReqs}, + {Name: "working-dir-initializer", Resources: workDirResourceReqs}, + {Name: "test-01", Resources: testResourceReqs}, + {Name: "foo", Resources: fooResourceReqs}, + }, + Containers: []corev1.Container{ + {Name: "scripts-01", Resources: defaultResourceReqs}, + {Name: "scripts-02", Resources: defaultResourceReqs}, + {Name: "sidecar-scripts-01", Resources: sideCarResourceReqs}, + {Name: "sidecar-scripts-02", Resources: sideCarResourceReqs}, + {Name: "test-01", Resources: testResourceReqs}, + {Name: "foo", Resources: fooResourceReqs}, + }, + } + return expectedPod }, - want: true, }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := artifactsPathReferenced(tt.steps) - if d := cmp.Diff(tt.want, got); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } - }) - } -} -func TestPodBuildWithK8s129(t *testing.T) { - always := corev1.ContainerRestartPolicyAlways - ts := v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "name", - Image: "image", - Command: []string{"cmd"}, // avoid entrypoint lookup. - }}, - Sidecars: []v1.Sidecar{{ - Name: "name", - Image: "image", - Command: []string{"cmd"}, - }}, - } - want := &corev1.PodSpec{ - RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{ - entrypointInitContainer( - images.EntrypointImage, - []v1.Step{{Name: "name"}}, - false, /* setSecurityContext */ - false /* windows */), - { - Name: "sidecar-name", - Image: "image", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", - "/tekton/downward/ready", - "-wait_file_content", - "-post_file", - "/tekton/run/0/out", - "-termination_path", - "/tekton/termination", - "-step_metadata_dir", - "/tekton/run/0/status", - "-entrypoint", - "cmd", - "--", + // verifies with existing data + { + name: "test-with-existing-data", + targetPod: &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, + Spec: corev1.PodSpec{ + InitContainers: []corev1.Container{ + {Name: "place-scripts"}, + {Name: "prepare", Resources: corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + }, + }}, + {Name: "working-dir-initializer"}, + }, + Containers: []corev1.Container{ + {Name: "scripts-01"}, + {Name: "scripts-02"}, + {Name: "sidecar-scripts-01"}, + {Name: "sidecar-scripts-02"}, + }, }, - RestartPolicy: &always, }, - }, - Containers: []corev1.Container{{ - Name: "step-name", - Image: "image", - Command: []string{"/tekton/bin/entrypoint"}, - Args: []string{ - "-wait_file", - "/tekton/downward/ready", - "-wait_file_content", - "-post_file", - "/tekton/run/0/out", - "-termination_path", - "/tekton/termination", - "-step_metadata_dir", - "/tekton/run/0/status", - "-entrypoint", - "cmd", - "--", + resourceRequirements: map[string]corev1.ResourceRequirements{ + "prepare": { + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("512Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + }, }, - }}, - } - featureFlags := map[string]string{ - "enable-kubernetes-sidecar": "true", - } - store := config.NewStore(logtesting.TestLogger(t)) - store.OnConfigChanged( - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, - Data: featureFlags, - }, - ) - kubeclient := fakek8s.NewSimpleClientset( - &corev1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: "default"}}, - &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{Name: "service-account", Namespace: "default"}, - Secrets: []corev1.ObjectReference{{ - Name: "multi-creds", - }}, - }, - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "multi-creds", - Namespace: "default", - Annotations: map[string]string{ - "tekton.dev/docker-0": "https://us.gcr.io", - "tekton.dev/docker-1": "https://docker.io", - "tekton.dev/git-0": "github.com", - "tekton.dev/git-1": "gitlab.com", - }, - }, - Type: "kubernetes.io/basic-auth", - Data: map[string][]byte{ - "username": []byte("foo"), - "password": []byte("BestEver"), + getExpectedPod: func() *corev1.Pod { + expectedPod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Namespace: "custom-ns"}, + Spec: corev1.PodSpec{ + InitContainers: []corev1.Container{ + {Name: "place-scripts"}, + {Name: "prepare", Resources: corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("256Mi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("128Mi"), + }, + }}, + {Name: "working-dir-initializer"}, + }, + Containers: []corev1.Container{ + {Name: "scripts-01"}, + {Name: "scripts-02"}, + {Name: "sidecar-scripts-01"}, + {Name: "sidecar-scripts-02"}, + }, + }, + } + return expectedPod }, }, - ) - fakeDisc, _ := kubeclient.Discovery().(*fakediscovery.FakeDiscovery) - fakeDisc.FakedServerVersion = &version.Info{ - Major: "1", - Minor: "29", - } - - trs := v1.TaskRunSpec{ - TaskSpec: &ts, - } - - tr := &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "taskrunName", - Namespace: "default", - }, - Spec: trs, } - // No entrypoints should be looked up. - entrypointCache := fakeCache{} - - builder := Builder{ - Images: images, - KubeClient: kubeclient, - EntrypointCache: entrypointCache, - } - got, err := builder.Build(store.ToContext(context.Background()), tr, ts) - if err != nil { - t.Errorf("Pod build failed: %s", err) - } - if d := cmp.Diff(want.InitContainers[1].Name, got.Spec.InitContainers[1].Name); d != "" { - t.Errorf("Pod does not have sidecar in init list: %s", diff.PrintWantGot(d)) - } + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + targetPod := tc.targetPod + updateResourceRequirements(tc.resourceRequirements, targetPod) - if d := cmp.Diff(want.InitContainers[1].RestartPolicy, got.Spec.InitContainers[1].RestartPolicy); d != "" { - t.Errorf("Sidecar does not have RestartPolicy Always: %s", diff.PrintWantGot(d)) + expectedPod := tc.getExpectedPod() + if d := cmp.Diff(expectedPod, targetPod); d != "" { + t.Errorf("Diff %s", diff.PrintWantGot(d)) + } + }) } } diff --git a/upstream/pkg/pod/script.go b/upstream/pkg/pod/script.go index 611c109c6ee..e2f3ca5d24d 100644 --- a/upstream/pkg/pod/script.go +++ b/upstream/pkg/pod/script.go @@ -87,13 +87,13 @@ func convertScripts(shellImageLinux string, shellImageWin string, steps []v1.Ste shellImage := shellImageLinux shellCommand := "sh" shellArg := "-c" - securityContext := LinuxSecurityContext + securityContext := linuxSecurityContext // Set windows variants for Image, Command and Args if requiresWindows { shellImage = shellImageWin shellCommand = "pwsh" shellArg = "-Command" - securityContext = WindowsSecurityContext + securityContext = windowsSecurityContext } placeScriptsInit := corev1.Container{ @@ -146,7 +146,9 @@ func convertListOfSteps(steps []v1.Step, initContainer *corev1.Container, debugC } containers = append(containers, *c) } - placeDebugScriptInContainers(containers, initContainer, debugConfig) + if debugConfig != nil && debugConfig.NeedsDebugOnFailure() { + placeDebugScriptInContainers(containers, initContainer) + } return containers } @@ -212,48 +214,26 @@ func encodeScript(script string) string { // placeDebugScriptInContainers inserts debug scripts into containers. It capsules those scripts to files in initContainer, // then executes those scripts in target containers. -func placeDebugScriptInContainers(containers []corev1.Container, initContainer *corev1.Container, debugConfig *v1.TaskRunDebug) { - if debugConfig == nil || !debugConfig.NeedsDebug() { - return - } - - isDebugOnFailure := debugConfig != nil && debugConfig.NeedsDebugOnFailure() - var needDebugBeforeStep bool - - for i := range containers { +func placeDebugScriptInContainers(containers []corev1.Container, initContainer *corev1.Container) { + for i := 0; i < len(containers); i++ { debugInfoVolumeMount := corev1.VolumeMount{ Name: debugInfoVolumeName, MountPath: filepath.Join(debugInfoDir, strconv.Itoa(i)), } (&containers[i]).VolumeMounts = append((&containers[i]).VolumeMounts, debugScriptsVolumeMount, debugInfoVolumeMount) - if debugConfig != nil && debugConfig.NeedsDebugBeforeStep(containers[i].Name) { - needDebugBeforeStep = true - } } type script struct { name string content string } - debugScripts := make([]script, 0) - if isDebugOnFailure { - debugScripts = append(debugScripts, []script{{ - name: "continue", - content: defaultScriptPreamble + fmt.Sprintf(debugContinueScriptTemplate, len(containers), debugInfoDir, RunDir), - }, { - name: "fail-continue", - content: defaultScriptPreamble + fmt.Sprintf(debugFailScriptTemplate, len(containers), debugInfoDir, RunDir), - }}...) - } - if needDebugBeforeStep { - debugScripts = append(debugScripts, []script{{ - name: "beforestep-continue", - content: defaultScriptPreamble + fmt.Sprintf(debugBeforeStepContinueScriptTemplate, len(containers), debugInfoDir, RunDir), - }, { - name: "beforestep-fail-continue", - content: defaultScriptPreamble + fmt.Sprintf(debugBeforeStepFailScriptTemplate, len(containers), debugInfoDir, RunDir), - }}...) - } + debugScripts := []script{{ + name: "continue", + content: defaultScriptPreamble + fmt.Sprintf(debugContinueScriptTemplate, len(containers), debugInfoDir, RunDir), + }, { + name: "fail-continue", + content: defaultScriptPreamble + fmt.Sprintf(debugFailScriptTemplate, len(containers), debugInfoDir, RunDir), + }} // Add debug or breakpoint related scripts to /tekton/debug/scripts // Iterate through the debugScripts and add routine for each of them in the initContainer for their creation diff --git a/upstream/pkg/pod/script_test.go b/upstream/pkg/pod/script_test.go index b18856534f8..93c1ed51ce5 100644 --- a/upstream/pkg/pod/script_test.go +++ b/upstream/pkg/pod/script_test.go @@ -159,7 +159,7 @@ _EOF_ /tekton/bin/entrypoint decode-script "${scriptfile}" `}, VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount}, - SecurityContext: LinuxSecurityContext, + SecurityContext: linuxSecurityContext, } want := []corev1.Container{{ Image: "step-1", @@ -353,7 +353,7 @@ _EOF_ } } -func TestConvertScripts_WithBreakpoints(t *testing.T) { +func TestConvertScripts_WithBreakpoint_OnFailure(t *testing.T) { names.TestingSeed() preExistingVolumeMounts := []corev1.VolumeMount{{ @@ -363,45 +363,37 @@ func TestConvertScripts_WithBreakpoints(t *testing.T) { Name: "another-one", MountPath: "/another/one", }} - testCases := []struct { - name string - steps []v1.Step - wantInit *corev1.Container - wantSteps []corev1.Container - taskRunDebug *v1.TaskRunDebug - }{ - { - name: "set breakpoint only on failure", - steps: []v1.Step{{ - Script: `#!/bin/sh + + gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1.Step{{ + Script: `#!/bin/sh script-1`, - Image: "step-1", - }, { - // No script to convert here. - Image: "step-2", - }, { - Script: ` + Image: "step-1", + }, { + // No script to convert here. + Image: "step-2", + }, { + Script: ` #!/bin/sh script-3`, - Image: "step-3", - VolumeMounts: preExistingVolumeMounts, - Args: []string{"my", "args"}, - }, { - Script: `no-shebang`, - Image: "step-3", - VolumeMounts: preExistingVolumeMounts, - Args: []string{"my", "args"}, - }}, - taskRunDebug: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - OnFailure: "enabled", - }, - }, - wantInit: &corev1.Container{ - Name: "place-scripts", - Image: images.ShellImage, - Command: []string{"sh"}, - Args: []string{"-c", `scriptfile="/tekton/scripts/script-0-9l9zj" + Image: "step-3", + VolumeMounts: preExistingVolumeMounts, + Args: []string{"my", "args"}, + }, { + Script: `no-shebang`, + Image: "step-3", + VolumeMounts: preExistingVolumeMounts, + Args: []string{"my", "args"}, + }}, []v1.Sidecar{}, &v1.TaskRunDebug{ + Breakpoints: &v1.TaskBreakpoints{ + OnFailure: "enabled", + }, + }, true) + + wantInit := &corev1.Container{ + Name: "place-scripts", + Image: images.ShellImage, + Command: []string{"sh"}, + Args: []string{"-c", `scriptfile="/tekton/scripts/script-0-9l9zj" touch ${scriptfile} && chmod +x ${scriptfile} cat > ${scriptfile} << '_EOF_' IyEvYmluL3NoCnNjcmlwdC0x @@ -464,176 +456,49 @@ else fi debug-fail-continue-heredoc-randomly-generated-6nl7g `}, - VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount, debugScriptsVolumeMount}, - SecurityContext: LinuxSecurityContext, - }, - wantSteps: []corev1.Container{{ - Image: "step-1", - Command: []string{"/tekton/scripts/script-0-9l9zj"}, - VolumeMounts: []corev1.VolumeMount{scriptsVolumeMount, debugScriptsVolumeMount, - {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/0"}}, - }, { - Image: "step-2", - VolumeMounts: []corev1.VolumeMount{ - debugScriptsVolumeMount, {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/1"}, - }, - }, { - Image: "step-3", - Command: []string{"/tekton/scripts/script-2-mz4c7"}, - Args: []string{"my", "args"}, - VolumeMounts: append(preExistingVolumeMounts, scriptsVolumeMount, debugScriptsVolumeMount, - corev1.VolumeMount{Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/2"}, - ), - }, { - Image: "step-3", - Command: []string{"/tekton/scripts/script-3-mssqb"}, - Args: []string{"my", "args"}, - VolumeMounts: []corev1.VolumeMount{ - {Name: "pre-existing-volume-mount", MountPath: "/mount/path"}, - {Name: "another-one", MountPath: "/another/one"}, - scriptsVolumeMount, - debugScriptsVolumeMount, - {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/3"}, - }, - }}, - }, { - name: "set all breakpoints with onfailure debugBeforeStep", - steps: []v1.Step{{ - Name: "step-1", - Script: `#!/bin/sh -script-1`, - Image: "step-1", - }}, - taskRunDebug: &v1.TaskRunDebug{ - Breakpoints: &v1.TaskBreakpoints{ - OnFailure: "enabled", - BeforeSteps: []string{"step-1"}, - }, - }, - wantInit: &corev1.Container{ - Name: "place-scripts", - Image: images.ShellImage, - Command: []string{"sh"}, - Args: []string{"-c", `scriptfile="/tekton/scripts/script-0-9l9zj" -touch ${scriptfile} && chmod +x ${scriptfile} -cat > ${scriptfile} << '_EOF_' -IyEvYmluL3NoCnNjcmlwdC0x -_EOF_ -/tekton/bin/entrypoint decode-script "${scriptfile}" -tmpfile="/tekton/debug/scripts/debug-continue" -touch ${tmpfile} && chmod +x ${tmpfile} -cat > ${tmpfile} << 'debug-continue-heredoc-randomly-generated-mz4c7' -#!/bin/sh -set -e - -numberOfSteps=1 -debugInfo=/tekton/debug/info -tektonRun=/tekton/run - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" - -if [ $stepNumber -lt $numberOfSteps ]; then - touch ${tektonRun}/${stepNumber}/out # Mark step as success - echo "0" > ${tektonRun}/${stepNumber}/out.breakpointexit - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, breakpoint exiting !" - exit 0 -fi -debug-continue-heredoc-randomly-generated-mz4c7 -tmpfile="/tekton/debug/scripts/debug-fail-continue" -touch ${tmpfile} && chmod +x ${tmpfile} -cat > ${tmpfile} << 'debug-fail-continue-heredoc-randomly-generated-mssqb' -#!/bin/sh -set -e - -numberOfSteps=1 -debugInfo=/tekton/debug/info -tektonRun=/tekton/run - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" - -if [ $stepNumber -lt $numberOfSteps ]; then - touch ${tektonRun}/${stepNumber}/out.err # Mark step as a failure - echo "1" > ${tektonRun}/${stepNumber}/out.breakpointexit - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, breakpoint exiting !" - exit 0 -fi -debug-fail-continue-heredoc-randomly-generated-mssqb -tmpfile="/tekton/debug/scripts/debug-beforestep-continue" -touch ${tmpfile} && chmod +x ${tmpfile} -cat > ${tmpfile} << 'debug-beforestep-continue-heredoc-randomly-generated-78c5n' -#!/bin/sh -set -e - -numberOfSteps=1 -debugInfo=/tekton/debug/info -tektonRun=/tekton/run - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" - -if [ $stepNumber -lt $numberOfSteps ]; then - echo "0" > ${tektonRun}/${stepNumber}/out.beforestepexit - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, before step breakpoint exiting !" - exit 0 -fi -debug-beforestep-continue-heredoc-randomly-generated-78c5n -tmpfile="/tekton/debug/scripts/debug-beforestep-fail-continue" -touch ${tmpfile} && chmod +x ${tmpfile} -cat > ${tmpfile} << 'debug-beforestep-fail-continue-heredoc-randomly-generated-6nl7g' -#!/bin/sh -set -e - -numberOfSteps=1 -debugInfo=/tekton/debug/info -tektonRun=/tekton/run - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" + VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount, debugScriptsVolumeMount}, + SecurityContext: linuxSecurityContext, + } -if [ $stepNumber -lt $numberOfSteps ]; then - echo "1" > ${tektonRun}/${stepNumber}/out.beforestepexit.err - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, before step breakpoint exiting !" - exit 0 -fi -debug-beforestep-fail-continue-heredoc-randomly-generated-6nl7g -`}, - VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount, debugScriptsVolumeMount}, - SecurityContext: LinuxSecurityContext}, - wantSteps: []corev1.Container{{ - Name: "step-1", - Image: "step-1", - Command: []string{"/tekton/scripts/script-0-9l9zj"}, - VolumeMounts: []corev1.VolumeMount{scriptsVolumeMount, debugScriptsVolumeMount, - {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/0"}}, - }}, + want := []corev1.Container{{ + Image: "step-1", + Command: []string{"/tekton/scripts/script-0-9l9zj"}, + VolumeMounts: []corev1.VolumeMount{scriptsVolumeMount, debugScriptsVolumeMount, + {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/0"}}, + }, { + Image: "step-2", + VolumeMounts: []corev1.VolumeMount{ + debugScriptsVolumeMount, {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/1"}, + }, + }, { + Image: "step-3", + Command: []string{"/tekton/scripts/script-2-mz4c7"}, + Args: []string{"my", "args"}, + VolumeMounts: append(preExistingVolumeMounts, scriptsVolumeMount, debugScriptsVolumeMount, + corev1.VolumeMount{Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/2"}), + }, { + Image: "step-3", + Command: []string{"/tekton/scripts/script-3-mssqb"}, + Args: []string{"my", "args"}, + VolumeMounts: []corev1.VolumeMount{ + {Name: "pre-existing-volume-mount", MountPath: "/mount/path"}, + {Name: "another-one", MountPath: "/another/one"}, + scriptsVolumeMount, + debugScriptsVolumeMount, + {Name: debugInfoVolumeName, MountPath: "/tekton/debug/info/3"}, }, + }} + + if d := cmp.Diff(wantInit, gotInit); d != "" { + t.Errorf("Init Container Diff %s", diff.PrintWantGot(d)) } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - names.TestingSeed() - gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, tc.steps, []v1.Sidecar{}, tc.taskRunDebug, true) - if d := cmp.Diff(tc.wantInit, gotInit); d != "" { - t.Errorf("Init Container Diff %s", diff.PrintWantGot(d)) - } - if d := cmp.Diff(tc.wantSteps, gotSteps); d != "" { - t.Errorf("Containers Diff %s", diff.PrintWantGot(d)) - } + if d := cmp.Diff(want, gotSteps); d != "" { + t.Errorf("Containers Diff %s", diff.PrintWantGot(d)) + } - if len(gotSidecars) != 0 { - t.Errorf("Expected zero sidecars, got %v", len(gotSidecars)) - } - }) + if len(gotSidecars) != 0 { + t.Errorf("Expected zero sidecars, got %v", len(gotSidecars)) } } @@ -690,7 +555,7 @@ _EOF_ /tekton/bin/entrypoint decode-script "${scriptfile}" `}, VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount}, - SecurityContext: LinuxSecurityContext, + SecurityContext: linuxSecurityContext, } want := []corev1.Container{{ Image: "step-1", @@ -777,7 +642,7 @@ no-shebang "@ | Out-File -FilePath /tekton/scripts/script-3-mssqb.cmd `}, VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount}, - SecurityContext: WindowsSecurityContext, + SecurityContext: windowsSecurityContext, } want := []corev1.Container{{ Image: "step-1", @@ -860,7 +725,7 @@ sidecar-1 "@ | Out-File -FilePath /tekton/scripts/sidecar-script-0-mssqb `}, VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount}, - SecurityContext: WindowsSecurityContext, + SecurityContext: windowsSecurityContext, } want := []corev1.Container{{ Image: "step-1", @@ -922,7 +787,7 @@ sidecar-1 "@ | Out-File -FilePath /tekton/scripts/sidecar-script-0-9l9zj `}, VolumeMounts: []corev1.VolumeMount{writeScriptsVolumeMount, binMount}, - SecurityContext: WindowsSecurityContext, + SecurityContext: windowsSecurityContext, } want := []corev1.Container{{ Image: "step-1", diff --git a/upstream/pkg/pod/scripts_constants.go b/upstream/pkg/pod/scripts_constants.go index 7b018b6c61c..8a5867fa0c4 100644 --- a/upstream/pkg/pod/scripts_constants.go +++ b/upstream/pkg/pod/scripts_constants.go @@ -49,36 +49,6 @@ if [ $stepNumber -lt $numberOfSteps ]; then else echo "Last step (no. $stepNumber) has already been executed, breakpoint exiting !" exit 0 -fi` - debugBeforeStepContinueScriptTemplate = ` -numberOfSteps=%d -debugInfo=%s -tektonRun=%s - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" - -if [ $stepNumber -lt $numberOfSteps ]; then - echo "0" > ${tektonRun}/${stepNumber}/out.beforestepexit - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, before step breakpoint exiting !" - exit 0 -fi` - debugBeforeStepFailScriptTemplate = ` -numberOfSteps=%d -debugInfo=%s -tektonRun=%s - -postFile="$(ls ${debugInfo} | grep -E '[0-9]+' | tail -1)" -stepNumber="$(echo ${postFile} | sed 's/[^0-9]*//g')" - -if [ $stepNumber -lt $numberOfSteps ]; then - echo "1" > ${tektonRun}/${stepNumber}/out.beforestepexit.err - echo "Executing step $stepNumber..." -else - echo "Last step (no. $stepNumber) has already been executed, before step breakpoint exiting !" - exit 0 fi` initScriptDirective = `tmpfile="%s" touch ${tmpfile} && chmod +x ${tmpfile} diff --git a/upstream/pkg/pod/status.go b/upstream/pkg/pod/status.go index c166bda961e..90fa5a8cd54 100644 --- a/upstream/pkg/pod/status.go +++ b/upstream/pkg/pod/status.go @@ -125,7 +125,7 @@ func MakeTaskRunStatus(ctx context.Context, logger *zap.SugaredLogger, tr v1.Tas sortPodContainerStatuses(pod.Status.ContainerStatuses, pod.Spec.Containers) - complete := areContainersCompleted(ctx, pod) || isPodCompleted(pod) + complete := areContainersCompleted(ctx, pod) || pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed if complete { onError, ok := tr.Annotations[v1.PipelineTaskOnErrorAnnotation] @@ -139,6 +139,7 @@ func MakeTaskRunStatus(ctx context.Context, logger *zap.SugaredLogger, tr v1.Tas } trs.PodName = pod.Name + trs.Steps = []v1.StepState{} trs.Sidecars = []v1.SidecarState{} var stepStatuses []corev1.ContainerStatus @@ -150,11 +151,6 @@ func MakeTaskRunStatus(ctx context.Context, logger *zap.SugaredLogger, tr v1.Tas sidecarStatuses = append(sidecarStatuses, s) } } - for _, s := range pod.Status.InitContainerStatuses { - if IsContainerSidecar(s.Name) { - sidecarStatuses = append(sidecarStatuses, s) - } - } var merr *multierror.Error if err := setTaskRunStatusBasedOnStepStatus(ctx, logger, stepStatuses, &tr, pod.Status.Phase, kubeclient, ts); err != nil { @@ -184,18 +180,9 @@ func createTaskResultsFromStepResults(stepRunRes []v1.TaskRunStepResult, neededS return taskResults } -func setTaskRunArtifactsFromRunResult(runResults []result.RunResult, artifacts *v1.Artifacts) error { - for _, slr := range runResults { - if slr.ResultType == result.TaskRunArtifactsResultType { - return json.Unmarshal([]byte(slr.Value), artifacts) - } - } - return nil -} - -func getTaskResultsFromSidecarLogs(runResults []result.RunResult) []result.RunResult { +func getTaskResultsFromSidecarLogs(sidecarLogResults []result.RunResult) []result.RunResult { taskResultsFromSidecarLogs := []result.RunResult{} - for _, slr := range runResults { + for _, slr := range sidecarLogResults { if slr.ResultType == result.TaskRunResultType { taskResultsFromSidecarLogs = append(taskResultsFromSidecarLogs, slr) } @@ -235,33 +222,20 @@ func setTaskRunStatusBasedOnStepStatus(ctx context.Context, logger *zap.SugaredL // Extract results from sidecar logs sidecarLogsResultsEnabled := config.FromContextOrDefaults(ctx).FeatureFlags.ResultExtractionMethod == config.ResultExtractionMethodSidecarLogs - // temporary solution to check if artifacts sidecar created in taskRun as we don't have the api for users to declare if a step/task is producing artifacts yet - artifactsSidecarCreated := artifactsPathReferenced(ts.Steps) sidecarLogResults := []result.RunResult{} - - if sidecarLogsResultsEnabled { + if sidecarLogsResultsEnabled && tr.Status.TaskSpec.Results != nil { // extraction of results from sidecar logs - if tr.Status.TaskSpec.Results != nil || artifactsSidecarCreated { - slr, err := sidecarlogresults.GetResultsFromSidecarLogs(ctx, kubeclient, tr.Namespace, tr.Status.PodName, pipeline.ReservedResultsSidecarContainerName, podPhase) - if err != nil { - merr = multierror.Append(merr, err) - } - sidecarLogResults = append(sidecarLogResults, slr...) + slr, err := sidecarlogresults.GetResultsFromSidecarLogs(ctx, kubeclient, tr.Namespace, tr.Status.PodName, pipeline.ReservedResultsSidecarContainerName, podPhase) + if err != nil { + merr = multierror.Append(merr, err) } + sidecarLogResults = append(sidecarLogResults, slr...) } // Populate Task results from sidecar logs taskResultsFromSidecarLogs := getTaskResultsFromSidecarLogs(sidecarLogResults) taskResults, _, _ := filterResults(taskResultsFromSidecarLogs, specResults, nil) if tr.IsDone() { trs.Results = append(trs.Results, taskResults...) - var tras v1.Artifacts - err := setTaskRunArtifactsFromRunResult(sidecarLogResults, &tras) - if err != nil { - logger.Errorf("Failed to set artifacts value from sidecar logs: %v", err) - merr = multierror.Append(merr, err) - } else { - trs.Artifacts = &tras - } } // Continue with extraction of termination messages @@ -296,28 +270,27 @@ func setTaskRunStatusBasedOnStepStatus(ctx context.Context, logger *zap.SugaredL // Set TaskResults from StepResults trs.Results = append(trs.Results, createTaskResultsFromStepResults(stepRunRes, neededStepResults)...) } - var sas v1.Artifacts - - err = setStepArtifactsValueFromSidecarLogResult(sidecarLogResults, s.Name, &sas) - if err != nil { - logger.Errorf("Failed to set artifacts value from sidecar logs: %v", err) - merr = multierror.Append(merr, err) - } // Parse termination messages terminationReason := "" + var as v1.Artifacts if state.Terminated != nil && len(state.Terminated.Message) != 0 { msg := state.Terminated.Message results, err := termination.ParseMessage(logger, msg) if err != nil { - logger.Errorf("termination message could not be parsed sas JSON: %v", err) + logger.Errorf("termination message could not be parsed as JSON: %v", err) merr = multierror.Append(merr, err) } else { - err := setStepArtifactsValueFromTerminationMessageRunResult(results, &sas) - if err != nil { - logger.Errorf("error setting step artifacts of step %q in taskrun %q: %v", s.Name, tr.Name, err) - merr = multierror.Append(merr, err) + for _, r := range results { + if r.ResultType == result.ArtifactsResultType { + if err := json.Unmarshal([]byte(r.Value), &as); err != nil { + logger.Errorf("result value could not be parsed as Artifacts: %v", err) + merr = multierror.Append(merr, err) + } + // there should be only one ArtifactsResult + break + } } time, err := extractStartedAtTimeFromResults(results) if err != nil { @@ -336,15 +309,6 @@ func setTaskRunStatusBasedOnStepStatus(ctx context.Context, logger *zap.SugaredL // Set TaskResults from StepResults taskResults = append(taskResults, createTaskResultsFromStepResults(stepRunRes, neededStepResults)...) trs.Results = append(trs.Results, taskResults...) - - var tras v1.Artifacts - err := setTaskRunArtifactsFromRunResult(filteredResults, &tras) - if err != nil { - logger.Errorf("error setting step artifacts in taskrun %q: %v", tr.Name, err) - merr = multierror.Append(merr, err) - } - trs.Artifacts.Merge(&tras) - trs.Artifacts.Merge(&sas) } msg, err = createMessageFromResults(filteredResults) if err != nil { @@ -364,51 +328,21 @@ func setTaskRunStatusBasedOnStepStatus(ctx context.Context, logger *zap.SugaredL terminationReason = getTerminationReason(state.Terminated.Reason, terminationFromResults, exitCode) } } - stepState := v1.StepState{ + trs.Steps = append(trs.Steps, v1.StepState{ ContainerState: *state, - Name: TrimStepPrefix(s.Name), + Name: trimStepPrefix(s.Name), Container: s.Name, ImageID: s.ImageID, Results: taskRunStepResults, TerminationReason: terminationReason, - Inputs: sas.Inputs, - Outputs: sas.Outputs, - } - foundStep := false - for i, ss := range trs.Steps { - if ss.Name == stepState.Name { - stepState.Provenance = ss.Provenance - trs.Steps[i] = stepState - foundStep = true - break - } - } - if !foundStep { - trs.Steps = append(trs.Steps, stepState) - } + Inputs: as.Inputs, + Outputs: as.Outputs, + }) } return merr } -func setStepArtifactsValueFromSidecarLogResult(results []result.RunResult, name string, artifacts *v1.Artifacts) error { - for _, r := range results { - if r.Key == name && r.ResultType == result.StepArtifactsResultType { - return json.Unmarshal([]byte(r.Value), artifacts) - } - } - return nil -} - -func setStepArtifactsValueFromTerminationMessageRunResult(results []result.RunResult, artifacts *v1.Artifacts) error { - for _, r := range results { - if r.ResultType == result.StepArtifactsResultType { - return json.Unmarshal([]byte(r.Value), artifacts) - } - } - return nil -} - func setTaskRunStatusBasedOnSidecarStatus(sidecarStatuses []corev1.ContainerStatus, trs *v1.TaskRunStatus) { for _, s := range sidecarStatuses { trs.Sidecars = append(trs.Sidecars, v1.SidecarState{ @@ -514,10 +448,7 @@ func filterResults(results []result.RunResult, specResults []v1.TaskResult, step } taskRunStepResults = append(taskRunStepResults, taskRunStepResult) filteredResults = append(filteredResults, r) - case result.StepArtifactsResultType: - filteredResults = append(filteredResults, r) - continue - case result.TaskRunArtifactsResultType: + case result.ArtifactsResultType: filteredResults = append(filteredResults, r) continue case result.InternalTektonResultType: @@ -567,11 +498,11 @@ func extractExitCodeFromResults(results []result.RunResult) (*int32, error) { for _, result := range results { if result.Key == "ExitCode" { // We could just pass the string through but this provides extra validation - i, err := strconv.ParseInt(result.Value, 10, 32) + i, err := strconv.ParseUint(result.Value, 10, 32) if err != nil { return nil, fmt.Errorf("could not parse int value %q in ExitCode field: %w", result.Value, err) } - exitCode := int32(i) // #nosec G115: ParseInt was called with bit size 32, so this is safe + exitCode := int32(i) return &exitCode, nil } } @@ -635,30 +566,6 @@ func updateIncompleteTaskRunStatus(trs *v1.TaskRunStatus, pod *corev1.Pod) { } } -// isPodCompleted checks if the given pod is completed. -// A pod is considered completed if its phase is either "Succeeded" or "Failed". -// -// If it is foreseeable that the pod will eventually be in a failed state, -// but it remains in a Running status for a visible period of time, it should be considered completed in advance. -// -// For example, when certain steps encounter OOM, only the pods that have timed out will change to a failed state, -// we should consider them completed in advance. -func isPodCompleted(pod *corev1.Pod) bool { - if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed { - return true - } - for _, s := range pod.Status.ContainerStatuses { - if IsContainerStep(s.Name) { - if s.State.Terminated != nil { - if isOOMKilled(s) { - return true - } - } - } - } - return false -} - // DidTaskRunFail check the status of pod to decide if related taskrun is failed func DidTaskRunFail(pod *corev1.Pod) bool { if pod.Status.Phase == corev1.PodFailed { diff --git a/upstream/pkg/pod/status_test.go b/upstream/pkg/pod/status_test.go index eb5a4695a33..681e50ca114 100644 --- a/upstream/pkg/pod/status_test.go +++ b/upstream/pkg/pod/status_test.go @@ -47,15 +47,14 @@ func TestSetTaskRunStatusBasedOnStepStatus(t *testing.T) { ContainerStatuses []corev1.ContainerStatus }{{ desc: "test result with large pipeline result", - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "step-bar-0", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234","resourceName":"source-image"}]`, - }, + ContainerStatuses: []corev1.ContainerStatus{{ + Name: "step-bar-0", + State: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234","resourceName":"source-image"}]`, }, }, + }, { Name: "step-bar1", State: corev1.ContainerState{ @@ -71,8 +70,7 @@ func TestSetTaskRunStatusBasedOnStepStatus(t *testing.T) { Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234` + strings.Repeat("a", 3072) + `","resourceName":"source-image"}]`, }, }, - }, - }, + }}, }, { desc: "The ExitCode in the result cannot modify the original ExitCode", ContainerStatuses: []corev1.ContainerStatus{{ @@ -118,87 +116,36 @@ func TestSetTaskRunStatusBasedOnStepStatus(t *testing.T) { func TestSetTaskRunStatusBasedOnStepStatus_sidecar_logs(t *testing.T) { for _, c := range []struct { - desc string - maxResultSize int - wantErr error - enableArtifacts bool - tr v1.TaskRun + desc string + maxResultSize int + wantErr error }{{ - desc: "test result with sidecar logs too large", - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - TaskSpec: &v1.TaskSpec{ - Results: []v1.TaskResult{{ - Name: "result1", - }}, - }, - PodName: "task-run-pod", - }, - }, - }, + desc: "test result with sidecar logs too large", maxResultSize: 1, wantErr: sidecarlogresults.ErrSizeExceeded, }, { - desc: "test result with sidecar logs bad format", - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - TaskSpec: &v1.TaskSpec{ - Results: []v1.TaskResult{{ - Name: "result1", - }}, - }, - PodName: "task-run-pod", - }, - }, - }, + desc: "test result with sidecar logs bad format", maxResultSize: 4096, wantErr: fmt.Errorf("%s", "invalid result \"\": invalid character 'k' in literal false (expecting 'l')"), - }, { - desc: "test artifact with sidecar logs too large", - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - TaskSpec: &v1.TaskSpec{}, - PodName: "task-run-pod", - }, - }, - }, - maxResultSize: 1, - wantErr: sidecarlogresults.ErrSizeExceeded, - enableArtifacts: true, - }, { - desc: "test artifact with sidecar logs bad format", - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - TaskSpec: &v1.TaskSpec{}, - PodName: "task-run-pod", - }, - }, - }, - maxResultSize: 4096, - wantErr: fmt.Errorf("%s", "invalid result \"\": invalid character 'k' in literal false (expecting 'l')"), - enableArtifacts: true, }} { t.Run(c.desc, func(t *testing.T) { + tr := v1.TaskRun{ + ObjectMeta: metav1.ObjectMeta{ + Name: "task-run", + Namespace: "foo", + }, + Status: v1.TaskRunStatus{ + TaskRunStatusFields: v1.TaskRunStatusFields{ + TaskSpec: &v1.TaskSpec{ + Results: []v1.TaskResult{{ + Name: "result1", + }}, + }, + PodName: "task-run-pod", + }, + }, + } + logger, _ := logging.NewLogger("", "status") kubeclient := fakek8s.NewSimpleClientset() pod := &corev1.Pod{ @@ -226,21 +173,15 @@ func TestSetTaskRunStatusBasedOnStepStatus_sidecar_logs(t *testing.T) { if err != nil { t.Errorf("Error occurred while creating pod %s: %s", pod.Name, err.Error()) } - featureFlags := &config.FeatureFlags{ - ResultExtractionMethod: config.ResultExtractionMethodSidecarLogs, - MaxResultSize: c.maxResultSize, - } - ts := &v1.TaskSpec{} - if c.enableArtifacts { - featureFlags.EnableArtifacts = true - ts.Steps = []v1.Step{{Name: "name", Script: `echo aaa >> /tekton/steps/step-name/artifacts/provenance.json`}} - } ctx := config.ToContext(context.Background(), &config.Config{ - FeatureFlags: featureFlags, + FeatureFlags: &config.FeatureFlags{ + ResultExtractionMethod: config.ResultExtractionMethodSidecarLogs, + MaxResultSize: c.maxResultSize, + }, }) var wantErr *multierror.Error wantErr = multierror.Append(wantErr, c.wantErr) - merr := setTaskRunStatusBasedOnStepStatus(ctx, logger, []corev1.ContainerStatus{{}}, &c.tr, pod.Status.Phase, kubeclient, ts) + merr := setTaskRunStatusBasedOnStepStatus(ctx, logger, []corev1.ContainerStatus{{}}, &tr, pod.Status.Phase, kubeclient, &v1.TaskSpec{}) if d := cmp.Diff(wantErr.Error(), merr.Error()); d != "" { t.Errorf("Got unexpected error %s", diff.PrintWantGot(d)) @@ -301,8 +242,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"uri","value":"https://foo.bar\n","type":4}]`, - }, - }, + }}, Name: "one", Container: "step-one", Results: []v1.TaskRunStepResult{{ @@ -311,8 +251,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { Value: *v1.NewStructuredValues("https://foo.bar\n"), }}, }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "task-result", Type: v1.ResultsTypeString, @@ -367,8 +306,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"array","value":"[\"hello\",\"world\"]","type":4}]`, - }, - }, + }}, Name: "one", Container: "step-one", Results: []v1.TaskRunStepResult{{ @@ -377,8 +315,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { Value: *v1.NewStructuredValues("hello", "world"), }}, }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeArray, @@ -436,8 +373,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","type":4},{"key":"resultName","value":"resultValue","type":4}]`, - }, - }, + }}, Name: "one", Container: "step-one", Results: []v1.TaskRunStepResult{{ @@ -450,8 +386,7 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { Value: *v1.NewStructuredValues("resultValue"), }}, }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultDigest", Type: v1.ResultsTypeString, @@ -498,179 +433,6 @@ func TestMakeTaskRunStatus_StepResults(t *testing.T) { } } -func TestMakeTaskRunStatus_StepProvenance(t *testing.T) { - for _, c := range []struct { - desc string - podStatus corev1.PodStatus - pod corev1.Pod - tr v1.TaskRun - want v1.TaskRunStatus - }{{ - desc: "provenance in step", - podStatus: corev1.PodStatus{ - Phase: corev1.PodSucceeded, - ContainerStatuses: []corev1.ContainerStatus{{ - Name: "step-one", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - }}, - }, - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "one", - Image: "bash", - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "one", - Provenance: &v1.Provenance{RefSource: &v1.RefSource{ - URI: "pkg://foo/bar", - Digest: map[string]string{"sha256": "digest"}, - }}, - }}, - }, - }, - }, - want: v1.TaskRunStatus{ - Status: statusSuccess(), - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - Name: "one", - Container: "step-one", - Results: []v1.TaskRunResult{}, - Provenance: &v1.Provenance{RefSource: &v1.RefSource{ - URI: "pkg://foo/bar", - Digest: map[string]string{"sha256": "digest"}, - }}, - }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, - // We don't actually care about the time, just that it's not nil - CompletionTime: &metav1.Time{Time: time.Now()}, - }, - }, - }, { - desc: "provenance in some steps", - podStatus: corev1.PodStatus{ - Phase: corev1.PodSucceeded, - ContainerStatuses: []corev1.ContainerStatus{{ - Name: "step-one", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - }, { - Name: "step-two", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - }}, - }, - tr: v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "task-run", - Namespace: "foo", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "one", - Image: "bash", - }, { - Name: "two", - Image: "bash", - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "one", - Provenance: &v1.Provenance{RefSource: &v1.RefSource{ - URI: "pkg://foo/bar", - Digest: map[string]string{"sha256": "digest"}, - }}, - }}, - }, - }, - }, - want: v1.TaskRunStatus{ - Status: statusSuccess(), - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - Name: "one", - Container: "step-one", - Results: []v1.TaskRunResult{}, - Provenance: &v1.Provenance{RefSource: &v1.RefSource{ - URI: "pkg://foo/bar", - Digest: map[string]string{"sha256": "digest"}, - }}, - }, { - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, - Name: "two", - Container: "step-two", - Results: []v1.TaskRunResult{}, - }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, - // We don't actually care about the time, just that it's not nil - CompletionTime: &metav1.Time{Time: time.Now()}, - }, - }, - }} { - t.Run(c.desc, func(t *testing.T) { - now := metav1.Now() - if cmp.Diff(c.pod, corev1.Pod{}) == "" { - c.pod = corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "foo", - CreationTimestamp: now, - }, - Status: c.podStatus, - } - } - - logger, _ := logging.NewLogger("", "status") - kubeclient := fakek8s.NewSimpleClientset() - got, err := MakeTaskRunStatus(context.Background(), logger, c.tr, &c.pod, kubeclient, c.tr.Spec.TaskSpec) - if err != nil { - t.Errorf("MakeTaskRunResult: %s", err) - } - - // Common traits, set for test case brevity. - c.want.PodName = "pod" - - ensureTimeNotNil := cmp.Comparer(func(x, y *metav1.Time) bool { - if x == nil { - return y == nil - } - return y != nil - }) - if d := cmp.Diff(c.want, got, ignoreVolatileTime, ensureTimeNotNil); d != "" { - t.Errorf("Diff %s", diff.PrintWantGot(d)) - } - }) - } -} - func TestMakeTaskRunStatus_StepArtifacts(t *testing.T) { for _, c := range []struct { desc string @@ -712,64 +474,34 @@ func TestMakeTaskRunStatus_StepArtifacts(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"/tekton/run/0/status/artifacts/provenance.json","value":"{\n \"inputs\":[\n {\n \"name\":\"input-artifacts\",\n \"values\":[\n {\n \"uri\":\"git:jjjsss\",\n \"digest\":{\n \"sha256\":\"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0\"\n }\n }\n ]\n }\n ],\n \"outputs\":[\n {\n \"name\":\"build-results\",\n \"values\":[\n {\n \"uri\":\"pkg:balba\",\n \"digest\":{\n \"sha256\":\"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48\",\n \"sha1\":\"95588b8f34c31eb7d62c92aaa4e6506639b06ef2\"\n }\n }\n ]\n }\n ]\n}\n","type":5}]`, - }, - }, + }}, Name: "one", Container: "step-one", Inputs: []v1.Artifact{ { Name: "input-artifacts", - Values: []v1.ArtifactValue{ - { - Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, - Uri: "git:jjjsss", - }, + Values: []v1.ArtifactValue{{ + Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, + Uri: "git:jjjsss", + }, }, }, }, Outputs: []v1.Artifact{ { Name: "build-results", - Values: []v1.ArtifactValue{ - { - Digest: map[v1.Algorithm]string{ - "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", - "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - }, - Uri: "pkg:balba", + Values: []v1.ArtifactValue{{ + Digest: map[v1.Algorithm]string{ + "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", + "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", }, + Uri: "pkg:balba", + }, }, }, }, Results: []v1.TaskRunResult{}, }}, - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{ - { - Name: "input-artifacts", - Values: []v1.ArtifactValue{ - { - Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, - Uri: "git:jjjsss", - }, - }, - }, - }, - Outputs: []v1.Artifact{ - { - Name: "build-results", - Values: []v1.ArtifactValue{ - { - Digest: map[v1.Algorithm]string{ - "sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", - "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - }, - Uri: "pkg:balba", - }, - }, - }, - }, - }, Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, @@ -826,6 +558,7 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusRunning(), TaskRunStatusFields: v1.TaskRunStatusFields{ + Steps: []v1.StepState{}, Sidecars: []v1.SidecarState{}, }, }, @@ -853,13 +586,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 123, - }, - }, + }}, Name: "state-name", Container: "step-state-name", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: nil, + Sidecars: []v1.SidecarState{}, }, }, }, { @@ -889,14 +620,12 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 123, - }, - }, + }}, Name: "state-name", Container: "step-state-name", ImageID: "image-id", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: nil, + Sidecars: []v1.SidecarState{}, }, }, }, { @@ -920,14 +649,12 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 0, - }, - }, + }}, Name: "step-push", Container: "step-step-push", ImageID: "image-id", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -981,15 +708,13 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 123, - }, - }, + }}, Name: "failure", Container: "step-failure", ImageID: "image-id", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1003,8 +728,8 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusFailure(v1.TaskRunReasonFailed.String(), "boom"), TaskRunStatusFields: v1.TaskRunStatusFields{ - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Steps: []v1.StepState{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1032,14 +757,12 @@ func TestMakeTaskRunStatus(t *testing.T) { Terminated: &corev1.ContainerStateTerminated{ Reason: "OOMKilled", ExitCode: 0, - }, - }, + }}, Name: "step-push", Container: "step-step-push", ImageID: "image-id", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1050,8 +773,8 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusFailure(v1.TaskRunReasonFailed.String(), "build failed for unspecified reasons."), TaskRunStatusFields: v1.TaskRunStatusFields{ - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Steps: []v1.StepState{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1100,6 +823,7 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusPending("Pending", `pod status "the type":"Unknown"; message: "the message"`), TaskRunStatusFields: v1.TaskRunStatusFields{ + Steps: []v1.StepState{}, Sidecars: []v1.SidecarState{}, }, }, @@ -1112,6 +836,7 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusPending("Pending", "pod status message"), TaskRunStatusFields: v1.TaskRunStatusFields{ + Steps: []v1.StepState{}, Sidecars: []v1.SidecarState{}, }, }, @@ -1121,6 +846,7 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusPending("Pending", "Pending"), TaskRunStatusFields: v1.TaskRunStatusFields{ + Steps: []v1.StepState{}, Sidecars: []v1.SidecarState{}, }, }, @@ -1136,6 +862,7 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusPending(ReasonExceededNodeResources, "TaskRun Pod exceeded available resources"), TaskRunStatusFields: v1.TaskRunStatusFields{ + Steps: []v1.StepState{}, Sidecars: []v1.SidecarState{}, }, }, @@ -1154,8 +881,8 @@ func TestMakeTaskRunStatus(t *testing.T) { want: v1.TaskRunStatus{ Status: statusFailure(ReasonCreateContainerConfigError, "Failed to create pod due to config error"), TaskRunStatusFields: v1.TaskRunStatusFields{ - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Steps: []v1.StepState{}, + Sidecars: []v1.SidecarState{}, }, }, }, { @@ -1312,13 +1039,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:12345","resourceName":"source-image"}]`, - }, - }, + }}, Name: "foo", Container: "step-foo", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1343,13 +1068,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"resultValue","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeString, @@ -1379,13 +1102,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"resultValue","type":1}]`, - }, - }, + }}, Name: "banana", Container: "step-banana", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeString, @@ -1422,21 +1143,18 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"resultNameOne","value":"resultValueOne","type":1},{"key":"resultNameTwo","value":"resultValueTwo","type":1}]`, - }, - }, + }}, Name: "one", Container: "step-one", }, { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"resultNameOne","value":"resultValueThree","type":1},{"key":"resultNameTwo","value":"resultValueTwo","type":1}]`, - }, - }, + }}, Name: "two", Container: "step-two", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultNameOne", Type: v1.ResultsTypeString, @@ -1450,46 +1168,6 @@ func TestMakeTaskRunStatus(t *testing.T) { CompletionTime: &metav1.Time{Time: time.Now()}, }, }, - }, { - desc: "oom occurred in the pod", - podStatus: corev1.PodStatus{ - Phase: corev1.PodRunning, - ContainerStatuses: []corev1.ContainerStatus{{ - Name: "step-one", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - Reason: oomKilled, - ExitCode: 137, - }, - }, - }, { - Name: "step-two", - State: corev1.ContainerState{}, - }}, - }, - want: v1.TaskRunStatus{ - Status: statusFailure(v1.TaskRunReasonFailed.String(), "\"step-one\" exited with code 137"), - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - Reason: oomKilled, - ExitCode: 137, - }, - }, - Name: "one", - Container: "step-one", - }, { - ContainerState: corev1.ContainerState{}, - Name: "two", - Container: "step-two", - }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, - // We don't actually care about the time, just that it's not nil - CompletionTime: &metav1.Time{Time: time.Now()}, - }, - }, }, { desc: "the failed task show task results", podStatus: corev1.PodStatus{ @@ -1516,7 +1194,6 @@ func TestMakeTaskRunStatus(t *testing.T) { Container: "step-task-result", }}, Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, CompletionTime: &metav1.Time{Time: time.Now()}, Results: []v1.TaskRunResult{{ Name: "resultName", @@ -1541,13 +1218,11 @@ func TestMakeTaskRunStatus(t *testing.T) { TaskRunStatusFields: v1.TaskRunStatusFields{ Steps: []v1.StepState{{ ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "mango", Container: "step-mango", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1570,13 +1245,11 @@ func TestMakeTaskRunStatus(t *testing.T) { TaskRunStatusFields: v1.TaskRunStatusFields{ Steps: []v1.StepState{{ ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "pineapple", Container: "step-pineapple", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1589,8 +1262,7 @@ func TestMakeTaskRunStatus(t *testing.T) { Name: "step-pear", State: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ - Message: `[{"key":"resultNameOne","value":"","type":3}, {"key":"resultNameThree","value":"","type":1}]`, - }, + Message: `[{"key":"resultNameOne","value":"","type":3}, {"key":"resultNameThree","value":"","type":1}]`}, }, }}, }, @@ -1601,13 +1273,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"resultNameThree","value":"","type":1}]`, - }, - }, + }}, Name: "pear", Container: "step-pear", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultNameThree", Type: v1.ResultsTypeString, @@ -1637,13 +1307,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"resultNameThree","value":"","type":1}]`, - }, - }, + }}, Name: "pear", Container: "step-pear", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultNameThree", Type: v1.ResultsTypeString, @@ -1713,31 +1381,26 @@ func TestMakeTaskRunStatus(t *testing.T) { Container: "step-first", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "second", Container: "step-second", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "third", Container: "step-third", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "", Container: "step-", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "fourth", Container: "step-fourth", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1788,13 +1451,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 0, - }, - }, + }}, Name: "second", Container: "step-second", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -1862,8 +1523,7 @@ func TestMakeTaskRunStatus(t *testing.T) { State: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 1, - }, - }, + }}, }}, ContainerStatuses: []corev1.ContainerStatus{{ Name: "step-A", @@ -1890,7 +1550,6 @@ func TestMakeTaskRunStatus(t *testing.T) { ImageID: "image-id-A", }}, Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, CompletionTime: &metav1.Time{Time: time.Now()}, }, }, @@ -1913,17 +1572,15 @@ func TestMakeTaskRunStatus(t *testing.T) { Phase: corev1.PodFailed, Reason: "Evicted", Message: `Usage of EmptyDir volume "ws-b6dfk" exceeds the limit "10Gi".`, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "step-A", - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 137, - }, + ContainerStatuses: []corev1.ContainerStatus{{ + Name: "step-A", + State: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + ExitCode: 137, }, }, }, - }, + }}, }, want: v1.TaskRunStatus{ Status: statusFailure(v1.TaskRunReasonFailed.String(), "Usage of EmptyDir volume \"ws-b6dfk\" exceeds the limit \"10Gi\"."), @@ -1932,13 +1589,11 @@ func TestMakeTaskRunStatus(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 137, - }, - }, + }}, Name: "A", Container: "step-A", }}, Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, CompletionTime: &metav1.Time{Time: time.Now()}, }, }, @@ -2230,13 +1885,11 @@ func TestMakeTaskRunStatusAlpha(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeString, @@ -2274,13 +1927,11 @@ func TestMakeTaskRunStatusAlpha(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"hello","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeString, @@ -2318,13 +1969,11 @@ func TestMakeTaskRunStatusAlpha(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"[\"hello\",\"world\"]","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeArray, @@ -2362,13 +2011,11 @@ func TestMakeTaskRunStatusAlpha(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"digest","value":"sha256:1234","resourceName":"source-image"},{"key":"resultName","value":"{\"hello\":\"world\"}","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeObject, @@ -2410,13 +2057,11 @@ func TestMakeTaskRunStatusAlpha(t *testing.T) { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ Message: `[{"key":"resultName","value":"{\"hello\":\"world\"}","type":1},{"key":"resultName2","value":"[\"hello\",\"world\"]","type":1}]`, - }, - }, + }}, Name: "bar", Container: "step-bar", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, Results: []v1.TaskRunResult{{ Name: "resultName", Type: v1.ResultsTypeString, @@ -2546,39 +2191,34 @@ func TestMakeRunStatusJSONError(t *testing.T) { Terminated: &corev1.ContainerStateTerminated{ ExitCode: 1, Message: "this is a non-json termination message. dont panic!", - }, - }, + }}, Name: "non-json", Container: "step-non-json", Results: []v1.TaskRunResult{}, ImageID: "image", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "after-non-json", Container: "step-after-non-json", Results: []v1.TaskRunResult{}, ImageID: "image", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "this-step-might-panic", Container: "step-this-step-might-panic", Results: []v1.TaskRunResult{}, ImageID: "image", }, { ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{}, - }, + Terminated: &corev1.ContainerStateTerminated{}}, Name: "foo", Container: "step-foo", Results: []v1.TaskRunResult{}, ImageID: "image", }}, - Sidecars: []v1.SidecarState{}, - Artifacts: &v1.Artifacts{}, + Sidecars: []v1.SidecarState{}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, }, @@ -2769,12 +2409,10 @@ func TestIsPodArchived(t *testing.T) { }, { name: "Pod is in the retriesStatus", podName: "pod", - retriesStatus: []v1.TaskRunStatus{ - { - TaskRunStatusFields: v1.TaskRunStatusFields{ - PodName: "pod", - }, - }, + retriesStatus: []v1.TaskRunStatus{{ + TaskRunStatusFields: v1.TaskRunStatusFields{ + PodName: "pod", + }}, }, want: true, }} { @@ -2923,7 +2561,7 @@ func TestGetStepResultsFromSidecarLogs(t *testing.T) { t.Errorf("did not expect an error but got: %v", err) } if d := cmp.Diff(want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } @@ -2938,7 +2576,7 @@ func TestGetStepResultsFromSidecarLogs_Error(t *testing.T) { _, err := getStepResultsFromSidecarLogs(sidecarLogResults, stepName) wantErr := fmt.Errorf("invalid string %s-%s : expected somtthing that looks like .", stepName, resultName) if d := cmp.Diff(wantErr.Error(), err.Error()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } @@ -3162,6 +2800,6 @@ func TestGetTaskResultsFromSidecarLogs(t *testing.T) { }} got := getTaskResultsFromSidecarLogs(sidecarLogResults) if d := cmp.Diff(want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } diff --git a/upstream/pkg/pod/workingdir_init.go b/upstream/pkg/pod/workingdir_init.go index 65da50b01e3..af001dc104d 100644 --- a/upstream/pkg/pod/workingdir_init.go +++ b/upstream/pkg/pod/workingdir_init.go @@ -60,9 +60,9 @@ func workingDirInit(workingdirinitImage string, stepContainers []corev1.Containe // There are no workingDirs to initialize. return nil } - securityContext := LinuxSecurityContext + securityContext := linuxSecurityContext if windows { - securityContext = WindowsSecurityContext + securityContext = windowsSecurityContext } c := &corev1.Container{ diff --git a/upstream/pkg/pod/workingdir_init_test.go b/upstream/pkg/pod/workingdir_init_test.go index c4a7b3b723d..05f1f65f133 100644 --- a/upstream/pkg/pod/workingdir_init_test.go +++ b/upstream/pkg/pod/workingdir_init_test.go @@ -90,7 +90,7 @@ func TestWorkingDirInit(t *testing.T) { Args: []string{"/workspace/bbb", "aaa", "zzz"}, WorkingDir: pipeline.WorkspaceDir, VolumeMounts: implicitVolumeMounts, - SecurityContext: LinuxSecurityContext, + SecurityContext: linuxSecurityContext, }, }, { desc: "workingDirs are unique and sorted, absolute dirs are ignored, uses windows", @@ -144,7 +144,7 @@ func TestWorkingDirInit(t *testing.T) { Args: []string{"/workspace/bbb", "aaa", "zzz"}, WorkingDir: pipeline.WorkspaceDir, VolumeMounts: implicitVolumeMounts, - SecurityContext: WindowsSecurityContext, + SecurityContext: windowsSecurityContext, }, }} { t.Run(c.desc, func(t *testing.T) { diff --git a/upstream/pkg/reconciler/apiserver/apiserver.go b/upstream/pkg/reconciler/apiserver/apiserver.go index 336774a5706..8489f6e12af 100644 --- a/upstream/pkg/reconciler/apiserver/apiserver.go +++ b/upstream/pkg/reconciler/apiserver/apiserver.go @@ -25,7 +25,7 @@ var ( // DryRunValidate validates the obj by issuing a dry-run create request for it in the given namespace. // This allows validating admission webhooks to process the object without actually creating it. // obj must be a v1/v1beta1 Task or Pipeline. -func DryRunValidate(ctx context.Context, namespace string, obj runtime.Object, tekton clientset.Interface) (runtime.Object, error) { +func DryRunValidate(ctx context.Context, namespace string, obj runtime.Object, tekton clientset.Interface) error { dryRunObjName := uuid.NewString() // Use a randomized name for the Pipeline/Task in case there is already another Pipeline/Task of the same name switch obj := obj.(type) { @@ -33,61 +33,42 @@ func DryRunValidate(ctx context.Context, namespace string, obj runtime.Object, t dryRunObj := obj.DeepCopy() dryRunObj.Name = dryRunObjName dryRunObj.Namespace = namespace // Make sure the namespace is the same as the PipelineRun - mutatedObj, err := tekton.TektonV1().Pipelines(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) + if _, err := tekton.TektonV1().Pipelines(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}); err != nil { + return handleDryRunCreateErr(err, obj.Name) } - return mutatedObj, nil case *v1beta1.Pipeline: dryRunObj := obj.DeepCopy() dryRunObj.Name = dryRunObjName dryRunObj.Namespace = namespace // Make sure the namespace is the same as the PipelineRun - mutatedObj, err := tekton.TektonV1beta1().Pipelines(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) + if _, err := tekton.TektonV1beta1().Pipelines(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}); err != nil { + return handleDryRunCreateErr(err, obj.Name) } - return mutatedObj, nil + case *v1.Task: dryRunObj := obj.DeepCopy() dryRunObj.Name = dryRunObjName dryRunObj.Namespace = namespace // Make sure the namespace is the same as the TaskRun - mutatedObj, err := tekton.TektonV1().Tasks(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) + if _, err := tekton.TektonV1().Tasks(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}); err != nil { + return handleDryRunCreateErr(err, obj.Name) } - return mutatedObj, nil case *v1beta1.Task: dryRunObj := obj.DeepCopy() dryRunObj.Name = dryRunObjName dryRunObj.Namespace = namespace // Make sure the namespace is the same as the TaskRun - mutatedObj, err := tekton.TektonV1beta1().Tasks(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) + if _, err := tekton.TektonV1beta1().Tasks(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}); err != nil { + return handleDryRunCreateErr(err, obj.Name) } - return mutatedObj, nil case *v1alpha1.StepAction: dryRunObj := obj.DeepCopy() dryRunObj.Name = dryRunObjName dryRunObj.Namespace = namespace // Make sure the namespace is the same as the StepAction - mutatedObj, err := tekton.TektonV1alpha1().StepActions(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) + if _, err := tekton.TektonV1alpha1().StepActions(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}); err != nil { + return handleDryRunCreateErr(err, obj.Name) } - return mutatedObj, nil - - case *v1beta1.StepAction: - dryRunObj := obj.DeepCopy() - dryRunObj.Name = dryRunObjName - dryRunObj.Namespace = namespace // Make sure the namespace is the same as the StepAction - mutatedObj, err := tekton.TektonV1beta1().StepActions(namespace).Create(ctx, dryRunObj, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) - if err != nil { - return nil, handleDryRunCreateErr(err, obj.Name) - } - return mutatedObj, nil - default: - return nil, fmt.Errorf("unsupported object GVK %s", obj.GetObjectKind().GroupVersionKind()) + return fmt.Errorf("unsupported object GVK %s", obj.GetObjectKind().GroupVersionKind()) } + return nil } func handleDryRunCreateErr(err error, objectName string) error { diff --git a/upstream/pkg/reconciler/apiserver/apiserver_test.go b/upstream/pkg/reconciler/apiserver/apiserver_test.go index 06f91abd8c5..7233a145d27 100644 --- a/upstream/pkg/reconciler/apiserver/apiserver_test.go +++ b/upstream/pkg/reconciler/apiserver/apiserver_test.go @@ -12,7 +12,6 @@ import ( "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake" "github.com/tektoncd/pipeline/pkg/reconciler/apiserver" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" @@ -24,47 +23,33 @@ func TestDryRunCreate_Valid_DifferentGVKs(t *testing.T) { name string obj runtime.Object wantErr bool - wantObj runtime.Object }{{ - name: "v1 task", - obj: &v1.Task{}, - wantObj: &v1.Task{}, + name: "v1 task", + obj: &v1.Task{}, }, { - name: "v1beta1 task", - obj: &v1beta1.Task{}, - wantObj: &v1beta1.Task{}, - }, { - name: "v1 pipeline", - obj: &v1.Pipeline{}, - wantObj: &v1.Pipeline{}, + name: "v1beta1 task", + obj: &v1beta1.Task{}, }, { - name: "v1beta1 pipeline", - obj: &v1beta1.Pipeline{}, - wantObj: &v1beta1.Pipeline{}, + name: "v1 pipeline", + obj: &v1.Pipeline{}, }, { - name: "v1alpha1 stepaction", - obj: &v1alpha1.StepAction{}, - wantObj: &v1alpha1.StepAction{}, + name: "v1beta1 pipeline", + obj: &v1beta1.Pipeline{}, }, { - name: "v1beta1 stepaction", - obj: &v1beta1.StepAction{}, - wantObj: &v1beta1.StepAction{}, + name: "v1alpha1 stepaction", + obj: &v1alpha1.StepAction{}, }, { name: "unsupported gvk", obj: &v1beta1.ClusterTask{}, wantErr: true, - wantObj: nil, }} for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tektonclient := fake.NewSimpleClientset() - mutatedObj, err := apiserver.DryRunValidate(context.Background(), "default", tc.obj, tektonclient) + err := apiserver.DryRunValidate(context.Background(), "default", tc.obj, tektonclient) if (err != nil) != tc.wantErr { t.Errorf("wantErr was %t but got err %v", tc.wantErr, err) } - if d := cmp.Diff(tc.wantObj, mutatedObj, cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name", "Namespace")); d != "" { - t.Errorf("wrong object: %s", d) - } }) } } @@ -94,10 +79,6 @@ func TestDryRunCreate_Invalid_DifferentGVKs(t *testing.T) { name: "v1alpha1 stepaction", obj: &v1alpha1.StepAction{}, wantErr: apiserver.ErrReferencedObjectValidationFailed, - }, { - name: "v1beta1 stepaction", - obj: &v1beta1.StepAction{}, - wantErr: apiserver.ErrReferencedObjectValidationFailed, }, { name: "unsupported gvk", obj: &v1beta1.ClusterTask{}, @@ -115,7 +96,7 @@ func TestDryRunCreate_Invalid_DifferentGVKs(t *testing.T) { tektonclient.PrependReactor("create", "stepactions", func(action ktesting.Action) (bool, runtime.Object, error) { return true, nil, apierrors.NewBadRequest("bad request") }) - _, err := apiserver.DryRunValidate(context.Background(), "default", tc.obj, tektonclient) + err := apiserver.DryRunValidate(context.Background(), "default", tc.obj, tektonclient) if d := cmp.Diff(tc.wantErr, err, cmpopts.EquateErrors()); d != "" { t.Errorf("wrong error: %s", d) } @@ -162,7 +143,7 @@ func TestDryRunCreate_DifferentErrTypes(t *testing.T) { tektonclient.PrependReactor("create", "tasks", func(action ktesting.Action) (bool, runtime.Object, error) { return true, nil, tc.webhookErr }) - _, err := apiserver.DryRunValidate(context.Background(), "default", &v1.Task{}, tektonclient) + err := apiserver.DryRunValidate(context.Background(), "default", &v1.Task{}, tektonclient) if d := cmp.Diff(tc.wantErr, err, cmpopts.EquateErrors()); d != "" { t.Errorf("wrong error: %s", d) } diff --git a/upstream/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go b/upstream/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go index 907e032601b..f44e0a7c96c 100644 --- a/upstream/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go +++ b/upstream/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go @@ -106,7 +106,7 @@ func TestSendCloudEventWithRetries(t *testing.T) { ceClient.CheckCloudEventsUnordered(t, tc.name, tc.wantCEvents) recorder := controller.GetEventRecorder(ctx).(*record.FakeRecorder) if err := k8sevent.CheckEventsOrdered(t, recorder.Events, tc.name, tc.wantEvents); err != nil { - t.Fatal(err.Error()) + t.Fatalf(err.Error()) } }) } @@ -223,7 +223,7 @@ func TestEmitCloudEvents(t *testing.T) { recorder := controller.GetEventRecorder(ctx).(*record.FakeRecorder) cloudevent.EmitCloudEvents(ctx, object) if err := k8sevent.CheckEventsOrdered(t, recorder.Events, tc.name, tc.wantEvents); err != nil { - t.Fatal(err.Error()) + t.Fatalf(err.Error()) } fakeClient.CheckCloudEventsUnordered(t, tc.name, tc.wantCloudEvents) } diff --git a/upstream/pkg/reconciler/events/cloudevent/cloudeventsfakeclient.go b/upstream/pkg/reconciler/events/cloudevent/cloudeventsfakeclient.go index 4eabf274194..92692943918 100644 --- a/upstream/pkg/reconciler/events/cloudevent/cloudeventsfakeclient.go +++ b/upstream/pkg/reconciler/events/cloudevent/cloudeventsfakeclient.go @@ -111,7 +111,7 @@ func (c *FakeClient) CheckCloudEventsUnordered(t *testing.T, testName string, wa // extra events are prevented in FakeClient's Send function. // fewer events are detected because we collect all events from channel and compare with wantEvents - for range channelEvents { + for eventCount := 0; eventCount < channelEvents; eventCount++ { event := <-c.events if len(expected) == 0 { t.Errorf("extra event received: %q", event) diff --git a/upstream/pkg/reconciler/events/event_test.go b/upstream/pkg/reconciler/events/event_test.go index ca0135a4ae4..5e790d347cd 100644 --- a/upstream/pkg/reconciler/events/event_test.go +++ b/upstream/pkg/reconciler/events/event_test.go @@ -109,7 +109,7 @@ func TestEmit(t *testing.T) { recorder := controller.GetEventRecorder(ctx).(*record.FakeRecorder) events.Emit(ctx, nil, after, object) if err := k8sevent.CheckEventsOrdered(t, recorder.Events, tc.name, tc.wantEvents); err != nil { - t.Fatal(err.Error()) + t.Fatalf(err.Error()) } fakeClient.CheckCloudEventsUnordered(t, tc.name, tc.wantCloudEvents) } diff --git a/upstream/pkg/reconciler/events/k8sevent/event_test.go b/upstream/pkg/reconciler/events/k8sevent/event_test.go index db4f4fd2016..612c4177a31 100644 --- a/upstream/pkg/reconciler/events/k8sevent/event_test.go +++ b/upstream/pkg/reconciler/events/k8sevent/event_test.go @@ -180,7 +180,7 @@ func TestEmitK8sEventsOnConditions(t *testing.T) { k8sevents.EmitK8sEvents(ctx, ts.before, ts.after, tr) err := k8sevents.CheckEventsOrdered(t, recorder.Events, ts.name, ts.wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } } } @@ -237,7 +237,7 @@ func TestEmitK8sEvents(t *testing.T) { recorder := controller.GetEventRecorder(ctx).(*record.FakeRecorder) k8sevents.EmitK8sEvents(ctx, nil, after, object) if err := k8sevents.CheckEventsOrdered(t, recorder.Events, tc.name, tc.wantEvents); err != nil { - t.Fatal(err.Error()) + t.Fatalf(err.Error()) } } } @@ -263,7 +263,7 @@ func TestEmitError(t *testing.T) { k8sevents.EmitError(fr, ts.err, tr) err := k8sevents.CheckEventsOrdered(t, fr.Events, ts.name, ts.wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } } } diff --git a/upstream/pkg/reconciler/events/k8sevent/events.go b/upstream/pkg/reconciler/events/k8sevent/events.go index 048308de881..3b35370cea2 100644 --- a/upstream/pkg/reconciler/events/k8sevent/events.go +++ b/upstream/pkg/reconciler/events/k8sevent/events.go @@ -46,7 +46,7 @@ func eventsFromChannel(c chan string, wantEvents []string) error { // on the channel forever if fewer than expected events are received timer := time.After(wait.ForeverTestTimeout) foundEvents := []string{} - for ii := range wantEvents { + for ii := 0; ii < len(wantEvents); ii++ { // We loop over all the events that we expect. Once they are all received // we exit the loop. If we never receive enough events, the timeout takes us // out of the loop. diff --git a/upstream/pkg/reconciler/pipeline/dag/dag_test.go b/upstream/pkg/reconciler/pipeline/dag/dag_test.go index bf85b7d4f59..056f5b73a39 100644 --- a/upstream/pkg/reconciler/pipeline/dag/dag_test.go +++ b/upstream/pkg/reconciler/pipeline/dag/dag_test.go @@ -219,8 +219,7 @@ func TestBuild_JoinMultipleRoots(t *testing.T) { "c": nodeC, "x": nodeX, "y": nodeY, - "z": nodeZ, - }, + "z": nodeZ}, } p := &v1.Pipeline{ ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, @@ -545,76 +544,75 @@ func TestBuild_InvalidDAG(t *testing.T) { name string spec v1.PipelineSpec err string - }{ - { - // a - // | - // a ("a" uses result of "a" as params) - name: "self-link-result", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{selfLinkResult}}, - err: "cycle detected", - }, { - // a - // | - // a ("a" runAfter "a") - name: "self-link-after", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{selfLinkAfter}}, - err: "cycle detected", - }, { - // a (also "a" depends on resource from "z") - // | - // x ("x" depends on resource from "a") - // | - // z ("z" depends on resource from "x") - name: "cycle-from", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xDependsOnA, zDependsOnX, aDependsOnZ}}, - err: "cycle detected", - }, { - // a (also "a" runAfter "z") - // | - // x ("x" runAfter "a") - // | - // z ("z" runAfter "x") - name: "cycle-runAfter", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xAfterA, zAfterX, aAfterZ}}, - err: "cycle detected", - }, { - // a (also "a" depends on resource from "z") - // | - // x ("x" depends on resource from "a") - // | - // z ("z" runAfter "x") - name: "cycle-both", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xDependsOnA, zAfterX, aDependsOnZ}}, - err: "cycle detected", - }, { - // This test make sure we detect a cyclic branch in a DAG with multiple branches. - // The following DAG is having a cyclic branch with an additional dependency (a runAfter e) - // a - // / \ - // b c - // \ / - // d - // / \ - // e f - // | - // g - name: "multiple-branches-with-one-cyclic-branch", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{aRunsAfterE, bDependsOnA, cRunsAfterA, dDependsOnBAndC, eRunsAfterD, fRunsAfterD, gDependsOnF}}, - err: "cycle detected", - }, { - name: "duplicate-tasks", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{a, a}}, - err: "duplicate pipeline task", - }, { - name: "invalid-task-result", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{invalidTaskResult}}, - err: "wasn't present in Pipeline", - }, { - name: "invalid-task-name-after", - spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{invalidTaskAfter}}, - err: "wasn't present in Pipeline", - }, + }{{ + // a + // | + // a ("a" uses result of "a" as params) + name: "self-link-result", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{selfLinkResult}}, + err: "cycle detected", + }, { + // a + // | + // a ("a" runAfter "a") + name: "self-link-after", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{selfLinkAfter}}, + err: "cycle detected", + }, { + // a (also "a" depends on resource from "z") + // | + // x ("x" depends on resource from "a") + // | + // z ("z" depends on resource from "x") + name: "cycle-from", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xDependsOnA, zDependsOnX, aDependsOnZ}}, + err: "cycle detected", + }, { + // a (also "a" runAfter "z") + // | + // x ("x" runAfter "a") + // | + // z ("z" runAfter "x") + name: "cycle-runAfter", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xAfterA, zAfterX, aAfterZ}}, + err: "cycle detected", + }, { + // a (also "a" depends on resource from "z") + // | + // x ("x" depends on resource from "a") + // | + // z ("z" runAfter "x") + name: "cycle-both", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{xDependsOnA, zAfterX, aDependsOnZ}}, + err: "cycle detected", + }, { + // This test make sure we detect a cyclic branch in a DAG with multiple branches. + // The following DAG is having a cyclic branch with an additional dependency (a runAfter e) + // a + // / \ + // b c + // \ / + // d + // / \ + // e f + // | + // g + name: "multiple-branches-with-one-cyclic-branch", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{aRunsAfterE, bDependsOnA, cRunsAfterA, dDependsOnBAndC, eRunsAfterD, fRunsAfterD, gDependsOnF}}, + err: "cycle detected", + }, { + name: "duplicate-tasks", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{a, a}}, + err: "duplicate pipeline task", + }, { + name: "invalid-task-result", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{invalidTaskResult}}, + err: "wasn't present in Pipeline", + }, { + name: "invalid-task-name-after", + spec: v1.PipelineSpec{Tasks: []v1.PipelineTask{invalidTaskAfter}}, + err: "wasn't present in Pipeline", + }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { @@ -638,7 +636,7 @@ func TestBuildGraphWithHundredsOfTasks_Success(t *testing.T) { // .. // b04 - 000 - 001 - ... - 100 nBranches, nTasks := 5, 100 - for branchIdx := range nBranches { + for branchIdx := 0; branchIdx < nBranches; branchIdx++ { var taskDeps []string firstTaskName := fmt.Sprintf("b%02d", branchIdx) firstTask := v1.PipelineTask{ @@ -648,7 +646,7 @@ func TestBuildGraphWithHundredsOfTasks_Success(t *testing.T) { } tasks = append(tasks, firstTask) taskDeps = append(taskDeps, firstTaskName) - for taskIdx := range nTasks { + for taskIdx := 0; taskIdx < nTasks; taskIdx++ { taskName := fmt.Sprintf("%s-%03d", firstTaskName, taskIdx) task := v1.PipelineTask{ Name: taskName, @@ -670,7 +668,7 @@ func TestBuildGraphWithHundredsOfTasks_InvalidDAG(t *testing.T) { var tasks []v1.PipelineTask // branches with circular interdependencies nBranches, nTasks := 5, 100 - for branchIdx := range nBranches { + for branchIdx := 0; branchIdx < nBranches; branchIdx++ { depBranchIdx := branchIdx + 1 if depBranchIdx == nBranches { depBranchIdx = 0 @@ -684,7 +682,7 @@ func TestBuildGraphWithHundredsOfTasks_InvalidDAG(t *testing.T) { } tasks = append(tasks, firstTask) taskDeps = append(taskDeps, firstTaskName) - for taskIdx := range nTasks { + for taskIdx := 0; taskIdx < nTasks; taskIdx++ { taskName := fmt.Sprintf("%s-%03d", firstTaskName, taskIdx) task := v1.PipelineTask{ Name: taskName, @@ -801,38 +799,37 @@ func TestFindCyclesInDependencies(t *testing.T) { name string deps map[string][]string err string - }{ - { - name: "valid-empty-deps", - deps: map[string][]string{ - "a": {}, - "b": {"c", "d"}, - "c": {}, - "d": {}, - }, - }, { - name: "self-link", - deps: map[string][]string{ - "a": {"a"}, - }, - err: `task "a" depends on "a"`, - }, { - name: "interdependent-tasks", - deps: map[string][]string{ - "a": {"b"}, - "b": {"a"}, - }, - err: `task "a" depends on "b"`, - }, { - name: "multiple-cycles", - deps: map[string][]string{ - "a": {"b", "c"}, - "b": {"a"}, - "c": {"d"}, - "d": {"a", "b"}, - }, - err: `task "a" depends on "b", "c"`, + }{{ + name: "valid-empty-deps", + deps: map[string][]string{ + "a": {}, + "b": {"c", "d"}, + "c": {}, + "d": {}, + }, + }, { + name: "self-link", + deps: map[string][]string{ + "a": {"a"}, + }, + err: `task "a" depends on "a"`, + }, { + name: "interdependent-tasks", + deps: map[string][]string{ + "a": {"b"}, + "b": {"a"}, + }, + err: `task "a" depends on "b"`, + }, { + name: "multiple-cycles", + deps: map[string][]string{ + "a": {"b", "c"}, + "b": {"a"}, + "c": {"d"}, + "d": {"a", "b"}, }, + err: `task "a" depends on "b", "c"`, + }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { diff --git a/upstream/pkg/reconciler/pipelinerun/affinity_assistant.go b/upstream/pkg/reconciler/pipelinerun/affinity_assistant.go index 94aab0951ab..87ff43fe3b8 100644 --- a/upstream/pkg/reconciler/pipelinerun/affinity_assistant.go +++ b/upstream/pkg/reconciler/pipelinerun/affinity_assistant.go @@ -29,7 +29,6 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/internal/affinityassistant" aa "github.com/tektoncd/pipeline/pkg/internal/affinityassistant" - pipelinePod "github.com/tektoncd/pipeline/pkg/pod" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" "github.com/tektoncd/pipeline/pkg/workspace" appsv1 "k8s.io/api/apps/v1" @@ -140,12 +139,7 @@ func (c *Reconciler) createOrUpdateAffinityAssistant(ctx context.Context, affini if err != nil { return []error{err} } - affinityAssistantContainerConfig := aa.ContainerConfig{ - Image: c.Images.NopImage, - SetSecurityContext: cfg.FeatureFlags.SetSecurityContext, - } - - affinityAssistantStatefulSet := affinityAssistantStatefulSet(aaBehavior, affinityAssistantName, pr, claimTemplates, claimNames, affinityAssistantContainerConfig, cfg.Defaults.DefaultAAPodTemplate) + affinityAssistantStatefulSet := affinityAssistantStatefulSet(aaBehavior, affinityAssistantName, pr, claimTemplates, claimNames, c.Images.NopImage, cfg.Defaults.DefaultAAPodTemplate) _, err = c.KubeClientSet.AppsV1().StatefulSets(pr.Namespace).Create(ctx, affinityAssistantStatefulSet, metav1.CreateOptions{}) if err != nil { errs = append(errs, fmt.Errorf("failed to create StatefulSet %s: %w", affinityAssistantName, err)) @@ -287,7 +281,7 @@ func getStatefulSetLabels(pr *v1.PipelineRun, affinityAssistantName string) map[ // with the given AffinityAssistantTemplate applied to the StatefulSet PodTemplateSpec. // The VolumeClaimTemplates and Volume of StatefulSet reference the PipelineRun WorkspaceBinding VolumeClaimTempalte and the PVCs respectively. // The PVs created by the StatefulSet are scheduled to the same availability zone which avoids PV scheduling conflict. -func affinityAssistantStatefulSet(aaBehavior aa.AffinityAssistantBehavior, name string, pr *v1.PipelineRun, claimTemplates []corev1.PersistentVolumeClaim, claimNames []string, containerConfig aa.ContainerConfig, defaultAATpl *pod.AffinityAssistantTemplate) *appsv1.StatefulSet { +func affinityAssistantStatefulSet(aaBehavior aa.AffinityAssistantBehavior, name string, pr *v1.PipelineRun, claimTemplates []corev1.PersistentVolumeClaim, claimNames []string, affinityAssistantImage string, defaultAATpl *pod.AffinityAssistantTemplate) *appsv1.StatefulSet { // We want a singleton pod replicas := int32(1) @@ -302,23 +296,9 @@ func affinityAssistantStatefulSet(aaBehavior aa.AffinityAssistantBehavior, name mounts = append(mounts, corev1.VolumeMount{Name: claimTemplate.Name, MountPath: claimTemplate.Name}) } - securityContext := &corev1.SecurityContext{} - if containerConfig.SetSecurityContext { - securityContext = pipelinePod.LinuxSecurityContext - - if tpl.NodeSelector[pipelinePod.OsSelectorLabel] == "windows" { - securityContext = pipelinePod.WindowsSecurityContext - } - } - - var priorityClassName string - if tpl.PriorityClassName != nil { - priorityClassName = *tpl.PriorityClassName - } - containers := []corev1.Container{{ Name: "affinity-assistant", - Image: containerConfig.Image, + Image: affinityAssistantImage, Args: []string{"tekton_run_indefinitely"}, // Set requests == limits to get QoS class _Guaranteed_. @@ -334,8 +314,7 @@ func affinityAssistantStatefulSet(aaBehavior aa.AffinityAssistantBehavior, name "memory": resource.MustParse("100Mi"), }, }, - SecurityContext: securityContext, - VolumeMounts: mounts, + VolumeMounts: mounts, }} var volumes []corev1.Volume @@ -380,11 +359,9 @@ func affinityAssistantStatefulSet(aaBehavior aa.AffinityAssistantBehavior, name Spec: corev1.PodSpec{ Containers: containers, - Tolerations: tpl.Tolerations, - NodeSelector: tpl.NodeSelector, - ImagePullSecrets: tpl.ImagePullSecrets, - SecurityContext: tpl.SecurityContext, - PriorityClassName: priorityClassName, + Tolerations: tpl.Tolerations, + NodeSelector: tpl.NodeSelector, + ImagePullSecrets: tpl.ImagePullSecrets, Affinity: getAssistantAffinityMergedWithPodTemplateAffinity(pr, aaBehavior), Volumes: volumes, diff --git a/upstream/pkg/reconciler/pipelinerun/affinity_assistant_test.go b/upstream/pkg/reconciler/pipelinerun/affinity_assistant_test.go index 35c22df73de..d20a18526c0 100644 --- a/upstream/pkg/reconciler/pipelinerun/affinity_assistant_test.go +++ b/upstream/pkg/reconciler/pipelinerun/affinity_assistant_test.go @@ -22,8 +22,6 @@ import ( "fmt" "testing" - "knative.dev/pkg/ptr" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" @@ -32,7 +30,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" aa "github.com/tektoncd/pipeline/pkg/internal/affinityassistant" - pipelinePod "github.com/tektoncd/pipeline/pkg/pod" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" "github.com/tektoncd/pipeline/pkg/workspace" "github.com/tektoncd/pipeline/test/diff" @@ -52,21 +49,11 @@ import ( _ "knative.dev/pkg/system/testing" // Setup system.Namespace() ) -var ( - podSpecFilter cmp.Option = cmpopts.IgnoreFields(corev1.PodSpec{}, "Affinity") - podTemplateSpecFilter cmp.Option = cmpopts.IgnoreFields(corev1.PodTemplateSpec{}, "ObjectMeta") - podContainerFilter cmp.Option = cmpopts.IgnoreFields(corev1.Container{}, "Resources", "Args", "VolumeMounts") +var podSpecFilter cmp.Option = cmpopts.IgnoreFields(corev1.PodSpec{}, "Containers", "Affinity") +var podTemplateSpecFilter cmp.Option = cmpopts.IgnoreFields(corev1.PodTemplateSpec{}, "ObjectMeta") - containerConfigWithoutSecurityContext = aa.ContainerConfig{ - Image: "nginx", - SetSecurityContext: false, - } -) - -var ( - workspacePVCName = "test-workspace-pvc" - workspaceVolumeClaimTemplateName = "test-workspace-vct" -) +var workspacePVCName = "test-workspace-pvc" +var workspaceVolumeClaimTemplateName = "test-workspace-vct" var testPRWithPVC = &v1.PipelineRun{ TypeMeta: metav1.TypeMeta{Kind: "PipelineRun"}, @@ -82,7 +69,6 @@ var testPRWithPVC = &v1.PipelineRun{ }}, }, } - var testPRWithVolumeClaimTemplate = &v1.PipelineRun{ TypeMeta: metav1.TypeMeta{Kind: "PipelineRun"}, ObjectMeta: metav1.ObjectMeta{ @@ -95,27 +81,23 @@ var testPRWithVolumeClaimTemplate = &v1.PipelineRun{ }}, }, } - var testPRWithVolumeClaimTemplateAndPVC = &v1.PipelineRun{ TypeMeta: metav1.TypeMeta{Kind: "PipelineRun"}, ObjectMeta: metav1.ObjectMeta{ Name: "pipelinerun-with-volumeClaimTemplate-and-pvc", }, Spec: v1.PipelineRunSpec{ - Workspaces: []v1.WorkspaceBinding{ - { - Name: workspaceVolumeClaimTemplateName, - VolumeClaimTemplate: &corev1.PersistentVolumeClaim{}, - }, { - Name: workspacePVCName, - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: "myclaim", - }, - }, + Workspaces: []v1.WorkspaceBinding{{ + Name: workspaceVolumeClaimTemplateName, + VolumeClaimTemplate: &corev1.PersistentVolumeClaim{}, + }, { + Name: workspacePVCName, + PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ + ClaimName: "myclaim", + }}, }, }, } - var testPRWithEmptyDir = &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "pipelinerun-with-emptyDir"}, Spec: v1.PipelineRunSpec{ @@ -126,31 +108,14 @@ var testPRWithEmptyDir = &v1.PipelineRun{ }, } -var testPRWithWindowsOs = &v1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{Name: "pipelinerun-with-windows"}, - Spec: v1.PipelineRunSpec{ - TaskRunTemplate: v1.PipelineTaskRunTemplate{ - PodTemplate: &pod.PodTemplate{ - NodeSelector: map[string]string{pipelinePod.OsSelectorLabel: "windows"}, - }, - }, - Workspaces: []v1.WorkspaceBinding{{ - Name: "EmptyDir Workspace", - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }}, - }, -} - // TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun tests to create and delete Affinity Assistants and PVCs // per pipelinerun for a given PipelineRun func TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun(t *testing.T) { replicas := int32(1) - tests := []struct { name string pr *v1.PipelineRun expectStatefulSetSpec *appsv1.StatefulSetSpec - featureFlags map[string]string }{{ name: "PersistentVolumeClaim Workspace type", pr: testPRWithPVC, @@ -165,10 +130,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun(t *testing.T) { }, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -190,14 +151,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun(t *testing.T) { workspace.LabelComponent: workspace.ComponentNameAffinityAssistant, }, }, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, - }, - }, VolumeClaimTemplates: []corev1.PersistentVolumeClaim{{ ObjectMeta: metav1.ObjectMeta{Name: "pvc-b9eea16dce"}, }}, @@ -219,10 +172,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun(t *testing.T) { }}, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -244,79 +193,17 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerPipelineRun(t *testing.T) { workspace.LabelComponent: workspace.ComponentNameAffinityAssistant, }, }, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, - }, - }, - }, - }, { - name: "securityContext feature enabled and os is Windows", - pr: testPRWithWindowsOs, - featureFlags: map[string]string{ - "set-security-context": "true", - }, - expectStatefulSetSpec: &appsv1.StatefulSetSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - pipeline.PipelineRunLabelKey: testPRWithWindowsOs.Name, - workspace.LabelInstance: "affinity-assistant-01cecfbdec", - workspace.LabelComponent: workspace.ComponentNameAffinityAssistant, - }, - }, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - NodeSelector: map[string]string{pipelinePod.OsSelectorLabel: "windows"}, - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: pipelinePod.WindowsSecurityContext, - }}, - }, - }, - }, - }, { - name: "securityContext feature enabled and os is Linux", - pr: testPRWithEmptyDir, - featureFlags: map[string]string{ - "set-security-context": "true", - }, - expectStatefulSetSpec: &appsv1.StatefulSetSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - pipeline.PipelineRunLabelKey: testPRWithEmptyDir.Name, - workspace.LabelInstance: "affinity-assistant-c655a0c8a2", - workspace.LabelComponent: workspace.ComponentNameAffinityAssistant, - }, - }, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: pipelinePod.LinuxSecurityContext, - }}, - }, - }, }, }} for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - featureFlags := map[string]string{ + configMap := map[string]string{ "disable-affinity-assistant": "true", "coschedule": "pipelineruns", } - - for k, v := range tc.featureFlags { - featureFlags[k] = v - } - kubeClientSet := fakek8s.NewSimpleClientset() - ctx := cfgtesting.SetFeatureFlags(context.Background(), t, featureFlags) + ctx := cfgtesting.SetFeatureFlags(context.Background(), t, configMap) c := Reconciler{ KubeClientSet: kubeClientSet, pvcHandler: volumeclaim.NewPVCHandler(kubeClientSet, zap.NewExample().Sugar()), @@ -368,10 +255,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -397,10 +280,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -431,10 +310,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -442,8 +317,7 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }, }}, }, - }, - }, { + }}, { Replicas: &replicas, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -454,10 +328,6 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "affinity-assistant", - SecurityContext: &corev1.SecurityContext{}, - }}, Volumes: []corev1.Volume{{ Name: "workspace-0", VolumeSource: corev1.VolumeSource{ @@ -475,6 +345,7 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCsPerWorkspaceOrDisabled(t *testin }} for _, tc := range tests { + tc := tc t.Run(tc.name, func(t *testing.T) { ctx := context.Background() kubeClientSet := fakek8s.NewSimpleClientset() @@ -595,7 +466,7 @@ func TestCreateOrUpdateAffinityAssistantsAndPVCs_Failure(t *testing.T) { } // TestCreateOrUpdateAffinityAssistantWhenNodeIsCordoned tests an existing Affinity Assistant can identify the node failure and -// can migrate the affinity assistant pod to a healthy node so that the existing pipelineRun runs to compleition +// can migrate the affinity assistant pod to a healthy node so that the existing pipelineRun runs to competition func TestCreateOrUpdateAffinityAssistantWhenNodeIsCordoned(t *testing.T) { expectedAffinityAssistantName := GetAffinityAssistantName(workspacePVCName, testPRWithPVC.Name) @@ -736,32 +607,24 @@ func TestPipelineRunPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { ImagePullSecrets: []corev1.LocalObjectReference{{ Name: "reg-creds", }}, - SecurityContext: &corev1.PodSecurityContext{ - RunAsNonRoot: ptr.Bool(true), - SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault}, - }, }, }, }, } - stsWithOverridenTemplateFields := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, containerConfigWithoutSecurityContext, nil) + stsWithTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, "nginx", nil) - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.Tolerations) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.Tolerations) != 1 { t.Errorf("expected Tolerations in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.NodeSelector) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.NodeSelector) != 1 { t.Errorf("expected a NodeSelector in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.ImagePullSecrets) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.ImagePullSecrets) != 1 { t.Errorf("expected ImagePullSecrets in the StatefulSet") } - - if stsWithOverridenTemplateFields.Spec.Template.Spec.SecurityContext == nil { - t.Errorf("expected a SecurityContext in the StatefulSet") - } } func TestDefaultPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { @@ -770,15 +633,7 @@ func TestDefaultPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "pipelinerun-with-custom-podtemplate", }, - Spec: v1.PipelineRunSpec{ - TaskRunTemplate: v1.PipelineTaskRunTemplate{ - PodTemplate: &pod.PodTemplate{ - HostNetwork: true, - }, - }, - }, } - priorityClassName := "test-priority" defaultTpl := &pod.AffinityAssistantTemplate{ Tolerations: []corev1.Toleration{{ @@ -793,34 +648,21 @@ func TestDefaultPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { ImagePullSecrets: []corev1.LocalObjectReference{{ Name: "reg-creds", }}, - SecurityContext: &corev1.PodSecurityContext{ - RunAsNonRoot: ptr.Bool(true), - SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault}, - }, - PriorityClassName: &priorityClassName, } - stsWithOverridenTemplateFields := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, containerConfigWithoutSecurityContext, defaultTpl) + stsWithTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, "nginx", defaultTpl) - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.Tolerations) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.Tolerations) != 1 { t.Errorf("expected Tolerations in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.NodeSelector) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.NodeSelector) != 1 { t.Errorf("expected a NodeSelector in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.ImagePullSecrets) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.ImagePullSecrets) != 1 { t.Errorf("expected ImagePullSecrets in the StatefulSet") } - - if stsWithOverridenTemplateFields.Spec.Template.Spec.SecurityContext == nil { - t.Errorf("expected SecurityContext in the StatefulSet") - } - - if stsWithOverridenTemplateFields.Spec.Template.Spec.PriorityClassName == "" { - t.Errorf("expected PriorityClassName in the StatefulSet") - } } func TestMergedPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { @@ -842,9 +684,7 @@ func TestMergedPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { {Name: "reg-creds"}, {Name: "alt-creds"}, }, - SecurityContext: &corev1.PodSecurityContext{RunAsNonRoot: ptr.Bool(true)}, - }, - }, + }}, }, } @@ -855,28 +695,21 @@ func TestMergedPodTemplatesArePropagatedToAffinityAssistant(t *testing.T) { ImagePullSecrets: []corev1.LocalObjectReference{{ Name: "reg-creds", }}, - SecurityContext: &corev1.PodSecurityContext{ - RunAsNonRoot: ptr.Bool(false), - }, } - stsWithOverridenTemplateFields := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, containerConfigWithoutSecurityContext, defaultTpl) + stsWithTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, "nginx", defaultTpl) - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.Tolerations) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.Tolerations) != 1 { t.Errorf("expected Tolerations from spec in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.NodeSelector) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.NodeSelector) != 1 { t.Errorf("expected NodeSelector from defaults in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.ImagePullSecrets) != 2 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.ImagePullSecrets) != 2 { t.Errorf("expected ImagePullSecrets from spec to overwrite default in the StatefulSet") } - - if stsWithOverridenTemplateFields.Spec.Template.Spec.SecurityContext.RunAsNonRoot == ptr.Bool(true) { - t.Errorf("expected SecurityContext from spec to overwrite default in the StatefulSet") - } } func TestOnlySelectPodTemplateFieldsArePropagatedToAffinityAssistant(t *testing.T) { @@ -898,18 +731,17 @@ func TestOnlySelectPodTemplateFieldsArePropagatedToAffinityAssistant(t *testing. IP: "1.2.3.4", Hostnames: []string{"localhost"}, }}, - }, - }, + }}, }, } - stsWithOverridenTemplateFields := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, containerConfigWithoutSecurityContext, nil) + stsWithTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, "nginx", nil) - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.Tolerations) != 1 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.Tolerations) != 1 { t.Errorf("expected Tolerations from spec in the StatefulSet") } - if len(stsWithOverridenTemplateFields.Spec.Template.Spec.HostAliases) != 0 { + if len(stsWithTolerationsAndNodeSelector.Spec.Template.Spec.HostAliases) != 0 { t.Errorf("expected HostAliases to not be passed from pod template") } } @@ -923,7 +755,7 @@ func TestThatTheAffinityAssistantIsWithoutNodeSelectorAndTolerations(t *testing. Spec: v1.PipelineRunSpec{}, } - stsWithoutTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithoutCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, containerConfigWithoutSecurityContext, nil) + stsWithoutTolerationsAndNodeSelector := affinityAssistantStatefulSet(aa.AffinityAssistantPerWorkspace, "test-assistant", prWithoutCustomPodTemplate, []corev1.PersistentVolumeClaim{}, []string{}, "nginx", nil) if len(stsWithoutTolerationsAndNodeSelector.Spec.Template.Spec.Tolerations) != 0 { t.Errorf("unexpected Tolerations in the StatefulSet") @@ -932,10 +764,6 @@ func TestThatTheAffinityAssistantIsWithoutNodeSelectorAndTolerations(t *testing. if len(stsWithoutTolerationsAndNodeSelector.Spec.Template.Spec.NodeSelector) != 0 { t.Errorf("unexpected NodeSelector in the StatefulSet") } - - if stsWithoutTolerationsAndNodeSelector.Spec.Template.Spec.SecurityContext != nil { - t.Errorf("unexpected SecurityContext in the StatefulSet") - } } // TestThatAffinityAssistantNameIsNoLongerThan53 tests that the Affinity Assistant Name @@ -1405,7 +1233,7 @@ func validateStatefulSetSpec(t *testing.T, ctx context.Context, c Reconciler, ex if err != nil { t.Fatalf("unexpected error when retrieving StatefulSet: %v", err) } - if d := cmp.Diff(expectStatefulSetSpec, &aa.Spec, podSpecFilter, podTemplateSpecFilter, podContainerFilter); d != "" { + if d := cmp.Diff(expectStatefulSetSpec, &aa.Spec, podSpecFilter, podTemplateSpecFilter); d != "" { t.Errorf("StatefulSetSpec diff: %s", diff.PrintWantGot(d)) } } else if !apierrors.IsNotFound(err) { diff --git a/upstream/pkg/reconciler/pipelinerun/cancel.go b/upstream/pkg/reconciler/pipelinerun/cancel.go index c198569da87..9b7dc48c440 100644 --- a/upstream/pkg/reconciler/pipelinerun/cancel.go +++ b/upstream/pkg/reconciler/pipelinerun/cancel.go @@ -24,7 +24,6 @@ import ( "strings" "time" - pipelineErrors "github.com/tektoncd/pipeline/pkg/apis/pipeline/errors" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" @@ -89,10 +88,6 @@ func cancelTaskRun(ctx context.Context, taskRunName string, namespace string, cl // still be able to cancel the PipelineRun return nil } - if pipelineErrors.IsImmutableTaskRunSpecError(err) { - // The TaskRun may have completed and the spec field is immutable, we should ignore this error. - return nil - } return err } diff --git a/upstream/pkg/reconciler/pipelinerun/cancel_test.go b/upstream/pkg/reconciler/pipelinerun/cancel_test.go index 0d1baa7e25d..72ab2e5ce04 100644 --- a/upstream/pkg/reconciler/pipelinerun/cancel_test.go +++ b/upstream/pkg/reconciler/pipelinerun/cancel_test.go @@ -295,6 +295,7 @@ func TestCancelPipelineRun(t *testing.T) { wantErr: true, }} for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { d := test.Data{ PipelineRuns: []*v1.PipelineRun{tc.pipelineRun}, @@ -366,38 +367,37 @@ func TestGetChildObjectsFromPRStatusForTaskNames(t *testing.T) { expectedRunNames []string expectedCustomRunNames []string hasError bool - }{ - { - name: "beta custom tasks", - prStatus: v1.PipelineRunStatus{PipelineRunStatusFields: v1.PipelineRunStatusFields{ - ChildReferences: []v1.ChildStatusReference{{ - TypeMeta: runtime.TypeMeta{ - APIVersion: v1beta1.SchemeGroupVersion.String(), - Kind: customRun, - }, - Name: "r1", - PipelineTaskName: "run-1", - }}, + }{{ + name: "beta custom tasks", + prStatus: v1.PipelineRunStatus{PipelineRunStatusFields: v1.PipelineRunStatusFields{ + ChildReferences: []v1.ChildStatusReference{{ + TypeMeta: runtime.TypeMeta{ + APIVersion: v1beta1.SchemeGroupVersion.String(), + Kind: customRun, + }, + Name: "r1", + PipelineTaskName: "run-1", }}, - expectedCustomRunNames: []string{"r1"}, - hasError: false, - }, { - name: "unknown kind", - prStatus: v1.PipelineRunStatus{PipelineRunStatusFields: v1.PipelineRunStatusFields{ - ChildReferences: []v1.ChildStatusReference{{ - TypeMeta: runtime.TypeMeta{ - APIVersion: "v1", - Kind: "UnknownKind", - }, - Name: "u1", - PipelineTaskName: "unknown-1", - }}, + }}, + expectedCustomRunNames: []string{"r1"}, + hasError: false, + }, { + name: "unknown kind", + prStatus: v1.PipelineRunStatus{PipelineRunStatusFields: v1.PipelineRunStatusFields{ + ChildReferences: []v1.ChildStatusReference{{ + TypeMeta: runtime.TypeMeta{ + APIVersion: "v1", + Kind: "UnknownKind", + }, + Name: "u1", + PipelineTaskName: "unknown-1", }}, - expectedTRNames: nil, - expectedRunNames: nil, - expectedCustomRunNames: nil, - hasError: true, - }, + }}, + expectedTRNames: nil, + expectedRunNames: nil, + expectedCustomRunNames: nil, + hasError: true, + }, } for _, tc := range testCases { diff --git a/upstream/pkg/reconciler/pipelinerun/controller.go b/upstream/pkg/reconciler/pipelinerun/controller.go index d47ef8d7760..5df3f698548 100644 --- a/upstream/pkg/reconciler/pipelinerun/controller.go +++ b/upstream/pkg/reconciler/pipelinerun/controller.go @@ -33,7 +33,7 @@ import ( "github.com/tektoncd/pipeline/pkg/pipelinerunmetrics" cloudeventclient "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" - resolution "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" + resolution "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/tracing" "k8s.io/client-go/tools/cache" "k8s.io/utils/clock" @@ -62,12 +62,8 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock) func(contex verificationpolicyInformer := verificationpolicyinformer.Get(ctx) secretinformer := secretinformer.Get(ctx) tracerProvider := tracing.New(TracerProviderName, logger.Named("tracing")) - pipelinerunmetricsRecorder := pipelinerunmetrics.Get(ctx) //nolint:contextcheck // OnStore methods does not support context as a parameter - configStore := config.NewStore(logger.Named("config-store"), - pipelinerunmetrics.OnStore(logger, pipelinerunmetricsRecorder), - tracerProvider.OnStore(secretinformer.Lister()), - ) + configStore := config.NewStore(logger.Named("config-store"), pipelinerunmetrics.MetricsOnStore(logger), tracerProvider.OnStore(secretinformer.Lister())) configStore.WatchConfigs(cmw) c := &Reconciler{ @@ -80,7 +76,7 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock) func(contex customRunLister: customRunInformer.Lister(), verificationPolicyLister: verificationpolicyInformer.Lister(), cloudEventClient: cloudeventclient.Get(ctx), - metrics: pipelinerunmetricsRecorder, + metrics: pipelinerunmetrics.Get(ctx), pvcHandler: volumeclaim.NewPVCHandler(kubeclientset, logger), resolutionRequester: resolution.NewCRDRequester(resolutionclient.Get(ctx), resolutionInformer.Lister()), tracerProvider: tracerProvider, diff --git a/upstream/pkg/reconciler/pipelinerun/pipelinerun.go b/upstream/pkg/reconciler/pipelinerun/pipelinerun.go index 8a67c183a7f..c2f1b2bf353 100644 --- a/upstream/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/upstream/pkg/reconciler/pipelinerun/pipelinerun.go @@ -52,8 +52,7 @@ import ( tresources "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" "github.com/tektoncd/pipeline/pkg/remote" - resolution "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" + resolution "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/substitution" "github.com/tektoncd/pipeline/pkg/trustedresources" "github.com/tektoncd/pipeline/pkg/workspace" @@ -289,8 +288,7 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pr *v1.PipelineRun) pkgr if taskTimeout.Duration == config.NoTimeoutDuration { waitTime = time.Duration(config.FromContextOrDefaults(ctx).Defaults.DefaultTimeoutMinutes) * time.Minute } - } else if pr.Status.FinallyStartTime != nil && pr.FinallyTimeout() != nil && - pr.FinallyTimeout().Duration != config.NoTimeoutDuration { + } else if pr.Status.FinallyStartTime != nil && pr.FinallyTimeout() != nil { finallyWaitTime := pr.FinallyTimeout().Duration - c.Clock.Since(pr.Status.FinallyStartTime.Time) if finallyWaitTime < waitTime { waitTime = finallyWaitTime @@ -340,8 +338,7 @@ func (c *Reconciler) resolvePipelineState( tasks []v1.PipelineTask, pipelineMeta *metav1.ObjectMeta, pr *v1.PipelineRun, - pst resources.PipelineRunState, -) (resources.PipelineRunState, error) { + pst resources.PipelineRunState) (resources.PipelineRunState, error) { ctx, span := c.tracerProvider.Tracer(TracerName).Start(ctx, "resolvePipelineState") defer span.End() // Resolve each task individually because they each could have a different reference context (remote or local). @@ -376,7 +373,7 @@ func (c *Reconciler) resolvePipelineState( pst, ) if err != nil { - if resolutioncommon.IsErrTransient(err) { + if tresources.IsErrTransient(err) { return nil, err } if errors.Is(err, remote.ErrRequestInProgress) { @@ -490,8 +487,8 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1.PipelineRun, getPipel if err := resources.ValidateRequiredParametersProvided(&pipelineSpec.Params, &pr.Spec.Params); err != nil { // This Run has failed, so we need to mark it as failed and stop reconciling it pr.Status.MarkFailed(v1.PipelineRunReasonParameterMissing.String(), - "PipelineRun %s/%s is missing some parameters required by Pipeline %s/%s: %s", - pr.Namespace, pr.Name, pr.Namespace, pipelineMeta.Name, err) + "PipelineRun %s parameters is missing some parameters required by Pipeline %s's parameters: %s", + pr.Namespace, pr.Name, err) return controller.NewPermanentError(err) } @@ -903,13 +900,6 @@ func (c *Reconciler) runNextSchedulableTask(ctx context.Context, pr *v1.Pipeline // propagate previous task results resources.PropagateResults(rpt, pipelineRunFacts.State) - // propagate previous task artifacts - err = resources.PropagateArtifacts(rpt, pipelineRunFacts.State) - if err != nil { - logger.Errorf("Failed to propagate artifacts due to error: %v", err) - return controller.NewPermanentError(err) - } - // Validate parameter types in matrix after apply substitutions from Task Results if rpt.PipelineTask.IsMatrixed() { if err := resources.ValidateParameterTypesInMatrix(pipelineRunFacts.State); err != nil { @@ -1326,11 +1316,6 @@ func propagatePipelineNameLabelToPipelineRun(pr *v1.PipelineRun) error { if pr.ObjectMeta.Labels == nil { pr.ObjectMeta.Labels = make(map[string]string) } - - if _, ok := pr.ObjectMeta.Labels[pipeline.PipelineLabelKey]; ok { - return nil - } - switch { case pr.Spec.PipelineRef != nil && pr.Spec.PipelineRef.Name != "": pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = pr.Spec.PipelineRef.Name @@ -1338,20 +1323,6 @@ func propagatePipelineNameLabelToPipelineRun(pr *v1.PipelineRun) error { pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = pr.Name case pr.Spec.PipelineRef != nil && pr.Spec.PipelineRef.Resolver != "": pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = pr.Name - - // https://tekton.dev/docs/pipelines/cluster-resolver/#pipeline-resolution - var kind, name string - for _, param := range pr.Spec.PipelineRef.Params { - if param.Name == "kind" { - kind = param.Value.StringVal - } - if param.Name == "name" { - name = param.Value.StringVal - } - } - if kind == "pipeline" { - pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = name - } default: return fmt.Errorf("pipelineRun %s not providing PipelineRef or PipelineSpec", pr.Name) } @@ -1367,7 +1338,6 @@ func getTaskrunLabels(pr *v1.PipelineRun, pipelineTaskName string, includePipeli } } labels[pipeline.PipelineRunLabelKey] = pr.Name - labels[pipeline.PipelineRunUIDLabelKey] = string(pr.UID) if pipelineTaskName != "" { labels[pipeline.PipelineTaskLabelKey] = pipelineTaskName } @@ -1464,9 +1434,7 @@ func storePipelineSpecAndMergeMeta(ctx context.Context, pr *v1.PipelineRun, ps * // Propagate labels from Pipeline to PipelineRun. PipelineRun labels take precedences over Pipeline. pr.ObjectMeta.Labels = kmap.Union(meta.Labels, pr.ObjectMeta.Labels) - if len(meta.Name) > 0 { - pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = meta.Name - } + pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = meta.Name // Propagate annotations from Pipeline to PipelineRun. PipelineRun annotations take precedences over Pipeline. pr.ObjectMeta.Annotations = kmap.Union(kmap.ExcludeKeys(meta.Annotations, tknreconciler.KubectlLastAppliedAnnotationKey), pr.ObjectMeta.Annotations) @@ -1575,8 +1543,6 @@ func filterCustomRunsForPipelineRunStatus(logger *zap.SugaredLogger, pr *v1.Pipe gvks = append(gvks, v1beta1.SchemeGroupVersion.WithKind(customRun)) } - // NAMES are names - return names, taskLabels, gvks, statuses } diff --git a/upstream/pkg/reconciler/pipelinerun/pipelinerun_test.go b/upstream/pkg/reconciler/pipelinerun/pipelinerun_test.go index 780249b6a40..e71ee79a823 100644 --- a/upstream/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/upstream/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -226,7 +226,7 @@ func getTaskRuns(ctx context.Context, t *testing.T, clients test.Clients, namesp outputs := make(map[string]*v1.TaskRun) for _, item := range taskRuns.Items { tr := item - outputs[item.Name] = &tr + outputs[tr.Name] = &tr } return outputs @@ -244,7 +244,6 @@ func TestReconcile(t *testing.T) { metadata: name: test-pipeline-run-success namespace: foo - uid: bar spec: params: - name: bar @@ -398,8 +397,6 @@ spec: name: unit-test-task kind: Task `) - expectedTaskRun.Labels["tekton.dev/pipelineRunUID"] = "bar" - expectedTaskRun.OwnerReferences[0].UID = "bar" // ignore IgnoreUnexported ignore both after and before steps fields if d := cmp.Diff(expectedTaskRun, actual, ignoreTypeMeta, ignoreResourceVersion); d != "" { t.Errorf("expected to see TaskRun %v created. Diff %s", expectedTaskRun, diff.PrintWantGot(d)) @@ -430,7 +427,6 @@ func TestReconcile_V1Beta1CustomTask(t *testing.T) { simpleCustomTaskPRYAML := `metadata: name: test-pipelinerun namespace: namespace - uid: bar spec: pipelineSpec: tasks: @@ -450,7 +446,6 @@ spec: tekton.dev/pipeline: test-pipelinerun tekton.dev/pipelineRun: test-pipelinerun tekton.dev/pipelineTask: custom-task - tekton.dev/pipelineRunUID: bar name: test-pipelinerun-custom-task namespace: namespace ownerReferences: @@ -459,7 +454,6 @@ spec: controller: true kind: PipelineRun name: test-pipelinerun - uid: bar spec: params: - name: param1 @@ -962,26 +956,10 @@ spec: "Warning Failed [User error] PipelineRun foo/embedded-pipeline-mismatching-param-type parameters have mismatching types with Pipeline foo/embedded-pipeline-mismatching-param-type's parameters: parameters have inconsistent types : [some-param]", }, }, { - name: "invalid-pipeline-run-missing-params-with-ref-shd-stop-reconciling", - pipelineRun: parse.MustParseV1PipelineRun(t, ` -metadata: - name: pipelinerun-missing-params-1 - namespace: foo -spec: - pipelineRef: - name: a-pipeline-with-array-params -`), - reason: v1.PipelineRunReasonParameterMissing.String(), - permanentError: true, - wantEvents: []string{ - "Normal Started", - "Warning Failed [User error] PipelineRun foo/pipelinerun-missing-params-1 is missing some parameters required by Pipeline foo/a-pipeline-with-array-params: pipelineRun missing parameters: [some-param]", - }, - }, { - name: "invalid-pipeline-run-missing-params-with-spec-shd-stop-reconciling", + name: "invalid-pipeline-run-missing-params-shd-stop-reconciling", pipelineRun: parse.MustParseV1PipelineRun(t, fmt.Sprintf(` metadata: - name: pipelinerun-missing-params-2 + name: pipelinerun-missing-params namespace: foo spec: pipelineSpec: @@ -997,7 +975,7 @@ spec: permanentError: true, wantEvents: []string{ "Normal Started", - "Warning Failed [User error] PipelineRun foo/pipelinerun-missing-params-2 is missing some parameters required by Pipeline foo/pipelinerun-missing-params-2: pipelineRun missing parameters: [some-param]", + "Warning Failed [User error] PipelineRun foo parameters is missing some parameters required by Pipeline pipelinerun-missing-params's parameters: pipelineRun missing parameters: [some-param]", }, }, { name: "invalid-pipeline-with-invalid-dag-graph", @@ -2512,7 +2490,24 @@ spec: } func TestReconcileWithTimeoutDisabled(t *testing.T) { - ps := []*v1.Pipeline{parse.MustParseV1Pipeline(t, ` + testCases := []struct { + name string + timeout time.Duration + }{ + { + name: "pipeline timeout is 24h", + timeout: 24 * time.Hour, + }, + { + name: "pipeline timeout is way longer than 24h", + timeout: 360 * time.Hour, + }, + } + + for _, tc := range testCases { + startTime := time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC).Add(-3 * tc.timeout) + t.Run(tc.name, func(t *testing.T) { + ps := []*v1.Pipeline{parse.MustParseV1Pipeline(t, ` metadata: name: test-pipeline namespace: foo @@ -2524,22 +2519,8 @@ spec: - name: hello-world-2 taskRef: name: hello-world -`), parse.MustParseV1Pipeline(t, ` -metadata: - name: test-pipeline-with-finally - namespace: foo -spec: - tasks: - - name: hello-world-1 - taskRef: - name: hello-world - finally: - - name: hello-world-2 - taskRef: - name: hello-world `)} - - prs := []*v1.PipelineRun{parse.MustParseV1PipelineRun(t, ` + prs := []*v1.PipelineRun{parse.MustParseV1PipelineRun(t, ` metadata: name: test-pipeline-run-with-timeout-disabled namespace: foo @@ -2552,108 +2533,32 @@ spec: pipeline: 0h0m0s status: startTime: "2021-12-30T00:00:00Z" -`), parse.MustParseV1PipelineRun(t, ` -metadata: - name: test-pipeline-run-with-timeout-disabled - namespace: foo -spec: - pipelineRef: - name: test-pipeline-with-finally - taskRunTemplate: - serviceAccountName: test-sa - timeouts: - pipeline: 96h0m0s - tasks: 96h0m0s -status: - startTime: "2021-12-30T00:00:00Z" - finallyStartTime: "2021-12-30T23:44:59Z" `)} - ts := []*v1.Task{simpleHelloWorldTask} + ts := []*v1.Task{simpleHelloWorldTask} - trs := []*v1.TaskRun{mustParseTaskRunWithObjectMeta(t, taskRunObjectMeta("test-pipeline-run-with-timeout-hello-world-1", "foo", "test-pipeline-run-with-timeout-disabled", - "test-pipeline", "hello-world-1", false), ` -spec: - serviceAccountName: test-sa - taskRef: - name: hello-world - kind: Task -`), mustParseTaskRunWithObjectMeta(t, taskRunObjectMeta("test-pipeline-run-with-timeout-with-finally-hello-world-1", "foo", "test-pipeline-run-with-timeout-disabled", - "test-pipeline-with-finally", "hello-world-1", false), ` -spec: - startTime: "2021-12-30T00:00:00Z" - serviceAccountName: test-sa - taskRef: - name: hello-world - kind: Task - conditions: - - lastTransitionTime: null - status: "True" - type: Succeeded -`), mustParseTaskRunWithObjectMeta(t, taskRunObjectMeta("test-pipeline-run-with-timeout-with-finally-hello-world-2", "foo", "test-pipeline-run-with-timeout-disabled", - "test-pipeline-with-finally", "hello-world-2", false), ` + trs := []*v1.TaskRun{mustParseTaskRunWithObjectMeta(t, taskRunObjectMeta("test-pipeline-run-with-timeout-hello-world-1", "foo", "test-pipeline-run-with-timeout-disabled", + "test-pipeline", "hello-world-1", false), ` spec: serviceAccountName: test-sa taskRef: name: hello-world kind: Task `)} - - testCases := []struct { - name string - timeout time.Duration - trs []*v1.TaskRun - ts []*v1.Task - ps []*v1.Pipeline - prs []*v1.PipelineRun - }{ - { - name: "pipeline timeout is 24h", - timeout: 24 * time.Hour, - trs: []*v1.TaskRun{trs[0]}, - ts: []*v1.Task{ts[0]}, - prs: []*v1.PipelineRun{prs[0]}, - ps: []*v1.Pipeline{ps[0]}, - }, - { - name: "pipeline timeout is way longer than 24h", - timeout: 360 * time.Hour, - trs: []*v1.TaskRun{trs[0]}, - ts: []*v1.Task{ts[0]}, - prs: []*v1.PipelineRun{prs[0]}, - ps: []*v1.Pipeline{ps[0]}, - }, - { - name: "pipeline timeout is 24h, and the final task timeout is 0s", - timeout: 24 * time.Hour, - trs: []*v1.TaskRun{trs[1], trs[2]}, - ts: []*v1.Task{ts[0]}, - prs: []*v1.PipelineRun{prs[1]}, - ps: []*v1.Pipeline{ps[1]}, - }, - } - - for _, tc := range testCases { - startTime := time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC).Add(-3 * tc.timeout) - notAdjustedCreationTimestamp := time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC).Add(tc.timeout) - t.Run(tc.name, func(t *testing.T) { start := metav1.NewTime(startTime) - tc.prs[0].Status.StartTime = &start - for i := range tc.trs { - tc.trs[i].CreationTimestamp = metav1.Time{Time: notAdjustedCreationTimestamp} - } + prs[0].Status.StartTime = &start d := test.Data{ - PipelineRuns: tc.prs, - Pipelines: tc.ps, - Tasks: tc.ts, - TaskRuns: tc.trs, + PipelineRuns: prs, + Pipelines: ps, + Tasks: ts, + TaskRuns: trs, } prt := newPipelineRunTest(t, d) defer prt.Cancel() c := prt.TestAssets.Controller clients := prt.TestAssets.Clients - reconcileError := c.Reconciler.Reconcile(prt.TestAssets.Ctx, fmt.Sprintf("%s/%s", "foo", tc.prs[0].Name)) + reconcileError := c.Reconciler.Reconcile(prt.TestAssets.Ctx, "foo/test-pipeline-run-with-timeout-disabled") if reconcileError == nil { t.Errorf("expected error, but got nil") } @@ -2663,7 +2568,7 @@ spec: t.Errorf("Expected a positive requeue duration but got %s", requeueDuration.String()) } prt.Test.Logf("Getting reconciled run") - reconciledRun, err := clients.Pipeline.TektonV1().PipelineRuns("foo").Get(prt.TestAssets.Ctx, tc.prs[0].Name, metav1.GetOptions{}) + reconciledRun, err := clients.Pipeline.TektonV1().PipelineRuns("foo").Get(prt.TestAssets.Ctx, "test-pipeline-run-with-timeout-disabled", metav1.GetOptions{}) if err != nil { prt.Test.Errorf("Somehow had error getting reconciled run out of fake client: %s", err) } @@ -2786,7 +2691,7 @@ spec: prt.Test.Logf("Getting events") // Check generated events match what's expected if err := k8sevent.CheckEventsOrdered(prt.Test, prt.TestAssets.Recorder.Events, "test-pipeline-run-with-timeout", wantEvents); err != nil { - prt.Test.Error(err.Error()) + prt.Test.Errorf(err.Error()) } // The PipelineRun should be timed out. @@ -3569,7 +3474,7 @@ spec: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, prName, wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } // Turn off failing reactor and retry reconciliation @@ -3687,7 +3592,7 @@ spec: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, prName, wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } // Turn off failing reactor and retry reconciliation @@ -3784,6 +3689,7 @@ metadata: PipelineRunAnnotation: PipelineRunValue labels: PipelineRunLabel: PipelineRunValue + tekton.dev/pipeline: WillNotBeUsed name: test-pipeline-run-with-labels namespace: foo spec: @@ -6914,7 +6820,7 @@ metadata: t.Errorf("storePipelineSpec() error = %v", err) } if d := cmp.Diff(tc.wantPipelineRun, pr); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } // mock second reconcile @@ -6922,7 +6828,7 @@ metadata: t.Errorf("storePipelineSpec() error = %v", err) } if d := cmp.Diff(tc.wantPipelineRun, pr); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -6946,10 +6852,10 @@ func Test_storePipelineSpec_metadata(t *testing.T) { t.Errorf("storePipelineSpecAndMergeMeta error = %v", err) } if d := cmp.Diff(wantedlabels, pr.ObjectMeta.Labels); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } if d := cmp.Diff(wantedannotations, pr.ObjectMeta.Annotations); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } } @@ -8339,73 +8245,6 @@ spec: } } -func TestReconciler_ReconcileKind_PipelineRunLabels(t *testing.T) { - names.TestingSeed() - - pipelineName := "p-pipelinetask" - pipelineRunName := "pr-pipelinetask" - - ps := []*v1.Pipeline{parse.MustParseV1Pipeline(t, ` -metadata: - name: p-pipelinetask - namespace: foo -spec: - tasks: - - name: task1 - taskRef: - name: mytask -`)} - - prs := []*v1.PipelineRun{parse.MustParseV1PipelineRun(t, ` -metadata: - name: pr-pipelinetask - namespace: foo -spec: - pipelineRef: - params: - - name: kind - value: pipeline - - name: name - value: p-pipelinetask - - name: namespace - value: foo - resolver: cluster -`)} - - ts := []*v1.Task{{ObjectMeta: baseObjectMeta("mytask", "foo")}} - - trs := []*v1.TaskRun{mustParseTaskRunWithObjectMeta(t, - taskRunObjectMeta(pipelineRunName+"-task1-xxyy", "foo", pipelineRunName, pipelineName, "task1", false), - ` -spec: - serviceAccountName: test-sa - taskRef: - name: mytask -status: - conditions: - - reason: "done" - status: "True" - type: Succeeded -`)} - - d := test.Data{ - PipelineRuns: prs, - Pipelines: ps, - Tasks: ts, - TaskRuns: trs, - } - prt := newPipelineRunTest(t, d) - defer prt.Cancel() - - actualPipelineRun, _ := prt.reconcileRun("foo", pipelineRunName, []string{}, false) - if actualPipelineRun.Labels == nil { - t.Fatalf("Pelinerun should have labels") - } - if v, ok := actualPipelineRun.Labels[pipeline.PipelineLabelKey]; !ok || v != pipelineName { - t.Fatalf("The expected name of the pipeline is %s, but the actual name is %s", pipelineName, v) - } -} - // newPipelineRunTest returns PipelineRunTest with a new PipelineRun controller created with specified state through data // This PipelineRunTest can be reused for multiple PipelineRuns by calling reconcileRun for each pipelineRun func newPipelineRunTest(t *testing.T, data test.Data) *PipelineRunTest { @@ -8449,7 +8288,7 @@ func (prt PipelineRunTest) reconcileRun(namespace, pipelineRunName string, wantE // Check generated events match what's expected if len(wantEvents) > 0 { if err := k8sevent.CheckEventsOrdered(prt.Test, prt.TestAssets.Recorder.Events, pipelineRunName, wantEvents); err != nil { - prt.Test.Error(err.Error()) + prt.Test.Errorf(err.Error()) } } @@ -8646,132 +8485,6 @@ spec: } } -func TestReconcile_RemotePipeline_PipelineNameLabel(t *testing.T) { - names.TestingSeed() - - namespace := "foo" - prName := "test-pipeline-run-success" - trName := "test-pipeline-run-success-unit-test-1" - - prs := []*v1.PipelineRun{parse.MustParseV1PipelineRun(t, ` -metadata: - name: test-pipeline-run-success - namespace: foo -spec: - pipelineRef: - resolver: bar - taskRunTemplate: - serviceAccountName: test-sa - timeout: 1h0m0s -`)} - ps := parse.MustParseV1Pipeline(t, ` -metadata: - name: test-pipeline - namespace: foo -spec: - tasks: - - name: unit-test-1 - taskRef: - resolver: bar -`) - notNamePipeline := parse.MustParseV1Pipeline(t, ` -metadata: - namespace: foo -spec: - tasks: - - name: unit-test-1 - taskRef: - resolver: bar -`) - - remoteTask := parse.MustParseV1Task(t, ` -metadata: - name: unit-test-task - namespace: foo -`) - - pipelineBytes, err := yaml.Marshal(ps) - if err != nil { - t.Fatal("fail to marshal pipeline", err) - } - notNamePipelineBytes, err := yaml.Marshal(notNamePipeline) - if err != nil { - t.Fatal("fail to marshal pipeline", err) - } - - taskBytes, err := yaml.Marshal(remoteTask) - if err != nil { - t.Fatal("fail to marshal task", err) - } - - pipelineReq := getResolvedResolutionRequest(t, "bar", pipelineBytes, "foo", prName) - notNamePipelineReq := getResolvedResolutionRequest(t, "bar", notNamePipelineBytes, "foo", prName) - taskReq := getResolvedResolutionRequest(t, "bar", taskBytes, "foo", trName) - - tcs := []struct { - name string - wantPipelineName string - pipelineReq resolutionv1beta1.ResolutionRequest - taskReq resolutionv1beta1.ResolutionRequest - }{{ - name: "remote pipeline contains name", - // Use the name from the remote pipeline - wantPipelineName: ps.Name, - pipelineReq: pipelineReq, - taskReq: taskReq, - }, { - name: "remote pipeline without name", - wantPipelineName: prs[0].Name, - pipelineReq: notNamePipelineReq, - taskReq: taskReq, - }} - - for _, tc := range tcs { - // Unlike the tests above, we do *not* locally define our pipeline or unit-test task. - d := test.Data{ - PipelineRuns: prs, - ServiceAccounts: []*corev1.ServiceAccount{{ - ObjectMeta: metav1.ObjectMeta{Name: prs[0].Spec.TaskRunTemplate.ServiceAccountName, Namespace: namespace}, - }}, - ConfigMaps: []*corev1.ConfigMap{ - { - ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "enable-api-fields": "beta", - }, - }, - }, - ResolutionRequests: []*resolutionv1beta1.ResolutionRequest{&tc.taskReq, &tc.pipelineReq}, - } - - prt := newPipelineRunTest(t, d) - defer prt.Cancel() - - wantEvents := []string{ - "Normal Started", - "Normal Running Tasks Completed: 0", - } - reconciledRun, _ := prt.reconcileRun(namespace, prName, wantEvents, false) - if len(reconciledRun.Labels) == 0 { - t.Errorf("the pipeline label in pr is not set") - } - pName := reconciledRun.Labels[pipeline.PipelineLabelKey] - if reconciledRun.Labels[pipeline.PipelineLabelKey] != tc.wantPipelineName { - t.Errorf("want pipeline name %s, but got %s", tc.wantPipelineName, pName) - } - - // Verify the pipeline name label after the second `reconcile`, to prevent it from being overwritten again. - reconciledRun, _ = prt.reconcileRun(namespace, prName, wantEvents, false) - if len(reconciledRun.Labels) == 0 { - t.Errorf("the pipeline label in pr is not set") - } - pName = reconciledRun.Labels[pipeline.PipelineLabelKey] - if reconciledRun.Labels[pipeline.PipelineLabelKey] != tc.wantPipelineName { - t.Errorf("want pipeline name %s, but got %s", tc.wantPipelineName, pName) - } - } -} - // TestReconcile_OptionalWorkspacesOmitted checks that an optional workspace declared by // a Task and a Pipeline can be omitted by a PipelineRun and the run will still start // successfully without an error. @@ -9340,13 +9053,11 @@ func taskRunObjectMeta(trName, ns, prName, pipelineName, pipelineTaskName string APIVersion: "tekton.dev/v1", Controller: &trueb, BlockOwnerDeletion: &trueb, - UID: "", }}, Labels: map[string]string{ - pipeline.PipelineLabelKey: pipelineName, - pipeline.PipelineRunLabelKey: prName, - pipeline.PipelineTaskLabelKey: pipelineTaskName, - pipeline.PipelineRunUIDLabelKey: "", + pipeline.PipelineLabelKey: pipelineName, + pipeline.PipelineRunLabelKey: prName, + pipeline.PipelineTaskLabelKey: pipelineTaskName, }, Annotations: map[string]string{}, } @@ -12172,7 +11883,7 @@ spec: type: array steps: - name: produce-a-list-of-platforms - image: docker.io/library/bash:5.2.26 + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path) @@ -12657,7 +12368,7 @@ spec: type: array steps: - name: produce-a-list-of-platforms - image: docker.io/library/bash:5.2.26 + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path) @@ -16887,7 +16598,7 @@ spec: // the ResolutionRequest's name is generated by resolverName, namespace and runName. func getResolvedResolutionRequest(t *testing.T, resolverName string, resourceBytes []byte, namespace string, runName string) resolutionv1beta1.ResolutionRequest { t.Helper() - name, err := remoteresource.GenerateDeterministicNameFromSpec(resolverName, namespace+"/"+runName, &resolutionv1beta1.ResolutionRequestSpec{}) + name, err := remoteresource.GenerateDeterministicName(resolverName, namespace+"/"+runName, nil) if err != nil { t.Errorf("error generating name for %s/%s/%s: %v", resolverName, namespace, runName, err) } @@ -17683,7 +17394,7 @@ func Test_runNextSchedulableTask(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "task2", ResourceVersion: "00002", - Labels: map[string]string{"tekton.dev/pipelineRun": "", "tekton.dev/pipelineTask": "task2", "tekton.dev/pipelineRunUID": ""}, + Labels: map[string]string{"tekton.dev/pipelineRun": "", "tekton.dev/pipelineTask": "task2"}, OwnerReferences: []metav1.OwnerReference{ { APIVersion: "tekton.dev/v1", diff --git a/upstream/pkg/reconciler/pipelinerun/resources/apply.go b/upstream/pkg/reconciler/pipelinerun/resources/apply.go index 6c635357adf..3aeb0accebd 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/apply.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/apply.go @@ -18,7 +18,6 @@ package resources import ( "context" - "encoding/json" "fmt" "strconv" "strings" @@ -40,11 +39,13 @@ const ( objectIndividualVariablePattern = "params.%s.%s" ) -var paramPatterns = []string{ - "params.%s", - "params[%q]", - "params['%s']", -} +var ( + paramPatterns = []string{ + "params.%s", + "params[%q]", + "params['%s']", + } +) // ApplyParameters applies the params from a PipelineRun.Params to a PipelineSpec. func ApplyParameters(ctx context.Context, p *v1.PipelineSpec, pr *v1.PipelineRun) *v1.PipelineSpec { @@ -62,7 +63,7 @@ func ApplyParameters(ctx context.Context, p *v1.PipelineSpec, pr *v1.PipelineRun switch p.Default.Type { case v1.ParamTypeArray: for _, pattern := range paramPatterns { - for i := range len(p.Default.ArrayVal) { + for i := 0; i < len(p.Default.ArrayVal); i++ { stringReplacements[fmt.Sprintf(pattern+"[%d]", p.Name, i)] = p.Default.ArrayVal[i] } arrayReplacements[fmt.Sprintf(pattern, p.Name)] = p.Default.ArrayVal @@ -110,7 +111,7 @@ func paramsFromPipelineRun(ctx context.Context, pr *v1.PipelineRun) (map[string] switch p.Value.Type { case v1.ParamTypeArray: for _, pattern := range paramPatterns { - for i := range len(p.Value.ArrayVal) { + for i := 0; i < len(p.Value.ArrayVal); i++ { stringReplacements[fmt.Sprintf(pattern+"[%d]", p.Name, i)] = p.Value.ArrayVal[i] } arrayReplacements[fmt.Sprintf(pattern, p.Name)] = p.Value.ArrayVal @@ -248,11 +249,8 @@ func ApplyTaskResults(targets PipelineRunState, resolvedResultRefs ResolvedResul } } pipelineTask.When = pipelineTask.When.ReplaceVariables(stringReplacements, arrayReplacements) - if pipelineTask.TaskRef != nil { - if pipelineTask.TaskRef.Params != nil { - pipelineTask.TaskRef.Params = pipelineTask.TaskRef.Params.ReplaceVariables(stringReplacements, arrayReplacements, objectReplacements) - } - pipelineTask.TaskRef.Name = substitution.ApplyReplacements(pipelineTask.TaskRef.Name, stringReplacements) + if pipelineTask.TaskRef != nil && pipelineTask.TaskRef.Params != nil { + pipelineTask.TaskRef.Params = pipelineTask.TaskRef.Params.ReplaceVariables(stringReplacements, arrayReplacements, objectReplacements) } pipelineTask.DisplayName = substitution.ApplyReplacements(pipelineTask.DisplayName, stringReplacements) for i, workspace := range pipelineTask.Workspaces { @@ -270,11 +268,8 @@ func ApplyPipelineTaskStateContext(state PipelineRunState, replacements map[stri pipelineTask := resolvedPipelineRunTask.PipelineTask.DeepCopy() pipelineTask.Params = pipelineTask.Params.ReplaceVariables(replacements, nil, nil) pipelineTask.When = pipelineTask.When.ReplaceVariables(replacements, nil) - if pipelineTask.TaskRef != nil { - if pipelineTask.TaskRef.Params != nil { - pipelineTask.TaskRef.Params = pipelineTask.TaskRef.Params.ReplaceVariables(replacements, nil, nil) - } - pipelineTask.TaskRef.Name = substitution.ApplyReplacements(pipelineTask.TaskRef.Name, replacements) + if pipelineTask.TaskRef != nil && pipelineTask.TaskRef.Params != nil { + pipelineTask.TaskRef.Params = pipelineTask.TaskRef.Params.ReplaceVariables(replacements, nil, nil) } pipelineTask.DisplayName = substitution.ApplyReplacements(pipelineTask.DisplayName, replacements) resolvedPipelineRunTask.PipelineTask = pipelineTask @@ -316,11 +311,8 @@ func ApplyReplacements(p *v1.PipelineSpec, replacements map[string]string, array p.Tasks[i].Workspaces[j].SubPath = substitution.ApplyReplacements(p.Tasks[i].Workspaces[j].SubPath, replacements) } p.Tasks[i].When = p.Tasks[i].When.ReplaceVariables(replacements, arrayReplacements) - if p.Tasks[i].TaskRef != nil { - if p.Tasks[i].TaskRef.Params != nil { - p.Tasks[i].TaskRef.Params = p.Tasks[i].TaskRef.Params.ReplaceVariables(replacements, arrayReplacements, objectReplacements) - } - p.Tasks[i].TaskRef.Name = substitution.ApplyReplacements(p.Tasks[i].TaskRef.Name, replacements) + if p.Tasks[i].TaskRef != nil && p.Tasks[i].TaskRef.Params != nil { + p.Tasks[i].TaskRef.Params = p.Tasks[i].TaskRef.Params.ReplaceVariables(replacements, arrayReplacements, objectReplacements) } p.Tasks[i] = propagateParams(p.Tasks[i], replacements, arrayReplacements, objectReplacements) } @@ -339,11 +331,8 @@ func ApplyReplacements(p *v1.PipelineSpec, replacements map[string]string, array p.Finally[i].Workspaces[j].SubPath = substitution.ApplyReplacements(p.Finally[i].Workspaces[j].SubPath, replacements) } p.Finally[i].When = p.Finally[i].When.ReplaceVariables(replacements, arrayReplacements) - if p.Finally[i].TaskRef != nil { - if p.Finally[i].TaskRef.Params != nil { - p.Finally[i].TaskRef.Params = p.Finally[i].TaskRef.Params.ReplaceVariables(replacements, arrayReplacements, objectReplacements) - } - p.Finally[i].TaskRef.Name = substitution.ApplyReplacements(p.Finally[i].TaskRef.Name, replacements) + if p.Finally[i].TaskRef != nil && p.Finally[i].TaskRef.Params != nil { + p.Finally[i].TaskRef.Params = p.Finally[i].TaskRef.Params.ReplaceVariables(replacements, arrayReplacements, objectReplacements) } p.Finally[i] = propagateParams(p.Finally[i], replacements, arrayReplacements, objectReplacements) } @@ -443,40 +432,6 @@ func PropagateResults(rpt *ResolvedPipelineTask, runStates PipelineRunState) { rpt.ResolvedTask.TaskSpec = resources.ApplyReplacements(rpt.ResolvedTask.TaskSpec, stringReplacements, arrayReplacements, map[string]map[string]string{}) } -// PropagateArtifacts propagates artifact values from previous task runs into the TaskSpec of the current task. -func PropagateArtifacts(rpt *ResolvedPipelineTask, runStates PipelineRunState) error { - if rpt.ResolvedTask == nil || rpt.ResolvedTask.TaskSpec == nil { - return nil - } - stringReplacements := map[string]string{} - for taskName, artifacts := range runStates.GetTaskRunsArtifacts() { - if artifacts != nil { - for i, input := range artifacts.Inputs { - ib, err := json.Marshal(input.Values) - if err != nil { - return err - } - stringReplacements[fmt.Sprintf("tasks.%s.inputs.%s", taskName, input.Name)] = string(ib) - if i == 0 { - stringReplacements[fmt.Sprintf("tasks.%s.inputs", taskName)] = string(ib) - } - } - for i, output := range artifacts.Outputs { - ob, err := json.Marshal(output.Values) - if err != nil { - return err - } - stringReplacements[fmt.Sprintf("tasks.%s.outputs.%s", taskName, output.Name)] = string(ob) - if i == 0 { - stringReplacements[fmt.Sprintf("tasks.%s.outputs", taskName)] = string(ob) - } - } - } - } - rpt.ResolvedTask.TaskSpec = resources.ApplyReplacements(rpt.ResolvedTask.TaskSpec, stringReplacements, map[string][]string{}, map[string]map[string]string{}) - return nil -} - // ApplyTaskResultsToPipelineResults applies the results of completed TasksRuns and Runs to a Pipeline's // list of PipelineResults, returning the computed set of PipelineRunResults. References to // non-existent TaskResults or failed TaskRuns or Runs result in a PipelineResult being considered invalid @@ -487,8 +442,7 @@ func ApplyTaskResultsToPipelineResults( results []v1.PipelineResult, taskRunResults map[string][]v1.TaskRunResult, customTaskResults map[string][]v1beta1.CustomRunResult, - taskstatus map[string]string, -) ([]v1.PipelineRunResult, error) { + taskstatus map[string]string) ([]v1.PipelineRunResult, error) { var runResults []v1.PipelineRunResult var invalidPipelineResults []string diff --git a/upstream/pkg/reconciler/pipelinerun/resources/apply_test.go b/upstream/pkg/reconciler/pipelinerun/resources/apply_test.go index 50222c8ef1d..e7d40c95d2e 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/apply_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/apply_test.go @@ -1772,6 +1772,7 @@ func TestApplyParameters(t *testing.T) { }, }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() ctx := context.Background() @@ -2081,6 +2082,7 @@ func TestApplyParameters_ArrayIndexing(t *testing.T) { }, }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() run := &v1.PipelineRun{ @@ -2333,6 +2335,7 @@ func TestApplyReplacementsMatrix(t *testing.T) { }, }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() run := &v1.PipelineRun{ @@ -3387,19 +3390,19 @@ func TestContext(t *testing.T) { } got := resources.ApplyContexts(&orig.Spec, orig.Name, tc.pr) if d := cmp.Diff(tc.expected, got.Tasks[0].Params[0]); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tc.expected, got.Finally[0].Params[0]); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tc.expected, got.Tasks[0].Matrix.Params[0]); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tc.expectedDisplayName, got.Tasks[0].DisplayName); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } if d := cmp.Diff(tc.expectedDisplayName, got.Finally[0].DisplayName); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -3651,7 +3654,7 @@ func TestApplyPipelineTaskContexts(t *testing.T) { t.Run(tc.description, func(t *testing.T) { got := resources.ApplyPipelineTaskContexts(&tc.pt, tc.prstatus, tc.facts) if d := cmp.Diff(&tc.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -3821,7 +3824,7 @@ func TestApplyFinallyResultsToPipelineResults(t *testing.T) { t.Run(tc.description, func(t *testing.T) { received, _ := resources.ApplyTaskResultsToPipelineResults(context.Background(), tc.results, tc.taskResults, tc.runResults, nil /* skippedTasks */) if d := cmp.Diff(tc.expected, received); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -4157,7 +4160,7 @@ func TestApplyTaskResultsToPipelineResults_Success(t *testing.T) { t.Errorf("Got unecpected error:%v", err) } if d := cmp.Diff(tc.expectedResults, received); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -4379,7 +4382,7 @@ func TestApplyTaskResultsToPipelineResults_Error(t *testing.T) { } if d := cmp.Diff(tc.expectedResults, received); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -4750,163 +4753,6 @@ func TestPropagateResults(t *testing.T) { } } -func TestPropagateArtifacts(t *testing.T) { - for _, tt := range []struct { - name string - resolvedTask *resources.ResolvedPipelineTask - runStates resources.PipelineRunState - expectedResolvedTask *resources.ResolvedPipelineTask - wantErr bool - }{ - { - name: "not propagate artifact when resolved task is nil", - resolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: nil, - }, - runStates: resources.PipelineRunState{}, - expectedResolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: nil, - }, - }, - { - name: "not propagate artifact when taskSpec is nil", - resolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: nil, - }, - }, - runStates: resources.PipelineRunState{}, - expectedResolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: nil, - }, - }, - }, - { - name: "propagate artifacts inputs", - resolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{ - { - Name: "get-artifacts-inputs-from-pt1", - Command: []string{"$(tasks.pt1.inputs.source)"}, - Args: []string{"$(tasks.pt1.inputs.source)"}, - }, - }, - }, - }, - }, - runStates: resources.PipelineRunState{ - { - PipelineTask: &v1.PipelineTask{ - Name: "pt1", - }, - TaskRuns: []*v1.TaskRun{ - { - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - { - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }, - }, - }, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: nil, - }, - }, - }, - }, - }, - }, - }, - expectedResolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{ - { - Name: "get-artifacts-inputs-from-pt1", - Command: []string{`[{"digest":{"sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"},"uri":"pkg:example.github.com/inputs"}]`}, - Args: []string{`[{"digest":{"sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"},"uri":"pkg:example.github.com/inputs"}]`}, - }, - }, - }, - }, - }, - }, - { - name: "propagate artifacts outputs", - resolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{ - { - Name: "get-artifacts-outputs-from-pt1", - Command: []string{"$(tasks.pt1.outputs.image)"}, - Args: []string{"$(tasks.pt1.outputs.image)"}, - }, - }, - }, - }, - }, - runStates: resources.PipelineRunState{ - { - PipelineTask: &v1.PipelineTask{ - Name: "pt1", - }, - TaskRuns: []*v1.TaskRun{ - { - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{ - { - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }, - }, - }, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }, - }, - }, - }, - }, - }, - expectedResolvedTask: &resources.ResolvedPipelineTask{ - ResolvedTask: &taskresources.ResolvedTask{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{ - { - Name: "get-artifacts-outputs-from-pt1", - Command: []string{`[{"digest":{"sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2"},"uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}]`}, - Args: []string{`[{"digest":{"sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2"},"uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}]`}, - }, - }, - }, - }, - }, - }, - } { - t.Run(tt.name, func(t *testing.T) { - err := resources.PropagateArtifacts(tt.resolvedTask, tt.runStates) - if tt.wantErr != (err != nil) { - t.Fatalf("Failed to check err want %t, got %v", tt.wantErr, err) - } - if d := cmp.Diff(tt.expectedResolvedTask, tt.resolvedTask); d != "" { - t.Fatalf("TestPropagateArtifacts() %s", diff.PrintWantGot(d)) - } - }) - } -} - func TestApplyParametersToWorkspaceBindings(t *testing.T) { testCases := []struct { name string diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelineref.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelineref.go index d295d0a3bc7..c6aab4a51b2 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelineref.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelineref.go @@ -24,14 +24,12 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - resolutionV1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" "github.com/tektoncd/pipeline/pkg/reconciler/apiserver" rprp "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinespec" "github.com/tektoncd/pipeline/pkg/remote" - "github.com/tektoncd/pipeline/pkg/remoteresolution/remote/resolution" - remoteresource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - "github.com/tektoncd/pipeline/pkg/substitution" + "github.com/tektoncd/pipeline/pkg/remote/resolution" + remoteresource "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -71,20 +69,8 @@ func GetPipelineFunc(ctx context.Context, k8s kubernetes.Interface, tekton clien stringReplacements[k] = v } replacedParams := pr.Params.ReplaceVariables(stringReplacements, arrayReplacements, objectReplacements) - var url string - // The name is url-like so its not a local reference. - if err := v1.RefNameLikeUrl(pr.Name); err == nil { - // apply variable replacements in the name. - pr.Name = substitution.ApplyReplacements(pr.Name, stringReplacements) - url = pr.Name - } - resolverPayload := remoteresource.ResolverPayload{ - ResolutionSpec: &resolutionV1beta1.ResolutionRequestSpec{ - Params: replacedParams, - URL: url, - }, - } - resolver := resolution.NewResolver(requester, pipelineRun, string(pr.Resolver), resolverPayload) + + resolver := resolution.NewResolver(requester, pipelineRun, string(pr.Resolver), "", "", replacedParams) return resolvePipeline(ctx, resolver, name, namespace, k8s, tekton, verificationPolicies) } default: @@ -157,24 +143,20 @@ func readRuntimeObjectAsPipeline(ctx context.Context, namespace string, obj runt // Verify the Pipeline once we fetch from the remote resolution, mutating, validation and conversion of the pipeline should happen after the verification, since signatures are based on the remote pipeline contents vr := trustedresources.VerifyResource(ctx, obj, k8s, refSource, verificationPolicies) // Issue a dry-run request to create the remote Pipeline, so that it can undergo validation from validating admission webhooks - // and mutation from mutating admission webhooks without actually creating the Pipeline on the cluster - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { + // without actually creating the Pipeline on the cluster. + if err := apiserver.DryRunValidate(ctx, namespace, obj, tekton); err != nil { return nil, nil, err } - if mutatedPipeline, ok := o.(*v1beta1.Pipeline); ok { - mutatedPipeline.ObjectMeta = obj.ObjectMeta - p := &v1.Pipeline{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pipeline", - APIVersion: "tekton.dev/v1", - }, - } - if err := mutatedPipeline.ConvertTo(ctx, p); err != nil { - return nil, nil, fmt.Errorf("failed to convert v1beta1 obj %s into v1 Pipeline", mutatedPipeline.GetObjectKind().GroupVersionKind().String()) - } - return p, &vr, nil + p := &v1.Pipeline{ + TypeMeta: metav1.TypeMeta{ + Kind: "Pipeline", + APIVersion: "tekton.dev/v1", + }, + } + if err := obj.ConvertTo(ctx, p); err != nil { + return nil, nil, fmt.Errorf("failed to convert v1beta1 obj %s into v1 Pipeline", obj.GetObjectKind().GroupVersionKind().String()) } + return p, &vr, nil case *v1.Pipeline: // Cleanup object from things we don't care about // FIXME: extract this in a function @@ -183,14 +165,12 @@ func readRuntimeObjectAsPipeline(ctx context.Context, namespace string, obj runt // Avoid forgetting to add it in the future when there is a v2 version, causing similar problems. obj.SetDefaults(ctx) vr := trustedresources.VerifyResource(ctx, obj, k8s, refSource, verificationPolicies) - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { + // Issue a dry-run request to create the remote Pipeline, so that it can undergo validation from validating admission webhooks + // without actually creating the Pipeline on the cluster + if err := apiserver.DryRunValidate(ctx, namespace, obj, tekton); err != nil { return nil, nil, err } - if mutatedPipeline, ok := o.(*v1.Pipeline); ok { - mutatedPipeline.ObjectMeta = obj.ObjectMeta - return mutatedPipeline, &vr, nil - } + return obj, &vr, nil } return nil, nil, errors.New("resource is not a pipeline") } diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelineref_test.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelineref_test.go index e10fbcd9134..9b173bc49dc 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelineref_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelineref_test.go @@ -34,18 +34,15 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - resolutionV1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake" "github.com/tektoncd/pipeline/pkg/reconciler/apiserver" "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/resources" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" "github.com/tektoncd/pipeline/test/parse" - resolution "github.com/tektoncd/pipeline/test/remoteresolution" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -347,8 +344,8 @@ func TestGetPipelineFunc_RemoteResolution(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - resolved := resolution.NewResolvedResource([]byte(tc.pipelineYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) + resolved := test.NewResolvedResource([]byte(tc.pipelineYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) + requester := test.NewRequester(resolved, nil) fn := resources.GetPipelineFunc(ctx, nil, clients, requester, &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.PipelineRunSpec{ @@ -402,8 +399,8 @@ func TestGetPipelineFunc_RemoteResolution_ValidationFailure(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - resolved := resolution.NewResolvedResource([]byte(tc.pipelineYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) + resolved := test.NewResolvedResource([]byte(tc.pipelineYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) + requester := test.NewRequester(resolved, nil) fn := resources.GetPipelineFunc(ctx, nil, clients, requester, &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.PipelineRunSpec{ @@ -438,7 +435,6 @@ func TestGetPipelineFunc_RemoteResolution_ReplacedParams(t *testing.T) { ctx = config.ToContext(ctx, cfg) pipeline := parse.MustParseV1PipelineAndSetDefaults(t, pipelineYAMLString) pipelineRef := &v1.PipelineRef{ - Name: "https://foo/bar", ResolverRef: v1.ResolverRef{ Resolver: "git", Params: []v1.Param{{ @@ -456,21 +452,16 @@ func TestGetPipelineFunc_RemoteResolution_ReplacedParams(t *testing.T) { pipelineYAMLString, }, "\n") - resolved := resolution.NewResolvedResource([]byte(pipelineYAML), nil, sampleRefSource.DeepCopy(), nil) - requester := &resolution.Requester{ + resolved := test.NewResolvedResource([]byte(pipelineYAML), nil, sampleRefSource.DeepCopy(), nil) + requester := &test.Requester{ ResolvedResource: resolved, - ResolverPayload: resource.ResolverPayload{ - ResolutionSpec: &resolutionV1beta1.ResolutionRequestSpec{ - Params: v1.Params{{ - Name: "foo", - Value: *v1.NewStructuredValues("bar"), - }, { - Name: "bar", - Value: *v1.NewStructuredValues("test-pipeline"), - }}, - URL: "https://foo/bar", - }, - }, + Params: v1.Params{{ + Name: "foo", + Value: *v1.NewStructuredValues("bar"), + }, { + Name: "bar", + Value: *v1.NewStructuredValues("test-pipeline"), + }}, } fn := resources.GetPipelineFunc(ctx, nil, clients, requester, &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ @@ -547,8 +538,8 @@ func TestGetPipelineFunc_RemoteResolutionInvalidData(t *testing.T) { ctx = config.ToContext(ctx, cfg) pipelineRef := &v1.PipelineRef{ResolverRef: v1.ResolverRef{Resolver: "git"}} resolvesTo := []byte("INVALID YAML") - res := resolution.NewResolvedResource(resolvesTo, nil, nil, nil) - requester := resolution.NewRequester(res, nil, resource.ResolverPayload{}) + resource := test.NewResolvedResource(resolvesTo, nil, nil, nil) + requester := test.NewRequester(resource, nil) fn := resources.GetPipelineFunc(ctx, nil, clients, requester, &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.PipelineRunSpec{ @@ -563,6 +554,7 @@ func TestGetPipelineFunc_RemoteResolutionInvalidData(t *testing.T) { } } +//nolint:musttag func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -585,8 +577,8 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedUnmatched := resolution.NewResolvedResource(unsignedPipelineBytes, nil, noMatchPolicyRefSource, nil) - requesterUnmatched := resolution.NewRequester(resolvedUnmatched, nil, resource.ResolverPayload{}) + resolvedUnmatched := test.NewResolvedResource(unsignedPipelineBytes, nil, noMatchPolicyRefSource, nil) + requesterUnmatched := test.NewRequester(resolvedUnmatched, nil) signedPipeline, err := test.GetSignedV1beta1Pipeline(unsignedPipeline, signer, "signed") if err != nil { @@ -608,8 +600,8 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedMatched := resolution.NewResolvedResource(signedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterMatched := resolution.NewRequester(resolvedMatched, nil, resource.ResolverPayload{}) + resolvedMatched := test.NewResolvedResource(signedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterMatched := test.NewRequester(resolvedMatched, nil) pipelineRef := &v1.PipelineRef{ Name: signedPipeline.Name, @@ -655,12 +647,12 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { warnPolicyRefSource := &v1.RefSource{ URI: " warnVP", } - resolvedUnsignedMatched := resolution.NewResolvedResource(unsignedPipelineBytes, nil, warnPolicyRefSource, nil) - requesterUnsignedMatched := resolution.NewRequester(resolvedUnsignedMatched, nil, resource.ResolverPayload{}) + resolvedUnsignedMatched := test.NewResolvedResource(unsignedPipelineBytes, nil, warnPolicyRefSource, nil) + requesterUnsignedMatched := test.NewRequester(resolvedUnsignedMatched, nil) testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string pipelinerun v1.PipelineRun policies []*v1alpha1.VerificationPolicy @@ -741,7 +733,7 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(context.Background(), tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) fn := resources.GetPipelineFunc(ctx, k8sclient, tektonclient, tc.requester, &tc.pipelinerun, tc.policies) gotResolvedPipeline, gotSource, gotVerificationResult, err := fn(ctx, pipelineRef.Name) @@ -767,7 +759,9 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyNoError(t *testing.T) { } } +//nolint:musttag func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { + ctx := context.Background() tektonclient := fake.NewSimpleClientset() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -784,8 +778,8 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { EntryPoint: "foo/bar", } - resolvedUnsigned := resolution.NewResolvedResource(unsignedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterUnsigned := resolution.NewRequester(resolvedUnsigned, nil, resource.ResolverPayload{}) + resolvedUnsigned := test.NewResolvedResource(unsignedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterUnsigned := test.NewRequester(resolvedUnsigned, nil) signedPipeline, err := test.GetSignedV1beta1Pipeline(unsignedPipeline, signer, "signed") if err != nil { @@ -803,8 +797,8 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedUnmatched := resolution.NewResolvedResource(signedPipelineBytes, nil, noMatchPolicyRefSource, nil) - requesterUnmatched := resolution.NewRequester(resolvedUnmatched, nil, resource.ResolverPayload{}) + resolvedUnmatched := test.NewResolvedResource(signedPipelineBytes, nil, noMatchPolicyRefSource, nil) + requesterUnmatched := test.NewRequester(resolvedUnmatched, nil) modifiedPipeline := signedPipeline.DeepCopy() modifiedPipeline.Annotations["random"] = "attack" @@ -812,14 +806,14 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { if err != nil { t.Fatal("fail to marshal pipeline", err) } - resolvedModified := resolution.NewResolvedResource(modifiedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterModified := resolution.NewRequester(resolvedModified, nil, resource.ResolverPayload{}) + resolvedModified := test.NewResolvedResource(modifiedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterModified := test.NewRequester(resolvedModified, nil) pipelineRef := &v1.PipelineRef{ResolverRef: v1.ResolverRef{Resolver: "git"}} testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string expectedVerificationResult *trustedresources.VerificationResult }{ @@ -862,7 +856,7 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(context.Background(), tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) pr := &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.PipelineRunSpec{ @@ -885,6 +879,7 @@ func TestGetPipelineFunc_V1beta1Pipeline_VerifyError(t *testing.T) { } } +//nolint:musttag func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -911,8 +906,8 @@ func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedUnmatched := resolution.NewResolvedResource(unsignedPipelineBytes, nil, noMatchPolicyRefSource, nil) - requesterUnmatched := resolution.NewRequester(resolvedUnmatched, nil, resource.ResolverPayload{}) + resolvedUnmatched := test.NewResolvedResource(unsignedPipelineBytes, nil, noMatchPolicyRefSource, nil) + requesterUnmatched := test.NewRequester(resolvedUnmatched, nil) signedPipeline, err := getSignedV1Pipeline(unsignedV1Pipeline, signer, "signed") if err != nil { @@ -940,8 +935,8 @@ func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedMatched := resolution.NewResolvedResource(signedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterMatched := resolution.NewRequester(resolvedMatched, nil, resource.ResolverPayload{}) + resolvedMatched := test.NewResolvedResource(signedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterMatched := test.NewRequester(resolvedMatched, nil) pipelineRef := &v1.PipelineRef{ Name: signedPipeline.Name, @@ -985,12 +980,12 @@ func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { warnPolicyRefSource := &v1.RefSource{ URI: " warnVP", } - resolvedUnsignedMatched := resolution.NewResolvedResource(unsignedPipelineBytes, nil, warnPolicyRefSource, nil) - requesterUnsignedMatched := resolution.NewRequester(resolvedUnsignedMatched, nil, resource.ResolverPayload{}) + resolvedUnsignedMatched := test.NewResolvedResource(unsignedPipelineBytes, nil, warnPolicyRefSource, nil) + requesterUnsignedMatched := test.NewRequester(resolvedUnsignedMatched, nil) testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string pipelinerun v1.PipelineRun policies []*v1alpha1.VerificationPolicy @@ -1071,7 +1066,7 @@ func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(context.Background(), tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) fn := resources.GetPipelineFunc(ctx, k8sclient, tektonclient, tc.requester, &tc.pipelinerun, tc.policies) gotResolvedPipeline, gotSource, gotVerificationResult, err := fn(ctx, pipelineRef.Name) @@ -1097,7 +1092,9 @@ func TestGetPipelineFunc_V1Pipeline_VerifyNoError(t *testing.T) { } } +//nolint:musttag func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { + ctx := context.Background() tektonclient := fake.NewSimpleClientset() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -1113,8 +1110,8 @@ func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { EntryPoint: "foo/bar", } - resolvedUnsigned := resolution.NewResolvedResource(unsignedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterUnsigned := resolution.NewRequester(resolvedUnsigned, nil, resource.ResolverPayload{}) + resolvedUnsigned := test.NewResolvedResource(unsignedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterUnsigned := test.NewRequester(resolvedUnsigned, nil) signedPipeline, err := getSignedV1Pipeline(unsignedV1Pipeline, signer, "signed") if err != nil { @@ -1132,8 +1129,8 @@ func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { }, EntryPoint: "foo/bar", } - resolvedUnmatched := resolution.NewResolvedResource(signedPipelineBytes, nil, noMatchPolicyRefSource, nil) - requesterUnmatched := resolution.NewRequester(resolvedUnmatched, nil, resource.ResolverPayload{}) + resolvedUnmatched := test.NewResolvedResource(signedPipelineBytes, nil, noMatchPolicyRefSource, nil) + requesterUnmatched := test.NewRequester(resolvedUnmatched, nil) modifiedPipeline := signedPipeline.DeepCopy() modifiedPipeline.Annotations["random"] = "attack" @@ -1141,14 +1138,14 @@ func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { if err != nil { t.Fatal("fail to marshal pipeline", err) } - resolvedModified := resolution.NewResolvedResource(modifiedPipelineBytes, nil, matchPolicyRefSource, nil) - requesterModified := resolution.NewRequester(resolvedModified, nil, resource.ResolverPayload{}) + resolvedModified := test.NewResolvedResource(modifiedPipelineBytes, nil, matchPolicyRefSource, nil) + requesterModified := test.NewRequester(resolvedModified, nil) pipelineRef := &v1.PipelineRef{ResolverRef: v1.ResolverRef{Resolver: "git"}} testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string expectedVerificationResult *trustedresources.VerificationResult }{ @@ -1191,7 +1188,7 @@ func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(context.Background(), tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) pr := &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.PipelineRunSpec{ @@ -1212,7 +1209,9 @@ func TestGetPipelineFunc_V1Pipeline_VerifyError(t *testing.T) { } } +//nolint:musttag func TestGetPipelineFunc_GetFuncError(t *testing.T) { + ctx := context.Background() tektonclient := fake.NewSimpleClientset() _, k8sclient, vps := test.SetupMatchAllVerificationPolicies(t, "trusted-resources") @@ -1222,8 +1221,8 @@ func TestGetPipelineFunc_GetFuncError(t *testing.T) { t.Fatal("fail to marshal pipeline", err) } - resolvedUnsigned := resolution.NewResolvedResource(unsignedPipelineBytes, nil, sampleRefSource.DeepCopy(), nil) - requesterUnsigned := resolution.NewRequester(resolvedUnsigned, nil, resource.ResolverPayload{}) + resolvedUnsigned := test.NewResolvedResource(unsignedPipelineBytes, nil, sampleRefSource.DeepCopy(), nil) + requesterUnsigned := test.NewRequester(resolvedUnsigned, nil) resolvedUnsigned.DataErr = errors.New("resolution error") prResolutionError := &v1.PipelineRun{ @@ -1243,7 +1242,7 @@ func TestGetPipelineFunc_GetFuncError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester pipelinerun v1.PipelineRun expectedErr error }{ @@ -1256,7 +1255,6 @@ func TestGetPipelineFunc_GetFuncError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() store := config.NewStore(logging.FromContext(ctx).Named("config-store")) featureflags := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -1334,7 +1332,7 @@ spec: - "bar" steps: - name: step1 - image: docker.io/library/ubuntu + image: ubuntu script: | echo "hello world!" ` @@ -1362,7 +1360,7 @@ spec: taskSpec: steps: - name: step1 - image: docker.io/library/ubuntu + image: ubuntu script: | echo "hello world!" ` diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go index a0f8180f770..7f980d1005a 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go @@ -31,7 +31,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/pkg/remote" - "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/substitution" kerrors "k8s.io/apimachinery/pkg/api/errors" "knative.dev/pkg/apis" @@ -138,37 +137,6 @@ func (t ResolvedPipelineTask) IsCustomTask() bool { return t.CustomTask } -// getReason returns the latest reason if the run has completed successfully -// If the PipelineTask has a Matrix, getReason returns the failure reason for any failure -// otherwise, it returns an empty string -func (t ResolvedPipelineTask) getReason() string { - if t.IsCustomTask() { - if len(t.CustomRuns) == 0 { - return "" - } - for _, run := range t.CustomRuns { - if !run.IsSuccessful() && len(run.Status.Conditions) >= 1 { - return run.Status.Conditions[0].Reason - } - } - if len(t.CustomRuns) >= 1 && len(t.CustomRuns[0].Status.Conditions) >= 1 { - return t.CustomRuns[0].Status.Conditions[0].Reason - } - } - if len(t.TaskRuns) == 0 { - return "" - } - for _, taskRun := range t.TaskRuns { - if !taskRun.IsSuccessful() && len(taskRun.Status.Conditions) >= 1 { - return taskRun.Status.Conditions[0].Reason - } - } - if len(t.TaskRuns) >= 1 && len(t.TaskRuns[0].Status.Conditions) >= 1 { - return t.TaskRuns[0].Status.Conditions[0].Reason - } - return "" -} - // isSuccessful returns true only if the run has completed successfully // If the PipelineTask has a Matrix, isSuccessful returns true if all runs have completed successfully func (t ResolvedPipelineTask) isSuccessful() bool { @@ -687,14 +655,8 @@ func resolveTask( case errors.Is(err, remote.ErrRequestInProgress): return rt, err case err != nil: - // some of the resolvers obtain the name from the parameters instead of from the TaskRef.Name field, - // so we account for both locations when constructing the error - name := pipelineTask.TaskRef.Name - if len(strings.TrimSpace(name)) == 0 { - name = resource.GenerateErrorLogString(string(pipelineTask.TaskRef.Resolver), pipelineTask.TaskRef.Params) - } return rt, &TaskNotFoundError{ - Name: name, + Name: pipelineTask.TaskRef.Name, Msg: err.Error(), } default: @@ -754,7 +716,7 @@ func getNewRunNames(ptName, prName string, numberOfRuns int) []string { return append(taskRunNames, taskRunName) } // For a matrix we append i to then end of the fanned out TaskRuns "matrixed-pr-taskrun-0" - for i := range numberOfRuns { + for i := 0; i < numberOfRuns; i++ { taskRunName := kmeta.ChildName(prName, fmt.Sprintf("-%s-%d", ptName, i)) // check if the taskRun name ends with a matrix instance count if !strings.HasSuffix(taskRunName, fmt.Sprintf("-%d", i)) { @@ -886,10 +848,6 @@ func createResultsCacheMatrixedTaskRuns(rpt *ResolvedPipelineTask) (resultsCache // ValidateParamEnumSubset finds the referenced pipeline-level params in the resolved pipelineTask. // It then validates if the referenced pipeline-level param enums are subsets of the resolved pipelineTask-level param enums func ValidateParamEnumSubset(pipelineTaskParams []v1.Param, pipelineParamSpecs []v1.ParamSpec, rt *resources.ResolvedTask) error { - // When the matrix Task has no TaskRun, the rt will be nil, we should skip the validation. - if rt == nil { - return nil - } for _, p := range pipelineTaskParams { // calculate referenced param enums res, present, errString := substitution.ExtractVariablesFromString(p.Value.StringVal, "params") diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go index 9f93efe5456..fe6deee7c78 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go @@ -282,21 +282,18 @@ func makeCustomRunStarted(run v1beta1.CustomRun) *v1beta1.CustomRun { func makeSucceeded(tr v1.TaskRun) *v1.TaskRun { newTr := newTaskRun(tr) newTr.Status.Conditions[0].Status = corev1.ConditionTrue - newTr.Status.Conditions[0].Reason = "Succeeded" return newTr } func makeCustomRunSucceeded(run v1beta1.CustomRun) *v1beta1.CustomRun { newRun := newCustomRun(run) newRun.Status.Conditions[0].Status = corev1.ConditionTrue - newRun.Status.Conditions[0].Reason = "Succeeded" return newRun } func makeFailed(tr v1.TaskRun) *v1.TaskRun { newTr := newTaskRun(tr) newTr.Status.Conditions[0].Status = corev1.ConditionFalse - newTr.Status.Conditions[0].Reason = "Failed" return newTr } @@ -310,7 +307,6 @@ func makeToBeRetried(tr v1.TaskRun) *v1.TaskRun { func makeCustomRunFailed(run v1beta1.CustomRun) *v1beta1.CustomRun { newRun := newCustomRun(run) newRun.Status.Conditions[0].Status = corev1.ConditionFalse - newRun.Status.Conditions[0].Reason = "Failed" return newRun } @@ -2494,18 +2490,6 @@ func TestResolvePipelineRun_TaskDoesntExist(t *testing.T) { Value: *v1.NewStructuredValues("b", "a", "r"), }}, }, - }, { - Name: "mytask3", - TaskRef: &v1.TaskRef{ResolverRef: v1.ResolverRef{Params: v1.Params{{Name: "name", Value: v1.ParamValue{Type: v1.ParamTypeString, StringVal: "foo"}}}}}, - Matrix: &v1.Matrix{ - Params: v1.Params{{ - Name: "foo", - Value: *v1.NewStructuredValues("f", "o", "o"), - }, { - Name: "bar", - Value: *v1.NewStructuredValues("b", "a", "r"), - }}, - }, }} // Return an error when the Task is retrieved, as if it didn't exist @@ -2528,9 +2512,6 @@ func TestResolvePipelineRun_TaskDoesntExist(t *testing.T) { t.Fatalf("Pipeline %s: want error, got nil", p.Name) case errors.As(err, &tnf): // expected error - if len(tnf.Name) == 0 { - t.Fatalf("Pipeline %s: TaskNotFoundError did not have name set: %s", p.Name, tnf.Error()) - } default: t.Fatalf("Pipeline %s: Want %T, got %s of type %T", p.Name, tnf, err, err) } @@ -2567,7 +2548,7 @@ func TestResolvePipelineRun_VerificationFailed(t *testing.T) { for _, pt := range pts { rt, _ := ResolvePipelineTask(context.Background(), pr, getTask, getTaskRun, nopGetCustomRun, pt, nil) if d := cmp.Diff(verificationResult, rt.ResolvedTask.VerificationResult, cmpopts.EquateErrors()); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } } @@ -3684,7 +3665,7 @@ func TestResolvePipelineRunTask_WithMatrix(t *testing.T) { var taskRuns []*v1.TaskRun var taskRunsNames []string taskRunsMap := map[string]*v1.TaskRun{} - for i := range 9 { + for i := 0; i < 9; i++ { trName := fmt.Sprintf("%s-%s-%d", pipelineRunName, pipelineTaskName, i) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ @@ -3842,7 +3823,7 @@ func TestResolvePipelineRunTask_WithMatrixedCustomTask(t *testing.T) { var runs []*v1beta1.CustomRun var runNames []string runsMap := map[string]*v1beta1.CustomRun{} - for i := range 9 { + for i := 0; i < 9; i++ { runName := fmt.Sprintf("%s-%s-%d", pipelineRunName, pipelineTaskName, i) run := &v1beta1.CustomRun{ ObjectMeta: metav1.ObjectMeta{ @@ -4814,197 +4795,6 @@ func TestIsRunning(t *testing.T) { } } -func TestGetReason(t *testing.T) { - for _, tc := range []struct { - name string - rpt ResolvedPipelineTask - want string - }{ - { - name: "taskrun created but the conditions were not initialized", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "namespace", - Name: "taskRun", - }, - }}, - }, - }, - { - name: "taskrun not started", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - }, - }, - { - name: "run not started", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomTask: true, - }, - }, - { - name: "taskrun running", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{makeStarted(trs[0])}, - }, - }, - { - name: "run running", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomTask: true, - CustomRuns: []*v1beta1.CustomRun{makeCustomRunStarted(customRuns[0])}, - }, - }, - { - name: "taskrun succeeded", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{makeSucceeded(trs[0])}, - }, - want: "Succeeded", - }, - { - name: "run succeeded", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomTask: true, - CustomRuns: []*v1beta1.CustomRun{makeCustomRunSucceeded(customRuns[0])}, - }, - want: "Succeeded", - }, - { - name: "taskrun failed", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{makeFailed(trs[0])}, - }, - want: "Failed", - }, - { - name: "run failed", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomTask: true, - CustomRuns: []*v1beta1.CustomRun{makeCustomRunFailed(customRuns[0])}, - }, - want: "Failed", - }, - { - name: "taskrun failed: retried", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task", Retries: 1}, - TaskRuns: []*v1.TaskRun{withRetries(makeFailed(trs[0]))}, - }, - want: "Failed", - }, - { - name: "run failed: retried", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task", Retries: 1}, - CustomTask: true, - CustomRuns: []*v1beta1.CustomRun{withCustomRunRetries(makeCustomRunFailed(customRuns[0]))}, - }, - want: "Failed", - }, - { - name: "taskrun cancelled", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{withCancelled(makeFailed(trs[0]))}, - }, - want: v1.TaskRunReasonCancelled.String(), - }, - { - name: "taskrun cancelled but not failed", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - TaskRuns: []*v1.TaskRun{withCancelled(newTaskRun(trs[0]))}, - }, - want: v1.TaskRunReasonCancelled.String(), - }, - { - name: "run cancelled", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomRuns: []*v1beta1.CustomRun{withCustomRunCancelled(makeCustomRunFailed(customRuns[0]))}, - CustomTask: true, - }, - want: "CustomRunCancelled", - }, - { - name: "run cancelled but not failed", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1.PipelineTask{Name: "task"}, - CustomRuns: []*v1beta1.CustomRun{withCustomRunCancelled(newCustomRun(customRuns[0]))}, - CustomTask: true, - }, - want: "CustomRunCancelled", - }, - { - name: "matrixed taskruns succeeded", - rpt: ResolvedPipelineTask{ - PipelineTask: matrixedPipelineTask, - TaskRuns: []*v1.TaskRun{makeSucceeded(trs[0]), makeSucceeded(trs[1])}, - }, - want: "Succeeded", - }, - { - name: "matrixed runs succeeded", - rpt: ResolvedPipelineTask{ - CustomTask: true, - PipelineTask: matrixedPipelineTask, - CustomRuns: []*v1beta1.CustomRun{makeCustomRunSucceeded(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, - }, - want: "Succeeded", - }, - { - name: "matrixed taskruns failed", - rpt: ResolvedPipelineTask{ - PipelineTask: matrixedPipelineTask, - TaskRuns: []*v1.TaskRun{makeFailed(trs[0]), makeFailed(trs[1])}, - }, - want: "Failed", - }, - { - name: "matrixed runs failed", - rpt: ResolvedPipelineTask{ - CustomTask: true, - PipelineTask: matrixedPipelineTask, - CustomRuns: []*v1beta1.CustomRun{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, - }, - want: "Failed", - }, - { - name: "matrixed taskruns cancelled", - rpt: ResolvedPipelineTask{ - PipelineTask: matrixedPipelineTask, - TaskRuns: []*v1.TaskRun{withCancelled(makeFailed(trs[0])), withCancelled(makeFailed(trs[1]))}, - }, - want: v1.TaskRunReasonCancelled.String(), - }, - { - name: "matrixed runs cancelled", - rpt: ResolvedPipelineTask{ - CustomTask: true, - PipelineTask: matrixedPipelineTask, - CustomRuns: []*v1beta1.CustomRun{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, - }, - want: "CustomRunCancelled", - }, - } { - t.Run(tc.name, func(t *testing.T) { - if got := tc.rpt.getReason(); got != tc.want { - t.Errorf("expected getReason: %s but got %s", tc.want, got) - } - }) - } -} - func TestCreateResultsCacheMatrixedTaskRuns(t *testing.T) { for _, tc := range []struct { name string @@ -5446,29 +5236,6 @@ func TestValidateParamEnumSubset_Valid(t *testing.T) { }, }, }, - }, { - name: "rt is nil - pass", - params: []v1.Param{ - { - Name: "resolved-task-p1", - Value: v1.ParamValue{ - StringVal: "$(params.p1) and $(params.p2)", - }, - }, - }, - pipelinePs: []v1.ParamSpec{ - { - Name: "p1", - Type: v1.ParamTypeString, - Enum: []string{"v1", "v2"}, - }, - { - Name: "p2", - Type: v1.ParamTypeString, - Enum: []string{"v3", "v4"}, - }, - }, - rt: nil, }, } @@ -5553,7 +5320,6 @@ func TestValidateParamEnumSubset_Invalid(t *testing.T) { }, }, }, - rt: &resources.ResolvedTask{}, wantErr: errors.New("unexpected error in ExtractVariablesFromString: Invalid referencing of parameters in \"$(params.p1.aaa.bbb)\"! Only two dot-separated components after the prefix \"params\" are allowed."), }} diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go index 0f1b82621cc..75364fef691 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go @@ -43,7 +43,6 @@ const ( PipelineTaskStatusPrefix = "tasks." // PipelineTaskStatusSuffix is a suffix of the param representing execution state of pipelineTask PipelineTaskStatusSuffix = ".status" - PipelineTaskReasonSuffix = ".reason" ) // PipelineRunState is a slice of ResolvedPipelineRunTasks the represents the current execution @@ -182,30 +181,6 @@ func (state PipelineRunState) GetTaskRunsResults() map[string][]v1.TaskRunResult return results } -// GetTaskRunsArtifacts returns a map of all successfully completed TaskRuns in the state, with the pipeline task name as -// the key and the artifacts from the corresponding TaskRun as the value. It only includes tasks which have completed successfully. -func (state PipelineRunState) GetTaskRunsArtifacts() map[string]*v1.Artifacts { - results := make(map[string]*v1.Artifacts) - for _, rpt := range state { - if rpt.IsCustomTask() { - continue - } - if !rpt.isSuccessful() { - continue - } - if rpt.PipelineTask.IsMatrixed() { - var ars v1.Artifacts - for _, tr := range rpt.TaskRuns { - ars.Merge(tr.Status.Artifacts) - } - results[rpt.PipelineTask.Name] = &ars - } else { - results[rpt.PipelineTask.Name] = rpt.TaskRuns[0].Status.Artifacts - } - } - return results -} - // ConvertResultsMapToTaskRunResults converts the map of results from Matrixed PipelineTasks to a list // of TaskRunResults to standard the format func ConvertResultsMapToTaskRunResults(resultsMap map[string][]string) []v1.TaskRunResult { @@ -630,7 +605,6 @@ func (facts *PipelineRunFacts) GetPipelineTaskStatus() map[string]string { s = PipelineTaskStateNone } tStatus[PipelineTaskStatusPrefix+t.PipelineTask.Name+PipelineTaskStatusSuffix] = s - tStatus[PipelineTaskStatusPrefix+t.PipelineTask.Name+PipelineTaskReasonSuffix] = t.getReason() } } // initialize aggregate status of all dag tasks to None diff --git a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go index 1c9be5a6793..7c42fe300e9 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go @@ -2351,9 +2351,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[1]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "", PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2362,9 +2360,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[1]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "", PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2373,9 +2369,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[1]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: v1.TaskRunReasonSuccessful.String(), - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "Succeeded", PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2384,9 +2378,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[1]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: v1.TaskRunReasonFailed.String(), - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "Failed", PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: v1.PipelineRunReasonFailed.String(), }, }, { @@ -2395,9 +2387,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[1]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: v1.TaskRunReasonSuccessful.String(), - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "Succeeded", PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskStatusSuffix: v1.TaskRunReasonSuccessful.String(), - PipelineTaskStatusPrefix + pts[1].Name + PipelineTaskReasonSuffix: "Succeeded", v1.PipelineTasksAggregateStatus: v1.PipelineRunReasonSuccessful.String(), }, }, { @@ -2413,7 +2403,6 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[9]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[9].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[9].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2428,7 +2417,6 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[10]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[10].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[10].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: v1.PipelineRunReasonCompleted.String(), }, }, { @@ -2449,9 +2437,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[11]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: "", PipelineTaskStatusPrefix + pts[11].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[11].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2460,7 +2446,6 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[4]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[4].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[4].Name + PipelineTaskReasonSuffix: v1.TaskRunReasonCancelled.String(), v1.PipelineTasksAggregateStatus: PipelineTaskStateNone, }, }, { @@ -2482,9 +2467,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) { dagTasks: []v1.PipelineTask{pts[0], pts[10]}, expectedStatus: map[string]string{ PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskStatusSuffix: v1.PipelineRunReasonFailed.String(), - PipelineTaskStatusPrefix + pts[0].Name + PipelineTaskReasonSuffix: v1.PipelineRunReasonFailed.String(), PipelineTaskStatusPrefix + pts[10].Name + PipelineTaskStatusSuffix: PipelineTaskStateNone, - PipelineTaskStatusPrefix + pts[10].Name + PipelineTaskReasonSuffix: "", v1.PipelineTasksAggregateStatus: v1.PipelineRunReasonFailed.String(), }, }} @@ -3163,300 +3146,6 @@ func TestPipelineRunState_GetResultsFuncs(t *testing.T) { } } -func TestPipelineRunState_GetTaskRunsArtifacts(t *testing.T) { - testCases := []struct { - name string - state PipelineRunState - expectedArtifacts map[string]*v1.Artifacts - }{ - { - name: "successful-task-with-artifacts", - state: PipelineRunState{{ - TaskRunNames: []string{"successful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "successful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }}, - expectedArtifacts: map[string]*v1.Artifacts{"successful-task-with-artifacts-1": { - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }}, - }, - { - name: "two-successful-tasks-with-artifacts", - state: PipelineRunState{{ - TaskRunNames: []string{"first-successful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "successful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }, { - TaskRunNames: []string{"second-successful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "successful-task-with-artifacts-2", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }}, - expectedArtifacts: map[string]*v1.Artifacts{"successful-task-with-artifacts-1": { - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, "successful-task-with-artifacts-2": { - Inputs: []v1.Artifact{{Name: "source2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }}, - }, - { - name: "Skip retrieving artifacts from unsuccessful task", - state: PipelineRunState{{ - TaskRunNames: []string{"unsuccessful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "unsuccessful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }}, - expectedArtifacts: map[string]*v1.Artifacts{}, - }, - { - name: "One successful task and one failed task, only retrieving artifacts from the successful one", - state: PipelineRunState{ - { - TaskRunNames: []string{"successful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "successful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }, - { - TaskRunNames: []string{"unsuccessful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "unsuccessful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source0", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image0", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }}, - expectedArtifacts: map[string]*v1.Artifacts{"successful-task-with-artifacts-1": { - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }}, - }, - { - name: "One standard successful taskRun with artifacts and one custom task, custom task has no effect", - state: PipelineRunState{{ - CustomRunNames: []string{"successful-run-without-results"}, - CustomTask: true, - PipelineTask: &v1.PipelineTask{ - Name: "successful-run-without-results-1", - }, - CustomRuns: []*v1beta1.CustomRun{ - { - Status: v1beta1.CustomRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - CustomRunStatusFields: v1beta1.CustomRunStatusFields{}, - }, - }}, - }, - { - TaskRunNames: []string{"successful-task-with-artifacts"}, - PipelineTask: &v1.PipelineTask{ - Name: "successful-task-with-artifacts-1", - }, - TaskRuns: []*v1.TaskRun{{ - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }, - }, - expectedArtifacts: map[string]*v1.Artifacts{"successful-task-with-artifacts-1": { - Inputs: []v1.Artifact{{Name: "source", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }}, - }, - { - name: "matrixed tasks", - state: PipelineRunState{{ - TaskRunNames: []string{ - "matrixed-task-run-0", - "matrixed-task-run-1", - "matrixed-task-run-2", - "matrixed-task-run-3", - }, - PipelineTask: &v1.PipelineTask{ - Name: "matrixed-task-with-artifacts", - TaskRef: &v1.TaskRef{ - Name: "task", - Kind: "Task", - APIVersion: "v1", - }, - Matrix: &v1.Matrix{ - Params: v1.Params{{ - Name: "foobar", - Value: v1.ParamValue{Type: v1.ParamTypeArray, ArrayVal: []string{"foo", "bar"}}, - }, { - Name: "quxbaz", - Value: v1.ParamValue{Type: v1.ParamTypeArray, ArrayVal: []string{"qux", "baz"}}, - }}}, - }, - TaskRuns: []*v1.TaskRun{{ - TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1"}, - ObjectMeta: metav1.ObjectMeta{Name: "matrixed-task-run-0"}, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: v1.TaskRunReasonSuccessful.String(), - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source1", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image1", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }, { - TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1"}, - ObjectMeta: metav1.ObjectMeta{Name: "matrixed-task-run-1"}, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: v1.TaskRunReasonSuccessful.String(), - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }, { - TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1"}, - ObjectMeta: metav1.ObjectMeta{Name: "matrixed-task-run-2"}, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: v1.TaskRunReasonSuccessful.String(), - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source3", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image3", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }, { - TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1"}, - ObjectMeta: metav1.ObjectMeta{Name: "matrixed-task-run-3"}, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: v1.TaskRunReasonSuccessful.String(), - }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{ - Inputs: []v1.Artifact{{Name: "source4", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image4", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }, - }}, - }}, - }}, - expectedArtifacts: map[string]*v1.Artifacts{"matrixed-task-with-artifacts": { - Inputs: []v1.Artifact{{Name: "source1", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}, {Name: "source2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}, {Name: "source3", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}, {Name: "source4", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, Uri: "pkg:example.github.com/inputs"}}}}, - Outputs: []v1.Artifact{{Name: "image1", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}, {Name: "image2", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}, {Name: "image3", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}, {Name: "image4", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2"}, Uri: "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c"}}}}, - }}, - }, - } - - for _, tt := range testCases { - got := tt.state.GetTaskRunsArtifacts() - if d := cmp.Diff(tt.expectedArtifacts, got, cmpopts.SortSlices(func(a, b v1.Artifact) bool { return a.Name > b.Name })); d != "" { - t.Errorf("GetTaskRunsArtifacts() did not produce expected artifacts for test %s: %s", tt.name, diff.PrintWantGot(d)) - } - } -} - func TestPipelineRunState_GetChildReferences(t *testing.T) { testCases := []struct { name string diff --git a/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution.go b/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution.go index e441b8eb0b9..790f5c6c105 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution.go @@ -17,7 +17,6 @@ limitations under the License. package resources import ( - "encoding/json" "errors" "fmt" "sort" @@ -27,9 +26,11 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) -// ErrInvalidTaskResultReference indicates that the reason for the failure status is that there -// is an invalid task result reference -var ErrInvalidTaskResultReference = pipelineErrors.WrapUserError(errors.New("Invalid task result reference")) +var ( + // ErrInvalidTaskResultReference indicates that the reason for the failure status is that there + // is an invalid task result reference + ErrInvalidTaskResultReference = pipelineErrors.WrapUserError(errors.New("Invalid task result reference")) +) // ResolvedResultRefs represents all of the ResolvedResultRef for a pipeline task type ResolvedResultRefs []*ResolvedResultRef @@ -163,28 +164,13 @@ func resolveCustomResultRef(customRuns []*v1beta1.CustomRun, resultRef *v1.Resul return nil, err } return &ResolvedResultRef{ - Value: *paramValueFromCustomRunResult(runValue), + Value: *v1.NewStructuredValues(runValue), FromTaskRun: "", FromRun: runName, ResultReference: *resultRef, }, nil } -func paramValueFromCustomRunResult(result string) *v1.ParamValue { - var arrayResult []string - // for fan out array result, which is represented as string, we should make it to array type param value - if err := json.Unmarshal([]byte(result), &arrayResult); err == nil && len(arrayResult) > 0 { - if len(arrayResult) > 1 { - return v1.NewStructuredValues(arrayResult[0], arrayResult[1:]...) - } - return &v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{arrayResult[0]}, - } - } - return v1.NewStructuredValues(result) -} - func resolveResultRef(taskRuns []*v1.TaskRun, resultRef *v1.ResultRef) (*ResolvedResultRef, error) { taskRun := taskRuns[0] taskRunName := taskRun.Name @@ -209,7 +195,6 @@ func findRunResultForParam(customRun *v1beta1.CustomRun, reference *v1.ResultRef err := fmt.Errorf("%w: Could not find result with name %s for task %s", ErrInvalidTaskResultReference, reference.Result, reference.PipelineTask) return "", err } - func findTaskResultForParam(taskRun *v1.TaskRun, reference *v1.ResultRef) (v1.ResultValue, error) { results := taskRun.Status.TaskRunStatusFields.Results for _, result := range results { @@ -254,7 +239,7 @@ func (rs ResolvedResultRefs) getStringReplacements() map[string]string { for _, r := range rs { switch r.Value.Type { case v1.ParamTypeArray: - for i := range len(r.Value.ArrayVal) { + for i := 0; i < len(r.Value.ArrayVal); i++ { for _, target := range r.getReplaceTargetfromArrayIndex(i) { replacements[target] = r.Value.ArrayVal[i] } diff --git a/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go b/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go index e11c80e18f9..1658445abcf 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go @@ -936,53 +936,3 @@ func TestValidateArrayResultsIndex(t *testing.T) { }) } } - -func TestParamValueFromCustomRunResult(t *testing.T) { - type args struct { - result string - } - tests := []struct { - name string - args args - want *v1.ParamValue - }{ - { - name: "multiple array elements result", - args: args{ - result: `["amd64", "arm64"]`, - }, - want: &v1.ParamValue{ - Type: "array", - ArrayVal: []string{"amd64", "arm64"}, - }, - }, - { - name: "single array elements result", - args: args{ - result: `[ "amd64" ]`, - }, - want: &v1.ParamValue{ - Type: "array", - ArrayVal: []string{"amd64"}, - }, - }, - { - name: "simple string result", - args: args{ - result: "amd64", - }, - want: &v1.ParamValue{ - Type: "string", - StringVal: "amd64", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := paramValueFromCustomRunResult(tt.args.result) - if d := cmp.Diff(tt.want, got); d != "" { - t.Fatalf("paramValueFromCustomRunResult %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/reconciler/pipelinerun/resources/validate_params_test.go b/upstream/pkg/reconciler/pipelinerun/resources/validate_params_test.go index 18fcd6241e9..9f32d1d6290 100644 --- a/upstream/pkg/reconciler/pipelinerun/resources/validate_params_test.go +++ b/upstream/pkg/reconciler/pipelinerun/resources/validate_params_test.go @@ -610,6 +610,7 @@ func TestValidateParamArrayIndex_valid(t *testing.T) { params: v1.Params{{Name: "second-param", Value: *v1.NewStructuredValues("second-value", "second-value-again")}}, }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() err := resources.ValidateParamArrayIndex(&tt.original, tt.params) @@ -836,6 +837,7 @@ func TestValidateParamArrayIndex_invalid(t *testing.T) { expected: errors.New("non-existent param references:[$(params.first-param[2]) $(params.second-param[3])]"), }, } { + tt := tt // capture range variable t.Run(tt.name, func(t *testing.T) { t.Parallel() err := resources.ValidateParamArrayIndex(&tt.original, tt.params) diff --git a/upstream/pkg/reconciler/pipelinerun/timeout.go b/upstream/pkg/reconciler/pipelinerun/timeout.go index 845ef3c22dd..8ae29a62d30 100644 --- a/upstream/pkg/reconciler/pipelinerun/timeout.go +++ b/upstream/pkg/reconciler/pipelinerun/timeout.go @@ -21,7 +21,6 @@ import ( "strings" "time" - pipelineErrors "github.com/tektoncd/pipeline/pkg/apis/pipeline/errors" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" @@ -126,10 +125,6 @@ func timeoutPipelineTasksForTaskNames(ctx context.Context, logger *zap.SugaredLo logger.Infof("patching TaskRun %s for timeout", taskRunName) if err := timeoutTaskRun(ctx, taskRunName, pr.Namespace, clientSet); err != nil { - if pipelineErrors.IsImmutableTaskRunSpecError(err) { - // The TaskRun may have completed and the spec field is immutable, we should ignore this error. - continue - } errs = append(errs, fmt.Errorf("failed to patch TaskRun `%s` with timeout: %w", taskRunName, err).Error()) continue } diff --git a/upstream/pkg/reconciler/pipelinerun/timeout_test.go b/upstream/pkg/reconciler/pipelinerun/timeout_test.go index 5e6955f7210..a369aeee268 100644 --- a/upstream/pkg/reconciler/pipelinerun/timeout_test.go +++ b/upstream/pkg/reconciler/pipelinerun/timeout_test.go @@ -245,6 +245,7 @@ func TestTimeoutPipelineRun(t *testing.T) { wantErr: true, }} for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { d := test.Data{ PipelineRuns: []*v1.PipelineRun{tc.pipelineRun}, diff --git a/upstream/pkg/reconciler/pipelinerun/tracing.go b/upstream/pkg/reconciler/pipelinerun/tracing.go index 7ab4d1755c5..8aedd34948e 100644 --- a/upstream/pkg/reconciler/pipelinerun/tracing.go +++ b/upstream/pkg/reconciler/pipelinerun/tracing.go @@ -45,7 +45,7 @@ func initTracing(ctx context.Context, tracerProvider trace.TracerProvider, pr *v pro := otel.GetTextMapPropagator() // SpanContext was created already - if len(pr.Status.SpanContext) > 0 { + if pr.Status.SpanContext != nil && len(pr.Status.SpanContext) > 0 { return pro.Extract(ctx, propagation.MapCarrier(pr.Status.SpanContext)) } diff --git a/upstream/pkg/reconciler/taskrun/controller.go b/upstream/pkg/reconciler/taskrun/controller.go index 84ab26185d2..451c78f9795 100644 --- a/upstream/pkg/reconciler/taskrun/controller.go +++ b/upstream/pkg/reconciler/taskrun/controller.go @@ -31,7 +31,7 @@ import ( "github.com/tektoncd/pipeline/pkg/pod" cloudeventclient "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" - resolution "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" + resolution "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/spire" "github.com/tektoncd/pipeline/pkg/taskrunmetrics" "github.com/tektoncd/pipeline/pkg/tracing" @@ -65,13 +65,8 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock) func(contex secretinformer := secretinformer.Get(ctx) spireClient := spire.GetControllerAPIClient(ctx) tracerProvider := tracing.New(TracerProviderName, logger.Named("tracing")) - taskrunmetricsRecorder := taskrunmetrics.Get(ctx) //nolint:contextcheck // OnStore methods does not support context as a parameter - configStore := config.NewStore(logger.Named("config-store"), - taskrunmetrics.OnStore(logger, taskrunmetricsRecorder), - spire.OnStore(ctx, logger), - tracerProvider.OnStore(secretinformer.Lister()), - ) + configStore := config.NewStore(logger.Named("config-store"), taskrunmetrics.MetricsOnStore(logger), spire.OnStore(ctx, logger), tracerProvider.OnStore(secretinformer.Lister())) configStore.WatchConfigs(cmw) entrypointCache, err := pod.NewEntrypointCache(kubeclientset) @@ -89,7 +84,7 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock) func(contex limitrangeLister: limitrangeInformer.Lister(), verificationPolicyLister: verificationpolicyInformer.Lister(), cloudEventClient: cloudeventclient.Get(ctx), - metrics: taskrunmetricsRecorder, + metrics: taskrunmetrics.Get(ctx), entrypointCache: entrypointCache, podLister: podInformer.Lister(), pvcHandler: volumeclaim.NewPVCHandler(kubeclientset, logger), diff --git a/upstream/pkg/reconciler/taskrun/resources/apply.go b/upstream/pkg/reconciler/taskrun/resources/apply.go index e6036faf832..b54a618dba1 100644 --- a/upstream/pkg/reconciler/taskrun/resources/apply.go +++ b/upstream/pkg/reconciler/taskrun/resources/apply.go @@ -21,11 +21,9 @@ import ( "fmt" "path/filepath" "regexp" - "sort" "strconv" "strings" - "github.com/tektoncd/pipeline/internal/artifactref" "github.com/tektoncd/pipeline/pkg/apis/pipeline" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/container" @@ -51,14 +49,6 @@ var ( "inputs.params.%s", } - substitutionToParamNamePatterns = []string{ - `^params\.(\w+)$`, - `^params\["([^"]+)"\]$`, - `^params\['([^']+)'\]$`, - // FIXME(vdemeester) Remove that with deprecating v1beta1 - `^inputs\.params\.(\w+)$`, - } - paramIndexRegexPatterns = []string{ `\$\(params.%s\[([0-9]*)*\*?\]\)`, `\$\(params\[%q\]\[([0-9]*)*\*?\]\)`, @@ -67,7 +57,7 @@ var ( ) // applyStepActionParameters applies the params from the Task and the underlying Step to the referenced StepAction. -func applyStepActionParameters(step *v1.Step, spec *v1.TaskSpec, tr *v1.TaskRun, stepParams v1.Params, defaults []v1.ParamSpec) (*v1.Step, error) { +func applyStepActionParameters(step *v1.Step, spec *v1.TaskSpec, tr *v1.TaskRun, stepParams v1.Params, defaults []v1.ParamSpec) *v1.Step { if stepParams != nil { stringR, arrayR, objectR := getTaskParameters(spec, tr, spec.Params...) stepParams = stepParams.ReplaceVariables(stringR, arrayR, objectR) @@ -88,45 +78,8 @@ func applyStepActionParameters(step *v1.Step, spec *v1.TaskSpec, tr *v1.TaskRun, for k, v := range stepResultReplacements { stringReplacements[k] = v } - - // Check if there are duplicate keys in the replacements - // If the same key is present in both stringReplacements and arrayReplacements, it means - // that the default value and the passed value have different types. - err := checkForDuplicateKeys(stringReplacements, arrayReplacements) - if err != nil { - return nil, err - } - container.ApplyStepReplacements(step, stringReplacements, arrayReplacements) - return step, nil -} - -// checkForDuplicateKeys checks if there are duplicate keys in the replacements -func checkForDuplicateKeys(stringReplacements map[string]string, arrayReplacements map[string][]string) error { - keys := make([]string, 0, len(stringReplacements)) - for k := range stringReplacements { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - if _, ok := arrayReplacements[k]; ok { - paramName := paramNameFromReplacementKey(k) - return fmt.Errorf("invalid parameter substitution: %s. Please check the types of the default value and the passed value", paramName) - } - } - return nil -} - -// paramNameFromReplacementKey returns the param name from the replacement key in best effort -func paramNameFromReplacementKey(key string) string { - for _, regexPattern := range substitutionToParamNamePatterns { - re := regexp.MustCompile(regexPattern) - if matches := re.FindStringSubmatch(key); matches != nil { - return matches[1] - } - } - // If no match is found, return the key - return key + return step } // findArrayIndexParamUsage finds the array index in a string using array param substitution @@ -246,7 +199,7 @@ func replacementsFromDefaultParams(defaults v1.ParamSpecs) (map[string]string, m switch p.Default.Type { case v1.ParamTypeArray: for _, pattern := range paramPatterns { - for i := range len(p.Default.ArrayVal) { + for i := 0; i < len(p.Default.ArrayVal); i++ { stringReplacements[fmt.Sprintf(pattern+"[%d]", p.Name, i)] = p.Default.ArrayVal[i] } arrayReplacements[fmt.Sprintf(pattern, p.Name)] = p.Default.ArrayVal @@ -281,7 +234,7 @@ func replacementsFromParams(params v1.Params) (map[string]string, map[string][]s switch p.Value.Type { case v1.ParamTypeArray: for _, pattern := range paramPatterns { - for i := range len(p.Value.ArrayVal) { + for i := 0; i < len(p.Value.ArrayVal); i++ { stringReplacements[fmt.Sprintf(pattern+"[%d]", p.Name, i)] = p.Value.ArrayVal[i] } arrayReplacements[fmt.Sprintf(pattern, p.Name)] = p.Value.ArrayVal @@ -446,20 +399,19 @@ func getTaskResultReplacements(spec *v1.TaskSpec) map[string]string { return stringReplacements } -// ApplyArtifacts replaces the occurrences of artifacts.path and step.artifacts.path with the absolute tekton internal path +// ApplyArtifacts replaces the occurrences of step.artifacts.path with the absolute tekton internal path func ApplyArtifacts(spec *v1.TaskSpec) *v1.TaskSpec { for i := range spec.Steps { - stringReplacements := getArtifactReplacements(spec.Steps[i], i) + stringReplacements := getStepArtifactReplacements(spec.Steps[i], i) container.ApplyStepReplacements(&spec.Steps[i], stringReplacements, map[string][]string{}) } return spec } -func getArtifactReplacements(step v1.Step, idx int) map[string]string { +func getStepArtifactReplacements(step v1.Step, idx int) map[string]string { stringReplacements := map[string]string{} stepName := pod.StepName(step.Name, idx) - stringReplacements[artifactref.StepArtifactPathPattern] = filepath.Join(pipeline.StepsDir, stepName, "artifacts", "provenance.json") - stringReplacements[artifactref.TaskArtifactPathPattern] = filepath.Join(pipeline.ArtifactsDir, "provenance.json") + stringReplacements["step.artifacts.path"] = filepath.Join(pipeline.StepsDir, stepName, "artifacts", "provenance.json") return stringReplacements } @@ -470,7 +422,8 @@ func ApplyStepExitCodePath(spec *v1.TaskSpec) *v1.TaskSpec { stringReplacements := map[string]string{} for i, step := range spec.Steps { - stringReplacements[fmt.Sprintf("steps.%s.exitCode.path", pod.StepName(step.Name, i))] = filepath.Join(pipeline.StepsDir, pod.StepName(step.Name, i), "exitCode") + stringReplacements[fmt.Sprintf("steps.%s.exitCode.path", pod.StepName(step.Name, i))] = + filepath.Join(pipeline.StepsDir, pod.StepName(step.Name, i), "exitCode") } return ApplyReplacements(spec, stringReplacements, map[string][]string{}, map[string]map[string]string{}) } diff --git a/upstream/pkg/reconciler/taskrun/resources/apply_test.go b/upstream/pkg/reconciler/taskrun/resources/apply_test.go index 9b1d9f1be1b..9601df0b4bf 100644 --- a/upstream/pkg/reconciler/taskrun/resources/apply_test.go +++ b/upstream/pkg/reconciler/taskrun/resources/apply_test.go @@ -551,14 +551,12 @@ var ( arrayTaskRun0Elements = &v1.TaskRun{ Spec: v1.TaskRunSpec{ - Params: []v1.Param{ - { - Name: "array-param", - Value: v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{}, - }, - }, + Params: []v1.Param{{ + Name: "array-param", + Value: v1.ParamValue{ + Type: v1.ParamTypeArray, + ArrayVal: []string{}, + }}, }, }, } @@ -1103,15 +1101,13 @@ func TestApplyWorkspaces(t *testing.T) { Name: "$(workspaces.myws.volume)", }, }, - }, - }, { + }}, { Name: "some-secret", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: "$(workspaces.myws.volume)", }, - }, - }, { + }}, { Name: "some-pvc", VolumeSource: corev1.VolumeSource{ PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ @@ -1483,7 +1479,7 @@ func TestContext(t *testing.T) { t.Run(tc.description, func(t *testing.T) { got := resources.ApplyContexts(&tc.spec, tc.taskName, &tc.tr) if d := cmp.Diff(&tc.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -1492,14 +1488,12 @@ func TestContext(t *testing.T) { func TestTaskResults(t *testing.T) { names.TestingSeed() ts := &v1.TaskSpec{ - Results: []v1.TaskResult{ - { - Name: "current.date.unix.timestamp", - Description: "The current date in unix timestamp format", - }, { - Name: "current-date-human-readable", - Description: "The current date in humand readable format", - }, + Results: []v1.TaskResult{{ + Name: "current.date.unix.timestamp", + Description: "The current date in unix timestamp format", + }, { + Name: "current-date-human-readable", + Description: "The current date in humand readable format"}, }, Steps: []v1.Step{{ Name: "print-date-unix-timestamp", @@ -1636,7 +1630,7 @@ func TestApplyCredentialsPath(t *testing.T) { t.Run(tc.description, func(t *testing.T) { got := resources.ApplyCredentialsPath(&tc.spec, tc.path) if d := cmp.Diff(&tc.want, got); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } @@ -1794,11 +1788,10 @@ func TestApplyParametersToWorkspaceBindings(t *testing.T) { }, }, }, - Params: v1.Params{ - {Name: "secret-name", Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "secret-value", - }}, + Params: v1.Params{{Name: "secret-name", Value: v1.ParamValue{ + Type: v1.ParamTypeString, + StringVal: "secret-value", + }}, }, }, }, @@ -2028,15 +2021,14 @@ func TestApplyParametersToWorkspaceBindings(t *testing.T) { func TestArtifacts(t *testing.T) { ts := &v1.TaskSpec{ - Steps: []v1.Step{ - { - Name: "name1", - Image: "bash:latest", - Args: []string{ - "$(step.artifacts.path)", - }, - Script: "#!/usr/bin/env bash\n echo -n $(step.artifacts.path)", + Steps: []v1.Step{{ + Name: "name1", + Image: "bash:latest", + Args: []string{ + "$(step.artifacts.path)", }, + Script: "#!/usr/bin/env bash\n echo -n $(step.artifacts.path)", + }, }, } diff --git a/upstream/pkg/reconciler/taskrun/resources/taskref.go b/upstream/pkg/reconciler/taskrun/resources/taskref.go index 2a1e9d8ca9b..b918ec7b6b2 100644 --- a/upstream/pkg/reconciler/taskrun/resources/taskref.go +++ b/upstream/pkg/reconciler/taskrun/resources/taskref.go @@ -25,13 +25,11 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - resolutionV1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" "github.com/tektoncd/pipeline/pkg/reconciler/apiserver" "github.com/tektoncd/pipeline/pkg/remote" - "github.com/tektoncd/pipeline/pkg/remoteresolution/remote/resolution" - remoteresource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - "github.com/tektoncd/pipeline/pkg/substitution" + "github.com/tektoncd/pipeline/pkg/remote/resolution" + remoteresource "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -39,6 +37,12 @@ import ( "knative.dev/pkg/kmeta" ) +// This error is defined in etcd at +// https://github.com/etcd-io/etcd/blob/5b226e0abf4100253c94bb71f47d6815877ed5a2/server/etcdserver/errors.go#L30 +// TODO: If/when https://github.com/kubernetes/kubernetes/issues/106491 is addressed, +// we should stop relying on a hardcoded string. +var errEtcdLeaderChange = "etcdserver: leader changed" + // GetTaskKind returns the referenced Task kind (Task, ClusterTask, ...) if the TaskRun is using TaskRef. func GetTaskKind(taskrun *v1.TaskRun) v1.TaskKind { kind := v1.NamespacedTaskKind @@ -93,7 +97,6 @@ func GetTaskFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset // casting it to a TaskObject. return func(ctx context.Context, name string) (*v1.Task, *v1.RefSource, *trustedresources.VerificationResult, error) { var replacedParams v1.Params - var url string if ownerAsTR, ok := owner.(*v1.TaskRun); ok { stringReplacements, arrayReplacements, _ := replacementsFromParams(ownerAsTR.Spec.Params) for k, v := range getContextReplacements("", ownerAsTR) { @@ -103,23 +106,10 @@ func GetTaskFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset p.Value.ApplyReplacements(stringReplacements, arrayReplacements, nil) replacedParams = append(replacedParams, p) } - if err := v1.RefNameLikeUrl(tr.Name); err == nil { - // The name is url-like so its not a local reference. - tr.Name = substitution.ApplyReplacements(tr.Name, stringReplacements) - url = tr.Name - } } else { replacedParams = append(replacedParams, tr.Params...) } - resolverPayload := remoteresource.ResolverPayload{ - Name: trName, - Namespace: namespace, - ResolutionSpec: &resolutionV1beta1.ResolutionRequestSpec{ - Params: replacedParams, - URL: url, - }, - } - resolver := resolution.NewResolver(requester, owner, string(tr.Resolver), resolverPayload) + resolver := resolution.NewResolver(requester, owner, string(tr.Resolver), trName, namespace, replacedParams) return resolveTask(ctx, resolver, name, namespace, kind, k8s, tekton, verificationPolicies) } @@ -138,24 +128,16 @@ func GetTaskFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset // It also requires a kubeclient, tektonclient, requester in case it needs to find that task in // cluster or authorize against an external repository. It will figure out whether it needs to look in the cluster or in // a remote location to fetch the reference. -func GetStepActionFunc(tekton clientset.Interface, k8s kubernetes.Interface, requester remoteresource.Requester, tr *v1.TaskRun, taskSpec v1.TaskSpec, step *v1.Step) GetStepAction { +func GetStepActionFunc(tekton clientset.Interface, k8s kubernetes.Interface, requester remoteresource.Requester, tr *v1.TaskRun, step *v1.Step) GetStepAction { trName := tr.Name namespace := tr.Namespace if step.Ref != nil && step.Ref.Resolver != "" && requester != nil { // Return an inline function that implements GetStepAction by calling Resolver.Get with the specified StepAction type and // casting it to a StepAction. - return func(ctx context.Context, name string) (*v1beta1.StepAction, *v1.RefSource, error) { + return func(ctx context.Context, name string) (*v1alpha1.StepAction, *v1.RefSource, error) { // Perform params replacements for StepAction resolver params - ApplyParameterSubstitutionInResolverParams(tr, taskSpec, step) - resolverPayload := remoteresource.ResolverPayload{ - Name: trName, - Namespace: namespace, - ResolutionSpec: &resolutionV1beta1.ResolutionRequestSpec{ - Params: step.Ref.Params, - URL: step.Ref.Name, - }, - } - resolver := resolution.NewResolver(requester, tr, string(step.Ref.Resolver), resolverPayload) + ApplyParameterSubstitutionInResolverParams(tr, step) + resolver := resolution.NewResolver(requester, tr, string(step.Ref.Resolver), trName, namespace, step.Ref.Params) return resolveStepAction(ctx, resolver, name, namespace, k8s, tekton) } } @@ -167,14 +149,14 @@ func GetStepActionFunc(tekton clientset.Interface, k8s kubernetes.Interface, req } // ApplyParameterSubstitutionInResolverParams applies parameter substitutions in resolver params for Step Ref. -func ApplyParameterSubstitutionInResolverParams(tr *v1.TaskRun, taskSpec v1.TaskSpec, step *v1.Step) { +func ApplyParameterSubstitutionInResolverParams(tr *v1.TaskRun, step *v1.Step) { stringReplacements := make(map[string]string) arrayReplacements := make(map[string][]string) objectReplacements := make(map[string]map[string]string) - - defaultSR, defaultAR, defaultOR := replacementsFromDefaultParams(taskSpec.Params) - stringReplacements, arrayReplacements, objectReplacements = extendReplacements(stringReplacements, arrayReplacements, objectReplacements, defaultSR, defaultAR, defaultOR) - + if tr.Spec.TaskSpec != nil { + defaultSR, defaultAR, defaultOR := replacementsFromDefaultParams(tr.Spec.TaskSpec.Params) + stringReplacements, arrayReplacements, objectReplacements = extendReplacements(stringReplacements, arrayReplacements, objectReplacements, defaultSR, defaultAR, defaultOR) + } paramSR, paramAR, paramOR := replacementsFromParams(tr.Spec.Params) stringReplacements, arrayReplacements, objectReplacements = extendReplacements(stringReplacements, arrayReplacements, objectReplacements, paramSR, paramAR, paramOR) step.Ref.Params = step.Ref.Params.ReplaceVariables(stringReplacements, arrayReplacements, objectReplacements) @@ -225,47 +207,22 @@ func resolveTask(ctx context.Context, resolver remote.Resolver, name, namespace return taskObj, refSource, vr, nil } -func resolveStepAction(ctx context.Context, resolver remote.Resolver, name, namespace string, k8s kubernetes.Interface, tekton clientset.Interface) (*v1beta1.StepAction, *v1.RefSource, error) { +func resolveStepAction(ctx context.Context, resolver remote.Resolver, name, namespace string, k8s kubernetes.Interface, tekton clientset.Interface) (*v1alpha1.StepAction, *v1.RefSource, error) { obj, refSource, err := resolver.Get(ctx, "StepAction", name) if err != nil { return nil, nil, err } - switch obj := obj.(type) { - case *v1beta1.StepAction: - // Cleanup object from things we don't care about - // FIXME: extract this in a function - obj.ObjectMeta.OwnerReferences = nil - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { - return nil, nil, err - } - if mutatedStepAction, ok := o.(*v1beta1.StepAction); ok { - mutatedStepAction.ObjectMeta = obj.ObjectMeta - return mutatedStepAction, refSource, nil - } + switch obj := obj.(type) { //nolint:gocritic case *v1alpha1.StepAction: obj.SetDefaults(ctx) // Cleanup object from things we don't care about // FIXME: extract this in a function obj.ObjectMeta.OwnerReferences = nil - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { + if err := apiserver.DryRunValidate(ctx, namespace, obj, tekton); err != nil { return nil, nil, err } - if mutatedStepAction, ok := o.(*v1alpha1.StepAction); ok { - mutatedStepAction.ObjectMeta = obj.ObjectMeta - v1BetaStepAction := v1beta1.StepAction{ - TypeMeta: metav1.TypeMeta{ - Kind: "StepAction", - APIVersion: "tekton.dev/v1beta1", - }, - } - err := mutatedStepAction.ConvertTo(ctx, &v1BetaStepAction) - if err != nil { - return nil, nil, err - } - return &v1BetaStepAction, refSource, nil - } + + return obj, refSource, nil } return nil, nil, errors.New("resource is not a StepAction") } @@ -290,42 +247,31 @@ func readRuntimeObjectAsTask(ctx context.Context, namespace string, obj runtime. vr := trustedresources.VerifyResource(ctx, obj, k8s, refSource, verificationPolicies) // Issue a dry-run request to create the remote Task, so that it can undergo validation from validating admission webhooks // without actually creating the Task on the cluster. - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { + if err := apiserver.DryRunValidate(ctx, namespace, obj, tekton); err != nil { return nil, nil, err } - if mutatedTask, ok := o.(*v1beta1.Task); ok { - t := &v1.Task{ - TypeMeta: metav1.TypeMeta{ - Kind: "Task", - APIVersion: "tekton.dev/v1", - }, - } - mutatedTask.ObjectMeta = obj.ObjectMeta - if err := mutatedTask.ConvertTo(ctx, t); err != nil { - return nil, nil, fmt.Errorf("failed to convert obj %s into Pipeline", mutatedTask.GetObjectKind().GroupVersionKind().String()) - } - return t, &vr, nil + t := &v1.Task{ + TypeMeta: metav1.TypeMeta{ + Kind: "Task", + APIVersion: "tekton.dev/v1", + }, + } + if err := obj.ConvertTo(ctx, t); err != nil { + return nil, nil, fmt.Errorf("failed to convert obj %s into Pipeline", obj.GetObjectKind().GroupVersionKind().String()) } + return t, &vr, nil case *v1beta1.ClusterTask: obj.SetDefaults(ctx) // Cleanup object from things we don't care about // FIXME: extract this in a function obj.ObjectMeta.OwnerReferences = nil t, err := convertClusterTaskToTask(ctx, *obj) - if err != nil { - return nil, nil, err - } // Issue a dry-run request to create the remote Task, so that it can undergo validation from validating admission webhooks // without actually creating the Task on the cluster - o, err := apiserver.DryRunValidate(ctx, namespace, t, tekton) - if err != nil { + if err := apiserver.DryRunValidate(ctx, namespace, t, tekton); err != nil { return nil, nil, err } - if mutatedTask, ok := o.(*v1.Task); ok { - mutatedTask.ObjectMeta = obj.ObjectMeta - return mutatedTask, nil, nil - } + return t, nil, err case *v1.Task: // This SetDefaults is currently not necessary, but for consistency, it is recommended to add it. // Avoid forgetting to add it in the future when there is a v2 version, causing similar problems. @@ -336,14 +282,10 @@ func readRuntimeObjectAsTask(ctx context.Context, namespace string, obj runtime. vr := trustedresources.VerifyResource(ctx, obj, k8s, refSource, verificationPolicies) // Issue a dry-run request to create the remote Task, so that it can undergo validation from validating admission webhooks // without actually creating the Task on the cluster - o, err := apiserver.DryRunValidate(ctx, namespace, obj, tekton) - if err != nil { + if err := apiserver.DryRunValidate(ctx, namespace, obj, tekton); err != nil { return nil, nil, err } - if mutatedTask, ok := o.(*v1.Task); ok { - mutatedTask.ObjectMeta = obj.ObjectMeta - return mutatedTask, &vr, nil - } + return obj, &vr, nil } return nil, nil, errors.New("resource is not a task") } @@ -387,18 +329,23 @@ type LocalStepActionRefResolver struct { // GetStepAction will resolve a StepAction from the local cluster using a versioned Tekton client. // It will return an error if it can't find an appropriate StepAction for any reason. -func (l *LocalStepActionRefResolver) GetStepAction(ctx context.Context, name string) (*v1beta1.StepAction, *v1.RefSource, error) { +func (l *LocalStepActionRefResolver) GetStepAction(ctx context.Context, name string) (*v1alpha1.StepAction, *v1.RefSource, error) { // If we are going to resolve this reference locally, we need a namespace scope. if l.Namespace == "" { return nil, nil, fmt.Errorf("must specify namespace to resolve reference to step action %s", name) } - stepAction, err := l.Tektonclient.TektonV1beta1().StepActions(l.Namespace).Get(ctx, name, metav1.GetOptions{}) + stepAction, err := l.Tektonclient.TektonV1alpha1().StepActions(l.Namespace).Get(ctx, name, metav1.GetOptions{}) if err != nil { return nil, nil, err } return stepAction, nil, nil } +// IsErrTransient returns true if an error returned by GetTask/GetStepAction is retryable. +func IsErrTransient(err error) bool { + return strings.Contains(err.Error(), errEtcdLeaderChange) +} + // convertClusterTaskToTask converts deprecated v1beta1 ClusterTasks to Tasks for // the rest of reconciling process since GetTask func and its upstream callers only // fetches the task spec and stores it in the taskrun status while the kind info diff --git a/upstream/pkg/reconciler/taskrun/resources/taskref_test.go b/upstream/pkg/reconciler/taskrun/resources/taskref_test.go index 526e37aa69b..1f81947dd95 100644 --- a/upstream/pkg/reconciler/taskrun/resources/taskref_test.go +++ b/upstream/pkg/reconciler/taskrun/resources/taskref_test.go @@ -34,16 +34,13 @@ import ( v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - resolutionV1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake" "github.com/tektoncd/pipeline/pkg/reconciler/apiserver" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" "github.com/tektoncd/pipeline/test/parse" - resolution "github.com/tektoncd/pipeline/test/remoteresolution" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -54,16 +51,16 @@ import ( ) var ( - simpleNamespacedStepAction = &v1beta1.StepAction{ + simpleNamespacedStepAction = &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "simple", Namespace: "default", }, TypeMeta: metav1.TypeMeta{ - APIVersion: "tekton.dev/v1beta1", + APIVersion: "tekton.dev/v1alpha1", Kind: "StepAction", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "something", }, } @@ -347,7 +344,6 @@ func TestStepActionResolverParamReplacements(t *testing.T) { name string namespace string taskrun *v1.TaskRun - taskSpec *v1.TaskSpec want *v1.Step }{{ name: "default taskspec parms", @@ -586,53 +582,11 @@ func TestStepActionResolverParamReplacements(t *testing.T) { }, }, }, - }, { - name: "defaults from remote task", - namespace: "default", - taskrun: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{Name: "some-tr"}, - Spec: v1.TaskRunSpec{ - TaskRef: &v1.TaskRef{ - Name: "resolved-task-name", - }, - }, - }, - taskSpec: &v1.TaskSpec{ - Params: []v1.ParamSpec{{ - Name: "resolver-param", - Default: v1.NewStructuredValues("foo/bar"), - }}, - Steps: []v1.Step{{ - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "git", - Params: []v1.Param{{ - Name: "pathInRepo", - Value: *v1.NewStructuredValues("$(params.resolver-param)"), - }}, - }, - }, - }}, - }, - want: &v1.Step{ - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "git", - Params: []v1.Param{{ - Name: "pathInRepo", - Value: *v1.NewStructuredValues("foo/bar"), - }}, - }, - }, - }, }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - if tc.taskSpec == nil { - tc.taskSpec = tc.taskrun.Spec.TaskSpec - } - step := &tc.taskSpec.Steps[0] - resources.ApplyParameterSubstitutionInResolverParams(tc.taskrun, *tc.taskSpec, step) + step := &tc.taskrun.Spec.TaskSpec.Steps[0] + resources.ApplyParameterSubstitutionInResolverParams(tc.taskrun, step) if d := cmp.Diff(tc.want, step); tc.want != nil && d != "" { t.Error(diff.PrintWantGot(d)) } @@ -651,13 +605,13 @@ func TestStepActionRef(t *testing.T) { name: "local-step-action", namespace: "default", stepactions: []runtime.Object{ - &v1beta1.StepAction{ + &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "simple", Namespace: "default", }, }, - &v1beta1.StepAction{ + &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "sample", Namespace: "default", @@ -667,7 +621,7 @@ func TestStepActionRef(t *testing.T) { ref: &v1.Ref{ Name: "simple", }, - expected: &v1beta1.StepAction{ + expected: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "simple", Namespace: "default", @@ -724,7 +678,7 @@ func TestStepActionRef_Error(t *testing.T) { name: "local-step-action-missing-namespace", namespace: "", stepactions: []runtime.Object{ - &v1beta1.StepAction{ + &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "simple", Namespace: "default", @@ -904,7 +858,7 @@ func TestGetStepActionFunc_Local(t *testing.T) { for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { tektonclient := fake.NewSimpleClientset(tc.localStepActions...) - fn := resources.GetStepActionFunc(tektonclient, nil, nil, tc.taskRun, *tc.taskRun.Spec.TaskSpec, &tc.taskRun.Spec.TaskSpec.Steps[0]) + fn := resources.GetStepActionFunc(tektonclient, nil, nil, tc.taskRun, &tc.taskRun.Spec.TaskSpec.Steps[0]) stepAction, refSource, err := fn(ctx, tc.taskRun.Spec.TaskSpec.Steps[0].Ref.Name) if err != nil { @@ -930,29 +884,21 @@ func TestGetStepActionFunc_RemoteResolution_Success(t *testing.T) { testcases := []struct { name string stepActionYAML string - wantStepAction *v1beta1.StepAction + wantStepAction *v1alpha1.StepAction wantErr bool }{{ - name: "remote StepAction v1alpha1", + name: "remote StepAction", stepActionYAML: strings.Join([]string{ "kind: StepAction", "apiVersion: tekton.dev/v1alpha1", stepActionYAMLString, }, "\n"), - wantStepAction: parse.MustParseV1beta1StepAction(t, stepActionYAMLString), - }, { - name: "remote StepAction v1beta1", - stepActionYAML: strings.Join([]string{ - "kind: StepAction", - "apiVersion: tekton.dev/v1beta1", - stepActionYAMLString, - }, "\n"), - wantStepAction: parse.MustParseV1beta1StepAction(t, stepActionYAMLString), + wantStepAction: parse.MustParseV1alpha1StepAction(t, stepActionYAMLString), }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - resolved := resolution.NewResolvedResource([]byte(tc.stepActionYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) + resolved := test.NewResolvedResource([]byte(tc.stepActionYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) + requester := test.NewRequester(resolved, nil) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.TaskRunSpec{ @@ -965,7 +911,7 @@ func TestGetStepActionFunc_RemoteResolution_Success(t *testing.T) { }, } tektonclient := fake.NewSimpleClientset() - fn := resources.GetStepActionFunc(tektonclient, nil, requester, tr, *tr.Spec.TaskSpec, &tr.Spec.TaskSpec.Steps[0]) + fn := resources.GetStepActionFunc(tektonclient, nil, requester, tr, &tr.Spec.TaskSpec.Steps[0]) resolvedStepAction, resolvedRefSource, err := fn(ctx, tr.Spec.TaskSpec.Steps[0].Ref.Name) if tc.wantErr { @@ -1012,8 +958,8 @@ func TestGetStepActionFunc_RemoteResolution_Error(t *testing.T) { for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - res := resolution.NewResolvedResource(tc.resolvesTo, nil, nil, nil) - requester := resolution.NewRequester(res, nil, resource.ResolverPayload{}) + resource := test.NewResolvedResource(tc.resolvesTo, nil, nil, nil) + requester := test.NewRequester(resource, nil) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.TaskRunSpec{ @@ -1026,7 +972,7 @@ func TestGetStepActionFunc_RemoteResolution_Error(t *testing.T) { }, } tektonclient := fake.NewSimpleClientset() - fn := resources.GetStepActionFunc(tektonclient, nil, requester, tr, *tr.Spec.TaskSpec, &tr.Spec.TaskSpec.Steps[0]) + fn := resources.GetStepActionFunc(tektonclient, nil, requester, tr, &tr.Spec.TaskSpec.Steps[0]) if _, _, err := fn(ctx, tr.Spec.TaskSpec.Steps[0].Ref.Name); err == nil { t.Fatalf("expected error due to invalid pipeline data but saw none") } @@ -1144,8 +1090,8 @@ func TestGetTaskFunc_RemoteResolution(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - resolved := resolution.NewResolvedResource([]byte(tc.taskYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) + resolved := test.NewResolvedResource([]byte(tc.taskYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) + requester := test.NewRequester(resolved, nil) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.TaskRunSpec{ @@ -1211,8 +1157,8 @@ func TestGetTaskFunc_RemoteResolution_ValidationFailure(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - resolved := resolution.NewResolvedResource([]byte(tc.taskYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) + resolved := test.NewResolvedResource([]byte(tc.taskYAML), nil /* annotations */, sampleRefSource.DeepCopy(), nil /* data error */) + requester := test.NewRequester(resolved, nil) tektonclient := fake.NewSimpleClientset() fn := resources.GetTaskFunc(ctx, nil, tektonclient, requester, &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, @@ -1245,7 +1191,6 @@ func TestGetTaskFunc_RemoteResolution_ReplacedParams(t *testing.T) { ctx = config.ToContext(ctx, cfg) task := parse.MustParseV1TaskAndSetDefaults(t, taskYAMLString) taskRef := &v1.TaskRef{ - Name: "https://foo/bar", ResolverRef: v1.ResolverRef{ Resolver: "git", Params: []v1.Param{{ @@ -1263,21 +1208,16 @@ func TestGetTaskFunc_RemoteResolution_ReplacedParams(t *testing.T) { taskYAMLString, }, "\n") - resolved := resolution.NewResolvedResource([]byte(taskYAML), nil, sampleRefSource.DeepCopy(), nil) - requester := &resolution.Requester{ + resolved := test.NewResolvedResource([]byte(taskYAML), nil, sampleRefSource.DeepCopy(), nil) + requester := &test.Requester{ ResolvedResource: resolved, - ResolverPayload: resource.ResolverPayload{ - ResolutionSpec: &resolutionV1beta1.ResolutionRequestSpec{ - Params: v1.Params{{ - Name: "foo", - Value: *v1.NewStructuredValues("bar"), - }, { - Name: "bar", - Value: *v1.NewStructuredValues("test-task"), - }}, - URL: "https://foo/bar", - }, - }, + Params: v1.Params{{ + Name: "foo", + Value: *v1.NewStructuredValues("bar"), + }, { + Name: "bar", + Value: *v1.NewStructuredValues("test-task"), + }}, } tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ @@ -1353,8 +1293,8 @@ func TestGetPipelineFunc_RemoteResolutionInvalidData(t *testing.T) { ctx = config.ToContext(ctx, cfg) taskRef := &v1.TaskRef{ResolverRef: v1.ResolverRef{Resolver: "git"}} resolvesTo := []byte("INVALID YAML") - res := resolution.NewResolvedResource(resolvesTo, nil, nil, nil) - requester := resolution.NewRequester(res, nil, resource.ResolverPayload{}) + resource := test.NewResolvedResource(resolvesTo, nil, nil, nil) + requester := test.NewRequester(resource, nil) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1.TaskRunSpec{ @@ -1368,6 +1308,7 @@ func TestGetPipelineFunc_RemoteResolutionInvalidData(t *testing.T) { } } +//nolint:musttag func TestGetTaskFunc_V1beta1Task_VerifyNoError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -1414,7 +1355,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyNoError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string policies []*v1alpha1.VerificationPolicy expected runtime.Object @@ -1473,7 +1414,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyNoError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(context.Background(), tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.TaskRunSpec{ @@ -1502,6 +1443,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyNoError(t *testing.T) { } } +//nolint:musttag func TestGetTaskFunc_V1beta1Task_VerifyError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -1542,7 +1484,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string expected *v1.Task expectedErr error @@ -1601,7 +1543,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.TaskRunSpec{ @@ -1622,6 +1564,7 @@ func TestGetTaskFunc_V1beta1Task_VerifyError(t *testing.T) { } } +//nolint:musttag func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -1678,7 +1621,7 @@ func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string policies []*v1alpha1.VerificationPolicy expected runtime.Object @@ -1737,7 +1680,7 @@ func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.TaskRunSpec{ @@ -1766,6 +1709,7 @@ func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) { } } +//nolint:musttag func TestGetTaskFunc_V1Task_VerifyError(t *testing.T) { ctx := context.Background() signer, _, k8sclient, vps := test.SetupVerificationPolicies(t) @@ -1806,7 +1750,7 @@ func TestGetTaskFunc_V1Task_VerifyError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester verificationNoMatchPolicy string expected *v1.Task expectedErr error @@ -1863,7 +1807,7 @@ func TestGetTaskFunc_V1Task_VerifyError(t *testing.T) { } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - ctx := test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) + ctx = test.SetupTrustedResourceConfig(ctx, tc.verificationNoMatchPolicy) tr := &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Namespace: "trusted-resources"}, Spec: v1.TaskRunSpec{ @@ -1881,6 +1825,7 @@ func TestGetTaskFunc_V1Task_VerifyError(t *testing.T) { } } +//nolint:musttag func TestGetTaskFunc_GetFuncError(t *testing.T) { ctx := context.Background() _, k8sclient, vps := test.SetupMatchAllVerificationPolicies(t, "trusted-resources") @@ -1892,8 +1837,8 @@ func TestGetTaskFunc_GetFuncError(t *testing.T) { t.Fatal("fail to marshal task", err) } - resolvedUnsigned := resolution.NewResolvedResource(unsignedTaskBytes, nil, sampleRefSource.DeepCopy(), nil) - requesterUnsigned := resolution.NewRequester(resolvedUnsigned, nil, resource.ResolverPayload{}) + resolvedUnsigned := test.NewResolvedResource(unsignedTaskBytes, nil, sampleRefSource.DeepCopy(), nil) + requesterUnsigned := test.NewRequester(resolvedUnsigned, nil) resolvedUnsigned.DataErr = errors.New("resolution error") trResolutionError := &v1.TaskRun{ @@ -1911,7 +1856,7 @@ func TestGetTaskFunc_GetFuncError(t *testing.T) { testcases := []struct { name string - requester *resolution.Requester + requester *test.Requester taskrun v1.TaskRun expectedErr error }{ @@ -1935,7 +1880,7 @@ func TestGetTaskFunc_GetFuncError(t *testing.T) { }, } store.OnConfigChanged(featureflags) - ctx := store.ToContext(ctx) + ctx = store.ToContext(ctx) fn := resources.GetTaskFunc(ctx, k8sclient, tektonclient, tc.requester, &tc.taskrun, tc.taskrun.Spec.TaskRef, "", "default", "default", vps) @@ -1962,7 +1907,7 @@ spec: - "bar" steps: - name: step1 - image: docker.io/library/ubuntu + image: ubuntu script: | echo "hello world!" ` @@ -1987,9 +1932,9 @@ spec: - name: foo ` -func bytesToRequester(data []byte, source *v1.RefSource) *resolution.Requester { - resolved := resolution.NewResolvedResource(data, nil, source, nil) - requester := resolution.NewRequester(resolved, nil, resource.ResolverPayload{}) +func bytesToRequester(data []byte, source *v1.RefSource) *test.Requester { + resolved := test.NewResolvedResource(data, nil, source, nil) + requester := test.NewRequester(resolved, nil) return requester } diff --git a/upstream/pkg/reconciler/taskrun/resources/taskspec.go b/upstream/pkg/reconciler/taskrun/resources/taskspec.go index e9b683d7520..64d71df04e8 100644 --- a/upstream/pkg/reconciler/taskrun/resources/taskspec.go +++ b/upstream/pkg/reconciler/taskrun/resources/taskspec.go @@ -22,11 +22,10 @@ import ( "fmt" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" resolutionutil "github.com/tektoncd/pipeline/pkg/internal/resolution" - "github.com/tektoncd/pipeline/pkg/pod" - remoteresource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" + remoteresource "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -43,7 +42,7 @@ type ResolvedTask struct { } // GetStepAction is a function used to retrieve StepActions. -type GetStepAction func(context.Context, string) (*v1beta1.StepAction, *v1.RefSource, error) +type GetStepAction func(context.Context, string) (*v1alpha1.StepAction, *v1.RefSource, error) // GetTask is a function used to retrieve Tasks. // VerificationResult is the result from trusted resources if the feature is enabled. @@ -104,40 +103,14 @@ func GetTaskData(ctx context.Context, taskRun *v1.TaskRun, getTask GetTask) (*re // GetStepActionsData extracts the StepActions and merges them with the inlined Step specification. func GetStepActionsData(ctx context.Context, taskSpec v1.TaskSpec, taskRun *v1.TaskRun, tekton clientset.Interface, k8s kubernetes.Interface, requester remoteresource.Requester) ([]v1.Step, error) { steps := []v1.Step{} - for i, step := range taskSpec.Steps { + for _, step := range taskSpec.Steps { s := step.DeepCopy() if step.Ref != nil { - getStepAction := GetStepActionFunc(tekton, k8s, requester, taskRun, taskSpec, s) - stepAction, source, err := getStepAction(ctx, s.Ref.Name) + getStepAction := GetStepActionFunc(tekton, k8s, requester, taskRun, s) + stepAction, _, err := getStepAction(ctx, s.Ref.Name) if err != nil { return nil, err } - // update stepstate with remote origin information - if source != nil { - found := false - for i, st := range taskRun.Status.Steps { - if st.Name == s.Name { - found = true - if st.Provenance != nil { - taskRun.Status.Steps[i].Provenance.RefSource = source - } else { - taskRun.Status.Steps[i].Provenance = &v1.Provenance{RefSource: source} - } - break - } - } - if !found { - stp := v1.StepState{ - Name: pod.TrimStepPrefix(pod.StepName(s.Name, i)), - Provenance: &v1.Provenance{RefSource: source}, - } - if len(taskRun.Status.Steps) == 0 { - taskRun.Status.Steps = []v1.StepState{stp} - } else { - taskRun.Status.Steps = append(taskRun.Status.Steps, stp) - } - } - } stepActionSpec := stepAction.StepActionSpec() stepActionSpec.SetDefaults(ctx) @@ -145,11 +118,7 @@ func GetStepActionsData(ctx context.Context, taskSpec v1.TaskSpec, taskRun *v1.T if err := validateStepHasStepActionParameters(s.Params, stepActionSpec.Params); err != nil { return nil, err } - - stepFromStepAction, err = applyStepActionParameters(stepFromStepAction, &taskSpec, taskRun, s.Params, stepActionSpec.Params) - if err != nil { - return nil, err - } + stepFromStepAction = applyStepActionParameters(stepFromStepAction, &taskSpec, taskRun, s.Params, stepActionSpec.Params) s.Image = stepFromStepAction.Image s.SecurityContext = stepFromStepAction.SecurityContext diff --git a/upstream/pkg/reconciler/taskrun/resources/taskspec_test.go b/upstream/pkg/reconciler/taskrun/resources/taskspec_test.go index f2fb37ee42c..361ce2f0050 100644 --- a/upstream/pkg/reconciler/taskrun/resources/taskspec_test.go +++ b/upstream/pkg/reconciler/taskrun/resources/taskspec_test.go @@ -25,17 +25,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" "github.com/tektoncd/pipeline/pkg/trustedresources" "github.com/tektoncd/pipeline/test/diff" - "github.com/tektoncd/pipeline/test/parse" - test "github.com/tektoncd/pipeline/test/remoteresolution" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/yaml" ) func TestGetTaskSpec_Ref(t *testing.T) { @@ -201,7 +197,7 @@ func TestGetTaskData_ResolutionSuccess(t *testing.T) { } if d := cmp.Diff(sourceSpec, *resolvedSpec); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } } @@ -297,343 +293,7 @@ func TestGetTaskData_VerificationResult(t *testing.T) { t.Fatalf("Did not expect error but got: %s", err) } if d := cmp.Diff(verificationResult, r.VerificationResult, cmpopts.EquateErrors()); d != "" { - t.Error(diff.PrintWantGot(d)) - } -} - -func TestGetStepActionsData_Provenance(t *testing.T) { - source := v1.RefSource{ - URI: "ref-source", - Digest: map[string]string{"sha256": "abcd123456"}, - } - stepAction := parse.MustParseV1beta1StepAction(t, ` -metadata: - name: stepAction - namespace: foo -spec: - image: myImage - command: ["ls"] -`) - - stepActionBytes, err := yaml.Marshal(stepAction) - if err != nil { - t.Fatal("failed to marshal StepAction", err) - } - rr := test.NewResolvedResource(stepActionBytes, map[string]string{}, &source, nil) - requester := test.NewRequester(rr, nil, resource.ResolverPayload{}) - tests := []struct { - name string - tr *v1.TaskRun - want *v1.TaskRun - }{{ - name: "remote-step-action-with-provenance", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "stepname", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - }, - want: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "stepname", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "stepname", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }}, - }, - }, - }, - }, { - name: "multiple-remote-step-actions-with-provenance", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }, { - Name: "step2", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - }, - want: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }, { - Name: "step2", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "step1", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }, { - Name: "step2", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }}, - }, - }, - }, - }, { - name: "remote-step-action-with-existing-provenance", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "step1", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }}, - }, - }, - }, - want: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "step1", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }}, - }, - }, - }, - }, { - name: "remote-step-action-with-missing-provenance", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "step1", - }}, - }, - }, - }, - want: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "step1", - Ref: &v1.Ref{ - ResolverRef: v1.ResolverRef{ - Resolver: "foo", - Params: []v1.Param{{ - Name: "bar", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "baz", - }, - }}, - }, - }, - }}, - }, - }, - Status: v1.TaskRunStatus{ - TaskRunStatusFields: v1.TaskRunStatusFields{ - Steps: []v1.StepState{{ - Name: "step1", - Provenance: &v1.Provenance{ - RefSource: &source, - }, - }}, - }, - }, - }, - }} - for _, tt := range tests { - ctx := context.Background() - tektonclient := fake.NewSimpleClientset(stepAction) - _, err := resources.GetStepActionsData(ctx, *tt.tr.Spec.TaskSpec, tt.tr, tektonclient, nil, requester) - if err != nil { - t.Fatalf("Did not expect an error but got : %s", err) - } - if d := cmp.Diff(tt.want, tt.tr); d != "" { - t.Errorf("the taskrun did not match what was expected diff: %s", diff.PrintWantGot(d)) - } + t.Errorf(diff.PrintWantGot(d)) } } @@ -643,7 +303,7 @@ func TestGetStepActionsData(t *testing.T) { tests := []struct { name string tr *v1.TaskRun - stepAction *v1beta1.StepAction + stepAction *v1alpha1.StepAction want []v1.Step }{{ name: "step-action-with-command-args", @@ -663,12 +323,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Command: []string{"ls"}, Args: []string{"-lh"}, @@ -705,12 +365,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepActionWithScript", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Script: "ls", }, @@ -736,12 +396,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepActionWithEnv", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Env: []corev1.EnvVar{{ Name: "env1", @@ -773,12 +433,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepActionWithScript", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Script: "ls", Results: []v1.StepResult{{ @@ -812,12 +472,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Command: []string{"ls"}, Args: []string{"-lh"}, @@ -850,12 +510,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Command: []string{"ls"}, Args: []string{"-lh"}, @@ -914,12 +574,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"$(params.string-param)", "$(params.array-param[0])", "$(params.array-param[1])", "$(params.array-param[*])", "$(params.object-param.key)"}, Params: v1.ParamSpecs{{ @@ -985,12 +645,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"$(params.string-param)", "$(params.array-param[0])", "$(params.array-param[1])", "$(params.array-param[*])", "$(params.object-param.key)"}, Params: v1.ParamSpecs{{ @@ -1027,12 +687,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"$(params.string-param)", "$(params.array-param[0])", "$(params.array-param[1])", "$(params.array-param[*])", "$(params.object-param.key)"}, Params: v1.ParamSpecs{{ @@ -1117,12 +777,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"$(params.string-param)", "$(params.array-param[0])", "$(params.array-param[1])", "$(params.array-param[*])", "$(params.object-param.key)", "$(params.object-param.key2)", "$(params.object-param.key3)"}, Params: v1.ParamSpecs{{ @@ -1188,12 +848,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"echo", "$(params.stringparam)"}, Params: v1.ParamSpecs{{ @@ -1248,12 +908,12 @@ func TestGetStepActionsData(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepAction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Args: []string{"$(params.string-param)", "$(params.array-param[0])", "$(params.array-param[1])", "$(params.array-param[*])", "$(params.object-param.key)"}, Command: []string{"$(params[\"string-param\"])", "$(params[\"array-param\"][0])"}, @@ -1301,54 +961,6 @@ func TestGetStepActionsData(t *testing.T) { Value: "$(steps.inlined-step.results.result1)", }}, }}, - }, { - name: "param types are matching", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "test", - Ref: &v1.Ref{Name: "stepAction"}, - Params: v1.Params{{ - Name: "commands", - Value: v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{"Hello, I am of type list"}, - }, - }}, - }}, - }, - }, - }, - stepAction: &v1beta1.StepAction{ - ObjectMeta: metav1.ObjectMeta{ - Name: "stepAction", - Namespace: "default", - }, - Spec: v1beta1.StepActionSpec{ - Image: "myimage", - Args: []string{"$(params.commands)"}, - Script: "echo $@", - Params: v1.ParamSpecs{{ - Name: "commands", - Type: v1.ParamTypeArray, - Default: &v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{"Hello, I am the default value"}, - }, - }}, - }, - }, - want: []v1.Step{{ - Name: "test", - Image: "myimage", - Args: []string{"Hello, I am of type list"}, - Script: "echo $@", - }}, }} for _, tt := range tests { ctx := context.Background() @@ -1368,7 +980,7 @@ func TestGetStepActionsData_Error(t *testing.T) { tests := []struct { name string tr *v1.TaskRun - stepAction *v1beta1.StepAction + stepAction *v1alpha1.StepAction expectedError error }{{ name: "namespace missing error", @@ -1386,7 +998,7 @@ func TestGetStepActionsData_Error(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{}, + stepAction: &v1alpha1.StepAction{}, expectedError: errors.New("must specify namespace to resolve reference to step action stepActionError"), }, { name: "params missing", @@ -1405,12 +1017,12 @@ func TestGetStepActionsData_Error(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepaction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", Params: v1.ParamSpecs{{ Name: "string-param", @@ -1440,56 +1052,16 @@ func TestGetStepActionsData_Error(t *testing.T) { }, }, }, - stepAction: &v1beta1.StepAction{ + stepAction: &v1alpha1.StepAction{ ObjectMeta: metav1.ObjectMeta{ Name: "stepaction", Namespace: "default", }, - Spec: v1beta1.StepActionSpec{ + Spec: v1alpha1.StepActionSpec{ Image: "myimage", }, }, expectedError: errors.New("extra params passed by Step to StepAction: [string-param]"), - }, { - name: "param types not matching", - tr: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mytaskrun", - Namespace: "default", - }, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{ - Steps: []v1.Step{{ - Name: "test", - Ref: &v1.Ref{Name: "stepAction"}, - Params: v1.Params{{ - Name: "commands", - Value: *v1.NewStructuredValues("Hello, I am of type string"), - }}, - }}, - }, - }, - }, - stepAction: &v1beta1.StepAction{ - ObjectMeta: metav1.ObjectMeta{ - Name: "stepAction", - Namespace: "default", - }, - Spec: v1beta1.StepActionSpec{ - Image: "myimage", - Args: []string{"$(params.commands)"}, - Script: "echo $@", - Params: v1.ParamSpecs{{ - Name: "commands", - Type: v1.ParamTypeArray, - Default: &v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{"Hello, I am the default value"}, - }, - }}, - }, - }, - expectedError: errors.New("invalid parameter substitution: commands. Please check the types of the default value and the passed value"), }} for _, tt := range tests { ctx := context.Background() diff --git a/upstream/pkg/reconciler/taskrun/taskrun.go b/upstream/pkg/reconciler/taskrun/taskrun.go index 56fdce49918..a11942fcb2a 100644 --- a/upstream/pkg/reconciler/taskrun/taskrun.go +++ b/upstream/pkg/reconciler/taskrun/taskrun.go @@ -22,7 +22,6 @@ import ( "fmt" "reflect" "slices" - "strconv" "strings" "time" @@ -39,7 +38,6 @@ import ( alphalisters "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/internal/affinityassistant" "github.com/tektoncd/pipeline/pkg/internal/computeresources" - "github.com/tektoncd/pipeline/pkg/internal/defaultresourcerequirements" resolutionutil "github.com/tektoncd/pipeline/pkg/internal/resolution" podconvert "github.com/tektoncd/pipeline/pkg/pod" tknreconciler "github.com/tektoncd/pipeline/pkg/reconciler" @@ -49,8 +47,7 @@ import ( "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/pkg/reconciler/volumeclaim" "github.com/tektoncd/pipeline/pkg/remote" - resolution "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" + resolution "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/pkg/spire" "github.com/tektoncd/pipeline/pkg/taskrunmetrics" "github.com/tektoncd/pipeline/pkg/trustedresources" @@ -153,28 +150,8 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, tr *v1.TaskRun) pkgrecon // and may not have had all of the assumed default specified. tr.SetDefaults(ctx) - // Check if current k8s version is less than 1.29 - // Since Kubernetes Major version cannot be 0 and if it's 2 then sidecar will be in - // we are only concerned about major version 1 and if the minor is less than 29 then - // we need to do the current logic - useTektonSidecar := true - if config.FromContextOrDefaults(ctx).FeatureFlags.EnableKubernetesSidecar { - dc := c.KubeClientSet.Discovery() - sv, err := dc.ServerVersion() - if err != nil { - return err - } - svMajorInt, _ := strconv.Atoi(sv.Major) - svMinorInt, _ := strconv.Atoi(sv.Minor) - if svMajorInt >= 1 && svMinorInt >= 29 { - useTektonSidecar = false - logger.Infof("Using Kubernetes Native Sidecars \n") - } - } - if useTektonSidecar { - if err := c.stopSidecars(ctx, tr); err != nil { - return err - } + if err := c.stopSidecars(ctx, tr); err != nil { + return err } return c.finishReconcileUpdateEmitEvents(ctx, tr, before, nil) @@ -431,7 +408,7 @@ func (c *Reconciler) prepare(ctx context.Context, tr *v1.TaskRun) (*v1.TaskSpec, return nil, nil, err case err != nil: logger.Errorf("Failed to determine Task spec to use for taskrun %s: %v", tr.Name, err) - if resolutioncommon.IsErrTransient(err) { + if resources.IsErrTransient(err) { return nil, nil, err } tr.Status.MarkResourceFailed(v1.TaskRunReasonFailedResolution, err) @@ -456,7 +433,7 @@ func (c *Reconciler) prepare(ctx context.Context, tr *v1.TaskRun) (*v1.TaskSpec, return nil, nil, err case err != nil: logger.Errorf("Failed to determine StepAction to use for TaskRun %s: %v", tr.Name, err) - if resolutioncommon.IsErrTransient(err) { + if resources.IsErrTransient(err) { return nil, nil, err } tr.Status.MarkResourceFailed(v1.TaskRunReasonFailedResolution, err) @@ -902,7 +879,6 @@ func (c *Reconciler) createPod(ctx context.Context, ts *v1.TaskSpec, tr *v1.Task EntrypointCache: c.entrypointCache, } pod, err := podbuilder.Build(ctx, tr, *ts, - defaultresourcerequirements.NewTransformer(ctx), computeresources.NewTransformer(ctx, tr.Namespace, c.limitrangeLister), affinityassistant.NewTransformer(ctx, tr.Annotations), ) @@ -1060,7 +1036,7 @@ func storeTaskSpecAndMergeMeta(ctx context.Context, tr *v1.TaskRun, ts *v1.TaskS // Propagate labels from Task to TaskRun. TaskRun labels take precedences over Task. tr.ObjectMeta.Labels = kmap.Union(meta.Labels, tr.ObjectMeta.Labels) if tr.Spec.TaskRef != nil { - if tr.Spec.TaskRef.Kind == v1.ClusterTaskRefKind { + if tr.Spec.TaskRef.Kind == "ClusterTask" { tr.ObjectMeta.Labels[pipeline.ClusterTaskLabelKey] = meta.Name } else { tr.ObjectMeta.Labels[pipeline.TaskLabelKey] = meta.Name diff --git a/upstream/pkg/reconciler/taskrun/taskrun_test.go b/upstream/pkg/reconciler/taskrun/taskrun_test.go index 694d78e7bca..7e1b30f7ee5 100644 --- a/upstream/pkg/reconciler/taskrun/taskrun_test.go +++ b/upstream/pkg/reconciler/taskrun/taskrun_test.go @@ -314,13 +314,6 @@ var ( EmptyDir: &corev1.EmptyDirVolumeSource{}, }, } - - artifactsVolume = corev1.Volume{ - Name: "tekton-internal-artifacts", - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - } downwardVolume = corev1.Volume{ Name: "tekton-internal-downward", VolumeSource: corev1.VolumeSource{ @@ -431,7 +424,6 @@ func TestReconcile_ExplicitDefaultSA(t *testing.T) { metadata: name: test-taskrun-run-success namespace: foo - uid: bar spec: taskRef: apiVersion: v1 @@ -441,7 +433,6 @@ spec: metadata: name: test-taskrun-with-sa-run-success namespace: foo - uid: bar spec: serviceAccountName: test-sa taskRef: @@ -471,7 +462,7 @@ spec: }{{ name: "success", taskRun: taskRunSuccess, - wantPod: expectedPod("test-taskrun-run-success-pod", "test-task", "test-taskrun-run-success", "bar", "foo", defaultSAName, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-run-success-pod", "test-task", "test-taskrun-run-success", "foo", defaultSAName, false, nil, []stepForExpectedPod{{ image: "foo", name: "simple-step", cmd: "/mycmd", @@ -479,7 +470,7 @@ spec: }, { name: "serviceaccount", taskRun: taskRunWithSaSuccess, - wantPod: expectedPod("test-taskrun-with-sa-run-success-pod", "test-with-sa", "test-taskrun-with-sa-run-success", "bar", "foo", "test-sa", false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-sa-run-success-pod", "test-with-sa", "test-taskrun-with-sa-run-success", "foo", "test-sa", false, nil, []stepForExpectedPod{{ image: "foo", name: "sa-step", cmd: "/mycmd", @@ -629,7 +620,7 @@ spec: err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, "reconcile-cloud-events", wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } wantCloudEvents := []string{ @@ -645,7 +636,6 @@ func TestReconcile(t *testing.T) { metadata: name: test-taskrun-run-success namespace: foo - uid: bar spec: taskRef: apiVersion: v1 @@ -655,7 +645,6 @@ spec: metadata: name: test-taskrun-with-sa-run-success namespace: foo - uid: bar spec: serviceAccountName: test-sa taskRef: @@ -666,7 +655,6 @@ spec: metadata: name: test-taskrun-substitution namespace: foo - uid: bar spec: params: - name: myarg @@ -683,7 +671,6 @@ spec: metadata: name: test-taskrun-with-taskspec namespace: foo - uid: bar spec: params: - name: myarg @@ -705,7 +692,6 @@ spec: metadata: name: test-taskrun-with-cluster-task namespace: foo - uid: bar spec: taskRef: kind: ClusterTask @@ -719,7 +705,6 @@ metadata: tekton.dev/taskRun: WillNotBeUsed name: test-taskrun-with-labels namespace: foo - uid: bar spec: taskRef: name: test-task @@ -731,7 +716,6 @@ metadata: TaskRunAnnotation: TaskRunValue name: test-taskrun-with-annotations namespace: foo - uid: bar spec: taskRef: name: test-task @@ -741,7 +725,6 @@ spec: metadata: name: test-taskrun-with-pod namespace: foo - uid: bar spec: taskRef: name: test-task @@ -753,7 +736,6 @@ status: metadata: name: test-taskrun-with-credentials-variable namespace: foo - uid: bar spec: taskSpec: steps: @@ -781,7 +763,6 @@ spec: metadata: name: test-taskrun-bundle namespace: foo - uid: bar spec: taskRef: bundle: %s @@ -812,7 +793,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-run-success-pod", "test-task", "test-taskrun-run-success", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-run-success-pod", "test-task", "test-taskrun-run-success", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ image: "foo", name: "simple-step", cmd: "/mycmd", @@ -824,7 +805,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-sa-run-success-pod", "test-with-sa", "test-taskrun-with-sa-run-success", "bar", "foo", "test-sa", false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-sa-run-success-pod", "test-with-sa", "test-taskrun-with-sa-run-success", "foo", "test-sa", false, nil, []stepForExpectedPod{{ image: "foo", name: "sa-step", cmd: "/mycmd", @@ -836,7 +817,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-substitution-pod", "test-task-with-substitution", "test-taskrun-substitution", "bar", "foo", config.DefaultServiceAccountValue, false, []corev1.Volume{{ + wantPod: expectedPod("test-taskrun-substitution-pod", "test-task-with-substitution", "test-taskrun-substitution", "foo", config.DefaultServiceAccountValue, false, []corev1.Volume{{ Name: "volume-configmap", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ @@ -872,7 +853,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-taskspec-pod", "", "test-taskrun-with-taskspec", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{ + wantPod: expectedPod("test-taskrun-with-taskspec-pod", "", "test-taskrun-with-taskspec", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{ { name: "mycontainer", image: "myimage", @@ -886,7 +867,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-cluster-task-pod", "test-cluster-task", "test-taskrun-with-cluster-task", "bar", "foo", config.DefaultServiceAccountValue, true, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-cluster-task-pod", "test-cluster-task", "test-taskrun-with-cluster-task", "foo", config.DefaultServiceAccountValue, true, nil, []stepForExpectedPod{{ name: "simple-step", image: "foo", cmd: "/mycmd", @@ -898,7 +879,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-pod-pod", "test-task", "test-taskrun-with-pod", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-pod-pod", "test-task", "test-taskrun-with-pod", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ name: "simple-step", image: "foo", cmd: "/mycmd", @@ -910,7 +891,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-credentials-variable-pod", "", "test-taskrun-with-credentials-variable", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-credentials-variable-pod", "", "test-taskrun-with-credentials-variable", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ name: "mycontainer", image: "myimage", cmd: "/mycmd /tekton/creds", @@ -922,7 +903,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-bundle-pod", "test-task", "test-taskrun-bundle", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-bundle-pod", "test-task", "test-taskrun-bundle", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ name: "simple-step", image: "foo", cmd: "/mycmd", @@ -980,7 +961,7 @@ spec: err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, tc.name, tc.wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } }) } @@ -992,7 +973,6 @@ func TestAlphaReconcile(t *testing.T) { metadata: name: test-taskrun-with-output-config namespace: foo - uid: bar spec: taskSpec: steps: @@ -1008,7 +988,6 @@ spec: metadata: name: test-taskrun-with-output-config-ws namespace: foo - uid: bar spec: workspaces: - name: data @@ -1053,7 +1032,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: expectedPod("test-taskrun-with-output-config-pod", "", "test-taskrun-with-output-config", "bar", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ + wantPod: expectedPod("test-taskrun-with-output-config-pod", "", "test-taskrun-with-output-config", "foo", config.DefaultServiceAccountValue, false, nil, []stepForExpectedPod{{ name: "mycontainer", image: "myimage", stdoutPath: "stdout.txt", @@ -1066,7 +1045,7 @@ spec: "Normal Started ", "Normal Running Not all Steps", }, - wantPod: addVolumeMounts(expectedPod("test-taskrun-with-output-config-ws-pod", "", "test-taskrun-with-output-config-ws", "bar", "foo", config.DefaultServiceAccountValue, false, + wantPod: addVolumeMounts(expectedPod("test-taskrun-with-output-config-ws-pod", "", "test-taskrun-with-output-config-ws", "foo", config.DefaultServiceAccountValue, false, []corev1.Volume{{ Name: "ws-d872e", VolumeSource: corev1.VolumeSource{ @@ -1136,7 +1115,7 @@ spec: err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, tc.name, tc.wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } }) } @@ -1216,7 +1195,7 @@ spec: spec: steps: - name: step1 - image: docker.io/library/ubuntu + image: ubuntu script: | echo "hello world!" `) @@ -1475,7 +1454,7 @@ spec: err := k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, tc.name, tc.wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } newTr, err := testAssets.Clients.Pipeline.TektonV1().TaskRuns(tc.taskRun.Namespace).Get(testAssets.Ctx, tc.taskRun.Name, metav1.GetOptions{}) @@ -1717,6 +1696,7 @@ status: provenance: featureFlags: RunningInEnvWithInjectedSidecars: true + EnableTektonOCIBundles: true EnforceNonfalsifiability: "none" EnableAPIFields: "alpha" AwaitSidecarReadiness: true @@ -1729,6 +1709,7 @@ status: provenance: featureFlags: RunningInEnvWithInjectedSidecars: true + EnableTektonOCIBundles: true EnableAPIFields: "alpha" EnforceNonfalsifiability: "none" AwaitSidecarReadiness: true @@ -1985,47 +1966,39 @@ spec: Tasks: []*v1.Task{simpleTask}, ClusterTasks: []*v1beta1.ClusterTask{}, } - for _, v := range []error{ - errors.New("etcdserver: leader changed"), - context.DeadlineExceeded, - apierrors.NewConflict(pipeline.TaskRunResource, "", nil), - apierrors.NewServerTimeout(pipeline.TaskRunResource, "", 0), - apierrors.NewTimeoutError("", 0), - } { - testAssets, cancel := getTaskRunController(t, d) - defer cancel() - c := testAssets.Controller - clients := testAssets.Clients - createServiceAccount(t, testAssets, "default", tr.Namespace) + testAssets, cancel := getTaskRunController(t, d) + defer cancel() + c := testAssets.Controller + clients := testAssets.Clients + createServiceAccount(t, testAssets, "default", tr.Namespace) - failingReactorActivated := true - clients.Pipeline.PrependReactor("*", "tasks", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) { - return failingReactorActivated, &v1.Task{}, v - }) - err := c.Reconciler.Reconcile(testAssets.Ctx, getRunName(tr)) - if err == nil { - t.Error("Wanted a wrapped error, but got nil.") - } - if controller.IsPermanentError(err) { - t.Errorf("Unexpected permanent error %v", err) - } + failingReactorActivated := true + clients.Pipeline.PrependReactor("*", "tasks", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) { + return failingReactorActivated, &v1.Task{}, errors.New("etcdserver: leader changed") + }) + err := c.Reconciler.Reconcile(testAssets.Ctx, getRunName(tr)) + if err == nil { + t.Error("Wanted a wrapped error, but got nil.") + } + if controller.IsPermanentError(err) { + t.Errorf("Unexpected permanent error %v", err) + } - failingReactorActivated = false - err = c.Reconciler.Reconcile(testAssets.Ctx, getRunName(tr)) - if err != nil { - if ok, _ := controller.IsRequeueKey(err); !ok { - t.Errorf("unexpected error in TaskRun reconciliation: %v", err) - } - } - reconciledRun, err := clients.Pipeline.TektonV1().TaskRuns("foo").Get(testAssets.Ctx, tr.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Somehow had error getting reconciled run out of fake client: %s", err) - } - condition := reconciledRun.Status.GetCondition(apis.ConditionSucceeded) - if !condition.IsUnknown() { - t.Errorf("Expected TaskRun to still be running but succeeded condition is %v", condition.Status) + failingReactorActivated = false + err = c.Reconciler.Reconcile(testAssets.Ctx, getRunName(tr)) + if err != nil { + if ok, _ := controller.IsRequeueKey(err); !ok { + t.Errorf("unexpected error in TaskRun reconciliation: %v", err) } } + reconciledRun, err := clients.Pipeline.TektonV1().TaskRuns("foo").Get(testAssets.Ctx, tr.Name, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Somehow had error getting reconciled run out of fake client: %s", err) + } + condition := reconciledRun.Status.GetCondition(apis.ConditionSucceeded) + if !condition.IsUnknown() { + t.Errorf("Expected TaskRun to still be running but succeeded condition is %v", condition.Status) + } } func TestReconcile_InvalidRemoteTask(t *testing.T) { @@ -2127,7 +2100,7 @@ spec: resolver: bar `) - stepAction := parse.MustParseV1beta1StepAction(t, ` + stepAction := parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -2162,7 +2135,7 @@ spec: clients := testAssets.Clients err = c.Reconciler.Reconcile(testAssets.Ctx, fmt.Sprintf("%s/%s", tr.Namespace, tr.Name)) if controller.IsPermanentError(err) { - t.Errorf("Not expected permanent error but got %v", err) + t.Errorf("Not expected permanent error but got %t", err) } reconciledRun, err := clients.Pipeline.TektonV1().TaskRuns(tr.Namespace).Get(testAssets.Ctx, tr.Name, metav1.GetOptions{}) if err != nil { @@ -2187,7 +2160,7 @@ spec: resolver: bar `)} - stepAction := parse.MustParseV1beta1StepAction(t, ` + stepAction := parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -2332,7 +2305,7 @@ status: // Check actions actions := clients.Kube.Actions() if len(actions) != 2 || !actions[0].Matches("list", "configmaps") || !actions[1].Matches("watch", "configmaps") { - t.Errorf("expected 3 actions (list configmaps, and watch configmaps) created by the reconciler,"+ + t.Errorf("expected 2 actions (list configmaps, and watch configmaps) created by the reconciler,"+ " got %d. Actions: %#v", len(actions), actions) } @@ -2501,7 +2474,7 @@ status: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, "test-reconcile-pod-updateStatus", wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } } @@ -2600,7 +2573,7 @@ status: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, "test-reconcile-on-cancelled-taskrun", wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } // reconcile the completed TaskRun again without the pod as that was deleted @@ -2673,7 +2646,7 @@ status: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, "test-reconcile-on-timedout-taskrun", wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } // reconcile the completed TaskRun again without the pod as that was deleted @@ -2777,7 +2750,7 @@ metadata: spec: taskSpec: sidecars: - - image: docker.io/library/ubuntu:24.04 + - image: ubuntu - image: whatever steps: - image: alpine @@ -2906,7 +2879,7 @@ status: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, taskRun.Name, wantEvents) if err != nil { - t.Error(err.Error()) + t.Errorf(err.Error()) } } }) @@ -3111,7 +3084,7 @@ status: } err = k8sevent.CheckEventsOrdered(t, testAssets.Recorder.Events, tc.taskRun.Name, tc.wantEvents) if !(err == nil) { - t.Error(err.Error()) + t.Errorf(err.Error()) } }) } @@ -3577,7 +3550,7 @@ spec: - name: inlined-step image: "inlined-image" `) - stepAction := parse.MustParseV1beta1StepAction(t, ` + stepAction := parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3587,7 +3560,7 @@ spec: securityContext: privileged: true `) - stepAction2 := parse.MustParseV1beta1StepAction(t, ` + stepAction2 := parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction2 namespace: foo @@ -3597,7 +3570,7 @@ spec: `) d := test.Data{ TaskRuns: []*v1.TaskRun{taskRun}, - StepActions: []*v1beta1.StepAction{stepAction, stepAction2}, + StepActions: []*v1alpha1.StepAction{stepAction, stepAction2}, ConfigMaps: []*corev1.ConfigMap{ { ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, @@ -3687,7 +3660,7 @@ func TestStepActionRefParams(t *testing.T) { tests := []struct { name string taskRun *v1.TaskRun - stepAction *v1beta1.StepAction + stepAction *v1alpha1.StepAction want []v1.Step }{{ name: "params propagated from taskrun", @@ -3717,7 +3690,7 @@ spec: - name: object-param value: $(params.objectparam[*]) `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3762,7 +3735,7 @@ spec: - name: stringparam value: "step string param" `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3795,7 +3768,7 @@ spec: name: stepAction name: step1 `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3826,7 +3799,7 @@ spec: name: stepAction name: step1 `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3872,7 +3845,7 @@ spec: - name: object-param value: $(params.objectparam[*]) `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3909,7 +3882,7 @@ spec: name: stepAction name: step1 `), - stepAction: parse.MustParseV1beta1StepAction(t, ` + stepAction: parse.MustParseV1alpha1StepAction(t, ` metadata: name: stepAction namespace: foo @@ -3946,7 +3919,7 @@ spec: t.Run(tt.name, func(t *testing.T) { d := test.Data{ TaskRuns: []*v1.TaskRun{tt.taskRun}, - StepActions: []*v1beta1.StepAction{tt.stepAction}, + StepActions: []*v1alpha1.StepAction{tt.stepAction}, ConfigMaps: []*corev1.ConfigMap{ { ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, @@ -5245,7 +5218,7 @@ status: t.Fatal(err) } if d := cmp.Diff(&tc.expectedStatus, tc.taskRun.Status.GetCondition(apis.ConditionSucceeded), ignoreLastTransitionTime); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } if tc.expectedStepStates != nil { @@ -5349,7 +5322,7 @@ spec: t.Errorf("storePipelineSpec() error = %v", err) } if d := cmp.Diff(tc.wantTaskRun, tr); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } // mock second reconcile @@ -5357,7 +5330,7 @@ spec: t.Errorf("storePipelineSpec() error = %v", err) } if d := cmp.Diff(tc.wantTaskRun, tr); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } }) } @@ -5382,10 +5355,10 @@ func Test_storeTaskSpec_metadata(t *testing.T) { t.Errorf("storeTaskSpecAndMergeMeta error = %v", err) } if d := cmp.Diff(wantedlabels, tr.ObjectMeta.Labels); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } if d := cmp.Diff(wantedannotations, tr.ObjectMeta.Annotations); d != "" { - t.Fatal(diff.PrintWantGot(d)) + t.Fatalf(diff.PrintWantGot(d)) } } @@ -5879,7 +5852,7 @@ func podVolumeMounts(idx, totalSteps int) []corev1.VolumeMount { MountPath: "/tekton/bin", ReadOnly: true, }) - for i := range totalSteps { + for i := 0; i < totalSteps; i++ { mnts = append(mnts, corev1.VolumeMount{ Name: fmt.Sprintf("tekton-internal-run-%d", i), MountPath: filepath.Join("/tekton/run", strconv.Itoa(i)), @@ -5914,10 +5887,6 @@ func podVolumeMounts(idx, totalSteps int) []corev1.VolumeMount { MountPath: "/tekton/steps", ReadOnly: true, }) - mnts = append(mnts, corev1.VolumeMount{ - Name: "tekton-internal-artifacts", - MountPath: "/tekton/artifacts", - }) return mnts } @@ -5956,7 +5925,7 @@ func podArgs(cmd string, stdoutPath string, stderrPath string, additionalArgs [] return args } -func podObjectMeta(name, taskName, taskRunName, taskRunUID, ns string, isClusterTask bool) metav1.ObjectMeta { +func podObjectMeta(name, taskName, taskRunName, ns string, isClusterTask bool) metav1.ObjectMeta { trueB := true om := metav1.ObjectMeta{ Name: name, @@ -5966,7 +5935,6 @@ func podObjectMeta(name, taskName, taskRunName, taskRunUID, ns string, isCluster }, Labels: map[string]string{ pipeline.TaskRunLabelKey: taskRunName, - pipeline.TaskRunUIDLabelKey: taskRunUID, "app.kubernetes.io/managed-by": "tekton-pipelines", }, OwnerReferences: []metav1.OwnerReference{{ @@ -5975,7 +5943,6 @@ func podObjectMeta(name, taskName, taskRunName, taskRunUID, ns string, isCluster Controller: &trueB, BlockOwnerDeletion: &trueB, APIVersion: currentAPIVersion, - UID: types.UID(taskRunUID), }}, } @@ -6002,19 +5969,18 @@ type stepForExpectedPod struct { stderrPath string } -func expectedPod(podName, taskName, taskRunName, taskRunUID, ns, saName string, isClusterTask bool, extraVolumes []corev1.Volume, steps []stepForExpectedPod) *corev1.Pod { +func expectedPod(podName, taskName, taskRunName, ns, saName string, isClusterTask bool, extraVolumes []corev1.Volume, steps []stepForExpectedPod) *corev1.Pod { stepNames := make([]string, 0, len(steps)) for _, s := range steps { stepNames = append(stepNames, "step-"+s.name) } p := &corev1.Pod{ - ObjectMeta: podObjectMeta(podName, taskName, taskRunName, taskRunUID, ns, isClusterTask), + ObjectMeta: podObjectMeta(podName, taskName, taskRunName, ns, isClusterTask), Spec: corev1.PodSpec{ Volumes: []corev1.Volume{ workspaceVolume, homeVolume, resultsVolume, - artifactsVolume, stepsVolume, binVolume, downwardVolume, @@ -7074,7 +7040,7 @@ func TestIsConcurrentModificationError(t *testing.T) { // the ResolutionRequest's name is generated by resolverName, namespace and runName. func getResolvedResolutionRequest(t *testing.T, resolverName string, resourceBytes []byte, namespace string, runName string) resolutionv1beta1.ResolutionRequest { t.Helper() - name, err := remoteresource.GenerateDeterministicNameFromSpec(resolverName, namespace+"/"+runName, &resolutionv1beta1.ResolutionRequestSpec{}) + name, err := remoteresource.GenerateDeterministicName(resolverName, namespace+"/"+runName, nil) if err != nil { t.Errorf("error generating name for %s/%s/%s: %v", resolverName, namespace, runName, err) } diff --git a/upstream/pkg/reconciler/taskrun/tracing.go b/upstream/pkg/reconciler/taskrun/tracing.go index 9bcf616c1c4..d5e26a3a984 100644 --- a/upstream/pkg/reconciler/taskrun/tracing.go +++ b/upstream/pkg/reconciler/taskrun/tracing.go @@ -42,7 +42,7 @@ func initTracing(ctx context.Context, tracerProvider trace.TracerProvider, tr *v pro := otel.GetTextMapPropagator() // SpanContext was created already - if len(tr.Status.SpanContext) > 0 { + if tr.Status.SpanContext != nil && len(tr.Status.SpanContext) > 0 { return pro.Extract(ctx, propagation.MapCarrier(tr.Status.SpanContext)) } diff --git a/upstream/pkg/remote/resolution/error.go b/upstream/pkg/remote/resolution/error.go index 9621060e074..05022c5f8cb 100644 --- a/upstream/pkg/remote/resolution/error.go +++ b/upstream/pkg/remote/resolution/error.go @@ -36,7 +36,7 @@ var ( // InvalidRuntimeObjectError is returned when remote resolution // succeeded but the returned data is not a valid runtime.Object. type InvalidRuntimeObjectError struct { - Original error + original error } // ErrorInvalidRuntimeObject is an alias to InvalidRuntimeObjectError. @@ -51,12 +51,12 @@ var ( // Error returns the string representation of this error. func (e *InvalidRuntimeObjectError) Error() string { - return fmt.Sprintf("invalid runtime object: %v", e.Original) + return fmt.Sprintf("invalid runtime object: %v", e.original) } // Unwrap returns the underlying original error. func (e *InvalidRuntimeObjectError) Unwrap() error { - return e.Original + return e.original } // Is returns true if the given error coerces into an error of this type. @@ -68,7 +68,7 @@ func (e *InvalidRuntimeObjectError) Is(that error) bool { // attempting to access the resolved data failed. An example of this // type of error would be if a ResolutionRequest contained malformed base64. type DataAccessError struct { - Original error + original error } // ErrorAccessingData is an alias to DataAccessError @@ -83,12 +83,12 @@ var ( // Error returns the string representation of this error. func (e *DataAccessError) Error() string { - return fmt.Sprintf("error accessing data from remote resource: %v", e.Original) + return fmt.Sprintf("error accessing data from remote resource: %v", e.original) } // Unwrap returns the underlying original error. func (e *DataAccessError) Unwrap() error { - return e.Original + return e.original } // Is returns true if the given error coerces into an error of this type. diff --git a/upstream/pkg/remote/resolution/resolver.go b/upstream/pkg/remote/resolution/resolver.go index f858d1259e0..772b39e416a 100644 --- a/upstream/pkg/remote/resolution/resolver.go +++ b/upstream/pkg/remote/resolution/resolver.go @@ -19,13 +19,11 @@ import ( "fmt" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" "github.com/tektoncd/pipeline/pkg/remote" resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" remoteresource "github.com/tektoncd/pipeline/pkg/resolution/resource" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" "knative.dev/pkg/kmeta" ) @@ -65,7 +63,24 @@ func (resolver *Resolver) Get(ctx context.Context, _, _ string) (runtime.Object, return nil, nil, fmt.Errorf("error building request for remote resource: %w", err) } resolved, err := resolver.requester.Submit(ctx, resolverName, req) - return ResolvedRequest(resolved, err) + switch { + case errors.Is(err, resolutioncommon.ErrRequestInProgress): + return nil, nil, remote.ErrRequestInProgress + case err != nil: + return nil, nil, fmt.Errorf("error requesting remote resource: %w", err) + case resolved == nil: + return nil, nil, ErrNilResource + default: + } + data, err := resolved.Data() + if err != nil { + return nil, nil, &DataAccessError{original: err} + } + obj, _, err := scheme.Codecs.UniversalDeserializer().Decode(data, nil, nil) + if err != nil { + return nil, nil, &InvalidRuntimeObjectError{original: err} + } + return obj, resolved.RefSource(), nil } // List implements remote.Resolver but is unused for remote resolution. @@ -74,12 +89,20 @@ func (resolver *Resolver) List(_ context.Context) ([]remote.ResolvedObject, erro } func buildRequest(resolverName string, owner kmeta.OwnerRefable, name string, namespace string, params v1.Params) (*resolutionRequest, error) { - rr := &v1beta1.ResolutionRequestSpec{ - Params: params, + if name == "" { + name = owner.GetObjectMeta().GetName() + namespace = owner.GetObjectMeta().GetNamespace() } - name, namespace, err := remoteresource.GetNameAndNamespace(resolverName, owner, name, namespace, rr) + if namespace == "" { + namespace = "default" + } + // Generating a deterministic name for the resource request + // prevents multiple requests being issued for the same + // pipelinerun's pipelineRef or taskrun's taskRef. + remoteResourceBaseName := namespace + "/" + name + name, err := remoteresource.GenerateDeterministicName(resolverName, remoteResourceBaseName, params) if err != nil { - return nil, err + return nil, fmt.Errorf("error generating name for taskrun %s/%s: %w", namespace, name, err) } req := &resolutionRequest{ Request: remoteresource.NewRequest(name, namespace, params), @@ -87,25 +110,3 @@ func buildRequest(resolverName string, owner kmeta.OwnerRefable, name string, na } return req, nil } - -func ResolvedRequest(resolved resolutioncommon.ResolvedResource, err error) (runtime.Object, *v1.RefSource, error) { - switch { - case errors.Is(err, resolutioncommon.ErrRequestInProgress): - return nil, nil, remote.ErrRequestInProgress - case err != nil: - return nil, nil, fmt.Errorf("error requesting remote resource: %w", err) - case resolved == nil: - return nil, nil, ErrNilResource - default: - } - data, err := resolved.Data() - if err != nil { - return nil, nil, &DataAccessError{Original: err} - } - codecs := serializer.NewCodecFactory(scheme.Scheme, serializer.EnableStrict) - obj, _, err := codecs.UniversalDeserializer().Decode(data, nil, nil) - if err != nil { - return nil, nil, &InvalidRuntimeObjectError{Original: err} - } - return obj, resolved.RefSource(), nil -} diff --git a/upstream/pkg/remote/resolution/resolver_test.go b/upstream/pkg/remote/resolution/resolver_test.go index 88150665332..8e900ba50ea 100644 --- a/upstream/pkg/remote/resolution/resolver_test.go +++ b/upstream/pkg/remote/resolution/resolver_test.go @@ -23,8 +23,8 @@ import ( "github.com/tektoncd/pipeline/pkg/remote" resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" remoteresource "github.com/tektoncd/pipeline/pkg/resolution/resource" + "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" - resolution "github.com/tektoncd/pipeline/test/resolution" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/kmeta" ) @@ -40,7 +40,7 @@ spec: taskSpec: steps: - name: step1 - image: docker.io/library/ubuntu + image: ubuntu script: | echo "hello world!" `) @@ -60,11 +60,11 @@ func TestGet_Successful(t *testing.T) { Namespace: "bar", }, } - resolved := &resolution.ResolvedResource{ + resolved := &test.ResolvedResource{ ResolvedData: tc.resolvedData, ResolvedAnnotations: tc.resolvedAnnotations, } - requester := &resolution.Requester{ + requester := &test.Requester{ SubmitErr: nil, ResolvedResource: resolved, } @@ -75,75 +75,16 @@ func TestGet_Successful(t *testing.T) { } } -var invalidPipelineBytes = []byte(` -kind: Pipeline -apiVersion: tekton.dev/v1 -metadata: - name: foo -spec: - tasks: - - name: task1 - taskSpec: - foo: bar - steps: - - name: step1 - image: ubuntu - script: | - echo "hello world!" - foo: bar -`) - -var invalidTaskBytes = []byte(` -kind: Task -apiVersion: tekton.dev/v1 -metadata: - name: foo -spec: - foo: bar - steps: - - name: step1 - image: ubuntu - script: | - echo "hello world!" -`) - -var invalidStepActionBytes = []byte(` -kind: StepAction -apiVersion: tekton.dev/v1beta1 -metadata: - name: foo -spec: - image: ubuntu - script: | - echo "hello world!" - foo: bar -`) - func TestGet_Errors(t *testing.T) { genericError := errors.New("uh oh something bad happened") - notARuntimeObject := &resolution.ResolvedResource{ + notARuntimeObject := &test.ResolvedResource{ ResolvedData: []byte(">:)"), ResolvedAnnotations: nil, } - invalidDataResource := &resolution.ResolvedResource{ + invalidDataResource := &test.ResolvedResource{ DataErr: errors.New("data access error"), ResolvedAnnotations: nil, } - invalidPipeline := &resolution.ResolvedResource{ - ResolvedData: invalidPipelineBytes, - DataErr: errors.New(`spec.tasks[0].taskSpec.foo", unknown field "spec.tasks[0].taskSpec.steps[0].foo`), - ResolvedAnnotations: nil, - } - invalidTask := &resolution.ResolvedResource{ - ResolvedData: invalidTaskBytes, - DataErr: errors.New(`spec.foo", unknown field "spec.steps[0].foo`), - ResolvedAnnotations: nil, - } - invalidStepAction := &resolution.ResolvedResource{ - ResolvedData: invalidStepActionBytes, - DataErr: errors.New(`unknown field "spec.foo`), - ResolvedAnnotations: nil, - } for _, tc := range []struct { submitErr error expectedGetErr error @@ -168,18 +109,6 @@ func TestGet_Errors(t *testing.T) { submitErr: nil, expectedGetErr: &DataAccessError{}, resolvedResource: invalidDataResource, - }, { - submitErr: nil, - expectedGetErr: &DataAccessError{}, - resolvedResource: invalidPipeline, - }, { - submitErr: nil, - expectedGetErr: &DataAccessError{}, - resolvedResource: invalidTask, - }, { - submitErr: nil, - expectedGetErr: &DataAccessError{}, - resolvedResource: invalidStepAction, }} { ctx := context.Background() owner := &v1beta1.PipelineRun{ @@ -188,7 +117,7 @@ func TestGet_Errors(t *testing.T) { Namespace: "bar", }, } - requester := &resolution.Requester{ + requester := &test.Requester{ SubmitErr: tc.submitErr, ResolvedResource: tc.resolvedResource, } diff --git a/upstream/pkg/remoteresolution/doc.go b/upstream/pkg/remoteresolution/doc.go deleted file mode 100644 index 83734f5ddd9..00000000000 --- a/upstream/pkg/remoteresolution/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remoteresolution contains the upgraded remote resolution framework. -This was necessary to ensure backwards compatibility with the existing framework. - -This package is subject to further refactoring and changes. -*/ -package remoteresolution diff --git a/upstream/pkg/remoteresolution/remote/resolution/doc.go b/upstream/pkg/remoteresolution/remote/resolution/doc.go deleted file mode 100644 index 3fc8f5f7a8e..00000000000 --- a/upstream/pkg/remoteresolution/remote/resolution/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resolution contains the upgraded remote resolution framework. -It is equivalent to `pkg/remote/resolution`. -This was necessary to ensure backwards compatibility with the existing framework. - -This package is subject to further refactoring and changes. -*/ -package resolution diff --git a/upstream/pkg/remoteresolution/remote/resolution/request.go b/upstream/pkg/remoteresolution/remote/resolution/request.go deleted file mode 100644 index 5a22f414014..00000000000 --- a/upstream/pkg/remoteresolution/remote/resolution/request.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resolution - -import ( - resolution "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/kmeta" -) - -var _ resolution.Request = &resolutionRequest{} -var _ resolution.OwnedRequest = &resolutionRequest{} - -type resolutionRequest struct { - resolution.Request - owner kmeta.OwnerRefable -} - -func (req *resolutionRequest) OwnerRef() metav1.OwnerReference { - return *kmeta.NewControllerRef(req.owner) -} diff --git a/upstream/pkg/remoteresolution/remote/resolution/resolver.go b/upstream/pkg/remoteresolution/remote/resolution/resolver.go deleted file mode 100644 index d3500ae6396..00000000000 --- a/upstream/pkg/remoteresolution/remote/resolution/resolver.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resolution - -import ( - "context" - "fmt" - - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remote" - resolution "github.com/tektoncd/pipeline/pkg/remote/resolution" - remoteresource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - resource "github.com/tektoncd/pipeline/pkg/resolution/resource" - "k8s.io/apimachinery/pkg/runtime" - "knative.dev/pkg/kmeta" -) - -// Resolver implements remote.Resolver and encapsulates the majority of -// code required to interface with the tektoncd/resolution project. It -// is used to make async requests for resources like pipelines from -// remote places like git repos. -type Resolver struct { - requester remoteresource.Requester - owner kmeta.OwnerRefable - resolverName string - resolverPayload remoteresource.ResolverPayload -} - -var _ remote.Resolver = &Resolver{} - -// NewResolver returns an implementation of remote.Resolver capable -// of performing asynchronous remote resolution. -func NewResolver(requester remoteresource.Requester, owner kmeta.OwnerRefable, resolverName string, resolverPayload remoteresource.ResolverPayload) remote.Resolver { - return &Resolver{ - requester: requester, - owner: owner, - resolverName: resolverName, - resolverPayload: resolverPayload, - } -} - -// Get implements remote.Resolver. -func (resolver *Resolver) Get(ctx context.Context, _, _ string) (runtime.Object, *v1.RefSource, error) { - resolverName := remoteresource.ResolverName(resolver.resolverName) - req, err := buildRequest(resolver.resolverName, resolver.owner, &resolver.resolverPayload) - if err != nil { - return nil, nil, fmt.Errorf("error building request for remote resource: %w", err) - } - resolved, err := resolver.requester.Submit(ctx, resolverName, req) - return resolution.ResolvedRequest(resolved, err) -} - -// List implements remote.Resolver but is unused for remote resolution. -func (resolver *Resolver) List(_ context.Context) ([]remote.ResolvedObject, error) { - return nil, nil -} - -func buildRequest(resolverName string, owner kmeta.OwnerRefable, resolverPayload *remoteresource.ResolverPayload) (*resolutionRequest, error) { - var name string - var namespace string - var url string - var params v1.Params - if resolverPayload != nil { - name = resolverPayload.Name - namespace = resolverPayload.Namespace - if resolverPayload.ResolutionSpec != nil { - params = resolverPayload.ResolutionSpec.Params - url = resolverPayload.ResolutionSpec.URL - } - } - rr := &v1beta1.ResolutionRequestSpec{ - Params: params, - URL: url, - } - name, namespace, err := resource.GetNameAndNamespace(resolverName, owner, name, namespace, rr) - if err != nil { - return nil, err - } - resolverPayload.Name = name - resolverPayload.Namespace = namespace - req := &resolutionRequest{ - Request: remoteresource.NewRequest(*resolverPayload), - owner: owner, - } - return req, nil -} diff --git a/upstream/pkg/remoteresolution/remote/resolution/resolver_test.go b/upstream/pkg/remoteresolution/remote/resolution/resolver_test.go deleted file mode 100644 index e196e327e27..00000000000 --- a/upstream/pkg/remoteresolution/remote/resolution/resolver_test.go +++ /dev/null @@ -1,190 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resolution - -import ( - "context" - "errors" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - resv1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - - "github.com/tektoncd/pipeline/pkg/remote" - "github.com/tektoncd/pipeline/pkg/remote/resolution" - remoteresource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resource" - "github.com/tektoncd/pipeline/test/diff" - test "github.com/tektoncd/pipeline/test/remoteresolution" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/kmeta" -) - -var pipelineBytes = []byte(` -kind: Pipeline -apiVersion: tekton.dev/v1beta1 -metadata: - name: foo -spec: - tasks: - - name: task1 - taskSpec: - steps: - - name: step1 - image: docker.io/library/ubuntu - script: | - echo "hello world!" -`) - -func TestGet_Successful(t *testing.T) { - for _, tc := range []struct { - resolvedData []byte - resolvedAnnotations map[string]string - }{{ - resolvedData: pipelineBytes, - resolvedAnnotations: nil, - }} { - ctx := context.Background() - owner := &v1beta1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - } - resolved := &test.ResolvedResource{ - ResolvedData: tc.resolvedData, - ResolvedAnnotations: tc.resolvedAnnotations, - } - requester := &test.Requester{ - SubmitErr: nil, - ResolvedResource: resolved, - } - resolver := NewResolver(requester, owner, "git", remoteresource.ResolverPayload{}) - if _, _, err := resolver.Get(ctx, "foo", "bar"); err != nil { - t.Fatalf("unexpected error: %v", err) - } - } -} - -func TestGet_Errors(t *testing.T) { - genericError := errors.New("uh oh something bad happened") - notARuntimeObject := &test.ResolvedResource{ - ResolvedData: []byte(">:)"), - ResolvedAnnotations: nil, - } - invalidDataResource := &test.ResolvedResource{ - DataErr: errors.New("data access error"), - ResolvedAnnotations: nil, - } - for _, tc := range []struct { - submitErr error - expectedGetErr error - resolvedResource remoteresource.ResolvedResource - }{{ - submitErr: common.ErrRequestInProgress, - expectedGetErr: remote.ErrRequestInProgress, - resolvedResource: nil, - }, { - submitErr: nil, - expectedGetErr: resolution.ErrNilResource, - resolvedResource: nil, - }, { - submitErr: genericError, - expectedGetErr: genericError, - resolvedResource: nil, - }, { - submitErr: nil, - expectedGetErr: &resolution.InvalidRuntimeObjectError{}, - resolvedResource: notARuntimeObject, - }, { - submitErr: nil, - expectedGetErr: &resolution.DataAccessError{}, - resolvedResource: invalidDataResource, - }} { - ctx := context.Background() - owner := &v1beta1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - } - requester := &test.Requester{ - SubmitErr: tc.submitErr, - ResolvedResource: tc.resolvedResource, - } - resolver := NewResolver(requester, owner, "git", remoteresource.ResolverPayload{}) - obj, refSource, err := resolver.Get(ctx, "foo", "bar") - if obj != nil { - t.Errorf("received unexpected resolved resource") - } - if refSource != nil { - t.Errorf("expected refSource is nil, but received %v", refSource) - } - if !errors.Is(err, tc.expectedGetErr) { - t.Fatalf("expected %v received %v", tc.expectedGetErr, err) - } - } -} - -func TestBuildRequestV2(t *testing.T) { - for _, tc := range []struct { - name string - targetName string - targetNamespace string - url string - }{{ - name: "just owner", - }, { - name: "with target name and namespace", - targetName: "some-object", - targetNamespace: "some-ns", - }, { - name: "with target name, namespace, and url", - targetName: "some-object", - targetNamespace: "some-ns", - url: "scheme://value", - }} { - t.Run(tc.name, func(t *testing.T) { - owner := &v1beta1.PipelineRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "bar", - }, - } - - rr := &remoteresource.ResolverPayload{Name: tc.targetName, Namespace: tc.targetNamespace} - rr.ResolutionSpec = &resv1beta1.ResolutionRequestSpec{URL: tc.url} - req, err := buildRequest("git", owner, rr) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if d := cmp.Diff(*kmeta.NewControllerRef(owner), req.OwnerRef()); d != "" { - t.Errorf("expected matching owner ref but got %s", diff.PrintWantGot(d)) - } - reqNameBase := owner.Namespace + "/" + owner.Name - if tc.targetName != "" { - reqNameBase = tc.targetNamespace + "/" + tc.targetName - } - expectedReqName, err := resource.GenerateDeterministicNameFromSpec("git", reqNameBase, rr.ResolutionSpec) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if expectedReqName != req.ResolverPayload().Name { - t.Errorf("expected request name %s, but was %s", expectedReqName, req.ResolverPayload().Name) - } - }) - } -} diff --git a/upstream/pkg/remoteresolution/resolver/bundle/resolver.go b/upstream/pkg/remoteresolution/resolver/bundle/resolver.go deleted file mode 100644 index 4f8612931a0..00000000000 --- a/upstream/pkg/remoteresolution/resolver/bundle/resolver.go +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2024 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 bundle - -import ( - "context" - "errors" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "k8s.io/client-go/kubernetes" - "knative.dev/pkg/client/injection/kube/client" -) - -const ( - // LabelValueBundleResolverType is the value to use for the - // resolution.tekton.dev/type label on resource requests - LabelValueBundleResolverType string = "bundles" - - // BundleResolverName is the name that the bundle resolver should be associated with. - BundleResolverName = "bundleresolver" -) - -var _ framework.Resolver = &Resolver{} - -// Resolver implements a framework.Resolver that can fetch files from OCI bundles. -type Resolver struct { - kubeClientSet kubernetes.Interface -} - -// Initialize sets up any dependencies needed by the Resolver. None atm. -func (r *Resolver) Initialize(ctx context.Context) error { - r.kubeClientSet = client.Get(ctx) - return nil -} - -// GetName returns a string name to refer to this Resolver by. -func (r *Resolver) GetName(context.Context) string { - return BundleResolverName -} - -// GetConfigName returns the name of the bundle resolver's configmap. -func (r *Resolver) GetConfigName(context.Context) string { - return bundle.ConfigMapName -} - -// GetSelector returns a map of labels to match requests to this Resolver. -func (r *Resolver) GetSelector(context.Context) map[string]string { - return map[string]string{ - common.LabelKeyResolverType: LabelValueBundleResolverType, - } -} - -// Validate ensures reqolution request spec from a request are as expected. -func (r *Resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return bundle.ValidateParams(ctx, req.Params) - } - // Remove this error once validate url has been implemented. - return errors.New("cannot validate request. the Validate method has not been implemented.") -} - -// Resolve uses the given request spec resolve the requested file or resource. -func (r *Resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (resolutionframework.ResolvedResource, error) { - if len(req.Params) > 0 { - return bundle.ResolveRequest(ctx, r.kubeClientSet, req) - } - // Remove this error once resolution of url has been implemented. - return nil, errors.New("the Resolve method has not been implemented.") -} diff --git a/upstream/pkg/remoteresolution/resolver/bundle/resolver_test.go b/upstream/pkg/remoteresolution/resolver/bundle/resolver_test.go deleted file mode 100644 index 738c523991b..00000000000 --- a/upstream/pkg/remoteresolution/resolver/bundle/resolver_test.go +++ /dev/null @@ -1,665 +0,0 @@ -/* - Copyright 2024 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 bundle_test - -import ( - "context" - "errors" - "fmt" - "net/http/httptest" - "net/url" - "strings" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-containerregistry/pkg/registry" - resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - bundle "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/bundle" - frtesting "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework/testing" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - bundleresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - frameworktesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - ktesting "k8s.io/client-go/testing" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" // Setup system.Namespace() - "sigs.k8s.io/yaml" -) - -const ( - disabledError = "cannot handle resolution request, enable-bundles-resolver feature flag not true" -) - -func TestGetSelector(t *testing.T) { - resolver := bundle.Resolver{} - sel := resolver.GetSelector(context.Background()) - if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { - t.Fatalf("unexpected selector: %v", sel) - } else if typ != bundle.LabelValueBundleResolverType { - t.Fatalf("unexpected type: %q", typ) - } -} - -func TestValidateParamsSecret(t *testing.T) { - resolver := bundle.Resolver{} - config := map[string]string{ - bundleresolution.ConfigServiceAccount: "default", - } - ctx := framework.InjectResolverConfigToContext(context.Background(), config) - - paramsWithTask := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: paramsWithTask} - if err := resolver.Validate(ctx, &req); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - - paramsWithPipeline := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("pipeline"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req = v1beta1.ResolutionRequestSpec{Params: paramsWithPipeline} - if err := resolver.Validate(ctx, &req); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } -} - -func TestValidateParamsServiceAccount(t *testing.T) { - resolver := bundle.Resolver{} - config := map[string]string{ - bundleresolution.ConfigServiceAccount: "default", - } - ctx := framework.InjectResolverConfigToContext(context.Background(), config) - - paramsWithTask := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: paramsWithTask} - if err := resolver.Validate(ctx, &req); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - - paramsWithPipeline := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("pipeline"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req = v1beta1.ResolutionRequestSpec{Params: paramsWithPipeline} - if err := resolver.Validate(context.Background(), &req); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } -} - -func TestValidateDisabled(t *testing.T) { - resolver := bundle.Resolver{} - - var err error - - params := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: params} - err = resolver.Validate(resolverDisabledContext(), &req) - if err == nil { - t.Fatalf("expected disabled err") - } - - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -func TestValidateMissing(t *testing.T) { - resolver := bundle.Resolver{} - - var err error - - paramsMissingBundle := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: paramsMissingBundle} - err = resolver.Validate(context.Background(), &req) - if err == nil { - t.Fatalf("expected missing kind err") - } - - paramsMissingName := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req = v1beta1.ResolutionRequestSpec{Params: paramsMissingName} - err = resolver.Validate(context.Background(), &req) - if err == nil { - t.Fatalf("expected missing name err") - } -} - -func TestResolveDisabled(t *testing.T) { - resolver := bundle.Resolver{} - - var err error - - params := []pipelinev1.Param{{ - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: params} - _, err = resolver.Resolve(resolverDisabledContext(), &req) - if err == nil { - t.Fatalf("expected disabled err") - } - - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -func TestResolve_KeyChainError(t *testing.T) { - resolver := &bundle.Resolver{} - params := ¶ms{ - bundle: "foo", - name: "example-task", - kind: "task", - secret: "bar", - } - - ctx, _ := ttesting.SetupFakeContext(t) - request := createRequest(params) - - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - ConfigMaps: []*corev1.ConfigMap{{ - ObjectMeta: metav1.ObjectMeta{ - Name: bundleresolution.ConfigMapName, - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: map[string]string{ - bundleresolution.ConfigKind: "task", - bundleresolution.ConfigServiceAccount: "default", - }, - }}, - } - - testAssets, cancel := frtesting.GetResolverFrameworkController(ctx, t, d, resolver) - defer cancel() - - expectedErr := apierrors.NewBadRequest("bad request") - // return error when getting secrets from kube client - testAssets.Clients.Kube.Fake.PrependReactor("get", "secrets", func(action ktesting.Action) (bool, runtime.Object, error) { - return true, nil, expectedErr - }) - - err := testAssets.Controller.Reconciler.Reconcile(testAssets.Ctx, strings.Join([]string{request.Namespace, request.Name}, "/")) - if err == nil { - t.Fatalf("expected to get error but got nothing") - } - - if !errors.Is(err, expectedErr) { - t.Fatalf("expected to get error %v, but got %v", expectedErr, err) - } -} - -type params struct { - serviceAccount string - secret string - bundle string - name string - kind string -} - -func TestResolve(t *testing.T) { - // example task resource - exampleTask := &pipelinev1beta1.Task{ - ObjectMeta: metav1.ObjectMeta{ - Name: "example-task", - Namespace: "task-ns", - ResourceVersion: "00002", - }, - TypeMeta: metav1.TypeMeta{ - Kind: string(pipelinev1beta1.NamespacedTaskKind), - APIVersion: "tekton.dev/v1beta1", - }, - Spec: pipelinev1beta1.TaskSpec{ - Steps: []pipelinev1beta1.Step{{ - Name: "some-step", - Image: "some-image", - Command: []string{"something"}, - }}, - }, - } - taskAsYAML, err := yaml.Marshal(exampleTask) - if err != nil { - t.Fatalf("couldn't marshal task: %v", err) - } - - // example pipeline resource - examplePipeline := &pipelinev1beta1.Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "example-pipeline", - Namespace: "pipeline-ns", - ResourceVersion: "00001", - }, - TypeMeta: metav1.TypeMeta{ - Kind: "Pipeline", - APIVersion: "tekton.dev/v1beta1", - }, - Spec: pipelinev1beta1.PipelineSpec{ - Tasks: []pipelinev1beta1.PipelineTask{{ - Name: "some-pipeline-task", - TaskRef: &pipelinev1beta1.TaskRef{ - Name: "some-task", - Kind: pipelinev1beta1.NamespacedTaskKind, - }, - }}, - }, - } - pipelineAsYAML, err := yaml.Marshal(examplePipeline) - if err != nil { - t.Fatalf("couldn't marshal pipeline: %v", err) - } - - // too many objects in bundle resolver test - var tooManyObjs []runtime.Object - for i := 0; i <= bundleresolution.MaximumBundleObjects; i++ { - name := fmt.Sprintf("%d-task", i) - obj := pipelinev1beta1.Task{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: "tekton.dev/v1beta1", - Kind: "Task", - }, - } - tooManyObjs = append(tooManyObjs, &obj) - } - - // Set up a fake registry to push an image to. - s := httptest.NewServer(registry.New()) - defer s.Close() - u, err := url.Parse(s.URL) - if err != nil { - t.Fatal(err) - } - r := fmt.Sprintf("%s/%s", u.Host, "testbundleresolver") - testImages := map[string]*imageRef{ - "single-task": pushToRegistry(t, r, "single-task", []runtime.Object{exampleTask}, test.DefaultObjectAnnotationMapper), - "single-pipeline": pushToRegistry(t, r, "single-pipeline", []runtime.Object{examplePipeline}, test.DefaultObjectAnnotationMapper), - "multiple-resources": pushToRegistry(t, r, "multiple-resources", []runtime.Object{exampleTask, examplePipeline}, test.DefaultObjectAnnotationMapper), - "too-many-objs": pushToRegistry(t, r, "too-many-objs", tooManyObjs, asIsMapper), - "single-task-no-version": pushToRegistry(t, r, "single-task-no-version", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{Kind: "task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), - "single-task-no-kind": pushToRegistry(t, r, "single-task-no-kind", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), - "single-task-no-name": pushToRegistry(t, r, "single-task-no-name", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1", Kind: "task"}}}, asIsMapper), - "single-task-kind-incorrect-form": pushToRegistry(t, r, "single-task-kind-incorrect-form", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1", Kind: "Task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), - } - - testcases := []struct { - name string - args *params - imageName string - kindInBundle string - expectedStatus *v1beta1.ResolutionRequestStatus - expectedErrMessage string - }{ - { - name: "single task: digest is included in the bundle parameter", - args: ¶ms{ - bundle: fmt.Sprintf("%s@%s:%s", testImages["single-task"].uri, testImages["single-task"].algo, testImages["single-task"].hex), - name: "example-task", - kind: "task", - }, - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single task: param kind is capitalized, but kind in bundle is not", - args: ¶ms{ - bundle: fmt.Sprintf("%s@%s:%s", testImages["single-task"].uri, testImages["single-task"].algo, testImages["single-task"].hex), - name: "example-task", - kind: "Task", - }, - kindInBundle: "task", - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single task: tag is included in the bundle parameter", - args: ¶ms{ - bundle: testImages["single-task"].uri + ":latest", - name: "example-task", - kind: "task", - }, - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single task: using default kind value from configmap", - args: ¶ms{ - bundle: testImages["single-task"].uri + ":latest", - name: "example-task", - }, - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single pipeline", - args: ¶ms{ - bundle: testImages["single-pipeline"].uri + ":latest", - name: "example-pipeline", - kind: "pipeline", - }, - imageName: "single-pipeline", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), - }, { - name: "multiple resources: an image has both task and pipeline resource", - args: ¶ms{ - bundle: testImages["multiple-resources"].uri + ":latest", - name: "example-pipeline", - kind: "pipeline", - }, - imageName: "multiple-resources", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), - }, { - name: "too many objects in an image", - args: ¶ms{ - bundle: testImages["too-many-objs"].uri + ":latest", - name: "2-task", - kind: "task", - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErrMessage: fmt.Sprintf("contained more than the maximum %d allow objects", bundleresolution.MaximumBundleObjects), - }, { - name: "single task no version", - args: ¶ms{ - bundle: testImages["single-task-no-version"].uri + ":latest", - name: "foo", - kind: "task", - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundleresolution.BundleAnnotationAPIVersion), - }, { - name: "single task no kind", - args: ¶ms{ - bundle: testImages["single-task-no-kind"].uri + ":latest", - name: "foo", - kind: "task", - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundleresolution.BundleAnnotationKind), - }, { - name: "single task no name", - args: ¶ms{ - bundle: testImages["single-task-no-name"].uri + ":latest", - name: "foo", - kind: "task", - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundleresolution.BundleAnnotationName), - }, { - name: "single task kind incorrect form", - args: ¶ms{ - bundle: testImages["single-task-kind-incorrect-form"].uri + ":latest", - name: "foo", - kind: "task", - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErrMessage: fmt.Sprintf("the layer 0 the annotation %s must be lowercased and singular, found %s", bundleresolution.BundleAnnotationKind, "Task"), - }, - } - - resolver := &bundle.Resolver{} - confMap := map[string]string{ - bundleresolution.ConfigKind: "task", - bundleresolution.ConfigServiceAccount: "default", - } - - for _, tc := range testcases { - t.Run(tc.name, func(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - request := createRequest(tc.args) - - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - ConfigMaps: []*corev1.ConfigMap{{ - ObjectMeta: metav1.ObjectMeta{ - Name: bundleresolution.ConfigMapName, - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: confMap, - }, { - ObjectMeta: metav1.ObjectMeta{ - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - Name: resolverconfig.GetFeatureFlagsConfigName(), - }, - Data: map[string]string{ - "enable-bundles-resolver": "true", - }, - }}, - } - var expectedStatus *v1beta1.ResolutionRequestStatus - var expectedError error - if tc.expectedStatus != nil { - expectedStatus = tc.expectedStatus.DeepCopy() - if tc.expectedErrMessage == "" { - if expectedStatus.Annotations == nil { - expectedStatus.Annotations = make(map[string]string) - } - - switch { - case tc.kindInBundle != "": - expectedStatus.Annotations[bundleresolution.ResolverAnnotationKind] = tc.kindInBundle - case tc.args.kind != "": - expectedStatus.Annotations[bundleresolution.ResolverAnnotationKind] = tc.args.kind - default: - expectedStatus.Annotations[bundleresolution.ResolverAnnotationKind] = "task" - } - - expectedStatus.Annotations[bundleresolution.ResolverAnnotationName] = tc.args.name - expectedStatus.Annotations[bundleresolution.ResolverAnnotationAPIVersion] = "v1beta1" - - expectedStatus.RefSource = &pipelinev1.RefSource{ - URI: testImages[tc.imageName].uri, - Digest: map[string]string{ - testImages[tc.imageName].algo: testImages[tc.imageName].hex, - }, - EntryPoint: tc.args.name, - } - expectedStatus.Source = expectedStatus.RefSource - } else { - expectedError = createError(tc.args.bundle, tc.expectedErrMessage) - expectedStatus.Status.Conditions[0].Message = expectedError.Error() - } - } - - frtesting.RunResolverReconcileTest(ctx, t, d, resolver, request, expectedStatus, expectedError) - }) - } -} - -func createRequest(p *params) *v1beta1.ResolutionRequest { - rr := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: bundle.LabelValueBundleResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: bundleresolution.ParamBundle, - Value: *pipelinev1.NewStructuredValues(p.bundle), - }, { - Name: bundleresolution.ParamName, - Value: *pipelinev1.NewStructuredValues(p.name), - }, { - Name: bundleresolution.ParamKind, - Value: *pipelinev1.NewStructuredValues(p.kind), - }, { - Name: bundleresolution.ParamImagePullSecret, - Value: *pipelinev1.NewStructuredValues(p.secret), - }, { - Name: bundleresolution.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues(p.serviceAccount), - }}, - }, - } - return rr -} - -func createError(image, msg string) error { - return &resolutioncommon.GetResourceError{ - ResolverName: bundle.BundleResolverName, - Key: "foo/rr", - Original: fmt.Errorf("invalid tekton bundle %s, error: %s", image, msg), - } -} - -func asIsMapper(obj runtime.Object) map[string]string { - annotations := map[string]string{} - if test.GetObjectName(obj) != "" { - annotations[bundleresolution.BundleAnnotationName] = test.GetObjectName(obj) - } - - if obj.GetObjectKind().GroupVersionKind().Kind != "" { - annotations[bundleresolution.BundleAnnotationKind] = obj.GetObjectKind().GroupVersionKind().Kind - } - if obj.GetObjectKind().GroupVersionKind().Version != "" { - annotations[bundleresolution.BundleAnnotationAPIVersion] = obj.GetObjectKind().GroupVersionKind().Version - } - return annotations -} - -func resolverDisabledContext() context.Context { - return frameworktesting.ContextWithBundlesResolverDisabled(context.Background()) -} - -type imageRef struct { - // uri is the image repositry identifier i.e. "gcr.io/tekton-releases/catalog/upstream/golang-build" - uri string - // algo is the algorithm portion of a particular image digest i.e. "sha256". - algo string - // hex is hex encoded portion of a particular image digest i.e. "23293df97dc11957ec36a88c80101bb554039a76e8992a435112eea8283b30d4". - hex string -} - -// pushToRegistry pushes an image to the registry and returns an imageRef. -// It accepts a registry address, image name, the data and an ObjectAnnotationMapper -// to map an object to the annotations for it. -// NOTE: Every image pushed to the registry has a default tag named "latest". -func pushToRegistry(t *testing.T, registry, imageName string, data []runtime.Object, mapper test.ObjectAnnotationMapper) *imageRef { - t.Helper() - ref, err := test.CreateImageWithAnnotations(fmt.Sprintf("%s/%s:latest", registry, imageName), mapper, data...) - if err != nil { - t.Fatalf("couldn't push the image: %v", err) - } - - refSplit := strings.Split(ref, "@") - uri, digest := refSplit[0], refSplit[1] - digSplits := strings.Split(digest, ":") - algo, hex := digSplits[0], digSplits[1] - - return &imageRef{ - uri: uri, - algo: algo, - hex: hex, - } -} diff --git a/upstream/pkg/remoteresolution/resolver/cluster/resolver.go b/upstream/pkg/remoteresolution/resolver/cluster/resolver.go deleted file mode 100644 index c08f8a18bd3..00000000000 --- a/upstream/pkg/remoteresolution/resolver/cluster/resolver.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 cluster - -import ( - "context" - "errors" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" - pipelineclient "github.com/tektoncd/pipeline/pkg/client/injection/client" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/cluster" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" -) - -const ( - // LabelValueClusterResolverType is the value to use for the - // resolution.tekton.dev/type label on resource requests - LabelValueClusterResolverType string = "cluster" - - // ClusterResolverName is the name that the cluster resolver should be - // associated with - ClusterResolverName string = "Cluster" - - configMapName = "cluster-resolver-config" -) - -var _ framework.Resolver = &Resolver{} - -// ResolverV2 implements a framework.Resolver that can fetch resources from other namespaces. -type Resolver struct { - pipelineClientSet clientset.Interface -} - -// Initialize performs any setup required by the cluster resolver. -func (r *Resolver) Initialize(ctx context.Context) error { - r.pipelineClientSet = pipelineclient.Get(ctx) - return nil -} - -// GetName returns the string name that the cluster resolver should be -// associated with. -func (r *Resolver) GetName(_ context.Context) string { - return ClusterResolverName -} - -// GetSelector returns the labels that resource requests are required to have for -// the cluster resolver to process them. -func (r *Resolver) GetSelector(_ context.Context) map[string]string { - return map[string]string{ - resolutioncommon.LabelKeyResolverType: LabelValueClusterResolverType, - } -} - -// Validate returns an error if the given parameter map is not -// valid for a resource request targeting the cluster resolver. -func (r *Resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return cluster.ValidateParams(ctx, req.Params) - } - // Remove this error once validate url has been implemented. - return errors.New("cannot validate request. the Validate method has not been implemented.") -} - -// Resolve performs the work of fetching a resource from a namespace with the given -// resolution spec. -func (r *Resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (resolutionframework.ResolvedResource, error) { - if len(req.Params) > 0 { - return cluster.ResolveFromParams(ctx, req.Params, r.pipelineClientSet) - } - // Remove this error once resolution of url has been implemented. - return nil, errors.New("the Resolve method has not been implemented.") -} - -var _ resolutionframework.ConfigWatcher = &Resolver{} - -// GetConfigName returns the name of the cluster resolver's configmap. -func (r *Resolver) GetConfigName(context.Context) string { - return configMapName -} diff --git a/upstream/pkg/remoteresolution/resolver/cluster/resolver_test.go b/upstream/pkg/remoteresolution/resolver/cluster/resolver_test.go deleted file mode 100644 index feecae799c7..00000000000 --- a/upstream/pkg/remoteresolution/resolver/cluster/resolver_test.go +++ /dev/null @@ -1,507 +0,0 @@ -/* - Copyright 2024 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cluster_test - -import ( - "context" - "encoding/base64" - "encoding/hex" - "errors" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - cluster "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/cluster" - frtesting "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework/testing" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - clusterresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/cluster" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - frameworktesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - duckv1 "knative.dev/pkg/apis/duck/v1" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" - "sigs.k8s.io/yaml" -) - -const ( - disabledError = "cannot handle resolution request, enable-cluster-resolver feature flag not true" -) - -func TestGetSelector(t *testing.T) { - resolver := cluster.Resolver{} - sel := resolver.GetSelector(context.Background()) - if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { - t.Fatalf("unexpected selector: %v", sel) - } else if typ != cluster.LabelValueClusterResolverType { - t.Fatalf("unexpected type: %q", typ) - } -} - -func TestValidate(t *testing.T) { - resolver := cluster.Resolver{} - - params := []pipelinev1.Param{{ - Name: clusterresolution.KindParam, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: clusterresolution.NamespaceParam, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: clusterresolution.NameParam, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - - ctx := framework.InjectResolverConfigToContext(context.Background(), map[string]string{ - clusterresolution.AllowedNamespacesKey: "foo,bar", - clusterresolution.BlockedNamespacesKey: "abc,def", - }) - - req := v1beta1.ResolutionRequestSpec{Params: params} - if err := resolver.Validate(ctx, &req); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } -} - -func TestValidateNotEnabled(t *testing.T) { - resolver := cluster.Resolver{} - - var err error - - params := []pipelinev1.Param{{ - Name: clusterresolution.KindParam, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: clusterresolution.NamespaceParam, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: clusterresolution.NameParam, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - req := v1beta1.ResolutionRequestSpec{Params: params} - err = resolver.Validate(resolverDisabledContext(), &req) - if err == nil { - t.Fatalf("expected disabled err") - } - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -func TestValidateFailure(t *testing.T) { - testCases := []struct { - name string - params map[string]string - conf map[string]string - expectedErr string - }{ - { - name: "missing kind", - params: map[string]string{ - clusterresolution.NameParam: "foo", - clusterresolution.NamespaceParam: "bar", - }, - expectedErr: "missing required cluster resolver params: kind", - }, { - name: "invalid kind", - params: map[string]string{ - clusterresolution.KindParam: "banana", - clusterresolution.NamespaceParam: "foo", - clusterresolution.NameParam: "bar", - }, - expectedErr: "unknown or unsupported resource kind 'banana'", - }, { - name: "missing multiple", - params: map[string]string{ - clusterresolution.KindParam: "task", - }, - expectedErr: "missing required cluster resolver params: name, namespace", - }, { - name: "not in allowed namespaces", - params: map[string]string{ - clusterresolution.KindParam: "task", - clusterresolution.NamespaceParam: "foo", - clusterresolution.NameParam: "baz", - }, - conf: map[string]string{ - clusterresolution.AllowedNamespacesKey: "abc,def", - }, - expectedErr: "access to specified namespace foo is not allowed", - }, { - name: "in blocked namespaces", - params: map[string]string{ - clusterresolution.KindParam: "task", - clusterresolution.NamespaceParam: "foo", - clusterresolution.NameParam: "baz", - }, - conf: map[string]string{ - clusterresolution.BlockedNamespacesKey: "foo,bar", - }, - expectedErr: "access to specified namespace foo is blocked", - }, - { - name: "blocked by star", - params: map[string]string{ - clusterresolution.KindParam: "task", - clusterresolution.NamespaceParam: "foo", - clusterresolution.NameParam: "baz", - }, - conf: map[string]string{ - clusterresolution.BlockedNamespacesKey: "*", - }, - expectedErr: "only explicit allowed access to namespaces is allowed", - }, - { - name: "blocked by star but allowed explicitly", - params: map[string]string{ - clusterresolution.KindParam: "task", - clusterresolution.NamespaceParam: "foo", - clusterresolution.NameParam: "baz", - }, - conf: map[string]string{ - clusterresolution.BlockedNamespacesKey: "*", - clusterresolution.AllowedNamespacesKey: "foo", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resolver := &cluster.Resolver{} - - ctx := context.Background() - if len(tc.conf) > 0 { - ctx = framework.InjectResolverConfigToContext(ctx, tc.conf) - } - - var asParams []pipelinev1.Param - for k, v := range tc.params { - asParams = append(asParams, pipelinev1.Param{ - Name: k, - Value: *pipelinev1.NewStructuredValues(v), - }) - } - req := v1beta1.ResolutionRequestSpec{Params: asParams} - err := resolver.Validate(ctx, &req) - if tc.expectedErr == "" { - if err != nil { - t.Fatalf("got unexpected error: %v", err) - } - return - } - if err == nil { - t.Fatalf("got no error, but expected: %s", tc.expectedErr) - } - if d := cmp.Diff(tc.expectedErr, err.Error()); d != "" { - t.Errorf("error did not match: %s", diff.PrintWantGot(d)) - } - }) - } -} - -func TestResolve(t *testing.T) { - defaultNS := "pipeline-ns" - - exampleTask := &pipelinev1.Task{ - ObjectMeta: metav1.ObjectMeta{ - Name: "example-task", - Namespace: "task-ns", - ResourceVersion: "00002", - UID: "a123", - }, - TypeMeta: metav1.TypeMeta{ - Kind: string(pipelinev1beta1.NamespacedTaskKind), - APIVersion: "tekton.dev/v1", - }, - Spec: pipelinev1.TaskSpec{ - Steps: []pipelinev1.Step{{ - Name: "some-step", - Image: "some-image", - Command: []string{"something"}, - }}, - }, - } - taskChecksum, err := exampleTask.Checksum() - if err != nil { - t.Fatalf("couldn't checksum task: %v", err) - } - taskAsYAML, err := yaml.Marshal(exampleTask) - if err != nil { - t.Fatalf("couldn't marshal task: %v", err) - } - - examplePipeline := &pipelinev1.Pipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "example-pipeline", - Namespace: defaultNS, - ResourceVersion: "00001", - UID: "b123", - }, - TypeMeta: metav1.TypeMeta{ - Kind: "Pipeline", - APIVersion: "tekton.dev/v1", - }, - Spec: pipelinev1.PipelineSpec{ - Tasks: []pipelinev1.PipelineTask{{ - Name: "some-pipeline-task", - TaskRef: &pipelinev1.TaskRef{ - Name: "some-task", - Kind: pipelinev1.NamespacedTaskKind, - }, - }}, - }, - } - pipelineChecksum, err := examplePipeline.Checksum() - if err != nil { - t.Fatalf("couldn't checksum pipeline: %v", err) - } - pipelineAsYAML, err := yaml.Marshal(examplePipeline) - if err != nil { - t.Fatalf("couldn't marshal pipeline: %v", err) - } - - testCases := []struct { - name string - kind string - resourceName string - namespace string - allowedNamespaces string - blockedNamespaces string - expectedStatus *v1beta1.ResolutionRequestStatus - expectedErr error - }{ - { - name: "successful task", - kind: "task", - resourceName: exampleTask.Name, - namespace: exampleTask.Namespace, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{}, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString(taskAsYAML), - RefSource: &pipelinev1.RefSource{ - URI: "/apis/tekton.dev/v1/namespaces/task-ns/task/example-task@a123", - Digest: map[string]string{ - "sha256": hex.EncodeToString(taskChecksum), - }, - }, - }, - }, - }, { - name: "successful pipeline", - kind: "pipeline", - resourceName: examplePipeline.Name, - namespace: examplePipeline.Namespace, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{}, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString(pipelineAsYAML), - RefSource: &pipelinev1.RefSource{ - URI: "/apis/tekton.dev/v1/namespaces/pipeline-ns/pipeline/example-pipeline@b123", - Digest: map[string]string{ - "sha256": hex.EncodeToString(pipelineChecksum), - }, - }, - }, - }, - }, { - name: "default namespace", - kind: "pipeline", - resourceName: examplePipeline.Name, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{}, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString(pipelineAsYAML), - RefSource: &pipelinev1.RefSource{ - URI: "/apis/tekton.dev/v1/namespaces/pipeline-ns/pipeline/example-pipeline@b123", - Digest: map[string]string{ - "sha256": hex.EncodeToString(pipelineChecksum), - }, - }, - }, - }, - }, { - name: "default kind", - resourceName: exampleTask.Name, - namespace: exampleTask.Namespace, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{}, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString(taskAsYAML), - RefSource: &pipelinev1.RefSource{ - URI: "/apis/tekton.dev/v1/namespaces/task-ns/task/example-task@a123", - Digest: map[string]string{ - "sha256": hex.EncodeToString(taskChecksum), - }, - }, - }, - }, - }, { - name: "no such task", - kind: "task", - resourceName: exampleTask.Name, - namespace: "other-ns", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &resolutioncommon.GetResourceError{ - ResolverName: cluster.ClusterResolverName, - Key: "foo/rr", - Original: errors.New(`tasks.tekton.dev "example-task" not found`), - }, - }, { - name: "not in allowed namespaces", - kind: "task", - resourceName: exampleTask.Name, - namespace: "other-ns", - allowedNamespaces: "foo,bar", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &resolutioncommon.InvalidRequestError{ - ResolutionRequestKey: "foo/rr", - Message: "access to specified namespace other-ns is not allowed", - }, - }, { - name: "in blocked namespaces", - kind: "task", - resourceName: exampleTask.Name, - namespace: "other-ns", - blockedNamespaces: "foo,other-ns,bar", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &resolutioncommon.InvalidRequestError{ - ResolutionRequestKey: "foo/rr", - Message: "access to specified namespace other-ns is blocked", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - request := createRequest(tc.kind, tc.resourceName, tc.namespace) - - confMap := map[string]string{ - clusterresolution.DefaultKindKey: "task", - clusterresolution.DefaultNamespaceKey: defaultNS, - } - if tc.allowedNamespaces != "" { - confMap[clusterresolution.AllowedNamespacesKey] = tc.allowedNamespaces - } - if tc.blockedNamespaces != "" { - confMap[clusterresolution.BlockedNamespacesKey] = tc.blockedNamespaces - } - - d := test.Data{ - ConfigMaps: []*corev1.ConfigMap{{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-resolver-config", - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: confMap, - }, { - ObjectMeta: metav1.ObjectMeta{ - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - Name: resolverconfig.GetFeatureFlagsConfigName(), - }, - Data: map[string]string{ - "enable-cluster-resolver": "true", - }, - }}, - Pipelines: []*pipelinev1.Pipeline{examplePipeline}, - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - Tasks: []*pipelinev1.Task{exampleTask}, - } - - resolver := &cluster.Resolver{} - - var expectedStatus *v1beta1.ResolutionRequestStatus - if tc.expectedStatus != nil { - expectedStatus = tc.expectedStatus.DeepCopy() - - if tc.expectedErr == nil { - reqParams := make(map[string]pipelinev1.ParamValue) - for _, p := range request.Spec.Params { - reqParams[p.Name] = p.Value - } - if expectedStatus.Annotations == nil { - expectedStatus.Annotations = make(map[string]string) - } - expectedStatus.Annotations[clusterresolution.ResourceNameAnnotation] = reqParams[clusterresolution.NameParam].StringVal - if reqParams[clusterresolution.NamespaceParam].StringVal != "" { - expectedStatus.Annotations[clusterresolution.ResourceNamespaceAnnotation] = reqParams[clusterresolution.NamespaceParam].StringVal - } else { - expectedStatus.Annotations[clusterresolution.ResourceNamespaceAnnotation] = defaultNS - } - } else { - expectedStatus.Status.Conditions[0].Message = tc.expectedErr.Error() - } - expectedStatus.Source = expectedStatus.RefSource - } - - frtesting.RunResolverReconcileTest(ctx, t, d, resolver, request, expectedStatus, tc.expectedErr) - }) - } -} - -func createRequest(kind, name, namespace string) *v1beta1.ResolutionRequest { - rr := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: cluster.LabelValueClusterResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: clusterresolution.NameParam, - Value: *pipelinev1.NewStructuredValues(name), - }}, - }, - } - if kind != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: clusterresolution.KindParam, - Value: *pipelinev1.NewStructuredValues(kind), - }) - } - if namespace != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: clusterresolution.NamespaceParam, - Value: *pipelinev1.NewStructuredValues(namespace), - }) - } - - return rr -} - -func resolverDisabledContext() context.Context { - return frameworktesting.ContextWithClusterResolverDisabled(context.Background()) -} diff --git a/upstream/pkg/remoteresolution/resolver/doc.go b/upstream/pkg/remoteresolution/resolver/doc.go deleted file mode 100644 index 784827d34fd..00000000000 --- a/upstream/pkg/remoteresolution/resolver/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resolver contains the upgraded remote resolution framework. -It contains the upgraded framework and the built-in resolves. -It is equivalent to `pkg/resolution/resolver`. -This was necessary to ensure backwards compatibility with the existing framework. - -This package is subject to further refactoring and changes. -*/ -package resolver diff --git a/upstream/pkg/remoteresolution/resolver/framework/controller.go b/upstream/pkg/remoteresolution/resolver/framework/controller.go deleted file mode 100644 index 665ecd89e93..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/controller.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright 2022 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 framework - -import ( - "context" - "strings" - - rrclient "github.com/tektoncd/pipeline/pkg/client/resolution/injection/client" - rrinformer "github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/resolution/v1beta1/resolutionrequest" - framework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "k8s.io/client-go/tools/cache" - "k8s.io/utils/clock" - kubeclient "knative.dev/pkg/client/injection/kube/client" - "knative.dev/pkg/configmap" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" -) - -// ReconcilerModifier is a func that can access and modify a reconciler -// in the moments before a resolver is started. It allows for -// things like injecting a test clock. -type ReconcilerModifier = func(reconciler *Reconciler) - -// NewController returns a knative controller for a Tekton Resolver. -// This sets up a lot of the boilerplate that individual resolvers -// shouldn't need to be concerned with since it's common to all of them. -func NewController(ctx context.Context, resolver Resolver, modifiers ...ReconcilerModifier) func(context.Context, configmap.Watcher) *controller.Impl { - if err := framework.ValidateResolver(ctx, resolver.GetSelector(ctx)); err != nil { - panic(err.Error()) - } - return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl { - logger := logging.FromContext(ctx) - kubeclientset := kubeclient.Get(ctx) - rrclientset := rrclient.Get(ctx) - rrInformer := rrinformer.Get(ctx) - - if err := resolver.Initialize(ctx); err != nil { - panic(err.Error()) - } - - r := &Reconciler{ - LeaderAwareFuncs: framework.LeaderAwareFuncs(rrInformer.Lister()), - kubeClientSet: kubeclientset, - resolutionRequestLister: rrInformer.Lister(), - resolutionRequestClientSet: rrclientset, - resolver: resolver, - } - - watchConfigChanges(ctx, r, cmw) - - // TODO(sbwsg): Do better sanitize. - resolverName := resolver.GetName(ctx) - resolverName = strings.ReplaceAll(resolverName, "/", "") - resolverName = strings.ReplaceAll(resolverName, " ", "") - - applyModifiersAndDefaults(ctx, r, modifiers) - - impl := controller.NewContext(ctx, r, controller.ControllerOptions{ - WorkQueueName: "TektonResolverFramework." + resolverName, - Logger: logger, - }) - - _, err := rrInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ - FilterFunc: framework.FilterResolutionRequestsBySelector(resolver.GetSelector(ctx)), - Handler: cache.ResourceEventHandlerFuncs{ - AddFunc: impl.Enqueue, - UpdateFunc: func(oldObj, newObj interface{}) { - impl.Enqueue(newObj) - }, - // TODO(sbwsg): should we deliver delete events - // to the resolver? - // DeleteFunc: impl.Enqueue, - }, - }) - if err != nil { - logging.FromContext(ctx).Panicf("Couldn't register ResolutionRequest informer event handler: %w", err) - } - - return impl - } -} - -// watchConfigChanges binds a framework.Resolver to updates on its -// configmap, using knative's configmap helpers. This is only done if -// the resolver implements the framework.ConfigWatcher interface. -func watchConfigChanges(ctx context.Context, reconciler *Reconciler, cmw configmap.Watcher) { - if configWatcher, ok := reconciler.resolver.(framework.ConfigWatcher); ok { - logger := logging.FromContext(ctx) - resolverConfigName := configWatcher.GetConfigName(ctx) - if resolverConfigName == "" { - panic("resolver returned empty config name") - } - reconciler.configStore = framework.NewConfigStore(resolverConfigName, logger) - reconciler.configStore.WatchConfigs(cmw) - } -} - -// applyModifiersAndDefaults applies the given modifiers to -// a reconciler and, after doing so, sets any default values for things -// that weren't set by a modifier. -func applyModifiersAndDefaults(ctx context.Context, r *Reconciler, modifiers []ReconcilerModifier) { - for _, mod := range modifiers { - mod(r) - } - - if r.Clock == nil { - r.Clock = clock.RealClock{} - } -} diff --git a/upstream/pkg/remoteresolution/resolver/framework/doc.go b/upstream/pkg/remoteresolution/resolver/framework/doc.go deleted file mode 100644 index 765551cab71..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 framework contains the upgraded remote resolution framework. -It is equivalent to `pkg/resolution/resolver/framework`. -This was necessary to ensure backwards compatibility with the existing framework. - -This package is subject to further refactoring and changes. -*/ -package framework diff --git a/upstream/pkg/remoteresolution/resolver/framework/fakeresolver.go b/upstream/pkg/remoteresolution/resolver/framework/fakeresolver.go deleted file mode 100644 index 046ec12f740..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/fakeresolver.go +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright 2022 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 framework - -import ( - "context" - "fmt" - "time" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" -) - -const FakeUrl string = "fake://url" - -var _ Resolver = &FakeResolver{} - -// FakeResolver implements a framework.Resolver that can fetch pre-configured strings based on a parameter value, or return -// resolution attempts with a configured error. -type FakeResolver framework.FakeResolver - -// Initialize performs any setup required by the fake resolver. -func (r *FakeResolver) Initialize(ctx context.Context) error { - if r.ForParam == nil { - r.ForParam = make(map[string]*framework.FakeResolvedResource) - } - return nil -} - -// GetName returns the string name that the fake resolver should be -// associated with. -func (r *FakeResolver) GetName(_ context.Context) string { - return framework.FakeResolverName -} - -// GetSelector returns the labels that resource requests are required to have for -// the fake resolver to process them. -func (r *FakeResolver) GetSelector(_ context.Context) map[string]string { - return map[string]string{ - resolutioncommon.LabelKeyResolverType: framework.LabelValueFakeResolverType, - } -} - -// Validate returns an error if the given parameter map is not -// valid for a resource request targeting the fake resolver. -func (r *FakeResolver) Validate(_ context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return framework.ValidateParams(req.Params) - } - if req.URL != FakeUrl { - return fmt.Errorf("Wrong url. Expected: %s, Got: %s", FakeUrl, req.URL) - } - return nil -} - -// Resolve performs the work of fetching a file from the fake resolver given a map of -// parameters. -func (r *FakeResolver) Resolve(_ context.Context, req *v1beta1.ResolutionRequestSpec) (framework.ResolvedResource, error) { - if len(req.Params) > 0 { - return framework.Resolve(req.Params, r.ForParam) - } - frr, ok := r.ForParam[req.URL] - if !ok { - return nil, fmt.Errorf("couldn't find resource for url %s", req.URL) - } - return frr, nil -} - -var _ framework.TimedResolution = &FakeResolver{} - -// GetResolutionTimeout returns the configured timeout for the reconciler, or the default time.Duration if not configured. -func (r *FakeResolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration, params map[string]string) (time.Duration, error) { - return framework.GetResolutionTimeout(r.Timeout, defaultTimeout), nil -} diff --git a/upstream/pkg/remoteresolution/resolver/framework/interface.go b/upstream/pkg/remoteresolution/resolver/framework/interface.go deleted file mode 100644 index 53cc9443143..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/interface.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2022 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 framework - -import ( - "context" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" -) - -// Resolver is the interface to implement for type-specific resource -// resolution. It fetches resources from a given type of remote location -// and returns their content along with any associated annotations. -type Resolver interface { - // Initialize is called at the moment the resolver controller is - // instantiated and is a good place to setup things like - // resource listers. - Initialize(ctx context.Context) error - - // GetName should give back the name of the resolver. E.g. "Git" - GetName(ctx context.Context) string - - // GetSelector returns the labels that are used to direct resolution - // requests to this resolver. - GetSelector(ctx context.Context) map[string]string - - // Validate is given the ressolution request spec - // should return an error if the resolver cannot resolve it. - Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error - - // ResolveRequest receives the resolution request spec - // and returns the resolved data along with any annotations - // to include in the response. If resolution fails then an error - // should be returned instead. If a resolution.Error - // is returned then its Reason and Message are used as part of the - // response to the request. - Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (framework.ResolvedResource, error) -} diff --git a/upstream/pkg/remoteresolution/resolver/framework/reconciler.go b/upstream/pkg/remoteresolution/resolver/framework/reconciler.go deleted file mode 100644 index 4e35557fe47..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/reconciler.go +++ /dev/null @@ -1,244 +0,0 @@ -/* -Copyright 2022 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 framework - -import ( - "context" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "time" - - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - rrclient "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned" - rrv1beta1 "github.com/tektoncd/pipeline/pkg/client/resolution/listers/resolution/v1beta1" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/utils/clock" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" - "knative.dev/pkg/reconciler" -) - -// defaultMaximumResolutionDuration is the maximum amount of time -// resolution may take. - -// defaultMaximumResolutionDuration is the max time that a call to -// Resolve() may take. It can be overridden by a resolver implementing -// the framework.TimedResolution interface. -const defaultMaximumResolutionDuration = time.Minute - -// statusDataPatch is the json structure that will be PATCHed into -// a ResolutionRequest with its data and annotations once successfully -// resolved. -type statusDataPatch struct { - Annotations map[string]string `json:"annotations"` - Data string `json:"data"` - Source *pipelinev1beta1.ConfigSource `json:"source"` - RefSource *pipelinev1.RefSource `json:"refSource"` -} - -// Reconciler handles ResolutionRequest objects, performs functionality -// common to all resolvers and delegates resolver-specific actions -// to its embedded type-specific Resolver object. -type Reconciler struct { - // Implements reconciler.LeaderAware - reconciler.LeaderAwareFuncs - - // Clock is used by the reconciler to track the passage of time - // and can be overridden for tests. - Clock clock.PassiveClock - - resolver Resolver - kubeClientSet kubernetes.Interface - resolutionRequestLister rrv1beta1.ResolutionRequestLister - resolutionRequestClientSet rrclient.Interface - - configStore *framework.ConfigStore -} - -var _ reconciler.LeaderAware = &Reconciler{} - -// Reconcile receives the string key of a ResolutionRequest object, looks -// it up, checks it for common errors, and then delegates -// resolver-specific functionality to the reconciler's embedded -// type-specific resolver. Any errors that occur during validation or -// resolution are handled by updating or failing the ResolutionRequest. -func (r *Reconciler) Reconcile(ctx context.Context, key string) error { - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - err = &resolutioncommon.InvalidResourceKeyError{Key: key, Original: err} - return controller.NewPermanentError(err) - } - - rr, err := r.resolutionRequestLister.ResolutionRequests(namespace).Get(name) - if err != nil { - err := &resolutioncommon.GetResourceError{ResolverName: "resolutionrequest", Key: key, Original: err} - return controller.NewPermanentError(err) - } - - if rr.IsDone() { - return nil - } - - // Inject request-scoped information into the context, such as - // the namespace that the request originates from and the - // configuration from the configmap this resolver is watching. - ctx = resolutioncommon.InjectRequestNamespace(ctx, namespace) - ctx = resolutioncommon.InjectRequestName(ctx, name) - if r.configStore != nil { - ctx = r.configStore.ToContext(ctx) - } - - return r.resolve(ctx, key, rr) -} - -func (r *Reconciler) resolve(ctx context.Context, key string, rr *v1beta1.ResolutionRequest) error { - errChan := make(chan error) - resourceChan := make(chan framework.ResolvedResource) - - paramsMap := make(map[string]string) - for _, p := range rr.Spec.Params { - paramsMap[p.Name] = p.Value.StringVal - } - - timeoutDuration := defaultMaximumResolutionDuration - if timed, ok := r.resolver.(framework.TimedResolution); ok { - var err error - timeoutDuration, err = timed.GetResolutionTimeout(ctx, defaultMaximumResolutionDuration, paramsMap) - if err != nil { - return err - } - } - - // A new context is created for resolution so that timeouts can - // be enforced without affecting other uses of ctx (e.g. sending - // Updates to ResolutionRequest objects). - resolutionCtx, cancelFn := context.WithTimeout(ctx, timeoutDuration) - defer cancelFn() - - go func() { - validationError := r.resolver.Validate(resolutionCtx, &rr.Spec) - if validationError != nil { - errChan <- &resolutioncommon.InvalidRequestError{ - ResolutionRequestKey: key, - Message: validationError.Error(), - } - return - } - resource, resolveErr := r.resolver.Resolve(resolutionCtx, &rr.Spec) - if resolveErr != nil { - errChan <- &resolutioncommon.GetResourceError{ - ResolverName: r.resolver.GetName(resolutionCtx), - Key: key, - Original: resolveErr, - } - return - } - resourceChan <- resource - }() - - select { - case err := <-errChan: - if err != nil { - return r.OnError(ctx, rr, err) - } - case <-resolutionCtx.Done(): - if err := resolutionCtx.Err(); err != nil { - return r.OnError(ctx, rr, err) - } - case resource := <-resourceChan: - return r.writeResolvedData(ctx, rr, resource) - } - - return errors.New("unknown error") -} - -// OnError is used to handle any situation where a ResolutionRequest has -// reached a terminal situation that cannot be recovered from. -func (r *Reconciler) OnError(ctx context.Context, rr *v1beta1.ResolutionRequest, err error) error { - if resolutioncommon.IsErrTransient(err) { - return err - } - if rr == nil { - return controller.NewPermanentError(err) - } - if err != nil { - _ = r.MarkFailed(ctx, rr, err) - return controller.NewPermanentError(err) - } - return nil -} - -// MarkFailed updates a ResolutionRequest as having failed. It returns -// errors that occur during the update process or nil if the update -// appeared to succeed. -func (r *Reconciler) MarkFailed(ctx context.Context, rr *v1beta1.ResolutionRequest, resolutionErr error) error { - key := fmt.Sprintf("%s/%s", rr.Namespace, rr.Name) - reason, resolutionErr := resolutioncommon.ReasonError(resolutionErr) - latestGeneration, err := r.resolutionRequestClientSet.ResolutionV1beta1().ResolutionRequests(rr.Namespace).Get(ctx, rr.Name, metav1.GetOptions{}) - if err != nil { - logging.FromContext(ctx).Warnf("error getting latest generation of resolutionrequest %q: %v", key, err) - return err - } - if latestGeneration.IsDone() { - return nil - } - latestGeneration.Status.MarkFailed(reason, resolutionErr.Error()) - _, err = r.resolutionRequestClientSet.ResolutionV1beta1().ResolutionRequests(rr.Namespace).UpdateStatus(ctx, latestGeneration, metav1.UpdateOptions{}) - if err != nil { - logging.FromContext(ctx).Warnf("error marking resolutionrequest %q as failed: %v", key, err) - return err - } - return nil -} - -func (r *Reconciler) writeResolvedData(ctx context.Context, rr *v1beta1.ResolutionRequest, resource framework.ResolvedResource) error { - encodedData := base64.StdEncoding.Strict().EncodeToString(resource.Data()) - patchBytes, err := json.Marshal(map[string]statusDataPatch{ - "status": { - Data: encodedData, - Annotations: resource.Annotations(), - RefSource: resource.RefSource(), - Source: (*pipelinev1beta1.ConfigSource)(resource.RefSource()), - }, - }) - if err != nil { - logging.FromContext(ctx).Warnf("writeResolvedData error serializing resource request patch for resolution request %s:%s: %s", rr.Namespace, rr.Name, err.Error()) - return r.OnError(ctx, rr, &resolutioncommon.UpdatingRequestError{ - ResolutionRequestKey: fmt.Sprintf("%s/%s", rr.Namespace, rr.Name), - Original: fmt.Errorf("error serializing resource request patch: %w", err), - }) - } - _, err = r.resolutionRequestClientSet.ResolutionV1beta1().ResolutionRequests(rr.Namespace).Patch(ctx, rr.Name, types.MergePatchType, patchBytes, metav1.PatchOptions{}, "status") - if err != nil { - logging.FromContext(ctx).Warnf("writeResolvedData error patching resolution request %s:%s: %s", rr.Namespace, rr.Name, err.Error()) - return r.OnError(ctx, rr, &resolutioncommon.UpdatingRequestError{ - ResolutionRequestKey: fmt.Sprintf("%s/%s", rr.Namespace, rr.Name), - Original: err, - }) - } - - return nil -} diff --git a/upstream/pkg/remoteresolution/resolver/framework/reconciler_test.go b/upstream/pkg/remoteresolution/resolver/framework/reconciler_test.go deleted file mode 100644 index 1a437ddfc89..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/reconciler_test.go +++ /dev/null @@ -1,431 +0,0 @@ -/* - Copyright 2022 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 framework_test - -import ( - "context" - "encoding/base64" - "errors" - "strings" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - "github.com/tektoncd/pipeline/test/names" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - clock "k8s.io/utils/clock/testing" - "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" - cminformer "knative.dev/pkg/configmap/informer" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" // Setup system.Namespace() -) - -var ( - now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) - testClock = clock.NewFakePassiveClock(now) - ignoreLastTransitionTime = cmpopts.IgnoreFields(apis.Condition{}, "LastTransitionTime.Inner.Time") -) - -func TestReconcile(t *testing.T) { - testCases := []struct { - name string - inputRequest *v1beta1.ResolutionRequest - paramMap map[string]*resolutionframework.FakeResolvedResource - reconcilerTimeout time.Duration - expectedStatus *v1beta1.ResolutionRequestStatus - expectedErr error - transient bool - }{ - { - name: "unknown value", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: resolutionframework.FakeParamName, - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - expectedErr: errors.New("error getting \"Fake\" \"foo/rr\": couldn't find resource for param value bar"), - }, { - name: "known value", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: resolutionframework.FakeParamName, - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - paramMap: map[string]*resolutionframework.FakeResolvedResource{ - "bar": { - Content: "some content", - AnnotationMap: map[string]string{"foo": "bar"}, - ContentSource: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - }, - }, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{ - Annotations: map[string]string{ - "foo": "bar", - }, - }, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString([]byte("some content")), - RefSource: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - Source: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - }, - }, - }, { - name: "unknown url", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: "dne://does-not-exist", - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - expectedErr: errors.New("invalid resource request \"foo/rr\": Wrong url. Expected: fake://url, Got: dne://does-not-exist"), - }, { - name: "valid url", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: framework.FakeUrl, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - paramMap: map[string]*resolutionframework.FakeResolvedResource{ - framework.FakeUrl: { - Content: "some content", - AnnotationMap: map[string]string{"foo": "bar"}, - ContentSource: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - }, - }, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{ - Annotations: map[string]string{ - "foo": "bar", - }, - }, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString([]byte("some content")), - RefSource: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - Source: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - }, - }, - }, { - name: "resource not found for url", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - URL: framework.FakeUrl, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - paramMap: map[string]*resolutionframework.FakeResolvedResource{ - "other://resource": { - Content: "some content", - AnnotationMap: map[string]string{"foo": "bar"}, - ContentSource: &pipelinev1.RefSource{ - URI: "https://abc.com", - Digest: map[string]string{ - "sha1": "xyz", - }, - EntryPoint: "foo/bar", - }, - }, - }, - expectedErr: errors.New("error getting \"Fake\" \"foo/rr\": couldn't find resource for url fake://url"), - }, { - name: "invalid params", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: "not-a-fake-param", - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - expectedErr: errors.New(`invalid resource request "foo/rr": missing fake-key`), - }, { - name: "error resolving", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: resolutionframework.FakeParamName, - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - paramMap: map[string]*resolutionframework.FakeResolvedResource{ - "bar": { - ErrorWith: "fake failure", - }, - }, - expectedErr: errors.New(`error getting "Fake" "foo/rr": fake failure`), - }, { - name: "timeout", - inputRequest: &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now().Add(-59 * time.Second)}, // 1 second before default timeout - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: resolutionframework.LabelValueFakeResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: resolutionframework.FakeParamName, - Value: *pipelinev1.NewStructuredValues("bar"), - }}, - }, - Status: v1beta1.ResolutionRequestStatus{}, - }, - paramMap: map[string]*resolutionframework.FakeResolvedResource{ - "bar": { - WaitFor: 1100 * time.Millisecond, - }, - }, - reconcilerTimeout: 1 * time.Second, - expectedErr: errors.New("context deadline exceeded"), - transient: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - d := test.Data{ - ResolutionRequests: []*v1beta1.ResolutionRequest{tc.inputRequest}, - } - - fakeResolver := &framework.FakeResolver{ForParam: tc.paramMap} - if tc.reconcilerTimeout > 0 { - fakeResolver.Timeout = tc.reconcilerTimeout - } - - ctx, _ := ttesting.SetupFakeContext(t) - testAssets, cancel := getResolverFrameworkController(ctx, t, d, fakeResolver, setClockOnReconciler) - defer cancel() - - err := testAssets.Controller.Reconciler.Reconcile(testAssets.Ctx, getRequestName(tc.inputRequest)) - if tc.expectedErr != nil { - if err == nil { - t.Fatalf("expected to get error %v, but got nothing", tc.expectedErr) - } - if tc.expectedErr.Error() != err.Error() { - t.Fatalf("expected to get error %v, but got %v", tc.expectedErr, err) - } - if tc.transient && controller.IsPermanentError(err) { - t.Fatalf("exepected error to not be wrapped as permanent %v", err) - } - } else { - if err != nil { - if ok, _ := controller.IsRequeueKey(err); !ok { - t.Fatalf("did not expect an error, but got %v", err) - } - } - - c := testAssets.Clients.ResolutionRequests.ResolutionV1beta1() - reconciledRR, err := c.ResolutionRequests(tc.inputRequest.Namespace).Get(testAssets.Ctx, tc.inputRequest.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("getting updated ResolutionRequest: %v", err) - } - if d := cmp.Diff(*tc.expectedStatus, reconciledRR.Status, ignoreLastTransitionTime); d != "" { - t.Errorf("ResolutionRequest status doesn't match %s", diff.PrintWantGot(d)) - } - } - }) - } -} - -func getResolverFrameworkController(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, modifiers ...framework.ReconcilerModifier) (test.Assets, func()) { - t.Helper() - names.TestingSeed() - - ctx, cancel := context.WithCancel(ctx) - c, informers := test.SeedTestData(t, ctx, d) - configMapWatcher := cminformer.NewInformedWatcher(c.Kube, system.Namespace()) - ctl := framework.NewController(ctx, resolver, modifiers...)(ctx, configMapWatcher) - if err := configMapWatcher.Start(ctx.Done()); err != nil { - t.Fatalf("error starting configmap watcher: %v", err) - } - - if la, ok := ctl.Reconciler.(pkgreconciler.LeaderAware); ok { - _ = la.Promote(pkgreconciler.UniversalBucket(), func(pkgreconciler.Bucket, types.NamespacedName) {}) - } - - return test.Assets{ - Logger: logging.FromContext(ctx), - Controller: ctl, - Clients: c, - Informers: informers, - Recorder: controller.GetEventRecorder(ctx).(*record.FakeRecorder), - Ctx: ctx, - }, cancel -} - -func getRequestName(rr *v1beta1.ResolutionRequest) string { - return strings.Join([]string{rr.Namespace, rr.Name}, "/") -} - -func setClockOnReconciler(r *framework.Reconciler) { - if r.Clock == nil { - r.Clock = testClock - } -} diff --git a/upstream/pkg/remoteresolution/resolver/framework/testing/fakecontroller.go b/upstream/pkg/remoteresolution/resolver/framework/testing/fakecontroller.go deleted file mode 100644 index eefee4263da..00000000000 --- a/upstream/pkg/remoteresolution/resolver/framework/testing/fakecontroller.go +++ /dev/null @@ -1,171 +0,0 @@ -/* - Copyright 2022 The Tekton Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 testing - -import ( - "context" - "encoding/base64" - "strings" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - "github.com/tektoncd/pipeline/test/names" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - testclock "k8s.io/utils/clock/testing" - "knative.dev/pkg/apis" - cminformer "knative.dev/pkg/configmap/informer" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" - "knative.dev/pkg/system" -) - -var ( - now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) - testClock = testclock.NewFakePassiveClock(now) - ignoreLastTransitionTime = cmpopts.IgnoreFields(apis.Condition{}, "LastTransitionTime.Inner.Time") -) - -// ResolverReconcileTestModifier is a function thaat will be invoked after the test assets and controller have been created -type ResolverReconcileTestModifier = func(resolver framework.Resolver, testAssets test.Assets) - -// RunResolverReconcileTest takes data to seed clients and informers, a Resolver, a ResolutionRequest, and the expected -// ResolutionRequestStatus and error, both of which can be nil. It instantiates a controller for that resolver and -// reconciles the given request. It then checks for the expected error, if any, and compares the resulting status with -// the expected status. -func RunResolverReconcileTest(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, request *v1beta1.ResolutionRequest, - expectedStatus *v1beta1.ResolutionRequestStatus, expectedErr error, resolverModifiers ...ResolverReconcileTestModifier) { - t.Helper() - - testAssets, cancel := GetResolverFrameworkController(ctx, t, d, resolver, setClockOnReconciler) - defer cancel() - - for _, rm := range resolverModifiers { - rm(resolver, testAssets) - } - - err := testAssets.Controller.Reconciler.Reconcile(testAssets.Ctx, getRequestName(request)) //nolint - if expectedErr != nil { - if err == nil { - t.Fatalf("expected to get error: `%v`, but got nothing", expectedErr) - } - if expectedErr.Error() != err.Error() { - t.Fatalf("expected to get error `%v`, but got `%v`", expectedErr, err) - } - } else if err != nil { - if ok, _ := controller.IsRequeueKey(err); !ok { - t.Fatalf("did not expect an error, but got `%v`", err) - } - } - - c := testAssets.Clients.ResolutionRequests.ResolutionV1beta1() - reconciledRR, err := c.ResolutionRequests(request.Namespace).Get(testAssets.Ctx, request.Name, metav1.GetOptions{}) //nolint - if err != nil { - t.Fatalf("getting updated ResolutionRequest: %v", err) - } - if expectedStatus != nil { - if d := cmp.Diff(*expectedStatus, reconciledRR.Status, ignoreLastTransitionTime); d != "" { - t.Errorf("ResolutionRequest status doesn't match %s", diff.PrintWantGot(d)) - if expectedStatus.Data != "" && expectedStatus.Data != reconciledRR.Status.Data { - decodedExpectedData, err := base64.StdEncoding.Strict().DecodeString(expectedStatus.Data) - if err != nil { - t.Errorf("couldn't decode expected data: %v", err) - return - } - decodedGotData, err := base64.StdEncoding.Strict().DecodeString(reconciledRR.Status.Data) - if err != nil { - t.Errorf("couldn't decode reconciled data: %v", err) - return - } - if d := cmp.Diff(decodedExpectedData, decodedGotData); d != "" { - t.Errorf("decoded data did not match expected: %s", diff.PrintWantGot(d)) - } - } - } - } -} - -// GetResolverFrameworkController returns an instance of the resolver framework controller/reconciler using the given resolver, -// seeded with d, where d represents the state of the system (existing resources) needed for the test. -func GetResolverFrameworkController(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, modifiers ...framework.ReconcilerModifier) (test.Assets, func()) { - t.Helper() - names.TestingSeed() - return initializeResolverFrameworkControllerAssets(ctx, t, d, resolver, modifiers...) -} - -func initializeResolverFrameworkControllerAssets(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, modifiers ...framework.ReconcilerModifier) (test.Assets, func()) { - t.Helper() - ctx, cancel := context.WithCancel(ctx) - ensureConfigurationConfigMapsExist(&d) - c, informers := test.SeedTestData(t, ctx, d) - configMapWatcher := cminformer.NewInformedWatcher(c.Kube, resolverconfig.ResolversNamespace(system.Namespace())) - ctl := framework.NewController(ctx, resolver, modifiers...)(ctx, configMapWatcher) - if err := configMapWatcher.Start(ctx.Done()); err != nil { - t.Fatalf("error starting configmap watcher: %v", err) - } - - if la, ok := ctl.Reconciler.(pkgreconciler.LeaderAware); ok { - _ = la.Promote(pkgreconciler.UniversalBucket(), func(pkgreconciler.Bucket, types.NamespacedName) {}) - } - - return test.Assets{ - Logger: logging.FromContext(ctx), - Controller: ctl, - Clients: c, - Informers: informers, - Recorder: controller.GetEventRecorder(ctx).(*record.FakeRecorder), - Ctx: ctx, - }, cancel -} - -func getRequestName(rr *v1beta1.ResolutionRequest) string { - return strings.Join([]string{rr.Namespace, rr.Name}, "/") -} - -func setClockOnReconciler(r *framework.Reconciler) { - if r.Clock == nil { - r.Clock = testClock - } -} - -func ensureConfigurationConfigMapsExist(d *test.Data) { - var featureFlagsExists bool - for _, cm := range d.ConfigMaps { - if cm.Name == resolverconfig.GetFeatureFlagsConfigName() { - featureFlagsExists = true - } - } - if !featureFlagsExists { - d.ConfigMaps = append(d.ConfigMaps, &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: resolverconfig.GetFeatureFlagsConfigName(), - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: map[string]string{}, - }) - } -} diff --git a/upstream/pkg/remoteresolution/resolver/git/resolver.go b/upstream/pkg/remoteresolution/resolver/git/resolver.go deleted file mode 100644 index 3a3734d4fbf..00000000000 --- a/upstream/pkg/remoteresolution/resolver/git/resolver.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 git - -import ( - "context" - "errors" - "time" - - "github.com/jenkins-x/go-scm/scm" - "github.com/jenkins-x/go-scm/scm/factory" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/git" - "go.uber.org/zap" - "k8s.io/apimachinery/pkg/util/cache" - "k8s.io/client-go/kubernetes" - kubeclient "knative.dev/pkg/client/injection/kube/client" - "knative.dev/pkg/logging" -) - -const ( - disabledError = "cannot handle resolution request, enable-git-resolver feature flag not true" - - // labelValueGitResolverType is the value to use for the - // resolution.tekton.dev/type label on resource requests - labelValueGitResolverType string = "git" - - // gitResolverName is the name that the git resolver should be - // associated with - gitResolverName string = "Git" - - // ConfigMapName is the git resolver's config map - ConfigMapName = "git-resolver-config" - - // cacheSize is the size of the LRU secrets cache - cacheSize = 1024 - // ttl is the time to live for a cache entry - ttl = 5 * time.Minute -) - -var _ framework.Resolver = &Resolver{} - -// Resolver implements a framework.Resolver that can fetch files from git. -type Resolver struct { - kubeClient kubernetes.Interface - logger *zap.SugaredLogger - cache *cache.LRUExpireCache - ttl time.Duration - - // Used in testing - clientFunc func(string, string, string, ...factory.ClientOptionFunc) (*scm.Client, error) -} - -// Initialize performs any setup required by the gitresolver. -func (r *Resolver) Initialize(ctx context.Context) error { - r.kubeClient = kubeclient.Get(ctx) - r.logger = logging.FromContext(ctx) - r.cache = cache.NewLRUExpireCache(cacheSize) - r.ttl = ttl - if r.clientFunc == nil { - r.clientFunc = factory.NewClient - } - return nil -} - -// GetName returns the string name that the gitresolver should be -// associated with. -func (r *Resolver) GetName(_ context.Context) string { - return gitResolverName -} - -// GetSelector returns the labels that resource requests are required to have for -// the gitresolver to process them. -func (r *Resolver) GetSelector(_ context.Context) map[string]string { - return map[string]string{ - resolutioncommon.LabelKeyResolverType: labelValueGitResolverType, - } -} - -// ValidateParams returns an error if the given parameter map is not -// valid for a resource request targeting the gitresolver. -func (r *Resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return git.ValidateParams(ctx, req.Params) - } - // Remove this error once validate url has been implemented. - return errors.New("cannot validate request. the Validate method has not been implemented.") -} - -// Resolve performs the work of fetching a file from git given a map of -// parameters. -func (r *Resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (resolutionframework.ResolvedResource, error) { - if len(req.Params) > 0 { - origParams := req.Params - - if git.IsDisabled(ctx) { - return nil, errors.New(disabledError) - } - - params, err := git.PopulateDefaultParams(ctx, origParams) - if err != nil { - return nil, err - } - - if params[git.UrlParam] != "" { - return git.ResolveAnonymousGit(ctx, params) - } - - return git.ResolveAPIGit(ctx, params, r.kubeClient, r.logger, r.cache, r.ttl, r.clientFunc) - } - // Remove this error once resolution of url has been implemented. - return nil, errors.New("the Resolve method has not been implemented.") -} - -var _ resolutionframework.ConfigWatcher = &Resolver{} - -// GetConfigName returns the name of the git resolver's configmap. -func (r *Resolver) GetConfigName(context.Context) string { - return ConfigMapName -} - -var _ resolutionframework.TimedResolution = &Resolver{} - -// GetResolutionTimeout returns a time.Duration for the amount of time a -// single git fetch may take. This can be configured with the -// fetch-timeout field in the git-resolver-config configmap. -func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration, params map[string]string) (time.Duration, error) { - conf, err := git.GetScmConfigForParamConfigKey(ctx, params) - if err != nil { - return time.Duration(0), err - } - if timeoutString := conf.Timeout; timeoutString != "" { - timeout, err := time.ParseDuration(timeoutString) - if err != nil { - return time.Duration(0), err - } - return timeout, nil - } - return defaultTimeout, nil -} diff --git a/upstream/pkg/remoteresolution/resolver/git/resolver_test.go b/upstream/pkg/remoteresolution/resolver/git/resolver_test.go deleted file mode 100644 index 84c5eb7c3e4..00000000000 --- a/upstream/pkg/remoteresolution/resolver/git/resolver_test.go +++ /dev/null @@ -1,982 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 git - -import ( - "context" - "encoding/base64" - "errors" - "fmt" - "os" - "path/filepath" - "testing" - "time" - - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/google/go-cmp/cmp" - "github.com/jenkins-x/go-scm/scm" - "github.com/jenkins-x/go-scm/scm/driver/fake" - "github.com/jenkins-x/go-scm/scm/factory" - resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - frtesting "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework/testing" - common "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - frameworktesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" - gitresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/git" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" -) - -func TestGetSelector(t *testing.T) { - resolver := Resolver{} - sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { - t.Fatalf("unexpected selector: %v", sel) - } else if typ != labelValueGitResolverType { - t.Fatalf("unexpected type: %q", typ) - } -} - -func TestValidateParams(t *testing.T) { - tests := []struct { - name string - wantErr string - params map[string]string - }{ - { - name: "params with revision", - params: map[string]string{ - gitresolution.UrlParam: "http://foo/bar/hello/moto", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "https url", - params: map[string]string{ - gitresolution.UrlParam: "https://foo/bar/hello/moto", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "https url with username password", - params: map[string]string{ - gitresolution.UrlParam: "https://user:pass@foo/bar/hello/moto", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "git server url", - params: map[string]string{ - gitresolution.UrlParam: "git://repo/hello/moto", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "git url from a local repository", - params: map[string]string{ - gitresolution.UrlParam: "/tmp/repo", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "git url from a git ssh repository", - params: map[string]string{ - gitresolution.UrlParam: "git@host.com:foo/bar", - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - }, - }, - { - name: "bad url", - params: map[string]string{ - gitresolution.UrlParam: "foo://bar", - gitresolution.PathParam: "path", - gitresolution.RevisionParam: "revision", - }, - wantErr: "invalid git repository url: foo://bar", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - resolver := Resolver{} - err := resolver.Validate(context.Background(), &v1beta1.ResolutionRequestSpec{Params: toParams(tt.params)}) - if tt.wantErr == "" { - if err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - return - } - - if d := cmp.Diff(tt.wantErr, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } - }) - } -} - -func TestValidateParamsNotEnabled(t *testing.T) { - resolver := Resolver{} - - var err error - - someParams := map[string]string{ - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - } - err = resolver.Validate(resolverDisabledContext(), &v1beta1.ResolutionRequestSpec{Params: toParams(someParams)}) - if err == nil { - t.Fatalf("expected disabled err") - } - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -func TestValidateParams_Failure(t *testing.T) { - testCases := []struct { - name string - params map[string]string - expectedErr string - }{ - { - name: "missing multiple", - params: map[string]string{ - gitresolution.OrgParam: "abcd1234", - gitresolution.RepoParam: "foo", - }, - expectedErr: fmt.Sprintf("missing required git resolver params: %s, %s", gitresolution.RevisionParam, gitresolution.PathParam), - }, { - name: "no repo or url", - params: map[string]string{ - gitresolution.RevisionParam: "abcd1234", - gitresolution.PathParam: "/foo/bar", - }, - expectedErr: "must specify one of 'url' or 'repo'", - }, { - name: "both repo and url", - params: map[string]string{ - gitresolution.RevisionParam: "abcd1234", - gitresolution.PathParam: "/foo/bar", - gitresolution.UrlParam: "http://foo", - gitresolution.RepoParam: "foo", - }, - expectedErr: "cannot specify both 'url' and 'repo'", - }, { - name: "no org with repo", - params: map[string]string{ - gitresolution.RevisionParam: "abcd1234", - gitresolution.PathParam: "/foo/bar", - gitresolution.RepoParam: "foo", - }, - expectedErr: "'org' is required when 'repo' is specified", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resolver := &Resolver{} - err := resolver.Validate(context.Background(), &v1beta1.ResolutionRequestSpec{Params: toParams(tc.params)}) - if err == nil { - t.Fatalf("got no error, but expected: %s", tc.expectedErr) - } - if d := cmp.Diff(tc.expectedErr, err.Error()); d != "" { - t.Errorf("error did not match: %s", diff.PrintWantGot(d)) - } - }) - } -} - -func TestGetResolutionTimeoutDefault(t *testing.T) { - resolver := Resolver{} - defaultTimeout := 30 * time.Minute - timeout, err := resolver.GetResolutionTimeout(context.Background(), defaultTimeout, map[string]string{}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } - if timeout != defaultTimeout { - t.Fatalf("expected default timeout to be returned") - } -} - -func TestGetResolutionTimeoutCustom(t *testing.T) { - resolver := Resolver{} - defaultTimeout := 30 * time.Minute - configTimeout := 5 * time.Second - config := map[string]string{ - gitresolution.DefaultTimeoutKey: configTimeout.String(), - } - ctx := resolutionframework.InjectResolverConfigToContext(context.Background(), config) - timeout, err := resolver.GetResolutionTimeout(ctx, defaultTimeout, map[string]string{}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } - if timeout != configTimeout { - t.Fatalf("expected timeout from config to be returned") - } -} - -func TestGetResolutionTimeoutCustomIdentifier(t *testing.T) { - resolver := Resolver{} - defaultTimeout := 30 * time.Minute - configTimeout := 5 * time.Second - identifierConfigTImeout := 10 * time.Second - config := map[string]string{ - gitresolution.DefaultTimeoutKey: configTimeout.String(), - "foo." + gitresolution.DefaultTimeoutKey: identifierConfigTImeout.String(), - } - ctx := resolutionframework.InjectResolverConfigToContext(context.Background(), config) - timeout, err := resolver.GetResolutionTimeout(ctx, defaultTimeout, map[string]string{"configKey": "foo"}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } - if timeout != identifierConfigTImeout { - t.Fatalf("expected timeout from config to be returned") - } -} - -func TestResolveNotEnabled(t *testing.T) { - resolver := Resolver{} - - var err error - - someParams := map[string]string{ - gitresolution.PathParam: "bar", - gitresolution.RevisionParam: "baz", - } - _, err = resolver.Resolve(resolverDisabledContext(), &v1beta1.ResolutionRequestSpec{Params: toParams(someParams)}) - if err == nil { - t.Fatalf("expected disabled err") - } - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -type params struct { - url string - revision string - pathInRepo string - org string - repo string - token string - tokenKey string - namespace string - serverURL string - scmType string - configKey string -} - -func TestResolve(t *testing.T) { - // local repo set up for anonymous cloning - // ---- - commits := []commitForRepo{{ - Dir: "foo/", - Filename: "old", - Content: "old content in test branch", - Branch: "test-branch", - }, { - Dir: "foo/", - Filename: "new", - Content: "new content in test branch", - Branch: "test-branch", - }, { - Dir: "./", - Filename: "released", - Content: "released content in main branch and in tag v1", - Tag: "v1", - }} - - anonFakeRepoURL, commitSHAsInAnonRepo := createTestRepo(t, commits) - - // local repo set up for scm cloning - // ---- - withTemporaryGitConfig(t) - - testOrg := "test-org" - testRepo := "test-repo" - - refsDir := filepath.Join("testdata", "test-org", "test-repo", "refs") - mainPipelineYAML, err := os.ReadFile(filepath.Join(refsDir, "main", "pipelines", "example-pipeline.yaml")) - if err != nil { - t.Fatalf("couldn't read main pipeline: %v", err) - } - otherPipelineYAML, err := os.ReadFile(filepath.Join(refsDir, "other", "pipelines", "example-pipeline.yaml")) - if err != nil { - t.Fatalf("couldn't read other pipeline: %v", err) - } - - mainTaskYAML, err := os.ReadFile(filepath.Join(refsDir, "main", "tasks", "example-task.yaml")) - if err != nil { - t.Fatalf("couldn't read main task: %v", err) - } - - commitSHAsInSCMRepo := []string{"abc", "xyz"} - - scmFakeRepoURL := fmt.Sprintf("https://fake/%s/%s.git", testOrg, testRepo) - resolver := &Resolver{ - clientFunc: func(driver string, serverURL string, token string, opts ...factory.ClientOptionFunc) (*scm.Client, error) { - scmClient, scmData := fake.NewDefault() - - // repository service - scmData.Repositories = []*scm.Repository{{ - FullName: fmt.Sprintf("%s/%s", testOrg, testRepo), - Clone: scmFakeRepoURL, - }} - - // git service - scmData.Commits = map[string]*scm.Commit{ - "main": {Sha: commitSHAsInSCMRepo[0]}, - "other": {Sha: commitSHAsInSCMRepo[1]}, - } - return scmClient, nil - }, - } - - testCases := []struct { - name string - args *params - config map[string]string - apiToken string - expectedCommitSHA string - expectedStatus *v1beta1.ResolutionRequestStatus - expectedErr error - configIdentifer string - }{{ - name: "clone: default revision main", - args: ¶ms{ - pathInRepo: "./released", - url: anonFakeRepoURL, - }, - expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), - }, { - name: "clone: revision is tag name", - args: ¶ms{ - revision: "v1", - pathInRepo: "./released", - url: anonFakeRepoURL, - }, - expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), - }, { - name: "clone: revision is the full tag name i.e. refs/tags/v1", - args: ¶ms{ - revision: "refs/tags/v1", - pathInRepo: "./released", - url: anonFakeRepoURL, - }, - expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), - }, { - name: "clone: revision is a branch name", - args: ¶ms{ - revision: "test-branch", - pathInRepo: "foo/new", - url: anonFakeRepoURL, - }, - expectedCommitSHA: commitSHAsInAnonRepo[1], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("new content in test branch")), - }, { - name: "clone: revision is a specific commit sha", - args: ¶ms{ - revision: commitSHAsInAnonRepo[0], - pathInRepo: "foo/old", - url: anonFakeRepoURL, - }, - expectedCommitSHA: commitSHAsInAnonRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("old content in test branch")), - }, { - name: "clone: file does not exist", - args: ¶ms{ - pathInRepo: "foo/non-exist", - url: anonFakeRepoURL, - }, - expectedErr: createError(`error opening file "foo/non-exist": file does not exist`), - }, { - name: "clone: revision does not exist", - args: ¶ms{ - revision: "non-existent-revision", - pathInRepo: "foo/new", - url: anonFakeRepoURL, - }, - expectedErr: createError("revision error: reference not found"), - }, { - name: "api: successful task from params api information", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - token: "token-secret", - tokenKey: "token", - namespace: "foo", - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful task", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful task from params api information with identifier", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - token: "token-secret", - tokenKey: "token", - namespace: "foo", - configKey: "test", - }, - config: map[string]string{ - "test." + gitresolution.ServerURLKey: "fake", - "test." + gitresolution.SCMTypeKey: "fake", - }, - configIdentifer: "test.", - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful task with identifier", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - configKey: "test", - }, - config: map[string]string{ - "test." + gitresolution.ServerURLKey: "fake", - "test." + gitresolution.SCMTypeKey: "fake", - "test." + gitresolution.APISecretNameKey: "token-secret", - "test." + gitresolution.APISecretKeyKey: "token", - "test." + gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - configIdentifer: "test.", - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful pipeline", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainPipelineYAML), - }, { - name: "api: successful pipeline with default revision", - args: ¶ms{ - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - gitresolution.DefaultRevisionKey: "other", - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[1], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(otherPipelineYAML), - }, { - name: "api: successful override scm type and server URL from user params", - - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - token: "token-secret", - tokenKey: "token", - namespace: "foo", - scmType: "fake", - serverURL: "fake", - }, - config: map[string]string{ - gitresolution.ServerURLKey: "notsofake", - gitresolution.SCMTypeKey: "definitivelynotafake", - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: file does not exist", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/other-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: createError("couldn't fetch resource content: file testdata/test-org/test-repo/refs/main/pipelines/other-pipeline.yaml does not exist: stat testdata/test-org/test-repo/refs/main/pipelines/other-pipeline.yaml: no such file or directory"), - }, { - name: "api: token not found", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: createError("cannot get API token, secret token-secret not found in namespace " + system.Namespace()), - }, { - name: "api: token secret name not specified", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: createError("cannot get API token, required when specifying 'repo' param, 'api-token-secret-name' not specified in config"), - }, { - name: "api: token secret key not specified", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.ServerURLKey: "fake", - gitresolution.SCMTypeKey: "fake", - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: createError("cannot get API token, required when specifying 'repo' param, 'api-token-secret-key' not specified in config"), - }, { - name: "api: SCM type not specified", - args: ¶ms{ - revision: "main", - pathInRepo: "pipelines/example-pipeline.yaml", - org: testOrg, - repo: testRepo, - }, - config: map[string]string{ - gitresolution.APISecretNameKey: "token-secret", - gitresolution.APISecretKeyKey: "token", - gitresolution.APISecretNamespaceKey: system.Namespace(), - }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainPipelineYAML), - }} - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - ctx, _ := ttesting.SetupFakeContext(t) - - cfg := tc.config - if cfg == nil { - cfg = make(map[string]string) - } - cfg[tc.configIdentifer+gitresolution.DefaultTimeoutKey] = "1m" - if cfg[tc.configIdentifer+gitresolution.DefaultRevisionKey] == "" { - cfg[tc.configIdentifer+gitresolution.DefaultRevisionKey] = plumbing.Master.Short() - } - - request := createRequest(tc.args) - - d := test.Data{ - ConfigMaps: []*corev1.ConfigMap{{ - ObjectMeta: metav1.ObjectMeta{ - Name: ConfigMapName, - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: cfg, - }, { - ObjectMeta: metav1.ObjectMeta{ - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - Name: resolverconfig.GetFeatureFlagsConfigName(), - }, - Data: map[string]string{ - "enable-git-resolver": "true", - }, - }}, - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - - var expectedStatus *v1beta1.ResolutionRequestStatus - if tc.expectedStatus != nil { - expectedStatus = tc.expectedStatus.DeepCopy() - - if tc.expectedErr == nil { - // status.annotations - if expectedStatus.Annotations == nil { - expectedStatus.Annotations = make(map[string]string) - } - expectedStatus.Annotations[common.AnnotationKeyContentType] = "application/x-yaml" - expectedStatus.Annotations[gitresolution.AnnotationKeyRevision] = tc.expectedCommitSHA - expectedStatus.Annotations[gitresolution.AnnotationKeyPath] = tc.args.pathInRepo - - if tc.args.url != "" { - expectedStatus.Annotations[gitresolution.AnnotationKeyURL] = anonFakeRepoURL - } else { - expectedStatus.Annotations[gitresolution.AnnotationKeyOrg] = testOrg - expectedStatus.Annotations[gitresolution.AnnotationKeyRepo] = testRepo - expectedStatus.Annotations[gitresolution.AnnotationKeyURL] = scmFakeRepoURL - } - - // status.refSource - expectedStatus.RefSource = &pipelinev1.RefSource{ - URI: "git+" + expectedStatus.Annotations[gitresolution.AnnotationKeyURL], - Digest: map[string]string{ - "sha1": tc.expectedCommitSHA, - }, - EntryPoint: tc.args.pathInRepo, - } - expectedStatus.Source = expectedStatus.RefSource - } else { - expectedStatus.Status.Conditions[0].Message = tc.expectedErr.Error() - } - } - - frtesting.RunResolverReconcileTest(ctx, t, d, resolver, request, expectedStatus, tc.expectedErr, func(resolver framework.Resolver, testAssets test.Assets) { - var secretName, secretNameKey, secretNamespace string - if tc.config[tc.configIdentifer+gitresolution.APISecretNameKey] != "" && tc.config[tc.configIdentifer+gitresolution.APISecretNamespaceKey] != "" && tc.config[tc.configIdentifer+gitresolution.APISecretKeyKey] != "" && tc.apiToken != "" { - secretName, secretNameKey, secretNamespace = tc.config[tc.configIdentifer+gitresolution.APISecretNameKey], tc.config[tc.configIdentifer+gitresolution.APISecretKeyKey], tc.config[tc.configIdentifer+gitresolution.APISecretNamespaceKey] - } - if tc.args.token != "" && tc.args.namespace != "" && tc.args.tokenKey != "" { - secretName, secretNameKey, secretNamespace = tc.args.token, tc.args.tokenKey, tc.args.namespace - } - if secretName == "" || secretNameKey == "" || secretNamespace == "" { - return - } - tokenSecret := &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - Namespace: secretNamespace, - }, - Data: map[string][]byte{ - secretNameKey: []byte(base64.StdEncoding.Strict().EncodeToString([]byte(tc.apiToken))), - }, - Type: corev1.SecretTypeOpaque, - } - if _, err := testAssets.Clients.Kube.CoreV1().Secrets(secretNamespace).Create(ctx, tokenSecret, metav1.CreateOptions{}); err != nil { - t.Fatalf("failed to create test token secret: %v", err) - } - }) - }) - } -} - -// createTestRepo is used to instantiate a local test repository with the desired commits. -func createTestRepo(t *testing.T, commits []commitForRepo) (string, []string) { - t.Helper() - commitSHAs := []string{} - - t.Helper() - tempDir := t.TempDir() - - repo, err := git.PlainInit(tempDir, false) - - worktree, err := repo.Worktree() - if err != nil { - t.Fatalf("getting test worktree: %v", err) - } - if worktree == nil { - t.Fatal("test worktree not created") - } - - startingHash := writeAndCommitToTestRepo(t, worktree, tempDir, "", "README", []byte("This is a test")) - - hashesByBranch := make(map[string][]string) - - // Iterate over the commits and add them. - for _, cmt := range commits { - branch := cmt.Branch - if branch == "" { - branch = plumbing.Master.Short() - } - - // If we're given a revision, check out that revision. - coOpts := &git.CheckoutOptions{ - Branch: plumbing.NewBranchReferenceName(branch), - } - - if _, ok := hashesByBranch[branch]; !ok && branch != plumbing.Master.Short() { - coOpts.Hash = plumbing.NewHash(startingHash.String()) - coOpts.Create = true - } - - if err := worktree.Checkout(coOpts); err != nil { - t.Fatalf("couldn't do checkout of %s: %v", branch, err) - } - - hash := writeAndCommitToTestRepo(t, worktree, tempDir, cmt.Dir, cmt.Filename, []byte(cmt.Content)) - commitSHAs = append(commitSHAs, hash.String()) - - if _, ok := hashesByBranch[branch]; !ok { - hashesByBranch[branch] = []string{hash.String()} - } else { - hashesByBranch[branch] = append(hashesByBranch[branch], hash.String()) - } - - if cmt.Tag != "" { - _, err = repo.CreateTag(cmt.Tag, hash, &git.CreateTagOptions{ - Message: cmt.Tag, - Tagger: &object.Signature{ - Name: "Someone", - Email: "someone@example.com", - When: time.Now(), - }, - }) - } - if err != nil { - t.Fatalf("couldn't add tag for %s: %v", cmt.Tag, err) - } - } - - return tempDir, commitSHAs -} - -// commitForRepo provides the directory, filename, content and revision for a test commit. -type commitForRepo struct { - Dir string - Filename string - Content string - Branch string - Tag string -} - -func writeAndCommitToTestRepo(t *testing.T, worktree *git.Worktree, repoDir string, subPath string, filename string, content []byte) plumbing.Hash { - t.Helper() - - targetDir := repoDir - if subPath != "" { - targetDir = filepath.Join(targetDir, subPath) - fi, err := os.Stat(targetDir) - if os.IsNotExist(err) { - if err := os.MkdirAll(targetDir, 0o700); err != nil { - t.Fatalf("couldn't create directory %s in worktree: %v", targetDir, err) - } - } else if err != nil { - t.Fatalf("checking if directory %s in worktree exists: %v", targetDir, err) - } - if fi != nil && !fi.IsDir() { - t.Fatalf("%s already exists but is not a directory", targetDir) - } - } - - outfile := filepath.Join(targetDir, filename) - if err := os.WriteFile(outfile, content, 0o600); err != nil { - t.Fatalf("couldn't write content to file %s: %v", outfile, err) - } - - _, err := worktree.Add(filepath.Join(subPath, filename)) - if err != nil { - t.Fatalf("couldn't add file %s to git: %v", outfile, err) - } - - hash, err := worktree.Commit("adding file for test", &git.CommitOptions{ - Author: &object.Signature{ - Name: "Someone", - Email: "someone@example.com", - When: time.Now(), - }, - }) - if err != nil { - t.Fatalf("couldn't perform commit for test: %v", err) - } - - return hash -} - -// withTemporaryGitConfig resets the .gitconfig for the duration of the test. -func withTemporaryGitConfig(t *testing.T) { - t.Helper() - gitConfigDir := t.TempDir() - key := "GIT_CONFIG_GLOBAL" - t.Setenv(key, filepath.Join(gitConfigDir, "config")) -} - -func createRequest(args *params) *v1beta1.ResolutionRequest { - rr := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - common.LabelKeyResolverType: labelValueGitResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: gitresolution.PathParam, - Value: *pipelinev1.NewStructuredValues(args.pathInRepo), - }}, - }, - } - - if args.revision != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.RevisionParam, - Value: *pipelinev1.NewStructuredValues(args.revision), - }) - } - - if args.serverURL != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.ServerURLParam, - Value: *pipelinev1.NewStructuredValues(args.serverURL), - }) - } - if args.scmType != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.ScmTypeParam, - Value: *pipelinev1.NewStructuredValues(args.scmType), - }) - } - - if args.url != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.UrlParam, - Value: *pipelinev1.NewStructuredValues(args.url), - }) - } else { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.RepoParam, - Value: *pipelinev1.NewStructuredValues(args.repo), - }) - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.OrgParam, - Value: *pipelinev1.NewStructuredValues(args.org), - }) - if args.token != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.TokenParam, - Value: *pipelinev1.NewStructuredValues(args.token), - }) - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.TokenKeyParam, - Value: *pipelinev1.NewStructuredValues(args.tokenKey), - }) - } - } - - if args.configKey != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: gitresolution.ConfigKeyParam, - Value: *pipelinev1.NewStructuredValues(args.configKey), - }) - } - - return rr -} - -func resolverDisabledContext() context.Context { - return frameworktesting.ContextWithGitResolverDisabled(context.Background()) -} - -func createError(msg string) error { - return &common.GetResourceError{ - ResolverName: gitResolverName, - Key: "foo/rr", - Original: errors.New(msg), - } -} - -func toParams(m map[string]string) []pipelinev1.Param { - var params []pipelinev1.Param - - for k, v := range m { - params = append(params, pipelinev1.Param{ - Name: k, - Value: *pipelinev1.NewStructuredValues(v), - }) - } - - return params -} diff --git a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/pipelines/example-pipeline.yaml b/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/pipelines/example-pipeline.yaml deleted file mode 100644 index cc697dd2e91..00000000000 --- a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/pipelines/example-pipeline.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: example-pipeline -spec: - tasks: - - name: some-pipeline-task - taskRef: - kind: Task - name: some-task diff --git a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/tasks/example-task.yaml b/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/tasks/example-task.yaml deleted file mode 100644 index 97ad418341e..00000000000 --- a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/main/tasks/example-task.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: example-task -spec: - steps: - - command: ['something'] - image: some-image - name: some-step diff --git a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/other/pipelines/example-pipeline.yaml b/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/other/pipelines/example-pipeline.yaml deleted file mode 100644 index 836822c6fa4..00000000000 --- a/upstream/pkg/remoteresolution/resolver/git/testdata/test-org/test-repo/refs/other/pipelines/example-pipeline.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Pipeline -metadata: - name: example-pipeline -spec: - tasks: - - name: some-pipeline-task - taskRef: - kind: Task - name: some-other-task diff --git a/upstream/pkg/remoteresolution/resolver/http/resolver.go b/upstream/pkg/remoteresolution/resolver/http/resolver.go deleted file mode 100644 index ec106586d9c..00000000000 --- a/upstream/pkg/remoteresolution/resolver/http/resolver.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 http - -import ( - "context" - "errors" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/http" - "go.uber.org/zap" - "k8s.io/client-go/kubernetes" - kubeclient "knative.dev/pkg/client/injection/kube/client" - "knative.dev/pkg/logging" -) - -const ( - // LabelValueHttpResolverType is the value to use for the - // resolution.tekton.dev/type label on resource requests - LabelValueHttpResolverType string = "http" - - disabledError = "cannot handle resolution request, enable-http-resolver feature flag not true" - - // httpResolverName The name of the resolver - httpResolverName = "Http" - - // configMapName is the http resolver's config map - configMapName = "http-resolver-config" - - // default Timeout value when fetching http resources in seconds - defaultHttpTimeoutValue = "1m" - - // default key in the HTTP password secret - defaultBasicAuthSecretKey = "password" -) - -var _ framework.Resolver = &Resolver{} - -// Resolver implements a framework.Resolver that can fetch files from an HTTP URL -type Resolver struct { - kubeClient kubernetes.Interface - logger *zap.SugaredLogger -} - -func (r *Resolver) Initialize(ctx context.Context) error { - r.kubeClient = kubeclient.Get(ctx) - r.logger = logging.FromContext(ctx) - return nil -} - -// GetName returns a string name to refer to this resolver by. -func (r *Resolver) GetName(context.Context) string { - return httpResolverName -} - -// GetConfigName returns the name of the http resolver's configmap. -func (r *Resolver) GetConfigName(context.Context) string { - return configMapName -} - -// GetSelector returns a map of labels to match requests to this resolver. -func (r *Resolver) GetSelector(context.Context) map[string]string { - return map[string]string{ - common.LabelKeyResolverType: LabelValueHttpResolverType, - } -} - -// Validate ensures parameters from a request are as expected. -func (r *Resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return http.ValidateParams(ctx, req.Params) - } - // Remove this error once validate url has been implemented. - return errors.New("cannot validate request. the Validate method has not been implemented.") -} - -// Resolve uses the given params to resolve the requested file or resource. -func (r *Resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (resolutionframework.ResolvedResource, error) { - if len(req.Params) > 0 { - oParams := req.Params - if http.IsDisabled(ctx) { - return nil, errors.New(disabledError) - } - - params, err := http.PopulateDefaultParams(ctx, oParams) - if err != nil { - return nil, err - } - - return http.FetchHttpResource(ctx, params, r.kubeClient, r.logger) - } - // Remove this error once resolution of url has been implemented. - return nil, errors.New("the Resolve method has not been implemented.") -} diff --git a/upstream/pkg/remoteresolution/resolver/http/resolver_test.go b/upstream/pkg/remoteresolution/resolver/http/resolver_test.go deleted file mode 100644 index f95fded82d4..00000000000 --- a/upstream/pkg/remoteresolution/resolver/http/resolver_test.go +++ /dev/null @@ -1,511 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 http - -import ( - "context" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "errors" - "fmt" - "net/http" - "net/http/httptest" - "regexp" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - frtesting "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework/testing" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - frameworktesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" - httpresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/http" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" -) - -type params struct { - url string - authUsername string - authSecret string - authSecretKey string - authSecretContent string -} - -const sampleTask = `--- -kind: Task -apiVersion: tekton.dev/v1 -metadata: - name: foo -spec: - steps: - - name: step1 - image: scratch` -const emptyStr = "empty" - -func TestGetSelector(t *testing.T) { - resolver := Resolver{} - sel := resolver.GetSelector(context.Background()) - if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { - t.Fatalf("unexpected selector: %v", sel) - } else if typ != LabelValueHttpResolverType { - t.Fatalf("unexpected type: %q", typ) - } -} - -func TestValidate(t *testing.T) { - testCases := []struct { - name string - url string - expectedErr error - }{ - { - name: "valid/url", - url: "https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.4/git-clone.yaml", - }, { - name: "invalid/url", - url: "xttps:ufoo/bar/", - expectedErr: errors.New(`url xttps:ufoo/bar/ is not a valid http(s) url`), - }, { - name: "invalid/url empty", - url: "", - expectedErr: errors.New(`cannot parse url : parse "": empty url`), - }, { - name: "missing/url", - expectedErr: errors.New(`missing required http resolver params: url`), - url: "nourl", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resolver := Resolver{} - params := map[string]string{} - if tc.url != "nourl" { - params[httpresolution.UrlParam] = tc.url - } else { - // inject a fake param so that it can validate that the url is actually missing. - params["foo"] = "bar" - } - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(params), - } - err := resolver.Validate(contextWithConfig(defaultHttpTimeoutValue), &req) - if tc.expectedErr != nil { - checkExpectedErr(t, tc.expectedErr, err) - } else if err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - }) - } -} - -func TestResolve(t *testing.T) { - tests := []struct { - name string - expectedErr string - input string - paramSet bool - expectedStatus int - }{ - { - name: "good/params set", - input: "task", - paramSet: true, - }, { - name: "bad/params not set", - input: "task", - expectedErr: `missing required http resolver params: url`, - }, { - name: "bad/not found", - input: "task", - paramSet: true, - expectedStatus: http.StatusNotFound, - expectedErr: `requested URL 'http://([^']*)' is not found`, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if tc.expectedStatus != 0 { - w.WriteHeader(tc.expectedStatus) - } - fmt.Fprint(w, tc.input) - })) - params := []pipelinev1.Param{} - if tc.paramSet { - params = append(params, pipelinev1.Param{ - Name: httpresolution.UrlParam, - Value: *pipelinev1.NewStructuredValues(svr.URL), - }) - } else { - params = append(params, pipelinev1.Param{ - Name: "foo", - Value: *pipelinev1.NewStructuredValues("bar"), - }) - } - resolver := Resolver{} - req := v1beta1.ResolutionRequestSpec{ - Params: params, - } - output, err := resolver.Resolve(contextWithConfig(defaultHttpTimeoutValue), &req) - if tc.expectedErr != "" { - re := regexp.MustCompile(tc.expectedErr) - if !re.MatchString(err.Error()) { - t.Fatalf("expected error '%v' but got '%v'", tc.expectedErr, err) - } - return - } else if err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - if o := cmp.Diff(tc.input, string(output.Data())); o != "" { - t.Fatalf("expected output '%v' but got '%v'", tc.input, string(output.Data())) - } - if o := cmp.Diff(svr.URL, output.RefSource().URI); o != "" { - t.Fatalf("expected url '%v' but got '%v'", svr.URL, output.RefSource().URI) - } - - eSum := sha256.New() - eSum.Write([]byte(tc.input)) - eSha256 := hex.EncodeToString(eSum.Sum(nil)) - if o := cmp.Diff(eSha256, output.RefSource().Digest["sha256"]); o != "" { - t.Fatalf("expected sha256 '%v' but got '%v'", eSha256, output.RefSource().Digest["sha256"]) - } - - if output.Annotations() != nil { - t.Fatalf("output annotations should be nil") - } - }) - } -} - -func TestResolveNotEnabled(t *testing.T) { - var err error - resolver := Resolver{} - someParams := map[string]string{"foo": "bar"} - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(someParams), - } - _, err = resolver.Resolve(resolverDisabledContext(), &req) - if err == nil { - t.Fatalf("expected disabled err") - } - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } - err = resolver.Validate(resolverDisabledContext(), &v1beta1.ResolutionRequestSpec{Params: toParams(someParams)}) - if err == nil { - t.Fatalf("expected disabled err") - } - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } -} - -func TestResolverReconcileBasicAuth(t *testing.T) { - var doNotCreate string = "notcreate" - var wrongSecretKey string = "wrongsecretk" - - tests := []struct { - name string - params *params - taskContent string - expectedStatus *v1beta1.ResolutionRequestStatus - expectedErr error - }{ - { - name: "good/URL Resolution", - taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), - }, - { - name: "good/URL Resolution with custom basic auth, and custom secret key", - taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), - params: ¶ms{ - authSecret: "auth-secret", - authUsername: "auth", - authSecretKey: "token", - authSecretContent: "untoken", - }, - }, - { - name: "good/URL Resolution with custom basic auth no custom secret key", - taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), - params: ¶ms{ - authSecret: "auth-secret", - authUsername: "auth", - authSecretContent: "untoken", - }, - }, - { - name: "bad/no url found", - params: ¶ms{}, - expectedErr: errors.New(`invalid resource request "foo/rr": cannot parse url : parse "": empty url`), - }, - { - name: "bad/no secret found", - params: ¶ms{ - authSecret: doNotCreate, - authUsername: "user", - url: "https://blah/blah.com", - }, - expectedErr: errors.New(`error getting "Http" "foo/rr": cannot get API token, secret notcreate not found in namespace foo`), - }, - { - name: "bad/no valid secret key", - params: ¶ms{ - authSecret: "shhhhh", - authUsername: "user", - authSecretKey: wrongSecretKey, - url: "https://blah/blah", - }, - expectedErr: errors.New(`error getting "Http" "foo/rr": cannot get API token, key wrongsecretk not found in secret shhhhh in namespace foo`), - }, - { - name: "bad/missing username params for secret with params", - params: ¶ms{ - authSecret: "shhhhh", - url: "https://blah/blah", - }, - expectedErr: errors.New(`invalid resource request "foo/rr": missing required param http-username when using http-password-secret`), - }, - { - name: "bad/missing password params for secret with username", - params: ¶ms{ - authUsername: "failure", - url: "https://blah/blah", - }, - expectedErr: errors.New(`invalid resource request "foo/rr": missing required param http-password-secret when using http-username`), - }, - { - name: "bad/empty auth username", - params: ¶ms{ - authUsername: emptyStr, - authSecret: "asecret", - url: "https://blah/blah", - }, - expectedErr: errors.New(`invalid resource request "foo/rr": value http-username cannot be empty`), - }, - { - name: "bad/empty auth password", - params: ¶ms{ - authUsername: "auser", - authSecret: emptyStr, - url: "https://blah/blah", - }, - expectedErr: errors.New(`invalid resource request "foo/rr": value http-password-secret cannot be empty`), - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - resolver := &Resolver{} - ctx, _ := ttesting.SetupFakeContext(t) - svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, tt.taskContent) - })) - p := tt.params - if p == nil { - p = ¶ms{} - } - if p.url == "" && tt.taskContent != "" { - p.url = svr.URL - } - request := createRequest(p) - cfg := make(map[string]string) - d := test.Data{ - ConfigMaps: []*corev1.ConfigMap{{ - ObjectMeta: metav1.ObjectMeta{ - Name: configMapName, - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - }, - Data: cfg, - }, { - ObjectMeta: metav1.ObjectMeta{ - Namespace: resolverconfig.ResolversNamespace(system.Namespace()), - Name: resolverconfig.GetFeatureFlagsConfigName(), - }, - Data: map[string]string{ - "enable-http-resolver": "true", - }, - }}, - ResolutionRequests: []*v1beta1.ResolutionRequest{request}, - } - var expectedStatus *v1beta1.ResolutionRequestStatus - if tt.expectedStatus != nil { - expectedStatus = tt.expectedStatus.DeepCopy() - if tt.expectedErr == nil { - if tt.taskContent != "" { - h := sha256.New() - h.Write([]byte(tt.taskContent)) - sha256CheckSum := hex.EncodeToString(h.Sum(nil)) - refsrc := &pipelinev1.RefSource{ - URI: svr.URL, - Digest: map[string]string{ - "sha256": sha256CheckSum, - }, - } - expectedStatus.RefSource = refsrc - expectedStatus.Source = refsrc - } - } else { - expectedStatus.Status.Conditions[0].Message = tt.expectedErr.Error() - } - } - frtesting.RunResolverReconcileTest(ctx, t, d, resolver, request, expectedStatus, tt.expectedErr, func(resolver framework.Resolver, testAssets test.Assets) { - if err := resolver.Initialize(ctx); err != nil { - t.Errorf("unexpected error: %v", err) - } - if tt.params == nil { - return - } - if tt.params.authSecret != "" && tt.params.authSecret != doNotCreate { - secretKey := tt.params.authSecretKey - if secretKey == wrongSecretKey { - secretKey = "randomNotOund" - } - if secretKey == "" { - secretKey = defaultBasicAuthSecretKey - } - tokenSecret := &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: tt.params.authSecret, - Namespace: request.GetNamespace(), - }, - Data: map[string][]byte{ - secretKey: []byte(base64.StdEncoding.Strict().EncodeToString([]byte(tt.params.authSecretContent))), - }, - } - if _, err := testAssets.Clients.Kube.CoreV1().Secrets(request.GetNamespace()).Create(ctx, tokenSecret, metav1.CreateOptions{}); err != nil { - t.Fatalf("failed to create test token secret: %v", err) - } - } - }) - }) - } -} - -func TestGetName(t *testing.T) { - resolver := Resolver{} - ctx := context.Background() - - if d := cmp.Diff(httpResolverName, resolver.GetName(ctx)); d != "" { - t.Errorf("invalid name: %s", diff.PrintWantGot(d)) - } - if d := cmp.Diff(configMapName, resolver.GetConfigName(ctx)); d != "" { - t.Errorf("invalid config map name: %s", diff.PrintWantGot(d)) - } -} - -func resolverDisabledContext() context.Context { - return frameworktesting.ContextWithHttpResolverDisabled(context.Background()) -} - -func toParams(m map[string]string) []pipelinev1.Param { - var params []pipelinev1.Param - - for k, v := range m { - params = append(params, pipelinev1.Param{ - Name: k, - Value: *pipelinev1.NewStructuredValues(v), - }) - } - - return params -} - -func contextWithConfig(timeout string) context.Context { - config := map[string]string{ - httpresolution.TimeoutKey: timeout, - } - return resolutionframework.InjectResolverConfigToContext(context.Background(), config) -} - -func checkExpectedErr(t *testing.T, expectedErr, actualErr error) { - t.Helper() - if actualErr == nil { - t.Fatalf("expected err '%v' but didn't get one", expectedErr) - } - if d := cmp.Diff(expectedErr.Error(), actualErr.Error()); d != "" { - t.Fatalf("expected err '%v' but got '%v'", expectedErr, actualErr) - } -} - -func createRequest(params *params) *v1beta1.ResolutionRequest { - rr := &v1beta1.ResolutionRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "resolution.tekton.dev/v1beta1", - Kind: "ResolutionRequest", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "rr", - Namespace: "foo", - CreationTimestamp: metav1.Time{Time: time.Now()}, - Labels: map[string]string{ - resolutioncommon.LabelKeyResolverType: LabelValueHttpResolverType, - }, - }, - Spec: v1beta1.ResolutionRequestSpec{ - Params: []pipelinev1.Param{{ - Name: httpresolution.UrlParam, - Value: *pipelinev1.NewStructuredValues(params.url), - }}, - }, - } - if params.authSecret != "" { - s := params.authSecret - if s == emptyStr { - s = "" - } - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: httpresolution.HttpBasicAuthSecret, - Value: *pipelinev1.NewStructuredValues(s), - }) - } - - if params.authUsername != "" { - s := params.authUsername - if s == emptyStr { - s = "" - } - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: httpresolution.HttpBasicAuthUsername, - Value: *pipelinev1.NewStructuredValues(s), - }) - } - - if params.authSecretKey != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: httpresolution.HttpBasicAuthSecretKey, - Value: *pipelinev1.NewStructuredValues(params.authSecretKey), - }) - } - - return rr -} diff --git a/upstream/pkg/remoteresolution/resolver/hub/resolver.go b/upstream/pkg/remoteresolution/resolver/hub/resolver.go deleted file mode 100644 index 8c29b23e50d..00000000000 --- a/upstream/pkg/remoteresolution/resolver/hub/resolver.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2024 The Tekton Authors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 hub - -import ( - "context" - "errors" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/hub" -) - -const ( - // LabelValueHubResolverType is the value to use for the - // resolution.tekton.dev/type label on resource requests - LabelValueHubResolverType string = "hub" - - // ArtifactHubType is the value to use setting the type field to artifact - ArtifactHubType string = "artifact" - - // TektonHubType is the value to use setting the type field to tekton - TektonHubType string = "tekton" -) - -var _ framework.Resolver = &Resolver{} - -// Resolver implements a framework.Resolver that can fetch files from OCI bundles. -type Resolver struct { - // TektonHubURL is the URL for hub resolver with type tekton - TektonHubURL string - // ArtifactHubURL is the URL for hub resolver with type artifact - ArtifactHubURL string -} - -// Initialize sets up any dependencies needed by the resolver. None atm. -func (r *Resolver) Initialize(context.Context) error { - return nil -} - -// GetName returns a string name to refer to this resolver by. -func (r *Resolver) GetName(context.Context) string { - return "Hub" -} - -// GetConfigName returns the name of the bundle resolver's configmap. -func (r *Resolver) GetConfigName(context.Context) string { - return "hubresolver-config" -} - -// GetSelector returns a map of labels to match requests to this resolver. -func (r *Resolver) GetSelector(context.Context) map[string]string { - return map[string]string{ - common.LabelKeyResolverType: LabelValueHubResolverType, - } -} - -// Validate ensures parameters from a request are as expected. -func (r *Resolver) Validate(ctx context.Context, req *v1beta1.ResolutionRequestSpec) error { - if len(req.Params) > 0 { - return hub.ValidateParams(ctx, req.Params, r.TektonHubURL) - } - // Remove this error once validate url has been implemented. - return errors.New("cannot validate request. the Validate method has not been implemented.") -} - -// Resolve uses the given params to resolve the requested file or resource. -func (r *Resolver) Resolve(ctx context.Context, req *v1beta1.ResolutionRequestSpec) (resolutionframework.ResolvedResource, error) { - if len(req.Params) > 0 { - return hub.Resolve(ctx, req.Params, r.TektonHubURL, r.ArtifactHubURL) - } - // Remove this error once resolution of url has been implemented. - return nil, errors.New("the Resolve method has not been implemented.") -} diff --git a/upstream/pkg/remoteresolution/resolver/hub/resolver_test.go b/upstream/pkg/remoteresolution/resolver/hub/resolver_test.go deleted file mode 100644 index da8f4ea2021..00000000000 --- a/upstream/pkg/remoteresolution/resolver/hub/resolver_test.go +++ /dev/null @@ -1,313 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 hub - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/http/httptest" - "testing" - - "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - hubresolver "github.com/tektoncd/pipeline/pkg/resolution/resolver/hub" - "github.com/tektoncd/pipeline/test/diff" -) - -func TestGetSelector(t *testing.T) { - resolver := Resolver{} - sel := resolver.GetSelector(context.Background()) - if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { - t.Fatalf("unexpected selector: %v", sel) - } else if typ != LabelValueHubResolverType { - t.Fatalf("unexpected type: %q", typ) - } -} - -func TestValidate(t *testing.T) { - testCases := []struct { - testName string - kind string - version string - catalog string - resourceName string - hubType string - expectedErr error - }{ - { - testName: "artifact type validation", - kind: "task", - resourceName: "foo", - version: "bar", - catalog: "baz", - hubType: ArtifactHubType, - }, { - testName: "tekton type validation", - kind: "task", - resourceName: "foo", - version: "bar", - catalog: "baz", - hubType: TektonHubType, - expectedErr: errors.New("failed to validate params: please configure TEKTON_HUB_API env variable to use tekton type"), - }, - } - - for _, tc := range testCases { - t.Run(tc.testName, func(t *testing.T) { - resolver := Resolver{} - params := map[string]string{ - hubresolver.ParamKind: tc.kind, - hubresolver.ParamName: tc.resourceName, - hubresolver.ParamVersion: tc.version, - hubresolver.ParamCatalog: tc.catalog, - hubresolver.ParamType: tc.hubType, - } - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(params), - } - err := resolver.Validate(contextWithConfig(), &req) - if tc.expectedErr != nil { - checkExpectedErr(t, tc.expectedErr, err) - } else if err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - }) - } -} - -func TestValidateMissing(t *testing.T) { - resolver := Resolver{} - - var err error - - paramsMissingName := map[string]string{ - hubresolver.ParamKind: "foo", - hubresolver.ParamVersion: "bar", - } - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(paramsMissingName), - } - err = resolver.Validate(contextWithConfig(), &req) - if err == nil { - t.Fatalf("expected missing name err") - } - - paramsMissingVersion := map[string]string{ - hubresolver.ParamKind: "foo", - hubresolver.ParamName: "bar", - } - req = v1beta1.ResolutionRequestSpec{ - Params: toParams(paramsMissingVersion), - } - err = resolver.Validate(contextWithConfig(), &req) - - if err == nil { - t.Fatalf("expected missing version err") - } -} - -func TestValidateConflictingKindName(t *testing.T) { - testCases := []struct { - kind string - name string - version string - catalog string - hubType string - }{ - { - kind: "not-taskpipeline", - name: "foo", - version: "bar", - catalog: "baz", - hubType: TektonHubType, - }, - { - kind: "task", - name: "foo", - version: "bar", - catalog: "baz", - hubType: "not-tekton-artifact", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - resolver := Resolver{} - params := map[string]string{ - hubresolver.ParamKind: tc.kind, - hubresolver.ParamName: tc.name, - hubresolver.ParamVersion: tc.version, - hubresolver.ParamCatalog: tc.catalog, - hubresolver.ParamType: tc.hubType, - } - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(params), - } - err := resolver.Validate(contextWithConfig(), &req) - if err == nil { - t.Fatalf("expected err due to conflicting param") - } - }) - } -} - -func TestResolve(t *testing.T) { - testCases := []struct { - name string - kind string - imageName string - version string - catalog string - hubType string - input string - expectedRes []byte - expectedErr error - }{ - { - name: "valid response from Tekton Hub", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: TektonHubType, - input: `{"data":{"yaml":"some content"}}`, - expectedRes: []byte("some content"), - }, - { - name: "valid response from Artifact Hub", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: ArtifactHubType, - input: `{"data":{"manifestRaw":"some content"}}`, - expectedRes: []byte("some content"), - }, - { - name: "not-found response from hub", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: TektonHubType, - input: `{"name":"not-found","id":"aaaaaaaa","message":"resource not found","temporary":false,"timeout":false,"fault":false}`, - expectedRes: []byte(""), - }, - { - name: "response with bad formatting error", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: TektonHubType, - input: `value`, - expectedErr: errors.New("fail to fetch Tekton Hub resource: error unmarshalling json response: invalid character 'v' looking for beginning of value"), - }, - { - name: "response with empty body error from Tekton Hub", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: TektonHubType, - expectedErr: errors.New("fail to fetch Tekton Hub resource: error unmarshalling json response: unexpected end of JSON input"), - }, - { - name: "response with empty body error from Artifact Hub", - kind: "task", - imageName: "foo", - version: "baz", - catalog: "Tekton", - hubType: ArtifactHubType, - expectedErr: errors.New("fail to fetch Artifact Hub resource: error unmarshalling json response: unexpected end of JSON input"), - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, tc.input) - })) - - resolver := &Resolver{ - TektonHubURL: svr.URL, - ArtifactHubURL: svr.URL, - } - - params := map[string]string{ - hubresolver.ParamKind: tc.kind, - hubresolver.ParamName: tc.imageName, - hubresolver.ParamVersion: tc.version, - hubresolver.ParamCatalog: tc.catalog, - hubresolver.ParamType: tc.hubType, - } - req := v1beta1.ResolutionRequestSpec{ - Params: toParams(params), - } - output, err := resolver.Resolve(contextWithConfig(), &req) - if tc.expectedErr != nil { - checkExpectedErr(t, tc.expectedErr, err) - } else { - if err != nil { - t.Fatalf("unexpected error resolving: %v", err) - } - if d := cmp.Diff(tc.expectedRes, output.Data()); d != "" { - t.Errorf("unexpected resource from Resolve: %s", diff.PrintWantGot(d)) - } - } - }) - } -} - -func toParams(m map[string]string) []pipelinev1.Param { - var params []pipelinev1.Param - - for k, v := range m { - params = append(params, pipelinev1.Param{ - Name: k, - Value: *pipelinev1.NewStructuredValues(v), - }) - } - - return params -} - -func contextWithConfig() context.Context { - config := map[string]string{ - "default-tekton-hub-catalog": "Tekton", - "default-artifact-hub-task-catalog": "tekton-catalog-tasks", - "default-artifact-hub-pipeline-catalog": "tekton-catalog-pipelines", - "default-type": "artifact", - } - - return resolutionframework.InjectResolverConfigToContext(context.Background(), config) -} - -func checkExpectedErr(t *testing.T, expectedErr, actualErr error) { - t.Helper() - if actualErr == nil { - t.Fatalf("expected err '%v' but didn't get one", expectedErr) - } - if d := cmp.Diff(expectedErr.Error(), actualErr.Error()); d != "" { - t.Fatalf("expected err '%v' but got '%v'", expectedErr, actualErr) - } -} diff --git a/upstream/pkg/remoteresolution/resource/crd_resource.go b/upstream/pkg/remoteresolution/resource/crd_resource.go deleted file mode 100644 index 55c619f7d48..00000000000 --- a/upstream/pkg/remoteresolution/resource/crd_resource.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource - -import ( - "context" - "errors" - - rrclient "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned" - rrlisters "github.com/tektoncd/pipeline/pkg/client/resolution/listers/resolution/v1beta1" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - resolutionresource "github.com/tektoncd/pipeline/pkg/resolution/resource" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/apis" -) - -// CRDRequester implements the Requester interface using -// ResolutionRequest CRDs. -type CRDRequester struct { - clientset rrclient.Interface - lister rrlisters.ResolutionRequestLister -} - -// NewCRDRequester returns an implementation of Requester that uses -// ResolutionRequest CRD objects to mediate between the caller who wants a -// resource (e.g. Tekton Pipelines) and the responder who can fetch -// it (e.g. the gitresolver) -func NewCRDRequester(clientset rrclient.Interface, lister rrlisters.ResolutionRequestLister) *CRDRequester { - return &CRDRequester{clientset, lister} -} - -var _ Requester = &CRDRequester{} - -// Submit constructs a ResolutionRequest object and submits it to the -// kubernetes cluster, returning any errors experienced while doing so. -// If ResolutionRequest is succeeded then it returns the resolved data. -func (r *CRDRequester) Submit(ctx context.Context, resolver ResolverName, req Request) (ResolvedResource, error) { - rr, _ := r.lister.ResolutionRequests(req.ResolverPayload().Namespace).Get(req.ResolverPayload().Name) - if rr == nil { - if err := r.createResolutionRequest(ctx, resolver, req); err != nil && - // When the request reconciles frequently, the creation may fail - // because the list informer cache is not updated. - // If the request already exists then we can assume that is in progress. - // The next reconcile will handle it based on the actual situation. - !apierrors.IsAlreadyExists(err) { - return nil, err - } - return nil, resolutioncommon.ErrRequestInProgress - } - - if rr.Status.GetCondition(apis.ConditionSucceeded).IsUnknown() { - // TODO(sbwsg): This should be where an existing - // resource is given an additional owner reference so - // that it doesn't get deleted until the caller is done - // with it. Use appendOwnerReference and then submit - // update to ResolutionRequest. - return nil, resolutioncommon.ErrRequestInProgress - } - - if rr.Status.GetCondition(apis.ConditionSucceeded).IsTrue() { - return resolutionresource.CrdIntoResource(rr), nil - } - - message := rr.Status.GetCondition(apis.ConditionSucceeded).GetMessage() - err := resolutioncommon.NewError(resolutioncommon.ReasonResolutionFailed, errors.New(message)) - return nil, err -} - -func (r *CRDRequester) createResolutionRequest(ctx context.Context, resolver ResolverName, req Request) error { - var owner metav1.OwnerReference - if ownedReq, ok := req.(OwnedRequest); ok { - owner = ownedReq.OwnerRef() - } - rr := resolutionresource.CreateResolutionRequest(ctx, resolver, req.ResolverPayload().Name, req.ResolverPayload().Namespace, req.ResolverPayload().ResolutionSpec.Params, owner) - rr.Spec.URL = req.ResolverPayload().ResolutionSpec.URL - _, err := r.clientset.ResolutionV1beta1().ResolutionRequests(rr.Namespace).Create(ctx, rr, metav1.CreateOptions{}) - return err -} diff --git a/upstream/pkg/remoteresolution/resource/crd_resource_test.go b/upstream/pkg/remoteresolution/resource/crd_resource_test.go deleted file mode 100644 index 728a52b73b7..00000000000 --- a/upstream/pkg/remoteresolution/resource/crd_resource_test.go +++ /dev/null @@ -1,326 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource_test - -import ( - "context" - "encoding/base64" - "errors" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/diff" - resolution "github.com/tektoncd/pipeline/test/remoteresolution" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/logging" - _ "knative.dev/pkg/system/testing" // Setup system.Namespace() - "sigs.k8s.io/yaml" -) - -// getCRDRequester returns an instance of the CRDRequester that has been seeded with -// d, where d represents the state of the system (existing resources) needed for the test. -func getCRDRequester(t *testing.T, d test.Data) (test.Assets, func()) { - t.Helper() - return initializeCRDRequesterAssets(t, d) -} - -func initializeCRDRequesterAssets(t *testing.T, d test.Data) (test.Assets, func()) { - t.Helper() - ctx, _ := ttesting.SetupFakeContext(t) - ctx, cancel := context.WithCancel(ctx) - c, informers := test.SeedTestData(t, ctx, d) - - return test.Assets{ - Logger: logging.FromContext(ctx), - Clients: c, - Informers: informers, - Ctx: ctx, - }, cancel -} - -func TestCRDRequesterSubmit(t *testing.T) { - ownerRef := mustParseOwnerReference(t, ` -apiVersion: tekton.dev/v1beta1 -blockOwnerDeletion: true -controller: true -kind: TaskRun -name: git-clone -uid: 727019c3-4066-4d8b-919e-90660dfd8b55 -`) - request := mustParseRawRequest(t, ` -resolverPayload: - name: git-ec247f5592afcaefa8485e34d2bd80c6 - namespace: namespace - resolutionSpec: - params: - - name: url - value: https://github.com/tektoncd/catalog - - name: revision - value: main - - name: pathInRepo - value: task/git-clone/0.6/git-clone.yaml - url: "https://foo/bar" -`) - baseRR := mustParseResolutionRequest(t, ` -kind: "ResolutionRequest" -apiVersion: "resolution.tekton.dev/v1beta1" -metadata: - name: "git-ec247f5592afcaefa8485e34d2bd80c6" - namespace: "namespace" - labels: - resolution.tekton.dev/type: "git" - ownerReferences: - - apiVersion: tekton.dev/v1beta1 - blockOwnerDeletion: true - controller: true - kind: TaskRun - name: git-clone - uid: 727019c3-4066-4d8b-919e-90660dfd8b55 -spec: - params: - - name: "url" - value: "https://github.com/tektoncd/catalog" - - name: "revision" - value: "main" - - name: "pathInRepo" - value: "task/git-clone/0.6/git-clone.yaml" - url: "https://foo/bar" -`) - createdRR := baseRR.DeepCopy() - // - unknownRR := baseRR.DeepCopy() - unknownRR.Status = *mustParseResolutionRequestStatus(t, ` -conditions: - - lastTransitionTime: "2023-03-26T10:31:29Z" - status: "Unknown" - type: Succeeded -`) - // - failedRR := baseRR.DeepCopy() - failedRR.Status = *mustParseResolutionRequestStatus(t, ` -conditions: - - lastTransitionTime: "2023-03-26T10:31:29Z" - status: "Failed" - type: Succeeded - message: "error message" -`) - // - successRR := baseRR.DeepCopy() - successRR.Status = *mustParseResolutionRequestStatus(t, ` -annotations: - resolution.tekton.dev/content-type: application/x-yaml - resolution.tekton.dev/path: task/git-clone/0.6/git-clone.yaml - resolution.tekton.dev/revision: main - resolution.tekton.dev/url: https://github.com/tektoncd/catalog -conditions: - - lastTransitionTime: "2023-03-26T10:31:29Z" - status: "True" - type: Succeeded - data: e30= -`) - // - successWithoutAnnotationsRR := baseRR.DeepCopy() - successWithoutAnnotationsRR.Status = *mustParseResolutionRequestStatus(t, ` -conditions: - - lastTransitionTime: "2023-03-26T10:31:29Z" - status: "True" - type: Succeeded - data: e30= -`) - - testCases := []struct { - name string - inputRequest *resolution.RawRequest - inputResolutionRequest *v1beta1.ResolutionRequest - expectedResolutionRequest *v1beta1.ResolutionRequest - expectedResolvedResource *v1beta1.ResolutionRequest - expectedErr error - }{ - { - name: "resolution request does not exist and needs to be created", - inputRequest: request, - inputResolutionRequest: nil, - expectedResolutionRequest: createdRR.DeepCopy(), - expectedResolvedResource: nil, - expectedErr: resolutioncommon.ErrRequestInProgress, - }, - { - name: "resolution request exist and status is unknown", - inputRequest: request, - inputResolutionRequest: unknownRR.DeepCopy(), - expectedResolutionRequest: nil, - expectedResolvedResource: nil, - expectedErr: resolutioncommon.ErrRequestInProgress, - }, - { - name: "resolution request exist and status is succeeded", - inputRequest: request, - inputResolutionRequest: successRR.DeepCopy(), - expectedResolutionRequest: nil, - expectedResolvedResource: successRR.DeepCopy(), - expectedErr: nil, - }, - { - name: "resolution request exist and status is succeeded but annotations is nil", - inputRequest: request, - inputResolutionRequest: successWithoutAnnotationsRR.DeepCopy(), - expectedResolutionRequest: nil, - expectedResolvedResource: successWithoutAnnotationsRR.DeepCopy(), - expectedErr: nil, - }, - { - name: "resolution request exist and status is failed", - inputRequest: request, - inputResolutionRequest: failedRR.DeepCopy(), - expectedResolutionRequest: nil, - expectedResolvedResource: nil, - expectedErr: resolutioncommon.NewError(resolutioncommon.ReasonResolutionFailed, errors.New("error message")), - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - d := test.Data{} - if tc.inputResolutionRequest != nil { - d.ResolutionRequests = []*v1beta1.ResolutionRequest{tc.inputResolutionRequest} - } - - testAssets, cancel := getCRDRequester(t, d) - defer cancel() - ctx := testAssets.Ctx - clients := testAssets.Clients - - resolver := resolutioncommon.ResolverName("git") - crdRequester := resource.NewCRDRequester(clients.ResolutionRequests, testAssets.Informers.ResolutionRequest.Lister()) - requestWithOwner := &ownerRequest{ - Request: tc.inputRequest.Request(), - ownerRef: *ownerRef, - } - resolvedResource, err := crdRequester.Submit(ctx, resolver, requestWithOwner) - - // check the error - if err != nil || tc.expectedErr != nil { - if err == nil || tc.expectedErr == nil { - t.Errorf("expected error %v, but got %v", tc.expectedErr, err) - } else if err.Error() != tc.expectedErr.Error() { - t.Errorf("expected error %v, but got %v", tc.expectedErr, err) - } - } - - // check the resolved resource - switch { - case tc.expectedResolvedResource == nil: - // skipping check of resolved resources. - case tc.expectedResolvedResource != nil: - if resolvedResource == nil { - t.Errorf("expected resolved resource equal %v, but got %v", tc.expectedResolvedResource, resolvedResource) - break - } - rr := tc.expectedResolvedResource - data, err := base64.StdEncoding.Strict().DecodeString(rr.Status.Data) - if err != nil { - t.Errorf("unexpected error decoding expected resource data: %v", err) - } - expectedResolvedResource := resolution.NewResolvedResource(data, rr.Status.Annotations, rr.Status.RefSource, nil) - assertResolvedResourceEqual(t, expectedResolvedResource, resolvedResource) - } - - // check the resolution request - if tc.expectedResolutionRequest != nil { - resolutionrequest, err := clients.ResolutionRequests.ResolutionV1beta1(). - ResolutionRequests(tc.inputRequest.ResolverPayload.Namespace).Get(ctx, tc.inputRequest.ResolverPayload.Name, metav1.GetOptions{}) - if err != nil { - t.Errorf("unexpected error getting resource requests: %v", err) - } - if d := cmp.Diff(tc.expectedResolutionRequest, resolutionrequest); d != "" { - t.Errorf("expected resolution request to match %s", diff.PrintWantGot(d)) - } - } - }) - } -} - -type ownerRequest struct { - resource.Request - ownerRef metav1.OwnerReference -} - -func (r *ownerRequest) OwnerRef() metav1.OwnerReference { - return r.ownerRef -} - -func mustParseRawRequest(t *testing.T, yamlStr string) *resolution.RawRequest { - t.Helper() - output := &resolution.RawRequest{} - if err := yaml.Unmarshal([]byte(yamlStr), output); err != nil { - t.Errorf("parsing raw request %s: %v", yamlStr, err) - } - return output -} - -func mustParseOwnerReference(t *testing.T, yamlStr string) *metav1.OwnerReference { - t.Helper() - output := &metav1.OwnerReference{} - if err := yaml.Unmarshal([]byte(yamlStr), output); err != nil { - t.Errorf("parsing owner reference %s: %v", yamlStr, err) - } - return output -} - -func mustParseResolutionRequest(t *testing.T, yamlStr string) *v1beta1.ResolutionRequest { - t.Helper() - output := &v1beta1.ResolutionRequest{} - if err := yaml.Unmarshal([]byte(yamlStr), output); err != nil { - t.Errorf("parsing resolution request %s: %v", yamlStr, err) - } - return output -} - -func mustParseResolutionRequestStatus(t *testing.T, yamlStr string) *v1beta1.ResolutionRequestStatus { - t.Helper() - output := &v1beta1.ResolutionRequestStatus{} - if err := yaml.Unmarshal([]byte(yamlStr), output); err != nil { - t.Errorf("parsing resolution request status %s: %v", yamlStr, err) - } - return output -} - -func assertResolvedResourceEqual(t *testing.T, expected, actual resolutioncommon.ResolvedResource) { - t.Helper() - expectedBytes, err := expected.Data() - if err != nil { - t.Errorf("unexpected error getting expected resource data: %v", err) - } - actualBytes, err := actual.Data() - if err != nil { - t.Errorf("unexpected error getting acutal resource data: %v", err) - } - if d := cmp.Diff(expectedBytes, actualBytes); d != "" { - t.Errorf("expected resolved resource Data to match %s", diff.PrintWantGot(d)) - } - if d := cmp.Diff(expected.Annotations(), actual.Annotations()); d != "" { - t.Errorf("expected resolved resource Annotations to match %s", diff.PrintWantGot(d)) - } - if d := cmp.Diff(expected.RefSource(), actual.RefSource()); d != "" { - t.Errorf("expected resolved resource Source to match %s", diff.PrintWantGot(d)) - } -} diff --git a/upstream/pkg/remoteresolution/resource/doc.go b/upstream/pkg/remoteresolution/resource/doc.go deleted file mode 100644 index 4f8393963da..00000000000 --- a/upstream/pkg/remoteresolution/resource/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource contains the upgraded remote resolution framework. -It is equivalent to `pkg/resolution/resource`. -This was necessary to ensure backwards compatibility with the existing framework. - -This package is subject to further refactoring and changes. -*/ -package resource diff --git a/upstream/pkg/remoteresolution/resource/request.go b/upstream/pkg/remoteresolution/resource/request.go deleted file mode 100644 index f5472b472fd..00000000000 --- a/upstream/pkg/remoteresolution/resource/request.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource - -import ( - "context" - - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" -) - -type BasicRequest struct { - resolverPayload ResolverPayload -} - -var _ Request = &BasicRequest{} - -// NewRequest returns an instance of a BasicRequestV2 with the given resolverPayload. -func NewRequest(resolverPayload ResolverPayload) Request { - return &BasicRequest{resolverPayload} -} - -var _ Request = &BasicRequest{} - -// Params are the map of parameters associated with this request -func (req *BasicRequest) ResolverPayload() ResolverPayload { - return req.resolverPayload -} - -// Requester is the interface implemented by a type that knows how to -// submit requests for remote resources. -type Requester interface { - // Submit accepts the name of a resolver to submit a request to - // along with the request itself. - Submit(ctx context.Context, name ResolverName, req Request) (ResolvedResource, error) -} - -// Request is implemented by any type that represents a single request -// for a remote resource. Implementing this interface gives the underlying -// type an opportunity to control properties such as whether the name of -// a request has particular properties, whether the request should be made -// to a specific namespace, and precisely which parameters should be included. -type Request interface { - ResolverPayload() ResolverPayload -} - -// ResolverPayload is the struct which holds the payload to create -// the Resolution Request CRD. -type ResolverPayload struct { - Name string - Namespace string - ResolutionSpec *v1beta1.ResolutionRequestSpec -} - -// ResolutionRequester is the interface implemented by a type that knows how to -// submit requests for remote resources. -type ResolutionRequester interface { - // SubmitResolutionRequest accepts the name of a resolver to submit a request to - // along with the request itself. - SubmitResolutionRequest(ctx context.Context, name ResolverName, req RequestRemoteResource) (ResolvedResource, error) -} - -// RequestRemoteResource is implemented by any type that represents a single request -// for a remote resource. Implementing this interface gives the underlying -// type an opportunity to control properties such as whether the name of -// a request has particular properties, whether the request should be made -// to a specific namespace, and precisely which parameters should be included. -type RequestRemoteResource interface { - ResolverPayload() ResolverPayload -} diff --git a/upstream/pkg/remoteresolution/resource/request_test.go b/upstream/pkg/remoteresolution/resource/request_test.go deleted file mode 100644 index 664f66cc423..00000000000 --- a/upstream/pkg/remoteresolution/resource/request_test.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource_test - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - "github.com/tektoncd/pipeline/test/diff" -) - -func TestNewRequest(t *testing.T) { - type args struct { - resolverPayload resource.ResolverPayload - } - type want = args - golden := args{ - resolverPayload: resource.ResolverPayload{ - Name: "test-name", - Namespace: "test-namespace", - ResolutionSpec: &v1beta1.ResolutionRequestSpec{ - Params: v1.Params{ - {Name: "param1", Value: v1.ParamValue{Type: v1.ParamTypeString, StringVal: "value1"}}, - {Name: "param2", Value: v1.ParamValue{Type: v1.ParamTypeString, StringVal: "value2"}}, - }, - URL: "https://foo/bar", - }, - }, - } - tests := []struct { - name string - args args - want want - }{ - { - name: "empty", - args: args{}, - want: want{}, - }, - { - name: "all", - args: golden, - want: golden, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - request := resource.NewRequest(tt.args.resolverPayload) - if request == nil { - t.Errorf("NewRequest() return nil") - } - if d := cmp.Diff(tt.want.resolverPayload, request.ResolverPayload()); d != "" { - t.Errorf("expected params to match %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/remoteresolution/resource/resource.go b/upstream/pkg/remoteresolution/resource/resource.go deleted file mode 100644 index ff61f65b4fc..00000000000 --- a/upstream/pkg/remoteresolution/resource/resource.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 resource - -import ( - "github.com/tektoncd/pipeline/pkg/resolution/common" -) - -// This is an alias for avoiding cycle import - -// ResolverName is the type used for a resolver's name and is mostly -// used to ensure the function signatures that accept it are clear on the -// purpose for the given string. -type ResolverName = common.ResolverName - -// OwnedRequest is implemented by any type implementing Request that also needs -// to express a Kubernetes OwnerRef relationship as part of the request being -// made. -type OwnedRequest = common.OwnedRequest - -// ResolvedResource is implemented by any type that offers a read-only -// view of the data and metadata of a resolved remote resource. -type ResolvedResource = common.ResolvedResource diff --git a/upstream/pkg/resolution/common/errors.go b/upstream/pkg/resolution/common/errors.go index d304989b8b8..bb680f7fb56 100644 --- a/upstream/pkg/resolution/common/errors.go +++ b/upstream/pkg/resolution/common/errors.go @@ -17,21 +17,10 @@ limitations under the License. package common import ( - "context" "errors" "fmt" - "slices" - "strings" - - apierrors "k8s.io/apimachinery/pkg/api/errors" ) -// This error is defined in etcd at -// https://github.com/etcd-io/etcd/blob/5b226e0abf4100253c94bb71f47d6815877ed5a2/server/etcdserver/errors.go#L30 -// TODO: If/when https://github.com/kubernetes/kubernetes/issues/106491 is addressed, -// we should stop relying on a hardcoded string. -var errEtcdLeaderChange = "etcdserver: leader changed" - // Error embeds both a short machine-readable string reason for resolution // problems alongside the original error generated during the resolution flow. type Error struct { @@ -176,19 +165,3 @@ func ReasonError(err error) (string, error) { return reason, resolutionError } - -// IsErrTransient returns true if an error returned by GetTask/GetStepAction is retryable. -func IsErrTransient(err error) bool { - switch { - case apierrors.IsConflict(err): - return true - case apierrors.IsServerTimeout(err): - return true - case apierrors.IsTimeout(err): - return true - default: - return slices.ContainsFunc([]string{errEtcdLeaderChange, context.DeadlineExceeded.Error()}, func(s string) bool { - return strings.Contains(err.Error(), s) - }) - } -} diff --git a/upstream/pkg/resolution/common/interface.go b/upstream/pkg/resolution/common/interface.go index 82bfda68590..3a1968f3695 100644 --- a/upstream/pkg/resolution/common/interface.go +++ b/upstream/pkg/resolution/common/interface.go @@ -30,8 +30,6 @@ type ResolverName string // Requester is the interface implemented by a type that knows how to // submit requests for remote resources. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.Requester]. type Requester interface { // Submit accepts the name of a resolver to submit a request to // along with the request itself. @@ -43,8 +41,6 @@ type Requester interface { // type an opportunity to control properties such as whether the name of // a request has particular properties, whether the request should be made // to a specific namespace, and precisely which parameters should be included. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.Request]. type Request interface { Name() string Namespace() string diff --git a/upstream/pkg/resolution/resolver/bundle/bundle.go b/upstream/pkg/resolution/resolver/bundle/bundle.go index bc6a7fed07f..cb5a023de13 100644 --- a/upstream/pkg/resolution/resolver/bundle/bundle.go +++ b/upstream/pkg/resolution/resolver/bundle/bundle.go @@ -37,7 +37,6 @@ const ( // RequestOptions are the options used to request a resource from // a remote bundle. type RequestOptions struct { - ServiceAccount string ImagePullSecret string Bundle string EntryName string diff --git a/upstream/pkg/resolution/resolver/bundle/config.go b/upstream/pkg/resolution/resolver/bundle/config.go index e46a3151334..45a12846259 100644 --- a/upstream/pkg/resolution/resolver/bundle/config.go +++ b/upstream/pkg/resolution/resolver/bundle/config.go @@ -16,9 +16,6 @@ package bundle const ( // ConfigMapName is the bundle resolver's config map ConfigMapName = "bundleresolver-config" - // ConfigServiceAccount is the configuration field name for controlling - // the Service Account name to use for bundle requests. - ConfigServiceAccount = "default-service-account" // ConfigKind is the configuration field name for controlling // what the layer name in the bundle image is. ConfigKind = "default-kind" diff --git a/upstream/pkg/resolution/resolver/bundle/params.go b/upstream/pkg/resolution/resolver/bundle/params.go index 2712cbe4c09..d410a699f7f 100644 --- a/upstream/pkg/resolution/resolver/bundle/params.go +++ b/upstream/pkg/resolution/resolver/bundle/params.go @@ -21,13 +21,8 @@ import ( "github.com/google/go-containerregistry/pkg/name" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/pkg/resolution/resource" ) -// ParamServiceAccount is the parameter defining what service -// account name to use for bundle requests. -const ParamServiceAccount = "serviceAccount" - // ParamImagePullSecret is the parameter defining what secret // name to use for bundle requests. const ParamImagePullSecret = "secret" @@ -37,7 +32,7 @@ const ParamBundle = "bundle" // ParamName is the parameter defining what the layer name in the bundle // image is. -const ParamName = resource.ParamName +const ParamName = "name" // ParamKind is the parameter defining what the layer kind in the bundle // image is. @@ -54,18 +49,6 @@ func OptionsFromParams(ctx context.Context, params []pipelinev1.Param) (RequestO paramsMap[p.Name] = p.Value } - saVal, ok := paramsMap[ParamServiceAccount] - sa := "" - if !ok || saVal.StringVal == "" { - if saString, ok := conf[ConfigServiceAccount]; ok { - sa = saString - } else { - return opts, errors.New("default Service Account was not set during installation of the bundle resolver") - } - } else { - sa = saVal.StringVal - } - bundleVal, ok := paramsMap[ParamBundle] if !ok || bundleVal.StringVal == "" { return opts, fmt.Errorf("parameter %q required", ParamBundle) @@ -85,13 +68,12 @@ func OptionsFromParams(ctx context.Context, params []pipelinev1.Param) (RequestO if kindString, ok := conf[ConfigKind]; ok { kind = kindString } else { - return opts, errors.New("default resource Kind was not set during installation of the bundle resolver") + return opts, errors.New("default resource Kind was not set during installation of the bundle resolver") } } else { kind = kindVal.StringVal } - opts.ServiceAccount = sa opts.ImagePullSecret = paramsMap[ParamImagePullSecret].StringVal opts.Bundle = bundleVal.StringVal opts.EntryName = nameVal.StringVal diff --git a/upstream/pkg/resolution/resolver/bundle/resolver.go b/upstream/pkg/resolution/resolver/bundle/resolver.go index 95c18f21963..a5cd07ac5f3 100644 --- a/upstream/pkg/resolution/resolver/bundle/resolver.go +++ b/upstream/pkg/resolution/resolver/bundle/resolver.go @@ -22,10 +22,10 @@ import ( "time" "github.com/google/go-containerregistry/pkg/authn/k8schain" + kauth "github.com/google/go-containerregistry/pkg/authn/kubernetes" resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" + "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" "k8s.io/client-go/kubernetes" "knative.dev/pkg/client/injection/kube/client" @@ -34,21 +34,19 @@ import ( const ( disabledError = "cannot handle resolution request, enable-bundles-resolver feature flag not true" - // TODO(sbwsg): This should be exposed as a configurable option for - // admins (e.g. via ConfigMap) - timeoutDuration = time.Minute - // LabelValueBundleResolverType is the value to use for the // resolution.tekton.dev/type label on resource requests LabelValueBundleResolverType string = "bundles" + // TODO(sbwsg): This should be exposed as a configurable option for + // admins (e.g. via ConfigMap) + timeoutDuration = time.Minute + // BundleResolverName is the name that the bundle resolver should be associated with. BundleResolverName = "bundleresolver" ) // Resolver implements a framework.Resolver that can fetch files from OCI bundles. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/bundle.Resolver] instead. type Resolver struct { kubeClientSet kubernetes.Interface } @@ -77,21 +75,22 @@ func (r *Resolver) GetSelector(context.Context) map[string]string { } // ValidateParams ensures parameters from a request are as expected. -func (r *Resolver) ValidateParams(ctx context.Context, params []v1.Param) error { - return ValidateParams(ctx, params) -} - -// Resolve uses the given params to resolve the requested file or resource. -func (r *Resolver) Resolve(ctx context.Context, params []v1.Param) (framework.ResolvedResource, error) { - return ResolveRequest(ctx, r.kubeClientSet, &v1beta1.ResolutionRequestSpec{Params: params}) +func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { + if r.isDisabled(ctx) { + return errors.New(disabledError) + } + if _, err := OptionsFromParams(ctx, params); err != nil { + return err + } + return nil } // Resolve uses the given params to resolve the requested file or resource. -func ResolveRequest(ctx context.Context, kubeClientSet kubernetes.Interface, req *v1beta1.ResolutionRequestSpec) (framework.ResolvedResource, error) { - if isDisabled(ctx) { +func (r *Resolver) Resolve(ctx context.Context, params []pipelinev1.Param) (framework.ResolvedResource, error) { + if r.isDisabled(ctx) { return nil, errors.New(disabledError) } - opts, err := OptionsFromParams(ctx, req.Params) + opts, err := OptionsFromParams(ctx, params) if err != nil { return nil, err } @@ -100,10 +99,10 @@ func ResolveRequest(ctx context.Context, kubeClientSet kubernetes.Interface, req imagePullSecrets = append(imagePullSecrets, opts.ImagePullSecret) } namespace := common.RequestNamespace(ctx) - kc, err := k8schain.New(ctx, kubeClientSet, k8schain.Options{ + kc, err := k8schain.New(ctx, r.kubeClientSet, k8schain.Options{ Namespace: namespace, - ServiceAccountName: opts.ServiceAccount, ImagePullSecrets: imagePullSecrets, + ServiceAccountName: kauth.NoServiceAccount, }) if err != nil { return nil, err @@ -113,17 +112,7 @@ func ResolveRequest(ctx context.Context, kubeClientSet kubernetes.Interface, req return GetEntry(ctx, kc, opts) } -func ValidateParams(ctx context.Context, params []v1.Param) error { - if isDisabled(ctx) { - return errors.New(disabledError) - } - if _, err := OptionsFromParams(ctx, params); err != nil { - return err - } - return nil -} - -func isDisabled(ctx context.Context) bool { +func (r *Resolver) isDisabled(ctx context.Context) bool { cfg := resolverconfig.FromContextOrDefaults(ctx) return !cfg.FeatureFlags.EnableBundleResolver } diff --git a/upstream/pkg/resolution/resolver/bundle/resolver_test.go b/upstream/pkg/resolution/resolver/bundle/resolver_test.go index d5e1ce4f84d..4f575d00b8f 100644 --- a/upstream/pkg/resolution/resolver/bundle/resolver_test.go +++ b/upstream/pkg/resolution/resolver/bundle/resolver_test.go @@ -30,13 +30,13 @@ import ( "github.com/google/go-containerregistry/pkg/registry" resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - common "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" + bundle "github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle" frtesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/internal" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" @@ -56,19 +56,15 @@ const ( func TestGetSelector(t *testing.T) { resolver := bundle.Resolver{} sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { + if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { t.Fatalf("unexpected selector: %v", sel) } else if typ != bundle.LabelValueBundleResolverType { t.Fatalf("unexpected type: %q", typ) } } -func TestValidateParamsSecret(t *testing.T) { +func TestValidateParams(t *testing.T) { resolver := bundle.Resolver{} - config := map[string]string{ - bundle.ConfigServiceAccount: "default", - } - ctx := framework.InjectResolverConfigToContext(context.Background(), config) paramsWithTask := []pipelinev1.Param{{ Name: bundle.ParamKind, @@ -84,7 +80,7 @@ func TestValidateParamsSecret(t *testing.T) { Value: *pipelinev1.NewStructuredValues("baz"), }} - if err := resolver.ValidateParams(ctx, paramsWithTask); err != nil { + if err := resolver.ValidateParams(context.Background(), paramsWithTask); err != nil { t.Fatalf("unexpected error validating params: %v", err) } @@ -101,47 +97,7 @@ func TestValidateParamsSecret(t *testing.T) { Name: bundle.ParamImagePullSecret, Value: *pipelinev1.NewStructuredValues("baz"), }} - if err := resolver.ValidateParams(ctx, paramsWithPipeline); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } -} - -func TestValidateParamsServiceAccount(t *testing.T) { - resolver := bundle.Resolver{} - config := map[string]string{ - bundle.ConfigServiceAccount: "default", - } - ctx := framework.InjectResolverConfigToContext(context.Background(), config) - - paramsWithTask := []pipelinev1.Param{{ - Name: bundle.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundle.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundle.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundle.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - - if err := resolver.ValidateParams(context.Background(), paramsWithTask); err != nil { - t.Fatalf("unexpected error validating params: %v", err) - } - - paramsWithPipeline := []pipelinev1.Param{{ - Name: bundle.ParamKind, - Value: *pipelinev1.NewStructuredValues("pipeline"), - }, { - Name: bundle.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundle.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }} - if err := resolver.ValidateParams(ctx, paramsWithPipeline); err != nil { + if err := resolver.ValidateParams(context.Background(), paramsWithPipeline); err != nil { t.Fatalf("unexpected error validating params: %v", err) } } @@ -151,7 +107,7 @@ func TestValidateParamsDisabled(t *testing.T) { var err error - paramsSecret := []pipelinev1.Param{{ + params := []pipelinev1.Param{{ Name: bundle.ParamKind, Value: *pipelinev1.NewStructuredValues("task"), }, { @@ -164,29 +120,7 @@ func TestValidateParamsDisabled(t *testing.T) { Name: bundle.ParamImagePullSecret, Value: *pipelinev1.NewStructuredValues("baz"), }} - err = resolver.ValidateParams(resolverDisabledContext(), paramsSecret) - if err == nil { - t.Fatalf("expected disabled err") - } - - if d := cmp.Diff(disabledError, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } - - paramsServiceAccount := []pipelinev1.Param{{ - Name: bundle.ParamKind, - Value: *pipelinev1.NewStructuredValues("task"), - }, { - Name: bundle.ParamName, - Value: *pipelinev1.NewStructuredValues("foo"), - }, { - Name: bundle.ParamBundle, - Value: *pipelinev1.NewStructuredValues("bar"), - }, { - Name: bundle.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues("baz"), - }} - err = resolver.ValidateParams(resolverDisabledContext(), paramsServiceAccount) + err = resolver.ValidateParams(resolverDisabledContext(), params) if err == nil { t.Fatalf("expected disabled err") } @@ -280,8 +214,7 @@ func TestResolve_KeyChainError(t *testing.T) { Namespace: resolverconfig.ResolversNamespace(system.Namespace()), }, Data: map[string]string{ - bundle.ConfigKind: "task", - bundle.ConfigServiceAccount: "default", + bundle.ConfigKind: "task", }, }}, } @@ -306,27 +239,26 @@ func TestResolve_KeyChainError(t *testing.T) { } type params struct { - serviceAccount string - secret string - bundle string - name string - kind string + secret string + bundle string + name string + kind string } func TestResolve(t *testing.T) { // example task resource - exampleTask := &pipelinev1.Task{ + exampleTask := &pipelinev1beta1.Task{ ObjectMeta: metav1.ObjectMeta{ Name: "example-task", Namespace: "task-ns", ResourceVersion: "00002", }, TypeMeta: metav1.TypeMeta{ - Kind: string(pipelinev1.NamespacedTaskKind), - APIVersion: "tekton.dev/v1", + Kind: string(pipelinev1beta1.NamespacedTaskKind), + APIVersion: "tekton.dev/v1beta1", }, - Spec: pipelinev1.TaskSpec{ - Steps: []pipelinev1.Step{{ + Spec: pipelinev1beta1.TaskSpec{ + Steps: []pipelinev1beta1.Step{{ Name: "some-step", Image: "some-image", Command: []string{"something"}, @@ -339,7 +271,7 @@ func TestResolve(t *testing.T) { } // example pipeline resource - examplePipeline := &pipelinev1.Pipeline{ + examplePipeline := &pipelinev1beta1.Pipeline{ ObjectMeta: metav1.ObjectMeta{ Name: "example-pipeline", Namespace: "pipeline-ns", @@ -347,14 +279,14 @@ func TestResolve(t *testing.T) { }, TypeMeta: metav1.TypeMeta{ Kind: "Pipeline", - APIVersion: "tekton.dev/v1", + APIVersion: "tekton.dev/v1beta1", }, - Spec: pipelinev1.PipelineSpec{ - Tasks: []pipelinev1.PipelineTask{{ + Spec: pipelinev1beta1.PipelineSpec{ + Tasks: []pipelinev1beta1.PipelineTask{{ Name: "some-pipeline-task", - TaskRef: &pipelinev1.TaskRef{ + TaskRef: &pipelinev1beta1.TaskRef{ Name: "some-task", - Kind: pipelinev1.NamespacedTaskKind, + Kind: pipelinev1beta1.NamespacedTaskKind, }, }}, }, @@ -368,12 +300,12 @@ func TestResolve(t *testing.T) { var tooManyObjs []runtime.Object for i := 0; i <= bundle.MaximumBundleObjects; i++ { name := fmt.Sprintf("%d-task", i) - obj := pipelinev1.Task{ + obj := pipelinev1beta1.Task{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, TypeMeta: metav1.TypeMeta{ - APIVersion: "tekton.dev/v1", + APIVersion: "tekton.dev/v1beta1", Kind: "Task", }, } @@ -393,10 +325,10 @@ func TestResolve(t *testing.T) { "single-pipeline": pushToRegistry(t, r, "single-pipeline", []runtime.Object{examplePipeline}, test.DefaultObjectAnnotationMapper), "multiple-resources": pushToRegistry(t, r, "multiple-resources", []runtime.Object{exampleTask, examplePipeline}, test.DefaultObjectAnnotationMapper), "too-many-objs": pushToRegistry(t, r, "too-many-objs", tooManyObjs, asIsMapper), - "single-task-no-version": pushToRegistry(t, r, "single-task-no-version", []runtime.Object{&pipelinev1.Task{TypeMeta: metav1.TypeMeta{Kind: "task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), - "single-task-no-kind": pushToRegistry(t, r, "single-task-no-kind", []runtime.Object{&pipelinev1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), - "single-task-no-name": pushToRegistry(t, r, "single-task-no-name", []runtime.Object{&pipelinev1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1", Kind: "task"}}}, asIsMapper), - "single-task-kind-incorrect-form": pushToRegistry(t, r, "single-task-kind-incorrect-form", []runtime.Object{&pipelinev1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1", Kind: "Task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), + "single-task-no-version": pushToRegistry(t, r, "single-task-no-version", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{Kind: "task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), + "single-task-no-kind": pushToRegistry(t, r, "single-task-no-kind", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), + "single-task-no-name": pushToRegistry(t, r, "single-task-no-name", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1", Kind: "task"}}}, asIsMapper), + "single-task-kind-incorrect-form": pushToRegistry(t, r, "single-task-kind-incorrect-form", []runtime.Object{&pipelinev1beta1.Task{TypeMeta: metav1.TypeMeta{APIVersion: "tekton.dev/v1beta1", Kind: "Task"}, ObjectMeta: metav1.ObjectMeta{Name: "foo"}}}, asIsMapper), } testcases := []struct { @@ -415,7 +347,7 @@ func TestResolve(t *testing.T) { kind: "task", }, imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), }, { name: "single task: param kind is capitalized, but kind in bundle is not", args: ¶ms{ @@ -425,7 +357,7 @@ func TestResolve(t *testing.T) { }, kindInBundle: "task", imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), }, { name: "single task: tag is included in the bundle parameter", args: ¶ms{ @@ -434,7 +366,7 @@ func TestResolve(t *testing.T) { kind: "task", }, imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), }, { name: "single task: using default kind value from configmap", args: ¶ms{ @@ -442,25 +374,7 @@ func TestResolve(t *testing.T) { name: "example-task", }, imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single task: using secret from params", - args: ¶ms{ - bundle: testImages["single-task"].uri + ":latest", - name: "example-task", - secret: "example-secret", - }, - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), - }, { - name: "single task: using SA from params", - args: ¶ms{ - bundle: testImages["single-task"].uri + ":latest", - name: "example-task", - serviceAccount: "example-sa", - }, - imageName: "single-task", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(taskAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), }, { name: "single pipeline", args: ¶ms{ @@ -469,27 +383,7 @@ func TestResolve(t *testing.T) { kind: "pipeline", }, imageName: "single-pipeline", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), - }, { - name: "single pipeline: with service account", - args: ¶ms{ - bundle: testImages["single-pipeline"].uri + ":latest", - name: "example-pipeline", - kind: "pipeline", - serviceAccount: "example-sa", - }, - imageName: "single-pipeline", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), - }, { - name: "single pipeline: with secret", - args: ¶ms{ - bundle: testImages["single-pipeline"].uri + ":latest", - name: "example-pipeline", - kind: "pipeline", - secret: "example-secret", - }, - imageName: "single-pipeline", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(pipelineAsYAML), }, { name: "multiple resources: an image has both task and pipeline resource", args: ¶ms{ @@ -498,7 +392,7 @@ func TestResolve(t *testing.T) { kind: "pipeline", }, imageName: "multiple-resources", - expectedStatus: resolution.CreateResolutionRequestStatusWithData(pipelineAsYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(pipelineAsYAML), }, { name: "too many objects in an image", args: ¶ms{ @@ -506,7 +400,7 @@ func TestResolve(t *testing.T) { name: "2-task", kind: "task", }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErrMessage: fmt.Sprintf("contained more than the maximum %d allow objects", bundle.MaximumBundleObjects), }, { name: "single task no version", @@ -515,7 +409,7 @@ func TestResolve(t *testing.T) { name: "foo", kind: "task", }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundle.BundleAnnotationAPIVersion), }, { name: "single task no kind", @@ -524,7 +418,7 @@ func TestResolve(t *testing.T) { name: "foo", kind: "task", }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundle.BundleAnnotationKind), }, { name: "single task no name", @@ -533,7 +427,7 @@ func TestResolve(t *testing.T) { name: "foo", kind: "task", }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErrMessage: fmt.Sprintf("the layer 0 does not contain a %s annotation", bundle.BundleAnnotationName), }, { name: "single task kind incorrect form", @@ -542,15 +436,14 @@ func TestResolve(t *testing.T) { name: "foo", kind: "task", }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErrMessage: fmt.Sprintf("the layer 0 the annotation %s must be lowercased and singular, found %s", bundle.BundleAnnotationKind, "Task"), }, } resolver := &bundle.Resolver{} confMap := map[string]string{ - bundle.ConfigKind: "task", - bundle.ConfigServiceAccount: "default", + bundle.ConfigKind: "task", } for _, tc := range testcases { @@ -596,7 +489,7 @@ func TestResolve(t *testing.T) { } expectedStatus.Annotations[bundle.ResolverAnnotationName] = tc.args.name - expectedStatus.Annotations[bundle.ResolverAnnotationAPIVersion] = "v1" + expectedStatus.Annotations[bundle.ResolverAnnotationAPIVersion] = "v1beta1" expectedStatus.RefSource = &pipelinev1.RefSource{ URI: testImages[tc.imageName].uri, @@ -628,7 +521,7 @@ func createRequest(p *params) *v1beta1.ResolutionRequest { Namespace: "foo", CreationTimestamp: metav1.Time{Time: time.Now()}, Labels: map[string]string{ - common.LabelKeyResolverType: bundle.LabelValueBundleResolverType, + resolutioncommon.LabelKeyResolverType: bundle.LabelValueBundleResolverType, }, }, Spec: v1beta1.ResolutionRequestSpec{ @@ -644,9 +537,6 @@ func createRequest(p *params) *v1beta1.ResolutionRequest { }, { Name: bundle.ParamImagePullSecret, Value: *pipelinev1.NewStructuredValues(p.secret), - }, { - Name: bundle.ParamServiceAccount, - Value: *pipelinev1.NewStructuredValues(p.serviceAccount), }}, }, } @@ -654,7 +544,7 @@ func createRequest(p *params) *v1beta1.ResolutionRequest { } func createError(image, msg string) error { - return &common.GetResourceError{ + return &resolutioncommon.GetResourceError{ ResolverName: bundle.BundleResolverName, Key: "foo/rr", Original: fmt.Errorf("invalid tekton bundle %s, error: %s", image, msg), diff --git a/upstream/pkg/resolution/resolver/cluster/resolver.go b/upstream/pkg/resolution/resolver/cluster/resolver.go index bc9d5cd3e30..6483016b93b 100644 --- a/upstream/pkg/resolution/resolver/cluster/resolver.go +++ b/upstream/pkg/resolution/resolver/cluster/resolver.go @@ -21,15 +21,13 @@ import ( "encoding/hex" "errors" "fmt" - "slices" "strings" resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" pipelineclient "github.com/tektoncd/pipeline/pkg/client/injection/client" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/logging" @@ -52,11 +50,7 @@ const ( var _ framework.Resolver = &Resolver{} -var supportedKinds = []string{"task", "pipeline", "stepaction"} - // Resolver implements a framework.Resolver that can fetch resources from other namespaces. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/cluster.Resolver] instead. type Resolver struct { pipelineClientSet clientset.Interface } @@ -77,24 +71,25 @@ func (r *Resolver) GetName(_ context.Context) string { // the cluster resolver to process them. func (r *Resolver) GetSelector(_ context.Context) map[string]string { return map[string]string{ - common.LabelKeyResolverType: LabelValueClusterResolverType, + resolutioncommon.LabelKeyResolverType: LabelValueClusterResolverType, } } // ValidateParams returns an error if the given parameter map is not // valid for a resource request targeting the cluster resolver. func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - return ValidateParams(ctx, params) + if r.isDisabled(ctx) { + return errors.New(disabledError) + } + + _, err := populateParamsWithDefaults(ctx, params) + return err } // Resolve performs the work of fetching a resource from a namespace with the given // parameters. func (r *Resolver) Resolve(ctx context.Context, origParams []pipelinev1.Param) (framework.ResolvedResource, error) { - return ResolveFromParams(ctx, origParams, r.pipelineClientSet) -} - -func ResolveFromParams(ctx context.Context, origParams []pipelinev1.Param, pipelineClientSet clientset.Interface) (framework.ResolvedResource, error) { - if isDisabled(ctx) { + if r.isDisabled(ctx) { return nil, errors.New(disabledError) } @@ -113,34 +108,53 @@ func ResolveFromParams(ctx context.Context, origParams []pipelinev1.Param, pipel groupVersion := pipelinev1.SchemeGroupVersion.String() switch params[KindParam] { - case "stepaction": - stepaction, err := pipelineClientSet.TektonV1beta1().StepActions(params[NamespaceParam]).Get(ctx, params[NameParam], metav1.GetOptions{}) + case "task": + task, err := r.pipelineClientSet.TektonV1().Tasks(params[NamespaceParam]).Get(ctx, params[NameParam], metav1.GetOptions{}) if err != nil { - logger.Infof("failed to load stepaction %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) + logger.Infof("failed to load task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } - uid, data, sha256Checksum, spec, err = fetchStepaction(ctx, pipelinev1beta1.SchemeGroupVersion.String(), stepaction, params) + uid = string(task.UID) + task.Kind = "Task" + task.APIVersion = groupVersion + data, err = yaml.Marshal(task) if err != nil { + logger.Infof("failed to marshal task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } - case "task": - task, err := pipelineClientSet.TektonV1().Tasks(params[NamespaceParam]).Get(ctx, params[NameParam], metav1.GetOptions{}) + sha256Checksum, err = task.Checksum() if err != nil { - logger.Infof("failed to load task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } - uid, data, sha256Checksum, spec, err = fetchTask(ctx, groupVersion, task, params) + + spec, err = yaml.Marshal(task.Spec) if err != nil { + logger.Infof("failed to marshal the spec of the task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } case "pipeline": - pipeline, err := pipelineClientSet.TektonV1().Pipelines(params[NamespaceParam]).Get(ctx, params[NameParam], metav1.GetOptions{}) + pipeline, err := r.pipelineClientSet.TektonV1().Pipelines(params[NamespaceParam]).Get(ctx, params[NameParam], metav1.GetOptions{}) if err != nil { logger.Infof("failed to load pipeline %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } - uid, data, sha256Checksum, spec, err = fetchPipeline(ctx, groupVersion, pipeline, params) + uid = string(pipeline.UID) + pipeline.Kind = "Pipeline" + pipeline.APIVersion = groupVersion + data, err = yaml.Marshal(pipeline) if err != nil { + logger.Infof("failed to marshal pipeline %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) + return nil, err + } + + sha256Checksum, err = pipeline.Checksum() + if err != nil { + return nil, err + } + + spec, err = yaml.Marshal(pipeline.Spec) + if err != nil { + logger.Infof("failed to marshal the spec of the pipeline %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) return nil, err } default: @@ -165,6 +179,11 @@ func (r *Resolver) GetConfigName(context.Context) string { return configMapName } +func (r *Resolver) isDisabled(ctx context.Context) bool { + cfg := resolverconfig.FromContextOrDefaults(ctx) + return !cfg.FeatureFlags.EnableClusterResolver +} + // ResolvedClusterResource implements framework.ResolvedResource and returns // the resolved file []byte data and an annotation map for any metadata. type ResolvedClusterResource struct { @@ -232,7 +251,7 @@ func populateParamsWithDefaults(ctx context.Context, origParams []pipelinev1.Par } else { params[KindParam] = pKind.StringVal } - if kindVal, ok := params[KindParam]; ok && !isSupportedKind(kindVal) { + if kindVal, ok := params[KindParam]; ok && kindVal != "task" && kindVal != "pipeline" { return nil, fmt.Errorf("unknown or unsupported resource kind '%s'", kindVal) } @@ -283,91 +302,3 @@ func isInCommaSeparatedList(checkVal string, commaList string) bool { } return false } - -func isDisabled(ctx context.Context) bool { - cfg := resolverconfig.FromContextOrDefaults(ctx) - return !cfg.FeatureFlags.EnableClusterResolver -} - -func ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - if isDisabled(ctx) { - return errors.New(disabledError) - } - - _, err := populateParamsWithDefaults(ctx, params) - return err -} - -func fetchStepaction(ctx context.Context, groupVersion string, stepaction *pipelinev1beta1.StepAction, params map[string]string) (string, []byte, []byte, []byte, error) { - logger := logging.FromContext(ctx) - uid := string(stepaction.UID) - stepaction.Kind = "StepAction" - stepaction.APIVersion = groupVersion - data, err := yaml.Marshal(stepaction) - if err != nil { - logger.Infof("failed to marshal stepaction %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - sha256Checksum, err := stepaction.Checksum() - if err != nil { - return "", nil, nil, nil, err - } - - spec, err := yaml.Marshal(stepaction.Spec) - if err != nil { - logger.Infof("failed to marshal the spec of the task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - return uid, data, sha256Checksum, spec, nil -} - -func fetchTask(ctx context.Context, groupVersion string, task *pipelinev1.Task, params map[string]string) (string, []byte, []byte, []byte, error) { - logger := logging.FromContext(ctx) - uid := string(task.UID) - task.Kind = "Task" - task.APIVersion = groupVersion - data, err := yaml.Marshal(task) - if err != nil { - logger.Infof("failed to marshal task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - sha256Checksum, err := task.Checksum() - if err != nil { - return "", nil, nil, nil, err - } - - spec, err := yaml.Marshal(task.Spec) - if err != nil { - logger.Infof("failed to marshal the spec of the task %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - return uid, data, sha256Checksum, spec, nil -} - -func fetchPipeline(ctx context.Context, groupVersion string, pipeline *pipelinev1.Pipeline, params map[string]string) (string, []byte, []byte, []byte, error) { - logger := logging.FromContext(ctx) - uid := string(pipeline.UID) - pipeline.Kind = "Pipeline" - pipeline.APIVersion = groupVersion - data, err := yaml.Marshal(pipeline) - if err != nil { - logger.Infof("failed to marshal pipeline %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - - sha256Checksum, err := pipeline.Checksum() - if err != nil { - return "", nil, nil, nil, err - } - - spec, err := yaml.Marshal(pipeline.Spec) - if err != nil { - logger.Infof("failed to marshal the spec of the pipeline %s from namespace %s: %v", params[NameParam], params[NamespaceParam], err) - return "", nil, nil, nil, err - } - return uid, data, sha256Checksum, spec, nil -} - -func isSupportedKind(kindValue string) bool { - return slices.Contains[[]string, string](supportedKinds, kindValue) -} diff --git a/upstream/pkg/resolution/resolver/cluster/resolver_test.go b/upstream/pkg/resolution/resolver/cluster/resolver_test.go index dd24ae7846b..e1051a7089d 100644 --- a/upstream/pkg/resolution/resolver/cluster/resolver_test.go +++ b/upstream/pkg/resolution/resolver/cluster/resolver_test.go @@ -30,12 +30,12 @@ import ( pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" cluster "github.com/tektoncd/pipeline/pkg/resolution/resolver/cluster" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" frtesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/internal" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" @@ -53,7 +53,7 @@ const ( func TestGetSelector(t *testing.T) { resolver := cluster.Resolver{} sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { + if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { t.Fatalf("unexpected selector: %v", sel) } else if typ != cluster.LabelValueClusterResolverType { t.Fatalf("unexpected type: %q", typ) @@ -279,28 +279,6 @@ func TestResolve(t *testing.T) { t.Fatalf("couldn't marshal pipeline: %v", err) } - exampleStepAction := &pipelinev1beta1.StepAction{ - ObjectMeta: metav1.ObjectMeta{ - Name: "example-stepaction", - Namespace: "stepaction-ns", - ResourceVersion: "00003", - UID: "c123", - }, - TypeMeta: metav1.TypeMeta{ - Kind: "StepAction", - APIVersion: "tekton.dev/v1beta1", - }, - Spec: pipelinev1beta1.StepActionSpec{}, - } - stepActionChecksum, err := exampleStepAction.Checksum() - if err != nil { - t.Fatalf("couldn't checksum stepaction: %v", err) - } - stepActionAsYAML, err := yaml.Marshal(exampleStepAction) - if err != nil { - t.Fatalf("couldn't marshal stepaction: %v", err) - } - testCases := []struct { name string kind string @@ -345,23 +323,6 @@ func TestResolve(t *testing.T) { }, }, }, - }, { - name: "successful stepaction", - kind: "stepaction", - resourceName: exampleStepAction.Name, - namespace: exampleStepAction.Namespace, - expectedStatus: &v1beta1.ResolutionRequestStatus{ - Status: duckv1.Status{}, - ResolutionRequestStatusFields: v1beta1.ResolutionRequestStatusFields{ - Data: base64.StdEncoding.Strict().EncodeToString(stepActionAsYAML), - RefSource: &pipelinev1.RefSource{ - URI: "/apis/tekton.dev/v1/namespaces/stepaction-ns/stepaction/example-stepaction@c123", - Digest: map[string]string{ - "sha256": hex.EncodeToString(stepActionChecksum), - }, - }, - }, - }, }, { name: "default namespace", kind: "pipeline", @@ -399,8 +360,8 @@ func TestResolve(t *testing.T) { kind: "task", resourceName: exampleTask.Name, namespace: "other-ns", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &common.GetResourceError{ + expectedStatus: internal.CreateResolutionRequestFailureStatus(), + expectedErr: &resolutioncommon.GetResourceError{ ResolverName: cluster.ClusterResolverName, Key: "foo/rr", Original: errors.New(`tasks.tekton.dev "example-task" not found`), @@ -411,8 +372,8 @@ func TestResolve(t *testing.T) { resourceName: exampleTask.Name, namespace: "other-ns", allowedNamespaces: "foo,bar", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &common.InvalidRequestError{ + expectedStatus: internal.CreateResolutionRequestFailureStatus(), + expectedErr: &resolutioncommon.InvalidRequestError{ ResolutionRequestKey: "foo/rr", Message: "access to specified namespace other-ns is not allowed", }, @@ -422,8 +383,8 @@ func TestResolve(t *testing.T) { resourceName: exampleTask.Name, namespace: "other-ns", blockedNamespaces: "foo,other-ns,bar", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), - expectedErr: &common.InvalidRequestError{ + expectedStatus: internal.CreateResolutionRequestFailureStatus(), + expectedErr: &resolutioncommon.InvalidRequestError{ ResolutionRequestKey: "foo/rr", Message: "access to specified namespace other-ns is blocked", }, @@ -466,7 +427,6 @@ func TestResolve(t *testing.T) { Pipelines: []*pipelinev1.Pipeline{examplePipeline}, ResolutionRequests: []*v1beta1.ResolutionRequest{request}, Tasks: []*pipelinev1.Task{exampleTask}, - StepActions: []*pipelinev1beta1.StepAction{exampleStepAction}, } resolver := &cluster.Resolver{} @@ -511,7 +471,7 @@ func createRequest(kind, name, namespace string) *v1beta1.ResolutionRequest { Namespace: "foo", CreationTimestamp: metav1.Time{Time: time.Now()}, Labels: map[string]string{ - common.LabelKeyResolverType: cluster.LabelValueClusterResolverType, + resolutioncommon.LabelKeyResolverType: cluster.LabelValueClusterResolverType, }, }, Spec: v1beta1.ResolutionRequestSpec{ diff --git a/upstream/pkg/resolution/resolver/framework/controller.go b/upstream/pkg/resolution/resolver/framework/controller.go index 61bc3c04626..f1d270a398a 100644 --- a/upstream/pkg/resolution/resolver/framework/controller.go +++ b/upstream/pkg/resolution/resolver/framework/controller.go @@ -46,7 +46,7 @@ type ReconcilerModifier = func(reconciler *Reconciler) // This sets up a lot of the boilerplate that individual resolvers // shouldn't need to be concerned with since it's common to all of them. func NewController(ctx context.Context, resolver Resolver, modifiers ...ReconcilerModifier) func(context.Context, configmap.Watcher) *controller.Impl { - if err := ValidateResolver(ctx, resolver.GetSelector(ctx)); err != nil { + if err := validateResolver(ctx, resolver); err != nil { panic(err.Error()) } return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl { @@ -60,7 +60,7 @@ func NewController(ctx context.Context, resolver Resolver, modifiers ...Reconcil } r := &Reconciler{ - LeaderAwareFuncs: LeaderAwareFuncs(rrInformer.Lister()), + LeaderAwareFuncs: leaderAwareFuncs(rrInformer.Lister()), kubeClientSet: kubeclientset, resolutionRequestLister: rrInformer.Lister(), resolutionRequestClientSet: rrclientset, @@ -82,7 +82,7 @@ func NewController(ctx context.Context, resolver Resolver, modifiers ...Reconcil }) _, err := rrInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ - FilterFunc: FilterResolutionRequestsBySelector(resolver.GetSelector(ctx)), + FilterFunc: filterResolutionRequestsBySelector(resolver.GetSelector(ctx)), Handler: cache.ResourceEventHandlerFuncs{ AddFunc: impl.Enqueue, UpdateFunc: func(oldObj, newObj interface{}) { @@ -101,35 +101,7 @@ func NewController(ctx context.Context, resolver Resolver, modifiers ...Reconcil } } -// watchConfigChanges binds a framework.Resolver to updates on its -// configmap, using knative's configmap helpers. This is only done if -// the resolver implements the framework.ConfigWatcher interface. -func watchConfigChanges(ctx context.Context, reconciler *Reconciler, cmw configmap.Watcher) { - if configWatcher, ok := reconciler.resolver.(ConfigWatcher); ok { - logger := logging.FromContext(ctx) - resolverConfigName := configWatcher.GetConfigName(ctx) - if resolverConfigName == "" { - panic("resolver returned empty config name") - } - reconciler.configStore = NewConfigStore(resolverConfigName, logger) - reconciler.configStore.WatchConfigs(cmw) - } -} - -// applyModifiersAndDefaults applies the given modifiers to -// a reconciler and, after doing so, sets any default values for things -// that weren't set by a modifier. -func applyModifiersAndDefaults(ctx context.Context, r *Reconciler, modifiers []ReconcilerModifier) { - for _, mod := range modifiers { - mod(r) - } - - if r.Clock == nil { - r.Clock = clock.RealClock{} - } -} - -func FilterResolutionRequestsBySelector(selector map[string]string) func(obj interface{}) bool { +func filterResolutionRequestsBySelector(selector map[string]string) func(obj interface{}) bool { return func(obj interface{}) bool { rr, ok := obj.(*v1beta1.ResolutionRequest) if !ok { @@ -155,7 +127,7 @@ func FilterResolutionRequestsBySelector(selector map[string]string) func(obj int // fact that the controller crashes if they're missing. It looks // like this is bucketing based on labels. Should we use the filter // selector from above in the call to lister.List here? -func LeaderAwareFuncs(lister rrlister.ResolutionRequestLister) reconciler.LeaderAwareFuncs { +func leaderAwareFuncs(lister rrlister.ResolutionRequestLister) reconciler.LeaderAwareFuncs { return reconciler.LeaderAwareFuncs{ PromoteFunc: func(bkt reconciler.Bucket, enq func(reconciler.Bucket, types.NamespacedName)) error { all, err := lister.List(labels.Everything()) @@ -184,7 +156,8 @@ var ( ErrorMissingTypeSelector = ErrMissingTypeSelector ) -func ValidateResolver(ctx context.Context, sel map[string]string) error { +func validateResolver(ctx context.Context, r Resolver) error { + sel := r.GetSelector(ctx) if sel == nil { return ErrMissingTypeSelector } @@ -193,3 +166,31 @@ func ValidateResolver(ctx context.Context, sel map[string]string) error { } return nil } + +// watchConfigChanges binds a framework.Resolver to updates on its +// configmap, using knative's configmap helpers. This is only done if +// the resolver implements the framework.ConfigWatcher interface. +func watchConfigChanges(ctx context.Context, reconciler *Reconciler, cmw configmap.Watcher) { + if configWatcher, ok := reconciler.resolver.(ConfigWatcher); ok { + logger := logging.FromContext(ctx) + resolverConfigName := configWatcher.GetConfigName(ctx) + if resolverConfigName == "" { + panic("resolver returned empty config name") + } + reconciler.configStore = NewConfigStore(resolverConfigName, logger) + reconciler.configStore.WatchConfigs(cmw) + } +} + +// applyModifiersAndDefaults applies the given modifiers to +// a reconciler and, after doing so, sets any default values for things +// that weren't set by a modifier. +func applyModifiersAndDefaults(ctx context.Context, r *Reconciler, modifiers []ReconcilerModifier) { + for _, mod := range modifiers { + mod(r) + } + + if r.Clock == nil { + r.Clock = clock.RealClock{} + } +} diff --git a/upstream/pkg/resolution/resolver/framework/fakeresolver.go b/upstream/pkg/resolution/resolver/framework/fakeresolver.go index b22349d6f56..0943199601b 100644 --- a/upstream/pkg/resolution/resolver/framework/fakeresolver.go +++ b/upstream/pkg/resolution/resolver/framework/fakeresolver.go @@ -103,10 +103,6 @@ func (r *FakeResolver) GetSelector(_ context.Context) map[string]string { // ValidateParams returns an error if the given parameter map is not // valid for a resource request targeting the fake resolver. func (r *FakeResolver) ValidateParams(_ context.Context, params []pipelinev1.Param) error { - return ValidateParams(params) -} - -func ValidateParams(params []pipelinev1.Param) error { paramsMap := make(map[string]pipelinev1.ParamValue) for _, p := range params { paramsMap[p.Name] = p.Value @@ -136,10 +132,6 @@ func ValidateParams(params []pipelinev1.Param) error { // Resolve performs the work of fetching a file from the fake resolver given a map of // parameters. func (r *FakeResolver) Resolve(_ context.Context, params []pipelinev1.Param) (ResolvedResource, error) { - return Resolve(params, r.ForParam) -} - -func Resolve(params []pipelinev1.Param, forParam map[string]*FakeResolvedResource) (ResolvedResource, error) { paramsMap := make(map[string]pipelinev1.ParamValue) for _, p := range params { paramsMap[p.Name] = p.Value @@ -147,7 +139,7 @@ func Resolve(params []pipelinev1.Param, forParam map[string]*FakeResolvedResourc paramValue := paramsMap[FakeParamName].StringVal - frr, ok := forParam[paramValue] + frr, ok := r.ForParam[paramValue] if !ok { return nil, fmt.Errorf("couldn't find resource for param value %s", paramValue) } @@ -166,14 +158,9 @@ func Resolve(params []pipelinev1.Param, forParam map[string]*FakeResolvedResourc var _ TimedResolution = &FakeResolver{} // GetResolutionTimeout returns the configured timeout for the reconciler, or the default time.Duration if not configured. -func (r *FakeResolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration, params map[string]string) (time.Duration, error) { - return GetResolutionTimeout(r.Timeout, defaultTimeout), nil -} - -// GetResolutionTimeout returns the input timeout if set to something greater than 0 or the default time.Duration if not configured. -func GetResolutionTimeout(timeout, defaultTimeout time.Duration) time.Duration { - if timeout > 0 { - return timeout +func (r *FakeResolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration) time.Duration { + if r.Timeout > 0 { + return r.Timeout } return defaultTimeout } diff --git a/upstream/pkg/resolution/resolver/framework/interface.go b/upstream/pkg/resolution/resolver/framework/interface.go index 89c1e897a77..33a9efab4d9 100644 --- a/upstream/pkg/resolution/resolver/framework/interface.go +++ b/upstream/pkg/resolution/resolver/framework/interface.go @@ -26,8 +26,6 @@ import ( // Resolver is the interface to implement for type-specific resource // resolution. It fetches resources from a given type of remote location // and returns their content along with any associated annotations. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework.Resolver] instead. type Resolver interface { // Initialize is called at the moment the resolver controller is // instantiated and is a good place to setup things like @@ -90,7 +88,7 @@ type TimedResolution interface { // object, which includes any request-scoped data like // resolver config and the request's originating namespace, // along with a default. - GetResolutionTimeout(ctx context.Context, timeout time.Duration, params map[string]string) (time.Duration, error) + GetResolutionTimeout(ctx context.Context, timeout time.Duration) time.Duration } // ResolvedResource returns the data and annotations of a successful diff --git a/upstream/pkg/resolution/resolver/framework/reconciler.go b/upstream/pkg/resolution/resolver/framework/reconciler.go index 314d801c2b1..b981ea6e02a 100644 --- a/upstream/pkg/resolution/resolver/framework/reconciler.go +++ b/upstream/pkg/resolution/resolver/framework/reconciler.go @@ -43,8 +43,6 @@ import ( // Reconciler handles ResolutionRequest objects, performs functionality // common to all resolvers and delegates resolver-specific actions // to its embedded type-specific Resolver object. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/framework.Reconciler] instead. type Reconciler struct { // Implements reconciler.LeaderAware reconciler.LeaderAwareFuncs @@ -109,18 +107,9 @@ func (r *Reconciler) resolve(ctx context.Context, key string, rr *v1beta1.Resolu errChan := make(chan error) resourceChan := make(chan ResolvedResource) - paramsMap := make(map[string]string) - for _, p := range rr.Spec.Params { - paramsMap[p.Name] = p.Value.StringVal - } - timeoutDuration := defaultMaximumResolutionDuration if timed, ok := r.resolver.(TimedResolution); ok { - var err error - timeoutDuration, err = timed.GetResolutionTimeout(ctx, defaultMaximumResolutionDuration, paramsMap) - if err != nil { - return err - } + timeoutDuration = timed.GetResolutionTimeout(ctx, defaultMaximumResolutionDuration) } // A new context is created for resolution so that timeouts can diff --git a/upstream/pkg/resolution/resolver/framework/reconciler_test.go b/upstream/pkg/resolution/resolver/framework/reconciler_test.go index e3164efed81..53b3bfb7a04 100644 --- a/upstream/pkg/resolution/resolver/framework/reconciler_test.go +++ b/upstream/pkg/resolution/resolver/framework/reconciler_test.go @@ -30,7 +30,7 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" + framework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" "github.com/tektoncd/pipeline/test/names" diff --git a/upstream/pkg/resolution/resolver/git/config.go b/upstream/pkg/resolution/resolver/git/config.go index 975166d637a..a085bdfac39 100644 --- a/upstream/pkg/resolution/resolver/git/config.go +++ b/upstream/pkg/resolution/resolver/git/config.go @@ -16,30 +16,21 @@ limitations under the License. package git -import ( - "context" - "fmt" - "reflect" - "strings" - - "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" -) - const ( - // DefaultTimeoutKey is the configuration field name for controlling + // defaultTimeoutKey is the configuration field name for controlling // the maximum duration of a resolution request for a file from git. - DefaultTimeoutKey = "fetch-timeout" + defaultTimeoutKey = "fetch-timeout" - // DefaultURLKey is the configuration field name for controlling + // defaultURLKey is the configuration field name for controlling // the git url to fetch the remote resource from. - DefaultURLKey = "default-url" + defaultURLKey = "default-url" - // DefaultRevisionKey is the configuration field name for controlling + // defaultRevisionKey is the configuration field name for controlling // the revision to fetch the remote resource from. - DefaultRevisionKey = "default-revision" + defaultRevisionKey = "default-revision" - // DefaultOrgKey is the configuration field name for setting a default organization when using the SCM API. - DefaultOrgKey = "default-org" + // defaultOrgKey is the configuration field name for setting a default organization when using the SCM API. + defaultOrgKey = "default-org" // ServerURLKey is the config map key for the SCM provider URL ServerURLKey = "server-url" @@ -52,55 +43,3 @@ const ( // APISecretNamespaceKey is the config map key for the token secret's namespace APISecretNamespaceKey = "api-token-secret-namespace" ) - -type GitResolverConfig map[string]ScmConfig - -type ScmConfig struct { - Timeout string `json:"fetch-timeout"` - URL string `json:"default-url"` - Revision string `json:"default-revision"` - Org string `json:"default-org"` - ServerURL string `json:"server-url"` - SCMType string `json:"scm-type"` - APISecretName string `json:"api-token-secret-name"` - APISecretKey string `json:"api-token-secret-key"` - APISecretNamespace string `json:"api-token-secret-namespace"` -} - -func GetGitResolverConfig(ctx context.Context) (GitResolverConfig, error) { - var scmConfig interface{} = &ScmConfig{} - structType := reflect.TypeOf(scmConfig).Elem() - gitResolverConfig := map[string]ScmConfig{} - conf := framework.GetResolverConfigFromContext(ctx) - for key, value := range conf { - var configIdentifier, configKey string - splittedKeyName := strings.Split(key, ".") - switch len(splittedKeyName) { - case 2: - configKey = splittedKeyName[1] - configIdentifier = splittedKeyName[0] - case 1: - configKey = key - configIdentifier = "default" - default: - return nil, fmt.Errorf("key %s passed in git resolver configmap is invalid", key) - } - _, ok := gitResolverConfig[configIdentifier] - if !ok { - gitResolverConfig[configIdentifier] = ScmConfig{} - } - for i := range structType.NumField() { - field := structType.Field(i) - fieldName := field.Name - jsonTag := field.Tag.Get("json") - if configKey == jsonTag { - tokenDetails := gitResolverConfig[configIdentifier] - var scm interface{} = &tokenDetails - structValue := reflect.ValueOf(scm).Elem() - structValue.FieldByName(fieldName).SetString(value) - gitResolverConfig[configIdentifier] = structValue.Interface().(ScmConfig) - } - } - } - return gitResolverConfig, nil -} diff --git a/upstream/pkg/resolution/resolver/git/config_test.go b/upstream/pkg/resolution/resolver/git/config_test.go deleted file mode 100644 index b3ec9504afd..00000000000 --- a/upstream/pkg/resolution/resolver/git/config_test.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 git - -import ( - "context" - "testing" - - "github.com/google/go-cmp/cmp" - resolutionframework "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" - "github.com/tektoncd/pipeline/test/diff" -) - -func TestGetGitResolverConfig(t *testing.T) { - tests := []struct { - name string - wantErr bool - expectedErr string - config map[string]string - expectedConfig GitResolverConfig - }{ - { - name: "no config", - config: map[string]string{}, - expectedConfig: GitResolverConfig{}, - }, - { - name: "default config", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - DefaultOrgKey: "tektoncd", - }, - expectedConfig: GitResolverConfig{ - "default": ScmConfig{ - URL: "https://github.com", - Revision: "main", - Org: "tektoncd", - }, - }, - }, - { - name: "default config with default key", - config: map[string]string{ - "default." + DefaultURLKey: "https://github.com", - "default." + DefaultRevisionKey: "main", - }, - expectedConfig: GitResolverConfig{ - "default": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - }, - }, - { - name: "config with custom key", - config: map[string]string{ - "test." + DefaultURLKey: "https://github.com", - "test." + DefaultRevisionKey: "main", - }, - expectedConfig: GitResolverConfig{ - "test": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - }, - }, - { - name: "config with custom key and no key", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github.com", - "test." + DefaultRevisionKey: "main", - }, - expectedConfig: GitResolverConfig{ - "default": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - "test": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - }, - }, - { - name: "config with both default and custom key", - config: map[string]string{ - "default." + DefaultURLKey: "https://github.com", - "default." + DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github.com", - "test." + DefaultRevisionKey: "main", - }, - expectedConfig: GitResolverConfig{ - "default": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - "test": ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - }, - }, - { - name: "config with invalid format", - config: map[string]string{ - "default.." + DefaultURLKey: "https://github.com", - }, - wantErr: true, - expectedErr: "key default..default-url passed in git resolver configmap is invalid", - expectedConfig: nil, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctx := resolutionframework.InjectResolverConfigToContext(context.Background(), tc.config) - gitResolverConfig, err := GetGitResolverConfig(ctx) - if tc.wantErr { - if err == nil { - t.Fatalf("unexpected error parsing git resolver config: %v", err) - } - if d := cmp.Diff(tc.expectedErr, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } - } - if d := cmp.Diff(tc.expectedConfig, gitResolverConfig); d != "" { - t.Errorf("expected config: %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/resolution/resolver/git/params.go b/upstream/pkg/resolution/resolver/git/params.go index d7cd114d8d6..679d0b0e9f5 100644 --- a/upstream/pkg/resolution/resolver/git/params.go +++ b/upstream/pkg/resolution/resolver/git/params.go @@ -16,29 +16,25 @@ limitations under the License. package git -import "github.com/tektoncd/pipeline/pkg/resolution/resource" - const ( - // UrlParam is the git repo Url when using the anonymous/full clone approach - UrlParam string = resource.ParamURL - // OrgParam is the organization to find the repository in when using the SCM API approach - OrgParam = "org" - // RepoParam is the repository to use when using the SCM API approach - RepoParam = "repo" - // PathParam is the pathInRepo into the git repo where a file is located. This is used with both approaches. - PathParam string = "pathInRepo" - // RevisionParam is the git revision that a file should be fetched from. This is used with both approaches. - RevisionParam string = "revision" - // TokenParam is an optional reference to a secret name for SCM API authentication - TokenParam string = "token" - // TokenKeyParam is an optional reference to a key in the TokenParam secret for SCM API authentication - TokenKeyParam string = "tokenKey" - // DefaultTokenKeyParam is the default key in the TokenParam secret for SCM API authentication - DefaultTokenKeyParam string = "token" - // scmTypeParam is an optional string overriding the scm-type configuration (ie: github, gitea, gitlab etc..) - ScmTypeParam string = "scmType" - // serverURLParam is an optional string to the server URL for the SCM API to connect to - ServerURLParam string = "serverURL" - // ConfigKeyParam is an optional string to provid which scm configuration to use from git resolver configmap - ConfigKeyParam string = "configKey" + // urlParam is the git repo url when using the anonymous/full clone approach + urlParam string = "url" + // orgParam is the organization to find the repository in when using the SCM API approach + orgParam = "org" + // repoParam is the repository to use when using the SCM API approach + repoParam = "repo" + // pathParam is the pathInRepo into the git repo where a file is located. This is used with both approaches. + pathParam string = "pathInRepo" + // revisionParam is the git revision that a file should be fetched from. This is used with both approaches. + revisionParam string = "revision" + // tokenParam is an optional reference to a secret name for SCM API authentication + tokenParam string = "token" + // tokenKeyParam is an optional reference to a key in the tokenParam secret for SCM API authentication + tokenKeyParam string = "tokenKey" + // defaultTokenKeyParam is the default key in the tokenParam secret for SCM API authentication + defaultTokenKeyParam string = "token" + // scmTypeParams is an optional string overriding the scm-type configuration (ie: github, gitea, gitlab etc..) + scmTypeParam string = "scmType" + // serverURLParams is an optional string to the server URL for the SCM API to connect to + serverURLParam string = "serverURL" ) diff --git a/upstream/pkg/resolution/resolver/git/resolver.go b/upstream/pkg/resolution/resolver/git/resolver.go index 73815e96bbb..34fcd6ad18f 100644 --- a/upstream/pkg/resolution/resolver/git/resolver.go +++ b/upstream/pkg/resolution/resolver/git/resolver.go @@ -36,7 +36,8 @@ import ( "github.com/jenkins-x/go-scm/scm/factory" resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" "go.uber.org/zap" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -73,8 +74,6 @@ const ( var _ framework.Resolver = &Resolver{} // Resolver implements a framework.Resolver that can fetch files from git. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/git.Resolver] instead. type Resolver struct { kubeClient kubernetes.Interface logger *zap.SugaredLogger @@ -107,45 +106,41 @@ func (r *Resolver) GetName(_ context.Context) string { // the gitresolver to process them. func (r *Resolver) GetSelector(_ context.Context) map[string]string { return map[string]string{ - common.LabelKeyResolverType: labelValueGitResolverType, + resolutioncommon.LabelKeyResolverType: labelValueGitResolverType, } } // ValidateParams returns an error if the given parameter map is not // valid for a resource request targeting the gitresolver. func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - return ValidateParams(ctx, params) + if r.isDisabled(ctx) { + return errors.New(disabledError) + } + + _, err := populateDefaultParams(ctx, params) + if err != nil { + return err + } + return nil } // Resolve performs the work of fetching a file from git given a map of // parameters. func (r *Resolver) Resolve(ctx context.Context, origParams []pipelinev1.Param) (framework.ResolvedResource, error) { - if IsDisabled(ctx) { + if r.isDisabled(ctx) { return nil, errors.New(disabledError) } - params, err := PopulateDefaultParams(ctx, origParams) + params, err := populateDefaultParams(ctx, origParams) if err != nil { return nil, err } - if params[UrlParam] != "" { - return ResolveAnonymousGit(ctx, params) + if params[urlParam] != "" { + return r.resolveAnonymousGit(ctx, params) } - return ResolveAPIGit(ctx, params, r.kubeClient, r.logger, r.cache, r.ttl, r.clientFunc) -} - -func ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - if IsDisabled(ctx) { - return errors.New(disabledError) - } - - _, err := PopulateDefaultParams(ctx, params) - if err != nil { - return err - } - return nil + return r.resolveAPIGit(ctx, params) } // validateRepoURL validates if the given URL is a valid git, http, https URL or @@ -157,22 +152,83 @@ func validateRepoURL(url string) bool { return re.MatchString(url) } -func ResolveAnonymousGit(ctx context.Context, params map[string]string) (framework.ResolvedResource, error) { - conf, err := GetScmConfigForParamConfigKey(ctx, params) +func (r *Resolver) resolveAPIGit(ctx context.Context, params map[string]string) (framework.ResolvedResource, error) { + // If we got here, the "repo" param was specified, so use the API approach + scmType, serverURL, err := r.getSCMTypeAndServerURL(ctx, params) if err != nil { return nil, err } - repo := params[UrlParam] + secretRef := &secretCacheKey{ + name: params[tokenParam], + key: params[tokenKeyParam], + } + if secretRef.name != "" { + if secretRef.key == "" { + secretRef.key = defaultTokenKeyParam + } + secretRef.ns = common.RequestNamespace(ctx) + } else { + secretRef = nil + } + apiToken, err := r.getAPIToken(ctx, secretRef) + if err != nil { + return nil, err + } + scmClient, err := r.clientFunc(scmType, serverURL, string(apiToken)) + if err != nil { + return nil, fmt.Errorf("failed to create SCM client: %w", err) + } + + orgRepo := fmt.Sprintf("%s/%s", params[orgParam], params[repoParam]) + path := params[pathParam] + ref := params[revisionParam] + + // fetch the actual content from a file in the repo + content, _, err := scmClient.Contents.Find(ctx, orgRepo, path, ref) + if err != nil { + return nil, fmt.Errorf("couldn't fetch resource content: %w", err) + } + if content == nil || len(content.Data) == 0 { + return nil, fmt.Errorf("no content for resource in %s %s", orgRepo, path) + } + + // find the actual git commit sha by the ref + commit, _, err := scmClient.Git.FindCommit(ctx, orgRepo, ref) + if err != nil || commit == nil { + return nil, fmt.Errorf("couldn't fetch the commit sha for the ref %s in the repo: %w", ref, err) + } + + // fetch the repository URL + repo, _, err := scmClient.Repositories.Find(ctx, orgRepo) + if err != nil { + return nil, fmt.Errorf("couldn't fetch repository: %w", err) + } + + return &resolvedGitResource{ + Content: content.Data, + Revision: commit.Sha, + Org: params[orgParam], + Repo: params[repoParam], + Path: content.Path, + URL: repo.Clone, + }, nil +} + +func (r *Resolver) resolveAnonymousGit(ctx context.Context, params map[string]string) (framework.ResolvedResource, error) { + conf := framework.GetResolverConfigFromContext(ctx) + repo := params[urlParam] if repo == "" { - urlString := conf.URL - if urlString == "" { + if urlString, ok := conf[defaultURLKey]; ok { + repo = urlString + } else { return nil, errors.New("default Git Repo Url was not set during installation of the git resolver") } } - revision := params[RevisionParam] + revision := params[revisionParam] if revision == "" { - revisionString := conf.Revision - if revisionString == "" { + if revisionString, ok := conf[defaultRevisionKey]; ok { + revision = revisionString + } else { return nil, errors.New("default Git Revision was not set during installation of the git resolver") } } @@ -215,7 +271,7 @@ func ResolveAnonymousGit(ctx context.Context, params map[string]string) (framewo return nil, fmt.Errorf("checkout error: %w", err) } - path := params[PathParam] + path := params[pathParam] f, err := filesystem.Open(path) if err != nil { @@ -231,8 +287,8 @@ func ResolveAnonymousGit(ctx context.Context, params map[string]string) (framewo return &resolvedGitResource{ Revision: h.String(), Content: buf.Bytes(), - URL: params[UrlParam], - Path: params[PathParam], + URL: params[urlParam], + Path: params[pathParam], }, nil } @@ -248,87 +304,20 @@ var _ framework.TimedResolution = &Resolver{} // GetResolutionTimeout returns a time.Duration for the amount of time a // single git fetch may take. This can be configured with the // fetch-timeout field in the git-resolver-config configmap. -func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration, params map[string]string) (time.Duration, error) { - conf, err := GetScmConfigForParamConfigKey(ctx, params) - if err != nil { - return time.Duration(0), err - } - if timeoutString := conf.Timeout; timeoutString != "" { +func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration) time.Duration { + conf := framework.GetResolverConfigFromContext(ctx) + if timeoutString, ok := conf[defaultTimeoutKey]; ok { timeout, err := time.ParseDuration(timeoutString) - if err != nil { - return time.Duration(0), err + if err == nil { + return timeout } - return timeout, nil } - return defaultTimeout, nil + return defaultTimeout } -func PopulateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { - paramsMap := make(map[string]string) - for _, p := range params { - paramsMap[p.Name] = p.Value.StringVal - } - - conf, err := GetScmConfigForParamConfigKey(ctx, paramsMap) - if err != nil { - return nil, err - } - - var missingParams []string - - if _, ok := paramsMap[RevisionParam]; !ok { - defaultRevision := conf.Revision - if defaultRevision != "" { - paramsMap[RevisionParam] = defaultRevision - } else { - missingParams = append(missingParams, RevisionParam) - } - } - if _, ok := paramsMap[PathParam]; !ok { - missingParams = append(missingParams, PathParam) - } - - if paramsMap[UrlParam] != "" && paramsMap[RepoParam] != "" { - return nil, fmt.Errorf("cannot specify both '%s' and '%s'", UrlParam, RepoParam) - } - - if paramsMap[UrlParam] == "" && paramsMap[RepoParam] == "" { - urlString := conf.URL - if urlString != "" { - paramsMap[UrlParam] = urlString - } else { - return nil, fmt.Errorf("must specify one of '%s' or '%s'", UrlParam, RepoParam) - } - } - - if paramsMap[RepoParam] != "" { - if _, ok := paramsMap[OrgParam]; !ok { - defaultOrg := conf.Org - if defaultOrg != "" { - paramsMap[OrgParam] = defaultOrg - } else { - return nil, fmt.Errorf("'%s' is required when '%s' is specified", OrgParam, RepoParam) - } - } - } - if len(missingParams) > 0 { - return nil, fmt.Errorf("missing required git resolver params: %s", strings.Join(missingParams, ", ")) - } - - // validate the url params if we are not using the SCM API - if paramsMap[RepoParam] == "" && paramsMap[OrgParam] == "" && !validateRepoURL(paramsMap[UrlParam]) { - return nil, fmt.Errorf("invalid git repository url: %s", paramsMap[UrlParam]) - } - - // TODO(sbwsg): validate pathInRepo is valid relative pathInRepo - return paramsMap, nil -} - -// supports the SPDX format which is recommended by in-toto -// ref: https://spdx.dev/spdx-specification-21-web-version/#h.49x2ik5 -// ref: https://github.com/in-toto/attestation/blob/main/spec/field_types.md -func spdxGit(url string) string { - return "git+" + url +func (r *Resolver) isDisabled(ctx context.Context) bool { + cfg := resolverconfig.FromContextOrDefaults(ctx) + return !cfg.FeatureFlags.EnableGitResolver } // resolvedGitResource implements framework.ResolvedResource and returns @@ -353,10 +342,10 @@ func (r *resolvedGitResource) Data() []byte { // from git. func (r *resolvedGitResource) Annotations() map[string]string { m := map[string]string{ - AnnotationKeyRevision: r.Revision, - AnnotationKeyPath: r.Path, - AnnotationKeyURL: r.URL, - common.AnnotationKeyContentType: yamlContentType, + AnnotationKeyRevision: r.Revision, + AnnotationKeyPath: r.Path, + AnnotationKeyURL: r.URL, + resolutioncommon.AnnotationKeyContentType: yamlContentType, } if r.Org != "" { @@ -387,73 +376,35 @@ type secretCacheKey struct { key string } -func ResolveAPIGit(ctx context.Context, params map[string]string, kubeclient kubernetes.Interface, logger *zap.SugaredLogger, cache *cache.LRUExpireCache, ttl time.Duration, clientFunc func(string, string, string, ...factory.ClientOptionFunc) (*scm.Client, error)) (framework.ResolvedResource, error) { - // If we got here, the "repo" param was specified, so use the API approach - scmType, serverURL, err := getSCMTypeAndServerURL(ctx, params) - if err != nil { - return nil, err - } - secretRef := &secretCacheKey{ - name: params[TokenParam], - key: params[TokenKeyParam], - } - if secretRef.name != "" { - if secretRef.key == "" { - secretRef.key = DefaultTokenKeyParam - } - secretRef.ns = common.RequestNamespace(ctx) - } else { - secretRef = nil - } - apiToken, err := getAPIToken(ctx, secretRef, kubeclient, logger, cache, ttl, params) - if err != nil { - return nil, err - } - scmClient, err := clientFunc(scmType, serverURL, string(apiToken)) - if err != nil { - return nil, fmt.Errorf("failed to create SCM client: %w", err) - } +func (r *Resolver) getSCMTypeAndServerURL(ctx context.Context, params map[string]string) (string, string, error) { + conf := framework.GetResolverConfigFromContext(ctx) - orgRepo := fmt.Sprintf("%s/%s", params[OrgParam], params[RepoParam]) - path := params[PathParam] - ref := params[RevisionParam] - - // fetch the actual content from a file in the repo - content, _, err := scmClient.Contents.Find(ctx, orgRepo, path, ref) - if err != nil { - return nil, fmt.Errorf("couldn't fetch resource content: %w", err) + var scmType, serverURL string + if key, ok := params[scmTypeParam]; ok { + scmType = key } - if content == nil || len(content.Data) == 0 { - return nil, fmt.Errorf("no content for resource in %s %s", orgRepo, path) + if scmType == "" { + if key, ok := conf[SCMTypeKey]; ok && scmType == "" { + scmType = key + } else { + return "", "", fmt.Errorf("missing or empty %s value in configmap", SCMTypeKey) + } } - - // find the actual git commit sha by the ref - commit, _, err := scmClient.Git.FindCommit(ctx, orgRepo, ref) - if err != nil || commit == nil { - return nil, fmt.Errorf("couldn't fetch the commit sha for the ref %s in the repo: %w", ref, err) + if key, ok := params[serverURLParam]; ok { + serverURL = key } - - // fetch the repository URL - repo, _, err := scmClient.Repositories.Find(ctx, orgRepo) - if err != nil { - return nil, fmt.Errorf("couldn't fetch repository: %w", err) + if serverURL == "" { + if key, ok := conf[ServerURLKey]; ok && serverURL == "" { + serverURL = key + } else { + return "", "", fmt.Errorf("missing or empty %s value in configmap", ServerURLKey) + } } - - return &resolvedGitResource{ - Content: content.Data, - Revision: commit.Sha, - Org: params[OrgParam], - Repo: params[RepoParam], - Path: content.Path, - URL: repo.Clone, - }, nil + return scmType, serverURL, nil } -func getAPIToken(ctx context.Context, apiSecret *secretCacheKey, kubeclient kubernetes.Interface, logger *zap.SugaredLogger, cache *cache.LRUExpireCache, ttl time.Duration, params map[string]string) ([]byte, error) { - conf, err := GetScmConfigForParamConfigKey(ctx, params) - if err != nil { - return nil, err - } +func (r *Resolver) getAPIToken(ctx context.Context, apiSecret *secretCacheKey) ([]byte, error) { + conf := framework.GetResolverConfigFromContext(ctx) ok := false @@ -465,96 +416,114 @@ func getAPIToken(ctx context.Context, apiSecret *secretCacheKey, kubeclient kube } if apiSecret.name == "" { - apiSecret.name = conf.APISecretName - if apiSecret.name == "" { - err := fmt.Errorf("cannot get API token, required when specifying '%s' param, '%s' not specified in config", RepoParam, APISecretNameKey) - logger.Info(err) + if apiSecret.name, ok = conf[APISecretNameKey]; !ok || apiSecret.name == "" { + err := fmt.Errorf("cannot get API token, required when specifying '%s' param, '%s' not specified in config", repoParam, APISecretNameKey) + r.logger.Info(err) return nil, err } } if apiSecret.key == "" { - apiSecret.key = conf.APISecretKey - if apiSecret.key == "" { - err := fmt.Errorf("cannot get API token, required when specifying '%s' param, '%s' not specified in config", RepoParam, APISecretKeyKey) - logger.Info(err) + if apiSecret.key, ok = conf[APISecretKeyKey]; !ok || apiSecret.key == "" { + err := fmt.Errorf("cannot get API token, required when specifying '%s' param, '%s' not specified in config", repoParam, APISecretKeyKey) + r.logger.Info(err) return nil, err } } if apiSecret.ns == "" { - apiSecret.ns = conf.APISecretNamespace - if apiSecret.ns == "" { + if apiSecret.ns, ok = conf[APISecretNamespaceKey]; !ok { apiSecret.ns = os.Getenv("SYSTEM_NAMESPACE") } } if cacheSecret { - val, ok := cache.Get(apiSecret) + val, ok := r.cache.Get(apiSecret) if ok { return val.([]byte), nil } } - secret, err := kubeclient.CoreV1().Secrets(apiSecret.ns).Get(ctx, apiSecret.name, metav1.GetOptions{}) + secret, err := r.kubeClient.CoreV1().Secrets(apiSecret.ns).Get(ctx, apiSecret.name, metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { notFoundErr := fmt.Errorf("cannot get API token, secret %s not found in namespace %s", apiSecret.name, apiSecret.ns) - logger.Info(notFoundErr) + r.logger.Info(notFoundErr) return nil, notFoundErr } wrappedErr := fmt.Errorf("error reading API token from secret %s in namespace %s: %w", apiSecret.name, apiSecret.ns, err) - logger.Info(wrappedErr) + r.logger.Info(wrappedErr) return nil, wrappedErr } secretVal, ok := secret.Data[apiSecret.key] if !ok { err := fmt.Errorf("cannot get API token, key %s not found in secret %s in namespace %s", apiSecret.key, apiSecret.name, apiSecret.ns) - logger.Info(err) + r.logger.Info(err) return nil, err } if cacheSecret { - cache.Add(apiSecret, secretVal, ttl) + r.cache.Add(apiSecret, secretVal, r.ttl) } return secretVal, nil } -func getSCMTypeAndServerURL(ctx context.Context, params map[string]string) (string, string, error) { - conf, err := GetScmConfigForParamConfigKey(ctx, params) - if err != nil { - return "", "", err - } +func populateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { + conf := framework.GetResolverConfigFromContext(ctx) - var scmType, serverURL string - if key, ok := params[ScmTypeParam]; ok { - scmType = key - } - if scmType == "" { - scmType = conf.SCMType + paramsMap := make(map[string]string) + for _, p := range params { + paramsMap[p.Name] = p.Value.StringVal } - if key, ok := params[ServerURLParam]; ok { - serverURL = key + + var missingParams []string + + if _, ok := paramsMap[revisionParam]; !ok { + if defaultRevision, ok := conf[defaultRevisionKey]; ok { + paramsMap[revisionParam] = defaultRevision + } else { + missingParams = append(missingParams, revisionParam) + } } - if serverURL == "" { - serverURL = conf.ServerURL + if _, ok := paramsMap[pathParam]; !ok { + missingParams = append(missingParams, pathParam) } - return scmType, serverURL, nil -} -func IsDisabled(ctx context.Context) bool { - cfg := resolverconfig.FromContextOrDefaults(ctx) - return !cfg.FeatureFlags.EnableGitResolver -} + if paramsMap[urlParam] != "" && paramsMap[repoParam] != "" { + return nil, fmt.Errorf("cannot specify both '%s' and '%s'", urlParam, repoParam) + } -func GetScmConfigForParamConfigKey(ctx context.Context, params map[string]string) (ScmConfig, error) { - gitResolverConfig, err := GetGitResolverConfig(ctx) - if err != nil { - return ScmConfig{}, err + if paramsMap[urlParam] == "" && paramsMap[repoParam] == "" { + if urlString, ok := conf[defaultURLKey]; ok { + paramsMap[urlParam] = urlString + } else { + return nil, fmt.Errorf("must specify one of '%s' or '%s'", urlParam, repoParam) + } } - if configKeyToUse, ok := params[ConfigKeyParam]; ok { - if config, exist := gitResolverConfig[configKeyToUse]; exist { - return config, nil + + if paramsMap[repoParam] != "" { + if _, ok := paramsMap[orgParam]; !ok { + if defaultOrg, ok := conf[defaultOrgKey]; ok { + paramsMap[orgParam] = defaultOrg + } else { + return nil, fmt.Errorf("'%s' is required when '%s' is specified", orgParam, repoParam) + } } - return ScmConfig{}, fmt.Errorf("no git resolver configuration found for configKey %s", configKeyToUse) } - return gitResolverConfig["default"], nil + if len(missingParams) > 0 { + return nil, fmt.Errorf("missing required git resolver params: %s", strings.Join(missingParams, ", ")) + } + + // validate the url params if we are not using the SCM API + if paramsMap[repoParam] == "" && paramsMap[orgParam] == "" && !validateRepoURL(paramsMap[urlParam]) { + return nil, fmt.Errorf("invalid git repository url: %s", paramsMap[urlParam]) + } + + // TODO(sbwsg): validate pathInRepo is valid relative pathInRepo + return paramsMap, nil +} + +// supports the SPDX format which is recommended by in-toto +// ref: https://spdx.dev/spdx-specification-21-web-version/#h.49x2ik5 +// ref: https://github.com/in-toto/attestation/blob/main/spec/field_types.md +func spdxGit(url string) string { + return "git+" + url } diff --git a/upstream/pkg/resolution/resolver/git/resolver_test.go b/upstream/pkg/resolution/resolver/git/resolver_test.go index 9001ab27cbe..a9f4c0490d9 100644 --- a/upstream/pkg/resolution/resolver/git/resolver_test.go +++ b/upstream/pkg/resolution/resolver/git/resolver_test.go @@ -36,11 +36,11 @@ import ( resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" frtesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/internal" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" @@ -52,7 +52,7 @@ import ( func TestGetSelector(t *testing.T) { resolver := Resolver{} sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { + if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { t.Fatalf("unexpected selector: %v", sel) } else if typ != labelValueGitResolverType { t.Fatalf("unexpected type: %q", typ) @@ -68,57 +68,57 @@ func TestValidateParams(t *testing.T) { { name: "params with revision", params: map[string]string{ - UrlParam: "http://foo/bar/hello/moto", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "http://foo/bar/hello/moto", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "https url", params: map[string]string{ - UrlParam: "https://foo/bar/hello/moto", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "https://foo/bar/hello/moto", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "https url with username password", params: map[string]string{ - UrlParam: "https://user:pass@foo/bar/hello/moto", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "https://user:pass@foo/bar/hello/moto", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "git server url", params: map[string]string{ - UrlParam: "git://repo/hello/moto", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "git://repo/hello/moto", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "git url from a local repository", params: map[string]string{ - UrlParam: "/tmp/repo", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "/tmp/repo", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "git url from a git ssh repository", params: map[string]string{ - UrlParam: "git@host.com:foo/bar", - PathParam: "bar", - RevisionParam: "baz", + urlParam: "git@host.com:foo/bar", + pathParam: "bar", + revisionParam: "baz", }, }, { name: "bad url", params: map[string]string{ - UrlParam: "foo://bar", - PathParam: "path", - RevisionParam: "revision", + urlParam: "foo://bar", + pathParam: "path", + revisionParam: "revision", }, wantErr: "invalid git repository url: foo://bar", }, @@ -147,8 +147,8 @@ func TestValidateParamsNotEnabled(t *testing.T) { var err error someParams := map[string]string{ - PathParam: "bar", - RevisionParam: "baz", + pathParam: "bar", + revisionParam: "baz", } err = resolver.ValidateParams(resolverDisabledContext(), toParams(someParams)) if err == nil { @@ -168,32 +168,32 @@ func TestValidateParams_Failure(t *testing.T) { { name: "missing multiple", params: map[string]string{ - OrgParam: "abcd1234", - RepoParam: "foo", + orgParam: "abcd1234", + repoParam: "foo", }, - expectedErr: fmt.Sprintf("missing required git resolver params: %s, %s", RevisionParam, PathParam), + expectedErr: fmt.Sprintf("missing required git resolver params: %s, %s", revisionParam, pathParam), }, { name: "no repo or url", params: map[string]string{ - RevisionParam: "abcd1234", - PathParam: "/foo/bar", + revisionParam: "abcd1234", + pathParam: "/foo/bar", }, expectedErr: "must specify one of 'url' or 'repo'", }, { name: "both repo and url", params: map[string]string{ - RevisionParam: "abcd1234", - PathParam: "/foo/bar", - UrlParam: "http://foo", - RepoParam: "foo", + revisionParam: "abcd1234", + pathParam: "/foo/bar", + urlParam: "http://foo", + repoParam: "foo", }, expectedErr: "cannot specify both 'url' and 'repo'", }, { name: "no org with repo", params: map[string]string{ - RevisionParam: "abcd1234", - PathParam: "/foo/bar", - RepoParam: "foo", + revisionParam: "abcd1234", + pathParam: "/foo/bar", + repoParam: "foo", }, expectedErr: "'org' is required when 'repo' is specified", }, @@ -216,10 +216,7 @@ func TestValidateParams_Failure(t *testing.T) { func TestGetResolutionTimeoutDefault(t *testing.T) { resolver := Resolver{} defaultTimeout := 30 * time.Minute - timeout, err := resolver.GetResolutionTimeout(context.Background(), defaultTimeout, map[string]string{}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } + timeout := resolver.GetResolutionTimeout(context.Background(), defaultTimeout) if timeout != defaultTimeout { t.Fatalf("expected default timeout to be returned") } @@ -230,45 +227,23 @@ func TestGetResolutionTimeoutCustom(t *testing.T) { defaultTimeout := 30 * time.Minute configTimeout := 5 * time.Second config := map[string]string{ - DefaultTimeoutKey: configTimeout.String(), + defaultTimeoutKey: configTimeout.String(), } ctx := framework.InjectResolverConfigToContext(context.Background(), config) - timeout, err := resolver.GetResolutionTimeout(ctx, defaultTimeout, map[string]string{}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } + timeout := resolver.GetResolutionTimeout(ctx, defaultTimeout) if timeout != configTimeout { t.Fatalf("expected timeout from config to be returned") } } -func TestGetResolutionTimeoutCustomIdentifier(t *testing.T) { - resolver := Resolver{} - defaultTimeout := 30 * time.Minute - configTimeout := 5 * time.Second - identifierConfigTImeout := 10 * time.Second - config := map[string]string{ - DefaultTimeoutKey: configTimeout.String(), - "foo." + DefaultTimeoutKey: identifierConfigTImeout.String(), - } - ctx := framework.InjectResolverConfigToContext(context.Background(), config) - timeout, err := resolver.GetResolutionTimeout(ctx, defaultTimeout, map[string]string{"configKey": "foo"}) - if err != nil { - t.Fatalf("couldn't get default-timeout: %v", err) - } - if timeout != identifierConfigTImeout { - t.Fatalf("expected timeout from config to be returned") - } -} - func TestResolveNotEnabled(t *testing.T) { resolver := Resolver{} var err error someParams := map[string]string{ - PathParam: "bar", - RevisionParam: "baz", + pathParam: "bar", + revisionParam: "baz", } _, err = resolver.Resolve(resolverDisabledContext(), toParams(someParams)) if err == nil { @@ -290,7 +265,6 @@ type params struct { namespace string serverURL string scmType string - configKey string } func TestResolve(t *testing.T) { @@ -367,7 +341,6 @@ func TestResolve(t *testing.T) { expectedCommitSHA string expectedStatus *v1beta1.ResolutionRequestStatus expectedErr error - configIdentifer string }{{ name: "clone: default revision main", args: ¶ms{ @@ -375,7 +348,7 @@ func TestResolve(t *testing.T) { url: anonFakeRepoURL, }, expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), }, { name: "clone: revision is tag name", args: ¶ms{ @@ -384,7 +357,7 @@ func TestResolve(t *testing.T) { url: anonFakeRepoURL, }, expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), }, { name: "clone: revision is the full tag name i.e. refs/tags/v1", args: ¶ms{ @@ -393,7 +366,7 @@ func TestResolve(t *testing.T) { url: anonFakeRepoURL, }, expectedCommitSHA: commitSHAsInAnonRepo[2], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte("released content in main branch and in tag v1")), }, { name: "clone: revision is a branch name", args: ¶ms{ @@ -402,7 +375,7 @@ func TestResolve(t *testing.T) { url: anonFakeRepoURL, }, expectedCommitSHA: commitSHAsInAnonRepo[1], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("new content in test branch")), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte("new content in test branch")), }, { name: "clone: revision is a specific commit sha", args: ¶ms{ @@ -411,7 +384,7 @@ func TestResolve(t *testing.T) { url: anonFakeRepoURL, }, expectedCommitSHA: commitSHAsInAnonRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte("old content in test branch")), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte("old content in test branch")), }, { name: "clone: file does not exist", args: ¶ms{ @@ -444,7 +417,7 @@ func TestResolve(t *testing.T) { }, apiToken: "some-token", expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(mainTaskYAML), }, { name: "api: successful task", args: ¶ms{ @@ -462,47 +435,7 @@ func TestResolve(t *testing.T) { }, apiToken: "some-token", expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful task from params api information with identifier", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - token: "token-secret", - tokenKey: "token", - namespace: "foo", - configKey: "test", - }, - config: map[string]string{ - "test." + ServerURLKey: "fake", - "test." + SCMTypeKey: "fake", - }, - configIdentifer: "test.", - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), - }, { - name: "api: successful task with identifier", - args: ¶ms{ - revision: "main", - pathInRepo: "tasks/example-task.yaml", - org: testOrg, - repo: testRepo, - configKey: "test", - }, - config: map[string]string{ - "test." + ServerURLKey: "fake", - "test." + SCMTypeKey: "fake", - "test." + APISecretNameKey: "token-secret", - "test." + APISecretKeyKey: "token", - "test." + APISecretNamespaceKey: system.Namespace(), - }, - configIdentifer: "test.", - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(mainTaskYAML), }, { name: "api: successful pipeline", args: ¶ms{ @@ -520,7 +453,7 @@ func TestResolve(t *testing.T) { }, apiToken: "some-token", expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainPipelineYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(mainPipelineYAML), }, { name: "api: successful pipeline with default revision", args: ¶ms{ @@ -534,11 +467,11 @@ func TestResolve(t *testing.T) { APISecretNameKey: "token-secret", APISecretKeyKey: "token", APISecretNamespaceKey: system.Namespace(), - DefaultRevisionKey: "other", + defaultRevisionKey: "other", }, apiToken: "some-token", expectedCommitSHA: commitSHAsInSCMRepo[1], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(otherPipelineYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(otherPipelineYAML), }, { name: "api: successful override scm type and server URL from user params", @@ -559,7 +492,7 @@ func TestResolve(t *testing.T) { }, apiToken: "some-token", expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainTaskYAML), + expectedStatus: internal.CreateResolutionRequestStatusWithData(mainTaskYAML), }, { name: "api: file does not exist", args: ¶ms{ @@ -576,7 +509,7 @@ func TestResolve(t *testing.T) { APISecretNamespaceKey: system.Namespace(), }, apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErr: createError("couldn't fetch resource content: file testdata/test-org/test-repo/refs/main/pipelines/other-pipeline.yaml does not exist: stat testdata/test-org/test-repo/refs/main/pipelines/other-pipeline.yaml: no such file or directory"), }, { name: "api: token not found", @@ -593,7 +526,7 @@ func TestResolve(t *testing.T) { APISecretKeyKey: "token", APISecretNamespaceKey: system.Namespace(), }, - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErr: createError("cannot get API token, secret token-secret not found in namespace " + system.Namespace()), }, { name: "api: token secret name not specified", @@ -610,7 +543,7 @@ func TestResolve(t *testing.T) { APISecretNamespaceKey: system.Namespace(), }, apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErr: createError("cannot get API token, required when specifying 'repo' param, 'api-token-secret-name' not specified in config"), }, { name: "api: token secret key not specified", @@ -627,7 +560,7 @@ func TestResolve(t *testing.T) { APISecretNamespaceKey: system.Namespace(), }, apiToken: "some-token", - expectedStatus: resolution.CreateResolutionRequestFailureStatus(), + expectedStatus: internal.CreateResolutionRequestFailureStatus(), expectedErr: createError("cannot get API token, required when specifying 'repo' param, 'api-token-secret-key' not specified in config"), }, { name: "api: SCM type not specified", @@ -642,9 +575,9 @@ func TestResolve(t *testing.T) { APISecretKeyKey: "token", APISecretNamespaceKey: system.Namespace(), }, - apiToken: "some-token", - expectedCommitSHA: commitSHAsInSCMRepo[0], - expectedStatus: resolution.CreateResolutionRequestStatusWithData(mainPipelineYAML), + apiToken: "some-token", + expectedStatus: internal.CreateResolutionRequestFailureStatus(), + expectedErr: createError("missing or empty scm-type value in configmap"), }} for _, tc := range testCases { @@ -655,9 +588,9 @@ func TestResolve(t *testing.T) { if cfg == nil { cfg = make(map[string]string) } - cfg[tc.configIdentifer+DefaultTimeoutKey] = "1m" - if cfg[tc.configIdentifer+DefaultRevisionKey] == "" { - cfg[tc.configIdentifer+DefaultRevisionKey] = plumbing.Master.Short() + cfg[defaultTimeoutKey] = "1m" + if cfg[defaultRevisionKey] == "" { + cfg[defaultRevisionKey] = plumbing.Master.Short() } request := createRequest(tc.args) @@ -690,7 +623,7 @@ func TestResolve(t *testing.T) { if expectedStatus.Annotations == nil { expectedStatus.Annotations = make(map[string]string) } - expectedStatus.Annotations[common.AnnotationKeyContentType] = "application/x-yaml" + expectedStatus.Annotations[resolutioncommon.AnnotationKeyContentType] = "application/x-yaml" expectedStatus.Annotations[AnnotationKeyRevision] = tc.expectedCommitSHA expectedStatus.Annotations[AnnotationKeyPath] = tc.args.pathInRepo @@ -718,8 +651,8 @@ func TestResolve(t *testing.T) { frtesting.RunResolverReconcileTest(ctx, t, d, resolver, request, expectedStatus, tc.expectedErr, func(resolver framework.Resolver, testAssets test.Assets) { var secretName, secretNameKey, secretNamespace string - if tc.config[tc.configIdentifer+APISecretNameKey] != "" && tc.config[tc.configIdentifer+APISecretNamespaceKey] != "" && tc.config[tc.configIdentifer+APISecretKeyKey] != "" && tc.apiToken != "" { - secretName, secretNameKey, secretNamespace = tc.config[tc.configIdentifer+APISecretNameKey], tc.config[tc.configIdentifer+APISecretKeyKey], tc.config[tc.configIdentifer+APISecretNamespaceKey] + if tc.config[APISecretNameKey] != "" && tc.config[APISecretNamespaceKey] != "" && tc.config[APISecretKeyKey] != "" && tc.apiToken != "" { + secretName, secretNameKey, secretNamespace = tc.config[APISecretNameKey], tc.config[APISecretKeyKey], tc.config[APISecretNamespaceKey] } if tc.args.token != "" && tc.args.namespace != "" && tc.args.tokenKey != "" { secretName, secretNameKey, secretNamespace = tc.args.token, tc.args.tokenKey, tc.args.namespace @@ -886,12 +819,12 @@ func createRequest(args *params) *v1beta1.ResolutionRequest { Namespace: "foo", CreationTimestamp: metav1.Time{Time: time.Now()}, Labels: map[string]string{ - common.LabelKeyResolverType: labelValueGitResolverType, + resolutioncommon.LabelKeyResolverType: labelValueGitResolverType, }, }, Spec: v1beta1.ResolutionRequestSpec{ Params: []pipelinev1.Param{{ - Name: PathParam, + Name: pathParam, Value: *pipelinev1.NewStructuredValues(args.pathInRepo), }}, }, @@ -899,57 +832,50 @@ func createRequest(args *params) *v1beta1.ResolutionRequest { if args.revision != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: RevisionParam, + Name: revisionParam, Value: *pipelinev1.NewStructuredValues(args.revision), }) } if args.serverURL != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: ServerURLParam, + Name: serverURLParam, Value: *pipelinev1.NewStructuredValues(args.serverURL), }) } if args.scmType != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: ScmTypeParam, + Name: scmTypeParam, Value: *pipelinev1.NewStructuredValues(args.scmType), }) } if args.url != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: UrlParam, + Name: urlParam, Value: *pipelinev1.NewStructuredValues(args.url), }) } else { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: RepoParam, + Name: repoParam, Value: *pipelinev1.NewStructuredValues(args.repo), }) rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: OrgParam, + Name: orgParam, Value: *pipelinev1.NewStructuredValues(args.org), }) if args.token != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: TokenParam, + Name: tokenParam, Value: *pipelinev1.NewStructuredValues(args.token), }) rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: TokenKeyParam, + Name: tokenKeyParam, Value: *pipelinev1.NewStructuredValues(args.tokenKey), }) } } - if args.configKey != "" { - rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: ConfigKeyParam, - Value: *pipelinev1.NewStructuredValues(args.configKey), - }) - } - return rr } @@ -958,7 +884,7 @@ func resolverDisabledContext() context.Context { } func createError(msg string) error { - return &common.GetResourceError{ + return &resolutioncommon.GetResourceError{ ResolverName: gitResolverName, Key: "foo/rr", Original: errors.New(msg), @@ -977,185 +903,3 @@ func toParams(m map[string]string) []pipelinev1.Param { return params } - -func TestGetScmConfigForParamConfigKey(t *testing.T) { - tests := []struct { - name string - wantErr bool - expectedErr string - config map[string]string - expectedConfig ScmConfig - params map[string]string - }{ - { - name: "no config", - config: map[string]string{}, - expectedConfig: ScmConfig{}, - }, - { - name: "default config", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - DefaultOrgKey: "tektoncd", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - Org: "tektoncd", - }, - }, - { - name: "default config with default key", - config: map[string]string{ - "default." + DefaultURLKey: "https://github.com", - "default." + DefaultRevisionKey: "main", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - }, - { - name: "default config with default key and default param", - config: map[string]string{ - "default." + DefaultURLKey: "https://github.com", - "default." + DefaultRevisionKey: "main", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - params: map[string]string{ - ConfigKeyParam: "default", - }, - }, - { - name: "config with custom key", - config: map[string]string{ - "test." + DefaultURLKey: "https://github.com", - "test." + DefaultRevisionKey: "main", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - params: map[string]string{ - ConfigKeyParam: "test", - }, - }, - { - name: "config with custom key and no param", - config: map[string]string{ - "test." + DefaultURLKey: "https://github.com", - "test." + DefaultRevisionKey: "main", - }, - expectedConfig: ScmConfig{}, - }, - { - name: "config with custom key and no key and param default", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github1.com", - "test." + DefaultRevisionKey: "main1", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - params: map[string]string{ - ConfigKeyParam: "default", - }, - }, - { - name: "config with custom key and no key and param test", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github1.com", - "test." + DefaultRevisionKey: "main1", - }, - expectedConfig: ScmConfig{ - URL: "https://github1.com", - Revision: "main1", - }, - params: map[string]string{ - ConfigKeyParam: "test", - }, - }, - { - name: "config with both default and custom key and param default", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github1.com", - "test." + DefaultRevisionKey: "main1", - }, - expectedConfig: ScmConfig{ - URL: "https://github.com", - Revision: "main", - }, - params: map[string]string{ - ConfigKeyParam: "default", - }, - }, - { - name: "config with both default and custom key and param test", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github1.com", - "test." + DefaultRevisionKey: "main1", - }, - expectedConfig: ScmConfig{ - URL: "https://github1.com", - Revision: "main1", - }, - params: map[string]string{ - ConfigKeyParam: "test", - }, - }, - { - name: "config with both default and custom key and param test2", - config: map[string]string{ - DefaultURLKey: "https://github.com", - DefaultRevisionKey: "main", - "test." + DefaultURLKey: "https://github1.com", - "test." + DefaultRevisionKey: "main1", - }, - expectedConfig: ScmConfig{}, - params: map[string]string{ - ConfigKeyParam: "test2", - }, - wantErr: true, - expectedErr: "no git resolver configuration found for configKey test2", - }, - { - name: "config with invalid format", - config: map[string]string{ - "default.." + DefaultURLKey: "https://github.com", - }, - wantErr: true, - expectedErr: "key default..default-url passed in git resolver configmap is invalid", - expectedConfig: ScmConfig{}, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctx := framework.InjectResolverConfigToContext(context.Background(), tc.config) - gitResolverConfig, err := GetScmConfigForParamConfigKey(ctx, tc.params) - if tc.wantErr { - if err == nil { - t.Fatalf("unexpected error parsing git resolver config: %v", err) - } - if d := cmp.Diff(tc.expectedErr, err.Error()); d != "" { - t.Errorf("unexpected error: %s", diff.PrintWantGot(d)) - } - } - if d := cmp.Diff(tc.expectedConfig, gitResolverConfig); d != "" { - t.Errorf("expected config: %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/upstream/pkg/resolution/resolver/http/config.go b/upstream/pkg/resolution/resolver/http/config.go index c8ffd8ed545..0685fdb07ba 100644 --- a/upstream/pkg/resolution/resolver/http/config.go +++ b/upstream/pkg/resolution/resolver/http/config.go @@ -17,7 +17,7 @@ limitations under the License. package http const ( - // TimeoutKey is the configuration field name for controlling + // timeoutKey is the configuration field name for controlling // the maximum duration of a resolution request for a file from http. - TimeoutKey = "fetch-timeout" + timeoutKey = "fetch-timeout" ) diff --git a/upstream/pkg/resolution/resolver/http/params.go b/upstream/pkg/resolution/resolver/http/params.go index 768832f65d8..b2e8c9a9c6c 100644 --- a/upstream/pkg/resolution/resolver/http/params.go +++ b/upstream/pkg/resolution/resolver/http/params.go @@ -13,18 +13,16 @@ limitations under the License. package http -import "github.com/tektoncd/pipeline/pkg/resolution/resource" - const ( - // UrlParam is the URL to fetch the task from - UrlParam string = resource.ParamURL + // urlParam is the URL to fetch the task from + urlParam string = "url" - // HttpBasicAuthUsername is the user name to use for basic auth - HttpBasicAuthUsername string = "http-username" + // httpBasicAuthUsername is the user name to use for basic auth + httpBasicAuthUsername string = "http-username" - // HttpBasicAuthSecret is the reference to a secret in the PipelineRun or TaskRun namespace to use for basic auth - HttpBasicAuthSecret string = "http-password-secret" + // httpBasicAuthSecret is the reference to a secret in the PipelineRun or TaskRun namespace to use for basic auth + httpBasicAuthSecret string = "http-password-secret" - // HttpBasicAuthSecretKey is the key in the httpBasicAuthSecret secret to use for basic auth - HttpBasicAuthSecretKey string = "http-password-secret-key" + // httpBasicAuthSecretKey is the key in the httpBasicAuthSecret secret to use for basic auth + httpBasicAuthSecretKey string = "http-password-secret-key" ) diff --git a/upstream/pkg/resolution/resolver/http/resolver.go b/upstream/pkg/resolution/resolver/http/resolver.go index 88447f43ba1..49d75bd2dd1 100644 --- a/upstream/pkg/resolution/resolver/http/resolver.go +++ b/upstream/pkg/resolution/resolver/http/resolver.go @@ -28,7 +28,7 @@ import ( resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" "go.uber.org/zap" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -59,8 +59,6 @@ const ( ) // Resolver implements a framework.Resolver that can fetch files from an HTTP URL -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/http.Resolver] instead. type Resolver struct { kubeClient kubernetes.Interface logger *zap.SugaredLogger @@ -91,24 +89,31 @@ func (r *Resolver) GetSelector(context.Context) map[string]string { // ValidateParams ensures parameters from a request are as expected. func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - return ValidateParams(ctx, params) + if r.isDisabled(ctx) { + return errors.New(disabledError) + } + _, err := populateDefaultParams(ctx, params) + if err != nil { + return err + } + return nil } // Resolve uses the given params to resolve the requested file or resource. func (r *Resolver) Resolve(ctx context.Context, oParams []pipelinev1.Param) (framework.ResolvedResource, error) { - if IsDisabled(ctx) { + if r.isDisabled(ctx) { return nil, errors.New(disabledError) } - params, err := PopulateDefaultParams(ctx, oParams) + params, err := populateDefaultParams(ctx, oParams) if err != nil { return nil, err } - return FetchHttpResource(ctx, params, r.kubeClient, r.logger) + return r.fetchHttpResource(ctx, params) } -func IsDisabled(ctx context.Context) bool { +func (r *Resolver) isDisabled(ctx context.Context) bool { cfg := resolverconfig.FromContextOrDefaults(ctx) return !cfg.FeatureFlags.EnableHttpResolver } @@ -146,7 +151,7 @@ func (rr *resolvedHttpResource) RefSource() *pipelinev1.RefSource { } } -func PopulateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { +func populateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { paramsMap := make(map[string]string) for _, p := range params { paramsMap[p.Name] = p.Value.StringVal @@ -154,33 +159,33 @@ func PopulateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[ var missingParams []string - if _, ok := paramsMap[UrlParam]; !ok { - missingParams = append(missingParams, UrlParam) + if _, ok := paramsMap[urlParam]; !ok { + missingParams = append(missingParams, urlParam) } else { - u, err := url.ParseRequestURI(paramsMap[UrlParam]) + u, err := url.ParseRequestURI(paramsMap[urlParam]) if err != nil { - return nil, fmt.Errorf("cannot parse url %s: %w", paramsMap[UrlParam], err) + return nil, fmt.Errorf("cannot parse url %s: %w", paramsMap[urlParam], err) } if u.Scheme != "http" && u.Scheme != "https" { - return nil, fmt.Errorf("url %s is not a valid http(s) url", paramsMap[UrlParam]) + return nil, fmt.Errorf("url %s is not a valid http(s) url", paramsMap[urlParam]) } } - if username, ok := paramsMap[HttpBasicAuthUsername]; ok { - if _, ok := paramsMap[HttpBasicAuthSecret]; !ok { - return nil, fmt.Errorf("missing required param %s when using %s", HttpBasicAuthSecret, HttpBasicAuthUsername) + if username, ok := paramsMap[httpBasicAuthUsername]; ok { + if _, ok := paramsMap[httpBasicAuthSecret]; !ok { + return nil, fmt.Errorf("missing required param %s when using %s", httpBasicAuthSecret, httpBasicAuthUsername) } if username == "" { - return nil, fmt.Errorf("value %s cannot be empty", HttpBasicAuthUsername) + return nil, fmt.Errorf("value %s cannot be empty", httpBasicAuthUsername) } } - if secret, ok := paramsMap[HttpBasicAuthSecret]; ok { - if _, ok := paramsMap[HttpBasicAuthUsername]; !ok { - return nil, fmt.Errorf("missing required param %s when using %s", HttpBasicAuthUsername, HttpBasicAuthSecret) + if secret, ok := paramsMap[httpBasicAuthSecret]; ok { + if _, ok := paramsMap[httpBasicAuthUsername]; !ok { + return nil, fmt.Errorf("missing required param %s when using %s", httpBasicAuthUsername, httpBasicAuthSecret) } if secret == "" { - return nil, fmt.Errorf("value %s cannot be empty", HttpBasicAuthSecret) + return nil, fmt.Errorf("value %s cannot be empty", httpBasicAuthSecret) } } @@ -194,7 +199,7 @@ func PopulateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[ func makeHttpClient(ctx context.Context) (*http.Client, error) { conf := framework.GetResolverConfigFromContext(ctx) timeout, _ := time.ParseDuration(defaultHttpTimeoutValue) - if v, ok := conf[TimeoutKey]; ok { + if v, ok := conf[timeoutKey]; ok { var err error timeout, err = time.ParseDuration(v) if err != nil { @@ -206,7 +211,7 @@ func makeHttpClient(ctx context.Context) (*http.Client, error) { }, nil } -func FetchHttpResource(ctx context.Context, params map[string]string, kubeclient kubernetes.Interface, logger *zap.SugaredLogger) (framework.ResolvedResource, error) { +func (r *Resolver) fetchHttpResource(ctx context.Context, params map[string]string) (framework.ResolvedResource, error) { var targetURL string var ok bool @@ -215,8 +220,8 @@ func FetchHttpResource(ctx context.Context, params map[string]string, kubeclient return nil, err } - if targetURL, ok = params[UrlParam]; !ok { - return nil, fmt.Errorf("missing required params: %s", UrlParam) + if targetURL, ok = params[urlParam]; !ok { + return nil, fmt.Errorf("missing required params: %s", urlParam) } req, err := http.NewRequestWithContext(ctx, http.MethodGet, targetURL, nil) @@ -225,8 +230,8 @@ func FetchHttpResource(ctx context.Context, params map[string]string, kubeclient } // NOTE(chmouel): We already made sure that username and secret was specified by the user - if secret, ok := params[HttpBasicAuthSecret]; ok && secret != "" { - if encodedSecret, err := getBasicAuthSecret(ctx, params, kubeclient, logger); err != nil { + if secret, ok := params[httpBasicAuthSecret]; ok && secret != "" { + if encodedSecret, err := r.getBasicAuthSecret(ctx, params); err != nil { return nil, err } else { req.Header.Set("Authorization", encodedSecret) @@ -254,44 +259,33 @@ func FetchHttpResource(ctx context.Context, params map[string]string, kubeclient }, nil } -func getBasicAuthSecret(ctx context.Context, params map[string]string, kubeclient kubernetes.Interface, logger *zap.SugaredLogger) (string, error) { - secretName := params[HttpBasicAuthSecret] - userName := params[HttpBasicAuthUsername] +func (r *Resolver) getBasicAuthSecret(ctx context.Context, params map[string]string) (string, error) { + secretName := params[httpBasicAuthSecret] + userName := params[httpBasicAuthUsername] tokenSecretKey := defaultBasicAuthSecretKey - if v, ok := params[HttpBasicAuthSecretKey]; ok { + if v, ok := params[httpBasicAuthSecretKey]; ok { if v != "" { tokenSecretKey = v } } secretNS := common.RequestNamespace(ctx) - secret, err := kubeclient.CoreV1().Secrets(secretNS).Get(ctx, secretName, metav1.GetOptions{}) + secret, err := r.kubeClient.CoreV1().Secrets(secretNS).Get(ctx, secretName, metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { notFoundErr := fmt.Errorf("cannot get API token, secret %s not found in namespace %s", secretName, secretNS) - logger.Info(notFoundErr) + r.logger.Info(notFoundErr) return "", notFoundErr } wrappedErr := fmt.Errorf("error reading API token from secret %s in namespace %s: %w", secretName, secretNS, err) - logger.Info(wrappedErr) + r.logger.Info(wrappedErr) return "", wrappedErr } secretVal, ok := secret.Data[tokenSecretKey] if !ok { err := fmt.Errorf("cannot get API token, key %s not found in secret %s in namespace %s", tokenSecretKey, secretName, secretNS) - logger.Info(err) + r.logger.Info(err) return "", err } return "Basic " + base64.StdEncoding.EncodeToString( []byte(fmt.Sprintf("%s:%s", userName, secretVal))), nil } - -func ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - if IsDisabled(ctx) { - return errors.New(disabledError) - } - _, err := PopulateDefaultParams(ctx, params) - if err != nil { - return err - } - return nil -} diff --git a/upstream/pkg/resolution/resolver/http/resolver_test.go b/upstream/pkg/resolution/resolver/http/resolver_test.go index 960fd8614fc..630b3882d6e 100644 --- a/upstream/pkg/resolution/resolver/http/resolver_test.go +++ b/upstream/pkg/resolution/resolver/http/resolver_test.go @@ -33,11 +33,11 @@ import ( resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "github.com/tektoncd/pipeline/pkg/internal/resolution" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" frtesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/internal" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" @@ -68,7 +68,7 @@ const emptyStr = "empty" func TestGetSelector(t *testing.T) { resolver := Resolver{} sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { + if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { t.Fatalf("unexpected selector: %v", sel) } else if typ != LabelValueHttpResolverType { t.Fatalf("unexpected type: %q", typ) @@ -104,7 +104,7 @@ func TestValidateParams(t *testing.T) { resolver := Resolver{} params := map[string]string{} if tc.url != "nourl" { - params[UrlParam] = tc.url + params[urlParam] = tc.url } err := resolver.ValidateParams(contextWithConfig(defaultHttpTimeoutValue), toParams(params)) if tc.expectedErr != nil { @@ -181,12 +181,12 @@ func TestResolve(t *testing.T) { if tc.expectedStatus != 0 { w.WriteHeader(tc.expectedStatus) } - fmt.Fprint(w, tc.input) + fmt.Fprintf(w, tc.input) })) params := []pipelinev1.Param{} if tc.paramSet { params = append(params, pipelinev1.Param{ - Name: UrlParam, + Name: urlParam, Value: *pipelinev1.NewStructuredValues(svr.URL), }) } @@ -253,12 +253,12 @@ func createRequest(params *params) *v1beta1.ResolutionRequest { Namespace: "foo", CreationTimestamp: metav1.Time{Time: time.Now()}, Labels: map[string]string{ - common.LabelKeyResolverType: LabelValueHttpResolverType, + resolutioncommon.LabelKeyResolverType: LabelValueHttpResolverType, }, }, Spec: v1beta1.ResolutionRequestSpec{ Params: []pipelinev1.Param{{ - Name: UrlParam, + Name: urlParam, Value: *pipelinev1.NewStructuredValues(params.url), }}, }, @@ -269,7 +269,7 @@ func createRequest(params *params) *v1beta1.ResolutionRequest { s = "" } rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: HttpBasicAuthSecret, + Name: httpBasicAuthSecret, Value: *pipelinev1.NewStructuredValues(s), }) } @@ -280,14 +280,14 @@ func createRequest(params *params) *v1beta1.ResolutionRequest { s = "" } rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: HttpBasicAuthUsername, + Name: httpBasicAuthUsername, Value: *pipelinev1.NewStructuredValues(s), }) } if params.authSecretKey != "" { rr.Spec.Params = append(rr.Spec.Params, pipelinev1.Param{ - Name: HttpBasicAuthSecretKey, + Name: httpBasicAuthSecretKey, Value: *pipelinev1.NewStructuredValues(params.authSecretKey), }) } @@ -309,12 +309,12 @@ func TestResolverReconcileBasicAuth(t *testing.T) { { name: "good/URL Resolution", taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte(sampleTask)), }, { name: "good/URL Resolution with custom basic auth, and custom secret key", taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte(sampleTask)), params: ¶ms{ authSecret: "auth-secret", authUsername: "auth", @@ -325,7 +325,7 @@ func TestResolverReconcileBasicAuth(t *testing.T) { { name: "good/URL Resolution with custom basic auth no custom secret key", taskContent: sampleTask, - expectedStatus: resolution.CreateResolutionRequestStatusWithData([]byte(sampleTask)), + expectedStatus: internal.CreateResolutionRequestStatusWithData([]byte(sampleTask)), params: ¶ms{ authSecret: "auth-secret", authUsername: "auth", @@ -396,7 +396,7 @@ func TestResolverReconcileBasicAuth(t *testing.T) { resolver := &Resolver{} ctx, _ := ttesting.SetupFakeContext(t) svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, tt.taskContent) + fmt.Fprintf(w, tt.taskContent) })) p := tt.params if p == nil { @@ -510,7 +510,7 @@ func toParams(m map[string]string) []pipelinev1.Param { func contextWithConfig(timeout string) context.Context { config := map[string]string{ - TimeoutKey: timeout, + timeoutKey: timeout, } return framework.InjectResolverConfigToContext(context.Background(), config) } diff --git a/upstream/pkg/resolution/resolver/hub/params.go b/upstream/pkg/resolution/resolver/hub/params.go index 211ad7cda9a..6c77736b48f 100644 --- a/upstream/pkg/resolution/resolver/hub/params.go +++ b/upstream/pkg/resolution/resolver/hub/params.go @@ -13,8 +13,6 @@ limitations under the License. package hub -import "github.com/tektoncd/pipeline/pkg/resolution/resource" - // DefaultArtifactHubURL is the default url for the Artifact hub api const DefaultArtifactHubURL = "https://artifacthub.io" @@ -32,7 +30,7 @@ const ArtifactHubListTasksEndpoint = "api/v1/packages/tekton-%s/%s/%s" // ParamName is the parameter defining what the layer name in the bundle // image is. -const ParamName = resource.ParamName +const ParamName = "name" // ParamKind is the parameter defining what the layer kind in the bundle // image is. diff --git a/upstream/pkg/resolution/resolver/hub/resolver.go b/upstream/pkg/resolution/resolver/hub/resolver.go index db2d9d29413..e94aa390fa5 100644 --- a/upstream/pkg/resolution/resolver/hub/resolver.go +++ b/upstream/pkg/resolution/resolver/hub/resolver.go @@ -27,7 +27,7 @@ import ( goversion "github.com/hashicorp/go-version" resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" ) @@ -46,8 +46,6 @@ const ( ) // Resolver implements a framework.Resolver that can fetch files from OCI bundles. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/hub.Resolver] instead. type Resolver struct { // TektonHubURL is the URL for hub resolver with type tekton TektonHubURL string @@ -79,11 +77,7 @@ func (r *Resolver) GetSelector(context.Context) map[string]string { // ValidateParams ensures parameters from a request are as expected. func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error { - return ValidateParams(ctx, params, r.TektonHubURL) -} - -func ValidateParams(ctx context.Context, params []pipelinev1.Param, tektonHubUrl string) error { - if isDisabled(ctx) { + if r.isDisabled(ctx) { return errors.New(disabledError) } @@ -91,7 +85,7 @@ func ValidateParams(ctx context.Context, params []pipelinev1.Param, tektonHubUrl if err != nil { return fmt.Errorf("failed to populate default params: %w", err) } - if err := validateParams(ctx, paramsMap, tektonHubUrl); err != nil { + if err := r.validateParams(ctx, paramsMap); err != nil { return fmt.Errorf("failed to validate params: %w", err) } @@ -116,11 +110,7 @@ type artifactHubResponse struct { // Resolve uses the given params to resolve the requested file or resource. func (r *Resolver) Resolve(ctx context.Context, params []pipelinev1.Param) (framework.ResolvedResource, error) { - return Resolve(ctx, params, r.TektonHubURL, r.ArtifactHubURL) -} - -func Resolve(ctx context.Context, params []pipelinev1.Param, tektonHubURL, artifactHubURL string) (framework.ResolvedResource, error) { - if isDisabled(ctx) { + if r.isDisabled(ctx) { return nil, errors.New(disabledError) } @@ -128,12 +118,12 @@ func Resolve(ctx context.Context, params []pipelinev1.Param, tektonHubURL, artif if err != nil { return nil, fmt.Errorf("failed to populate default params: %w", err) } - if err := validateParams(ctx, paramsMap, tektonHubURL); err != nil { + if err := r.validateParams(ctx, paramsMap); err != nil { return nil, fmt.Errorf("failed to validate params: %w", err) } if constraint, err := goversion.NewConstraint(paramsMap[ParamVersion]); err == nil { - chosen, err := resolveVersionConstraint(ctx, paramsMap, constraint, artifactHubURL, tektonHubURL) + chosen, err := r.resolveVersionConstraint(ctx, paramsMap, constraint) if err != nil { return nil, err } @@ -149,7 +139,7 @@ func Resolve(ctx context.Context, params []pipelinev1.Param, tektonHubURL, artif // call hub API switch paramsMap[ParamType] { case ArtifactHubType: - url := fmt.Sprintf(fmt.Sprintf("%s/%s", artifactHubURL, ArtifactHubYamlEndpoint), + url := fmt.Sprintf(fmt.Sprintf("%s/%s", r.ArtifactHubURL, ArtifactHubYamlEndpoint), paramsMap[ParamKind], paramsMap[ParamCatalog], paramsMap[ParamName], paramsMap[ParamVersion]) resp := artifactHubResponse{} if err := fetchHubResource(ctx, url, &resp); err != nil { @@ -160,7 +150,7 @@ func Resolve(ctx context.Context, params []pipelinev1.Param, tektonHubURL, artif Content: []byte(resp.Data.YAML), }, nil case TektonHubType: - url := fmt.Sprintf(fmt.Sprintf("%s/%s", tektonHubURL, TektonHubYamlEndpoint), + url := fmt.Sprintf(fmt.Sprintf("%s/%s", r.TektonHubURL, TektonHubYamlEndpoint), paramsMap[ParamCatalog], paramsMap[ParamKind], paramsMap[ParamName], paramsMap[ParamVersion]) resp := tektonHubResponse{} if err := fetchHubResource(ctx, url, &resp); err != nil { @@ -208,7 +198,7 @@ func (rr *ResolvedHubResource) RefSource() *pipelinev1.RefSource { } } -func isDisabled(ctx context.Context) bool { +func (r *Resolver) isDisabled(ctx context.Context) bool { cfg := resolverconfig.FromContextOrDefaults(ctx) return !cfg.FeatureFlags.EnableHubResolver } @@ -298,92 +288,10 @@ type tektonHubListResult struct { Data tektonHubListDataResult `json:"data"` } -// the Artifact Hub follows the semVer (i.e. ..0) -// the Tekton Hub follows the simplified semVer (i.e. .) -// for resolution request with "artifact" type, we append ".0" suffix if the input version is simplified semVer -// for resolution request with "tekton" type, we only use . part of the input if it is semVer -func resolveVersion(version, hubType string) (string, error) { - semVer := strings.Split(version, ".") - resVer := version - - if hubType == ArtifactHubType && len(semVer) == 2 { - resVer = version + ".0" - } else if hubType == TektonHubType && len(semVer) > 2 { - resVer = strings.Join(semVer[0:2], ".") - } - - return resVer, nil -} - -func populateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { - conf := framework.GetResolverConfigFromContext(ctx) - paramsMap := make(map[string]string) - for _, p := range params { - paramsMap[p.Name] = p.Value.StringVal - } - - // type - if _, ok := paramsMap[ParamType]; !ok { - if typeString, ok := conf[ConfigType]; ok { - paramsMap[ParamType] = typeString - } else { - return nil, errors.New("default type was not set during installation of the hub resolver") - } - } - - // kind - if _, ok := paramsMap[ParamKind]; !ok { - if kindString, ok := conf[ConfigKind]; ok { - paramsMap[ParamKind] = kindString - } else { - return nil, errors.New("default resource kind was not set during installation of the hub resolver") - } - } - - // catalog - resCatName, err := resolveCatalogName(paramsMap, conf) - if err != nil { - return nil, err - } - paramsMap[ParamCatalog] = resCatName - - return paramsMap, nil -} - -func validateParams(ctx context.Context, paramsMap map[string]string, tektonHubURL string) error { - var missingParams []string - if _, ok := paramsMap[ParamName]; !ok { - missingParams = append(missingParams, ParamName) - } - if _, ok := paramsMap[ParamVersion]; !ok { - missingParams = append(missingParams, ParamVersion) - } - if kind, ok := paramsMap[ParamKind]; ok { - if kind != "task" && kind != "pipeline" { - return errors.New("kind param must be task or pipeline") - } - } - if hubType, ok := paramsMap[ParamType]; ok { - if hubType != ArtifactHubType && hubType != TektonHubType { - return fmt.Errorf("type param must be %s or %s", ArtifactHubType, TektonHubType) - } - - if hubType == TektonHubType && tektonHubURL == "" { - return errors.New("please configure TEKTON_HUB_API env variable to use tekton type") - } - } - - if len(missingParams) > 0 { - return fmt.Errorf("missing required hub resolver params: %s", strings.Join(missingParams, ", ")) - } - - return nil -} - -func resolveVersionConstraint(ctx context.Context, paramsMap map[string]string, constraint goversion.Constraints, artifactHubURL, tektonHubURL string) (*goversion.Version, error) { +func (r *Resolver) resolveVersionConstraint(ctx context.Context, paramsMap map[string]string, constraint goversion.Constraints) (*goversion.Version, error) { var ret *goversion.Version if paramsMap[ParamType] == ArtifactHubType { - allVersionsURL := fmt.Sprintf("%s/%s", artifactHubURL, fmt.Sprintf( + allVersionsURL := fmt.Sprintf("%s/%s", r.ArtifactHubURL, fmt.Sprintf( ArtifactHubListTasksEndpoint, paramsMap[ParamKind], paramsMap[ParamCatalog], paramsMap[ParamName])) resp := artifactHubListResult{} @@ -410,7 +318,7 @@ func resolveVersionConstraint(ctx context.Context, paramsMap map[string]string, } } } else if paramsMap[ParamType] == TektonHubType { - allVersionsURL := fmt.Sprintf("%s/%s", tektonHubURL, + allVersionsURL := fmt.Sprintf("%s/%s", r.TektonHubURL, fmt.Sprintf(TektonHubListTasksEndpoint, paramsMap[ParamCatalog], paramsMap[ParamKind], paramsMap[ParamName])) resp := tektonHubListResult{} @@ -439,3 +347,85 @@ func resolveVersionConstraint(ctx context.Context, paramsMap map[string]string, } return ret, nil } + +// the Artifact Hub follows the semVer (i.e. ..0) +// the Tekton Hub follows the simplified semVer (i.e. .) +// for resolution request with "artifact" type, we append ".0" suffix if the input version is simplified semVer +// for resolution request with "tekton" type, we only use . part of the input if it is semVer +func resolveVersion(version, hubType string) (string, error) { + semVer := strings.Split(version, ".") + resVer := version + + if hubType == ArtifactHubType && len(semVer) == 2 { + resVer = version + ".0" + } else if hubType == TektonHubType && len(semVer) > 2 { + resVer = strings.Join(semVer[0:2], ".") + } + + return resVer, nil +} + +func (r *Resolver) validateParams(ctx context.Context, paramsMap map[string]string) error { + var missingParams []string + if _, ok := paramsMap[ParamName]; !ok { + missingParams = append(missingParams, ParamName) + } + if _, ok := paramsMap[ParamVersion]; !ok { + missingParams = append(missingParams, ParamVersion) + } + if kind, ok := paramsMap[ParamKind]; ok { + if kind != "task" && kind != "pipeline" { + return errors.New("kind param must be task or pipeline") + } + } + if hubType, ok := paramsMap[ParamType]; ok { + if hubType != ArtifactHubType && hubType != TektonHubType { + return fmt.Errorf("type param must be %s or %s", ArtifactHubType, TektonHubType) + } + + if hubType == TektonHubType && r.TektonHubURL == "" { + return errors.New("please configure TEKTON_HUB_API env variable to use tekton type") + } + } + + if len(missingParams) > 0 { + return fmt.Errorf("missing required hub resolver params: %s", strings.Join(missingParams, ", ")) + } + + return nil +} + +func populateDefaultParams(ctx context.Context, params []pipelinev1.Param) (map[string]string, error) { + conf := framework.GetResolverConfigFromContext(ctx) + paramsMap := make(map[string]string) + for _, p := range params { + paramsMap[p.Name] = p.Value.StringVal + } + + // type + if _, ok := paramsMap[ParamType]; !ok { + if typeString, ok := conf[ConfigType]; ok { + paramsMap[ParamType] = typeString + } else { + return nil, errors.New("default type was not set during installation of the hub resolver") + } + } + + // kind + if _, ok := paramsMap[ParamKind]; !ok { + if kindString, ok := conf[ConfigKind]; ok { + paramsMap[ParamKind] = kindString + } else { + return nil, errors.New("default resource kind was not set during installation of the hub resolver") + } + } + + // catalog + resCatName, err := resolveCatalogName(paramsMap, conf) + if err != nil { + return nil, err + } + paramsMap[ParamCatalog] = resCatName + + return paramsMap, nil +} diff --git a/upstream/pkg/resolution/resolver/hub/resolver_test.go b/upstream/pkg/resolution/resolver/hub/resolver_test.go index 82335875d7d..474838c1a7f 100644 --- a/upstream/pkg/resolution/resolver/hub/resolver_test.go +++ b/upstream/pkg/resolution/resolver/hub/resolver_test.go @@ -29,7 +29,7 @@ import ( "github.com/google/go-cmp/cmp" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework" frtesting "github.com/tektoncd/pipeline/pkg/resolution/resolver/framework/testing" "github.com/tektoncd/pipeline/test/diff" @@ -38,7 +38,7 @@ import ( func TestGetSelector(t *testing.T) { resolver := Resolver{} sel := resolver.GetSelector(context.Background()) - if typ, has := sel[common.LabelKeyResolverType]; !has { + if typ, has := sel[resolutioncommon.LabelKeyResolverType]; !has { t.Fatalf("unexpected selector: %v", sel) } else if typ != LabelValueHubResolverType { t.Fatalf("unexpected type: %q", typ) @@ -346,7 +346,7 @@ func TestResolveConstraint(t *testing.T) { ret = tt.resultTask } output, _ := json.Marshal(ret) - fmt.Fprint(w, string(output)) + fmt.Fprintf(w, string(output)) })) resolver := &Resolver{ @@ -582,7 +582,7 @@ func TestResolve(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, tc.input) + fmt.Fprintf(w, tc.input) })) resolver := &Resolver{ diff --git a/upstream/pkg/internal/resolution/resolutionrequest.go b/upstream/pkg/resolution/resolver/internal/resolutionrequest.go similarity index 91% rename from upstream/pkg/internal/resolution/resolutionrequest.go rename to upstream/pkg/resolution/resolver/internal/resolutionrequest.go index a7cf0909ae0..be7f78f9a89 100644 --- a/upstream/pkg/internal/resolution/resolutionrequest.go +++ b/upstream/pkg/resolution/resolver/internal/resolutionrequest.go @@ -14,13 +14,13 @@ limitations under the License. */ -package resolution +package internal import ( "encoding/base64" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" corev1 "k8s.io/api/core/v1" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -43,7 +43,7 @@ func CreateResolutionRequestFailureStatus() *v1beta1.ResolutionRequestStatus { Conditions: duckv1.Conditions{{ Type: apis.ConditionSucceeded, Status: corev1.ConditionFalse, - Reason: common.ReasonResolutionFailed, + Reason: resolutioncommon.ReasonResolutionFailed, }}, }, } diff --git a/upstream/pkg/resolution/resource/crd_resource.go b/upstream/pkg/resolution/resource/crd_resource.go index 9e1281a63a7..90fd7653303 100644 --- a/upstream/pkg/resolution/resource/crd_resource.go +++ b/upstream/pkg/resolution/resource/crd_resource.go @@ -22,11 +22,11 @@ import ( "errors" "fmt" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" rrclient "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned" rrlisters "github.com/tektoncd/pipeline/pkg/client/resolution/listers/resolution/v1beta1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -34,8 +34,6 @@ import ( // CRDRequester implements the Requester interface using // ResolutionRequest CRDs. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.CRDRequester] instead. type CRDRequester struct { clientset rrclient.Interface lister rrlisters.ResolutionRequestLister @@ -45,8 +43,6 @@ type CRDRequester struct { // ResolutionRequest CRD objects to mediate between the caller who wants a // resource (e.g. Tekton Pipelines) and the responder who can fetch // it (e.g. the gitresolver) -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.NewCRDRequester] instead. func NewCRDRequester(clientset rrclient.Interface, lister rrlisters.ResolutionRequestLister) *CRDRequester { return &CRDRequester{clientset, lister} } @@ -67,7 +63,7 @@ func (r *CRDRequester) Submit(ctx context.Context, resolver ResolverName, req Re !apierrors.IsAlreadyExists(err) { return nil, err } - return nil, common.ErrRequestInProgress + return nil, resolutioncommon.ErrRequestInProgress } if rr.Status.GetCondition(apis.ConditionSucceeded).IsUnknown() { @@ -76,58 +72,52 @@ func (r *CRDRequester) Submit(ctx context.Context, resolver ResolverName, req Re // that it doesn't get deleted until the caller is done // with it. Use appendOwnerReference and then submit // update to ResolutionRequest. - return nil, common.ErrRequestInProgress + return nil, resolutioncommon.ErrRequestInProgress } if rr.Status.GetCondition(apis.ConditionSucceeded).IsTrue() { - return CrdIntoResource(rr), nil + return crdIntoResource(rr), nil } message := rr.Status.GetCondition(apis.ConditionSucceeded).GetMessage() - err := common.NewError(common.ReasonResolutionFailed, errors.New(message)) + err := resolutioncommon.NewError(resolutioncommon.ReasonResolutionFailed, errors.New(message)) return nil, err } func (r *CRDRequester) createResolutionRequest(ctx context.Context, resolver ResolverName, req Request) error { - var owner metav1.OwnerReference - if ownedReq, ok := req.(OwnedRequest); ok { - owner = ownedReq.OwnerRef() - } - rr := CreateResolutionRequest(ctx, resolver, req.Name(), req.Namespace(), req.Params(), owner) - _, err := r.clientset.ResolutionV1beta1().ResolutionRequests(rr.Namespace).Create(ctx, rr, metav1.CreateOptions{}) - return err -} - -func CreateResolutionRequest(ctx context.Context, resolver common.ResolverName, name, namespace string, params []v1.Param, ownerRef metav1.OwnerReference) *v1beta1.ResolutionRequest { rr := &v1beta1.ResolutionRequest{ TypeMeta: metav1.TypeMeta{ APIVersion: "resolution.tekton.dev/v1beta1", Kind: "ResolutionRequest", }, ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, + Name: req.Name(), + Namespace: req.Namespace(), Labels: map[string]string{ - common.LabelKeyResolverType: string(resolver), + resolutioncommon.LabelKeyResolverType: string(resolver), }, }, Spec: v1beta1.ResolutionRequestSpec{ - Params: params, + Params: req.Params(), }, } - appendOwnerReference(rr, ownerRef) - return rr + appendOwnerReference(rr, req) + _, err := r.clientset.ResolutionV1beta1().ResolutionRequests(rr.Namespace).Create(ctx, rr, metav1.CreateOptions{}) + return err } -func appendOwnerReference(rr *v1beta1.ResolutionRequest, ownerRef metav1.OwnerReference) { - isOwner := false - for _, ref := range rr.ObjectMeta.OwnerReferences { - if ownerRefsAreEqual(ref, ownerRef) { - isOwner = true +func appendOwnerReference(rr *v1beta1.ResolutionRequest, req Request) { + if ownedReq, ok := req.(OwnedRequest); ok { + newOwnerRef := ownedReq.OwnerRef() + isOwner := false + for _, ref := range rr.ObjectMeta.OwnerReferences { + if ownerRefsAreEqual(ref, newOwnerRef) { + isOwner = true + } + } + if !isOwner { + rr.ObjectMeta.OwnerReferences = append(rr.ObjectMeta.OwnerReferences, newOwnerRef) } - } - if !isOwner { - rr.ObjectMeta.OwnerReferences = append(rr.ObjectMeta.OwnerReferences, ownerRef) } } @@ -141,21 +131,21 @@ func ownerRefsAreEqual(a, b metav1.OwnerReference) bool { return a.APIVersion == b.APIVersion && a.Kind == b.Kind && a.Name == b.Name && a.UID == b.UID } -// ReadOnlyResolutionRequest is an opaque wrapper around ResolutionRequest +// readOnlyResolutionRequest is an opaque wrapper around ResolutionRequest // that provides the methods needed to read data from it using the // Resource interface without exposing the underlying API // object. -type ReadOnlyResolutionRequest struct { +type readOnlyResolutionRequest struct { req *v1beta1.ResolutionRequest } -var _ common.ResolvedResource = ReadOnlyResolutionRequest{} +var _ ResolvedResource = readOnlyResolutionRequest{} -func CrdIntoResource(rr *v1beta1.ResolutionRequest) ReadOnlyResolutionRequest { - return ReadOnlyResolutionRequest{req: rr} +func crdIntoResource(rr *v1beta1.ResolutionRequest) readOnlyResolutionRequest { + return readOnlyResolutionRequest{req: rr} } -func (r ReadOnlyResolutionRequest) Annotations() map[string]string { +func (r readOnlyResolutionRequest) Annotations() map[string]string { status := r.req.GetStatus() if status != nil && status.Annotations != nil { annotationsCopy := map[string]string{} @@ -167,7 +157,7 @@ func (r ReadOnlyResolutionRequest) Annotations() map[string]string { return nil } -func (r ReadOnlyResolutionRequest) Data() ([]byte, error) { +func (r readOnlyResolutionRequest) Data() ([]byte, error) { encodedData := r.req.Status.ResolutionRequestStatusFields.Data decodedBytes, err := base64.StdEncoding.Strict().DecodeString(encodedData) if err != nil { @@ -176,6 +166,6 @@ func (r ReadOnlyResolutionRequest) Data() ([]byte, error) { return decodedBytes, nil } -func (r ReadOnlyResolutionRequest) RefSource() *v1.RefSource { +func (r readOnlyResolutionRequest) RefSource() *pipelinev1.RefSource { return r.req.Status.RefSource } diff --git a/upstream/pkg/resolution/resource/crd_resource_test.go b/upstream/pkg/resolution/resource/crd_resource_test.go index c63a3564977..da5a06fac38 100644 --- a/upstream/pkg/resolution/resource/crd_resource_test.go +++ b/upstream/pkg/resolution/resource/crd_resource_test.go @@ -25,11 +25,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/pkg/resolution/common" + resolutioncommon "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/pkg/resolution/resource" "github.com/tektoncd/pipeline/test" "github.com/tektoncd/pipeline/test/diff" - resolution "github.com/tektoncd/pipeline/test/resolution" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/logging" _ "knative.dev/pkg/system/testing" // Setup system.Namespace() @@ -145,7 +144,7 @@ conditions: testCases := []struct { name string - inputRequest *resolution.RawRequest + inputRequest *test.RawRequest inputResolutionRequest *v1beta1.ResolutionRequest expectedResolutionRequest *v1beta1.ResolutionRequest expectedResolvedResource *v1beta1.ResolutionRequest @@ -157,7 +156,7 @@ conditions: inputResolutionRequest: nil, expectedResolutionRequest: createdRR.DeepCopy(), expectedResolvedResource: nil, - expectedErr: common.ErrRequestInProgress, + expectedErr: resolutioncommon.ErrRequestInProgress, }, { name: "resolution request exist and status is unknown", @@ -165,7 +164,7 @@ conditions: inputResolutionRequest: unknownRR.DeepCopy(), expectedResolutionRequest: nil, expectedResolvedResource: nil, - expectedErr: common.ErrRequestInProgress, + expectedErr: resolutioncommon.ErrRequestInProgress, }, { name: "resolution request exist and status is succeeded", @@ -189,7 +188,7 @@ conditions: inputResolutionRequest: failedRR.DeepCopy(), expectedResolutionRequest: nil, expectedResolvedResource: nil, - expectedErr: common.NewError(common.ReasonResolutionFailed, errors.New("error message")), + expectedErr: resolutioncommon.NewError(resolutioncommon.ReasonResolutionFailed, errors.New("error message")), }, } @@ -205,7 +204,7 @@ conditions: ctx := testAssets.Ctx clients := testAssets.Clients - resolver := common.ResolverName("git") + resolver := resolutioncommon.ResolverName("git") crdRequester := resource.NewCRDRequester(clients.ResolutionRequests, testAssets.Informers.ResolutionRequest.Lister()) requestWithOwner := &ownerRequest{ Request: tc.inputRequest.Request(), @@ -236,7 +235,7 @@ conditions: if err != nil { t.Errorf("unexpected error decoding expected resource data: %v", err) } - expectedResolvedResource := resolution.NewResolvedResource(data, rr.Status.Annotations, rr.Status.RefSource, nil) + expectedResolvedResource := test.NewResolvedResource(data, rr.Status.Annotations, rr.Status.RefSource, nil) assertResolvedResourceEqual(t, expectedResolvedResource, resolvedResource) } @@ -256,7 +255,7 @@ conditions: } type ownerRequest struct { - common.Request + resolutioncommon.Request ownerRef metav1.OwnerReference } @@ -264,9 +263,9 @@ func (r *ownerRequest) OwnerRef() metav1.OwnerReference { return r.ownerRef } -func mustParseRawRequest(t *testing.T, yamlStr string) *resolution.RawRequest { +func mustParseRawRequest(t *testing.T, yamlStr string) *test.RawRequest { t.Helper() - output := &resolution.RawRequest{} + output := &test.RawRequest{} if err := yaml.Unmarshal([]byte(yamlStr), output); err != nil { t.Errorf("parsing raw request %s: %v", yamlStr, err) } @@ -300,7 +299,7 @@ func mustParseResolutionRequestStatus(t *testing.T, yamlStr string) *v1beta1.Res return output } -func assertResolvedResourceEqual(t *testing.T, expected, actual common.ResolvedResource) { +func assertResolvedResourceEqual(t *testing.T, expected, actual resolutioncommon.ResolvedResource) { t.Helper() expectedBytes, err := expected.Data() if err != nil { diff --git a/upstream/pkg/resolution/resource/name.go b/upstream/pkg/resolution/resource/name.go index 8557d824622..051eabc89d0 100644 --- a/upstream/pkg/resolution/resource/name.go +++ b/upstream/pkg/resolution/resource/name.go @@ -21,77 +21,26 @@ import ( "hash" "hash/fnv" "sort" - "strings" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - "k8s.io/apimachinery/pkg/util/validation" - "knative.dev/pkg/kmeta" ) -const ( - // ParamName is a param that explicitly assigns a name to the remote object - ParamName = "name" - - // ParamURL is a param that hold the URL used for accesing the remote object - ParamURL = "url" -) - -// - -const maxLength = validation.DNS1123LabelMaxLength - -// GenerateDeterministicName makes a best-effort attempt to create a -// unique but reproducible name for use in a Request. The returned value -// will have the format {prefix}-{hash} where {prefix} is -// given and {hash} is nameHasher(base) + nameHasher(param1) + -// nameHasher(param2) + ... -func GenerateDeterministicName(prefix, base string, params v1.Params) (string, error) { - return GenerateDeterministicNameFromSpec(prefix, base, &v1beta1.ResolutionRequestSpec{Params: params}) -} - -// GetNameAndNamespace determines the name and namespace for a resource request. -// It prioritizes explicit values, falling back to the owning object and "default" namespace. -// If needed, it generates a deterministic name to prevent duplicate requests within a context. -func GetNameAndNamespace(resolverName string, owner kmeta.OwnerRefable, name string, namespace string, req *v1beta1.ResolutionRequestSpec) (string, string, error) { - if name == "" { - name = owner.GetObjectMeta().GetName() - namespace = owner.GetObjectMeta().GetNamespace() - } - if namespace == "" { - namespace = "default" - } - // Generating a deterministic name for the resource request - // prevents multiple requests being issued for the same - // pipelinerun's pipelineRef or taskrun's taskRef. - remoteResourceBaseName := namespace + "/" + name - name, err := GenerateDeterministicNameFromSpec(resolverName, remoteResourceBaseName, req) - if err != nil { - return "", "", fmt.Errorf("error generating name for taskrun %s/%s: %w", namespace, name, err) - } - return name, namespace, nil -} - // nameHasher returns the hash.Hash to use when generating names. func nameHasher() hash.Hash { return fnv.New128a() } -// GenerateDeterministicNameFromSpec makes a best-effort attempt to create a +// GenerateDeterministicName makes a best-effort attempt to create a // unique but reproducible name for use in a Request. The returned value // will have the format {prefix}-{hash} where {prefix} is // given and {hash} is nameHasher(base) + nameHasher(param1) + // nameHasher(param2) + ... -func GenerateDeterministicNameFromSpec(prefix, base string, resolutionSpec *v1beta1.ResolutionRequestSpec) (string, error) { +func GenerateDeterministicName(prefix, base string, params v1.Params) (string, error) { hasher := nameHasher() if _, err := hasher.Write([]byte(base)); err != nil { return "", err } - if resolutionSpec == nil { - return fmt.Sprintf("%s-%x", prefix, hasher.Sum(nil)), nil - } - params := resolutionSpec.Params sortedParams := make(v1.Params, len(params)) for i := range params { sortedParams[i] = *params[i].DeepCopy() @@ -118,39 +67,5 @@ func GenerateDeterministicNameFromSpec(prefix, base string, resolutionSpec *v1be } } } - if len(resolutionSpec.URL) > 0 { - if _, err := hasher.Write([]byte(resolutionSpec.URL)); err != nil { - return "", err - } - } - name := fmt.Sprintf("%s-%x", prefix, hasher.Sum(nil)) - if maxLength > len(name) { - return name, nil - } - return name[:strings.LastIndex(name[:maxLength], " ")], nil -} - -// GenerateErrorLogString makes a best effort attempt to get the name of the task -// when a resolver error occurred. The TaskRef name does not have to be set, where -// the specific resolver gets the name from the parameters. -func GenerateErrorLogString(resolverType string, params v1.Params) string { - paramString := fmt.Sprintf("resolver type %s\n", resolverType) - for _, p := range params { - if p.Name == ParamName { - name := p.Value.StringVal - if p.Value.Type != v1.ParamTypeString { - asJSON, err := p.Value.MarshalJSON() - if err != nil { - paramString += fmt.Sprintf("name could not be marshalled: %s\n", err.Error()) - continue - } - name = string(asJSON) - } - paramString += fmt.Sprintf("name = %s\n", name) - } - if p.Name == ParamURL { - paramString += fmt.Sprintf("url = %s\n", p.Value.StringVal) - } - } - return paramString + return fmt.Sprintf("%s-%x", prefix, hasher.Sum(nil)), nil } diff --git a/upstream/pkg/resolution/resource/name_test.go b/upstream/pkg/resolution/resource/name_test.go index 738d84cc47d..1a90a0aaf18 100644 --- a/upstream/pkg/resolution/resource/name_test.go +++ b/upstream/pkg/resolution/resource/name_test.go @@ -17,11 +17,9 @@ limitations under the License. package resource_test import ( - "strings" "testing" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" "github.com/tektoncd/pipeline/pkg/resolution/resource" ) @@ -115,215 +113,3 @@ func TestGenerateDeterministicName(t *testing.T) { }) } } - -func TestGenerateDeterministicNameFromSpec(t *testing.T) { - type args struct { - prefix string - base string - params []v1.Param - url string - } - golden := args{ - prefix: "prefix", - base: "base", - params: []v1.Param{ - { - Name: "string-param", - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "value1", - }, - }, - { - Name: "array-param", - Value: v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{"value1", "value2"}, - }, - }, - { - Name: "object-param", - Value: v1.ParamValue{ - Type: v1.ParamTypeObject, - ObjectVal: map[string]string{"key": "value"}, - }, - }, - }, - url: "https://foo/bar", - } - tests := []struct { - name string - args args - want string - wantErr bool - }{ - { - name: "only contains prefix", - args: args{ - prefix: golden.prefix, - }, - want: "prefix-6c62272e07bb014262b821756295c58d", - }, - { - name: "only contains base", - args: args{ - base: golden.base, - }, - want: "-6989337ae0757277b806e97e86444ef0", - }, - { - name: "only contains url", - args: args{ - url: golden.url, - }, - want: "-dcfaf53735f4a84a3e319e17352940b4", - }, - { - name: "only contains params", - args: args{ - params: golden.params, - }, - want: "-52921b17d3c2930a34419c618d6af0e9", - }, - { - name: "params with different order should generate same hash", - args: args{ - params: []v1.Param{ - golden.params[2], - golden.params[1], - golden.params[0], - }, - }, - want: "-52921b17d3c2930a34419c618d6af0e9", - }, - { - name: "contain all fields", - args: golden, - want: "prefix-ff25bd24688ab610bdc530a5ab3aabbd", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - resolutionSpec := &v1beta1.ResolutionRequestSpec{ - Params: tt.args.params, - URL: tt.args.url, - } - got, err := resource.GenerateDeterministicNameFromSpec(tt.args.prefix, tt.args.base, resolutionSpec) - if (err != nil) != tt.wantErr { - t.Errorf("GenerateDeterministicNameFromSpec() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("GenerateDeterministicNameFromSpec() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestGenerateErrorLogString(t *testing.T) { - tests := []struct { - resolverType string - name string - url string - err string - params []v1.Param - isPresent bool - }{ - { - name: "foo", - url: "https://bar", - resolverType: "git", - isPresent: true, - params: []v1.Param{ - { - Name: resource.ParamName, - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "foo", - }, - }, - { - Name: resource.ParamURL, - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "https://bar", - }, - }, - }, - }, - { - name: "foo", - url: "https://bar", - resolverType: "", - err: "name could not be marshalled", - params: []v1.Param{}, - }, - { - name: "goo", - resolverType: "bundle", - isPresent: true, - params: []v1.Param{ - { - Name: resource.ParamName, - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "goo", - }, - }, - }, - }, - { - name: "goo-array", - resolverType: "bundle", - isPresent: true, - params: []v1.Param{ - { - Name: resource.ParamName, - Value: v1.ParamValue{ - Type: v1.ParamTypeArray, - ArrayVal: []string{resource.ParamName, "goo-array"}, - }, - }, - }, - }, - { - name: "hoo", - resolverType: "cluster", - err: "name could not be marshalled", - isPresent: true, - params: []v1.Param{ - { - Name: resource.ParamName, - Value: v1.ParamValue{ - Type: v1.ParamTypeString, - StringVal: "hoo", - }, - }, - { - Name: resource.ParamName, - Value: v1.ParamValue{ - Type: v1.ParamType("foo"), - }, - }, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := resource.GenerateErrorLogString(tt.resolverType, tt.params) - if strings.Contains(got, tt.name) != tt.isPresent { - t.Errorf("name %s presence in %s should be %v", tt.name, got, tt.isPresent) - } - if strings.Contains(got, tt.url) != tt.isPresent { - t.Errorf("url %s presence in %s should be %v", tt.url, got, tt.isPresent) - } - if strings.Contains(got, tt.err) != tt.isPresent { - t.Errorf("err %s presence in %s should be %v", tt.err, got, tt.isPresent) - } - // should always have resolver type - if !strings.Contains(got, tt.resolverType) { - t.Errorf("type %s not in %s", tt.resolverType, got) - } - }) - } -} diff --git a/upstream/pkg/resolution/resource/request.go b/upstream/pkg/resolution/resource/request.go index a3d8a967be5..9e0f3e194e7 100644 --- a/upstream/pkg/resolution/resource/request.go +++ b/upstream/pkg/resolution/resource/request.go @@ -21,8 +21,6 @@ import v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" var _ Request = &BasicRequest{} // BasicRequest holds the fields needed to submit a new resource request. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.BasicRequest] instead. type BasicRequest struct { name string namespace string @@ -31,12 +29,12 @@ type BasicRequest struct { // NewRequest returns an instance of a BasicRequest with the given name, // namespace and params. -// -// Deprecated: Use [github.com/tektoncd/pipeline/pkg/remoteresolution/resource.NewRequest] instead. func NewRequest(name, namespace string, params v1.Params) Request { return &BasicRequest{name, namespace, params} } +var _ Request = &BasicRequest{} + // Name returns the name attached to the request func (req *BasicRequest) Name() string { return req.name diff --git a/upstream/pkg/result/result.go b/upstream/pkg/result/result.go index 6506074fd1d..e3d66b596ff 100644 --- a/upstream/pkg/result/result.go +++ b/upstream/pkg/result/result.go @@ -36,11 +36,8 @@ const ( // StepResultType default step result value StepResultType ResultType = 4 - // StepArtifactsResultType default step artifacts result value - StepArtifactsResultType ResultType = 5 - - // TaskRunArtifactsResultType default taskRun artifacts result value - TaskRunArtifactsResultType ResultType = 6 + // ArtifactsResultType default artifacts result value + ArtifactsResultType ResultType = 5 ) // RunResult is used to write key/value pairs to TaskRun pod termination messages. @@ -94,10 +91,8 @@ func (r *ResultType) UnmarshalJSON(data []byte) error { *r = TaskRunResultType case "InternalTektonResult": *r = InternalTektonResultType - case "StepArtifactsResult": - *r = StepArtifactsResultType - case "TaskRunArtifactsResult": - *r = TaskRunArtifactsResultType + case "ArtifactsResult": + *r = ArtifactsResultType default: *r = UnknownResultType } diff --git a/upstream/pkg/result/result_test.go b/upstream/pkg/result/result_test.go index fbd26b3712e..5b96acb2041 100644 --- a/upstream/pkg/result/result_test.go +++ b/upstream/pkg/result/result_test.go @@ -29,38 +29,28 @@ func TestRunResult_UnmarshalJSON(t *testing.T) { name string data string pr RunResult - }{ - { - name: "type defined as string - TaskRunResult", - data: "{\"key\":\"resultName\",\"value\":\"resultValue\", \"type\": \"TaskRunResult\"}", - pr: RunResult{Key: "resultName", Value: "resultValue", ResultType: TaskRunResultType}, - }, - { - name: "type defined as string - StepResult", - data: "{\"key\":\"resultName\",\"value\":\"resultValue\", \"type\": \"StepResult\"}", - pr: RunResult{Key: "resultName", Value: "resultValue", ResultType: StepResultType}, - }, + }{{ + name: "type defined as string - TaskRunResult", + data: "{\"key\":\"resultName\",\"value\":\"resultValue\", \"type\": \"TaskRunResult\"}", + pr: RunResult{Key: "resultName", Value: "resultValue", ResultType: TaskRunResultType}, + }, { + name: "type defined as string - StepResult", + data: "{\"key\":\"resultName\",\"value\":\"resultValue\", \"type\": \"StepResult\"}", + pr: RunResult{Key: "resultName", Value: "resultValue", ResultType: StepResultType}, + }, { name: "type defined as string - InternalTektonResult", data: "{\"key\":\"resultName\",\"value\":\"\", \"type\": \"InternalTektonResult\"}", pr: RunResult{Key: "resultName", Value: "", ResultType: InternalTektonResultType}, - }, - { - name: "type defined as string - StepArtifactsResultType", - data: "{\"key\":\"resultName\",\"value\":\"\", \"type\": \"StepArtifactsResult\"}", - pr: RunResult{Key: "resultName", Value: "", ResultType: StepArtifactsResultType}, - }, - { - name: "type defined as string - TaskRunArtifactResult", - data: "{\"key\":\"resultName\",\"value\":\"\", \"type\": \"TaskRunArtifactsResult\"}", - pr: RunResult{Key: "resultName", Value: "", ResultType: TaskRunArtifactsResultType}, - }, - { + }, { + name: "type defined as string - ArtifactsResult", + data: "{\"key\":\"resultName\",\"value\":\"\", \"type\": \"ArtifactsResult\"}", + pr: RunResult{Key: "resultName", Value: "", ResultType: ArtifactsResultType}, + }, { name: "type defined as int", data: "{\"key\":\"resultName\",\"value\":\"\", \"type\": 1}", pr: RunResult{Key: "resultName", Value: "", ResultType: TaskRunResultType}, - }, - } + }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { @@ -69,7 +59,7 @@ func TestRunResult_UnmarshalJSON(t *testing.T) { t.Errorf("Unexpected error when unmarshalling the json into RunResult") } if d := cmp.Diff(tc.pr, pipRes); d != "" { - t.Error(diff.PrintWantGot(d)) + t.Errorf(diff.PrintWantGot(d)) } }) } diff --git a/upstream/pkg/spire/controller.go b/upstream/pkg/spire/controller.go index 33d5203fddf..db7fbe40f7a 100644 --- a/upstream/pkg/spire/controller.go +++ b/upstream/pkg/spire/controller.go @@ -231,15 +231,10 @@ func (sc *spireControllerAPIClient) CreateEntries(ctx context.Context, tr *v1bet var errCodes []int32 for _, r := range resp.GetResults() { - statusCode := r.GetStatus().GetCode() - if statusCode < 0 { - return fmt.Errorf("statusCode overflows uint32: %d", statusCode) - } - code := codes.Code(statusCode) - - if code != codes.AlreadyExists && code != codes.OK { + if codes.Code(r.GetStatus().GetCode()) != codes.AlreadyExists && + codes.Code(r.GetStatus().GetCode()) != codes.OK { errPaths = append(errPaths, r.GetEntry().GetSpiffeId().GetPath()) - errCodes = append(errCodes, statusCode) + errCodes = append(errCodes, r.GetStatus().GetCode()) } } @@ -301,15 +296,10 @@ func (sc *spireControllerAPIClient) DeleteEntry(ctx context.Context, tr *v1beta1 var errCodes []int32 for _, r := range resp.GetResults() { - statusCode := r.GetStatus().GetCode() - if statusCode < 0 { - return fmt.Errorf("statusCode overflows uint32: %d", statusCode) - } - code := codes.Code(statusCode) - - if code != codes.NotFound && code != codes.OK { + if codes.Code(r.GetStatus().GetCode()) != codes.NotFound && + codes.Code(r.GetStatus().GetCode()) != codes.OK { errIds = append(errIds, r.GetId()) - errCodes = append(errCodes, statusCode) + errCodes = append(errCodes, r.GetStatus().GetCode()) } } diff --git a/upstream/pkg/taskrunmetrics/metrics.go b/upstream/pkg/taskrunmetrics/metrics.go index 94a5dad73b7..9d26d3a8cb7 100644 --- a/upstream/pkg/taskrunmetrics/metrics.go +++ b/upstream/pkg/taskrunmetrics/metrics.go @@ -121,7 +121,6 @@ var ( type Recorder struct { mutex sync.Mutex initialized bool - cfg *config.Metrics ReportingPeriod time.Duration @@ -145,15 +144,15 @@ var ( // to log the TaskRun related metrics func NewRecorder(ctx context.Context) (*Recorder, error) { once.Do(func() { - cfg := config.FromContextOrDefaults(ctx) r = &Recorder{ initialized: true, - cfg: cfg.Metrics, // Default to reporting metrics every 30s. ReportingPeriod: 30 * time.Second, } + cfg := config.FromContextOrDefaults(ctx) + errRegistering = viewRegister(cfg.Metrics) if errRegistering != nil { r.initialized = false @@ -213,12 +212,6 @@ func viewRegister(cfg *config.Metrics) error { } } - trCountViewTags := []tag.Key{statusTag} - if cfg.CountWithReason { - trCountViewTags = append(trCountViewTags, reasonTag) - trunTag = append(trunTag, reasonTag) - } - trDurationView = &view.View{ Description: trDuration.Description(), Measure: trDuration, @@ -232,6 +225,10 @@ func viewRegister(cfg *config.Metrics) error { TagKeys: append([]tag.Key{statusTag, namespaceTag}, append(trunTag, prunTag...)...), } + trCountViewTags := []tag.Key{statusTag} + if cfg.CountWithReason { + trCountViewTags = append(trCountViewTags, reasonTag) + } trCountView = &view.View{ Description: trCount.Description(), Measure: trCount, @@ -271,21 +268,15 @@ func viewRegister(cfg *config.Metrics) error { Aggregation: view.LastValue(), } - throttleViewTags := []tag.Key{} - if cfg.ThrottleWithNamespace { - throttleViewTags = append(throttleViewTags, namespaceTag) - } runningTRsThrottledByQuotaView = &view.View{ Description: runningTRsThrottledByQuota.Description(), Measure: runningTRsThrottledByQuota, Aggregation: view.LastValue(), - TagKeys: throttleViewTags, } runningTRsThrottledByNodeView = &view.View{ Description: runningTRsThrottledByNode.Description(), Measure: runningTRsThrottledByNode, Aggregation: view.LastValue(), - TagKeys: throttleViewTags, } podLatencyView = &view.View{ Description: podLatency.Description(), @@ -326,8 +317,9 @@ func viewUnregister() { ) } -// OnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so -func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, value interface{}) { +// MetricsOnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so +func MetricsOnStore(logger *zap.SugaredLogger) func(name string, + value interface{}) { return func(name string, value interface{}) { if name == config.GetMetricsConfigName() { cfg, ok := value.(*config.Metrics) @@ -335,8 +327,6 @@ func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, value int logger.Error("Failed to do type insertion for extracting metrics config") return } - r.updateConfig(cfg) - // Update metrics according to the configuration viewUnregister() err := viewRegister(cfg) if err != nil { @@ -348,10 +338,8 @@ func OnStore(logger *zap.SugaredLogger, r *Recorder) func(name string, value int } func pipelinerunInsertTag(pipeline, pipelinerun string) []tag.Mutator { - return []tag.Mutator{ - tag.Insert(pipelineTag, pipeline), - tag.Insert(pipelinerunTag, pipelinerun), - } + return []tag.Mutator{tag.Insert(pipelineTag, pipeline), + tag.Insert(pipelinerunTag, pipelinerun)} } func pipelineInsertTag(pipeline, pipelinerun string) []tag.Mutator { @@ -359,10 +347,8 @@ func pipelineInsertTag(pipeline, pipelinerun string) []tag.Mutator { } func taskrunInsertTag(task, taskrun string) []tag.Mutator { - return []tag.Mutator{ - tag.Insert(taskTag, task), - tag.Insert(taskrunTag, taskrun), - } + return []tag.Mutator{tag.Insert(taskTag, task), + tag.Insert(taskrunTag, taskrun)} } func taskInsertTag(task, taskrun string) []tag.Mutator { @@ -379,15 +365,6 @@ func getTaskTagName(tr *v1.TaskRun) string { case tr.Spec.TaskRef != nil && len(tr.Spec.TaskRef.Name) > 0: taskName = tr.Spec.TaskRef.Name case tr.Spec.TaskSpec != nil: - pipelineTaskTable, hasPipelineTaskTable := tr.Labels[pipeline.PipelineTaskLabelKey] - if hasPipelineTaskTable && len(pipelineTaskTable) > 0 { - taskName = pipelineTaskTable - } - case tr.Spec.TaskRef != nil && tr.Spec.TaskRef.Kind == v1.ClusterTaskRefKind: - clusterTaskLabel, hasClusterTaskLabel := tr.Labels[pipeline.ClusterTaskLabelKey] - if hasClusterTaskLabel && len(clusterTaskLabel) > 0 { - taskName = clusterTaskLabel - } default: if len(tr.Labels) > 0 { taskLabel, hasTaskLabel := tr.Labels[pipeline.TaskLabelKey] @@ -400,13 +377,6 @@ func getTaskTagName(tr *v1.TaskRun) string { return taskName } -func (r *Recorder) updateConfig(cfg *config.Metrics) { - r.mutex.Lock() - defer r.mutex.Unlock() - - r.cfg = cfg -} - // DurationAndCount logs the duration of TaskRun execution and // count for number of TaskRuns succeed or failed // returns an error if its failed to log the metrics @@ -472,43 +442,22 @@ func (r *Recorder) RunningTaskRuns(ctx context.Context, lister listers.TaskRunLi return err } - addNamespaceLabelToQuotaThrottleMetric := r.cfg != nil && r.cfg.ThrottleWithNamespace - var runningTrs int - trsThrottledByQuota := map[string]int{} - trsThrottledByQuotaCount := 0 - trsThrottledByNode := map[string]int{} - trsThrottledByNodeCount := 0 + var trsThrottledByQuota int + var trsThrottledByNode int var trsWaitResolvingTaskRef int for _, pr := range trs { - // initialize metrics with namespace tag to zero if unset; will then update as needed below - _, ok := trsThrottledByQuota[pr.Namespace] - if !ok { - trsThrottledByQuota[pr.Namespace] = 0 - } - _, ok = trsThrottledByNode[pr.Namespace] - if !ok { - trsThrottledByNode[pr.Namespace] = 0 - } - if pr.IsDone() { continue } runningTrs++ - succeedCondition := pr.Status.GetCondition(apis.ConditionSucceeded) if succeedCondition != nil && succeedCondition.Status == corev1.ConditionUnknown { switch succeedCondition.Reason { case pod.ReasonExceededResourceQuota: - trsThrottledByQuotaCount++ - cnt := trsThrottledByQuota[pr.Namespace] - cnt++ - trsThrottledByQuota[pr.Namespace] = cnt + trsThrottledByQuota++ case pod.ReasonExceededNodeResources: - trsThrottledByNodeCount++ - cnt := trsThrottledByNode[pr.Namespace] - cnt++ - trsThrottledByNode[pr.Namespace] = cnt + trsThrottledByNode++ case v1.TaskRunReasonResolvingTaskRef: trsWaitResolvingTaskRef++ } @@ -521,32 +470,12 @@ func (r *Recorder) RunningTaskRuns(ctx context.Context, lister listers.TaskRunLi } metrics.Record(ctx, runningTRsCount.M(float64(runningTrs))) metrics.Record(ctx, runningTRs.M(float64(runningTrs))) + metrics.Record(ctx, runningTRsThrottledByNodeCount.M(float64(trsThrottledByNode))) + metrics.Record(ctx, runningTRsThrottledByQuotaCount.M(float64(trsThrottledByQuota))) metrics.Record(ctx, runningTRsWaitingOnTaskResolutionCount.M(float64(trsWaitResolvingTaskRef))) - metrics.Record(ctx, runningTRsThrottledByQuotaCount.M(float64(trsThrottledByQuotaCount))) - metrics.Record(ctx, runningTRsThrottledByNodeCount.M(float64(trsThrottledByNodeCount))) + metrics.Record(ctx, runningTRsThrottledByNode.M(float64(trsThrottledByNode))) + metrics.Record(ctx, runningTRsThrottledByQuota.M(float64(trsThrottledByQuota))) - for ns, cnt := range trsThrottledByQuota { - var mutators []tag.Mutator - if addNamespaceLabelToQuotaThrottleMetric { - mutators = []tag.Mutator{tag.Insert(namespaceTag, ns)} - } - ctx, err := tag.New(ctx, mutators...) - if err != nil { - return err - } - metrics.Record(ctx, runningTRsThrottledByQuota.M(float64(cnt))) - } - for ns, cnt := range trsThrottledByNode { - var mutators []tag.Mutator - if addNamespaceLabelToQuotaThrottleMetric { - mutators = []tag.Mutator{tag.Insert(namespaceTag, ns)} - } - ctx, err := tag.New(ctx, mutators...) - if err != nil { - return err - } - metrics.Record(ctx, runningTRsThrottledByNode.M(float64(cnt))) - } return nil } @@ -594,10 +523,8 @@ func (r *Recorder) RecordPodLatency(ctx context.Context, pod *corev1.Pod, tr *v1 ctx, err := tag.New( ctx, - append([]tag.Mutator{ - tag.Insert(namespaceTag, tr.Namespace), - tag.Insert(podTag, pod.Name), - }, + append([]tag.Mutator{tag.Insert(namespaceTag, tr.Namespace), + tag.Insert(podTag, pod.Name)}, r.insertTaskTag(taskName, tr.Name)...)...) if err != nil { return err diff --git a/upstream/pkg/taskrunmetrics/metrics_test.go b/upstream/pkg/taskrunmetrics/metrics_test.go index daf8342dbce..7a23478d21d 100644 --- a/upstream/pkg/taskrunmetrics/metrics_test.go +++ b/upstream/pkg/taskrunmetrics/metrics_test.go @@ -44,7 +44,7 @@ var ( completionTime = metav1.NewTime(startTime.Time.Add(time.Minute)) ) -func getConfigContext(countWithReason, throttleWithNamespace bool) context.Context { +func getConfigContext(countWithReason bool) context.Context { ctx := context.Background() cfg := &config.Config{ Metrics: &config.Metrics{ @@ -53,7 +53,6 @@ func getConfigContext(countWithReason, throttleWithNamespace bool) context.Conte DurationTaskrunType: config.DefaultDurationTaskrunType, DurationPipelinerunType: config.DefaultDurationPipelinerunType, CountWithReason: countWithReason, - ThrottleWithNamespace: throttleWithNamespace, }, } return config.ToContext(ctx, cfg) @@ -80,19 +79,19 @@ func TestUninitializedMetrics(t *testing.T) { } } -func TestOnStore(t *testing.T) { +func TestMetricsOnStore(t *testing.T) { log := zap.NewExample() defer log.Sync() logger := log.Sugar() - ctx := getConfigContext(false, false) + ctx := getConfigContext(false) metrics, err := NewRecorder(ctx) if err != nil { t.Fatalf("NewRecorder: %v", err) } // We check that there's no change when incorrect config is passed - OnStore(logger, metrics)(config.GetMetricsConfigName(), &config.Store{}) + MetricsOnStore(logger)(config.GetMetricsConfigName(), &config.Store{}) // Comparing function assign to struct with the one which should yield same value if reflect.ValueOf(metrics.insertTaskTag).Pointer() != reflect.ValueOf(taskrunInsertTag).Pointer() { t.Fatalf("metrics recorder shouldn't change during this OnStore call") @@ -107,7 +106,7 @@ func TestOnStore(t *testing.T) { } // We test that there's no change when incorrect values in configmap is passed - OnStore(logger, metrics)(config.GetMetricsConfigName(), cfg) + MetricsOnStore(logger)(config.GetMetricsConfigName(), cfg) // Comparing function assign to struct with the one which should yield same value if reflect.ValueOf(metrics.insertTaskTag).Pointer() != reflect.ValueOf(taskrunInsertTag).Pointer() { t.Fatalf("metrics recorder shouldn't change during this OnStore call") @@ -121,7 +120,7 @@ func TestOnStore(t *testing.T) { DurationPipelinerunType: config.DurationPipelinerunTypeLastValue, } - OnStore(logger, metrics)(config.GetMetricsConfigName(), cfg) + MetricsOnStore(logger)(config.GetMetricsConfigName(), cfg) if reflect.ValueOf(metrics.insertTaskTag).Pointer() != reflect.ValueOf(nilInsertTag).Pointer() { t.Fatalf("metrics recorder didn't change during OnStore call") } @@ -172,78 +171,6 @@ func TestRecordTaskRunDurationCount(t *testing.T) { expectedCount: 1, beforeCondition: nil, countWithReason: false, - }, { - name: "for succeeded taskrun ref cluster task", - taskRun: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{Name: "taskrun-1", Namespace: "ns", Labels: map[string]string{ - pipeline.PipelineTaskLabelKey: "task-1", - }}, - Spec: v1.TaskRunSpec{ - TaskSpec: &v1.TaskSpec{}, - }, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}, - }, - TaskRunStatusFields: v1.TaskRunStatusFields{ - StartTime: &startTime, - CompletionTime: &completionTime, - }, - }, - }, - metricName: "taskrun_duration_seconds", - expectedDurationTags: map[string]string{ - "task": "task-1", - "taskrun": "taskrun-1", - "namespace": "ns", - "status": "success", - }, - expectedCountTags: map[string]string{ - "status": "success", - }, - expectedDuration: 60, - expectedCount: 1, - beforeCondition: nil, - countWithReason: false, - }, { - name: "for succeeded taskrun create by pipelinerun", - taskRun: &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{Name: "taskrun-1", Namespace: "ns", Labels: map[string]string{ - pipeline.ClusterTaskLabelKey: "task-1", - }}, - Spec: v1.TaskRunSpec{ - TaskRef: &v1.TaskRef{Kind: v1.ClusterTaskRefKind}, - }, - Status: v1.TaskRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - }}, - }, - TaskRunStatusFields: v1.TaskRunStatusFields{ - StartTime: &startTime, - CompletionTime: &completionTime, - }, - }, - }, - metricName: "taskrun_duration_seconds", - expectedDurationTags: map[string]string{ - "task": "task-1", - "taskrun": "taskrun-1", - "namespace": "ns", - "status": "success", - }, - expectedCountTags: map[string]string{ - "status": "success", - }, - expectedDuration: 60, - expectedCount: 1, - beforeCondition: nil, - countWithReason: false, }, { name: "for succeeded taskrun with before condition", taskRun: &v1.TaskRun{ @@ -507,7 +434,6 @@ func TestRecordTaskRunDurationCount(t *testing.T) { "task": "task-1", "taskrun": "taskrun-1", "namespace": "ns", - "reason": "TaskRunImagePullFailed", "status": "failed", }, expectedCountTags: map[string]string{ @@ -522,7 +448,7 @@ func TestRecordTaskRunDurationCount(t *testing.T) { t.Run(c.name, func(t *testing.T) { unregisterMetrics() - ctx := getConfigContext(c.countWithReason, false) + ctx := getConfigContext(c.countWithReason) metrics, err := NewRecorder(ctx) if err != nil { t.Fatalf("NewRecorder: %v", err) @@ -577,7 +503,7 @@ func TestRecordRunningTaskRunsCount(t *testing.T) { } } - ctx = getConfigContext(false, false) + ctx = getConfigContext(false) metrics, err := NewRecorder(ctx) if err != nil { t.Fatalf("NewRecorder: %v", err) @@ -597,7 +523,6 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { nodeCount float64 quotaCount float64 waitCount float64 - addNS bool }{ { status: corev1.ConditionTrue, @@ -607,20 +532,10 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { status: corev1.ConditionTrue, reason: pod.ReasonExceededResourceQuota, }, - { - status: corev1.ConditionTrue, - reason: pod.ReasonExceededResourceQuota, - addNS: true, - }, { status: corev1.ConditionTrue, reason: pod.ReasonExceededNodeResources, }, - { - status: corev1.ConditionTrue, - reason: pod.ReasonExceededNodeResources, - addNS: true, - }, { status: corev1.ConditionTrue, reason: v1.TaskRunReasonResolvingTaskRef, @@ -655,18 +570,6 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { reason: pod.ReasonExceededNodeResources, nodeCount: 3, }, - { - status: corev1.ConditionUnknown, - reason: pod.ReasonExceededResourceQuota, - quotaCount: 3, - addNS: true, - }, - { - status: corev1.ConditionUnknown, - reason: pod.ReasonExceededNodeResources, - nodeCount: 3, - addNS: true, - }, { status: corev1.ConditionUnknown, reason: v1.TaskRunReasonResolvingTaskRef, @@ -676,9 +579,9 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { unregisterMetrics() ctx, _ := ttesting.SetupFakeContext(t) informer := faketaskruninformer.Get(ctx) - for range multiplier { + for i := 0; i < multiplier; i++ { tr := &v1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("taskrun-"), Namespace: "test"}, + ObjectMeta: metav1.ObjectMeta{Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("taskrun-")}, Status: v1.TaskRunStatus{ Status: duckv1.Status{ Conditions: duckv1.Conditions{{ @@ -694,7 +597,7 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { } } - ctx = getConfigContext(false, tc.addNS) + ctx = getConfigContext(false) metrics, err := NewRecorder(ctx) if err != nil { t.Fatalf("NewRecorder: %v", err) @@ -704,13 +607,7 @@ func TestRecordRunningTaskRunsThrottledCounts(t *testing.T) { t.Errorf("RunningTaskRuns: %v", err) } metricstest.CheckLastValueData(t, "running_taskruns_throttled_by_quota_count", map[string]string{}, tc.quotaCount) - nsMap := map[string]string{} - if tc.addNS { - nsMap = map[string]string{namespaceTag.Name(): "test"} - } - metricstest.CheckLastValueData(t, "running_taskruns_throttled_by_quota", nsMap, tc.quotaCount) metricstest.CheckLastValueData(t, "running_taskruns_throttled_by_node_count", map[string]string{}, tc.nodeCount) - metricstest.CheckLastValueData(t, "running_taskruns_throttled_by_node", nsMap, tc.nodeCount) metricstest.CheckLastValueData(t, "running_taskruns_waiting_on_task_resolution_count", map[string]string{}, tc.waitCount) } } @@ -841,7 +738,7 @@ func TestRecordPodLatency(t *testing.T) { t.Run(td.name, func(t *testing.T) { unregisterMetrics() - ctx := getConfigContext(false, false) + ctx := getConfigContext(false) metrics, err := NewRecorder(ctx) if err != nil { t.Fatalf("NewRecorder: %v", err) diff --git a/upstream/releases.md b/upstream/releases.md index fb34dd8fa1a..2a3660865a4 100644 --- a/upstream/releases.md +++ b/upstream/releases.md @@ -41,24 +41,12 @@ Further documentation available: ## Release -### v0.64 -- **Latest Release**: [v0.64.0][v0.64-0] (2024-09-27) ([docs][v0.64-0-docs], [examples][v0.64-0-examples]) -- **Initial Release**: [v0.64.0][v0.64-0] (2024-09-27) -- **End of Life**: 2024-10-26 -- **Patch Releases**: [v0.64.0][v0.64-0] - -### v0.62 (LTS) -- **Latest Release**: [v0.62.2][v0.62-2] (2024-08-23) ([docs][v0.62-2-docs], [examples][v0.62-2-examples]) -- **Initial Release**: [v0.62.0][v0.62-0] (2024-07-23) -- **End of Life**: 2025-07-23 -- **Patch Releases**: [v0.62.0][v0.62-0], [v0.62.1][v0.62-1], [v0.62.2][v0.62-2] - -### v0.59 (LTS) +### v0.58 -- **Latest Release**: [v0.59.2][v0.59-2] (2024-07-04) ([docs][v0.59-2-docs], [examples][v0.59-2-examples]) -- **Initial Release**: [v0.59.0][v0.59-0] (2024-04-25) -- **Estimated End of Life**: 2025-04-24 -- **Patch Releases**: [v0.59.0][v0.59-0], [v0.59.1][v0.59-1], [v0.59.2][v0.59-2] +- **Latest Release**: [v0.58.0][v0.58-0] (2024-03-20) ([docs][v0.58-0-docs], [examples][v0.58-0-examples]) +- **Initial Release**: [v0.58.0][v0.58-0] (2024-03-20) +- **End of Life**: 2024-04-20 +- **Patch Releases**: [v0.58.0][v0.58-0] ### v0.56 (LTS) @@ -74,33 +62,22 @@ Further documentation available: - **Estimated End of Life**: 2024-10-25 - **Patch Releases**: [v0.53.0][v0.53-0], [v0.53.1][v0.53-1], [v0.53.2][v0.53-2], [v0.53.3][v0.53-3], [v0.53.4][v0.53-4], [v0.53.5][v0.53-5] +### v0.50 (LTS) -## End of Life Releases - -### v0.63 -- **Latest Release**: [v0.63.0][v0.63-0] (2024-08-30) ([docs][v0.63-0-docs], [examples][v0.63-0-examples]) -- **Initial Release**: [v0.63.0][v0.63-0] (2024-08-30) -- **End of Life**: 2024-09-27 -- **Patch Releases**: [v0.63.0][v0.63-0] +- **Latest Release**: [v0.50.5][v0.50-5] (2023-11-16) ([docs][v0.50-5-docs], [examples][v0.50-5-examples]) +- **Initial Release**: [v0.50.0][v0.50-0] (2023-07-25) +- **Estimated End of Life**: 2024-07-25 +- **Patch Releases**: [v0.50.0][v0.50-0] [v0.50.1][v0.50-1] [v0.50.2][v0.50-2] [v0.50.3][v0.50-3] [v0.50.4][v0.50-4] [v0.50.5][v0.50-5] -### v0.61 -- **Latest Release**: [v0.61.0][v0.61-0] (2024-06-25) ([docs][v0.61-0-docs], [examples][v0.61-0-examples]) -- **Initial Release**: [v0.61.0][v0.61-0] (2024-06-25) -- **End of Life**: 2024-07-25 -- **Patch Releases**: [v0.61.0][v0.61-0] +### v0.47 (LTS) -### v0.60 -- **Latest Release**: [v0.60.1][v0.60-1] (2024-05-28) ([docs][v0.60-1-docs], [examples][v0.60-1-examples]) -- **Initial Release**: [v0.60.0][v0.60-0] (2024-05-22) -- **End of Life**: 2024-06-22 -- **Patch Releases**: [v0.60.0][v0.60-0], [v0.60.1][v0.60-1] +- **Latest Release**: [v0.47.8][v0-47-8] (2024-04-05) ([docs][v0-47-8-docs], [examples][v0-47-8-examples]) +- **Initial Release**: [v0.47.0][v0-47-0] (2023-03-17) +- **Estimated End of Life**: 2024-03-17 +- **Patch Releases**: [v0.47.0][v0-47-0], [v0.47.1][v0-47-1], [v0.47.2][v0-47-2], [v0.47.3][v0-47-3], [v0.47.4][v0-47-4], [v0.47.5][v0-47-5], [v0.47.6][v0-47-6], [v0.47.7][v0-47-7], [v0.47.8][v0-47-8] -### v0.58 -- **Latest Release**: [v0.58.0][v0.58-0] (2024-03-20) ([docs][v0.58-0-docs], [examples][v0.58-0-examples]) -- **Initial Release**: [v0.58.0][v0.58-0] (2024-03-20) -- **End of Life**: 2024-04-20 -- **Patch Releases**: [v0.58.0][v0.58-0] +## End of Life Releases ### v0.57 @@ -130,13 +107,6 @@ Further documentation available: - **End of Life**: 2023-09-17 - **Patch Releases**: [v0.51.0][v0.51-0] -### v0.50 (LTS) - -- **Latest Release**: [v0.50.5][v0.50-5] (2023-11-16) ([docs][v0.50-5-docs], [examples][v0.50-5-examples]) -- **Initial Release**: [v0.50.0][v0.50-0] (2023-07-25) -- **Estimated End of Life**: 2024-07-25 -- **Patch Releases**: [v0.50.0][v0.50-0] [v0.50.1][v0.50-1] [v0.50.2][v0.50-2] [v0.50.3][v0.50-3] [v0.50.4][v0.50-4] [v0.50.5][v0.50-5] - ### v0.49 - **Latest Release**: [v0.49.0][v0-49-0] (2023-06-20) ([docs][v0-49-0-docs], [examples][v0-49-0-examples]) @@ -151,13 +121,6 @@ Further documentation available: - **End of Life**: 2023-06-20 - **Patch Releases**: [v0.48.0][v0-48-0] -### v0.47 (LTS) - -- **Latest Release**: [v0.47.8][v0-47-8] (2024-04-05) ([docs][v0-47-8-docs], [examples][v0-47-8-examples]) -- **Initial Release**: [v0.47.0][v0-47-0] (2023-03-17) -- **Estimated End of Life**: 2024-03-17 -- **Patch Releases**: [v0.47.0][v0-47-0], [v0.47.1][v0-47-1], [v0.47.2][v0-47-2], [v0.47.3][v0-47-3], [v0.47.4][v0-47-4], [v0.47.5][v0-47-5], [v0.47.6][v0-47-6], [v0.47.7][v0-47-7], [v0.47.8][v0-47-8] - ### v0.46 - **Latest Release**: [v0.46.0][v0-46-0] (2023-03-17) ([docs][v0-46-0-docs], [examples][v0-46-0-examples]) @@ -239,17 +202,6 @@ Older releases are EOL and available on [GitHub][tekton-pipeline-releases]. [release-notes-standards]: https://github.com/tektoncd/community/blob/main/standards.md#release-notes -[v0.64-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.64.0 -[v0.63-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.63.0 -[v0.62-2]: https://github.com/tektoncd/pipeline/releases/tag/v0.62.2 -[v0.62-1]: https://github.com/tektoncd/pipeline/releases/tag/v0.62.1 -[v0.62-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.62.0 -[v0.61-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.61.0 -[v0.60-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.60.0 -[v0.60-1]: https://github.com/tektoncd/pipeline/releases/tag/v0.60.1 -[v0.59-2]: https://github.com/tektoncd/pipeline/releases/tag/v0.59.2 -[v0.59-1]: https://github.com/tektoncd/pipeline/releases/tag/v0.59.1 -[v0.59-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.59.0 [v0.58-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.58.0 [v0.57-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.57.0 [v0.56-3]: https://github.com/tektoncd/pipeline/releases/tag/v0.56.3 @@ -309,17 +261,6 @@ Older releases are EOL and available on [GitHub][tekton-pipeline-releases]. [v0-37-5]: https://github.com/tektoncd/pipeline/releases/tag/v0.37.5 [v0-37-0]: https://github.com/tektoncd/pipeline/releases/tag/v0.37.0 -[v0.64-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.64.0/docs#tekton-pipelines -[v0.63-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.63.0/docs#tekton-pipelines -[v0.62-2-docs]: https://github.com/tektoncd/pipeline/tree/v0.62.2/docs#tekton-pipelines -[v0.62-1-docs]: https://github.com/tektoncd/pipeline/tree/v0.62.1/docs#tekton-pipelines -[v0.62-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.62.0/docs#tekton-pipelines -[v0.61-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.61.0/docs#tekton-pipelines -[v0.60-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.60.0/docs#tekton-pipelines -[v0.60-1-docs]: https://github.com/tektoncd/pipeline/tree/v0.60.1/docs#tekton-pipelines -[v0.59-2-docs]: https://github.com/tektoncd/pipeline/tree/v0.59.2/docs#tekton-pipelines -[v0.59-1-docs]: https://github.com/tektoncd/pipeline/tree/v0.59.1/docs#tekton-pipelines -[v0.59-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.59.0/docs#tekton-pipelines [v0.58-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.58.0/docs#tekton-pipelines [v0.57-0-docs]: https://github.com/tektoncd/pipeline/tree/v0.57.0/docs#tekton-pipelines [v0.56-3-docs]: https://github.com/tektoncd/pipeline/tree/v0.56.3/docs#tekton-pipelines @@ -342,17 +283,6 @@ Older releases are EOL and available on [GitHub][tekton-pipeline-releases]. [v0-38-4-docs]: https://github.com/tektoncd/pipeline/tree/v0.38.4/docs#tekton-pipelines [v0-37-5-docs]: https://github.com/tektoncd/pipeline/tree/v0.37.5/docs#tekton-pipelines -[v0.64-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.64.0/examples#examples -[v0.63-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.63.0/examples#examples -[v0.62-2-examples]: https://github.com/tektoncd/pipeline/tree/v0.62.2/examples#examples -[v0.62-1-examples]: https://github.com/tektoncd/pipeline/tree/v0.62.1/examples#examples -[v0.62-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.62.0/examples#examples -[v0.61-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.61.0/examples#examples -[v0.60-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.60.0/examples#examples -[v0.60-1-examples]: https://github.com/tektoncd/pipeline/tree/v0.60.1/examples#examples -[v0.59-2-examples]: https://github.com/tektoncd/pipeline/tree/v0.59.2/examples#examples -[v0.59-1-examples]: https://github.com/tektoncd/pipeline/tree/v0.59.1/examples#examples -[v0.59-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.59.0/examples#examples [v0.58-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.58.0/examples#examples [v0.57-0-examples]: https://github.com/tektoncd/pipeline/tree/v0.57.0/examples#examples [v0.56-3-examples]: https://github.com/tektoncd/pipeline/tree/v0.56.3/examples#examples diff --git a/upstream/tekton/bugfix-release.sh b/upstream/tekton/bugfix-release.sh index dd3ac229528..004d7670190 100755 --- a/upstream/tekton/bugfix-release.sh +++ b/upstream/tekton/bugfix-release.sh @@ -41,18 +41,11 @@ echo "> Starting the release pipeline" tkn pipeline start pipeline-release \ --serviceaccount=release-right-meow \ --param=gitRevision="${TEKTON_RELEASE_GIT_SHA}" \ - --param=imageRegistry=ghcr.io \ - --param=imageRegistryRegions="" \ - --param=imageRegistryPath=tektoncd/pipeline \ - --param=imageRegistryUser=tekton-robot \ --param=serviceAccountPath=release.json \ - --param serviceAccountImagesPath=credentials \ --param=versionTag="${TEKTON_VERSION}" \ --param=releaseBucket=gs://tekton-releases/pipeline \ - --param=koExtraArgs=" " \ --param=releaseAsLatest="false" \ --workspace name=release-secret,secret=release-secret \ - --workspace name=release-images-secret,secret=ghcr-creds \ --workspace name=workarea,volumeClaimTemplateFile=workspace-template.yaml --use-param-defaults --pipeline-timeout 3h --showlog RELEASE_FILE=https://storage.googleapis.com/tekton-releases/pipeline/previous/${TEKTON_VERSION}/release.yaml diff --git a/upstream/tekton/publish.yaml b/upstream/tekton/publish.yaml index 3709eacb342..8a3ae9bbc4b 100644 --- a/upstream/tekton/publish.yaml +++ b/upstream/tekton/publish.yaml @@ -73,7 +73,7 @@ spec: steps: - name: container-registry-auth - image: cgr.dev/chainguard/crane:latest-dev@sha256:1a9ad542fa38507436d881646db7248fa5b8257614b4819012021046a494f3d1 + image: cgr.dev/chainguard/crane:latest-dev@sha256:b33c82b22a6cfb21e3db968fba5f426461f7540d7fa37048e2a6ffb9aaca7f19 script: | #!/bin/sh set -ex @@ -92,7 +92,7 @@ spec: cp ${DOCKER_CONFIG} /workspace/docker-config.json - name: create-ko-yaml - image: cgr.dev/chainguard/go:latest-dev@sha256:ac083e53ba09176079a651dc72d7cf4baac4b39581e79c26c2595963a28a53bc + image: cgr.dev/chainguard/go:latest-dev@sha256:35dc4adbb3b6fadafd60d0a004d06d706f2f6ed1511f5c24f22f92f8fe94f783 script: | #!/bin/sh set -ex @@ -135,7 +135,7 @@ spec: cat /workspace/.ko.yaml - name: run-ko - image: gcr.io/tekton-releases/dogfooding/ko@sha256:1c27e4e98ce4dccab532295d892db443078b36011438be183f8fccfe6651a8e6 + image: gcr.io/tekton-releases/dogfooding/ko@sha256:bdcd596b40583f6f8316745e27d7ff327a0756fb6aee1251dfc0bdbd01b26c88 env: - name: KO_DOCKER_REPO value: $(params.imageRegistry)/$(params.imageRegistryPath) @@ -198,7 +198,7 @@ spec: sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/release.yaml sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/release.notags.yaml - name: koparse - image: gcr.io/tekton-releases/dogfooding/koparse@sha256:cec528145eca7e66b3ea2e4459928b1c593336ece922302ef342912ed571a59b + image: gcr.io/tekton-releases/dogfooding/koparse@sha256:6b70f2d6fc1cc7849c5e65dcf404ee153653055799ceea511935bba7a27d3c44 script: | set -ex @@ -232,7 +232,7 @@ spec: ${PRESERVE_IMPORT_PATH} > /workspace/built_images - name: tag-images - image: cgr.dev/chainguard/crane:latest-dev@sha256:1a9ad542fa38507436d881646db7248fa5b8257614b4819012021046a494f3d1 + image: cgr.dev/chainguard/crane:latest-dev@sha256:b33c82b22a6cfb21e3db968fba5f426461f7540d7fa37048e2a6ffb9aaca7f19 script: | #!/bin/sh set -ex diff --git a/upstream/test/affinity_assistant_test.go b/upstream/test/affinity_assistant_test.go index a40e1942324..e74942b299f 100644 --- a/upstream/test/affinity_assistant_test.go +++ b/upstream/test/affinity_assistant_test.go @@ -56,14 +56,14 @@ spec: - name: my-workspace taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo hello foo - name: bar workspaces: - name: my-workspace taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo hello bar workspaces: - name: my-workspace @@ -151,14 +151,14 @@ spec: - name: my-workspace taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo hello foo - name: bar workspaces: - name: my-workspace2 taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo hello bar - name: double-ws workspaces: @@ -166,12 +166,12 @@ spec: - name: my-workspace2 taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo double-ws - name: no-ws taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo no-ws workspaces: - name: my-workspace diff --git a/upstream/test/artifacts_test.go b/upstream/test/artifacts_test.go index 14bb523ea7b..39ca286b3aa 100644 --- a/upstream/test/artifacts_test.go +++ b/upstream/test/artifacts_test.go @@ -40,57 +40,43 @@ var ( } ) -func TestSurfaceArtifacts(t *testing.T) { - tests := []struct { - desc string - resultExtractionMethod string - }{ - { - desc: "surface artifacts through termination message", - resultExtractionMethod: config.ResultExtractionMethodTerminationMessage}, - { - desc: "surface artifacts through sidecar logs", - resultExtractionMethod: config.ResultExtractionMethodSidecarLogs}, - } - - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - featureFlags := getFeatureFlagsBaseOnAPIFlag(t) - checkFlagsEnabled := requireAllGates(requireEnableStepArtifactsGate) +func TestSurfaceArtifactsThroughTerminationMessage(t *testing.T) { + featureFlags := getFeatureFlagsBaseOnAPIFlag(t) + checkFlagsEnabled := requireAllGates(requireEnableStepArtifactsGate) - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - c, namespace := setup(ctx, t) - checkFlagsEnabled(ctx, t, c, "") - previous := featureFlags.ResultExtractionMethod - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": tc.resultExtractionMethod, - }) + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + c, namespace := setup(ctx, t) + checkFlagsEnabled(ctx, t, c, "") + previous := featureFlags.ResultExtractionMethod + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": config.ResultExtractionMethodTerminationMessage, + }) - knativetest.CleanupOnInterrupt(func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }, t.Logf) - defer func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }() + knativetest.CleanupOnInterrupt(func() { + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": previous, + }) + tearDown(ctx, t, c, namespace) + }, t.Logf) + defer func() { + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": previous, + }) + tearDown(ctx, t, c, namespace) + }() - taskRunName := helpers.ObjectNameForTest(t) + taskRunName := helpers.ObjectNameForTest(t) - fqImageName := getTestImage(busyboxImage) + fqImageName := getTestImage(busyboxImage) - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := simpleArtifactProducerTask(t, namespace, fqImageName) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` + t.Logf("Creating Task and TaskRun in namespace %s", namespace) + task := simpleArtifactProducerTask(t, namespace, fqImageName) + if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create Task: %s", err) + } + taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` metadata: name: %s namespace: %s @@ -98,33 +84,31 @@ spec: taskRef: name: %s `, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } + if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create TaskRun: %s", err) + } - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } + if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { + t.Errorf("Error waiting for TaskRun to finish: %s", err) + } - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "source", - Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, - Uri: "git:jjjsss", - }}, - }}, taskrun.Status.Steps[0].Inputs); d != "" { - t.Fatalf(`The expected stepState Inputs does not match created taskrun stepState Inputs. Here is the diff: %v`, d) - } - if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "image", BuildOutput: true, - Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48"}, - Uri: "pkg:balba", - }}, - }}, taskrun.Status.Steps[0].Outputs); d != "" { - t.Fatalf(`The expected stepState Outputs does not match created taskrun stepState Outputs. Here is the diff: %v`, d) - } - }) + taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) + } + if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "input-artifacts", + Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, + Uri: "git:jjjsss", + }}, + }}, taskrun.Status.Steps[0].Inputs); d != "" { + t.Fatalf(`The expected stepState Inputs does not match created taskrun stepState Inputs. Here is the diff: %v`, d) + } + if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "build-result", + Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48"}, + Uri: "pkg:balba", + }}, + }}, taskrun.Status.Steps[0].Outputs); d != "" { + t.Fatalf(`The expected stepState Outputs does not match created taskrun stepState Outputs. Here is the diff: %v`, d) } } @@ -191,7 +175,7 @@ spec: }}, taskrun.Status.Steps[0].Inputs); d != "" { t.Fatalf(`The expected stepState Inputs does not match created taskrun stepState Inputs. Here is the diff: %v`, d) } - if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "build-result", BuildOutput: false, + if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "build-result", Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48"}, Uri: "pkg:balba", }}, @@ -201,67 +185,53 @@ spec: } func TestConsumeArtifacts(t *testing.T) { - tests := []struct { - desc string - resultExtractionMethod string - }{ - { - desc: "surface artifacts through termination message", - resultExtractionMethod: config.ResultExtractionMethodTerminationMessage}, - { - desc: "surface artifacts through sidecar logs", - resultExtractionMethod: config.ResultExtractionMethodSidecarLogs}, - } - - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - featureFlags := getFeatureFlagsBaseOnAPIFlag(t) - checkFlagsEnabled := requireAllGates(map[string]string{ - "enable-artifacts": "true", - "enable-step-actions": "true", - }) + featureFlags := getFeatureFlagsBaseOnAPIFlag(t) + checkFlagsEnabled := requireAllGates(map[string]string{ + "enable-artifacts": "true", + "enable-step-actions": "true", + }) - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - c, namespace := setup(ctx, t) - checkFlagsEnabled(ctx, t, c, "") - previous := featureFlags.ResultExtractionMethod - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": tc.resultExtractionMethod, - }) + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + c, namespace := setup(ctx, t) + checkFlagsEnabled(ctx, t, c, "") + previous := featureFlags.ResultExtractionMethod + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": config.ResultExtractionMethodTerminationMessage, + }) - knativetest.CleanupOnInterrupt(func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }, t.Logf) + knativetest.CleanupOnInterrupt(func() { + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": previous, + }) + tearDown(ctx, t, c, namespace) + }, t.Logf) - defer func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }() - taskRunName := helpers.ObjectNameForTest(t) + defer func() { + updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ + "results-from": previous, + }) + tearDown(ctx, t, c, namespace) + }() + taskRunName := helpers.ObjectNameForTest(t) - fqImageName := getTestImage(busyboxImage) + fqImageName := getTestImage(busyboxImage) - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := simpleArtifactProducerTask(t, namespace, fqImageName) - task.Spec.Steps = append(task.Spec.Steps, - v1.Step{Name: "consume-outputs", Image: fqImageName, - Command: []string{"sh", "-c", "echo -n $(steps.hello.outputs.image) >> $(step.results.result1.path)"}, - Results: []v1.StepResult{{Name: "result1", Type: v1.ResultsTypeString}}}, - v1.Step{Name: "consume-inputs", Image: fqImageName, - Command: []string{"sh", "-c", "echo -n $(steps.hello.inputs.source) >> $(step.results.result2.path)"}, - Results: []v1.StepResult{{Name: "result2", Type: v1.ResultsTypeString}}}, - ) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` + t.Logf("Creating Task and TaskRun in namespace %s", namespace) + task := simpleArtifactProducerTask(t, namespace, fqImageName) + task.Spec.Steps = append(task.Spec.Steps, + v1.Step{Name: "consume-outputs", Image: fqImageName, + Command: []string{"sh", "-c", "echo -n $(steps.hello.outputs) >> $(step.results.result1.path)"}, + Results: []v1.StepResult{{Name: "result1", Type: v1.ResultsTypeString}}}, + v1.Step{Name: "consume-inputs", Image: fqImageName, + Command: []string{"sh", "-c", "echo -n $(steps.hello.inputs) >> $(step.results.result2.path)"}, + Results: []v1.StepResult{{Name: "result2", Type: v1.ResultsTypeString}}}, + ) + if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create Task: %s", err) + } + taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` metadata: name: %s namespace: %s @@ -269,127 +239,27 @@ spec: taskRef: name: %s `, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } - - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } - - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - wantOut := `[{digest:{sha1:95588b8f34c31eb7d62c92aaa4e6506639b06ef2,sha256:df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48},uri:pkg:balba}]` - gotOut := taskrun.Status.Steps[1].Results[0].Value.StringVal - if d := cmp.Diff(wantOut, gotOut); d != "" { - t.Fatalf(`The expected artifact outputs consumption result doesnot match expected. Here is the diff: %v`, d) - } - wantIn := `[{digest:{sha256:b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0},uri:git:jjjsss}]` - gotIn := taskrun.Status.Steps[2].Results[0].Value.StringVal - if d := cmp.Diff(wantIn, gotIn); d != "" { - t.Fatalf(`The expected artifact Inputs consumption result doesnot match expected. Here is the diff: %v`, d) - } - }) + if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create TaskRun: %s", err) } -} -func TestStepProduceResultsAndArtifacts(t *testing.T) { - tests := []struct { - desc string - resultExtractionMethod string - }{ - { - desc: "surface artifacts through termination message", - resultExtractionMethod: config.ResultExtractionMethodTerminationMessage}, - { - desc: "surface artifacts through sidecar logs", - resultExtractionMethod: config.ResultExtractionMethodSidecarLogs}, + if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { + t.Errorf("Error waiting for TaskRun to finish: %s", err) } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - featureFlags := getFeatureFlagsBaseOnAPIFlag(t) - checkFlagsEnabled := requireAllGates(map[string]string{ - "enable-artifacts": "true", - "enable-step-actions": "true", - }) - - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - c, namespace := setup(ctx, t) - checkFlagsEnabled(ctx, t, c, "") - previous := featureFlags.ResultExtractionMethod - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": tc.resultExtractionMethod, - }) - - knativetest.CleanupOnInterrupt(func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }, t.Logf) - - defer func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - "results-from": previous, - }) - tearDown(ctx, t, c, namespace) - }() - taskRunName := helpers.ObjectNameForTest(t) - - fqImageName := getTestImage(busyboxImage) - - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := produceResultsAndArtifactsTask(t, namespace, fqImageName) - - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - taskRef: - name: %s -`, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } - - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } - - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "source", - Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha256": "b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0"}, - Uri: "git:jjjsss", - }}, - }}, taskrun.Status.Steps[0].Inputs); d != "" { - t.Fatalf(`The expected stepState Inputs does not match created taskrun stepState Inputs. Here is the diff: %v`, d) - } - if d := cmp.Diff([]v1.TaskRunStepArtifact{{Name: "image", - Values: []v1.ArtifactValue{{Digest: map[v1.Algorithm]string{"sha1": "95588b8f34c31eb7d62c92aaa4e6506639b06ef2", "sha256": "df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48"}, - Uri: "pkg:balba", - }}, - }}, taskrun.Status.Steps[0].Outputs); d != "" { - t.Fatalf(`The expected stepState Outputs does not match created taskrun stepState Outputs. Here is the diff: %v`, d) - } - - wantResult := `result1Value` - gotResult := taskrun.Status.Steps[0].Results[0].Value.StringVal - if d := cmp.Diff(wantResult, gotResult); d != "" { - t.Fatalf(`The expected artifact outputs consumption result doesnot match expected. Here is the diff: %v`, d) - } - }) + taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) + } + wantOut := `[{digest:{sha1:95588b8f34c31eb7d62c92aaa4e6506639b06ef2,sha256:df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48},uri:pkg:balba}]` + gotOut := taskrun.Status.Steps[1].Results[0].Value.StringVal + if d := cmp.Diff(wantOut, gotOut); d != "" { + t.Fatalf(`The expected artifact outputs consumption result doesnot match expected. Here is the diff: %v`, d) + } + wantIn := `[{digest:{sha256:b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0},uri:git:jjjsss}]` + gotIn := taskrun.Status.Steps[2].Results[0].Value.StringVal + if d := cmp.Diff(wantIn, gotIn); d != "" { + t.Fatalf(`The expected artifact Inputs consumption result doesnot match expected. Here is the diff: %v`, d) } } @@ -411,59 +281,7 @@ spec: { "inputs":[ { - "name":"source", - "values":[ - { - "uri":"git:jjjsss", - "digest":{ - "sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" - } - } - ] - } - ], - "outputs":[ - { - "name":"image", - "buildOutput":true, - "values":[ - { - "uri":"pkg:balba", - "digest":{ - "sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", - "sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" - } - } - ] - } - ] - } - EOF -`, helpers.ObjectNameForTest(t), namespace, fqImageName)) - return task -} - -func produceResultsAndArtifactsTask(t *testing.T, namespace string, fqImageName string) *v1.Task { - t.Helper() - task := parse.MustParseV1Task(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: hello - image: %s - command: ['/bin/sh'] - results: - - name: result1 - args: - - "-c" - - | - cat > $(step.artifacts.path) << EOF - { - "inputs":[ - { - "name":"source", + "name":"input-artifacts", "values":[ { "uri":"git:jjjsss", @@ -476,7 +294,7 @@ spec: ], "outputs":[ { - "name":"image", + "name":"build-result", "values":[ { "uri":"pkg:balba", @@ -490,7 +308,6 @@ spec: ] } EOF - echo -n result1Value >> $(step.results.result1.path) `, helpers.ObjectNameForTest(t), namespace, fqImageName)) return task } @@ -524,7 +341,6 @@ spec: "outputs":[ { "name":"build-result", - "buildOutput":false, "values":[ { "uri":"pkg:balba", diff --git a/upstream/test/cancel_test.go b/upstream/test/cancel_test.go index e5c10bd3e64..5b5fda9d9a3 100644 --- a/upstream/test/cancel_test.go +++ b/upstream/test/cancel_test.go @@ -42,6 +42,7 @@ func TestTaskRunPipelineRunCancel(t *testing.T) { // on failure, to ensure that cancelling the PipelineRun doesn't cause // the retrying TaskRun to retry. for _, numRetries := range []int{0, 1} { + numRetries := numRetries // capture range variable specStatus := v1.PipelineRunSpecStatusCancelled t.Run(fmt.Sprintf("retries=%d,status=%s", numRetries, specStatus), func(t *testing.T) { ctx := context.Background() @@ -65,7 +66,7 @@ spec: retries: %d taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: 'sleep 5000' `, helpers.ObjectNameForTest(t), namespace, numRetries)) @@ -184,134 +185,3 @@ spec: }) } } - -// TestCancelActivePipelineRunWithCompletedTaskRuns cancels a PipelineRun with completed TaskRuns and verifies TaskRun statuses. -func TestCancelActivePipelineRunWithCompletedTaskRuns(t *testing.T) { - specStatus := v1.PipelineRunSpecStatusCancelled - t.Run("status="+specStatus, func(t *testing.T) { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - requirements := []func(context.Context, *testing.T, *clients, string){} - c, namespace := setup(ctx, t, requirements...) - t.Parallel() - - knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) - defer tearDown(ctx, t, c, namespace) - - pipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - pipelineSpec: - tasks: - - name: task-succeeded - taskSpec: - steps: - - image: mirror.gcr.io/busybox - script: 'sleep 1' - - name: task-running - taskSpec: - steps: - - image: mirror.gcr.io/busybox - script: 'sleep 5000' -`, helpers.ObjectNameForTest(t), namespace)) - - t.Logf("Creating PipelineRun in namespace %s", namespace) - if _, err := c.V1PipelineRunClient.Create(ctx, pipelineRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create PipelineRun `%s`: %s", pipelineRun.Name, err) - } - - t.Logf("Waiting for Pipelinerun %s in namespace %s to be started", pipelineRun.Name, namespace) - if err := WaitForPipelineRunState(ctx, c, pipelineRun.Name, timeout, Running(pipelineRun.Name), "PipelineRunRunning", v1Version); err != nil { - t.Fatalf("Error waiting for PipelineRun %s to be running: %s", pipelineRun.Name, err) - } - - taskrunList, err := c.V1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + pipelineRun.Name}) - if err != nil { - t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", pipelineRun.Name, err) - } - - t.Logf("Waiting for PipelineRun %s from namespace %s with one TaskRun succeeded and another one running.", pipelineRun.Name, namespace) - for _, taskrunItem := range taskrunList.Items { - name := taskrunItem.Name - switch n := taskrunItem.Labels["tekton.dev/pipelineTask"]; { - case n == "task-succeeded": - err := WaitForTaskRunState(ctx, c, name, TaskRunSucceed(name), "TaskRunSuccess", v1Version) - if err != nil { - t.Errorf("Error waiting for TaskRun %s to be succeed: %v", name, err) - } - case n == "task-running": - err := WaitForTaskRunState(ctx, c, name, Running(name), "TaskRunRunning", v1Version) - if err != nil { - t.Errorf("Error waiting for TaskRun %s to be running: %v", name, err) - } - } - } - - pr, err := c.V1PipelineRunClient.Get(ctx, pipelineRun.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Failed to get PipelineRun `%s`: %s", pipelineRun.Name, err) - } - - patches := []jsonpatch.JsonPatchOperation{{ - Operation: "add", - Path: "/spec/status", - Value: specStatus, - }} - patchBytes, err := json.Marshal(patches) - if err != nil { - t.Fatalf("failed to marshal patch bytes in order to cancel") - } - if _, err := c.V1PipelineRunClient.Patch(ctx, pr.Name, types.JSONPatchType, patchBytes, metav1.PatchOptions{}, ""); err != nil { - t.Fatalf("Failed to patch PipelineRun `%s` with cancellation: %s", pipelineRun.Name, err) - } - - expectedReason := v1.PipelineRunReasonCancelled.String() - expectedCondition := FailedWithReason(expectedReason, pipelineRun.Name) - t.Logf("Waiting for PipelineRun %s in namespace %s to be cancelled", pipelineRun.Name, namespace) - if err := WaitForPipelineRunState(ctx, c, pipelineRun.Name, timeout, expectedCondition, expectedReason, v1Version); err != nil { - t.Errorf("Error waiting for PipelineRun %q to finished: %s", pipelineRun.Name, err) - } - - t.Logf("Waiting for TaskRuns in PipelineRun %s in namespace %s to be cancelled", pipelineRun.Name, namespace) - for _, taskrunItem := range taskrunList.Items { - name := taskrunItem.Name - switch n := taskrunItem.Labels["tekton.dev/pipelineTask"]; { - case n == "task-succeeded": - // the completed TaskRun no need to wait - case n == "task-running": - err := WaitForTaskRunState(ctx, c, name, FailedWithReason("TaskRunCancelled", name), "TaskRunCancelled", v1Version) - if err != nil { - t.Errorf("Error waiting for TaskRun %s to be finished: %v", name, err) - } - } - } - - taskrunList, err = c.V1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + pipelineRun.Name}) - if err != nil { - t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", pipelineRun.Name, err) - } - for _, taskrunItem := range taskrunList.Items { - switch n := taskrunItem.Labels["tekton.dev/pipelineTask"]; { - case n == "task-succeeded": - // the completed TaskRun should not be changed - if taskrunItem.Spec.Status != "" { - t.Fatalf("The status is %s, but it should be empty.", taskrunItem.Spec.Status) - } - if taskrunItem.Spec.StatusMessage != "" { - t.Fatalf("Status message is set to %s while it should be empty.", taskrunItem.Spec.StatusMessage) - } - case n == "task-running": - // the running TaskRun should be cancelled - if taskrunItem.Spec.Status != v1.TaskRunSpecStatusCancelled { - t.Fatalf("Status is %s while it should have been %s", taskrunItem.Spec.Status, v1.TaskRunSpecStatusCancelled) - } - if taskrunItem.Spec.StatusMessage != v1.TaskRunCancelledByPipelineMsg { - t.Fatalf("Status message is set to %s while it should be %s.", taskrunItem.Spec.StatusMessage, v1.TaskRunCancelledByPipelineMsg) - } - } - } - }) -} diff --git a/upstream/test/clients.go b/upstream/test/clients.go index dc0424a5275..0a0a4f21400 100644 --- a/upstream/test/clients.go +++ b/upstream/test/clients.go @@ -68,7 +68,7 @@ type clients struct { V1TaskClient v1.TaskInterface V1TaskRunClient v1.TaskRunInterface V1PipelineRunClient v1.PipelineRunInterface - V1beta1StepActionClient v1beta1.StepActionInterface + V1alpha1StepActionClient v1alpha1.StepActionInterface } // newClients instantiates and returns several clientsets required for making requests to the @@ -110,6 +110,6 @@ func newClients(t *testing.T, configPath, clusterName, namespace string) *client c.V1TaskClient = cs.TektonV1().Tasks(namespace) c.V1TaskRunClient = cs.TektonV1().TaskRuns(namespace) c.V1PipelineRunClient = cs.TektonV1().PipelineRuns(namespace) - c.V1beta1StepActionClient = cs.TektonV1beta1().StepActions(namespace) + c.V1alpha1StepActionClient = cs.TektonV1alpha1().StepActions(namespace) return c } diff --git a/upstream/test/conformance/conformance_test.go b/upstream/test/conformance/conformance_test.go index 6df4a039273..329b27478f7 100644 --- a/upstream/test/conformance/conformance_test.go +++ b/upstream/test/conformance/conformance_test.go @@ -39,13 +39,8 @@ package conformance_test import ( "fmt" - "strconv" - "strings" "testing" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/test/parse" "knative.dev/pkg/test/helpers" ) @@ -53,7 +48,6 @@ import ( const ( succeedConditionStatus = "True" conformanceVersion = "v1" - failureConditionStatus = "False" ) // TestTaskRunConditions examines population of Conditions @@ -71,7 +65,7 @@ spec: taskSpec: steps: - name: add - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo Hello world! `, helpers.ObjectNameForTest(t)) @@ -108,7 +102,7 @@ spec: taskSpec: steps: - name: add - image: mirror.gcr.io/ubuntu + image: ubuntu script: | echo Hello world! `, helpers.ObjectNameForTest(t)) @@ -126,1438 +120,3 @@ spec: t.Error(err) } } - -const ( - TaskRunInputType = "TaskRun" - PipelineRunInputType = "PipelineRun" - ExpectRunToFail = true -) - -func TestStepScript(t *testing.T) { - t.Parallel() - expectedSteps := map[string]string{ - "node": "Completed", - "perl": "Completed", - "params-applied": "Completed", - "args-allowed": "Completed", - "dollar-signs-allowed": "Completed", - "bash-variable-evaluations": "Completed", - } - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - params: - - name: PARAM - default: param-value - steps: - - name: node - image: mirror.gcr.io/node:lts-alpine3.20 - script: | - #!/usr/bin/env node - console.log("Hello from Node!") - - name: perl - image: mirror.gcr.io/perl:devel-bullseye - script: | - #!/usr/bin/perl - print "Hello from Perl!" - # Test that param values are replaced. - - name: params-applied - image: mirror.gcr.io/python:3.12.4 - script: | - #!/usr/bin/env python3 - v = '$(params.PARAM)' - if v != 'param-value': - print('Param values not applied') - print('Got: ', v) - exit(1) - # Test that args are allowed and passed to the script as expected. - - name: args-allowed - image: mirror.gcr.io/ubuntu - args: ['hello', 'world'] - script: | - #!/usr/bin/env bash - [[ $# == 2 ]] - [[ $1 == "hello" ]] - [[ $2 == "world" ]] - # Test that multiple dollar signs next to each other are not replaced by Kubernetes - - name: dollar-signs-allowed - image: mirror.gcr.io/python:3.12.4 - script: | - #!/usr/bin/env python3 - if '$' != '\u0024': - print('single dollar signs ($) are not passed through as expected :(') - exit(1) - if '$$' != '\u0024\u0024': - print('double dollar signs ($$) are not passed through as expected :(') - exit(2) - if '$$$' != '\u0024\u0024\u0024': - print('three dollar signs ($$$) are not passed through as expected :(') - exit(3) - if '$$$$' != '\u0024\u0024\u0024\u0024': - print('four dollar signs ($$$$) are not passed through as expected :(') - exit(4) - print('dollar signs appear to be handled correctly! :)') - - # Test that bash scripts with variable evaluations work as expected - - name: bash-variable-evaluations - image: mirror.gcr.io/bash - script: | - #!/usr/bin/env bash - set -xe - var1=var1_value - var2=var1 - echo $(eval echo \$$var2) > tmpfile - eval_result=$(cat tmpfile) - if [ "$eval_result" != "var1_value" ] ; then - echo "unexpected eval result: $eval_result" - exit 1 - fi -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if len(resolvedTR.Status.Steps) != len(expectedSteps) { - t.Errorf("Expected length of steps %v but has: %v", len(expectedSteps), len(resolvedTR.Status.Steps)) - } - - for _, resolvedStep := range resolvedTR.Status.Steps { - resolvedStepTerminatedReason := resolvedStep.Terminated.Reason - if expectedStepState, ok := expectedSteps[resolvedStep.Name]; ok { - if resolvedStepTerminatedReason != expectedStepState { - t.Fatalf("Expect step %s to have completed successfully but it has Termination Reason: %s", resolvedStep.Name, resolvedStepTerminatedReason) - } - } else { - t.Fatalf("Does not expect to have step: %s", resolvedStep.Name) - } - } -} - -func TestStepEnv(t *testing.T) { - t.Parallel() - envVarName := "FOO" - envVarVal := "foooooooo" - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - name: bash - image: mirror.gcr.io/ubuntu - env: - - name: %s - value: %s - script: | - #!/usr/bin/env bash - set -euxo pipefail - echo "Hello from Bash!" - echo FOO is ${FOO} - echo substring is ${FOO:2:4} -`, helpers.ObjectNameForTest(t), envVarName, envVarVal) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - resolvedStep := resolvedTR.Status.Steps[0] - resolvedStepTerminatedReason := resolvedStep.Terminated.Reason - if resolvedStepTerminatedReason != "Completed" { - t.Fatalf("Expect step %s to have completed successfully but it has Termination Reason: %s", resolvedStep.Name, resolvedStepTerminatedReason) - } - - resolvedStepEnv := resolvedTR.Status.TaskSpec.Steps[0].Env[0] - if resolvedStepEnv.Name != envVarName { - t.Fatalf("Expect step %s to have EnvVar Name %s but it has: %s", resolvedStep.Name, envVarName, resolvedStepEnv.Name) - } - if resolvedStepEnv.Value != envVarVal { - t.Fatalf("Expect step %s to have EnvVar Value %s but it has: %s", resolvedStep.Name, envVarVal, resolvedStepEnv.Value) - } -} - -func TestStepWorkingDir(t *testing.T) { - t.Parallel() - defaultWorkingDir := "/workspace" - overrideWorkingDir := "/a/path/too/far" - - expectedWorkingDirs := map[string]string{ - "default": defaultWorkingDir, - "override": overrideWorkingDir, - } - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - name: default - image: mirror.gcr.io/ubuntu - workingDir: %s - script: | - #!/usr/bin/env bash - if [[ $PWD != /workspace ]]; then - exit 1 - fi - - name: override - image: mirror.gcr.io/ubuntu - workingDir: %s - script: | - #!/usr/bin/env bash - if [[ $PWD != /a/path/too/far ]]; then - exit 1 - fi -`, helpers.ObjectNameForTest(t), defaultWorkingDir, overrideWorkingDir) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - for _, resolvedStep := range resolvedTR.Status.Steps { - resolvedStepTerminatedReason := resolvedStep.Terminated.Reason - if resolvedStepTerminatedReason != "Completed" { - t.Fatalf("Expect step %s to have completed successfully but it has Termination Reason: %s", resolvedStep.Name, resolvedStepTerminatedReason) - } - } - - for _, resolvedStepSpec := range resolvedTR.Status.TaskSpec.Steps { - resolvedStepWorkingDir := resolvedStepSpec.WorkingDir - if resolvedStepWorkingDir != expectedWorkingDirs[resolvedStepSpec.Name] { - t.Fatalf("Expect step %s to have WorkingDir %s but it has: %s", resolvedStepSpec.Name, expectedWorkingDirs[resolvedStepSpec.Name], resolvedStepWorkingDir) - } - } -} - -func TestStepStateImageID(t *testing.T) { - t.Parallel() - // Step images can be specified by digest. - image := "busybox@sha256:1303dbf110c57f3edf68d9f5a16c082ec06c4cf7604831669faf2c712260b5a0" - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - image: %s - args: ['-c', 'echo hello'] -`, helpers.ObjectNameForTest(t), image) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, succeedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(resolvedTR.Status.Steps) != 1 { - t.Errorf("Expect vendor service to provide 1 Step in StepState but it has: %v", len(resolvedTR.Status.Steps)) - } - - if !strings.HasSuffix(resolvedTR.Status.Steps[0].ImageID, image) { - t.Errorf("Expect vendor service to provide image %s in StepState but it has: %s", image, resolvedTR.Status.Steps[0].ImageID) - } -} - -func TestStepStateName(t *testing.T) { - t.Parallel() - stepName := "step-foo" - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - name: %s - image: mirror.gcr.io/busybox - args: ['-c', 'echo hello'] -`, helpers.ObjectNameForTest(t), stepName) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, succeedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(resolvedTR.Status.Steps) != 1 { - t.Errorf("Expect vendor service to provide 1 Step in StepState but it has: %v", len(resolvedTR.Status.Steps)) - } - - if resolvedTR.Status.Steps[0].Name != stepName { - t.Errorf("Expect vendor service to provide Name %s in StepState but it has: %s", stepName, resolvedTR.Status.Steps[0].Name) - } -} - -// Examines the ContainerStateTerminated ExitCode, StartedAt, FinishtedAt and Reason -func TestStepStateContainerStateTerminated(t *testing.T) { - t.Parallel() - successInputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - image: mirror.gcr.io/busybox - args: ['-c', 'echo hello'] -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - successOutputYAML, err := ProcessAndSendToTekton(successInputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - successResolvedTR := parse.MustParseV1TaskRun(t, successOutputYAML) - - if err := checkTaskRunConditionSucceeded(successResolvedTR.Status, succeedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(successResolvedTR.Status.Steps) != 1 { - t.Errorf("Expect vendor service to provide 1 Step in StepState but it has: %v", len(successResolvedTR.Status.Steps)) - } - - startTime := successResolvedTR.Status.Steps[0].Terminated.StartedAt - finishTime := successResolvedTR.Status.Steps[0].Terminated.FinishedAt - - if startTime.IsZero() { - t.Errorf("Expect vendor service to provide StartTimeStamp in StepState.Terminated but it does not provide so") - } - - if finishTime.IsZero() { - t.Errorf("Expect vendor service to provide FinishTimeStamp in StepState.Terminated but it does not provide so") - } - - if finishTime.Before(&startTime) { - t.Errorf("Expect vendor service to provide StartTimeStamp %v earlier than FinishTimeStamp in StepState.Terminated %v but it does not provide so", startTime, finishTime) - } - - if successResolvedTR.Status.Steps[0].Terminated.ExitCode != 0 { - t.Errorf("Expect vendor service to provide ExitCode in StepState.Terminated to be 0 but it has: %v", successResolvedTR.Status.Steps[0].Terminated.ExitCode) - } - - if successResolvedTR.Status.Steps[0].Terminated.Reason != "Completed" { - t.Errorf("Expect vendor service to provide Reason in StepState.Terminated to be Completed but it has: %s", successResolvedTR.Status.Steps[0].Terminated.Reason) - } - - failureInputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - image: mirror.gcr.io/busybox - script: exit 1 -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - failureOutputYAML, err := ProcessAndSendToTekton(failureInputYAML, TaskRunInputType, t, ExpectRunToFail) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - failureResolvedTR := parse.MustParseV1TaskRun(t, failureOutputYAML) - - if err := checkTaskRunConditionSucceeded(failureResolvedTR.Status, failureConditionStatus, "Failed"); err != nil { - t.Error(err) - } - - if len(failureResolvedTR.Status.Steps) != 1 { - t.Errorf("Expect vendor service to provide 1 Step in StepState but it has: %v", len(failureResolvedTR.Status.Steps)) - } - - startTime = failureResolvedTR.Status.Steps[0].Terminated.StartedAt - finishTime = failureResolvedTR.Status.Steps[0].Terminated.FinishedAt - - if startTime.IsZero() { - t.Errorf("Expect vendor service to provide StartTimeStamp in StepState.Terminated but it does not provide so") - } - - if finishTime.IsZero() { - t.Errorf("Expect vendor service to provide FinishTimeStamp in StepState.Terminated but it does not provide so") - } - - if finishTime.Before(&startTime) { - t.Errorf("Expect vendor service to provide StartTimeStamp %v earlier than FinishTimeStamp in StepState.Terminated %v but it does not provide so", startTime, finishTime) - } - - if failureResolvedTR.Status.Steps[0].Terminated.ExitCode != 1 { - t.Errorf("Expect vendor service to provide ExitCode in StepState.Terminated to be 0 but it has: %v", failureResolvedTR.Status.Steps[0].Terminated.ExitCode) - } - - if failureResolvedTR.Status.Steps[0].Terminated.Reason != "Error" { - t.Errorf("Expect vendor service to provide Reason in StepState.Terminated to be Error but it has: %s", failureResolvedTR.Status.Steps[0].Terminated.Reason) - } -} - -func TestSidecarName(t *testing.T) { - sidecarName := "hello-sidecar" - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - sidecars: - - name: %s - image: mirror.gcr.io/ubuntu - script: echo "hello from sidecar" - steps: - - name: hello-step - image: mirror.gcr.io/ubuntu - script: echo "hello from step" -`, helpers.ObjectNameForTest(t), sidecarName) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(resolvedTR.Spec.TaskSpec.Sidecars) != 1 { - t.Errorf("Expect vendor service to provide 1 Sidcar but it has: %v", len(resolvedTR.Spec.TaskSpec.Sidecars)) - } - - if resolvedTR.Spec.TaskSpec.Sidecars[0].Name != sidecarName { - t.Errorf("Expect vendor service to provide Sidcar name %s but it has: %s", sidecarName, resolvedTR.Spec.TaskSpec.Sidecars[0].Name) - } -} - -// This test relies on the support of Sidecar Script and its volumeMounts. -// For sidecar tests, sidecars don't have /workspace mounted by default, so we have to define -// our own shared volume. For vendor services, please feel free to override the shared workspace -// supported in your sidecar. Otherwise there are no existing v1 conformance `REQUIRED` fields that -// are going to be used for verifying Sidecar functionality. -func TestSidecarScriptSuccess(t *testing.T) { - succeedInputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - sidecars: - - name: slow-sidecar - image: mirror.gcr.io/ubuntu - script: | - echo "hello from sidecar" > /shared/message - volumeMounts: - - name: shared - mountPath: /shared - - steps: - - name: check-ready - image: mirror.gcr.io/ubuntu - script: cat /shared/message - volumeMounts: - - name: shared - mountPath: /shared - - # Sidecars don't have /workspace mounted by default, so we have to define - # our own shared volume. - volumes: - - name: shared - emptyDir: {} -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - succeedOutputYAML, err := ProcessAndSendToTekton(succeedInputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - succeededResolvedTR := parse.MustParseV1TaskRun(t, succeedOutputYAML) - - if err := checkTaskRunConditionSucceeded(succeededResolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } -} - -func TestSidecarScriptFailure(t *testing.T) { - failInputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - sidecars: - - name: exit-sidecar - image: mirror.gcr.io/ubuntu - script: exit 1 - - steps: - - name: check-ready - image: mirror.gcr.io/ubuntu - script: cat /shared/message - volumeMounts: - - name: shared - mountPath: /shared - - # Sidecars don't have /workspace mounted by default, so we have to define - # our own shared volume. - volumes: - - name: shared - emptyDir: {} -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - failOutputYAML, err := ProcessAndSendToTekton(failInputYAML, TaskRunInputType, t, ExpectRunToFail) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - failResolvedTR := parse.MustParseV1TaskRun(t, failOutputYAML) - - if len(failResolvedTR.Spec.TaskSpec.Sidecars) != 1 { - t.Errorf("Expect vendor service to provide 1 Sidcar but it has: %v", len(failResolvedTR.Spec.TaskSpec.Sidecars)) - } - - if err := checkTaskRunConditionSucceeded(failResolvedTR.Status, "False", "Failed"); err != nil { - t.Error(err) - } -} - -func TestSidecarArgAndCommand(t *testing.T) { - failInputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - sidecars: - - name: slow-sidecar - image: mirror.gcr.io/ubuntu - command: [/bin/bash] - args: [-c, "echo 'hello from sidecar' > /shared/message"] - volumeMounts: - - name: shared - mountPath: /shared - steps: - - name: check-ready - image: mirror.gcr.io/ubuntu - command: - - cat - args: - - '/shared/message' - volumeMounts: - - name: shared - mountPath: /shared - - # Sidecars don't have /workspace mounted by default, so we have to define - # our own shared volume. - volumes: - - name: shared - emptyDir: {} -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - failOutputYAML, err := ProcessAndSendToTekton(failInputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - failResolvedTR := parse.MustParseV1TaskRun(t, failOutputYAML) - - if len(failResolvedTR.Spec.TaskSpec.Sidecars) != 1 { - t.Errorf("Expect vendor service to provide 1 Sidcar but it has: %v", len(failResolvedTR.Spec.TaskSpec.Sidecars)) - } - - if err := checkTaskRunConditionSucceeded(failResolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } -} - -func TestStringTaskParam(t *testing.T) { - stringParam := "foo-string" - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - params: - - name: "string-param" - value: %s - taskSpec: - params: - - name: "string-param" - type: string - steps: - - name: "check-param" - image: mirror.gcr.io/bash - script: | - if [[ $(params.string-param) != %s ]]; then - exit 1 - fi -`, helpers.ObjectNameForTest(t), stringParam, stringParam) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if len(resolvedTR.Spec.Params) != 1 { - t.Errorf("Expect vendor service to provide 1 Param but it has: %v", len(resolvedTR.Spec.Params)) - } - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - -} - -func TestArrayTaskParam(t *testing.T) { - var arrayParam0, arrayParam1 = "foo", "bar" - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - params: - - name: array-to-concat - value: - - %s - - %s - taskSpec: - results: - - name: "concat-array" - params: - - name: array-to-concat - type: array - steps: - - name: concat-array-params - image: mirror.gcr.io/alpine - command: ["/bin/sh", "-c"] - args: - - echo -n $(params.array-to-concat[0])"-"$(params.array-to-concat[1]) | tee $(results.concat-array.path); -`, helpers.ObjectNameForTest(t), arrayParam0, arrayParam1) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if len(resolvedTR.Spec.Params) != 1 { - t.Errorf("Examining TaskRun Param: expect vendor service to provide TaskRun with 1 Array Param but it has: %v", len(resolvedTR.Spec.Params)) - } - if len(resolvedTR.Spec.Params[0].Value.ArrayVal) != 2 { - t.Errorf("Examining TaskParams: expect vendor service to provide 2 Task Array Param values but it has: %v", len(resolvedTR.Spec.Params[0].Value.ArrayVal)) - } - - // Utilizing TaskResult to verify functionality of Array Params - if len(resolvedTR.Status.Results) != 1 { - t.Errorf("Expect vendor service to provide 1 result but it has: %v", len(resolvedTR.Status.Results)) - } - if resolvedTR.Status.Results[0].Value.StringVal != arrayParam0+"-"+arrayParam1 { - t.Errorf("Not producing correct result, expect to get \"%s\" but has: \"%s\"", arrayParam0+"-"+arrayParam1, resolvedTR.Status.Results[0].Value.StringVal) - } -} - -func TestTaskParamDefaults(t *testing.T) { - stringParam := "string-foo" - arrayParam := []string{"array-foo", "array-bar"} - expectedStringParamResultVal := "string-foo-string-baz-default" - expectedArrayParamResultVal := "array-foo-array-bar-default" - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - params: - - name: array-param - value: - - %s - - %s - - name: string-param - value: %s - taskSpec: - results: - - name: array-output - - name: string-output - params: - - name: array-param - type: array - - name: array-defaul-param - type: array - default: - - "array-foo-default" - - "array-bar-default" - - name: string-param - type: string - - name: string-default - type: string - default: "string-baz-default" - steps: - - name: string-params-to-result - image: mirror.gcr.io/bash - command: ["/bin/sh", "-c"] - args: - - echo -n $(params.string-param)"-"$(params.string-default) | tee $(results.string-output.path); - - name: array-params-to-result - image: mirror.gcr.io/bash - command: ["/bin/sh", "-c"] - args: - - echo -n $(params.array-param[0])"-"$(params.array-defaul-param[1]) | tee $(results.array-output.path); -`, helpers.ObjectNameForTest(t), arrayParam[0], arrayParam[1], stringParam) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if len(resolvedTR.Spec.Params) != 2 { - t.Errorf("Expect vendor service to provide 2 Params but it has: %v", len(resolvedTR.Spec.Params)) - } - if len(resolvedTR.Spec.Params[0].Value.ArrayVal) != 2 { - t.Errorf("Expect vendor service to provide 2 Task Array Params but it has: %v", len(resolvedTR.Spec.Params)) - } - for _, param := range resolvedTR.Spec.Params { - if param.Name == "array-param" { - paramArr := param.Value.ArrayVal - for i, _ := range paramArr { - if paramArr[i] != arrayParam[i] { - t.Errorf("Expect Params to match %s: %v", arrayParam[i], paramArr[i]) - } - } - } - if param.Name == "string-param" { - if param.Value.StringVal != stringParam { - t.Errorf("Not producing correct result, expect to get \"%s\" but has: \"%s\"", stringParam, param.Value.StringVal) - } - } - } - - // Utilizing TaskResult to verify functionality of Task Params Defaults - if len(resolvedTR.Status.Results) != 2 { - t.Errorf("Expect vendor service to provide 2 result but it has: %v", len(resolvedTR.Status.Results)) - } - - for _, result := range resolvedTR.Status.Results { - if result.Name == "string-output" { - resultVal := result.Value.StringVal - if resultVal != expectedStringParamResultVal { - t.Errorf("Not producing correct result, expect to get \"%s\" but has: \"%s\"", expectedStringParamResultVal, resultVal) - } - } - if result.Name == "array-output" { - resultVal := result.Value.StringVal - if resultVal != expectedArrayParamResultVal { - t.Errorf("Not producing correct result, expect to get \"%s\" but has: \"%s\"", expectedArrayParamResultVal, resultVal) - } - } - } -} - -func TestTaskParamDescription(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - params: - - name: foo - description: foo param - default: "foo" - steps: - - name: add - image: mirror.gcr.io/alpine - env: - - name: OP1 - value: $(params.foo) - command: ["/bin/sh", "-c"] - args: - - echo -n ${OP1} -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if resolvedTR.Spec.TaskSpec.Params[0].Description != "foo param" { - t.Errorf("Expect vendor service to provide Param Description \"foo param\" but it has: %s", resolvedTR.Spec.TaskSpec.Params[0].Description) - } - - if resolvedTR.Status.TaskSpec.Params[0].Description != "foo param" { - t.Errorf("Expect vendor service to provide Param Description \"foo param\" but it has: %s", resolvedTR.Spec.TaskSpec.Params[0].Description) - } -} - -// The goal of the Taskrun Workspace test is to verify if different Steps in the TaskRun could -// pass data among each other. -func TestTaskRunWorkspace(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - workspaces: - - name: custom-workspace - # Please note that vendor services are welcomed to override the following actual workspace binding type. - # This is considered as the implementation detail for the conformant workspace fields. - emptyDir: {} - taskSpec: - steps: - - name: write - image: mirror.gcr.io/ubuntu - script: echo $(workspaces.custom-workspace.path) > $(workspaces.custom-workspace.path)/foo - - name: read - image: mirror.gcr.io/ubuntu - script: cat $(workspaces.custom-workspace.path)/foo - - name: check - image: mirror.gcr.io/ubuntu - script: | - if [ "$(cat $(workspaces.custom-workspace.path)/foo)" != "/workspace/custom-workspace" ]; then - echo $(cat $(workspaces.custom-workspace.path)/foo) - exit 1 - fi - workspaces: - - name: custom-workspace -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(resolvedTR.Spec.Workspaces) != 1 { - t.Errorf("Expect vendor service to provide 1 Workspace but it has: %v", len(resolvedTR.Spec.Workspaces)) - } - - if resolvedTR.Spec.Workspaces[0].Name != "custom-workspace" { - t.Errorf("Expect vendor service to provide Workspace 'custom-workspace' but it has: %s", resolvedTR.Spec.Workspaces[0].Name) - } - - if resolvedTR.Status.TaskSpec.Workspaces[0].Name != "custom-workspace" { - t.Errorf("Expect vendor service to provide Workspace 'custom-workspace' in TaskRun.Status.TaskSpec but it has: %s", resolvedTR.Spec.Workspaces[0].Name) - } -} - -// TestTaskRunTimeout examines the Timeout behaviour for -// TaskRun level. It creates a TaskRun with Timeout and wait in the Step of the -// inline Task for the time length longer than the specified Timeout. -// The TaskRun is expected to fail with the Reason `TaskRunTimeout`. -func TestTaskRunTimeout(t *testing.T) { - expectedFailedStatus := true - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - timeout: 15s - taskSpec: - steps: - - image: mirror.gcr.io/busybox - command: ['/bin/sh'] - args: ['-c', 'sleep 15001'] -`, helpers.ObjectNameForTest(t)) - - // Execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t, expectedFailedStatus) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, "False", "TaskRunTimeout"); err != nil { - t.Error(err) - } -} - -// TestConditions examines population of Conditions -// fields. It creates the a TaskRun with minimal specifications and checks the -// required Condition Status and Type. -func TestConditions(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: TaskRun -metadata: - name: %s -spec: - taskSpec: - steps: - - name: add - image: mirror.gcr.io/ubuntu - script: - echo Hello world! -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, TaskRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedTR := parse.MustParseV1TaskRun(t, outputYAML) - - if err := checkTaskRunConditionSucceeded(resolvedTR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } -} - -// TestPipelineTaskParams examines the PipelineTask -// Params functionality by creating a Pipeline that performs addition in its -// Task for validation. -func TestPipelineTaskParams(t *testing.T) { - var op0, op1 = 10, 1 - expectedParams := v1.Params{{ - Name: "op0", - Value: v1.ParamValue{StringVal: strconv.Itoa(op0)}, - }, { - Name: "op1", - Value: v1.ParamValue{StringVal: strconv.Itoa(op1)}}, - } - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - pipelineSpec: - tasks: - - name: sum-params - taskSpec: - params: - - name: op0 - type: string - description: The first integer from PipelineTask Param - - name: op1 - type: string - description: The second integer from PipelineTask Param - steps: - - name: sum - image: mirror.gcr.io/bash - script: | - #!/usr/bin/env bash - echo -n $(( "$(inputs.params.op0)" + "$(inputs.params.op1)" )) - params: - - name: op0 - value: %s - - name: op1 - value: %s -`, helpers.ObjectNameForTest(t), strconv.Itoa(op0), strconv.Itoa(op1)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - if len(resolvedPR.Spec.PipelineSpec.Tasks) != 1 { - t.Errorf("Expect vendor service to provide 1 PipelineTask but got: %v", len(resolvedPR.Spec.PipelineSpec.Tasks)) - } - - if d := cmp.Diff(expectedParams, resolvedPR.Spec.PipelineSpec.Tasks[0].Params, cmpopts.IgnoreFields(v1.ParamValue{}, "Type")); d != "" { - t.Errorf("Expect vendor service to provide 2 params 10, 1, but got: %v", d) - - } -} - -func TestPipelineResult(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - params: - - name: prefix - value: prefix - pipelineSpec: - results: - - name: output - type: string - value: $(tasks.do-something.results.output) - params: - - name: prefix - tasks: - - name: generate-suffix - taskSpec: - results: - - name: suffix - steps: - - name: generate-suffix - image: mirror.gcr.io/alpine - script: | - echo -n "suffix" > $(results.suffix.path) - - name: do-something - taskSpec: - results: - - name: output - params: - - name: arg - steps: - - name: do-something - image: mirror.gcr.io/alpine - script: | - echo -n "$(params.arg)" | tee $(results.output.path) - params: - - name: arg - value: "$(params.prefix):$(tasks.generate-suffix.results.suffix)" -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - if len(resolvedPR.Status.Results) != 1 { - t.Errorf("Expect vendor service to provide 1 result but has: %v", len(resolvedPR.Status.Results)) - } - - if resolvedPR.Status.Results[0].Value.StringVal != "prefix:suffix" { - t.Errorf("Not producing correct result :\"%s\"", resolvedPR.Status.Results[0].Value.StringVal) - } -} - -func TestPipelineWorkspace(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - workspaces: - - name: custom-workspace - # Vendor service could override the actual workspace binding type. - # This is considered as the implementation detail for the conformant workspace fields. - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 16Mi - volumeMode: Filesystem - pipelineSpec: - workspaces: - - name: custom-workspace - tasks: - - name: write-task - taskSpec: - steps: - - name: write-step - image: mirror.gcr.io/ubuntu - script: | - echo $(workspaces.custom-workspace-write-task.path) > $(workspaces.custom-workspace-write-task.path)/foo - cat $(workspaces.custom-workspace-write-task.path)/foo - workspaces: - - name: custom-workspace-write-task - workspaces: - - name: custom-workspace-write-task - workspace: custom-workspace - - name: read-task - taskSpec: - steps: - - name: read-step - image: mirror.gcr.io/ubuntu - script: cat $(workspaces.custom-workspace-read-task.path)/foo - workspaces: - - name: custom-workspace-read-task - workspaces: - - name: custom-workspace-read-task - workspace: custom-workspace - runAfter: - - write-task - - name: check-task - taskSpec: - steps: - - name: check-step - image: mirror.gcr.io/ubuntu - script: | - if [ "$(cat $(workspaces.custom-workspace-check-task.path)/foo)" != "/workspace/custom-workspace-write-task" ]; then - echo $(cat $(workspaces.custom-workspace-check-task.path)/foo) - exit 1 - fi - workspaces: - - name: custom-workspace-check-task - workspaces: - - name: custom-workspace-check-task - workspace: custom-workspace - runAfter: - - read-task -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - if err := checkPipelineRunConditionSucceeded(resolvedPR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if resolvedPR.Spec.Workspaces[0].Name != "custom-workspace" { - t.Errorf("Expect vendor service to provide Workspace 'custom-workspace' but it has: %s", resolvedPR.Spec.Workspaces[0].Name) - } - - if resolvedPR.Status.PipelineSpec.Workspaces[0].Name != "custom-workspace" { - t.Errorf("Expect vendor service to provide Workspace 'custom-workspace' in PipelineRun.Status.TaskSpec but it has: %s", resolvedPR.Spec.Workspaces[0].Name) - } - - // TODO add more tests for WorkSpace Declaration test for PipelineTask Workspace in a separate test -} - -func TestPipelineTaskTimeout(t *testing.T) { - expectedFailedStatus := true - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - pipelineSpec: - tasks: - - name: timeout - timeout: 15s - taskSpec: - steps: - - image: mirror.gcr.io/busybox - command: ['/bin/sh'] - args: ['-c', 'sleep 15001'] -`, helpers.ObjectNameForTest(t)) - - // Execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t, expectedFailedStatus) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - // TODO to examine PipelineRunReason when https://github.com/tektoncd/pipeline/issues/7573 is fixed - PipelineTaskTimeout - if err := checkPipelineRunConditionSucceeded(resolvedPR.Status, FailureConditionStatus, "Failed"); err != nil { - t.Error(err) - } -} - -// TestPipelineRunTimeout examines the Timeout behaviour for -// PipelineRun level. It creates a TaskRun with Timeout and wait in the Step of the -// inline Task for the time length longer than the specified Timeout. -// The TaskRun is expected to fail with the Reason `TaskRunTimeout`. -func TestPipelineRunTimeout(t *testing.T) { - expectedFailedStatus := true - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - timeouts: - tasks: 15s - pipelineSpec: - tasks: - - name: timeout - taskSpec: - steps: - - image: mirror.gcr.io/busybox - command: ['/bin/sh'] - args: ['-c', 'sleep 15001'] -`, helpers.ObjectNameForTest(t)) - - // Execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t, expectedFailedStatus) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - if err := checkPipelineRunConditionSucceeded(resolvedPR.Status, FailureConditionStatus, "PipelineRunTimeout"); err != nil { - t.Error(err) - } - -} - -// ** there is no feasible way as in v1 conformance policy to test finally without -// dependencies: results, param functionality -func TestPipelineRunTaskFinally(t *testing.T) { - var inputOp0, inputOp1 = 3, 1 - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - pipelineSpec: - params: - - name: a - type: string - - name: b - type: string - results: - - name: task-result - description: "grabbing results from the tasks section" - value: $(tasks.multiply-inputs.results.product) - - name: finally-result - description: "grabbing results from the finally section" - value: $(finally.exponent.results.product) - tasks: - - name: multiply-inputs - taskSpec: - results: - - name: product - description: The product of the two provided integers - steps: - - name: product - image: mirror.gcr.io/bash - script: | - #!/usr/bin/env bash - echo -n $(( "$(params.a)" * "$(params.b)" )) | tee $(results.product.path) - params: - - name: a - value: "$(params.a)" - - name: b - value: "$(params.b)" - finally: - - name: exponent - taskSpec: - results: - - name: product - description: The product of the two provided integers - steps: - - name: product - image: mirror.gcr.io/bash - script: | - #!/usr/bin/env bash - echo -n $(( "$(params.a)" * "$(params.b)" )) | tee $(results.product.path) - params: - - name: a - value: "$(tasks.multiply-inputs.results.product)$(tasks.multiply-inputs.results.product)" - - name: b - value: "$(tasks.multiply-inputs.results.product)$(tasks.multiply-inputs.results.product)" - params: - - name: a - value: %s - - name: b - value: %s -`, helpers.ObjectNameForTest(t), strconv.Itoa(inputOp0), strconv.Itoa(inputOp1)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - if len(resolvedPR.Status.Conditions) != 1 { - t.Errorf("Expect vendor service to populate 1 Condition but no") - } - - expectedFinallyResultVal := strconv.Itoa((inputOp0*10 + inputOp0) * (inputOp1*10 + inputOp1) * inputOp0 * inputOp1) - - for _, res := range resolvedPR.Status.Results { - if res.Name == "finally-result" { - if res.Value.StringVal != expectedFinallyResultVal { - t.Errorf("Expect vendor service to provide finally task computation to have resultVal %s, but has: %s", expectedFinallyResultVal, res.Value.StringVal) - } - } - } -} - -// TestPipelineRunConditions examines population of Conditions -// fields. It creates the a PipelineRun with minimal specifications and checks the -// required Condition Status and Type. -func TestPipelineRunConditions(t *testing.T) { - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - pipelineSpec: - tasks: - - name: pipeline-task-0 - taskSpec: - steps: - - name: add - image: mirror.gcr.io/ubuntu - script: - echo Hello world! -`, helpers.ObjectNameForTest(t)) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - if err := checkPipelineRunConditionSucceeded(resolvedPR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } -} - -func TestPipelineRunChildReferences(t *testing.T) { - prName := helpers.ObjectNameForTest(t) - pt0, pt1 := "pipeline-task-0", "pipeline-task-1" - expectedChildRefs := map[string]string{ - pt0: prName + "-" + pt0, - pt1: prName + "-" + pt1, - } - - inputYAML := fmt.Sprintf(` -apiVersion: tekton.dev/v1 -kind: PipelineRun -metadata: - name: %s -spec: - pipelineSpec: - tasks: - - name: %s - taskSpec: - steps: - - name: hello-step - image: mirror.gcr.io/ubuntu - script: - echo Hello world! - - name: %s - taskSpec: - steps: - - name: hell-step - image: mirror.gcr.io/ubuntu - script: - echo Hello world! -`, prName, pt0, pt1) - - // The execution of Pipeline CRDs that should be implemented by Vendor service - outputYAML, err := ProcessAndSendToTekton(inputYAML, PipelineRunInputType, t) - if err != nil { - t.Fatalf("Vendor service failed processing inputYAML: %s", err) - } - - // Parse and validate output YAML - resolvedPR := parse.MustParseV1PipelineRun(t, outputYAML) - - if err := checkPipelineRunConditionSucceeded(resolvedPR.Status, SucceedConditionStatus, "Succeeded"); err != nil { - t.Error(err) - } - - if len(resolvedPR.Status.ChildReferences) != 2 { - t.Errorf("Expect vendor service to have 2 ChildReferences but it has: %v", len(resolvedPR.Status.ChildReferences)) - } - - for _, cr := range resolvedPR.Status.ChildReferences { - if childRefName, ok := expectedChildRefs[cr.PipelineTaskName]; ok { - if childRefName != cr.Name { - t.Errorf("Expect vendor service to populate ChildReferenceStatus Name %s but it has: %s", childRefName, cr.Name) - } - } else { - t.Errorf("Does not expect vendor service to populate ChildReferenceStatus PipelineTaskName: %s", cr.PipelineTaskName) - } - } - -} diff --git a/upstream/test/conformance_test.go b/upstream/test/conformance_test.go index 9dffa035751..1a93de0812c 100644 --- a/upstream/test/conformance_test.go +++ b/upstream/test/conformance_test.go @@ -193,7 +193,7 @@ spec: if d := cmp.Diff(tr.Status.Steps, tc.expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { t.Fatalf("-got, +want: %v", d) } - // Note(chmouel): Sometime we have docker-pullable:// or mirror.gcr.io as prefix, so let only compare the suffix + // Note(chmouel): Sometime we have docker-pullable:// or docker.io/library as prefix, so let only compare the suffix if !strings.HasSuffix(tr.Status.Steps[0].ImageID, fqImageName) { t.Fatalf("`ImageID: %s` does not end with `%s`", tr.Status.Steps[0].ImageID, fqImageName) } diff --git a/upstream/test/controller.go b/upstream/test/controller.go index d4cc5506135..93a3840ae86 100644 --- a/upstream/test/controller.go +++ b/upstream/test/controller.go @@ -37,10 +37,10 @@ import ( fakepipelineruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/fake" faketaskinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/task/fake" faketaskruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/taskrun/fake" + fakestepactioninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/stepaction/fake" fakeverificationpolicyinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/fake" fakeclustertaskinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake" fakecustomruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/fake" - fakestepactioninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/stepaction/fake" fakeresolutionclientset "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/fake" resolutioninformersv1alpha1 "github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/resolution/v1beta1" fakeresolutionrequestclient "github.com/tektoncd/pipeline/pkg/client/resolution/injection/client/fake" @@ -74,7 +74,7 @@ type Data struct { Pipelines []*v1.Pipeline TaskRuns []*v1.TaskRun Tasks []*v1.Task - StepActions []*v1beta1.StepAction + StepActions []*v1alpha1.StepAction ClusterTasks []*v1beta1.ClusterTask CustomRuns []*v1beta1.CustomRun Pods []*corev1.Pod @@ -104,7 +104,7 @@ type Informers struct { Run informersv1alpha1.RunInformer CustomRun informersv1beta1.CustomRunInformer Task informersv1.TaskInformer - StepAction informersv1beta1.StepActionInformer + StepAction informersv1alpha1.StepActionInformer ClusterTask informersv1beta1.ClusterTaskInformer Pod coreinformers.PodInformer ConfigMap coreinformers.ConfigMapInformer @@ -236,7 +236,7 @@ func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers c.Pipeline.PrependReactor("*", "stepactions", AddToInformer(t, i.StepAction.Informer().GetIndexer())) for _, sa := range d.StepActions { sa := sa.DeepCopy() // Avoid assumptions that the informer's copy is modified. - if _, err := c.Pipeline.TektonV1beta1().StepActions(sa.Namespace).Create(ctx, sa, metav1.CreateOptions{}); err != nil { + if _, err := c.Pipeline.TektonV1alpha1().StepActions(sa.Namespace).Create(ctx, sa, metav1.CreateOptions{}); err != nil { t.Fatal(err) } } diff --git a/upstream/test/conversion_test.go b/upstream/test/conversion_test.go index 9e14ed7dea0..489fad5aced 100644 --- a/upstream/test/conversion_test.go +++ b/upstream/test/conversion_test.go @@ -33,17 +33,21 @@ import ( ) var ( - filterLabels = cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Labels") - filterAnnotations = cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Annotations") - filterV1TaskRunStatus = cmpopts.IgnoreFields(v1.TaskRunStatusFields{}, "StartTime", "CompletionTime", "Artifacts") - filterV1PipelineRunStatus = cmpopts.IgnoreFields(v1.PipelineRunStatusFields{}, "StartTime", "CompletionTime") - filterV1beta1TaskRunStatus = cmpopts.IgnoreFields(v1beta1.TaskRunStatusFields{}, "StartTime", "CompletionTime") - filterV1beta1PipelineRunStatus = cmpopts.IgnoreFields(v1beta1.PipelineRunStatusFields{}, "StartTime", "CompletionTime") - filterContainerStateTerminated = cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID", "Message") - filterV1StepState = cmpopts.IgnoreFields(v1.StepState{}, "Name", "ImageID", "Container") - filterV1beta1StepState = cmpopts.IgnoreFields(v1beta1.StepState{}, "Name", "ImageID", "ContainerName") - filterV1TaskRunSA = cmpopts.IgnoreFields(v1.TaskRunSpec{}, "ServiceAccountName") - filterV1PipelineRunSA = cmpopts.IgnoreFields(v1.PipelineTaskRunTemplate{}, "ServiceAccountName") + filterLabels = cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Labels") + filterAnnotations = cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Annotations") + filterV1TaskRunStatus = cmpopts.IgnoreFields(v1.TaskRunStatusFields{}, "StartTime", "CompletionTime") + filterV1PipelineRunStatus = cmpopts.IgnoreFields(v1.PipelineRunStatusFields{}, "StartTime", "CompletionTime") + filterV1beta1TaskRunStatus = cmpopts.IgnoreFields(v1beta1.TaskRunStatusFields{}, "StartTime", "CompletionTime") + filterV1beta1PipelineRunStatus = cmpopts.IgnoreFields(v1beta1.PipelineRunStatusFields{}, "StartTime", "CompletionTime") + filterContainerStateTerminated = cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID", "Message") + filterV1StepState = cmpopts.IgnoreFields(v1.StepState{}, "Name", "ImageID", "Container") + filterV1beta1StepState = cmpopts.IgnoreFields(v1beta1.StepState{}, "Name", "ImageID", "ContainerName") + filterV1TaskRunSA = cmpopts.IgnoreFields(v1.TaskRunSpec{}, "ServiceAccountName") + filterV1beta1TaskRunSA = cmpopts.IgnoreFields(v1beta1.TaskRunSpec{}, "ServiceAccountName") + filterV1PipelineRunSA = cmpopts.IgnoreFields(v1.PipelineTaskRunTemplate{}, "ServiceAccountName") + filterV1beta1PipelineRunSA = cmpopts.IgnoreFields(v1beta1.PipelineRunSpec{}, "ServiceAccountName") + filterV1RefSourceImageDigest = cmpopts.IgnoreFields(v1.RefSource{}, "Digest") + filterV1beta1RefSourceImageDigest = cmpopts.IgnoreFields(v1beta1.RefSource{}, "Digest") filterMetadata = []cmp.Option{filterTypeMeta, filterObjectMeta, filterAnnotations} filterV1TaskRunFields = []cmp.Option{filterTypeMeta, filterObjectMeta, filterLabels, filterAnnotations, filterCondition, filterV1TaskRunStatus, filterContainerStateTerminated, filterV1StepState} @@ -94,7 +98,7 @@ spec: runAsNonRoot: true sidecars: - name: server - image: mirror.gcr.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 command: ['/bin/bash'] args: ['-c', 'gcloud auth activate-service-account --key-file /var/secret/bucket-secret/bucket-secret-key'] workingDir: /dir @@ -170,7 +174,7 @@ spec: runAsNonRoot: true sidecars: - name: server - image: mirror.gcr.io/alpine/git:v2.26.2 + image: alpine/git:v2.26.2 command: ['/bin/bash'] args: ['-c', 'gcloud auth activate-service-account --key-file /var/secret/bucket-secret/bucket-secret-key'] workingDir: /dir @@ -224,7 +228,7 @@ spec: - name: task1-result value: task1-val steps: - - image: mirror.gcr.io/alpine + - image: alpine onError: continue name: exit-with-255 script: | @@ -246,7 +250,7 @@ spec: type: string steps: - name: verify-status - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ $(params.echoStatus) == "Succeeded" ] then @@ -278,7 +282,7 @@ spec: - name: task1-result value: task1-val steps: - - image: mirror.gcr.io/alpine + - image: alpine onError: continue name: exit-with-255 script: | @@ -300,7 +304,7 @@ spec: type: string steps: - name: verify-status - image: mirror.gcr.io/ubuntu + image: ubuntu script: | if [ $(params.echoStatus) == "Succeeded" ] then @@ -320,7 +324,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "Hello World!" @@ -353,7 +357,7 @@ spec: taskSpec: steps: - computeResources: {} - image: mirror.gcr.io/ubuntu + image: ubuntu name: echo script: | #!/usr/bin/env bash @@ -372,7 +376,7 @@ status: taskSpec: steps: - computeResources: {} - image: mirror.gcr.io/ubuntu + image: ubuntu name: echo script: | #!/usr/bin/env bash @@ -408,7 +412,7 @@ spec: taskSpec: steps: - computeResources: {} - image: mirror.gcr.io/ubuntu + image: ubuntu name: echo script: | #!/usr/bin/env bash @@ -438,7 +442,7 @@ spec: taskSpec: steps: - computeResources: {} - image: mirror.gcr.io/ubuntu + image: ubuntu name: echo script: | #!/usr/bin/env bash @@ -454,7 +458,7 @@ status: taskSpec: steps: - computeResources: {} - image: mirror.gcr.io/ubuntu + image: ubuntu name: echo script: | #!/usr/bin/env bash @@ -493,7 +497,7 @@ spec: taskSpec: steps: - name: echo-hello - image: mirror.gcr.io/ubuntu + image: ubuntu script: | ls $(workspaces.dir.path) echo hello @@ -524,7 +528,7 @@ spec: taskSpec: steps: - name: echo-hello - image: mirror.gcr.io/ubuntu + image: ubuntu script: | ls $(workspaces.dir.path) echo hello @@ -540,7 +544,7 @@ status: name: cluster-task-pipeline-4 steps: - name: "echo-hello" - image: "mirror.gcr.io/ubuntu" + image: "ubuntu" script: | ls $(workspaces.dir.path) echo hello @@ -578,7 +582,7 @@ spec: taskSpec: steps: - name: echo-hello - image: mirror.gcr.io/ubuntu + image: ubuntu script: | ls $(workspaces.dir.path) echo hello @@ -611,7 +615,7 @@ spec: taskSpec: steps: - name: echo-hello - image: mirror.gcr.io/ubuntu + image: ubuntu script: | ls $(workspaces.dir.path) echo hello @@ -635,7 +639,7 @@ status: name: cluster-task-pipeline-4 steps: - name: "echo-hello" - image: "mirror.gcr.io/ubuntu" + image: "ubuntu" script: | ls $(workspaces.dir.path) echo hello @@ -650,6 +654,202 @@ status: name: %s-hello-task pipelineTaskName: hello-task ` + + v1beta1TaskWithBundleYaml = ` +metadata: + name: %s + namespace: %s +spec: + steps: + - name: hello + image: alpine + script: 'echo Hello' +` + + v1beta1PipelineWithBundleYaml = ` +metadata: + name: %s + namespace: %s +spec: + tasks: + - name: hello-world + taskRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s +` + + v1beta1TaskRunWithBundleYaml = ` +metadata: + name: %s + namespace: %s +spec: + taskRef: + name: %s + bundle: %s +` + + v1beta1PipelineRunWithBundleYaml = ` +metadata: + name: %s + namespace: %s +spec: + pipelineRef: + name: %s + bundle: %s +` + + v1TaskRunWithBundleExpectedYaml = ` +metadata: + name: %s + namespace: %s +spec: + serviceAccountName: default + timeout: 1h + taskRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + - name: kind + value: Task +status: + conditions: + - type: Succeeded + status: "True" + reason: "Succeeded" + podName: %s-pod + taskSpec: + steps: + - computeResources: {} + image: alpine + name: hello + script: 'echo Hello' + steps: + - image: alpine + name: hello + script: 'echo Hello' + terminationReason: Completed + terminated: + reason: Completed +` + + v1PipelineRunWithBundleExpectedYaml = ` +metadata: + name: %s + namespace: %s +spec: + taskRunTemplate: + timeouts: + pipeline: 1h + pipelineRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + - name: kind + value: Pipeline +status: + conditions: + - type: Succeeded + status: "True" + reason: "Succeeded" + pipelineSpec: + tasks: + - name: hello-world + taskRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + childReferences: + - apiVersion: tekton.dev/v1 + kind: TaskRun + name: %s-hello-world + pipelineTaskName: hello-world +` + + v1beta1TaskRunWithBundleRoundTripYaml = ` +metadata: + name: %s + namespace: %s +spec: + timeout: 1h + taskRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + - name: kind + value: Task +status: + conditions: + - type: Succeeded + status: "True" + reason: "Succeeded" + podName: %s-pod + taskSpec: + steps: + - computeResources: {} + image: alpine + name: hello + script: 'echo Hello' + steps: + - image: alpine + name: hello + script: 'echo Hello' + terminated: + reason: Completed +` + + v1beta1PipelineRunWithBundleRoundTripYaml = ` +metadata: + name: %s + namespace: %s +spec: + timeouts: + pipeline: 1h + pipelineRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + - name: kind + value: Pipeline +status: + conditions: + - type: Succeeded + status: "True" + reason: "Succeeded" + pipelineSpec: + tasks: + - name: hello-world + taskRef: + resolver: bundles + params: + - name: bundle + value: %s + - name: name + value: %s + childReferences: + - apiVersion: tekton.dev/v1 + kind: TaskRun + name: %s-hello-world + pipelineTaskName: hello-world +` ) // TestTaskCRDConversion first creates a v1beta1 Task CRD using v1beta1Clients and @@ -948,3 +1148,118 @@ func TestPipelineRunCRDConversion(t *testing.T) { t.Errorf("-want, +got: %v", d) } } + +// TestBundleConversion tests v1beta1 bundle syntax converted into v1 since it has +// been deprecated in v1 and it would be converted into bundle resolver in pipelineRef +// and taskRef. It sets up a registry for a bundle of a v1beta1 Task and Pipeline +// and uses the v1beta1 TaskRef/ PipelineRef to test the conversion from v1beta1 bundle +// syntax to a v1 bundle resolver and then it tests roundtrip back to v1beta1 bundle +// resolver syntax. +func TestBundleConversion(t *testing.T) { + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + t.Parallel() + + c, namespace := setup(ctx, t, withRegistry, bundleFeatureFlags) + knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) + defer tearDown(ctx, t, c, namespace) + + repo := getRegistryServiceIP(ctx, t, c, namespace) + ":5000/tektonbundlessimple" + taskName := helpers.ObjectNameForTest(t) + pipelineName := helpers.ObjectNameForTest(t) + task := parse.MustParseV1beta1Task(t, fmt.Sprintf(v1beta1TaskWithBundleYaml, taskName, namespace)) + pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(v1beta1PipelineWithBundleYaml, pipelineName, namespace, repo, taskName)) + setupBundle(ctx, t, c, namespace, repo, task, pipeline) + + v1beta1TaskRunName := helpers.ObjectNameForTest(t) + v1beta1TaskRun := parse.MustParseV1beta1TaskRun(t, fmt.Sprintf(v1beta1TaskRunWithBundleYaml, v1beta1TaskRunName, namespace, taskName, repo)) + v1TaskRunExpected := parse.MustParseV1TaskRun(t, fmt.Sprintf(v1TaskRunWithBundleExpectedYaml, v1beta1TaskRunName, namespace, repo, taskName, v1beta1TaskRunName)) + v1beta1TaskRunRoundTripExpected := parse.MustParseV1beta1TaskRun(t, fmt.Sprintf(v1beta1TaskRunWithBundleRoundTripYaml, v1beta1TaskRunName, namespace, repo, taskName, v1beta1TaskRunName)) + + v1TaskRunExpected.Status.Provenance = &v1.Provenance{ + FeatureFlags: getFeatureFlagsBaseOnAPIFlag(t), + RefSource: &v1.RefSource{ + URI: repo, + Digest: map[string]string{"sha256": "a123"}, + EntryPoint: taskName, + }, + } + v1beta1TaskRunRoundTripExpected.Status.Provenance = &v1beta1.Provenance{ + FeatureFlags: getFeatureFlagsBaseOnAPIFlag(t), + RefSource: &v1beta1.RefSource{ + URI: repo, + Digest: map[string]string{"sha256": "a123"}, + EntryPoint: taskName, + }, + } + + if _, err := c.V1beta1TaskRunClient.Create(ctx, v1beta1TaskRun, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create v1beta1 TaskRun: %s", err) + } + if err := WaitForTaskRunState(ctx, c, v1beta1TaskRunName, Succeed(v1beta1TaskRunName), v1beta1TaskRunName, "v1beta1"); err != nil { + t.Fatalf("Failed waiting for v1beta1 TaskRun done: %v", err) + } + + v1TaskRunGot, err := c.V1TaskRunClient.Get(ctx, v1beta1TaskRunName, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Couldn't get expected v1 TaskRun for %s: %s", v1beta1TaskRunName, err) + } + if d := cmp.Diff(v1TaskRunExpected, v1TaskRunGot, append([]cmp.Option{filterV1RefSourceImageDigest, filterV1TaskRunSA}, filterV1TaskRunFields...)...); d != "" { + t.Errorf("-want, +got: %v", d) + } + + v1beta1TaskRunRoundTrip := &v1beta1.TaskRun{} + if err := v1beta1TaskRunRoundTrip.ConvertFrom(context.Background(), v1TaskRunGot); err != nil { + t.Fatalf("Failed to convert roundtrip v1beta1TaskRunGot ConvertFrom v1 = %v", err) + } + if d := cmp.Diff(v1beta1TaskRunRoundTripExpected, v1beta1TaskRunRoundTrip, append([]cmp.Option{filterV1beta1RefSourceImageDigest, filterV1beta1TaskRunSA}, filterV1beta1TaskRunFields...)...); d != "" { + t.Errorf("-want, +got: %v", d) + } + + v1beta1ToV1PipelineRunName := helpers.ObjectNameForTest(t) + v1beta1PipelineRun := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(v1beta1PipelineRunWithBundleYaml, v1beta1ToV1PipelineRunName, namespace, pipelineName, repo)) + v1PipelineRunExpected := parse.MustParseV1PipelineRun(t, fmt.Sprintf(v1PipelineRunWithBundleExpectedYaml, v1beta1ToV1PipelineRunName, namespace, repo, pipelineName, repo, taskName, v1beta1ToV1PipelineRunName)) + v1beta1PRRoundTripExpected := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(v1beta1PipelineRunWithBundleRoundTripYaml, v1beta1ToV1PipelineRunName, namespace, repo, pipelineName, repo, taskName, v1beta1ToV1PipelineRunName)) + + v1PipelineRunExpected.Status.Provenance = &v1.Provenance{ + FeatureFlags: getFeatureFlagsBaseOnAPIFlag(t), + RefSource: &v1.RefSource{ + URI: repo, + Digest: map[string]string{"sha256": "a123"}, + EntryPoint: pipelineName, + }, + } + v1beta1PRRoundTripExpected.Status.Provenance = &v1beta1.Provenance{ + FeatureFlags: getFeatureFlagsBaseOnAPIFlag(t), + RefSource: &v1beta1.RefSource{ + URI: repo, + Digest: map[string]string{"sha256": "a123"}, + EntryPoint: pipelineName, + }, + } + + if _, err := c.V1beta1PipelineRunClient.Create(ctx, v1beta1PipelineRun, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create v1beta1 PipelineRun: %s", err) + } + if err := WaitForPipelineRunState(ctx, c, v1beta1ToV1PipelineRunName, timeout, Succeed(v1beta1ToV1PipelineRunName), v1beta1ToV1PipelineRunName, "v1beta1"); err != nil { + t.Fatalf("Failed waiting for v1beta1 PipelineRun done: %v", err) + } + + v1PipelineRunGot, err := c.V1PipelineRunClient.Get(ctx, v1beta1ToV1PipelineRunName, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Couldn't get expected v1 PipelineRun for %s: %s", v1beta1ToV1PipelineRunName, err) + } + if d := cmp.Diff(v1PipelineRunExpected, v1PipelineRunGot, append([]cmp.Option{filterV1RefSourceImageDigest, filterV1PipelineRunSA}, filterV1PipelineRunFields...)...); d != "" { + t.Errorf("-want, +got: %v", d) + } + + v1beta1PRRoundTrip := &v1beta1.PipelineRun{} + if err := v1beta1PRRoundTrip.ConvertFrom(context.Background(), v1PipelineRunGot); err != nil { + t.Fatalf("Error roundtrip v1beta1PipelineRun ConvertFrom v1PipelineRunGot = %v", err) + } + if d := cmp.Diff(v1beta1PRRoundTripExpected, v1beta1PRRoundTrip, append([]cmp.Option{filterV1beta1RefSourceImageDigest, filterV1beta1PipelineRunSA}, filterV1beta1PipelineRunFields...)...); d != "" { + t.Errorf("-want, +got: %v", d) + } +} diff --git a/upstream/test/custom-task-ctrls/wait-task-beta/example_customrun_matrix_results.yaml b/upstream/test/custom-task-ctrls/wait-task-beta/example_customrun_matrix_results.yaml index 80ed7a1f520..0f43f79d3ab 100644 --- a/upstream/test/custom-task-ctrls/wait-task-beta/example_customrun_matrix_results.yaml +++ b/upstream/test/custom-task-ctrls/wait-task-beta/example_customrun_matrix_results.yaml @@ -11,7 +11,7 @@ spec: - name: duration steps: - name: echo - image: mirror.gcr.io/alpine + image: alpine script: | echo "$(params.duration)" --- @@ -25,7 +25,7 @@ spec: type: array steps: - name: produce-a-list-of-durations - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"10s\",\"2s\",\"5s\"]" | tee $(results.durations.path) diff --git a/upstream/test/custom-task-ctrls/wait-task-beta/example_pipelinerun.yaml b/upstream/test/custom-task-ctrls/wait-task-beta/example_pipelinerun.yaml index 91d5fa813b1..513adcc5394 100644 --- a/upstream/test/custom-task-ctrls/wait-task-beta/example_pipelinerun.yaml +++ b/upstream/test/custom-task-ctrls/wait-task-beta/example_pipelinerun.yaml @@ -8,7 +8,7 @@ spec: - name: before taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo before wait - name: wait taskRef: @@ -21,6 +21,6 @@ spec: - name: after taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo after wait runAfter: ['wait'] diff --git a/upstream/test/custom-task-ctrls/wait-task-beta/go.mod b/upstream/test/custom-task-ctrls/wait-task-beta/go.mod index 626842418d9..f49b3abda70 100644 --- a/upstream/test/custom-task-ctrls/wait-task-beta/go.mod +++ b/upstream/test/custom-task-ctrls/wait-task-beta/go.mod @@ -6,9 +6,9 @@ require ( github.com/emicklei/go-restful v2.16.0+incompatible // indirect github.com/google/go-cmp v0.6.0 github.com/tektoncd/pipeline v0.53.1 - k8s.io/api v0.27.16 - k8s.io/apimachinery v0.27.16 - k8s.io/client-go v0.27.16 + k8s.io/api v0.27.13 + k8s.io/apimachinery v0.27.13 + k8s.io/client-go v0.27.13 k8s.io/utils v0.0.0-20230505201702-9f6742963106 knative.dev/pkg v0.0.0-20231011193800-bd99f2f98be7 ) diff --git a/upstream/test/custom-task-ctrls/wait-task-beta/go.sum b/upstream/test/custom-task-ctrls/wait-task-beta/go.sum index dc936579a74..39cf8077312 100644 --- a/upstream/test/custom-task-ctrls/wait-task-beta/go.sum +++ b/upstream/test/custom-task-ctrls/wait-task-beta/go.sum @@ -3661,8 +3661,8 @@ k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= k8s.io/api v0.26.2/go.mod h1:1kjMQsFE+QHPfskEcVNgL3+Hp88B80uj0QtSOlj8itU= k8s.io/api v0.26.5/go.mod h1:O7ICW7lj6+ZQQQ3cxekgCoW+fnGo5kWT0nTHkLZ5grc= k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= -k8s.io/api v0.27.16 h1:70IBoTuiPfd+Tm68WH0tGXQRSQq0R1xnbyhTRe8WYQY= -k8s.io/api v0.27.16/go.mod h1:5j0Cgo6X4qovBOu3OjzRwETDEYqMxq2qafhDQXOPy3A= +k8s.io/api v0.27.13 h1:d49LYs1dh+JMMDNYQSu8FhEzCjc2TNpYvDWoSGAKs80= +k8s.io/api v0.27.13/go.mod h1:W3lYMPs34i0XQA+cmKfejve+HwbRZjy67fL05RyJUTo= k8s.io/apiextensions-apiserver v0.26.5 h1:VJ946z9RjyCPn3qiz4Kus/UYjCRrdn1xUvEsJFvN5Yo= k8s.io/apiextensions-apiserver v0.26.5/go.mod h1:Olsde7ZNWnyz9rsL13iXYXmL1h7kWujtKeC3yWVCDPo= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= @@ -3676,8 +3676,8 @@ k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5 k8s.io/apimachinery v0.26.5/go.mod h1:HUvk6wrOP4v22AIYqeCGSQ6xWCHo41J9d6psb3temAg= k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= -k8s.io/apimachinery v0.27.16 h1:Nmbei3P/6w6vxbNxV8/sDCZz+TQrJ9A4+bVIRjDufuM= -k8s.io/apimachinery v0.27.16/go.mod h1:TWo+8wOIz3CytsrlI9k/LBWXLRr9dqf5hRSCbbggMAg= +k8s.io/apimachinery v0.27.13 h1:xDAnOWaRVNSkaKdfB0Ab11hixH90KGTbLwEHMloMjFM= +k8s.io/apimachinery v0.27.13/go.mod h1:TWo+8wOIz3CytsrlI9k/LBWXLRr9dqf5hRSCbbggMAg= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= @@ -3692,8 +3692,8 @@ k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= k8s.io/client-go v0.26.2/go.mod h1:u5EjOuSyBa09yqqyY7m3abZeovO/7D/WehVVlZ2qcqU= k8s.io/client-go v0.26.5/go.mod h1:/CYyNt+ZLMvWqMF8h1SvkUXz2ujFWQLwdDrdiQlZ5X0= k8s.io/client-go v0.27.1/go.mod h1:f8LHMUkVb3b9N8bWturc+EDtVVVwZ7ueTVquFAJb2vA= -k8s.io/client-go v0.27.16 h1:x06Jk6/SIQQ6kAsWs5uzQIkBLHtcAQlbTAgmj1tZzG0= -k8s.io/client-go v0.27.16/go.mod h1:bPZUNRj8XsHa+JVS5jU6qeU2H/Za8+7riWA08FUjaA8= +k8s.io/client-go v0.27.13 h1:SfUbIukb6BSqaadlYRX0AzMoN6+e+9FZGEKqfisidho= +k8s.io/client-go v0.27.13/go.mod h1:I9SBaI28r6ii465Fb0dTpf5O3adOnDwNBoeqlDNbbFg= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= k8s.io/code-generator v0.26.5/go.mod h1:iWTVFxfBX+RYe0bXjKqSM83KJF8eimor/izQInvq/60= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= diff --git a/upstream/test/custom_task_test.go b/upstream/test/custom_task_test.go index 61bcac7af00..001e61285a0 100644 --- a/upstream/test/custom_task_test.go +++ b/upstream/test/custom_task_test.go @@ -111,7 +111,7 @@ spec: steps: - args: ['-c', 'echo $(input-result-from-custom-task-ref) $(input-result-from-custom-task-spec)'] command: ['/bin/bash'] - image: mirror.gcr.io/ubuntu + image: ubuntu `, pipelineRunName, betaAPIVersion, kind, betaAPIVersion, kind, customTaskRawSpec)), metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create PipelineRun %q: %v", pipelineRunName, err) diff --git a/upstream/test/dag_test.go b/upstream/test/dag_test.go index afd8f3281bf..e5fc176243e 100644 --- a/upstream/test/dag_test.go +++ b/upstream/test/dag_test.go @@ -70,9 +70,9 @@ spec: results: - name: result steps: - - image: mirror.gcr.io/busybox + - image: busybox script: 'echo $(params["text"])' - - image: mirror.gcr.io/busybox + - image: busybox # Sleep for N seconds so that we can check that tasks that # should be run in parallel have overlap. script: | diff --git a/upstream/test/duplicate_test.go b/upstream/test/duplicate_test.go index bd606271edf..508c80735b4 100644 --- a/upstream/test/duplicate_test.go +++ b/upstream/test/duplicate_test.go @@ -47,7 +47,7 @@ func TestDuplicatePodTaskRun(t *testing.T) { // The number of builds generated has a direct impact on test // runtime and is traded off against proving the taskrun // reconciler's efficacy at not duplicating pods. - for range 5 { + for i := 0; i < 5; i++ { wg.Add(1) taskrunName := helpers.ObjectNameForTest(t) t.Logf("Creating taskrun %q.", taskrunName) @@ -59,7 +59,7 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/echo'] args: ['simple'] `, taskrunName, namespace)) diff --git a/upstream/test/e2e-tests-kind-prow-alpha.env b/upstream/test/e2e-tests-kind-prow-alpha.env index 5ab894c2ac7..255bdf63579 100644 --- a/upstream/test/e2e-tests-kind-prow-alpha.env +++ b/upstream/test/e2e-tests-kind-prow-alpha.env @@ -8,5 +8,3 @@ ENABLE_STEP_ACTIONS=true ENABLE_CEL_IN_WHENEXPRESSION=true ENABLE_PARAM_ENUM=true ENABLE_ARTIFACTS=true -ENABLE_CONCISE_RESOLVER_SYNTAX=true -ENABLE_KUBERNETES_SIDECAR=true diff --git a/upstream/test/e2e-tests-kind-prow-beta.env b/upstream/test/e2e-tests-kind-prow-beta.env index acf7b599ce8..8dae8c618fe 100644 --- a/upstream/test/e2e-tests-kind-prow-beta.env +++ b/upstream/test/e2e-tests-kind-prow-beta.env @@ -2,7 +2,5 @@ SKIP_INITIALIZE=true PIPELINE_FEATURE_GATE=beta EMBEDDED_STATUS_GATE=minimal RUN_YAML_TESTS=true -RESULTS_FROM=sidecar-logs -ENABLE_STEP_ACTIONS=true KO_DOCKER_REPO=registry.local:5000 E2E_GO_TEST_TIMEOUT=40m diff --git a/upstream/test/e2e-tests.sh b/upstream/test/e2e-tests.sh index 9d78515fdb5..a291f27e4ba 100755 --- a/upstream/test/e2e-tests.sh +++ b/upstream/test/e2e-tests.sh @@ -32,8 +32,6 @@ ENABLE_STEP_ACTIONS=${ENABLE_STEP_ACTIONS:="false"} ENABLE_CEL_IN_WHENEXPRESSION=${ENABLE_CEL_IN_WHENEXPRESSION:="false"} ENABLE_PARAM_ENUM=${ENABLE_PARAM_ENUM:="false"} ENABLE_ARTIFACTS=${ENABLE_ARTIFACTS:="false"} -ENABLE_CONCISE_RESOLVER_SYNTAX=${ENABLE_CONCISE_RESOLVER_SYNTAX:="false"} -ENABLE_KUBERNETES_SIDECAR=${ENABLE_KUBERNETES_SIDECAR:="false"} failed=0 # Script entry point. @@ -132,30 +130,6 @@ function set_enable_artifacts() { kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch" } -function set_enable_concise_resolver_syntax() { - local method="$1" - if [ "$method" != "false" ] && [ "$method" != "true" ]; then - printf "Invalid value for enable-concise-resolver-syntax %s\n" ${method} - exit 255 - fi - printf "Setting enable-concise-resolver-syntax to %s\n", ${method} - jsonpatch=$(printf "{\"data\": {\"enable-concise-resolver-syntax\": \"%s\"}}" $1) - echo "feature-flags ConfigMap patch: ${jsonpatch}" - kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch" -} - -function set_enable_kubernetes_sidecar() { - local method="$1" - if [ "$method" != "false" ] && [ "$method" != "true" ]; then - printf "Invalid value for enable-kubernetes-sidecar %s\n" ${method} - exit 255 - fi - printf "Setting enable-kubernetes-sidecar to %s\n", ${method} - jsonpatch=$(printf "{\"data\": {\"enable-kubernetes-sidecar\": \"%s\"}}" $1) - echo "feature-flags ConfigMap patch: ${jsonpatch}" - kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch" -} - function run_e2e() { # Run the integration tests header "Running Go e2e tests" @@ -183,8 +157,6 @@ set_enable_step_actions "$ENABLE_STEP_ACTIONS" set_cel_in_whenexpression "$ENABLE_CEL_IN_WHENEXPRESSION" set_enable_param_enum "$ENABLE_PARAM_ENUM" set_enable_artifacts "$ENABLE_ARTIFACTS" -set_enable_concise_resolver_syntax "$ENABLE_CONCISE_RESOLVER_SYNTAX" -set_enable_kubernetes_sidecar "$ENABLE_KUBERNETES_SIDECAR" run_e2e (( failed )) && fail_test diff --git a/upstream/test/entrypoint_test.go b/upstream/test/entrypoint_test.go index 0814a0caaad..26454d8938f 100644 --- a/upstream/test/entrypoint_test.go +++ b/upstream/test/entrypoint_test.go @@ -54,10 +54,10 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox workingDir: /workspace script: 'sleep 3 && touch foo' - - image: mirror.gcr.io/ubuntu + - image: ubuntu workingDir: /workspace script: 'ls foo' `, epTaskRunName, namespace)), metav1.CreateOptions{}); err != nil { diff --git a/upstream/test/examples_test.go b/upstream/test/examples_test.go index 3880bc42022..74a74909858 100644 --- a/upstream/test/examples_test.go +++ b/upstream/test/examples_test.go @@ -280,14 +280,13 @@ func imageNamesMapping() map[string]string { } case "ppc64le": return map[string]string{ - "registry": getTestImage(registryImage), - "node": "node:alpine3.11", - "gcr.io/cloud-builders/git": "alpine/git:latest", - "docker@sha256:74e78208fc18da48ddf8b569abe21563730845c312130bd0f0b059746a7e10f5": "ibmcom/docker-ppc64le:19.03-dind", + "registry": getTestImage(registryImage), + "node": "node:alpine3.11", + "gcr.io/cloud-builders/git": "alpine/git:latest", + "docker:dind": "ibmcom/docker-ppc64le:19.03-dind", "docker": "docker:18.06.3", "mikefarah/yq:3": "danielxlee/yq:2.4.0", "stedolan/jq": "ibmcom/jq-ppc64le:latest", - "amd64/ubuntu": "ppc64le/ubuntu", "gcr.io/kaniko-project/executor:v1.3.0": getTestImage(kanikoImage), } } diff --git a/upstream/test/featureflags.go b/upstream/test/featureflags.go index a6b6db071f6..673d82cb75f 100644 --- a/upstream/test/featureflags.go +++ b/upstream/test/featureflags.go @@ -111,23 +111,19 @@ func requireAllGates(gates map[string]string) func(context.Context, *testing.T, func getFeatureFlagsBaseOnAPIFlag(t *testing.T) *config.FeatureFlags { t.Helper() alphaFeatureFlags, err := config.NewFeatureFlagsFromMap(map[string]string{ - "enable-api-fields": "alpha", - "results-from": "sidecar-logs", - "enable-tekton-oci-bundles": "true", - "enable-step-actions": "true", - "enable-cel-in-whenexpression": "true", - "enable-param-enum": "true", - "enable-artifacts": "true", - "enable-concise-resolver-syntax": "true", - "enable-kubernetes-sidecar": "true", + "enable-api-fields": "alpha", + "results-from": "sidecar-logs", + "enable-tekton-oci-bundles": "true", + "enable-step-actions": "true", + "enable-cel-in-whenexpression": "true", + "enable-param-enum": "true", + "enable-artifacts": "true", }) if err != nil { t.Fatalf("error creating alpha feature flags configmap: %v", err) } betaFeatureFlags, err := config.NewFeatureFlagsFromMap(map[string]string{ - "results-from": "sidecar-logs", - "enable-api-fields": "beta", - "enable-step-actions": "true", + "enable-api-fields": "beta", }) if err != nil { t.Fatalf("error creating beta feature flags configmap: %v", err) diff --git a/upstream/test/git-resolver/gitea.yaml b/upstream/test/git-resolver/gitea.yaml index 58874241b29..dc085f0634f 100644 --- a/upstream/test/git-resolver/gitea.yaml +++ b/upstream/test/git-resolver/gitea.yaml @@ -704,7 +704,7 @@ spec: fsGroup: 1000 initContainers: - name: init-directories - image: "docker.io/gitea/gitea:1.17.1" + image: "gitea/gitea:1.17.1" imagePullPolicy: Always command: ["/usr/sbin/init_directory_structure.sh"] env: @@ -727,7 +727,7 @@ spec: securityContext: {} - name: init-app-ini - image: "docker.io/gitea/gitea:1.17.1" + image: "gitea/gitea:1.17.1" imagePullPolicy: Always command: ["/usr/sbin/config_environment.sh"] env: @@ -752,7 +752,7 @@ spec: securityContext: {} - name: configure-gitea - image: "docker.io/gitea/gitea:1.17.1" + image: "gitea/gitea:1.17.1" command: ["/usr/sbin/configure_gitea.sh"] imagePullPolicy: Always securityContext: @@ -781,7 +781,7 @@ spec: terminationGracePeriodSeconds: 60 containers: - name: gitea - image: "docker.io/gitea/gitea:1.17.1" + image: "gitea/gitea:1.17.1" imagePullPolicy: Always env: # SSH Port values have to be set here as well for openssh configuration diff --git a/upstream/test/git-resolver/remote-task.yaml b/upstream/test/git-resolver/remote-task.yaml index 95f0e8d4b27..1737ad12622 100644 --- a/upstream/test/git-resolver/remote-task.yaml +++ b/upstream/test/git-resolver/remote-task.yaml @@ -5,6 +5,6 @@ metadata: spec: steps: - name: sleep - image: mirror.gcr.io/busybox + image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 10'] diff --git a/upstream/test/gohelloworld/main.go b/upstream/test/gohelloworld/main.go index 2cfe8f5a3ef..8c0bd0f8a5b 100644 --- a/upstream/test/gohelloworld/main.go +++ b/upstream/test/gohelloworld/main.go @@ -31,7 +31,8 @@ func main() { log.Print("Hello world sample started.") http.HandleFunc("/", handler) - //nolint: gosec + //nolint:gosec + // #nosec G114 -- see https://github.com/securego/gosec#available-rules if err := http.ListenAndServe(":8080", nil); err != nil { panic(err) } diff --git a/upstream/test/ignore_step_error_test.go b/upstream/test/ignore_step_error_test.go index adb2c8564aa..0ba770e96ec 100644 --- a/upstream/test/ignore_step_error_test.go +++ b/upstream/test/ignore_step_error_test.go @@ -53,7 +53,7 @@ spec: steps: - name: failing-step onError: continue - image: mirror.gcr.io/busybox + image: busybox script: 'echo -n 123 | tee $(results.result1.path); exit 1; echo -n 456 | tee $(results.result2.path)' `, taskRunName, namespace)) diff --git a/upstream/test/ignore_task_error_test.go b/upstream/test/ignore_task_error_test.go index e8492585cb0..becb0618ab7 100644 --- a/upstream/test/ignore_task_error_test.go +++ b/upstream/test/ignore_task_error_test.go @@ -37,7 +37,7 @@ func TestFailingPipelineTaskOnContinue(t *testing.T) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) defer cancel() - c, namespace := setup(ctx, t, requireAnyGate(map[string]string{"enable-api-fields": "beta"})) + c, namespace := setup(ctx, t, requireAnyGate(map[string]string{"enable-api-fields": "alpha"})) knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) defer tearDown(ctx, t, c, namespace) @@ -57,14 +57,14 @@ spec: type: string steps: - name: failing-step - image: mirror.gcr.io/busybox + image: busybox script: 'exit 1; echo -n 123 | tee $(results.result1.path)' - name: order-dep-task runAfter: ["failed-ignored-task"] taskSpec: steps: - name: foo - image: mirror.gcr.io/busybox + image: busybox script: 'echo hello' - name: resource-dep-task onError: continue @@ -77,7 +77,7 @@ spec: type: string steps: - name: foo - image: mirror.gcr.io/busybox + image: busybox script: 'echo $(params.param1)' `, prName, namespace)) diff --git a/upstream/test/larger_results_sidecar_logs_test.go b/upstream/test/larger_results_sidecar_logs_test.go index e1c9e54263d..5cd4845b8fc 100644 --- a/upstream/test/larger_results_sidecar_logs_test.go +++ b/upstream/test/larger_results_sidecar_logs_test.go @@ -61,6 +61,7 @@ func TestLargerResultsSidecarLogs(t *testing.T) { }} for _, td := range tds { + td := td t.Run(td.name, func(t *testing.T) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) @@ -90,7 +91,7 @@ func TestLargerResultsSidecarLogs(t *testing.T) { } t.Logf("Waiting for PipelineRun %s in namespace %s to complete", prName, namespace) - if err := WaitForPipelineRunState(ctx, c, prName, timeout, PipelineRunFailed(prName), "PipelineRunFailed", v1Version); err != nil { + if err := WaitForPipelineRunState(ctx, c, prName, timeout, PipelineRunSucceed(prName), "PipelineRunSuccess", v1Version); err != nil { t.Fatalf("Error waiting for PipelineRun %s to finish: %s", prName, err) } cl, _ := c.V1PipelineRunClient.Get(ctx, prName, metav1.GetOptions{}) @@ -133,26 +134,6 @@ func TestLargerResultsSidecarLogs(t *testing.T) { } } -func setUpSidecarLogs(ctx context.Context, t *testing.T, fn ...func(context.Context, *testing.T, *clients, string)) (*clients, string) { - t.Helper() - c, ns := setup(ctx, t) - configMapData := map[string]string{ - "results-from": "sidecar-logs", - } - - if err := updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), configMapData); err != nil { - t.Fatal(err) - } - return c, ns -} - -func resetSidecarLogs(ctx context.Context, t *testing.T, c *clients, previousResultExtractionMethod string) { - t.Helper() - if err := updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{"results-from": previousResultExtractionMethod}); err != nil { - t.Fatal(err) - } -} - func getLargerResultsPipelineRun(t *testing.T, namespace string) (*v1.PipelineRun, *v1.PipelineRun, []*v1.TaskRun) { t.Helper() pipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` @@ -169,31 +150,16 @@ spec: - name: result2 steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s"| tee $(results.result1.path); echo -n "%s"| tee $(results.result2.path); - name: task2 - taskSpec: - results: - - name: result1 - - name: result2 - steps: - - name: step1 - onError: continue - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result2.path); - # trigger an error - not-a-command - # This result will be skipped - echo -n "%s"| tee $(results.result1.path); - - name: task3 params: - name: param1 value: "$(tasks.task1.results.result1)" - name: param2 - value: "$(tasks.task2.results.result2)" + value: "$(tasks.task1.results.result2)" taskSpec: params: - name: param1 @@ -206,28 +172,14 @@ spec: - name: large-result steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "$(params.param1)">> $(results.large-result.path); echo -n "$(params.param2)">> $(results.large-result.path); - - name: failed-task - runAfter: ["task3"] - taskSpec: - results: - - name: result1 - - name: result2 - steps: - - name: step1 - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result1.path); - echo -n "%s"| tee $(results.result2.path); - #trigger a failure - not-a-command results: - name: large-result - value: $(tasks.task3.results.large-result) -`, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("d", 2000), strings.Repeat("c", 2000), strings.Repeat("e", 2000), strings.Repeat("f", 2000))) + value: $(tasks.task2.results.large-result) +`, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000))) expectedPipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` metadata: name: larger-results-sidecar-logs @@ -248,33 +200,16 @@ spec: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s"| tee $(results.result1.path); echo -n "%s"| tee $(results.result2.path); - name: task2 - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - onError: continue - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result2.path); - # trigger an error - not-a-command - # This result will be skipped - echo -n "%s"| tee $(results.result1.path); - - name: task3 params: - name: param1 value: "$(tasks.task1.results.result1)" - name: param2 - value: "$(tasks.task2.results.result2)" + value: "$(tasks.task1.results.result2)" taskSpec: params: - name: param1 @@ -288,29 +223,13 @@ spec: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "$(params.param1)">> $(results.large-result.path); echo -n "$(params.param2)">> $(results.large-result.path); - - name: failed-task - runAfter: ["task3"] - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result1.path); - echo -n "%s"| tee $(results.result2.path); - #trigger a failure - not-a-command results: - name: large-result - value: $(tasks.task3.results.large-result) + value: $(tasks.task2.results.large-result) status: pipelineSpec: tasks: @@ -323,33 +242,16 @@ status: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s"| tee $(results.result1.path); echo -n "%s"| tee $(results.result2.path); - name: task2 - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - image: mirror.gcr.io/alpine - onError: continue - script: | - echo -n "%s"| tee $(results.result2.path); - # trigger an error - not-a-command - # This result will be skipped - echo -n "%s"| tee $(results.result1.path); - - name: task3 params: - name: param1 value: "$(tasks.task1.results.result1)" - name: param2 - value: "$(tasks.task2.results.result2)" + value: "$(tasks.task1.results.result2)" taskSpec: params: - name: param1 @@ -363,33 +265,17 @@ status: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "$(params.param1)">> $(results.large-result.path); echo -n "$(params.param2)">> $(results.large-result.path); - - name: failed-task - runAfter: ["task3"] - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result1.path); - echo -n "%s"| tee $(results.result2.path); - #trigger a failure - not-a-command results: - name: large-result - value: $(tasks.task3.results.large-result) + value: $(tasks.task2.results.large-result) results: - name: large-result value: %s%s -`, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("d", 2000), strings.Repeat("c", 2000), strings.Repeat("e", 2000), strings.Repeat("f", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("d", 2000), strings.Repeat("c", 2000), strings.Repeat("e", 2000), strings.Repeat("f", 2000), strings.Repeat("a", 2000), strings.Repeat("d", 2000))) +`, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000))) taskRun1 := parse.MustParseV1TaskRun(t, fmt.Sprintf(` metadata: name: larger-results-sidecar-logs-task1 @@ -405,7 +291,7 @@ spec: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s"| tee $(results.result1.path); echo -n "%s"| tee $(results.result2.path); @@ -423,7 +309,7 @@ status: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s"| tee /tekton/results/result1; echo -n "%s"| tee /tekton/results/result2; @@ -437,66 +323,11 @@ status: sidecars: - name: tekton-log-results container: sidecar-tekton-log-results - artifacts: {} `, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000))) taskRun2 := parse.MustParseV1TaskRun(t, fmt.Sprintf(` metadata: name: larger-results-sidecar-logs-task2 namespace: %s -spec: - serviceAccountName: default - timeout: 1h - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - onError: continue - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result2.path); - # trigger an error - not-a-command - # This result will be skipped - echo -n "%s"| tee $(results.result1.path); -status: - conditions: - - type: "Succeeded" - status: "True" - reason: "Succeeded" - podName: larger-results-sidecar-logs-task2-pod - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - onError: continue - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee /tekton/results/result2; - # trigger an error - not-a-command - # This result will be skipped - echo -n "%s"| tee /tekton/results/result1; - results: - - name: result2 - type: string - value: %s - sidecars: - - name: tekton-log-results - container: sidecar-tekton-log-results - artifacts: {} -`, namespace, strings.Repeat("d", 2000), strings.Repeat("c", 2000), strings.Repeat("d", 2000), strings.Repeat("c", 2000), strings.Repeat("d", 2000))) - taskRun3 := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: larger-results-sidecar-logs-task3 - namespace: %s spec: serviceAccountName: default timeout: 1h @@ -520,7 +351,7 @@ spec: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "$(params.param1)">> $(results.large-result.path); echo -n "$(params.param2)">> $(results.large-result.path); @@ -529,7 +360,7 @@ status: - type: "Succeeded" status: "True" reason: "Succeeded" - podName: larger-results-sidecar-logs-task3-pod + podName: larger-results-sidecar-logs-task2-pod taskSpec: params: - name: param1 @@ -543,7 +374,7 @@ status: type: string steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n "%s">> /tekton/results/large-result; echo -n "%s">> /tekton/results/large-result; @@ -554,60 +385,26 @@ status: sidecars: - name: tekton-log-results container: sidecar-tekton-log-results - artifacts: {} -`, namespace, strings.Repeat("a", 2000), strings.Repeat("d", 2000), strings.Repeat("a", 2000), strings.Repeat("d", 2000), strings.Repeat("a", 2000), strings.Repeat("d", 2000))) - taskRun4 := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: larger-results-sidecar-logs-failed-task - namespace: %s -spec: - serviceAccountName: default - timeout: 1h - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee $(results.result1.path); - echo -n "%s"| tee $(results.result2.path); - #trigger a failure - not-a-command -status: - conditions: - - type: "Succeeded" - status: "False" - reason: "Failed" - podName: larger-results-sidecar-logs-failed-task-pod - taskSpec: - results: - - name: result1 - type: string - - name: result2 - type: string - steps: - - name: step1 - image: mirror.gcr.io/alpine - script: | - echo -n "%s"| tee /tekton/results/result1; - echo -n "%s"| tee /tekton/results/result2; - #trigger a failure - not-a-command - results: - - name: result1 - type: string - value: %s - - name: result2 - type: string - value: %s - sidecars: - - name: tekton-log-results - container: sidecar-tekton-log-results - artifacts: {} -`, namespace, strings.Repeat("e", 2000), strings.Repeat("f", 2000), strings.Repeat("e", 2000), strings.Repeat("f", 2000), strings.Repeat("e", 2000), strings.Repeat("f", 2000))) - return pipelineRun, expectedPipelineRun, []*v1.TaskRun{taskRun1, taskRun2, taskRun3, taskRun4} +`, namespace, strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000), strings.Repeat("a", 2000), strings.Repeat("b", 2000))) + return pipelineRun, expectedPipelineRun, []*v1.TaskRun{taskRun1, taskRun2} +} + +func setUpSidecarLogs(ctx context.Context, t *testing.T, fn ...func(context.Context, *testing.T, *clients, string)) (*clients, string) { + t.Helper() + c, ns := setup(ctx, t) + configMapData := map[string]string{ + "results-from": "sidecar-logs", + } + + if err := updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), configMapData); err != nil { + t.Fatal(err) + } + return c, ns +} + +func resetSidecarLogs(ctx context.Context, t *testing.T, c *clients, previousResultExtractionMethod string) { + t.Helper() + if err := updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{"results-from": previousResultExtractionMethod}); err != nil { + t.Fatal(err) + } } diff --git a/upstream/test/matrix_test.go b/upstream/test/matrix_test.go index 04475140b02..6dcdec5fe4e 100644 --- a/upstream/test/matrix_test.go +++ b/upstream/test/matrix_test.go @@ -70,7 +70,7 @@ spec: default: "" steps: - name: echo - image: mirror.gcr.io/alpine + image: alpine script: | echo "$(params.GOARCH) and $(params.version)" `, namespace)) @@ -85,7 +85,7 @@ spec: type: array steps: - name: produce-a-list-of-results - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"linux/amd64\",\"linux/ppc64le\"]" | tee $(results.GOARCHs.path) @@ -101,7 +101,7 @@ spec: type: array steps: - name: produce-a-list-of-versions - image: mirror.gcr.io/bash + image: bash:latest script: | #!/usr/bin/env bash echo -n "[\"go1.17\",\"go1.18.1\"]" | tee $(results.versions.path) @@ -206,9 +206,6 @@ spec: Reason: "Succeeded", Message: "All Steps have completed executing", }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{}, - }, }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -238,9 +235,6 @@ spec: Reason: "Succeeded", Message: "All Steps have completed executing", }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{}, - }, }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -267,9 +261,6 @@ spec: Reason: "Succeeded", Message: "All Steps have completed executing", }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{}, - }, }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -296,9 +287,6 @@ spec: Reason: "Succeeded", Message: "All Steps have completed executing", }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{}, - }, }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -319,9 +307,6 @@ spec: Reason: "Succeeded", Message: "All Steps have completed executing", }}}, - TaskRunStatusFields: v1.TaskRunStatusFields{ - Artifacts: &v1.Artifacts{}, - }, }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -338,7 +323,6 @@ spec: Type: "array", Value: v1.ParamValue{Type: v1.ParamTypeArray, ArrayVal: []string{"linux/amd64", "linux/ppc64le"}}, }}, - Artifacts: &v1.Artifacts{}, }, Status: duckv1.Status{Conditions: []apis.Condition{{ Type: apis.ConditionSucceeded, @@ -362,7 +346,6 @@ spec: Type: "array", Value: v1.ParamValue{Type: v1.ParamTypeArray, ArrayVal: []string{"go1.17", "go1.18.1"}}, }}, - Artifacts: &v1.Artifacts{}, }, Status: duckv1.Status{Conditions: []apis.Condition{{ Type: apis.ConditionSucceeded, @@ -420,7 +403,7 @@ spec: - name: exit-code steps: - name: echo - image: mirror.gcr.io/alpine + image: alpine script: | exit "$(params.exit-code)" `, namespace)) diff --git a/upstream/test/parse/yaml.go b/upstream/test/parse/yaml.go index 847084b9c26..68bc16e14b5 100644 --- a/upstream/test/parse/yaml.go +++ b/upstream/test/parse/yaml.go @@ -35,17 +35,6 @@ kind: StepAction return &sa } -// MustParseV1beta1StepAction takes YAML and parses it into a *v1alpha1.StepAction -func MustParseV1beta1StepAction(t *testing.T, yaml string) *v1beta1.StepAction { - t.Helper() - var sa v1beta1.StepAction - yaml = `apiVersion: tekton.dev/v1beta1 -kind: StepAction -` + yaml - mustParseYAML(t, yaml, &sa) - return &sa -} - // MustParseV1beta1TaskRun takes YAML and parses it into a *v1beta1.TaskRun func MustParseV1beta1TaskRun(t *testing.T, yaml string) *v1beta1.TaskRun { t.Helper() diff --git a/upstream/test/per_feature_flags_test.go b/upstream/test/per_feature_flags_test.go index 4fb8f833005..4555d2010c9 100644 --- a/upstream/test/per_feature_flags_test.go +++ b/upstream/test/per_feature_flags_test.go @@ -47,8 +47,8 @@ const ( ) var ( - alphaFeatureFlags = []string{"enable-param-enum", "keep-pod-enabled-cancel", "enable-cel-in-whenexpression", "enable-artifacts"} - betaFeatureFlags = []string{"enable-step-actions"} + alphaFeatureFlags = []string{"enable-param-enum", "enable-step-actions", "keep-pod-enabled-cancel", "enable-cel-in-whenexpression", "enable-artifacts"} + betaFeatureFlags = []string{} perFeatureFlags = map[string][]string{ "alpha": alphaFeatureFlags, "beta": betaFeatureFlags, @@ -152,9 +152,9 @@ spec: results: - name: result steps: - - image: mirror.gcr.io/busybox + - image: busybox script: 'echo $(params["text"])' - - image: mirror.gcr.io/busybox + - image: busybox # Sleep for N seconds so that we can check that tasks that # should be run in parallel have overlap. script: | @@ -269,7 +269,7 @@ spec: - name: result1 steps: - name: failing-step - image: mirror.gcr.io/busybox + image: busybox script: 'echo -n 123 | tee $(results.result1.path); exit 1' finally: - name: finaltask1 @@ -280,7 +280,7 @@ spec: params: - name: param1 steps: - - image: mirror.gcr.io/busybox + - image: busybox script: 'echo $(params.param1);exit 0' `, helpers.ObjectNameForTest(t))) @@ -356,14 +356,14 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) `, namespace)) @@ -397,14 +397,14 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) status: pipelineSpec: @@ -413,14 +413,14 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) @@ -443,7 +443,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: podName: propagated-parameters-fully-echo-hello-pod @@ -453,7 +453,7 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) @@ -466,7 +466,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: podName: propagated-parameters-fully-echo-hello-finally-pod @@ -476,7 +476,7 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) diff --git a/upstream/test/pipelinefinally_test.go b/upstream/test/pipelinefinally_test.go index 4173a446556..50397307012 100644 --- a/upstream/test/pipelinefinally_test.go +++ b/upstream/test/pipelinefinally_test.go @@ -788,7 +788,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'exit 0' `, helpers.ObjectNameForTest(t), namespace)) } @@ -801,7 +801,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'exit 1' `, helpers.ObjectNameForTest(t), namespace)) } @@ -814,7 +814,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'sleep 5; exit 0' `, helpers.ObjectNameForTest(t), namespace)) } @@ -827,7 +827,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'exit 0' params: - name: dagtask1-status @@ -845,7 +845,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'echo -n "Hello" > $(results.result.path)' results: - name: result @@ -890,7 +890,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'sleep 5; echo -n "Hello" > $(results.result.path)' results: - name: result @@ -905,7 +905,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'exit 0' params: - name: %s diff --git a/upstream/test/pipelinerun_test.go b/upstream/test/pipelinerun_test.go index 06b4448abd3..64b8534f862 100644 --- a/upstream/test/pipelinerun_test.go +++ b/upstream/test/pipelinerun_test.go @@ -68,7 +68,7 @@ spec: - name: HELLO default: "Hi!" steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | #!/usr/bin/env bash echo "$(params.HELLO)" @@ -91,6 +91,8 @@ spec: }} for i, td := range tds { + i := i // capture range variable + td := td // capture range variable t.Run(td.name, func(t *testing.T) { t.Parallel() ctx := context.Background() @@ -295,6 +297,8 @@ spec: }} for i, td := range tds { + i := i // capture range variable + td := td // capture range variable t.Run(td.name, func(t *testing.T) { t.Parallel() ctx := context.Background() @@ -440,7 +444,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash # Sleep for 10s @@ -450,7 +454,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash # Sleep for another 10s @@ -512,7 +516,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu command: ['/bin/bash'] args: ['-c', 'echo hello, world'] `, taskName, namespace)), metav1.CreateOptions{}); err != nil { @@ -582,10 +586,10 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox name: write-data-task-0-step-0 script: echo stuff | tee $(results.result-stuff.path) - - image: mirror.gcr.io/busybox + - image: busybox name: write-data-task-0-step-1 script: echo other | tee $(results.result-other.path) results: @@ -600,10 +604,10 @@ spec: params: - name: check-stuff steps: - - image: mirror.gcr.io/busybox + - image: busybox name: read-from-task-0 script: echo $(params.check-stuff) - - image: mirror.gcr.io/busybox + - image: busybox name: write-data-task-1 script: echo | tee $(results.result-something.path) results: @@ -618,9 +622,9 @@ spec: - name: check-other steps: - script: echo $(params.check-other) - image: mirror.gcr.io/busybox + image: busybox name: read-from-task-0 - - image: mirror.gcr.io/busybox + - image: busybox name: write-data-task-1 script: echo something | tee $(results.result-else.path) results: @@ -637,7 +641,7 @@ spec: - name: workspacepath-else value: $(tasks.create-file.results.result-else) steps: - - image: mirror.gcr.io/busybox + - image: busybox script: echo params.workspacepath-something `, helpers.ObjectNameForTest(t), namespace)), } @@ -971,7 +975,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu command: ['/bin/bash'] args: ['-c', 'echo hello, world'] `, taskName, namespace)), metav1.CreateOptions{}); err != nil { @@ -1007,7 +1011,7 @@ spec: - name: abc steps: - name: update-sa - image: mirror.gcr.io/bash + image: bash:latest script: | echo 'test' > $(results.abc.path) exit 1 diff --git a/upstream/test/premption_test.go b/upstream/test/premption_test.go index a8dd50e36df..59373503b55 100644 --- a/upstream/test/premption_test.go +++ b/upstream/test/premption_test.go @@ -62,7 +62,7 @@ spec: memory: 5000Gi steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "Good Morning!" > $(workspaces.task-ws.path) diff --git a/upstream/test/propagated_params_test.go b/upstream/test/propagated_params_test.go index 87429a03b78..4e615201124 100644 --- a/upstream/test/propagated_params_test.go +++ b/upstream/test/propagated_params_test.go @@ -66,6 +66,7 @@ func TestPropagatedParams(t *testing.T) { }} for _, td := range tds { + td := td t.Run(td.name, func(t *testing.T) { t.Parallel() ctx := context.Background() @@ -150,14 +151,14 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) `, namespace)) expectedPipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` @@ -176,14 +177,14 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) status: pipelineSpec: @@ -192,14 +193,14 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! finally: - name: echo-hello-finally taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -211,18 +212,17 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: podName: propagated-parameters-fully-echo-hello-pod - artifacts: {} steps: - name: echo container: step-echo taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) finallyTaskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -234,10 +234,9 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: - artifacts: {} podName: propagated-parameters-fully-echo-hello-finally-pod steps: - name: echo @@ -245,7 +244,7 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) return pipelineRun, expectedPipelineRun, []*v1.TaskRun{taskRun, finallyTaskRun} @@ -270,7 +269,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) `, namespace)) expectedPipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` @@ -292,7 +291,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) status: pipelineSpec: @@ -304,7 +303,7 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -319,10 +318,9 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: - artifacts: {} podName: propagated-parameters-task-level-echo-hello-pod steps: - name: echo @@ -330,7 +328,7 @@ status: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) return pipelineRun, expectedPipelineRun, []*v1.TaskRun{taskRun} @@ -356,7 +354,7 @@ spec: default: "Default Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) `, namespace)) expectedPipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` @@ -379,7 +377,7 @@ spec: default: "Default Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.HELLO) status: pipelineSpec: @@ -392,7 +390,7 @@ status: default: "Default Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -408,10 +406,9 @@ spec: default: "Default Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! status: - artifacts: {} podName: propagated-parameters-default-task-level-echo-hello-pod steps: - name: echo @@ -423,7 +420,7 @@ status: default: "Default Hello World" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo Hello World! `, namespace)) return pipelineRun, expectedPipelineRun, []*v1.TaskRun{taskRun} diff --git a/upstream/test/propagated_results_test.go b/upstream/test/propagated_results_test.go index 6e1a1b87fc9..57fee1be165 100644 --- a/upstream/test/propagated_results_test.go +++ b/upstream/test/propagated_results_test.go @@ -43,8 +43,7 @@ func TestPropagatedResults(t *testing.T) { ignorePipelineRunStatusFields := cmpopts.IgnoreFields(v1.PipelineRunStatusFields{}, "Provenance") ignoreTaskRunStatus := cmpopts.IgnoreFields(v1.TaskRunStatusFields{}, "StartTime", "CompletionTime", "Sidecars", "Provenance") requireAlphaFeatureFlag = requireAnyGate(map[string]string{ - "enable-api-fields": "alpha", - }) + "enable-api-fields": "alpha"}) type tests struct { name string @@ -59,6 +58,7 @@ func TestPropagatedResults(t *testing.T) { }} for _, td := range tds { + td := td t.Run(td.name, func(t *testing.T) { t.Parallel() ctx := context.Background() @@ -151,17 +151,17 @@ spec: } steps: - name: add-str-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo "1001" | tee $(results.strUid.path) - name: add-array-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo "[\"1002\", \"1003\"]" | tee $(results.arrayUid.path) - name: add-map-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo -n "{\"uid\":\"1004\"}" | tee $(results.mapUid.path) @@ -169,19 +169,19 @@ spec: taskSpec: steps: - name: show-str-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo - $(tasks.make-uid.results.strUid) - name: show-array-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo - $(tasks.make-uid.results.arrayUid[*]) - name: show-map-uid - image: mirror.gcr.io/busybox + image: busybox command: ["/bin/sh", "-c"] args: - echo @@ -212,21 +212,21 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-str-uid - args: - echo "[\"1002\", \"1003\"]" | tee $(results.arrayUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-array-uid - args: - echo -n "{\"uid\":\"1004\"}" | tee $(results.mapUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-map-uid - name: show-uid taskSpec: @@ -237,7 +237,7 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-str-uid - args: - echo @@ -245,7 +245,7 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-array-uid - args: - echo @@ -253,7 +253,7 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-map-uid timeouts: pipeline: 1h0m0s @@ -278,21 +278,21 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-str-uid - args: - echo "[\"1002\", \"1003\"]" | tee $(results.arrayUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-array-uid - args: - echo -n "{\"uid\":\"1004\"}" | tee $(results.mapUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-map-uid - name: show-uid taskSpec: @@ -303,7 +303,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-str-uid - args: - echo @@ -311,7 +311,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-array-uid - args: - echo @@ -319,7 +319,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-map-uid `, namespace)) makeUidTaskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -344,25 +344,24 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-str-uid - args: - echo "[\"1002\", \"1003\"]" | tee $(results.arrayUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-array-uid - args: - echo -n "{\"uid\":\"1004\"}" | tee $(results.mapUid.path) command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-map-uid timeout: 1h0m0s status: - artifacts: {} podName: propagated-all-type-results-make-uid-pod results: - name: strUid @@ -402,21 +401,21 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-str-uid - args: - echo "[\"1002\", \"1003\"]" | tee /tekton/results/arrayUid command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-array-uid - args: - echo -n "{\"uid\":\"1004\"}" | tee /tekton/results/mapUid command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: add-map-uid `, namespace)) showUidTaskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -433,7 +432,7 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-str-uid - args: - echo @@ -442,7 +441,7 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-array-uid - args: - echo @@ -450,11 +449,10 @@ spec: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-map-uid timeout: 1h0m0s status: - artifacts: {} podName: propagated-all-type-results-show-uid-pod steps: - container: step-show-str-uid @@ -472,7 +470,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-str-uid - args: - echo @@ -481,7 +479,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-array-uid - args: - echo @@ -489,7 +487,7 @@ status: command: - /bin/sh - -c - image: mirror.gcr.io/busybox + image: busybox name: show-map-uid `, namespace)) return pipelineRun, expectedPipelineRun, []*v1.TaskRun{makeUidTaskRun, showUidTaskRun} diff --git a/upstream/test/remoteresolution/resolution.go b/upstream/test/remoteresolution/resolution.go deleted file mode 100644 index 05274a7a182..00000000000 --- a/upstream/test/remoteresolution/resolution.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Copyright 2024 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 test - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - resource "github.com/tektoncd/pipeline/pkg/remoteresolution/resource" - resolution "github.com/tektoncd/pipeline/pkg/resolution/common" - "github.com/tektoncd/pipeline/test/diff" -) - -var _ resource.Requester = &Requester{} -var _ resolution.ResolvedResource = &ResolvedResource{} - -// NewResolvedResource creates a mock resolved resource that is -// populated with the given data and annotations or returns the given -// error from its Data() method. -func NewResolvedResource(data []byte, annotations map[string]string, source *pipelinev1.RefSource, dataErr error) *ResolvedResource { - return &ResolvedResource{ - ResolvedData: data, - ResolvedAnnotations: annotations, - ResolvedRefSource: source, - DataErr: dataErr, - } -} - -// NewRequester creates a mock requester that resolves to the given -// resource or returns the given error on Submit(). -func NewRequester(resource resolution.ResolvedResource, err error, resolverPayload resource.ResolverPayload) *Requester { - return &Requester{ - ResolvedResource: resource, - SubmitErr: err, - ResolverPayload: resolverPayload, - } -} - -// Requester implements resolution.Requester and makes it easier -// to mock the outcome of a remote pipelineRef or taskRef resolution. -type Requester struct { - // The resolved resource object to return when a request is - // submitted. - ResolvedResource resolution.ResolvedResource - // An error to return when a request is submitted. - SubmitErr error - // ResolverPayload that should match that of the request in order to return the resolved resource - ResolverPayload resource.ResolverPayload -} - -// Submit implements resolution.Requester, accepting the name of a -// resolver and a request for a specific remote file, and then returns -// whatever mock data was provided on initialization. -func (r *Requester) Submit(ctx context.Context, resolverName resolution.ResolverName, req resource.Request) (resolution.ResolvedResource, error) { - if (r.ResolverPayload == resource.ResolverPayload{} || r.ResolverPayload.ResolutionSpec == nil || len(r.ResolverPayload.ResolutionSpec.Params) == 0) { - return r.ResolvedResource, r.SubmitErr - } - if r.ResolverPayload.ResolutionSpec.URL == "" { - return r.ResolvedResource, r.SubmitErr - } - reqParams := make(map[string]pipelinev1.ParamValue) - for _, p := range req.ResolverPayload().ResolutionSpec.Params { - reqParams[p.Name] = p.Value - } - - var wrongParams []string - for _, p := range r.ResolverPayload.ResolutionSpec.Params { - if reqValue, ok := reqParams[p.Name]; !ok { - wrongParams = append(wrongParams, fmt.Sprintf("expected %s param to be %#v, but was %#v", p.Name, p.Value, reqValue)) - } else if d := cmp.Diff(p.Value, reqValue); d != "" { - wrongParams = append(wrongParams, fmt.Sprintf("%s param did not match: %s", p.Name, diff.PrintWantGot(d))) - } - } - if len(wrongParams) > 0 { - return nil, errors.New(strings.Join(wrongParams, "; ")) - } - if r.ResolverPayload.ResolutionSpec.URL != req.ResolverPayload().ResolutionSpec.URL { - return nil, fmt.Errorf("Resolution name did not match. Got %s; Want %s", req.ResolverPayload().ResolutionSpec.URL, r.ResolverPayload.ResolutionSpec.URL) - } - - return r.ResolvedResource, r.SubmitErr -} - -// ResolvedResource implements resolution.ResolvedResource and makes -// it easier to mock the resolved content of a fetched pipeline or task. -type ResolvedResource struct { - // The resolved bytes to return when resolution is complete. - ResolvedData []byte - // An error to return instead of the resolved bytes after - // resolution completes. - DataErr error - // Annotations to return when resolution is complete. - ResolvedAnnotations map[string]string - // ResolvedRefSource to return the source reference of the remote data - ResolvedRefSource *pipelinev1.RefSource -} - -// Data implements resolution.ResolvedResource and returns the mock -// data and/or error given to it on initialization. -func (r *ResolvedResource) Data() ([]byte, error) { - return r.ResolvedData, r.DataErr -} - -// Annotations implements resolution.ResolvedResource and returns -// the mock annotations given to it on initialization. -func (r *ResolvedResource) Annotations() map[string]string { - return r.ResolvedAnnotations -} - -// RefSource is the source reference of the remote data that records where the remote -// file came from including the url, digest and the entrypoint. -func (r *ResolvedResource) RefSource() *pipelinev1.RefSource { - return r.ResolvedRefSource -} - -// RawRequest stores the raw request data -type RawRequest struct { - ResolverPayload resource.ResolverPayload -} - -// Request returns a Request interface based on the RawRequest. -func (r *RawRequest) Request() resource.Request { - if r == nil { - r = &RawRequest{} - } - return &Request{ - RawRequest: *r, - } -} - -// Request implements resolution.Request and makes it easier to mock input for submit -// Using inline structs is to avoid conflicts between field names and method names. -type Request struct { - RawRequest -} - -var _ resource.Request = &Request{} - -// NewRequest creates a mock request that is populated with the given name namespace and params -func NewRequest(resolverPayload resource.ResolverPayload) *Request { - return &Request{ - RawRequest: RawRequest{ - ResolverPayload: resolverPayload, - }, - } -} - -// Params implements resolution.Request and returns the mock params given to it on initialization. -func (r *Request) ResolverPayload() resource.ResolverPayload { - return r.RawRequest.ResolverPayload -} - -var _ resource.Request = &Request{} diff --git a/upstream/test/resolution/resolution.go b/upstream/test/resolution.go similarity index 91% rename from upstream/test/resolution/resolution.go rename to upstream/test/resolution.go index b8b940658f9..514988427f2 100644 --- a/upstream/test/resolution/resolution.go +++ b/upstream/test/resolution.go @@ -24,16 +24,16 @@ import ( "github.com/google/go-cmp/cmp" pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - common "github.com/tektoncd/pipeline/pkg/resolution/common" + resolution "github.com/tektoncd/pipeline/pkg/resolution/common" "github.com/tektoncd/pipeline/test/diff" ) -var _ common.Requester = &Requester{} -var _ common.ResolvedResource = &ResolvedResource{} +var _ resolution.Requester = &Requester{} +var _ resolution.ResolvedResource = &ResolvedResource{} // NewRequester creates a mock requester that resolves to the given // resource or returns the given error on Submit(). -func NewRequester(resource common.ResolvedResource, err error) *Requester { +func NewRequester(resource resolution.ResolvedResource, err error) *Requester { return &Requester{ ResolvedResource: resource, SubmitErr: err, @@ -57,7 +57,7 @@ func NewResolvedResource(data []byte, annotations map[string]string, source *pip type Requester struct { // The resolved resource object to return when a request is // submitted. - ResolvedResource common.ResolvedResource + ResolvedResource resolution.ResolvedResource // An error to return when a request is submitted. SubmitErr error // Params that should match those on the request in order to return the resolved resource @@ -67,7 +67,7 @@ type Requester struct { // Submit implements resolution.Requester, accepting the name of a // resolver and a request for a specific remote file, and then returns // whatever mock data was provided on initialization. -func (r *Requester) Submit(ctx context.Context, resolverName common.ResolverName, req common.Request) (common.ResolvedResource, error) { +func (r *Requester) Submit(ctx context.Context, resolverName resolution.ResolverName, req resolution.Request) (resolution.ResolvedResource, error) { if len(r.Params) == 0 { return r.ResolvedResource, r.SubmitErr } @@ -134,7 +134,7 @@ type RawRequest struct { } // Request returns a Request interface based on the RawRequest. -func (r *RawRequest) Request() common.Request { +func (r *RawRequest) Request() resolution.Request { if r == nil { r = &RawRequest{} } @@ -149,7 +149,7 @@ type Request struct { RawRequest } -var _ common.Request = &Request{} +var _ resolution.Request = &Request{} // NewRequest creates a mock request that is populated with the given name namespace and params func NewRequest(name, namespace string, params []pipelinev1.Param) *Request { diff --git a/upstream/test/resolvers_test.go b/upstream/test/resolvers_test.go index 813e6b34d47..1979a1703c2 100644 --- a/upstream/test/resolvers_test.go +++ b/upstream/test/resolvers_test.go @@ -37,7 +37,7 @@ import ( resolverconfig "github.com/tektoncd/pipeline/pkg/apis/config/resolver" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun" - gitresolution "github.com/tektoncd/pipeline/pkg/resolution/resolver/git" + "github.com/tektoncd/pipeline/pkg/resolution/resolver/git" "github.com/tektoncd/pipeline/test/parse" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -388,7 +388,7 @@ spec: taskSpec: steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash # Sleep for 10s @@ -484,24 +484,24 @@ func TestGitResolver_API(t *testing.T) { resovlerNS := resolverconfig.ResolversNamespace(systemNamespace) - originalConfigMap, err := c.KubeClient.CoreV1().ConfigMaps(resovlerNS).Get(ctx, gitresolution.ConfigMapName, metav1.GetOptions{}) + originalConfigMap, err := c.KubeClient.CoreV1().ConfigMaps(resovlerNS).Get(ctx, git.ConfigMapName, metav1.GetOptions{}) if err != nil { - t.Fatalf("Failed to get ConfigMap `%s`: %s", gitresolution.ConfigMapName, err) + t.Fatalf("Failed to get ConfigMap `%s`: %s", git.ConfigMapName, err) } originalConfigMapData := originalConfigMap.Data - t.Logf("Creating ConfigMap %s", gitresolution.ConfigMapName) + t.Logf("Creating ConfigMap %s", git.ConfigMapName) configMapData := map[string]string{ - gitresolution.ServerURLKey: fmt.Sprint("http://", net.JoinHostPort(giteaClusterHostname, "3000")), - gitresolution.SCMTypeKey: "gitea", - gitresolution.APISecretNameKey: tokenSecretName, - gitresolution.APISecretKeyKey: scmTokenSecretKey, - gitresolution.APISecretNamespaceKey: namespace, + git.ServerURLKey: fmt.Sprint("http://", net.JoinHostPort(giteaClusterHostname, "3000")), + git.SCMTypeKey: "gitea", + git.APISecretNameKey: tokenSecretName, + git.APISecretKeyKey: scmTokenSecretKey, + git.APISecretNamespaceKey: namespace, } - if err := updateConfigMap(ctx, c.KubeClient, resovlerNS, gitresolution.ConfigMapName, configMapData); err != nil { + if err := updateConfigMap(ctx, c.KubeClient, resovlerNS, git.ConfigMapName, configMapData); err != nil { t.Fatal(err) } - defer resetConfigMap(ctx, t, c, resovlerNS, gitresolution.ConfigMapName, originalConfigMapData) + defer resetConfigMap(ctx, t, c, resovlerNS, git.ConfigMapName, originalConfigMapData) trName := helpers.ObjectNameForTest(t) tr := parse.MustParseV1TaskRun(t, fmt.Sprintf(` @@ -533,70 +533,6 @@ spec: } } -func TestGitResolver_API_Identifier(t *testing.T) { - ctx := context.Background() - c, namespace := setup(ctx, t, gitFeatureFlags) - - t.Parallel() - - knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) - defer tearDown(ctx, t, c, namespace) - - giteaClusterHostname, tokenSecretName := setupGitea(ctx, t, c, namespace) - - resovlerNS := resolverconfig.ResolversNamespace(systemNamespace) - - originalConfigMap, err := c.KubeClient.CoreV1().ConfigMaps(resovlerNS).Get(ctx, gitresolution.ConfigMapName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Failed to get ConfigMap `%s`: %s", gitresolution.ConfigMapName, err) - } - originalConfigMapData := originalConfigMap.Data - - t.Logf("Creating ConfigMap %s", gitresolution.ConfigMapName) - configMapData := map[string]string{ - "test." + gitresolution.ServerURLKey: fmt.Sprint("http://", net.JoinHostPort(giteaClusterHostname, "3000")), - "test." + gitresolution.SCMTypeKey: "gitea", - "test." + gitresolution.APISecretNameKey: tokenSecretName, - "test." + gitresolution.APISecretKeyKey: scmTokenSecretKey, - "test." + gitresolution.APISecretNamespaceKey: namespace, - } - if err := updateConfigMap(ctx, c.KubeClient, resovlerNS, gitresolution.ConfigMapName, configMapData); err != nil { - t.Fatal(err) - } - defer resetConfigMap(ctx, t, c, resovlerNS, gitresolution.ConfigMapName, originalConfigMapData) - - trName := helpers.ObjectNameForTest(t) - tr := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - taskRef: - resolver: git - params: - - name: revision - value: %s - - name: pathInRepo - value: %s - - name: org - value: %s - - name: repo - value: %s - - name: configKey - value: test -`, trName, namespace, scmRemoteBranch, scmRemoteTaskPath, scmRemoteOrg, scmRemoteRepo)) - - _, err = c.V1TaskRunClient.Create(ctx, tr, metav1.CreateOptions{}) - if err != nil { - t.Fatalf("Failed to create TaskRun: %v", err) - } - - t.Logf("Waiting for TaskRun %s in namespace %s to complete", trName, namespace) - if err := WaitForTaskRunState(ctx, c, trName, TaskRunSucceed(trName), "TaskRunSuccess", v1Version); err != nil { - t.Fatalf("Error waiting for TaskRun %s to finish: %s", trName, err) - } -} - // setupGitea reads git-resolver/gitea.yaml, replaces "default" namespace references in "namespace: default" and // svc.cluster.local hostnames with the test namespace, calls kubectl create, and waits for the gitea-0 pod to be up // and running. At that point, it'll create a test user and token, create a Secret containing that token, create an org @@ -652,7 +588,7 @@ spec: - name: token type: string steps: - - image: docker.io/alpine/curl + - image: alpine/curl script: | #!/bin/ash curl -X POST "http://gitea_admin:%s@%s:3000/api/v1/admin/users" -H "accept: application/json" -H "Content-Type: application/json" -d '%s' diff --git a/upstream/test/resolvers_yaml/pipeline-in-git.yaml b/upstream/test/resolvers_yaml/pipeline-in-git.yaml index 9006f86af50..bf88408fad2 100644 --- a/upstream/test/resolvers_yaml/pipeline-in-git.yaml +++ b/upstream/test/resolvers_yaml/pipeline-in-git.yaml @@ -12,7 +12,7 @@ spec: app: "example" steps: - name: echo - image: mirror.gcr.io/ubuntu + image: ubuntu script: | #!/usr/bin/env bash echo "Good Morning!" diff --git a/upstream/test/retry_test.go b/upstream/test/retry_test.go index fbe8ed8776c..22e388d0ed1 100644 --- a/upstream/test/retry_test.go +++ b/upstream/test/retry_test.go @@ -55,7 +55,7 @@ spec: retries: %d taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: exit 1 `, pipelineRunName, numRetries)), metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create PipelineRun %q: %v", pipelineRunName, err) diff --git a/upstream/test/serviceaccount_test.go b/upstream/test/serviceaccount_test.go index 3ee469979db..2e5013ce69c 100644 --- a/upstream/test/serviceaccount_test.go +++ b/upstream/test/serviceaccount_test.go @@ -123,17 +123,17 @@ spec: - name: task1 taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo task1 - name: task2 taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo task2 - name: task3 taskSpec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo task3 `, helpers.ObjectNameForTest(t), namespace)) if _, err := c.V1PipelineClient.Create(ctx, pipeline, metav1.CreateOptions{}); err != nil { @@ -242,7 +242,7 @@ spec: taskSpec: metadata: {} steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: echo task1 `, helpers.ObjectNameForTest(t), namespace)) if _, err := c.V1PipelineClient.Create(ctx, pipeline, metav1.CreateOptions{}); err != nil { diff --git a/upstream/test/sidecar_test.go b/upstream/test/sidecar_test.go index f21b32eb3c1..7e6ccb23a40 100644 --- a/upstream/test/sidecar_test.go +++ b/upstream/test/sidecar_test.go @@ -61,13 +61,8 @@ func TestSidecarTaskSupport(t *testing.T) { t.Parallel() for _, test := range tests { + test := test t.Run(test.desc, func(t *testing.T) { - // If Kubernetes Sidecar support is enabled the Pod will terminate and it gets caught as an error though it's expected - ff := getFeatureFlagsBaseOnAPIFlag(t) - - if ff.EnableKubernetesSidecar { - t.SkipNow() - } t.Parallel() ctx, cancel := context.WithCancel(ctx) @@ -85,11 +80,11 @@ metadata: spec: steps: - name: %s - image: mirror.gcr.io/busybox + image: busybox command: [%s] sidecars: - name: %s - image: mirror.gcr.io/busybox + image: busybox command: [%s] `, sidecarTaskName, namespace, primaryContainerName, stringSliceToYAMLArray(test.stepCommand), sidecarContainerName, stringSliceToYAMLArray(test.sidecarCommand))) diff --git a/upstream/test/start_time_test.go b/upstream/test/start_time_test.go index ad2f29db289..48812ae9218 100644 --- a/upstream/test/start_time_test.go +++ b/upstream/test/start_time_test.go @@ -56,15 +56,15 @@ metadata: spec: taskSpec: steps: - - image: mirror.gcr.io/busybox + - image: busybox script: sleep 2 - - image: mirror.gcr.io/busybox + - image: busybox script: sleep 2 - - image: mirror.gcr.io/busybox + - image: busybox script: sleep 2 - - image: mirror.gcr.io/busybox + - image: busybox script: sleep 2 - - image: mirror.gcr.io/busybox + - image: busybox script: sleep 2 `, helpers.ObjectNameForTest(t), namespace)), metav1.CreateOptions{}) if err != nil { diff --git a/upstream/test/status_test.go b/upstream/test/status_test.go index 77d249ea42b..6f10b6d8c73 100644 --- a/upstream/test/status_test.go +++ b/upstream/test/status_test.go @@ -60,7 +60,7 @@ metadata: spec: steps: - name: foo - image: mirror.gcr.io/busybox + image: busybox command: ['ls', '-la']`, helpers.ObjectNameForTest(t))) if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create Task: %s", err) @@ -234,7 +234,7 @@ spec: - name: HELLO default: "hello world!" steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu script: | #!/usr/bin/env bash echo "$(params.HELLO)" diff --git a/upstream/test/step_when_test.go b/upstream/test/step_when_test.go deleted file mode 100644 index adc0e8df01f..00000000000 --- a/upstream/test/step_when_test.go +++ /dev/null @@ -1,469 +0,0 @@ -//go:build e2e -// +build e2e - -// /* -// Copyright 2024 The Tekton Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 test - -import ( - "context" - "fmt" - "strconv" - "testing" - - "github.com/tektoncd/pipeline/pkg/apis/config" - v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/test/parse" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/system" - knativetest "knative.dev/pkg/test" - "knative.dev/pkg/test/helpers" -) - -func TestWhenExpressionsInStep(t *testing.T) { - tests := []struct { - desc string - expected []v1.StepState - taskTemplate string - }{ - { - desc: "single step, when is false, skipped", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Skipped", - Name: "foo", - Container: "step-foo", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - input: "foo" - operator: in - values: [ "bar" ] -`, - }, - { - desc: "single step, when is true, completed", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "foo", - Container: "step-foo", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - input: "foo" - operator: in - values: [ "foo" ] -`, - }, - { - desc: "two steps, first when is false, skipped and second step complete", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Skipped", - Name: "foo", - Container: "step-foo", - }, { - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "bar", - Container: "step-bar", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - input: "foo" - operator: in - values: [ "bar" ] - - name: bar - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] -`, - }, - { - desc: "two steps, when is based on step-results", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "foo", - Container: "step-foo", - Results: []v1.TaskRunStepResult{ - { - Name: "result1", - Type: "string", - Value: v1.ParamValue{Type: "string", StringVal: "bar"}, - }, - }, - }, { - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "bar", - Container: "step-bar", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - results: - - name: result1 - command: ['/bin/sh'] - args: ['-c', 'echo -n bar >> $(step.results.result1.path)'] - - name: bar - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - input: "$(steps.foo.results.result1)" - operator: in - values: [ "bar" ] -`, - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - checkFlagsEnabled := requireAllGates(requireEnableStepActionsGate) - - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - c, namespace := setup(ctx, t) - checkFlagsEnabled(ctx, t, c, "") - - knativetest.CleanupOnInterrupt(func() { - tearDown(ctx, t, c, namespace) - }, t.Logf) - - defer tearDown(ctx, t, c, namespace) - - taskRunName := helpers.ObjectNameForTest(t) - - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := parse.MustParseV1Task(t, fmt.Sprintf(tc.taskTemplate, taskRunName, namespace)) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - taskRef: - name: %s -`, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } - - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceeded", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } - - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - var ops cmp.Options - ops = append(ops, cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID", "Message")) - ops = append(ops, cmpopts.IgnoreFields(v1.StepState{}, "ImageID")) - if d := cmp.Diff(taskrun.Status.Steps, tc.expected, ops); d != "" { - t.Fatalf("-got, +want: %v", d) - } - }) - } -} - -func TestWhenExpressionsCELInStep(t *testing.T) { - tests := []struct { - desc string - expected []v1.StepState - taskTemplate string - }{ - { - desc: "single step, when is false, skipped", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Skipped", - Name: "foo", - Container: "step-foo", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - cel: "'foo'=='bar'" -`, - }, - { - desc: "single step, when CEL is true, completed", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "foo", - Container: "step-foo", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - cel: "'foo'=='foo'" -`, - }, - { - desc: "two steps, first when CEL is false, skipped and second step complete", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Skipped", - Name: "foo", - Container: "step-foo", - }, { - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "bar", - Container: "step-bar", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - cel: "'foo'=='bar'" - - name: bar - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] -`, - }, - { - desc: "two steps, when cel is based on step-results", - expected: []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "foo", - Container: "step-foo", - Results: []v1.TaskRunStepResult{ - { - Name: "result1", - Type: "string", - Value: v1.ParamValue{Type: "string", StringVal: "bar"}, - }, - }, - }, { - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "bar", - Container: "step-bar", - }}, - taskTemplate: ` -metadata: - name: %s - namespace: %s -spec: - steps: - - name: foo - image: busybox - results: - - name: result1 - command: ['/bin/sh'] - args: ['-c', 'echo -n bar >> $(step.results.result1.path)'] - - name: bar - image: busybox - command: ['/bin/sh'] - args: ['-c', 'echo hello'] - when: - - cel: "'$(steps.foo.results.result1)'=='bar'" -`, - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - featureFlags := getFeatureFlagsBaseOnAPIFlag(t) - checkFlagsEnabled := requireAllGates(requireEnableStepActionsGate) - - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - c, namespace := setup(ctx, t) - checkFlagsEnabled(ctx, t, c, "") - - previous := featureFlags.EnableCELInWhenExpression - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - config.EnableCELInWhenExpression: "true", - }) - - knativetest.CleanupOnInterrupt(func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - config.EnableCELInWhenExpression: strconv.FormatBool(previous), - }) - tearDown(ctx, t, c, namespace) - }, t.Logf) - defer func() { - updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{ - config.EnableCELInWhenExpression: strconv.FormatBool(previous), - }) - tearDown(ctx, t, c, namespace) - }() - - taskRunName := helpers.ObjectNameForTest(t) - - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := parse.MustParseV1Task(t, fmt.Sprintf(tc.taskTemplate, taskRunName, namespace)) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - taskRef: - name: %s -`, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } - - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceeded", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } - - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - var ops cmp.Options - ops = append(ops, cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID", "Message")) - ops = append(ops, cmpopts.IgnoreFields(v1.StepState{}, "ImageID")) - if d := cmp.Diff(taskrun.Status.Steps, tc.expected, ops); d != "" { - t.Fatalf("-got, +want: %v", d) - } - }) - } -} diff --git a/upstream/test/stepaction_results_test.go b/upstream/test/stepaction_results_test.go index 43a5702c582..5c3fafa50a2 100644 --- a/upstream/test/stepaction_results_test.go +++ b/upstream/test/stepaction_results_test.go @@ -28,7 +28,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/test/parse" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/system" @@ -49,7 +49,7 @@ func TestStepResultsStepActions(t *testing.T) { type tests struct { name string taskRunFunc func(*testing.T, string) (*v1.TaskRun, *v1.TaskRun) - stepActionFunc func(*testing.T, string) *v1beta1.StepAction + stepActionFunc func(*testing.T, string) *v1alpha1.StepAction } tds := []tests{{ @@ -59,6 +59,7 @@ func TestStepResultsStepActions(t *testing.T) { }} for _, td := range tds { + td := td t.Run(td.name, func(t *testing.T) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) @@ -79,7 +80,7 @@ func TestStepResultsStepActions(t *testing.T) { trName := taskRun.Name - _, err := c.V1beta1StepActionClient.Create(ctx, stepAction, metav1.CreateOptions{}) + _, err := c.V1alpha1StepActionClient.Create(ctx, stepAction, metav1.CreateOptions{}) if err != nil { t.Fatalf("Failed to create StepAction : %s", err) } @@ -113,9 +114,9 @@ func TestStepResultsStepActions(t *testing.T) { } } -func getStepAction(t *testing.T, namespace string) *v1beta1.StepAction { +func getStepAction(t *testing.T, namespace string) *v1alpha1.StepAction { t.Helper() - return parse.MustParseV1beta1StepAction(t, fmt.Sprintf(` + return parse.MustParseV1alpha1StepAction(t, fmt.Sprintf(` metadata: name: step-action namespace: %s @@ -123,7 +124,7 @@ spec: results: - name: result1 type: string - image: mirror.gcr.io/alpine + image: alpine script: | echo -n step-action >> $(step.results.result1.path) `, namespace)) @@ -139,7 +140,7 @@ spec: taskSpec: steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n inlined-step >> $(step.results.result1.path) results: @@ -167,7 +168,7 @@ spec: taskSpec: steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine script: | echo -n inlined-step >> $(step.results.result1.path) results: @@ -189,18 +190,17 @@ status: status: "True" reason: "Succeeded" podName: step-results-task-run-pod - artifacts: {} taskSpec: steps: - name: step1 - image: mirror.gcr.io/alpine + image: alpine results: - name: result1 type: string script: | echo -n inlined-step >> /tekton/steps/step-step1/results/result1 - name: step2 - image: mirror.gcr.io/alpine + image: alpine results: - name: result1 type: string diff --git a/upstream/test/task_results_from_failed_tasks_test.go b/upstream/test/task_results_from_failed_tasks_test.go index 16911f40d54..5ecf98ae204 100644 --- a/upstream/test/task_results_from_failed_tasks_test.go +++ b/upstream/test/task_results_from_failed_tasks_test.go @@ -52,7 +52,7 @@ spec: - name: result2 steps: - name: failing-step - image: mirror.gcr.io/busybox + image: busybox script: 'echo -n 123 | tee $(results.result1.path); exit 1; echo -n 456 | tee $(results.result2.path)' finally: - name: finaltask1 @@ -63,7 +63,7 @@ spec: params: - name: param1 steps: - - image: mirror.gcr.io/busybox + - image: busybox script: 'exit 0' - name: finaltask2 params: @@ -73,7 +73,7 @@ spec: params: - name: param1 steps: - - image: mirror.gcr.io/busybox + - image: busybox script: exit 0`, helpers.ObjectNameForTest(t))) if _, err := c.V1beta1PipelineRunClient.Create(ctx, pipelineRun, metav1.CreateOptions{}); err != nil { diff --git a/upstream/test/taskrun_test.go b/upstream/test/taskrun_test.go index d8382c18331..ee277fc4daa 100644 --- a/upstream/test/taskrun_test.go +++ b/upstream/test/taskrun_test.go @@ -61,13 +61,13 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'echo hello'] - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'exit 1'] - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 30s'] `, helpers.ObjectNameForTest(t), namespace)) @@ -127,33 +127,10 @@ spec: Name: "unnamed-2", Container: "step-unnamed-2", }} - expectedStepNumber := len(expectedStepState) - if len(taskrun.Status.Steps) < expectedStepNumber { - t.Fatalf("expected at least %d steps, got %d", expectedStepNumber, len(taskrun.Status.Steps)) - } ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID") - ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID", "Running") - lastStepIndex := len(expectedStepState) - 1 - for i := range lastStepIndex { - if d := cmp.Diff(taskrun.Status.Steps[i], expectedStepState[i], ignoreTerminatedFields, ignoreStepFields); d != "" { - t.Fatalf("taskrun.Status.Steps[%d]:\n-got, +want: %v", i, d) - } - } - - // Sometimes, the state of the last container in the Pod is still running, - // and the state content of the final step is not skipped. - // In this case, we should compare the state of the last step with the normal state. - otherLatestExpectedStepState := v1.StepState{ - Name: "unnamed-2", - Container: "step-unnamed-2", - } - - if d := cmp.Diff(taskrun.Status.Steps[lastStepIndex], expectedStepState[lastStepIndex], ignoreTerminatedFields, ignoreStepFields); d != "" { - t.Logf("taskrun.Status.Steps[%d]:\n-got, +want: %v", lastStepIndex, d) - // try to compare the state of the last step with the other state - if d := cmp.Diff(taskrun.Status.Steps[lastStepIndex], otherLatestExpectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { - t.Fatalf("taskrun.Status.Steps[%d]:\n-got, +want: %v", lastStepIndex, d) - } + ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID") + if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { + t.Fatalf("-got, +want: %v", d) } releaseAnnotation, ok := taskrun.Annotations[pod.ReleaseAnnotation] @@ -535,7 +512,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'exit 1'] volumeMounts: @@ -604,101 +581,3 @@ spec: t.Fatalf("expected 1 retry status, got %d", len(taskrun.Status.RetriesStatus)) } } - -func TestTaskRunResolveDefaultParameterSubstitutionOnStepAction(t *testing.T) { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - c, namespace := setup(ctx, t, requireAllGates(requireEnableStepActionsGate)) - - knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) - defer tearDown(ctx, t, c, namespace) - - t.Logf("Creating Task and TaskRun in namespace %s", namespace) - task := parse.MustParseV1Task(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - params: - - name: repository - type: string - default: https://github.com/tektoncd/catalog.git - - name: revision - type: string - default: main - steps: - - name: clone - ref: - resolver: git - params: - - name: url - value: "$(params.repository)" - - name: pathInRepo - value: /stepaction/git-clone/0.1/git-clone.yaml - - name: revision - value: "$(params.revision)" - params: - - name: output-path - value: "/tmp" - - name: url - value: $(params.repository) - - name: revision - value: $(params.revision) -`, helpers.ObjectNameForTest(t), namespace)) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task: %s", err) - } - - taskRunName := helpers.ObjectNameForTest(t) - taskRun := parse.MustParseV1TaskRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - taskRef: - name: %s - retries: 1 -`, taskRunName, namespace, task.Name)) - if _, err := c.V1TaskRunClient.Create(ctx, taskRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create TaskRun: %s", err) - } - - t.Logf("Waiting for TaskRun in namespace %s to complete", namespace) - if err := WaitForTaskRunState(ctx, c, taskRunName, TaskRunSucceed(taskRunName), "TaskRunSucceed", v1Version); err != nil { - t.Errorf("Error waiting for TaskRun to finish: %s", err) - } - - taskrun, err := c.V1TaskRunClient.Get(ctx, taskRunName, metav1.GetOptions{}) - if err != nil { - t.Fatalf("Couldn't get expected TaskRun %s: %s", taskRunName, err) - } - - if !isSuccessful(t, taskrun.GetName(), taskrun.Status.Conditions) { - t.Fatalf("task should have succeeded") - } - - expectedReason := "Succeeded" - actualReason := taskrun.Status.GetCondition(apis.ConditionSucceeded).GetReason() - if actualReason != expectedReason { - t.Fatalf("expected TaskRun to have failed reason %s, got %s", expectedReason, actualReason) - } - - expectedStepState := []v1.StepState{{ - ContainerState: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", - }, - }, - TerminationReason: "Completed", - Name: "clone", - Container: "step-clone", - }} - ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID", "Message") - ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID", "Results", "Provenance") - if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { - t.Fatalf("-got, +want: %v", d) - } -} diff --git a/upstream/test/tektonbundles_test.go b/upstream/test/tektonbundles_test.go index 39f80f3972f..3515dcaeb41 100644 --- a/upstream/test/tektonbundles_test.go +++ b/upstream/test/tektonbundles_test.go @@ -36,7 +36,9 @@ import ( "github.com/google/go-containerregistry/pkg/v1/layout" "github.com/google/go-containerregistry/pkg/v1/mutate" "github.com/google/go-containerregistry/pkg/v1/tarball" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun" "github.com/tektoncd/pipeline/test/parse" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -46,11 +48,108 @@ import ( "sigs.k8s.io/yaml" ) +var bundleFeatureFlags = requireAnyGate(map[string]string{ + "enable-tekton-oci-bundles": "true", + "enable-api-fields": "alpha", +}) + var resolverFeatureFlags = requireAllGates(map[string]string{ "enable-bundles-resolver": "true", "enable-api-fields": "beta", }) +// TestTektonBundlesSimpleWorkingExample is an integration test which tests a simple, working Tekton bundle using OCI +// images. +func TestTektonBundlesSimpleWorkingExample(t *testing.T) { + ctx := context.Background() + c, namespace := setup(ctx, t, withRegistry, bundleFeatureFlags) + + t.Parallel() + + knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) + defer tearDown(ctx, t, c, namespace) + + taskName := helpers.ObjectNameForTest(t) + pipelineName := helpers.ObjectNameForTest(t) + pipelineRunName := helpers.ObjectNameForTest(t) + repo := getRegistryServiceIP(ctx, t, c, namespace) + ":5000/tektonbundlessimple" + task := parse.MustParseV1beta1Task(t, fmt.Sprintf(` +metadata: + name: %s + namespace: %s +spec: + steps: + - name: hello + image: alpine + script: 'echo Hello' +`, taskName, namespace)) + + pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(` +metadata: + name: %s + namespace: %s +spec: + tasks: + - name: hello-world + taskRef: + name: %s + bundle: %s +`, pipelineName, namespace, taskName, repo)) + + setupBundle(ctx, t, c, namespace, repo, task, pipeline) + + // Now generate a PipelineRun to invoke this pipeline and task. + pr := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(` +metadata: + name: %s +spec: + pipelineRef: + name: %s + bundle: %s +`, pipelineRunName, pipelineName, repo)) + if _, err := c.V1beta1PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create PipelineRun: %s", err) + } + + t.Logf("Waiting for PipelineRun in namespace %s to finish", namespace) + if err := WaitForPipelineRunState(ctx, c, pipelineRunName, timeout, PipelineRunSucceed(pipelineRunName), "PipelineRunCompleted", v1beta1Version); err != nil { + t.Errorf("Error waiting for PipelineRun to finish with error: %s", err) + } + + trs, err := c.V1beta1TaskRunClient.List(ctx, metav1.ListOptions{}) + if err != nil { + t.Errorf("Error retrieving taskrun: %s", err) + } + if len(trs.Items) != 1 { + t.Fatalf("Expected 1 TaskRun but found %d", len(trs.Items)) + } + + tr := trs.Items[0] + if tr.Status.GetCondition(apis.ConditionSucceeded).IsFalse() { + t.Errorf("Expected TaskRun to succeed but instead found condition: %s", tr.Status.GetCondition(apis.ConditionSucceeded)) + } + + if tr.Status.PodName == "" { + t.Fatal("Error getting a PodName (empty)") + } + p, err := c.KubeClient.CoreV1().Pods(namespace).Get(ctx, tr.Status.PodName, metav1.GetOptions{}) + if err != nil { + t.Fatalf("Error getting pod `%s` in namespace `%s`", tr.Status.PodName, namespace) + } + for _, stat := range p.Status.ContainerStatuses { + if strings.Contains(stat.Name, "step-hello") { + req := c.KubeClient.CoreV1().Pods(namespace).GetLogs(p.Name, &corev1.PodLogOptions{Container: stat.Name}) + logContent, err := req.Do(ctx).Raw() + if err != nil { + t.Fatalf("Error getting pod logs for pod `%s` and container `%s` in namespace `%s`", tr.Status.PodName, stat.Name, namespace) + } + if !strings.Contains(string(logContent), "Hello") { + t.Fatalf("Expected logs to say hello but received %v", logContent) + } + } + } +} + // TestTektonBundlesResolver is an integration test which tests a simple, working Tekton bundle using OCI // images using the remote resolution bundles resolver. func TestTektonBundlesResolver(t *testing.T) { @@ -74,7 +173,7 @@ metadata: spec: steps: - name: hello - image: mirror.gcr.io/alpine + image: alpine script: 'echo Hello' `, taskName, namespace)) @@ -154,6 +253,169 @@ spec: } } +// TestTektonBundlesUsingRegularImage is an integration test which passes a non-Tekton bundle as a task reference. +func TestTektonBundlesUsingRegularImage(t *testing.T) { + ctx := context.Background() + c, namespace := setup(ctx, t, withRegistry, bundleFeatureFlags) + + t.Parallel() + + knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) + defer tearDown(ctx, t, c, namespace) + + taskName := helpers.ObjectNameForTest(t) + pipelineName := helpers.ObjectNameForTest(t) + pipelineRunName := helpers.ObjectNameForTest(t) + repo := getRegistryServiceIP(ctx, t, c, namespace) + ":5000/tektonbundlesregularimage" + + pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(` +metadata: + name: %s + namespace: %s +spec: + tasks: + - name: hello-world + taskRef: + name: %s + bundle: registry +`, pipelineName, namespace, taskName)) + + setupBundle(ctx, t, c, namespace, repo, nil, pipeline) + + // Now generate a PipelineRun to invoke this pipeline and task. + pr := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(` +metadata: + name: %s +spec: + pipelineRef: + name: %s + bundle: %s +`, pipelineRunName, pipelineName, repo)) + if _, err := c.V1beta1PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create PipelineRun: %s", err) + } + + t.Logf("Waiting for PipelineRun in namespace %s to finish", namespace) + if err := WaitForPipelineRunState(ctx, c, pipelineRunName, timeout, + Chain( + FailedWithReason(pipelinev1.PipelineRunReasonCouldntGetTask.String(), pipelineRunName), + FailedWithMessage("does not contain a dev.tekton.image.apiVersion annotation", pipelineRunName), + ), "PipelineRunFailed", v1beta1Version); err != nil { + t.Fatalf("Error waiting for PipelineRun to finish with expected error: %s", err) + } +} + +// TestTektonBundlesUsingImproperFormat is an integration test which passes an improperly formatted Tekton bundle as a +// task reference. +func TestTektonBundlesUsingImproperFormat(t *testing.T) { + ctx := context.Background() + c, namespace := setup(ctx, t, withRegistry, bundleFeatureFlags) + + t.Parallel() + + knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) + defer tearDown(ctx, t, c, namespace) + + taskName := helpers.ObjectNameForTest(t) + pipelineName := helpers.ObjectNameForTest(t) + pipelineRunName := helpers.ObjectNameForTest(t) + repo := getRegistryServiceIP(ctx, t, c, namespace) + ":5000/tektonbundlesimproperformat" + + ref, err := name.ParseReference(repo) + if err != nil { + t.Fatalf("Failed to parse %s as an OCI reference: %s", repo, err) + } + + task := parse.MustParseV1beta1Task(t, fmt.Sprintf(` +metadata: + name: %s + namespace: %s +spec: + steps: + - name: hello + image: alpine + script: 'echo Hello' +`, taskName, namespace)) + + pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(` +metadata: + name: %s + namespace: %s +spec: + tasks: + - name: hello-world + taskRef: + name: %s + bundle: %s +`, pipelineName, namespace, taskName, repo)) + + // Write the pipeline into an image to the registry in the proper format. Write the task using incorrect + // annotations. + rawTask, err := yaml.Marshal(task) + if err != nil { + t.Fatalf("Failed to marshal task to yaml: %s", err) + } + + rawPipeline, err := yaml.Marshal(pipeline) + if err != nil { + t.Fatalf("Failed to marshal task to yaml: %s", err) + } + + img := empty.Image + taskLayer, err := tarball.LayerFromReader(bytes.NewBuffer(rawTask)) + if err != nil { + t.Fatalf("Failed to create oci layer from task: %s", err) + } + pipelineLayer, err := tarball.LayerFromReader(bytes.NewBuffer(rawPipeline)) + if err != nil { + t.Fatalf("Failed to create oci layer from pipeline: %s", err) + } + img, err = mutate.Append(img, mutate.Addendum{ + Layer: taskLayer, + Annotations: map[string]string{ + // intentionally invalid name annotation + "org.opencontainers.image.title": taskName, + "dev.tekton.image.kind": strings.ToLower(task.Kind), + "dev.tekton.image.apiVersion": task.APIVersion, + }, + }, mutate.Addendum{ + Layer: pipelineLayer, + Annotations: map[string]string{ + "dev.tekton.image.name": pipelineName, + "dev.tekton.image.kind": strings.ToLower(pipeline.Kind), + "dev.tekton.image.apiVersion": pipeline.APIVersion, + }, + }) + if err != nil { + t.Fatalf("Failed to create an oci image from the task and pipeline layers: %s", err) + } + + // Publish this image to the in-cluster registry. + publishImg(ctx, t, c, namespace, img, ref) + + // Now generate a PipelineRun to invoke this pipeline and task. + pr := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(` +metadata: + name: %s +spec: + pipelineRef: + name: %s + bundle: %s +`, pipelineRunName, pipelineName, repo)) + if _, err := c.V1beta1PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil { + t.Fatalf("Failed to create PipelineRun: %s", err) + } + + t.Logf("Waiting for PipelineRun in namespace %s to finish", namespace) + if err := WaitForPipelineRunState(ctx, c, pipelineRunName, timeout, + Chain( + FailedWithReason(pipelinerun.ReasonCouldntGetPipeline, pipelineRunName), + FailedWithMessage("does not contain a dev.tekton.image.name annotation", pipelineRunName), + ), "PipelineRunFailed", v1beta1Version); err != nil { + t.Fatalf("Error waiting for PipelineRun to finish with expected error: %s", err) + } +} + func tarImageInOCIFormat(namespace string, img v1.Image) ([]byte, error) { // Write the image in the OCI layout and then tar it up. dir, err := os.MkdirTemp(os.TempDir(), namespace) diff --git a/upstream/test/timeout_test.go b/upstream/test/timeout_test.go index 2b407b66890..4b72f38b18f 100644 --- a/upstream/test/timeout_test.go +++ b/upstream/test/timeout_test.go @@ -57,7 +57,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 10'] `, helpers.ObjectNameForTest(t), namespace)) @@ -178,15 +178,15 @@ spec: taskSpec: steps: - name: no-timeout - image: mirror.gcr.io/busybox + image: busybox script: sleep 1 timeout: 2s - name: timeout - image: mirror.gcr.io/busybox + image: busybox script: sleep 1 timeout: 1ms - name: canceled - image: mirror.gcr.io/busybox + image: busybox script: sleep 1 `, helpers.ObjectNameForTest(t), namespace)) t.Logf("Creating TaskRun %s in namespace %s", taskRun.Name, namespace) @@ -242,7 +242,7 @@ spec: - name: test steps: - name: timeout - image: mirror.gcr.io/busybox + image: busybox script: sleep 1 timeout: 1ms`) @@ -277,7 +277,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 3000'] `, helpers.ObjectNameForTest(t), namespace)) @@ -333,7 +333,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 1s'] `, helpers.ObjectNameForTest(t), namespace)) @@ -343,7 +343,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 10s'] `, helpers.ObjectNameForTest(t), namespace)) @@ -454,7 +454,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 30'] `, helpers.ObjectNameForTest(t), namespace)) @@ -469,7 +469,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/busybox + - image: busybox command: ['/bin/sh'] args: ['-c', 'sleep 1'] `, helpers.ObjectNameForTest(t), namespace)) @@ -560,102 +560,3 @@ spec: } wg.Wait() } - -// TestPipelineRunTimeoutWithCompletedTaskRuns tests the case where a PipelineRun is timeout and has completed TaskRuns. -func TestPipelineRunTimeoutWithCompletedTaskRuns(t *testing.T) { - t.Parallel() - // cancel the context after we have waited a suitable buffer beyond the given deadline. - ctx, cancel := context.WithTimeout(context.Background(), timeout+2*time.Minute) - defer cancel() - c, namespace := setup(ctx, t) - - knativetest.CleanupOnInterrupt(func() { tearDown(context.Background(), t, c, namespace) }, t.Logf) - defer tearDown(context.Background(), t, c, namespace) - - t.Logf("Creating Task in namespace %s", namespace) - task := parse.MustParseV1Task(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - params: - - name: sleep - default: "1" - steps: - - image: mirror.gcr.io/busybox - command: ['/bin/sh'] - args: ['-c', 'sleep $(params.sleep)'] -`, helpers.ObjectNameForTest(t), namespace)) - if _, err := c.V1TaskClient.Create(ctx, task, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Task `%s`: %s", task.Name, err) - } - - pipeline := parse.MustParseV1Pipeline(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - tasks: - - name: fast-task - params: - - name: sleep - value: "1" - taskRef: - name: %s - - name: slow-task - params: - - name: sleep - value: "120" - taskRef: - name: %s -`, helpers.ObjectNameForTest(t), namespace, task.Name, task.Name)) - pipelineRun := parse.MustParseV1PipelineRun(t, fmt.Sprintf(` -metadata: - name: %s - namespace: %s -spec: - pipelineRef: - name: %s - timeouts: - pipeline: 30s - tasks: 30s -`, helpers.ObjectNameForTest(t), namespace, pipeline.Name)) - if _, err := c.V1PipelineClient.Create(ctx, pipeline, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create Pipeline `%s`: %s", pipeline.Name, err) - } - if _, err := c.V1PipelineRunClient.Create(ctx, pipelineRun, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create PipelineRun `%s`: %s", pipelineRun.Name, err) - } - - t.Logf("Waiting for PipelineRun %s in namespace %s to be timed out", pipelineRun.Name, namespace) - if err := WaitForPipelineRunState(ctx, c, pipelineRun.Name, timeout, FailedWithReason(v1.PipelineRunReasonTimedOut.String(), pipelineRun.Name), "PipelineRunTimedOut", v1Version); err != nil { - t.Errorf("Error waiting for PipelineRun %s to finish: %s", pipelineRun.Name, err) - } - - taskrunList, err := c.V1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + pipelineRun.Name}) - if err != nil { - t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", pipelineRun.Name, err) - } - - t.Logf("Waiting for TaskRuns from PipelineRun %s in namespace %s to time out and be cancelled", pipelineRun.Name, namespace) - var wg sync.WaitGroup - for _, taskrunItem := range taskrunList.Items { - wg.Add(1) - go func(name string) { - defer wg.Done() - if strings.Contains(name, "fast-task") { - // fast-task should have completed, not timed out - return - } - err := WaitForTaskRunState(ctx, c, name, FailedWithReason(v1.TaskRunReasonCancelled.String(), name), v1.TaskRunReasonCancelled.String(), v1Version) - if err != nil { - t.Errorf("Error waiting for TaskRun %s to timeout: %s", name, err) - } - }(taskrunItem.Name) - } - wg.Wait() - - if _, err := c.V1PipelineRunClient.Get(ctx, pipelineRun.Name, metav1.GetOptions{}); err != nil { - t.Fatalf("Failed to get PipelineRun `%s`: %s", pipelineRun.Name, err) - } -} diff --git a/upstream/test/upgrade/simpleResources.yaml b/upstream/test/upgrade/simpleResources.yaml index 6568f0d56b6..03fa3b4b49f 100644 --- a/upstream/test/upgrade/simpleResources.yaml +++ b/upstream/test/upgrade/simpleResources.yaml @@ -10,18 +10,18 @@ spec: default: "response" steps: - name: echo-param - image: mirror.gcr.io/alpine + image: alpine script: | echo "$(params.rsp)" - name: check-workspace - image: mirror.gcr.io/alpine + image: alpine script: | if [ "$(workspaces.workspace.bound)" == "true" ]; then echo "Workspace provided" fi sidecars: - name: server - image: mirror.gcr.io/alpine + image: alpine:3.12.0 command: ['/bin/bash'] workingDir: /foo script: echo server @@ -44,7 +44,7 @@ spec: type: string default: "1" steps: - - image: mirror.gcr.io/alpine + - image: alpine name: check-workspace script: | if [ "$(workspaces.workspace.bound)" == "true" ]; then @@ -63,5 +63,5 @@ spec: default: "Succeeded" steps: - name: verify-status - image: mirror.gcr.io/ubuntu + image: ubuntu script: echo $(params.echoStatus) diff --git a/upstream/test/upgrade_test.go b/upstream/test/upgrade_test.go index 3f98955032a..7d30b233fa2 100644 --- a/upstream/test/upgrade_test.go +++ b/upstream/test/upgrade_test.go @@ -52,11 +52,11 @@ spec: default: "response" steps: - name: echo-param - image: mirror.gcr.io/alpine + image: alpine script: | echo "$(params.rsp)" - name: check-workspace - image: mirror.gcr.io/alpine + image: alpine script: | if [ "$(workspaces.taskWorkspace.bound)" == "true" ]; then echo "Workspace provided" @@ -128,12 +128,12 @@ status: status: "True" taskSpec: steps: - - image: mirror.gcr.io/alpine + - image: alpine name: echo-param script: | echo "response" - name: check-workspace - image: mirror.gcr.io/alpine + image: alpine script: | if [ "true" == "true" ]; then echo "Workspace provided" @@ -155,7 +155,6 @@ status: terminationReason: Completed terminated: reason: Completed - artifacts: {} ` expectedSimplePipelineRunYaml = ` diff --git a/upstream/test/util.go b/upstream/test/util.go index e1254e2edb1..99e005a86b4 100644 --- a/upstream/test/util.go +++ b/upstream/test/util.go @@ -92,9 +92,9 @@ func header(t *testing.T, text string) { right := " ###" txt := left + text + right bar := strings.Repeat("#", len(txt)) - t.Log(bar) - t.Log(txt) - t.Log(bar) + t.Logf(bar) + t.Logf(txt) + t.Logf(bar) } func tearDown(ctx context.Context, t *testing.T, cs *clients, namespace string) { diff --git a/upstream/test/workingdir_test.go b/upstream/test/workingdir_test.go index 613ef6566c0..5fc67c516e3 100644 --- a/upstream/test/workingdir_test.go +++ b/upstream/test/workingdir_test.go @@ -51,7 +51,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu workingDir: /workspace/HELLOMOTO args: ['-c', 'echo YES'] `, wdTaskName, namespace)) @@ -124,7 +124,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/ubuntu + - image: ubuntu workingDir: /HELLOMOTO args: ['-c', 'echo YES'] `, wdTaskName, namespace)) diff --git a/upstream/test/workspace_test.go b/upstream/test/workspace_test.go index db648500ad5..8a03ed1ce4e 100644 --- a/upstream/test/workspace_test.go +++ b/upstream/test/workspace_test.go @@ -51,7 +51,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'echo foo > /workspace/test/file' workspaces: - name: test @@ -129,7 +129,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'cat /workspace/test/file' workspaces: - name: test @@ -199,7 +199,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine script: 'cat /workspace/test/file' workspaces: - name: test @@ -268,7 +268,7 @@ metadata: namespace: %s spec: steps: - - image: mirror.gcr.io/alpine + - image: alpine name: foo command: ['echo'] args: ['$(workspaces.test.volume)'] diff --git a/upstream/tools/go.mod b/upstream/tools/go.mod index 43067be98c3..fea2b15c1c1 100644 --- a/upstream/tools/go.mod +++ b/upstream/tools/go.mod @@ -1,24 +1,21 @@ module github.com/tektoncd/pipeline/tools -go 1.22.1 +go 1.18 -toolchain go1.22.5 - -require github.com/golangci/golangci-lint v1.61.0 +require github.com/golangci/golangci-lint v1.57.2 require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - github.com/4meepo/tagalign v1.3.4 // indirect - github.com/Abirdcfly/dupword v0.1.1 // indirect - github.com/Antonboom/errname v0.1.13 // indirect - github.com/Antonboom/nilnil v0.1.9 // indirect - github.com/Antonboom/testifylint v1.4.3 // indirect - github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect - github.com/Crocmagnon/fatcontext v0.5.2 // indirect + github.com/4meepo/tagalign v1.3.3 // indirect + github.com/Abirdcfly/dupword v0.0.14 // indirect + github.com/Antonboom/errname v0.1.12 // indirect + github.com/Antonboom/nilnil v0.1.7 // indirect + github.com/Antonboom/testifylint v1.2.0 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/alecthomas/go-check-sumtype v0.1.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.4 // indirect @@ -29,29 +26,29 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v4 v4.4.1 // indirect + github.com/bombsimon/wsl/v4 v4.2.1 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect github.com/butuzov/ireturn v0.3.0 // indirect - github.com/butuzov/mirror v1.2.0 // indirect + github.com/butuzov/mirror v1.1.0 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/ckaznocha/intrange v0.2.0 // indirect + github.com/ckaznocha/intrange v0.1.1 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.13.5 // indirect + github.com/daixiang0/gci v0.12.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/ettle/strcase v0.2.0 // indirect - github.com/fatih/color v1.17.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/fatih/structtag v1.2.0 // indirect - github.com/firefart/nonamedreturns v1.0.5 // indirect + github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/ghostiam/protogetter v0.3.6 // indirect - github.com/go-critic/go-critic v0.11.4 // indirect + github.com/ghostiam/protogetter v0.3.5 // indirect + github.com/go-critic/go-critic v0.11.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -59,17 +56,16 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/gofrs/flock v0.12.1 // indirect + github.com/gofrs/flock v0.8.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect - github.com/golangci/misspell v0.6.0 // indirect - github.com/golangci/modinfo v0.3.4 // indirect + github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect + github.com/golangci/misspell v0.4.1 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect - github.com/golangci/revgrep v0.5.3 // indirect + github.com/golangci/revgrep v0.5.2 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect @@ -77,25 +73,24 @@ require ( github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect - github.com/jjti/go-spancheck v0.6.2 // indirect + github.com/jjti/go-spancheck v0.5.3 // indirect github.com/julz/importas v0.1.0 // indirect - github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect + github.com/karamaru-alpha/copyloopvar v1.0.10 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.10 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect - github.com/lasiar/canonicalheader v1.1.1 // indirect github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect - github.com/leonklingele/grouper v1.1.2 // indirect + github.com/leonklingele/grouper v1.1.1 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -106,44 +101,44 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mgechev/revive v1.3.9 // indirect + github.com/mgechev/revive v1.3.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moricho/tparallel v0.3.2 // indirect + github.com/moricho/tparallel v0.3.1 // indirect github.com/nakabonne/nestif v0.3.1 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.16.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.6.0 // indirect + github.com/polyfloyd/go-errorlint v1.4.8 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect - github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect + github.com/quasilyte/go-ruleguard v0.4.2 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/ryancurrah/gomodguard v1.3.5 // indirect + github.com/ryancurrah/gomodguard v1.3.1 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect - github.com/securego/gosec/v2 v2.21.2 // indirect + github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect + github.com/securego/gosec/v2 v2.19.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect - github.com/sivchari/tenv v1.10.0 // indirect + github.com/sivchari/tenv v1.7.1 // indirect github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.12.0 // indirect @@ -152,38 +147,40 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/stretchr/testify v1.9.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect + github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.17 // indirect + github.com/tetafro/godot v1.4.16 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect - github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect + github.com/tomarrell/wrapcheck/v2 v2.8.3 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.1.0 // indirect - github.com/ultraware/whitespace v0.1.1 // indirect - github.com/uudashr/gocognit v1.1.3 // indirect + github.com/ultraware/whitespace v0.1.0 // indirect + github.com/uudashr/gocognit v1.1.2 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.3.0 // indirect + github.com/yeya24/promlinter v0.2.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect - gitlab.com/bosi/decorder v0.4.2 // indirect - go-simpler.org/musttag v0.12.2 // indirect - go-simpler.org/sloglint v0.7.2 // indirect + gitlab.com/bosi/decorder v0.4.1 // indirect + go-simpler.org/musttag v0.9.0 // indirect + go-simpler.org/sloglint v0.5.0 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect - golang.org/x/tools v0.24.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.19.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.5.1 // indirect - mvdan.cc/gofumpt v0.7.0 // indirect - mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect + honnef.co/go/tools v0.4.7 // indirect + mvdan.cc/gofumpt v0.6.0 // indirect + mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 // indirect ) diff --git a/upstream/tools/go.sum b/upstream/tools/go.sum index de6bd9d31a7..e03f5115d77 100644 --- a/upstream/tools/go.sum +++ b/upstream/tools/go.sum @@ -35,36 +35,32 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= -github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= -github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY= -github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM= -github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= -github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= -github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= -github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= -github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= -github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= +github.com/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= +github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= +github.com/Abirdcfly/dupword v0.0.14 h1:3U4ulkc8EUo+CaT105/GJ1BQwtgyj6+VaBVbAX11Ba8= +github.com/Abirdcfly/dupword v0.0.14/go.mod h1:VKDAbxdY8YbKUByLGg8EETzYSuC4crm9WwI6Y3S0cLI= +github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= +github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= +github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= +github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= +github.com/Antonboom/testifylint v1.2.0 h1:015bxD8zc5iY8QwTp4+RG9I4kIbqwvGX9TrBbb7jGdM= +github.com/Antonboom/testifylint v1.2.0/go.mod h1:rkmEqjqVnHDRNsinyN6fPSLnoajzFwsCcguJgwADBkw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= -github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= -github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -81,7 +77,6 @@ github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1 github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -90,16 +85,16 @@ github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJ github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= -github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= +github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= +github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= -github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= -github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= +github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= +github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -115,15 +110,15 @@ github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+U github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/ckaznocha/intrange v0.2.0 h1:FykcZuJ8BD7oX93YbO1UY9oZtkRbp+1/kJcDjkefYLs= -github.com/ckaznocha/intrange v0.2.0/go.mod h1:r5I7nUlAAG56xmkOpw4XVr16BXhwYTUdcuRFeevn1oE= +github.com/ckaznocha/intrange v0.1.1 h1:gHe4LfqCspWkh8KpJFs20fJz3XRHFBFUV9yI7Itu83Q= +github.com/ckaznocha/intrange v0.1.1/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= -github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/daixiang0/gci v0.12.3 h1:yOZI7VAxAGPQmkb1eqt5g/11SUlwoat1fSblGLmdiQc= +github.com/daixiang0/gci v0.12.3/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= 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= @@ -135,22 +130,21 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= -github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= +github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= -github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= -github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= -github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= +github.com/ghostiam/protogetter v0.3.5 h1:+f7UiF8XNd4w3a//4DnusQ2SZjPkUjxkMEfjbxOK4Ug= +github.com/ghostiam/protogetter v0.3.5/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= +github.com/go-critic/go-critic v0.11.2 h1:81xH/2muBphEgPtcwH1p6QD+KzXl2tMSi3hXjBSxDnM= +github.com/go-critic/go-critic v0.11.2/go.mod h1:OePaicfjsf+KPy33yq4gzv6CO7TEQ9Rom6ns1KsJnl8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -160,13 +154,9 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -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-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= -github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= @@ -180,20 +170,19 @@ github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlN github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= -github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -226,18 +215,16 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= -github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= -github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8= -github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8= -github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= -github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= -github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= -github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= +github.com/golangci/golangci-lint v1.57.2 h1:NNhxfZyL5He1WWDrIvl1a4n5bvWZBcgAqBwlJAAgLTw= +github.com/golangci/golangci-lint v1.57.2/go.mod h1:ApiG3S3Ca23QyfGp5BmsorTiVxJpr5jGiNS0BkdSidg= +github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= +github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= -github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= -github.com/golangci/revgrep v0.5.3/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= +github.com/golangci/revgrep v0.5.2 h1:EndcWoRhcnfj2NHQ+28hyuXpLMF+dQmCN+YaeeIl4FU= +github.com/golangci/revgrep v0.5.2/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -266,8 +253,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -284,10 +270,9 @@ github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -303,8 +288,8 @@ github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjz github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= -github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= +github.com/jjti/go-spancheck v0.5.3 h1:vfq4s2IB8T3HvbpiwDTYgVPj1Ze/ZSXrTtaZRTc7CuM= +github.com/jjti/go-spancheck v0.5.3/go.mod h1:eQdOX1k3T+nAKvZDyLC3Eby0La4dZ+I19iOl5NzSPFE= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -316,8 +301,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= -github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= +github.com/karamaru-alpha/copyloopvar v1.0.10 h1:8HYDy6KQYqTmD7JuhZMWS1nwPru9889XI24ROd/+WXI= +github.com/karamaru-alpha/copyloopvar v1.0.10/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -328,25 +313,21 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= -github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= -github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= -github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= +github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= +github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= @@ -370,8 +351,8 @@ github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/Qd github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= -github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= +github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= +github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -381,12 +362,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= -github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= +github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= +github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= @@ -395,31 +378,27 @@ github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbn github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= -github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= -github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= -github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= -github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= -github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= +github.com/polyfloyd/go-errorlint v1.4.8 h1:jiEjKDH33ouFktyez7sckv6pHWif9B7SuS8cutDXFHw= +github.com/polyfloyd/go-errorlint v1.4.8/go.mod h1:NNCxFcFjZcw3xNjVdCchERkEM6Oz7wta2XJVxRftwO4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -442,10 +421,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= -github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= -github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= -github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= +github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= @@ -454,10 +431,9 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4l github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 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/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= -github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= +github.com/ryancurrah/gomodguard v1.3.1 h1:fH+fUg+ngsQO0ruZXXHnA/2aNllWA1whly4a6UvyzGE= +github.com/ryancurrah/gomodguard v1.3.1/go.mod h1:DGFHzEhi6iJ0oIDfMuo3TgrS+L9gZvrEfmjjuelnRU0= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= @@ -466,10 +442,10 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6Ng github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= -github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= -github.com/securego/gosec/v2 v2.21.2 h1:deZp5zmYf3TWwU7A7cR2+SolbTpZ3HQiwFqnzQyEl3M= -github.com/securego/gosec/v2 v2.21.2/go.mod h1:au33kg78rNseF5PwPnTWhuYBFf534bvJRvOrgZ/bFzU= +github.com/sashamelentyev/usestdlibvars v1.25.0 h1:IK8SI2QyFzy/2OD2PYnhy84dpfNo9qADrRt6LH8vSzU= +github.com/sashamelentyev/usestdlibvars v1.25.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/securego/gosec/v2 v2.19.0 h1:gl5xMkOI0/E6Hxx0XCY2XujA3V7SNSefA8sC+3f1gnk= +github.com/securego/gosec/v2 v2.19.0/go.mod h1:hOkDcHz9J/XIgIlPDXalxjeVYsHxoWUc5zJSHxcB8YM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= @@ -481,8 +457,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= -github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= +github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= +github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= @@ -491,8 +467,8 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -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/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -521,34 +497,36 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.17 h1:pGzu+Ye7ZUEFx7LHU0dAKmCOXWsPjl7qA6iMGndsjPs= -github.com/tetafro/godot v1.4.17/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= +github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= -github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= -github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs= +github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= -github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= -github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= -github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= -github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= +github.com/ultraware/whitespace v0.1.0 h1:O1HKYoh0kIeqE8sFqZf1o0qbORXUCOQFrlaQyZsczZw= +github.com/ultraware/whitespace v0.1.0/go.mod h1:/se4r3beMFNmewJ4Xmz0nMQ941GJt+qmSHGP9emHYe0= +github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= +github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= -github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= +github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= +github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -558,14 +536,13 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= -gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= -go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= -go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= -go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= -go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= -go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= -go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= +gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= +gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= +go-simpler.org/assert v0.7.0 h1:OzWWZqfNxt8cLS+MlUp6Tgk1HjPkmgdKBq9qvy8lZsA= +go-simpler.org/musttag v0.9.0 h1:Dzt6/tyP9ONr5g9h9P3cnYWCxeBFRkd0uJL/w+1Mxos= +go-simpler.org/musttag v0.9.0/go.mod h1:gA9nThnalvNSKpEoyp3Ko4/vCX2xTpqKoUtNqXOnVR4= +go-simpler.org/sloglint v0.5.0 h1:2YCcd+YMuYpuqthCgubcF5lBSjb6berc5VMOYUHKrpY= +go-simpler.org/sloglint v0.5.0/go.mod h1:EUknX5s8iXqf18KQxKnaBHUPVriiPnOrPjjJcsaTcSQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -576,7 +553,6 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= @@ -599,8 +575,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= -golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= @@ -633,8 +609,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -673,8 +649,7 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -694,8 +669,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -741,6 +716,7 @@ golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -749,8 +725,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/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.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -767,8 +743,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +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/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -827,13 +803,14 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= 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= @@ -913,14 +890,14 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -941,12 +918,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= -honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= -mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= -mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= -mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= -mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= +honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= +honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= +mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= +mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= +mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 h1:zCr3iRRgdk5eIikZNDphGcM6KGVTx3Yu+/Uu9Es254w= +mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/upstream/vendor/cloud.google.com/go/.gitignore b/upstream/vendor/cloud.google.com/go/.gitignore deleted file mode 100644 index cc7e53b46c0..00000000000 --- a/upstream/vendor/cloud.google.com/go/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -# Editors -.idea -.vscode -*.swp -.history - -# Test files -*.test -coverage.txt - -# Other -.DS_Store diff --git a/upstream/vendor/cloud.google.com/go/.release-please-manifest-individual.json b/upstream/vendor/cloud.google.com/go/.release-please-manifest-individual.json deleted file mode 100644 index c434cab6bc0..00000000000 --- a/upstream/vendor/cloud.google.com/go/.release-please-manifest-individual.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "aiplatform": "1.67.0", - "auth": "0.4.0", - "auth/oauth2adapt": "0.2.2", - "bigquery": "1.61.0", - "bigtable": "1.23.0", - "datastore": "1.17.0", - "errorreporting": "0.3.0", - "firestore": "1.15.0", - "logging": "1.9.0", - "profiler": "0.4.0", - "pubsub": "1.38.0", - "pubsublite": "1.8.1", - "spanner": "1.61.0", - "storage": "1.40.0", - "vertexai": "0.8.0" -} diff --git a/upstream/vendor/cloud.google.com/go/.release-please-manifest-submodules.json b/upstream/vendor/cloud.google.com/go/.release-please-manifest-submodules.json deleted file mode 100644 index 81dcc66deb1..00000000000 --- a/upstream/vendor/cloud.google.com/go/.release-please-manifest-submodules.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "accessapproval": "1.7.7", - "accesscontextmanager": "1.8.7", - "advisorynotifications": "1.4.1", - "alloydb": "1.10.2", - "analytics": "0.23.2", - "apigateway": "1.6.7", - "apigeeconnect": "1.6.7", - "apigeeregistry": "0.8.5", - "apikeys": "1.1.7", - "appengine": "1.8.7", - "apphub": "0.1.1", - "apps": "0.4.2", - "area120": "0.8.7", - "artifactregistry": "1.14.9", - "asset": "1.19.1", - "assuredworkloads": "1.11.7", - "automl": "1.13.7", - "backupdr": "0.1.1", - "baremetalsolution": "1.2.6", - "batch": "1.8.5", - "beyondcorp": "1.0.6", - "billing": "1.18.5", - "binaryauthorization": "1.8.3", - "certificatemanager": "1.8.1", - "channel": "1.17.7", - "chat": "0.1.0", - "cloudbuild": "1.16.1", - "cloudcontrolspartner": "0.2.1", - "clouddms": "1.7.6", - "cloudprofiler": "0.3.2", - "cloudquotas": "0.2.1", - "cloudtasks": "1.12.8", - "commerce": "0.1.6", - "compute": "1.26.0", - "compute/metadata": "0.3.0", - "confidentialcomputing": "1.5.1", - "config": "0.4.0", - "contactcenterinsights": "1.13.2", - "container": "1.35.1", - "containeranalysis": "0.11.6", - "datacatalog": "1.20.1", - "dataflow": "0.9.7", - "dataform": "0.9.4", - "datafusion": "1.7.7", - "datalabeling": "0.8.7", - "dataplex": "1.16.0", - "dataproc": "2.4.2", - "dataqna": "0.8.7", - "datastream": "1.10.6", - "deploy": "1.18.1", - "dialogflow": "1.53.0", - "discoveryengine": "1.7.1", - "dlp": "1.13.0", - "documentai": "1.28.0", - "domains": "0.9.7", - "edgecontainer": "1.2.1", - "edgenetwork": "0.2.4", - "essentialcontacts": "1.6.8", - "eventarc": "1.13.6", - "filestore": "1.8.3", - "functions": "1.16.2", - "gkebackup": "1.4.1", - "gkeconnect": "0.8.7", - "gkehub": "0.14.7", - "gkemulticloud": "1.1.3", - "grafeas": "0.3.6", - "gsuiteaddons": "1.6.7", - "iam": "1.1.8", - "iap": "1.9.6", - "identitytoolkit": "0.0.0", - "ids": "1.4.7", - "iot": "1.7.7", - "kms": "1.16.0", - "language": "1.12.5", - "lifesciences": "0.9.7", - "longrunning": "0.5.7", - "managedidentities": "1.6.7", - "maps": "1.8.0", - "mediatranslation": "0.8.7", - "memcache": "1.10.7", - "metastore": "1.13.6", - "migrationcenter": "0.2.6", - "monitoring": "1.19.0", - "netapp": "0.2.8", - "networkconnectivity": "1.14.6", - "networkmanagement": "1.13.2", - "networksecurity": "0.9.7", - "notebooks": "1.11.5", - "optimization": "1.6.5", - "orchestration": "1.9.2", - "orgpolicy": "1.12.3", - "osconfig": "1.12.7", - "oslogin": "1.13.3", - "parallelstore": "0.2.0", - "phishingprotection": "0.8.7", - "policysimulator": "0.2.5", - "policytroubleshooter": "1.10.5", - "privatecatalog": "0.9.7", - "rapidmigrationassessment": "1.0.7", - "recaptchaenterprise": "2.13.0", - "recommendationengine": "0.8.7", - "recommender": "1.12.3", - "redis": "1.14.4", - "resourcemanager": "1.9.7", - "resourcesettings": "1.6.7", - "retail": "1.16.2", - "run": "1.3.7", - "scheduler": "1.10.8", - "secretmanager": "1.13.0", - "securesourcemanager": "0.1.5", - "security": "1.16.1", - "securitycenter": "1.30.0", - "securitycentermanagement": "0.1.8", - "securityposture": "0.1.3", - "servicecontrol": "1.13.2", - "servicedirectory": "1.11.6", - "servicehealth": "0.1.4", - "servicemanagement": "1.9.8", - "serviceusage": "1.8.6", - "shell": "1.7.7", - "shopping": "0.6.0", - "speech": "1.23.1", - "storageinsights": "1.0.7", - "storagetransfer": "1.10.6", - "streetview": "0.1.0", - "support": "1.0.6", - "talent": "1.6.8", - "telcoautomation": "0.2.2", - "texttospeech": "1.7.7", - "tpu": "1.6.7", - "trace": "1.10.7", - "translate": "1.10.3", - "video": "1.20.6", - "videointelligence": "1.11.7", - "vision": "2.8.2", - "visionai": "0.1.2", - "vmmigration": "1.7.7", - "vmwareengine": "1.1.3", - "vpcaccess": "1.7.7", - "webrisk": "1.9.7", - "websecurityscanner": "1.6.7", - "workflows": "1.12.6", - "workstations": "0.5.6" -} diff --git a/upstream/vendor/cloud.google.com/go/.release-please-manifest.json b/upstream/vendor/cloud.google.com/go/.release-please-manifest.json deleted file mode 100644 index f85d240a3dc..00000000000 --- a/upstream/vendor/cloud.google.com/go/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.113.0" -} diff --git a/upstream/vendor/cloud.google.com/go/CHANGES.md b/upstream/vendor/cloud.google.com/go/CHANGES.md deleted file mode 100644 index bba862161d5..00000000000 --- a/upstream/vendor/cloud.google.com/go/CHANGES.md +++ /dev/null @@ -1,2620 +0,0 @@ -# Changes - -## [0.113.0](https://github.com/googleapis/google-cloud-go/compare/v0.112.2...v0.113.0) (2024-05-08) - - -### Features - -* **civil:** Add Compare method to Date, Time, and DateTime ([#10010](https://github.com/googleapis/google-cloud-go/issues/10010)) ([34455c1](https://github.com/googleapis/google-cloud-go/commit/34455c15d62b089f3281ff4c663245e72b257f37)) - - -### Bug Fixes - -* **all:** Bump x/net to v0.24.0 ([#10000](https://github.com/googleapis/google-cloud-go/issues/10000)) ([ba31ed5](https://github.com/googleapis/google-cloud-go/commit/ba31ed5fda2c9664f2e1cf972469295e63deb5b4)) -* **debugger:** Add internaloption.WithDefaultEndpointTemplate ([3b41408](https://github.com/googleapis/google-cloud-go/commit/3b414084450a5764a0248756e95e13383a645f90)) -* **internal/aliasfix:** Handle import paths correctly ([#10097](https://github.com/googleapis/google-cloud-go/issues/10097)) ([fafaf0d](https://github.com/googleapis/google-cloud-go/commit/fafaf0d0a293096559a4655ea61062cb896f1568)) -* **rpcreplay:** Properly unmarshal dynamic message ([#9774](https://github.com/googleapis/google-cloud-go/issues/9774)) ([53ccb20](https://github.com/googleapis/google-cloud-go/commit/53ccb20d925ccb00f861958d9658b55738097dc6)), refs [#9773](https://github.com/googleapis/google-cloud-go/issues/9773) - - -### Documentation - -* **testing:** Switch deprecated WithInsecure to WithTransportCredentials ([#10091](https://github.com/googleapis/google-cloud-go/issues/10091)) ([2b576ab](https://github.com/googleapis/google-cloud-go/commit/2b576abd1c3bfca2f962de0e024524f72d3652c0)) - -## [0.112.2](https://github.com/googleapis/google-cloud-go/compare/v0.112.1...v0.112.2) (2024-03-27) - - -### Bug Fixes - -* **all:** Release protobuf dep bump ([#9586](https://github.com/googleapis/google-cloud-go/issues/9586)) ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) - -## [0.112.1](https://github.com/googleapis/google-cloud-go/compare/v0.112.0...v0.112.1) (2024-02-26) - - -### Bug Fixes - -* **internal/postprocessor:** Handle googleapis link in commit body ([#9251](https://github.com/googleapis/google-cloud-go/issues/9251)) ([1dd3515](https://github.com/googleapis/google-cloud-go/commit/1dd35157bff871a2b3e5b0e3cac33502737fd631)) - - -### Documentation - -* **main:** Add OpenTelemetry-Go compatibility warning to debug.md ([#9268](https://github.com/googleapis/google-cloud-go/issues/9268)) ([18f9bb9](https://github.com/googleapis/google-cloud-go/commit/18f9bb94fbc239255a873b29462fc7c2eac3c0aa)), refs [#9267](https://github.com/googleapis/google-cloud-go/issues/9267) - -## [0.112.0](https://github.com/googleapis/google-cloud-go/compare/v0.111.0...v0.112.0) (2024-01-11) - - -### Features - -* **internal/trace:** Export internal/trace package constants and vars ([#9242](https://github.com/googleapis/google-cloud-go/issues/9242)) ([941c16f](https://github.com/googleapis/google-cloud-go/commit/941c16f3a2602e9bdc737b139060a7dd8318f9dd)) - - -### Documentation - -* **main:** Add telemetry discussion to debug.md ([#9074](https://github.com/googleapis/google-cloud-go/issues/9074)) ([90ed12e](https://github.com/googleapis/google-cloud-go/commit/90ed12e1dffe722b42f58556f0e17b808da9714d)), refs [#8655](https://github.com/googleapis/google-cloud-go/issues/8655) - -## [0.111.0](https://github.com/googleapis/google-cloud-go/compare/v0.110.10...v0.111.0) (2023-11-29) - - -### Features - -* **internal/trace:** Add OpenTelemetry support ([#8655](https://github.com/googleapis/google-cloud-go/issues/8655)) ([7a46b54](https://github.com/googleapis/google-cloud-go/commit/7a46b5428f239871993d66be2c7c667121f60a6f)), refs [#2205](https://github.com/googleapis/google-cloud-go/issues/2205) - - -### Bug Fixes - -* **all:** Bump google.golang.org/api to v0.149.0 ([#8959](https://github.com/googleapis/google-cloud-go/issues/8959)) ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) - -## [0.110.10](https://github.com/googleapis/google-cloud-go/compare/v0.110.9...v0.110.10) (2023-10-31) - - -### Bug Fixes - -* **all:** Update grpc-go to v1.56.3 ([#8916](https://github.com/googleapis/google-cloud-go/issues/8916)) ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c)) -* **all:** Update grpc-go to v1.59.0 ([#8922](https://github.com/googleapis/google-cloud-go/issues/8922)) ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) -* **internal/godocfx:** Fix links to other packages in summary ([#8756](https://github.com/googleapis/google-cloud-go/issues/8756)) ([6220a9a](https://github.com/googleapis/google-cloud-go/commit/6220a9afeb89df3080e9e663e97648939fd4e15f)) - -## [0.110.9](https://github.com/googleapis/google-cloud-go/compare/v0.110.8...v0.110.9) (2023-10-19) - - -### Bug Fixes - -* **all:** Update golang.org/x/net to v0.17.0 ([#8705](https://github.com/googleapis/google-cloud-go/issues/8705)) ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/aliasgen:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/examples/fake:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/gapicgen:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/generated/snippets:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/godocfx:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **internal/postprocessor:** Add ability to override release level ([#8643](https://github.com/googleapis/google-cloud-go/issues/8643)) ([26c608a](https://github.com/googleapis/google-cloud-go/commit/26c608a8204d740767dfebf6aa473cdf1873e5f0)) -* **internal/postprocessor:** Add missing assignment ([#8646](https://github.com/googleapis/google-cloud-go/issues/8646)) ([d8c5746](https://github.com/googleapis/google-cloud-go/commit/d8c5746e6dde1bd34c01a9886804f861c88c0cb7)) -* **internal/postprocessor:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) - -## [0.110.8](https://github.com/googleapis/google-cloud-go/compare/v0.110.7...v0.110.8) (2023-09-11) - - -### Documentation - -* **postprocessor:** Nudge users towards stable clients ([#8513](https://github.com/googleapis/google-cloud-go/issues/8513)) ([05a1484](https://github.com/googleapis/google-cloud-go/commit/05a1484b0752aaa3d6a164d37686d6de070cc78d)) - -## [0.110.7](https://github.com/googleapis/google-cloud-go/compare/v0.110.6...v0.110.7) (2023-07-31) - - -### Bug Fixes - -* **main:** Add more docs to base package ([c401ab4](https://github.com/googleapis/google-cloud-go/commit/c401ab4a576c64ab2b8840a90f7ccd5d031cea57)) - -## [0.110.6](https://github.com/googleapis/google-cloud-go/compare/v0.110.5...v0.110.6) (2023-07-13) - - -### Bug Fixes - -* **httpreplay:** Ignore GCS header by default ([#8260](https://github.com/googleapis/google-cloud-go/issues/8260)) ([b961a1a](https://github.com/googleapis/google-cloud-go/commit/b961a1abe7aeafe420c88eed38035fed0bbf7bbe)), refs [#8233](https://github.com/googleapis/google-cloud-go/issues/8233) - -## [0.110.5](https://github.com/googleapis/google-cloud-go/compare/v0.110.4...v0.110.5) (2023-07-07) - - -### Bug Fixes - -* **logadmin:** Use consistent filter in paging example ([#8221](https://github.com/googleapis/google-cloud-go/issues/8221)) ([9570159](https://github.com/googleapis/google-cloud-go/commit/95701597b1d709543ea22a4b6ff9b28b14a2d4fc)) - -## [0.110.4](https://github.com/googleapis/google-cloud-go/compare/v0.110.3...v0.110.4) (2023-07-05) - - -### Bug Fixes - -* **internal/retry:** Simplify gRPC status code mapping of retry error ([#8196](https://github.com/googleapis/google-cloud-go/issues/8196)) ([e8b224a](https://github.com/googleapis/google-cloud-go/commit/e8b224a3bcb0ca9430990ef6ae8ddb7b60f5225d)) - -## [0.110.3](https://github.com/googleapis/google-cloud-go/compare/v0.110.2...v0.110.3) (2023-06-23) - - -### Bug Fixes - -* **internal/retry:** Never return nil from GRPCStatus() ([#8128](https://github.com/googleapis/google-cloud-go/issues/8128)) ([005d2df](https://github.com/googleapis/google-cloud-go/commit/005d2dfb6b68bf5a35bfb8db449d3f0084b34d6e)) - - -### Documentation - -* **v1:** Minor clarifications for TaskGroup and min_cpu_platform ([3382ef8](https://github.com/googleapis/google-cloud-go/commit/3382ef81b6bcefe1c7bfc14aa5ff9bbf25850966)) - -## [0.110.2](https://github.com/googleapis/google-cloud-go/compare/v0.110.1...v0.110.2) (2023-05-08) - - -### Bug Fixes - -* **deps:** Update grpc to v1.55.0 ([#7885](https://github.com/googleapis/google-cloud-go/issues/7885)) ([9fc48a9](https://github.com/googleapis/google-cloud-go/commit/9fc48a921428c94c725ea90415d55ff0c177dd81)) - -## [0.110.1](https://github.com/googleapis/google-cloud-go/compare/v0.110.0...v0.110.1) (2023-05-03) - - -### Bug Fixes - -* **httpreplay:** Add ignore-header flag, fix tests ([#7865](https://github.com/googleapis/google-cloud-go/issues/7865)) ([1829706](https://github.com/googleapis/google-cloud-go/commit/1829706c5ade36cc786b2e6780fda5e7302f965b)) - -## [0.110.0](https://github.com/googleapis/google-cloud-go/compare/v0.109.0...v0.110.0) (2023-02-15) - - -### Features - -* **internal/postprocessor:** Detect and initialize new modules ([#7288](https://github.com/googleapis/google-cloud-go/issues/7288)) ([59ce02c](https://github.com/googleapis/google-cloud-go/commit/59ce02c13f265741a8f1f0f7ad5109bf83e3df82)) -* **internal/postprocessor:** Only regen snippets for changed modules ([#7300](https://github.com/googleapis/google-cloud-go/issues/7300)) ([220f8a5](https://github.com/googleapis/google-cloud-go/commit/220f8a5ad2fd64b75c5a1af531b1ab4597cf17d7)) - - -### Bug Fixes - -* **internal/postprocessor:** Add scopes without OwlBot api-name feature ([#7404](https://github.com/googleapis/google-cloud-go/issues/7404)) ([f7fe4f6](https://github.com/googleapis/google-cloud-go/commit/f7fe4f68ebf2ca28efd282f3419329dd2c09d245)) -* **internal/postprocessor:** Include module and package in scope ([#7294](https://github.com/googleapis/google-cloud-go/issues/7294)) ([d2c5c84](https://github.com/googleapis/google-cloud-go/commit/d2c5c8449f6939301f0fd506282e8fc73fc84f96)) - -## [0.109.0](https://github.com/googleapis/google-cloud-go/compare/v0.108.0...v0.109.0) (2023-01-18) - - -### Features - -* **internal/postprocessor:** Make OwlBot postprocessor ([#7202](https://github.com/googleapis/google-cloud-go/issues/7202)) ([7a1022e](https://github.com/googleapis/google-cloud-go/commit/7a1022e215261d679c8496cdd35a9cad1f13e527)) - -## [0.108.0](https://github.com/googleapis/google-cloud-go/compare/v0.107.0...v0.108.0) (2023-01-05) - - -### Features - -* **all:** Enable REGAPIC and REST numeric enums ([#6999](https://github.com/googleapis/google-cloud-go/issues/6999)) ([28f3572](https://github.com/googleapis/google-cloud-go/commit/28f3572addb0f563a2a42a76977b4e083191613f)) -* **debugger:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) - - -### Bug Fixes - -* **internal/gapicgen:** Disable rest for non-rest APIs ([#7157](https://github.com/googleapis/google-cloud-go/issues/7157)) ([ab332ce](https://github.com/googleapis/google-cloud-go/commit/ab332ced06f6c07909444e4528c02a8b6a0a70a6)) - -## [0.107.0](https://github.com/googleapis/google-cloud-go/compare/v0.106.0...v0.107.0) (2022-11-15) - - -### Features - -* **routing:** Start generating apiv2 ([#7011](https://github.com/googleapis/google-cloud-go/issues/7011)) ([66e8e27](https://github.com/googleapis/google-cloud-go/commit/66e8e2717b2593f4e5640ecb97344bb1d5e5fc0b)) - -## [0.106.0](https://github.com/googleapis/google-cloud-go/compare/v0.105.0...v0.106.0) (2022-11-09) - - -### Features - -* **debugger:** rewrite signatures in terms of new location ([3c4b2b3](https://github.com/googleapis/google-cloud-go/commit/3c4b2b34565795537aac1661e6af2442437e34ad)) - -## [0.104.0](https://github.com/googleapis/google-cloud-go/compare/v0.103.0...v0.104.0) (2022-08-24) - - -### Features - -* **godocfx:** add friendlyAPIName ([#6447](https://github.com/googleapis/google-cloud-go/issues/6447)) ([c6d3ba4](https://github.com/googleapis/google-cloud-go/commit/c6d3ba401b7b3ae9b710a8850c6ec5d49c4c1490)) - -## [0.103.0](https://github.com/googleapis/google-cloud-go/compare/v0.102.1...v0.103.0) (2022-06-29) - - -### Features - -* **privateca:** temporarily remove REGAPIC support ([199b725](https://github.com/googleapis/google-cloud-go/commit/199b7250f474b1a6f53dcf0aac0c2966f4987b68)) - -## [0.102.1](https://github.com/googleapis/google-cloud-go/compare/v0.102.0...v0.102.1) (2022-06-17) - - -### Bug Fixes - -* **longrunning:** regapic remove path params duped as query params ([#6183](https://github.com/googleapis/google-cloud-go/issues/6183)) ([c963be3](https://github.com/googleapis/google-cloud-go/commit/c963be301f074779e6bb8c897d8064fa076e9e35)) - -## [0.102.0](https://github.com/googleapis/google-cloud-go/compare/v0.101.1...v0.102.0) (2022-05-24) - - -### Features - -* **civil:** add Before and After methods to civil.Time ([#5703](https://github.com/googleapis/google-cloud-go/issues/5703)) ([7acaaaf](https://github.com/googleapis/google-cloud-go/commit/7acaaafef47668c3e8382b8bc03475598c3db187)) - -### [0.101.1](https://github.com/googleapis/google-cloud-go/compare/v0.101.0...v0.101.1) (2022-05-03) - - -### Bug Fixes - -* **internal/gapicgen:** properly update modules that have no gapic changes ([#5945](https://github.com/googleapis/google-cloud-go/issues/5945)) ([de2befc](https://github.com/googleapis/google-cloud-go/commit/de2befcaa2a886499db9da6d4d04d28398c8d44b)) - -## [0.101.0](https://github.com/googleapis/google-cloud-go/compare/v0.100.2...v0.101.0) (2022-04-20) - - -### Features - -* **all:** bump grpc dep ([#5481](https://github.com/googleapis/google-cloud-go/issues/5481)) ([b12964d](https://github.com/googleapis/google-cloud-go/commit/b12964df5c63c647aaf204e73cfcdfd379d19682)) -* **internal/gapicgen:** change versionClient for gapics ([#5687](https://github.com/googleapis/google-cloud-go/issues/5687)) ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9)) - - -### Bug Fixes - -* **internal/gapicgen:** add generation of internal/version.go for new client modules ([#5726](https://github.com/googleapis/google-cloud-go/issues/5726)) ([341e0df](https://github.com/googleapis/google-cloud-go/commit/341e0df1e44480706180cc5b07c49b3cee904095)) -* **internal/gapicgen:** don't gen version files for longrunning and debugger ([#5698](https://github.com/googleapis/google-cloud-go/issues/5698)) ([3a81108](https://github.com/googleapis/google-cloud-go/commit/3a81108c74cd8864c56b8ab5939afd864db3c64b)) -* **internal/gapicgen:** don't try to make snippets for non-gapics ([#5919](https://github.com/googleapis/google-cloud-go/issues/5919)) ([c94dddc](https://github.com/googleapis/google-cloud-go/commit/c94dddc60ef83a0584ba8f7dd24589d9db971672)) -* **internal/gapicgen:** move breaking change indicator if present ([#5452](https://github.com/googleapis/google-cloud-go/issues/5452)) ([e712df5](https://github.com/googleapis/google-cloud-go/commit/e712df5ebb45598a1653081d7e11e578bad22ff8)) -* **internal/godocfx:** prevent errors for filtered mods ([#5485](https://github.com/googleapis/google-cloud-go/issues/5485)) ([6cb9b89](https://github.com/googleapis/google-cloud-go/commit/6cb9b89b2d654c695eab00d8fb375cce0cd6e059)) - -## [0.100.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.99.0...v0.100.0) (2022-01-04) - - -### Features - -* **analytics/admin:** add the `AcknowledgeUserDataCollection` operation which acknowledges the terms of user data collection for the specified property feat: add the new resource type `DataStream`, which is planned to eventually replace `WebDataStream`, `IosAppDataStream`, `AndroidAppDataStream` resources fix!: remove `GetEnhancedMeasurementSettings`, `UpdateEnhancedMeasurementSettingsRequest`, `UpdateEnhancedMeasurementSettingsRequest` operations from the API feat: add `CreateDataStream`, `DeleteDataStream`, `UpdateDataStream`, `ListDataStreams` operations to support the new `DataStream` resource feat: add `DISPLAY_VIDEO_360_ADVERTISER_LINK`, `DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL` fields to `ChangeHistoryResourceType` enum feat: add the `account` field to the `Property` type docs: update the documentation with a new list of valid values for `UserLink.direct_roles` field ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **assuredworkloads:** EU Regions and Support With Sovereign Controls ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **dialogflow/cx:** added the display name of the current page in webhook requests ([e0833b2](https://www.github.com/googleapis/google-cloud-go/commit/e0833b2853834ba79fd20ca2ae9c613d585dd2a5)) -* **dialogflow/cx:** added the display name of the current page in webhook requests ([e0833b2](https://www.github.com/googleapis/google-cloud-go/commit/e0833b2853834ba79fd20ca2ae9c613d585dd2a5)) -* **dialogflow:** added export documentation method feat: added filter in list documentations request feat: added option to import custom metadata from Google Cloud Storage in reload document request feat: added option to apply partial update to the smart messaging allowlist in reload document request feat: added filter in list knowledge bases request ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **dialogflow:** removed OPTIONAL for speech model variant docs: added more docs for speech model variant and improved docs format for participant ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **recaptchaenterprise:** add new reCAPTCHA Enterprise fraud annotations ([3dd34a2](https://www.github.com/googleapis/google-cloud-go/commit/3dd34a262edbff63b9aece8faddc2ff0d98ce42a)) - - -### Bug Fixes - -* **artifactregistry:** fix resource pattern ID segment name ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **compute:** add parameter in compute bazel rules ([#692](https://www.github.com/googleapis/google-cloud-go/issues/692)) ([5444809](https://www.github.com/googleapis/google-cloud-go/commit/5444809e0b7cf9f5416645ea2df6fec96f8b9023)) -* **profiler:** refine regular expression for parsing backoff duration in E2E tests ([#5229](https://www.github.com/googleapis/google-cloud-go/issues/5229)) ([4438aeb](https://www.github.com/googleapis/google-cloud-go/commit/4438aebca2ec01d4dbf22287aa651937a381e043)) -* **profiler:** remove certificate expiration workaround ([#5222](https://www.github.com/googleapis/google-cloud-go/issues/5222)) ([2da36c9](https://www.github.com/googleapis/google-cloud-go/commit/2da36c95f44d5f88fd93cd949ab78823cea74fe7)) - -## [0.99.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.98.0...v0.99.0) (2021-12-06) - - -### Features - -* **dialogflow/cx:** added `TelephonyTransferCall` in response message ([fe27098](https://www.github.com/googleapis/google-cloud-go/commit/fe27098e5d429911428821ded57384353e699774)) - -## [0.98.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.97.0...v0.98.0) (2021-12-03) - - -### Features - -* **aiplatform:** add enable_private_service_connect field to Endpoint feat: add id field to DeployedModel feat: add service_attachment field to PrivateEndpoints feat: add endpoint_id to CreateEndpointRequest and method signature to CreateEndpoint feat: add method signature to CreateFeatureStore, CreateEntityType, CreateFeature feat: add network and enable_private_service_connect to IndexEndpoint feat: add service_attachment to IndexPrivateEndpoints feat: add stratified_split field to training_pipeline InputDataConfig ([a2c0bef](https://www.github.com/googleapis/google-cloud-go/commit/a2c0bef551489c9f1d0d12b973d3bf095354841e)) -* **aiplatform:** add featurestore service to aiplatform v1 feat: add metadata service to aiplatform v1 ([30794e7](https://www.github.com/googleapis/google-cloud-go/commit/30794e70050b55ff87d6a80d0b4075065e9d271d)) -* **aiplatform:** Adds support for `google.protobuf.Value` pipeline parameters in the `parameter_values` field ([88a1cdb](https://www.github.com/googleapis/google-cloud-go/commit/88a1cdbef3cc337354a61bc9276725bfb9a686d8)) -* **aiplatform:** Tensorboard v1 protos release feat:Exposing a field for v1 CustomJob-Tensorboard integration. ([90e2868](https://www.github.com/googleapis/google-cloud-go/commit/90e2868a3d220aa7f897438f4917013fda7a7c59)) -* **binaryauthorization:** add new admission rule types to Policy feat: update SignatureAlgorithm enum to match algorithm names in KMS feat: add SystemPolicyV1Beta1 service ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **channel:** add resource type to ChannelPartnerLink ([c206948](https://www.github.com/googleapis/google-cloud-go/commit/c2069487f6af5bcb37d519afeb60e312e35e67d5)) -* **cloudtasks:** add C++ rules for Cloud Tasks ([90e2868](https://www.github.com/googleapis/google-cloud-go/commit/90e2868a3d220aa7f897438f4917013fda7a7c59)) -* **compute:** Move compute.v1 from googleapis-discovery to googleapis ([#675](https://www.github.com/googleapis/google-cloud-go/issues/675)) ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **compute:** Switch to string enums for compute ([#685](https://www.github.com/googleapis/google-cloud-go/issues/685)) ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **contactcenterinsights:** Add ability to update phrase matchers feat: Add issue model stats to time series feat: Add display name to issue model stats ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **contactcenterinsights:** Add WriteDisposition to BigQuery Export API ([a2c0bef](https://www.github.com/googleapis/google-cloud-go/commit/a2c0bef551489c9f1d0d12b973d3bf095354841e)) -* **contactcenterinsights:** deprecate issue_matches docs: if conversation medium is unspecified, it will default to PHONE_CALL ([1a0720f](https://www.github.com/googleapis/google-cloud-go/commit/1a0720f2f33bb14617f5c6a524946a93209e1266)) -* **contactcenterinsights:** new feature flag disable_issue_modeling docs: fixed formatting issues in the reference documentation ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **contactcenterinsights:** remove feature flag disable_issue_modeling ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **datacatalog:** Added BigQueryDateShardedSpec.latest_shard_resource field feat: Added SearchCatalogResult.display_name field feat: Added SearchCatalogResult.description field ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **dataproc:** add Dataproc Serverless for Spark Batches API ([30794e7](https://www.github.com/googleapis/google-cloud-go/commit/30794e70050b55ff87d6a80d0b4075065e9d271d)) -* **dataproc:** Add support for dataproc BatchController service ([8519b94](https://www.github.com/googleapis/google-cloud-go/commit/8519b948fee5dc82d39300c4d96e92c85fe78fe6)) -* **dialogflow/cx:** added API for changelogs docs: clarified semantic of the streaming APIs ([587bba5](https://www.github.com/googleapis/google-cloud-go/commit/587bba5ad792a92f252107aa38c6af50fb09fb58)) -* **dialogflow/cx:** added API for changelogs docs: clarified semantic of the streaming APIs ([587bba5](https://www.github.com/googleapis/google-cloud-go/commit/587bba5ad792a92f252107aa38c6af50fb09fb58)) -* **dialogflow/cx:** added support for comparing between versions docs: clarified security settings API reference ([83b941c](https://www.github.com/googleapis/google-cloud-go/commit/83b941c0983e44fdd18ceee8c6f3e91219d72ad1)) -* **dialogflow/cx:** added support for Deployments with ListDeployments and GetDeployment apis feat: added support for DeployFlow api under Environments feat: added support for TestCasesConfig under Environment docs: added long running operation explanation for several apis fix!: marked resource name of security setting as not-required ([8c5c6cf](https://www.github.com/googleapis/google-cloud-go/commit/8c5c6cf9df046b67998a8608d05595bd9e34feb0)) -* **dialogflow/cx:** allow setting custom CA for generic webhooks and release CompareVersions API docs: clarify DLP template reader usage ([90e2868](https://www.github.com/googleapis/google-cloud-go/commit/90e2868a3d220aa7f897438f4917013fda7a7c59)) -* **dialogflow:** added support to configure security settings, language code and time zone on conversation profile ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **dialogflow:** support document metadata filter in article suggestion and smart reply model in human agent assistant ([e33350c](https://www.github.com/googleapis/google-cloud-go/commit/e33350cfcabcddcda1a90069383d39c68deb977a)) -* **dlp:** added deidentify replacement dictionaries feat: added field for BigQuery inspect template inclusion lists feat: added field to support infotype versioning ([a2c0bef](https://www.github.com/googleapis/google-cloud-go/commit/a2c0bef551489c9f1d0d12b973d3bf095354841e)) -* **domains:** added library for Cloud Domains v1 API. Also added methods for the transfer-in flow docs: improved API comments ([8519b94](https://www.github.com/googleapis/google-cloud-go/commit/8519b948fee5dc82d39300c4d96e92c85fe78fe6)) -* **functions:** Secret Manager integration fields 'secret_environment_variables' and 'secret_volumes' added feat: CMEK integration fields 'kms_key_name' and 'docker_repository' added ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **kms:** add OAEP+SHA1 to the list of supported algorithms ([8c5c6cf](https://www.github.com/googleapis/google-cloud-go/commit/8c5c6cf9df046b67998a8608d05595bd9e34feb0)) -* **kms:** add RPC retry information for MacSign, MacVerify, and GenerateRandomBytes Committer: [@bdhess](https://www.github.com/bdhess) ([1a0720f](https://www.github.com/googleapis/google-cloud-go/commit/1a0720f2f33bb14617f5c6a524946a93209e1266)) -* **kms:** add support for Raw PKCS[#1](https://www.github.com/googleapis/google-cloud-go/issues/1) signing keys ([58bea89](https://www.github.com/googleapis/google-cloud-go/commit/58bea89a3d177d5c431ff19310794e3296253353)) -* **monitoring/apiv3:** add CreateServiceTimeSeries RPC ([9e41088](https://www.github.com/googleapis/google-cloud-go/commit/9e41088bb395fbae0e757738277d5c95fa2749c8)) -* **monitoring/dashboard:** Added support for auto-close configurations ([90e2868](https://www.github.com/googleapis/google-cloud-go/commit/90e2868a3d220aa7f897438f4917013fda7a7c59)) -* **monitoring/metricsscope:** promote apiv1 to GA ([#5135](https://www.github.com/googleapis/google-cloud-go/issues/5135)) ([33c0f63](https://www.github.com/googleapis/google-cloud-go/commit/33c0f63e0e0ce69d9ef6e57b04d1b8cc10ed2b78)) -* **osconfig:** OSConfig: add OS policy assignment rpcs ([83b941c](https://www.github.com/googleapis/google-cloud-go/commit/83b941c0983e44fdd18ceee8c6f3e91219d72ad1)) -* **osconfig:** Update OSConfig API ([e33350c](https://www.github.com/googleapis/google-cloud-go/commit/e33350cfcabcddcda1a90069383d39c68deb977a)) -* **osconfig:** Update osconfig v1 and v1alpha RecurringSchedule.Frequency with DAILY frequency ([59e548a](https://www.github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d)) -* **recaptchaenterprise:** add reCAPTCHA Enterprise account defender API methods ([88a1cdb](https://www.github.com/googleapis/google-cloud-go/commit/88a1cdbef3cc337354a61bc9276725bfb9a686d8)) -* **redis:** [Cloud Memorystore for Redis] Support Multiple Read Replicas when creating Instance ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **redis:** [Cloud Memorystore for Redis] Support Multiple Read Replicas when creating Instance ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **security/privateca:** add IAMPolicy & Locations mix-in support ([1a0720f](https://www.github.com/googleapis/google-cloud-go/commit/1a0720f2f33bb14617f5c6a524946a93209e1266)) -* **securitycenter:** Added a new API method UpdateExternalSystem, which enables updating a finding w/ external system metadata. External systems are a child resource under finding, and are housed on the finding itself, and can also be filtered on in Notifications, the ListFindings and GroupFindings API ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **securitycenter:** Added mute related APIs, proto messages and fields ([3e7185c](https://www.github.com/googleapis/google-cloud-go/commit/3e7185c241d97ee342f132ae04bc93bb79a8e897)) -* **securitycenter:** Added resource type and display_name field to the FindingResult, and supported them in the filter for ListFindings and GroupFindings. Also added display_name to the resource which is surfaced in NotificationMessage ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) -* **securitycenter:** Added vulnerability field to the finding feat: Added type field to the resource which is surfaced in NotificationMessage ([090cc3a](https://www.github.com/googleapis/google-cloud-go/commit/090cc3ae0f8747a14cc904fc6d429e2f5379bb03)) -* **servicecontrol:** add C++ rules for many Cloud services ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **speech:** add result_end_time to SpeechRecognitionResult ([a2c0bef](https://www.github.com/googleapis/google-cloud-go/commit/a2c0bef551489c9f1d0d12b973d3bf095354841e)) -* **speech:** added alternative_language_codes to RecognitionConfig feat: WEBM_OPUS codec feat: SpeechAdaptation configuration feat: word confidence feat: spoken punctuation and spoken emojis feat: hint boost in SpeechContext ([a2c0bef](https://www.github.com/googleapis/google-cloud-go/commit/a2c0bef551489c9f1d0d12b973d3bf095354841e)) -* **texttospeech:** update v1 proto ([90e2868](https://www.github.com/googleapis/google-cloud-go/commit/90e2868a3d220aa7f897438f4917013fda7a7c59)) -* **workflows/executions:** add a stack_trace field to the Error messages specifying where the error occured feat: add call_log_level field to Execution messages doc: clarify requirement to escape strings within JSON arguments ([1f5aa78](https://www.github.com/googleapis/google-cloud-go/commit/1f5aa78a4d6633871651c89a6d9c48e3409fecc5)) - - -### Bug Fixes - -* **accesscontextmanager:** nodejs package name access-context-manager ([30794e7](https://www.github.com/googleapis/google-cloud-go/commit/30794e70050b55ff87d6a80d0b4075065e9d271d)) -* **aiplatform:** Remove invalid resource annotations ([587bba5](https://www.github.com/googleapis/google-cloud-go/commit/587bba5ad792a92f252107aa38c6af50fb09fb58)) -* **compute/metadata:** return an error when all retries have failed ([#5063](https://www.github.com/googleapis/google-cloud-go/issues/5063)) ([c792a0d](https://www.github.com/googleapis/google-cloud-go/commit/c792a0d13db019c9964efeee5c6bc85b07ca50fa)), refs [#5062](https://www.github.com/googleapis/google-cloud-go/issues/5062) -* **compute:** make parent_id fields required compute move and insert methods ([#686](https://www.github.com/googleapis/google-cloud-go/issues/686)) ([c8271d4](https://www.github.com/googleapis/google-cloud-go/commit/c8271d4b217a6e6924d9f87eac9468c4b5767ba7)) -* **compute:** Move compute_small protos under its own directory ([#681](https://www.github.com/googleapis/google-cloud-go/issues/681)) ([3e7185c](https://www.github.com/googleapis/google-cloud-go/commit/3e7185c241d97ee342f132ae04bc93bb79a8e897)) -* **internal/gapicgen:** fix a compute filtering ([#5111](https://www.github.com/googleapis/google-cloud-go/issues/5111)) ([77aa19d](https://www.github.com/googleapis/google-cloud-go/commit/77aa19de7fc33a9e831e6b91bd324d6832b44d99)) -* **internal/godocfx:** only put TOC status on mod if all pkgs have same status ([#4974](https://www.github.com/googleapis/google-cloud-go/issues/4974)) ([309b59e](https://www.github.com/googleapis/google-cloud-go/commit/309b59e583d1bf0dd9ffe84223034eb8a2975d47)) -* **internal/godocfx:** replace * with HTML code ([#5049](https://www.github.com/googleapis/google-cloud-go/issues/5049)) ([a8f7c06](https://www.github.com/googleapis/google-cloud-go/commit/a8f7c066e8d97120ae4e12963e3c9acc8b8906c2)) -* **monitoring/apiv3:** Reintroduce deprecated field/enum for backward compatibility docs: Use absolute link targets in comments ([45fd259](https://www.github.com/googleapis/google-cloud-go/commit/45fd2594d99ef70c776df26866f0a3b537e7e69e)) -* **profiler:** workaround certificate expiration issue in integration tests ([#4955](https://www.github.com/googleapis/google-cloud-go/issues/4955)) ([de9e465](https://www.github.com/googleapis/google-cloud-go/commit/de9e465bea8cd0580c45e87d2cbc2b610615b363)) -* **security/privateca:** include mixin protos as input for mixin rpcs ([479c2f9](https://www.github.com/googleapis/google-cloud-go/commit/479c2f90d556a106b25ebcdb1539d231488182da)) -* **security/privateca:** repair service config to enable mixins ([83b941c](https://www.github.com/googleapis/google-cloud-go/commit/83b941c0983e44fdd18ceee8c6f3e91219d72ad1)) -* **video/transcoder:** update nodejs package name to video-transcoder ([30794e7](https://www.github.com/googleapis/google-cloud-go/commit/30794e70050b55ff87d6a80d0b4075065e9d271d)) - -## [0.97.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.96.0...v0.97.0) (2021-09-29) - - -### Features - -* **internal** add Retry func to testutil from samples repository [#4902](https://github.com/googleapis/google-cloud-go/pull/4902) - -## [0.96.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.95.0...v0.96.0) (2021-09-28) - - -### Features - -* **civil:** add IsEmpty function to time, date and datetime ([#4728](https://www.github.com/googleapis/google-cloud-go/issues/4728)) ([88bfa64](https://www.github.com/googleapis/google-cloud-go/commit/88bfa64d6df2f3bb7d41e0b8f56717dd3de790e2)), refs [#4727](https://www.github.com/googleapis/google-cloud-go/issues/4727) -* **internal/godocfx:** detect preview versions ([#4899](https://www.github.com/googleapis/google-cloud-go/issues/4899)) ([9b60844](https://www.github.com/googleapis/google-cloud-go/commit/9b608445ce9ebabbc87a50e85ce6ef89125031d2)) -* **internal:** provide wrapping for retried errors ([#4797](https://www.github.com/googleapis/google-cloud-go/issues/4797)) ([ce5f4db](https://www.github.com/googleapis/google-cloud-go/commit/ce5f4dbab884e847a2d9f1f8f3fcfd7df19a505a)) - - -### Bug Fixes - -* **internal/gapicgen:** restore fmting proto files ([#4789](https://www.github.com/googleapis/google-cloud-go/issues/4789)) ([5606b54](https://www.github.com/googleapis/google-cloud-go/commit/5606b54b97bb675487c6c138a4081c827218f933)) -* **internal/trace:** use xerrors.As for trace ([#4813](https://www.github.com/googleapis/google-cloud-go/issues/4813)) ([05fe61c](https://www.github.com/googleapis/google-cloud-go/commit/05fe61c5aa4860bdebbbe3e91a9afaba16aa6184)) - -## [0.95.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.94.1...v0.95.0) (2021-09-21) - -### Bug Fixes - -* **internal/gapicgen:** add a temporary import ([#4756](https://www.github.com/googleapis/google-cloud-go/issues/4756)) ([4d9c046](https://www.github.com/googleapis/google-cloud-go/commit/4d9c046b66a2dc205e2c14b676995771301440da)) -* **compute/metadata:** remove heavy gax dependency ([#4784](https://www.github.com/googleapis/google-cloud-go/issues/4784)) ([ea00264](https://www.github.com/googleapis/google-cloud-go/commit/ea00264428137471805f2ec67f04f3a5a42928fa)) - -### [0.94.1](https://www.github.com/googleapis/google-cloud-go/compare/v0.94.0...v0.94.1) (2021-09-02) - - -### Bug Fixes - -* **compute/metadata:** fix retry logic to not panic on error ([#4714](https://www.github.com/googleapis/google-cloud-go/issues/4714)) ([75c63b9](https://www.github.com/googleapis/google-cloud-go/commit/75c63b94d2cf86606fffc3611f7e6150b667eedc)), refs [#4713](https://www.github.com/googleapis/google-cloud-go/issues/4713) - -## [0.94.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.92.0...v0.94.0) (2021-08-31) - - -### Features - -* **aiplatform:** add XAI, model monitoring, and index services to aiplatform v1 ([e385b40](https://www.github.com/googleapis/google-cloud-go/commit/e385b40a1e2ecf81f5fd0910de5c37275951f86b)) -* **analytics/admin:** add `GetDataRetentionSettings`, `UpdateDataRetentionSettings` methods to the API ([8467899](https://www.github.com/googleapis/google-cloud-go/commit/8467899ab6ebf0328c543bfb5fbcddeb2f53a082)) -* **asset:** Release of relationships in v1, Add content type Relationship to support relationship export Committer: lvv@ ([d4c3340](https://www.github.com/googleapis/google-cloud-go/commit/d4c3340bfc8b6793d6d2c8a3ed8ccdb472e1efd3)) -* **assuredworkloads:** Add Canada Regions And Support compliance regime ([b9226eb](https://www.github.com/googleapis/google-cloud-go/commit/b9226eb0b34473cb6f920c2526ad0d6dacb03f3c)) -* **cloudbuild/apiv1:** Add ability to configure BuildTriggers to create Builds that require approval before executing and ApproveBuild API to approve or reject pending Builds ([d4c3340](https://www.github.com/googleapis/google-cloud-go/commit/d4c3340bfc8b6793d6d2c8a3ed8ccdb472e1efd3)) -* **cloudbuild/apiv1:** add script field to BuildStep message ([b9226eb](https://www.github.com/googleapis/google-cloud-go/commit/b9226eb0b34473cb6f920c2526ad0d6dacb03f3c)) -* **cloudbuild/apiv1:** Update cloudbuild proto with the service_account for BYOSA Triggers. ([b9226eb](https://www.github.com/googleapis/google-cloud-go/commit/b9226eb0b34473cb6f920c2526ad0d6dacb03f3c)) -* **compute/metadata:** retry error when talking to metadata service ([#4648](https://www.github.com/googleapis/google-cloud-go/issues/4648)) ([81c6039](https://www.github.com/googleapis/google-cloud-go/commit/81c6039503121f8da3de4f4cd957b8488a3ef620)), refs [#4642](https://www.github.com/googleapis/google-cloud-go/issues/4642) -* **dataproc:** remove apiv1beta2 client ([#4682](https://www.github.com/googleapis/google-cloud-go/issues/4682)) ([2248554](https://www.github.com/googleapis/google-cloud-go/commit/22485541affb1251604df292670a20e794111d3e)) -* **gaming:** support version reporting API ([cd65cec](https://www.github.com/googleapis/google-cloud-go/commit/cd65cecf15c4a01648da7f8f4f4d497772961510)) -* **gkehub:** Add request_id under `DeleteMembershipRequest` and `UpdateMembershipRequest` ([b9226eb](https://www.github.com/googleapis/google-cloud-go/commit/b9226eb0b34473cb6f920c2526ad0d6dacb03f3c)) -* **internal/carver:** support carving batches ([#4623](https://www.github.com/googleapis/google-cloud-go/issues/4623)) ([2972d19](https://www.github.com/googleapis/google-cloud-go/commit/2972d194da19bedf16d76fda471c06a965cfdcd6)) -* **kms:** add support for Key Reimport ([bf4378b](https://www.github.com/googleapis/google-cloud-go/commit/bf4378b5b859f7b835946891dbfebfee31c4b123)) -* **metastore:** Added the Backup resource and Backup resource GetIamPolicy/SetIamPolicy to V1 feat: Added the RestoreService method to V1 ([d4c3340](https://www.github.com/googleapis/google-cloud-go/commit/d4c3340bfc8b6793d6d2c8a3ed8ccdb472e1efd3)) -* **monitoring/dashboard:** Added support for logs-based alerts: https://cloud.google.com/logging/docs/alerting/log-based-alerts feat: Added support for user-defined labels on cloud monitoring's Service and ServiceLevelObjective objects fix!: mark required fields in QueryTimeSeriesRequest as required ([b9226eb](https://www.github.com/googleapis/google-cloud-go/commit/b9226eb0b34473cb6f920c2526ad0d6dacb03f3c)) -* **osconfig:** Update osconfig v1 and v1alpha with WindowsApplication ([bf4378b](https://www.github.com/googleapis/google-cloud-go/commit/bf4378b5b859f7b835946891dbfebfee31c4b123)) -* **speech:** Add transcript normalization ([b31646d](https://www.github.com/googleapis/google-cloud-go/commit/b31646d1e12037731df4b5c0ba9f60b6434d7b9b)) -* **talent:** Add new commute methods in Search APIs feat: Add new histogram type 'publish_time_in_day' feat: Support filtering by requisitionId is ListJobs API ([d4c3340](https://www.github.com/googleapis/google-cloud-go/commit/d4c3340bfc8b6793d6d2c8a3ed8ccdb472e1efd3)) -* **translate:** added v3 proto for online/batch document translation and updated v3beta1 proto for format conversion ([bf4378b](https://www.github.com/googleapis/google-cloud-go/commit/bf4378b5b859f7b835946891dbfebfee31c4b123)) - - -### Bug Fixes - -* **datastream:** Change a few resource pattern variables from camelCase to snake_case ([bf4378b](https://www.github.com/googleapis/google-cloud-go/commit/bf4378b5b859f7b835946891dbfebfee31c4b123)) - -## [0.92.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.91.0...v0.92.0) (2021-08-16) - - -### Features - -* **all:** remove testing deps ([#4580](https://www.github.com/googleapis/google-cloud-go/issues/4580)) ([15c1eb9](https://www.github.com/googleapis/google-cloud-go/commit/15c1eb9730f0b514edb911161f9c59e8d790a5ec)), refs [#4061](https://www.github.com/googleapis/google-cloud-go/issues/4061) -* **internal/detect:** add helper to detect projectID from env ([#4582](https://www.github.com/googleapis/google-cloud-go/issues/4582)) ([cc65d94](https://www.github.com/googleapis/google-cloud-go/commit/cc65d945688ac446602bce6ef86a935714dfe2f8)), refs [#1294](https://www.github.com/googleapis/google-cloud-go/issues/1294) -* **spannertest:** Add validation of duplicated column names ([#4611](https://www.github.com/googleapis/google-cloud-go/issues/4611)) ([84f86a6](https://www.github.com/googleapis/google-cloud-go/commit/84f86a605c809ab36dd3cb4b3ab1df15a5302083)) - -## [0.91.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.90.0...v0.91.0) (2021-08-11) - - -### Features - -* **.github:** support dynamic submodule detection ([#4537](https://www.github.com/googleapis/google-cloud-go/issues/4537)) ([4374b90](https://www.github.com/googleapis/google-cloud-go/commit/4374b907e9f166da6bd23a8ef94399872b00afd6)) -* **dialogflow/cx:** add advanced settings for agent level feat: add rollout config, state and failure reason for experiment feat: add insights export settings for security setting feat: add language code for streaming recognition result and flow versions for query parameters docs: deprecate legacy logging settings ([ed73554](https://www.github.com/googleapis/google-cloud-go/commit/ed735541dc57d0681d84b46853393eac5f7ccec3)) -* **dialogflow/cx:** add advanced settings for agent level feat: add rollout config, state and failure reason for experiment feat: add insights export settings for security setting feat: add language code for streaming recognition result and flow versions for query parameters docs: deprecate legacy logging settings ([ed73554](https://www.github.com/googleapis/google-cloud-go/commit/ed735541dc57d0681d84b46853393eac5f7ccec3)) -* **dialogflow/cx:** added support for DLP templates; expose `Locations` service to get/list avaliable locations of Dialogflow products ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) -* **dialogflow/cx:** added support for DLP templates; expose `Locations` service to get/list avaliable locations of Dialogflow products docs: reorder some fields ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) -* **dialogflow:** expose `Locations` service to get/list avaliable locations of Dialogflow products; fixed some API annotations ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) -* **kms:** add support for HMAC, Variable Key Destruction, and GenerateRandom ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) -* **speech:** add total_billed_time response field ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) -* **video/transcoder:** Add video cropping feature feat: Add video padding feature feat: Add ttl_after_completion_days field to Job docs: Update proto documentation docs: Indicate v1beta1 deprecation ([5996846](https://www.github.com/googleapis/google-cloud-go/commit/59968462a3870c6289166fa1161f9b6d9c10e093)) - - -### Bug Fixes - -* **functions:** Updating behavior of source_upload_url during Get/List function calls ([381a494](https://www.github.com/googleapis/google-cloud-go/commit/381a494c29da388977b0bdda2177058328cc4afe)) - -## [0.90.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.89.0...v0.90.0) (2021-08-03) - - -### ⚠ BREAKING CHANGES - -* **compute:** add pagination and an Operation wrapper (#4542) - -### Features - -* **compute:** add pagination and an Operation wrapper ([#4542](https://www.github.com/googleapis/google-cloud-go/issues/4542)) ([36f4649](https://www.github.com/googleapis/google-cloud-go/commit/36f46494111f6d16d103fb208d49616576dbf91e)) -* **internal/godocfx:** add status to packages and TOCs ([#4547](https://www.github.com/googleapis/google-cloud-go/issues/4547)) ([c6de69c](https://www.github.com/googleapis/google-cloud-go/commit/c6de69c710561bb2a40eff05417df4b9798c258a)) -* **internal/godocfx:** mark status of deprecated items ([#4525](https://www.github.com/googleapis/google-cloud-go/issues/4525)) ([d571c6f](https://www.github.com/googleapis/google-cloud-go/commit/d571c6f4337ec9c4807c230cd77f53b6e7db6437)) - - -### Bug Fixes - -* **internal/carver:** don't tag commits ([#4518](https://www.github.com/googleapis/google-cloud-go/issues/4518)) ([c355eb8](https://www.github.com/googleapis/google-cloud-go/commit/c355eb8ecb0bb1af0ccf55e6262ca8c0d5c7e352)) - -## [0.89.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.88.0...v0.89.0) (2021-07-29) - - -### Features - -* **assuredworkloads:** Add EU Regions And Support compliance regime ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **datacatalog:** Added support for BigQuery connections entries feat: Added support for BigQuery routines entries feat: Added usage_signal field feat: Added labels field feat: Added ReplaceTaxonomy in Policy Tag Manager Serialization API feat: Added support for public tag templates feat: Added support for rich text tags docs: Documentation improvements ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **datafusion:** start generating apiv1 ([e55a016](https://www.github.com/googleapis/google-cloud-go/commit/e55a01667afaf36ff70807d061ecafb61827ba97)) -* **iap:** start generating apiv1 ([e55a016](https://www.github.com/googleapis/google-cloud-go/commit/e55a01667afaf36ff70807d061ecafb61827ba97)) -* **internal/carver:** add tooling to help carve out sub-modules ([#4417](https://www.github.com/googleapis/google-cloud-go/issues/4417)) ([a7e28f2](https://www.github.com/googleapis/google-cloud-go/commit/a7e28f2557469562ae57e5174b41bdf8fce62b63)) -* **networkconnectivity:** Add files for Network Connectivity v1 API. ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **retail:** Add restricted Retail Search features for Retail API v2. ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **secretmanager:** In Secret Manager, users can now use filter to customize the output of ListSecrets/ListSecretVersions calls ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **securitycenter:** add finding_class and indicator fields in Finding ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **speech:** add total_billed_time response field. fix!: phrase_set_id is required field in CreatePhraseSetRequest. fix!: custom_class_id is required field in CreateCustomClassRequest. ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) -* **storagetransfer:** start generating apiv1 ([#4505](https://www.github.com/googleapis/google-cloud-go/issues/4505)) ([f2d531d](https://www.github.com/googleapis/google-cloud-go/commit/f2d531d2b519efa58e0f23a178bbebe675c203c3)) - - -### Bug Fixes - -* **internal/gapicgen:** exec Stdout already set ([#4509](https://www.github.com/googleapis/google-cloud-go/issues/4509)) ([41246e9](https://www.github.com/googleapis/google-cloud-go/commit/41246e900aaaea92a9f956e92956c40c86f4cb3a)) -* **internal/gapicgen:** tidy all after dep bump ([#4515](https://www.github.com/googleapis/google-cloud-go/issues/4515)) ([9401be5](https://www.github.com/googleapis/google-cloud-go/commit/9401be509c570c3c55694375065c84139e961857)), refs [#4434](https://www.github.com/googleapis/google-cloud-go/issues/4434) - -## [0.88.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.87.0...v0.88.0) (2021-07-22) - - -### ⚠ BREAKING CHANGES - -* **cloudbuild/apiv1:** Proto had a prior definitions of WorkerPool resources which were never supported. This change replaces those resources with definitions that are currently supported. - -### Features - -* **cloudbuild/apiv1:** add a WorkerPools API ([19ea3f8](https://www.github.com/googleapis/google-cloud-go/commit/19ea3f830212582bfee21d9e09f0034f9ce76547)) -* **cloudbuild/apiv1:** Implementation of Build Failure Info: - Added message FailureInfo field ([19ea3f8](https://www.github.com/googleapis/google-cloud-go/commit/19ea3f830212582bfee21d9e09f0034f9ce76547)) -* **osconfig/agentendpoint:** OSConfig AgentEndpoint: add basic os info to RegisterAgentRequest, add WindowsApplication type to Inventory ([8936bc3](https://www.github.com/googleapis/google-cloud-go/commit/8936bc3f2d0fb2f6514f6e019fa247b8f41bd43c)) -* **resourcesettings:** Publish Cloud ResourceSettings v1 API ([43ad3cb](https://www.github.com/googleapis/google-cloud-go/commit/43ad3cb7be981fff9dc5dcf4510f1cd7bea99957)) - - -### Bug Fixes - -* **internal/godocfx:** set exit code, print cmd output, no go get ... ([#4445](https://www.github.com/googleapis/google-cloud-go/issues/4445)) ([cc70f77](https://www.github.com/googleapis/google-cloud-go/commit/cc70f77ac279a62e24e1b07f6e53fd126b7286b0)) -* **internal:** detect module for properly generating docs URLs ([#4460](https://www.github.com/googleapis/google-cloud-go/issues/4460)) ([1eaba8b](https://www.github.com/googleapis/google-cloud-go/commit/1eaba8bd694f7552a8e3e09b4f164de8b6ca23f0)), refs [#4447](https://www.github.com/googleapis/google-cloud-go/issues/4447) -* **kms:** Updating WORKSPACE files to use the newest version of the Typescript generator. ([8936bc3](https://www.github.com/googleapis/google-cloud-go/commit/8936bc3f2d0fb2f6514f6e019fa247b8f41bd43c)) - -## [0.87.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.86.0...v0.87.0) (2021-07-13) - - -### Features - -* **container:** allow updating security group on existing clusters ([528ffc9](https://www.github.com/googleapis/google-cloud-go/commit/528ffc9bd63090129a8b1355cd31273f8c23e34c)) -* **monitoring/dashboard:** added validation only mode when writing dashboards feat: added alert chart widget ([652d7c2](https://www.github.com/googleapis/google-cloud-go/commit/652d7c277da2f6774729064ab65d557875c81567)) -* **networkmanagment:** start generating apiv1 ([907592c](https://www.github.com/googleapis/google-cloud-go/commit/907592c576abfc65c01bbcd30c1a6094916cdc06)) -* **secretmanager:** Tune Secret Manager auto retry parameters ([528ffc9](https://www.github.com/googleapis/google-cloud-go/commit/528ffc9bd63090129a8b1355cd31273f8c23e34c)) -* **video/transcoder:** start generating apiv1 ([907592c](https://www.github.com/googleapis/google-cloud-go/commit/907592c576abfc65c01bbcd30c1a6094916cdc06)) - - -### Bug Fixes - -* **compute:** properly generate PUT requests ([#4426](https://www.github.com/googleapis/google-cloud-go/issues/4426)) ([a7491a5](https://www.github.com/googleapis/google-cloud-go/commit/a7491a533e4ad75eb6d5f89718d4dafb0c5b4167)) -* **internal:** fix relative pathing for generator ([#4397](https://www.github.com/googleapis/google-cloud-go/issues/4397)) ([25e0eae](https://www.github.com/googleapis/google-cloud-go/commit/25e0eaecf9feb1caa97988c5398ac58f6ca17391)) - - -### Miscellaneous Chores - -* **all:** fix release version ([#4427](https://www.github.com/googleapis/google-cloud-go/issues/4427)) ([2c0d267](https://www.github.com/googleapis/google-cloud-go/commit/2c0d2673ccab7281b6432215ee8279f9efd04a15)) - -## [0.86.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.85.0...v0.86.0) (2021-07-01) - - -### Features - -* **bigquery managedwriter:** schema conversion support ([#4357](https://www.github.com/googleapis/google-cloud-go/issues/4357)) ([f2b20f4](https://www.github.com/googleapis/google-cloud-go/commit/f2b20f493e2ed5a883ce42fa65695c03c574feb5)) - -## [0.85.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.84.0...v0.85.0) (2021-06-30) - - -### Features - -* **dataflow:** start generating apiv1beta3 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) -* **datastream:** start generating apiv1alpha1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) -* **dialogflow:** added Automated agent reply type and allow cancellation flag for partial response feature. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) -* **documentai:** update document.proto, add the processor management methods. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) -* **eventarc:** start generating apiv1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) -* **gkehub:** added v1alpha messages and client for gkehub ([8fb4649](https://www.github.com/googleapis/google-cloud-go/commit/8fb464956f0ca51d30e8e14dc625ff9fa150c437)) -* **internal/godocfx:** add support for other modules ([#4290](https://www.github.com/googleapis/google-cloud-go/issues/4290)) ([d52bae6](https://www.github.com/googleapis/google-cloud-go/commit/d52bae6cd77474174192c46236d309bf967dfa00)) -* **internal/godocfx:** different metadata for different modules ([#4297](https://www.github.com/googleapis/google-cloud-go/issues/4297)) ([598f5b9](https://www.github.com/googleapis/google-cloud-go/commit/598f5b93778b2e2e75265ae54484dd54477433f5)) -* **internal:** add force option for regen ([#4310](https://www.github.com/googleapis/google-cloud-go/issues/4310)) ([de654eb](https://www.github.com/googleapis/google-cloud-go/commit/de654ebfcf23a53b4d1fee0aa48c73999a55c1a6)) -* **servicecontrol:** Added the gRPC service config for the Service Controller v1 API docs: Updated some comments. ([8fb4649](https://www.github.com/googleapis/google-cloud-go/commit/8fb464956f0ca51d30e8e14dc625ff9fa150c437)) -* **workflows/executions:** start generating apiv1 ([cfee361](https://www.github.com/googleapis/google-cloud-go/commit/cfee36161d41e3a0f769e51ab96c25d0967af273)) - - -### Bug Fixes - -* **internal:** add autogenerated header to snippets ([#4261](https://www.github.com/googleapis/google-cloud-go/issues/4261)) ([2220787](https://www.github.com/googleapis/google-cloud-go/commit/222078722c37c3fdadec7bbbe0bcf81edd105f1a)), refs [#4260](https://www.github.com/googleapis/google-cloud-go/issues/4260) -* **internal:** fix googleapis-disco regen ([#4354](https://www.github.com/googleapis/google-cloud-go/issues/4354)) ([aeea1ce](https://www.github.com/googleapis/google-cloud-go/commit/aeea1ce1e5dff3acdfe208932327b52c49851b41)) -* **kms:** replace IAMPolicy mixin in service config. ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) -* **security/privateca:** Fixed casing of the Ruby namespace ([5a9c6ce](https://www.github.com/googleapis/google-cloud-go/commit/5a9c6ce781fb6a338e29d3dee72367998d834af0)) - -## [0.84.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.83.0...v0.84.0) (2021-06-09) - - -### Features - -* **aiplatform:** start generating apiv1 ([be1d729](https://www.github.com/googleapis/google-cloud-go/commit/be1d729fdaa18eb1c782f3b09a6bb8fd6b3a144c)) -* **apigeeconnect:** start generating abiv1 ([be1d729](https://www.github.com/googleapis/google-cloud-go/commit/be1d729fdaa18eb1c782f3b09a6bb8fd6b3a144c)) -* **dialogflow/cx:** support sentiment analysis in bot testing ([7a57aac](https://www.github.com/googleapis/google-cloud-go/commit/7a57aac996f2bae20ee6ddbd02ad9e56e380099b)) -* **dialogflow/cx:** support sentiment analysis in bot testing ([6ad2306](https://www.github.com/googleapis/google-cloud-go/commit/6ad2306f64710ce16059b464342dbc6a98d2d9c2)) -* **documentai:** Move CommonOperationMetadata into a separate proto file for potential reuse. ([9e80ea0](https://www.github.com/googleapis/google-cloud-go/commit/9e80ea0d053b06876418194f65a478045dc4fe6c)) -* **documentai:** Move CommonOperationMetadata into a separate proto file for potential reuse. ([18375e5](https://www.github.com/googleapis/google-cloud-go/commit/18375e50e8f16e63506129b8927a7b62f85e407b)) -* **gkeconnect/gateway:** start generating apiv1beta1 ([#4235](https://www.github.com/googleapis/google-cloud-go/issues/4235)) ([1c3e968](https://www.github.com/googleapis/google-cloud-go/commit/1c3e9689d78670a231a3660db00fd4fd8f5c6345)) -* **lifesciences:** strat generating apiv2beta ([be1d729](https://www.github.com/googleapis/google-cloud-go/commit/be1d729fdaa18eb1c782f3b09a6bb8fd6b3a144c)) -* **tpu:** start generating apiv1 ([#4199](https://www.github.com/googleapis/google-cloud-go/issues/4199)) ([cac48ea](https://www.github.com/googleapis/google-cloud-go/commit/cac48eab960cd34cc20732f6a1aeb93c540a036b)) - - -### Bug Fixes - -* **bttest:** fix race condition in SampleRowKeys ([#4207](https://www.github.com/googleapis/google-cloud-go/issues/4207)) ([5711fb1](https://www.github.com/googleapis/google-cloud-go/commit/5711fb10d25c458807598d736a232bb2210a047a)) -* **documentai:** Fix Ruby gem title of documentai v1 (package not currently published) ([9e80ea0](https://www.github.com/googleapis/google-cloud-go/commit/9e80ea0d053b06876418194f65a478045dc4fe6c)) - -## [0.83.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.82.0...v0.83.0) (2021-06-02) - - -### Features - -* **dialogflow:** added a field in the query result to indicate whether slot filling is cancelled. ([f9cda8f](https://www.github.com/googleapis/google-cloud-go/commit/f9cda8fb6c3d76a062affebe6649f0a43aeb96f3)) -* **essentialcontacts:** start generating apiv1 ([#4118](https://www.github.com/googleapis/google-cloud-go/issues/4118)) ([fe14afc](https://www.github.com/googleapis/google-cloud-go/commit/fe14afcf74e09089b22c4f5221cbe37046570fda)) -* **gsuiteaddons:** start generating apiv1 ([#4082](https://www.github.com/googleapis/google-cloud-go/issues/4082)) ([6de5c99](https://www.github.com/googleapis/google-cloud-go/commit/6de5c99173c4eeaf777af18c47522ca15637d232)) -* **osconfig:** OSConfig: add ExecResourceOutput and per step error message. ([f9cda8f](https://www.github.com/googleapis/google-cloud-go/commit/f9cda8fb6c3d76a062affebe6649f0a43aeb96f3)) -* **osconfig:** start generating apiv1alpha ([#4119](https://www.github.com/googleapis/google-cloud-go/issues/4119)) ([8ad471f](https://www.github.com/googleapis/google-cloud-go/commit/8ad471f26087ec076460df6dcf27769ffe1b8834)) -* **privatecatalog:** start generating apiv1beta1 ([500c1a6](https://www.github.com/googleapis/google-cloud-go/commit/500c1a6101f624cb6032f0ea16147645a02e7076)) -* **serviceusage:** start generating apiv1 ([#4120](https://www.github.com/googleapis/google-cloud-go/issues/4120)) ([e4531f9](https://www.github.com/googleapis/google-cloud-go/commit/e4531f93cfeb6388280bb253ef6eb231aba37098)) -* **shell:** start generating apiv1 ([500c1a6](https://www.github.com/googleapis/google-cloud-go/commit/500c1a6101f624cb6032f0ea16147645a02e7076)) -* **vpcaccess:** start generating apiv1 ([500c1a6](https://www.github.com/googleapis/google-cloud-go/commit/500c1a6101f624cb6032f0ea16147645a02e7076)) - -## [0.82.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.81.0...v0.82.0) (2021-05-17) - - -### Features - -* **billing/budgets:** Added support for configurable budget time period. fix: Updated some documentation links. ([83b1b3b](https://www.github.com/googleapis/google-cloud-go/commit/83b1b3b648c6d9225f07f00e8c0cdabc3d1fc1ab)) -* **billing/budgets:** Added support for configurable budget time period. fix: Updated some documentation links. ([83b1b3b](https://www.github.com/googleapis/google-cloud-go/commit/83b1b3b648c6d9225f07f00e8c0cdabc3d1fc1ab)) -* **cloudbuild/apiv1:** Add fields for Pub/Sub triggers ([8b4adbf](https://www.github.com/googleapis/google-cloud-go/commit/8b4adbf9815e1ec229dfbcfb9189d3ea63112e1b)) -* **cloudbuild/apiv1:** Implementation of Source Manifests: - Added message StorageSourceManifest as an option for the Source message - Added StorageSourceManifest field to the SourceProvenance message ([7fd2ccd](https://www.github.com/googleapis/google-cloud-go/commit/7fd2ccd26adec1468e15fe84bf75210255a9dfea)) -* **clouddms:** start generating apiv1 ([#4081](https://www.github.com/googleapis/google-cloud-go/issues/4081)) ([29df85c](https://www.github.com/googleapis/google-cloud-go/commit/29df85c40ab64d59e389a980c9ce550077839763)) -* **dataproc:** update the Dataproc V1 API client library ([9a459d5](https://www.github.com/googleapis/google-cloud-go/commit/9a459d5d149b9c3b02a35d4245d164b899ff09b3)) -* **dialogflow/cx:** add support for service directory webhooks ([7fd2ccd](https://www.github.com/googleapis/google-cloud-go/commit/7fd2ccd26adec1468e15fe84bf75210255a9dfea)) -* **dialogflow/cx:** add support for service directory webhooks ([7fd2ccd](https://www.github.com/googleapis/google-cloud-go/commit/7fd2ccd26adec1468e15fe84bf75210255a9dfea)) -* **dialogflow/cx:** support setting current_page to resume sessions; expose transition_route_groups in flows and language_code in webhook ([9a459d5](https://www.github.com/googleapis/google-cloud-go/commit/9a459d5d149b9c3b02a35d4245d164b899ff09b3)) -* **dialogflow/cx:** support setting current_page to resume sessions; expose transition_route_groups in flows and language_code in webhook ([9a459d5](https://www.github.com/googleapis/google-cloud-go/commit/9a459d5d149b9c3b02a35d4245d164b899ff09b3)) -* **dialogflow:** added more Environment RPCs feat: added Versions service feat: added Fulfillment service feat: added TextToSpeechSettings. feat: added location in some resource patterns. ([4f73dc1](https://www.github.com/googleapis/google-cloud-go/commit/4f73dc19c2e05ad6133a8eac3d62ddb522314540)) -* **documentai:** add confidence field to the PageAnchor.PageRef in document.proto. ([d089dda](https://www.github.com/googleapis/google-cloud-go/commit/d089dda0089acb9aaef9b3da40b219476af9fc06)) -* **documentai:** add confidence field to the PageAnchor.PageRef in document.proto. ([07fdcd1](https://www.github.com/googleapis/google-cloud-go/commit/07fdcd12499eac26f9b5fae01d6c1282c3e02b7c)) -* **internal/gapicgen:** only update relevant gapic files ([#4066](https://www.github.com/googleapis/google-cloud-go/issues/4066)) ([5948bee](https://www.github.com/googleapis/google-cloud-go/commit/5948beedbadd491601bdee6a006cf685e94a85f4)) -* **internal/gensnippets:** add license header and region tags ([#3924](https://www.github.com/googleapis/google-cloud-go/issues/3924)) ([e9ff7a0](https://www.github.com/googleapis/google-cloud-go/commit/e9ff7a0f9bb1cc67f5d0de47934811960429e72c)) -* **internal/gensnippets:** initial commit ([#3922](https://www.github.com/googleapis/google-cloud-go/issues/3922)) ([3fabef0](https://www.github.com/googleapis/google-cloud-go/commit/3fabef032388713f732ab4dbfc51624cdca0f481)) -* **internal:** auto-generate snippets ([#3949](https://www.github.com/googleapis/google-cloud-go/issues/3949)) ([b70e0fc](https://www.github.com/googleapis/google-cloud-go/commit/b70e0fccdc86813e0d97ff63b585822d4deafb38)) -* **internal:** generate region tags for snippets ([#3962](https://www.github.com/googleapis/google-cloud-go/issues/3962)) ([ef2b90e](https://www.github.com/googleapis/google-cloud-go/commit/ef2b90ea6d47e27744c98a1a9ae0c487c5051808)) -* **metastore:** start generateing apiv1 ([#4083](https://www.github.com/googleapis/google-cloud-go/issues/4083)) ([661610a](https://www.github.com/googleapis/google-cloud-go/commit/661610afa6a9113534884cafb138109536724310)) -* **security/privateca:** start generating apiv1 ([#4023](https://www.github.com/googleapis/google-cloud-go/issues/4023)) ([08aa83a](https://www.github.com/googleapis/google-cloud-go/commit/08aa83a5371bb6485bc3b19b3ed5300f807ce69f)) -* **securitycenter:** add canonical_name and folder fields ([5c5ca08](https://www.github.com/googleapis/google-cloud-go/commit/5c5ca08c637a23cfa3e3a051fea576e1feb324fd)) -* **securitycenter:** add canonical_name and folder fields ([5c5ca08](https://www.github.com/googleapis/google-cloud-go/commit/5c5ca08c637a23cfa3e3a051fea576e1feb324fd)) -* **speech:** add webm opus support. ([d089dda](https://www.github.com/googleapis/google-cloud-go/commit/d089dda0089acb9aaef9b3da40b219476af9fc06)) -* **speech:** Support for spoken punctuation and spoken emojis. ([9a459d5](https://www.github.com/googleapis/google-cloud-go/commit/9a459d5d149b9c3b02a35d4245d164b899ff09b3)) - - -### Bug Fixes - -* **binaryauthorization:** add Java options to Binaryauthorization protos ([9a459d5](https://www.github.com/googleapis/google-cloud-go/commit/9a459d5d149b9c3b02a35d4245d164b899ff09b3)) -* **internal/gapicgen:** filter out internal directory changes ([#4085](https://www.github.com/googleapis/google-cloud-go/issues/4085)) ([01473f6](https://www.github.com/googleapis/google-cloud-go/commit/01473f6d8db26c6e18969ace7f9e87c66e94ad9e)) -* **internal/gapicgen:** use correct region tags for gensnippets ([#4022](https://www.github.com/googleapis/google-cloud-go/issues/4022)) ([8ccd689](https://www.github.com/googleapis/google-cloud-go/commit/8ccd689cab08f016008ca06a939a4828817d4a25)) -* **internal/gensnippets:** run goimports ([#3931](https://www.github.com/googleapis/google-cloud-go/issues/3931)) ([10050f0](https://www.github.com/googleapis/google-cloud-go/commit/10050f05c20c226547d87c08168fa4bc551395c5)) -* **internal:** append a new line to comply with go fmt ([#4028](https://www.github.com/googleapis/google-cloud-go/issues/4028)) ([a297278](https://www.github.com/googleapis/google-cloud-go/commit/a2972783c4af806199d1c67c9f63ad9677f20f34)) -* **internal:** make sure formatting is run on snippets ([#4039](https://www.github.com/googleapis/google-cloud-go/issues/4039)) ([130dfc5](https://www.github.com/googleapis/google-cloud-go/commit/130dfc535396e98fc009585b0457e3bc48ead941)), refs [#4037](https://www.github.com/googleapis/google-cloud-go/issues/4037) -* **metastore:** increase metastore lro polling timeouts ([83b1b3b](https://www.github.com/googleapis/google-cloud-go/commit/83b1b3b648c6d9225f07f00e8c0cdabc3d1fc1ab)) - - -### Miscellaneous Chores - -* **all:** fix release version ([#4040](https://www.github.com/googleapis/google-cloud-go/issues/4040)) ([4c991a9](https://www.github.com/googleapis/google-cloud-go/commit/4c991a928665d9be93691decce0c653f430688b7)) - -## [0.81.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.80.0...v0.81.0) (2021-04-02) - - -### Features - -* **datacatalog:** Policy Tag Manager v1 API service feat: new RenameTagTemplateFieldEnumValue API feat: adding fully_qualified_name in lookup and search feat: added DATAPROC_METASTORE integrated system along with new entry types: DATABASE and SERVICE docs: Documentation improvements ([2b02a03](https://www.github.com/googleapis/google-cloud-go/commit/2b02a03ff9f78884da5a8e7b64a336014c61bde7)) -* **dialogflow/cx:** include original user query in WebhookRequest; add GetTextCaseresult API. doc: clarify resource format for session response. ([a0b1f6f](https://www.github.com/googleapis/google-cloud-go/commit/a0b1f6faae77d014fdee166ab018ddcd6f846ab4)) -* **dialogflow/cx:** include original user query in WebhookRequest; add GetTextCaseresult API. doc: clarify resource format for session response. ([b5b4da6](https://www.github.com/googleapis/google-cloud-go/commit/b5b4da6952922440d03051f629f3166f731dfaa3)) -* **dialogflow:** expose MP3_64_KBPS and MULAW for output audio encodings. ([b5b4da6](https://www.github.com/googleapis/google-cloud-go/commit/b5b4da6952922440d03051f629f3166f731dfaa3)) -* **secretmanager:** Rotation for Secrets ([2b02a03](https://www.github.com/googleapis/google-cloud-go/commit/2b02a03ff9f78884da5a8e7b64a336014c61bde7)) - - -### Bug Fixes - -* **internal/godocfx:** filter out non-Cloud ([#3878](https://www.github.com/googleapis/google-cloud-go/issues/3878)) ([625aef9](https://www.github.com/googleapis/google-cloud-go/commit/625aef9b47181cf627587cc9cde9e400713c6678)) - -## [0.80.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.79.0...v0.80.0) (2021-03-23) - - -### ⚠ BREAKING CHANGES - -* **all:** This is a breaking change in dialogflow - -### Features - -* **appengine:** added vm_liveness, search_api_available, network_settings, service_account, build_env_variables, kms_key_reference to v1 API ([fd04a55](https://www.github.com/googleapis/google-cloud-go/commit/fd04a552213f99619c714b5858548f61f4948493)) -* **assuredworkloads:** Add 'resource_settings' field to provide custom properties (ids) for the provisioned projects. ([ab4824a](https://www.github.com/googleapis/google-cloud-go/commit/ab4824a7914864228e59b244d6382de862139524)) -* **assuredworkloads:** add HIPAA and HITRUST compliance regimes ([ab4824a](https://www.github.com/googleapis/google-cloud-go/commit/ab4824a7914864228e59b244d6382de862139524)) -* **dialogflow/cx:** added fallback option when restoring an agent docs: clarified experiment length ([cd70aa9](https://www.github.com/googleapis/google-cloud-go/commit/cd70aa9cc1a5dccfe4e49d2d6ca6db2119553c86)) -* **dialogflow/cx:** start generating apiv3 ([#3850](https://www.github.com/googleapis/google-cloud-go/issues/3850)) ([febbdcf](https://www.github.com/googleapis/google-cloud-go/commit/febbdcf13fcea3f5d8186c3d3dface1c0d27ef9e)), refs [#3634](https://www.github.com/googleapis/google-cloud-go/issues/3634) -* **documentai:** add EVAL_SKIPPED value to the Provenance.OperationType enum in document.proto. ([cb43066](https://www.github.com/googleapis/google-cloud-go/commit/cb4306683926843f6e977f207fa6070bb9242a61)) -* **documentai:** start generating apiv1 ([#3853](https://www.github.com/googleapis/google-cloud-go/issues/3853)) ([d68e604](https://www.github.com/googleapis/google-cloud-go/commit/d68e604c953eea90489f6134e71849b24dd0fcbf)) -* **internal/godocfx:** add prettyprint class to code blocks ([#3819](https://www.github.com/googleapis/google-cloud-go/issues/3819)) ([6e49f21](https://www.github.com/googleapis/google-cloud-go/commit/6e49f2148b116ee439c8a882dcfeefb6e7647c57)) -* **internal/godocfx:** handle Markdown content ([#3816](https://www.github.com/googleapis/google-cloud-go/issues/3816)) ([56d5d0a](https://www.github.com/googleapis/google-cloud-go/commit/56d5d0a900197fb2de46120a0eda649f2c17448f)) -* **kms:** Add maxAttempts to retry policy for KMS gRPC service config feat: Add Bazel exports_files entry for KMS gRPC service config ([fd04a55](https://www.github.com/googleapis/google-cloud-go/commit/fd04a552213f99619c714b5858548f61f4948493)) -* **resourcesettings:** start generating apiv1 ([#3854](https://www.github.com/googleapis/google-cloud-go/issues/3854)) ([3b288b4](https://www.github.com/googleapis/google-cloud-go/commit/3b288b4fa593c6cb418f696b5b26768967c20b9e)) -* **speech:** Support output transcript to GCS for LongRunningRecognize. ([fd04a55](https://www.github.com/googleapis/google-cloud-go/commit/fd04a552213f99619c714b5858548f61f4948493)) -* **speech:** Support output transcript to GCS for LongRunningRecognize. ([cd70aa9](https://www.github.com/googleapis/google-cloud-go/commit/cd70aa9cc1a5dccfe4e49d2d6ca6db2119553c86)) -* **speech:** Support output transcript to GCS for LongRunningRecognize. ([35a8706](https://www.github.com/googleapis/google-cloud-go/commit/35a870662df8bf63c4ec10a0233d1d7a708007ee)) - - -### Miscellaneous Chores - -* **all:** auto-regenerate gapics ([#3837](https://www.github.com/googleapis/google-cloud-go/issues/3837)) ([ab4824a](https://www.github.com/googleapis/google-cloud-go/commit/ab4824a7914864228e59b244d6382de862139524)) - -## [0.79.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.78.0...v0.79.0) (2021-03-10) - - -### Features - -* **apigateway:** start generating apiv1 ([#3726](https://www.github.com/googleapis/google-cloud-go/issues/3726)) ([66046da](https://www.github.com/googleapis/google-cloud-go/commit/66046da2a4be5971ce2655dc6a5e1fadb08c3d1f)) -* **channel:** addition of billing_account field on Plan. docs: clarification that valid address lines are required for all customers. ([d4246aa](https://www.github.com/googleapis/google-cloud-go/commit/d4246aad4da3c3ef12350385f229bb908e3fb215)) -* **dialogflow/cx:** allow to disable webhook invocation per request ([d4246aa](https://www.github.com/googleapis/google-cloud-go/commit/d4246aad4da3c3ef12350385f229bb908e3fb215)) -* **dialogflow/cx:** allow to disable webhook invocation per request ([44c6bf9](https://www.github.com/googleapis/google-cloud-go/commit/44c6bf986f39a3c9fddf46788ae63bfbb3739441)) -* **dialogflow:** Add CCAI API ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) -* **documentai:** remove the translation fields in document.proto. ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) -* **documentai:** Update documentai/v1beta3 protos: add support for boolean normalized value ([529925b](https://www.github.com/googleapis/google-cloud-go/commit/529925ba79f4d3191ef80a13e566d86210fe4d25)) -* **internal/godocfx:** keep some cross links on same domain ([#3767](https://www.github.com/googleapis/google-cloud-go/issues/3767)) ([77f76ed](https://www.github.com/googleapis/google-cloud-go/commit/77f76ed09cb07a090ba9054063a7c002a35bca4e)) -* **internal:** add ability to regenerate one module's docs ([#3777](https://www.github.com/googleapis/google-cloud-go/issues/3777)) ([dc15995](https://www.github.com/googleapis/google-cloud-go/commit/dc15995521bd065da4cfaae95642588919a8c548)) -* **metastore:** added support for release channels when creating service ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) -* **metastore:** Publish Dataproc Metastore v1alpha API ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) -* **metastore:** start generating apiv1alpha ([#3747](https://www.github.com/googleapis/google-cloud-go/issues/3747)) ([359312a](https://www.github.com/googleapis/google-cloud-go/commit/359312ad6d4f61fb341d41ffa35fc0634979e650)) -* **metastore:** start generating apiv1beta ([#3788](https://www.github.com/googleapis/google-cloud-go/issues/3788)) ([2977095](https://www.github.com/googleapis/google-cloud-go/commit/297709593ad32f234c0fbcfa228cffcfd3e591f4)) -* **secretmanager:** added topic field to Secret ([f1323b1](https://www.github.com/googleapis/google-cloud-go/commit/f1323b10a3c7cc1d215730cefd3062064ef54c01)) - - -### Bug Fixes - -* **analytics/admin:** add `https://www.googleapis.com/auth/analytics.edit` OAuth2 scope to the list of acceptable scopes for all read only methods of the Admin API docs: update the documentation of the `update_mask` field used by Update() methods ([f1323b1](https://www.github.com/googleapis/google-cloud-go/commit/f1323b10a3c7cc1d215730cefd3062064ef54c01)) -* **apigateway:** Provide resource definitions for service management and IAM resources ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) -* **functions:** Fix service namespace in grpc_service_config. ([7811a34](https://www.github.com/googleapis/google-cloud-go/commit/7811a34ef64d722480c640810251bb3a0d65d495)) -* **internal/godocfx:** prevent index out of bounds when pkg == mod ([#3768](https://www.github.com/googleapis/google-cloud-go/issues/3768)) ([3d80b4e](https://www.github.com/googleapis/google-cloud-go/commit/3d80b4e93b0f7e857d6e9681d8d6a429750ecf80)) -* **internal/godocfx:** use correct anchor links ([#3738](https://www.github.com/googleapis/google-cloud-go/issues/3738)) ([919039a](https://www.github.com/googleapis/google-cloud-go/commit/919039a01a006c41e720218bd55f83ce98a5edef)) -* **internal:** fix Bash syntax ([#3779](https://www.github.com/googleapis/google-cloud-go/issues/3779)) ([3dd245d](https://www.github.com/googleapis/google-cloud-go/commit/3dd245dbdbfa84f0bbe5a476412d8463fe3e700c)) -* **tables:** use area120tables_v1alpha1.yaml as api-service-config ([#3759](https://www.github.com/googleapis/google-cloud-go/issues/3759)) ([b130ec0](https://www.github.com/googleapis/google-cloud-go/commit/b130ec0aa946b1a1eaa4d5a7c33e72353ac1612e)) - -## [0.78.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.77.0...v0.78.0) (2021-02-22) - - -### Features - -* **area120/tables:** Added ListWorkspaces, GetWorkspace, BatchDeleteRows APIs. ([16597fa](https://www.github.com/googleapis/google-cloud-go/commit/16597fa1ce549053c7183e8456e23f554a5501de)) -* **area120/tables:** Added ListWorkspaces, GetWorkspace, BatchDeleteRows APIs. ([0bd21d7](https://www.github.com/googleapis/google-cloud-go/commit/0bd21d793f75924e5a2d033c58e8aaef89cf8113)) -* **dialogflow:** add additional_bindings to Dialogflow v2 ListIntents API docs: update copyrights and session docs ([0bd21d7](https://www.github.com/googleapis/google-cloud-go/commit/0bd21d793f75924e5a2d033c58e8aaef89cf8113)) -* **documentai:** Update documentai/v1beta3 protos ([613ced7](https://www.github.com/googleapis/google-cloud-go/commit/613ced702bbc82a154a4d3641b483f71c7cd1af4)) -* **gkehub:** Update Membership API v1beta1 proto ([613ced7](https://www.github.com/googleapis/google-cloud-go/commit/613ced702bbc82a154a4d3641b483f71c7cd1af4)) -* **servicecontrol:** Update the ruby_cloud_gapic_library rules for the libraries published to google-cloud-ruby to the form that works with build_gen (separate parameters for ruby_cloud_title and ruby_cloud_description). chore: Update Bazel-Ruby rules version. chore: Update build_gen version. ([0bd21d7](https://www.github.com/googleapis/google-cloud-go/commit/0bd21d793f75924e5a2d033c58e8aaef89cf8113)) -* **speech:** Support Model Adaptation. ([0bd21d7](https://www.github.com/googleapis/google-cloud-go/commit/0bd21d793f75924e5a2d033c58e8aaef89cf8113)) - - -### Bug Fixes - -* **dialogflow/cx:** RunTestCase http template. PHP REST client lib can be generated. feat: Support transition route group coverage for Test Cases. ([613ced7](https://www.github.com/googleapis/google-cloud-go/commit/613ced702bbc82a154a4d3641b483f71c7cd1af4)) -* **errorreporting:** Fixes ruby gem build ([0bd21d7](https://www.github.com/googleapis/google-cloud-go/commit/0bd21d793f75924e5a2d033c58e8aaef89cf8113)) - -## [0.77.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.76.0...v0.77.0) (2021-02-16) - - -### Features - -* **channel:** Add Pub/Sub endpoints for Cloud Channel API. ([1aea7c8](https://www.github.com/googleapis/google-cloud-go/commit/1aea7c87d39eed87620b488ba0dd60b88ff26c04)) -* **dialogflow/cx:** supports SentimentAnalysisResult in webhook request docs: minor updates in wording ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) -* **errorreporting:** Make resolution status field available for error groups. Now callers can set the status of an error group by passing this to UpdateGroup. When not specified, it's treated like OPEN. feat: Make source location available for error groups created from GAE. ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) -* **errorreporting:** Make resolution status field available for error groups. Now callers can set the status of an error group by passing this to UpdateGroup. When not specified, it's treated like OPEN. feat: Make source location available for error groups created from GAE. ([f66114b](https://www.github.com/googleapis/google-cloud-go/commit/f66114bc7233ad06e18f38dd39497a74d85fdbd8)) -* **gkehub:** start generating apiv1beta1 ([#3698](https://www.github.com/googleapis/google-cloud-go/issues/3698)) ([8aed3bd](https://www.github.com/googleapis/google-cloud-go/commit/8aed3bd1bbbe983e4891c813e4c5dc9b3aa1b9b2)) -* **internal/docfx:** full cross reference linking ([#3656](https://www.github.com/googleapis/google-cloud-go/issues/3656)) ([fcb7318](https://www.github.com/googleapis/google-cloud-go/commit/fcb7318eb338bf3828ac831ed06ca630e1876418)) -* **memcache:** added ApplySoftwareUpdate API docs: various clarifications, new documentation for ApplySoftwareUpdate chore: update proto annotations ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) -* **networkconnectivity:** Add state field in resources docs: Minor changes ([0b4370a](https://www.github.com/googleapis/google-cloud-go/commit/0b4370a0d397913d932dbbdc2046a958dc3b836a)) -* **networkconnectivity:** Add state field in resources docs: Minor changes ([b4b5898](https://www.github.com/googleapis/google-cloud-go/commit/b4b58987368f80494bbc7f651f50e9123200fb3f)) -* **recommendationengine:** start generating apiv1beta1 ([#3686](https://www.github.com/googleapis/google-cloud-go/issues/3686)) ([8f4e130](https://www.github.com/googleapis/google-cloud-go/commit/8f4e13009444d88a5a56144129f055623a2205ac)) - - -### Bug Fixes - -* **errorreporting:** Remove dependency on AppEngine's proto definitions. This also removes the source_references field. ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) -* **errorreporting:** Update bazel builds for ER client libraries. ([0b4370a](https://www.github.com/googleapis/google-cloud-go/commit/0b4370a0d397913d932dbbdc2046a958dc3b836a)) -* **internal/godocfx:** use exact list of top-level decls ([#3665](https://www.github.com/googleapis/google-cloud-go/issues/3665)) ([3cd2961](https://www.github.com/googleapis/google-cloud-go/commit/3cd2961bd7b9c29d82a21ba8850eff00c7c332fd)) -* **kms:** do not retry on 13 INTERNAL ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) -* **orgpolicy:** Fix constraint resource pattern annotation ([f66114b](https://www.github.com/googleapis/google-cloud-go/commit/f66114bc7233ad06e18f38dd39497a74d85fdbd8)) -* **orgpolicy:** Fix constraint resource pattern annotation ([0b4370a](https://www.github.com/googleapis/google-cloud-go/commit/0b4370a0d397913d932dbbdc2046a958dc3b836a)) -* **profiler:** make sure retries use the most up-to-date copy of the trailer ([#3660](https://www.github.com/googleapis/google-cloud-go/issues/3660)) ([3ba9ebc](https://www.github.com/googleapis/google-cloud-go/commit/3ba9ebcee2b8b43cdf2c8f8a3d810516a604b363)) -* **vision:** sync vision v1 protos to get extra FaceAnnotation Landmark Types ([2b4414d](https://www.github.com/googleapis/google-cloud-go/commit/2b4414d973e3445725cd38901bf75340c97fc663)) - -## [0.76.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.75.0...v0.76.0) (2021-02-02) - - -### Features - -* **accessapproval:** Migrate the Bazel rules for the libraries published to google-cloud-ruby to use the gapic-generator-ruby instead of the monolith generator. ([ac22beb](https://www.github.com/googleapis/google-cloud-go/commit/ac22beb9b90771b24c8b35db7587ad3f5c0a970e)) -* **all:** auto-regenerate gapics ([#3526](https://www.github.com/googleapis/google-cloud-go/issues/3526)) ([ab2af0b](https://www.github.com/googleapis/google-cloud-go/commit/ab2af0b32630dd97f44800f4e273184f887375db)) -* **all:** auto-regenerate gapics ([#3539](https://www.github.com/googleapis/google-cloud-go/issues/3539)) ([84d4d8a](https://www.github.com/googleapis/google-cloud-go/commit/84d4d8ae2d3fbf34a4a312a0a2e4062d18caaa3d)) -* **all:** auto-regenerate gapics ([#3546](https://www.github.com/googleapis/google-cloud-go/issues/3546)) ([959fde5](https://www.github.com/googleapis/google-cloud-go/commit/959fde5ab12f7aee206dd46022e3cad1bc3470f7)) -* **all:** auto-regenerate gapics ([#3563](https://www.github.com/googleapis/google-cloud-go/issues/3563)) ([102112a](https://www.github.com/googleapis/google-cloud-go/commit/102112a4e9285a16645aabc89789f613d4f47c9e)) -* **all:** auto-regenerate gapics ([#3576](https://www.github.com/googleapis/google-cloud-go/issues/3576)) ([ac22beb](https://www.github.com/googleapis/google-cloud-go/commit/ac22beb9b90771b24c8b35db7587ad3f5c0a970e)) -* **all:** auto-regenerate gapics ([#3580](https://www.github.com/googleapis/google-cloud-go/issues/3580)) ([9974a80](https://www.github.com/googleapis/google-cloud-go/commit/9974a8017b5de8129a586f2404a23396caea0ee1)) -* **all:** auto-regenerate gapics ([#3587](https://www.github.com/googleapis/google-cloud-go/issues/3587)) ([3859a6f](https://www.github.com/googleapis/google-cloud-go/commit/3859a6ffc447e9c0b4ef231e2788fbbcfe48a94f)) -* **all:** auto-regenerate gapics ([#3598](https://www.github.com/googleapis/google-cloud-go/issues/3598)) ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **appengine:** start generating apiv1 ([#3561](https://www.github.com/googleapis/google-cloud-go/issues/3561)) ([2b6a3b4](https://www.github.com/googleapis/google-cloud-go/commit/2b6a3b4609e389da418a83eb60a8ae3710d646d7)) -* **assuredworkloads:** updated google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService service. Clients can now create workloads with US_REGIONAL_ACCESS compliance regime ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **binaryauthorization:** start generating apiv1beta1 ([#3562](https://www.github.com/googleapis/google-cloud-go/issues/3562)) ([56e18a6](https://www.github.com/googleapis/google-cloud-go/commit/56e18a64836ab9482528b212eb139f649f7a35c3)) -* **channel:** Add Pub/Sub endpoints for Cloud Channel API. ([9070c86](https://www.github.com/googleapis/google-cloud-go/commit/9070c86e2c69f9405d42fc0e6fe7afd4a256d8b8)) -* **cloudtasks:** introducing field: ListQueuesRequest.read_mask, GetQueueRequest.read_mask, Queue.task_ttl, Queue.tombstone_ttl, Queue.stats, Task.pull_message and introducing messages: QueueStats PullMessage docs: updates to max burst size description ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **cloudtasks:** introducing fields: ListQueuesRequest.read_mask, GetQueueRequest.read_mask, Queue.task_ttl, Queue.tombstone_ttl, Queue.stats and introducing messages: QueueStats docs: updates to AppEngineHttpRequest description ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **datalabeling:** start generating apiv1beta1 ([#3582](https://www.github.com/googleapis/google-cloud-go/issues/3582)) ([d8a7fee](https://www.github.com/googleapis/google-cloud-go/commit/d8a7feef51d3344fa7e258aba1d9fbdab56dadcf)) -* **dataqna:** start generating apiv1alpha ([#3586](https://www.github.com/googleapis/google-cloud-go/issues/3586)) ([24c5b8f](https://www.github.com/googleapis/google-cloud-go/commit/24c5b8f4f45f8cd8b3001b1ca5a8d80e9f3b39d5)) -* **dialogflow/cx:** Add new Experiment service docs: minor doc update on redact field in intent.proto and page.proto ([0959f27](https://www.github.com/googleapis/google-cloud-go/commit/0959f27e85efe94d39437ceef0ff62ddceb8e7a7)) -* **dialogflow/cx:** added support for test cases and agent validation ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **dialogflow/cx:** added support for test cases and agent validation ([3859a6f](https://www.github.com/googleapis/google-cloud-go/commit/3859a6ffc447e9c0b4ef231e2788fbbcfe48a94f)) -* **dialogflow:** add C++ targets for DialogFlow ([959fde5](https://www.github.com/googleapis/google-cloud-go/commit/959fde5ab12f7aee206dd46022e3cad1bc3470f7)) -* **documentai:** start generating apiv1beta3 ([#3595](https://www.github.com/googleapis/google-cloud-go/issues/3595)) ([5ae21fa](https://www.github.com/googleapis/google-cloud-go/commit/5ae21fa1cfb8b8dacbcd0fc43eee430f7db63102)) -* **domains:** start generating apiv1beta1 ([#3632](https://www.github.com/googleapis/google-cloud-go/issues/3632)) ([b8ada6f](https://www.github.com/googleapis/google-cloud-go/commit/b8ada6f197e680d0bb26aa031e6431bc099a3149)) -* **godocfx:** include alt documentation link ([#3530](https://www.github.com/googleapis/google-cloud-go/issues/3530)) ([806cdd5](https://www.github.com/googleapis/google-cloud-go/commit/806cdd56fb6fdddd7a6c1354e55e0d1259bd6c8b)) -* **internal/gapicgen:** change commit formatting to match standard ([#3500](https://www.github.com/googleapis/google-cloud-go/issues/3500)) ([d1e3d46](https://www.github.com/googleapis/google-cloud-go/commit/d1e3d46c47c425581e2b149c07f8e27ffc373c7e)) -* **internal/godocfx:** xref function declarations ([#3615](https://www.github.com/googleapis/google-cloud-go/issues/3615)) ([2bdbb87](https://www.github.com/googleapis/google-cloud-go/commit/2bdbb87a682d799cf5e262a61a3ef1faf41151af)) -* **mediatranslation:** start generating apiv1beta1 ([#3636](https://www.github.com/googleapis/google-cloud-go/issues/3636)) ([4129469](https://www.github.com/googleapis/google-cloud-go/commit/412946966cf7f53c51deff1b1cc1a12d62ed0279)) -* **memcache:** start generating apiv1 ([#3579](https://www.github.com/googleapis/google-cloud-go/issues/3579)) ([eabf7cf](https://www.github.com/googleapis/google-cloud-go/commit/eabf7cfde7b3a3cc1b35c320ba52e07be9926359)) -* **networkconnectivity:** initial generation of apiv1alpha1 ([#3567](https://www.github.com/googleapis/google-cloud-go/issues/3567)) ([adf489a](https://www.github.com/googleapis/google-cloud-go/commit/adf489a536292e3196677621477eae0d52761e7f)) -* **orgpolicy:** start generating apiv2 ([#3652](https://www.github.com/googleapis/google-cloud-go/issues/3652)) ([c103847](https://www.github.com/googleapis/google-cloud-go/commit/c1038475779fda3589aa9659d4ad0b703036b531)) -* **osconfig/agentendpoint:** add ApplyConfigTask to AgentEndpoint API ([9070c86](https://www.github.com/googleapis/google-cloud-go/commit/9070c86e2c69f9405d42fc0e6fe7afd4a256d8b8)) -* **osconfig/agentendpoint:** add ApplyConfigTask to AgentEndpoint API ([9af529c](https://www.github.com/googleapis/google-cloud-go/commit/9af529c21e98b62c4617f7a7191c307659cf8bb8)) -* **recommender:** add bindings for folder/org type resources for protos in recommendations, insights and recommender_service to enable v1 api for folder/org ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **recommender:** auto generated cl for enabling v1beta1 folder/org APIs and integration test ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) -* **resourcemanager:** start generating apiv2 ([#3575](https://www.github.com/googleapis/google-cloud-go/issues/3575)) ([93d0ebc](https://www.github.com/googleapis/google-cloud-go/commit/93d0ebceb4270351518a13958005bb68f0cace60)) -* **secretmanager:** added expire_time and ttl fields to Secret ([9974a80](https://www.github.com/googleapis/google-cloud-go/commit/9974a8017b5de8129a586f2404a23396caea0ee1)) -* **secretmanager:** added expire_time and ttl fields to Secret ([ac22beb](https://www.github.com/googleapis/google-cloud-go/commit/ac22beb9b90771b24c8b35db7587ad3f5c0a970e)) -* **servicecontrol:** start generating apiv1 ([#3644](https://www.github.com/googleapis/google-cloud-go/issues/3644)) ([f84938b](https://www.github.com/googleapis/google-cloud-go/commit/f84938bb4042a5629fd66bda42de028fd833648a)) -* **servicemanagement:** start generating apiv1 ([#3614](https://www.github.com/googleapis/google-cloud-go/issues/3614)) ([b96134f](https://www.github.com/googleapis/google-cloud-go/commit/b96134fe91c182237359000cd544af5fec60d7db)) - - -### Bug Fixes - -* **datacatalog:** Update PHP package name casing to match the PHP namespace in the proto files ([c7ecf0f](https://www.github.com/googleapis/google-cloud-go/commit/c7ecf0f3f454606b124e52d20af2545b2c68646f)) -* **internal/godocfx:** add TOC element for module root package ([#3599](https://www.github.com/googleapis/google-cloud-go/issues/3599)) ([1d6eb23](https://www.github.com/googleapis/google-cloud-go/commit/1d6eb238206fcf8815d88981527ef176851afd7a)) -* **profiler:** Force gax to retry in case of certificate errors ([#3178](https://www.github.com/googleapis/google-cloud-go/issues/3178)) ([35dcd72](https://www.github.com/googleapis/google-cloud-go/commit/35dcd725dcd03266ed7439de40c277376b38cd71)) - -## [0.75.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.74.0...v0.75.0) (2021-01-11) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3514](https://www.github.com/googleapis/google-cloud-go/issues/3514) [#3501](https://www.github.com/googleapis/google-cloud-go/issues/3501) [#3497](https://www.github.com/googleapis/google-cloud-go/issues/3497) [#3455](https://www.github.com/googleapis/google-cloud-go/issues/3455) [#3448](https://www.github.com/googleapis/google-cloud-go/issues/3448) -* **channel:** start generating apiv1 ([#3517](https://www.github.com/googleapis/google-cloud-go/issues/3517)) ([2cf3b3c](https://www.github.com/googleapis/google-cloud-go/commit/2cf3b3cf7d99f2efd6868a710fad9e935fc87965)) - - -### Bug Fixes - -* **internal/gapicgen:** don't regen files that have been deleted ([#3471](https://www.github.com/googleapis/google-cloud-go/issues/3471)) ([112ca94](https://www.github.com/googleapis/google-cloud-go/commit/112ca9416cc8a2502b32547dc8d789655452f84a)) - -## [0.74.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.73.0...v0.74.0) (2020-12-10) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3440](https://www.github.com/googleapis/google-cloud-go/issues/3440) [#3436](https://www.github.com/googleapis/google-cloud-go/issues/3436) [#3394](https://www.github.com/googleapis/google-cloud-go/issues/3394) [#3391](https://www.github.com/googleapis/google-cloud-go/issues/3391) [#3374](https://www.github.com/googleapis/google-cloud-go/issues/3374) -* **internal/gapicgen:** support generating only gapics with genlocal ([#3383](https://www.github.com/googleapis/google-cloud-go/issues/3383)) ([eaa742a](https://www.github.com/googleapis/google-cloud-go/commit/eaa742a248dc7d93c019863248f28e37f88aae84)) -* **servicedirectory:** start generating apiv1 ([#3382](https://www.github.com/googleapis/google-cloud-go/issues/3382)) ([2774925](https://www.github.com/googleapis/google-cloud-go/commit/2774925925909071ebc585cf7400373334c156ba)) - - -### Bug Fixes - -* **internal/gapicgen:** don't create genproto pr as draft ([#3379](https://www.github.com/googleapis/google-cloud-go/issues/3379)) ([517ab0f](https://www.github.com/googleapis/google-cloud-go/commit/517ab0f25e544498c5374b256354bc41ba936ad5)) - -## [0.73.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.72.0...v0.73.0) (2020-12-04) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3335](https://www.github.com/googleapis/google-cloud-go/issues/3335) [#3294](https://www.github.com/googleapis/google-cloud-go/issues/3294) [#3250](https://www.github.com/googleapis/google-cloud-go/issues/3250) [#3229](https://www.github.com/googleapis/google-cloud-go/issues/3229) [#3211](https://www.github.com/googleapis/google-cloud-go/issues/3211) [#3217](https://www.github.com/googleapis/google-cloud-go/issues/3217) [#3212](https://www.github.com/googleapis/google-cloud-go/issues/3212) [#3209](https://www.github.com/googleapis/google-cloud-go/issues/3209) [#3206](https://www.github.com/googleapis/google-cloud-go/issues/3206) [#3199](https://www.github.com/googleapis/google-cloud-go/issues/3199) -* **artifactregistry:** start generating apiv1beta2 ([#3352](https://www.github.com/googleapis/google-cloud-go/issues/3352)) ([2e6f20b](https://www.github.com/googleapis/google-cloud-go/commit/2e6f20b0ab438b0b366a1a3802fc64d1a0e66fff)) -* **internal:** copy pubsub Message and PublishResult to internal/pubsub ([#3351](https://www.github.com/googleapis/google-cloud-go/issues/3351)) ([82521ee](https://www.github.com/googleapis/google-cloud-go/commit/82521ee5038735c1663525658d27e4df00ec90be)) -* **internal/gapicgen:** support adding context to regen ([#3174](https://www.github.com/googleapis/google-cloud-go/issues/3174)) ([941ab02](https://www.github.com/googleapis/google-cloud-go/commit/941ab029ba6f7f33e8b2e31e3818aeb68312a999)) -* **internal/kokoro:** add ability to regen all DocFX YAML ([#3191](https://www.github.com/googleapis/google-cloud-go/issues/3191)) ([e12046b](https://www.github.com/googleapis/google-cloud-go/commit/e12046bc4431d33aee72c324e6eb5cc907a4214a)) - - -### Bug Fixes - -* **internal/godocfx:** filter out test packages from other modules ([#3197](https://www.github.com/googleapis/google-cloud-go/issues/3197)) ([1d397aa](https://www.github.com/googleapis/google-cloud-go/commit/1d397aa8b41f8f980cba1d3dcc50f11e4d4f4ca0)) - -## [0.72.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.71.0...v0.72.0) (2020-11-10) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3177](https://www.github.com/googleapis/google-cloud-go/issues/3177) [#3164](https://www.github.com/googleapis/google-cloud-go/issues/3164) [#3149](https://www.github.com/googleapis/google-cloud-go/issues/3149) [#3142](https://www.github.com/googleapis/google-cloud-go/issues/3142) [#3136](https://www.github.com/googleapis/google-cloud-go/issues/3136) [#3130](https://www.github.com/googleapis/google-cloud-go/issues/3130) [#3121](https://www.github.com/googleapis/google-cloud-go/issues/3121) [#3119](https://www.github.com/googleapis/google-cloud-go/issues/3119) - - -### Bug Fixes - -* **all:** Update hand-written clients to not use WithEndpoint override ([#3111](https://www.github.com/googleapis/google-cloud-go/issues/3111)) ([f0cfd05](https://www.github.com/googleapis/google-cloud-go/commit/f0cfd0532f5204ff16f7bae406efa72603d16f44)) -* **internal/godocfx:** rename README files to pkg-readme ([#3185](https://www.github.com/googleapis/google-cloud-go/issues/3185)) ([d3a8571](https://www.github.com/googleapis/google-cloud-go/commit/d3a85719be411b692aede3331abb29b5a7b3da9a)) - - -## [0.71.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.70.0...v0.71.0) (2020-10-30) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3115](https://www.github.com/googleapis/google-cloud-go/issues/3115) [#3106](https://www.github.com/googleapis/google-cloud-go/issues/3106) [#3102](https://www.github.com/googleapis/google-cloud-go/issues/3102) [#3083](https://www.github.com/googleapis/google-cloud-go/issues/3083) [#3073](https://www.github.com/googleapis/google-cloud-go/issues/3073) [#3057](https://www.github.com/googleapis/google-cloud-go/issues/3057) [#3044](https://www.github.com/googleapis/google-cloud-go/issues/3044) -* **billing/budgets:** start generating apiv1 ([#3099](https://www.github.com/googleapis/google-cloud-go/issues/3099)) ([e760c85](https://www.github.com/googleapis/google-cloud-go/commit/e760c859de88a6e79b6dffc653dbf75f1630d8e3)) -* **internal:** auto-run godocfx on new mods ([#3069](https://www.github.com/googleapis/google-cloud-go/issues/3069)) ([49f497e](https://www.github.com/googleapis/google-cloud-go/commit/49f497eab80ce34dfb4ca41f033a5c0429ff5e42)) -* **pubsublite:** Added Pub/Sub Lite clients and routing headers ([#3105](https://www.github.com/googleapis/google-cloud-go/issues/3105)) ([98668fa](https://www.github.com/googleapis/google-cloud-go/commit/98668fa5457d26ed34debee708614f027020e5bc)) -* **pubsublite:** Message type and message routers ([#3077](https://www.github.com/googleapis/google-cloud-go/issues/3077)) ([179fc55](https://www.github.com/googleapis/google-cloud-go/commit/179fc550b545a5344358a243da7007ffaa7b5171)) -* **pubsublite:** Pub/Sub Lite admin client ([#3036](https://www.github.com/googleapis/google-cloud-go/issues/3036)) ([749473e](https://www.github.com/googleapis/google-cloud-go/commit/749473ead30bf1872634821d3238d1299b99acc6)) -* **pubsublite:** Publish settings and errors ([#3075](https://www.github.com/googleapis/google-cloud-go/issues/3075)) ([9eb9fcb](https://www.github.com/googleapis/google-cloud-go/commit/9eb9fcb79f17ad7c08c77c455ba3e8d89e3bdbf2)) -* **pubsublite:** Retryable stream wrapper ([#3068](https://www.github.com/googleapis/google-cloud-go/issues/3068)) ([97cfd45](https://www.github.com/googleapis/google-cloud-go/commit/97cfd4587f2f51996bd685ff486308b70eb51900)) - - -### Bug Fixes - -* **internal/kokoro:** remove unnecessary cd ([#3071](https://www.github.com/googleapis/google-cloud-go/issues/3071)) ([c1a4c3e](https://www.github.com/googleapis/google-cloud-go/commit/c1a4c3eaffcdc3cffe0e223fcfa1f60879cd23bb)) -* **pubsublite:** Disable integration tests for project id ([#3087](https://www.github.com/googleapis/google-cloud-go/issues/3087)) ([a0982f7](https://www.github.com/googleapis/google-cloud-go/commit/a0982f79d6461feabdf31363f29fed7dc5677fe7)) - -## [0.70.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.69.0...v0.70.0) (2020-10-19) - - -### Features - -* **all:** auto-regenerate gapics , refs [#3047](https://www.github.com/googleapis/google-cloud-go/issues/3047) [#3035](https://www.github.com/googleapis/google-cloud-go/issues/3035) [#3025](https://www.github.com/googleapis/google-cloud-go/issues/3025) -* **managedidentities:** start generating apiv1 ([#3032](https://www.github.com/googleapis/google-cloud-go/issues/3032)) ([10ccca2](https://www.github.com/googleapis/google-cloud-go/commit/10ccca238074d24fea580a4cd8e64478818b0b44)) -* **pubsublite:** Types for resource paths and topic/subscription configs ([#3026](https://www.github.com/googleapis/google-cloud-go/issues/3026)) ([6f7fa86](https://www.github.com/googleapis/google-cloud-go/commit/6f7fa86ed906258f98d996aab40184f3a46f9714)) - -## [0.69.1](https://www.github.com/googleapis/google-cloud-go/compare/v0.69.0...v0.69.1) (2020-10-14) - -This is an empty release that was created solely to aid in pubsublite's module -carve out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## [0.69.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.68.0...v0.69.0) (2020-10-14) - - -### Features - -* **accessapproval:** start generating apiv1 ([#3002](https://www.github.com/googleapis/google-cloud-go/issues/3002)) ([709d6e7](https://www.github.com/googleapis/google-cloud-go/commit/709d6e76393e6ac00ff488efd83bfe873173b045)) -* **all:** auto-regenerate gapics , refs [#3010](https://www.github.com/googleapis/google-cloud-go/issues/3010) [#3005](https://www.github.com/googleapis/google-cloud-go/issues/3005) [#2993](https://www.github.com/googleapis/google-cloud-go/issues/2993) [#2989](https://www.github.com/googleapis/google-cloud-go/issues/2989) [#2981](https://www.github.com/googleapis/google-cloud-go/issues/2981) [#2976](https://www.github.com/googleapis/google-cloud-go/issues/2976) [#2968](https://www.github.com/googleapis/google-cloud-go/issues/2968) [#2958](https://www.github.com/googleapis/google-cloud-go/issues/2958) -* **cmd/go-cloud-debug-agent:** mark as deprecated ([#2964](https://www.github.com/googleapis/google-cloud-go/issues/2964)) ([276ec88](https://www.github.com/googleapis/google-cloud-go/commit/276ec88b05852c33a3ba437e18d072f7ffd8fd33)) -* **godocfx:** add nesting to TOC ([#2972](https://www.github.com/googleapis/google-cloud-go/issues/2972)) ([3a49b2d](https://www.github.com/googleapis/google-cloud-go/commit/3a49b2d142a353f98429235c3f380431430b4dbf)) -* **internal/godocfx:** HTML-ify package summary ([#2986](https://www.github.com/googleapis/google-cloud-go/issues/2986)) ([9e64b01](https://www.github.com/googleapis/google-cloud-go/commit/9e64b018255bd8d9b31d60e8f396966251de946b)) -* **internal/kokoro:** make publish_docs VERSION optional ([#2979](https://www.github.com/googleapis/google-cloud-go/issues/2979)) ([76e35f6](https://www.github.com/googleapis/google-cloud-go/commit/76e35f689cb60bd5db8e14b8c8d367c5902bcb0e)) -* **websecurityscanner:** start generating apiv1 ([#3006](https://www.github.com/googleapis/google-cloud-go/issues/3006)) ([1d92e20](https://www.github.com/googleapis/google-cloud-go/commit/1d92e2062a13f62d7a96be53a7354c0cacca6a85)) - - -### Bug Fixes - -* **godocfx:** make extra files optional, filter out third_party ([#2985](https://www.github.com/googleapis/google-cloud-go/issues/2985)) ([f268921](https://www.github.com/googleapis/google-cloud-go/commit/f2689214a24b2e325d3e8f54441bb11fbef925f0)) - -## [0.68.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.67.0...v0.68.0) (2020-10-02) - - -### Features - -* **all:** auto-regenerate gapics , refs [#2952](https://www.github.com/googleapis/google-cloud-go/issues/2952) [#2944](https://www.github.com/googleapis/google-cloud-go/issues/2944) [#2935](https://www.github.com/googleapis/google-cloud-go/issues/2935) - -## [0.67.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.66.0...v0.67.0) (2020-09-29) - - -### Features - -* **all:** auto-regenerate gapics , refs [#2933](https://www.github.com/googleapis/google-cloud-go/issues/2933) [#2919](https://www.github.com/googleapis/google-cloud-go/issues/2919) [#2913](https://www.github.com/googleapis/google-cloud-go/issues/2913) [#2910](https://www.github.com/googleapis/google-cloud-go/issues/2910) [#2899](https://www.github.com/googleapis/google-cloud-go/issues/2899) [#2897](https://www.github.com/googleapis/google-cloud-go/issues/2897) [#2886](https://www.github.com/googleapis/google-cloud-go/issues/2886) [#2877](https://www.github.com/googleapis/google-cloud-go/issues/2877) [#2869](https://www.github.com/googleapis/google-cloud-go/issues/2869) [#2864](https://www.github.com/googleapis/google-cloud-go/issues/2864) -* **assuredworkloads:** start generating apiv1beta1 ([#2866](https://www.github.com/googleapis/google-cloud-go/issues/2866)) ([7598c4d](https://www.github.com/googleapis/google-cloud-go/commit/7598c4dd2462e8270a2c7b1f496af58ca81ff568)) -* **dialogflow/cx:** start generating apiv3beta1 ([#2875](https://www.github.com/googleapis/google-cloud-go/issues/2875)) ([37ca93a](https://www.github.com/googleapis/google-cloud-go/commit/37ca93ad69eda363d956f0174d444ed5914f5a72)) -* **docfx:** add support for examples ([#2884](https://www.github.com/googleapis/google-cloud-go/issues/2884)) ([0cc0de3](https://www.github.com/googleapis/google-cloud-go/commit/0cc0de300d58be6d3b7eeb2f1baebfa6df076830)) -* **godocfx:** include README in output ([#2927](https://www.github.com/googleapis/google-cloud-go/issues/2927)) ([f084690](https://www.github.com/googleapis/google-cloud-go/commit/f084690a2ea08ce73bafaaced95ad271fd01e11e)) -* **talent:** start generating apiv4 ([#2871](https://www.github.com/googleapis/google-cloud-go/issues/2871)) ([5c98071](https://www.github.com/googleapis/google-cloud-go/commit/5c98071b03822c58862d1fa5442ff36d627f1a61)) - - -### Bug Fixes - -* **godocfx:** filter out other modules, sort pkgs ([#2894](https://www.github.com/googleapis/google-cloud-go/issues/2894)) ([868db45](https://www.github.com/googleapis/google-cloud-go/commit/868db45e2e6f4e9ad48432be86c849f335e1083d)) -* **godocfx:** shorten function names ([#2880](https://www.github.com/googleapis/google-cloud-go/issues/2880)) ([48a0217](https://www.github.com/googleapis/google-cloud-go/commit/48a0217930750c1f4327f2622b0f2a3ec8afc0b7)) -* **translate:** properly name examples ([#2892](https://www.github.com/googleapis/google-cloud-go/issues/2892)) ([c19e141](https://www.github.com/googleapis/google-cloud-go/commit/c19e1415e6fa76b7ea66a7fc67ad3ba22670a2ba)), refs [#2883](https://www.github.com/googleapis/google-cloud-go/issues/2883) - -## [0.66.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.65.0...v0.66.0) (2020-09-15) - - -### Features - -* **all:** auto-regenerate gapics , refs [#2849](https://www.github.com/googleapis/google-cloud-go/issues/2849) [#2843](https://www.github.com/googleapis/google-cloud-go/issues/2843) [#2841](https://www.github.com/googleapis/google-cloud-go/issues/2841) [#2819](https://www.github.com/googleapis/google-cloud-go/issues/2819) [#2816](https://www.github.com/googleapis/google-cloud-go/issues/2816) [#2809](https://www.github.com/googleapis/google-cloud-go/issues/2809) [#2801](https://www.github.com/googleapis/google-cloud-go/issues/2801) [#2795](https://www.github.com/googleapis/google-cloud-go/issues/2795) [#2791](https://www.github.com/googleapis/google-cloud-go/issues/2791) [#2788](https://www.github.com/googleapis/google-cloud-go/issues/2788) [#2781](https://www.github.com/googleapis/google-cloud-go/issues/2781) -* **analytics/data:** start generating apiv1alpha ([#2796](https://www.github.com/googleapis/google-cloud-go/issues/2796)) ([e93132c](https://www.github.com/googleapis/google-cloud-go/commit/e93132c77725de3c80c34d566df269eabfcfde93)) -* **area120/tables:** start generating apiv1alpha1 ([#2807](https://www.github.com/googleapis/google-cloud-go/issues/2807)) ([9e5a4d0](https://www.github.com/googleapis/google-cloud-go/commit/9e5a4d0dee0d83be0c020797a2f579d9e42ef521)) -* **cloudbuild:** Start generating apiv1/v3 ([#2830](https://www.github.com/googleapis/google-cloud-go/issues/2830)) ([358a536](https://www.github.com/googleapis/google-cloud-go/commit/358a5368da64cf4868551652e852ceb453504f64)) -* **godocfx:** create Go DocFX YAML generator ([#2854](https://www.github.com/googleapis/google-cloud-go/issues/2854)) ([37c70ac](https://www.github.com/googleapis/google-cloud-go/commit/37c70acd91768567106ff3b2b130835998d974c5)) -* **security/privateca:** start generating apiv1beta1 ([#2806](https://www.github.com/googleapis/google-cloud-go/issues/2806)) ([f985141](https://www.github.com/googleapis/google-cloud-go/commit/f9851412183989dc69733a7e61ad39a9378cd893)) -* **video/transcoder:** start generating apiv1beta1 ([#2797](https://www.github.com/googleapis/google-cloud-go/issues/2797)) ([390dda8](https://www.github.com/googleapis/google-cloud-go/commit/390dda8ff2c526e325e434ad0aec778b7aa97ea4)) -* **workflows:** start generating apiv1beta ([#2799](https://www.github.com/googleapis/google-cloud-go/issues/2799)) ([0e39665](https://www.github.com/googleapis/google-cloud-go/commit/0e39665ccb788caec800e2887d433ca6e0cf9901)) -* **workflows/executions:** start generating apiv1beta ([#2800](https://www.github.com/googleapis/google-cloud-go/issues/2800)) ([7eaa0d1](https://www.github.com/googleapis/google-cloud-go/commit/7eaa0d184c6a2141d8bf4514b3fd20715b50a580)) - - -### Bug Fixes - -* **internal/kokoro:** install the right version of docuploader ([#2861](https://www.github.com/googleapis/google-cloud-go/issues/2861)) ([d8489c1](https://www.github.com/googleapis/google-cloud-go/commit/d8489c141b8b02e83d6426f4baebd3658ae11639)) -* **internal/kokoro:** remove extra dash in doc tarball ([#2862](https://www.github.com/googleapis/google-cloud-go/issues/2862)) ([690ddcc](https://www.github.com/googleapis/google-cloud-go/commit/690ddccc5202b5a70f1afa5c518dca37b6a0861c)) -* **profiler:** do not collect disabled profile types ([#2836](https://www.github.com/googleapis/google-cloud-go/issues/2836)) ([faeb498](https://www.github.com/googleapis/google-cloud-go/commit/faeb4985bf6afdcddba4553efa874642bf7f08ed)), refs [#2835](https://www.github.com/googleapis/google-cloud-go/issues/2835) - - -### Reverts - -* **cloudbuild): "feat(cloudbuild:** Start generating apiv1/v3" ([#2840](https://www.github.com/googleapis/google-cloud-go/issues/2840)) ([3aaf755](https://www.github.com/googleapis/google-cloud-go/commit/3aaf755476dfea1700986fc086f53fc1ab756557)) - -## [0.65.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.64.0...v0.65.0) (2020-08-27) - - -### Announcements - -The following changes will be included in an upcoming release and are not -included in this one. - -#### Default Deadlines - -By default, non-streaming methods, like Create or Get methods, will have a -default deadline applied to the context provided at call time, unless a context -deadline is already set. Streaming methods have no default deadline and will run -indefinitely, unless the context provided at call time contains a deadline. - -To opt-out of this behavior, set the environment variable -`GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE` to `true` prior to -initializing a client. This opt-out mechanism will be removed in a later -release, with a notice similar to this one ahead of its removal. - - -### Features - -* **all:** auto-regenerate gapics , refs [#2774](https://www.github.com/googleapis/google-cloud-go/issues/2774) [#2764](https://www.github.com/googleapis/google-cloud-go/issues/2764) - - -### Bug Fixes - -* **all:** correct minor typos ([#2756](https://www.github.com/googleapis/google-cloud-go/issues/2756)) ([03d78b5](https://www.github.com/googleapis/google-cloud-go/commit/03d78b5627819cb64d1f3866f90043f709e825e1)) -* **compute/metadata:** remove leading slash for Get suffix ([#2760](https://www.github.com/googleapis/google-cloud-go/issues/2760)) ([f0d605c](https://www.github.com/googleapis/google-cloud-go/commit/f0d605ccf32391a9da056a2c551158bd076c128d)) - -## [0.64.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.63.0...v0.64.0) (2020-08-18) - - -### Features - -* **all:** auto-regenerate gapics , refs [#2734](https://www.github.com/googleapis/google-cloud-go/issues/2734) [#2731](https://www.github.com/googleapis/google-cloud-go/issues/2731) [#2730](https://www.github.com/googleapis/google-cloud-go/issues/2730) [#2725](https://www.github.com/googleapis/google-cloud-go/issues/2725) [#2722](https://www.github.com/googleapis/google-cloud-go/issues/2722) [#2706](https://www.github.com/googleapis/google-cloud-go/issues/2706) -* **pubsublite:** start generating v1 ([#2700](https://www.github.com/googleapis/google-cloud-go/issues/2700)) ([d2e777f](https://www.github.com/googleapis/google-cloud-go/commit/d2e777f56e08146646b3ffb7a78856795094ab4e)) - -## [0.63.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.62.0...v0.63.0) (2020-08-05) - - -### Features - -* **all:** auto-regenerate gapics ([#2682](https://www.github.com/googleapis/google-cloud-go/issues/2682)) ([63bfd63](https://www.github.com/googleapis/google-cloud-go/commit/63bfd638da169e0f1f4fa4a5125da2955022dc04)) -* **analytics/admin:** start generating apiv1alpha ([#2670](https://www.github.com/googleapis/google-cloud-go/issues/2670)) ([268199e](https://www.github.com/googleapis/google-cloud-go/commit/268199e5350a64a83ecf198e0e0fa4863f00fa6c)) -* **functions/metadata:** Special-case marshaling ([#2669](https://www.github.com/googleapis/google-cloud-go/issues/2669)) ([d8d7fc6](https://www.github.com/googleapis/google-cloud-go/commit/d8d7fc66cbc42f79bec25fb0daaf53d926e3645b)) -* **gaming:** start generate apiv1 ([#2681](https://www.github.com/googleapis/google-cloud-go/issues/2681)) ([1adfd0a](https://www.github.com/googleapis/google-cloud-go/commit/1adfd0aed6b2c0e1dd0c575a5ec0f49388fa5601)) -* **internal/kokoro:** add script to test compatibility with samples ([#2637](https://www.github.com/googleapis/google-cloud-go/issues/2637)) ([f2aa76a](https://www.github.com/googleapis/google-cloud-go/commit/f2aa76a0058e86c1c33bb634d2c084b58f77ab32)) - -## v0.62.0 - -### Announcements - -- There was a breaking change to `cloud.google.com/go/dataproc/apiv1` that was - merged in [this PR](https://github.com/googleapis/google-cloud-go/pull/2606). - This fixed a broken API response for `DiagnoseCluster`. When polling on the - Long Running Operation(LRO), the API now returns - `(*dataprocpb.DiagnoseClusterResults, error)` whereas it only returned an - `error` before. - -### Changes - -- all: - - Updated all direct dependencies. - - Updated contributing guidelines to suggest allowing edits from maintainers. -- billing/budgets: - - Start generating client for apiv1beta1. -- functions: - - Start generating client for apiv1. -- notebooks: - - Start generating client apiv1beta1. -- profiler: - - update proftest to support parsing floating-point backoff durations. - - Fix the regexp used to parse backoff duration. -- Various updates to autogenerated clients. - -## v0.61.0 - -### Changes - -- all: - - Update all direct dependencies. -- dashboard: - - Start generating client for apiv1. -- policytroubleshooter: - - Start generating client for apiv1. -- profiler: - - Disable OpenCensus Telemetry for requests made by the profiler package by default. You can re-enable it using `profiler.Config.EnableOCTelemetry`. -- Various updates to autogenerated clients. - -## v0.60.0 - -### Changes - -- all: - - Refactored examples to reduce module dependencies. - - Update sub-modules to use cloud.google.com/go v0.59.0. -- internal: - - Start generating client for gaming apiv1beta. -- Various updates to autogenerated clients. - -## v0.59.0 - -### Announcements - -goolgeapis/google-cloud-go has moved its source of truth to GitHub and is no longer a mirror. This means that our -contributing process has changed a bit. We will now be conducting all code reviews on GitHub which means we now accept -pull requests! If you have a version of the codebase previously checked out you may wish to update your git remote to -point to GitHub. - -### Changes - -- all: - - Remove dependency on honnef.co/go/tools. - - Update our contributing instructions now that we use GitHub for reviews. - - Remove some un-inclusive terminology. -- compute/metadata: - - Pass cancelable context to DNS lookup. -- .github: - - Update templates issue/PR templates. -- internal: - - Bump several clients to GA. - - Fix GoDoc badge source. - - Several automation changes related to the move to GitHub. - - Start generating a client for asset v1p5beta1. -- Various updates to autogenerated clients. - -## v0.58.0 - -### Deprecation notice - -- `cloud.google.com/go/monitoring/apiv3` has been deprecated due to breaking - changes in the API. Please migrate to `cloud.google.com/go/monitoring/apiv3/v2`. - -### Changes - -- all: - - The remaining uses of gtransport.Dial have been removed. - - The `genproto` dependency has been updated to a version that makes use of - new `protoreflect` library. For more information on these protobuf changes - please see the following post from the official Go blog: - https://blog.golang.org/protobuf-apiv2. -- internal: - - Started generation of datastore admin v1 client. - - Updated protofuf version used for generation to 3.12.X. - - Update the release levels for several APIs. - - Generate clients with protoc-gen-go@v1.4.1. -- monitoring: - - Re-enable generation of monitoring/apiv3 under v2 directory (see deprecation - notice above). -- profiler: - - Fixed flakiness in tests. -- Various updates to autogenerated clients. - -## v0.57.0 - -- all: - - Update module dependency `google.golang.org/api` to `v0.21.0`. -- errorreporting: - - Add exported SetGoogleClientInfo wrappers to manual file. -- expr/v1alpha1: - - Deprecate client. This client will be removed in a future release. -- internal: - - Fix possible data race in TestTracer. - - Pin versions of tools used for generation. - - Correct the release levels for BigQuery APIs. - - Start generation osconfig v1. -- longrunning: - - Add exported SetGoogleClientInfo wrappers to manual file. -- monitoring: - - Stop generation of monitoring/apiv3 because of incoming breaking change. -- trace: - - Add exported SetGoogleClientInfo wrappers to manual file. -- Various updates to autogenerated clients. - -## v0.56.0 - -- secretmanager: - - add IAM helper -- profiler: - - try all us-west1 zones for integration tests -- internal: - - add config to generate webrisk v1 - - add repo and commit to buildcop invocation - - add recaptchaenterprise v1 generation config - - update microgenerator to v0.12.5 - - add datacatalog client - - start generating security center settings v1beta - - start generating osconfig agentendpoint v1 - - setup generation for bigquery/connection/v1beta1 -- all: - - increase continous testing timeout to 45m - - various updates to autogenerated clients. - -## v0.55.0 - -- Various updates to autogenerated clients. - -## v0.54.0 - -- all: - - remove unused golang.org/x/exp from mod file - - update godoc.org links to pkg.go.dev -- compute/metadata: - - use defaultClient when http.Client is nil - - remove subscribeClient -- iam: - - add support for v3 policy and IAM conditions -- Various updates to autogenerated clients. - -## v0.53.0 - -- all: most clients now use transport/grpc.DialPool rather than Dial (see #1777 for outliers). - - Connection pooling now does not use the deprecated (and soon to be removed) gRPC load balancer API. -- profiler: remove symbolization (drops support for go1.10) -- Various updates to autogenerated clients. - -## v0.52.0 - -- internal/gapicgen: multiple improvements related to library generation. -- compute/metadata: unset ResponseHeaderTimeout in defaultClient -- docs: fix link to KMS in README.md -- Various updates to autogenerated clients. - -## v0.51.0 - -- secretmanager: - - add IAM helper for generic resource IAM handle -- cloudbuild: - - migrate to microgen in a major version -- Various updates to autogenerated clients. - -## v0.50.0 - -- profiler: - - Support disabling CPU profile collection. - - Log when a profile creation attempt begins. -- compute/metadata: - - Fix panic on malformed URLs. - - InstanceName returns actual instance name. -- Various updates to autogenerated clients. - -## v0.49.0 - -- functions/metadata: - - Handle string resources in JSON unmarshaller. -- Various updates to autogenerated clients. - -## v0.48.0 - -- Various updates to autogenerated clients - -## v0.47.0 - -This release drops support for Go 1.9 and Go 1.10: we continue to officially -support Go 1.11, Go 1.12, and Go 1.13. - -- Various updates to autogenerated clients. -- Add cloudbuild/apiv1 client. - -## v0.46.3 - -This is an empty release that was created solely to aid in storage's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.2 - -This is an empty release that was created solely to aid in spanner's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.1 - -This is an empty release that was created solely to aid in firestore's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.0 - -- spanner: - - Retry "Session not found" for read-only transactions. - - Retry aborted PDMLs. -- spanner/spannertest: - - Fix a bug that was causing 0X-prefixed number to be parsed incorrectly. -- storage: - - Add HMACKeyOptions. - - Remove *REGIONAL from StorageClass documentation. Using MULTI_REGIONAL, - DURABLE_REDUCED_AVAILABILITY, and REGIONAL are no longer best practice - StorageClasses but they are still acceptable values. -- trace: - - Remove cloud.google.com/go/trace. Package cloud.google.com/go/trace has been - marked OBSOLETE for several years: it is now no longer provided. If you - relied on this package, please vendor it or switch to using - https://cloud.google.com/trace/docs/setup/go (which obsoleted it). - -## v0.45.1 - -This is an empty release that was created solely to aid in pubsub's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.45.0 - -- compute/metadata: - - Add Email method. -- storage: - - Fix duplicated retry logic. - - Add ReaderObjectAttrs.StartOffset. - - Support reading last N bytes of a file when a negative range is given, such - as `obj.NewRangeReader(ctx, -10, -1)`. - - Add HMACKey listing functionality. -- spanner/spannertest: - - Support primary keys with no columns. - - Fix MinInt64 parsing. - - Implement deletion of key ranges. - - Handle reads during a read-write transaction. - - Handle returning DATE values. -- pubsub: - - Fix Ack/Modack request size calculation. -- logging: - - Add auto-detection of monitored resources on GAE Standard. - -## v0.44.3 - -This is an empty release that was created solely to aid in bigtable's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.2 - -This is an empty release that was created solely to aid in bigquery's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.1 - -This is an empty release that was created solely to aid in datastore's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.0 - -- datastore: - - Interface elements whose underlying types are supported, are now supported. - - Reduce time to initial retry from 1s to 100ms. -- firestore: - - Add Increment transformation. -- storage: - - Allow emulator with STORAGE_EMULATOR_HOST. - - Add methods for HMAC key management. -- pubsub: - - Add PublishCount and PublishLatency measurements. - - Add DefaultPublishViews and DefaultSubscribeViews for convenience of - importing all views. - - Add add Subscription.PushConfig.AuthenticationMethod. -- spanner: - - Allow emulator usage with SPANNER_EMULATOR_HOST. - - Add cloud.google.com/go/spanner/spannertest, a spanner emulator. - - Add cloud.google.com/go/spanner/spansql which contains types and a parser - for the Cloud Spanner SQL dialect. -- asset: - - Add apiv1p2beta1 client. - -## v0.43.0 - -This is an empty release that was created solely to aid in logging's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.42.0 - -- bigtable: - - Add an admin method to update an instance and clusters. - - Fix bttest regex matching behavior for alternations (things like `|a`). - - Expose BlockAllFilter filter. -- bigquery: - - Add Routines API support. -- storage: - - Add read-only Bucket.LocationType. -- logging: - - Add TraceSampled to Entry. - - Fix to properly extract {Trace, Span}Id from X-Cloud-Trace-Context. -- pubsub: - - Add Cloud Key Management to TopicConfig. - - Change ExpirationPolicy to optional.Duration. -- automl: - - Add apiv1beta1 client. -- iam: - - Fix compilation problem with iam/credentials/apiv1. - -## v0.41.0 - -- bigtable: - - Check results from PredicateFilter in bttest, which fixes certain false matches. -- profiler: - - debugLog checks user defined logging options before logging. -- spanner: - - PartitionedUpdates respect query parameters. - - StartInstance allows specifying cloud API access scopes. -- bigquery: - - Use empty slice instead of nil for ValueSaver, fixing an issue with zero-length, repeated, nested fields causing panics. -- firestore: - - Return same number of snapshots as doc refs (in the form of duplicate records) during GetAll. -- replay: - - Change references to IPv4 addresses to localhost, making replay compatible with IPv6. - -## v0.40.0 - -- all: - - Update to protobuf-golang v1.3.1. -- datastore: - - Attempt to decode GAE-encoded keys if initial decoding attempt fails. - - Support integer time conversion. -- pubsub: - - Add PublishSettings.BundlerByteLimit. If users receive pubsub.ErrOverflow, - this value should be adjusted higher. - - Use IPv6 compatible target in testutil. -- bigtable: - - Fix Latin-1 regexp filters in bttest, allowing \C. - - Expose PassAllFilter. -- profiler: - - Add log messages for slow path in start. - - Fix start to allow retry until success. -- firestore: - - Add admin client. -- containeranalysis: - - Add apiv1 client. -- grafeas: - - Add apiv1 client. - -## 0.39.0 - -- bigtable: - - Implement DeleteInstance in bttest. - - Return an error on invalid ReadRowsRequest.RowRange key ranges in bttest. -- bigquery: - - Move RequirePartitionFilter outside of TimePartioning. - - Expose models API. -- firestore: - - Allow array values in create and update calls. - - Add CollectionGroup method. -- pubsub: - - Add ExpirationPolicy to Subscription. -- storage: - - Add V4 signing. -- rpcreplay: - - Match streams by first sent request. This further improves rpcreplay's - ability to distinguish streams. -- httpreplay: - - Set up Man-In-The-Middle config only once. This should improve proxy - creation when multiple proxies are used in a single process. - - Remove error on empty Content-Type, allowing requests with no Content-Type - header but a non-empty body. -- all: - - Fix an edge case bug in auto-generated library pagination by properly - propagating pagetoken. - -## 0.38.0 - -This update includes a substantial reduction in our transitive dependency list -by way of updating to opencensus@v0.21.0. - -- spanner: - - Error implements GRPCStatus, allowing status.Convert. -- bigtable: - - Fix a bug in bttest that prevents single column queries returning results - that match other filters. - - Remove verbose retry logging. -- logging: - - Ensure RequestUrl has proper UTF-8, removing the need for users to wrap and - rune replace manually. -- recaptchaenterprise: - - Add v1beta1 client. -- phishingprotection: - - Add v1beta1 client. - -## 0.37.4 - -This patch releases re-builds the go.sum. This was not possible in the -previous release. - -- firestore: - - Add sentinel value DetectProjectID for auto-detecting project ID. - - Add OpenCensus tracing for public methods. - - Marked stable. All future changes come with a backwards compatibility - guarantee. - - Removed firestore/apiv1beta1. All users relying on this low-level library - should migrate to firestore/apiv1. Note that most users should use the - high-level firestore package instead. -- pubsub: - - Allow large messages in synchronous pull case. - - Cap bundler byte limit. This should prevent OOM conditions when there are - a very large number of message publishes occurring. -- storage: - - Add ETag to BucketAttrs and ObjectAttrs. -- datastore: - - Removed some non-sensical OpenCensus traces. -- webrisk: - - Add v1 client. -- asset: - - Add v1 client. -- cloudtasks: - - Add v2 client. - -## 0.37.3 - -This patch release removes github.com/golang/lint from the transitive -dependency list, resolving `go get -u` problems. - -Note: this release intentionally has a broken go.sum. Please use v0.37.4. - -## 0.37.2 - -This patch release is mostly intended to bring in v0.3.0 of -google.golang.org/api, which fixes a GCF deployment issue. - -Note: we had to-date accidentally marked Redis as stable. In this release, we've -fixed it by downgrading its documentation to alpha, as it is in other languages -and docs. - -- all: - - Document context in generated libraries. - -## 0.37.1 - -Small go.mod version bumps to bring in v0.2.0 of google.golang.org/api, which -introduces a new oauth2 url. - -## 0.37.0 - -- spanner: - - Add BatchDML method. - - Reduced initial time between retries. -- bigquery: - - Produce better error messages for InferSchema. - - Add logical type control for avro loads. - - Add support for the GEOGRAPHY type. -- datastore: - - Add sentinel value DetectProjectID for auto-detecting project ID. - - Allow flatten tag on struct pointers. - - Fixed a bug that caused queries to panic with invalid queries. Instead they - will now return an error. -- profiler: - - Add ability to override GCE zone and instance. -- pubsub: - - BEHAVIOR CHANGE: Refactor error code retry logic. RPCs should now more - consistently retry specific error codes based on whether they're idempotent - or non-idempotent. -- httpreplay: Fixed a bug when a non-GET request had a zero-length body causing - the Content-Length header to be dropped. -- iot: - - Add new apiv1 client. -- securitycenter: - - Add new apiv1 client. -- cloudscheduler: - - Add new apiv1 client. - -## 0.36.0 - -- spanner: - - Reduce minimum retry backoff from 1s to 100ms. This makes time between - retries much faster and should improve latency. -- storage: - - Add support for Bucket Policy Only. -- kms: - - Add ResourceIAM helper method. - - Deprecate KeyRingIAM and CryptoKeyIAM. Please use ResourceIAM. -- firestore: - - Switch from v1beta1 API to v1 API. - - Allow emulator with FIRESTORE_EMULATOR_HOST. -- bigquery: - - Add NumLongTermBytes to Table. - - Add TotalBytesProcessedAccuracy to QueryStatistics. -- irm: - - Add new v1alpha2 client. -- talent: - - Add new v4beta1 client. -- rpcreplay: - - Fix connection to work with grpc >= 1.17. - - It is now required for an actual gRPC server to be running for Dial to - succeed. - -## 0.35.1 - -- spanner: - - Adds OpenCensus views back to public API. - -## v0.35.0 - -- all: - - Add go.mod and go.sum. - - Switch usage of gax-go to gax-go/v2. -- bigquery: - - Fix bug where time partitioning could not be removed from a table. - - Fix panic that occurred with empty query parameters. -- bttest: - - Fix bug where deleted rows were returned by ReadRows. -- bigtable/emulator: - - Configure max message size to 256 MiB. -- firestore: - - Allow non-transactional queries in transactions. - - Allow StartAt/EndBefore on direct children at any depth. - - QuerySnapshotIterator.Stop may be called in an error state. - - Fix bug the prevented reset of transaction write state in between retries. -- functions/metadata: - - Make Metadata.Resource a pointer. -- logging: - - Make SpanID available in logging.Entry. -- metadata: - - Wrap !200 error code in a typed err. -- profiler: - - Add function to check if function name is within a particular file in the - profile. - - Set parent field in create profile request. - - Return kubernetes client to start cluster, so client can be used to poll - cluster. - - Add function for checking if filename is in profile. -- pubsub: - - Fix bug where messages expired without an initial modack in - synchronous=true mode. - - Receive does not retry ResourceExhausted errors. -- spanner: - - client.Close now cancels existing requests and should be much faster for - large amounts of sessions. - - Correctly allow MinOpened sessions to be spun up. - -## v0.34.0 - -- functions/metadata: - - Switch to using JSON in context. - - Make Resource a value. -- vision: Fix ProductSearch return type. -- datastore: Add an example for how to handle MultiError. - -## v0.33.1 - -- compute: Removes an erroneously added go.mod. -- logging: Populate source location in fromLogEntry. - -## v0.33.0 - -- bttest: - - Add support for apply_label_transformer. -- expr: - - Add expr library. -- firestore: - - Support retrieval of missing documents. -- kms: - - Add IAM methods. -- pubsub: - - Clarify extension documentation. -- scheduler: - - Add v1beta1 client. -- vision: - - Add product search helper. - - Add new product search client. - -## v0.32.0 - -Note: This release is the last to support Go 1.6 and 1.8. - -- bigquery: - - Add support for removing an expiration. - - Ignore NeverExpire in Table.Create. - - Validate table expiration time. -- cbt: - - Add note about not supporting arbitrary bytes. -- datastore: - - Align key checks. -- firestore: - - Return an error when using Start/End without providing values. -- pubsub: - - Add pstest Close method. - - Clarify MaxExtension documentation. -- securitycenter: - - Add v1beta1 client. -- spanner: - - Allow nil in mutations. - - Improve doc of SessionPoolConfig.MaxOpened. - - Increase session deletion timeout from 5s to 15s. - -## v0.31.0 - -- bigtable: - - Group mutations across multiple requests. -- bigquery: - - Link to bigquery troubleshooting errors page in bigquery.Error comment. -- cbt: - - Fix go generate command. - - Document usage of both maxage + maxversions. -- datastore: - - Passing nil keys results in ErrInvalidKey. -- firestore: - - Clarify what Document.DataTo does with untouched struct fields. -- profile: - - Validate service name in agent. -- pubsub: - - Fix deadlock with pstest and ctx.Cancel. - - Fix a possible deadlock in pstest. -- trace: - - Update doc URL with new fragment. - -Special thanks to @fastest963 for going above and beyond helping us to debug -hard-to-reproduce Pub/Sub issues. - -## v0.30.0 - -- spanner: DML support added. See https://godoc.org/cloud.google.com/go/spanner#hdr-DML_and_Partitioned_DML for more information. -- bigtable: bttest supports row sample filter. -- functions: metadata package added for accessing Cloud Functions resource metadata. - -## v0.29.0 - -- bigtable: - - Add retry to all idempotent RPCs. - - cbt supports complex GC policies. - - Emulator supports arbitrary bytes in regex filters. -- firestore: Add ArrayUnion and ArrayRemove. -- logging: Add the ContextFunc option to supply the context used for - asynchronous RPCs. -- profiler: Ignore NotDefinedError when fetching the instance name -- pubsub: - - BEHAVIOR CHANGE: Receive doesn't retry if an RPC returns codes.Cancelled. - - BEHAVIOR CHANGE: Receive retries on Unavailable intead of returning. - - Fix deadlock. - - Restore Ack/Nack/Modacks metrics. - - Improve context handling in iterator. - - Implement synchronous mode for Receive. - - pstest: add Pull. -- spanner: Add a metric for the number of sessions currently opened. -- storage: - - Canceling the context releases all resources. - - Add additional RetentionPolicy attributes. -- vision/apiv1: Add LocalizeObjects method. - -## v0.28.0 - -- bigtable: - - Emulator returns Unimplemented for snapshot RPCs. -- bigquery: - - Support zero-length repeated, nested fields. -- cloud assets: - - Add v1beta client. -- datastore: - - Don't nil out transaction ID on retry. -- firestore: - - BREAKING CHANGE: When watching a query with Query.Snapshots, QuerySnapshotIterator.Next - returns a QuerySnapshot which contains read time, result size, change list and the DocumentIterator - (previously, QuerySnapshotIterator.Next returned just the DocumentIterator). See: https://godoc.org/cloud.google.com/go/firestore#Query.Snapshots. - - Add array-contains operator. -- IAM: - - Add iam/credentials/apiv1 client. -- pubsub: - - Canceling the context passed to Subscription.Receive causes Receive to return when - processing finishes on all messages currently in progress, even if new messages are arriving. -- redis: - - Add redis/apiv1 client. -- storage: - - Add Reader.Attrs. - - Deprecate several Reader getter methods: please use Reader.Attrs for these instead. - - Add ObjectHandle.Bucket and ObjectHandle.Object methods. - -## v0.27.0 - -- bigquery: - - Allow modification of encryption configuration and partitioning options to a table via the Update call. - - Add a SchemaFromJSON function that converts a JSON table schema. -- bigtable: - - Restore cbt count functionality. -- containeranalysis: - - Add v1beta client. -- spanner: - - Fix a case where an iterator might not be closed correctly. -- storage: - - Add ServiceAccount method https://godoc.org/cloud.google.com/go/storage#Client.ServiceAccount. - - Add a method to Reader that returns the parsed value of the Last-Modified header. - -## v0.26.0 - -- bigquery: - - Support filtering listed jobs by min/max creation time. - - Support data clustering (https://godoc.org/cloud.google.com/go/bigquery#Clustering). - - Include job creator email in Job struct. -- bigtable: - - Add `RowSampleFilter`. - - emulator: BREAKING BEHAVIOR CHANGE: Regexps in row, family, column and value filters - must match the entire target string to succeed. Previously, the emulator was - succeeding on partial matches. - NOTE: As of this release, this change only affects the emulator when run - from this repo (bigtable/cmd/emulator/cbtemulator.go). The version launched - from `gcloud` will be updated in a subsequent `gcloud` release. -- dataproc: Add apiv1beta2 client. -- datastore: Save non-nil pointer fields on omitempty. -- logging: populate Entry.Trace from the HTTP X-Cloud-Trace-Context header. -- logging/logadmin: Support writer_identity and include_children. -- pubsub: - - Support labels on topics and subscriptions. - - Support message storage policy for topics. - - Use the distribution of ack times to determine when to extend ack deadlines. - The only user-visible effect of this change should be that programs that - call only `Subscription.Receive` need no IAM permissions other than `Pub/Sub - Subscriber`. -- storage: - - Support predefined ACLs. - - Support additional ACL fields other than Entity and Role. - - Support bucket websites. - - Support bucket logging. - - -## v0.25.0 - -- Added [Code of Conduct](https://github.com/googleapis/google-cloud-go/blob/master/CODE_OF_CONDUCT.md) -- bigtable: - - cbt: Support a GC policy of "never". -- errorreporting: - - Support User. - - Close now calls Flush. - - Use OnError (previously ignored). - - Pass through the RPC error as-is to OnError. -- httpreplay: A tool for recording and replaying HTTP requests - (for the bigquery and storage clients in this repo). -- kms: v1 client added -- logging: add SourceLocation to Entry. -- storage: improve CRC checking on read. - -## v0.24.0 - -- bigquery: Support for the NUMERIC type. -- bigtable: - - cbt: Optionally specify columns for read/lookup - - Support instance-level administration. -- oslogin: New client for the OS Login API. -- pubsub: - - The package is now stable. There will be no further breaking changes. - - Internal changes to improve Subscription.Receive behavior. -- storage: Support updating bucket lifecycle config. -- spanner: Support struct-typed parameter bindings. -- texttospeech: New client for the Text-to-Speech API. - -## v0.23.0 - -- bigquery: Add DDL stats to query statistics. -- bigtable: - - cbt: Add cells-per-column limit for row lookup. - - cbt: Make it possible to combine read filters. -- dlp: v2beta2 client removed. Use the v2 client instead. -- firestore, spanner: Fix compilation errors due to protobuf changes. - -## v0.22.0 - -- bigtable: - - cbt: Support cells per column limit for row read. - - bttest: Correctly handle empty RowSet. - - Fix ReadModifyWrite operation in emulator. - - Fix API path in GetCluster. - -- bigquery: - - BEHAVIOR CHANGE: Retry on 503 status code. - - Add dataset.DeleteWithContents. - - Add SchemaUpdateOptions for query jobs. - - Add Timeline to QueryStatistics. - - Add more stats to ExplainQueryStage. - - Support Parquet data format. - -- datastore: - - Support omitempty for times. - -- dlp: - - **BREAKING CHANGE:** Remove v1beta1 client. Please migrate to the v2 client, - which is now out of beta. - - Add v2 client. - -- firestore: - - BEHAVIOR CHANGE: Treat set({}, MergeAll) as valid. - -- iam: - - Support JWT signing via SignJwt callopt. - -- profiler: - - BEHAVIOR CHANGE: PollForSerialOutput returns an error when context.Done. - - BEHAVIOR CHANGE: Increase the initial backoff to 1 minute. - - Avoid returning empty serial port output. - -- pubsub: - - BEHAVIOR CHANGE: Don't backoff during next retryable error once stream is healthy. - - BEHAVIOR CHANGE: Don't backoff on EOF. - - pstest: Support Acknowledge and ModifyAckDeadline RPCs. - -- redis: - - Add v1 beta Redis client. - -- spanner: - - Support SessionLabels. - -- speech: - - Add api v1 beta1 client. - -- storage: - - BEHAVIOR CHANGE: Retry reads when retryable error occurs. - - Fix delete of object in requester-pays bucket. - - Support KMS integration. - -## v0.21.0 - -- bigquery: - - Add OpenCensus tracing. - -- firestore: - - **BREAKING CHANGE:** If a document does not exist, return a DocumentSnapshot - whose Exists method returns false. DocumentRef.Get and Transaction.Get - return the non-nil DocumentSnapshot in addition to a NotFound error. - **DocumentRef.GetAll and Transaction.GetAll return a non-nil - DocumentSnapshot instead of nil.** - - Add DocumentIterator.Stop. **Call Stop whenever you are done with a - DocumentIterator.** - - Added Query.Snapshots and DocumentRef.Snapshots, which provide realtime - notification of updates. See https://cloud.google.com/firestore/docs/query-data/listen. - - Canceling an RPC now always returns a grpc.Status with codes.Canceled. - -- spanner: - - Add `CommitTimestamp`, which supports inserting the commit timestamp of a - transaction into a column. - -## v0.20.0 - -- bigquery: Support SchemaUpdateOptions for load jobs. - -- bigtable: - - Add SampleRowKeys. - - cbt: Support union, intersection GCPolicy. - - Retry admin RPCS. - - Add trace spans to retries. - -- datastore: Add OpenCensus tracing. - -- firestore: - - Fix queries involving Null and NaN. - - Allow Timestamp protobuffers for time values. - -- logging: Add a WriteTimeout option. - -- spanner: Support Batch API. - -- storage: Add OpenCensus tracing. - -## v0.19.0 - -- bigquery: - - Support customer-managed encryption keys. - -- bigtable: - - Improved emulator support. - - Support GetCluster. - -- datastore: - - Add general mutations. - - Support pointer struct fields. - - Support transaction options. - -- firestore: - - Add Transaction.GetAll. - - Support document cursors. - -- logging: - - Support concurrent RPCs to the service. - - Support per-entry resources. - -- profiler: - - Add config options to disable heap and thread profiling. - - Read the project ID from $GOOGLE_CLOUD_PROJECT when it's set. - -- pubsub: - - BEHAVIOR CHANGE: Release flow control after ack/nack (instead of after the - callback returns). - - Add SubscriptionInProject. - - Add OpenCensus instrumentation for streaming pull. - -- storage: - - Support CORS. - -## v0.18.0 - -- bigquery: - - Marked stable. - - Schema inference of nullable fields supported. - - Added TimePartitioning to QueryConfig. - -- firestore: Data provided to DocumentRef.Set with a Merge option can contain - Delete sentinels. - -- logging: Clients can accept parent resources other than projects. - -- pubsub: - - pubsub/pstest: A lighweight fake for pubsub. Experimental; feedback welcome. - - Support updating more subscription metadata: AckDeadline, - RetainAckedMessages and RetentionDuration. - -- oslogin/apiv1beta: New client for the Cloud OS Login API. - -- rpcreplay: A package for recording and replaying gRPC traffic. - -- spanner: - - Add a ReadWithOptions that supports a row limit, as well as an index. - - Support query plan and execution statistics. - - Added [OpenCensus](http://opencensus.io) support. - -- storage: Clarify checksum validation for gzipped files (it is not validated - when the file is served uncompressed). - - -## v0.17.0 - -- firestore BREAKING CHANGES: - - Remove UpdateMap and UpdateStruct; rename UpdatePaths to Update. - Change - `docref.UpdateMap(ctx, map[string]interface{}{"a.b", 1})` - to - `docref.Update(ctx, []firestore.Update{{Path: "a.b", Value: 1}})` - - Change - `docref.UpdateStruct(ctx, []string{"Field"}, aStruct)` - to - `docref.Update(ctx, []firestore.Update{{Path: "Field", Value: aStruct.Field}})` - - Rename MergePaths to Merge; require args to be FieldPaths - - A value stored as an integer can be read into a floating-point field, and vice versa. -- bigtable/cmd/cbt: - - Support deleting a column. - - Add regex option for row read. -- spanner: Mark stable. -- storage: - - Add Reader.ContentEncoding method. - - Fix handling of SignedURL headers. -- bigquery: - - If Uploader.Put is called with no rows, it returns nil without making a - call. - - Schema inference supports the "nullable" option in struct tags for - non-required fields. - - TimePartitioning supports "Field". - - -## v0.16.0 - -- Other bigquery changes: - - `JobIterator.Next` returns `*Job`; removed `JobInfo` (BREAKING CHANGE). - - UseStandardSQL is deprecated; set UseLegacySQL to true if you need - Legacy SQL. - - Uploader.Put will generate a random insert ID if you do not provide one. - - Support time partitioning for load jobs. - - Support dry-run queries. - - A `Job` remembers its last retrieved status. - - Support retrieving job configuration. - - Support labels for jobs and tables. - - Support dataset access lists. - - Improve support for external data sources, including data from Bigtable and - Google Sheets, and tables with external data. - - Support updating a table's view configuration. - - Fix uploading civil times with nanoseconds. - -- storage: - - Support PubSub notifications. - - Support Requester Pays buckets. - -- profiler: Support goroutine and mutex profile types. - -## v0.15.0 - -- firestore: beta release. See the - [announcement](https://firebase.googleblog.com/2017/10/introducing-cloud-firestore.html). - -- errorreporting: The existing package has been redesigned. - -- errors: This package has been removed. Use errorreporting. - - -## v0.14.0 - -- bigquery BREAKING CHANGES: - - Standard SQL is the default for queries and views. - - `Table.Create` takes `TableMetadata` as a second argument, instead of - options. - - `Dataset.Create` takes `DatasetMetadata` as a second argument. - - `DatasetMetadata` field `ID` renamed to `FullID` - - `TableMetadata` field `ID` renamed to `FullID` - -- Other bigquery changes: - - The client will append a random suffix to a provided job ID if you set - `AddJobIDSuffix` to true in a job config. - - Listing jobs is supported. - - Better retry logic. - -- vision, language, speech: clients are now stable - -- monitoring: client is now beta - -- profiler: - - Rename InstanceName to Instance, ZoneName to Zone - - Auto-detect service name and version on AppEngine. - -## v0.13.0 - -- bigquery: UseLegacySQL options for CreateTable and QueryConfig. Use these - options to continue using Legacy SQL after the client switches its default - to Standard SQL. - -- bigquery: Support for updating dataset labels. - -- bigquery: Set DatasetIterator.ProjectID to list datasets in a project other - than the client's. DatasetsInProject is no longer needed and is deprecated. - -- bigtable: Fail ListInstances when any zones fail. - -- spanner: support decoding of slices of basic types (e.g. []string, []int64, - etc.) - -- logging/logadmin: UpdateSink no longer creates a sink if it is missing - (actually a change to the underlying service, not the client) - -- profiler: Service and ServiceVersion replace Target in Config. - -## v0.12.0 - -- pubsub: Subscription.Receive now uses streaming pull. - -- pubsub: add Client.TopicInProject to access topics in a different project - than the client. - -- errors: renamed errorreporting. The errors package will be removed shortly. - -- datastore: improved retry behavior. - -- bigquery: support updates to dataset metadata, with etags. - -- bigquery: add etag support to Table.Update (BREAKING: etag argument added). - -- bigquery: generate all job IDs on the client. - -- storage: support bucket lifecycle configurations. - - -## v0.11.0 - -- Clients for spanner, pubsub and video are now in beta. - -- New client for DLP. - -- spanner: performance and testing improvements. - -- storage: requester-pays buckets are supported. - -- storage, profiler, bigtable, bigquery: bug fixes and other minor improvements. - -- pubsub: bug fixes and other minor improvements - -## v0.10.0 - -- pubsub: Subscription.ModifyPushConfig replaced with Subscription.Update. - -- pubsub: Subscription.Receive now runs concurrently for higher throughput. - -- vision: cloud.google.com/go/vision is deprecated. Use -cloud.google.com/go/vision/apiv1 instead. - -- translation: now stable. - -- trace: several changes to the surface. See the link below. - -### Code changes required from v0.9.0 - -- pubsub: Replace - - ``` - sub.ModifyPushConfig(ctx, pubsub.PushConfig{Endpoint: "https://example.com/push"}) - ``` - - with - - ``` - sub.Update(ctx, pubsub.SubscriptionConfigToUpdate{ - PushConfig: &pubsub.PushConfig{Endpoint: "https://example.com/push"}, - }) - ``` - -- trace: traceGRPCServerInterceptor will be provided from *trace.Client. -Given an initialized `*trace.Client` named `tc`, instead of - - ``` - s := grpc.NewServer(grpc.UnaryInterceptor(trace.GRPCServerInterceptor(tc))) - ``` - - write - - ``` - s := grpc.NewServer(grpc.UnaryInterceptor(tc.GRPCServerInterceptor())) - ``` - -- trace trace.GRPCClientInterceptor will also provided from *trace.Client. -Instead of - - ``` - conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(trace.GRPCClientInterceptor())) - ``` - - write - - ``` - conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor())) - ``` - -- trace: We removed the deprecated `trace.EnableGRPCTracing`. Use the gRPC -interceptor as a dial option as shown below when initializing Cloud package -clients: - - ``` - c, err := pubsub.NewClient(ctx, "project-id", option.WithGRPCDialOption(grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor()))) - if err != nil { - ... - } - ``` - - -## v0.9.0 - -- Breaking changes to some autogenerated clients. -- rpcreplay package added. - -## v0.8.0 - -- profiler package added. -- storage: - - Retry Objects.Insert call. - - Add ProgressFunc to WRiter. -- pubsub: breaking changes: - - Publish is now asynchronous ([announcement](https://groups.google.com/d/topic/google-api-go-announce/aaqRDIQ3rvU/discussion)). - - Subscription.Pull replaced by Subscription.Receive, which takes a callback ([announcement](https://groups.google.com/d/topic/google-api-go-announce/8pt6oetAdKc/discussion)). - - Message.Done replaced with Message.Ack and Message.Nack. - -## v0.7.0 - -- Release of a client library for Spanner. See -the -[blog -post](https://cloudplatform.googleblog.com/2017/02/introducing-Cloud-Spanner-a-global-database-service-for-mission-critical-applications.html). -Note that although the Spanner service is beta, the Go client library is alpha. - -## v0.6.0 - -- Beta release of BigQuery, DataStore, Logging and Storage. See the -[blog post](https://cloudplatform.googleblog.com/2016/12/announcing-new-google-cloud-client.html). - -- bigquery: - - struct support. Read a row directly into a struct with -`RowIterator.Next`, and upload a row directly from a struct with `Uploader.Put`. -You can also use field tags. See the [package documentation][cloud-bigquery-ref] -for details. - - - The `ValueList` type was removed. It is no longer necessary. Instead of - ```go - var v ValueList - ... it.Next(&v) .. - ``` - use - - ```go - var v []Value - ... it.Next(&v) ... - ``` - - - Previously, repeatedly calling `RowIterator.Next` on the same `[]Value` or - `ValueList` would append to the slice. Now each call resets the size to zero first. - - - Schema inference will infer the SQL type BYTES for a struct field of - type []byte. Previously it inferred STRING. - - - The types `uint`, `uint64` and `uintptr` are no longer supported in schema - inference. BigQuery's integer type is INT64, and those types may hold values - that are not correctly represented in a 64-bit signed integer. - -## v0.5.0 - -- bigquery: - - The SQL types DATE, TIME and DATETIME are now supported. They correspond to - the `Date`, `Time` and `DateTime` types in the new `cloud.google.com/go/civil` - package. - - Support for query parameters. - - Support deleting a dataset. - - Values from INTEGER columns will now be returned as int64, not int. This - will avoid errors arising from large values on 32-bit systems. -- datastore: - - Nested Go structs encoded as Entity values, instead of a -flattened list of the embedded struct's fields. This means that you may now have twice-nested slices, eg. - ```go - type State struct { - Cities []struct{ - Populations []int - } - } - ``` - See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/79jtrdeuJAg) for -more details. - - Contexts no longer hold namespaces; instead you must set a key's namespace - explicitly. Also, key functions have been changed and renamed. - - The WithNamespace function has been removed. To specify a namespace in a Query, use the Query.Namespace method: - ```go - q := datastore.NewQuery("Kind").Namespace("ns") - ``` - - All the fields of Key are exported. That means you can construct any Key with a struct literal: - ```go - k := &Key{Kind: "Kind", ID: 37, Namespace: "ns"} - ``` - - As a result of the above, the Key methods Kind, ID, d.Name, Parent, SetParent and Namespace have been removed. - - `NewIncompleteKey` has been removed, replaced by `IncompleteKey`. Replace - ```go - NewIncompleteKey(ctx, kind, parent) - ``` - with - ```go - IncompleteKey(kind, parent) - ``` - and if you do use namespaces, make sure you set the namespace on the returned key. - - `NewKey` has been removed, replaced by `NameKey` and `IDKey`. Replace - ```go - NewKey(ctx, kind, name, 0, parent) - NewKey(ctx, kind, "", id, parent) - ``` - with - ```go - NameKey(kind, name, parent) - IDKey(kind, id, parent) - ``` - and if you do use namespaces, make sure you set the namespace on the returned key. - - The `Done` variable has been removed. Replace `datastore.Done` with `iterator.Done`, from the package `google.golang.org/api/iterator`. - - The `Client.Close` method will have a return type of error. It will return the result of closing the underlying gRPC connection. - - See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/hqXtM_4Ix-0) for -more details. - -## v0.4.0 - -- bigquery: - -`NewGCSReference` is now a function, not a method on `Client`. - - `Table.LoaderFrom` now accepts a `ReaderSource`, enabling - loading data into a table from a file or any `io.Reader`. - * Client.Table and Client.OpenTable have been removed. - Replace - ```go - client.OpenTable("project", "dataset", "table") - ``` - with - ```go - client.DatasetInProject("project", "dataset").Table("table") - ``` - - * Client.CreateTable has been removed. - Replace - ```go - client.CreateTable(ctx, "project", "dataset", "table") - ``` - with - ```go - client.DatasetInProject("project", "dataset").Table("table").Create(ctx) - ``` - - * Dataset.ListTables have been replaced with Dataset.Tables. - Replace - ```go - tables, err := ds.ListTables(ctx) - ``` - with - ```go - it := ds.Tables(ctx) - for { - table, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: use table. - } - ``` - - * Client.Read has been replaced with Job.Read, Table.Read and Query.Read. - Replace - ```go - it, err := client.Read(ctx, job) - ``` - with - ```go - it, err := job.Read(ctx) - ``` - and similarly for reading from tables or queries. - - * The iterator returned from the Read methods is now named RowIterator. Its - behavior is closer to the other iterators in these libraries. It no longer - supports the Schema method; see the next item. - Replace - ```go - for it.Next(ctx) { - var vals ValueList - if err := it.Get(&vals); err != nil { - // TODO: Handle error. - } - // TODO: use vals. - } - if err := it.Err(); err != nil { - // TODO: Handle error. - } - ``` - with - ``` - for { - var vals ValueList - err := it.Next(&vals) - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: use vals. - } - ``` - Instead of the `RecordsPerRequest(n)` option, write - ```go - it.PageInfo().MaxSize = n - ``` - Instead of the `StartIndex(i)` option, write - ```go - it.StartIndex = i - ``` - - * ValueLoader.Load now takes a Schema in addition to a slice of Values. - Replace - ```go - func (vl *myValueLoader) Load(v []bigquery.Value) - ``` - with - ```go - func (vl *myValueLoader) Load(v []bigquery.Value, s bigquery.Schema) - ``` - - - * Table.Patch is replace by Table.Update. - Replace - ```go - p := table.Patch() - p.Description("new description") - metadata, err := p.Apply(ctx) - ``` - with - ```go - metadata, err := table.Update(ctx, bigquery.TableMetadataToUpdate{ - Description: "new description", - }) - ``` - - * Client.Copy is replaced by separate methods for each of its four functions. - All options have been replaced by struct fields. - - * To load data from Google Cloud Storage into a table, use Table.LoaderFrom. - - Replace - ```go - client.Copy(ctx, table, gcsRef) - ``` - with - ```go - table.LoaderFrom(gcsRef).Run(ctx) - ``` - Instead of passing options to Copy, set fields on the Loader: - ```go - loader := table.LoaderFrom(gcsRef) - loader.WriteDisposition = bigquery.WriteTruncate - ``` - - * To extract data from a table into Google Cloud Storage, use - Table.ExtractorTo. Set fields on the returned Extractor instead of - passing options. - - Replace - ```go - client.Copy(ctx, gcsRef, table) - ``` - with - ```go - table.ExtractorTo(gcsRef).Run(ctx) - ``` - - * To copy data into a table from one or more other tables, use - Table.CopierFrom. Set fields on the returned Copier instead of passing options. - - Replace - ```go - client.Copy(ctx, dstTable, srcTable) - ``` - with - ```go - dst.Table.CopierFrom(srcTable).Run(ctx) - ``` - - * To start a query job, create a Query and call its Run method. Set fields - on the query instead of passing options. - - Replace - ```go - client.Copy(ctx, table, query) - ``` - with - ```go - query.Run(ctx) - ``` - - * Table.NewUploader has been renamed to Table.Uploader. Instead of options, - configure an Uploader by setting its fields. - Replace - ```go - u := table.NewUploader(bigquery.UploadIgnoreUnknownValues()) - ``` - with - ```go - u := table.NewUploader(bigquery.UploadIgnoreUnknownValues()) - u.IgnoreUnknownValues = true - ``` - -- pubsub: remove `pubsub.Done`. Use `iterator.Done` instead, where `iterator` is the package -`google.golang.org/api/iterator`. - -## v0.3.0 - -- storage: - * AdminClient replaced by methods on Client. - Replace - ```go - adminClient.CreateBucket(ctx, bucketName, attrs) - ``` - with - ```go - client.Bucket(bucketName).Create(ctx, projectID, attrs) - ``` - - * BucketHandle.List replaced by BucketHandle.Objects. - Replace - ```go - for query != nil { - objs, err := bucket.List(d.ctx, query) - if err != nil { ... } - query = objs.Next - for _, obj := range objs.Results { - fmt.Println(obj) - } - } - ``` - with - ```go - iter := bucket.Objects(d.ctx, query) - for { - obj, err := iter.Next() - if err == iterator.Done { - break - } - if err != nil { ... } - fmt.Println(obj) - } - ``` - (The `iterator` package is at `google.golang.org/api/iterator`.) - - Replace `Query.Cursor` with `ObjectIterator.PageInfo().Token`. - - Replace `Query.MaxResults` with `ObjectIterator.PageInfo().MaxSize`. - - - * ObjectHandle.CopyTo replaced by ObjectHandle.CopierFrom. - Replace - ```go - attrs, err := src.CopyTo(ctx, dst, nil) - ``` - with - ```go - attrs, err := dst.CopierFrom(src).Run(ctx) - ``` - - Replace - ```go - attrs, err := src.CopyTo(ctx, dst, &storage.ObjectAttrs{ContextType: "text/html"}) - ``` - with - ```go - c := dst.CopierFrom(src) - c.ContextType = "text/html" - attrs, err := c.Run(ctx) - ``` - - * ObjectHandle.ComposeFrom replaced by ObjectHandle.ComposerFrom. - Replace - ```go - attrs, err := dst.ComposeFrom(ctx, []*storage.ObjectHandle{src1, src2}, nil) - ``` - with - ```go - attrs, err := dst.ComposerFrom(src1, src2).Run(ctx) - ``` - - * ObjectHandle.Update's ObjectAttrs argument replaced by ObjectAttrsToUpdate. - Replace - ```go - attrs, err := obj.Update(ctx, &storage.ObjectAttrs{ContextType: "text/html"}) - ``` - with - ```go - attrs, err := obj.Update(ctx, storage.ObjectAttrsToUpdate{ContextType: "text/html"}) - ``` - - * ObjectHandle.WithConditions replaced by ObjectHandle.If. - Replace - ```go - obj.WithConditions(storage.Generation(gen), storage.IfMetaGenerationMatch(mgen)) - ``` - with - ```go - obj.Generation(gen).If(storage.Conditions{MetagenerationMatch: mgen}) - ``` - - Replace - ```go - obj.WithConditions(storage.IfGenerationMatch(0)) - ``` - with - ```go - obj.If(storage.Conditions{DoesNotExist: true}) - ``` - - * `storage.Done` replaced by `iterator.Done` (from package `google.golang.org/api/iterator`). - -- Package preview/logging deleted. Use logging instead. - -## v0.2.0 - -- Logging client replaced with preview version (see below). - -- New clients for some of Google's Machine Learning APIs: Vision, Speech, and -Natural Language. - -- Preview version of a new [Stackdriver Logging][cloud-logging] client in -[`cloud.google.com/go/preview/logging`](https://godoc.org/cloud.google.com/go/preview/logging). -This client uses gRPC as its transport layer, and supports log reading, sinks -and metrics. It will replace the current client at `cloud.google.com/go/logging` shortly. diff --git a/upstream/vendor/cloud.google.com/go/CONTRIBUTING.md b/upstream/vendor/cloud.google.com/go/CONTRIBUTING.md deleted file mode 100644 index 36d1b275e33..00000000000 --- a/upstream/vendor/cloud.google.com/go/CONTRIBUTING.md +++ /dev/null @@ -1,364 +0,0 @@ -# Contributing - -1. [File an issue](https://github.com/googleapis/google-cloud-go/issues/new/choose). - The issue will be used to discuss the bug or feature and should be created - before sending a PR. - -1. [Install Go](https://golang.org/dl/). - 1. Ensure that your `GOBIN` directory (by default `$(go env GOPATH)/bin`) - is in your `PATH`. - 1. Check it's working by running `go version`. - * If it doesn't work, check the install location, usually - `/usr/local/go`, is on your `PATH`. - -1. Sign one of the -[contributor license agreements](#contributor-license-agreements) below. - -1. Clone the repo: - `git clone https://github.com/googleapis/google-cloud-go` - -1. Change into the checked out source: - `cd google-cloud-go` - -1. Fork the repo. - -1. Set your fork as a remote: - `git remote add fork git@github.com:GITHUB_USERNAME/google-cloud-go.git` - -1. Make changes, commit to your fork. - - Commit messages should follow the - [Conventional Commits Style](https://www.conventionalcommits.org). The scope - portion should always be filled with the name of the package affected by the - changes being made. For example: - ``` - feat(functions): add gophers codelab - ``` - -1. Send a pull request with your changes. - - To minimize friction, consider setting `Allow edits from maintainers` on the - PR, which will enable project committers and automation to update your PR. - -1. A maintainer will review the pull request and make comments. - - Prefer adding additional commits over amending and force-pushing since it can - be difficult to follow code reviews when the commit history changes. - - Commits will be squashed when they're merged. - -## Policy on new dependencies - -While the Go ecosystem is rich with useful modules, in this project we try to -minimize the number of direct dependencies we have on modules that are not -Google-owned. - -Adding new third party dependencies can have the following effects: -* broadens the vulnerability surface -* increases so called "vanity" import routing infrastructure failure points -* increases complexity of our own [`third_party`][] imports - -So if you are contributing, please either contribute the full implementation -directly, or find a Google-owned project that provides the functionality. Of -course, there may be exceptions to this rule, but those should be well defined -and agreed upon by the maintainers ahead of time. - -## Testing - -We test code against two versions of Go, the minimum and maximum versions -supported by our clients. To see which versions these are checkout our -[README](README.md#supported-versions). - -### Integration Tests - -In addition to the unit tests, you may run the integration test suite. These -directions describe setting up your environment to run integration tests for -_all_ packages: note that many of these instructions may be redundant if you -intend only to run integration tests on a single package. - -#### GCP Setup - -To run the integrations tests, creation and configuration of three projects in -the Google Developers Console is required: one specifically for Firestore -integration tests, one specifically for Bigtable integration tests, and another -for all other integration tests. We'll refer to these projects as -"Firestore project", "Bigtable project" and "general project". - -Note: You can skip setting up Bigtable project if you do not plan working on or running a few Bigtable -tests that require a secondary project - -After creating each project, you must [create a service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) -for each project. Ensure the project-level **Owner** -[IAM role](https://console.cloud.google.com/iam-admin/iam/project) role is added to -each service account. During the creation of the service account, you should -download the JSON credential file for use later. - -Next, ensure the following APIs are enabled in the general project: - -- BigQuery API -- BigQuery Data Transfer API -- Cloud Dataproc API -- Cloud Dataproc Control API Private -- Cloud Datastore API -- Cloud Firestore API -- Cloud Key Management Service (KMS) API -- Cloud Natural Language API -- Cloud OS Login API -- Cloud Pub/Sub API -- Cloud Resource Manager API -- Cloud Spanner API -- Cloud Speech API -- Cloud Translation API -- Cloud Video Intelligence API -- Cloud Vision API -- Compute Engine API -- Compute Engine Instance Group Manager API -- Container Registry API -- Firebase Rules API -- Google Cloud APIs -- Google Cloud Deployment Manager V2 API -- Google Cloud SQL -- Google Cloud Storage -- Google Cloud Storage JSON API -- Google Compute Engine Instance Group Updater API -- Google Compute Engine Instance Groups API -- Kubernetes Engine API -- Cloud Error Reporting API -- Pub/Sub Lite API - -Next, create a Datastore database in the general project, and a Firestore -database in the Firestore project. - -Finally, in the general project, create an API key for the translate API: - -- Go to GCP Developer Console. -- Navigate to APIs & Services > Credentials. -- Click Create Credentials > API Key. -- Save this key for use in `GCLOUD_TESTS_API_KEY` as described below. - -#### Local Setup - -Once the three projects are created and configured, set the following environment -variables: - -- `GCLOUD_TESTS_GOLANG_PROJECT_ID`: Developers Console project's ID (e.g. -bamboo-shift-455) for the general project. -- `GCLOUD_TESTS_GOLANG_KEY`: The path to the JSON key file of the general -project's service account. -- `GCLOUD_TESTS_GOLANG_DATASTORE_DATABASES`: Comma separated list of developer's Datastore databases. If not provided, default database i.e. empty string is used. -- `GCLOUD_TESTS_GOLANG_FIRESTORE_PROJECT_ID`: Developers Console project's ID -(e.g. doorway-cliff-677) for the Firestore project. -- `GCLOUD_TESTS_GOLANG_FIRESTORE_DATABASES` : Comma separated list of developer's Firestore databases. If not provided, default database is used. -- `GCLOUD_TESTS_GOLANG_FIRESTORE_KEY`: The path to the JSON key file of the -Firestore project's service account. -- `GCLOUD_TESTS_API_KEY`: API key for using the Translate API created above. -- `GCLOUD_TESTS_GOLANG_SECONDARY_BIGTABLE_PROJECT_ID`: Developers Console project's ID (e.g. doorway-cliff-677) for Bigtable optional secondary project. This can be same as Firestore project or any project other than the general project. -- `GCLOUD_TESTS_BIGTABLE_CLUSTER`: Cluster ID of Bigtable cluster in general project -- `GCLOUD_TESTS_BIGTABLE_PRI_PROJ_SEC_CLUSTER`: Optional. Cluster ID of Bigtable secondary cluster in general project - -As part of the setup that follows, the following variables will be configured: - -- `GCLOUD_TESTS_GOLANG_KEYRING`: The full name of the keyring for the tests, -in the form -"projects/P/locations/L/keyRings/R". The creation of this is described below. -- `GCLOUD_TESTS_BIGTABLE_KEYRING`: The full name of the keyring for the bigtable tests, -in the form -"projects/P/locations/L/keyRings/R". The creation of this is described below. Expected to be single region. -- `GCLOUD_TESTS_GOLANG_ZONE`: Compute Engine zone. - -Install the [gcloud command-line tool][gcloudcli] to your machine and use it to -create some resources used in integration tests. - -From the project's root directory: - -``` sh -# Sets the default project in your env. -$ gcloud config set project $GCLOUD_TESTS_GOLANG_PROJECT_ID - -# Authenticates the gcloud tool with your account. -$ gcloud auth login - -# Create the indexes for all the databases you want to use in the datastore integration tests. -# Use empty string as databaseID or skip database flag for default database. -$ gcloud alpha datastore indexes create --database=your-databaseID-1 --project=$GCLOUD_TESTS_GOLANG_PROJECT_ID testdata/index.yaml - -# Creates a Google Cloud storage bucket with the same name as your test project, -# and with the Cloud Logging service account as owner, for the sink -# integration tests in logging. -$ gsutil mb gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID -$ gsutil acl ch -g cloud-logs@google.com:O gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID - -# Creates a PubSub topic for integration tests of storage notifications. -$ gcloud beta pubsub topics create go-storage-notification-test -# Next, go to the Pub/Sub dashboard in GCP console. Authorize the user -# "service-@gs-project-accounts.iam.gserviceaccount.com" -# as a publisher to that topic. - -# Creates a Spanner instance for the spanner integration tests. -$ gcloud beta spanner instances create go-integration-test --config regional-us-central1 --nodes 10 --description 'Instance for go client test' -# NOTE: Spanner instances are priced by the node-hour, so you may want to -# delete the instance after testing with 'gcloud beta spanner instances delete'. - -$ export MY_KEYRING=some-keyring-name -$ export MY_LOCATION=global -$ export MY_SINGLE_LOCATION=us-central1 -# Creates a KMS keyring, in the same location as the default location for your -# project's buckets. -$ gcloud kms keyrings create $MY_KEYRING --location $MY_LOCATION -# Creates two keys in the keyring, named key1 and key2. -$ gcloud kms keys create key1 --keyring $MY_KEYRING --location $MY_LOCATION --purpose encryption -$ gcloud kms keys create key2 --keyring $MY_KEYRING --location $MY_LOCATION --purpose encryption -# Sets the GCLOUD_TESTS_GOLANG_KEYRING environment variable. -$ export GCLOUD_TESTS_GOLANG_KEYRING=projects/$GCLOUD_TESTS_GOLANG_PROJECT_ID/locations/$MY_LOCATION/keyRings/$MY_KEYRING -# Authorizes Google Cloud Storage to encrypt and decrypt using key1. -$ gsutil kms authorize -p $GCLOUD_TESTS_GOLANG_PROJECT_ID -k $GCLOUD_TESTS_GOLANG_KEYRING/cryptoKeys/key1 - -# Create KMS Key in one region for Bigtable -$ gcloud kms keyrings create $MY_KEYRING --location $MY_SINGLE_LOCATION -$ gcloud kms keys create key1 --keyring $MY_KEYRING --location $MY_SINGLE_LOCATION --purpose encryption -# Sets the GCLOUD_TESTS_BIGTABLE_KEYRING environment variable. -$ export GCLOUD_TESTS_BIGTABLE_KEYRING=projects/$GCLOUD_TESTS_GOLANG_PROJECT_ID/locations/$MY_SINGLE_LOCATION/keyRings/$MY_KEYRING -# Create a service agent, https://cloud.google.com/bigtable/docs/use-cmek#gcloud: -$ gcloud beta services identity create \ - --service=bigtableadmin.googleapis.com \ - --project $GCLOUD_TESTS_GOLANG_PROJECT_ID -# Note the service agent email for the agent created. -$ export SERVICE_AGENT_EMAIL= - -# Authorizes Google Cloud Bigtable to encrypt and decrypt using key1 -$ gcloud kms keys add-iam-policy-binding key1 \ - --keyring $MY_KEYRING \ - --location $MY_SINGLE_LOCATION \ - --role roles/cloudkms.cryptoKeyEncrypterDecrypter \ - --member "serviceAccount:$SERVICE_AGENT_EMAIL" \ - --project $GCLOUD_TESTS_GOLANG_PROJECT_ID -``` - -It may be useful to add exports to your shell initialization for future use. -For instance, in `.zshrc`: - -```sh -#### START GO SDK Test Variables -# Developers Console project's ID (e.g. bamboo-shift-455) for the general project. -export GCLOUD_TESTS_GOLANG_PROJECT_ID=your-project - -# Developers Console project's ID (e.g. bamboo-shift-455) for the Bigtable project. -export GCLOUD_TESTS_GOLANG_SECONDARY_BIGTABLE_PROJECT_ID=your-bigtable-optional-secondary-project - -# The path to the JSON key file of the general project's service account. -export GCLOUD_TESTS_GOLANG_KEY=~/directory/your-project-abcd1234.json - -# Comma separated list of developer's Datastore databases. If not provided, -# default database i.e. empty string is used. -export GCLOUD_TESTS_GOLANG_DATASTORE_DATABASES=your-database-1,your-database-2 - -# Developers Console project's ID (e.g. doorway-cliff-677) for the Firestore project. -export GCLOUD_TESTS_GOLANG_FIRESTORE_PROJECT_ID=your-firestore-project - -# Comma separated list of developer's Firestore databases. If not provided, default database is used. -export GCLOUD_TESTS_GOLANG_FIRESTORE_DATABASES=your-database-1,your-database-2 - -# The path to the JSON key file of the Firestore project's service account. -export GCLOUD_TESTS_GOLANG_FIRESTORE_KEY=~/directory/your-firestore-project-abcd1234.json - -# The full name of the keyring for the tests, in the form "projects/P/locations/L/keyRings/R". -# The creation of this is described below. -export MY_KEYRING=my-golang-sdk-test -export MY_LOCATION=global -export GCLOUD_TESTS_GOLANG_KEYRING=projects/$GCLOUD_TESTS_GOLANG_PROJECT_ID/locations/$MY_LOCATION/keyRings/$MY_KEYRING - -# API key for using the Translate API. -export GCLOUD_TESTS_API_KEY=abcdefghijk123456789 - -# Compute Engine zone. (https://cloud.google.com/compute/docs/regions-zones) -export GCLOUD_TESTS_GOLANG_ZONE=your-chosen-region -#### END GO SDK Test Variables -``` - -#### Running - -Once you've done the necessary setup, you can run the integration tests by -running: - -``` sh -$ go test -v ./... -``` - -Note that the above command will not run the tests in other modules. To run -tests on other modules, first navigate to the appropriate -subdirectory. For instance, to run only the tests for datastore: -``` sh -$ cd datastore -$ go test -v ./... -``` - -#### Replay - -Some packages can record the RPCs during integration tests to a file for -subsequent replay. To record, pass the `-record` flag to `go test`. The -recording will be saved to the _package_`.replay` file. To replay integration -tests from a saved recording, the replay file must be present, the `-short` -flag must be passed to `go test`, and the `GCLOUD_TESTS_GOLANG_ENABLE_REPLAY` -environment variable must have a non-empty value. - -## Contributor License Agreements - -Before we can accept your pull requests you'll need to sign a Contributor -License Agreement (CLA): - -- **If you are an individual writing original source code** and **you own the -intellectual property**, then you'll need to sign an [individual CLA][indvcla]. -- **If you work for a company that wants to allow you to contribute your -work**, then you'll need to sign a [corporate CLA][corpcla]. - -You can sign these electronically (just scroll to the bottom). After that, -we'll be able to accept your pull requests. - -## Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers 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. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org), version 1.2.0, -available at [https://contributor-covenant.org/version/1/2/0/](https://contributor-covenant.org/version/1/2/0/) - -[gcloudcli]: https://developers.google.com/cloud/sdk/gcloud/ -[indvcla]: https://developers.google.com/open-source/cla/individual -[corpcla]: https://developers.google.com/open-source/cla/corporate -[`third_party`]: https://opensource.google/documentation/reference/thirdparty diff --git a/upstream/vendor/cloud.google.com/go/README.md b/upstream/vendor/cloud.google.com/go/README.md deleted file mode 100644 index fc58181fa9b..00000000000 --- a/upstream/vendor/cloud.google.com/go/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# Google Cloud Client Libraries for Go - -[![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go.svg)](https://pkg.go.dev/cloud.google.com/go) - -Go packages for [Google Cloud Platform](https://cloud.google.com) services. - -``` go -import "cloud.google.com/go" -``` - -To install the packages on your system, *do not clone the repo*. Instead: - -1. Change to your project directory: `cd /my/cloud/project` -1. Get the package you want to use. Some products have their own module, so it's - best to `go get` the package(s) you want to use: - -```bash -go get cloud.google.com/go/firestore # Replace with the package you want to use. -``` - -**NOTE:** Some of these packages are under development, and may occasionally -make backwards-incompatible changes. - -## Supported APIs - -For an updated list of all of our released APIs please see our -[reference docs](https://cloud.google.com/go/docs/reference). - -## [Go Versions Supported](#supported-versions) - -Our libraries are compatible with at least the three most recent, major Go -releases. They are currently compatible with: - -- Go 1.22 -- Go 1.21 -- Go 1.20 -- Go 1.19 - -## Authorization - -By default, each API will use [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) -for authorization credentials used in calling the API endpoints. This will allow your -application to run in many environments without requiring explicit configuration. - -```go -client, err := storage.NewClient(ctx) -``` - -To authorize using a -[JSON key file](https://cloud.google.com/iam/docs/managing-service-account-keys), -pass -[`option.WithCredentialsFile`](https://pkg.go.dev/google.golang.org/api/option#WithCredentialsFile) -to the `NewClient` function of the desired package. For example: - -```go -client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/to/keyfile.json")) -``` - -You can exert more control over authorization by using the -[`golang.org/x/oauth2`](https://pkg.go.dev/golang.org/x/oauth2) package to -create an `oauth2.TokenSource`. Then pass -[`option.WithTokenSource`](https://pkg.go.dev/google.golang.org/api/option#WithTokenSource) -to the `NewClient` function: - -```go -tokenSource := ... -client, err := storage.NewClient(ctx, option.WithTokenSource(tokenSource)) -``` - -## Contributing - -Contributions are welcome. Please, see the -[CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md) -document for details. - -Please note that this project is released with a Contributor Code of Conduct. -By participating in this project you agree to abide by its terms. -See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct) -for more information. - -## Links - -- [Go on Google Cloud](https://cloud.google.com/go/home) -- [Getting started with Go on Google Cloud](https://cloud.google.com/go/getting-started) -- [App Engine Quickstart](https://cloud.google.com/appengine/docs/standard/go/quickstart) -- [Cloud Functions Quickstart](https://cloud.google.com/functions/docs/quickstart-go) -- [Cloud Run Quickstart](https://cloud.google.com/run/docs/quickstarts/build-and-deploy#go) diff --git a/upstream/vendor/cloud.google.com/go/RELEASING.md b/upstream/vendor/cloud.google.com/go/RELEASING.md deleted file mode 100644 index 6d0fcf4f9f9..00000000000 --- a/upstream/vendor/cloud.google.com/go/RELEASING.md +++ /dev/null @@ -1,141 +0,0 @@ -# Releasing - -## Determine which module to release - -The Go client libraries have several modules. Each module does not strictly -correspond to a single library - they correspond to trees of directories. If a -file needs to be released, you must release the closest ancestor module. - -To see all modules: - -```bash -$ cat `find . -name go.mod` | grep module -module cloud.google.com/go/pubsub -module cloud.google.com/go/spanner -module cloud.google.com/go -module cloud.google.com/go/bigtable -module cloud.google.com/go/bigquery -module cloud.google.com/go/storage -module cloud.google.com/go/pubsublite -module cloud.google.com/go/firestore -module cloud.google.com/go/logging -module cloud.google.com/go/internal/gapicgen -module cloud.google.com/go/internal/godocfx -module cloud.google.com/go/internal/examples/fake -module cloud.google.com/go/internal/examples/mock -module cloud.google.com/go/datastore -``` - -The `cloud.google.com/go` is the repository root module. Each other module is -a submodule. - -So, if you need to release a change in `bigtable/bttest/inmem.go`, the closest -ancestor module is `cloud.google.com/go/bigtable` - so you should release a new -version of the `cloud.google.com/go/bigtable` submodule. - -If you need to release a change in `asset/apiv1/asset_client.go`, the closest -ancestor module is `cloud.google.com/go` - so you should release a new version -of the `cloud.google.com/go` repository root module. Note: releasing -`cloud.google.com/go` has no impact on any of the submodules, and vice-versa. -They are released entirely independently. - -## Test failures - -If there are any test failures in the Kokoro build, releases are blocked until -the failures have been resolved. - -## How to release - -### Automated Releases (`cloud.google.com/go` and submodules) - -We now use [release-please](https://github.com/googleapis/release-please) to -perform automated releases for `cloud.google.com/go` and all submodules. - -1. If there are changes that have not yet been released, a - [pull request](https://github.com/googleapis/google-cloud-go/pull/2971) will - be automatically opened by release-please - with a title like "chore: release X.Y.Z" (for the root module) or - "chore: release datastore X.Y.Z" (for the datastore submodule), where X.Y.Z - is the next version to be released. Find the desired pull request - [here](https://github.com/googleapis/google-cloud-go/pulls) -1. Check for failures in the - [continuous Kokoro build](http://go/google-cloud-go-continuous). If there are - any failures in the most recent build, address them before proceeding with - the release. (This applies even if the failures are in a different submodule - from the one being released.) -1. Review the release notes. These are automatically generated from the titles - of any merged commits since the previous release. If you would like to edit - them, this can be done by updating the changes in the release PR. -1. To cut a release, approve and merge the pull request. Doing so will - update the `CHANGES.md`, tag the merged commit with the appropriate version, - and draft a GitHub release which will copy the notes from `CHANGES.md`. - -### Manual Release (`cloud.google.com/go`) - -If for whatever reason the automated release process is not working as expected, -here is how to manually cut a release of `cloud.google.com/go`. - -1. Check for failures in the - [continuous Kokoro build](http://go/google-cloud-go-continuous). If there are - any failures in the most recent build, address them before proceeding with - the release. -1. Navigate to `google-cloud-go/` and switch to main. -1. `git pull` -1. Run `git tag -l | grep -v beta | grep -v alpha` to see all existing releases. - The current latest tag `$CV` is the largest tag. It should look something - like `vX.Y.Z` (note: ignore all `LIB/vX.Y.Z` tags - these are tags for a - specific library, not the module root). We'll call the current version `$CV` - and the new version `$NV`. -1. On main, run `git log $CV...` to list all the changes since the last - release. NOTE: You must manually visually parse out changes to submodules [1] - (the `git log` is going to show you things in submodules, which are not going - to be part of your release). -1. Edit `CHANGES.md` to include a summary of the changes. -1. In `internal/version/version.go`, update `const Repo` to today's date with - the format `YYYYMMDD`. -1. In `internal/version` run `go generate`. -1. Commit the changes, ignoring the generated `.go-r` file. Push to your fork, - and create a PR titled `chore: release $NV`. -1. Wait for the PR to be reviewed and merged. Once it's merged, and without - merging any other PRs in the meantime: - a. Switch to main. - b. `git pull` - c. Tag the repo with the next version: `git tag $NV`. - d. Push the tag to origin: - `git push origin $NV` -1. Update [the releases page](https://github.com/googleapis/google-cloud-go/releases) - with the new release, copying the contents of `CHANGES.md`. - -### Manual Releases (submodules) - -If for whatever reason the automated release process is not working as expected, -here is how to manually cut a release of a submodule. - -(these instructions assume we're releasing `cloud.google.com/go/datastore` - adjust accordingly) - -1. Check for failures in the - [continuous Kokoro build](http://go/google-cloud-go-continuous). If there are - any failures in the most recent build, address them before proceeding with - the release. (This applies even if the failures are in a different submodule - from the one being released.) -1. Navigate to `google-cloud-go/` and switch to main. -1. `git pull` -1. Run `git tag -l | grep datastore | grep -v beta | grep -v alpha` to see all - existing releases. The current latest tag `$CV` is the largest tag. It - should look something like `datastore/vX.Y.Z`. We'll call the current version - `$CV` and the new version `$NV`. -1. On main, run `git log $CV.. -- datastore/` to list all the changes to the - submodule directory since the last release. -1. Edit `datastore/CHANGES.md` to include a summary of the changes. -1. In `internal/version` run `go generate`. -1. Commit the changes, ignoring the generated `.go-r` file. Push to your fork, - and create a PR titled `chore(datastore): release $NV`. -1. Wait for the PR to be reviewed and merged. Once it's merged, and without - merging any other PRs in the meantime: - a. Switch to main. - b. `git pull` - c. Tag the repo with the next version: `git tag $NV`. - d. Push the tag to origin: - `git push origin $NV` -1. Update [the releases page](https://github.com/googleapis/google-cloud-go/releases) - with the new release, copying the contents of `datastore/CHANGES.md`. diff --git a/upstream/vendor/cloud.google.com/go/SECURITY.md b/upstream/vendor/cloud.google.com/go/SECURITY.md deleted file mode 100644 index 8b58ae9c01a..00000000000 --- a/upstream/vendor/cloud.google.com/go/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). - -The Google Security Team will respond within 5 working days of your report on g.co/vulnz. - -We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/upstream/vendor/cloud.google.com/go/auth/CHANGES.md b/upstream/vendor/cloud.google.com/go/auth/CHANGES.md deleted file mode 100644 index f1b1a033e88..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/CHANGES.md +++ /dev/null @@ -1,125 +0,0 @@ -# Changelog - -## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.0...auth/v0.4.1) (2024-05-09) - - -### Bug Fixes - -* **auth:** Don't try to detect default creds it opt configured ([#10143](https://github.com/googleapis/google-cloud-go/issues/10143)) ([804632e](https://github.com/googleapis/google-cloud-go/commit/804632e7c5b0b85ff522f7951114485e256eb5bc)) - -## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.3.0...auth/v0.4.0) (2024-05-07) - - -### Features - -* **auth:** Enable client certificates by default ([#10102](https://github.com/googleapis/google-cloud-go/issues/10102)) ([9013e52](https://github.com/googleapis/google-cloud-go/commit/9013e5200a6ec0f178ed91acb255481ffb073a2c)) - - -### Bug Fixes - -* **auth:** Get s2a logic up to date ([#10093](https://github.com/googleapis/google-cloud-go/issues/10093)) ([4fe9ae4](https://github.com/googleapis/google-cloud-go/commit/4fe9ae4b7101af2a5221d6d6b2e77b479305bb06)) - -## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.2...auth/v0.3.0) (2024-04-23) - - -### Features - -* **auth/httptransport:** Add ability to customize transport ([#10023](https://github.com/googleapis/google-cloud-go/issues/10023)) ([72c7f6b](https://github.com/googleapis/google-cloud-go/commit/72c7f6bbec3136cc7a62788fc7186bc33ef6c3b3)), refs [#9812](https://github.com/googleapis/google-cloud-go/issues/9812) [#9814](https://github.com/googleapis/google-cloud-go/issues/9814) - - -### Bug Fixes - -* **auth/credentials:** Error on bad file name if explicitly set ([#10018](https://github.com/googleapis/google-cloud-go/issues/10018)) ([55beaa9](https://github.com/googleapis/google-cloud-go/commit/55beaa993aaf052d8be39766afc6777c3c2a0bdd)), refs [#9809](https://github.com/googleapis/google-cloud-go/issues/9809) - -## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.1...auth/v0.2.2) (2024-04-19) - - -### Bug Fixes - -* **auth:** Add internal opt to skip validation on transports ([#9999](https://github.com/googleapis/google-cloud-go/issues/9999)) ([9e20ef8](https://github.com/googleapis/google-cloud-go/commit/9e20ef89f6287d6bd03b8697d5898dc43b4a77cf)), refs [#9823](https://github.com/googleapis/google-cloud-go/issues/9823) -* **auth:** Set secure flag for gRPC conn pools ([#10002](https://github.com/googleapis/google-cloud-go/issues/10002)) ([14e3956](https://github.com/googleapis/google-cloud-go/commit/14e3956dfd736399731b5ee8d9b178ae085cf7ba)), refs [#9833](https://github.com/googleapis/google-cloud-go/issues/9833) - -## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.0...auth/v0.2.1) (2024-04-18) - - -### Bug Fixes - -* **auth:** Default gRPC token type to Bearer if not set ([#9800](https://github.com/googleapis/google-cloud-go/issues/9800)) ([5284066](https://github.com/googleapis/google-cloud-go/commit/5284066670b6fe65d79089cfe0199c9660f87fc7)) - -## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.1...auth/v0.2.0) (2024-04-15) - -### Breaking Changes - -In the below mentioned commits there were a few large breaking changes since the -last release of the module. - -1. The `Credentials` type has been moved to the root of the module as it is - becoming the core abstraction for the whole module. -2. Because of the above mentioned change many functions that previously - returned a `TokenProvider` now return `Credentials`. Similarly, these - functions have been renamed to be more specific. -3. Most places that used to take an optional `TokenProvider` now accept - `Credentials`. You can make a `Credentials` from a `TokenProvider` using the - constructor found in the `auth` package. -4. The `detect` package has been renamed to `credentials`. With this change some - function signatures were also updated for better readability. -5. Derivative auth flows like `impersonate` and `downscope` have been moved to - be under the new `credentials` package. - -Although these changes are disruptive we think that they are for the best of the -long-term health of the module. We do not expect any more large breaking changes -like these in future revisions, even before 1.0.0. This version will be the -first version of the auth library that our client libraries start to use and -depend on. - -### Features - -* **auth/credentials/externalaccount:** Add default TokenURL ([#9700](https://github.com/googleapis/google-cloud-go/issues/9700)) ([81830e6](https://github.com/googleapis/google-cloud-go/commit/81830e6848ceefd055aa4d08f933d1154455a0f6)) -* **auth:** Add downscope.Options.UniverseDomain ([#9634](https://github.com/googleapis/google-cloud-go/issues/9634)) ([52cf7d7](https://github.com/googleapis/google-cloud-go/commit/52cf7d780853594291c4e34302d618299d1f5a1d)) -* **auth:** Add universe domain to grpctransport and httptransport ([#9663](https://github.com/googleapis/google-cloud-go/issues/9663)) ([67d353b](https://github.com/googleapis/google-cloud-go/commit/67d353beefe3b607c08c891876fbd95ab89e5fe3)), refs [#9670](https://github.com/googleapis/google-cloud-go/issues/9670) -* **auth:** Add UniverseDomain to DetectOptions ([#9536](https://github.com/googleapis/google-cloud-go/issues/9536)) ([3618d3f](https://github.com/googleapis/google-cloud-go/commit/3618d3f7061615c0e189f376c75abc201203b501)) -* **auth:** Make package externalaccount public ([#9633](https://github.com/googleapis/google-cloud-go/issues/9633)) ([a0978d8](https://github.com/googleapis/google-cloud-go/commit/a0978d8e96968399940ebd7d092539772bf9caac)) -* **auth:** Move credentials to base auth package ([#9590](https://github.com/googleapis/google-cloud-go/issues/9590)) ([1a04baf](https://github.com/googleapis/google-cloud-go/commit/1a04bafa83c27342b9308d785645e1e5423ea10d)) -* **auth:** Refactor public sigs to use Credentials ([#9603](https://github.com/googleapis/google-cloud-go/issues/9603)) ([69cb240](https://github.com/googleapis/google-cloud-go/commit/69cb240c530b1f7173a9af2555c19e9a1beb56c5)) - - -### Bug Fixes - -* **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) -* **auth:** Fix uint32 conversion ([9221c7f](https://github.com/googleapis/google-cloud-go/commit/9221c7fa12cef9d5fb7ddc92f41f1d6204971c7b)) -* **auth:** Port sts expires fix ([#9618](https://github.com/googleapis/google-cloud-go/issues/9618)) ([7bec97b](https://github.com/googleapis/google-cloud-go/commit/7bec97b2f51ed3ac4f9b88bf100d301da3f5d1bd)) -* **auth:** Read universe_domain from all credentials files ([#9632](https://github.com/googleapis/google-cloud-go/issues/9632)) ([16efbb5](https://github.com/googleapis/google-cloud-go/commit/16efbb52e39ea4a319e5ee1e95c0e0305b6d9824)) -* **auth:** Remove content-type header from idms get requests ([#9508](https://github.com/googleapis/google-cloud-go/issues/9508)) ([8589f41](https://github.com/googleapis/google-cloud-go/commit/8589f41599d265d7c3d46a3d86c9fab2329cbdd9)) -* **auth:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) - -## [0.1.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.0...auth/v0.1.1) (2024-03-10) - - -### Bug Fixes - -* **auth/impersonate:** Properly send default detect params ([#9529](https://github.com/googleapis/google-cloud-go/issues/9529)) ([5b6b8be](https://github.com/googleapis/google-cloud-go/commit/5b6b8bef577f82707e51f5cc5d258d5bdf90218f)), refs [#9136](https://github.com/googleapis/google-cloud-go/issues/9136) -* **auth:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c)) -* **auth:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) - -## 0.1.0 (2023-10-18) - - -### Features - -* **auth:** Add base auth package ([#8465](https://github.com/googleapis/google-cloud-go/issues/8465)) ([6a45f26](https://github.com/googleapis/google-cloud-go/commit/6a45f26b809b64edae21f312c18d4205f96b180e)) -* **auth:** Add cert support to httptransport ([#8569](https://github.com/googleapis/google-cloud-go/issues/8569)) ([37e3435](https://github.com/googleapis/google-cloud-go/commit/37e3435f8e98595eafab481bdfcb31a4c56fa993)) -* **auth:** Add Credentials.UniverseDomain() ([#8654](https://github.com/googleapis/google-cloud-go/issues/8654)) ([af0aa1e](https://github.com/googleapis/google-cloud-go/commit/af0aa1ed8015bc8fe0dd87a7549ae029107cbdb8)) -* **auth:** Add detect package ([#8491](https://github.com/googleapis/google-cloud-go/issues/8491)) ([d977419](https://github.com/googleapis/google-cloud-go/commit/d977419a3269f6acc193df77a2136a6eb4b4add7)) -* **auth:** Add downscope package ([#8532](https://github.com/googleapis/google-cloud-go/issues/8532)) ([dda9bff](https://github.com/googleapis/google-cloud-go/commit/dda9bff8ec70e6d104901b4105d13dcaa4e2404c)) -* **auth:** Add grpctransport package ([#8625](https://github.com/googleapis/google-cloud-go/issues/8625)) ([69a8347](https://github.com/googleapis/google-cloud-go/commit/69a83470bdcc7ed10c6c36d1abc3b7cfdb8a0ee5)) -* **auth:** Add httptransport package ([#8567](https://github.com/googleapis/google-cloud-go/issues/8567)) ([6898597](https://github.com/googleapis/google-cloud-go/commit/6898597d2ea95d630fcd00fd15c58c75ea843bff)) -* **auth:** Add idtoken package ([#8580](https://github.com/googleapis/google-cloud-go/issues/8580)) ([a79e693](https://github.com/googleapis/google-cloud-go/commit/a79e693e97e4e3e1c6742099af3dbc58866d88fe)) -* **auth:** Add impersonate package ([#8578](https://github.com/googleapis/google-cloud-go/issues/8578)) ([e29ba0c](https://github.com/googleapis/google-cloud-go/commit/e29ba0cb7bd3888ab9e808087027dc5a32474c04)) -* **auth:** Add support for external accounts in detect ([#8508](https://github.com/googleapis/google-cloud-go/issues/8508)) ([62210d5](https://github.com/googleapis/google-cloud-go/commit/62210d5d3e56e8e9f35db8e6ac0defec19582507)) -* **auth:** Port external account changes ([#8697](https://github.com/googleapis/google-cloud-go/issues/8697)) ([5823db5](https://github.com/googleapis/google-cloud-go/commit/5823db5d633069999b58b9131a7f9cd77e82c899)) - - -### Bug Fixes - -* **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) -* **auth:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) diff --git a/upstream/vendor/cloud.google.com/go/auth/README.md b/upstream/vendor/cloud.google.com/go/auth/README.md deleted file mode 100644 index 36de276a074..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# auth - -This module is currently EXPERIMENTAL and under active development. It is not -yet intended to be used. diff --git a/upstream/vendor/cloud.google.com/go/auth/auth.go b/upstream/vendor/cloud.google.com/go/auth/auth.go deleted file mode 100644 index ea7c1b0ad8d..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/auth.go +++ /dev/null @@ -1,476 +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 auth - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "strings" - "sync" - "time" - - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/jwt" -) - -const ( - // Parameter keys for AuthCodeURL method to support PKCE. - codeChallengeKey = "code_challenge" - codeChallengeMethodKey = "code_challenge_method" - - // Parameter key for Exchange method to support PKCE. - codeVerifierKey = "code_verifier" - - // 3 minutes and 45 seconds before expiration. The shortest MDS cache is 4 minutes, - // so we give it 15 seconds to refresh it's cache before attempting to refresh a token. - defaultExpiryDelta = 215 * time.Second - - universeDomainDefault = "googleapis.com" -) - -var ( - defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" - defaultHeader = &jwt.Header{Algorithm: jwt.HeaderAlgRSA256, Type: jwt.HeaderType} - - // for testing - timeNow = time.Now -) - -// TokenProvider specifies an interface for anything that can return a token. -type TokenProvider interface { - // Token returns a Token or an error. - // The Token returned must be safe to use - // concurrently. - // The returned Token must not be modified. - // The context provided must be sent along to any requests that are made in - // the implementing code. - Token(context.Context) (*Token, error) -} - -// Token holds the credential token used to authorized requests. All fields are -// considered read-only. -type Token struct { - // Value is the token used to authorize requests. It is usually an access - // token but may be other types of tokens such as ID tokens in some flows. - Value string - // Type is the type of token Value is. If uninitialized, it should be - // assumed to be a "Bearer" token. - Type string - // Expiry is the time the token is set to expire. - Expiry time.Time - // Metadata may include, but is not limited to, the body of the token - // response returned by the server. - Metadata map[string]interface{} // TODO(codyoss): maybe make a method to flatten metadata to avoid []string for url.Values -} - -// IsValid reports that a [Token] is non-nil, has a [Token.Value], and has not -// expired. A token is considered expired if [Token.Expiry] has passed or will -// pass in the next 10 seconds. -func (t *Token) IsValid() bool { - return t.isValidWithEarlyExpiry(defaultExpiryDelta) -} - -func (t *Token) isValidWithEarlyExpiry(earlyExpiry time.Duration) bool { - if t == nil || t.Value == "" { - return false - } - if t.Expiry.IsZero() { - return true - } - return !t.Expiry.Round(0).Add(-earlyExpiry).Before(timeNow()) -} - -// Credentials holds Google credentials, including -// [Application Default Credentials](https://developers.google.com/accounts/docs/application-default-credentials). -type Credentials struct { - json []byte - projectID CredentialsPropertyProvider - quotaProjectID CredentialsPropertyProvider - // universeDomain is the default service domain for a given Cloud universe. - universeDomain CredentialsPropertyProvider - - TokenProvider -} - -// JSON returns the bytes associated with the the file used to source -// credentials if one was used. -func (c *Credentials) JSON() []byte { - return c.json -} - -// ProjectID returns the associated project ID from the underlying file or -// environment. -func (c *Credentials) ProjectID(ctx context.Context) (string, error) { - if c.projectID == nil { - return internal.GetProjectID(c.json, ""), nil - } - v, err := c.projectID.GetProperty(ctx) - if err != nil { - return "", err - } - return internal.GetProjectID(c.json, v), nil -} - -// QuotaProjectID returns the associated quota project ID from the underlying -// file or environment. -func (c *Credentials) QuotaProjectID(ctx context.Context) (string, error) { - if c.quotaProjectID == nil { - return internal.GetQuotaProject(c.json, ""), nil - } - v, err := c.quotaProjectID.GetProperty(ctx) - if err != nil { - return "", err - } - return internal.GetQuotaProject(c.json, v), nil -} - -// UniverseDomain returns the default service domain for a given Cloud universe. -// The default value is "googleapis.com". -func (c *Credentials) UniverseDomain(ctx context.Context) (string, error) { - if c.universeDomain == nil { - return universeDomainDefault, nil - } - v, err := c.universeDomain.GetProperty(ctx) - if err != nil { - return "", err - } - if v == "" { - return universeDomainDefault, nil - } - return v, err -} - -// CredentialsPropertyProvider provides an implementation to fetch a property -// value for [Credentials]. -type CredentialsPropertyProvider interface { - GetProperty(context.Context) (string, error) -} - -// CredentialsPropertyFunc is a type adapter to allow the use of ordinary -// functions as a [CredentialsPropertyProvider]. -type CredentialsPropertyFunc func(context.Context) (string, error) - -// GetProperty loads the properly value provided the given context. -func (p CredentialsPropertyFunc) GetProperty(ctx context.Context) (string, error) { - return p(ctx) -} - -// CredentialsOptions are used to configure [Credentials]. -type CredentialsOptions struct { - // TokenProvider is a means of sourcing a token for the credentials. Required. - TokenProvider TokenProvider - // JSON is the raw contents of the credentials file if sourced from a file. - JSON []byte - // ProjectIDProvider resolves the project ID associated with the - // credentials. - ProjectIDProvider CredentialsPropertyProvider - // QuotaProjectIDProvider resolves the quota project ID associated with the - // credentials. - QuotaProjectIDProvider CredentialsPropertyProvider - // UniverseDomainProvider resolves the universe domain with the credentials. - UniverseDomainProvider CredentialsPropertyProvider -} - -// NewCredentials returns new [Credentials] from the provided options. Most users -// will want to build this object a function from the -// [cloud.google.com/go/auth/credentials] package. -func NewCredentials(opts *CredentialsOptions) *Credentials { - creds := &Credentials{ - TokenProvider: opts.TokenProvider, - json: opts.JSON, - projectID: opts.ProjectIDProvider, - quotaProjectID: opts.QuotaProjectIDProvider, - universeDomain: opts.UniverseDomainProvider, - } - - return creds -} - -// CachedTokenProviderOptions provided options for configuring a -// CachedTokenProvider. -type CachedTokenProviderOptions struct { - // DisableAutoRefresh makes the TokenProvider always return the same token, - // even if it is expired. - DisableAutoRefresh bool - // ExpireEarly configures the amount of time before a token expires, that it - // should be refreshed. If unset, the default value is 10 seconds. - ExpireEarly time.Duration -} - -func (ctpo *CachedTokenProviderOptions) autoRefresh() bool { - if ctpo == nil { - return true - } - return !ctpo.DisableAutoRefresh -} - -func (ctpo *CachedTokenProviderOptions) expireEarly() time.Duration { - if ctpo == nil { - return defaultExpiryDelta - } - return ctpo.ExpireEarly -} - -// NewCachedTokenProvider wraps a [TokenProvider] to cache the tokens returned -// by the underlying provider. By default it will refresh tokens ten seconds -// before they expire, but this time can be configured with the optional -// options. -func NewCachedTokenProvider(tp TokenProvider, opts *CachedTokenProviderOptions) TokenProvider { - if ctp, ok := tp.(*cachedTokenProvider); ok { - return ctp - } - return &cachedTokenProvider{ - tp: tp, - autoRefresh: opts.autoRefresh(), - expireEarly: opts.expireEarly(), - } -} - -type cachedTokenProvider struct { - tp TokenProvider - autoRefresh bool - expireEarly time.Duration - - mu sync.Mutex - cachedToken *Token -} - -func (c *cachedTokenProvider) Token(ctx context.Context) (*Token, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.cachedToken.IsValid() || !c.autoRefresh { - return c.cachedToken, nil - } - t, err := c.tp.Token(ctx) - if err != nil { - return nil, err - } - c.cachedToken = t - return t, nil -} - -// Error is a error associated with retrieving a [Token]. It can hold useful -// additional details for debugging. -type Error struct { - // Response is the HTTP response associated with error. The body will always - // be already closed and consumed. - Response *http.Response - // Body is the HTTP response body. - Body []byte - // Err is the underlying wrapped error. - Err error - - // code returned in the token response - code string - // description returned in the token response - description string - // uri returned in the token response - uri string -} - -func (e *Error) Error() string { - if e.code != "" { - s := fmt.Sprintf("auth: %q", e.code) - if e.description != "" { - s += fmt.Sprintf(" %q", e.description) - } - if e.uri != "" { - s += fmt.Sprintf(" %q", e.uri) - } - return s - } - return fmt.Sprintf("auth: cannot fetch token: %v\nResponse: %s", e.Response.StatusCode, e.Body) -} - -// Temporary returns true if the error is considered temporary and may be able -// to be retried. -func (e *Error) Temporary() bool { - if e.Response == nil { - return false - } - sc := e.Response.StatusCode - return sc == http.StatusInternalServerError || sc == http.StatusServiceUnavailable || sc == http.StatusRequestTimeout || sc == http.StatusTooManyRequests -} - -func (e *Error) Unwrap() error { - return e.Err -} - -// Style describes how the token endpoint wants to receive the ClientID and -// ClientSecret. -type Style int - -const ( - // StyleUnknown means the value has not been initiated. Sending this in - // a request will cause the token exchange to fail. - StyleUnknown Style = iota - // StyleInParams sends client info in the body of a POST request. - StyleInParams - // StyleInHeader sends client info using Basic Authorization header. - StyleInHeader -) - -// Options2LO is the configuration settings for doing a 2-legged JWT OAuth2 flow. -type Options2LO struct { - // Email is the OAuth2 client ID. This value is set as the "iss" in the - // JWT. - Email string - // PrivateKey contains the contents of an RSA private key or the - // contents of a PEM file that contains a private key. It is used to sign - // the JWT created. - PrivateKey []byte - // TokenURL is th URL the JWT is sent to. Required. - TokenURL string - // PrivateKeyID is the ID of the key used to sign the JWT. It is used as the - // "kid" in the JWT header. Optional. - PrivateKeyID string - // Subject is the used for to impersonate a user. It is used as the "sub" in - // the JWT.m Optional. - Subject string - // Scopes specifies requested permissions for the token. Optional. - Scopes []string - // Expires specifies the lifetime of the token. Optional. - Expires time.Duration - // Audience specifies the "aud" in the JWT. Optional. - Audience string - // PrivateClaims allows specifying any custom claims for the JWT. Optional. - PrivateClaims map[string]interface{} - - // Client is the client to be used to make the underlying token requests. - // Optional. - Client *http.Client - // UseIDToken requests that the token returned be an ID token if one is - // returned from the server. Optional. - UseIDToken bool -} - -func (o *Options2LO) client() *http.Client { - if o.Client != nil { - return o.Client - } - return internal.CloneDefaultClient() -} - -func (o *Options2LO) validate() error { - if o == nil { - return errors.New("auth: options must be provided") - } - if o.Email == "" { - return errors.New("auth: email must be provided") - } - if len(o.PrivateKey) == 0 { - return errors.New("auth: private key must be provided") - } - if o.TokenURL == "" { - return errors.New("auth: token URL must be provided") - } - return nil -} - -// New2LOTokenProvider returns a [TokenProvider] from the provided options. -func New2LOTokenProvider(opts *Options2LO) (TokenProvider, error) { - if err := opts.validate(); err != nil { - return nil, err - } - return tokenProvider2LO{opts: opts, Client: opts.client()}, nil -} - -type tokenProvider2LO struct { - opts *Options2LO - Client *http.Client -} - -func (tp tokenProvider2LO) Token(ctx context.Context) (*Token, error) { - pk, err := internal.ParseKey(tp.opts.PrivateKey) - if err != nil { - return nil, err - } - claimSet := &jwt.Claims{ - Iss: tp.opts.Email, - Scope: strings.Join(tp.opts.Scopes, " "), - Aud: tp.opts.TokenURL, - AdditionalClaims: tp.opts.PrivateClaims, - Sub: tp.opts.Subject, - } - if t := tp.opts.Expires; t > 0 { - claimSet.Exp = time.Now().Add(t).Unix() - } - if aud := tp.opts.Audience; aud != "" { - claimSet.Aud = aud - } - h := *defaultHeader - h.KeyID = tp.opts.PrivateKeyID - payload, err := jwt.EncodeJWS(&h, claimSet, pk) - if err != nil { - return nil, err - } - v := url.Values{} - v.Set("grant_type", defaultGrantType) - v.Set("assertion", payload) - resp, err := tp.Client.PostForm(tp.opts.TokenURL, v) - if err != nil { - return nil, fmt.Errorf("auth: cannot fetch token: %w", err) - } - defer resp.Body.Close() - body, err := internal.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("auth: cannot fetch token: %w", err) - } - if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices { - return nil, &Error{ - Response: resp, - Body: body, - } - } - // tokenRes is the JSON response body. - var tokenRes struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - IDToken string `json:"id_token"` - ExpiresIn int64 `json:"expires_in"` - } - if err := json.Unmarshal(body, &tokenRes); err != nil { - return nil, fmt.Errorf("auth: cannot fetch token: %w", err) - } - token := &Token{ - Value: tokenRes.AccessToken, - Type: tokenRes.TokenType, - } - token.Metadata = make(map[string]interface{}) - json.Unmarshal(body, &token.Metadata) // no error checks for optional fields - - if secs := tokenRes.ExpiresIn; secs > 0 { - token.Expiry = time.Now().Add(time.Duration(secs) * time.Second) - } - if v := tokenRes.IDToken; v != "" { - // decode returned id token to get expiry - claimSet, err := jwt.DecodeJWS(v) - if err != nil { - return nil, fmt.Errorf("auth: error decoding JWT token: %w", err) - } - token.Expiry = time.Unix(claimSet.Exp, 0) - } - if tp.opts.UseIDToken { - if tokenRes.IDToken == "" { - return nil, fmt.Errorf("auth: response doesn't have JWT token") - } - token.Value = tokenRes.IDToken - } - return token, nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/compute.go b/upstream/vendor/cloud.google.com/go/auth/credentials/compute.go deleted file mode 100644 index 6db643837e2..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/compute.go +++ /dev/null @@ -1,85 +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 credentials - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/url" - "strings" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/compute/metadata" -) - -var ( - computeTokenMetadata = map[string]interface{}{ - "auth.google.tokenSource": "compute-metadata", - "auth.google.serviceAccount": "default", - } - computeTokenURI = "instance/service-accounts/default/token" -) - -// computeTokenProvider creates a [cloud.google.com/go/auth.TokenProvider] that -// uses the metadata service to retrieve tokens. -func computeTokenProvider(earlyExpiry time.Duration, scope ...string) auth.TokenProvider { - return auth.NewCachedTokenProvider(computeProvider{scopes: scope}, &auth.CachedTokenProviderOptions{ - ExpireEarly: earlyExpiry, - }) -} - -// computeProvider fetches tokens from the google cloud metadata service. -type computeProvider struct { - scopes []string -} - -type metadataTokenResp struct { - AccessToken string `json:"access_token"` - ExpiresInSec int `json:"expires_in"` - TokenType string `json:"token_type"` -} - -func (cs computeProvider) Token(ctx context.Context) (*auth.Token, error) { - tokenURI, err := url.Parse(computeTokenURI) - if err != nil { - return nil, err - } - if len(cs.scopes) > 0 { - v := url.Values{} - v.Set("scopes", strings.Join(cs.scopes, ",")) - tokenURI.RawQuery = v.Encode() - } - tokenJSON, err := metadata.Get(tokenURI.String()) - if err != nil { - return nil, err - } - var res metadataTokenResp - if err := json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res); err != nil { - return nil, fmt.Errorf("credentials: invalid token JSON from metadata: %w", err) - } - if res.ExpiresInSec == 0 || res.AccessToken == "" { - return nil, errors.New("credentials: incomplete token received from metadata") - } - return &auth.Token{ - Value: res.AccessToken, - Type: res.TokenType, - Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second), - Metadata: computeTokenMetadata, - }, nil - -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/detect.go b/upstream/vendor/cloud.google.com/go/auth/credentials/detect.go deleted file mode 100644 index cb3f44f5873..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/detect.go +++ /dev/null @@ -1,252 +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 credentials - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" - "cloud.google.com/go/compute/metadata" -) - -const ( - // jwtTokenURL is Google's OAuth 2.0 token URL to use with the JWT(2LO) flow. - jwtTokenURL = "https://oauth2.googleapis.com/token" - - // Google's OAuth 2.0 default endpoints. - googleAuthURL = "https://accounts.google.com/o/oauth2/auth" - googleTokenURL = "https://oauth2.googleapis.com/token" - - // Help on default credentials - adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc" -) - -var ( - // for testing - allowOnGCECheck = true -) - -// OnGCE reports whether this process is running in Google Cloud. -func OnGCE() bool { - // TODO(codyoss): once all libs use this auth lib move metadata check here - return allowOnGCECheck && metadata.OnGCE() -} - -// DetectDefault searches for "Application Default Credentials" and returns -// a credential based on the [DetectOptions] provided. -// -// It looks for credentials in the following places, preferring the first -// location found: -// -// - A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS -// environment variable. For workload identity federation, refer to -// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation -// on how to generate the JSON configuration file for on-prem/non-Google -// cloud platforms. -// - A JSON file in a location known to the gcloud command-line tool. On -// Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On -// other systems, $HOME/.config/gcloud/application_default_credentials.json. -// - On Google Compute Engine, Google App Engine standard second generation -// runtimes, and Google App Engine flexible environment, it fetches -// credentials from the metadata server. -func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) { - if err := opts.validate(); err != nil { - return nil, err - } - if opts.CredentialsJSON != nil { - return readCredentialsFileJSON(opts.CredentialsJSON, opts) - } - if opts.CredentialsFile != "" { - return readCredentialsFile(opts.CredentialsFile, opts) - } - if filename := os.Getenv(credsfile.GoogleAppCredsEnvVar); filename != "" { - if creds, err := readCredentialsFile(filename, opts); err == nil { - return creds, err - } - } - - fileName := credsfile.GetWellKnownFileName() - if b, err := os.ReadFile(fileName); err == nil { - return readCredentialsFileJSON(b, opts) - } - - if OnGCE() { - return auth.NewCredentials(&auth.CredentialsOptions{ - TokenProvider: computeTokenProvider(opts.EarlyTokenRefresh, opts.Scopes...), - ProjectIDProvider: auth.CredentialsPropertyFunc(func(context.Context) (string, error) { - return metadata.ProjectID() - }), - UniverseDomainProvider: &internal.ComputeUniverseDomainProvider{}, - }), nil - } - - return nil, fmt.Errorf("credentials: could not find default credentials. See %v for more information", adcSetupURL) -} - -// DetectOptions provides configuration for [DetectDefault]. -type DetectOptions struct { - // Scopes that credentials tokens should have. Example: - // https://www.googleapis.com/auth/cloud-platform. Required if Audience is - // not provided. - Scopes []string - // Audience that credentials tokens should have. Only applicable for 2LO - // flows with service accounts. If specified, scopes should not be provided. - Audience string - // Subject is the user email used for [domain wide delegation](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority). - // Optional. - Subject string - // EarlyTokenRefresh configures how early before a token expires that it - // should be refreshed. - EarlyTokenRefresh time.Duration - // AuthHandlerOptions configures an authorization handler and other options - // for 3LO flows. It is required, and only used, for client credential - // flows. - AuthHandlerOptions *auth.AuthorizationHandlerOptions - // TokenURL allows to set the token endpoint for user credential flows. If - // unset the default value is: https://oauth2.googleapis.com/token. - // Optional. - TokenURL string - // STSAudience is the audience sent to when retrieving an STS token. - // Currently this only used for GDCH auth flow, for which it is required. - STSAudience string - // CredentialsFile overrides detection logic and sources a credential file - // from the provided filepath. If provided, CredentialsJSON must not be. - // Optional. - CredentialsFile string - // CredentialsJSON overrides detection logic and uses the JSON bytes as the - // source for the credential. If provided, CredentialsFile must not be. - // Optional. - CredentialsJSON []byte - // UseSelfSignedJWT directs service account based credentials to create a - // self-signed JWT with the private key found in the file, skipping any - // network requests that would normally be made. Optional. - UseSelfSignedJWT bool - // Client configures the underlying client used to make network requests - // when fetching tokens. Optional. - Client *http.Client - // UniverseDomain is the default service domain for a given Cloud universe. - // The default value is "googleapis.com". This option is ignored for - // authentication flows that do not support universe domain. Optional. - UniverseDomain string -} - -func (o *DetectOptions) validate() error { - if o == nil { - return errors.New("credentials: options must be provided") - } - if len(o.Scopes) > 0 && o.Audience != "" { - return errors.New("credentials: both scopes and audience were provided") - } - if len(o.CredentialsJSON) > 0 && o.CredentialsFile != "" { - return errors.New("credentials: both credentials file and JSON were provided") - } - return nil -} - -func (o *DetectOptions) tokenURL() string { - if o.TokenURL != "" { - return o.TokenURL - } - return googleTokenURL -} - -func (o *DetectOptions) scopes() []string { - scopes := make([]string, len(o.Scopes)) - copy(scopes, o.Scopes) - return scopes -} - -func (o *DetectOptions) client() *http.Client { - if o.Client != nil { - return o.Client - } - return internal.CloneDefaultClient() -} - -func readCredentialsFile(filename string, opts *DetectOptions) (*auth.Credentials, error) { - b, err := os.ReadFile(filename) - if err != nil { - return nil, err - } - return readCredentialsFileJSON(b, opts) -} - -func readCredentialsFileJSON(b []byte, opts *DetectOptions) (*auth.Credentials, error) { - // attempt to parse jsonData as a Google Developers Console client_credentials.json. - config := clientCredConfigFromJSON(b, opts) - if config != nil { - if config.AuthHandlerOpts == nil { - return nil, errors.New("credentials: auth handler must be specified for this credential filetype") - } - tp, err := auth.New3LOTokenProvider(config) - if err != nil { - return nil, err - } - return auth.NewCredentials(&auth.CredentialsOptions{ - TokenProvider: tp, - JSON: b, - }), nil - } - return fileCredentials(b, opts) -} - -func clientCredConfigFromJSON(b []byte, opts *DetectOptions) *auth.Options3LO { - var creds credsfile.ClientCredentialsFile - var c *credsfile.Config3LO - if err := json.Unmarshal(b, &creds); err != nil { - return nil - } - switch { - case creds.Web != nil: - c = creds.Web - case creds.Installed != nil: - c = creds.Installed - default: - return nil - } - if len(c.RedirectURIs) < 1 { - return nil - } - var handleOpts *auth.AuthorizationHandlerOptions - if opts.AuthHandlerOptions != nil { - handleOpts = &auth.AuthorizationHandlerOptions{ - Handler: opts.AuthHandlerOptions.Handler, - State: opts.AuthHandlerOptions.State, - PKCEOpts: opts.AuthHandlerOptions.PKCEOpts, - } - } - return &auth.Options3LO{ - ClientID: c.ClientID, - ClientSecret: c.ClientSecret, - RedirectURL: c.RedirectURIs[0], - Scopes: opts.scopes(), - AuthURL: c.AuthURI, - TokenURL: c.TokenURI, - Client: opts.client(), - EarlyTokenExpiry: opts.EarlyTokenRefresh, - AuthHandlerOpts: handleOpts, - // TODO(codyoss): refactor this out. We need to add in auto-detection - // for this use case. - AuthStyle: auth.StyleInParams, - } -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/doc.go b/upstream/vendor/cloud.google.com/go/auth/credentials/doc.go deleted file mode 100644 index 1dbb2866b91..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/doc.go +++ /dev/null @@ -1,45 +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 credentials provides support for making OAuth2 authorized and -// authenticated HTTP requests to Google APIs. It supports the Web server flow, -// client-side credentials, service accounts, Google Compute Engine service -// accounts, Google App Engine service accounts and workload identity federation -// from non-Google cloud platforms. -// -// A brief overview of the package follows. For more information, please read -// https://developers.google.com/accounts/docs/OAuth2 -// and -// https://developers.google.com/accounts/docs/application-default-credentials. -// For more information on using workload identity federation, refer to -// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation. -// -// # Credentials -// -// The [cloud.google.com/go/auth.Credentials] type represents Google -// credentials, including Application Default Credentials. -// -// Use [DetectDefault] to obtain Application Default Credentials. -// -// Application Default Credentials support workload identity federation to -// access Google Cloud resources from non-Google Cloud platforms including Amazon -// Web Services (AWS), Microsoft Azure or any identity provider that supports -// OpenID Connect (OIDC). Workload identity federation is recommended for -// non-Google Cloud environments as it avoids the need to download, manage, and -// store service account private keys locally. -// -// # Workforce Identity Federation -// -// For more information on this feature see [cloud.google.com/go/auth/credentials/externalaccount]. -package credentials diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/upstream/vendor/cloud.google.com/go/auth/credentials/filetypes.go deleted file mode 100644 index a66e56d70f8..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/filetypes.go +++ /dev/null @@ -1,219 +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 credentials - -import ( - "errors" - "fmt" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials/internal/externalaccount" - "cloud.google.com/go/auth/credentials/internal/externalaccountuser" - "cloud.google.com/go/auth/credentials/internal/gdch" - "cloud.google.com/go/auth/credentials/internal/impersonate" - internalauth "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" -) - -func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { - fileType, err := credsfile.ParseFileType(b) - if err != nil { - return nil, err - } - - var projectID, quotaProjectID, universeDomain string - var tp auth.TokenProvider - switch fileType { - case credsfile.ServiceAccountKey: - f, err := credsfile.ParseServiceAccount(b) - if err != nil { - return nil, err - } - tp, err = handleServiceAccount(f, opts) - if err != nil { - return nil, err - } - projectID = f.ProjectID - universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.UserCredentialsKey: - f, err := credsfile.ParseUserCredentials(b) - if err != nil { - return nil, err - } - tp, err = handleUserCredential(f, opts) - if err != nil { - return nil, err - } - quotaProjectID = f.QuotaProjectID - universeDomain = f.UniverseDomain - case credsfile.ExternalAccountKey: - f, err := credsfile.ParseExternalAccount(b) - if err != nil { - return nil, err - } - tp, err = handleExternalAccount(f, opts) - if err != nil { - return nil, err - } - quotaProjectID = f.QuotaProjectID - universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.ExternalAccountAuthorizedUserKey: - f, err := credsfile.ParseExternalAccountAuthorizedUser(b) - if err != nil { - return nil, err - } - tp, err = handleExternalAccountAuthorizedUser(f, opts) - if err != nil { - return nil, err - } - quotaProjectID = f.QuotaProjectID - universeDomain = f.UniverseDomain - case credsfile.ImpersonatedServiceAccountKey: - f, err := credsfile.ParseImpersonatedServiceAccount(b) - if err != nil { - return nil, err - } - tp, err = handleImpersonatedServiceAccount(f, opts) - if err != nil { - return nil, err - } - universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.GDCHServiceAccountKey: - f, err := credsfile.ParseGDCHServiceAccount(b) - if err != nil { - return nil, err - } - tp, err = handleGDCHServiceAccount(f, opts) - if err != nil { - return nil, err - } - projectID = f.Project - universeDomain = f.UniverseDomain - default: - return nil, fmt.Errorf("credentials: unsupported filetype %q", fileType) - } - return auth.NewCredentials(&auth.CredentialsOptions{ - TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenRefresh, - }), - JSON: b, - ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID), - QuotaProjectIDProvider: internalauth.StaticCredentialsProperty(quotaProjectID), - UniverseDomainProvider: internalauth.StaticCredentialsProperty(universeDomain), - }), nil -} - -// resolveUniverseDomain returns optsUniverseDomain if non-empty, in order to -// support configuring universe-specific credentials in code. Auth flows -// unsupported for universe domain should not use this func, but should instead -// simply set the file universe domain on the credentials. -func resolveUniverseDomain(optsUniverseDomain, fileUniverseDomain string) string { - if optsUniverseDomain != "" { - return optsUniverseDomain - } - return fileUniverseDomain -} - -func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) { - if opts.UseSelfSignedJWT { - return configureSelfSignedJWT(f, opts) - } - opts2LO := &auth.Options2LO{ - Email: f.ClientEmail, - PrivateKey: []byte(f.PrivateKey), - PrivateKeyID: f.PrivateKeyID, - Scopes: opts.scopes(), - TokenURL: f.TokenURL, - Subject: opts.Subject, - } - if opts2LO.TokenURL == "" { - opts2LO.TokenURL = jwtTokenURL - } - return auth.New2LOTokenProvider(opts2LO) -} - -func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions) (auth.TokenProvider, error) { - opts3LO := &auth.Options3LO{ - ClientID: f.ClientID, - ClientSecret: f.ClientSecret, - Scopes: opts.scopes(), - AuthURL: googleAuthURL, - TokenURL: opts.tokenURL(), - AuthStyle: auth.StyleInParams, - EarlyTokenExpiry: opts.EarlyTokenRefresh, - RefreshToken: f.RefreshToken, - } - return auth.New3LOTokenProvider(opts3LO) -} - -func handleExternalAccount(f *credsfile.ExternalAccountFile, opts *DetectOptions) (auth.TokenProvider, error) { - externalOpts := &externalaccount.Options{ - Audience: f.Audience, - SubjectTokenType: f.SubjectTokenType, - TokenURL: f.TokenURL, - TokenInfoURL: f.TokenInfoURL, - ServiceAccountImpersonationURL: f.ServiceAccountImpersonationURL, - ClientSecret: f.ClientSecret, - ClientID: f.ClientID, - CredentialSource: f.CredentialSource, - QuotaProjectID: f.QuotaProjectID, - Scopes: opts.scopes(), - WorkforcePoolUserProject: f.WorkforcePoolUserProject, - Client: opts.client(), - } - if f.ServiceAccountImpersonation != nil { - externalOpts.ServiceAccountImpersonationLifetimeSeconds = f.ServiceAccountImpersonation.TokenLifetimeSeconds - } - return externalaccount.NewTokenProvider(externalOpts) -} - -func handleExternalAccountAuthorizedUser(f *credsfile.ExternalAccountAuthorizedUserFile, opts *DetectOptions) (auth.TokenProvider, error) { - externalOpts := &externalaccountuser.Options{ - Audience: f.Audience, - RefreshToken: f.RefreshToken, - TokenURL: f.TokenURL, - TokenInfoURL: f.TokenInfoURL, - ClientID: f.ClientID, - ClientSecret: f.ClientSecret, - Scopes: opts.scopes(), - Client: opts.client(), - } - return externalaccountuser.NewTokenProvider(externalOpts) -} - -func handleImpersonatedServiceAccount(f *credsfile.ImpersonatedServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) { - if f.ServiceAccountImpersonationURL == "" || f.CredSource == nil { - return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials") - } - - tp, err := fileCredentials(f.CredSource, opts) - if err != nil { - return nil, err - } - return impersonate.NewTokenProvider(&impersonate.Options{ - URL: f.ServiceAccountImpersonationURL, - Scopes: opts.scopes(), - Tp: tp, - Delegates: f.Delegates, - Client: opts.client(), - }) -} - -func handleGDCHServiceAccount(f *credsfile.GDCHServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) { - return gdch.NewTokenProvider(f, &gdch.Options{ - STSAudience: opts.STSAudience, - Client: opts.client(), - }) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go deleted file mode 100644 index d9e1dcddf64..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go +++ /dev/null @@ -1,547 +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 externalaccount - -import ( - "bytes" - "context" - "crypto/hmac" - "crypto/sha256" - "encoding/hex" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "os" - "path" - "sort" - "strings" - "time" - - "cloud.google.com/go/auth/internal" -) - -var ( - // getenv aliases os.Getenv for testing - getenv = os.Getenv -) - -const ( - // AWS Signature Version 4 signing algorithm identifier. - awsAlgorithm = "AWS4-HMAC-SHA256" - - // The termination string for the AWS credential scope value as defined in - // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html - awsRequestType = "aws4_request" - - // The AWS authorization header name for the security session token if available. - awsSecurityTokenHeader = "x-amz-security-token" - - // The name of the header containing the session token for metadata endpoint calls - awsIMDSv2SessionTokenHeader = "X-aws-ec2-metadata-token" - - awsIMDSv2SessionTTLHeader = "X-aws-ec2-metadata-token-ttl-seconds" - - awsIMDSv2SessionTTL = "300" - - // The AWS authorization header name for the auto-generated date. - awsDateHeader = "x-amz-date" - - defaultRegionalCredentialVerificationURL = "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" - - // Supported AWS configuration environment variables. - awsAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID" - awsDefaultRegionEnvVar = "AWS_DEFAULT_REGION" - awsRegionEnvVar = "AWS_REGION" - awsSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY" - awsSessionTokenEnvVar = "AWS_SESSION_TOKEN" - - awsTimeFormatLong = "20060102T150405Z" - awsTimeFormatShort = "20060102" - awsProviderType = "aws" -) - -type awsSubjectProvider struct { - EnvironmentID string - RegionURL string - RegionalCredVerificationURL string - CredVerificationURL string - IMDSv2SessionTokenURL string - TargetResource string - requestSigner *awsRequestSigner - region string - securityCredentialsProvider AwsSecurityCredentialsProvider - reqOpts *RequestOptions - - Client *http.Client -} - -func (sp *awsSubjectProvider) subjectToken(ctx context.Context) (string, error) { - // Set Defaults - if sp.RegionalCredVerificationURL == "" { - sp.RegionalCredVerificationURL = defaultRegionalCredentialVerificationURL - } - if sp.requestSigner == nil { - headers := make(map[string]string) - if sp.shouldUseMetadataServer() { - awsSessionToken, err := sp.getAWSSessionToken(ctx) - if err != nil { - return "", err - } - - if awsSessionToken != "" { - headers[awsIMDSv2SessionTokenHeader] = awsSessionToken - } - } - - awsSecurityCredentials, err := sp.getSecurityCredentials(ctx, headers) - if err != nil { - return "", err - } - if sp.region, err = sp.getRegion(ctx, headers); err != nil { - return "", err - } - sp.requestSigner = &awsRequestSigner{ - RegionName: sp.region, - AwsSecurityCredentials: awsSecurityCredentials, - } - } - - // Generate the signed request to AWS STS GetCallerIdentity API. - // Use the required regional endpoint. Otherwise, the request will fail. - req, err := http.NewRequest("POST", strings.Replace(sp.RegionalCredVerificationURL, "{region}", sp.region, 1), nil) - if err != nil { - return "", err - } - // The full, canonical resource name of the workload identity pool - // provider, with or without the HTTPS prefix. - // Including this header as part of the signature is recommended to - // ensure data integrity. - if sp.TargetResource != "" { - req.Header.Set("x-goog-cloud-target-resource", sp.TargetResource) - } - sp.requestSigner.signRequest(req) - - /* - The GCP STS endpoint expects the headers to be formatted as: - # [ - # {key: 'x-amz-date', value: '...'}, - # {key: 'Authorization', value: '...'}, - # ... - # ] - # And then serialized as: - # quote(json.dumps({ - # url: '...', - # method: 'POST', - # headers: [{key: 'x-amz-date', value: '...'}, ...] - # })) - */ - - awsSignedReq := awsRequest{ - URL: req.URL.String(), - Method: "POST", - } - for headerKey, headerList := range req.Header { - for _, headerValue := range headerList { - awsSignedReq.Headers = append(awsSignedReq.Headers, awsRequestHeader{ - Key: headerKey, - Value: headerValue, - }) - } - } - sort.Slice(awsSignedReq.Headers, func(i, j int) bool { - headerCompare := strings.Compare(awsSignedReq.Headers[i].Key, awsSignedReq.Headers[j].Key) - if headerCompare == 0 { - return strings.Compare(awsSignedReq.Headers[i].Value, awsSignedReq.Headers[j].Value) < 0 - } - return headerCompare < 0 - }) - - result, err := json.Marshal(awsSignedReq) - if err != nil { - return "", err - } - return url.QueryEscape(string(result)), nil -} - -func (sp *awsSubjectProvider) providerType() string { - if sp.securityCredentialsProvider != nil { - return programmaticProviderType - } - return awsProviderType -} - -func (sp *awsSubjectProvider) getAWSSessionToken(ctx context.Context) (string, error) { - if sp.IMDSv2SessionTokenURL == "" { - return "", nil - } - req, err := http.NewRequestWithContext(ctx, "PUT", sp.IMDSv2SessionTokenURL, nil) - if err != nil { - return "", err - } - req.Header.Set(awsIMDSv2SessionTTLHeader, awsIMDSv2SessionTTL) - - resp, err := sp.Client.Do(req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - respBody, err := internal.ReadAll(resp.Body) - if err != nil { - return "", err - } - if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("credentials: unable to retrieve AWS session token: %s", respBody) - } - return string(respBody), nil -} - -func (sp *awsSubjectProvider) getRegion(ctx context.Context, headers map[string]string) (string, error) { - if sp.securityCredentialsProvider != nil { - return sp.securityCredentialsProvider.AwsRegion(ctx, sp.reqOpts) - } - if canRetrieveRegionFromEnvironment() { - if envAwsRegion := getenv(awsRegionEnvVar); envAwsRegion != "" { - return envAwsRegion, nil - } - return getenv(awsDefaultRegionEnvVar), nil - } - - if sp.RegionURL == "" { - return "", errors.New("credentials: unable to determine AWS region") - } - - req, err := http.NewRequestWithContext(ctx, "GET", sp.RegionURL, nil) - if err != nil { - return "", err - } - - for name, value := range headers { - req.Header.Add(name, value) - } - - resp, err := sp.Client.Do(req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - respBody, err := internal.ReadAll(resp.Body) - if err != nil { - return "", err - } - - if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("credentials: unable to retrieve AWS region - %s", respBody) - } - - // This endpoint will return the region in format: us-east-2b. - // Only the us-east-2 part should be used. - bodyLen := len(respBody) - if bodyLen == 0 { - return "", nil - } - return string(respBody[:bodyLen-1]), nil -} - -func (sp *awsSubjectProvider) getSecurityCredentials(ctx context.Context, headers map[string]string) (result *AwsSecurityCredentials, err error) { - if sp.securityCredentialsProvider != nil { - return sp.securityCredentialsProvider.AwsSecurityCredentials(ctx, sp.reqOpts) - } - if canRetrieveSecurityCredentialFromEnvironment() { - return &AwsSecurityCredentials{ - AccessKeyID: getenv(awsAccessKeyIDEnvVar), - SecretAccessKey: getenv(awsSecretAccessKeyEnvVar), - SessionToken: getenv(awsSessionTokenEnvVar), - }, nil - } - - roleName, err := sp.getMetadataRoleName(ctx, headers) - if err != nil { - return - } - credentials, err := sp.getMetadataSecurityCredentials(ctx, roleName, headers) - if err != nil { - return - } - - if credentials.AccessKeyID == "" { - return result, errors.New("credentials: missing AccessKeyId credential") - } - if credentials.SecretAccessKey == "" { - return result, errors.New("credentials: missing SecretAccessKey credential") - } - - return credentials, nil -} - -func (sp *awsSubjectProvider) getMetadataSecurityCredentials(ctx context.Context, roleName string, headers map[string]string) (*AwsSecurityCredentials, error) { - var result *AwsSecurityCredentials - - req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("%s/%s", sp.CredVerificationURL, roleName), nil) - if err != nil { - return result, err - } - for name, value := range headers { - req.Header.Add(name, value) - } - - resp, err := sp.Client.Do(req) - if err != nil { - return result, err - } - defer resp.Body.Close() - - respBody, err := internal.ReadAll(resp.Body) - if err != nil { - return result, err - } - if resp.StatusCode != http.StatusOK { - return result, fmt.Errorf("credentials: unable to retrieve AWS security credentials - %s", respBody) - } - err = json.Unmarshal(respBody, &result) - return result, err -} - -func (sp *awsSubjectProvider) getMetadataRoleName(ctx context.Context, headers map[string]string) (string, error) { - if sp.CredVerificationURL == "" { - return "", errors.New("credentials: unable to determine the AWS metadata server security credentials endpoint") - } - req, err := http.NewRequestWithContext(ctx, "GET", sp.CredVerificationURL, nil) - if err != nil { - return "", err - } - for name, value := range headers { - req.Header.Add(name, value) - } - - resp, err := sp.Client.Do(req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - respBody, err := internal.ReadAll(resp.Body) - if err != nil { - return "", err - } - if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("credentials: unable to retrieve AWS role name - %s", respBody) - } - return string(respBody), nil -} - -// awsRequestSigner is a utility class to sign http requests using a AWS V4 signature. -type awsRequestSigner struct { - RegionName string - AwsSecurityCredentials *AwsSecurityCredentials -} - -// signRequest adds the appropriate headers to an http.Request -// or returns an error if something prevented this. -func (rs *awsRequestSigner) signRequest(req *http.Request) error { - // req is assumed non-nil - signedRequest := cloneRequest(req) - timestamp := Now() - signedRequest.Header.Set("host", requestHost(req)) - if rs.AwsSecurityCredentials.SessionToken != "" { - signedRequest.Header.Set(awsSecurityTokenHeader, rs.AwsSecurityCredentials.SessionToken) - } - if signedRequest.Header.Get("date") == "" { - signedRequest.Header.Set(awsDateHeader, timestamp.Format(awsTimeFormatLong)) - } - authorizationCode, err := rs.generateAuthentication(signedRequest, timestamp) - if err != nil { - return err - } - signedRequest.Header.Set("Authorization", authorizationCode) - req.Header = signedRequest.Header - return nil -} - -func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp time.Time) (string, error) { - canonicalHeaderColumns, canonicalHeaderData := canonicalHeaders(req) - dateStamp := timestamp.Format(awsTimeFormatShort) - serviceName := "" - - if splitHost := strings.Split(requestHost(req), "."); len(splitHost) > 0 { - serviceName = splitHost[0] - } - credentialScope := strings.Join([]string{dateStamp, rs.RegionName, serviceName, awsRequestType}, "/") - requestString, err := canonicalRequest(req, canonicalHeaderColumns, canonicalHeaderData) - if err != nil { - return "", err - } - requestHash, err := getSha256([]byte(requestString)) - if err != nil { - return "", err - } - - stringToSign := strings.Join([]string{awsAlgorithm, timestamp.Format(awsTimeFormatLong), credentialScope, requestHash}, "\n") - signingKey := []byte("AWS4" + rs.AwsSecurityCredentials.SecretAccessKey) - for _, signingInput := range []string{ - dateStamp, rs.RegionName, serviceName, awsRequestType, stringToSign, - } { - signingKey, err = getHmacSha256(signingKey, []byte(signingInput)) - if err != nil { - return "", err - } - } - - return fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", awsAlgorithm, rs.AwsSecurityCredentials.AccessKeyID, credentialScope, canonicalHeaderColumns, hex.EncodeToString(signingKey)), nil -} - -func getSha256(input []byte) (string, error) { - hash := sha256.New() - if _, err := hash.Write(input); err != nil { - return "", err - } - return hex.EncodeToString(hash.Sum(nil)), nil -} - -func getHmacSha256(key, input []byte) ([]byte, error) { - hash := hmac.New(sha256.New, key) - if _, err := hash.Write(input); err != nil { - return nil, err - } - return hash.Sum(nil), nil -} - -func cloneRequest(r *http.Request) *http.Request { - r2 := new(http.Request) - *r2 = *r - if r.Header != nil { - r2.Header = make(http.Header, len(r.Header)) - - // Find total number of values. - headerCount := 0 - for _, headerValues := range r.Header { - headerCount += len(headerValues) - } - copiedHeaders := make([]string, headerCount) // shared backing array for headers' values - - for headerKey, headerValues := range r.Header { - headerCount = copy(copiedHeaders, headerValues) - r2.Header[headerKey] = copiedHeaders[:headerCount:headerCount] - copiedHeaders = copiedHeaders[headerCount:] - } - } - return r2 -} - -func canonicalPath(req *http.Request) string { - result := req.URL.EscapedPath() - if result == "" { - return "/" - } - return path.Clean(result) -} - -func canonicalQuery(req *http.Request) string { - queryValues := req.URL.Query() - for queryKey := range queryValues { - sort.Strings(queryValues[queryKey]) - } - return queryValues.Encode() -} - -func canonicalHeaders(req *http.Request) (string, string) { - // Header keys need to be sorted alphabetically. - var headers []string - lowerCaseHeaders := make(http.Header) - for k, v := range req.Header { - k := strings.ToLower(k) - if _, ok := lowerCaseHeaders[k]; ok { - // include additional values - lowerCaseHeaders[k] = append(lowerCaseHeaders[k], v...) - } else { - headers = append(headers, k) - lowerCaseHeaders[k] = v - } - } - sort.Strings(headers) - - var fullHeaders bytes.Buffer - for _, header := range headers { - headerValue := strings.Join(lowerCaseHeaders[header], ",") - fullHeaders.WriteString(header) - fullHeaders.WriteRune(':') - fullHeaders.WriteString(headerValue) - fullHeaders.WriteRune('\n') - } - - return strings.Join(headers, ";"), fullHeaders.String() -} - -func requestDataHash(req *http.Request) (string, error) { - var requestData []byte - if req.Body != nil { - requestBody, err := req.GetBody() - if err != nil { - return "", err - } - defer requestBody.Close() - - requestData, err = internal.ReadAll(requestBody) - if err != nil { - return "", err - } - } - - return getSha256(requestData) -} - -func requestHost(req *http.Request) string { - if req.Host != "" { - return req.Host - } - return req.URL.Host -} - -func canonicalRequest(req *http.Request, canonicalHeaderColumns, canonicalHeaderData string) (string, error) { - dataHash, err := requestDataHash(req) - if err != nil { - return "", err - } - return fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", req.Method, canonicalPath(req), canonicalQuery(req), canonicalHeaderData, canonicalHeaderColumns, dataHash), nil -} - -type awsRequestHeader struct { - Key string `json:"key"` - Value string `json:"value"` -} - -type awsRequest struct { - URL string `json:"url"` - Method string `json:"method"` - Headers []awsRequestHeader `json:"headers"` -} - -// The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION. Only one is -// required. -func canRetrieveRegionFromEnvironment() bool { - return getenv(awsRegionEnvVar) != "" || getenv(awsDefaultRegionEnvVar) != "" -} - -// Check if both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are available. -func canRetrieveSecurityCredentialFromEnvironment() bool { - return getenv(awsAccessKeyIDEnvVar) != "" && getenv(awsSecretAccessKeyEnvVar) != "" -} - -func (sp *awsSubjectProvider) shouldUseMetadataServer() bool { - return sp.securityCredentialsProvider == nil && (!canRetrieveRegionFromEnvironment() || !canRetrieveSecurityCredentialFromEnvironment()) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go deleted file mode 100644 index d5765c47497..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go +++ /dev/null @@ -1,284 +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 externalaccount - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - "os/exec" - "regexp" - "strings" - "time" - - "cloud.google.com/go/auth/internal" -) - -const ( - executableSupportedMaxVersion = 1 - executableDefaultTimeout = 30 * time.Second - executableSource = "response" - executableProviderType = "executable" - outputFileSource = "output file" - - allowExecutablesEnvVar = "GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES" - - jwtTokenType = "urn:ietf:params:oauth:token-type:jwt" - idTokenType = "urn:ietf:params:oauth:token-type:id_token" - saml2TokenType = "urn:ietf:params:oauth:token-type:saml2" -) - -var ( - serviceAccountImpersonationRE = regexp.MustCompile(`https://iamcredentials..+/v1/projects/-/serviceAccounts/(.*@.*):generateAccessToken`) -) - -type nonCacheableError struct { - message string -} - -func (nce nonCacheableError) Error() string { - return nce.message -} - -// environment is a contract for testing -type environment interface { - existingEnv() []string - getenv(string) string - run(ctx context.Context, command string, env []string) ([]byte, error) - now() time.Time -} - -type runtimeEnvironment struct{} - -func (r runtimeEnvironment) existingEnv() []string { - return os.Environ() -} -func (r runtimeEnvironment) getenv(key string) string { - return os.Getenv(key) -} -func (r runtimeEnvironment) now() time.Time { - return time.Now().UTC() -} - -func (r runtimeEnvironment) run(ctx context.Context, command string, env []string) ([]byte, error) { - splitCommand := strings.Fields(command) - cmd := exec.CommandContext(ctx, splitCommand[0], splitCommand[1:]...) - cmd.Env = env - - var stdout, stderr bytes.Buffer - cmd.Stdout = &stdout - cmd.Stderr = &stderr - - if err := cmd.Run(); err != nil { - if ctx.Err() == context.DeadlineExceeded { - return nil, context.DeadlineExceeded - } - if exitError, ok := err.(*exec.ExitError); ok { - return nil, exitCodeError(exitError) - } - return nil, executableError(err) - } - - bytesStdout := bytes.TrimSpace(stdout.Bytes()) - if len(bytesStdout) > 0 { - return bytesStdout, nil - } - return bytes.TrimSpace(stderr.Bytes()), nil -} - -type executableSubjectProvider struct { - Command string - Timeout time.Duration - OutputFile string - client *http.Client - opts *Options - env environment -} - -type executableResponse struct { - Version int `json:"version,omitempty"` - Success *bool `json:"success,omitempty"` - TokenType string `json:"token_type,omitempty"` - ExpirationTime int64 `json:"expiration_time,omitempty"` - IDToken string `json:"id_token,omitempty"` - SamlResponse string `json:"saml_response,omitempty"` - Code string `json:"code,omitempty"` - Message string `json:"message,omitempty"` -} - -func (sp *executableSubjectProvider) parseSubjectTokenFromSource(response []byte, source string, now int64) (string, error) { - var result executableResponse - if err := json.Unmarshal(response, &result); err != nil { - return "", jsonParsingError(source, string(response)) - } - // Validate - if result.Version == 0 { - return "", missingFieldError(source, "version") - } - if result.Success == nil { - return "", missingFieldError(source, "success") - } - if !*result.Success { - if result.Code == "" || result.Message == "" { - return "", malformedFailureError() - } - return "", userDefinedError(result.Code, result.Message) - } - if result.Version > executableSupportedMaxVersion || result.Version < 0 { - return "", unsupportedVersionError(source, result.Version) - } - if result.ExpirationTime == 0 && sp.OutputFile != "" { - return "", missingFieldError(source, "expiration_time") - } - if result.TokenType == "" { - return "", missingFieldError(source, "token_type") - } - if result.ExpirationTime != 0 && result.ExpirationTime < now { - return "", tokenExpiredError() - } - - switch result.TokenType { - case jwtTokenType, idTokenType: - if result.IDToken == "" { - return "", missingFieldError(source, "id_token") - } - return result.IDToken, nil - case saml2TokenType: - if result.SamlResponse == "" { - return "", missingFieldError(source, "saml_response") - } - return result.SamlResponse, nil - default: - return "", tokenTypeError(source) - } -} - -func (sp *executableSubjectProvider) subjectToken(ctx context.Context) (string, error) { - if token, err := sp.getTokenFromOutputFile(); token != "" || err != nil { - return token, err - } - return sp.getTokenFromExecutableCommand(ctx) -} - -func (sp *executableSubjectProvider) providerType() string { - return executableProviderType -} - -func (sp *executableSubjectProvider) getTokenFromOutputFile() (token string, err error) { - if sp.OutputFile == "" { - // This ExecutableCredentialSource doesn't use an OutputFile. - return "", nil - } - - file, err := os.Open(sp.OutputFile) - if err != nil { - // No OutputFile found. Hasn't been created yet, so skip it. - return "", nil - } - defer file.Close() - - data, err := internal.ReadAll(file) - if err != nil || len(data) == 0 { - // Cachefile exists, but no data found. Get new credential. - return "", nil - } - - token, err = sp.parseSubjectTokenFromSource(data, outputFileSource, sp.env.now().Unix()) - if err != nil { - if _, ok := err.(nonCacheableError); ok { - // If the cached token is expired we need a new token, - // and if the cache contains a failure, we need to try again. - return "", nil - } - - // There was an error in the cached token, and the developer should be aware of it. - return "", err - } - // Token parsing succeeded. Use found token. - return token, nil -} - -func (sp *executableSubjectProvider) executableEnvironment() []string { - result := sp.env.existingEnv() - result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE=%v", sp.opts.Audience)) - result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE=%v", sp.opts.SubjectTokenType)) - result = append(result, "GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE=0") - if sp.opts.ServiceAccountImpersonationURL != "" { - matches := serviceAccountImpersonationRE.FindStringSubmatch(sp.opts.ServiceAccountImpersonationURL) - if matches != nil { - result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL=%v", matches[1])) - } - } - if sp.OutputFile != "" { - result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE=%v", sp.OutputFile)) - } - return result -} - -func (sp *executableSubjectProvider) getTokenFromExecutableCommand(ctx context.Context) (string, error) { - // For security reasons, we need our consumers to set this environment variable to allow executables to be run. - if sp.env.getenv(allowExecutablesEnvVar) != "1" { - return "", errors.New("credentials: executables need to be explicitly allowed (set GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES to '1') to run") - } - - ctx, cancel := context.WithDeadline(ctx, sp.env.now().Add(sp.Timeout)) - defer cancel() - - output, err := sp.env.run(ctx, sp.Command, sp.executableEnvironment()) - if err != nil { - return "", err - } - return sp.parseSubjectTokenFromSource(output, executableSource, sp.env.now().Unix()) -} - -func missingFieldError(source, field string) error { - return fmt.Errorf("credentials: %q missing %q field", source, field) -} - -func jsonParsingError(source, data string) error { - return fmt.Errorf("credentials: unable to parse %q: %v", source, data) -} - -func malformedFailureError() error { - return nonCacheableError{"credentials: response must include `error` and `message` fields when unsuccessful"} -} - -func userDefinedError(code, message string) error { - return nonCacheableError{fmt.Sprintf("credentials: response contains unsuccessful response: (%v) %v", code, message)} -} - -func unsupportedVersionError(source string, version int) error { - return fmt.Errorf("credentials: %v contains unsupported version: %v", source, version) -} - -func tokenExpiredError() error { - return nonCacheableError{"credentials: the token returned by the executable is expired"} -} - -func tokenTypeError(source string) error { - return fmt.Errorf("credentials: %v contains unsupported token type", source) -} - -func exitCodeError(err *exec.ExitError) error { - return fmt.Errorf("credentials: executable command failed with exit code %v: %w", err.ExitCode(), err) -} - -func executableError(err error) error { - return fmt.Errorf("credentials: executable command failed: %w", err) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go deleted file mode 100644 index b19c6edeae5..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go +++ /dev/null @@ -1,367 +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 externalaccount - -import ( - "context" - "errors" - "fmt" - "net/http" - "regexp" - "strconv" - "strings" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials/internal/impersonate" - "cloud.google.com/go/auth/credentials/internal/stsexchange" - "cloud.google.com/go/auth/internal/credsfile" -) - -const ( - timeoutMinimum = 5 * time.Second - timeoutMaximum = 120 * time.Second - - universeDomainPlaceholder = "UNIVERSE_DOMAIN" - defaultTokenURL = "https://sts.UNIVERSE_DOMAIN/v1/token" - defaultUniverseDomain = "googleapis.com" -) - -var ( - // Now aliases time.Now for testing - Now = func() time.Time { - return time.Now().UTC() - } - validWorkforceAudiencePattern *regexp.Regexp = regexp.MustCompile(`//iam\.googleapis\.com/locations/[^/]+/workforcePools/`) -) - -// Options stores the configuration for fetching tokens with external credentials. -type Options struct { - // Audience is the Secure Token Service (STS) audience which contains the resource name for the workload - // identity pool or the workforce pool and the provider identifier in that pool. - Audience string - // SubjectTokenType is the STS token type based on the Oauth2.0 token exchange spec - // e.g. `urn:ietf:params:oauth:token-type:jwt`. - SubjectTokenType string - // TokenURL is the STS token exchange endpoint. - TokenURL string - // TokenInfoURL is the token_info endpoint used to retrieve the account related information ( - // user attributes like account identifier, eg. email, username, uid, etc). This is - // needed for gCloud session account identification. - TokenInfoURL string - // ServiceAccountImpersonationURL is the URL for the service account impersonation request. This is only - // required for workload identity pools when APIs to be accessed have not integrated with UberMint. - ServiceAccountImpersonationURL string - // ServiceAccountImpersonationLifetimeSeconds is the number of seconds the service account impersonation - // token will be valid for. - ServiceAccountImpersonationLifetimeSeconds int - // ClientSecret is currently only required if token_info endpoint also - // needs to be called with the generated GCP access token. When provided, STS will be - // called with additional basic authentication using client_id as username and client_secret as password. - ClientSecret string - // ClientID is only required in conjunction with ClientSecret, as described above. - ClientID string - // CredentialSource contains the necessary information to retrieve the token itself, as well - // as some environmental information. - CredentialSource *credsfile.CredentialSource - // QuotaProjectID is injected by gCloud. If the value is non-empty, the Auth libraries - // will set the x-goog-user-project which overrides the project associated with the credentials. - QuotaProjectID string - // Scopes contains the desired scopes for the returned access token. - Scopes []string - // WorkforcePoolUserProject should be set when it is a workforce pool and - // not a workload identity pool. The underlying principal must still have - // serviceusage.services.use IAM permission to use the project for - // billing/quota. Optional. - WorkforcePoolUserProject string - // UniverseDomain is the default service domain for a given Cloud universe. - // This value will be used in the default STS token URL. The default value - // is "googleapis.com". It will not be used if TokenURL is set. Optional. - UniverseDomain string - // SubjectTokenProvider is an optional token provider for OIDC/SAML - // credentials. One of SubjectTokenProvider, AWSSecurityCredentialProvider - // or CredentialSource must be provided. Optional. - SubjectTokenProvider SubjectTokenProvider - // AwsSecurityCredentialsProvider is an AWS Security Credential provider - // for AWS credentials. One of SubjectTokenProvider, - // AWSSecurityCredentialProvider or CredentialSource must be provided. Optional. - AwsSecurityCredentialsProvider AwsSecurityCredentialsProvider - // Client for token request. - Client *http.Client -} - -// SubjectTokenProvider can be used to supply a subject token to exchange for a -// GCP access token. -type SubjectTokenProvider interface { - // SubjectToken should return a valid subject token or an error. - // The external account token provider does not cache the returned subject - // token, so caching logic should be implemented in the provider to prevent - // multiple requests for the same subject token. - SubjectToken(ctx context.Context, opts *RequestOptions) (string, error) -} - -// RequestOptions contains information about the requested subject token or AWS -// security credentials from the Google external account credential. -type RequestOptions struct { - // Audience is the requested audience for the external account credential. - Audience string - // Subject token type is the requested subject token type for the external - // account credential. Expected values include: - // “urn:ietf:params:oauth:token-type:jwt” - // “urn:ietf:params:oauth:token-type:id-token” - // “urn:ietf:params:oauth:token-type:saml2” - // “urn:ietf:params:aws:token-type:aws4_request” - SubjectTokenType string -} - -// AwsSecurityCredentialsProvider can be used to supply AwsSecurityCredentials -// and an AWS Region to exchange for a GCP access token. -type AwsSecurityCredentialsProvider interface { - // AwsRegion should return the AWS region or an error. - AwsRegion(ctx context.Context, opts *RequestOptions) (string, error) - // GetAwsSecurityCredentials should return a valid set of - // AwsSecurityCredentials or an error. The external account token provider - // does not cache the returned security credentials, so caching logic should - // be implemented in the provider to prevent multiple requests for the - // same security credentials. - AwsSecurityCredentials(ctx context.Context, opts *RequestOptions) (*AwsSecurityCredentials, error) -} - -// AwsSecurityCredentials models AWS security credentials. -type AwsSecurityCredentials struct { - // AccessKeyId is the AWS Access Key ID - Required. - AccessKeyID string `json:"AccessKeyID"` - // SecretAccessKey is the AWS Secret Access Key - Required. - SecretAccessKey string `json:"SecretAccessKey"` - // SessionToken is the AWS Session token. This should be provided for - // temporary AWS security credentials - Optional. - SessionToken string `json:"Token"` -} - -func (o *Options) validate() error { - if o.Audience == "" { - return fmt.Errorf("externalaccount: Audience must be set") - } - if o.SubjectTokenType == "" { - return fmt.Errorf("externalaccount: Subject token type must be set") - } - if o.WorkforcePoolUserProject != "" { - if valid := validWorkforceAudiencePattern.MatchString(o.Audience); !valid { - return fmt.Errorf("externalaccount: workforce_pool_user_project should not be set for non-workforce pool credentials") - } - } - count := 0 - if o.CredentialSource != nil { - count++ - } - if o.SubjectTokenProvider != nil { - count++ - } - if o.AwsSecurityCredentialsProvider != nil { - count++ - } - if count == 0 { - return fmt.Errorf("externalaccount: one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set") - } - if count > 1 { - return fmt.Errorf("externalaccount: only one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set") - } - return nil -} - -// resolveTokenURL sets the default STS token endpoint with the configured -// universe domain. -func (o *Options) resolveTokenURL() { - if o.TokenURL != "" { - return - } else if o.UniverseDomain != "" { - o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, o.UniverseDomain, 1) - } else { - o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, defaultUniverseDomain, 1) - } -} - -// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider] -// configured with the provided options. -func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { - if err := opts.validate(); err != nil { - return nil, err - } - opts.resolveTokenURL() - stp, err := newSubjectTokenProvider(opts) - if err != nil { - return nil, err - } - tp := &tokenProvider{ - client: opts.Client, - opts: opts, - stp: stp, - } - if opts.ServiceAccountImpersonationURL == "" { - return auth.NewCachedTokenProvider(tp, nil), nil - } - - scopes := make([]string, len(opts.Scopes)) - copy(scopes, opts.Scopes) - // needed for impersonation - tp.opts.Scopes = []string{"https://www.googleapis.com/auth/cloud-platform"} - imp, err := impersonate.NewTokenProvider(&impersonate.Options{ - Client: opts.Client, - URL: opts.ServiceAccountImpersonationURL, - Scopes: scopes, - Tp: auth.NewCachedTokenProvider(tp, nil), - TokenLifetimeSeconds: opts.ServiceAccountImpersonationLifetimeSeconds, - }) - if err != nil { - return nil, err - } - return auth.NewCachedTokenProvider(imp, nil), nil -} - -type subjectTokenProvider interface { - subjectToken(ctx context.Context) (string, error) - providerType() string -} - -// tokenProvider is the provider that handles external credentials. It is used to retrieve Tokens. -type tokenProvider struct { - client *http.Client - opts *Options - stp subjectTokenProvider -} - -func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) { - subjectToken, err := tp.stp.subjectToken(ctx) - if err != nil { - return nil, err - } - - stsRequest := &stsexchange.TokenRequest{ - GrantType: stsexchange.GrantType, - Audience: tp.opts.Audience, - Scope: tp.opts.Scopes, - RequestedTokenType: stsexchange.TokenType, - SubjectToken: subjectToken, - SubjectTokenType: tp.opts.SubjectTokenType, - } - header := make(http.Header) - header.Set("Content-Type", "application/x-www-form-urlencoded") - header.Add("x-goog-api-client", getGoogHeaderValue(tp.opts, tp.stp)) - clientAuth := stsexchange.ClientAuthentication{ - AuthStyle: auth.StyleInHeader, - ClientID: tp.opts.ClientID, - ClientSecret: tp.opts.ClientSecret, - } - var options map[string]interface{} - // Do not pass workforce_pool_user_project when client authentication is used. - // The client ID is sufficient for determining the user project. - if tp.opts.WorkforcePoolUserProject != "" && tp.opts.ClientID == "" { - options = map[string]interface{}{ - "userProject": tp.opts.WorkforcePoolUserProject, - } - } - stsResp, err := stsexchange.ExchangeToken(ctx, &stsexchange.Options{ - Client: tp.client, - Endpoint: tp.opts.TokenURL, - Request: stsRequest, - Authentication: clientAuth, - Headers: header, - ExtraOpts: options, - }) - if err != nil { - return nil, err - } - - tok := &auth.Token{ - Value: stsResp.AccessToken, - Type: stsResp.TokenType, - } - // The RFC8693 doesn't define the explicit 0 of "expires_in" field behavior. - if stsResp.ExpiresIn <= 0 { - return nil, fmt.Errorf("credentials: got invalid expiry from security token service") - } - tok.Expiry = Now().Add(time.Duration(stsResp.ExpiresIn) * time.Second) - return tok, nil -} - -// newSubjectTokenProvider determines the type of credsfile.CredentialSource needed to create a -// subjectTokenProvider -func newSubjectTokenProvider(o *Options) (subjectTokenProvider, error) { - reqOpts := &RequestOptions{Audience: o.Audience, SubjectTokenType: o.SubjectTokenType} - if o.AwsSecurityCredentialsProvider != nil { - return &awsSubjectProvider{ - securityCredentialsProvider: o.AwsSecurityCredentialsProvider, - TargetResource: o.Audience, - reqOpts: reqOpts, - }, nil - } else if o.SubjectTokenProvider != nil { - return &programmaticProvider{stp: o.SubjectTokenProvider, opts: reqOpts}, nil - } else if len(o.CredentialSource.EnvironmentID) > 3 && o.CredentialSource.EnvironmentID[:3] == "aws" { - if awsVersion, err := strconv.Atoi(o.CredentialSource.EnvironmentID[3:]); err == nil { - if awsVersion != 1 { - return nil, fmt.Errorf("credentials: aws version '%d' is not supported in the current build", awsVersion) - } - - awsProvider := &awsSubjectProvider{ - EnvironmentID: o.CredentialSource.EnvironmentID, - RegionURL: o.CredentialSource.RegionURL, - RegionalCredVerificationURL: o.CredentialSource.RegionalCredVerificationURL, - CredVerificationURL: o.CredentialSource.URL, - TargetResource: o.Audience, - Client: o.Client, - } - if o.CredentialSource.IMDSv2SessionTokenURL != "" { - awsProvider.IMDSv2SessionTokenURL = o.CredentialSource.IMDSv2SessionTokenURL - } - - return awsProvider, nil - } - } else if o.CredentialSource.File != "" { - return &fileSubjectProvider{File: o.CredentialSource.File, Format: o.CredentialSource.Format}, nil - } else if o.CredentialSource.URL != "" { - return &urlSubjectProvider{URL: o.CredentialSource.URL, Headers: o.CredentialSource.Headers, Format: o.CredentialSource.Format, Client: o.Client}, nil - } else if o.CredentialSource.Executable != nil { - ec := o.CredentialSource.Executable - if ec.Command == "" { - return nil, errors.New("credentials: missing `command` field — executable command must be provided") - } - - execProvider := &executableSubjectProvider{} - execProvider.Command = ec.Command - if ec.TimeoutMillis == 0 { - execProvider.Timeout = executableDefaultTimeout - } else { - execProvider.Timeout = time.Duration(ec.TimeoutMillis) * time.Millisecond - if execProvider.Timeout < timeoutMinimum || execProvider.Timeout > timeoutMaximum { - return nil, fmt.Errorf("credentials: invalid `timeout_millis` field — executable timeout must be between %v and %v seconds", timeoutMinimum.Seconds(), timeoutMaximum.Seconds()) - } - } - execProvider.OutputFile = ec.OutputFile - execProvider.client = o.Client - execProvider.opts = o - execProvider.env = runtimeEnvironment{} - return execProvider, nil - } - return nil, errors.New("credentials: unable to parse credential source") -} - -func getGoogHeaderValue(conf *Options, p subjectTokenProvider) string { - return fmt.Sprintf("gl-go/%s auth/%s google-byoid-sdk source/%s sa-impersonation/%t config-lifetime/%t", - goVersion(), - "unknown", - p.providerType(), - conf.ServiceAccountImpersonationURL != "", - conf.ServiceAccountImpersonationLifetimeSeconds != 0) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go deleted file mode 100644 index 8186939fe1d..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go +++ /dev/null @@ -1,78 +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 externalaccount - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "os" - - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" -) - -const ( - fileProviderType = "file" -) - -type fileSubjectProvider struct { - File string - Format *credsfile.Format -} - -func (sp *fileSubjectProvider) subjectToken(context.Context) (string, error) { - tokenFile, err := os.Open(sp.File) - if err != nil { - return "", fmt.Errorf("credentials: failed to open credential file %q: %w", sp.File, err) - } - defer tokenFile.Close() - tokenBytes, err := internal.ReadAll(tokenFile) - if err != nil { - return "", fmt.Errorf("credentials: failed to read credential file: %w", err) - } - tokenBytes = bytes.TrimSpace(tokenBytes) - - if sp.Format == nil { - return string(tokenBytes), nil - } - switch sp.Format.Type { - case fileTypeJSON: - jsonData := make(map[string]interface{}) - err = json.Unmarshal(tokenBytes, &jsonData) - if err != nil { - return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err) - } - val, ok := jsonData[sp.Format.SubjectTokenFieldName] - if !ok { - return "", errors.New("credentials: provided subject_token_field_name not found in credentials") - } - token, ok := val.(string) - if !ok { - return "", errors.New("credentials: improperly formatted subject token") - } - return token, nil - case fileTypeText: - return string(tokenBytes), nil - default: - return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type) - } -} - -func (sp *fileSubjectProvider) providerType() string { - return fileProviderType -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go deleted file mode 100644 index 8e4b4379b41..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go +++ /dev/null @@ -1,74 +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 externalaccount - -import ( - "runtime" - "strings" - "unicode" -) - -var ( - // version is a package internal global variable for testing purposes. - version = runtime.Version -) - -// versionUnknown is only used when the runtime version cannot be determined. -const versionUnknown = "UNKNOWN" - -// goVersion returns a Go runtime version derived from the runtime environment -// that is modified to be suitable for reporting in a header, meaning it has no -// whitespace. If it is unable to determine the Go runtime version, it returns -// versionUnknown. -func goVersion() string { - const develPrefix = "devel +" - - s := version() - if strings.HasPrefix(s, develPrefix) { - s = s[len(develPrefix):] - if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { - s = s[:p] - } - return s - } else if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { - s = s[:p] - } - - notSemverRune := func(r rune) bool { - return !strings.ContainsRune("0123456789.", r) - } - - if strings.HasPrefix(s, "go1") { - s = s[2:] - var prerelease string - if p := strings.IndexFunc(s, notSemverRune); p >= 0 { - s, prerelease = s[:p], s[p:] - } - if strings.HasSuffix(s, ".") { - s += "0" - } else if strings.Count(s, ".") < 2 { - s += ".0" - } - if prerelease != "" { - // Some release candidates already have a dash in them. - if !strings.HasPrefix(prerelease, "-") { - prerelease = "-" + prerelease - } - s += prerelease - } - return s - } - return versionUnknown -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go deleted file mode 100644 index be3c87351f7..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 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 externalaccount - -import "context" - -type programmaticProvider struct { - opts *RequestOptions - stp SubjectTokenProvider -} - -func (pp *programmaticProvider) providerType() string { - return programmaticProviderType -} - -func (pp *programmaticProvider) subjectToken(ctx context.Context) (string, error) { - return pp.stp.SubjectToken(ctx, pp.opts) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go deleted file mode 100644 index 22b8af1c11b..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go +++ /dev/null @@ -1,93 +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 externalaccount - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" -) - -const ( - fileTypeText = "text" - fileTypeJSON = "json" - urlProviderType = "url" - programmaticProviderType = "programmatic" -) - -type urlSubjectProvider struct { - URL string - Headers map[string]string - Format *credsfile.Format - Client *http.Client -} - -func (sp *urlSubjectProvider) subjectToken(ctx context.Context) (string, error) { - req, err := http.NewRequestWithContext(ctx, "GET", sp.URL, nil) - if err != nil { - return "", fmt.Errorf("credentials: HTTP request for URL-sourced credential failed: %w", err) - } - - for key, val := range sp.Headers { - req.Header.Add(key, val) - } - resp, err := sp.Client.Do(req) - if err != nil { - return "", fmt.Errorf("credentials: invalid response when retrieving subject token: %w", err) - } - defer resp.Body.Close() - - respBody, err := internal.ReadAll(resp.Body) - if err != nil { - return "", fmt.Errorf("credentials: invalid body in subject token URL query: %w", err) - } - if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices { - return "", fmt.Errorf("credentials: status code %d: %s", c, respBody) - } - - if sp.Format == nil { - return string(respBody), nil - } - switch sp.Format.Type { - case "json": - jsonData := make(map[string]interface{}) - err = json.Unmarshal(respBody, &jsonData) - if err != nil { - return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err) - } - val, ok := jsonData[sp.Format.SubjectTokenFieldName] - if !ok { - return "", errors.New("credentials: provided subject_token_field_name not found in credentials") - } - token, ok := val.(string) - if !ok { - return "", errors.New("credentials: improperly formatted subject token") - } - return token, nil - case fileTypeText: - return string(respBody), nil - default: - return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type) - } -} - -func (sp *urlSubjectProvider) providerType() string { - return urlProviderType -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go deleted file mode 100644 index 0d788547987..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go +++ /dev/null @@ -1,110 +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 externalaccountuser - -import ( - "context" - "errors" - "net/http" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials/internal/stsexchange" - "cloud.google.com/go/auth/internal" -) - -// Options stores the configuration for fetching tokens with external authorized -// user credentials. -type Options struct { - // Audience is the Secure Token Service (STS) audience which contains the - // resource name for the workforce pool and the provider identifier in that - // pool. - Audience string - // RefreshToken is the OAuth 2.0 refresh token. - RefreshToken string - // TokenURL is the STS token exchange endpoint for refresh. - TokenURL string - // TokenInfoURL is the STS endpoint URL for token introspection. Optional. - TokenInfoURL string - // ClientID is only required in conjunction with ClientSecret, as described - // below. - ClientID string - // ClientSecret is currently only required if token_info endpoint also needs - // to be called with the generated a cloud access token. When provided, STS - // will be called with additional basic authentication using client_id as - // username and client_secret as password. - ClientSecret string - // Scopes contains the desired scopes for the returned access token. - Scopes []string - - // Client for token request. - Client *http.Client -} - -func (c *Options) validate() bool { - return c.ClientID != "" && c.ClientSecret != "" && c.RefreshToken != "" && c.TokenURL != "" -} - -// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider] -// configured with the provided options. -func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { - if !opts.validate() { - return nil, errors.New("credentials: invalid external_account_authorized_user configuration") - } - - tp := &tokenProvider{ - o: opts, - } - return auth.NewCachedTokenProvider(tp, nil), nil -} - -type tokenProvider struct { - o *Options -} - -func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) { - opts := tp.o - - clientAuth := stsexchange.ClientAuthentication{ - AuthStyle: auth.StyleInHeader, - ClientID: opts.ClientID, - ClientSecret: opts.ClientSecret, - } - headers := make(http.Header) - headers.Set("Content-Type", "application/x-www-form-urlencoded") - stsResponse, err := stsexchange.RefreshAccessToken(ctx, &stsexchange.Options{ - Client: opts.Client, - Endpoint: opts.TokenURL, - RefreshToken: opts.RefreshToken, - Authentication: clientAuth, - Headers: headers, - }) - if err != nil { - return nil, err - } - if stsResponse.ExpiresIn < 0 { - return nil, errors.New("credentials: invalid expiry from security token service") - } - - // guarded by the wrapping with CachedTokenProvider - if stsResponse.RefreshToken != "" { - opts.RefreshToken = stsResponse.RefreshToken - } - return &auth.Token{ - Value: stsResponse.AccessToken, - Expiry: time.Now().UTC().Add(time.Duration(stsResponse.ExpiresIn) * time.Second), - Type: internal.TokenTypeBearer, - }, nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go deleted file mode 100644 index 467edb9088e..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go +++ /dev/null @@ -1,182 +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 gdch - -import ( - "context" - "crypto/rsa" - "crypto/tls" - "crypto/x509" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "os" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" - "cloud.google.com/go/auth/internal/jwt" -) - -const ( - // GrantType is the grant type for the token request. - GrantType = "urn:ietf:params:oauth:token-type:token-exchange" - requestTokenType = "urn:ietf:params:oauth:token-type:access_token" - subjectTokenType = "urn:k8s:params:oauth:token-type:serviceaccount" -) - -var ( - gdchSupportFormatVersions map[string]bool = map[string]bool{ - "1": true, - } -) - -// Options for [NewTokenProvider]. -type Options struct { - STSAudience string - Client *http.Client -} - -// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider] from a -// GDCH cred file. -func NewTokenProvider(f *credsfile.GDCHServiceAccountFile, o *Options) (auth.TokenProvider, error) { - if !gdchSupportFormatVersions[f.FormatVersion] { - return nil, fmt.Errorf("credentials: unsupported gdch_service_account format %q", f.FormatVersion) - } - if o.STSAudience == "" { - return nil, errors.New("credentials: STSAudience must be set for the GDCH auth flows") - } - pk, err := internal.ParseKey([]byte(f.PrivateKey)) - if err != nil { - return nil, err - } - certPool, err := loadCertPool(f.CertPath) - if err != nil { - return nil, err - } - - tp := gdchProvider{ - serviceIdentity: fmt.Sprintf("system:serviceaccount:%s:%s", f.Project, f.Name), - tokenURL: f.TokenURL, - aud: o.STSAudience, - pk: pk, - pkID: f.PrivateKeyID, - certPool: certPool, - client: o.Client, - } - return tp, nil -} - -func loadCertPool(path string) (*x509.CertPool, error) { - pool := x509.NewCertPool() - pem, err := os.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("credentials: failed to read certificate: %w", err) - } - pool.AppendCertsFromPEM(pem) - return pool, nil -} - -type gdchProvider struct { - serviceIdentity string - tokenURL string - aud string - pk *rsa.PrivateKey - pkID string - certPool *x509.CertPool - - client *http.Client -} - -func (g gdchProvider) Token(ctx context.Context) (*auth.Token, error) { - addCertToTransport(g.client, g.certPool) - iat := time.Now() - exp := iat.Add(time.Hour) - claims := jwt.Claims{ - Iss: g.serviceIdentity, - Sub: g.serviceIdentity, - Aud: g.tokenURL, - Iat: iat.Unix(), - Exp: exp.Unix(), - } - h := jwt.Header{ - Algorithm: jwt.HeaderAlgRSA256, - Type: jwt.HeaderType, - KeyID: string(g.pkID), - } - payload, err := jwt.EncodeJWS(&h, &claims, g.pk) - if err != nil { - return nil, err - } - v := url.Values{} - v.Set("grant_type", GrantType) - v.Set("audience", g.aud) - v.Set("requested_token_type", requestTokenType) - v.Set("subject_token", payload) - v.Set("subject_token_type", subjectTokenType) - resp, err := g.client.PostForm(g.tokenURL, v) - if err != nil { - return nil, fmt.Errorf("credentials: cannot fetch token: %w", err) - } - defer resp.Body.Close() - body, err := internal.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("credentials: cannot fetch token: %w", err) - } - if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices { - return nil, &auth.Error{ - Response: resp, - Body: body, - } - } - - var tokenRes struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresIn int64 `json:"expires_in"` // relative seconds from now - } - if err := json.Unmarshal(body, &tokenRes); err != nil { - return nil, fmt.Errorf("credentials: cannot fetch token: %w", err) - } - token := &auth.Token{ - Value: tokenRes.AccessToken, - Type: tokenRes.TokenType, - } - raw := make(map[string]interface{}) - json.Unmarshal(body, &raw) // no error checks for optional fields - token.Metadata = raw - - if secs := tokenRes.ExpiresIn; secs > 0 { - token.Expiry = time.Now().Add(time.Duration(secs) * time.Second) - } - return token, nil -} - -// addCertToTransport makes a best effort attempt at adding in the cert info to -// the client. It tries to keep all configured transport settings if the -// underlying transport is an http.Transport. Or else it overwrites the -// transport with defaults adding in the certs. -func addCertToTransport(hc *http.Client, certPool *x509.CertPool) { - trans, ok := hc.Transport.(*http.Transport) - if !ok { - trans = http.DefaultTransport.(*http.Transport).Clone() - } - trans.TLSClientConfig = &tls.Config{ - RootCAs: certPool, - } -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go deleted file mode 100644 index 3ceab873b8e..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go +++ /dev/null @@ -1,151 +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 impersonate - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/internal" -) - -const ( - defaultTokenLifetime = "3600s" - authHeaderKey = "Authorization" -) - -// generateAccesstokenReq is used for service account impersonation -type generateAccessTokenReq struct { - Delegates []string `json:"delegates,omitempty"` - Lifetime string `json:"lifetime,omitempty"` - Scope []string `json:"scope,omitempty"` -} - -type impersonateTokenResponse struct { - AccessToken string `json:"accessToken"` - ExpireTime string `json:"expireTime"` -} - -// NewTokenProvider uses a source credential, stored in Ts, to request an access token to the provided URL. -// Scopes can be defined when the access token is requested. -func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { - if err := opts.validate(); err != nil { - return nil, err - } - return opts, nil -} - -// Options for [NewTokenProvider]. -type Options struct { - // Tp is the source credential used to generate a token on the - // impersonated service account. Required. - Tp auth.TokenProvider - - // URL is the endpoint to call to generate a token - // on behalf of the service account. Required. - URL string - // Scopes that the impersonated credential should have. Required. - Scopes []string - // Delegates are the service account email addresses in a delegation chain. - // Each service account must be granted roles/iam.serviceAccountTokenCreator - // on the next service account in the chain. Optional. - Delegates []string - // TokenLifetimeSeconds is the number of seconds the impersonation token will - // be valid for. Defaults to 1 hour if unset. Optional. - TokenLifetimeSeconds int - // Client configures the underlying client used to make network requests - // when fetching tokens. Required. - Client *http.Client -} - -func (o *Options) validate() error { - if o.Tp == nil { - return errors.New("credentials: missing required 'source_credentials' field in impersonated credentials") - } - if o.URL == "" { - return errors.New("credentials: missing required 'service_account_impersonation_url' field in impersonated credentials") - } - return nil -} - -// Token performs the exchange to get a temporary service account token to allow access to GCP. -func (o *Options) Token(ctx context.Context) (*auth.Token, error) { - lifetime := defaultTokenLifetime - if o.TokenLifetimeSeconds != 0 { - lifetime = fmt.Sprintf("%ds", o.TokenLifetimeSeconds) - } - reqBody := generateAccessTokenReq{ - Lifetime: lifetime, - Scope: o.Scopes, - Delegates: o.Delegates, - } - b, err := json.Marshal(reqBody) - if err != nil { - return nil, fmt.Errorf("credentials: unable to marshal request: %w", err) - } - req, err := http.NewRequestWithContext(ctx, "POST", o.URL, bytes.NewReader(b)) - if err != nil { - return nil, fmt.Errorf("credentials: unable to create impersonation request: %w", err) - } - req.Header.Set("Content-Type", "application/json") - if err := setAuthHeader(ctx, o.Tp, req); err != nil { - return nil, err - } - resp, err := o.Client.Do(req) - if err != nil { - return nil, fmt.Errorf("credentials: unable to generate access token: %w", err) - } - defer resp.Body.Close() - body, err := internal.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("credentials: unable to read body: %w", err) - } - if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices { - return nil, fmt.Errorf("credentials: status code %d: %s", c, body) - } - - var accessTokenResp impersonateTokenResponse - if err := json.Unmarshal(body, &accessTokenResp); err != nil { - return nil, fmt.Errorf("credentials: unable to parse response: %w", err) - } - expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime) - if err != nil { - return nil, fmt.Errorf("credentials: unable to parse expiry: %w", err) - } - return &auth.Token{ - Value: accessTokenResp.AccessToken, - Expiry: expiry, - Type: internal.TokenTypeBearer, - }, nil -} - -func setAuthHeader(ctx context.Context, tp auth.TokenProvider, r *http.Request) error { - t, err := tp.Token(ctx) - if err != nil { - return err - } - typ := t.Type - if typ == "" { - typ = internal.TokenTypeBearer - } - r.Header.Set(authHeaderKey, typ+" "+t.Value) - return nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go b/upstream/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go deleted file mode 100644 index f70e0aef48f..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go +++ /dev/null @@ -1,167 +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 stsexchange - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "net/http" - "net/url" - "strconv" - "strings" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/internal" -) - -const ( - // GrantType for a sts exchange. - GrantType = "urn:ietf:params:oauth:grant-type:token-exchange" - // TokenType for a sts exchange. - TokenType = "urn:ietf:params:oauth:token-type:access_token" - - jwtTokenType = "urn:ietf:params:oauth:token-type:jwt" -) - -// Options stores the configuration for making an sts exchange request. -type Options struct { - Client *http.Client - Endpoint string - Request *TokenRequest - Authentication ClientAuthentication - Headers http.Header - // ExtraOpts are optional fields marshalled into the `options` field of the - // request body. - ExtraOpts map[string]interface{} - RefreshToken string -} - -// RefreshAccessToken performs the token exchange using a refresh token flow. -func RefreshAccessToken(ctx context.Context, opts *Options) (*TokenResponse, error) { - data := url.Values{} - data.Set("grant_type", "refresh_token") - data.Set("refresh_token", opts.RefreshToken) - return doRequest(ctx, opts, data) -} - -// ExchangeToken performs an oauth2 token exchange with the provided endpoint. -func ExchangeToken(ctx context.Context, opts *Options) (*TokenResponse, error) { - data := url.Values{} - data.Set("audience", opts.Request.Audience) - data.Set("grant_type", GrantType) - data.Set("requested_token_type", TokenType) - data.Set("subject_token_type", opts.Request.SubjectTokenType) - data.Set("subject_token", opts.Request.SubjectToken) - data.Set("scope", strings.Join(opts.Request.Scope, " ")) - if opts.ExtraOpts != nil { - opts, err := json.Marshal(opts.ExtraOpts) - if err != nil { - return nil, fmt.Errorf("credentials: failed to marshal additional options: %w", err) - } - data.Set("options", string(opts)) - } - return doRequest(ctx, opts, data) -} - -func doRequest(ctx context.Context, opts *Options, data url.Values) (*TokenResponse, error) { - opts.Authentication.InjectAuthentication(data, opts.Headers) - encodedData := data.Encode() - - req, err := http.NewRequestWithContext(ctx, "POST", opts.Endpoint, strings.NewReader(encodedData)) - if err != nil { - return nil, fmt.Errorf("credentials: failed to properly build http request: %w", err) - - } - for key, list := range opts.Headers { - for _, val := range list { - req.Header.Add(key, val) - } - } - req.Header.Set("Content-Length", strconv.Itoa(len(encodedData))) - - resp, err := opts.Client.Do(req) - if err != nil { - return nil, fmt.Errorf("credentials: invalid response from Secure Token Server: %w", err) - } - defer resp.Body.Close() - - body, err := internal.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices { - return nil, fmt.Errorf("credentials: status code %d: %s", c, body) - } - var stsResp TokenResponse - if err := json.Unmarshal(body, &stsResp); err != nil { - return nil, fmt.Errorf("credentials: failed to unmarshal response body from Secure Token Server: %w", err) - } - - return &stsResp, nil -} - -// TokenRequest contains fields necessary to make an oauth2 token -// exchange. -type TokenRequest struct { - ActingParty struct { - ActorToken string - ActorTokenType string - } - GrantType string - Resource string - Audience string - Scope []string - RequestedTokenType string - SubjectToken string - SubjectTokenType string -} - -// TokenResponse is used to decode the remote server response during -// an oauth2 token exchange. -type TokenResponse struct { - AccessToken string `json:"access_token"` - IssuedTokenType string `json:"issued_token_type"` - TokenType string `json:"token_type"` - ExpiresIn int `json:"expires_in"` - Scope string `json:"scope"` - RefreshToken string `json:"refresh_token"` -} - -// ClientAuthentication represents an OAuth client ID and secret and the -// mechanism for passing these credentials as stated in rfc6749#2.3.1. -type ClientAuthentication struct { - AuthStyle auth.Style - ClientID string - ClientSecret string -} - -// InjectAuthentication is used to add authentication to a Secure Token Service -// exchange request. It modifies either the passed url.Values or http.Header -// depending on the desired authentication format. -func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) { - if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil { - return - } - switch c.AuthStyle { - case auth.StyleInHeader: - plainHeader := c.ClientID + ":" + c.ClientSecret - headers.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(plainHeader))) - default: - values.Set("client_id", c.ClientID) - values.Set("client_secret", c.ClientSecret) - } -} diff --git a/upstream/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go b/upstream/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go deleted file mode 100644 index b62a8ae4d5d..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go +++ /dev/null @@ -1,81 +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 credentials - -import ( - "context" - "crypto/rsa" - "fmt" - "strings" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/credsfile" - "cloud.google.com/go/auth/internal/jwt" -) - -var ( - // for testing - now func() time.Time = time.Now -) - -// configureSelfSignedJWT uses the private key in the service account to create -// a JWT without making a network call. -func configureSelfSignedJWT(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) { - pk, err := internal.ParseKey([]byte(f.PrivateKey)) - if err != nil { - return nil, fmt.Errorf("credentials: could not parse key: %w", err) - } - return &selfSignedTokenProvider{ - email: f.ClientEmail, - audience: opts.Audience, - scopes: opts.scopes(), - pk: pk, - pkID: f.PrivateKeyID, - }, nil -} - -type selfSignedTokenProvider struct { - email string - audience string - scopes []string - pk *rsa.PrivateKey - pkID string -} - -func (tp *selfSignedTokenProvider) Token(context.Context) (*auth.Token, error) { - iat := now() - exp := iat.Add(time.Hour) - scope := strings.Join(tp.scopes, " ") - c := &jwt.Claims{ - Iss: tp.email, - Sub: tp.email, - Aud: tp.audience, - Scope: scope, - Iat: iat.Unix(), - Exp: exp.Unix(), - } - h := &jwt.Header{ - Algorithm: jwt.HeaderAlgRSA256, - Type: jwt.HeaderType, - KeyID: string(tp.pkID), - } - msg, err := jwt.EncodeJWS(h, c, tp.pk) - if err != nil { - return nil, fmt.Errorf("credentials: could not encode JWT: %w", err) - } - return &auth.Token{Value: msg, Type: internal.TokenTypeBearer, Expiry: exp}, nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/grpctransport/dial_socketopt.go b/upstream/vendor/cloud.google.com/go/auth/grpctransport/dial_socketopt.go deleted file mode 100644 index e6136080572..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/grpctransport/dial_socketopt.go +++ /dev/null @@ -1,62 +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. - -//go:build linux -// +build linux - -package grpctransport - -import ( - "context" - "net" - "syscall" - - "google.golang.org/grpc" -) - -const ( - // defaultTCPUserTimeout is the default TCP_USER_TIMEOUT socket option. By - // default is 20 seconds. - tcpUserTimeoutMilliseconds = 20000 - - // Copied from golang.org/x/sys/unix.TCP_USER_TIMEOUT. - tcpUserTimeoutOp = 0x12 -) - -func init() { - // timeoutDialerOption is a grpc.DialOption that contains dialer with - // socket option TCP_USER_TIMEOUT. This dialer requires go versions 1.11+. - timeoutDialerOption = grpc.WithContextDialer(dialTCPUserTimeout) -} - -func dialTCPUserTimeout(ctx context.Context, addr string) (net.Conn, error) { - control := func(network, address string, c syscall.RawConn) error { - var syscallErr error - controlErr := c.Control(func(fd uintptr) { - syscallErr = syscall.SetsockoptInt( - int(fd), syscall.IPPROTO_TCP, tcpUserTimeoutOp, tcpUserTimeoutMilliseconds) - }) - if syscallErr != nil { - return syscallErr - } - if controlErr != nil { - return controlErr - } - return nil - } - d := &net.Dialer{ - Control: control, - } - return d.DialContext(ctx, "tcp", addr) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/grpctransport/directpath.go b/upstream/vendor/cloud.google.com/go/auth/grpctransport/directpath.go deleted file mode 100644 index 8dbfa7ef7e9..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/grpctransport/directpath.go +++ /dev/null @@ -1,123 +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 grpctransport - -import ( - "context" - "net" - "os" - "strconv" - "strings" - - "cloud.google.com/go/auth" - "cloud.google.com/go/compute/metadata" - "google.golang.org/grpc" - grpcgoogle "google.golang.org/grpc/credentials/google" -) - -func isDirectPathEnabled(endpoint string, opts *Options) bool { - if opts.InternalOptions != nil && !opts.InternalOptions.EnableDirectPath { - return false - } - if !checkDirectPathEndPoint(endpoint) { - return false - } - if b, _ := strconv.ParseBool(os.Getenv(disableDirectPathEnvVar)); b { - return false - } - return true -} - -func checkDirectPathEndPoint(endpoint string) bool { - // Only [dns:///]host[:port] is supported, not other schemes (e.g., "tcp://" or "unix://"). - // Also don't try direct path if the user has chosen an alternate name resolver - // (i.e., via ":///" prefix). - if strings.Contains(endpoint, "://") && !strings.HasPrefix(endpoint, "dns:///") { - return false - } - - if endpoint == "" { - return false - } - - return true -} - -func isTokenProviderDirectPathCompatible(tp auth.TokenProvider, _ *Options) bool { - if tp == nil { - return false - } - tok, err := tp.Token(context.Background()) - if err != nil { - return false - } - if tok == nil { - return false - } - if source, _ := tok.Metadata["auth.google.tokenSource"].(string); source != "compute-metadata" { - return false - } - if acct, _ := tok.Metadata["auth.google.serviceAccount"].(string); acct != "default" { - return false - } - return true -} - -func isDirectPathXdsUsed(o *Options) bool { - // Method 1: Enable DirectPath xDS by env; - if b, _ := strconv.ParseBool(os.Getenv(enableDirectPathXdsEnvVar)); b { - return true - } - // Method 2: Enable DirectPath xDS by option; - if o.InternalOptions != nil && o.InternalOptions.EnableDirectPathXds { - return true - } - return false -} - -// configureDirectPath returns some dial options and an endpoint to use if the -// configuration allows the use of direct path. If it does not the provided -// grpcOpts and endpoint are returned. -func configureDirectPath(grpcOpts []grpc.DialOption, opts *Options, endpoint string, creds *auth.Credentials) ([]grpc.DialOption, string) { - if isDirectPathEnabled(endpoint, opts) && metadata.OnGCE() && isTokenProviderDirectPathCompatible(creds, opts) { - // Overwrite all of the previously specific DialOptions, DirectPath uses its own set of credentials and certificates. - grpcOpts = []grpc.DialOption{ - grpc.WithCredentialsBundle(grpcgoogle.NewDefaultCredentialsWithOptions(grpcgoogle.DefaultCredentialsOptions{PerRPCCreds: &grpcCredentialsProvider{creds: creds}}))} - if timeoutDialerOption != nil { - grpcOpts = append(grpcOpts, timeoutDialerOption) - } - // Check if google-c2p resolver is enabled for DirectPath - if isDirectPathXdsUsed(opts) { - // google-c2p resolver target must not have a port number - if addr, _, err := net.SplitHostPort(endpoint); err == nil { - endpoint = "google-c2p:///" + addr - } else { - endpoint = "google-c2p:///" + endpoint - } - } else { - if !strings.HasPrefix(endpoint, "dns:///") { - endpoint = "dns:///" + endpoint - } - grpcOpts = append(grpcOpts, - // For now all DirectPath go clients will be using the following lb config, but in future - // when different services need different configs, then we should change this to a - // per-service config. - grpc.WithDisableServiceConfig(), - grpc.WithDefaultServiceConfig(`{"loadBalancingConfig":[{"grpclb":{"childPolicy":[{"pick_first":{}}]}}]}`)) - } - // TODO: add support for system parameters (quota project, request reason) via chained interceptor. - } - return grpcOpts, endpoint -} diff --git a/upstream/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/upstream/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go deleted file mode 100644 index 81c956b030b..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go +++ /dev/null @@ -1,329 +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 grpctransport - -import ( - "context" - "errors" - "fmt" - "net/http" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/transport" - "go.opencensus.io/plugin/ocgrpc" - "google.golang.org/grpc" - grpccreds "google.golang.org/grpc/credentials" - grpcinsecure "google.golang.org/grpc/credentials/insecure" -) - -const ( - // Check env to disable DirectPath traffic. - disableDirectPathEnvVar = "GOOGLE_CLOUD_DISABLE_DIRECT_PATH" - - // Check env to decide if using google-c2p resolver for DirectPath traffic. - enableDirectPathXdsEnvVar = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS" - - quotaProjectHeaderKey = "X-Goog-User-Project" -) - -var ( - // Set at init time by dial_socketopt.go. If nil, socketopt is not supported. - timeoutDialerOption grpc.DialOption -) - -// Options used to configure a [GRPCClientConnPool] from [Dial]. -type Options struct { - // DisableTelemetry disables default telemetry (OpenCensus). An example - // reason to do so would be to bind custom telemetry that overrides the - // defaults. - DisableTelemetry bool - // DisableAuthentication specifies that no authentication should be used. It - // is suitable only for testing and for accessing public resources, like - // public Google Cloud Storage buckets. - DisableAuthentication bool - // Endpoint overrides the default endpoint to be used for a service. - Endpoint string - // Metadata is extra gRPC metadata that will be appended to every outgoing - // request. - Metadata map[string]string - // GRPCDialOpts are dial options that will be passed to `grpc.Dial` when - // establishing a`grpc.Conn`` - GRPCDialOpts []grpc.DialOption - // PoolSize is specifies how many connections to balance between when making - // requests. If unset or less than 1, the value defaults to 1. - PoolSize int - // Credentials used to add Authorization metadata to all requests. If set - // DetectOpts are ignored. - Credentials *auth.Credentials - // DetectOpts configures settings for detect Application Default - // Credentials. - DetectOpts *credentials.DetectOptions - // UniverseDomain is the default service domain for a given Cloud universe. - // The default value is "googleapis.com". This is the universe domain - // configured for the client, which will be compared to the universe domain - // that is separately configured for the credentials. - UniverseDomain string - - // InternalOptions are NOT meant to be set directly by consumers of this - // package, they should only be set by generated client code. - InternalOptions *InternalOptions -} - -// client returns the client a user set for the detect options or nil if one was -// not set. -func (o *Options) client() *http.Client { - if o.DetectOpts != nil && o.DetectOpts.Client != nil { - return o.DetectOpts.Client - } - return nil -} - -func (o *Options) validate() error { - if o == nil { - return errors.New("grpctransport: opts required to be non-nil") - } - if o.InternalOptions != nil && o.InternalOptions.SkipValidation { - return nil - } - hasCreds := o.Credentials != nil || - (o.DetectOpts != nil && len(o.DetectOpts.CredentialsJSON) > 0) || - (o.DetectOpts != nil && o.DetectOpts.CredentialsFile != "") - if o.DisableAuthentication && hasCreds { - return errors.New("grpctransport: DisableAuthentication is incompatible with options that set or detect credentials") - } - return nil -} - -func (o *Options) resolveDetectOptions() *credentials.DetectOptions { - io := o.InternalOptions - // soft-clone these so we are not updating a ref the user holds and may reuse - do := transport.CloneDetectOptions(o.DetectOpts) - - // If scoped JWTs are enabled user provided an aud, allow self-signed JWT. - if (io != nil && io.EnableJWTWithScope) || do.Audience != "" { - do.UseSelfSignedJWT = true - } - // Only default scopes if user did not also set an audience. - if len(do.Scopes) == 0 && do.Audience == "" && io != nil && len(io.DefaultScopes) > 0 { - do.Scopes = make([]string, len(io.DefaultScopes)) - copy(do.Scopes, io.DefaultScopes) - } - if len(do.Scopes) == 0 && do.Audience == "" && io != nil { - do.Audience = o.InternalOptions.DefaultAudience - } - return do -} - -// InternalOptions are only meant to be set by generated client code. These are -// not meant to be set directly by consumers of this package. Configuration in -// this type is considered EXPERIMENTAL and may be removed at any time in the -// future without warning. -type InternalOptions struct { - // EnableNonDefaultSAForDirectPath overrides the default requirement for - // using the default service account for DirectPath. - EnableNonDefaultSAForDirectPath bool - // EnableDirectPath overrides the default attempt to use DirectPath. - EnableDirectPath bool - // EnableDirectPathXds overrides the default DirectPath type. It is only - // valid when DirectPath is enabled. - EnableDirectPathXds bool - // EnableJWTWithScope specifies if scope can be used with self-signed JWT. - EnableJWTWithScope bool - // DefaultAudience specifies a default audience to be used as the audience - // field ("aud") for the JWT token authentication. - DefaultAudience string - // DefaultEndpointTemplate combined with UniverseDomain specifies - // the default endpoint. - DefaultEndpointTemplate string - // DefaultMTLSEndpoint specifies the default mTLS endpoint. - DefaultMTLSEndpoint string - // DefaultScopes specifies the default OAuth2 scopes to be used for a - // service. - DefaultScopes []string - // SkipValidation bypasses validation on Options. It should only be used - // internally for clients that needs more control over their transport. - SkipValidation bool -} - -// Dial returns a GRPCClientConnPool that can be used to communicate with a -// Google cloud service, configured with the provided [Options]. It -// automatically appends Authorization metadata to all outgoing requests. -func Dial(ctx context.Context, secure bool, opts *Options) (GRPCClientConnPool, error) { - if err := opts.validate(); err != nil { - return nil, err - } - if opts.PoolSize <= 1 { - conn, err := dial(ctx, secure, opts) - if err != nil { - return nil, err - } - return &singleConnPool{conn}, nil - } - pool := &roundRobinConnPool{} - for i := 0; i < opts.PoolSize; i++ { - conn, err := dial(ctx, secure, opts) - if err != nil { - // ignore close error, if any - defer pool.Close() - return nil, err - } - pool.conns = append(pool.conns, conn) - } - return pool, nil -} - -// return a GRPCClientConnPool if pool == 1 or else a pool of of them if >1 -func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, error) { - tOpts := &transport.Options{ - Endpoint: opts.Endpoint, - Client: opts.client(), - UniverseDomain: opts.UniverseDomain, - } - if io := opts.InternalOptions; io != nil { - tOpts.DefaultEndpointTemplate = io.DefaultEndpointTemplate - tOpts.DefaultMTLSEndpoint = io.DefaultMTLSEndpoint - tOpts.EnableDirectPath = io.EnableDirectPath - tOpts.EnableDirectPathXds = io.EnableDirectPathXds - } - transportCreds, endpoint, err := transport.GetGRPCTransportCredsAndEndpoint(tOpts) - if err != nil { - return nil, err - } - - if !secure { - transportCreds = grpcinsecure.NewCredentials() - } - - // Initialize gRPC dial options with transport-level security options. - grpcOpts := []grpc.DialOption{ - grpc.WithTransportCredentials(transportCreds), - } - - // Authentication can only be sent when communicating over a secure connection. - if !opts.DisableAuthentication { - metadata := opts.Metadata - - var creds *auth.Credentials - if opts.Credentials != nil { - creds = opts.Credentials - } else { - var err error - creds, err = credentials.DetectDefault(opts.resolveDetectOptions()) - if err != nil { - return nil, err - } - } - - qp, err := creds.QuotaProjectID(ctx) - if err != nil { - return nil, err - } - if qp != "" { - if metadata == nil { - metadata = make(map[string]string, 1) - } - metadata[quotaProjectHeaderKey] = qp - } - grpcOpts = append(grpcOpts, - grpc.WithPerRPCCredentials(&grpcCredentialsProvider{ - creds: creds, - metadata: metadata, - clientUniverseDomain: opts.UniverseDomain, - }), - ) - - // Attempt Direct Path - grpcOpts, endpoint = configureDirectPath(grpcOpts, opts, endpoint, creds) - } - - // Add tracing, but before the other options, so that clients can override the - // gRPC stats handler. - // This assumes that gRPC options are processed in order, left to right. - grpcOpts = addOCStatsHandler(grpcOpts, opts) - grpcOpts = append(grpcOpts, opts.GRPCDialOpts...) - - return grpc.DialContext(ctx, endpoint, grpcOpts...) -} - -// grpcCredentialsProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials. -type grpcCredentialsProvider struct { - creds *auth.Credentials - - secure bool - - // Additional metadata attached as headers. - metadata map[string]string - clientUniverseDomain string -} - -// getClientUniverseDomain returns the default service domain for a given Cloud universe. -// The default value is "googleapis.com". This is the universe domain -// configured for the client, which will be compared to the universe domain -// that is separately configured for the credentials. -func (c *grpcCredentialsProvider) getClientUniverseDomain() string { - if c.clientUniverseDomain == "" { - return internal.DefaultUniverseDomain - } - return c.clientUniverseDomain -} - -func (c *grpcCredentialsProvider) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - credentialsUniverseDomain, err := c.creds.UniverseDomain(ctx) - if err != nil { - return nil, err - } - if err := transport.ValidateUniverseDomain(c.getClientUniverseDomain(), credentialsUniverseDomain); err != nil { - return nil, err - } - token, err := c.creds.Token(ctx) - if err != nil { - return nil, err - } - if c.secure { - ri, _ := grpccreds.RequestInfoFromContext(ctx) - if err = grpccreds.CheckSecurityLevel(ri.AuthInfo, grpccreds.PrivacyAndIntegrity); err != nil { - return nil, fmt.Errorf("unable to transfer credentials PerRPCCredentials: %v", err) - } - } - metadata := make(map[string]string, len(c.metadata)+1) - setAuthMetadata(token, metadata) - for k, v := range c.metadata { - metadata[k] = v - } - return metadata, nil -} - -// setAuthMetadata uses the provided token to set the Authorization metadata. -// If the token.Type is empty, the type is assumed to be Bearer. -func setAuthMetadata(token *auth.Token, m map[string]string) { - typ := token.Type - if typ == "" { - typ = internal.TokenTypeBearer - } - m["authorization"] = typ + " " + token.Value -} - -func (c *grpcCredentialsProvider) RequireTransportSecurity() bool { - return c.secure -} - -func addOCStatsHandler(dialOpts []grpc.DialOption, opts *Options) []grpc.DialOption { - if opts.DisableTelemetry { - return dialOpts - } - return append(dialOpts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{})) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/grpctransport/pool.go b/upstream/vendor/cloud.google.com/go/auth/grpctransport/pool.go deleted file mode 100644 index 642679f9b76..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/grpctransport/pool.go +++ /dev/null @@ -1,119 +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 grpctransport - -import ( - "context" - "fmt" - "sync/atomic" - - "google.golang.org/grpc" -) - -// GRPCClientConnPool is an interface that satisfies -// [google.golang.org/grpc.ClientConnInterface] and has some utility functions -// that are needed for connection lifecycle when using in a client library. It -// may be a pool or a single connection. This interface is not intended to, and -// can't be, implemented by others. -type GRPCClientConnPool interface { - // Connection returns a [google.golang.org/grpc.ClientConn] from the pool. - // - // ClientConn aren't returned to the pool and should not be closed directly. - Connection() *grpc.ClientConn - - // Len returns the number of connections in the pool. It will always return - // the same value. - Len() int - - // Close closes every ClientConn in the pool. The error returned by Close - // may be a single error or multiple errors. - Close() error - - grpc.ClientConnInterface - - // private ensure others outside this package can't implement this type - private() -} - -// singleConnPool is a special case for a single connection. -type singleConnPool struct { - *grpc.ClientConn -} - -func (p *singleConnPool) Connection() *grpc.ClientConn { return p.ClientConn } -func (p *singleConnPool) Len() int { return 1 } -func (p *singleConnPool) private() {} - -type roundRobinConnPool struct { - conns []*grpc.ClientConn - - idx uint32 // access via sync/atomic -} - -func (p *roundRobinConnPool) Len() int { - return len(p.conns) -} - -func (p *roundRobinConnPool) Connection() *grpc.ClientConn { - i := atomic.AddUint32(&p.idx, 1) - return p.conns[i%uint32(len(p.conns))] -} - -func (p *roundRobinConnPool) Close() error { - var errs multiError - for _, conn := range p.conns { - if err := conn.Close(); err != nil { - errs = append(errs, err) - } - } - if len(errs) == 0 { - return nil - } - return errs -} - -func (p *roundRobinConnPool) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error { - return p.Connection().Invoke(ctx, method, args, reply, opts...) -} - -func (p *roundRobinConnPool) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { - return p.Connection().NewStream(ctx, desc, method, opts...) -} - -func (p *roundRobinConnPool) private() {} - -// multiError represents errors from multiple conns in the group. -type multiError []error - -func (m multiError) Error() string { - s, n := "", 0 - for _, e := range m { - if e != nil { - if n == 0 { - s = e.Error() - } - n++ - } - } - switch n { - case 0: - return "(0 errors)" - case 1: - return s - case 2: - return s + " (and 1 other error)" - } - return fmt.Sprintf("%s (and %d other errors)", s, n-1) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/httptransport/httptransport.go b/upstream/vendor/cloud.google.com/go/auth/httptransport/httptransport.go deleted file mode 100644 index 06acc04151a..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/httptransport/httptransport.go +++ /dev/null @@ -1,208 +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 httptransport - -import ( - "crypto/tls" - "errors" - "fmt" - "net/http" - - "cloud.google.com/go/auth" - detect "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/transport" -) - -// ClientCertProvider is a function that returns a TLS client certificate to be -// used when opening TLS connections. It follows the same semantics as -// [crypto/tls.Config.GetClientCertificate]. -type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) - -// Options used to configure a [net/http.Client] from [NewClient]. -type Options struct { - // DisableTelemetry disables default telemetry (OpenCensus). An example - // reason to do so would be to bind custom telemetry that overrides the - // defaults. - DisableTelemetry bool - // DisableAuthentication specifies that no authentication should be used. It - // is suitable only for testing and for accessing public resources, like - // public Google Cloud Storage buckets. - DisableAuthentication bool - // Headers are extra HTTP headers that will be appended to every outgoing - // request. - Headers http.Header - // BaseRoundTripper overrides the base transport used for serving requests. - // If specified ClientCertProvider is ignored. - BaseRoundTripper http.RoundTripper - // Endpoint overrides the default endpoint to be used for a service. - Endpoint string - // APIKey specifies an API key to be used as the basis for authentication. - // If set DetectOpts are ignored. - APIKey string - // Credentials used to add Authorization header to all requests. If set - // DetectOpts are ignored. - Credentials *auth.Credentials - // ClientCertProvider is a function that returns a TLS client certificate to - // be used when opening TLS connections. It follows the same semantics as - // crypto/tls.Config.GetClientCertificate. - ClientCertProvider ClientCertProvider - // DetectOpts configures settings for detect Application Default - // Credentials. - DetectOpts *detect.DetectOptions - // UniverseDomain is the default service domain for a given Cloud universe. - // The default value is "googleapis.com". This is the universe domain - // configured for the client, which will be compared to the universe domain - // that is separately configured for the credentials. - UniverseDomain string - - // InternalOptions are NOT meant to be set directly by consumers of this - // package, they should only be set by generated client code. - InternalOptions *InternalOptions -} - -func (o *Options) validate() error { - if o == nil { - return errors.New("httptransport: opts required to be non-nil") - } - if o.InternalOptions != nil && o.InternalOptions.SkipValidation { - return nil - } - hasCreds := o.APIKey != "" || - o.Credentials != nil || - (o.DetectOpts != nil && len(o.DetectOpts.CredentialsJSON) > 0) || - (o.DetectOpts != nil && o.DetectOpts.CredentialsFile != "") - if o.DisableAuthentication && hasCreds { - return errors.New("httptransport: DisableAuthentication is incompatible with options that set or detect credentials") - } - return nil -} - -// client returns the client a user set for the detect options or nil if one was -// not set. -func (o *Options) client() *http.Client { - if o.DetectOpts != nil && o.DetectOpts.Client != nil { - return o.DetectOpts.Client - } - return nil -} - -func (o *Options) resolveDetectOptions() *detect.DetectOptions { - io := o.InternalOptions - // soft-clone these so we are not updating a ref the user holds and may reuse - do := transport.CloneDetectOptions(o.DetectOpts) - - // If scoped JWTs are enabled user provided an aud, allow self-signed JWT. - if (io != nil && io.EnableJWTWithScope) || do.Audience != "" { - do.UseSelfSignedJWT = true - } - // Only default scopes if user did not also set an audience. - if len(do.Scopes) == 0 && do.Audience == "" && io != nil && len(io.DefaultScopes) > 0 { - do.Scopes = make([]string, len(io.DefaultScopes)) - copy(do.Scopes, io.DefaultScopes) - } - if len(do.Scopes) == 0 && do.Audience == "" && io != nil { - do.Audience = o.InternalOptions.DefaultAudience - } - return do -} - -// InternalOptions are only meant to be set by generated client code. These are -// not meant to be set directly by consumers of this package. Configuration in -// this type is considered EXPERIMENTAL and may be removed at any time in the -// future without warning. -type InternalOptions struct { - // EnableJWTWithScope specifies if scope can be used with self-signed JWT. - EnableJWTWithScope bool - // DefaultAudience specifies a default audience to be used as the audience - // field ("aud") for the JWT token authentication. - DefaultAudience string - // DefaultEndpointTemplate combined with UniverseDomain specifies the - // default endpoint. - DefaultEndpointTemplate string - // DefaultMTLSEndpoint specifies the default mTLS endpoint. - DefaultMTLSEndpoint string - // DefaultScopes specifies the default OAuth2 scopes to be used for a - // service. - DefaultScopes []string - // SkipValidation bypasses validation on Options. It should only be used - // internally for clients that needs more control over their transport. - SkipValidation bool -} - -// AddAuthorizationMiddleware adds a middleware to the provided client's -// transport that sets the Authorization header with the value produced by the -// provided [cloud.google.com/go/auth.Credentials]. An error is returned only -// if client or creds is nil. -func AddAuthorizationMiddleware(client *http.Client, creds *auth.Credentials) error { - if client == nil || creds == nil { - return fmt.Errorf("httptransport: client and tp must not be nil") - } - base := client.Transport - if base == nil { - base = http.DefaultTransport.(*http.Transport).Clone() - } - client.Transport = &authTransport{ - creds: creds, - base: base, - // TODO(quartzmo): Somehow set clientUniverseDomain from impersonate calls. - } - return nil -} - -// NewClient returns a [net/http.Client] that can be used to communicate with a -// Google cloud service, configured with the provided [Options]. It -// automatically appends Authorization headers to all outgoing requests. -func NewClient(opts *Options) (*http.Client, error) { - if err := opts.validate(); err != nil { - return nil, err - } - - tOpts := &transport.Options{ - Endpoint: opts.Endpoint, - ClientCertProvider: opts.ClientCertProvider, - Client: opts.client(), - UniverseDomain: opts.UniverseDomain, - } - if io := opts.InternalOptions; io != nil { - tOpts.DefaultEndpointTemplate = io.DefaultEndpointTemplate - tOpts.DefaultMTLSEndpoint = io.DefaultMTLSEndpoint - } - clientCertProvider, dialTLSContext, err := transport.GetHTTPTransportConfig(tOpts) - if err != nil { - return nil, err - } - baseRoundTripper := opts.BaseRoundTripper - if baseRoundTripper == nil { - baseRoundTripper = defaultBaseTransport(clientCertProvider, dialTLSContext) - } - trans, err := newTransport(baseRoundTripper, opts) - if err != nil { - return nil, err - } - return &http.Client{ - Transport: trans, - }, nil -} - -// SetAuthHeader uses the provided token to set the Authorization header on a -// request. If the token.Type is empty, the type is assumed to be Bearer. -func SetAuthHeader(token *auth.Token, req *http.Request) { - typ := token.Type - if typ == "" { - typ = internal.TokenTypeBearer - } - req.Header.Set("Authorization", typ+" "+token.Value) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/httptransport/trace.go b/upstream/vendor/cloud.google.com/go/auth/httptransport/trace.go deleted file mode 100644 index 467c477c04d..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/httptransport/trace.go +++ /dev/null @@ -1,93 +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 httptransport - -import ( - "encoding/binary" - "encoding/hex" - "fmt" - "net/http" - "strconv" - "strings" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -const ( - httpHeaderMaxSize = 200 - cloudTraceHeader = `X-Cloud-Trace-Context` -) - -// asserts the httpFormat fulfills this foreign interface -var _ propagation.HTTPFormat = (*httpFormat)(nil) - -// httpFormat implements propagation.httpFormat to propagate -// traces in HTTP headers for Google Cloud Platform and Cloud Trace. -type httpFormat struct{} - -// SpanContextFromRequest extracts a Cloud Trace span context from incoming requests. -func (f *httpFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) { - h := req.Header.Get(cloudTraceHeader) - // See https://cloud.google.com/trace/docs/faq for the header HTTPFormat. - // Return if the header is empty or missing, or if the header is unreasonably - // large, to avoid making unnecessary copies of a large string. - if h == "" || len(h) > httpHeaderMaxSize { - return trace.SpanContext{}, false - } - - // Parse the trace id field. - slash := strings.Index(h, `/`) - if slash == -1 { - return trace.SpanContext{}, false - } - tid, h := h[:slash], h[slash+1:] - - buf, err := hex.DecodeString(tid) - if err != nil { - return trace.SpanContext{}, false - } - copy(sc.TraceID[:], buf) - - // Parse the span id field. - spanstr := h - semicolon := strings.Index(h, `;`) - if semicolon != -1 { - spanstr, h = h[:semicolon], h[semicolon+1:] - } - sid, err := strconv.ParseUint(spanstr, 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - binary.BigEndian.PutUint64(sc.SpanID[:], sid) - - // Parse the options field, options field is optional. - if !strings.HasPrefix(h, "o=") { - return sc, true - } - o, err := strconv.ParseUint(h[2:], 10, 32) - if err != nil { - return trace.SpanContext{}, false - } - sc.TraceOptions = trace.TraceOptions(o) - return sc, true -} - -// SpanContextToRequest modifies the given request to include a Cloud Trace header. -func (f *httpFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - sid := binary.BigEndian.Uint64(sc.SpanID[:]) - header := fmt.Sprintf("%s/%d;o=%d", hex.EncodeToString(sc.TraceID[:]), sid, int64(sc.TraceOptions)) - req.Header.Set(cloudTraceHeader, header) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/httptransport/transport.go b/upstream/vendor/cloud.google.com/go/auth/httptransport/transport.go deleted file mode 100644 index 94caeb00f0a..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/httptransport/transport.go +++ /dev/null @@ -1,211 +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 httptransport - -import ( - "context" - "crypto/tls" - "net" - "net/http" - "time" - - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/transport" - "cloud.google.com/go/auth/internal/transport/cert" - "go.opencensus.io/plugin/ochttp" - "golang.org/x/net/http2" -) - -const ( - quotaProjectHeaderKey = "X-Goog-User-Project" -) - -func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, error) { - var headers = opts.Headers - ht := &headerTransport{ - base: base, - headers: headers, - } - var trans http.RoundTripper = ht - trans = addOCTransport(trans, opts) - switch { - case opts.DisableAuthentication: - // Do nothing. - case opts.APIKey != "": - qp := internal.GetQuotaProject(nil, opts.Headers.Get(quotaProjectHeaderKey)) - if qp != "" { - if headers == nil { - headers = make(map[string][]string, 1) - } - headers.Set(quotaProjectHeaderKey, qp) - } - trans = &apiKeyTransport{ - Transport: trans, - Key: opts.APIKey, - } - default: - var creds *auth.Credentials - if opts.Credentials != nil { - creds = opts.Credentials - } else { - var err error - creds, err = credentials.DetectDefault(opts.resolveDetectOptions()) - if err != nil { - return nil, err - } - } - qp, err := creds.QuotaProjectID(context.Background()) - if err != nil { - return nil, err - } - if qp != "" { - if headers == nil { - headers = make(map[string][]string, 1) - } - headers.Set(quotaProjectHeaderKey, qp) - } - creds.TokenProvider = auth.NewCachedTokenProvider(creds.TokenProvider, nil) - trans = &authTransport{ - base: trans, - creds: creds, - clientUniverseDomain: opts.UniverseDomain, - } - } - return trans, nil -} - -// defaultBaseTransport returns the base HTTP transport. -// On App Engine, this is urlfetch.Transport. -// Otherwise, use a default transport, taking most defaults from -// http.DefaultTransport. -// If TLSCertificate is available, set TLSClientConfig as well. -func defaultBaseTransport(clientCertSource cert.Provider, dialTLSContext func(context.Context, string, string) (net.Conn, error)) http.RoundTripper { - trans := http.DefaultTransport.(*http.Transport).Clone() - trans.MaxIdleConnsPerHost = 100 - - if clientCertSource != nil { - trans.TLSClientConfig = &tls.Config{ - GetClientCertificate: clientCertSource, - } - } - if dialTLSContext != nil { - // If DialTLSContext is set, TLSClientConfig wil be ignored - trans.DialTLSContext = dialTLSContext - } - - // Configures the ReadIdleTimeout HTTP/2 option for the - // transport. This allows broken idle connections to be pruned more quickly, - // preventing the client from attempting to re-use connections that will no - // longer work. - http2Trans, err := http2.ConfigureTransports(trans) - if err == nil { - http2Trans.ReadIdleTimeout = time.Second * 31 - } - - return trans -} - -type apiKeyTransport struct { - // Key is the API Key to set on requests. - Key string - // Transport is the underlying HTTP transport. - // If nil, http.DefaultTransport is used. - Transport http.RoundTripper -} - -func (t *apiKeyTransport) RoundTrip(req *http.Request) (*http.Response, error) { - newReq := *req - args := newReq.URL.Query() - args.Set("key", t.Key) - newReq.URL.RawQuery = args.Encode() - return t.Transport.RoundTrip(&newReq) -} - -type headerTransport struct { - headers http.Header - base http.RoundTripper -} - -func (t *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.base - newReq := *req - newReq.Header = make(http.Header) - for k, vv := range req.Header { - newReq.Header[k] = vv - } - - for k, v := range t.headers { - newReq.Header[k] = v - } - - return rt.RoundTrip(&newReq) -} - -func addOCTransport(trans http.RoundTripper, opts *Options) http.RoundTripper { - if opts.DisableTelemetry { - return trans - } - return &ochttp.Transport{ - Base: trans, - Propagation: &httpFormat{}, - } -} - -type authTransport struct { - creds *auth.Credentials - base http.RoundTripper - clientUniverseDomain string -} - -// getClientUniverseDomain returns the universe domain configured for the client. -// The default value is "googleapis.com". -func (t *authTransport) getClientUniverseDomain() string { - if t.clientUniverseDomain == "" { - return internal.DefaultUniverseDomain - } - return t.clientUniverseDomain -} - -// RoundTrip authorizes and authenticates the request with an -// access token from Transport's Source. Per the RoundTripper contract we must -// not modify the initial request, so we clone it, and we must close the body -// on any errors that happens during our token logic. -func (t *authTransport) RoundTrip(req *http.Request) (*http.Response, error) { - reqBodyClosed := false - if req.Body != nil { - defer func() { - if !reqBodyClosed { - req.Body.Close() - } - }() - } - credentialsUniverseDomain, err := t.creds.UniverseDomain(req.Context()) - if err != nil { - return nil, err - } - if err := transport.ValidateUniverseDomain(t.getClientUniverseDomain(), credentialsUniverseDomain); err != nil { - return nil, err - } - token, err := t.creds.Token(req.Context()) - if err != nil { - return nil, err - } - req2 := req.Clone(req.Context()) - SetAuthHeader(token, req2) - reqBodyClosed = true - return t.base.RoundTrip(req2) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go b/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go deleted file mode 100644 index 9cd4bed61b5..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go +++ /dev/null @@ -1,107 +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 credsfile is meant to hide implementation details from the pubic -// surface of the detect package. It should not import any other packages in -// this module. It is located under the main internal package so other -// sub-packages can use these parsed types as well. -package credsfile - -import ( - "os" - "os/user" - "path/filepath" - "runtime" -) - -const ( - // GoogleAppCredsEnvVar is the environment variable for setting the - // application default credentials. - GoogleAppCredsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS" - userCredsFilename = "application_default_credentials.json" -) - -// CredentialType represents different credential filetypes Google credentials -// can be. -type CredentialType int - -const ( - // UnknownCredType is an unidentified file type. - UnknownCredType CredentialType = iota - // UserCredentialsKey represents a user creds file type. - UserCredentialsKey - // ServiceAccountKey represents a service account file type. - ServiceAccountKey - // ImpersonatedServiceAccountKey represents a impersonated service account - // file type. - ImpersonatedServiceAccountKey - // ExternalAccountKey represents a external account file type. - ExternalAccountKey - // GDCHServiceAccountKey represents a GDCH file type. - GDCHServiceAccountKey - // ExternalAccountAuthorizedUserKey represents a external account authorized - // user file type. - ExternalAccountAuthorizedUserKey -) - -// parseCredentialType returns the associated filetype based on the parsed -// typeString provided. -func parseCredentialType(typeString string) CredentialType { - switch typeString { - case "service_account": - return ServiceAccountKey - case "authorized_user": - return UserCredentialsKey - case "impersonated_service_account": - return ImpersonatedServiceAccountKey - case "external_account": - return ExternalAccountKey - case "external_account_authorized_user": - return ExternalAccountAuthorizedUserKey - case "gdch_service_account": - return GDCHServiceAccountKey - default: - return UnknownCredType - } -} - -// GetFileNameFromEnv returns the override if provided or detects a filename -// from the environment. -func GetFileNameFromEnv(override string) string { - if override != "" { - return override - } - return os.Getenv(GoogleAppCredsEnvVar) -} - -// GetWellKnownFileName tries to locate the filepath for the user credential -// file based on the environment. -func GetWellKnownFileName() string { - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "gcloud", userCredsFilename) - } - return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", userCredsFilename) -} - -// guessUnixHomeDir default to checking for HOME, but not all unix systems have -// this set, do have a fallback. -func guessUnixHomeDir() string { - if v := os.Getenv("HOME"); v != "" { - return v - } - if u, err := user.Current(); err == nil { - return u.HomeDir - } - return "" -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go b/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go deleted file mode 100644 index 69e30779f98..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go +++ /dev/null @@ -1,149 +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 credsfile - -import ( - "encoding/json" -) - -// Config3LO is the internals of a client creds file. -type Config3LO struct { - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - RedirectURIs []string `json:"redirect_uris"` - AuthURI string `json:"auth_uri"` - TokenURI string `json:"token_uri"` -} - -// ClientCredentialsFile representation. -type ClientCredentialsFile struct { - Web *Config3LO `json:"web"` - Installed *Config3LO `json:"installed"` - UniverseDomain string `json:"universe_domain"` -} - -// ServiceAccountFile representation. -type ServiceAccountFile struct { - Type string `json:"type"` - ProjectID string `json:"project_id"` - PrivateKeyID string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - ClientEmail string `json:"client_email"` - ClientID string `json:"client_id"` - AuthURL string `json:"auth_uri"` - TokenURL string `json:"token_uri"` - UniverseDomain string `json:"universe_domain"` -} - -// UserCredentialsFile representation. -type UserCredentialsFile struct { - Type string `json:"type"` - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - QuotaProjectID string `json:"quota_project_id"` - RefreshToken string `json:"refresh_token"` - UniverseDomain string `json:"universe_domain"` -} - -// ExternalAccountFile representation. -type ExternalAccountFile struct { - Type string `json:"type"` - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - Audience string `json:"audience"` - SubjectTokenType string `json:"subject_token_type"` - ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"` - TokenURL string `json:"token_url"` - CredentialSource *CredentialSource `json:"credential_source,omitempty"` - TokenInfoURL string `json:"token_info_url"` - ServiceAccountImpersonation *ServiceAccountImpersonationInfo `json:"service_account_impersonation,omitempty"` - QuotaProjectID string `json:"quota_project_id"` - WorkforcePoolUserProject string `json:"workforce_pool_user_project"` - UniverseDomain string `json:"universe_domain"` -} - -// ExternalAccountAuthorizedUserFile representation. -type ExternalAccountAuthorizedUserFile struct { - Type string `json:"type"` - Audience string `json:"audience"` - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - RefreshToken string `json:"refresh_token"` - TokenURL string `json:"token_url"` - TokenInfoURL string `json:"token_info_url"` - RevokeURL string `json:"revoke_url"` - QuotaProjectID string `json:"quota_project_id"` - UniverseDomain string `json:"universe_domain"` -} - -// CredentialSource stores the information necessary to retrieve the credentials for the STS exchange. -// -// One field amongst File, URL, and Executable should be filled, depending on the kind of credential in question. -// The EnvironmentID should start with AWS if being used for an AWS credential. -type CredentialSource struct { - File string `json:"file"` - URL string `json:"url"` - Headers map[string]string `json:"headers"` - Executable *ExecutableConfig `json:"executable,omitempty"` - EnvironmentID string `json:"environment_id"` - RegionURL string `json:"region_url"` - RegionalCredVerificationURL string `json:"regional_cred_verification_url"` - CredVerificationURL string `json:"cred_verification_url"` - IMDSv2SessionTokenURL string `json:"imdsv2_session_token_url"` - Format *Format `json:"format,omitempty"` -} - -// Format describes the format of a [CredentialSource]. -type Format struct { - // Type is either "text" or "json". When not provided "text" type is assumed. - Type string `json:"type"` - // SubjectTokenFieldName is only required for JSON format. This would be "access_token" for azure. - SubjectTokenFieldName string `json:"subject_token_field_name"` -} - -// ExecutableConfig represents the command to run for an executable -// [CredentialSource]. -type ExecutableConfig struct { - Command string `json:"command"` - TimeoutMillis int `json:"timeout_millis"` - OutputFile string `json:"output_file"` -} - -// ServiceAccountImpersonationInfo has impersonation configuration. -type ServiceAccountImpersonationInfo struct { - TokenLifetimeSeconds int `json:"token_lifetime_seconds"` -} - -// ImpersonatedServiceAccountFile representation. -type ImpersonatedServiceAccountFile struct { - Type string `json:"type"` - ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"` - Delegates []string `json:"delegates"` - CredSource json.RawMessage `json:"source_credentials"` - UniverseDomain string `json:"universe_domain"` -} - -// GDCHServiceAccountFile represents the Google Distributed Cloud Hosted (GDCH) service identity file. -type GDCHServiceAccountFile struct { - Type string `json:"type"` - FormatVersion string `json:"format_version"` - Project string `json:"project"` - Name string `json:"name"` - CertPath string `json:"ca_cert_path"` - PrivateKeyID string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - TokenURL string `json:"token_uri"` - UniverseDomain string `json:"universe_domain"` -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go b/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go deleted file mode 100644 index a02b9f5df7e..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go +++ /dev/null @@ -1,98 +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 credsfile - -import ( - "encoding/json" -) - -// ParseServiceAccount parses bytes into a [ServiceAccountFile]. -func ParseServiceAccount(b []byte) (*ServiceAccountFile, error) { - var f *ServiceAccountFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseClientCredentials parses bytes into a -// [credsfile.ClientCredentialsFile]. -func ParseClientCredentials(b []byte) (*ClientCredentialsFile, error) { - var f *ClientCredentialsFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseUserCredentials parses bytes into a [UserCredentialsFile]. -func ParseUserCredentials(b []byte) (*UserCredentialsFile, error) { - var f *UserCredentialsFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseExternalAccount parses bytes into a [ExternalAccountFile]. -func ParseExternalAccount(b []byte) (*ExternalAccountFile, error) { - var f *ExternalAccountFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseExternalAccountAuthorizedUser parses bytes into a -// [ExternalAccountAuthorizedUserFile]. -func ParseExternalAccountAuthorizedUser(b []byte) (*ExternalAccountAuthorizedUserFile, error) { - var f *ExternalAccountAuthorizedUserFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseImpersonatedServiceAccount parses bytes into a -// [ImpersonatedServiceAccountFile]. -func ParseImpersonatedServiceAccount(b []byte) (*ImpersonatedServiceAccountFile, error) { - var f *ImpersonatedServiceAccountFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -// ParseGDCHServiceAccount parses bytes into a [GDCHServiceAccountFile]. -func ParseGDCHServiceAccount(b []byte) (*GDCHServiceAccountFile, error) { - var f *GDCHServiceAccountFile - if err := json.Unmarshal(b, &f); err != nil { - return nil, err - } - return f, nil -} - -type fileTypeChecker struct { - Type string `json:"type"` -} - -// ParseFileType determines the [CredentialType] based on bytes provided. -func ParseFileType(b []byte) (CredentialType, error) { - var f fileTypeChecker - if err := json.Unmarshal(b, &f); err != nil { - return 0, err - } - return parseCredentialType(f.Type), nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/internal.go b/upstream/vendor/cloud.google.com/go/auth/internal/internal.go deleted file mode 100644 index 70534e809a4..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/internal.go +++ /dev/null @@ -1,184 +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 internal - -import ( - "context" - "crypto/rsa" - "crypto/x509" - "encoding/json" - "encoding/pem" - "errors" - "fmt" - "io" - "net/http" - "os" - "sync" - "time" - - "cloud.google.com/go/compute/metadata" -) - -const ( - // TokenTypeBearer is the auth header prefix for bearer tokens. - TokenTypeBearer = "Bearer" - - // QuotaProjectEnvVar is the environment variable for setting the quota - // project. - QuotaProjectEnvVar = "GOOGLE_CLOUD_QUOTA_PROJECT" - projectEnvVar = "GOOGLE_CLOUD_PROJECT" - maxBodySize = 1 << 20 - - // DefaultUniverseDomain is the default value for universe domain. - // Universe domain is the default service domain for a given Cloud universe. - DefaultUniverseDomain = "googleapis.com" -) - -// CloneDefaultClient returns a [http.Client] with some good defaults. -func CloneDefaultClient() *http.Client { - return &http.Client{ - Transport: http.DefaultTransport.(*http.Transport).Clone(), - Timeout: 30 * time.Second, - } -} - -// ParseKey converts the binary contents of a private key file -// to an *rsa.PrivateKey. It detects whether the private key is in a -// PEM container or not. If so, it extracts the the private key -// from PEM container before conversion. It only supports PEM -// containers with no passphrase. -func ParseKey(key []byte) (*rsa.PrivateKey, error) { - block, _ := pem.Decode(key) - if block != nil { - key = block.Bytes - } - parsedKey, err := x509.ParsePKCS8PrivateKey(key) - if err != nil { - parsedKey, err = x509.ParsePKCS1PrivateKey(key) - if err != nil { - return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8: %w", err) - } - } - parsed, ok := parsedKey.(*rsa.PrivateKey) - if !ok { - return nil, errors.New("private key is invalid") - } - return parsed, nil -} - -// GetQuotaProject retrieves quota project with precedence being: override, -// environment variable, creds json file. -func GetQuotaProject(b []byte, override string) string { - if override != "" { - return override - } - if env := os.Getenv(QuotaProjectEnvVar); env != "" { - return env - } - if b == nil { - return "" - } - var v struct { - QuotaProject string `json:"quota_project_id"` - } - if err := json.Unmarshal(b, &v); err != nil { - return "" - } - return v.QuotaProject -} - -// GetProjectID retrieves project with precedence being: override, -// environment variable, creds json file. -func GetProjectID(b []byte, override string) string { - if override != "" { - return override - } - if env := os.Getenv(projectEnvVar); env != "" { - return env - } - if b == nil { - return "" - } - var v struct { - ProjectID string `json:"project_id"` // standard service account key - Project string `json:"project"` // gdch key - } - if err := json.Unmarshal(b, &v); err != nil { - return "" - } - if v.ProjectID != "" { - return v.ProjectID - } - return v.Project -} - -// ReadAll consumes the whole reader and safely reads the content of its body -// with some overflow protection. -func ReadAll(r io.Reader) ([]byte, error) { - return io.ReadAll(io.LimitReader(r, maxBodySize)) -} - -// StaticCredentialsProperty is a helper for creating static credentials -// properties. -func StaticCredentialsProperty(s string) StaticProperty { - return StaticProperty(s) -} - -// StaticProperty always returns that value of the underlying string. -type StaticProperty string - -// GetProperty loads the properly value provided the given context. -func (p StaticProperty) GetProperty(context.Context) (string, error) { - return string(p), nil -} - -// ComputeUniverseDomainProvider fetches the credentials universe domain from -// the google cloud metadata service. -type ComputeUniverseDomainProvider struct { - universeDomainOnce sync.Once - universeDomain string - universeDomainErr error -} - -// GetProperty fetches the credentials universe domain from the google cloud -// metadata service. -func (c *ComputeUniverseDomainProvider) GetProperty(ctx context.Context) (string, error) { - c.universeDomainOnce.Do(func() { - c.universeDomain, c.universeDomainErr = getMetadataUniverseDomain(ctx) - }) - if c.universeDomainErr != nil { - return "", c.universeDomainErr - } - return c.universeDomain, nil -} - -// httpGetMetadataUniverseDomain is a package var for unit test substitution. -var httpGetMetadataUniverseDomain = func(ctx context.Context) (string, error) { - client := metadata.NewClient(&http.Client{Timeout: time.Second}) - // TODO(quartzmo): set ctx on request - return client.Get("universe/universe_domain") -} - -func getMetadataUniverseDomain(ctx context.Context) (string, error) { - universeDomain, err := httpGetMetadataUniverseDomain(ctx) - if err == nil { - return universeDomain, nil - } - if _, ok := err.(metadata.NotDefinedError); ok { - // http.StatusNotFound (404) - return DefaultUniverseDomain, nil - } - return "", err -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go b/upstream/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go deleted file mode 100644 index dc28b3c3bb5..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go +++ /dev/null @@ -1,171 +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 jwt - -import ( - "bytes" - "crypto" - "crypto/rand" - "crypto/rsa" - "crypto/sha256" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "strings" - "time" -) - -const ( - // HeaderAlgRSA256 is the RS256 [Header.Algorithm]. - HeaderAlgRSA256 = "RS256" - // HeaderAlgES256 is the ES256 [Header.Algorithm]. - HeaderAlgES256 = "ES256" - // HeaderType is the standard [Header.Type]. - HeaderType = "JWT" -) - -// Header represents a JWT header. -type Header struct { - Algorithm string `json:"alg"` - Type string `json:"typ"` - KeyID string `json:"kid"` -} - -func (h *Header) encode() (string, error) { - b, err := json.Marshal(h) - if err != nil { - return "", err - } - return base64.RawURLEncoding.EncodeToString(b), nil -} - -// Claims represents the claims set of a JWT. -type Claims struct { - // Iss is the issuer JWT claim. - Iss string `json:"iss"` - // Scope is the scope JWT claim. - Scope string `json:"scope,omitempty"` - // Exp is the expiry JWT claim. If unset, default is in one hour from now. - Exp int64 `json:"exp"` - // Iat is the subject issued at claim. If unset, default is now. - Iat int64 `json:"iat"` - // Aud is the audience JWT claim. Optional. - Aud string `json:"aud"` - // Sub is the subject JWT claim. Optional. - Sub string `json:"sub,omitempty"` - // AdditionalClaims contains any additional non-standard JWT claims. Optional. - AdditionalClaims map[string]interface{} `json:"-"` -} - -func (c *Claims) encode() (string, error) { - // Compensate for skew - now := time.Now().Add(-10 * time.Second) - if c.Iat == 0 { - c.Iat = now.Unix() - } - if c.Exp == 0 { - c.Exp = now.Add(time.Hour).Unix() - } - if c.Exp < c.Iat { - return "", fmt.Errorf("jwt: invalid Exp = %d; must be later than Iat = %d", c.Exp, c.Iat) - } - - b, err := json.Marshal(c) - if err != nil { - return "", err - } - - if len(c.AdditionalClaims) == 0 { - return base64.RawURLEncoding.EncodeToString(b), nil - } - - // Marshal private claim set and then append it to b. - prv, err := json.Marshal(c.AdditionalClaims) - if err != nil { - return "", fmt.Errorf("invalid map of additional claims %v: %w", c.AdditionalClaims, err) - } - - // Concatenate public and private claim JSON objects. - if !bytes.HasSuffix(b, []byte{'}'}) { - return "", fmt.Errorf("invalid JSON %s", b) - } - if !bytes.HasPrefix(prv, []byte{'{'}) { - return "", fmt.Errorf("invalid JSON %s", prv) - } - b[len(b)-1] = ',' // Replace closing curly brace with a comma. - b = append(b, prv[1:]...) // Append private claims. - return base64.RawURLEncoding.EncodeToString(b), nil -} - -// EncodeJWS encodes the data using the provided key as a JSON web signature. -func EncodeJWS(header *Header, c *Claims, key *rsa.PrivateKey) (string, error) { - head, err := header.encode() - if err != nil { - return "", err - } - claims, err := c.encode() - if err != nil { - return "", err - } - ss := fmt.Sprintf("%s.%s", head, claims) - h := sha256.New() - h.Write([]byte(ss)) - sig, err := rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil)) - if err != nil { - return "", err - } - return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil -} - -// DecodeJWS decodes a claim set from a JWS payload. -func DecodeJWS(payload string) (*Claims, error) { - // decode returned id token to get expiry - s := strings.Split(payload, ".") - if len(s) < 2 { - return nil, errors.New("invalid token received") - } - decoded, err := base64.RawURLEncoding.DecodeString(s[1]) - if err != nil { - return nil, err - } - c := &Claims{} - if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c); err != nil { - return nil, err - } - if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(&c.AdditionalClaims); err != nil { - return nil, err - } - return c, err -} - -// VerifyJWS tests whether the provided JWT token's signature was produced by -// the private key associated with the provided public key. -func VerifyJWS(token string, key *rsa.PublicKey) error { - parts := strings.Split(token, ".") - if len(parts) != 3 { - return errors.New("jwt: invalid token received, token must have 3 parts") - } - - signedContent := parts[0] + "." + parts[1] - signatureString, err := base64.RawURLEncoding.DecodeString(parts[2]) - if err != nil { - return err - } - - h := sha256.New() - h.Write([]byte(signedContent)) - return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), signatureString) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cba.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/cba.go deleted file mode 100644 index 75734906259..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cba.go +++ /dev/null @@ -1,298 +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 transport - -import ( - "context" - "crypto/tls" - "errors" - "net" - "net/http" - "net/url" - "os" - "strconv" - "strings" - - "cloud.google.com/go/auth/internal" - "cloud.google.com/go/auth/internal/transport/cert" - "github.com/google/s2a-go" - "github.com/google/s2a-go/fallback" - "google.golang.org/grpc/credentials" -) - -const ( - mTLSModeAlways = "always" - mTLSModeNever = "never" - mTLSModeAuto = "auto" - - // Experimental: if true, the code will try MTLS with S2A as the default for transport security. Default value is false. - googleAPIUseS2AEnv = "EXPERIMENTAL_GOOGLE_API_USE_S2A" - googleAPIUseCertSource = "GOOGLE_API_USE_CLIENT_CERTIFICATE" - googleAPIUseMTLS = "GOOGLE_API_USE_MTLS_ENDPOINT" - googleAPIUseMTLSOld = "GOOGLE_API_USE_MTLS" - - universeDomainPlaceholder = "UNIVERSE_DOMAIN" -) - -var ( - mdsMTLSAutoConfigSource mtlsConfigSource - errUniverseNotSupportedMTLS = errors.New("mTLS is not supported in any universe other than googleapis.com") -) - -// Options is a struct that is duplicated information from the individual -// transport packages in order to avoid cyclic deps. It correlates 1:1 with -// fields on httptransport.Options and grpctransport.Options. -type Options struct { - Endpoint string - DefaultMTLSEndpoint string - DefaultEndpointTemplate string - ClientCertProvider cert.Provider - Client *http.Client - UniverseDomain string - EnableDirectPath bool - EnableDirectPathXds bool -} - -// getUniverseDomain returns the default service domain for a given Cloud -// universe. -func (o *Options) getUniverseDomain() string { - if o.UniverseDomain == "" { - return internal.DefaultUniverseDomain - } - return o.UniverseDomain -} - -// isUniverseDomainGDU returns true if the universe domain is the default Google -// universe. -func (o *Options) isUniverseDomainGDU() bool { - return o.getUniverseDomain() == internal.DefaultUniverseDomain -} - -// defaultEndpoint returns the DefaultEndpointTemplate merged with the -// universe domain if the DefaultEndpointTemplate is set, otherwise returns an -// empty string. -func (o *Options) defaultEndpoint() string { - if o.DefaultEndpointTemplate == "" { - return "" - } - return strings.Replace(o.DefaultEndpointTemplate, universeDomainPlaceholder, o.getUniverseDomain(), 1) -} - -// mergedEndpoint merges a user-provided Endpoint of format host[:port] with the -// default endpoint. -func (o *Options) mergedEndpoint() (string, error) { - defaultEndpoint := o.defaultEndpoint() - u, err := url.Parse(fixScheme(defaultEndpoint)) - if err != nil { - return "", err - } - return strings.Replace(defaultEndpoint, u.Host, o.Endpoint, 1), nil -} - -func fixScheme(baseURL string) string { - if !strings.Contains(baseURL, "://") { - baseURL = "https://" + baseURL - } - return baseURL -} - -// GetGRPCTransportCredsAndEndpoint returns an instance of -// [google.golang.org/grpc/credentials.TransportCredentials], and the -// corresponding endpoint to use for GRPC client. -func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error) { - config, err := getTransportConfig(opts) - if err != nil { - return nil, "", err - } - - defaultTransportCreds := credentials.NewTLS(&tls.Config{ - GetClientCertificate: config.clientCertSource, - }) - if config.s2aAddress == "" { - return defaultTransportCreds, config.endpoint, nil - } - - var fallbackOpts *s2a.FallbackOptions - // In case of S2A failure, fall back to the endpoint that would've been used without S2A. - if fallbackHandshake, err := fallback.DefaultFallbackClientHandshakeFunc(config.endpoint); err == nil { - fallbackOpts = &s2a.FallbackOptions{ - FallbackClientHandshakeFunc: fallbackHandshake, - } - } - - s2aTransportCreds, err := s2a.NewClientCreds(&s2a.ClientOptions{ - S2AAddress: config.s2aAddress, - FallbackOpts: fallbackOpts, - }) - if err != nil { - // Use default if we cannot initialize S2A client transport credentials. - return defaultTransportCreds, config.endpoint, nil - } - return s2aTransportCreds, config.s2aMTLSEndpoint, nil -} - -// GetHTTPTransportConfig returns a client certificate source and a function for -// dialing MTLS with S2A. -func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context, string, string) (net.Conn, error), error) { - config, err := getTransportConfig(opts) - if err != nil { - return nil, nil, err - } - - if config.s2aAddress == "" { - return config.clientCertSource, nil, nil - } - - var fallbackOpts *s2a.FallbackOptions - // In case of S2A failure, fall back to the endpoint that would've been used without S2A. - if fallbackURL, err := url.Parse(config.endpoint); err == nil { - if fallbackDialer, fallbackServerAddr, err := fallback.DefaultFallbackDialerAndAddress(fallbackURL.Hostname()); err == nil { - fallbackOpts = &s2a.FallbackOptions{ - FallbackDialer: &s2a.FallbackDialer{ - Dialer: fallbackDialer, - ServerAddr: fallbackServerAddr, - }, - } - } - } - - dialTLSContextFunc := s2a.NewS2ADialTLSContextFunc(&s2a.ClientOptions{ - S2AAddress: config.s2aAddress, - FallbackOpts: fallbackOpts, - }) - return nil, dialTLSContextFunc, nil -} - -func getTransportConfig(opts *Options) (*transportConfig, error) { - clientCertSource, err := getClientCertificateSource(opts) - if err != nil { - return nil, err - } - endpoint, err := getEndpoint(opts, clientCertSource) - if err != nil { - return nil, err - } - defaultTransportConfig := transportConfig{ - clientCertSource: clientCertSource, - endpoint: endpoint, - } - - if !shouldUseS2A(clientCertSource, opts) { - return &defaultTransportConfig, nil - } - if !opts.isUniverseDomainGDU() { - return nil, errUniverseNotSupportedMTLS - } - - s2aMTLSEndpoint := opts.DefaultMTLSEndpoint - - s2aAddress := GetS2AAddress() - if s2aAddress == "" { - return &defaultTransportConfig, nil - } - return &transportConfig{ - clientCertSource: clientCertSource, - endpoint: endpoint, - s2aAddress: s2aAddress, - s2aMTLSEndpoint: s2aMTLSEndpoint, - }, nil -} - -// getClientCertificateSource returns a default client certificate source, if -// not provided by the user. -// -// A nil default source can be returned if the source does not exist. Any exceptions -// encountered while initializing the default source will be reported as client -// error (ex. corrupt metadata file). -func getClientCertificateSource(opts *Options) (cert.Provider, error) { - if !isClientCertificateEnabled() { - return nil, nil - } else if opts.ClientCertProvider != nil { - return opts.ClientCertProvider, nil - } - return cert.DefaultProvider() - -} - -// isClientCertificateEnabled returns true by default, unless explicitly set to false via env var. -func isClientCertificateEnabled() bool { - if value, ok := os.LookupEnv(googleAPIUseCertSource); ok { - // error as false is OK - b, _ := strconv.ParseBool(value) - return b - } - return true -} - -type transportConfig struct { - // The client certificate source. - clientCertSource cert.Provider - // The corresponding endpoint to use based on client certificate source. - endpoint string - // The S2A address if it can be used, otherwise an empty string. - s2aAddress string - // The MTLS endpoint to use with S2A. - s2aMTLSEndpoint string -} - -// getEndpoint returns the endpoint for the service, taking into account the -// user-provided endpoint override "settings.Endpoint". -// -// If no endpoint override is specified, we will either return the default endpoint or -// the default mTLS endpoint if a client certificate is available. -// -// You can override the default endpoint choice (mtls vs. regular) by setting the -// GOOGLE_API_USE_MTLS_ENDPOINT environment variable. -// -// If the endpoint override is an address (host:port) rather than full base -// URL (ex. https://...), then the user-provided address will be merged into -// the default endpoint. For example, WithEndpoint("myhost:8000") and -// DefaultEndpointTemplate("https://UNIVERSE_DOMAIN/bar/baz") will return "https://myhost:8080/bar/baz" -func getEndpoint(opts *Options, clientCertSource cert.Provider) (string, error) { - if opts.Endpoint == "" { - mtlsMode := getMTLSMode() - if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) { - if !opts.isUniverseDomainGDU() { - return "", errUniverseNotSupportedMTLS - } - return opts.DefaultMTLSEndpoint, nil - } - return opts.defaultEndpoint(), nil - } - if strings.Contains(opts.Endpoint, "://") { - // User passed in a full URL path, use it verbatim. - return opts.Endpoint, nil - } - if opts.defaultEndpoint() == "" { - // If DefaultEndpointTemplate is not configured, - // use the user provided endpoint verbatim. This allows a naked - // "host[:port]" URL to be used with GRPC Direct Path. - return opts.Endpoint, nil - } - - // Assume user-provided endpoint is host[:port], merge it with the default endpoint. - return opts.mergedEndpoint() -} - -func getMTLSMode() string { - mode := os.Getenv(googleAPIUseMTLS) - if mode == "" { - mode = os.Getenv(googleAPIUseMTLSOld) // Deprecated. - } - if mode == "" { - return mTLSModeAuto - } - return strings.ToLower(mode) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go deleted file mode 100644 index 96582ce7b6a..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go +++ /dev/null @@ -1,62 +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 cert - -import ( - "crypto/tls" - "errors" - "sync" -) - -// defaultCertData holds all the variables pertaining to -// the default certificate provider created by [DefaultProvider]. -// -// A singleton model is used to allow the provider to be reused -// by the transport layer. As mentioned in [DefaultProvider] (provider nil, nil) -// may be returned to indicate a default provider could not be found, which -// will skip extra tls config in the transport layer . -type defaultCertData struct { - once sync.Once - provider Provider - err error -} - -var ( - defaultCert defaultCertData -) - -// Provider is a function that can be passed into crypto/tls.Config.GetClientCertificate. -type Provider func(*tls.CertificateRequestInfo) (*tls.Certificate, error) - -// errSourceUnavailable is a sentinel error to indicate certificate source is unavailable. -var errSourceUnavailable = errors.New("certificate source is unavailable") - -// DefaultProvider returns a certificate source using the preferred EnterpriseCertificateProxySource. -// If EnterpriseCertificateProxySource is not available, fall back to the legacy SecureConnectSource. -// -// If neither source is available (due to missing configurations), a nil Source and a nil Error are -// returned to indicate that a default certificate source is unavailable. -func DefaultProvider() (Provider, error) { - defaultCert.once.Do(func() { - defaultCert.provider, defaultCert.err = NewEnterpriseCertificateProxyProvider("") - if errors.Is(defaultCert.err, errSourceUnavailable) { - defaultCert.provider, defaultCert.err = NewSecureConnectProvider("") - if errors.Is(defaultCert.err, errSourceUnavailable) { - defaultCert.provider, defaultCert.err = nil, nil - } - } - }) - return defaultCert.provider, defaultCert.err -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go deleted file mode 100644 index 36651591612..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go +++ /dev/null @@ -1,56 +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 cert - -import ( - "crypto/tls" - "errors" - - "github.com/googleapis/enterprise-certificate-proxy/client" -) - -type ecpSource struct { - key *client.Key -} - -// NewEnterpriseCertificateProxyProvider creates a certificate source -// using the Enterprise Certificate Proxy client, which delegates -// certifcate related operations to an OS-specific "signer binary" -// that communicates with the native keystore (ex. keychain on MacOS). -// -// The configFilePath points to a config file containing relevant parameters -// such as the certificate issuer and the location of the signer binary. -// If configFilePath is empty, the client will attempt to load the config from -// a well-known gcloud location. -func NewEnterpriseCertificateProxyProvider(configFilePath string) (Provider, error) { - key, err := client.Cred(configFilePath) - if err != nil { - if errors.Is(err, client.ErrCredUnavailable) { - return nil, errSourceUnavailable - } - return nil, err - } - - return (&ecpSource{ - key: key, - }).getClientCertificate, nil -} - -func (s *ecpSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) { - var cert tls.Certificate - cert.PrivateKey = s.key - cert.Certificate = s.key.CertificateChain() - return &cert, nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go deleted file mode 100644 index 3227aba280c..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go +++ /dev/null @@ -1,124 +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 cert - -import ( - "crypto/tls" - "crypto/x509" - "encoding/json" - "errors" - "fmt" - "os" - "os/exec" - "os/user" - "path/filepath" - "sync" - "time" -) - -const ( - metadataPath = ".secureConnect" - metadataFile = "context_aware_metadata.json" -) - -type secureConnectSource struct { - metadata secureConnectMetadata - - // Cache the cert to avoid executing helper command repeatedly. - cachedCertMutex sync.Mutex - cachedCert *tls.Certificate -} - -type secureConnectMetadata struct { - Cmd []string `json:"cert_provider_command"` -} - -// NewSecureConnectProvider creates a certificate source using -// the Secure Connect Helper and its associated metadata file. -// -// The configFilePath points to the location of the context aware metadata file. -// If configFilePath is empty, use the default context aware metadata location. -func NewSecureConnectProvider(configFilePath string) (Provider, error) { - if configFilePath == "" { - user, err := user.Current() - if err != nil { - // Error locating the default config means Secure Connect is not supported. - return nil, errSourceUnavailable - } - configFilePath = filepath.Join(user.HomeDir, metadataPath, metadataFile) - } - - file, err := os.ReadFile(configFilePath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - // Config file missing means Secure Connect is not supported. - return nil, errSourceUnavailable - } - return nil, err - } - - var metadata secureConnectMetadata - if err := json.Unmarshal(file, &metadata); err != nil { - return nil, fmt.Errorf("cert: could not parse JSON in %q: %w", configFilePath, err) - } - if err := validateMetadata(metadata); err != nil { - return nil, fmt.Errorf("cert: invalid config in %q: %w", configFilePath, err) - } - return (&secureConnectSource{ - metadata: metadata, - }).getClientCertificate, nil -} - -func validateMetadata(metadata secureConnectMetadata) error { - if len(metadata.Cmd) == 0 { - return errors.New("empty cert_provider_command") - } - return nil -} - -func (s *secureConnectSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) { - s.cachedCertMutex.Lock() - defer s.cachedCertMutex.Unlock() - if s.cachedCert != nil && !isCertificateExpired(s.cachedCert) { - return s.cachedCert, nil - } - // Expand OS environment variables in the cert provider command such as "$HOME". - for i := 0; i < len(s.metadata.Cmd); i++ { - s.metadata.Cmd[i] = os.ExpandEnv(s.metadata.Cmd[i]) - } - command := s.metadata.Cmd - data, err := exec.Command(command[0], command[1:]...).Output() - if err != nil { - return nil, err - } - cert, err := tls.X509KeyPair(data, data) - if err != nil { - return nil, err - } - s.cachedCert = &cert - return &cert, nil -} - -// isCertificateExpired returns true if the given cert is expired or invalid. -func isCertificateExpired(cert *tls.Certificate) bool { - if len(cert.Certificate) == 0 { - return true - } - parsed, err := x509.ParseCertificate(cert.Certificate[0]) - if err != nil { - return true - } - return time.Now().After(parsed.NotAfter) -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/s2a.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/s2a.go deleted file mode 100644 index 2ed532deb7a..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/s2a.go +++ /dev/null @@ -1,180 +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 transport - -import ( - "encoding/json" - "log" - "os" - "strconv" - "sync" - "time" - - "cloud.google.com/go/auth/internal/transport/cert" - "cloud.google.com/go/compute/metadata" -) - -const ( - configEndpointSuffix = "instance/platform-security/auto-mtls-configuration" -) - -var ( - // The period an MTLS config can be reused before needing refresh. - configExpiry = time.Hour - - // mdsMTLSAutoConfigSource is an instance of reuseMTLSConfigSource, with metadataMTLSAutoConfig as its config source. - mtlsOnce sync.Once -) - -// GetS2AAddress returns the S2A address to be reached via plaintext connection. -// Returns empty string if not set or invalid. -func GetS2AAddress() string { - c, err := getMetadataMTLSAutoConfig().Config() - if err != nil { - return "" - } - if !c.Valid() { - return "" - } - return c.S2A.PlaintextAddress -} - -type mtlsConfigSource interface { - Config() (*mtlsConfig, error) -} - -// mtlsConfig contains the configuration for establishing MTLS connections with Google APIs. -type mtlsConfig struct { - S2A *s2aAddresses `json:"s2a"` - Expiry time.Time -} - -func (c *mtlsConfig) Valid() bool { - return c != nil && c.S2A != nil && !c.expired() -} -func (c *mtlsConfig) expired() bool { - return c.Expiry.Before(time.Now()) -} - -// s2aAddresses contains the plaintext and/or MTLS S2A addresses. -type s2aAddresses struct { - // PlaintextAddress is the plaintext address to reach S2A - PlaintextAddress string `json:"plaintext_address"` - // MTLSAddress is the MTLS address to reach S2A - MTLSAddress string `json:"mtls_address"` -} - -// getMetadataMTLSAutoConfig returns mdsMTLSAutoConfigSource, which is backed by config from MDS with auto-refresh. -func getMetadataMTLSAutoConfig() mtlsConfigSource { - mtlsOnce.Do(func() { - mdsMTLSAutoConfigSource = &reuseMTLSConfigSource{ - src: &metadataMTLSAutoConfig{}, - } - }) - return mdsMTLSAutoConfigSource -} - -// reuseMTLSConfigSource caches a valid version of mtlsConfig, and uses `src` to refresh upon config expiry. -// It implements the mtlsConfigSource interface, so calling Config() on it returns an mtlsConfig. -type reuseMTLSConfigSource struct { - src mtlsConfigSource // src.Config() is called when config is expired - mu sync.Mutex // mutex guards config - config *mtlsConfig // cached config -} - -func (cs *reuseMTLSConfigSource) Config() (*mtlsConfig, error) { - cs.mu.Lock() - defer cs.mu.Unlock() - - if cs.config.Valid() { - return cs.config, nil - } - c, err := cs.src.Config() - if err != nil { - return nil, err - } - cs.config = c - return c, nil -} - -// metadataMTLSAutoConfig is an implementation of the interface mtlsConfigSource -// It has the logic to query MDS and return an mtlsConfig -type metadataMTLSAutoConfig struct{} - -var httpGetMetadataMTLSConfig = func() (string, error) { - return metadata.Get(configEndpointSuffix) -} - -func (cs *metadataMTLSAutoConfig) Config() (*mtlsConfig, error) { - resp, err := httpGetMetadataMTLSConfig() - if err != nil { - log.Printf("querying MTLS config from MDS endpoint failed: %v", err) - return defaultMTLSConfig(), nil - } - var config mtlsConfig - err = json.Unmarshal([]byte(resp), &config) - if err != nil { - log.Printf("unmarshalling MTLS config from MDS endpoint failed: %v", err) - return defaultMTLSConfig(), nil - } - - if config.S2A == nil { - log.Printf("returned MTLS config from MDS endpoint is invalid: %v", config) - return defaultMTLSConfig(), nil - } - - // set new expiry - config.Expiry = time.Now().Add(configExpiry) - return &config, nil -} - -func defaultMTLSConfig() *mtlsConfig { - return &mtlsConfig{ - S2A: &s2aAddresses{ - PlaintextAddress: "", - MTLSAddress: "", - }, - Expiry: time.Now().Add(configExpiry), - } -} - -func shouldUseS2A(clientCertSource cert.Provider, opts *Options) bool { - // If client cert is found, use that over S2A. - if clientCertSource != nil { - return false - } - // If EXPERIMENTAL_GOOGLE_API_USE_S2A is not set to true, skip S2A. - if !isGoogleS2AEnabled() { - return false - } - // If DefaultMTLSEndpoint is not set or has endpoint override, skip S2A. - if opts.DefaultMTLSEndpoint == "" || opts.Endpoint != "" { - return false - } - // If custom HTTP client is provided, skip S2A. - if opts.Client != nil { - return false - } - // If directPath is enabled, skip S2A. - return !opts.EnableDirectPath && !opts.EnableDirectPathXds -} - -func isGoogleS2AEnabled() bool { - b, err := strconv.ParseBool(os.Getenv(googleAPIUseS2AEnv)) - if err != nil { - return false - } - return b -} diff --git a/upstream/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/upstream/vendor/cloud.google.com/go/auth/internal/transport/transport.go deleted file mode 100644 index b76386d3c0d..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/internal/transport/transport.go +++ /dev/null @@ -1,76 +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 transport provided internal helpers for the two transport packages -// (grpctransport and httptransport). -package transport - -import ( - "fmt" - - "cloud.google.com/go/auth/credentials" -) - -// CloneDetectOptions clones a user set detect option into some new memory that -// we can internally manipulate before sending onto the detect package. -func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions { - if oldDo == nil { - // it is valid for users not to set this, but we will need to to default - // some options for them in this case so return some initialized memory - // to work with. - return &credentials.DetectOptions{} - } - newDo := &credentials.DetectOptions{ - // Simple types - Audience: oldDo.Audience, - Subject: oldDo.Subject, - EarlyTokenRefresh: oldDo.EarlyTokenRefresh, - TokenURL: oldDo.TokenURL, - STSAudience: oldDo.STSAudience, - CredentialsFile: oldDo.CredentialsFile, - UseSelfSignedJWT: oldDo.UseSelfSignedJWT, - UniverseDomain: oldDo.UniverseDomain, - - // These fields are are pointer types that we just want to use exactly - // as the user set, copy the ref - Client: oldDo.Client, - AuthHandlerOptions: oldDo.AuthHandlerOptions, - } - - // Smartly size this memory and copy below. - if oldDo.CredentialsJSON != nil { - newDo.CredentialsJSON = make([]byte, len(oldDo.CredentialsJSON)) - copy(newDo.CredentialsJSON, oldDo.CredentialsJSON) - } - if oldDo.Scopes != nil { - newDo.Scopes = make([]string, len(oldDo.Scopes)) - copy(newDo.Scopes, oldDo.Scopes) - } - - return newDo -} - -// ValidateUniverseDomain verifies that the universe domain configured for the -// client matches the universe domain configured for the credentials. -func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain string) error { - if clientUniverseDomain != credentialsUniverseDomain { - return fmt.Errorf( - "the configured universe domain (%q) does not match the universe "+ - "domain found in the credentials (%q). If you haven't configured "+ - "the universe domain explicitly, \"googleapis.com\" is the default", - clientUniverseDomain, - credentialsUniverseDomain) - } - return nil -} diff --git a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md b/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md deleted file mode 100644 index ff9747beda0..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md +++ /dev/null @@ -1,40 +0,0 @@ -# Changelog - -## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.1...auth/oauth2adapt/v0.2.2) (2024-04-23) - - -### Bug Fixes - -* **auth/oauth2adapt:** Bump x/net to v0.24.0 ([ba31ed5](https://github.com/googleapis/google-cloud-go/commit/ba31ed5fda2c9664f2e1cf972469295e63deb5b4)) - -## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.0...auth/oauth2adapt/v0.2.1) (2024-04-18) - - -### Bug Fixes - -* **auth/oauth2adapt:** Adapt Token Types to be translated ([#9801](https://github.com/googleapis/google-cloud-go/issues/9801)) ([70f4115](https://github.com/googleapis/google-cloud-go/commit/70f411555ebbf2b71e6d425cc8d2030644c6b438)), refs [#9800](https://github.com/googleapis/google-cloud-go/issues/9800) - -## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.1.0...auth/oauth2adapt/v0.2.0) (2024-04-16) - - -### Features - -* **auth/oauth2adapt:** Add helpers for working with credentials types ([#9694](https://github.com/googleapis/google-cloud-go/issues/9694)) ([cf33b55](https://github.com/googleapis/google-cloud-go/commit/cf33b5514423a2ac5c2a323a1cd99aac34fd4233)) - - -### Bug Fixes - -* **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) - -## 0.1.0 (2023-10-19) - - -### Features - -* **auth/oauth2adapt:** Adds a new module to translate types ([#8595](https://github.com/googleapis/google-cloud-go/issues/8595)) ([6933c5a](https://github.com/googleapis/google-cloud-go/commit/6933c5a0c1fc8e58cbfff8bbca439d671b94672f)) -* **auth/oauth2adapt:** Fixup deps for release ([#8747](https://github.com/googleapis/google-cloud-go/issues/8747)) ([749d243](https://github.com/googleapis/google-cloud-go/commit/749d243862b025a6487a4d2d339219889b4cfe70)) - - -### Bug Fixes - -* **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) diff --git a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE b/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go b/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go deleted file mode 100644 index 9835ac571cf..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go +++ /dev/null @@ -1,164 +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 oauth2adapt helps converts types used in [cloud.google.com/go/auth] -// and [golang.org/x/oauth2]. -package oauth2adapt - -import ( - "context" - "encoding/json" - "errors" - - "cloud.google.com/go/auth" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" -) - -// TokenProviderFromTokenSource converts any [golang.org/x/oauth2.TokenSource] -// into a [cloud.google.com/go/auth.TokenProvider]. -func TokenProviderFromTokenSource(ts oauth2.TokenSource) auth.TokenProvider { - return &tokenProviderAdapter{ts: ts} -} - -type tokenProviderAdapter struct { - ts oauth2.TokenSource -} - -// Token fulfills the [cloud.google.com/go/auth.TokenProvider] interface. It -// is a light wrapper around the underlying TokenSource. -func (tp *tokenProviderAdapter) Token(context.Context) (*auth.Token, error) { - tok, err := tp.ts.Token() - if err != nil { - var err2 *oauth2.RetrieveError - if ok := errors.As(err, &err2); ok { - return nil, AuthErrorFromRetrieveError(err2) - } - return nil, err - } - return &auth.Token{ - Value: tok.AccessToken, - Type: tok.Type(), - Expiry: tok.Expiry, - }, nil -} - -// TokenSourceFromTokenProvider converts any -// [cloud.google.com/go/auth.TokenProvider] into a -// [golang.org/x/oauth2.TokenSource]. -func TokenSourceFromTokenProvider(tp auth.TokenProvider) oauth2.TokenSource { - return &tokenSourceAdapter{tp: tp} -} - -type tokenSourceAdapter struct { - tp auth.TokenProvider -} - -// Token fulfills the [golang.org/x/oauth2.TokenSource] interface. It -// is a light wrapper around the underlying TokenProvider. -func (ts *tokenSourceAdapter) Token() (*oauth2.Token, error) { - tok, err := ts.tp.Token(context.Background()) - if err != nil { - var err2 *auth.Error - if ok := errors.As(err, &err2); ok { - return nil, AddRetrieveErrorToAuthError(err2) - } - return nil, err - } - return &oauth2.Token{ - AccessToken: tok.Value, - TokenType: tok.Type, - Expiry: tok.Expiry, - }, nil -} - -// AuthCredentialsFromOauth2Credentials converts a [golang.org/x/oauth2/google.Credentials] -// to a [cloud.google.com/go/auth.Credentials]. -func AuthCredentialsFromOauth2Credentials(creds *google.Credentials) *auth.Credentials { - if creds == nil { - return nil - } - return auth.NewCredentials(&auth.CredentialsOptions{ - TokenProvider: TokenProviderFromTokenSource(creds.TokenSource), - JSON: creds.JSON, - ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) { - return creds.ProjectID, nil - }), - UniverseDomainProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) { - return creds.GetUniverseDomain() - }), - }) -} - -// Oauth2CredentialsFromAuthCredentials converts a [cloud.google.com/go/auth.Credentials] -// to a [golang.org/x/oauth2/google.Credentials]. -func Oauth2CredentialsFromAuthCredentials(creds *auth.Credentials) *google.Credentials { - if creds == nil { - return nil - } - // Throw away errors as old credentials are not request aware. Also, no - // network requests are currently happening for this use case. - projectID, _ := creds.ProjectID(context.Background()) - - return &google.Credentials{ - TokenSource: TokenSourceFromTokenProvider(creds.TokenProvider), - ProjectID: projectID, - JSON: creds.JSON(), - UniverseDomainProvider: func() (string, error) { - return creds.UniverseDomain(context.Background()) - }, - } -} - -type oauth2Error struct { - ErrorCode string `json:"error"` - ErrorDescription string `json:"error_description"` - ErrorURI string `json:"error_uri"` -} - -// AddRetrieveErrorToAuthError returns the same error provided and adds a -// [golang.org/x/oauth2.RetrieveError] to the error chain by setting the `Err` field on the -// [cloud.google.com/go/auth.Error]. -func AddRetrieveErrorToAuthError(err *auth.Error) *auth.Error { - if err == nil { - return nil - } - e := &oauth2.RetrieveError{ - Response: err.Response, - Body: err.Body, - } - err.Err = e - if len(err.Body) > 0 { - var oErr oauth2Error - // ignore the error as it only fills in extra details - json.Unmarshal(err.Body, &oErr) - e.ErrorCode = oErr.ErrorCode - e.ErrorDescription = oErr.ErrorDescription - e.ErrorURI = oErr.ErrorURI - } - return err -} - -// AuthErrorFromRetrieveError returns an [cloud.google.com/go/auth.Error] that -// wraps the provided [golang.org/x/oauth2.RetrieveError]. -func AuthErrorFromRetrieveError(err *oauth2.RetrieveError) *auth.Error { - if err == nil { - return nil - } - return &auth.Error{ - Response: err.Response, - Body: err.Body, - Err: err, - } -} diff --git a/upstream/vendor/cloud.google.com/go/auth/threelegged.go b/upstream/vendor/cloud.google.com/go/auth/threelegged.go deleted file mode 100644 index 1b8d83c4b4f..00000000000 --- a/upstream/vendor/cloud.google.com/go/auth/threelegged.go +++ /dev/null @@ -1,373 +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 auth - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "mime" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "cloud.google.com/go/auth/internal" -) - -// AuthorizationHandler is a 3-legged-OAuth helper that prompts the user for -// OAuth consent at the specified auth code URL and returns an auth code and -// state upon approval. -type AuthorizationHandler func(authCodeURL string) (code string, state string, err error) - -// Options3LO are the options for doing a 3-legged OAuth2 flow. -type Options3LO struct { - // ClientID is the application's ID. - ClientID string - // ClientSecret is the application's secret. Not required if AuthHandlerOpts - // is set. - ClientSecret string - // AuthURL is the URL for authenticating. - AuthURL string - // TokenURL is the URL for retrieving a token. - TokenURL string - // AuthStyle is used to describe how to client info in the token request. - AuthStyle Style - // RefreshToken is the token used to refresh the credential. Not required - // if AuthHandlerOpts is set. - RefreshToken string - // RedirectURL is the URL to redirect users to. Optional. - RedirectURL string - // Scopes specifies requested permissions for the Token. Optional. - Scopes []string - - // URLParams are the set of values to apply to the token exchange. Optional. - URLParams url.Values - // Client is the client to be used to make the underlying token requests. - // Optional. - Client *http.Client - // EarlyTokenExpiry is the time before the token expires that it should be - // refreshed. If not set the default value is 10 seconds. Optional. - EarlyTokenExpiry time.Duration - - // AuthHandlerOpts provides a set of options for doing a - // 3-legged OAuth2 flow with a custom [AuthorizationHandler]. Optional. - AuthHandlerOpts *AuthorizationHandlerOptions -} - -func (o *Options3LO) validate() error { - if o == nil { - return errors.New("auth: options must be provided") - } - if o.ClientID == "" { - return errors.New("auth: client ID must be provided") - } - if o.AuthHandlerOpts == nil && o.ClientSecret == "" { - return errors.New("auth: client secret must be provided") - } - if o.AuthURL == "" { - return errors.New("auth: auth URL must be provided") - } - if o.TokenURL == "" { - return errors.New("auth: token URL must be provided") - } - if o.AuthStyle == StyleUnknown { - return errors.New("auth: auth style must be provided") - } - if o.AuthHandlerOpts == nil && o.RefreshToken == "" { - return errors.New("auth: refresh token must be provided") - } - return nil -} - -// PKCEOptions holds parameters to support PKCE. -type PKCEOptions struct { - // Challenge is the un-padded, base64-url-encoded string of the encrypted code verifier. - Challenge string // The un-padded, base64-url-encoded string of the encrypted code verifier. - // ChallengeMethod is the encryption method (ex. S256). - ChallengeMethod string - // Verifier is the original, non-encrypted secret. - Verifier string // The original, non-encrypted secret. -} - -type tokenJSON struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - RefreshToken string `json:"refresh_token"` - ExpiresIn int `json:"expires_in"` - // error fields - ErrorCode string `json:"error"` - ErrorDescription string `json:"error_description"` - ErrorURI string `json:"error_uri"` -} - -func (e *tokenJSON) expiry() (t time.Time) { - if v := e.ExpiresIn; v != 0 { - return time.Now().Add(time.Duration(v) * time.Second) - } - return -} - -func (o *Options3LO) client() *http.Client { - if o.Client != nil { - return o.Client - } - return internal.CloneDefaultClient() -} - -// authCodeURL returns a URL that points to a OAuth2 consent page. -func (o *Options3LO) authCodeURL(state string, values url.Values) string { - var buf bytes.Buffer - buf.WriteString(o.AuthURL) - v := url.Values{ - "response_type": {"code"}, - "client_id": {o.ClientID}, - } - if o.RedirectURL != "" { - v.Set("redirect_uri", o.RedirectURL) - } - if len(o.Scopes) > 0 { - v.Set("scope", strings.Join(o.Scopes, " ")) - } - if state != "" { - v.Set("state", state) - } - if o.AuthHandlerOpts != nil { - if o.AuthHandlerOpts.PKCEOpts != nil && - o.AuthHandlerOpts.PKCEOpts.Challenge != "" { - v.Set(codeChallengeKey, o.AuthHandlerOpts.PKCEOpts.Challenge) - } - if o.AuthHandlerOpts.PKCEOpts != nil && - o.AuthHandlerOpts.PKCEOpts.ChallengeMethod != "" { - v.Set(codeChallengeMethodKey, o.AuthHandlerOpts.PKCEOpts.ChallengeMethod) - } - } - for k := range values { - v.Set(k, v.Get(k)) - } - if strings.Contains(o.AuthURL, "?") { - buf.WriteByte('&') - } else { - buf.WriteByte('?') - } - buf.WriteString(v.Encode()) - return buf.String() -} - -// New3LOTokenProvider returns a [TokenProvider] based on the 3-legged OAuth2 -// configuration. The TokenProvider is caches and auto-refreshes tokens by -// default. -func New3LOTokenProvider(opts *Options3LO) (TokenProvider, error) { - if err := opts.validate(); err != nil { - return nil, err - } - if opts.AuthHandlerOpts != nil { - return new3LOTokenProviderWithAuthHandler(opts), nil - } - return NewCachedTokenProvider(&tokenProvider3LO{opts: opts, refreshToken: opts.RefreshToken, client: opts.client()}, &CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenExpiry, - }), nil -} - -// AuthorizationHandlerOptions provides a set of options to specify for doing a -// 3-legged OAuth2 flow with a custom [AuthorizationHandler]. -type AuthorizationHandlerOptions struct { - // AuthorizationHandler specifies the handler used to for the authorization - // part of the flow. - Handler AuthorizationHandler - // State is used verify that the "state" is identical in the request and - // response before exchanging the auth code for OAuth2 token. - State string - // PKCEOpts allows setting configurations for PKCE. Optional. - PKCEOpts *PKCEOptions -} - -func new3LOTokenProviderWithAuthHandler(opts *Options3LO) TokenProvider { - return NewCachedTokenProvider(&tokenProviderWithHandler{opts: opts, state: opts.AuthHandlerOpts.State}, &CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenExpiry, - }) -} - -// exchange handles the final exchange portion of the 3lo flow. Returns a Token, -// refreshToken, and error. -func (o *Options3LO) exchange(ctx context.Context, code string) (*Token, string, error) { - // Build request - v := url.Values{ - "grant_type": {"authorization_code"}, - "code": {code}, - } - if o.RedirectURL != "" { - v.Set("redirect_uri", o.RedirectURL) - } - if o.AuthHandlerOpts != nil && - o.AuthHandlerOpts.PKCEOpts != nil && - o.AuthHandlerOpts.PKCEOpts.Verifier != "" { - v.Set(codeVerifierKey, o.AuthHandlerOpts.PKCEOpts.Verifier) - } - for k := range o.URLParams { - v.Set(k, o.URLParams.Get(k)) - } - return fetchToken(ctx, o, v) -} - -// This struct is not safe for concurrent access alone, but the way it is used -// in this package by wrapping it with a cachedTokenProvider makes it so. -type tokenProvider3LO struct { - opts *Options3LO - client *http.Client - refreshToken string -} - -func (tp *tokenProvider3LO) Token(ctx context.Context) (*Token, error) { - if tp.refreshToken == "" { - return nil, errors.New("auth: token expired and refresh token is not set") - } - v := url.Values{ - "grant_type": {"refresh_token"}, - "refresh_token": {tp.refreshToken}, - } - for k := range tp.opts.URLParams { - v.Set(k, tp.opts.URLParams.Get(k)) - } - - tk, rt, err := fetchToken(ctx, tp.opts, v) - if err != nil { - return nil, err - } - if tp.refreshToken != rt && rt != "" { - tp.refreshToken = rt - } - return tk, err -} - -type tokenProviderWithHandler struct { - opts *Options3LO - state string -} - -func (tp tokenProviderWithHandler) Token(ctx context.Context) (*Token, error) { - url := tp.opts.authCodeURL(tp.state, nil) - code, state, err := tp.opts.AuthHandlerOpts.Handler(url) - if err != nil { - return nil, err - } - if state != tp.state { - return nil, errors.New("auth: state mismatch in 3-legged-OAuth flow") - } - tok, _, err := tp.opts.exchange(ctx, code) - return tok, err -} - -// fetchToken returns a Token, refresh token, and/or an error. -func fetchToken(ctx context.Context, o *Options3LO, v url.Values) (*Token, string, error) { - var refreshToken string - if o.AuthStyle == StyleInParams { - if o.ClientID != "" { - v.Set("client_id", o.ClientID) - } - if o.ClientSecret != "" { - v.Set("client_secret", o.ClientSecret) - } - } - req, err := http.NewRequest("POST", o.TokenURL, strings.NewReader(v.Encode())) - if err != nil { - return nil, refreshToken, err - } - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - if o.AuthStyle == StyleInHeader { - req.SetBasicAuth(url.QueryEscape(o.ClientID), url.QueryEscape(o.ClientSecret)) - } - - // Make request - r, err := o.client().Do(req.WithContext(ctx)) - if err != nil { - return nil, refreshToken, err - } - body, err := internal.ReadAll(r.Body) - r.Body.Close() - if err != nil { - return nil, refreshToken, fmt.Errorf("auth: cannot fetch token: %w", err) - } - - failureStatus := r.StatusCode < 200 || r.StatusCode > 299 - tokError := &Error{ - Response: r, - Body: body, - } - - var token *Token - // errors ignored because of default switch on content - content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) - switch content { - case "application/x-www-form-urlencoded", "text/plain": - // some endpoints return a query string - vals, err := url.ParseQuery(string(body)) - if err != nil { - if failureStatus { - return nil, refreshToken, tokError - } - return nil, refreshToken, fmt.Errorf("auth: cannot parse response: %w", err) - } - tokError.code = vals.Get("error") - tokError.description = vals.Get("error_description") - tokError.uri = vals.Get("error_uri") - token = &Token{ - Value: vals.Get("access_token"), - Type: vals.Get("token_type"), - Metadata: make(map[string]interface{}, len(vals)), - } - for k, v := range vals { - token.Metadata[k] = v - } - refreshToken = vals.Get("refresh_token") - e := vals.Get("expires_in") - expires, _ := strconv.Atoi(e) - if expires != 0 { - token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) - } - default: - var tj tokenJSON - if err = json.Unmarshal(body, &tj); err != nil { - if failureStatus { - return nil, refreshToken, tokError - } - return nil, refreshToken, fmt.Errorf("auth: cannot parse json: %w", err) - } - tokError.code = tj.ErrorCode - tokError.description = tj.ErrorDescription - tokError.uri = tj.ErrorURI - token = &Token{ - Value: tj.AccessToken, - Type: tj.TokenType, - Expiry: tj.expiry(), - Metadata: make(map[string]interface{}), - } - json.Unmarshal(body, &token.Metadata) // optional field, skip err check - refreshToken = tj.RefreshToken - } - // according to spec, servers should respond status 400 in error case - // https://www.rfc-editor.org/rfc/rfc6749#section-5.2 - // but some unorthodox servers respond 200 in error case - if failureStatus || tokError.code != "" { - return nil, refreshToken, tokError - } - if token.Value == "" { - return nil, refreshToken, errors.New("auth: server response missing access_token") - } - return token, refreshToken, nil -} diff --git a/upstream/vendor/cloud.google.com/go/LICENSE b/upstream/vendor/cloud.google.com/go/compute/LICENSE similarity index 100% rename from upstream/vendor/cloud.google.com/go/LICENSE rename to upstream/vendor/cloud.google.com/go/compute/LICENSE diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go b/upstream/vendor/cloud.google.com/go/compute/internal/version.go similarity index 66% rename from upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go rename to upstream/vendor/cloud.google.com/go/compute/internal/version.go index 74689acbbbf..291a237fe1c 100644 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go +++ b/upstream/vendor/cloud.google.com/go/compute/internal/version.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,17 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux +package internal -package metadata - -import ( - "os" - "strings" -) - -func systemInfoSuggestsGCE() bool { - b, _ := os.ReadFile("/sys/class/dmi/id/product_name") - name := strings.TrimSpace(string(b)) - return name == "Google" || name == "Google Compute Engine" -} +// Version is the current tagged release of the library. +const Version = "1.24.0" diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/CHANGES.md b/upstream/vendor/cloud.google.com/go/compute/metadata/CHANGES.md index 9594e1e2793..06b957349af 100644 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/CHANGES.md +++ b/upstream/vendor/cloud.google.com/go/compute/metadata/CHANGES.md @@ -1,31 +1,5 @@ # Changes -## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10) - - -### Features - -* **compute/metadata:** Add sys check for windows OnGCE ([#10521](https://github.com/googleapis/google-cloud-go/issues/10521)) ([3b9a830](https://github.com/googleapis/google-cloud-go/commit/3b9a83063960d2a2ac20beb47cc15818a68bd302)) - -## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.3.0...compute/metadata/v0.4.0) (2024-07-01) - - -### Features - -* **compute/metadata:** Add context for all functions/methods ([#10370](https://github.com/googleapis/google-cloud-go/issues/10370)) ([66b8efe](https://github.com/googleapis/google-cloud-go/commit/66b8efe7ad877e052b2987bb4475477e38c67bb3)) - - -### Documentation - -* **compute/metadata:** Update OnGCE description ([#10408](https://github.com/googleapis/google-cloud-go/issues/10408)) ([6a46dca](https://github.com/googleapis/google-cloud-go/commit/6a46dca4eae4f88ec6f88822e01e5bf8aeca787f)) - -## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.3...compute/metadata/v0.3.0) (2024-04-15) - - -### Features - -* **compute/metadata:** Add context aware functions ([#9733](https://github.com/googleapis/google-cloud-go/issues/9733)) ([e4eb5b4](https://github.com/googleapis/google-cloud-go/commit/e4eb5b46ee2aec9d2fc18300bfd66015e25a0510)) - ## [0.2.3](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.2...compute/metadata/v0.2.3) (2022-12-15) diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/metadata.go b/upstream/vendor/cloud.google.com/go/compute/metadata/metadata.go index 345080b7297..c17faa142a4 100644 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ b/upstream/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -23,11 +23,12 @@ import ( "context" "encoding/json" "fmt" - "io" + "io/ioutil" "net" "net/http" "net/url" "os" + "runtime" "strings" "sync" "time" @@ -87,16 +88,16 @@ func (suffix NotDefinedError) Error() string { return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) } -func (c *cachedValue) get(ctx context.Context, cl *Client) (v string, err error) { +func (c *cachedValue) get(cl *Client) (v string, err error) { defer c.mu.Unlock() c.mu.Lock() if c.v != "" { return c.v, nil } if c.trim { - v, err = cl.getTrimmed(ctx, c.k) + v, err = cl.getTrimmed(c.k) } else { - v, err = cl.GetWithContext(ctx, c.k) + v, err = cl.Get(c.k) } if err == nil { c.v = v @@ -109,9 +110,7 @@ var ( onGCE bool ) -// OnGCE reports whether this process is running on Google Compute Platforms. -// NOTE: True returned from `OnGCE` does not guarantee that the metadata server -// is accessible from this process and have all the metadata defined. +// OnGCE reports whether this process is running on Google Compute Engine. func OnGCE() bool { onGCEOnce.Do(initOnGCE) return onGCE @@ -189,213 +188,78 @@ func testOnGCE() bool { return <-resc } -// Subscribe calls Client.SubscribeWithContext on the default client. -// -// Deprecated: Please use the context aware variant [SubscribeWithContext]. -func Subscribe(suffix string, fn func(v string, ok bool) error) error { - return defaultClient.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) }) -} - -// SubscribeWithContext calls Client.SubscribeWithContext on the default client. -func SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error { - return defaultClient.SubscribeWithContext(ctx, suffix, fn) +// systemInfoSuggestsGCE reports whether the local system (without +// doing network requests) suggests that we're running on GCE. If this +// returns true, testOnGCE tries a bit harder to reach its metadata +// server. +func systemInfoSuggestsGCE() bool { + if runtime.GOOS != "linux" { + // We don't have any non-Linux clues available, at least yet. + return false + } + slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") + name := strings.TrimSpace(string(slurp)) + return name == "Google" || name == "Google Compute Engine" } -// Get calls Client.GetWithContext on the default client. -// -// Deprecated: Please use the context aware variant [GetWithContext]. -func Get(suffix string) (string, error) { - return defaultClient.GetWithContext(context.Background(), suffix) +// Subscribe calls Client.Subscribe on the default client. +func Subscribe(suffix string, fn func(v string, ok bool) error) error { + return defaultClient.Subscribe(suffix, fn) } -// GetWithContext calls Client.GetWithContext on the default client. -func GetWithContext(ctx context.Context, suffix string) (string, error) { - return defaultClient.GetWithContext(ctx, suffix) -} +// Get calls Client.Get on the default client. +func Get(suffix string) (string, error) { return defaultClient.Get(suffix) } // ProjectID returns the current instance's project ID string. -// -// Deprecated: Please use the context aware variant [ProjectIDWithContext]. -func ProjectID() (string, error) { - return defaultClient.ProjectIDWithContext(context.Background()) -} - -// ProjectIDWithContext returns the current instance's project ID string. -func ProjectIDWithContext(ctx context.Context) (string, error) { - return defaultClient.ProjectIDWithContext(ctx) -} +func ProjectID() (string, error) { return defaultClient.ProjectID() } // NumericProjectID returns the current instance's numeric project ID. -// -// Deprecated: Please use the context aware variant [NumericProjectIDWithContext]. -func NumericProjectID() (string, error) { - return defaultClient.NumericProjectIDWithContext(context.Background()) -} - -// NumericProjectIDWithContext returns the current instance's numeric project ID. -func NumericProjectIDWithContext(ctx context.Context) (string, error) { - return defaultClient.NumericProjectIDWithContext(ctx) -} +func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() } // InternalIP returns the instance's primary internal IP address. -// -// Deprecated: Please use the context aware variant [InternalIPWithContext]. -func InternalIP() (string, error) { - return defaultClient.InternalIPWithContext(context.Background()) -} - -// InternalIPWithContext returns the instance's primary internal IP address. -func InternalIPWithContext(ctx context.Context) (string, error) { - return defaultClient.InternalIPWithContext(ctx) -} +func InternalIP() (string, error) { return defaultClient.InternalIP() } // ExternalIP returns the instance's primary external (public) IP address. -// -// Deprecated: Please use the context aware variant [ExternalIPWithContext]. -func ExternalIP() (string, error) { - return defaultClient.ExternalIPWithContext(context.Background()) -} - -// ExternalIPWithContext returns the instance's primary external (public) IP address. -func ExternalIPWithContext(ctx context.Context) (string, error) { - return defaultClient.ExternalIPWithContext(ctx) -} - -// Email calls Client.EmailWithContext on the default client. -// -// Deprecated: Please use the context aware variant [EmailWithContext]. -func Email(serviceAccount string) (string, error) { - return defaultClient.EmailWithContext(context.Background(), serviceAccount) -} +func ExternalIP() (string, error) { return defaultClient.ExternalIP() } -// EmailWithContext calls Client.EmailWithContext on the default client. -func EmailWithContext(ctx context.Context, serviceAccount string) (string, error) { - return defaultClient.EmailWithContext(ctx, serviceAccount) -} +// Email calls Client.Email on the default client. +func Email(serviceAccount string) (string, error) { return defaultClient.Email(serviceAccount) } // Hostname returns the instance's hostname. This will be of the form // ".c..internal". -// -// Deprecated: Please use the context aware variant [HostnameWithContext]. -func Hostname() (string, error) { - return defaultClient.HostnameWithContext(context.Background()) -} - -// HostnameWithContext returns the instance's hostname. This will be of the form -// ".c..internal". -func HostnameWithContext(ctx context.Context) (string, error) { - return defaultClient.HostnameWithContext(ctx) -} +func Hostname() (string, error) { return defaultClient.Hostname() } // InstanceTags returns the list of user-defined instance tags, // assigned when initially creating a GCE instance. -// -// Deprecated: Please use the context aware variant [InstanceTagsWithContext]. -func InstanceTags() ([]string, error) { - return defaultClient.InstanceTagsWithContext(context.Background()) -} - -// InstanceTagsWithContext returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func InstanceTagsWithContext(ctx context.Context) ([]string, error) { - return defaultClient.InstanceTagsWithContext(ctx) -} +func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() } // InstanceID returns the current VM's numeric instance ID. -// -// Deprecated: Please use the context aware variant [InstanceIDWithContext]. -func InstanceID() (string, error) { - return defaultClient.InstanceIDWithContext(context.Background()) -} - -// InstanceIDWithContext returns the current VM's numeric instance ID. -func InstanceIDWithContext(ctx context.Context) (string, error) { - return defaultClient.InstanceIDWithContext(ctx) -} +func InstanceID() (string, error) { return defaultClient.InstanceID() } // InstanceName returns the current VM's instance ID string. -// -// Deprecated: Please use the context aware variant [InstanceNameWithContext]. -func InstanceName() (string, error) { - return defaultClient.InstanceNameWithContext(context.Background()) -} - -// InstanceNameWithContext returns the current VM's instance ID string. -func InstanceNameWithContext(ctx context.Context) (string, error) { - return defaultClient.InstanceNameWithContext(ctx) -} +func InstanceName() (string, error) { return defaultClient.InstanceName() } // Zone returns the current VM's zone, such as "us-central1-b". -// -// Deprecated: Please use the context aware variant [ZoneWithContext]. -func Zone() (string, error) { - return defaultClient.ZoneWithContext(context.Background()) -} - -// ZoneWithContext returns the current VM's zone, such as "us-central1-b". -func ZoneWithContext(ctx context.Context) (string, error) { - return defaultClient.ZoneWithContext(ctx) -} +func Zone() (string, error) { return defaultClient.Zone() } -// InstanceAttributes calls Client.InstanceAttributesWithContext on the default client. -// -// Deprecated: Please use the context aware variant [InstanceAttributesWithContext. -func InstanceAttributes() ([]string, error) { - return defaultClient.InstanceAttributesWithContext(context.Background()) -} - -// InstanceAttributesWithContext calls Client.ProjectAttributesWithContext on the default client. -func InstanceAttributesWithContext(ctx context.Context) ([]string, error) { - return defaultClient.InstanceAttributesWithContext(ctx) -} - -// ProjectAttributes calls Client.ProjectAttributesWithContext on the default client. -// -// Deprecated: Please use the context aware variant [ProjectAttributesWithContext]. -func ProjectAttributes() ([]string, error) { - return defaultClient.ProjectAttributesWithContext(context.Background()) -} +// InstanceAttributes calls Client.InstanceAttributes on the default client. +func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() } -// ProjectAttributesWithContext calls Client.ProjectAttributesWithContext on the default client. -func ProjectAttributesWithContext(ctx context.Context) ([]string, error) { - return defaultClient.ProjectAttributesWithContext(ctx) -} +// ProjectAttributes calls Client.ProjectAttributes on the default client. +func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() } -// InstanceAttributeValue calls Client.InstanceAttributeValueWithContext on the default client. -// -// Deprecated: Please use the context aware variant [InstanceAttributeValueWithContext]. +// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client. func InstanceAttributeValue(attr string) (string, error) { - return defaultClient.InstanceAttributeValueWithContext(context.Background(), attr) -} - -// InstanceAttributeValueWithContext calls Client.InstanceAttributeValueWithContext on the default client. -func InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) { - return defaultClient.InstanceAttributeValueWithContext(ctx, attr) + return defaultClient.InstanceAttributeValue(attr) } -// ProjectAttributeValue calls Client.ProjectAttributeValueWithContext on the default client. -// -// Deprecated: Please use the context aware variant [ProjectAttributeValueWithContext]. +// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client. func ProjectAttributeValue(attr string) (string, error) { - return defaultClient.ProjectAttributeValueWithContext(context.Background(), attr) -} - -// ProjectAttributeValueWithContext calls Client.ProjectAttributeValueWithContext on the default client. -func ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) { - return defaultClient.ProjectAttributeValueWithContext(ctx, attr) -} - -// Scopes calls Client.ScopesWithContext on the default client. -// -// Deprecated: Please use the context aware variant [ScopesWithContext]. -func Scopes(serviceAccount string) ([]string, error) { - return defaultClient.ScopesWithContext(context.Background(), serviceAccount) + return defaultClient.ProjectAttributeValue(attr) } -// ScopesWithContext calls Client.ScopesWithContext on the default client. -func ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) { - return defaultClient.ScopesWithContext(ctx, serviceAccount) -} +// Scopes calls Client.Scopes on the default client. +func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) } func strsContains(ss []string, s string) bool { for _, v := range ss { @@ -418,12 +282,14 @@ func NewClient(c *http.Client) *Client { if c == nil { return defaultClient } + return &Client{hc: c} } // getETag returns a value from the metadata service as well as the associated ETag. // This func is otherwise equivalent to Get. -func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string, err error) { +func (c *Client) getETag(suffix string) (value, etag string, err error) { + ctx := context.TODO() // Using a fixed IP makes it very difficult to spoof the metadata service in // a container, which is an important use-case for local testing of cloud // deployments. To enable spoofing of the metadata service, the environment @@ -440,7 +306,7 @@ func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string } suffix = strings.TrimLeft(suffix, "/") u := "http://" + host + "/computeMetadata/v1/" + suffix - req, err := http.NewRequestWithContext(ctx, "GET", u, nil) + req, err := http.NewRequest("GET", u, nil) if err != nil { return "", "", err } @@ -470,7 +336,7 @@ func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string if res.StatusCode == http.StatusNotFound { return "", "", NotDefinedError(suffix) } - all, err := io.ReadAll(res.Body) + all, err := ioutil.ReadAll(res.Body) if err != nil { return "", "", err } @@ -488,37 +354,19 @@ func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string // // If the requested metadata is not defined, the returned error will // be of type NotDefinedError. -// -// Deprecated: Please use the context aware variant [Client.GetWithContext]. func (c *Client) Get(suffix string) (string, error) { - return c.GetWithContext(context.Background(), suffix) -} - -// GetWithContext returns a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// -// If the GCE_METADATA_HOST environment variable is not defined, a default of -// 169.254.169.254 will be used instead. -// -// If the requested metadata is not defined, the returned error will -// be of type NotDefinedError. -// -// NOTE: Without an extra deadline in the context this call can take in the -// worst case, with internal backoff retries, up to 15 seconds (e.g. when server -// is responding slowly). Pass context with additional timeouts when needed. -func (c *Client) GetWithContext(ctx context.Context, suffix string) (string, error) { - val, _, err := c.getETag(ctx, suffix) + val, _, err := c.getETag(suffix) return val, err } -func (c *Client) getTrimmed(ctx context.Context, suffix string) (s string, err error) { - s, err = c.GetWithContext(ctx, suffix) +func (c *Client) getTrimmed(suffix string) (s string, err error) { + s, err = c.Get(suffix) s = strings.TrimSpace(s) return } -func (c *Client) lines(ctx context.Context, suffix string) ([]string, error) { - j, err := c.GetWithContext(ctx, suffix) +func (c *Client) lines(suffix string) ([]string, error) { + j, err := c.Get(suffix) if err != nil { return nil, err } @@ -530,104 +378,45 @@ func (c *Client) lines(ctx context.Context, suffix string) ([]string, error) { } // ProjectID returns the current instance's project ID string. -// -// Deprecated: Please use the context aware variant [Client.ProjectIDWithContext]. -func (c *Client) ProjectID() (string, error) { return c.ProjectIDWithContext(context.Background()) } - -// ProjectIDWithContext returns the current instance's project ID string. -func (c *Client) ProjectIDWithContext(ctx context.Context) (string, error) { return projID.get(ctx, c) } +func (c *Client) ProjectID() (string, error) { return projID.get(c) } // NumericProjectID returns the current instance's numeric project ID. -// -// Deprecated: Please use the context aware variant [Client.NumericProjectIDWithContext]. -func (c *Client) NumericProjectID() (string, error) { - return c.NumericProjectIDWithContext(context.Background()) -} - -// NumericProjectIDWithContext returns the current instance's numeric project ID. -func (c *Client) NumericProjectIDWithContext(ctx context.Context) (string, error) { - return projNum.get(ctx, c) -} +func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) } // InstanceID returns the current VM's numeric instance ID. -// -// Deprecated: Please use the context aware variant [Client.InstanceIDWithContext]. -func (c *Client) InstanceID() (string, error) { - return c.InstanceIDWithContext(context.Background()) -} - -// InstanceIDWithContext returns the current VM's numeric instance ID. -func (c *Client) InstanceIDWithContext(ctx context.Context) (string, error) { - return instID.get(ctx, c) -} +func (c *Client) InstanceID() (string, error) { return instID.get(c) } // InternalIP returns the instance's primary internal IP address. -// -// Deprecated: Please use the context aware variant [Client.InternalIPWithContext]. func (c *Client) InternalIP() (string, error) { - return c.InternalIPWithContext(context.Background()) -} - -// InternalIPWithContext returns the instance's primary internal IP address. -func (c *Client) InternalIPWithContext(ctx context.Context) (string, error) { - return c.getTrimmed(ctx, "instance/network-interfaces/0/ip") + return c.getTrimmed("instance/network-interfaces/0/ip") } // Email returns the email address associated with the service account. -// -// Deprecated: Please use the context aware variant [Client.EmailWithContext]. +// The account may be empty or the string "default" to use the instance's +// main account. func (c *Client) Email(serviceAccount string) (string, error) { - return c.EmailWithContext(context.Background(), serviceAccount) -} - -// EmailWithContext returns the email address associated with the service account. -// The serviceAccount parameter default value (empty string or "default" value) -// will use the instance's main account. -func (c *Client) EmailWithContext(ctx context.Context, serviceAccount string) (string, error) { if serviceAccount == "" { serviceAccount = "default" } - return c.getTrimmed(ctx, "instance/service-accounts/"+serviceAccount+"/email") + return c.getTrimmed("instance/service-accounts/" + serviceAccount + "/email") } // ExternalIP returns the instance's primary external (public) IP address. -// -// Deprecated: Please use the context aware variant [Client.ExternalIPWithContext]. func (c *Client) ExternalIP() (string, error) { - return c.ExternalIPWithContext(context.Background()) -} - -// ExternalIPWithContext returns the instance's primary external (public) IP address. -func (c *Client) ExternalIPWithContext(ctx context.Context) (string, error) { - return c.getTrimmed(ctx, "instance/network-interfaces/0/access-configs/0/external-ip") + return c.getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") } // Hostname returns the instance's hostname. This will be of the form // ".c..internal". -// -// Deprecated: Please use the context aware variant [Client.HostnameWithContext]. func (c *Client) Hostname() (string, error) { - return c.HostnameWithContext(context.Background()) -} - -// HostnameWithContext returns the instance's hostname. This will be of the form -// ".c..internal". -func (c *Client) HostnameWithContext(ctx context.Context) (string, error) { - return c.getTrimmed(ctx, "instance/hostname") + return c.getTrimmed("instance/hostname") } -// InstanceTags returns the list of user-defined instance tags. -// -// Deprecated: Please use the context aware variant [Client.InstanceTagsWithContext]. -func (c *Client) InstanceTags() ([]string, error) { - return c.InstanceTagsWithContext(context.Background()) -} - -// InstanceTagsWithContext returns the list of user-defined instance tags, +// InstanceTags returns the list of user-defined instance tags, // assigned when initially creating a GCE instance. -func (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) { +func (c *Client) InstanceTags() ([]string, error) { var s []string - j, err := c.GetWithContext(ctx, "instance/tags") + j, err := c.Get("instance/tags") if err != nil { return nil, err } @@ -638,27 +427,13 @@ func (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) } // InstanceName returns the current VM's instance ID string. -// -// Deprecated: Please use the context aware variant [Client.InstanceNameWithContext]. func (c *Client) InstanceName() (string, error) { - return c.InstanceNameWithContext(context.Background()) -} - -// InstanceNameWithContext returns the current VM's instance ID string. -func (c *Client) InstanceNameWithContext(ctx context.Context) (string, error) { - return c.getTrimmed(ctx, "instance/name") + return c.getTrimmed("instance/name") } // Zone returns the current VM's zone, such as "us-central1-b". -// -// Deprecated: Please use the context aware variant [Client.ZoneWithContext]. func (c *Client) Zone() (string, error) { - return c.ZoneWithContext(context.Background()) -} - -// ZoneWithContext returns the current VM's zone, such as "us-central1-b". -func (c *Client) ZoneWithContext(ctx context.Context) (string, error) { - zone, err := c.getTrimmed(ctx, "instance/zone") + zone, err := c.getTrimmed("instance/zone") // zone is of the form "projects//zones/". if err != nil { return "", err @@ -669,34 +444,12 @@ func (c *Client) ZoneWithContext(ctx context.Context) (string, error) { // InstanceAttributes returns the list of user-defined attributes, // assigned when initially creating a GCE VM instance. The value of an // attribute can be obtained with InstanceAttributeValue. -// -// Deprecated: Please use the context aware variant [Client.InstanceAttributesWithContext]. -func (c *Client) InstanceAttributes() ([]string, error) { - return c.InstanceAttributesWithContext(context.Background()) -} - -// InstanceAttributesWithContext returns the list of user-defined attributes, -// assigned when initially creating a GCE VM instance. The value of an -// attribute can be obtained with InstanceAttributeValue. -func (c *Client) InstanceAttributesWithContext(ctx context.Context) ([]string, error) { - return c.lines(ctx, "instance/attributes/") -} +func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") } // ProjectAttributes returns the list of user-defined attributes // applying to the project as a whole, not just this VM. The value of // an attribute can be obtained with ProjectAttributeValue. -// -// Deprecated: Please use the context aware variant [Client.ProjectAttributesWithContext]. -func (c *Client) ProjectAttributes() ([]string, error) { - return c.ProjectAttributesWithContext(context.Background()) -} - -// ProjectAttributesWithContext returns the list of user-defined attributes -// applying to the project as a whole, not just this VM. The value of -// an attribute can be obtained with ProjectAttributeValue. -func (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, error) { - return c.lines(ctx, "project/attributes/") -} +func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") } // InstanceAttributeValue returns the value of the provided VM // instance attribute. @@ -706,22 +459,8 @@ func (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, er // // InstanceAttributeValue may return ("", nil) if the attribute was // defined to be the empty string. -// -// Deprecated: Please use the context aware variant [Client.InstanceAttributeValueWithContext]. func (c *Client) InstanceAttributeValue(attr string) (string, error) { - return c.InstanceAttributeValueWithContext(context.Background(), attr) -} - -// InstanceAttributeValueWithContext returns the value of the provided VM -// instance attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// InstanceAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) { - return c.GetWithContext(ctx, "instance/attributes/"+attr) + return c.Get("instance/attributes/" + attr) } // ProjectAttributeValue returns the value of the provided @@ -732,71 +471,39 @@ func (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr str // // ProjectAttributeValue may return ("", nil) if the attribute was // defined to be the empty string. -// -// Deprecated: Please use the context aware variant [Client.ProjectAttributeValueWithContext]. func (c *Client) ProjectAttributeValue(attr string) (string, error) { - return c.ProjectAttributeValueWithContext(context.Background(), attr) -} - -// ProjectAttributeValueWithContext returns the value of the provided -// project attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// ProjectAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) { - return c.GetWithContext(ctx, "project/attributes/"+attr) + return c.Get("project/attributes/" + attr) } // Scopes returns the service account scopes for the given account. // The account may be empty or the string "default" to use the instance's // main account. -// -// Deprecated: Please use the context aware variant [Client.ScopesWithContext]. func (c *Client) Scopes(serviceAccount string) ([]string, error) { - return c.ScopesWithContext(context.Background(), serviceAccount) -} - -// ScopesWithContext returns the service account scopes for the given account. -// The account may be empty or the string "default" to use the instance's -// main account. -func (c *Client) ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) { if serviceAccount == "" { serviceAccount = "default" } - return c.lines(ctx, "instance/service-accounts/"+serviceAccount+"/scopes") + return c.lines("instance/service-accounts/" + serviceAccount + "/scopes") } // Subscribe subscribes to a value from the metadata service. // The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". // The suffix may contain query parameters. // -// Deprecated: Please use the context aware variant [Client.SubscribeWithContext]. +// Subscribe calls fn with the latest metadata value indicated by the provided +// suffix. If the metadata value is deleted, fn is called with the empty string +// and ok false. Subscribe blocks until fn returns a non-nil error or the value +// is deleted. Subscribe returns the error value returned from the last call to +// fn, which may be nil when ok == false. func (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error { - return c.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) }) -} - -// SubscribeWithContext subscribes to a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// The suffix may contain query parameters. -// -// SubscribeWithContext calls fn with the latest metadata value indicated by the -// provided suffix. If the metadata value is deleted, fn is called with the -// empty string and ok false. Subscribe blocks until fn returns a non-nil error -// or the value is deleted. Subscribe returns the error value returned from the -// last call to fn, which may be nil when ok == false. -func (c *Client) SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error { const failedSubscribeSleep = time.Second * 5 // First check to see if the metadata value exists at all. - val, lastETag, err := c.getETag(ctx, suffix) + val, lastETag, err := c.getETag(suffix) if err != nil { return err } - if err := fn(ctx, val, true); err != nil { + if err := fn(val, true); err != nil { return err } @@ -807,7 +514,7 @@ func (c *Client) SubscribeWithContext(ctx context.Context, suffix string, fn fun suffix += "?wait_for_change=true&last_etag=" } for { - val, etag, err := c.getETag(ctx, suffix+url.QueryEscape(lastETag)) + val, etag, err := c.getETag(suffix + url.QueryEscape(lastETag)) if err != nil { if _, deleted := err.(NotDefinedError); !deleted { time.Sleep(failedSubscribeSleep) @@ -817,7 +524,7 @@ func (c *Client) SubscribeWithContext(ctx context.Context, suffix string, fn fun } lastETag = etag - if err := fn(ctx, val, ok); err != nil || !ok { + if err := fn(val, ok); err != nil || !ok { return err } } diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/retry.go b/upstream/vendor/cloud.google.com/go/compute/metadata/retry.go index 3d4bc75ddf2..0f18f3cda1e 100644 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/retry.go +++ b/upstream/vendor/cloud.google.com/go/compute/metadata/retry.go @@ -27,7 +27,7 @@ const ( ) var ( - syscallRetryable = func(error) bool { return false } + syscallRetryable = func(err error) bool { return false } ) // defaultBackoff is basically equivalent to gax.Backoff without the need for diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck.go b/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck.go deleted file mode 100644 index e0704fa6477..00000000000 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 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. - -//go:build !windows && !linux - -package metadata - -// systemInfoSuggestsGCE reports whether the local system (without -// doing network requests) suggests that we're running on GCE. If this -// returns true, testOnGCE tries a bit harder to reach its metadata -// server. -func systemInfoSuggestsGCE() bool { - // We don't currently have checks for other GOOS - return false -} diff --git a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go b/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go deleted file mode 100644 index c0ce627872f..00000000000 --- a/upstream/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 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. - -//go:build windows - -package metadata - -import ( - "strings" - - "golang.org/x/sys/windows/registry" -) - -func systemInfoSuggestsGCE() bool { - k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\HardwareConfig\Current`, registry.QUERY_VALUE) - if err != nil { - return false - } - defer k.Close() - - s, _, err := k.GetStringValue("SystemProductName") - if err != nil { - return false - } - s = strings.TrimSpace(s) - return strings.HasPrefix(s, "Google") -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/tidyfix.go b/upstream/vendor/cloud.google.com/go/compute/metadata/tidyfix.go similarity index 93% rename from upstream/vendor/cloud.google.com/go/longrunning/tidyfix.go rename to upstream/vendor/cloud.google.com/go/compute/metadata/tidyfix.go index d9a07f99e0d..4cef4850081 100644 --- a/upstream/vendor/cloud.google.com/go/longrunning/tidyfix.go +++ b/upstream/vendor/cloud.google.com/go/compute/metadata/tidyfix.go @@ -17,7 +17,7 @@ //go:build modhack // +build modhack -package longrunning +package metadata // Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "cloud.google.com/go" +import _ "cloud.google.com/go/compute/internal" diff --git a/upstream/vendor/cloud.google.com/go/debug.md b/upstream/vendor/cloud.google.com/go/debug.md deleted file mode 100644 index beec9155525..00000000000 --- a/upstream/vendor/cloud.google.com/go/debug.md +++ /dev/null @@ -1,404 +0,0 @@ -# Logging, Debugging and Telemetry - -**Warning: The OpenCensus project is obsolete and was archived on July 31st, -2023.** This means that any security vulnerabilities that are found will not be -patched. We recommend that you begin migrating to OpenCensus tracing to -OpenTelemetry, the successor project. See [OpenCensus](#opencensus) below for -details. - -Logging, debugging and telemetry all capture data that can be used for -troubleshooting. Logging records specific events and transactions. Debugging -exposes values for immediate analysis. Telemetry is suitable for production use -and can serve both logging and monitoring purposes. Telemetry tracing follows -requests through a system to provide a view of component interactions. Telemetry -metrics collects data for significant performance indicators, offering insights -into a system's health. - -## Logging and debugging - -While working with the Go Client Libraries you may run into some situations -where you need a deeper level of understanding about what is going on in order -to solve your problem. Here are some tips and tricks that you can use in these -cases. *Note* that many of the tips in this section will have a performance -impact and are therefore not recommended for sustained production use. Use these -tips locally or in production for a *limited time* to help get a better -understanding of what is going on. - -### HTTP based clients - -All of our auto-generated clients have a constructor to create a client that -uses HTTP/JSON instead of gRPC. Additionally a couple of our hand-written -clients like Storage and Bigquery are also HTTP based. Here are some tips for -debugging these clients. - -#### Try setting Go's HTTP debug variable - -Try setting the following environment variable for verbose Go HTTP logging: -GODEBUG=http2debug=1. To read more about this feature please see the godoc for -[net/http](https://pkg.go.dev/net/http). - -*WARNING*: Enabling this debug variable will log headers and payloads which may -contain private information. - -#### Add in your own logging with an HTTP middleware - -You may want to add in your own logging around HTTP requests. One way to do this -is to register a custom HTTP client with a logging transport built in. Here is -an example of how you would do this with the storage client. - -*WARNING*: Adding this middleware will log headers and payloads which may -contain private information. - -```go -package main - -import ( - "context" - "fmt" - "log" - "net/http" - "net/http/httputil" - - "cloud.google.com/go/storage" - "google.golang.org/api/iterator" - "google.golang.org/api/option" - htransport "google.golang.org/api/transport/http" -) - -type loggingRoundTripper struct { - rt http.RoundTripper -} - -func (d loggingRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - // Will create a dump of the request and body. - dump, err := httputil.DumpRequest(r, true) - if err != nil { - log.Println("error dumping request") - } - log.Printf("%s", dump) - return d.rt.RoundTrip(r) -} - -func main() { - ctx := context.Background() - - // Create a transport with authentication built-in detected with - // [ADC](https://google.aip.dev/auth/4110). Note you will have to pass any - // required scoped for the client you are using. - trans, err := htransport.NewTransport(ctx, - http.DefaultTransport, - option.WithScopes(storage.ScopeFullControl), - ) - if err != nil { - log.Fatal(err) - } - - // Embed customized transport into an HTTP client. - hc := &http.Client{ - Transport: loggingRoundTripper{rt: trans}, - } - - // Supply custom HTTP client for use by the library. - client, err := storage.NewClient(ctx, option.WithHTTPClient(hc)) - if err != nil { - log.Fatal(err) - } - defer client.Close() - // Use the client -} -``` - -### gRPC based clients - -#### Try setting grpc-go's debug variables - -Try setting the following environment variables for grpc-go: -`GRPC_GO_LOG_VERBOSITY_LEVEL=99` `GRPC_GO_LOG_SEVERITY_LEVEL=info`. These are -good for diagnosing connection level failures. For more information please see -[grpc-go's debug documentation](https://pkg.go.dev/google.golang.org/grpc/examples/features/debugging#section-readme). - -#### Add in your own logging with a gRPC interceptors - -You may want to add in your own logging around gRPC requests. One way to do this -is to register a custom interceptor that adds logging. Here is -an example of how you would do this with the secretmanager client. Note this -example registers a UnaryClientInterceptor but you may want/need to register -a StreamClientInterceptor instead-of/as-well depending on what kinds of -RPCs you are calling. - -*WARNING*: Adding this interceptor will log metadata and payloads which may -contain private information. - -```go -package main - -import ( - "context" - "log" - - secretmanager "cloud.google.com/go/secretmanager/apiv1" - "google.golang.org/api/option" - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/reflect/protoreflect" -) - -func loggingUnaryInterceptor() grpc.UnaryClientInterceptor { - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - err := invoker(ctx, method, req, reply, cc, opts...) - log.Printf("Invoked method: %v", method) - md, ok := metadata.FromOutgoingContext(ctx) - if ok { - log.Println("Metadata:") - for k, v := range md { - log.Printf("Key: %v, Value: %v", k, v) - } - } - reqb, merr := protojson.Marshal(req.(protoreflect.ProtoMessage)) - if merr == nil { - log.Printf("Request: %s", reqb) - } - return err - } -} - -func main() { - ctx := context.Background() - // Supply custom gRPC interceptor for use by the client. - client, err := secretmanager.NewClient(ctx, - option.WithGRPCDialOption(grpc.WithUnaryInterceptor(loggingUnaryInterceptor())), - ) - if err != nil { - log.Fatal(err) - } - defer client.Close() - // Use the client -} -``` - -## Telemetry - -**Warning: The OpenCensus project is obsolete and was archived on July 31st, -2023.** This means that any security vulnerabilities that are found will not be -patched. We recommend that you begin migrating to OpenCensus tracing to -OpenTelemetry, the successor project. See [OpenCensus](#opencensus) below for -details. - -The Google Cloud client libraries for Go still use the OpenCensus project by -default. However, opt-in support for -[OpenTelemetry](https://opentelemetry.io/docs/what-is-opentelemetry/) is now -available. The transition from OpenCensus to OpenTelemetry is covered in the -following sections. - -### Tracing (experimental) - -Apart from spans created by underlying libraries such as gRPC, Google Cloud Go -generated clients do not create spans. Only the spans created by following -hand-written clients are in scope for the discussion in this section: - -* [cloud.google.com/go/bigquery](https://pkg.go.dev/cloud.google.com/go/bigquery) -* [cloud.google.com/go/bigtable](https://pkg.go.dev/cloud.google.com/go/bigtable) -* [cloud.google.com/go/datastore](https://pkg.go.dev/cloud.google.com/go/datastore) -* [cloud.google.com/go/firestore](https://pkg.go.dev/cloud.google.com/go/firestore) -* [cloud.google.com/go/spanner](https://pkg.go.dev/cloud.google.com/go/spanner) -* [cloud.google.com/go/storage](https://pkg.go.dev/cloud.google.com/go/storage) - -Currently, the spans created by these clients are for OpenCensus. However, -OpenCensus users are urged to transition to OpenTelemetry as soon as possible, -as explained in the next section. OpenTelemetry users can opt-in to experimental -OpenTelemetry support via an environment variable, as described below. - -#### OpenCensus - -**Warning: The OpenCensus project is obsolete and was archived on July 31st, -2023.** This means that any security vulnerabilities that are found will not be -patched. We recommend that you begin migrating to OpenCensus tracing to -OpenTelemetry, the successor project. - -Using the [OpenTelemetry-Go - OpenCensus Bridge](https://pkg.go.dev/go.opentelemetry.io/otel/bridge/opencensus), you can immediately begin exporting your traces with OpenTelemetry, even while -dependencies of your application remain instrumented with OpenCensus. If you do -not use the bridge, you will need to migrate your entire application and all of -its instrumented dependencies at once. For simple applications, this may be -possible, but we expect the bridge to be helpful if multiple libraries with -instrumentation are used. - -On May 29, 2024, six months after the -[release](https://github.com/googleapis/google-cloud-go/releases/tag/v0.111.0) -of experimental, opt-in support for OpenTelemetry tracing, the default tracing -support in the clients above will change from OpenCensus to OpenTelemetry, and -the experimental OpenCensus support will be marked as deprecated. To continue -using the OpenCensus support after this change, set the environment variable -`GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING` to the case-insensitive -value `opencensus` before loading the client library. - -```sh -export GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING=opencensus -``` - -On December 2nd, 2024, one year after the release of OpenTelemetry support, the -experimental and deprecated support for OpenCensus tracing will be removed. - -Please note that all Google Cloud Go clients currently provide experimental -support for the propagation of both OpenCensus and OpenTelemetry trace context -to their receiving endpoints. The experimental support for OpenCensus trace -context propagation will be removed at the same time as the experimental -OpenCensus tracing support. - -Please refer to the following resources: - -* [Sunsetting OpenCensus](https://opentelemetry.io/blog/2023/sunsetting-opencensus/) -* [OpenTelemetry-Go - OpenCensus Bridge](https://pkg.go.dev/go.opentelemetry.io/otel/bridge/opencensus) - -#### OpenTelemetry - -**Warning: OpenTelemetry-Go ensures -[compatibility](https://github.com/open-telemetry/opentelemetry-go/tree/main?tab=readme-ov-file#compatibility) -with ONLY the current supported versions of the [Go -language](https://go.dev/doc/devel/release#policy). This support may be narrower -than the support that has been offered historically by the Go Client Libraries. -Ensure that your Go runtime version is supported by the OpenTelemetry-Go -[compatibility](https://github.com/open-telemetry/opentelemetry-go/tree/main?tab=readme-ov-file#compatibility) -policy before enabling OpenTelemetry instrumentation.** - -To opt-in to experimental OpenTelemetry tracing currently available in the -clients listed above, set the environment variable -`GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING` to the case-insensitive -value `opentelemetry` before loading the client library. - -```sh -export GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING=opentelemetry -``` - -On May 29, 2024, the default tracing support will change from OpenCensus to -OpenTelemetry, and this environment variable will no longer be needed. - -Please refer to the following resources: - -* [What is OpenTelemetry?](https://opentelemetry.io/docs/what-is-opentelemetry/) -* [Cloud Trace - Go and OpenTelemetry](https://cloud.google.com/trace/docs/setup/go-ot) -* On GCE, [use Ops Agent and OpenTelemetry](https://cloud.google.com/trace/docs/otlp) - -##### Configuring the OpenTelemetry-Go - OpenCensus Bridge - -To configure the OpenCensus bridge with OpenTelemetry and Cloud Trace: - -```go -import ( - "context" - "log" - "os" - texporter "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace" - octrace "go.opencensus.io/trace" - "go.opentelemetry.io/contrib/detectors/gcp" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/bridge/opencensus" - "go.opentelemetry.io/otel/sdk/resource" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.7.0" -) - -func main() { - // Create exporter. - ctx := context.Background() - projectID := os.Getenv("GOOGLE_CLOUD_PROJECT") - exporter, err := texporter.New(texporter.WithProjectID(projectID)) - if err != nil { - log.Fatalf("texporter.New: %v", err) - } - // Identify your application using resource detection - res, err := resource.New(ctx, - // Use the GCP resource detector to detect information about the GCP platform - resource.WithDetectors(gcp.NewDetector()), - // Keep the default detectors - resource.WithTelemetrySDK(), - // Add your own custom attributes to identify your application - resource.WithAttributes( - semconv.ServiceNameKey.String("my-application"), - ), - ) - if err != nil { - log.Fatalf("resource.New: %v", err) - } - // Create trace provider with the exporter. - // - // By default it uses AlwaysSample() which samples all traces. - // In a production environment or high QPS setup please use - // probabilistic sampling. - // Example: - // tp := sdktrace.NewTracerProvider(sdktrace.WithSampler(sdktrace.TraceIDRatioBased(0.0001)), ...) - tp := sdktrace.NewTracerProvider( - sdktrace.WithBatcher(exporter), - sdktrace.WithResource(res), - ) - defer tp.Shutdown(ctx) // flushes any pending spans, and closes connections. - otel.SetTracerProvider(tp) - tracer := otel.GetTracerProvider().Tracer("example.com/trace") - // Configure the OpenCensus tracer to use the bridge. - octrace.DefaultTracer = opencensus.NewTracer(tracer) - // Use otel tracer to create spans... -} - -``` - - -##### Configuring context propagation - -In order to pass options to OpenTelemetry trace context propagation, follow the -appropriate example for the client's underlying transport. - -###### Passing options in HTTP-based clients - -```go -ctx := context.Background() -trans, err := htransport.NewTransport(ctx, - http.DefaultTransport, - option.WithScopes(storage.ScopeFullControl), -) -if err != nil { - log.Fatal(err) -} -// An example of passing options to the otelhttp.Transport. -otelOpts := otelhttp.WithFilter(func(r *http.Request) bool { - return r.URL.Path != "/ping" -}) -hc := &http.Client{ - Transport: otelhttp.NewTransport(trans, otelOpts), -} -client, err := storage.NewClient(ctx, option.WithHTTPClient(hc)) -``` - -Note that scopes must be set manually in this user-configured solution. - -###### Passing options in gRPC-based clients - -```go -projectID := "..." -ctx := context.Background() - -// An example of passing options to grpc.WithStatsHandler. -otelOpts := otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents) -dialOpts := grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelOpts)) - -ctx := context.Background() -c, err := datastore.NewClient(ctx, projectID, option.WithGRPCDialOption(dialOpts)) -if err != nil { - log.Fatal(err) -} -defer c.Close() -``` - - -### Metrics (experimental) - -The generated clients do not create metrics. Only the following hand-written -clients create experimental OpenCensus metrics: - -* [cloud.google.com/go/bigquery](https://pkg.go.dev/cloud.google.com/go/bigquery) -* [cloud.google.com/go/pubsub](https://pkg.go.dev/cloud.google.com/go/pubsub) -* [cloud.google.com/go/spanner](https://pkg.go.dev/cloud.google.com/go/spanner) - -#### OpenTelemetry - -The transition of the experimental metrics in the clients above from OpenCensus -to OpenTelemetry is still TBD. \ No newline at end of file diff --git a/upstream/vendor/cloud.google.com/go/doc.go b/upstream/vendor/cloud.google.com/go/doc.go deleted file mode 100644 index 133ff68553f..00000000000 --- a/upstream/vendor/cloud.google.com/go/doc.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2014 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 cloud is the root of the packages used to access Google Cloud -Services. See https://pkg.go.dev/cloud.google.com/go for a full list -of sub-modules. - -# Client Options - -All clients in sub-packages are configurable via client options. These options -are described here: https://pkg.go.dev/google.golang.org/api/option. - -# Endpoint Override - -Endpoint configuration is used to specify the URL to which requests are -sent. It is used for services that support or require regional endpoints, as -well as for other use cases such as [testing against fake servers]. - -For example, the Vertex AI service recommends that you configure the endpoint to -the location with the features you want that is closest to your physical -location or the location of your users. There is no global endpoint for Vertex -AI. See [Vertex AI - Locations] for more details. The following example -demonstrates configuring a Vertex AI client with a regional endpoint: - - ctx := context.Background() - endpoint := "us-central1-aiplatform.googleapis.com:443" - client, err := aiplatform.NewDatasetClient(ctx, option.WithEndpoint(endpoint)) - -# Authentication and Authorization - -All of the clients support authentication via [Google Application Default Credentials], -or by providing a JSON key file for a Service Account. See examples below. - -Google Application Default Credentials (ADC) is the recommended way to authorize -and authenticate clients. For information on how to create and obtain -Application Default Credentials, see -https://cloud.google.com/docs/authentication/production. If you have your -environment configured correctly you will not need to pass any extra information -to the client libraries. Here is an example of a client using ADC to -authenticate: - - client, err := secretmanager.NewClient(context.Background()) - if err != nil { - // TODO: handle error. - } - _ = client // Use the client. - -You can use a file with credentials to authenticate and authorize, such as a -JSON key file associated with a Google service account. Service Account keys can -be created and downloaded from https://console.cloud.google.com/iam-admin/serviceaccounts. -This example uses the Secret Manger client, but the same steps apply to the -all other client libraries this package as well. Example: - - client, err := secretmanager.NewClient(context.Background(), - option.WithCredentialsFile("/path/to/service-account-key.json")) - if err != nil { - // TODO: handle error. - } - _ = client // Use the client. - -In some cases (for instance, you don't want to store secrets on disk), you can -create credentials from in-memory JSON and use the WithCredentials option. -This example uses the Secret Manager client, but the same steps apply to -all other client libraries as well. Note that scopes can be -found at https://developers.google.com/identity/protocols/oauth2/scopes, and -are also provided in all auto-generated libraries: for example, -cloud.google.com/go/secretmanager/apiv1 provides DefaultAuthScopes. Example: - - ctx := context.Background() - // https://pkg.go.dev/golang.org/x/oauth2/google - creds, err := google.CredentialsFromJSON(ctx, []byte("JSON creds"), secretmanager.DefaultAuthScopes()...) - if err != nil { - // TODO: handle error. - } - client, err := secretmanager.NewClient(ctx, option.WithCredentials(creds)) - if err != nil { - // TODO: handle error. - } - _ = client // Use the client. - -# Timeouts and Cancellation - -By default, non-streaming methods, like Create or Get, will have a default -deadline applied to the context provided at call time, unless a context deadline -is already set. Streaming methods have no default deadline and will run -indefinitely. To set timeouts or arrange for cancellation, use -[context]. Transient errors will be retried when correctness allows. - -Here is an example of setting a timeout for an RPC using -[context.WithTimeout]: - - ctx := context.Background() - // Do not set a timeout on the context passed to NewClient: dialing happens - // asynchronously, and the context is used to refresh credentials in the - // background. - client, err := secretmanager.NewClient(ctx) - if err != nil { - // TODO: handle error. - } - // Time out if it takes more than 10 seconds to create a dataset. - tctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() // Always call cancel. - - req := &secretmanagerpb.DeleteSecretRequest{Name: "projects/project-id/secrets/name"} - if err := client.DeleteSecret(tctx, req); err != nil { - // TODO: handle error. - } - -Here is an example of setting a timeout for an RPC using -[github.com/googleapis/gax-go/v2.WithTimeout]: - - ctx := context.Background() - // Do not set a timeout on the context passed to NewClient: dialing happens - // asynchronously, and the context is used to refresh credentials in the - // background. - client, err := secretmanager.NewClient(ctx) - if err != nil { - // TODO: handle error. - } - - req := &secretmanagerpb.DeleteSecretRequest{Name: "projects/project-id/secrets/name"} - // Time out if it takes more than 10 seconds to create a dataset. - if err := client.DeleteSecret(tctx, req, gax.WithTimeout(10*time.Second)); err != nil { - // TODO: handle error. - } - -Here is an example of how to arrange for an RPC to be canceled, use -[context.WithCancel]: - - ctx := context.Background() - // Do not cancel the context passed to NewClient: dialing happens asynchronously, - // and the context is used to refresh credentials in the background. - client, err := secretmanager.NewClient(ctx) - if err != nil { - // TODO: handle error. - } - cctx, cancel := context.WithCancel(ctx) - defer cancel() // Always call cancel. - - // TODO: Make the cancel function available to whatever might want to cancel the - // call--perhaps a GUI button. - req := &secretmanagerpb.DeleteSecretRequest{Name: "projects/proj/secrets/name"} - if err := client.DeleteSecret(cctx, req); err != nil { - // TODO: handle error. - } - -Do not attempt to control the initial connection (dialing) of a service by -setting a timeout on the context passed to NewClient. Dialing is non-blocking, -so timeouts would be ineffective and would only interfere with credential -refreshing, which uses the same context. - -# Headers - -Regardless of which transport is used, request headers can be set in the same -way using [`callctx.SetHeaders`][setheaders]. - -Here is a generic example: - - // Set the header "key" to "value". - ctx := callctx.SetHeaders(context.Background(), "key", "value") - - // Then use ctx in a subsequent request. - response, err := client.GetSecret(ctx, request) - -## Google-reserved headers - -There are a some header keys that Google reserves for internal use that must -not be ovewritten. The following header keys are broadly considered reserved -and should not be conveyed by client library users unless instructed to do so: - -* `x-goog-api-client` -* `x-goog-request-params` - -Be sure to check the individual package documentation for other service-specific -reserved headers. For example, Storage supports a specific auditing header that -is mentioned in that [module's documentation][storagedocs]. - -## Google Cloud system parameters - -Google Cloud services respect [system parameters][system parameters] that can be -used to augment request and/or response behavior. For the most part, they are -not needed when using one of the enclosed client libraries. However, those that -may be necessary are made available via the [`callctx`][callctx] package. If not -present there, consider opening an issue on that repo to request a new constant. - -# Connection Pooling - -Connection pooling differs in clients based on their transport. Cloud -clients either rely on HTTP or gRPC transports to communicate -with Google Cloud. - -Cloud clients that use HTTP rely on the underlying HTTP transport to cache -connections for later re-use. These are cached to the http.MaxIdleConns -and http.MaxIdleConnsPerHost settings in http.DefaultTransport by default. - -For gRPC clients, connection pooling is configurable. Users of Cloud Client -Libraries may specify option.WithGRPCConnectionPool(n) as a client option to -NewClient calls. This configures the underlying gRPC connections to be pooled -and accessed in a round robin fashion. - -# Using the Libraries in Container environments(Docker) - -Minimal container images like Alpine lack CA certificates. This causes RPCs to -appear to hang, because gRPC retries indefinitely. See -https://github.com/googleapis/google-cloud-go/issues/928 for more information. - -# Debugging - -For tips on how to write tests against code that calls into our libraries check -out our [Debugging Guide]. - -# Testing - -For tips on how to write tests against code that calls into our libraries check -out our [Testing Guide]. - -# Inspecting errors - -Most of the errors returned by the generated clients are wrapped in an -[github.com/googleapis/gax-go/v2/apierror.APIError] and can be further unwrapped -into a [google.golang.org/grpc/status.Status] or -[google.golang.org/api/googleapi.Error] depending on the transport used to make -the call (gRPC or REST). Converting your errors to these types can be a useful -way to get more information about what went wrong while debugging. - -APIError gives access to specific details in the error. The transport-specific -errors can still be unwrapped using the APIError. - - if err != nil { - var ae *apierror.APIError - if errors.As(err, &ae) { - log.Println(ae.Reason()) - log.Println(ae.Details().Help.GetLinks()) - } - } - -If the gRPC transport was used, the [google.golang.org/grpc/status.Status] can -still be parsed using the [google.golang.org/grpc/status.FromError] function. - - if err != nil { - if s, ok := status.FromError(err); ok { - log.Println(s.Message()) - for _, d := range s.Proto().Details { - log.Println(d) - } - } - } - -# Client Stability - -Semver is used to communicate stability of the sub-modules of this package. -Note, some stable sub-modules do contain packages, and sometimes features, that -are considered unstable. If something is unstable it will be explicitly labeled -as such. Example of package does in an unstable package: - - NOTE: This package is in beta. It is not stable, and may be subject to changes. - -Clients that contain alpha and beta in their import path may change or go away -without notice. - -Clients marked stable will maintain compatibility with future versions for as -long as we can reasonably sustain. Incompatible changes might be made in some -situations, including: - - - Security bugs may prompt backwards-incompatible changes. - - Situations in which components are no longer feasible to maintain without - making breaking changes, including removal. - - Parts of the client surface may be outright unstable and subject to change. - These parts of the surface will be labeled with the note, "It is EXPERIMENTAL - and subject to change or removal without notice." - -[testing against fake servers]: https://github.com/googleapis/google-cloud-go/blob/main/testing.md#testing-grpc-services-using-fakes -[Vertex AI - Locations]: https://cloud.google.com/vertex-ai/docs/general/locations -[Google Application Default Credentials]: https://cloud.google.com/docs/authentication/external/set-up-adc -[Testing Guide]: https://github.com/googleapis/google-cloud-go/blob/main/testing.md -[Debugging Guide]: https://github.com/googleapis/google-cloud-go/blob/main/debug.md -[callctx]: https://pkg.go.dev/github.com/googleapis/gax-go/v2/callctx#pkg-constants -[setheaders]: https://pkg.go.dev/github.com/googleapis/gax-go/v2/callctx#SetHeaders -[storagedocs]: https://pkg.go.dev/cloud.google.com/go/storage#hdr-Sending_Custom_Headers -[system parameters]: https://cloud.google.com/apis/docs/system-parameters -*/ -package cloud // import "cloud.google.com/go" diff --git a/upstream/vendor/cloud.google.com/go/go.work b/upstream/vendor/cloud.google.com/go/go.work deleted file mode 100644 index bbf602e9af9..00000000000 --- a/upstream/vendor/cloud.google.com/go/go.work +++ /dev/null @@ -1,177 +0,0 @@ -go 1.21 - -use ( - . - ./accessapproval - ./accesscontextmanager - ./advisorynotifications - ./ai - ./aiplatform - ./alloydb - ./analytics - ./apigateway - ./apigeeconnect - ./apigeeregistry - ./apikeys - ./appengine - ./apphub - ./apps - ./area120 - ./artifactregistry - ./asset - ./assuredworkloads - ./auth - ./auth/oauth2adapt - ./automl - ./backupdr - ./baremetalsolution - ./batch - ./beyondcorp - ./bigquery - ./bigtable - ./billing - ./binaryauthorization - ./certificatemanager - ./channel - ./chat - ./cloudbuild - ./cloudcontrolspartner - ./clouddms - ./cloudprofiler - ./cloudquotas - ./cloudtasks - ./commerce - ./compute - ./compute/metadata - ./confidentialcomputing - ./config - ./contactcenterinsights - ./container - ./containeranalysis - ./datacatalog - ./dataflow - ./dataform - ./datafusion - ./datalabeling - ./dataplex - ./dataproc - ./dataqna - ./datastore - ./datastream - ./deploy - ./dialogflow - ./discoveryengine - ./dlp - ./documentai - ./domains - ./edgecontainer - ./edgenetwork - ./errorreporting - ./essentialcontacts - ./eventarc - ./filestore - ./firestore - ./functions - ./gkebackup - ./gkeconnect - ./gkehub - ./gkemulticloud - ./grafeas - ./gsuiteaddons - ./iam - ./iap - ./identitytoolkit - ./ids - ./internal/actions - ./internal/aliasfix - ./internal/aliasgen - ./internal/carver - ./internal/examples/fake - ./internal/examples/mock - ./internal/gapicgen - ./internal/generated/snippets - ./internal/godocfx - ./internal/postprocessor - ./internal/protoveneer - ./iot - ./kms - ./language - ./lifesciences - ./logging - ./longrunning - ./managedidentities - ./maps - ./mediatranslation - ./memcache - ./metastore - ./migrationcenter - ./monitoring - ./netapp - ./networkconnectivity - ./networkmanagement - ./networksecurity - ./notebooks - ./optimization - ./orchestration - ./orgpolicy - ./osconfig - ./oslogin - ./parallelstore - ./phishingprotection - ./policysimulator - ./policytroubleshooter - ./privatecatalog - ./profiler - ./pubsub - ./pubsublite - ./rapidmigrationassessment - ./recaptchaenterprise - ./recommendationengine - ./recommender - ./redis - ./resourcemanager - ./resourcesettings - ./retail - ./run - ./scheduler - ./secretmanager - ./securesourcemanager - ./security - ./securitycenter - ./securitycentermanagement - ./securityposture - ./servicecontrol - ./servicedirectory - ./servicehealth - ./servicemanagement - ./serviceusage - ./shell - ./shopping - ./spanner - ./spanner/test/opentelemetry/test - ./speech - ./storage - ./storage/internal/benchmarks - ./storageinsights - ./storagetransfer - ./streetview - ./support - ./talent - ./telcoautomation - ./texttospeech - ./tpu - ./trace - ./translate - ./vertexai - ./video - ./videointelligence - ./vision - ./visionai - ./vmmigration - ./vmwareengine - ./vpcaccess - ./webrisk - ./websecurityscanner - ./workflows - ./workstations -) diff --git a/upstream/vendor/cloud.google.com/go/go.work.sum b/upstream/vendor/cloud.google.com/go/go.work.sum deleted file mode 100644 index 002f0a0872e..00000000000 --- a/upstream/vendor/cloud.google.com/go/go.work.sum +++ /dev/null @@ -1,87 +0,0 @@ -cloud.google.com/go/auth v0.2.0/go.mod h1:+yb+oy3/P0geX6DLKlqiGHARGR6EX2GRtYCzWOCQSbU= -cloud.google.com/go/auth/oauth2adapt v0.2.0/go.mod h1:AfqujpDAlTfLfeCIl/HJZZlIxD8+nJoZ5e0x1IxGq5k= -cloud.google.com/go/dataproc v1.12.0 h1:W47qHL3W4BPkAIbk4SWmIERwsWBaNnWm0P2sdx3YgGU= -cloud.google.com/go/gaming v1.9.0 h1:7vEhFnZmd931Mo7sZ6pJy7uQPDxF7m7v8xtBheG08tc= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.18.0 h1:ugYJK/neZQtQeh2jc5xNoDFiMQojlAkoqJMRb7vTu1U= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.18.0/go.mod h1:Xx0VKh7GJ4si3rmElbh19Mejxz68ibWg/J30ZOMrqzU= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.46.0/go.mod h1:V28hx+cUCZC9e3qcqszMb+Sbt8cQZtHTiXOmyDzoDOg= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go-v2 v1.16.10/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo= -github.com/aws/aws-sdk-go-v2/config v1.15.9/go.mod h1:rv/l/TbZo67kp99v/3Kb0qV6Fm1KEtKyruEV2GvVfgs= -github.com/aws/aws-sdk-go-v2/credentials v1.12.12/go.mod h1:vFHC2HifIWHebmoVsfpqliKuqbAY2LaVlvy03JzF4c4= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.11/go.mod h1:38Asv/UyQbDNpSXCurZRlDMjzIl6J+wUe8vY3TtUuzA= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.17/go.mod h1:6qtGip7sJEyvgsLjphRZWF9qPe3xJf1mL/MM01E35Wc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.11/go.mod h1:cYAfnB+9ZkmZWpQWmPDsuIGm4EA+6k2ZVtxKjw/XJBY= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.18/go.mod h1:hTHq8hL4bAxJyng364s9d4IUGXZOs7Y5LSqAhIiIQ2A= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.18.3/go.mod h1:BrAJyOMrnwzYVQcP5ziqlCpnEuFfkNppZLzqDyW/YTg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.11/go.mod h1:OEofCUKF7Hri4ShOCokF6k6hGq9PCB2sywt/9rLSXjY= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.15/go.mod h1:dDVD4ElJRTQXx7dOQ59EkqGyNU9tnwy1RKln+oLIOTU= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.12/go.mod h1:b53qpmhHk7mTL2J/tfG6f38neZiyBQSiNXGCuNKq4+4= -github.com/aws/smithy-go v1.12.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -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/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/fullstorydev/grpcurl v1.8.7/go.mod h1:pVtM4qe3CMoLaIzYS8uvTuDj2jVYmXqMUkZeijnXp/E= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -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/google/go-jsonnet v0.20.0/go.mod h1:VbgWF9JX7ztlv770x/TolZNGGFfiHEVx9G6ca2eUmeA= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/hoisie/redis v0.0.0-20160730154456-b5c6e81454e0/go.mod h1:pMYMxVaKJqCDC1JUg/XbPJ4/fSazB25zORpFzqsIGIc= -github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/itchyny/gojq v0.12.9/go.mod h1:T4Ip7AETUXeGpD+436m+UEl3m3tokRgajd5pRfsR5oE= -github.com/itchyny/timefmt-go v0.1.4/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/miekg/dns v1.1.33/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= -go.opentelemetry.io/otel/bridge/opencensus v0.40.0 h1:pqDiayRhBgoqy1vwnscik+TizcImJ58l053NScJyZso= -go.opentelemetry.io/otel/bridge/opencensus v0.40.0/go.mod h1:1NvVHb6tLTe5A9qCYz+eErW0t8iPn4ZfR6tDKcqlGTM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0/go.mod h1:U707O40ee1FpQGyhvqnzmCJm1Wh6OX6GGBVn0E6Uyyk= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0/go.mod h1:qcTO4xHAxZLaLxPd60TdE88rxtItPHgHWqOhOGRr0as= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0/go.mod h1:sTt30Evb7hJB/gEk27qLb1+l9n4Tb8HvHkR0Wx3S6CU= -go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= -go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= -google.golang.org/api v0.174.0/go.mod h1:aC7tB6j0HR1Nl0ni5ghpx6iLasmAX78Zkh/wgxAAjLg= -google.golang.org/genproto v0.0.0-20230725213213-b022f6e96895/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= -google.golang.org/genproto/googleapis/api v0.0.0-20230725213213-b022f6e96895/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f/go.mod h1:iIgEblxoG4klcXsG0d9cpoxJ4xndv6+1FkDROCHhPRI= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20240102182953-50ed04b92917/go.mod h1:O9TvT7A9NLgdqqF0JJXJ+axpaoYiEb8txGmkvy+AvLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230725213213-b022f6e96895/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/upstream/vendor/cloud.google.com/go/iam/CHANGES.md b/upstream/vendor/cloud.google.com/go/iam/CHANGES.md index af5ff374887..43a17938486 100644 --- a/upstream/vendor/cloud.google.com/go/iam/CHANGES.md +++ b/upstream/vendor/cloud.google.com/go/iam/CHANGES.md @@ -1,20 +1,6 @@ # Changes -## [1.1.8](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.7...iam/v1.1.8) (2024-05-01) - - -### Bug Fixes - -* **iam:** Bump x/net to v0.24.0 ([ba31ed5](https://github.com/googleapis/google-cloud-go/commit/ba31ed5fda2c9664f2e1cf972469295e63deb5b4)) - -## [1.1.7](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.6...iam/v1.1.7) (2024-03-14) - - -### Bug Fixes - -* **iam:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) - ## [1.1.6](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.5...iam/v1.1.6) (2024-01-30) diff --git a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go index 3fbf4530d0d..b5243e61291 100644 --- a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go +++ b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.23.2 // source: google/iam/v1/iam_policy.proto package iampb diff --git a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go index 29738ad1ce3..3f854fe496e 100644 --- a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go +++ b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.23.2 // source: google/iam/v1/options.proto package iampb diff --git a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go index a4e15741b64..dfc60661a30 100644 --- a/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go +++ b/upstream/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.23.2 // source: google/iam/v1/policy.proto package iampb diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go deleted file mode 100644 index fa01cf3dddb..00000000000 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go +++ /dev/null @@ -1,1268 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go_gapic. DO NOT EDIT. - -package kms - -import ( - "bytes" - "context" - "fmt" - "io" - "math" - "net/http" - "net/url" - "time" - - iampb "cloud.google.com/go/iam/apiv1/iampb" - kmspb "cloud.google.com/go/kms/apiv1/kmspb" - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - gax "github.com/googleapis/gax-go/v2" - "google.golang.org/api/googleapi" - "google.golang.org/api/iterator" - "google.golang.org/api/option" - "google.golang.org/api/option/internaloption" - gtransport "google.golang.org/api/transport/grpc" - httptransport "google.golang.org/api/transport/http" - locationpb "google.golang.org/genproto/googleapis/cloud/location" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -var newAutokeyAdminClientHook clientHook - -// AutokeyAdminCallOptions contains the retry settings for each method of AutokeyAdminClient. -type AutokeyAdminCallOptions struct { - UpdateAutokeyConfig []gax.CallOption - GetAutokeyConfig []gax.CallOption - ShowEffectiveAutokeyConfig []gax.CallOption - GetLocation []gax.CallOption - ListLocations []gax.CallOption - GetIamPolicy []gax.CallOption - SetIamPolicy []gax.CallOption - TestIamPermissions []gax.CallOption - GetOperation []gax.CallOption -} - -func defaultAutokeyAdminGRPCClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("cloudkms.googleapis.com:443"), - internaloption.WithDefaultEndpointTemplate("cloudkms.UNIVERSE_DOMAIN:443"), - internaloption.WithDefaultMTLSEndpoint("cloudkms.mtls.googleapis.com:443"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableJwtWithScope(), - internaloption.EnableNewAuthLibrary(), - option.WithGRPCDialOption(grpc.WithDefaultCallOptions( - grpc.MaxCallRecvMsgSize(math.MaxInt32))), - } -} - -func defaultAutokeyAdminCallOptions() *AutokeyAdminCallOptions { - return &AutokeyAdminCallOptions{ - UpdateAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - GetAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - ShowEffectiveAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - GetLocation: []gax.CallOption{}, - ListLocations: []gax.CallOption{}, - GetIamPolicy: []gax.CallOption{}, - SetIamPolicy: []gax.CallOption{}, - TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, - } -} - -func defaultAutokeyAdminRESTCallOptions() *AutokeyAdminCallOptions { - return &AutokeyAdminCallOptions{ - UpdateAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }, - http.StatusServiceUnavailable, - http.StatusGatewayTimeout) - }), - }, - GetAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }, - http.StatusServiceUnavailable, - http.StatusGatewayTimeout) - }), - }, - ShowEffectiveAutokeyConfig: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }, - http.StatusServiceUnavailable, - http.StatusGatewayTimeout) - }), - }, - GetLocation: []gax.CallOption{}, - ListLocations: []gax.CallOption{}, - GetIamPolicy: []gax.CallOption{}, - SetIamPolicy: []gax.CallOption{}, - TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, - } -} - -// internalAutokeyAdminClient is an interface that defines the methods available from Cloud Key Management Service (KMS) API. -type internalAutokeyAdminClient interface { - Close() error - setGoogleClientInfo(...string) - Connection() *grpc.ClientConn - UpdateAutokeyConfig(context.Context, *kmspb.UpdateAutokeyConfigRequest, ...gax.CallOption) (*kmspb.AutokeyConfig, error) - GetAutokeyConfig(context.Context, *kmspb.GetAutokeyConfigRequest, ...gax.CallOption) (*kmspb.AutokeyConfig, error) - ShowEffectiveAutokeyConfig(context.Context, *kmspb.ShowEffectiveAutokeyConfigRequest, ...gax.CallOption) (*kmspb.ShowEffectiveAutokeyConfigResponse, error) - GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) - ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator - GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) - SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) - TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) -} - -// AutokeyAdminClient is a client for interacting with Cloud Key Management Service (KMS) API. -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -// -// Provides interfaces for managing Cloud KMS Autokey folder-level -// configurations. A configuration is inherited by all descendent projects. A -// configuration at one folder overrides any other configurations in its -// ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS -// Autokey, so that users working in a descendant project can request -// provisioned CryptoKeys, ready for Customer -// Managed Encryption Key (CMEK) use, on-demand. -type AutokeyAdminClient struct { - // The internal transport-dependent client. - internalClient internalAutokeyAdminClient - - // The call options for this service. - CallOptions *AutokeyAdminCallOptions -} - -// Wrapper methods routed to the internal client. - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *AutokeyAdminClient) Close() error { - return c.internalClient.Close() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *AutokeyAdminClient) setGoogleClientInfo(keyval ...string) { - c.internalClient.setGoogleClientInfo(keyval...) -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *AutokeyAdminClient) Connection() *grpc.ClientConn { - return c.internalClient.Connection() -} - -// UpdateAutokeyConfig updates the AutokeyConfig for a -// folder. The caller must have both cloudkms.autokeyConfigs.update -// permission on the parent folder and cloudkms.cryptoKeys.setIamPolicy -// permission on the provided key project. A -// KeyHandle creation in the folder’s -// descendant projects will use this configuration to determine where to -// create the resulting CryptoKey. -func (c *AutokeyAdminClient) UpdateAutokeyConfig(ctx context.Context, req *kmspb.UpdateAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - return c.internalClient.UpdateAutokeyConfig(ctx, req, opts...) -} - -// GetAutokeyConfig returns the AutokeyConfig for a -// folder. -func (c *AutokeyAdminClient) GetAutokeyConfig(ctx context.Context, req *kmspb.GetAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - return c.internalClient.GetAutokeyConfig(ctx, req, opts...) -} - -// ShowEffectiveAutokeyConfig returns the effective Cloud KMS Autokey configuration for a given project. -func (c *AutokeyAdminClient) ShowEffectiveAutokeyConfig(ctx context.Context, req *kmspb.ShowEffectiveAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.ShowEffectiveAutokeyConfigResponse, error) { - return c.internalClient.ShowEffectiveAutokeyConfig(ctx, req, opts...) -} - -// GetLocation gets information about a location. -func (c *AutokeyAdminClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - return c.internalClient.GetLocation(ctx, req, opts...) -} - -// ListLocations lists information about the supported locations for this service. -func (c *AutokeyAdminClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - return c.internalClient.ListLocations(ctx, req, opts...) -} - -// GetIamPolicy gets the access control policy for a resource. Returns an empty policy -// if the resource exists and does not have a policy set. -func (c *AutokeyAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - return c.internalClient.GetIamPolicy(ctx, req, opts...) -} - -// SetIamPolicy sets the access control policy on the specified resource. Replaces -// any existing policy. -// -// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED -// errors. -func (c *AutokeyAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - return c.internalClient.SetIamPolicy(ctx, req, opts...) -} - -// TestIamPermissions returns permissions that a caller has on the specified resource. If the -// resource does not exist, this will return an empty set of -// permissions, not a NOT_FOUND error. -// -// Note: This operation is designed to be used for building -// permission-aware UIs and command-line tools, not for authorization -// checking. This operation may “fail open” without warning. -func (c *AutokeyAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - return c.internalClient.TestIamPermissions(ctx, req, opts...) -} - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *AutokeyAdminClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - -// autokeyAdminGRPCClient is a client for interacting with Cloud Key Management Service (KMS) API over gRPC transport. -// -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type autokeyAdminGRPCClient struct { - // Connection pool of gRPC connections to the service. - connPool gtransport.ConnPool - - // Points back to the CallOptions field of the containing AutokeyAdminClient - CallOptions **AutokeyAdminCallOptions - - // The gRPC API client. - autokeyAdminClient kmspb.AutokeyAdminClient - - operationsClient longrunningpb.OperationsClient - - iamPolicyClient iampb.IAMPolicyClient - - locationsClient locationpb.LocationsClient - - // The x-goog-* metadata to be sent with each request. - xGoogHeaders []string -} - -// NewAutokeyAdminClient creates a new autokey admin client based on gRPC. -// The returned client must be Closed when it is done being used to clean up its underlying connections. -// -// Provides interfaces for managing Cloud KMS Autokey folder-level -// configurations. A configuration is inherited by all descendent projects. A -// configuration at one folder overrides any other configurations in its -// ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS -// Autokey, so that users working in a descendant project can request -// provisioned CryptoKeys, ready for Customer -// Managed Encryption Key (CMEK) use, on-demand. -func NewAutokeyAdminClient(ctx context.Context, opts ...option.ClientOption) (*AutokeyAdminClient, error) { - clientOpts := defaultAutokeyAdminGRPCClientOptions() - if newAutokeyAdminClientHook != nil { - hookOpts, err := newAutokeyAdminClientHook(ctx, clientHookParams{}) - if err != nil { - return nil, err - } - clientOpts = append(clientOpts, hookOpts...) - } - - connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) - if err != nil { - return nil, err - } - client := AutokeyAdminClient{CallOptions: defaultAutokeyAdminCallOptions()} - - c := &autokeyAdminGRPCClient{ - connPool: connPool, - autokeyAdminClient: kmspb.NewAutokeyAdminClient(connPool), - CallOptions: &client.CallOptions, - operationsClient: longrunningpb.NewOperationsClient(connPool), - iamPolicyClient: iampb.NewIAMPolicyClient(connPool), - locationsClient: locationpb.NewLocationsClient(connPool), - } - c.setGoogleClientInfo() - - client.internalClient = c - - return &client, nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *autokeyAdminGRPCClient) Connection() *grpc.ClientConn { - return c.connPool.Conn() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *autokeyAdminGRPCClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *autokeyAdminGRPCClient) Close() error { - return c.connPool.Close() -} - -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type autokeyAdminRESTClient struct { - // The http endpoint to connect to. - endpoint string - - // The http client. - httpClient *http.Client - - // The x-goog-* headers to be sent with each request. - xGoogHeaders []string - - // Points back to the CallOptions field of the containing AutokeyAdminClient - CallOptions **AutokeyAdminCallOptions -} - -// NewAutokeyAdminRESTClient creates a new autokey admin rest client. -// -// Provides interfaces for managing Cloud KMS Autokey folder-level -// configurations. A configuration is inherited by all descendent projects. A -// configuration at one folder overrides any other configurations in its -// ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS -// Autokey, so that users working in a descendant project can request -// provisioned CryptoKeys, ready for Customer -// Managed Encryption Key (CMEK) use, on-demand. -func NewAutokeyAdminRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutokeyAdminClient, error) { - clientOpts := append(defaultAutokeyAdminRESTClientOptions(), opts...) - httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) - if err != nil { - return nil, err - } - - callOpts := defaultAutokeyAdminRESTCallOptions() - c := &autokeyAdminRESTClient{ - endpoint: endpoint, - httpClient: httpClient, - CallOptions: &callOpts, - } - c.setGoogleClientInfo() - - return &AutokeyAdminClient{internalClient: c, CallOptions: callOpts}, nil -} - -func defaultAutokeyAdminRESTClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("https://cloudkms.googleapis.com"), - internaloption.WithDefaultEndpointTemplate("https://cloudkms.UNIVERSE_DOMAIN"), - internaloption.WithDefaultMTLSEndpoint("https://cloudkms.mtls.googleapis.com"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableNewAuthLibrary(), - } -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *autokeyAdminRESTClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *autokeyAdminRESTClient) Close() error { - // Replace httpClient with nil to force cleanup. - c.httpClient = nil - return nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: This method always returns nil. -func (c *autokeyAdminRESTClient) Connection() *grpc.ClientConn { - return nil -} -func (c *autokeyAdminGRPCClient) UpdateAutokeyConfig(ctx context.Context, req *kmspb.UpdateAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "autokey_config.name", url.QueryEscape(req.GetAutokeyConfig().GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).UpdateAutokeyConfig[0:len((*c.CallOptions).UpdateAutokeyConfig):len((*c.CallOptions).UpdateAutokeyConfig)], opts...) - var resp *kmspb.AutokeyConfig - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyAdminClient.UpdateAutokeyConfig(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) GetAutokeyConfig(ctx context.Context, req *kmspb.GetAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetAutokeyConfig[0:len((*c.CallOptions).GetAutokeyConfig):len((*c.CallOptions).GetAutokeyConfig)], opts...) - var resp *kmspb.AutokeyConfig - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyAdminClient.GetAutokeyConfig(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) ShowEffectiveAutokeyConfig(ctx context.Context, req *kmspb.ShowEffectiveAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.ShowEffectiveAutokeyConfigResponse, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).ShowEffectiveAutokeyConfig[0:len((*c.CallOptions).ShowEffectiveAutokeyConfig):len((*c.CallOptions).ShowEffectiveAutokeyConfig)], opts...) - var resp *kmspb.ShowEffectiveAutokeyConfigResponse - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyAdminClient.ShowEffectiveAutokeyConfig(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) - var resp *locationpb.Location - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) - it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { - resp := &locationpb.ListLocationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - - it.Response = resp - return resp.GetLocations(), resp.GetNextPageToken(), nil - } - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -func (c *autokeyAdminGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) - var resp *iampb.Policy - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) - var resp *iampb.Policy - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) - var resp *iampb.TestIamPermissionsResponse - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyAdminGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// UpdateAutokeyConfig updates the AutokeyConfig for a -// folder. The caller must have both cloudkms.autokeyConfigs.update -// permission on the parent folder and cloudkms.cryptoKeys.setIamPolicy -// permission on the provided key project. A -// KeyHandle creation in the folder’s -// descendant projects will use this configuration to determine where to -// create the resulting CryptoKey. -func (c *autokeyAdminRESTClient) UpdateAutokeyConfig(ctx context.Context, req *kmspb.UpdateAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - body := req.GetAutokeyConfig() - jsonReq, err := m.Marshal(body) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetAutokeyConfig().GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetUpdateMask() != nil { - updateMask, err := protojson.Marshal(req.GetUpdateMask()) - if err != nil { - return nil, err - } - params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "autokey_config.name", url.QueryEscape(req.GetAutokeyConfig().GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).UpdateAutokeyConfig[0:len((*c.CallOptions).UpdateAutokeyConfig):len((*c.CallOptions).UpdateAutokeyConfig)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &kmspb.AutokeyConfig{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// GetAutokeyConfig returns the AutokeyConfig for a -// folder. -func (c *autokeyAdminRESTClient) GetAutokeyConfig(ctx context.Context, req *kmspb.GetAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.AutokeyConfig, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetAutokeyConfig[0:len((*c.CallOptions).GetAutokeyConfig):len((*c.CallOptions).GetAutokeyConfig)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &kmspb.AutokeyConfig{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// ShowEffectiveAutokeyConfig returns the effective Cloud KMS Autokey configuration for a given project. -func (c *autokeyAdminRESTClient) ShowEffectiveAutokeyConfig(ctx context.Context, req *kmspb.ShowEffectiveAutokeyConfigRequest, opts ...gax.CallOption) (*kmspb.ShowEffectiveAutokeyConfigResponse, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:showEffectiveAutokeyConfig", req.GetParent()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).ShowEffectiveAutokeyConfig[0:len((*c.CallOptions).ShowEffectiveAutokeyConfig):len((*c.CallOptions).ShowEffectiveAutokeyConfig)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &kmspb.ShowEffectiveAutokeyConfigResponse{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// GetLocation gets information about a location. -func (c *autokeyAdminRESTClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &locationpb.Location{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// ListLocations lists information about the supported locations for this service. -func (c *autokeyAdminRESTClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { - resp := &locationpb.ListLocationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, "", err - } - baseUrl.Path += fmt.Sprintf("/v1/%v/locations", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetFilter() != "" { - params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) - } - if req.GetPageSize() != 0 { - params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) - } - if req.GetPageToken() != "" { - params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := append(c.xGoogHeaders, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, "", e - } - it.Response = resp - return resp.GetLocations(), resp.GetNextPageToken(), nil - } - - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -// GetIamPolicy gets the access control policy for a resource. Returns an empty policy -// if the resource exists and does not have a policy set. -func (c *autokeyAdminRESTClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:getIamPolicy", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetOptions().GetRequestedPolicyVersion() != 0 { - params.Add("options.requestedPolicyVersion", fmt.Sprintf("%v", req.GetOptions().GetRequestedPolicyVersion())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.Policy{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// SetIamPolicy sets the access control policy on the specified resource. Replaces -// any existing policy. -// -// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED -// errors. -func (c *autokeyAdminRESTClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - jsonReq, err := m.Marshal(req) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:setIamPolicy", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.Policy{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// TestIamPermissions returns permissions that a caller has on the specified resource. If the -// resource does not exist, this will return an empty set of -// permissions, not a NOT_FOUND error. -// -// Note: This operation is designed to be used for building -// permission-aware UIs and command-line tools, not for authorization -// checking. This operation may “fail open” without warning. -func (c *autokeyAdminRESTClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - jsonReq, err := m.Marshal(req) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:testIamPermissions", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.TestIamPermissionsResponse{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *autokeyAdminRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go deleted file mode 100644 index c11e3ad222b..00000000000 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go +++ /dev/null @@ -1,1345 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go_gapic. DO NOT EDIT. - -package kms - -import ( - "bytes" - "context" - "fmt" - "io" - "math" - "net/http" - "net/url" - "time" - - iampb "cloud.google.com/go/iam/apiv1/iampb" - kmspb "cloud.google.com/go/kms/apiv1/kmspb" - "cloud.google.com/go/longrunning" - lroauto "cloud.google.com/go/longrunning/autogen" - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - gax "github.com/googleapis/gax-go/v2" - "google.golang.org/api/googleapi" - "google.golang.org/api/iterator" - "google.golang.org/api/option" - "google.golang.org/api/option/internaloption" - gtransport "google.golang.org/api/transport/grpc" - httptransport "google.golang.org/api/transport/http" - locationpb "google.golang.org/genproto/googleapis/cloud/location" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -var newAutokeyClientHook clientHook - -// AutokeyCallOptions contains the retry settings for each method of AutokeyClient. -type AutokeyCallOptions struct { - CreateKeyHandle []gax.CallOption - GetKeyHandle []gax.CallOption - ListKeyHandles []gax.CallOption - GetLocation []gax.CallOption - ListLocations []gax.CallOption - GetIamPolicy []gax.CallOption - SetIamPolicy []gax.CallOption - TestIamPermissions []gax.CallOption - GetOperation []gax.CallOption -} - -func defaultAutokeyGRPCClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("cloudkms.googleapis.com:443"), - internaloption.WithDefaultEndpointTemplate("cloudkms.UNIVERSE_DOMAIN:443"), - internaloption.WithDefaultMTLSEndpoint("cloudkms.mtls.googleapis.com:443"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableJwtWithScope(), - internaloption.EnableNewAuthLibrary(), - option.WithGRPCDialOption(grpc.WithDefaultCallOptions( - grpc.MaxCallRecvMsgSize(math.MaxInt32))), - } -} - -func defaultAutokeyCallOptions() *AutokeyCallOptions { - return &AutokeyCallOptions{ - CreateKeyHandle: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - }, - GetKeyHandle: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - ListKeyHandles: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }) - }), - }, - GetLocation: []gax.CallOption{}, - ListLocations: []gax.CallOption{}, - GetIamPolicy: []gax.CallOption{}, - SetIamPolicy: []gax.CallOption{}, - TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, - } -} - -func defaultAutokeyRESTCallOptions() *AutokeyCallOptions { - return &AutokeyCallOptions{ - CreateKeyHandle: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - }, - GetKeyHandle: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }, - http.StatusServiceUnavailable, - http.StatusGatewayTimeout) - }), - }, - ListKeyHandles: []gax.CallOption{ - gax.WithTimeout(60000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60000 * time.Millisecond, - Multiplier: 1.30, - }, - http.StatusServiceUnavailable, - http.StatusGatewayTimeout) - }), - }, - GetLocation: []gax.CallOption{}, - ListLocations: []gax.CallOption{}, - GetIamPolicy: []gax.CallOption{}, - SetIamPolicy: []gax.CallOption{}, - TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, - } -} - -// internalAutokeyClient is an interface that defines the methods available from Cloud Key Management Service (KMS) API. -type internalAutokeyClient interface { - Close() error - setGoogleClientInfo(...string) - Connection() *grpc.ClientConn - CreateKeyHandle(context.Context, *kmspb.CreateKeyHandleRequest, ...gax.CallOption) (*CreateKeyHandleOperation, error) - CreateKeyHandleOperation(name string) *CreateKeyHandleOperation - GetKeyHandle(context.Context, *kmspb.GetKeyHandleRequest, ...gax.CallOption) (*kmspb.KeyHandle, error) - ListKeyHandles(context.Context, *kmspb.ListKeyHandlesRequest, ...gax.CallOption) (*kmspb.ListKeyHandlesResponse, error) - GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) - ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator - GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) - SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) - TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) -} - -// AutokeyClient is a client for interacting with Cloud Key Management Service (KMS) API. -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -// -// Provides interfaces for using Cloud KMS Autokey to provision new -// CryptoKeys, ready for Customer Managed -// Encryption Key (CMEK) use, on-demand. To support certain client tooling, this -// feature is modeled around a KeyHandle -// resource: creating a KeyHandle in a resource -// project and given location triggers Cloud KMS Autokey to provision a -// CryptoKey in the configured key project and -// the same location. -// -// Prior to use in a given resource project, -// UpdateAutokeyConfig -// should have been called on an ancestor folder, setting the key project where -// Cloud KMS Autokey should create new -// CryptoKeys. See documentation for additional -// prerequisites. To check what key project, if any, is currently configured on -// a resource project’s ancestor folder, see -// ShowEffectiveAutokeyConfig. -type AutokeyClient struct { - // The internal transport-dependent client. - internalClient internalAutokeyClient - - // The call options for this service. - CallOptions *AutokeyCallOptions - - // LROClient is used internally to handle long-running operations. - // It is exposed so that its CallOptions can be modified if required. - // Users should not Close this client. - LROClient *lroauto.OperationsClient -} - -// Wrapper methods routed to the internal client. - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *AutokeyClient) Close() error { - return c.internalClient.Close() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *AutokeyClient) setGoogleClientInfo(keyval ...string) { - c.internalClient.setGoogleClientInfo(keyval...) -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *AutokeyClient) Connection() *grpc.ClientConn { - return c.internalClient.Connection() -} - -// CreateKeyHandle creates a new KeyHandle, triggering the -// provisioning of a new CryptoKey for CMEK -// use with the given resource type in the configured key project and the same -// location. GetOperation should be used to resolve -// the resulting long-running operation and get the resulting -// KeyHandle and -// CryptoKey. -func (c *AutokeyClient) CreateKeyHandle(ctx context.Context, req *kmspb.CreateKeyHandleRequest, opts ...gax.CallOption) (*CreateKeyHandleOperation, error) { - return c.internalClient.CreateKeyHandle(ctx, req, opts...) -} - -// CreateKeyHandleOperation returns a new CreateKeyHandleOperation from a given name. -// The name must be that of a previously created CreateKeyHandleOperation, possibly from a different process. -func (c *AutokeyClient) CreateKeyHandleOperation(name string) *CreateKeyHandleOperation { - return c.internalClient.CreateKeyHandleOperation(name) -} - -// GetKeyHandle returns the KeyHandle. -func (c *AutokeyClient) GetKeyHandle(ctx context.Context, req *kmspb.GetKeyHandleRequest, opts ...gax.CallOption) (*kmspb.KeyHandle, error) { - return c.internalClient.GetKeyHandle(ctx, req, opts...) -} - -// ListKeyHandles lists KeyHandles. -func (c *AutokeyClient) ListKeyHandles(ctx context.Context, req *kmspb.ListKeyHandlesRequest, opts ...gax.CallOption) (*kmspb.ListKeyHandlesResponse, error) { - return c.internalClient.ListKeyHandles(ctx, req, opts...) -} - -// GetLocation gets information about a location. -func (c *AutokeyClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - return c.internalClient.GetLocation(ctx, req, opts...) -} - -// ListLocations lists information about the supported locations for this service. -func (c *AutokeyClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - return c.internalClient.ListLocations(ctx, req, opts...) -} - -// GetIamPolicy gets the access control policy for a resource. Returns an empty policy -// if the resource exists and does not have a policy set. -func (c *AutokeyClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - return c.internalClient.GetIamPolicy(ctx, req, opts...) -} - -// SetIamPolicy sets the access control policy on the specified resource. Replaces -// any existing policy. -// -// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED -// errors. -func (c *AutokeyClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - return c.internalClient.SetIamPolicy(ctx, req, opts...) -} - -// TestIamPermissions returns permissions that a caller has on the specified resource. If the -// resource does not exist, this will return an empty set of -// permissions, not a NOT_FOUND error. -// -// Note: This operation is designed to be used for building -// permission-aware UIs and command-line tools, not for authorization -// checking. This operation may “fail open” without warning. -func (c *AutokeyClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - return c.internalClient.TestIamPermissions(ctx, req, opts...) -} - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *AutokeyClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - -// autokeyGRPCClient is a client for interacting with Cloud Key Management Service (KMS) API over gRPC transport. -// -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type autokeyGRPCClient struct { - // Connection pool of gRPC connections to the service. - connPool gtransport.ConnPool - - // Points back to the CallOptions field of the containing AutokeyClient - CallOptions **AutokeyCallOptions - - // The gRPC API client. - autokeyClient kmspb.AutokeyClient - - // LROClient is used internally to handle long-running operations. - // It is exposed so that its CallOptions can be modified if required. - // Users should not Close this client. - LROClient **lroauto.OperationsClient - - operationsClient longrunningpb.OperationsClient - - iamPolicyClient iampb.IAMPolicyClient - - locationsClient locationpb.LocationsClient - - // The x-goog-* metadata to be sent with each request. - xGoogHeaders []string -} - -// NewAutokeyClient creates a new autokey client based on gRPC. -// The returned client must be Closed when it is done being used to clean up its underlying connections. -// -// Provides interfaces for using Cloud KMS Autokey to provision new -// CryptoKeys, ready for Customer Managed -// Encryption Key (CMEK) use, on-demand. To support certain client tooling, this -// feature is modeled around a KeyHandle -// resource: creating a KeyHandle in a resource -// project and given location triggers Cloud KMS Autokey to provision a -// CryptoKey in the configured key project and -// the same location. -// -// Prior to use in a given resource project, -// UpdateAutokeyConfig -// should have been called on an ancestor folder, setting the key project where -// Cloud KMS Autokey should create new -// CryptoKeys. See documentation for additional -// prerequisites. To check what key project, if any, is currently configured on -// a resource project’s ancestor folder, see -// ShowEffectiveAutokeyConfig. -func NewAutokeyClient(ctx context.Context, opts ...option.ClientOption) (*AutokeyClient, error) { - clientOpts := defaultAutokeyGRPCClientOptions() - if newAutokeyClientHook != nil { - hookOpts, err := newAutokeyClientHook(ctx, clientHookParams{}) - if err != nil { - return nil, err - } - clientOpts = append(clientOpts, hookOpts...) - } - - connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) - if err != nil { - return nil, err - } - client := AutokeyClient{CallOptions: defaultAutokeyCallOptions()} - - c := &autokeyGRPCClient{ - connPool: connPool, - autokeyClient: kmspb.NewAutokeyClient(connPool), - CallOptions: &client.CallOptions, - operationsClient: longrunningpb.NewOperationsClient(connPool), - iamPolicyClient: iampb.NewIAMPolicyClient(connPool), - locationsClient: locationpb.NewLocationsClient(connPool), - } - c.setGoogleClientInfo() - - client.internalClient = c - - client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) - if err != nil { - // This error "should not happen", since we are just reusing old connection pool - // and never actually need to dial. - // If this does happen, we could leak connp. However, we cannot close conn: - // If the user invoked the constructor with option.WithGRPCConn, - // we would close a connection that's still in use. - // TODO: investigate error conditions. - return nil, err - } - c.LROClient = &client.LROClient - return &client, nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *autokeyGRPCClient) Connection() *grpc.ClientConn { - return c.connPool.Conn() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *autokeyGRPCClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *autokeyGRPCClient) Close() error { - return c.connPool.Close() -} - -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type autokeyRESTClient struct { - // The http endpoint to connect to. - endpoint string - - // The http client. - httpClient *http.Client - - // LROClient is used internally to handle long-running operations. - // It is exposed so that its CallOptions can be modified if required. - // Users should not Close this client. - LROClient **lroauto.OperationsClient - - // The x-goog-* headers to be sent with each request. - xGoogHeaders []string - - // Points back to the CallOptions field of the containing AutokeyClient - CallOptions **AutokeyCallOptions -} - -// NewAutokeyRESTClient creates a new autokey rest client. -// -// Provides interfaces for using Cloud KMS Autokey to provision new -// CryptoKeys, ready for Customer Managed -// Encryption Key (CMEK) use, on-demand. To support certain client tooling, this -// feature is modeled around a KeyHandle -// resource: creating a KeyHandle in a resource -// project and given location triggers Cloud KMS Autokey to provision a -// CryptoKey in the configured key project and -// the same location. -// -// Prior to use in a given resource project, -// UpdateAutokeyConfig -// should have been called on an ancestor folder, setting the key project where -// Cloud KMS Autokey should create new -// CryptoKeys. See documentation for additional -// prerequisites. To check what key project, if any, is currently configured on -// a resource project’s ancestor folder, see -// ShowEffectiveAutokeyConfig. -func NewAutokeyRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutokeyClient, error) { - clientOpts := append(defaultAutokeyRESTClientOptions(), opts...) - httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) - if err != nil { - return nil, err - } - - callOpts := defaultAutokeyRESTCallOptions() - c := &autokeyRESTClient{ - endpoint: endpoint, - httpClient: httpClient, - CallOptions: &callOpts, - } - c.setGoogleClientInfo() - - lroOpts := []option.ClientOption{ - option.WithHTTPClient(httpClient), - option.WithEndpoint(endpoint), - } - opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...) - if err != nil { - return nil, err - } - c.LROClient = &opClient - - return &AutokeyClient{internalClient: c, CallOptions: callOpts}, nil -} - -func defaultAutokeyRESTClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("https://cloudkms.googleapis.com"), - internaloption.WithDefaultEndpointTemplate("https://cloudkms.UNIVERSE_DOMAIN"), - internaloption.WithDefaultMTLSEndpoint("https://cloudkms.mtls.googleapis.com"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableNewAuthLibrary(), - } -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *autokeyRESTClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *autokeyRESTClient) Close() error { - // Replace httpClient with nil to force cleanup. - c.httpClient = nil - return nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: This method always returns nil. -func (c *autokeyRESTClient) Connection() *grpc.ClientConn { - return nil -} -func (c *autokeyGRPCClient) CreateKeyHandle(ctx context.Context, req *kmspb.CreateKeyHandleRequest, opts ...gax.CallOption) (*CreateKeyHandleOperation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).CreateKeyHandle[0:len((*c.CallOptions).CreateKeyHandle):len((*c.CallOptions).CreateKeyHandle)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyClient.CreateKeyHandle(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return &CreateKeyHandleOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), - }, nil -} - -func (c *autokeyGRPCClient) GetKeyHandle(ctx context.Context, req *kmspb.GetKeyHandleRequest, opts ...gax.CallOption) (*kmspb.KeyHandle, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetKeyHandle[0:len((*c.CallOptions).GetKeyHandle):len((*c.CallOptions).GetKeyHandle)], opts...) - var resp *kmspb.KeyHandle - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyClient.GetKeyHandle(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) ListKeyHandles(ctx context.Context, req *kmspb.ListKeyHandlesRequest, opts ...gax.CallOption) (*kmspb.ListKeyHandlesResponse, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).ListKeyHandles[0:len((*c.CallOptions).ListKeyHandles):len((*c.CallOptions).ListKeyHandles)], opts...) - var resp *kmspb.ListKeyHandlesResponse - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.autokeyClient.ListKeyHandles(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) - var resp *locationpb.Location - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) - it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { - resp := &locationpb.ListLocationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.locationsClient.ListLocations(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - - it.Response = resp - return resp.GetLocations(), resp.GetNextPageToken(), nil - } - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -func (c *autokeyGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) - var resp *iampb.Policy - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.GetIamPolicy(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) - var resp *iampb.Policy - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.SetIamPolicy(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) - var resp *iampb.TestIamPermissionsResponse - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.iamPolicyClient.TestIamPermissions(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *autokeyGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// CreateKeyHandle creates a new KeyHandle, triggering the -// provisioning of a new CryptoKey for CMEK -// use with the given resource type in the configured key project and the same -// location. GetOperation should be used to resolve -// the resulting long-running operation and get the resulting -// KeyHandle and -// CryptoKey. -func (c *autokeyRESTClient) CreateKeyHandle(ctx context.Context, req *kmspb.CreateKeyHandleRequest, opts ...gax.CallOption) (*CreateKeyHandleOperation, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - body := req.GetKeyHandle() - jsonReq, err := m.Marshal(body) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v/keyHandles", req.GetParent()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetKeyHandleId() != "" { - params.Add("keyHandleId", fmt.Sprintf("%v", req.GetKeyHandleId())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - - override := fmt.Sprintf("/v1/%s", resp.GetName()) - return &CreateKeyHandleOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), - pollPath: override, - }, nil -} - -// GetKeyHandle returns the KeyHandle. -func (c *autokeyRESTClient) GetKeyHandle(ctx context.Context, req *kmspb.GetKeyHandleRequest, opts ...gax.CallOption) (*kmspb.KeyHandle, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetKeyHandle[0:len((*c.CallOptions).GetKeyHandle):len((*c.CallOptions).GetKeyHandle)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &kmspb.KeyHandle{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// ListKeyHandles lists KeyHandles. -func (c *autokeyRESTClient) ListKeyHandles(ctx context.Context, req *kmspb.ListKeyHandlesRequest, opts ...gax.CallOption) (*kmspb.ListKeyHandlesResponse, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v/keyHandles", req.GetParent()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetFilter() != "" { - params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).ListKeyHandles[0:len((*c.CallOptions).ListKeyHandles):len((*c.CallOptions).ListKeyHandles)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &kmspb.ListKeyHandlesResponse{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// GetLocation gets information about a location. -func (c *autokeyRESTClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &locationpb.Location{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// ListLocations lists information about the supported locations for this service. -func (c *autokeyRESTClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { - it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { - resp := &locationpb.ListLocationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, "", err - } - baseUrl.Path += fmt.Sprintf("/v1/%v/locations", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetFilter() != "" { - params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) - } - if req.GetPageSize() != 0 { - params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) - } - if req.GetPageToken() != "" { - params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := append(c.xGoogHeaders, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, "", e - } - it.Response = resp - return resp.GetLocations(), resp.GetNextPageToken(), nil - } - - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -// GetIamPolicy gets the access control policy for a resource. Returns an empty policy -// if the resource exists and does not have a policy set. -func (c *autokeyRESTClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:getIamPolicy", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - if req.GetOptions().GetRequestedPolicyVersion() != 0 { - params.Add("options.requestedPolicyVersion", fmt.Sprintf("%v", req.GetOptions().GetRequestedPolicyVersion())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.Policy{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// SetIamPolicy sets the access control policy on the specified resource. Replaces -// any existing policy. -// -// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED -// errors. -func (c *autokeyRESTClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - jsonReq, err := m.Marshal(req) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:setIamPolicy", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.Policy{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// TestIamPermissions returns permissions that a caller has on the specified resource. If the -// resource does not exist, this will return an empty set of -// permissions, not a NOT_FOUND error. -// -// Note: This operation is designed to be used for building -// permission-aware UIs and command-line tools, not for authorization -// checking. This operation may “fail open” without warning. -func (c *autokeyRESTClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - jsonReq, err := m.Marshal(req) - if err != nil { - return nil, err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:testIamPermissions", req.GetResource()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &iampb.TestIamPermissionsResponse{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *autokeyRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// CreateKeyHandleOperation returns a new CreateKeyHandleOperation from a given name. -// The name must be that of a previously created CreateKeyHandleOperation, possibly from a different process. -func (c *autokeyGRPCClient) CreateKeyHandleOperation(name string) *CreateKeyHandleOperation { - return &CreateKeyHandleOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), - } -} - -// CreateKeyHandleOperation returns a new CreateKeyHandleOperation from a given name. -// The name must be that of a previously created CreateKeyHandleOperation, possibly from a different process. -func (c *autokeyRESTClient) CreateKeyHandleOperation(name string) *CreateKeyHandleOperation { - override := fmt.Sprintf("/v1/%s", name) - return &CreateKeyHandleOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), - pollPath: override, - } -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go index 0ca75b22f8a..49c301e3375 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go @@ -17,80 +17,11 @@ package kms import ( - "context" - "time" - kmspb "cloud.google.com/go/kms/apiv1/kmspb" - "cloud.google.com/go/longrunning" - gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) -// CreateKeyHandleOperation manages a long-running operation from CreateKeyHandle. -type CreateKeyHandleOperation struct { - lro *longrunning.Operation - pollPath string -} - -// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. -// -// See documentation of Poll for error-handling information. -func (op *CreateKeyHandleOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*kmspb.KeyHandle, error) { - opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) - var resp kmspb.KeyHandle - if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { - return nil, err - } - return &resp, nil -} - -// Poll fetches the latest state of the long-running operation. -// -// Poll also fetches the latest metadata, which can be retrieved by Metadata. -// -// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and -// the operation has completed with failure, the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, -// op.Done will return true, and the response of the operation is returned. -// If Poll succeeds and the operation has not completed, the returned response and error are both nil. -func (op *CreateKeyHandleOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*kmspb.KeyHandle, error) { - opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) - var resp kmspb.KeyHandle - if err := op.lro.Poll(ctx, &resp, opts...); err != nil { - return nil, err - } - if !op.Done() { - return nil, nil - } - return &resp, nil -} - -// Metadata returns metadata associated with the long-running operation. -// Metadata itself does not contact the server, but Poll does. -// To get the latest metadata, call this method after a successful call to Poll. -// If the metadata is not available, the returned metadata and error are both nil. -func (op *CreateKeyHandleOperation) Metadata() (*kmspb.CreateKeyHandleMetadata, error) { - var meta kmspb.CreateKeyHandleMetadata - if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { - return nil, nil - } else if err != nil { - return nil, err - } - return &meta, nil -} - -// Done reports whether the long-running operation has completed. -func (op *CreateKeyHandleOperation) Done() bool { - return op.lro.Done() -} - -// Name returns the name of the long-running operation. -// The name is assigned by the server and is unique within the service from which the operation is created. -func (op *CreateKeyHandleOperation) Name() string { - return op.lro.Name() -} - // CryptoKeyIterator manages a stream of *kmspb.CryptoKey. type CryptoKeyIterator struct { items []*kmspb.CryptoKey diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/doc.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/doc.go index 432780fa5a3..b20d1ac4014 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/doc.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/doc.go @@ -42,7 +42,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := kms.NewAutokeyClient(ctx) +// c, err := kms.NewEkmClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -62,22 +62,17 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := kms.NewAutokeyClient(ctx) +// c, err := kms.NewEkmClient(ctx) // if err != nil { // // TODO: Handle error. // } // defer c.Close() // -// req := &kmspb.CreateKeyHandleRequest{ +// req := &kmspb.CreateEkmConnectionRequest{ // // TODO: Fill request struct fields. -// // See https://pkg.go.dev/cloud.google.com/go/kms/apiv1/kmspb#CreateKeyHandleRequest. +// // See https://pkg.go.dev/cloud.google.com/go/kms/apiv1/kmspb#CreateEkmConnectionRequest. // } -// op, err := c.CreateKeyHandle(ctx, req) -// if err != nil { -// // TODO: Handle error. -// } -// -// resp, err := op.Wait(ctx) +// resp, err := c.CreateEkmConnection(ctx, req) // if err != nil { // // TODO: Handle error. // } @@ -86,7 +81,7 @@ // // # Use of Context // -// The ctx passed to NewAutokeyClient is used for authentication requests and +// The ctx passed to NewEkmClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go index 6d1856c9eac..1e8d2ffe0a0 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go @@ -28,7 +28,6 @@ import ( iampb "cloud.google.com/go/iam/apiv1/iampb" kmspb "cloud.google.com/go/kms/apiv1/kmspb" - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" @@ -59,7 +58,6 @@ type EkmCallOptions struct { GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption - GetOperation []gax.CallOption } func defaultEkmGRPCClientOptions() []option.ClientOption { @@ -71,7 +69,6 @@ func defaultEkmGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), - internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), } @@ -139,7 +136,6 @@ func defaultEkmCallOptions() *EkmCallOptions { GetIamPolicy: []gax.CallOption{}, SetIamPolicy: []gax.CallOption{}, TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, } } @@ -201,7 +197,6 @@ func defaultEkmRESTCallOptions() *EkmCallOptions { GetIamPolicy: []gax.CallOption{}, SetIamPolicy: []gax.CallOption{}, TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, } } @@ -222,7 +217,6 @@ type internalEkmClient interface { GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // EkmClient is a client for interacting with Cloud Key Management Service (KMS) API. @@ -344,11 +338,6 @@ func (c *EkmClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPe return c.internalClient.TestIamPermissions(ctx, req, opts...) } -// GetOperation is a utility method from google.longrunning.Operations. -func (c *EkmClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - // ekmGRPCClient is a client for interacting with Cloud Key Management Service (KMS) API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -362,8 +351,6 @@ type ekmGRPCClient struct { // The gRPC API client. ekmClient kmspb.EkmServiceClient - operationsClient longrunningpb.OperationsClient - iamPolicyClient iampb.IAMPolicyClient locationsClient locationpb.LocationsClient @@ -398,12 +385,11 @@ func NewEkmClient(ctx context.Context, opts ...option.ClientOption) (*EkmClient, client := EkmClient{CallOptions: defaultEkmCallOptions()} c := &ekmGRPCClient{ - connPool: connPool, - ekmClient: kmspb.NewEkmServiceClient(connPool), - CallOptions: &client.CallOptions, - operationsClient: longrunningpb.NewOperationsClient(connPool), - iamPolicyClient: iampb.NewIAMPolicyClient(connPool), - locationsClient: locationpb.NewLocationsClient(connPool), + connPool: connPool, + ekmClient: kmspb.NewEkmServiceClient(connPool), + CallOptions: &client.CallOptions, + iamPolicyClient: iampb.NewIAMPolicyClient(connPool), + locationsClient: locationpb.NewLocationsClient(connPool), } c.setGoogleClientInfo() @@ -426,9 +412,7 @@ func (c *ekmGRPCClient) Connection() *grpc.ClientConn { func (c *ekmGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} } // Close closes the connection to the API service. The user should invoke this when @@ -486,7 +470,6 @@ func defaultEkmRESTClientOptions() []option.ClientOption { internaloption.WithDefaultUniverseDomain("googleapis.com"), internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableNewAuthLibrary(), } } @@ -496,9 +479,7 @@ func defaultEkmRESTClientOptions() []option.ClientOption { func (c *ekmRESTClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} } // Close closes the connection to the API service. The user should invoke this when @@ -787,24 +768,6 @@ func (c *ekmGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestI return resp, nil } -func (c *ekmGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - // ListEkmConnections lists EkmConnections. func (c *ekmRESTClient) ListEkmConnections(ctx context.Context, req *kmspb.ListEkmConnectionsRequest, opts ...gax.CallOption) *EkmConnectionIterator { it := &EkmConnectionIterator{} @@ -1661,63 +1624,3 @@ func (c *ekmRESTClient) TestIamPermissions(ctx context.Context, req *iampb.TestI } return resp, nil } - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *ekmRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json b/upstream/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json deleted file mode 100644 index 47b250252cc..00000000000 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json +++ /dev/null @@ -1,715 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.cloud.kms.v1", - "libraryPackage": "cloud.google.com/go/kms/apiv1", - "services": { - "Autokey": { - "clients": { - "grpc": { - "libraryClient": "AutokeyClient", - "rpcs": { - "CreateKeyHandle": { - "methods": [ - "CreateKeyHandle" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetKeyHandle": { - "methods": [ - "GetKeyHandle" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListKeyHandles": { - "methods": [ - "ListKeyHandles" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - } - } - }, - "rest": { - "libraryClient": "AutokeyClient", - "rpcs": { - "CreateKeyHandle": { - "methods": [ - "CreateKeyHandle" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetKeyHandle": { - "methods": [ - "GetKeyHandle" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListKeyHandles": { - "methods": [ - "ListKeyHandles" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - } - } - } - } - }, - "AutokeyAdmin": { - "clients": { - "grpc": { - "libraryClient": "AutokeyAdminClient", - "rpcs": { - "GetAutokeyConfig": { - "methods": [ - "GetAutokeyConfig" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "ShowEffectiveAutokeyConfig": { - "methods": [ - "ShowEffectiveAutokeyConfig" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateAutokeyConfig": { - "methods": [ - "UpdateAutokeyConfig" - ] - } - } - }, - "rest": { - "libraryClient": "AutokeyAdminClient", - "rpcs": { - "GetAutokeyConfig": { - "methods": [ - "GetAutokeyConfig" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "ShowEffectiveAutokeyConfig": { - "methods": [ - "ShowEffectiveAutokeyConfig" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateAutokeyConfig": { - "methods": [ - "UpdateAutokeyConfig" - ] - } - } - } - } - }, - "EkmService": { - "clients": { - "grpc": { - "libraryClient": "EkmClient", - "rpcs": { - "CreateEkmConnection": { - "methods": [ - "CreateEkmConnection" - ] - }, - "GetEkmConfig": { - "methods": [ - "GetEkmConfig" - ] - }, - "GetEkmConnection": { - "methods": [ - "GetEkmConnection" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListEkmConnections": { - "methods": [ - "ListEkmConnections" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateEkmConfig": { - "methods": [ - "UpdateEkmConfig" - ] - }, - "UpdateEkmConnection": { - "methods": [ - "UpdateEkmConnection" - ] - }, - "VerifyConnectivity": { - "methods": [ - "VerifyConnectivity" - ] - } - } - }, - "rest": { - "libraryClient": "EkmClient", - "rpcs": { - "CreateEkmConnection": { - "methods": [ - "CreateEkmConnection" - ] - }, - "GetEkmConfig": { - "methods": [ - "GetEkmConfig" - ] - }, - "GetEkmConnection": { - "methods": [ - "GetEkmConnection" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListEkmConnections": { - "methods": [ - "ListEkmConnections" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateEkmConfig": { - "methods": [ - "UpdateEkmConfig" - ] - }, - "UpdateEkmConnection": { - "methods": [ - "UpdateEkmConnection" - ] - }, - "VerifyConnectivity": { - "methods": [ - "VerifyConnectivity" - ] - } - } - } - } - }, - "KeyManagementService": { - "clients": { - "grpc": { - "libraryClient": "KeyManagementClient", - "rpcs": { - "AsymmetricDecrypt": { - "methods": [ - "AsymmetricDecrypt" - ] - }, - "AsymmetricSign": { - "methods": [ - "AsymmetricSign" - ] - }, - "CreateCryptoKey": { - "methods": [ - "CreateCryptoKey" - ] - }, - "CreateCryptoKeyVersion": { - "methods": [ - "CreateCryptoKeyVersion" - ] - }, - "CreateImportJob": { - "methods": [ - "CreateImportJob" - ] - }, - "CreateKeyRing": { - "methods": [ - "CreateKeyRing" - ] - }, - "Decrypt": { - "methods": [ - "Decrypt" - ] - }, - "DestroyCryptoKeyVersion": { - "methods": [ - "DestroyCryptoKeyVersion" - ] - }, - "Encrypt": { - "methods": [ - "Encrypt" - ] - }, - "GenerateRandomBytes": { - "methods": [ - "GenerateRandomBytes" - ] - }, - "GetCryptoKey": { - "methods": [ - "GetCryptoKey" - ] - }, - "GetCryptoKeyVersion": { - "methods": [ - "GetCryptoKeyVersion" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetImportJob": { - "methods": [ - "GetImportJob" - ] - }, - "GetKeyRing": { - "methods": [ - "GetKeyRing" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "GetPublicKey": { - "methods": [ - "GetPublicKey" - ] - }, - "ImportCryptoKeyVersion": { - "methods": [ - "ImportCryptoKeyVersion" - ] - }, - "ListCryptoKeyVersions": { - "methods": [ - "ListCryptoKeyVersions" - ] - }, - "ListCryptoKeys": { - "methods": [ - "ListCryptoKeys" - ] - }, - "ListImportJobs": { - "methods": [ - "ListImportJobs" - ] - }, - "ListKeyRings": { - "methods": [ - "ListKeyRings" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "MacSign": { - "methods": [ - "MacSign" - ] - }, - "MacVerify": { - "methods": [ - "MacVerify" - ] - }, - "RawDecrypt": { - "methods": [ - "RawDecrypt" - ] - }, - "RawEncrypt": { - "methods": [ - "RawEncrypt" - ] - }, - "RestoreCryptoKeyVersion": { - "methods": [ - "RestoreCryptoKeyVersion" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateCryptoKey": { - "methods": [ - "UpdateCryptoKey" - ] - }, - "UpdateCryptoKeyPrimaryVersion": { - "methods": [ - "UpdateCryptoKeyPrimaryVersion" - ] - }, - "UpdateCryptoKeyVersion": { - "methods": [ - "UpdateCryptoKeyVersion" - ] - } - } - }, - "rest": { - "libraryClient": "KeyManagementClient", - "rpcs": { - "AsymmetricDecrypt": { - "methods": [ - "AsymmetricDecrypt" - ] - }, - "AsymmetricSign": { - "methods": [ - "AsymmetricSign" - ] - }, - "CreateCryptoKey": { - "methods": [ - "CreateCryptoKey" - ] - }, - "CreateCryptoKeyVersion": { - "methods": [ - "CreateCryptoKeyVersion" - ] - }, - "CreateImportJob": { - "methods": [ - "CreateImportJob" - ] - }, - "CreateKeyRing": { - "methods": [ - "CreateKeyRing" - ] - }, - "Decrypt": { - "methods": [ - "Decrypt" - ] - }, - "DestroyCryptoKeyVersion": { - "methods": [ - "DestroyCryptoKeyVersion" - ] - }, - "Encrypt": { - "methods": [ - "Encrypt" - ] - }, - "GenerateRandomBytes": { - "methods": [ - "GenerateRandomBytes" - ] - }, - "GetCryptoKey": { - "methods": [ - "GetCryptoKey" - ] - }, - "GetCryptoKeyVersion": { - "methods": [ - "GetCryptoKeyVersion" - ] - }, - "GetIamPolicy": { - "methods": [ - "GetIamPolicy" - ] - }, - "GetImportJob": { - "methods": [ - "GetImportJob" - ] - }, - "GetKeyRing": { - "methods": [ - "GetKeyRing" - ] - }, - "GetLocation": { - "methods": [ - "GetLocation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "GetPublicKey": { - "methods": [ - "GetPublicKey" - ] - }, - "ImportCryptoKeyVersion": { - "methods": [ - "ImportCryptoKeyVersion" - ] - }, - "ListCryptoKeyVersions": { - "methods": [ - "ListCryptoKeyVersions" - ] - }, - "ListCryptoKeys": { - "methods": [ - "ListCryptoKeys" - ] - }, - "ListImportJobs": { - "methods": [ - "ListImportJobs" - ] - }, - "ListKeyRings": { - "methods": [ - "ListKeyRings" - ] - }, - "ListLocations": { - "methods": [ - "ListLocations" - ] - }, - "MacSign": { - "methods": [ - "MacSign" - ] - }, - "MacVerify": { - "methods": [ - "MacVerify" - ] - }, - "RawDecrypt": { - "methods": [ - "RawDecrypt" - ] - }, - "RawEncrypt": { - "methods": [ - "RawEncrypt" - ] - }, - "RestoreCryptoKeyVersion": { - "methods": [ - "RestoreCryptoKeyVersion" - ] - }, - "SetIamPolicy": { - "methods": [ - "SetIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "TestIamPermissions" - ] - }, - "UpdateCryptoKey": { - "methods": [ - "UpdateCryptoKey" - ] - }, - "UpdateCryptoKeyPrimaryVersion": { - "methods": [ - "UpdateCryptoKeyPrimaryVersion" - ] - }, - "UpdateCryptoKeyVersion": { - "methods": [ - "UpdateCryptoKeyVersion" - ] - } - } - } - } - } - } -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go index 7b3492e9113..2f71ee36c77 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go @@ -28,7 +28,6 @@ import ( iampb "cloud.google.com/go/iam/apiv1/iampb" kmspb "cloud.google.com/go/kms/apiv1/kmspb" - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" @@ -80,7 +79,6 @@ type KeyManagementCallOptions struct { GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption - GetOperation []gax.CallOption } func defaultKeyManagementGRPCClientOptions() []option.ClientOption { @@ -92,7 +90,6 @@ func defaultKeyManagementGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), - internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), } @@ -425,7 +422,6 @@ func defaultKeyManagementCallOptions() *KeyManagementCallOptions { GetIamPolicy: []gax.CallOption{}, SetIamPolicy: []gax.CallOption{}, TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, } } @@ -732,7 +728,6 @@ func defaultKeyManagementRESTCallOptions() *KeyManagementCallOptions { GetIamPolicy: []gax.CallOption{}, SetIamPolicy: []gax.CallOption{}, TestIamPermissions: []gax.CallOption{}, - GetOperation: []gax.CallOption{}, } } @@ -774,7 +769,6 @@ type internalKeyManagementClient interface { GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // KeyManagementClient is a client for interacting with Cloud Key Management Service (KMS) API. @@ -1104,11 +1098,6 @@ func (c *KeyManagementClient) TestIamPermissions(ctx context.Context, req *iampb return c.internalClient.TestIamPermissions(ctx, req, opts...) } -// GetOperation is a utility method from google.longrunning.Operations. -func (c *KeyManagementClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - // keyManagementGRPCClient is a client for interacting with Cloud Key Management Service (KMS) API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -1122,8 +1111,6 @@ type keyManagementGRPCClient struct { // The gRPC API client. keyManagementClient kmspb.KeyManagementServiceClient - operationsClient longrunningpb.OperationsClient - iamPolicyClient iampb.IAMPolicyClient locationsClient locationpb.LocationsClient @@ -1170,7 +1157,6 @@ func NewKeyManagementClient(ctx context.Context, opts ...option.ClientOption) (* connPool: connPool, keyManagementClient: kmspb.NewKeyManagementServiceClient(connPool), CallOptions: &client.CallOptions, - operationsClient: longrunningpb.NewOperationsClient(connPool), iamPolicyClient: iampb.NewIAMPolicyClient(connPool), locationsClient: locationpb.NewLocationsClient(connPool), } @@ -1195,9 +1181,7 @@ func (c *keyManagementGRPCClient) Connection() *grpc.ClientConn { func (c *keyManagementGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} } // Close closes the connection to the API service. The user should invoke this when @@ -1264,7 +1248,6 @@ func defaultKeyManagementRESTClientOptions() []option.ClientOption { internaloption.WithDefaultUniverseDomain("googleapis.com"), internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableNewAuthLibrary(), } } @@ -1274,9 +1257,7 @@ func defaultKeyManagementRESTClientOptions() []option.ClientOption { func (c *keyManagementRESTClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") - c.xGoogHeaders = []string{ - "x-goog-api-client", gax.XGoogHeader(kv...), - } + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} } // Close closes the connection to the API service. The user should invoke this when @@ -2027,24 +2008,6 @@ func (c *keyManagementGRPCClient) TestIamPermissions(ctx context.Context, req *i return resp, nil } -func (c *keyManagementGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - // ListKeyRings lists KeyRings. func (c *keyManagementRESTClient) ListKeyRings(ctx context.Context, req *kmspb.ListKeyRingsRequest, opts ...gax.CallOption) *KeyRingIterator { it := &KeyRingIterator{} @@ -4470,63 +4433,3 @@ func (c *keyManagementRESTClient) TestIamPermissions(ctx context.Context, req *i } return resp, nil } - -// GetOperation is a utility method from google.longrunning.Operations. -func (c *keyManagementRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - params.Add("$alt", "json;enum-encoding=int") - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go deleted file mode 100644 index 167f4362333..00000000000 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go +++ /dev/null @@ -1,828 +0,0 @@ -// Copyright 2024 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v4.25.3 -// source: google/cloud/kms/v1/autokey.proto - -package kmspb - -import ( - context "context" - reflect "reflect" - sync "sync" - - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Request message for -// [Autokey.CreateKeyHandle][google.cloud.kms.v1.Autokey.CreateKeyHandle]. -type CreateKeyHandleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Name of the resource project and location to create the - // [KeyHandle][google.cloud.kms.v1.KeyHandle] in, e.g. - // `projects/{PROJECT_ID}/locations/{LOCATION}`. - Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Optional. Id of the [KeyHandle][google.cloud.kms.v1.KeyHandle]. Must be - // unique to the resource project and location. If not provided by the caller, - // a new UUID is used. - KeyHandleId string `protobuf:"bytes,2,opt,name=key_handle_id,json=keyHandleId,proto3" json:"key_handle_id,omitempty"` - // Required. [KeyHandle][google.cloud.kms.v1.KeyHandle] to create. - KeyHandle *KeyHandle `protobuf:"bytes,3,opt,name=key_handle,json=keyHandle,proto3" json:"key_handle,omitempty"` -} - -func (x *CreateKeyHandleRequest) Reset() { - *x = CreateKeyHandleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateKeyHandleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateKeyHandleRequest) ProtoMessage() {} - -func (x *CreateKeyHandleRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateKeyHandleRequest.ProtoReflect.Descriptor instead. -func (*CreateKeyHandleRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateKeyHandleRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *CreateKeyHandleRequest) GetKeyHandleId() string { - if x != nil { - return x.KeyHandleId - } - return "" -} - -func (x *CreateKeyHandleRequest) GetKeyHandle() *KeyHandle { - if x != nil { - return x.KeyHandle - } - return nil -} - -// Request message for [GetKeyHandle][google.cloud.kms.v1.Autokey.GetKeyHandle]. -type GetKeyHandleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] resource, - // e.g. - // `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetKeyHandleRequest) Reset() { - *x = GetKeyHandleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetKeyHandleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetKeyHandleRequest) ProtoMessage() {} - -func (x *GetKeyHandleRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetKeyHandleRequest.ProtoReflect.Descriptor instead. -func (*GetKeyHandleRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{1} -} - -func (x *GetKeyHandleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Resource-oriented representation of a request to Cloud KMS Autokey and the -// resulting provisioning of a [CryptoKey][google.cloud.kms.v1.CryptoKey]. -type KeyHandle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier. Name of the [KeyHandle][google.cloud.kms.v1.KeyHandle] - // resource, e.g. - // `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Output only. Name of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that has - // been provisioned for Customer Managed Encryption Key (CMEK) use in the - // [KeyHandle][google.cloud.kms.v1.KeyHandle] project and location for the - // requested resource type. The [CryptoKey][google.cloud.kms.v1.CryptoKey] - // project will reflect the value configured in the - // [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] on the resource - // project's ancestor folder at the time of the - // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation. If more than one - // ancestor folder has a configured - // [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig], the nearest of these - // configurations is used. - KmsKey string `protobuf:"bytes,3,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"` - // Required. Indicates the resource type that the resulting - // [CryptoKey][google.cloud.kms.v1.CryptoKey] is meant to protect, e.g. - // `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource - // types. - ResourceTypeSelector string `protobuf:"bytes,4,opt,name=resource_type_selector,json=resourceTypeSelector,proto3" json:"resource_type_selector,omitempty"` -} - -func (x *KeyHandle) Reset() { - *x = KeyHandle{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyHandle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyHandle) ProtoMessage() {} - -func (x *KeyHandle) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyHandle.ProtoReflect.Descriptor instead. -func (*KeyHandle) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{2} -} - -func (x *KeyHandle) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *KeyHandle) GetKmsKey() string { - if x != nil { - return x.KmsKey - } - return "" -} - -func (x *KeyHandle) GetResourceTypeSelector() string { - if x != nil { - return x.ResourceTypeSelector - } - return "" -} - -// Metadata message for -// [CreateKeyHandle][google.cloud.kms.v1.Autokey.CreateKeyHandle] long-running -// operation response. -type CreateKeyHandleMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreateKeyHandleMetadata) Reset() { - *x = CreateKeyHandleMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateKeyHandleMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateKeyHandleMetadata) ProtoMessage() {} - -func (x *CreateKeyHandleMetadata) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateKeyHandleMetadata.ProtoReflect.Descriptor instead. -func (*CreateKeyHandleMetadata) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{3} -} - -// Request message for -// [Autokey.ListKeyHandles][google.cloud.kms.v1.Autokey.ListKeyHandles]. -type ListKeyHandlesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Name of the resource project and location from which to list - // [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. - // `projects/{PROJECT_ID}/locations/{LOCATION}`. - Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Optional. Filter to apply when listing - // [KeyHandles][google.cloud.kms.v1.KeyHandle], e.g. - // `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. - Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *ListKeyHandlesRequest) Reset() { - *x = ListKeyHandlesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListKeyHandlesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListKeyHandlesRequest) ProtoMessage() {} - -func (x *ListKeyHandlesRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListKeyHandlesRequest.ProtoReflect.Descriptor instead. -func (*ListKeyHandlesRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{4} -} - -func (x *ListKeyHandlesRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *ListKeyHandlesRequest) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -// Response message for -// [Autokey.ListKeyHandles][google.cloud.kms.v1.Autokey.ListKeyHandles]. -type ListKeyHandlesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Resulting [KeyHandles][google.cloud.kms.v1.KeyHandle]. - KeyHandles []*KeyHandle `protobuf:"bytes,1,rep,name=key_handles,json=keyHandles,proto3" json:"key_handles,omitempty"` -} - -func (x *ListKeyHandlesResponse) Reset() { - *x = ListKeyHandlesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListKeyHandlesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListKeyHandlesResponse) ProtoMessage() {} - -func (x *ListKeyHandlesResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListKeyHandlesResponse.ProtoReflect.Descriptor instead. -func (*ListKeyHandlesResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_proto_rawDescGZIP(), []int{5} -} - -func (x *ListKeyHandlesResponse) GetKeyHandles() []*KeyHandle { - if x != nil { - return x.KeyHandles - } - return nil -} - -var File_google_cloud_kms_v1_autokey_proto protoreflect.FileDescriptor - -var file_google_cloud_kms_v1_autokey_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6b, - 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xc8, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x27, - 0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x09, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x54, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, - 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0xa3, 0x02, 0x0a, 0x09, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, - 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x03, 0xfa, 0x41, - 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x16, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x7e, 0xea, 0x41, 0x7b, 0x0a, 0x21, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, - 0x3f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x7d, - 0x2a, 0x0a, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x32, 0x09, 0x6b, 0x65, - 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x77, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, - 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x16, 0x4c, - 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x32, 0xb4, 0x05, 0x0a, 0x07, 0x41, 0x75, 0x74, 0x6f, 0x6b, - 0x65, 0x79, 0x12, 0xeb, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, - 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x8b, 0x01, 0xca, 0x41, 0x24, 0x0a, 0x09, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xda, 0x41, 0x1f, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x2c, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x3c, 0x3a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, - 0x12, 0x97, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x3d, 0xda, 0x41, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xaa, 0x01, 0x0a, 0x0e, 0x4c, - 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x2a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x1a, 0x74, 0xca, 0x41, 0x17, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x57, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x42, 0x54, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, - 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, - 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_cloud_kms_v1_autokey_proto_rawDescOnce sync.Once - file_google_cloud_kms_v1_autokey_proto_rawDescData = file_google_cloud_kms_v1_autokey_proto_rawDesc -) - -func file_google_cloud_kms_v1_autokey_proto_rawDescGZIP() []byte { - file_google_cloud_kms_v1_autokey_proto_rawDescOnce.Do(func() { - file_google_cloud_kms_v1_autokey_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_kms_v1_autokey_proto_rawDescData) - }) - return file_google_cloud_kms_v1_autokey_proto_rawDescData -} - -var file_google_cloud_kms_v1_autokey_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_google_cloud_kms_v1_autokey_proto_goTypes = []interface{}{ - (*CreateKeyHandleRequest)(nil), // 0: google.cloud.kms.v1.CreateKeyHandleRequest - (*GetKeyHandleRequest)(nil), // 1: google.cloud.kms.v1.GetKeyHandleRequest - (*KeyHandle)(nil), // 2: google.cloud.kms.v1.KeyHandle - (*CreateKeyHandleMetadata)(nil), // 3: google.cloud.kms.v1.CreateKeyHandleMetadata - (*ListKeyHandlesRequest)(nil), // 4: google.cloud.kms.v1.ListKeyHandlesRequest - (*ListKeyHandlesResponse)(nil), // 5: google.cloud.kms.v1.ListKeyHandlesResponse - (*longrunningpb.Operation)(nil), // 6: google.longrunning.Operation -} -var file_google_cloud_kms_v1_autokey_proto_depIdxs = []int32{ - 2, // 0: google.cloud.kms.v1.CreateKeyHandleRequest.key_handle:type_name -> google.cloud.kms.v1.KeyHandle - 2, // 1: google.cloud.kms.v1.ListKeyHandlesResponse.key_handles:type_name -> google.cloud.kms.v1.KeyHandle - 0, // 2: google.cloud.kms.v1.Autokey.CreateKeyHandle:input_type -> google.cloud.kms.v1.CreateKeyHandleRequest - 1, // 3: google.cloud.kms.v1.Autokey.GetKeyHandle:input_type -> google.cloud.kms.v1.GetKeyHandleRequest - 4, // 4: google.cloud.kms.v1.Autokey.ListKeyHandles:input_type -> google.cloud.kms.v1.ListKeyHandlesRequest - 6, // 5: google.cloud.kms.v1.Autokey.CreateKeyHandle:output_type -> google.longrunning.Operation - 2, // 6: google.cloud.kms.v1.Autokey.GetKeyHandle:output_type -> google.cloud.kms.v1.KeyHandle - 5, // 7: google.cloud.kms.v1.Autokey.ListKeyHandles:output_type -> google.cloud.kms.v1.ListKeyHandlesResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_cloud_kms_v1_autokey_proto_init() } -func file_google_cloud_kms_v1_autokey_proto_init() { - if File_google_cloud_kms_v1_autokey_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_cloud_kms_v1_autokey_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateKeyHandleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetKeyHandleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyHandle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateKeyHandleMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKeyHandlesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKeyHandlesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_cloud_kms_v1_autokey_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_google_cloud_kms_v1_autokey_proto_goTypes, - DependencyIndexes: file_google_cloud_kms_v1_autokey_proto_depIdxs, - MessageInfos: file_google_cloud_kms_v1_autokey_proto_msgTypes, - }.Build() - File_google_cloud_kms_v1_autokey_proto = out.File - file_google_cloud_kms_v1_autokey_proto_rawDesc = nil - file_google_cloud_kms_v1_autokey_proto_goTypes = nil - file_google_cloud_kms_v1_autokey_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AutokeyClient is the client API for Autokey service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AutokeyClient interface { - // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the - // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK - // use with the given resource type in the configured key project and the same - // location. [GetOperation][Operations.GetOperation] should be used to resolve - // the resulting long-running operation and get the resulting - // [KeyHandle][google.cloud.kms.v1.KeyHandle] and - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) - // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. - GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) - // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. - ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) -} - -type autokeyClient struct { - cc grpc.ClientConnInterface -} - -func NewAutokeyClient(cc grpc.ClientConnInterface) AutokeyClient { - return &autokeyClient{cc} -} - -func (c *autokeyClient) CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { - out := new(longrunningpb.Operation) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/CreateKeyHandle", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyClient) GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) { - out := new(KeyHandle) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/GetKeyHandle", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyClient) ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) { - out := new(ListKeyHandlesResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/ListKeyHandles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AutokeyServer is the server API for Autokey service. -type AutokeyServer interface { - // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the - // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK - // use with the given resource type in the configured key project and the same - // location. [GetOperation][Operations.GetOperation] should be used to resolve - // the resulting long-running operation and get the resulting - // [KeyHandle][google.cloud.kms.v1.KeyHandle] and - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) - // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. - GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) - // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. - ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) -} - -// UnimplementedAutokeyServer can be embedded to have forward compatible implementations. -type UnimplementedAutokeyServer struct { -} - -func (*UnimplementedAutokeyServer) CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKeyHandle not implemented") -} -func (*UnimplementedAutokeyServer) GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetKeyHandle not implemented") -} -func (*UnimplementedAutokeyServer) ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListKeyHandles not implemented") -} - -func RegisterAutokeyServer(s *grpc.Server, srv AutokeyServer) { - s.RegisterService(&_Autokey_serviceDesc, srv) -} - -func _Autokey_CreateKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKeyHandleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).CreateKeyHandle(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/CreateKeyHandle", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).CreateKeyHandle(ctx, req.(*CreateKeyHandleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autokey_GetKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetKeyHandleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).GetKeyHandle(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/GetKeyHandle", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).GetKeyHandle(ctx, req.(*GetKeyHandleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autokey_ListKeyHandles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListKeyHandlesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).ListKeyHandles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/ListKeyHandles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).ListKeyHandles(ctx, req.(*ListKeyHandlesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Autokey_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.Autokey", - HandlerType: (*AutokeyServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateKeyHandle", - Handler: _Autokey_CreateKeyHandle_Handler, - }, - { - MethodName: "GetKeyHandle", - Handler: _Autokey_GetKeyHandle_Handler, - }, - { - MethodName: "ListKeyHandles", - Handler: _Autokey_ListKeyHandles_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/autokey.proto", -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go deleted file mode 100644 index 972ec637bfc..00000000000 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go +++ /dev/null @@ -1,733 +0,0 @@ -// Copyright 2024 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v4.25.3 -// source: google/cloud/kms/v1/autokey_admin.proto - -package kmspb - -import ( - context "context" - reflect "reflect" - sync "sync" - - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Request message for -// [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig]. -type UpdateAutokeyConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] with values to - // update. - AutokeyConfig *AutokeyConfig `protobuf:"bytes,1,opt,name=autokey_config,json=autokeyConfig,proto3" json:"autokey_config,omitempty"` - // Required. Masks which fields of the - // [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] to update, e.g. - // `keyProject`. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateAutokeyConfigRequest) Reset() { - *x = UpdateAutokeyConfigRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateAutokeyConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAutokeyConfigRequest) ProtoMessage() {} - -func (x *UpdateAutokeyConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAutokeyConfigRequest.ProtoReflect.Descriptor instead. -func (*UpdateAutokeyConfigRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP(), []int{0} -} - -func (x *UpdateAutokeyConfigRequest) GetAutokeyConfig() *AutokeyConfig { - if x != nil { - return x.AutokeyConfig - } - return nil -} - -func (x *UpdateAutokeyConfigRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -// Request message for -// [GetAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig]. -type GetAutokeyConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] - // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetAutokeyConfigRequest) Reset() { - *x = GetAutokeyConfigRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAutokeyConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAutokeyConfigRequest) ProtoMessage() {} - -func (x *GetAutokeyConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAutokeyConfigRequest.ProtoReflect.Descriptor instead. -func (*GetAutokeyConfigRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP(), []int{1} -} - -func (x *GetAutokeyConfigRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Cloud KMS Autokey configuration for a folder. -type AutokeyConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] - // resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or - // `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new - // [CryptoKey][google.cloud.kms.v1.CryptoKey] when a - // [KeyHandle][google.cloud.kms.v1.KeyHandle] is created. On - // [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig], - // the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on - // this key project. Once configured, for Cloud KMS Autokey to function - // properly, this key project must have the Cloud KMS API activated and the - // Cloud KMS Service Agent for this key project must be granted the - // `cloudkms.admin` role (or pertinent permissions). A request with an empty - // key project field will clear the configuration. - KeyProject string `protobuf:"bytes,2,opt,name=key_project,json=keyProject,proto3" json:"key_project,omitempty"` -} - -func (x *AutokeyConfig) Reset() { - *x = AutokeyConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AutokeyConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AutokeyConfig) ProtoMessage() {} - -func (x *AutokeyConfig) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AutokeyConfig.ProtoReflect.Descriptor instead. -func (*AutokeyConfig) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP(), []int{2} -} - -func (x *AutokeyConfig) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AutokeyConfig) GetKeyProject() string { - if x != nil { - return x.KeyProject - } - return "" -} - -// Request message for -// [ShowEffectiveAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig]. -type ShowEffectiveAutokeyConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Name of the resource project to the show effective Cloud KMS - // Autokey configuration for. This may be helpful for interrogating the effect - // of nested folder configurations on a given resource project. - Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` -} - -func (x *ShowEffectiveAutokeyConfigRequest) Reset() { - *x = ShowEffectiveAutokeyConfigRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShowEffectiveAutokeyConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShowEffectiveAutokeyConfigRequest) ProtoMessage() {} - -func (x *ShowEffectiveAutokeyConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ShowEffectiveAutokeyConfigRequest.ProtoReflect.Descriptor instead. -func (*ShowEffectiveAutokeyConfigRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP(), []int{3} -} - -func (x *ShowEffectiveAutokeyConfigRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -// Response message for -// [ShowEffectiveAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig]. -type ShowEffectiveAutokeyConfigResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the key project configured in the resource project's folder - // ancestry. - KeyProject string `protobuf:"bytes,1,opt,name=key_project,json=keyProject,proto3" json:"key_project,omitempty"` -} - -func (x *ShowEffectiveAutokeyConfigResponse) Reset() { - *x = ShowEffectiveAutokeyConfigResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShowEffectiveAutokeyConfigResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShowEffectiveAutokeyConfigResponse) ProtoMessage() {} - -func (x *ShowEffectiveAutokeyConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ShowEffectiveAutokeyConfigResponse.ProtoReflect.Descriptor instead. -func (*ShowEffectiveAutokeyConfigResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP(), []int{4} -} - -func (x *ShowEffectiveAutokeyConfigResponse) GetKeyProject() string { - if x != nil { - return x.KeyProject - } - return "" -} - -var File_google_cloud_kms_v1_autokey_admin_proto protoreflect.FileDescriptor - -var file_google_cloud_kms_v1_autokey_admin_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6b, - 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x6b, - 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, - 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, - 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x3a, 0x69, 0xea, 0x41, 0x66, 0x0a, 0x25, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, - 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x1e, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x7d, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, - 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x32, - 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x70, - 0x0a, 0x21, 0x53, 0x68, 0x6f, 0x77, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x22, 0x45, 0x0a, 0x22, 0x53, 0x68, 0x6f, 0x77, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x79, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0xc8, 0x05, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x6f, - 0x6b, 0x65, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0xd2, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x66, 0xda, 0x41, 0x1a, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, - 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x43, 0x3a, 0x0e, 0x61, 0x75, 0x74, 0x6f, - 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x31, 0x2f, 0x76, 0x31, 0x2f, - 0x7b, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, 0x61, - 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x7d, 0x12, 0x97, 0x01, - 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x6f, - 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x22, 0x31, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x7d, 0x12, 0xd2, 0x01, 0x0a, 0x1a, 0x53, 0x68, 0x6f, 0x77, - 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, - 0x77, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, - 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x7d, 0x3a, 0x73, 0x68, 0x6f, 0x77, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x74, 0xca, 0x41, - 0x17, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x57, 0x68, 0x74, 0x74, 0x70, 0x73, - 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, - 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, - 0x6d, 0x73, 0x42, 0x59, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x41, - 0x75, 0x74, 0x6f, 0x6b, 0x65, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, - 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_cloud_kms_v1_autokey_admin_proto_rawDescOnce sync.Once - file_google_cloud_kms_v1_autokey_admin_proto_rawDescData = file_google_cloud_kms_v1_autokey_admin_proto_rawDesc -) - -func file_google_cloud_kms_v1_autokey_admin_proto_rawDescGZIP() []byte { - file_google_cloud_kms_v1_autokey_admin_proto_rawDescOnce.Do(func() { - file_google_cloud_kms_v1_autokey_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_kms_v1_autokey_admin_proto_rawDescData) - }) - return file_google_cloud_kms_v1_autokey_admin_proto_rawDescData -} - -var file_google_cloud_kms_v1_autokey_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_google_cloud_kms_v1_autokey_admin_proto_goTypes = []interface{}{ - (*UpdateAutokeyConfigRequest)(nil), // 0: google.cloud.kms.v1.UpdateAutokeyConfigRequest - (*GetAutokeyConfigRequest)(nil), // 1: google.cloud.kms.v1.GetAutokeyConfigRequest - (*AutokeyConfig)(nil), // 2: google.cloud.kms.v1.AutokeyConfig - (*ShowEffectiveAutokeyConfigRequest)(nil), // 3: google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest - (*ShowEffectiveAutokeyConfigResponse)(nil), // 4: google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse - (*fieldmaskpb.FieldMask)(nil), // 5: google.protobuf.FieldMask -} -var file_google_cloud_kms_v1_autokey_admin_proto_depIdxs = []int32{ - 2, // 0: google.cloud.kms.v1.UpdateAutokeyConfigRequest.autokey_config:type_name -> google.cloud.kms.v1.AutokeyConfig - 5, // 1: google.cloud.kms.v1.UpdateAutokeyConfigRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 2: google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig:input_type -> google.cloud.kms.v1.UpdateAutokeyConfigRequest - 1, // 3: google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig:input_type -> google.cloud.kms.v1.GetAutokeyConfigRequest - 3, // 4: google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig:input_type -> google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest - 2, // 5: google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig:output_type -> google.cloud.kms.v1.AutokeyConfig - 2, // 6: google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig:output_type -> google.cloud.kms.v1.AutokeyConfig - 4, // 7: google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig:output_type -> google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_cloud_kms_v1_autokey_admin_proto_init() } -func file_google_cloud_kms_v1_autokey_admin_proto_init() { - if File_google_cloud_kms_v1_autokey_admin_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAutokeyConfigRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAutokeyConfigRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutokeyConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShowEffectiveAutokeyConfigRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_cloud_kms_v1_autokey_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShowEffectiveAutokeyConfigResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_cloud_kms_v1_autokey_admin_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_google_cloud_kms_v1_autokey_admin_proto_goTypes, - DependencyIndexes: file_google_cloud_kms_v1_autokey_admin_proto_depIdxs, - MessageInfos: file_google_cloud_kms_v1_autokey_admin_proto_msgTypes, - }.Build() - File_google_cloud_kms_v1_autokey_admin_proto = out.File - file_google_cloud_kms_v1_autokey_admin_proto_rawDesc = nil - file_google_cloud_kms_v1_autokey_admin_proto_goTypes = nil - file_google_cloud_kms_v1_autokey_admin_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AutokeyAdminClient is the client API for AutokeyAdmin service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AutokeyAdminClient interface { - // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. The caller must have both `cloudkms.autokeyConfigs.update` - // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - // permission on the provided key project. A - // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's - // descendant projects will use this configuration to determine where to - // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) - // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. - GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) - // Returns the effective Cloud KMS Autokey configuration for a given project. - ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) -} - -type autokeyAdminClient struct { - cc grpc.ClientConnInterface -} - -func NewAutokeyAdminClient(cc grpc.ClientConnInterface) AutokeyAdminClient { - return &autokeyAdminClient{cc} -} - -func (c *autokeyAdminClient) UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { - out := new(AutokeyConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyAdminClient) GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { - out := new(AutokeyConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyAdminClient) ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) { - out := new(ShowEffectiveAutokeyConfigResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AutokeyAdminServer is the server API for AutokeyAdmin service. -type AutokeyAdminServer interface { - // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. The caller must have both `cloudkms.autokeyConfigs.update` - // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - // permission on the provided key project. A - // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's - // descendant projects will use this configuration to determine where to - // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) - // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. - GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) - // Returns the effective Cloud KMS Autokey configuration for a given project. - ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) -} - -// UnimplementedAutokeyAdminServer can be embedded to have forward compatible implementations. -type UnimplementedAutokeyAdminServer struct { -} - -func (*UnimplementedAutokeyAdminServer) UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAutokeyConfig not implemented") -} -func (*UnimplementedAutokeyAdminServer) GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAutokeyConfig not implemented") -} -func (*UnimplementedAutokeyAdminServer) ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShowEffectiveAutokeyConfig not implemented") -} - -func RegisterAutokeyAdminServer(s *grpc.Server, srv AutokeyAdminServer) { - s.RegisterService(&_AutokeyAdmin_serviceDesc, srv) -} - -func _AutokeyAdmin_UpdateAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, req.(*UpdateAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AutokeyAdmin_GetAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, req.(*GetAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ShowEffectiveAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, req.(*ShowEffectiveAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AutokeyAdmin_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.AutokeyAdmin", - HandlerType: (*AutokeyAdminServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateAutokeyConfig", - Handler: _AutokeyAdmin_UpdateAutokeyConfig_Handler, - }, - { - MethodName: "GetAutokeyConfig", - Handler: _AutokeyAdmin_GetAutokeyConfig_Handler, - }, - { - MethodName: "ShowEffectiveAutokeyConfig", - Handler: _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/autokey_admin.proto", -} diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go index 20329707472..632ca94ab52 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: google/cloud/kms/v1/ekm_service.proto package kmspb diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go index 31d613edf82..3cc89947e81 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: google/cloud/kms/v1/resources.proto package kmspb @@ -357,8 +357,6 @@ const ( // Other hash functions can also be used: // https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms CryptoKeyVersion_EC_SIGN_SECP256K1_SHA256 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 31 - // EdDSA on the Curve25519 in pure mode (taking data as input). - CryptoKeyVersion_EC_SIGN_ED25519 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 40 // HMAC-SHA256 signing with a 256 bit key. CryptoKeyVersion_HMAC_SHA256 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 32 // HMAC-SHA1 signing with a 160 bit key. @@ -405,7 +403,6 @@ var ( 12: "EC_SIGN_P256_SHA256", 13: "EC_SIGN_P384_SHA384", 31: "EC_SIGN_SECP256K1_SHA256", - 40: "EC_SIGN_ED25519", 32: "HMAC_SHA256", 33: "HMAC_SHA1", 34: "HMAC_SHA384", @@ -443,7 +440,6 @@ var ( "EC_SIGN_P256_SHA256": 12, "EC_SIGN_P384_SHA384": 13, "EC_SIGN_SECP256K1_SHA256": 31, - "EC_SIGN_ED25519": 40, "HMAC_SHA256": 32, "HMAC_SHA1": 33, "HMAC_SHA384": 34, @@ -1497,18 +1493,22 @@ type PublicKey struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The public key, encoded in PEM format. For more information, see the - // [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - // [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - // [Textual Encoding of Subject Public Key Info] + // A public key encoded in PEM format, populated only when + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // returns one key. For more information, see the [RFC + // 7468](https://tools.ietf.org/html/rfc7468) sections for [General + // Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual + // Encoding of Subject Public Key Info] // (https://tools.ietf.org/html/rfc7468#section-13). Pem string `protobuf:"bytes,1,opt,name=pem,proto3" json:"pem,omitempty"` // The // [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] // associated with this key. Algorithm CryptoKeyVersion_CryptoKeyVersionAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=google.cloud.kms.v1.CryptoKeyVersion_CryptoKeyVersionAlgorithm" json:"algorithm,omitempty"` - // Integrity verification field. A CRC32C checksum of the returned - // [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + // Integrity verification field: A CRC32C checksum of the returned + // [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated + // when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // returns one key. An integrity check of // [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by // computing the CRC32C checksum of // [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -2118,7 +2118,7 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, 0x5f, 0x56, 0x32, - 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x04, 0x22, 0x89, 0x15, + 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x04, 0x22, 0xf4, 0x14, 0x0a, 0x10, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x05, 0x73, @@ -2191,7 +2191,7 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x11, 0x72, 0x65, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x72, 0x65, - 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x22, 0xe2, + 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x22, 0xcd, 0x07, 0x0a, 0x19, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2c, 0x0a, 0x28, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, @@ -2245,180 +2245,178 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x0c, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x33, 0x38, 0x34, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x0d, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x4b, 0x31, 0x5f, - 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x1f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x43, 0x5f, 0x53, - 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x28, 0x12, 0x0f, 0x0a, - 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x20, 0x12, 0x0d, - 0x0a, 0x09, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x21, 0x12, 0x0f, 0x0a, - 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x22, 0x12, 0x0f, - 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x23, 0x12, - 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x32, 0x34, 0x10, 0x24, - 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x59, 0x4d, - 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, - 0x4e, 0x10, 0x12, 0x22, 0x9b, 0x02, 0x0a, 0x15, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, - 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, - 0x24, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, - 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, - 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, - 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, - 0x53, 0x54, 0x52, 0x4f, 0x59, 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x53, - 0x54, 0x52, 0x4f, 0x59, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x04, - 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4d, 0x50, 0x4f, - 0x52, 0x54, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, - 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4e, 0x45, 0x52, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x20, - 0x0a, 0x1c, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, - 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, - 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, - 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, - 0x0a, 0x22, 0x49, 0x0a, 0x14, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x52, 0x59, - 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, - 0x56, 0x49, 0x45, 0x57, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x01, 0x3a, 0xaa, 0x01, 0xea, - 0x41, 0xa6, 0x01, 0x0a, 0x28, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, - 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, - 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x22, 0xce, 0x03, 0x0a, 0x09, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x12, 0x5d, 0x0a, 0x09, 0x61, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x65, 0x6d, 0x5f, - 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x70, 0x65, 0x6d, 0x43, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0xae, 0x01, 0xea, 0x41, 0xaa, 0x01, - 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x84, 0x01, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, - 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, - 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, - 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0xd4, 0x09, 0x0a, 0x09, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x58, 0x0a, 0x0d, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0c, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x57, 0x0a, 0x10, 0x70, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x06, 0xe0, 0x41, 0x02, - 0xe0, 0x41, 0x05, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 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, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 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, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, - 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0a, 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, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x0a, 0x0b, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, - 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x25, 0x0a, 0x11, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x22, 0xe5, 0x01, 0x0a, 0x0c, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4d, 0x50, 0x4f, - 0x52, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x4f, - 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, 0x41, 0x45, - 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x4f, - 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, 0x41, 0x45, - 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x4f, - 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x5f, - 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, - 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, - 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x52, - 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, - 0x32, 0x35, 0x36, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, - 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x22, - 0x63, 0x0a, 0x0e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x47, - 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, - 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, 0x49, 0x52, - 0x45, 0x44, 0x10, 0x03, 0x3a, 0x7b, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x53, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, - 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, - 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x4a, 0x6f, 0x62, 0x73, 0x2f, 0x7b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, - 0x7d, 0x22, 0x81, 0x01, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x55, 0x72, 0x69, 0x12, 0x35, - 0x0a, 0x17, 0x65, 0x6b, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x14, 0x65, 0x6b, 0x6d, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, - 0x79, 0x50, 0x61, 0x74, 0x68, 0x2a, 0x6a, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x52, 0x4f, 0x54, - 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, - 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x53, 0x4d, 0x10, - 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x12, - 0x10, 0x0a, 0x0c, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x56, 0x50, 0x43, 0x10, - 0x04, 0x42, 0x88, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4b, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, - 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xf8, 0x01, 0x01, - 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x4b, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4b, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x1f, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, + 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x4d, 0x41, + 0x43, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x21, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, + 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x22, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, + 0x43, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x23, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, + 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x32, 0x34, 0x10, 0x24, 0x12, 0x21, 0x0a, 0x1d, 0x45, + 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, + 0x43, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x12, 0x22, 0x9b, + 0x02, 0x0a, 0x15, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x52, 0x59, 0x50, + 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x47, 0x45, + 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4e, + 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, + 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, + 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x5f, + 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x50, + 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x06, 0x12, + 0x11, 0x0a, 0x0d, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x4e, + 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, + 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x1f, 0x0a, 0x1b, 0x45, + 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x0a, 0x22, 0x49, 0x0a, 0x14, + 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x56, 0x69, 0x65, 0x77, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, + 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x01, 0x3a, 0xaa, 0x01, 0xea, 0x41, 0xa6, 0x01, 0x0a, 0x28, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, + 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, + 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x7d, 0x22, 0xce, 0x03, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x70, 0x65, 0x6d, 0x12, 0x5d, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x65, 0x6d, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x70, 0x65, 0x6d, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x3a, 0xae, 0x01, 0xea, 0x41, 0xaa, 0x01, 0x0a, 0x21, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x84, + 0x01, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, + 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0xd4, 0x09, 0x0a, 0x09, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x0d, + 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x57, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0f, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 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, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 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, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, + 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, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x25, 0x0a, 0x11, 0x57, + 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, + 0x65, 0x6d, 0x22, 0xe5, 0x01, 0x0a, 0x0c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4d, 0x45, + 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, + 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, + 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, + 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, + 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, + 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, + 0x35, 0x36, 0x10, 0x03, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, + 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, + 0x5f, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, + 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x05, + 0x12, 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, + 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x22, 0x63, 0x0a, 0x0e, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x1c, + 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, + 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, + 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x3a, + 0x7b, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, + 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, + 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x2f, + 0x7b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x7d, 0x22, 0x81, 0x01, 0x0a, + 0x1e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x5f, + 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x55, 0x72, 0x69, 0x12, 0x35, 0x0a, 0x17, 0x65, 0x6b, 0x6d, + 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x65, 0x6b, 0x6d, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x74, 0x68, + 0x2a, 0x6a, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, + 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x53, 0x4d, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, + 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x58, + 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x56, 0x50, 0x43, 0x10, 0x04, 0x42, 0x88, 0x01, 0x0a, + 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4b, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, 0x73, + 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4b, 0x6d, 0x73, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x5c, 0x4b, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go index 6ba1765a4d2..3d2fc5b9927 100644 --- a/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go +++ b/upstream/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v4.25.3 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: google/cloud/kms/v1/service.proto package kmspb diff --git a/upstream/vendor/cloud.google.com/go/kms/internal/version.go b/upstream/vendor/cloud.google.com/go/kms/internal/version.go index 2d7d8774486..f6b4a3e367d 100644 --- a/upstream/vendor/cloud.google.com/go/kms/internal/version.go +++ b/upstream/vendor/cloud.google.com/go/kms/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.17.1" +const Version = "1.15.8" diff --git a/upstream/vendor/cloud.google.com/go/longrunning/CHANGES.md b/upstream/vendor/cloud.google.com/go/longrunning/CHANGES.md deleted file mode 100644 index 6c6a7b6661a..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/CHANGES.md +++ /dev/null @@ -1,89 +0,0 @@ -# Changes - -## [0.5.7](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.6...longrunning/v0.5.7) (2024-05-01) - - -### Bug Fixes - -* **longrunning:** Bump x/net to v0.24.0 ([ba31ed5](https://github.com/googleapis/google-cloud-go/commit/ba31ed5fda2c9664f2e1cf972469295e63deb5b4)) - -## [0.5.6](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.5...longrunning/v0.5.6) (2024-03-14) - - -### Bug Fixes - -* **longrunning:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) - -## [0.5.5](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.4...longrunning/v0.5.5) (2024-01-30) - - -### Bug Fixes - -* **longrunning:** Enable universe domain resolution options ([fd1d569](https://github.com/googleapis/google-cloud-go/commit/fd1d56930fa8a747be35a224611f4797b8aeb698)) - -## [0.5.4](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.3...longrunning/v0.5.4) (2023-11-01) - - -### Bug Fixes - -* **longrunning:** Bump google.golang.org/api to v0.149.0 ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) - -## [0.5.3](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.2...longrunning/v0.5.3) (2023-10-26) - - -### Bug Fixes - -* **longrunning:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) - -## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.1...longrunning/v0.5.2) (2023-10-12) - - -### Bug Fixes - -* **longrunning:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) - -## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.0...longrunning/v0.5.1) (2023-06-20) - - -### Bug Fixes - -* **longrunning:** REST query UpdateMask bug ([df52820](https://github.com/googleapis/google-cloud-go/commit/df52820b0e7721954809a8aa8700b93c5662dc9b)) - -## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.2...longrunning/v0.5.0) (2023-05-30) - - -### Features - -* **longrunning:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6)) - -## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.1...longrunning/v0.4.2) (2023-05-08) - - -### Bug Fixes - -* **longrunning:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef)) - -## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.0...longrunning/v0.4.1) (2023-02-14) - - -### Bug Fixes - -* **longrunning:** Properly parse errors with apierror ([#7392](https://github.com/googleapis/google-cloud-go/issues/7392)) ([e768e48](https://github.com/googleapis/google-cloud-go/commit/e768e487e10b197ba42a2339014136d066190610)) - -## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.3.0...longrunning/v0.4.0) (2023-01-04) - - -### Features - -* **longrunning:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) - -## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.2.1...longrunning/v0.3.0) (2022-11-03) - - -### Features - -* **longrunning:** rewrite signatures in terms of new location ([3c4b2b3](https://github.com/googleapis/google-cloud-go/commit/3c4b2b34565795537aac1661e6af2442437e34ad)) - -## v0.1.0 - -Initial release. diff --git a/upstream/vendor/cloud.google.com/go/longrunning/LICENSE b/upstream/vendor/cloud.google.com/go/longrunning/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/upstream/vendor/cloud.google.com/go/longrunning/README.md b/upstream/vendor/cloud.google.com/go/longrunning/README.md deleted file mode 100644 index a07f3093fd3..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# longrunning - -[![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/longrunning.svg)](https://pkg.go.dev/cloud.google.com/go/longrunning) - -A helper library for working with long running operations. - -## Install - -```bash -go get cloud.google.com/go/longrunning -``` - -## Go Version Support - -See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) -section in the root directory's README. - -## Contributing - -Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md) -document for details. - -Please note that this project is released with a Contributor Code of Conduct. -By participating in this project you agree to abide by its terms. See -[Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct) -for more information. diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/auxiliary.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/auxiliary.go deleted file mode 100644 index a42e61e99c3..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/auxiliary.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go_gapic. DO NOT EDIT. - -package longrunning - -import ( - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - "google.golang.org/api/iterator" -) - -// OperationIterator manages a stream of *longrunningpb.Operation. -type OperationIterator struct { - items []*longrunningpb.Operation - pageInfo *iterator.PageInfo - nextFunc func() error - - // Response is the raw response for the current page. - // It must be cast to the RPC response type. - // Calling Next() or InternalFetch() updates this value. - Response interface{} - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *OperationIterator) PageInfo() *iterator.PageInfo { - return it.pageInfo -} - -// Next returns the next result. Its second return value is iterator.Done if there are no more -// results. Once Next returns Done, all subsequent calls will return Done. -func (it *OperationIterator) Next() (*longrunningpb.Operation, error) { - var item *longrunningpb.Operation - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *OperationIterator) bufLen() int { - return len(it.items) -} - -func (it *OperationIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/doc.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/doc.go deleted file mode 100644 index 7976ed73455..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/doc.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go_gapic. DO NOT EDIT. - -// Package longrunning is an auto-generated package for the -// Long Running Operations API. -// -// # General documentation -// -// For information that is relevant for all client libraries please reference -// https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this -// page includes: -// -// - [Authentication and Authorization] -// - [Timeouts and Cancellation] -// - [Testing against Client Libraries] -// - [Debugging Client Libraries] -// - [Inspecting errors] -// -// # Example usage -// -// To get started with this package, create a client. -// -// ctx := context.Background() -// // This snippet has been automatically generated and should be regarded as a code template only. -// // It will require modifications to work: -// // - It may require correct/in-range values for request initialization. -// // - It may require specifying regional endpoints when creating the service client as shown in: -// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := longrunning.NewOperationsClient(ctx) -// if err != nil { -// // TODO: Handle error. -// } -// defer c.Close() -// -// The client will use your default application credentials. Clients should be reused instead of created as needed. -// The methods of Client are safe for concurrent use by multiple goroutines. -// The returned client must be Closed when it is done being used. -// -// # Using the Client -// -// The following is an example of making an API call with the newly created client. -// -// ctx := context.Background() -// // This snippet has been automatically generated and should be regarded as a code template only. -// // It will require modifications to work: -// // - It may require correct/in-range values for request initialization. -// // - It may require specifying regional endpoints when creating the service client as shown in: -// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := longrunning.NewOperationsClient(ctx) -// if err != nil { -// // TODO: Handle error. -// } -// defer c.Close() -// -// req := &longrunningpb.CancelOperationRequest{ -// // TODO: Fill request struct fields. -// // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. -// } -// err = c.CancelOperation(ctx, req) -// if err != nil { -// // TODO: Handle error. -// } -// -// # Use of Context -// -// The ctx passed to NewOperationsClient is used for authentication requests and -// for creating the underlying connection, but is not used for subsequent calls. -// Individual methods on the client use the ctx given to them. -// -// To close the open connection, use the Close() method. -// -// [Authentication and Authorization]: https://pkg.go.dev/cloud.google.com/go#hdr-Authentication_and_Authorization -// [Timeouts and Cancellation]: https://pkg.go.dev/cloud.google.com/go#hdr-Timeouts_and_Cancellation -// [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing -// [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging -// [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package longrunning // import "cloud.google.com/go/longrunning/autogen" - -import ( - "context" - - "google.golang.org/api/option" -) - -// For more information on implementing a client constructor hook, see -// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. -type clientHookParams struct{} -type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) - -var versionClient string - -func getVersionClient() string { - if versionClient == "" { - return "UNKNOWN" - } - return versionClient -} - -// DefaultAuthScopes reports the default set of authentication scopes to use with this package. -func DefaultAuthScopes() []string { - return []string{ - "", - } -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/from_conn.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/from_conn.go deleted file mode 100644 index f09714b9b32..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/from_conn.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020, 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 longrunning - -import ( - "context" - - "google.golang.org/api/option" - "google.golang.org/grpc" -) - -// InternalFromConn is for use by the Google Cloud Libraries only. -// -// Deprecated. Use `NewOperationsClient(ctx, option.WithGRPCConn(conn))` instead. -func InternalFromConn(conn *grpc.ClientConn) *OperationsClient { - c, _ := NewOperationsClient(context.Background(), option.WithGRPCConn(conn)) - return c -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/gapic_metadata.json b/upstream/vendor/cloud.google.com/go/longrunning/autogen/gapic_metadata.json deleted file mode 100644 index 52714282166..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/gapic_metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", - "language": "go", - "protoPackage": "google.longrunning", - "libraryPackage": "cloud.google.com/go/longrunning/autogen", - "services": { - "Operations": { - "clients": { - "grpc": { - "libraryClient": "OperationsClient", - "rpcs": { - "CancelOperation": { - "methods": [ - "CancelOperation" - ] - }, - "DeleteOperation": { - "methods": [ - "DeleteOperation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListOperations": { - "methods": [ - "ListOperations" - ] - }, - "WaitOperation": { - "methods": [ - "WaitOperation" - ] - } - } - }, - "rest": { - "libraryClient": "OperationsClient", - "rpcs": { - "CancelOperation": { - "methods": [ - "CancelOperation" - ] - }, - "DeleteOperation": { - "methods": [ - "DeleteOperation" - ] - }, - "GetOperation": { - "methods": [ - "GetOperation" - ] - }, - "ListOperations": { - "methods": [ - "ListOperations" - ] - }, - "WaitOperation": { - "methods": [ - "WaitOperation" - ] - } - } - } - } - } - } -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/info.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/info.go deleted file mode 100644 index b006c4d018e..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/info.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020 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 longrunning - -// SetGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Also passes any -// provided key-value pairs. Intended for use by Google-written clients. -// -// Internal use only. -func (c *OperationsClient) SetGoogleClientInfo(keyval ...string) { - c.setGoogleClientInfo(keyval...) -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go deleted file mode 100644 index be148ff97a3..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go +++ /dev/null @@ -1,1230 +0,0 @@ -// Copyright 2020 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v4.25.3 -// source: google/longrunning/operations.proto - -package longrunningpb - -import ( - context "context" - reflect "reflect" - sync "sync" - - _ "google.golang.org/genproto/googleapis/api/annotations" - status "google.golang.org/genproto/googleapis/rpc/status" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status1 "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - anypb "google.golang.org/protobuf/types/known/anypb" - durationpb "google.golang.org/protobuf/types/known/durationpb" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This resource represents a long-running operation that is the result of a -// network API call. -type Operation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The server-assigned name, which is only unique within the same service that - // originally returns it. If you use the default HTTP mapping, the - // `name` should be a resource name ending with `operations/{unique_id}`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Service-specific metadata associated with the operation. It typically - // contains progress information and common metadata such as create time. - // Some services might not provide such metadata. Any method that returns a - // long-running operation should document the metadata type, if any. - Metadata *anypb.Any `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - // If the value is `false`, it means the operation is still in progress. - // If `true`, the operation is completed, and either `error` or `response` is - // available. - Done bool `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"` - // The operation result, which can be either an `error` or a valid `response`. - // If `done` == `false`, neither `error` nor `response` is set. - // If `done` == `true`, exactly one of `error` or `response` is set. - // - // Types that are assignable to Result: - // - // *Operation_Error - // *Operation_Response - Result isOperation_Result `protobuf_oneof:"result"` -} - -func (x *Operation) Reset() { - *x = Operation{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{0} -} - -func (x *Operation) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Operation) GetMetadata() *anypb.Any { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Operation) GetDone() bool { - if x != nil { - return x.Done - } - return false -} - -func (m *Operation) GetResult() isOperation_Result { - if m != nil { - return m.Result - } - return nil -} - -func (x *Operation) GetError() *status.Status { - if x, ok := x.GetResult().(*Operation_Error); ok { - return x.Error - } - return nil -} - -func (x *Operation) GetResponse() *anypb.Any { - if x, ok := x.GetResult().(*Operation_Response); ok { - return x.Response - } - return nil -} - -type isOperation_Result interface { - isOperation_Result() -} - -type Operation_Error struct { - // The error result of the operation in case of failure or cancellation. - Error *status.Status `protobuf:"bytes,4,opt,name=error,proto3,oneof"` -} - -type Operation_Response struct { - // The normal response of the operation in case of success. If the original - // method returns no data on success, such as `Delete`, the response is - // `google.protobuf.Empty`. If the original method is standard - // `Get`/`Create`/`Update`, the response should be the resource. For other - // methods, the response should have the type `XxxResponse`, where `Xxx` - // is the original method name. For example, if the original method name - // is `TakeSnapshot()`, the inferred response type is - // `TakeSnapshotResponse`. - Response *anypb.Any `protobuf:"bytes,5,opt,name=response,proto3,oneof"` -} - -func (*Operation_Error) isOperation_Result() {} - -func (*Operation_Response) isOperation_Result() {} - -// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. -type GetOperationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the operation resource. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetOperationRequest) Reset() { - *x = GetOperationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOperationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOperationRequest) ProtoMessage() {} - -func (x *GetOperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOperationRequest.ProtoReflect.Descriptor instead. -func (*GetOperationRequest) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{1} -} - -func (x *GetOperationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. -type ListOperationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the operation's parent resource. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // The standard list filter. - Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` - // The standard list page size. - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The standard list page token. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` -} - -func (x *ListOperationsRequest) Reset() { - *x = ListOperationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOperationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOperationsRequest) ProtoMessage() {} - -func (x *ListOperationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOperationsRequest.ProtoReflect.Descriptor instead. -func (*ListOperationsRequest) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{2} -} - -func (x *ListOperationsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ListOperationsRequest) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -func (x *ListOperationsRequest) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListOperationsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. -type ListOperationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A list of operations that matches the specified filter in the request. - Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` - // The standard List next-page token. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOperationsResponse) Reset() { - *x = ListOperationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOperationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOperationsResponse) ProtoMessage() {} - -func (x *ListOperationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOperationsResponse.ProtoReflect.Descriptor instead. -func (*ListOperationsResponse) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{3} -} - -func (x *ListOperationsResponse) GetOperations() []*Operation { - if x != nil { - return x.Operations - } - return nil -} - -func (x *ListOperationsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. -type CancelOperationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the operation resource to be cancelled. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *CancelOperationRequest) Reset() { - *x = CancelOperationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CancelOperationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CancelOperationRequest) ProtoMessage() {} - -func (x *CancelOperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CancelOperationRequest.ProtoReflect.Descriptor instead. -func (*CancelOperationRequest) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{4} -} - -func (x *CancelOperationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. -type DeleteOperationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the operation resource to be deleted. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *DeleteOperationRequest) Reset() { - *x = DeleteOperationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOperationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOperationRequest) ProtoMessage() {} - -func (x *DeleteOperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOperationRequest.ProtoReflect.Descriptor instead. -func (*DeleteOperationRequest) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteOperationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. -type WaitOperationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the operation resource to wait on. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The maximum duration to wait before timing out. If left blank, the wait - // will be at most the time permitted by the underlying HTTP/RPC protocol. - // If RPC context deadline is also specified, the shorter one will be used. - Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` -} - -func (x *WaitOperationRequest) Reset() { - *x = WaitOperationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WaitOperationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WaitOperationRequest) ProtoMessage() {} - -func (x *WaitOperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WaitOperationRequest.ProtoReflect.Descriptor instead. -func (*WaitOperationRequest) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{6} -} - -func (x *WaitOperationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *WaitOperationRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -// A message representing the message types used by a long-running operation. -// -// Example: -// -// rpc LongRunningRecognize(LongRunningRecognizeRequest) -// returns (google.longrunning.Operation) { -// option (google.longrunning.operation_info) = { -// response_type: "LongRunningRecognizeResponse" -// metadata_type: "LongRunningRecognizeMetadata" -// }; -// } -type OperationInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. The message name of the primary return type for this - // long-running operation. - // This type will be used to deserialize the LRO's response. - // - // If the response is in a different package from the rpc, a fully-qualified - // message name must be used (e.g. `google.protobuf.Struct`). - // - // Note: Altering this value constitutes a breaking change. - ResponseType string `protobuf:"bytes,1,opt,name=response_type,json=responseType,proto3" json:"response_type,omitempty"` - // Required. The message name of the metadata type for this long-running - // operation. - // - // If the response is in a different package from the rpc, a fully-qualified - // message name must be used (e.g. `google.protobuf.Struct`). - // - // Note: Altering this value constitutes a breaking change. - MetadataType string `protobuf:"bytes,2,opt,name=metadata_type,json=metadataType,proto3" json:"metadata_type,omitempty"` -} - -func (x *OperationInfo) Reset() { - *x = OperationInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_google_longrunning_operations_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OperationInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationInfo) ProtoMessage() {} - -func (x *OperationInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_longrunning_operations_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationInfo.ProtoReflect.Descriptor instead. -func (*OperationInfo) Descriptor() ([]byte, []int) { - return file_google_longrunning_operations_proto_rawDescGZIP(), []int{7} -} - -func (x *OperationInfo) GetResponseType() string { - if x != nil { - return x.ResponseType - } - return "" -} - -func (x *OperationInfo) GetMetadataType() string { - if x != nil { - return x.MetadataType - } - return "" -} - -var file_google_longrunning_operations_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*OperationInfo)(nil), - Field: 1049, - Name: "google.longrunning.operation_info", - Tag: "bytes,1049,opt,name=operation_info", - Filename: "google/longrunning/operations.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // Additional information regarding long-running operations. - // In particular, this specifies the types that are returned from - // long-running operations. - // - // Required for methods that return `google.longrunning.Operation`; invalid - // otherwise. - // - // optional google.longrunning.OperationInfo operation_info = 1049; - E_OperationInfo = &file_google_longrunning_operations_proto_extTypes[0] -) - -var File_google_longrunning_operations_proto protoreflect.FileDescriptor - -var file_google_longrunning_operations_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, - 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, - 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x7f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x7f, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x16, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x2c, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5f, - 0x0a, 0x14, 0x57, 0x61, 0x69, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, - 0x59, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x32, 0xaa, 0x05, 0x0a, 0x0a, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, - 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2b, 0xda, 0x41, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x7d, - 0x12, 0x7f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2a, - 0x7d, 0x12, 0x7e, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, - 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2a, - 0x7d, 0x12, 0x88, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, - 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x31, 0xda, 0x41, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x5a, 0x0a, 0x0d, - 0x57, 0x61, 0x69, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, - 0x6e, 0x67, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x1a, 0x1d, 0xca, 0x41, 0x1a, 0x6c, 0x6f, 0x6e, - 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x3a, 0x69, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0x9d, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x0f, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x43, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, - 0x67, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, - 0x69, 0x6e, 0x67, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x12, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x12, - 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, - 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_longrunning_operations_proto_rawDescOnce sync.Once - file_google_longrunning_operations_proto_rawDescData = file_google_longrunning_operations_proto_rawDesc -) - -func file_google_longrunning_operations_proto_rawDescGZIP() []byte { - file_google_longrunning_operations_proto_rawDescOnce.Do(func() { - file_google_longrunning_operations_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_longrunning_operations_proto_rawDescData) - }) - return file_google_longrunning_operations_proto_rawDescData -} - -var file_google_longrunning_operations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_google_longrunning_operations_proto_goTypes = []interface{}{ - (*Operation)(nil), // 0: google.longrunning.Operation - (*GetOperationRequest)(nil), // 1: google.longrunning.GetOperationRequest - (*ListOperationsRequest)(nil), // 2: google.longrunning.ListOperationsRequest - (*ListOperationsResponse)(nil), // 3: google.longrunning.ListOperationsResponse - (*CancelOperationRequest)(nil), // 4: google.longrunning.CancelOperationRequest - (*DeleteOperationRequest)(nil), // 5: google.longrunning.DeleteOperationRequest - (*WaitOperationRequest)(nil), // 6: google.longrunning.WaitOperationRequest - (*OperationInfo)(nil), // 7: google.longrunning.OperationInfo - (*anypb.Any)(nil), // 8: google.protobuf.Any - (*status.Status)(nil), // 9: google.rpc.Status - (*durationpb.Duration)(nil), // 10: google.protobuf.Duration - (*descriptorpb.MethodOptions)(nil), // 11: google.protobuf.MethodOptions - (*emptypb.Empty)(nil), // 12: google.protobuf.Empty -} -var file_google_longrunning_operations_proto_depIdxs = []int32{ - 8, // 0: google.longrunning.Operation.metadata:type_name -> google.protobuf.Any - 9, // 1: google.longrunning.Operation.error:type_name -> google.rpc.Status - 8, // 2: google.longrunning.Operation.response:type_name -> google.protobuf.Any - 0, // 3: google.longrunning.ListOperationsResponse.operations:type_name -> google.longrunning.Operation - 10, // 4: google.longrunning.WaitOperationRequest.timeout:type_name -> google.protobuf.Duration - 11, // 5: google.longrunning.operation_info:extendee -> google.protobuf.MethodOptions - 7, // 6: google.longrunning.operation_info:type_name -> google.longrunning.OperationInfo - 2, // 7: google.longrunning.Operations.ListOperations:input_type -> google.longrunning.ListOperationsRequest - 1, // 8: google.longrunning.Operations.GetOperation:input_type -> google.longrunning.GetOperationRequest - 5, // 9: google.longrunning.Operations.DeleteOperation:input_type -> google.longrunning.DeleteOperationRequest - 4, // 10: google.longrunning.Operations.CancelOperation:input_type -> google.longrunning.CancelOperationRequest - 6, // 11: google.longrunning.Operations.WaitOperation:input_type -> google.longrunning.WaitOperationRequest - 3, // 12: google.longrunning.Operations.ListOperations:output_type -> google.longrunning.ListOperationsResponse - 0, // 13: google.longrunning.Operations.GetOperation:output_type -> google.longrunning.Operation - 12, // 14: google.longrunning.Operations.DeleteOperation:output_type -> google.protobuf.Empty - 12, // 15: google.longrunning.Operations.CancelOperation:output_type -> google.protobuf.Empty - 0, // 16: google.longrunning.Operations.WaitOperation:output_type -> google.longrunning.Operation - 12, // [12:17] is the sub-list for method output_type - 7, // [7:12] is the sub-list for method input_type - 6, // [6:7] is the sub-list for extension type_name - 5, // [5:6] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_google_longrunning_operations_proto_init() } -func file_google_longrunning_operations_proto_init() { - if File_google_longrunning_operations_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_longrunning_operations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOperationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOperationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOperationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CancelOperationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOperationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitOperationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_longrunning_operations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperationInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_google_longrunning_operations_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Operation_Error)(nil), - (*Operation_Response)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_longrunning_operations_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 1, - NumServices: 1, - }, - GoTypes: file_google_longrunning_operations_proto_goTypes, - DependencyIndexes: file_google_longrunning_operations_proto_depIdxs, - MessageInfos: file_google_longrunning_operations_proto_msgTypes, - ExtensionInfos: file_google_longrunning_operations_proto_extTypes, - }.Build() - File_google_longrunning_operations_proto = out.File - file_google_longrunning_operations_proto_rawDesc = nil - file_google_longrunning_operations_proto_goTypes = nil - file_google_longrunning_operations_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// OperationsClient is the client API for Operations service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type OperationsClient interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - // - // NOTE: the `name` binding allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. To - // override the binding, API services can add a binding such as - // `"/v1/{name=users/*}/operations"` to their service configuration. - // For backwards compatibility, the default name includes the operations - // collection id, however overriding users must ensure the name binding - // is the parent resource, without the operations collection id. - ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Waits until the specified long-running operation is done or reaches at most - // a specified timeout, returning the latest state. If the operation is - // already done, the latest state is immediately returned. If the timeout - // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - // timeout is used. If the server does not support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - // Note that this method is on a best-effort basis. It may return the latest - // state before the specified timeout (including immediately), meaning even an - // immediate response is no guarantee that the operation is done. - WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) -} - -type operationsClient struct { - cc grpc.ClientConnInterface -} - -func NewOperationsClient(cc grpc.ClientConnInterface) OperationsClient { - return &operationsClient{cc} -} - -func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { - out := new(ListOperationsResponse) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/ListOperations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { - out := new(Operation) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/GetOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/DeleteOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/CancelOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) { - out := new(Operation) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/WaitOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OperationsServer is the server API for Operations service. -type OperationsServer interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - // - // NOTE: the `name` binding allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. To - // override the binding, API services can add a binding such as - // `"/v1/{name=users/*}/operations"` to their service configuration. - // For backwards compatibility, the default name includes the operations - // collection id, however overriding users must ensure the name binding - // is the parent resource, without the operations collection id. - ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(context.Context, *GetOperationRequest) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) - // Waits until the specified long-running operation is done or reaches at most - // a specified timeout, returning the latest state. If the operation is - // already done, the latest state is immediately returned. If the timeout - // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - // timeout is used. If the server does not support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - // Note that this method is on a best-effort basis. It may return the latest - // state before the specified timeout (including immediately), meaning even an - // immediate response is no guarantee that the operation is done. - WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) -} - -// UnimplementedOperationsServer can be embedded to have forward compatible implementations. -type UnimplementedOperationsServer struct { -} - -func (*UnimplementedOperationsServer) ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListOperations not implemented") -} -func (*UnimplementedOperationsServer) GetOperation(context.Context, *GetOperationRequest) (*Operation, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetOperation not implemented") -} -func (*UnimplementedOperationsServer) DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteOperation not implemented") -} -func (*UnimplementedOperationsServer) CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CancelOperation not implemented") -} -func (*UnimplementedOperationsServer) WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) { - return nil, status1.Errorf(codes.Unimplemented, "method WaitOperation not implemented") -} - -func RegisterOperationsServer(s *grpc.Server, srv OperationsServer) { - s.RegisterService(&_Operations_serviceDesc, srv) -} - -func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).ListOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/ListOperations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).GetOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/GetOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).DeleteOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/DeleteOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).CancelOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/CancelOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_WaitOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).WaitOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/WaitOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).WaitOperation(ctx, req.(*WaitOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Operations_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.longrunning.Operations", - HandlerType: (*OperationsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListOperations", - Handler: _Operations_ListOperations_Handler, - }, - { - MethodName: "GetOperation", - Handler: _Operations_GetOperation_Handler, - }, - { - MethodName: "DeleteOperation", - Handler: _Operations_DeleteOperation_Handler, - }, - { - MethodName: "CancelOperation", - Handler: _Operations_CancelOperation_Handler, - }, - { - MethodName: "WaitOperation", - Handler: _Operations_WaitOperation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/longrunning/operations.proto", -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go b/upstream/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go deleted file mode 100644 index abdb2d6b638..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go_gapic. DO NOT EDIT. - -package longrunning - -import ( - "bytes" - "context" - "fmt" - "io" - "math" - "net/http" - "net/url" - "time" - - longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - gax "github.com/googleapis/gax-go/v2" - "google.golang.org/api/googleapi" - "google.golang.org/api/iterator" - "google.golang.org/api/option" - "google.golang.org/api/option/internaloption" - gtransport "google.golang.org/api/transport/grpc" - httptransport "google.golang.org/api/transport/http" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -var newOperationsClientHook clientHook - -// OperationsCallOptions contains the retry settings for each method of OperationsClient. -type OperationsCallOptions struct { - ListOperations []gax.CallOption - GetOperation []gax.CallOption - DeleteOperation []gax.CallOption - CancelOperation []gax.CallOption - WaitOperation []gax.CallOption -} - -func defaultOperationsGRPCClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("longrunning.googleapis.com:443"), - internaloption.WithDefaultEndpointTemplate("longrunning.UNIVERSE_DOMAIN:443"), - internaloption.WithDefaultMTLSEndpoint("longrunning.mtls.googleapis.com:443"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://longrunning.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - internaloption.EnableJwtWithScope(), - option.WithGRPCDialOption(grpc.WithDefaultCallOptions( - grpc.MaxCallRecvMsgSize(math.MaxInt32))), - } -} - -func defaultOperationsCallOptions() *OperationsCallOptions { - return &OperationsCallOptions{ - ListOperations: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }) - }), - }, - GetOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }) - }), - }, - DeleteOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }) - }), - }, - CancelOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, - }, gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }) - }), - }, - WaitOperation: []gax.CallOption{}, - } -} - -func defaultOperationsRESTCallOptions() *OperationsCallOptions { - return &OperationsCallOptions{ - ListOperations: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }, - http.StatusServiceUnavailable) - }), - }, - GetOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }, - http.StatusServiceUnavailable) - }), - }, - DeleteOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }, - http.StatusServiceUnavailable) - }), - }, - CancelOperation: []gax.CallOption{ - gax.WithTimeout(10000 * time.Millisecond), - gax.WithRetry(func() gax.Retryer { - return gax.OnHTTPCodes(gax.Backoff{ - Initial: 500 * time.Millisecond, - Max: 10000 * time.Millisecond, - Multiplier: 2.00, - }, - http.StatusServiceUnavailable) - }), - }, - WaitOperation: []gax.CallOption{}, - } -} - -// internalOperationsClient is an interface that defines the methods available from Long Running Operations API. -type internalOperationsClient interface { - Close() error - setGoogleClientInfo(...string) - Connection() *grpc.ClientConn - ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator - GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) - DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error - CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error - WaitOperation(context.Context, *longrunningpb.WaitOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) -} - -// OperationsClient is a client for interacting with Long Running Operations API. -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -// -// Manages long-running operations with an API service. -// -// When an API method normally takes long time to complete, it can be designed -// to return Operation to the client, and the client can use this -// interface to receive the real response asynchronously by polling the -// operation resource, or pass the operation resource to another API (such as -// Google Cloud Pub/Sub API) to receive the response. Any API service that -// returns long-running operations should implement the Operations interface -// so developers can have a consistent client experience. -type OperationsClient struct { - // The internal transport-dependent client. - internalClient internalOperationsClient - - // The call options for this service. - CallOptions *OperationsCallOptions -} - -// Wrapper methods routed to the internal client. - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *OperationsClient) Close() error { - return c.internalClient.Close() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *OperationsClient) setGoogleClientInfo(keyval ...string) { - c.internalClient.setGoogleClientInfo(keyval...) -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *OperationsClient) Connection() *grpc.ClientConn { - return c.internalClient.Connection() -} - -// ListOperations lists operations that match the specified filter in the request. If the -// server doesn’t support this method, it returns UNIMPLEMENTED. -// -// NOTE: the name binding allows API services to override the binding -// to use different resource name schemes, such as users/*/operations. To -// override the binding, API services can add a binding such as -// "/v1/{name=users/*}/operations" to their service configuration. -// For backwards compatibility, the default name includes the operations -// collection id, however overriding users must ensure the name binding -// is the parent resource, without the operations collection id. -func (c *OperationsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { - return c.internalClient.ListOperations(ctx, req, opts...) -} - -// GetOperation gets the latest state of a long-running operation. Clients can use this -// method to poll the operation result at intervals as recommended by the API -// service. -func (c *OperationsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.GetOperation(ctx, req, opts...) -} - -// DeleteOperation deletes a long-running operation. This method indicates that the client is -// no longer interested in the operation result. It does not cancel the -// operation. If the server doesn’t support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. -func (c *OperationsClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { - return c.internalClient.DeleteOperation(ctx, req, opts...) -} - -// CancelOperation starts asynchronous cancellation on a long-running operation. The server -// makes a best effort to cancel the operation, but success is not -// guaranteed. If the server doesn’t support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or -// other methods to check whether the cancellation succeeded or whether the -// operation completed despite cancellation. On successful cancellation, -// the operation is not deleted; instead, it becomes an operation with -// an Operation.error value with a google.rpc.Status.code of 1, -// corresponding to Code.CANCELLED. -func (c *OperationsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { - return c.internalClient.CancelOperation(ctx, req, opts...) -} - -// WaitOperation waits until the specified long-running operation is done or reaches at most -// a specified timeout, returning the latest state. If the operation is -// already done, the latest state is immediately returned. If the timeout -// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC -// timeout is used. If the server does not support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. -// Note that this method is on a best-effort basis. It may return the latest -// state before the specified timeout (including immediately), meaning even an -// immediate response is no guarantee that the operation is done. -func (c *OperationsClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - return c.internalClient.WaitOperation(ctx, req, opts...) -} - -// operationsGRPCClient is a client for interacting with Long Running Operations API over gRPC transport. -// -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type operationsGRPCClient struct { - // Connection pool of gRPC connections to the service. - connPool gtransport.ConnPool - - // Points back to the CallOptions field of the containing OperationsClient - CallOptions **OperationsCallOptions - - // The gRPC API client. - operationsClient longrunningpb.OperationsClient - - // The x-goog-* metadata to be sent with each request. - xGoogHeaders []string -} - -// NewOperationsClient creates a new operations client based on gRPC. -// The returned client must be Closed when it is done being used to clean up its underlying connections. -// -// Manages long-running operations with an API service. -// -// When an API method normally takes long time to complete, it can be designed -// to return Operation to the client, and the client can use this -// interface to receive the real response asynchronously by polling the -// operation resource, or pass the operation resource to another API (such as -// Google Cloud Pub/Sub API) to receive the response. Any API service that -// returns long-running operations should implement the Operations interface -// so developers can have a consistent client experience. -func NewOperationsClient(ctx context.Context, opts ...option.ClientOption) (*OperationsClient, error) { - clientOpts := defaultOperationsGRPCClientOptions() - if newOperationsClientHook != nil { - hookOpts, err := newOperationsClientHook(ctx, clientHookParams{}) - if err != nil { - return nil, err - } - clientOpts = append(clientOpts, hookOpts...) - } - - connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) - if err != nil { - return nil, err - } - client := OperationsClient{CallOptions: defaultOperationsCallOptions()} - - c := &operationsGRPCClient{ - connPool: connPool, - operationsClient: longrunningpb.NewOperationsClient(connPool), - CallOptions: &client.CallOptions, - } - c.setGoogleClientInfo() - - client.internalClient = c - - return &client, nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: Connections are now pooled so this method does not always -// return the same resource. -func (c *operationsGRPCClient) Connection() *grpc.ClientConn { - return c.connPool.Conn() -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *operationsGRPCClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) - c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *operationsGRPCClient) Close() error { - return c.connPool.Close() -} - -// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. -type operationsRESTClient struct { - // The http endpoint to connect to. - endpoint string - - // The http client. - httpClient *http.Client - - // The x-goog-* headers to be sent with each request. - xGoogHeaders []string - - // Points back to the CallOptions field of the containing OperationsClient - CallOptions **OperationsCallOptions -} - -// NewOperationsRESTClient creates a new operations rest client. -// -// Manages long-running operations with an API service. -// -// When an API method normally takes long time to complete, it can be designed -// to return Operation to the client, and the client can use this -// interface to receive the real response asynchronously by polling the -// operation resource, or pass the operation resource to another API (such as -// Google Cloud Pub/Sub API) to receive the response. Any API service that -// returns long-running operations should implement the Operations interface -// so developers can have a consistent client experience. -func NewOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*OperationsClient, error) { - clientOpts := append(defaultOperationsRESTClientOptions(), opts...) - httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) - if err != nil { - return nil, err - } - - callOpts := defaultOperationsRESTCallOptions() - c := &operationsRESTClient{ - endpoint: endpoint, - httpClient: httpClient, - CallOptions: &callOpts, - } - c.setGoogleClientInfo() - - return &OperationsClient{internalClient: c, CallOptions: callOpts}, nil -} - -func defaultOperationsRESTClientOptions() []option.ClientOption { - return []option.ClientOption{ - internaloption.WithDefaultEndpoint("https://longrunning.googleapis.com"), - internaloption.WithDefaultEndpointTemplate("https://longrunning.UNIVERSE_DOMAIN"), - internaloption.WithDefaultMTLSEndpoint("https://longrunning.mtls.googleapis.com"), - internaloption.WithDefaultUniverseDomain("googleapis.com"), - internaloption.WithDefaultAudience("https://longrunning.googleapis.com/"), - internaloption.WithDefaultScopes(DefaultAuthScopes()...), - } -} - -// setGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Intended for -// use by Google-written clients. -func (c *operationsRESTClient) setGoogleClientInfo(keyval ...string) { - kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") - c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} -} - -// Close closes the connection to the API service. The user should invoke this when -// the client is no longer required. -func (c *operationsRESTClient) Close() error { - // Replace httpClient with nil to force cleanup. - c.httpClient = nil - return nil -} - -// Connection returns a connection to the API service. -// -// Deprecated: This method always returns nil. -func (c *operationsRESTClient) Connection() *grpc.ClientConn { - return nil -} -func (c *operationsGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) - it := &OperationIterator{} - req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) - it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { - resp := &longrunningpb.ListOperationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.ListOperations(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, "", err - } - - it.Response = resp - return resp.GetOperations(), resp.GetNextPageToken(), nil - } - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -func (c *operationsGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *operationsGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - _, err = c.operationsClient.DeleteOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - return err -} - -func (c *operationsGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) - opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - return err -} - -func (c *operationsGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) - opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) - var resp *longrunningpb.Operation - err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - var err error - resp, err = c.operationsClient.WaitOperation(ctx, req, settings.GRPC...) - return err - }, opts...) - if err != nil { - return nil, err - } - return resp, nil -} - -// ListOperations lists operations that match the specified filter in the request. If the -// server doesn’t support this method, it returns UNIMPLEMENTED. -// -// NOTE: the name binding allows API services to override the binding -// to use different resource name schemes, such as users/*/operations. To -// override the binding, API services can add a binding such as -// "/v1/{name=users/*}/operations" to their service configuration. -// For backwards compatibility, the default name includes the operations -// collection id, however overriding users must ensure the name binding -// is the parent resource, without the operations collection id. -func (c *operationsRESTClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { - it := &OperationIterator{} - req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { - resp := &longrunningpb.ListOperationsResponse{} - if pageToken != "" { - req.PageToken = pageToken - } - if pageSize > math.MaxInt32 { - req.PageSize = math.MaxInt32 - } else if pageSize != 0 { - req.PageSize = int32(pageSize) - } - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, "", err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - params := url.Values{} - if req.GetFilter() != "" { - params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) - } - if req.GetPageSize() != 0 { - params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) - } - if req.GetPageToken() != "" { - params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := append(c.xGoogHeaders, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, "", e - } - it.Response = resp - return resp.GetOperations(), resp.GetNextPageToken(), nil - } - - fetch := func(pageSize int, pageToken string) (string, error) { - items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) - if err != nil { - return "", err - } - it.items = append(it.items, items...) - return nextPageToken, nil - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) - it.pageInfo.MaxSize = int(req.GetPageSize()) - it.pageInfo.Token = req.GetPageToken() - - return it -} - -// GetOperation gets the latest state of a long-running operation. Clients can use this -// method to poll the operation result at intervals as recommended by the API -// service. -func (c *operationsRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} - -// DeleteOperation deletes a long-running operation. This method indicates that the client is -// no longer interested in the operation result. It does not cancel the -// operation. If the server doesn’t support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. -func (c *operationsRESTClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return err - } - baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - // Returns nil if there is no error, otherwise wraps - // the response code and body into a non-nil error - return googleapi.CheckResponse(httpRsp) - }, opts...) -} - -// CancelOperation starts asynchronous cancellation on a long-running operation. The server -// makes a best effort to cancel the operation, but success is not -// guaranteed. If the server doesn’t support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or -// other methods to check whether the cancellation succeeded or whether the -// operation completed despite cancellation. On successful cancellation, -// the operation is not deleted; instead, it becomes an operation with -// an Operation.error value with a google.rpc.Status.code of 1, -// corresponding to Code.CANCELLED. -func (c *operationsRESTClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { - m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} - jsonReq, err := m.Marshal(req) - if err != nil { - return err - } - - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return err - } - baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName()) - - // Build HTTP headers from client and context metadata. - hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} - - hds = append(c.xGoogHeaders, hds...) - hds = append(hds, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - // Returns nil if there is no error, otherwise wraps - // the response code and body into a non-nil error - return googleapi.CheckResponse(httpRsp) - }, opts...) -} - -// WaitOperation waits until the specified long-running operation is done or reaches at most -// a specified timeout, returning the latest state. If the operation is -// already done, the latest state is immediately returned. If the timeout -// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC -// timeout is used. If the server does not support this method, it returns -// google.rpc.Code.UNIMPLEMENTED. -// Note that this method is on a best-effort basis. It may return the latest -// state before the specified timeout (including immediately), meaning even an -// immediate response is no guarantee that the operation is done. -func (c *operationsRESTClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { - baseUrl, err := url.Parse(c.endpoint) - if err != nil { - return nil, err - } - baseUrl.Path += fmt.Sprintf("") - - params := url.Values{} - if req.GetName() != "" { - params.Add("name", fmt.Sprintf("%v", req.GetName())) - } - if req.GetTimeout() != nil { - timeout, err := protojson.Marshal(req.GetTimeout()) - if err != nil { - return nil, err - } - params.Add("timeout", string(timeout[1:len(timeout)-1])) - } - - baseUrl.RawQuery = params.Encode() - - // Build HTTP headers from client and context metadata. - hds := append(c.xGoogHeaders, "Content-Type", "application/json") - headers := gax.BuildHeaders(ctx, hds...) - opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - resp := &longrunningpb.Operation{} - e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { - if settings.Path != "" { - baseUrl.Path = settings.Path - } - httpReq, err := http.NewRequest("", baseUrl.String(), nil) - if err != nil { - return err - } - httpReq = httpReq.WithContext(ctx) - httpReq.Header = headers - - httpRsp, err := c.httpClient.Do(httpReq) - if err != nil { - return err - } - defer httpRsp.Body.Close() - - if err = googleapi.CheckResponse(httpRsp); err != nil { - return err - } - - buf, err := io.ReadAll(httpRsp.Body) - if err != nil { - return err - } - - if err := unm.Unmarshal(buf, resp); err != nil { - return err - } - - return nil - }, opts...) - if e != nil { - return nil, e - } - return resp, nil -} diff --git a/upstream/vendor/cloud.google.com/go/longrunning/longrunning.go b/upstream/vendor/cloud.google.com/go/longrunning/longrunning.go deleted file mode 100644 index 3c75b761e46..00000000000 --- a/upstream/vendor/cloud.google.com/go/longrunning/longrunning.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2016 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 longrunning supports Long Running Operations for the Google Cloud Libraries. -// See google.golang.org/genproto/googleapis/longrunning for its service definition. -// -// Users of the Google Cloud Libraries will typically not use this package directly. -// Instead they will call functions returning Operations and call their methods. -// -// This package is still experimental and subject to change. -package longrunning // import "cloud.google.com/go/longrunning" - -import ( - "context" - "errors" - "fmt" - "time" - - autogen "cloud.google.com/go/longrunning/autogen" - pb "cloud.google.com/go/longrunning/autogen/longrunningpb" - gax "github.com/googleapis/gax-go/v2" - "github.com/googleapis/gax-go/v2/apierror" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/protoadapt" - "google.golang.org/protobuf/types/known/anypb" -) - -// ErrNoMetadata is the error returned by Metadata if the operation contains no metadata. -var ErrNoMetadata = errors.New("operation contains no metadata") - -// Operation represents the result of an API call that may not be ready yet. -type Operation struct { - c operationsClient - proto *pb.Operation -} - -type operationsClient interface { - GetOperation(context.Context, *pb.GetOperationRequest, ...gax.CallOption) (*pb.Operation, error) - CancelOperation(context.Context, *pb.CancelOperationRequest, ...gax.CallOption) error - DeleteOperation(context.Context, *pb.DeleteOperationRequest, ...gax.CallOption) error -} - -// InternalNewOperation is for use by the google Cloud Libraries only. -// -// InternalNewOperation returns an long-running operation, abstracting the raw pb.Operation. -// The conn parameter refers to a server that proto was received from. -func InternalNewOperation(inner *autogen.OperationsClient, proto *pb.Operation) *Operation { - return &Operation{ - c: inner, - proto: proto, - } -} - -// Name returns the name of the long-running operation. -// The name is assigned by the server and is unique within the service -// from which the operation is created. -func (op *Operation) Name() string { - return op.proto.Name -} - -// Done reports whether the long-running operation has completed. -func (op *Operation) Done() bool { - return op.proto.Done -} - -// Metadata unmarshals op's metadata into meta. -// If op does not contain any metadata, Metadata returns ErrNoMetadata and meta is unmodified. -func (op *Operation) Metadata(meta protoadapt.MessageV1) error { - if m := op.proto.Metadata; m != nil { - metav2 := protoadapt.MessageV2Of(meta) - return anypb.UnmarshalTo(m, metav2, proto.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}) - } - return ErrNoMetadata -} - -// Poll fetches the latest state of a long-running operation. -// -// If Poll fails, the error is returned and op is unmodified. -// If Poll succeeds and the operation has completed with failure, -// the error is returned and op.Done will return true. -// If Poll succeeds and the operation has completed successfully, -// op.Done will return true; if resp != nil, the response of the operation -// is stored in resp. -func (op *Operation) Poll(ctx context.Context, resp protoadapt.MessageV1, opts ...gax.CallOption) error { - if !op.Done() { - p, err := op.c.GetOperation(ctx, &pb.GetOperationRequest{Name: op.Name()}, opts...) - if err != nil { - return err - } - op.proto = p - } - if !op.Done() { - return nil - } - - switch r := op.proto.Result.(type) { - case *pb.Operation_Error: - err, _ := apierror.FromError(status.ErrorProto(r.Error)) - return err - case *pb.Operation_Response: - if resp == nil { - return nil - } - respv2 := protoadapt.MessageV2Of(resp) - return anypb.UnmarshalTo(r.Response, respv2, proto.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}) - default: - return fmt.Errorf("unsupported result type %[1]T: %[1]v", r) - } -} - -// DefaultWaitInterval is the polling interval used by Operation.Wait. -const DefaultWaitInterval = 60 * time.Second - -// Wait is equivalent to WaitWithInterval using DefaultWaitInterval. -func (op *Operation) Wait(ctx context.Context, resp protoadapt.MessageV1, opts ...gax.CallOption) error { - return op.WaitWithInterval(ctx, resp, DefaultWaitInterval, opts...) -} - -// WaitWithInterval blocks until the operation is completed. -// If resp != nil, Wait stores the response in resp. -// WaitWithInterval polls every interval, except initially -// when it polls using exponential backoff. -// -// See documentation of Poll for error-handling information. -func (op *Operation) WaitWithInterval(ctx context.Context, resp protoadapt.MessageV1, interval time.Duration, opts ...gax.CallOption) error { - bo := gax.Backoff{ - Initial: 1 * time.Second, - Max: interval, - } - if bo.Max < bo.Initial { - bo.Max = bo.Initial - } - return op.wait(ctx, resp, &bo, gax.Sleep, opts...) -} - -type sleeper func(context.Context, time.Duration) error - -// wait implements Wait, taking exponentialBackoff and sleeper arguments for testing. -func (op *Operation) wait(ctx context.Context, resp protoadapt.MessageV1, bo *gax.Backoff, sl sleeper, opts ...gax.CallOption) error { - for { - if err := op.Poll(ctx, resp, opts...); err != nil { - return err - } - if op.Done() { - return nil - } - if err := sl(ctx, bo.Pause()); err != nil { - return err - } - } -} - -// Cancel starts asynchronous cancellation on a long-running operation. The server -// makes a best effort to cancel the operation, but success is not -// guaranteed. If the server doesn't support this method, it returns -// status.Code(err) == codes.Unimplemented. Clients can use -// Poll or other methods to check whether the cancellation succeeded or whether the -// operation completed despite cancellation. On successful cancellation, -// the operation is not deleted; instead, op.Poll returns an error -// with code Canceled. -func (op *Operation) Cancel(ctx context.Context, opts ...gax.CallOption) error { - return op.c.CancelOperation(ctx, &pb.CancelOperationRequest{Name: op.Name()}, opts...) -} - -// Delete deletes a long-running operation. This method indicates that the client is -// no longer interested in the operation result. It does not cancel the -// operation. If the server doesn't support this method, status.Code(err) == codes.Unimplemented. -func (op *Operation) Delete(ctx context.Context, opts ...gax.CallOption) error { - return op.c.DeleteOperation(ctx, &pb.DeleteOperationRequest{Name: op.Name()}, opts...) -} diff --git a/upstream/vendor/cloud.google.com/go/migration.md b/upstream/vendor/cloud.google.com/go/migration.md deleted file mode 100644 index 224dcfa1397..00000000000 --- a/upstream/vendor/cloud.google.com/go/migration.md +++ /dev/null @@ -1,50 +0,0 @@ -# go-genproto to google-cloud-go message type migration - -The message types for all of our client libraries are being migrated from the -`google.golang.org/genproto` [module](https://pkg.go.dev/google.golang.org/genproto) -to their respective product specific module in this repository. For example -this asset request type that was once found in [genproto](https://pkg.go.dev/google.golang.org/genproto@v0.0.0-20220908141613-51c1cc9bc6d0/googleapis/cloud/asset/v1p5beta1#ListAssetsRequest) -can now be found in directly in the [asset module](https://pkg.go.dev/cloud.google.com/go/asset/apiv1p5beta1/assetpb#ListAssetsRequest). - -Although the type definitions have moved, aliases have been left in the old -genproto packages to ensure a smooth non-breaking transition. - -## How do I migrate to the new packages? - -The easiest option is to run a migration tool at the root of our project. It is -like `go fix`, but specifically for this migration. Before running the tool it -is best to make sure any modules that have the prefix of `cloud.google.com/go` -are up to date. To run the tool, do the following: - -```bash -go run cloud.google.com/go/internal/aliasfix/cmd/aliasfix@latest . -go mod tidy -``` - -The tool should only change up to one line in the import statement per file. -This can also be done by hand if you prefer. - -## Do I have to migrate? - -Yes if you wish to keep using the newest versions of our client libraries with -the newest features -- You should migrate by the start of 2023. Until then we -will keep updating the aliases in go-genproto weekly. If you have an existing -workload that uses these client libraries and does not need to update its -dependencies there is no action to take. All existing written code will continue -to work. - -## Why are these types being moved - -1. This change will help simplify dependency trees over time. -2. The types will now be in product specific modules that are versioned - independently with semver. This is especially a benefit for users that rely - on multiple clients in a single application. Because message types are no - longer mono-packaged users are less likely to run into intermediate - dependency conflicts when updating dependencies. -3. Having all these types in one repository will help us ensure that unintended - changes are caught before they would be released. - -## Have questions? - -Please reach out to us on our [issue tracker](https://github.com/googleapis/google-cloud-go/issues/new?assignees=&labels=genproto-migration&template=migration-issue.md&title=package%3A+migration+help) -if you have any questions or concerns. diff --git a/upstream/vendor/cloud.google.com/go/release-please-config-individual.json b/upstream/vendor/cloud.google.com/go/release-please-config-individual.json deleted file mode 100644 index 93054b7de60..00000000000 --- a/upstream/vendor/cloud.google.com/go/release-please-config-individual.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "release-type": "go-yoshi", - "include-component-in-tag": true, - "separate-pull-requests": true, - "tag-separator": "/", - "packages": { - "aiplatform": { - "component": "aiplatform" - }, - "auth": { - "component": "auth" - }, - "auth/oauth2adapt": { - "component": "auth/oauth2adapt" - }, - "bigquery": { - "component": "bigquery" - }, - "bigtable": { - "component": "bigtable" - }, - "datastore": { - "component": "datastore" - }, - "errorreporting": { - "component": "errorreporting" - }, - "firestore": { - "component": "firestore" - }, - "logging": { - "component": "logging" - }, - "profiler": { - "component": "profiler" - }, - "pubsub": { - "component": "pubsub" - }, - "pubsublite": { - "component": "pubsublite" - }, - "spanner": { - "component": "spanner" - }, - "storage": { - "component": "storage" - }, - "vertexai": { - "component": "vertexai" - } - }, - "plugins": [ - "sentence-case" - ] -} diff --git a/upstream/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json b/upstream/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json deleted file mode 100644 index 3615b1952ec..00000000000 --- a/upstream/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json +++ /dev/null @@ -1,439 +0,0 @@ -{ - "release-type": "go-yoshi", - "include-component-in-tag": true, - "tag-separator": "/", - "packages": { - "accessapproval": { - "component": "accessapproval" - }, - "accesscontextmanager": { - "component": "accesscontextmanager" - }, - "advisorynotifications": { - "component": "advisorynotifications" - }, - "alloydb": { - "component": "alloydb" - }, - "analytics": { - "component": "analytics" - }, - "apigateway": { - "component": "apigateway" - }, - "apigeeconnect": { - "component": "apigeeconnect" - }, - "apigeeregistry": { - "component": "apigeeregistry" - }, - "apikeys": { - "component": "apikeys" - }, - "appengine": { - "component": "appengine" - }, - "apphub": { - "component": "apphub" - }, - "apps": { - "component": "apps" - }, - "area120": { - "component": "area120" - }, - "artifactregistry": { - "component": "artifactregistry" - }, - "asset": { - "component": "asset" - }, - "assuredworkloads": { - "component": "assuredworkloads" - }, - "automl": { - "component": "automl" - }, - "backupdr": { - "component": "backupdr" - }, - "baremetalsolution": { - "component": "baremetalsolution" - }, - "batch": { - "component": "batch" - }, - "beyondcorp": { - "component": "beyondcorp" - }, - "billing": { - "component": "billing" - }, - "binaryauthorization": { - "component": "binaryauthorization" - }, - "certificatemanager": { - "component": "certificatemanager" - }, - "channel": { - "component": "channel" - }, - "chat": { - "component": "chat" - }, - "cloudbuild": { - "component": "cloudbuild" - }, - "cloudcontrolspartner": { - "component": "cloudcontrolspartner" - }, - "clouddms": { - "component": "clouddms" - }, - "cloudprofiler": { - "component": "cloudprofiler" - }, - "cloudquotas": { - "component": "cloudquotas" - }, - "cloudtasks": { - "component": "cloudtasks" - }, - "commerce": { - "component": "commerce" - }, - "compute": { - "component": "compute" - }, - "compute/metadata": { - "component": "compute/metadata" - }, - "confidentialcomputing": { - "component": "confidentialcomputing" - }, - "config": { - "component": "config" - }, - "contactcenterinsights": { - "component": "contactcenterinsights" - }, - "container": { - "component": "container" - }, - "containeranalysis": { - "component": "containeranalysis" - }, - "datacatalog": { - "component": "datacatalog" - }, - "dataflow": { - "component": "dataflow" - }, - "dataform": { - "component": "dataform" - }, - "datafusion": { - "component": "datafusion" - }, - "datalabeling": { - "component": "datalabeling" - }, - "dataplex": { - "component": "dataplex" - }, - "dataproc": { - "component": "dataproc" - }, - "dataqna": { - "component": "dataqna" - }, - "datastream": { - "component": "datastream" - }, - "deploy": { - "component": "deploy" - }, - "dialogflow": { - "component": "dialogflow" - }, - "discoveryengine": { - "component": "discoveryengine" - }, - "dlp": { - "component": "dlp" - }, - "documentai": { - "component": "documentai" - }, - "domains": { - "component": "domains" - }, - "edgecontainer": { - "component": "edgecontainer" - }, - "edgenetwork": { - "component": "edgenetwork" - }, - "essentialcontacts": { - "component": "essentialcontacts" - }, - "eventarc": { - "component": "eventarc" - }, - "filestore": { - "component": "filestore" - }, - "functions": { - "component": "functions" - }, - "gkebackup": { - "component": "gkebackup" - }, - "gkeconnect": { - "component": "gkeconnect" - }, - "gkehub": { - "component": "gkehub" - }, - "gkemulticloud": { - "component": "gkemulticloud" - }, - "grafeas": { - "component": "grafeas" - }, - "gsuiteaddons": { - "component": "gsuiteaddons" - }, - "iam": { - "component": "iam" - }, - "iap": { - "component": "iap" - }, - "identitytoolkit": { - "component": "identitytoolkit" - }, - "ids": { - "component": "ids" - }, - "iot": { - "component": "iot" - }, - "kms": { - "component": "kms" - }, - "language": { - "component": "language" - }, - "lifesciences": { - "component": "lifesciences" - }, - "longrunning": { - "component": "longrunning" - }, - "managedidentities": { - "component": "managedidentities" - }, - "maps": { - "component": "maps" - }, - "mediatranslation": { - "component": "mediatranslation" - }, - "memcache": { - "component": "memcache" - }, - "metastore": { - "component": "metastore" - }, - "migrationcenter": { - "component": "migrationcenter" - }, - "monitoring": { - "component": "monitoring" - }, - "netapp": { - "component": "netapp" - }, - "networkconnectivity": { - "component": "networkconnectivity" - }, - "networkmanagement": { - "component": "networkmanagement" - }, - "networksecurity": { - "component": "networksecurity" - }, - "notebooks": { - "component": "notebooks" - }, - "optimization": { - "component": "optimization" - }, - "orchestration": { - "component": "orchestration" - }, - "orgpolicy": { - "component": "orgpolicy" - }, - "osconfig": { - "component": "osconfig" - }, - "oslogin": { - "component": "oslogin" - }, - "parallelstore": { - "component": "parallelstore" - }, - "phishingprotection": { - "component": "phishingprotection" - }, - "policysimulator": { - "component": "policysimulator" - }, - "policytroubleshooter": { - "component": "policytroubleshooter" - }, - "privatecatalog": { - "component": "privatecatalog" - }, - "rapidmigrationassessment": { - "component": "rapidmigrationassessment" - }, - "recaptchaenterprise": { - "component": "recaptchaenterprise" - }, - "recommendationengine": { - "component": "recommendationengine" - }, - "recommender": { - "component": "recommender" - }, - "redis": { - "component": "redis" - }, - "resourcemanager": { - "component": "resourcemanager" - }, - "resourcesettings": { - "component": "resourcesettings" - }, - "retail": { - "component": "retail" - }, - "run": { - "component": "run" - }, - "scheduler": { - "component": "scheduler" - }, - "secretmanager": { - "component": "secretmanager" - }, - "securesourcemanager": { - "component": "securesourcemanager" - }, - "security": { - "component": "security" - }, - "securitycenter": { - "component": "securitycenter" - }, - "securitycentermanagement": { - "component": "securitycentermanagement" - }, - "securityposture": { - "component": "securityposture" - }, - "servicecontrol": { - "component": "servicecontrol" - }, - "servicedirectory": { - "component": "servicedirectory" - }, - "servicehealth": { - "component": "servicehealth" - }, - "servicemanagement": { - "component": "servicemanagement" - }, - "serviceusage": { - "component": "serviceusage" - }, - "shell": { - "component": "shell" - }, - "shopping": { - "component": "shopping" - }, - "speech": { - "component": "speech" - }, - "storageinsights": { - "component": "storageinsights" - }, - "storagetransfer": { - "component": "storagetransfer" - }, - "streetview": { - "component": "streetview" - }, - "support": { - "component": "support" - }, - "talent": { - "component": "talent" - }, - "telcoautomation": { - "component": "telcoautomation" - }, - "texttospeech": { - "component": "texttospeech" - }, - "tpu": { - "component": "tpu" - }, - "trace": { - "component": "trace" - }, - "translate": { - "component": "translate" - }, - "video": { - "component": "video" - }, - "videointelligence": { - "component": "videointelligence" - }, - "vision": { - "component": "vision" - }, - "visionai": { - "component": "visionai" - }, - "vmmigration": { - "component": "vmmigration" - }, - "vmwareengine": { - "component": "vmwareengine" - }, - "vpcaccess": { - "component": "vpcaccess" - }, - "webrisk": { - "component": "webrisk" - }, - "websecurityscanner": { - "component": "websecurityscanner" - }, - "workflows": { - "component": "workflows" - }, - "workstations": { - "component": "workstations" - } - }, - "plugins": [ - "sentence-case" - ] -} diff --git a/upstream/vendor/cloud.google.com/go/release-please-config.json b/upstream/vendor/cloud.google.com/go/release-please-config.json deleted file mode 100644 index 1400245b8a3..00000000000 --- a/upstream/vendor/cloud.google.com/go/release-please-config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "release-type": "go-yoshi", - "separate-pull-requests": true, - "include-component-in-tag": false, - "packages": { - ".": { - "component": "main" - } - }, - "plugins": ["sentence-case"] -} diff --git a/upstream/vendor/cloud.google.com/go/testing.md b/upstream/vendor/cloud.google.com/go/testing.md deleted file mode 100644 index 78bb35b3b6e..00000000000 --- a/upstream/vendor/cloud.google.com/go/testing.md +++ /dev/null @@ -1,237 +0,0 @@ -# Testing Code that depends on Go Client Libraries - -The Go client libraries generated as a part of `cloud.google.com/go` all take -the approach of returning concrete types instead of interfaces. That way, new -fields and methods can be added to the libraries without breaking users. This -document will go over some patterns that can be used to test code that depends -on the Go client libraries. - -## Testing gRPC services using fakes - -*Note*: You can see the full -[example code using a fake here](https://github.com/googleapis/google-cloud-go/tree/main/internal/examples/fake). - -The clients found in `cloud.google.com/go` are gRPC based, with a couple of -notable exceptions being the [`storage`](https://pkg.go.dev/cloud.google.com/go/storage) -and [`bigquery`](https://pkg.go.dev/cloud.google.com/go/bigquery) clients. -Interactions with gRPC services can be faked by serving up your own in-memory -server within your test. One benefit of using this approach is that you don’t -need to define an interface in your runtime code; you can keep using -concrete struct types. You instead define a fake server in your test code. For -example, take a look at the following function: - -```go -import ( - "context" - "fmt" - "log" - "os" - - translate "cloud.google.com/go/translate/apiv3" - "github.com/googleapis/gax-go/v2" - translatepb "google.golang.org/genproto/googleapis/cloud/translate/v3" -) - -func TranslateTextWithConcreteClient(client *translate.TranslationClient, text string, targetLang string) (string, error) { - ctx := context.Background() - log.Printf("Translating %q to %q", text, targetLang) - req := &translatepb.TranslateTextRequest{ - Parent: fmt.Sprintf("projects/%s/locations/global", os.Getenv("GOOGLE_CLOUD_PROJECT")), - TargetLanguageCode: "en-US", - Contents: []string{text}, - } - resp, err := client.TranslateText(ctx, req) - if err != nil { - return "", fmt.Errorf("unable to translate text: %v", err) - } - translations := resp.GetTranslations() - if len(translations) != 1 { - return "", fmt.Errorf("expected only one result, got %d", len(translations)) - } - return translations[0].TranslatedText, nil -} -``` - -Here is an example of what a fake server implementation would look like for -faking the interactions above: - -```go -import ( - "context" - - translatepb "google.golang.org/genproto/googleapis/cloud/translate/v3" -) - -type fakeTranslationServer struct { - translatepb.UnimplementedTranslationServiceServer -} - -func (f *fakeTranslationServer) TranslateText(ctx context.Context, req *translatepb.TranslateTextRequest) (*translatepb.TranslateTextResponse, error) { - resp := &translatepb.TranslateTextResponse{ - Translations: []*translatepb.Translation{ - &translatepb.Translation{ - TranslatedText: "Hello World", - }, - }, - } - return resp, nil -} -``` - -All of the generated protobuf code found in [google.golang.org/genproto](https://pkg.go.dev/google.golang.org/genproto) -contains a similar `package.UnimplementedFooServer` type that is useful for -creating fakes. By embedding the unimplemented server in the -`fakeTranslationServer`, the fake will “inherit” all of the RPCs the server -exposes. Then, by providing our own `fakeTranslationServer.TranslateText` -method you can “override” the default unimplemented behavior of the one RPC that -you would like to be faked. - -The test itself does require a little bit of setup: start up a `net.Listener`, -register the server, and tell the client library to call the server: - -```go -import ( - "context" - "net" - "testing" - - translate "cloud.google.com/go/translate/apiv3" - "google.golang.org/api/option" - translatepb "google.golang.org/genproto/googleapis/cloud/translate/v3" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" -) - -func TestTranslateTextWithConcreteClient(t *testing.T) { - ctx := context.Background() - - // Setup the fake server. - fakeTranslationServer := &fakeTranslationServer{} - l, err := net.Listen("tcp", "localhost:0") - if err != nil { - t.Fatal(err) - } - gsrv := grpc.NewServer() - translatepb.RegisterTranslationServiceServer(gsrv, fakeTranslationServer) - fakeServerAddr := l.Addr().String() - go func() { - if err := gsrv.Serve(l); err != nil { - panic(err) - } - }() - - // Create a client. - client, err := translate.NewTranslationClient(ctx, - option.WithEndpoint(fakeServerAddr), - option.WithoutAuthentication(), - option.WithGRPCDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())), - ) - if err != nil { - t.Fatal(err) - } - - // Run the test. - text, err := TranslateTextWithConcreteClient(client, "Hola Mundo", "en-US") - if err != nil { - t.Fatal(err) - } - if text != "Hello World" { - t.Fatalf("got %q, want Hello World", text) - } -} -``` - -## Testing using mocks - -*Note*: You can see the full -[example code using a mock here](https://github.com/googleapis/google-cloud-go/tree/main/internal/examples/mock). - -When mocking code you need to work with interfaces. Let’s create an interface -for the `cloud.google.com/go/translate/apiv3` client used in the -`TranslateTextWithConcreteClient` function mentioned in the previous section. -The `translate.Client` has over a dozen methods but this code only uses one of -them. Here is an interface that satisfies the interactions of the -`translate.Client` in this function. - -```go -type TranslationClient interface { - TranslateText(ctx context.Context, req *translatepb.TranslateTextRequest, opts ...gax.CallOption) (*translatepb.TranslateTextResponse, error) -} -``` - -Now that we have an interface that satisfies the method being used we can -rewrite the function signature to take the interface instead of the concrete -type. - -```go -func TranslateTextWithInterfaceClient(client TranslationClient, text string, targetLang string) (string, error) { -// ... -} -``` - -This allows a real `translate.Client` to be passed to the method in production -and for a mock implementation to be passed in during testing. This pattern can -be applied to any Go code, not just `cloud.google.com/go`. This is because -interfaces in Go are implicitly satisfied. Structs in the client libraries can -implicitly implement interfaces defined in your codebase. Let’s take a look at -what it might look like to define a lightweight mock for the `TranslationClient` -interface. - -```go -import ( - "context" - "testing" - - "github.com/googleapis/gax-go/v2" - translatepb "google.golang.org/genproto/googleapis/cloud/translate/v3" -) - -type mockClient struct{} - -func (*mockClient) TranslateText(_ context.Context, req *translatepb.TranslateTextRequest, opts ...gax.CallOption) (*translatepb.TranslateTextResponse, error) { - resp := &translatepb.TranslateTextResponse{ - Translations: []*translatepb.Translation{ - &translatepb.Translation{ - TranslatedText: "Hello World", - }, - }, - } - return resp, nil -} - -func TestTranslateTextWithAbstractClient(t *testing.T) { - client := &mockClient{} - text, err := TranslateTextWithInterfaceClient(client, "Hola Mundo", "en-US") - if err != nil { - t.Fatal(err) - } - if text != "Hello World" { - t.Fatalf("got %q, want Hello World", text) - } -} -``` - -If you prefer to not write your own mocks there are mocking frameworks such as -[golang/mock](https://github.com/golang/mock) which can generate mocks for you -from an interface. As a word of caution though, try to not -[overuse mocks](https://testing.googleblog.com/2013/05/testing-on-toilet-dont-overuse-mocks.html). - -## Testing using emulators - -Some of the client libraries provided in `cloud.google.com/go` support running -against a service emulator. The concept is similar to that of using fakes, -mentioned above, but the server is managed for you. You just need to start it up -and instruct the client library to talk to the emulator by setting a service -specific emulator environment variable. Current services/environment-variables -are: - -- bigtable: `BIGTABLE_EMULATOR_HOST` -- datastore: `DATASTORE_EMULATOR_HOST` -- firestore: `FIRESTORE_EMULATOR_HOST` -- pubsub: `PUBSUB_EMULATOR_HOST` -- spanner: `SPANNER_EMULATOR_HOST` -- storage: `STORAGE_EMULATOR_HOST` - - Although the storage client supports an emulator environment variable there is no official emulator provided by gcloud. - -For more information on emulators please refer to the -[gcloud documentation](https://cloud.google.com/sdk/gcloud/reference/beta/emulators). diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index a6675492b1a..bf0c3e1aacc 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,29 +1,5 @@ # Release History -## 1.11.1 (2024-04-02) - -### Bugs Fixed - -* Pollers that use the `Location` header won't consider `http.StatusRequestTimeout` a terminal failure. -* `runtime.Poller[T].Result` won't consider non-terminal error responses as terminal. - -## 1.11.0 (2024-04-01) - -### Features Added - -* Added `StatusCodes` to `arm/policy.RegistrationOptions` to allow supporting non-standard HTTP status codes during registration. -* Added field `InsecureAllowCredentialWithHTTP` to `azcore.ClientOptions` and dependent authentication pipeline policies. -* Added type `MultipartContent` to the `streaming` package to support multipart/form payloads with custom Content-Type and file name. - -### Bugs Fixed - -* `runtime.SetMultipartFormData` won't try to stringify `[]byte` values. -* Pollers that use the `Location` header won't consider `http.StatusTooManyRequests` a terminal failure. - -### Other Changes - -* Update dependencies. - ## 1.10.0 (2024-02-29) ### Features Added diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go index f18caf84893..83cf91e3ecb 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go @@ -20,11 +20,6 @@ type BearerTokenOptions struct { // policy's credential must support multitenant authentication. AuxiliaryTenants []string - // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP. - // By default, authenticated requests to an HTTP endpoint are rejected by the client. - // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution. - InsecureAllowCredentialWithHTTP bool - // Scopes contains the list of permission scopes required for the token. Scopes []string } @@ -49,11 +44,6 @@ type RegistrationOptions struct { // The default valule is 5 minutes. // NOTE: Setting this to a small value might cause the policy to prematurely fail. PollingDuration time.Duration - - // StatusCodes contains the slice of custom HTTP status codes to use instead - // of the default http.StatusConflict. This should only be set if a service - // returns a non-standard HTTP status code when unregistered. - StatusCodes []int } // ClientOptions contains configuration settings for a client's pipeline. diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go index 039b758bf98..302c19cd426 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go @@ -30,9 +30,8 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr return azruntime.Pipeline{}, err } authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{ - AuxiliaryTenants: options.AuxiliaryTenants, - InsecureAllowCredentialWithHTTP: options.InsecureAllowCredentialWithHTTP, - Scopes: []string{conf.Audience + "/.default"}, + AuxiliaryTenants: options.AuxiliaryTenants, + Scopes: []string{conf.Audience + "/.default"}, }) perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1) copy(perRetry, plOpts.PerRetry) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go index 765fbc6843d..54b3bb78d85 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go @@ -64,7 +64,6 @@ func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTok p.scopes = make([]string, len(opts.Scopes)) copy(p.scopes, opts.Scopes) p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{ - InsecureAllowCredentialWithHTTP: opts.InsecureAllowCredentialWithHTTP, AuthorizationHandler: azpolicy.AuthorizationHandler{ OnChallenge: p.onChallenge, OnRequest: p.onRequest, diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go index 810ac9d9fab..83e15949aa3 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go @@ -8,6 +8,7 @@ package runtime import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -15,7 +16,6 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" @@ -45,9 +45,6 @@ func setDefaults(r *armpolicy.RegistrationOptions) { if r.PollingDuration == 0 { r.PollingDuration = 5 * time.Minute } - if len(r.StatusCodes) == 0 { - r.StatusCodes = []int{http.StatusConflict} - } } // NewRPRegistrationPolicy creates a policy object configured using the specified options. @@ -91,7 +88,7 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) // make the original request resp, err = req.Next() // getting a 409 is the first indication that the RP might need to be registered, check error response - if err != nil || !runtime.HasStatusCode(resp, r.options.StatusCodes...) { + if err != nil || resp.StatusCode != http.StatusConflict { return resp, err } var reqErr requestError @@ -108,12 +105,17 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) // to the caller so its error unmarshalling will kick in return resp, err } - res, err := resource.ParseResourceID(req.Raw().URL.Path) + // RP needs to be registered. start by getting the subscription ID from the original request + subID, err := getSubscription(req.Raw().URL.Path) + if err != nil { + return resp, err + } + // now get the RP from the error + rp, err = getProvider(reqErr) if err != nil { return resp, err } - rp = res.ResourceType.Namespace - logRegistrationExit := func(v any) { + logRegistrationExit := func(v interface{}) { log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v) } log.Writef(LogRPRegistration, "BEGIN registration for %s", rp) @@ -122,7 +124,7 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) rpOps := &providersOperations{ p: r.pipeline, u: r.endpoint, - subID: res.SubscriptionID, + subID: subID, } if _, err = rpOps.Register(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, rp); err != nil { logRegistrationExit(err) @@ -187,13 +189,36 @@ func isUnregisteredRPCode(errorCode string) bool { return false } +func getSubscription(path string) (string, error) { + parts := strings.Split(path, "/") + for i, v := range parts { + if v == "subscriptions" && (i+1) < len(parts) { + return parts[i+1], nil + } + } + return "", fmt.Errorf("failed to obtain subscription ID from %s", path) +} + +func getProvider(re requestError) (string, error) { + if len(re.ServiceError.Details) > 0 { + return re.ServiceError.Details[0].Target, nil + } + return "", errors.New("unexpected empty Details") +} + // minimal error definitions to simplify detection type requestError struct { ServiceError *serviceError `json:"error"` } type serviceError struct { - Code string `json:"code"` + Code string `json:"code"` + Details []serviceErrorDetails `json:"details"` +} + +type serviceErrorDetails struct { + Code string `json:"code"` + Target string `json:"target"` } /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml index 99348527b54..aab9218538d 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml @@ -23,7 +23,7 @@ pr: - sdk/azcore/ - eng/ -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: ServiceDirectory: azcore diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go index 3041984d9b1..8d1ae213c95 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go @@ -51,15 +51,15 @@ type Request struct { values opValues } -type opValues map[reflect.Type]any +type opValues map[reflect.Type]interface{} // Set adds/changes a value -func (ov opValues) set(value any) { +func (ov opValues) set(value interface{}) { ov[reflect.TypeOf(value)] = value } // Get looks for a value set by SetValue first -func (ov opValues) get(value any) bool { +func (ov opValues) get(value interface{}) bool { v, ok := ov[reflect.ValueOf(value).Elem().Type()] if ok { reflect.ValueOf(value).Elem().Set(reflect.ValueOf(v)) @@ -108,7 +108,7 @@ func (req *Request) Next() (*http.Response, error) { } // SetOperationValue adds/changes a mutable key/value associated with a single operation. -func (req *Request) SetOperationValue(value any) { +func (req *Request) SetOperationValue(value interface{}) { if req.values == nil { req.values = opValues{} } @@ -116,7 +116,7 @@ func (req *Request) SetOperationValue(value any) { } // OperationValue looks for a value set by SetOperationValue(). -func (req *Request) OperationValue(value any) bool { +func (req *Request) OperationValue(value interface{}) bool { if req.values == nil { return false } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go index 08a95458730..bd348b868bf 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go @@ -59,7 +59,7 @@ func NewResponseErrorWithErrorCode(resp *http.Response, errorCode string) error } func extractErrorCodeJSON(body []byte) string { - var rawObj map[string]any + var rawObj map[string]interface{} if err := json.Unmarshal(body, &rawObj); err != nil { // not a JSON object return "" @@ -68,7 +68,7 @@ func extractErrorCodeJSON(body []byte) string { // check if this is a wrapped error, i.e. { "error": { ... } } // if so then unwrap it if wrapped, ok := rawObj["error"]; ok { - unwrapped, ok := wrapped.(map[string]any) + unwrapped, ok := wrapped.(map[string]interface{}) if !ok { return "" } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go index 6fc6d1400e7..5cb87de2cb5 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go @@ -30,7 +30,7 @@ func Write(cls log.Event, msg string) { // Writef invokes the underlying listener with the specified event and formatted message. // If the event shouldn't be logged or there is no listener then Writef does nothing. -func Writef(cls log.Event, format string, a ...any) { +func Writef(cls log.Event, format string, a ...interface{}) { log.Writef(cls, format, a...) } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go index ccd4794e9e9..b05bd8b38d2 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go @@ -27,7 +27,7 @@ func Applicable(resp *http.Response) bool { } // CanResume returns true if the token can rehydrate this poller type. -func CanResume(token map[string]any) bool { +func CanResume(token map[string]interface{}) bool { _, ok := token["asyncURL"] return ok } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go index 0d781b31d0c..2bb9e105b66 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go @@ -29,7 +29,7 @@ func Applicable(resp *http.Response) bool { } // CanResume returns true if the token can rehydrate this poller type. -func CanResume(token map[string]any) bool { +func CanResume(token map[string]interface{}) bool { t, ok := token["type"] if !ok { return false diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go index 51aede8a2b8..25983471867 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go @@ -26,7 +26,7 @@ func Applicable(resp *http.Response) bool { } // CanResume returns true if the token can rehydrate this poller type. -func CanResume(token map[string]any) bool { +func CanResume(token map[string]interface{}) bool { _, ok := token["fakeURL"] return ok } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go index 7a56c5211b7..d6be89876ab 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go @@ -28,7 +28,7 @@ func Applicable(resp *http.Response) bool { } // CanResume returns true if the token can rehydrate this poller type. -func CanResume(token map[string]any) bool { +func CanResume(token map[string]interface{}) bool { t, ok := token["type"] if !ok { return false @@ -103,10 +103,6 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) { } else if resp.StatusCode > 199 && resp.StatusCode < 300 { // any 2xx other than a 202 indicates success p.CurState = poller.StatusSucceeded - } else if pollers.IsNonTerminalHTTPStatusCode(resp) { - // the request timed out or is being throttled. - // DO NOT include this as a terminal failure. preserve - // the existing state and return the response. } else { p.CurState = poller.StatusFailed } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go index ac1c0efb5ac..1bc7ad0aced 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go @@ -25,7 +25,7 @@ func Applicable(resp *http.Response) bool { } // CanResume returns true if the token can rehydrate this poller type. -func CanResume(token map[string]any) bool { +func CanResume(token map[string]interface{}) bool { _, ok := token["oplocURL"] return ok } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go index eb3cf651db0..d8d86a46c2d 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go @@ -74,7 +74,7 @@ func ExtractToken(token string) ([]byte, error) { // IsTokenValid returns an error if the specified token isn't applicable for generic type T. func IsTokenValid[T any](token string) error { - raw := map[string]any{} + raw := map[string]interface{}{} if err := json.Unmarshal([]byte(token), &raw); err != nil { return err } @@ -185,16 +185,3 @@ func ResultHelper[T any](resp *http.Response, failed bool, out *T) error { } return nil } - -// IsNonTerminalHTTPStatusCode returns true if the HTTP status code should be -// considered non-terminal thus eligible for retry. -func IsNonTerminalHTTPStatusCode(resp *http.Response) bool { - return exported.HasStatusCode(resp, - http.StatusRequestTimeout, // 408 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - ) -} diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 03691cbf024..330bf9a60b7 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -40,5 +40,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.11.1" + Version = "v1.10.0" ) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go index 8d984535887..d934f1dc5fa 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go @@ -39,11 +39,6 @@ type ClientOptions struct { // Cloud specifies a cloud for the client. The default is Azure Public Cloud. Cloud cloud.Configuration - // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP. - // By default, authenticated requests to an HTTP endpoint are rejected by the client. - // WARNING: setting this to true will allow sending the credential in clear text. Use with caution. - InsecureAllowCredentialWithHTTP bool - // Logging configures the built-in logging policy. Logging LogOptions @@ -152,11 +147,6 @@ type BearerTokenOptions struct { // When this field isn't set, the policy follows its default behavior of authorizing every request with a bearer token from // its given credential. AuthorizationHandler AuthorizationHandler - - // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP. - // By default, authenticated requests to an HTTP endpoint are rejected by the client. - // WARNING: setting this to true will allow sending the bearer token in clear text. Use with caution. - InsecureAllowCredentialWithHTTP bool } // AuthorizationHandler allows SDK developers to insert custom logic that runs when BearerTokenPolicy must authorize a request. diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go index cb2a6952805..f0f28035595 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go @@ -24,7 +24,6 @@ type BearerTokenPolicy struct { authzHandler policy.AuthorizationHandler cred exported.TokenCredential scopes []string - allowHTTP bool } type acquiringResourceState struct { @@ -56,7 +55,6 @@ func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts * cred: cred, scopes: scopes, mainResource: temporal.NewResource(acquire), - allowHTTP: opts.InsecureAllowCredentialWithHTTP, } } @@ -82,7 +80,7 @@ func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) { return req.Next() } - if err := checkHTTPSForAuth(req, b.allowHTTP); err != nil { + if err := checkHTTPSForAuth(req); err != nil { return nil, err } @@ -115,8 +113,8 @@ func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) { return res, err } -func checkHTTPSForAuth(req *policy.Request, allowHTTP bool) error { - if strings.ToLower(req.Raw().URL.Scheme) != "https" && !allowHTTP { +func checkHTTPSForAuth(req *policy.Request) error { + if strings.ToLower(req.Raw().URL.Scheme) != "https" { return errorinfo.NonRetriableError(errors.New("authenticated requests are not permitted for non TLS protected (https) endpoints")) } return nil diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go index eeb1c09cc12..6f577fa7a9e 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go @@ -12,19 +12,13 @@ import ( // KeyCredentialPolicy authorizes requests with a [azcore.KeyCredential]. type KeyCredentialPolicy struct { - cred *exported.KeyCredential - header string - prefix string - allowHTTP bool + cred *exported.KeyCredential + header string + prefix string } // KeyCredentialPolicyOptions contains the optional values configuring [KeyCredentialPolicy]. type KeyCredentialPolicyOptions struct { - // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP. - // By default, authenticated requests to an HTTP endpoint are rejected by the client. - // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution. - InsecureAllowCredentialWithHTTP bool - // Prefix is used if the key requires a prefix before it's inserted into the HTTP request. Prefix string } @@ -38,10 +32,9 @@ func NewKeyCredentialPolicy(cred *exported.KeyCredential, header string, options options = &KeyCredentialPolicyOptions{} } return &KeyCredentialPolicy{ - cred: cred, - header: header, - prefix: options.Prefix, - allowHTTP: options.InsecureAllowCredentialWithHTTP, + cred: cred, + header: header, + prefix: options.Prefix, } } @@ -51,7 +44,7 @@ func (k *KeyCredentialPolicy) Do(req *policy.Request) (*http.Response, error) { // this prevents a panic that might be hard to diagnose and allows testing // against http endpoints that don't require authentication. if k.cred != nil { - if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil { + if err := checkHTTPSForAuth(req); err != nil { return nil, err } val := exported.KeyCredentialGet(k.cred) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go index 3964beea862..ebe2b7772ba 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go @@ -12,17 +12,13 @@ import ( // SASCredentialPolicy authorizes requests with a [azcore.SASCredential]. type SASCredentialPolicy struct { - cred *exported.SASCredential - header string - allowHTTP bool + cred *exported.SASCredential + header string } // SASCredentialPolicyOptions contains the optional values configuring [SASCredentialPolicy]. type SASCredentialPolicyOptions struct { - // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP. - // By default, authenticated requests to an HTTP endpoint are rejected by the client. - // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution. - InsecureAllowCredentialWithHTTP bool + // placeholder for future optional values } // NewSASCredentialPolicy creates a new instance of [SASCredentialPolicy]. @@ -30,13 +26,9 @@ type SASCredentialPolicyOptions struct { // - header is the name of the HTTP request header in which the shared access signature is placed // - options contains optional configuration, pass nil to accept the default values func NewSASCredentialPolicy(cred *exported.SASCredential, header string, options *SASCredentialPolicyOptions) *SASCredentialPolicy { - if options == nil { - options = &SASCredentialPolicyOptions{} - } return &SASCredentialPolicy{ - cred: cred, - header: header, - allowHTTP: options.InsecureAllowCredentialWithHTTP, + cred: cred, + header: header, } } @@ -46,7 +38,7 @@ func (k *SASCredentialPolicy) Do(req *policy.Request) (*http.Response, error) { // this prevents a panic that might be hard to diagnose and allows testing // against http endpoints that don't require authentication. if k.cred != nil { - if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil { + if err := checkHTTPSForAuth(req); err != nil { return nil, err } req.Raw().Header.Add(k.header, exported.SASCredentialGet(k.cred)) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go index 03f76c9aa8e..c373f68962e 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go @@ -154,7 +154,7 @@ func NewPollerFromResumeToken[T any](token string, pl exported.Pipeline, options if err != nil { return nil, err } - var asJSON map[string]any + var asJSON map[string]interface{} if err := json.Unmarshal(raw, &asJSON); err != nil { return nil, err } @@ -240,7 +240,7 @@ func (p *Poller[T]) PollUntilDone(ctx context.Context, options *PollUntilDoneOpt } start := time.Now() - logPollUntilDoneExit := func(v any) { + logPollUntilDoneExit := func(v interface{}) { log.Writef(log.EventLRO, "END PollUntilDone() for %T: %v, total time: %s", p.op, v, time.Since(start)) } log.Writef(log.EventLRO, "BEGIN PollUntilDone() for %T", p.op) @@ -334,11 +334,6 @@ func (p *Poller[T]) Result(ctx context.Context) (res T, err error) { err = p.op.Result(ctx, p.result) var respErr *exported.ResponseError if errors.As(err, &respErr) { - if pollers.IsNonTerminalHTTPStatusCode(respErr.RawResponse) { - // the request failed in a non-terminal way. - // don't cache the error or mark the Poller as done - return - } // the LRO failed. record the error p.err = err } else if err != nil { diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go index 06ac95b1b71..bef05f2a3d9 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go @@ -11,11 +11,9 @@ import ( "context" "encoding/json" "encoding/xml" - "errors" "fmt" "io" "mime/multipart" - "net/textproto" "net/url" "path" "strings" @@ -23,7 +21,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" ) // Base64Encoding is usesd to specify which base-64 encoder/decoder to use when @@ -112,7 +109,7 @@ func MarshalAsByteArray(req *policy.Request, v []byte, format Base64Encoding) er } // MarshalAsJSON calls json.Marshal() to get the JSON encoding of v then calls SetBody. -func MarshalAsJSON(req *policy.Request, v any) error { +func MarshalAsJSON(req *policy.Request, v interface{}) error { b, err := json.Marshal(v) if err != nil { return fmt.Errorf("error marshalling type %T: %s", v, err) @@ -122,7 +119,7 @@ func MarshalAsJSON(req *policy.Request, v any) error { } // MarshalAsXML calls xml.Marshal() to get the XML encoding of v then calls SetBody. -func MarshalAsXML(req *policy.Request, v any) error { +func MarshalAsXML(req *policy.Request, v interface{}) error { b, err := xml.Marshal(v) if err != nil { return fmt.Errorf("error marshalling type %T: %s", v, err) @@ -132,10 +129,10 @@ func MarshalAsXML(req *policy.Request, v any) error { return req.SetBody(exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppXML) } -// SetMultipartFormData writes the specified keys/values as multi-part form fields with the specified value. -// File content must be specified as an [io.ReadSeekCloser] or [streaming.MultipartContent]. -// Byte slices will be treated as JSON. All other values are treated as string values. -func SetMultipartFormData(req *policy.Request, formData map[string]any) error { +// SetMultipartFormData writes the specified keys/values as multi-part form +// fields with the specified value. File content must be specified as a ReadSeekCloser. +// All other values are treated as string values. +func SetMultipartFormData(req *policy.Request, formData map[string]interface{}) error { body := bytes.Buffer{} writer := multipart.NewWriter(&body) @@ -151,60 +148,6 @@ func SetMultipartFormData(req *policy.Request, formData map[string]any) error { return nil } - quoteEscaper := strings.NewReplacer("\\", "\\\\", `"`, "\\\"") - - writeMultipartContent := func(fieldname string, mpc streaming.MultipartContent) error { - if mpc.Body == nil { - return errors.New("streaming.MultipartContent.Body cannot be nil") - } - - // use fieldname for the file name when unspecified - filename := fieldname - - if mpc.ContentType == "" && mpc.Filename == "" { - return writeContent(fieldname, filename, mpc.Body) - } - if mpc.Filename != "" { - filename = mpc.Filename - } - // this is pretty much copied from multipart.Writer.CreateFormFile - // but lets us set the caller provided Content-Type and filename - h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", - fmt.Sprintf(`form-data; name="%s"; filename="%s"`, - quoteEscaper.Replace(fieldname), quoteEscaper.Replace(filename))) - contentType := "application/octet-stream" - if mpc.ContentType != "" { - contentType = mpc.ContentType - } - h.Set("Content-Type", contentType) - fd, err := writer.CreatePart(h) - if err != nil { - return err - } - // copy the data to the form file - if _, err = io.Copy(fd, mpc.Body); err != nil { - return err - } - return nil - } - - // the same as multipart.Writer.WriteField but lets us specify the Content-Type - writeField := func(fieldname, contentType string, value string) error { - h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", - fmt.Sprintf(`form-data; name="%s"`, quoteEscaper.Replace(fieldname))) - h.Set("Content-Type", contentType) - fd, err := writer.CreatePart(h) - if err != nil { - return err - } - if _, err = fd.Write([]byte(value)); err != nil { - return err - } - return nil - } - for k, v := range formData { if rsc, ok := v.(io.ReadSeekCloser); ok { if err := writeContent(k, k, rsc); err != nil { @@ -218,35 +161,13 @@ func SetMultipartFormData(req *policy.Request, formData map[string]any) error { } } continue - } else if mpc, ok := v.(streaming.MultipartContent); ok { - if err := writeMultipartContent(k, mpc); err != nil { - return err - } - continue - } else if mpcs, ok := v.([]streaming.MultipartContent); ok { - for _, mpc := range mpcs { - if err := writeMultipartContent(k, mpc); err != nil { - return err - } - } - continue } - - var content string - contentType := shared.ContentTypeTextPlain - switch tt := v.(type) { - case []byte: - // JSON, don't quote it - content = string(tt) - contentType = shared.ContentTypeAppJSON - case string: - content = tt - default: - // ensure the value is in string format - content = fmt.Sprintf("%v", v) + // ensure the value is in string format + s, ok := v.(string) + if !ok { + s = fmt.Sprintf("%v", v) } - - if err := writeField(k, contentType, content); err != nil { + if err := writer.WriteField(k, s); err != nil { return err } } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go index 048566e02c0..003c875b1f5 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go @@ -40,7 +40,7 @@ func UnmarshalAsByteArray(resp *http.Response, v *[]byte, format Base64Encoding) } // UnmarshalAsJSON calls json.Unmarshal() to unmarshal the received payload into the value pointed to by v. -func UnmarshalAsJSON(resp *http.Response, v any) error { +func UnmarshalAsJSON(resp *http.Response, v interface{}) error { payload, err := Payload(resp) if err != nil { return err @@ -61,7 +61,7 @@ func UnmarshalAsJSON(resp *http.Response, v any) error { } // UnmarshalAsXML calls xml.Unmarshal() to unmarshal the received payload into the value pointed to by v. -func UnmarshalAsXML(resp *http.Response, v any) error { +func UnmarshalAsXML(resp *http.Response, v interface{}) error { payload, err := Payload(resp) if err != nil { return err diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go index 2468540bd75..fbcd48311b8 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go @@ -73,17 +73,3 @@ func (p *progress) Seek(offset int64, whence int) (int64, error) { func (p *progress) Close() error { return p.rc.Close() } - -// MultipartContent contains streaming content used in multipart/form payloads. -type MultipartContent struct { - // Body contains the required content body. - Body io.ReadSeekCloser - - // ContentType optionally specifies the HTTP Content-Type for this Body. - // The default value is application/octet-stream. - ContentType string - - // Filename optionally specifies the filename for this Body. - // The default value is the field name for the multipart/form section. - Filename string -} diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore deleted file mode 100644 index 8cdb9103650..00000000000 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# live test artifacts -Dockerfile -k8s.yaml -sshkey* diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md index 6d4b6feb86e..71dcb5f3e95 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md @@ -1,66 +1,5 @@ # Release History -## 1.6.0 (2024-06-10) - -### Features Added -* `NewOnBehalfOfCredentialWithClientAssertions` creates an on-behalf-of credential - that authenticates with client assertions such as federated credentials - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.6.0-beta.4 -* Removed `AzurePipelinesCredential` and the persistent token caching API. - They will return in v1.7.0-beta.1 - -### Bugs Fixed -* Managed identity bug fixes - -## 1.6.0-beta.4 (2024-05-14) - -### Features Added -* `AzurePipelinesCredential` authenticates an Azure Pipeline service connection with - workload identity federation - -## 1.6.0-beta.3 (2024-04-09) - -### Breaking Changes -* `DefaultAzureCredential` now sends a probe request with no retries for IMDS managed identity - environments to avoid excessive retry delays when the IMDS endpoint is not available. This - should improve credential chain resolution for local development scenarios. - -### Bugs Fixed -* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances - -## 1.5.2 (2024-04-09) - -### Bugs Fixed -* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances - -### Other Changes -* Restored v1.4.0 error behavior for empty tenant IDs -* Upgraded dependencies - -## 1.6.0-beta.2 (2024-02-06) - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.6.0-beta.1 -* Replaced `ErrAuthenticationRequired` with `AuthenticationRequiredError`, a struct - type that carries the `TokenRequestOptions` passed to the `GetToken` call which - returned the error. - -### Bugs Fixed -* Fixed more cases in which credential chains like `DefaultAzureCredential` - should try their next credential after attempting managed identity - authentication in a Docker Desktop container - -### Other Changes -* `AzureCLICredential` uses the CLI's `expires_on` value for token expiration - -## 1.6.0-beta.1 (2024-01-17) - -### Features Added -* Restored persistent token caching API first added in v1.5.0-beta.1 -* Added `AzureCLICredentialOptions.Subscription` - ## 1.5.1 (2024-01-17) ### Bugs Fixed @@ -187,7 +126,7 @@ ### Features Added * By default, credentials set client capability "CP1" to enable support for - [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity-platform/app-resilience-continuous-access-evaluation). + [Continuous Access Evaluation (CAE)](https://docs.microsoft.com/azure/active-directory/develop/app-resilience-continuous-access-evaluation). This indicates to Microsoft Entra ID that your application can handle CAE claims challenges. You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true". * `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md index 4404be82449..1a649202303 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md @@ -1,6 +1,6 @@ # Migrating from autorest/adal to azidentity -`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead. +`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead. This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`. @@ -284,7 +284,7 @@ if err == nil { } ``` -Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/permissions-consent-overview). +Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/permissions-consent-overview). ## Use azidentity credentials with older packages diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md index b5acff0e632..b6ad2d39f84 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md @@ -1,9 +1,9 @@ # Azure Identity Client Module for Go -The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication. +The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication. [![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/azidentity)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) -| [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity/) +| [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/) | [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity) # Getting started @@ -30,7 +30,7 @@ When debugging and executing code locally, developers typically use their own ac #### Authenticating via the Azure CLI `DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user -signed in to the [Azure CLI](https://learn.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user. +signed in to the [Azure CLI](https://docs.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user. When no default browser is available, `az login` will use the device code authentication flow. This can also be selected manually by running `az login --use-device-code`. @@ -69,14 +69,14 @@ The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID. ## Managed Identity `DefaultAzureCredential` and `ManagedIdentityCredential` support -[managed identity authentication](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) +[managed identity authentication](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) in any hosting environment which supports managed identities, such as (this list is not exhaustive): -* [Azure App Service](https://learn.microsoft.com/azure/app-service/overview-managed-identity) -* [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) -* [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization) -* [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity) -* [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity) -* [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token) +* [Azure App Service](https://docs.microsoft.com/azure/app-service/overview-managed-identity) +* [Azure Arc](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) +* [Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/msi-authorization) +* [Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/use-managed-identity) +* [Azure Service Fabric](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity) +* [Azure Virtual Machines](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token) ## Examples @@ -207,7 +207,7 @@ For more details, see the [token caching documentation](https://aka.ms/azsdk/go/ Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot). -For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes). +For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/azure/active-directory/develop/reference-error-codes). ### Logging diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD index f9cc4894339..c0d6601469c 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD @@ -45,7 +45,7 @@ With persistent disk token caching enabled, the library first determines if a va #### Example code -See the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.6.0-beta.2#pkg-overview) for example code demonstrating how to configure persistent caching and access cached data. +See the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.5.0-beta.1#pkg-overview) for code examples demonstrating how to configure persistent caching and access cached data. ### Credentials supporting token caching diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md index 3564e685e18..832c599eb90 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md @@ -58,7 +58,7 @@ This error contains several pieces of information: - __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`. -- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes. +- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes. - __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Microsoft Entra failures. @@ -97,17 +97,17 @@ azlog.SetEvents(azidentity.EventAuthentication) | Error Code | Issue | Mitigation | |---|---|---| -|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| +|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| +|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| +|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).| ## Troubleshoot ClientCertificateCredential authentication issues | Error Code | Description | Mitigation | |---|---|---| -|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-1-upload-a-certificate).| -|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| +|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-1-upload-a-certificate).| +|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).| ## Troubleshoot UsernamePasswordCredential authentication issues @@ -123,20 +123,20 @@ azlog.SetEvents(azidentity.EventAuthentication) |Host Environment| | | |---|---|---| -|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)| -|Azure App Service and Azure Functions|[Configuration](https://learn.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)| +|Azure Virtual Machines and Scale Sets|[Configuration](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)| +|Azure App Service and Azure Functions|[Configuration](https://docs.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)| |Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)| -|Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)|| -|Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)|| +|Azure Arc|[Configuration](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)|| +|Azure Service Fabric|[Configuration](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity)|| ### Azure Virtual Machine managed identity | Error Message |Description| Mitigation | |---|---|---| -|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.

    If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).| +|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.

    If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).| |The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`| -|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|

    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | -|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|
    • Refer to the error message for more details on specific failures.
    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | +|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|
    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | +|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|
    • Refer to the error message for more details on specific failures.
    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | #### Verify IMDS is available on the VM @@ -152,7 +152,7 @@ curl 'http://169.254.169.254/metadata/identity/oauth2/token?resource=https://man | Error Message |Description| Mitigation | |---|---|---| -|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|
    • Ensure the App Service is configured for managed identity as described in [App Service documentation](https://learn.microsoft.com/azure/app-service/overview-managed-identity).
    • Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
    | +|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|
    • Ensure the App Service is configured for managed identity as described in [App Service documentation](https://docs.microsoft.com/azure/app-service/overview-managed-identity).
    • Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
    | #### Verify the App Service managed identity endpoint is available @@ -177,8 +177,8 @@ curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-versio | Error Message |Description| Mitigation | |---|---|---| -|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|
    • Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://learn.microsoft.com/cli/azure/install-azure-cli).
    • Validate the installation location is in the application's `PATH` environment variable.
    | -|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|
    • Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli).
    • Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
    | +|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|
    • Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://docs.microsoft.com/cli/azure/install-azure-cli).
    • Validate the installation location is in the application's `PATH` environment variable.
    | +|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|
    • Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://docs.microsoft.com/cli/azure/authenticate-azure-cli).
    • Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
    | #### Verify the Azure CLI can obtain tokens diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json index bff0c44dac4..173ce2b3cda 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/azidentity", - "Tag": "go/azidentity_087379b475" + "Tag": "go/azidentity_db4a26f583" } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go index b0965036bbf..c3bcfb56c0a 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go @@ -121,9 +121,6 @@ func alphanumeric(r rune) bool { } func validTenantID(tenantID string) bool { - if len(tenantID) < 1 { - return false - } for _, r := range tenantID { if !(alphanumeric(r) || r == '.' || r == '-') { return false diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go index b9976f5fede..43577ab3c5f 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go @@ -35,9 +35,9 @@ type AzureCLICredentialOptions struct { // logged in account can access. AdditionallyAllowedTenants []string - // Subscription is the name or ID of a subscription. Set this to acquire tokens for an account other + // subscription is the name or ID of a subscription. Set this to acquire tokens for an account other // than the Azure CLI's current account. - Subscription string + subscription string // TenantID identifies the tenant the credential should authenticate in. // Defaults to the CLI's default tenant, which is typically the home tenant of the logged in user. @@ -68,9 +68,9 @@ func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredent if options != nil { cp = *options } - for _, r := range cp.Subscription { + for _, r := range cp.subscription { if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') { - return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.Subscription) + return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.subscription) } } if cp.TenantID != "" && !validTenantID(cp.TenantID) { @@ -97,7 +97,7 @@ func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequ } c.mu.Lock() defer c.mu.Unlock() - b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.Subscription) + b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.subscription) if err == nil { at, err = c.createAccessToken(b) } @@ -163,21 +163,26 @@ var defaultAzTokenProvider azTokenProvider = func(ctx context.Context, scopes [] func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) { t := struct { - AccessToken string `json:"accessToken"` - Expires_On int64 `json:"expires_on"` - ExpiresOn string `json:"expiresOn"` + AccessToken string `json:"accessToken"` + Authority string `json:"_authority"` + ClientID string `json:"_clientId"` + ExpiresOn string `json:"expiresOn"` + IdentityProvider string `json:"identityProvider"` + IsMRRT bool `json:"isMRRT"` + RefreshToken string `json:"refreshToken"` + Resource string `json:"resource"` + TokenType string `json:"tokenType"` + UserID string `json:"userId"` }{} err := json.Unmarshal(tk, &t) if err != nil { return azcore.AccessToken{}, err } - exp := time.Unix(t.Expires_On, 0) - if t.Expires_On == 0 { - exp, err = time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local) - if err != nil { - return azcore.AccessToken{}, fmt.Errorf("%s: error parsing token expiration time %q: %v", credNameAzureCLI, t.ExpiresOn, err) - } + // the Azure CLI's "expiresOn" is local time + exp, err := time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local) + if err != nil { + return azcore.AccessToken{}, fmt.Errorf("Error parsing token expiration time %q: %v", t.ExpiresOn, err) } converted := azcore.AccessToken{ diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go deleted file mode 100644 index 2655543aee6..00000000000 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const ( - credNameAzurePipelines = "AzurePipelinesCredential" - oidcAPIVersion = "7.1" - systemAccessToken = "SYSTEM_ACCESSTOKEN" - systemOIDCRequestURI = "SYSTEM_OIDCREQUESTURI" -) - -// azurePipelinesCredential authenticates with workload identity federation in an Azure Pipeline. See -// [Azure Pipelines documentation] for more information. -// -// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-that-uses-workload-identity-federation -type azurePipelinesCredential struct { - connectionID, oidcURI, systemAccessToken string - cred *ClientAssertionCredential -} - -// azurePipelinesCredentialOptions contains optional parameters for AzurePipelinesCredential. -type azurePipelinesCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool -} - -// newAzurePipelinesCredential is the constructor for AzurePipelinesCredential. In addition to its required arguments, -// it reads a security token for the running build, which is required to authenticate the service connection, from the -// environment variable SYSTEM_ACCESSTOKEN. See the [Azure Pipelines documentation] for an example showing how to set -// this variable in build job YAML. -// -// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken -func newAzurePipelinesCredential(tenantID, clientID, serviceConnectionID string, options *azurePipelinesCredentialOptions) (*azurePipelinesCredential, error) { - if options == nil { - options = &azurePipelinesCredentialOptions{} - } - u := os.Getenv(systemOIDCRequestURI) - if u == "" { - return nil, fmt.Errorf("no value for environment variable %s. This should be set by Azure Pipelines", systemOIDCRequestURI) - } - sat := os.Getenv(systemAccessToken) - if sat == "" { - return nil, errors.New("no value for environment variable " + systemAccessToken) - } - a := azurePipelinesCredential{ - connectionID: serviceConnectionID, - oidcURI: u, - systemAccessToken: sat, - } - caco := ClientAssertionCredentialOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - cred, err := NewClientAssertionCredential(tenantID, clientID, a.getAssertion, &caco) - if err != nil { - return nil, err - } - cred.client.name = credNameAzurePipelines - a.cred = cred - return &a, nil -} - -// GetToken requests an access token from Microsoft Entra ID. Azure SDK clients call this method automatically. -func (a *azurePipelinesCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameAzurePipelines+"."+traceOpGetToken, a.cred.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := a.cred.GetToken(ctx, opts) - return tk, err -} - -func (a *azurePipelinesCredential) getAssertion(ctx context.Context) (string, error) { - url := a.oidcURI + "?api-version=" + oidcAPIVersion + "&serviceConnectionId=" + a.connectionID - url, err := runtime.EncodeQueryParams(url) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't encode OIDC URL: "+err.Error(), nil, nil) - } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, nil) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't create OIDC token request: "+err.Error(), nil, nil) - } - req.Header.Set("Authorization", "Bearer "+a.systemAccessToken) - res, err := doForClient(a.cred.client.azClient, req) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't send OIDC token request: "+err.Error(), nil, nil) - } - if res.StatusCode != http.StatusOK { - msg := res.Status + " response from the OIDC endpoint. Check service connection ID and Pipeline configuration" - // include the response because its body, if any, probably contains an error message. - // OK responses aren't included with errors because they probably contain secrets - return "", newAuthenticationFailedError(credNameAzurePipelines, msg, res, nil) - } - b, err := runtime.Payload(res) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't read OIDC response content: "+err.Error(), nil, nil) - } - var r struct { - OIDCToken string `json:"oidcToken"` - } - err = json.Unmarshal(b, &r) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "unexpected response from OIDC endpoint", nil, nil) - } - return r.OIDCToken, nil -} diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go index 6c35a941b97..dc855edf786 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go @@ -86,7 +86,7 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token errs []error successfulCredential azcore.TokenCredential token azcore.AccessToken - unavailableErr credentialUnavailable + unavailableErr *credentialUnavailableError ) for _, cred := range c.sources { token, err = cred.GetToken(ctx, opts) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml index 4cd8c514473..d077682c5c2 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml @@ -8,7 +8,7 @@ trigger: - release/* paths: include: - - sdk/azidentity/ + - sdk/azidentity/ pr: branches: @@ -19,28 +19,17 @@ pr: - release/* paths: include: - - sdk/azidentity/ + - sdk/azidentity/ -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-identity-test-resources) - EnvVars: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - RunLiveTests: true - ServiceDirectory: azidentity - UsePipelineProxy: false - - ${{ if endsWith(variables['Build.DefinitionName'], 'weekly') }}: - MatrixConfigs: - - Name: managed_identity_matrix - GenerateVMJobs: true - Path: sdk/azidentity/managed-identity-matrix.json - Selection: sparse - MatrixReplace: - - Pool=.*LINUXPOOL.*/azsdk-pool-mms-ubuntu-2204-identitymsi - - OSVmImage=.*LINUXNEXTVMIMAGE.*/azsdk-pool-mms-ubuntu-2204-1espt +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + RunLiveTests: true + UsePipelineProxy: false + ServiceDirectory: 'azidentity' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + # Contains alternate tenant, AAD app and cert info for testing + - $(sub-config-identity-test-resources) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go index b588750ef33..fc3df68eb19 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go @@ -23,7 +23,7 @@ const credNameAssertion = "ClientAssertionCredential" // the most common assertion scenario, authenticating a service principal with a certificate. See // [Microsoft Entra ID documentation] for details of the assertion format. // -// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/certificate-credentials#assertion-format +// [Microsoft Entra ID documentation]: https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials#assertion-format type ClientAssertionCredential struct { client *confidentialClient } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go index 80cd96b560f..607533f486e 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go @@ -51,8 +51,7 @@ type ClientCertificateCredential struct { client *confidentialClient } -// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults. See -// [ParseCertificates] for help loading a certificate. +// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults. func NewClientCertificateCredential(tenantID string, clientID string, certs []*x509.Certificate, key crypto.PrivateKey, options *ClientCertificateCredentialOptions) (*ClientCertificateCredential, error) { if len(certs) == 0 { return nil, errors.New("at least one certificate is required") @@ -87,10 +86,8 @@ func (c *ClientCertificateCredential) GetToken(ctx context.Context, opts policy. return tk, err } -// ParseCertificates loads certificates and a private key, in PEM or PKCS#12 format, for use with [NewClientCertificateCredential]. -// Pass nil for password if the private key isn't encrypted. This function has limitations, for example it can't decrypt keys in -// PEM format or PKCS#12 certificates that use SHA256 for message authentication. If you encounter such limitations, consider -// using another module to load the certificate and private key. +// ParseCertificates loads certificates and a private key, in PEM or PKCS12 format, for use with NewClientCertificateCredential. +// Pass nil for password if the private key isn't encrypted. This function can't decrypt keys in PEM format. func ParseCertificates(certData []byte, password []byte) ([]*x509.Certificate, crypto.PrivateKey, error) { var blocks []*pem.Block var err error diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go index 3bd08c685fb..854267bdbfd 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go @@ -91,7 +91,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque } tro.TenantID = tenant } - client, mu, err := c.client(tro) + client, mu, err := c.client(ctx, tro) if err != nil { return azcore.AccessToken{}, err } @@ -109,7 +109,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque if err != nil { // We could get a credentialUnavailableError from managed identity authentication because in that case the error comes from our code. // We return it directly because it affects the behavior of credential chains. Otherwise, we return AuthenticationFailedError. - var unavailableErr credentialUnavailable + var unavailableErr *credentialUnavailableError if !errors.As(err, &unavailableErr) { res := getResponseFromError(err) err = newAuthenticationFailedError(c.name, err.Error(), res, err) @@ -121,7 +121,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err } -func (c *confidentialClient) client(tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) { +func (c *confidentialClient) client(ctx context.Context, tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) { c.clientMu.Lock() defer c.clientMu.Unlock() if tro.EnableCAE { diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go index 551d3199462..35aeef86747 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go @@ -8,8 +8,10 @@ package azidentity import ( "context" + "errors" "os" "strings" + "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" @@ -96,13 +98,13 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default creds = append(creds, &defaultCredentialErrorReporter{credType: credNameWorkloadIdentity, err: err}) } - o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions, dac: true} + o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions} if ID, ok := os.LookupEnv(azureClientID); ok { o.ID = ClientID(ID) } miCred, err := NewManagedIdentityCredential(o) if err == nil { - creds = append(creds, miCred) + creds = append(creds, &timeoutWrapper{mic: miCred, timeout: time.Second}) } else { errorMessages = append(errorMessages, credNameManagedIdentity+": "+err.Error()) creds = append(creds, &defaultCredentialErrorReporter{credType: credNameManagedIdentity, err: err}) @@ -156,10 +158,51 @@ type defaultCredentialErrorReporter struct { } func (d *defaultCredentialErrorReporter) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - if _, ok := d.err.(credentialUnavailable); ok { + if _, ok := d.err.(*credentialUnavailableError); ok { return azcore.AccessToken{}, d.err } return azcore.AccessToken{}, newCredentialUnavailableError(d.credType, d.err.Error()) } var _ azcore.TokenCredential = (*defaultCredentialErrorReporter)(nil) + +// timeoutWrapper prevents a potentially very long timeout when managed identity isn't available +type timeoutWrapper struct { + mic *ManagedIdentityCredential + // timeout applies to all auth attempts until one doesn't time out + timeout time.Duration +} + +// GetToken wraps DefaultAzureCredential's initial managed identity auth attempt with a short timeout +// because managed identity may not be available and connecting to IMDS can take several minutes to time out. +func (w *timeoutWrapper) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { + var tk azcore.AccessToken + var err error + // no need to synchronize around this value because it's written only within ChainedTokenCredential's critical section + if w.timeout > 0 { + c, cancel := context.WithTimeout(ctx, w.timeout) + defer cancel() + tk, err = w.mic.GetToken(c, opts) + if isAuthFailedDueToContext(err) { + err = newCredentialUnavailableError(credNameManagedIdentity, "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information") + } else { + // some managed identity implementation is available, so don't apply the timeout to future calls + w.timeout = 0 + } + } else { + tk, err = w.mic.GetToken(ctx, opts) + } + return tk, err +} + +// unwraps nested AuthenticationFailedErrors to get the root error +func isAuthFailedDueToContext(err error) bool { + for { + var authFailedErr *AuthenticationFailedError + if !errors.As(err, &authFailedErr) { + break + } + err = authFailedErr.err + } + return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) +} diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go index be963d3a2af..d8b952f532e 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go @@ -19,7 +19,7 @@ const cliTimeout = 10 * time.Second // the next credential in its chain (another developer credential). func unavailableIfInChain(err error, inDefaultChain bool) error { if err != nil && inDefaultChain { - var unavailableErr credentialUnavailable + var unavailableErr *credentialUnavailableError if !errors.As(err, &unavailableErr) { err = newCredentialUnavailableError(credNameAzureDeveloperCLI, err.Error()) } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go index cd30bedd5e9..1b7a283703a 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go @@ -34,8 +34,8 @@ type DeviceCodeCredentialOptions struct { ClientID string // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate. - // When this option is true, GetToken will return authenticationRequiredError when user interaction is necessary - // to acquire a token. + // When this option is true, [DeviceCodeCredential.GetToken] will return [ErrAuthenticationRequired] when user + // interaction is necessary to acquire a token. disableAutomaticAuthentication bool // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go index b30f5474f55..42f84875e23 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go @@ -57,9 +57,6 @@ type EnvironmentCredentialOptions struct { // // AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file. // -// Note that this credential uses [ParseCertificates] to load the certificate and key from the file. If this -// function isn't able to parse your certificate, use [ClientCertificateCredential] instead. -// // # User with username and password // // AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations". @@ -124,7 +121,7 @@ func NewEnvironmentCredential(options *EnvironmentCredentialOptions) (*Environme } certs, key, err := ParseCertificates(certData, password) if err != nil { - return nil, fmt.Errorf("failed to parse %q due to error %q. This may be due to a limitation of this module's certificate loader. Consider calling NewClientCertificateCredential instead", certPath, err.Error()) + return nil, fmt.Errorf(`failed to load certificate from "%s": %v`, certPath, err) } o := &ClientCertificateCredentialOptions{ AdditionallyAllowedTenants: additionalTenants, diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go index 698650bbb62..335d2b7dcf2 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go @@ -13,12 +13,15 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo" msal "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors" ) +// errAuthenticationRequired indicates a credential's Authenticate method must be called to acquire a token +// because user interaction is required and the credential is configured not to automatically prompt the user. +var errAuthenticationRequired error = &credentialUnavailableError{"can't acquire a token without user interaction. Call Authenticate to interactively authenticate a user"} + // getResponseFromError retrieves the response carried by // an AuthenticationFailedError or MSAL CallErr, if any func getResponseFromError(err error) *http.Response { @@ -53,7 +56,7 @@ func (e *AuthenticationFailedError) Error() string { return e.credType + ": " + e.message } msg := &bytes.Buffer{} - fmt.Fprintf(msg, "%s authentication failed. %s\n", e.credType, e.message) + fmt.Fprintf(msg, e.credType+" authentication failed\n") if e.RawResponse.Request != nil { fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path) } else { @@ -107,34 +110,8 @@ func (*AuthenticationFailedError) NonRetriable() { var _ errorinfo.NonRetriable = (*AuthenticationFailedError)(nil) -// authenticationRequiredError indicates a credential's Authenticate method must be called to acquire a token -// because the credential requires user interaction and is configured not to request it automatically. -type authenticationRequiredError struct { - credentialUnavailableError - - // TokenRequestOptions for the required token. Pass this to the credential's Authenticate method. - TokenRequestOptions policy.TokenRequestOptions -} - -func newauthenticationRequiredError(credType string, tro policy.TokenRequestOptions) error { - return &authenticationRequiredError{ - credentialUnavailableError: credentialUnavailableError{ - credType + " can't acquire a token without user interaction. Call Authenticate to authenticate a user interactively", - }, - TokenRequestOptions: tro, - } -} - -var ( - _ credentialUnavailable = (*authenticationRequiredError)(nil) - _ errorinfo.NonRetriable = (*authenticationRequiredError)(nil) -) - -type credentialUnavailable interface { - error - credentialUnavailable() -} - +// credentialUnavailableError indicates a credential can't attempt authentication because it lacks required +// data or state type credentialUnavailableError struct { message string } @@ -158,11 +135,6 @@ func (e *credentialUnavailableError) Error() string { } // NonRetriable is a marker method indicating this error should not be retried. It has no implementation. -func (*credentialUnavailableError) NonRetriable() {} - -func (*credentialUnavailableError) credentialUnavailable() {} +func (e *credentialUnavailableError) NonRetriable() {} -var ( - _ credentialUnavailable = (*credentialUnavailableError)(nil) - _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil) -) +var _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum index c592f283b6b..7cd86b0019e 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum @@ -3,40 +3,26 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0-beta.1/go.mod h1:3Ug6Qzto9an github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/dbus v0.0.0-20220506165403-5aa21ea2c23a/go.mod h1:YPNKjjE7Ubp9dTbnWvsP3HT+hYnY6TfXzubYTBeUxc8= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -47,14 +33,7 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go index 056785a8a33..bd829698375 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go @@ -33,8 +33,8 @@ type InteractiveBrowserCredentialOptions struct { ClientID string // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate. - // When this option is true, GetToken will return authenticationRequiredError when user interaction is necessary - // to acquire a token. + // When this option is true, [InteractiveBrowserCredential.GetToken] will return [ErrAuthenticationRequired] when + // user interaction is necessary to acquire a token. disableAutomaticAuthentication bool // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json deleted file mode 100644 index 1c3791777a1..00000000000 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "include": [ - { - "Agent": { - "msi_image": { - "ArmTemplateParameters": "@{deployResources = $true}", - "OSVmImage": "env:LINUXNEXTVMIMAGE", - "Pool": "env:LINUXPOOL" - } - }, - "GoVersion": [ - "1.22.1" - ], - "IDENTITY_IMDS_AVAILABLE": "1" - } - ] -} diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go index 6122cc70050..7c25cb8bdd5 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go @@ -14,15 +14,13 @@ import ( "net/http" "net/url" "os" - "path/filepath" - "runtime" "strconv" "strings" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" "github.com/Azure/azure-sdk-for-go/sdk/internal/log" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" @@ -36,17 +34,15 @@ const ( identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT" headerMetadata = "Metadata" imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" - miResID = "mi_res_id" msiEndpoint = "MSI_ENDPOINT" - msiResID = "msi_res_id" msiSecret = "MSI_SECRET" imdsAPIVersion = "2018-02-01" azureArcAPIVersion = "2019-08-15" - qpClientID = "client_id" serviceFabricAPIVersion = "2019-07-01-preview" -) -var imdsProbeTimeout = time.Second + qpClientID = "client_id" + qpResID = "mi_res_id" +) type msiType int @@ -59,28 +55,13 @@ const ( msiTypeServiceFabric ) +// managedIdentityClient provides the base for authenticating in managed identity environments +// This type includes an runtime.Pipeline and TokenCredentialOptions. type managedIdentityClient struct { - azClient *azcore.Client - endpoint string - id ManagedIDKind - msiType msiType - probeIMDS bool -} - -// arcKeyDirectory returns the directory expected to contain Azure Arc keys -var arcKeyDirectory = func() (string, error) { - switch runtime.GOOS { - case "linux": - return "/var/opt/azcmagent/tokens", nil - case "windows": - pd := os.Getenv("ProgramData") - if pd == "" { - return "", errors.New("environment variable ProgramData has no value") - } - return filepath.Join(pd, "AzureConnectedMachineAgent", "Tokens"), nil - default: - return "", fmt.Errorf("unsupported OS %q", runtime.GOOS) - } + azClient *azcore.Client + msiType msiType + endpoint string + id ManagedIDKind } type wrappedNumber json.Number @@ -107,7 +88,7 @@ func setIMDSRetryOptionDefaults(o *policy.RetryOptions) { if o.StatusCodes == nil { o.StatusCodes = []int{ // IMDS docs recommend retrying 404, 410, 429 and 5xx - // https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token#error-handling + // https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#error-handling http.StatusNotFound, // 404 http.StatusGone, // 410 http.StatusTooManyRequests, // 429 @@ -166,12 +147,11 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag c.msiType = msiTypeCloudShell } } else { - c.probeIMDS = options.dac setIMDSRetryOptionDefaults(&cp.Retry) } - client, err := azcore.NewClient(module, version, azruntime.PipelineOptions{ - Tracing: azruntime.TracingOptions{ + client, err := azcore.NewClient(module, version, runtime.PipelineOptions{ + Tracing: runtime.TracingOptions{ Namespace: traceNamespace, }, }, &cp) @@ -200,27 +180,6 @@ func (c *managedIdentityClient) provideToken(ctx context.Context, params confide // authenticate acquires an access token func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) { - // no need to synchronize around this value because it's true only when DefaultAzureCredential constructed the client, - // and in that case ChainedTokenCredential.GetToken synchronizes goroutines that would execute this block - if c.probeIMDS { - cx, cancel := context.WithTimeout(ctx, imdsProbeTimeout) - defer cancel() - cx = policy.WithRetryOptions(cx, policy.RetryOptions{MaxRetries: -1}) - req, err := azruntime.NewRequest(cx, http.MethodGet, c.endpoint) - if err == nil { - _, err = c.azClient.Pipeline().Do(req) - } - if err != nil { - msg := err.Error() - if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { - msg = "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information" - } - return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg) - } - // send normal token requests from now on because something responded - c.probeIMDS = false - } - msg, err := c.createAuthRequest(ctx, id, scopes) if err != nil { return azcore.AccessToken{}, err @@ -231,7 +190,7 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil, err) } - if azruntime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + if runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return c.createAccessToken(resp) } @@ -242,15 +201,15 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp, nil) } msg := "failed to authenticate a system assigned identity" - if body, err := azruntime.Payload(resp); err == nil && len(body) > 0 { + if body, err := runtime.Payload(resp); err == nil && len(body) > 0 { msg += fmt.Sprintf(". The endpoint responded with %s", body) } return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg) case http.StatusForbidden: // Docker Desktop runs a proxy that responds 403 to IMDS token requests. If we get that response, // we return credentialUnavailableError so credential chains continue to their next credential - body, err := azruntime.Payload(resp) - if err == nil && strings.Contains(string(body), "unreachable") { + body, err := runtime.Payload(resp) + if err == nil && strings.Contains(string(body), "A socket operation was attempted to an unreachable network") { return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("unexpected response %q", string(body))) } } @@ -267,7 +226,7 @@ func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.Ac ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string }{} - if err := azruntime.UnmarshalAsJSON(res, &value); err != nil { + if err := runtime.UnmarshalAsJSON(res, &value); err != nil { return azcore.AccessToken{}, fmt.Errorf("internal AccessToken: %v", err) } if value.ExpiresIn != "" { @@ -317,7 +276,7 @@ func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id Manage } func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return nil, err } @@ -327,7 +286,7 @@ func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id Ma q.Add("resource", strings.Join(scopes, " ")) if id != nil { if id.idKind() == miResourceID { - q.Add(msiResID, id.String()) + q.Add(qpResID, id.String()) } else { q.Add(qpClientID, id.String()) } @@ -337,7 +296,7 @@ func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id Ma } func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return nil, err } @@ -347,7 +306,7 @@ func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, q.Add("resource", scopes[0]) if id != nil { if id.idKind() == miResourceID { - q.Add(miResID, id.String()) + q.Add(qpResID, id.String()) } else { q.Add(qpClientID, id.String()) } @@ -357,7 +316,7 @@ func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, } func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return nil, err } @@ -370,7 +329,7 @@ func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id if id.idKind() == miResourceID { log.Write(EventAuthentication, "WARNING: Azure ML doesn't support specifying a managed identity by resource ID") q.Set("clientid", "") - q.Set(miResID, id.String()) + q.Set(qpResID, id.String()) } else { q.Set("clientid", id.String()) } @@ -380,7 +339,7 @@ func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id } func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return nil, err } @@ -392,7 +351,7 @@ func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Conte if id != nil { log.Write(EventAuthentication, "WARNING: Service Fabric doesn't support selecting a user-assigned identity at runtime") if id.idKind() == miResourceID { - q.Add(miResID, id.String()) + q.Add(qpResID, id.String()) } else { q.Add(qpClientID, id.String()) } @@ -403,7 +362,7 @@ func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Conte func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) { // create the request to retreive the secret key challenge provided by the HIMDS service - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return "", err } @@ -425,36 +384,22 @@ func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resour } header := response.Header.Get("WWW-Authenticate") if len(header) == 0 { - return "", newAuthenticationFailedError(credNameManagedIdentity, "HIMDS response has no WWW-Authenticate header", nil, nil) + return "", errors.New("did not receive a value from WWW-Authenticate header") } // the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key - _, p, found := strings.Cut(header, "=") - if !found { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected WWW-Authenticate header from HIMDS: "+header, nil, nil) - } - expected, err := arcKeyDirectory() - if err != nil { - return "", err - } - if filepath.Dir(p) != expected || !strings.HasSuffix(p, ".key") { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected file path from HIMDS service: "+p, nil, nil) - } - f, err := os.Stat(p) - if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not stat %q: %v", p, err), nil, nil) - } - if s := f.Size(); s > 4096 { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("key is too large (%d bytes)", s), nil, nil) + pos := strings.LastIndex(header, "=") + if pos == -1 { + return "", fmt.Errorf("did not receive a correct value from WWW-Authenticate header: %s", header) } - key, err := os.ReadFile(p) + key, err := os.ReadFile(header[pos+1:]) if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not read %q: %v", p, err), nil, nil) + return "", fmt.Errorf("could not read file (%s) contents: %v", header[pos+1:], err) } return string(key), nil } func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, id ManagedIDKind, resources []string, key string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint) if err != nil { return nil, err } @@ -466,7 +411,7 @@ func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, i if id != nil { log.Write(EventAuthentication, "WARNING: Azure Arc doesn't support user-assigned managed identities") if id.idKind() == miResourceID { - q.Add(miResID, id.String()) + q.Add(qpResID, id.String()) } else { q.Add(qpClientID, id.String()) } @@ -476,7 +421,7 @@ func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, i } func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodPost, c.endpoint) + request, err := runtime.NewRequest(ctx, http.MethodPost, c.endpoint) if err != nil { return nil, err } @@ -492,7 +437,7 @@ func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, log.Write(EventAuthentication, "WARNING: Cloud Shell doesn't support user-assigned managed identities") q := request.Raw().URL.Query() if id.idKind() == miResourceID { - q.Add(miResID, id.String()) + q.Add(qpResID, id.String()) } else { q.Add(qpClientID, id.String()) } diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go index 13c043d8e0c..dcd278befa1 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go @@ -64,19 +64,12 @@ type ManagedIdentityCredentialOptions struct { // instead of the hosting environment's default. The value may be the identity's client ID or resource ID, but note that // some platforms don't accept resource IDs. ID ManagedIDKind - - // dac indicates whether the credential is part of DefaultAzureCredential. When true, and the environment doesn't have - // configuration for a specific managed identity API, the credential tries to determine whether IMDS is available before - // sending its first token request. It does this by sending a malformed request with a short timeout. Any response to that - // request is taken to mean IMDS is available, in which case the credential will send ordinary token requests thereafter - // with no special timeout. The purpose of this behavior is to prevent a very long timeout when IMDS isn't available. - dac bool } // ManagedIdentityCredential authenticates an Azure managed identity in any hosting environment supporting managed identities. // This credential authenticates a system-assigned identity by default. Use ManagedIdentityCredentialOptions.ID to specify a // user-assigned identity. See Microsoft Entra ID documentation for more information about managed identities: -// https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview +// https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview type ManagedIdentityCredential struct { client *confidentialClient mic *managedIdentityClient diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go index 9dcc82f013b..5e67cf02145 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go @@ -10,7 +10,6 @@ import ( "context" "crypto" "crypto/x509" - "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" @@ -25,7 +24,7 @@ const credNameOBO = "OnBehalfOfCredential" // is not an interactive authentication flow, an application using it must have admin consent for any delegated // permissions before requesting tokens for them. See [Microsoft Entra ID documentation] for more details. // -// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow +// [Microsoft Entra ID documentation]: https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow type OnBehalfOfCredential struct { client *confidentialClient } @@ -61,19 +60,6 @@ func NewOnBehalfOfCredentialWithCertificate(tenantID, clientID, userAssertion st return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options) } -// NewOnBehalfOfCredentialWithClientAssertions constructs an OnBehalfOfCredential that authenticates with client assertions. -// userAssertion is the user's access token for the application. The getAssertion function should return client assertions -// that authenticate the application to Microsoft Entra ID, such as federated credentials. -func NewOnBehalfOfCredentialWithClientAssertions(tenantID, clientID, userAssertion string, getAssertion func(context.Context) (string, error), options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { - if getAssertion == nil { - return nil, errors.New("getAssertion can't be nil. It must be a function that returns client assertions") - } - cred := confidential.NewCredFromAssertionCallback(func(ctx context.Context, _ confidential.AssertionRequestOptions) (string, error) { - return getAssertion(ctx) - }) - return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options) -} - // NewOnBehalfOfCredentialWithSecret constructs an OnBehalfOfCredential that authenticates with a client secret. func NewOnBehalfOfCredentialWithSecret(tenantID, clientID, userAssertion, clientSecret string, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { cred, err := confidential.NewCredFromSecret(clientSecret) diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go index b3d22dbf3ce..63c31190d18 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go @@ -152,7 +152,7 @@ func (p *publicClient) GetToken(ctx context.Context, tro policy.TokenRequestOpti return p.token(ar, err) } if p.opts.DisableAutomaticAuthentication { - return azcore.AccessToken{}, newauthenticationRequiredError(p.name, tro) + return azcore.AccessToken{}, errAuthenticationRequired } at, err := p.reqToken(ctx, client, tro) if err == nil { diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 deleted file mode 100644 index a69bbce34c4..00000000000 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root. - -param ( - [hashtable] $AdditionalParameters = @{}, - [hashtable] $DeploymentOutputs -) - -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -if ($CI) { - if (!$AdditionalParameters['deployResources']) { - Write-Host "Skipping post-provisioning script because resources weren't deployed" - return - } - az login --service-principal -u $DeploymentOutputs['AZIDENTITY_CLIENT_ID'] -p $DeploymentOutputs['AZIDENTITY_CLIENT_SECRET'] --tenant $DeploymentOutputs['AZIDENTITY_TENANT_ID'] - az account set --subscription $DeploymentOutputs['AZIDENTITY_SUBSCRIPTION_ID'] -} - -Write-Host "Building container" -$image = "$($DeploymentOutputs['AZIDENTITY_ACR_LOGIN_SERVER'])/azidentity-managed-id-test" -Set-Content -Path "$PSScriptRoot/Dockerfile" -Value @" -FROM mcr.microsoft.com/oss/go/microsoft/golang:latest as builder -ENV GOARCH=amd64 GOWORK=off -COPY . /azidentity -WORKDIR /azidentity/testdata/managed-id-test -RUN go mod tidy -RUN go build -o /build/managed-id-test . -RUN GOOS=windows go build -o /build/managed-id-test.exe . - -FROM mcr.microsoft.com/mirror/docker/library/alpine:3.16 -RUN apk add gcompat -COPY --from=builder /build/* . -RUN chmod +x managed-id-test -CMD ["./managed-id-test"] -"@ -# build from sdk/azidentity because we need that dir in the context (because the test app uses local azidentity) -docker build -t $image "$PSScriptRoot" -az acr login -n $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -docker push $image - -$rg = $DeploymentOutputs['AZIDENTITY_RESOURCE_GROUP'] - -# ACI is easier to provision here than in the bicep file because the image isn't available before now -Write-Host "Deploying Azure Container Instance" -$aciName = "azidentity-test" -az container create -g $rg -n $aciName --image $image ` - --acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - --assign-identity [system] $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - --role "Storage Blob Data Reader" ` - --scope $($DeploymentOutputs['AZIDENTITY_STORAGE_ID']) ` - -e AZIDENTITY_STORAGE_NAME=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME']) ` - AZIDENTITY_STORAGE_NAME_USER_ASSIGNED=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) ` - AZIDENTITY_USER_ASSIGNED_IDENTITY=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - FUNCTIONS_CUSTOMHANDLER_PORT=80 -Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName" - -# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip -Write-Host "Deploying to Azure Functions" -$container = docker create $image -docker cp ${container}:managed-id-test.exe "$PSScriptRoot/testdata/managed-id-test/" -docker rm -v $container -Compress-Archive -Path "$PSScriptRoot/testdata/managed-id-test/*" -DestinationPath func.zip -Force -az functionapp deploy -g $rg -n $DeploymentOutputs['AZIDENTITY_FUNCTION_NAME'] --src-path func.zip --type zip - -Write-Host "Creating federated identity" -$aksName = $DeploymentOutputs['AZIDENTITY_AKS_NAME'] -$idName = $DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME'] -$issuer = az aks show -g $rg -n $aksName --query "oidcIssuerProfile.issuerUrl" -otsv -$podName = "azidentity-test" -$serviceAccountName = "workload-identity-sa" -az identity federated-credential create -g $rg --identity-name $idName --issuer $issuer --name $idName --subject system:serviceaccount:default:$serviceAccountName -Write-Host "Deploying to AKS" -az aks get-credentials -g $rg -n $aksName -az aks update --attach-acr $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -g $rg -n $aksName -Set-Content -Path "$PSScriptRoot/k8s.yaml" -Value @" -apiVersion: v1 -kind: ServiceAccount -metadata: - annotations: - azure.workload.identity/client-id: $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) - name: $serviceAccountName - namespace: default ---- -apiVersion: v1 -kind: Pod -metadata: - name: $podName - namespace: default - labels: - app: $podName - azure.workload.identity/use: "true" -spec: - serviceAccountName: $serviceAccountName - containers: - - name: $podName - image: $image - env: - - name: AZIDENTITY_STORAGE_NAME - value: $($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) - - name: AZIDENTITY_USE_WORKLOAD_IDENTITY - value: "true" - - name: FUNCTIONS_CUSTOMHANDLER_PORT - value: "80" - nodeSelector: - kubernetes.io/os: linux -"@ -kubectl apply -f "$PSScriptRoot/k8s.yaml" -Write-Host "##vso[task.setvariable variable=AZIDENTITY_POD_NAME;]$podName" diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 index 58766d0a022..fe0183addeb 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 @@ -1,44 +1,36 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root. - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( - [hashtable] $AdditionalParameters = @{}, - # Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors). [Parameter(ValueFromRemainingArguments = $true)] $RemainingArguments ) -if (-not (Test-Path "$PSScriptRoot/sshkey.pub")) { - ssh-keygen -t rsa -b 4096 -f "$PSScriptRoot/sshkey" -N '' -C '' -} -$templateFileParameters['sshPubKey'] = Get-Content "$PSScriptRoot/sshkey.pub" - if (!$CI) { # TODO: Remove this once auto-cloud config downloads are supported locally Write-Host "Skipping cert setup in local testing mode" return } -if ($null -eq $EnvironmentVariables -or $EnvironmentVariables.Count -eq 0) { +if ($EnvironmentVariables -eq $null -or $EnvironmentVariables.Count -eq 0) { throw "EnvironmentVariables must be set in the calling script New-TestResources.ps1" } $tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath() $pfxPath = Join-Path $tmp "test.pfx" $pemPath = Join-Path $tmp "test.pem" +$sniPath = Join-Path $tmp "testsni.pfx" -Write-Host "Creating identity test files: $pfxPath $pemPath" +Write-Host "Creating identity test files: $pfxPath $pemPath $sniPath" [System.Convert]::FromBase64String($EnvironmentVariables['PFX_CONTENTS']) | Set-Content -Path $pfxPath -AsByteStream Set-Content -Path $pemPath -Value $EnvironmentVariables['PEM_CONTENTS'] +[System.Convert]::FromBase64String($EnvironmentVariables['SNI_CONTENTS']) | Set-Content -Path $sniPath -AsByteStream # Set for pipeline Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PFX;]$pfxPath" Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PEM;]$pemPath" +Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_SNI;]$sniPath" # Set for local $env:IDENTITY_SP_CERT_PFX = $pfxPath $env:IDENTITY_SP_CERT_PEM = $pemPath +$env:IDENTITY_SP_CERT_SNI = $sniPath diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep index 2a216529309..b3490d3b50a 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep @@ -1,219 +1 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -@description('Kubernetes cluster admin user name.') -param adminUser string = 'azureuser' - -@minLength(6) -@maxLength(23) -@description('The base resource name.') -param baseName string = resourceGroup().name - -@description('Whether to deploy resources. When set to false, this file deploys nothing.') -param deployResources bool = false - -param sshPubKey string = '' - -@description('The location of the resource. By default, this is the same as the resource group.') -param location string = resourceGroup().location - -// https://learn.microsoft.com/azure/role-based-access-control/built-in-roles -var acrPull = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') -var blobReader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1') - -resource sa 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) { - kind: 'StorageV2' - location: location - name: 'sa${uniqueString(baseName)}' - properties: { - accessTier: 'Hot' - } - sku: { - name: 'Standard_LRS' - } -} - -resource saUserAssigned 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) { - kind: 'StorageV2' - location: location - name: 'sa2${uniqueString(baseName)}' - properties: { - accessTier: 'Hot' - } - sku: { - name: 'Standard_LRS' - } -} - -resource usermgdid 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = if (deployResources) { - location: location - name: baseName -} - -resource acrPullContainerInstance 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - name: guid(resourceGroup().id, acrPull, 'containerInstance') - properties: { - principalId: deployResources ? usermgdid.properties.principalId : '' - principalType: 'ServicePrincipal' - roleDefinitionId: acrPull - } - scope: containerRegistry -} - -resource blobRoleUserAssigned 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - scope: saUserAssigned - name: guid(resourceGroup().id, blobReader, usermgdid.id) - properties: { - principalId: deployResources ? usermgdid.properties.principalId : '' - principalType: 'ServicePrincipal' - roleDefinitionId: blobReader - } -} - -resource blobRoleFunc 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - name: guid(resourceGroup().id, blobReader, 'azfunc') - properties: { - principalId: deployResources ? azfunc.identity.principalId : '' - roleDefinitionId: blobReader - principalType: 'ServicePrincipal' - } - scope: sa -} - -resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = if (deployResources) { - location: location - name: uniqueString(resourceGroup().id) - properties: { - adminUserEnabled: true - } - sku: { - name: 'Basic' - } -} - -resource farm 'Microsoft.Web/serverfarms@2021-03-01' = if (deployResources) { - kind: 'app' - location: location - name: '${baseName}_asp' - properties: {} - sku: { - capacity: 1 - family: 'B' - name: 'B1' - size: 'B1' - tier: 'Basic' - } -} - -resource azfunc 'Microsoft.Web/sites@2021-03-01' = if (deployResources) { - identity: { - type: 'SystemAssigned, UserAssigned' - userAssignedIdentities: { - '${deployResources ? usermgdid.id : ''}': {} - } - } - kind: 'functionapp' - location: location - name: '${baseName}func' - properties: { - enabled: true - httpsOnly: true - keyVaultReferenceIdentity: 'SystemAssigned' - serverFarmId: farm.id - siteConfig: { - alwaysOn: true - appSettings: [ - { - name: 'AZIDENTITY_STORAGE_NAME' - value: deployResources ? sa.name : null - } - { - name: 'AZIDENTITY_STORAGE_NAME_USER_ASSIGNED' - value: deployResources ? saUserAssigned.name : null - } - { - name: 'AZIDENTITY_USER_ASSIGNED_IDENTITY' - value: deployResources ? usermgdid.id : null - } - { - name: 'AzureWebJobsStorage' - value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}' - } - { - name: 'FUNCTIONS_EXTENSION_VERSION' - value: '~4' - } - { - name: 'FUNCTIONS_WORKER_RUNTIME' - value: 'custom' - } - { - name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' - value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}' - } - { - name: 'WEBSITE_CONTENTSHARE' - value: toLower('${baseName}-func') - } - ] - http20Enabled: true - minTlsVersion: '1.2' - } - } -} - -resource aks 'Microsoft.ContainerService/managedClusters@2023-06-01' = if (deployResources) { - name: baseName - location: location - identity: { - type: 'SystemAssigned' - } - properties: { - agentPoolProfiles: [ - { - count: 1 - enableAutoScaling: false - kubeletDiskType: 'OS' - mode: 'System' - name: 'agentpool' - osDiskSizeGB: 128 - osDiskType: 'Managed' - osSKU: 'Ubuntu' - osType: 'Linux' - type: 'VirtualMachineScaleSets' - vmSize: 'Standard_D2s_v3' - } - ] - dnsPrefix: 'identitytest' - enableRBAC: true - linuxProfile: { - adminUsername: adminUser - ssh: { - publicKeys: [ - { - keyData: sshPubKey - } - ] - } - } - oidcIssuerProfile: { - enabled: true - } - securityProfile: { - workloadIdentity: { - enabled: true - } - } - } -} - -output AZIDENTITY_ACR_LOGIN_SERVER string = deployResources ? containerRegistry.properties.loginServer : '' -output AZIDENTITY_ACR_NAME string = deployResources ? containerRegistry.name : '' -output AZIDENTITY_AKS_NAME string = deployResources ? aks.name : '' -output AZIDENTITY_FUNCTION_NAME string = deployResources ? azfunc.name : '' -output AZIDENTITY_STORAGE_ID string = deployResources ? sa.id : '' -output AZIDENTITY_STORAGE_NAME string = deployResources ? sa.name : '' -output AZIDENTITY_STORAGE_NAME_USER_ASSIGNED string = deployResources ? saUserAssigned.name : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY string = deployResources ? usermgdid.id : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID string = deployResources ? usermgdid.properties.clientId : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME string = deployResources ? usermgdid.name : '' +param baseName string diff --git a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go index 459ef64c6f7..e8caeea71ef 100644 --- a/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go +++ b/upstream/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go @@ -14,5 +14,5 @@ const ( module = "github.com/Azure/azure-sdk-for-go/sdk/" + component // Version is the semantic version (see http://semver.org) of this module. - version = "v1.6.0" + version = "v1.5.1" ) diff --git a/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go index f86286051de..1841d146f5f 100644 --- a/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go +++ b/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go @@ -48,8 +48,8 @@ duplication. .Net People, Take note on X509: This uses x509.Certificates and private keys. x509 does not store private keys. .Net -has a x509.Certificate2 abstraction that has private keys, but that just a strange invention. -As such I've put a PEM decoder into here. +has some x509.Certificate2 thing that has private keys, but that is just some bullcrap that .Net +added, it doesn't exist in real life. As such I've put a PEM decoder into here. */ // TODO(msal): This should have example code for each method on client using Go's example doc framework. diff --git a/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go index 392e5e43f7d..e346ff3dffd 100644 --- a/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go +++ b/upstream/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go @@ -217,13 +217,11 @@ func WithClaims(claims string) interface { func WithAuthenticationScheme(authnScheme AuthenticationScheme) interface { AcquireSilentOption AcquireInteractiveOption - AcquireByUsernamePasswordOption options.CallOption } { return struct { AcquireSilentOption AcquireInteractiveOption - AcquireByUsernamePasswordOption options.CallOption }{ CallOption: options.NewCallOption( @@ -233,8 +231,6 @@ func WithAuthenticationScheme(authnScheme AuthenticationScheme) interface { t.authnScheme = authnScheme case *interactiveAuthOptions: t.authnScheme = authnScheme - case *acquireTokenByUsernamePasswordOptions: - t.authnScheme = authnScheme default: return fmt.Errorf("unexpected options type %T", a) } @@ -353,7 +349,6 @@ func (pca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts // acquireTokenByUsernamePasswordOptions contains optional configuration for AcquireTokenByUsernamePassword type acquireTokenByUsernamePasswordOptions struct { claims, tenantID string - authnScheme AuthenticationScheme } // AcquireByUsernamePasswordOption is implemented by options for AcquireTokenByUsernamePassword @@ -379,9 +374,6 @@ func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []s authParams.Claims = o.claims authParams.Username = username authParams.Password = password - if o.authnScheme != nil { - authParams.AuthnScheme = o.authnScheme - } token, err := pca.base.Token.UsernamePassword(ctx, authParams) if err != nil { diff --git a/upstream/vendor/github.com/Microsoft/go-winio/.golangci.yml b/upstream/vendor/github.com/Microsoft/go-winio/.golangci.yml index faedfe937a7..7b503d26a36 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/.golangci.yml +++ b/upstream/vendor/github.com/Microsoft/go-winio/.golangci.yml @@ -1,3 +1,7 @@ +run: + skip-dirs: + - pkg/etw/sample + linters: enable: # style @@ -16,13 +20,9 @@ linters: - gofmt # files are gofmt'ed - gosec # security - nilerr # returns nil even with non-nil error - - thelper # test helpers without t.Helper() - unparam # unused function params issues: - exclude-dirs: - - pkg/etw/sample - exclude-rules: # err is very often shadowed in nested scopes - linters: @@ -69,7 +69,9 @@ linters-settings: # struct order is often for Win32 compat # also, ignore pointer bytes/GC issues for now until performance becomes an issue - fieldalignment + check-shadowing: true nolintlint: + allow-leading-space: false require-explanation: true require-specific: true revive: diff --git a/upstream/vendor/github.com/Microsoft/go-winio/backup.go b/upstream/vendor/github.com/Microsoft/go-winio/backup.go index b54341daacb..09621c88463 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/backup.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/backup.go @@ -10,14 +10,14 @@ import ( "io" "os" "runtime" + "syscall" "unicode/utf16" - "github.com/Microsoft/go-winio/internal/fs" "golang.org/x/sys/windows" ) -//sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead -//sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite +//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead +//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite const ( BackupData = uint32(iota + 1) @@ -104,7 +104,7 @@ func (r *BackupStreamReader) Next() (*BackupHeader, error) { if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { return nil, err } - hdr.Name = windows.UTF16ToString(name) + hdr.Name = syscall.UTF16ToString(name) } if wsi.StreamID == BackupSparseBlock { if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { @@ -205,7 +205,7 @@ func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { // Read reads a backup stream from the file by calling the Win32 API BackupRead(). func (r *BackupFileReader) Read(b []byte) (int, error) { var bytesRead uint32 - err := backupRead(windows.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) + err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) if err != nil { return 0, &os.PathError{Op: "BackupRead", Path: r.f.Name(), Err: err} } @@ -220,7 +220,7 @@ func (r *BackupFileReader) Read(b []byte) (int, error) { // the underlying file. func (r *BackupFileReader) Close() error { if r.ctx != 0 { - _ = backupRead(windows.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) + _ = backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) runtime.KeepAlive(r.f) r.ctx = 0 } @@ -244,7 +244,7 @@ func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { // Write restores a portion of the file using the provided backup stream. func (w *BackupFileWriter) Write(b []byte) (int, error) { var bytesWritten uint32 - err := backupWrite(windows.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) + err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) if err != nil { return 0, &os.PathError{Op: "BackupWrite", Path: w.f.Name(), Err: err} } @@ -259,7 +259,7 @@ func (w *BackupFileWriter) Write(b []byte) (int, error) { // close the underlying file. func (w *BackupFileWriter) Close() error { if w.ctx != 0 { - _ = backupWrite(windows.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) + _ = backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) runtime.KeepAlive(w.f) w.ctx = 0 } @@ -271,14 +271,17 @@ func (w *BackupFileWriter) Close() error { // // If the file opened was a directory, it cannot be used with Readdir(). func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { - h, err := fs.CreateFile(path, - fs.AccessMask(access), - fs.FileShareMode(share), + winPath, err := syscall.UTF16FromString(path) + if err != nil { + return nil, err + } + h, err := syscall.CreateFile(&winPath[0], + access, + share, nil, - fs.FileCreationDisposition(createmode), - fs.FILE_FLAG_BACKUP_SEMANTICS|fs.FILE_FLAG_OPEN_REPARSE_POINT, - 0, - ) + createmode, + syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, + 0) if err != nil { err = &os.PathError{Op: "open", Path: path, Err: err} return nil, err diff --git a/upstream/vendor/github.com/Microsoft/go-winio/file.go b/upstream/vendor/github.com/Microsoft/go-winio/file.go index fe82a180dbd..175a99d3f42 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/file.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/file.go @@ -15,11 +15,26 @@ import ( "golang.org/x/sys/windows" ) -//sys cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) = CancelIoEx -//sys createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) = CreateIoCompletionPort -//sys getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus -//sys setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes -//sys wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult +//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx +//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort +//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus +//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes +//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult + +type atomicBool int32 + +func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } +func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } +func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } + +//revive:disable-next-line:predeclared Keep "new" to maintain consistency with "atomic" pkg +func (b *atomicBool) swap(new bool) bool { + var newInt int32 + if new { + newInt = 1 + } + return atomic.SwapInt32((*int32)(b), newInt) == 1 +} var ( ErrFileClosed = errors.New("file has already been closed") @@ -35,7 +50,7 @@ func (*timeoutError) Temporary() bool { return true } type timeoutChan chan struct{} var ioInitOnce sync.Once -var ioCompletionPort windows.Handle +var ioCompletionPort syscall.Handle // ioResult contains the result of an asynchronous IO operation. type ioResult struct { @@ -45,12 +60,12 @@ type ioResult struct { // ioOperation represents an outstanding asynchronous Win32 IO. type ioOperation struct { - o windows.Overlapped + o syscall.Overlapped ch chan ioResult } func initIO() { - h, err := createIoCompletionPort(windows.InvalidHandle, 0, 0, 0xffffffff) + h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff) if err != nil { panic(err) } @@ -61,10 +76,10 @@ func initIO() { // win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. // It takes ownership of this handle and will close it if it is garbage collected. type win32File struct { - handle windows.Handle + handle syscall.Handle wg sync.WaitGroup wgLock sync.RWMutex - closing atomic.Bool + closing atomicBool socket bool readDeadline deadlineHandler writeDeadline deadlineHandler @@ -75,11 +90,11 @@ type deadlineHandler struct { channel timeoutChan channelLock sync.RWMutex timer *time.Timer - timedout atomic.Bool + timedout atomicBool } // makeWin32File makes a new win32File from an existing file handle. -func makeWin32File(h windows.Handle) (*win32File, error) { +func makeWin32File(h syscall.Handle) (*win32File, error) { f := &win32File{handle: h} ioInitOnce.Do(initIO) _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) @@ -95,12 +110,7 @@ func makeWin32File(h windows.Handle) (*win32File, error) { return f, nil } -// Deprecated: use NewOpenFile instead. func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { - return NewOpenFile(windows.Handle(h)) -} - -func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) { // If we return the result of makeWin32File directly, it can result in an // interface-wrapped nil, rather than a nil interface value. f, err := makeWin32File(h) @@ -114,13 +124,13 @@ func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) { func (f *win32File) closeHandle() { f.wgLock.Lock() // Atomically set that we are closing, releasing the resources only once. - if !f.closing.Swap(true) { + if !f.closing.swap(true) { f.wgLock.Unlock() // cancel all IO and wait for it to complete _ = cancelIoEx(f.handle, nil) f.wg.Wait() // at this point, no new IO can start - windows.Close(f.handle) + syscall.Close(f.handle) f.handle = 0 } else { f.wgLock.Unlock() @@ -135,14 +145,14 @@ func (f *win32File) Close() error { // IsClosed checks if the file has been closed. func (f *win32File) IsClosed() bool { - return f.closing.Load() + return f.closing.isSet() } // prepareIO prepares for a new IO operation. // The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. func (f *win32File) prepareIO() (*ioOperation, error) { f.wgLock.RLock() - if f.closing.Load() { + if f.closing.isSet() { f.wgLock.RUnlock() return nil, ErrFileClosed } @@ -154,12 +164,12 @@ func (f *win32File) prepareIO() (*ioOperation, error) { } // ioCompletionProcessor processes completed async IOs forever. -func ioCompletionProcessor(h windows.Handle) { +func ioCompletionProcessor(h syscall.Handle) { for { var bytes uint32 var key uintptr var op *ioOperation - err := getQueuedCompletionStatus(h, &bytes, &key, &op, windows.INFINITE) + err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE) if op == nil { panic(err) } @@ -172,11 +182,11 @@ func ioCompletionProcessor(h windows.Handle) { // asyncIO processes the return value from ReadFile or WriteFile, blocking until // the operation has actually completed. func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { - if err != windows.ERROR_IO_PENDING { //nolint:errorlint // err is Errno + if err != syscall.ERROR_IO_PENDING { //nolint:errorlint // err is Errno return int(bytes), err } - if f.closing.Load() { + if f.closing.isSet() { _ = cancelIoEx(f.handle, &c.o) } @@ -191,8 +201,8 @@ func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, er select { case r = <-c.ch: err = r.err - if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno - if f.closing.Load() { + if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno + if f.closing.isSet() { err = ErrFileClosed } } else if err != nil && f.socket { @@ -204,7 +214,7 @@ func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, er _ = cancelIoEx(f.handle, &c.o) r = <-c.ch err = r.err - if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno + if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno err = ErrTimeout } } @@ -225,22 +235,23 @@ func (f *win32File) Read(b []byte) (int, error) { } defer f.wg.Done() - if f.readDeadline.timedout.Load() { + if f.readDeadline.timedout.isSet() { return 0, ErrTimeout } var bytes uint32 - err = windows.ReadFile(f.handle, b, &bytes, &c.o) + err = syscall.ReadFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.readDeadline, bytes, err) runtime.KeepAlive(b) // Handle EOF conditions. if err == nil && n == 0 && len(b) != 0 { return 0, io.EOF - } else if err == windows.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno + } else if err == syscall.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno return 0, io.EOF + } else { + return n, err } - return n, err } // Write writes to a file handle. @@ -251,12 +262,12 @@ func (f *win32File) Write(b []byte) (int, error) { } defer f.wg.Done() - if f.writeDeadline.timedout.Load() { + if f.writeDeadline.timedout.isSet() { return 0, ErrTimeout } var bytes uint32 - err = windows.WriteFile(f.handle, b, &bytes, &c.o) + err = syscall.WriteFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.writeDeadline, bytes, err) runtime.KeepAlive(b) return n, err @@ -271,7 +282,7 @@ func (f *win32File) SetWriteDeadline(deadline time.Time) error { } func (f *win32File) Flush() error { - return windows.FlushFileBuffers(f.handle) + return syscall.FlushFileBuffers(f.handle) } func (f *win32File) Fd() uintptr { @@ -288,7 +299,7 @@ func (d *deadlineHandler) set(deadline time.Time) error { } d.timer = nil } - d.timedout.Store(false) + d.timedout.setFalse() select { case <-d.channel: @@ -303,7 +314,7 @@ func (d *deadlineHandler) set(deadline time.Time) error { } timeoutIO := func() { - d.timedout.Store(true) + d.timedout.setTrue() close(d.channel) } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/fileinfo.go b/upstream/vendor/github.com/Microsoft/go-winio/fileinfo.go index c860eb9917a..702950e72a4 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/fileinfo.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/fileinfo.go @@ -18,18 +18,9 @@ type FileBasicInfo struct { _ uint32 // padding } -// alignedFileBasicInfo is a FileBasicInfo, but aligned to uint64 by containing -// uint64 rather than windows.Filetime. Filetime contains two uint32s. uint64 -// alignment is necessary to pass this as FILE_BASIC_INFO. -type alignedFileBasicInfo struct { - CreationTime, LastAccessTime, LastWriteTime, ChangeTime uint64 - FileAttributes uint32 - _ uint32 // padding -} - // GetFileBasicInfo retrieves times and attributes for a file. func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { - bi := &alignedFileBasicInfo{} + bi := &FileBasicInfo{} if err := windows.GetFileInformationByHandleEx( windows.Handle(f.Fd()), windows.FileBasicInfo, @@ -39,21 +30,16 @@ func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} } runtime.KeepAlive(f) - // Reinterpret the alignedFileBasicInfo as a FileBasicInfo so it matches the - // public API of this module. The data may be unnecessarily aligned. - return (*FileBasicInfo)(unsafe.Pointer(bi)), nil + return bi, nil } // SetFileBasicInfo sets times and attributes for a file. func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { - // Create an alignedFileBasicInfo based on a FileBasicInfo. The copy is - // suitable to pass to GetFileInformationByHandleEx. - biAligned := *(*alignedFileBasicInfo)(unsafe.Pointer(bi)) if err := windows.SetFileInformationByHandle( windows.Handle(f.Fd()), windows.FileBasicInfo, - (*byte)(unsafe.Pointer(&biAligned)), - uint32(unsafe.Sizeof(biAligned)), + (*byte)(unsafe.Pointer(bi)), + uint32(unsafe.Sizeof(*bi)), ); err != nil { return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/hvsock.go b/upstream/vendor/github.com/Microsoft/go-winio/hvsock.go index c4fdd9d4aec..c881916583e 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/hvsock.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/hvsock.go @@ -10,6 +10,7 @@ import ( "io" "net" "os" + "syscall" "time" "unsafe" @@ -180,13 +181,13 @@ type HvsockConn struct { var _ net.Conn = &HvsockConn{} func newHVSocket() (*win32File, error) { - fd, err := windows.Socket(afHVSock, windows.SOCK_STREAM, 1) + fd, err := syscall.Socket(afHVSock, syscall.SOCK_STREAM, 1) if err != nil { return nil, os.NewSyscallError("socket", err) } f, err := makeWin32File(fd) if err != nil { - windows.Close(fd) + syscall.Close(fd) return nil, err } f.socket = true @@ -196,24 +197,16 @@ func newHVSocket() (*win32File, error) { // ListenHvsock listens for connections on the specified hvsock address. func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { l := &HvsockListener{addr: *addr} - - var sock *win32File - sock, err = newHVSocket() + sock, err := newHVSocket() if err != nil { return nil, l.opErr("listen", err) } - defer func() { - if err != nil { - _ = sock.Close() - } - }() - sa := addr.raw() - err = socket.Bind(sock.handle, &sa) + err = socket.Bind(windows.Handle(sock.handle), &sa) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("socket", err)) } - err = windows.Listen(sock.handle, 16) + err = syscall.Listen(sock.handle, 16) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("listen", err)) } @@ -253,7 +246,7 @@ func (l *HvsockListener) Accept() (_ net.Conn, err error) { var addrbuf [addrlen * 2]byte var bytes uint32 - err = windows.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) + err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) if _, err = l.sock.asyncIO(c, nil, bytes, err); err != nil { return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) } @@ -270,7 +263,7 @@ func (l *HvsockListener) Accept() (_ net.Conn, err error) { conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) // initialize the accepted socket and update its properties with those of the listening socket - if err = windows.Setsockopt(sock.handle, + if err = windows.Setsockopt(windows.Handle(sock.handle), windows.SOL_SOCKET, windows.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&l.sock.handle)), int32(unsafe.Sizeof(l.sock.handle))); err != nil { return nil, conn.opErr("accept", os.NewSyscallError("setsockopt", err)) @@ -341,7 +334,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock }() sa := addr.raw() - err = socket.Bind(sock.handle, &sa) + err = socket.Bind(windows.Handle(sock.handle), &sa) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("bind", err)) } @@ -354,7 +347,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock var bytes uint32 for i := uint(0); i <= d.Retries; i++ { err = socket.ConnectEx( - sock.handle, + windows.Handle(sock.handle), &sa, nil, // sendBuf 0, // sendDataLen @@ -374,7 +367,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock // update the connection properties, so shutdown can be used if err = windows.Setsockopt( - sock.handle, + windows.Handle(sock.handle), windows.SOL_SOCKET, windows.SO_UPDATE_CONNECT_CONTEXT, nil, // optvalue @@ -385,7 +378,7 @@ func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *Hvsock // get the local name var sal rawHvsockAddr - err = socket.GetSockName(sock.handle, &sal) + err = socket.GetSockName(windows.Handle(sock.handle), &sal) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("getsockname", err)) } @@ -428,7 +421,7 @@ func (d *HvsockDialer) redialWait(ctx context.Context) (err error) { return ctx.Err() } -// assumes error is a plain, unwrapped windows.Errno provided by direct syscall. +// assumes error is a plain, unwrapped syscall.Errno provided by direct syscall. func canRedial(err error) bool { //nolint:errorlint // guaranteed to be an Errno switch err { @@ -454,9 +447,9 @@ func (conn *HvsockConn) Read(b []byte) (int, error) { return 0, conn.opErr("read", err) } defer conn.sock.wg.Done() - buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} + buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} var flags, bytes uint32 - err = windows.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) + err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.readDeadline, bytes, err) if err != nil { var eno windows.Errno @@ -489,9 +482,9 @@ func (conn *HvsockConn) write(b []byte) (int, error) { return 0, conn.opErr("write", err) } defer conn.sock.wg.Done() - buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} + buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} var bytes uint32 - err = windows.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) + err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.writeDeadline, bytes, err) if err != nil { var eno windows.Errno @@ -518,7 +511,7 @@ func (conn *HvsockConn) shutdown(how int) error { return socket.ErrSocketClosed } - err := windows.Shutdown(conn.sock.handle, how) + err := syscall.Shutdown(conn.sock.handle, how) if err != nil { // If the connection was closed, shutdowns fail with "not connected" if errors.Is(err, windows.WSAENOTCONN) || @@ -532,7 +525,7 @@ func (conn *HvsockConn) shutdown(how int) error { // CloseRead shuts down the read end of the socket, preventing future read operations. func (conn *HvsockConn) CloseRead() error { - err := conn.shutdown(windows.SHUT_RD) + err := conn.shutdown(syscall.SHUT_RD) if err != nil { return conn.opErr("closeread", err) } @@ -542,7 +535,7 @@ func (conn *HvsockConn) CloseRead() error { // CloseWrite shuts down the write end of the socket, preventing future write operations and // notifying the other endpoint that no more data will be written. func (conn *HvsockConn) CloseWrite() error { - err := conn.shutdown(windows.SHUT_WR) + err := conn.shutdown(syscall.SHUT_WR) if err != nil { return conn.opErr("closewrite", err) } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go b/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go index 0cd9621df78..509b3ec6410 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go @@ -11,14 +11,12 @@ import ( //go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go fs.go // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew -//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW +//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW const NullHandle windows.Handle = 0 // AccessMask defines standard, specific, and generic rights. // -// Used with CreateFile and NtCreateFile (and co.). -// // Bitmask: // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 @@ -49,12 +47,6 @@ const ( // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#parameters FILE_ANY_ACCESS AccessMask = 0 - GENERIC_READ AccessMask = 0x8000_0000 - GENERIC_WRITE AccessMask = 0x4000_0000 - GENERIC_EXECUTE AccessMask = 0x2000_0000 - GENERIC_ALL AccessMask = 0x1000_0000 - ACCESS_SYSTEM_SECURITY AccessMask = 0x0100_0000 - // Specific Object Access // from ntioapi.h @@ -132,32 +124,14 @@ const ( TRUNCATE_EXISTING FileCreationDisposition = 0x05 ) -// Create disposition values for NtCreate* -type NTFileCreationDisposition uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // From ntioapi.h - - FILE_SUPERSEDE NTFileCreationDisposition = 0x00 - FILE_OPEN NTFileCreationDisposition = 0x01 - FILE_CREATE NTFileCreationDisposition = 0x02 - FILE_OPEN_IF NTFileCreationDisposition = 0x03 - FILE_OVERWRITE NTFileCreationDisposition = 0x04 - FILE_OVERWRITE_IF NTFileCreationDisposition = 0x05 - FILE_MAXIMUM_DISPOSITION NTFileCreationDisposition = 0x05 -) - // CreateFile and co. take flags or attributes together as one parameter. // Define alias until we can use generics to allow both -// + // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants type FileFlagOrAttribute uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // from winnt.h - +const ( // from winnt.h FILE_FLAG_WRITE_THROUGH FileFlagOrAttribute = 0x8000_0000 FILE_FLAG_OVERLAPPED FileFlagOrAttribute = 0x4000_0000 FILE_FLAG_NO_BUFFERING FileFlagOrAttribute = 0x2000_0000 @@ -171,51 +145,17 @@ const ( FILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000 ) -// NtCreate* functions take a dedicated CreateOptions parameter. -// -// https://learn.microsoft.com/en-us/windows/win32/api/Winternl/nf-winternl-ntcreatefile -// -// https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file -type NTCreateOptions uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // From ntioapi.h - - FILE_DIRECTORY_FILE NTCreateOptions = 0x0000_0001 - FILE_WRITE_THROUGH NTCreateOptions = 0x0000_0002 - FILE_SEQUENTIAL_ONLY NTCreateOptions = 0x0000_0004 - FILE_NO_INTERMEDIATE_BUFFERING NTCreateOptions = 0x0000_0008 - - FILE_SYNCHRONOUS_IO_ALERT NTCreateOptions = 0x0000_0010 - FILE_SYNCHRONOUS_IO_NONALERT NTCreateOptions = 0x0000_0020 - FILE_NON_DIRECTORY_FILE NTCreateOptions = 0x0000_0040 - FILE_CREATE_TREE_CONNECTION NTCreateOptions = 0x0000_0080 - - FILE_COMPLETE_IF_OPLOCKED NTCreateOptions = 0x0000_0100 - FILE_NO_EA_KNOWLEDGE NTCreateOptions = 0x0000_0200 - FILE_DISABLE_TUNNELING NTCreateOptions = 0x0000_0400 - FILE_RANDOM_ACCESS NTCreateOptions = 0x0000_0800 - - FILE_DELETE_ON_CLOSE NTCreateOptions = 0x0000_1000 - FILE_OPEN_BY_FILE_ID NTCreateOptions = 0x0000_2000 - FILE_OPEN_FOR_BACKUP_INTENT NTCreateOptions = 0x0000_4000 - FILE_NO_COMPRESSION NTCreateOptions = 0x0000_8000 -) - type FileSQSFlag = FileFlagOrAttribute //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // from winbase.h - +const ( // from winbase.h SECURITY_ANONYMOUS FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16) SECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification << 16) SECURITY_IMPERSONATION FileSQSFlag = FileSQSFlag(SecurityImpersonation << 16) SECURITY_DELEGATION FileSQSFlag = FileSQSFlag(SecurityDelegation << 16) - SECURITY_SQOS_PRESENT FileSQSFlag = 0x0010_0000 - SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F_0000 + SECURITY_SQOS_PRESENT FileSQSFlag = 0x00100000 + SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F0000 ) // GetFinalPathNameByHandle flags diff --git a/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go b/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go index a94e234c706..e2f7bb24e5f 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go @@ -33,6 +33,9 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } + // TODO: add more here, after collecting data on the common + // error values see on Windows. (perhaps when running + // all.bat?) return e } @@ -42,7 +45,7 @@ var ( procCreateFileW = modkernel32.NewProc("CreateFileW") ) -func CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { +func CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { @@ -51,8 +54,8 @@ func CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows. return _CreateFile(_p0, access, mode, sa, createmode, attrs, templatefile) } -func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { - r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) +func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { + r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) handle = windows.Handle(r0) if handle == windows.InvalidHandle { err = errnoErr(e1) diff --git a/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go b/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go index 88580d974ec..aeb7b7250f5 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go @@ -156,7 +156,9 @@ func connectEx( bytesSent *uint32, overlapped *windows.Overlapped, ) (err error) { - r1, _, e1 := syscall.SyscallN(connectExFunc.addr, + // todo: after upgrading to 1.18, switch from syscall.Syscall9 to syscall.SyscallN + r1, _, e1 := syscall.Syscall9(connectExFunc.addr, + 7, uintptr(s), uintptr(name), uintptr(namelen), @@ -164,8 +166,8 @@ func connectEx( uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), - ) - + 0, + 0) if r1 == 0 { if e1 != 0 { err = error(e1) diff --git a/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go b/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go index e1504126aa6..6d2e1a9e443 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go @@ -33,6 +33,9 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } + // TODO: add more here, after collecting data on the common + // error values see on Windows. (perhaps when running + // all.bat?) return e } @@ -45,7 +48,7 @@ var ( ) func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socketError { err = errnoErr(e1) } @@ -53,7 +56,7 @@ func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { } func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) + r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } @@ -61,7 +64,7 @@ func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err err } func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) + r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go b/upstream/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go index 42ebc019fcb..7ad50570240 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go @@ -62,7 +62,7 @@ func (b *WString) Free() { // ResizeTo grows the buffer to at least c and returns the new capacity, freeing the // previous buffer back into pool. func (b *WString) ResizeTo(c uint32) uint32 { - // already sufficient (or n is 0) + // allready sufficient (or n is 0) if c <= b.Cap() { return b.Cap() } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/pipe.go b/upstream/vendor/github.com/Microsoft/go-winio/pipe.go index a2da6639d00..25cc811031b 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/pipe.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/pipe.go @@ -11,6 +11,7 @@ import ( "net" "os" "runtime" + "syscall" "time" "unsafe" @@ -19,44 +20,20 @@ import ( "github.com/Microsoft/go-winio/internal/fs" ) -//sys connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) = ConnectNamedPipe -//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateNamedPipeW -//sys disconnectNamedPipe(pipe windows.Handle) (err error) = DisconnectNamedPipe -//sys getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo -//sys getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW -//sys ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile +//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe +//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW +//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo +//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW +//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc +//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile //sys rtlNtStatusToDosError(status ntStatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb //sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) = ntdll.RtlDosPathNameToNtPathName_U //sys rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) = ntdll.RtlDefaultNpAcl -type PipeConn interface { - net.Conn - Disconnect() error - Flush() error -} - -// type aliases for mkwinsyscall code -type ( - ntAccessMask = fs.AccessMask - ntFileShareMode = fs.FileShareMode - ntFileCreationDisposition = fs.NTFileCreationDisposition - ntFileOptions = fs.NTCreateOptions -) - type ioStatusBlock struct { Status, Information uintptr } -// typedef struct _OBJECT_ATTRIBUTES { -// ULONG Length; -// HANDLE RootDirectory; -// PUNICODE_STRING ObjectName; -// ULONG Attributes; -// PVOID SecurityDescriptor; -// PVOID SecurityQualityOfService; -// } OBJECT_ATTRIBUTES; -// -// https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes type objectAttributes struct { Length uintptr RootDirectory uintptr @@ -72,17 +49,6 @@ type unicodeString struct { Buffer uintptr } -// typedef struct _SECURITY_DESCRIPTOR { -// BYTE Revision; -// BYTE Sbz1; -// SECURITY_DESCRIPTOR_CONTROL Control; -// PSID Owner; -// PSID Group; -// PACL Sacl; -// PACL Dacl; -// } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; -// -// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-security_descriptor type securityDescriptor struct { Revision byte Sbz1 byte @@ -114,8 +80,6 @@ type win32Pipe struct { path string } -var _ PipeConn = (*win32Pipe)(nil) - type win32MessageBytePipe struct { win32Pipe writeClosed bool @@ -139,10 +103,6 @@ func (f *win32Pipe) SetDeadline(t time.Time) error { return f.SetWriteDeadline(t) } -func (f *win32Pipe) Disconnect() error { - return disconnectNamedPipe(f.win32File.handle) -} - // CloseWrite closes the write side of a message pipe in byte mode. func (f *win32MessageBytePipe) CloseWrite() error { if f.writeClosed { @@ -186,7 +146,7 @@ func (f *win32MessageBytePipe) Read(b []byte) (int, error) { // zero-byte message, ensure that all future Read() calls // also return EOF. f.readEOF = true - } else if err == windows.ERROR_MORE_DATA { //nolint:errorlint // err is Errno + } else if err == syscall.ERROR_MORE_DATA { //nolint:errorlint // err is Errno // ERROR_MORE_DATA indicates that the pipe's read mode is message mode // and the message still has more bytes. Treat this as a success, since // this package presents all named pipes as byte streams. @@ -204,20 +164,21 @@ func (s pipeAddress) String() string { } // tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask, impLevel PipeImpLevel) (windows.Handle, error) { +func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask) (syscall.Handle, error) { for { select { case <-ctx.Done(): - return windows.Handle(0), ctx.Err() + return syscall.Handle(0), ctx.Err() default: - h, err := fs.CreateFile(*path, + wh, err := fs.CreateFile(*path, access, 0, // mode nil, // security attributes fs.OPEN_EXISTING, - fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.FileSQSFlag(impLevel), + fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.SECURITY_ANONYMOUS, 0, // template file handle ) + h := syscall.Handle(wh) if err == nil { return h, nil } @@ -253,33 +214,15 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { // DialPipeContext attempts to connect to a named pipe by `path` until `ctx` // cancellation or timeout. func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { - return DialPipeAccess(ctx, path, uint32(fs.GENERIC_READ|fs.GENERIC_WRITE)) + return DialPipeAccess(ctx, path, syscall.GENERIC_READ|syscall.GENERIC_WRITE) } -// PipeImpLevel is an enumeration of impersonation levels that may be set -// when calling DialPipeAccessImpersonation. -type PipeImpLevel uint32 - -const ( - PipeImpLevelAnonymous = PipeImpLevel(fs.SECURITY_ANONYMOUS) - PipeImpLevelIdentification = PipeImpLevel(fs.SECURITY_IDENTIFICATION) - PipeImpLevelImpersonation = PipeImpLevel(fs.SECURITY_IMPERSONATION) - PipeImpLevelDelegation = PipeImpLevel(fs.SECURITY_DELEGATION) -) - // DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` // cancellation or timeout. func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { - return DialPipeAccessImpLevel(ctx, path, access, PipeImpLevelAnonymous) -} - -// DialPipeAccessImpLevel attempts to connect to a named pipe by `path` with -// `access` at `impLevel` until `ctx` cancellation or timeout. The other -// DialPipe* implementations use PipeImpLevelAnonymous. -func DialPipeAccessImpLevel(ctx context.Context, path string, access uint32, impLevel PipeImpLevel) (net.Conn, error) { var err error - var h windows.Handle - h, err = tryDialPipe(ctx, &path, fs.AccessMask(access), impLevel) + var h syscall.Handle + h, err = tryDialPipe(ctx, &path, fs.AccessMask(access)) if err != nil { return nil, err } @@ -292,7 +235,7 @@ func DialPipeAccessImpLevel(ctx context.Context, path string, access uint32, imp f, err := makeWin32File(h) if err != nil { - windows.Close(h) + syscall.Close(h) return nil, err } @@ -312,7 +255,7 @@ type acceptResponse struct { } type win32PipeListener struct { - firstHandle windows.Handle + firstHandle syscall.Handle path string config PipeConfig acceptCh chan (chan acceptResponse) @@ -320,8 +263,8 @@ type win32PipeListener struct { doneCh chan int } -func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (windows.Handle, error) { - path16, err := windows.UTF16FromString(path) +func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) { + path16, err := syscall.UTF16FromString(path) if err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } @@ -337,20 +280,16 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (wi ).Err(); err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } - defer windows.LocalFree(windows.Handle(ntPath.Buffer)) //nolint:errcheck + defer localFree(ntPath.Buffer) oa.ObjectName = &ntPath oa.Attributes = windows.OBJ_CASE_INSENSITIVE // The security descriptor is only needed for the first pipe. if first { if sd != nil { - //todo: does `sdb` need to be allocated on the heap, or can go allocate it? l := uint32(len(sd)) - sdb, err := windows.LocalAlloc(0, l) - if err != nil { - return 0, fmt.Errorf("LocalAlloc for security descriptor with of length %d: %w", l, err) - } - defer windows.LocalFree(windows.Handle(sdb)) //nolint:errcheck + sdb := localAlloc(0, l) + defer localFree(sdb) copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) } else { @@ -359,7 +298,7 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (wi if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { return 0, fmt.Errorf("getting default named pipe ACL: %w", err) } - defer windows.LocalFree(windows.Handle(dacl)) //nolint:errcheck + defer localFree(dacl) sdb := &securityDescriptor{ Revision: 1, @@ -375,27 +314,27 @@ func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (wi typ |= windows.FILE_PIPE_MESSAGE_TYPE } - disposition := fs.FILE_OPEN - access := fs.GENERIC_READ | fs.GENERIC_WRITE | fs.SYNCHRONIZE + disposition := uint32(windows.FILE_OPEN) + access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE) if first { - disposition = fs.FILE_CREATE + disposition = windows.FILE_CREATE // By not asking for read or write access, the named pipe file system // will put this pipe into an initially disconnected state, blocking // client connections until the next call with first == false. - access = fs.SYNCHRONIZE + access = syscall.SYNCHRONIZE } timeout := int64(-50 * 10000) // 50ms var ( - h windows.Handle + h syscall.Handle iosb ioStatusBlock ) err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, - fs.FILE_SHARE_READ|fs.FILE_SHARE_WRITE, + syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, disposition, 0, typ, @@ -420,7 +359,7 @@ func (l *win32PipeListener) makeServerPipe() (*win32File, error) { } f, err := makeWin32File(h) if err != nil { - windows.Close(h) + syscall.Close(h) return nil, err } return f, nil @@ -479,7 +418,7 @@ func (l *win32PipeListener) listenerRoutine() { closed = err == ErrPipeListenerClosed //nolint:errorlint // err is Errno } } - windows.Close(l.firstHandle) + syscall.Close(l.firstHandle) l.firstHandle = 0 // Notify Close() and Accept() callers that the handle has been closed. close(l.doneCh) diff --git a/upstream/vendor/github.com/Microsoft/go-winio/privilege.go b/upstream/vendor/github.com/Microsoft/go-winio/privilege.go index d9b90b6e861..0ff9dac906d 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/privilege.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/privilege.go @@ -9,6 +9,7 @@ import ( "fmt" "runtime" "sync" + "syscall" "unicode/utf16" "golang.org/x/sys/windows" @@ -17,8 +18,8 @@ import ( //sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges //sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf //sys revertToSelf() (err error) = advapi32.RevertToSelf -//sys openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken -//sys getCurrentThread() (h windows.Handle) = GetCurrentThread +//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken +//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread //sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW //sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW //sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW @@ -28,7 +29,7 @@ const ( SE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED //revive:disable-next-line:var-naming ALL_CAPS - ERROR_NOT_ALL_ASSIGNED windows.Errno = windows.ERROR_NOT_ALL_ASSIGNED + ERROR_NOT_ALL_ASSIGNED syscall.Errno = windows.ERROR_NOT_ALL_ASSIGNED SeBackupPrivilege = "SeBackupPrivilege" SeRestorePrivilege = "SeRestorePrivilege" @@ -176,7 +177,7 @@ func newThreadToken() (windows.Token, error) { } var token windows.Token - err = openThreadToken(getCurrentThread(), windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, false, &token) + err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token) if err != nil { rerr := revertToSelf() if rerr != nil { diff --git a/upstream/vendor/github.com/Microsoft/go-winio/sd.go b/upstream/vendor/github.com/Microsoft/go-winio/sd.go index c3685e98e14..5550ef6b61e 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/sd.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/sd.go @@ -5,7 +5,7 @@ package winio import ( "errors" - "fmt" + "syscall" "unsafe" "golang.org/x/sys/windows" @@ -15,6 +15,10 @@ import ( //sys lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountSidW //sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW //sys convertStringSidToSid(str *uint16, sid **byte) (err error) = advapi32.ConvertStringSidToSidW +//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW +//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW +//sys localFree(mem uintptr) = LocalFree +//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength type AccountLookupError struct { Name string @@ -60,7 +64,7 @@ func LookupSidByName(name string) (sid string, err error) { var sidSize, sidNameUse, refDomainSize uint32 err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno + if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno return "", &AccountLookupError{name, err} } sidBuffer := make([]byte, sidSize) @@ -74,8 +78,8 @@ func LookupSidByName(name string) (sid string, err error) { if err != nil { return "", &AccountLookupError{name, err} } - sid = windows.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) - _, _ = windows.LocalFree(windows.Handle(unsafe.Pointer(strBuffer))) + sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) + localFree(uintptr(unsafe.Pointer(strBuffer))) return sid, nil } @@ -96,7 +100,7 @@ func LookupNameBySid(sid string) (name string, err error) { if err = convertStringSidToSid(sidBuffer, &sidPtr); err != nil { return "", &AccountLookupError{sid, err} } - defer windows.LocalFree(windows.Handle(unsafe.Pointer(sidPtr))) //nolint:errcheck + defer localFree(uintptr(unsafe.Pointer(sidPtr))) var nameSize, refDomainSize, sidNameUse uint32 err = lookupAccountSid(nil, sidPtr, nil, &nameSize, nil, &refDomainSize, &sidNameUse) @@ -116,18 +120,25 @@ func LookupNameBySid(sid string) (name string, err error) { } func SddlToSecurityDescriptor(sddl string) ([]byte, error) { - sd, err := windows.SecurityDescriptorFromString(sddl) + var sdBuffer uintptr + err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil) if err != nil { - return nil, &SddlConversionError{Sddl: sddl, Err: err} + return nil, &SddlConversionError{sddl, err} } - b := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length()) - return b, nil + defer localFree(sdBuffer) + sd := make([]byte, getSecurityDescriptorLength(sdBuffer)) + copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)]) + return sd, nil } func SecurityDescriptorToSddl(sd []byte) (string, error) { - if l := int(unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{})); len(sd) < l { - return "", fmt.Errorf("SecurityDescriptor (%d) smaller than expected (%d): %w", len(sd), l, windows.ERROR_INCORRECT_SIZE) + var sddl *uint16 + // The returned string length seems to include an arbitrary number of terminating NULs. + // Don't use it. + err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil) + if err != nil { + return "", err } - s := (*windows.SECURITY_DESCRIPTOR)(unsafe.Pointer(&sd[0])) - return s.String(), nil + defer localFree(uintptr(unsafe.Pointer(sddl))) + return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil } diff --git a/upstream/vendor/github.com/Microsoft/go-winio/tools.go b/upstream/vendor/github.com/Microsoft/go-winio/tools.go new file mode 100644 index 00000000000..2aa045843ea --- /dev/null +++ b/upstream/vendor/github.com/Microsoft/go-winio/tools.go @@ -0,0 +1,5 @@ +//go:build tools + +package winio + +import _ "golang.org/x/tools/cmd/stringer" diff --git a/upstream/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/upstream/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go index 89b66eda8cc..469b16f6398 100644 --- a/upstream/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go +++ b/upstream/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go @@ -33,6 +33,9 @@ func errnoErr(e syscall.Errno) error { case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } + // TODO: add more here, after collecting data on the common + // error values see on Windows. (perhaps when running + // all.bat?) return e } @@ -42,34 +45,38 @@ var ( modntdll = windows.NewLazySystemDLL("ntdll.dll") modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") - procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") - procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") - procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") - procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") - procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") - procRevertToSelf = modadvapi32.NewProc("RevertToSelf") - procBackupRead = modkernel32.NewProc("BackupRead") - procBackupWrite = modkernel32.NewProc("BackupWrite") - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") - procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") - procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") - procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") - procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") - procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") - procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") - procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") - procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") + procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") + procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") + procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") + procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") + procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") + procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") + procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") + procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") + procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") + procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") + procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") + procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") + procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") + procRevertToSelf = modadvapi32.NewProc("RevertToSelf") + procBackupRead = modkernel32.NewProc("BackupRead") + procBackupWrite = modkernel32.NewProc("BackupWrite") + procCancelIoEx = modkernel32.NewProc("CancelIoEx") + procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") + procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") + procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") + procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") + procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") + procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") + procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") + procLocalAlloc = modkernel32.NewProc("LocalAlloc") + procLocalFree = modkernel32.NewProc("LocalFree") + procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") + procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") + procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") + procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") + procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") + procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") ) func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { @@ -77,7 +84,7 @@ func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, ou if releaseAll { _p0 = 1 } - r0, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) + r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) success = r0 != 0 if true { err = errnoErr(e1) @@ -85,8 +92,33 @@ func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, ou return } +func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func convertSidToStringSid(sid *byte, str **uint16) (err error) { - r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str))) + r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) { + var _p0 *uint16 + _p0, err = syscall.UTF16PtrFromString(str) + if err != nil { + return + } + return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) +} + +func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -94,15 +126,21 @@ func convertSidToStringSid(sid *byte, str **uint16) (err error) { } func convertStringSidToSid(str *uint16, sid **byte) (err error) { - r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid))) + r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid)), 0) if r1 == 0 { err = errnoErr(e1) } return } +func getSecurityDescriptorLength(sd uintptr) (len uint32) { + r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0) + len = uint32(r0) + return +} + func impersonateSelf(level uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(level)) + r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -119,7 +157,7 @@ func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSiz } func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) + r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -127,7 +165,7 @@ func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidS } func lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) + r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -144,7 +182,7 @@ func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, } func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procLookupPrivilegeDisplayNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId))) + r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0) if r1 == 0 { err = errnoErr(e1) } @@ -161,7 +199,7 @@ func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size * } func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procLookupPrivilegeNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size))) + r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -183,19 +221,19 @@ func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err err } func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { - r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) + r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } return } -func openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { +func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { var _p0 uint32 if openAsSelf { _p0 = 1 } - r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token))) + r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) if r1 == 0 { err = errnoErr(e1) } @@ -203,14 +241,14 @@ func openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, } func revertToSelf() (err error) { - r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) + r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) if r1 == 0 { err = errnoErr(e1) } return } -func backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { +func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] @@ -223,14 +261,14 @@ func backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, proce if processSecurity { _p2 = 1 } - r1, _, e1 := syscall.SyscallN(procBackupRead.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) + r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) if r1 == 0 { err = errnoErr(e1) } return } -func backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { +func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] @@ -243,39 +281,39 @@ func backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, p if processSecurity { _p2 = 1 } - r1, _, e1 := syscall.SyscallN(procBackupWrite.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) + r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) if r1 == 0 { err = errnoErr(e1) } return } -func cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) { - r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(file), uintptr(unsafe.Pointer(o))) +func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) { + r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0) if r1 == 0 { err = errnoErr(e1) } return } -func connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) { - r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(o))) +func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) { + r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0) if r1 == 0 { err = errnoErr(e1) } return } -func createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) { - r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount)) - newport = windows.Handle(r0) +func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) { + r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0) + newport = syscall.Handle(r0) if newport == 0 { err = errnoErr(e1) } return } -func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { +func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { @@ -284,93 +322,96 @@ func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances ui return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) } -func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { - r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) - handle = windows.Handle(r0) - if handle == windows.InvalidHandle { - err = errnoErr(e1) - } - return -} - -func disconnectNamedPipe(pipe windows.Handle) (err error) { - r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) - if r1 == 0 { +func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { + r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) + handle = syscall.Handle(r0) + if handle == syscall.InvalidHandle { err = errnoErr(e1) } return } -func getCurrentThread() (h windows.Handle) { - r0, _, _ := syscall.SyscallN(procGetCurrentThread.Addr()) - h = windows.Handle(r0) +func getCurrentThread() (h syscall.Handle) { + r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) + h = syscall.Handle(r0) return } -func getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) +func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { + r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) if r1 == 0 { err = errnoErr(e1) } return } -func getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) +func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) if r1 == 0 { err = errnoErr(e1) } return } -func getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { - r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout)) +func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0) if r1 == 0 { err = errnoErr(e1) } return } -func setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) { - r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(h), uintptr(flags)) +func localAlloc(uFlags uint32, length uint32) (ptr uintptr) { + r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0) + ptr = uintptr(r0) + return +} + +func localFree(mem uintptr) { + syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0) + return +} + +func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) { + r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0) if r1 == 0 { err = errnoErr(e1) } return } -func ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { - r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) +func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { + r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) status = ntStatus(r0) return } func rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) { - r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(dacl))) + r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0) status = ntStatus(r0) return } func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) { - r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved)) + r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0) status = ntStatus(r0) return } func rtlNtStatusToDosError(status ntStatus) (winerr error) { - r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(status)) + r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0) if r0 != 0 { winerr = syscall.Errno(r0) } return } -func wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { +func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { var _p0 uint32 if wait { _p0 = 1 } - r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) + r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) if r1 == 0 { err = errnoErr(e1) } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index e648346be72..847cc51a981 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.27.0" +const goModuleVersion = "1.26.0" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go index 19d6107c461..b0133f4c88d 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go @@ -112,8 +112,6 @@ type MetricData struct { ResolveEndpointStartTime time.Time ResolveEndpointEndTime time.Time EndpointResolutionDuration time.Duration - GetIdentityStartTime time.Time - GetIdentityEndTime time.Time InThroughput float64 OutThroughput float64 RetryCount int @@ -124,7 +122,6 @@ type MetricData struct { OperationName string PartitionID string Region string - UserAgent string RequestContentLength int64 Stream StreamMetrics Attempts []AttemptMetrics @@ -147,6 +144,8 @@ type AttemptMetrics struct { ConnRequestedTime time.Time ConnObtainedTime time.Time ConcurrencyAcquireDuration time.Duration + CredentialFetchStartTime time.Time + CredentialFetchEndTime time.Time SignStartTime time.Time SignEndTime time.Time SigningDuration time.Duration diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go index a9db6433de9..febeb0482db 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics" v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" "github.com/aws/aws-sdk-go-v2/internal/sdk" @@ -300,7 +301,22 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl return out, metadata, &SigningError{Err: fmt.Errorf("computed payload hash missing from context")} } + mctx := metrics.Context(ctx) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.CredentialFetchStartTime = sdk.NowTime() + } + } + credentials, err := s.credentialsProvider.Retrieve(ctx) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.CredentialFetchEndTime = sdk.NowTime() + } + } + if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to retrieve credentials: %w", err)} } @@ -321,7 +337,20 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl }) } + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.SignStartTime = sdk.NowTime() + } + } + err = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), signerOptions...) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.SignEndTime = sdk.NowTime() + } + } + if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to sign http request, %w", err)} } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go index 55dfd07ba87..bb61904e1d8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go @@ -1,41 +1,48 @@ -// Package v4 implements the AWS signature version 4 algorithm (commonly known -// as SigV4). +// Package v4 implements signing for AWS V4 signer // -// For more information about SigV4, see [Signing AWS API requests] in the IAM -// user guide. +// Provides request signing for request that need to be signed with +// AWS V4 Signatures. // -// While this implementation CAN work in an external context, it is developed -// primarily for SDK use and you may encounter fringe behaviors around header -// canonicalization. +// # Standalone Signer // -// # Pre-escaping a request URI +// Generally using the signer outside of the SDK should not require any additional // -// AWS v4 signature validation requires that the canonical string's URI path -// component must be the escaped form of the HTTP request's path. -// -// The Go HTTP client will perform escaping automatically on the HTTP request. -// This may cause signature validation errors because the request differs from -// the URI path or query from which the signature was generated. +// The signer does this by taking advantage of the URL.EscapedPath method. If your request URI requires // -// Because of this, we recommend that you explicitly escape the request when -// using this signer outside of the SDK to prevent possible signature mismatch. -// This can be done by setting URL.Opaque on the request. The signer will -// prefer that value, falling back to the return of URL.EscapedPath if unset. +// additional escaping you many need to use the URL.Opaque to define what the raw URI should be sent +// to the service as. // -// When setting URL.Opaque you must do so in the form of: +// The signer will first check the URL.Opaque field, and use its value if set. +// The signer does require the URL.Opaque field to be set in the form of: // // "///" // // // e.g. // "//example.com/some/path" // -// The leading "//" and hostname are required or the escaping will not work -// correctly. +// The leading "//" and hostname are required or the URL.Opaque escaping will +// not work correctly. +// +// If URL.Opaque is not set the signer will fallback to the URL.EscapedPath() +// method and using the returned value. +// +// AWS v4 signature validation requires that the canonical string's URI path +// element must be the URI escaped form of the HTTP request's path. +// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html +// +// The Go HTTP client will perform escaping automatically on the request. Some +// of these escaping may cause signature validation errors because the HTTP +// request differs from the URI path or query that the signature was generated. +// https://golang.org/pkg/net/url/#URL.EscapedPath // -// The TestStandaloneSign unit test provides a complete example of using the -// signer outside of the SDK and pre-escaping the URI path. +// Because of this, it is recommended that when using the signer outside of the +// SDK that explicitly escaping the request prior to being signed is preferable, +// and will help prevent signature validation errors. This can be done by setting +// the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then +// call URL.EscapedPath() if Opaque is not set. // -// [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html +// Test `TestStandaloneSign` provides a complete example of using the signer +// outside of the SDK and pre-escaping the URI path. package v4 import ( diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index 20ce6ee8712..d5e6071fa24 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,31 +1,3 @@ -# v1.27.16 (2024-05-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.15 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.14 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.13 (2024-05-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.12 (2024-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.11 (2024-04-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.10 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.27.9 (2024-03-21) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 60d884c4f71..00ee2049182 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.27.16" +const goModuleVersion = "1.27.9" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index d93b31f47a4..399f0896975 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,31 +1,3 @@ -# v1.17.16 (2024-05-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.15 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.14 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.13 (2024-05-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.12 (2024-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.11 (2024-04-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.10 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.17.9 (2024-03-21) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 91c40c6e709..2b4ff3895bd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.17.16" +const goModuleVersion = "1.17.9" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index 15f2dff92d5..e07fb5ca702 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,15 +1,3 @@ -# v1.16.3 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.16.0 (2024-03-21) * **Feature**: Add config switch `DisableDefaultTimeout` that allows you to disable the default operation timeout (5 seconds) for IMDS calls. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index 18c7d54f872..a44cd1b79fc 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.16.3" +const goModuleVersion = "1.16.0" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index e5ab27663e7..86f5b137251 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,15 +1,3 @@ -# v1.3.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.5 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.3.4 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index 67cbc376748..d25782e9ce1 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.3.7" +const goModuleVersion = "1.3.4" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 5ff8fef9364..5bb02f574f9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,15 +1,3 @@ -# v2.6.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.5 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v2.6.4 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index cc9b78076ac..bb857bcb972 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.6.7" +const goModuleVersion = "2.6.4" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/CHANGELOG.md index 53164b65bde..3d155118e33 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/CHANGELOG.md @@ -1,164 +1,3 @@ -# v1.27.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.26.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.26.0 (2024-02-16) - -* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. - -# v1.25.1 (2024-02-15) - -* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field. - -# v1.25.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.7 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.6 (2023-12-20) - -* No change notes available for this release. - -# v1.24.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.24.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.24.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.3 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.23.1 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2023-11-17) - -* **Feature**: Documentation and operational updates for Amazon ECR, adding support for pull through cache rules for upstream registries that require authentication. - -# v1.22.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2023-09-11) - -* **Feature**: This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required. - -# v1.19.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2023-08-01) - -* No change notes available for this release. - -# v1.19.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.15 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.14 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.13 (2023-06-15) - -* No change notes available for this release. - -# v1.18.12 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.18.11 (2023-05-04) * No change notes available for this release. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_client.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_client.go index 9d8a1588aa0..add37d360a5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_client.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_client.go @@ -4,15 +4,12 @@ package ecr import ( "context" - "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" @@ -49,48 +46,128 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) - resolveEndpointResolverV2(&options) - - resolveAuthSchemeResolver(&options) + resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } - finalizeRetryMaxAttempts(&options) + client := &Client{ + options: options, + } - ignoreAnonymousAuth(&options) + return client +} - wrapWithAnonymousAuth(&options) +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error - resolveAuthSchemes(&options) + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode - client := &Client{ - options: options, + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) } +} - return client +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } } -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) } +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() - for _, fn := range optFns { fn(&options) } - finalizeOperationRetryMaxAttempts(&options, *c) + finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -118,89 +195,8 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - type noSmithyDocumentSerde = smithydocument.NoSerde -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -238,7 +234,6 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -246,7 +241,6 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } @@ -338,15 +332,7 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } @@ -358,39 +344,20 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ecr", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ecr", goModuleVersion)(stack) } -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { @@ -411,48 +378,12 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - }) - if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), } - return nil + return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration @@ -485,18 +416,12 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { return nil } -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - + return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { @@ -507,32 +432,3 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchCheckLayerAvailability.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchCheckLayerAvailability.go index a3c278bc982..13489da617f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchCheckLayerAvailability.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchCheckLayerAvailability.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -68,9 +68,6 @@ type BatchCheckLayerAvailabilityOutput struct { } func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchCheckLayerAvailability{}, middleware.After) if err != nil { return err @@ -79,47 +76,40 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchCheckLayerAvailability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchCheckLayerAvailabilityValidationMiddleware(stack); err != nil { @@ -128,7 +118,7 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCheckLayerAvailability(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +130,6 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -150,6 +137,7 @@ func newServiceMetadataMiddleware_opBatchCheckLayerAvailability(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "BatchCheckLayerAvailability", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchDeleteImage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchDeleteImage.go index d9846d25858..646f46a0048 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchDeleteImage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchDeleteImage.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -69,9 +69,6 @@ type BatchDeleteImageOutput struct { } func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteImage{}, middleware.After) if err != nil { return err @@ -80,47 +77,40 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchDeleteImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchDeleteImageValidationMiddleware(stack); err != nil { @@ -129,7 +119,7 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteImage(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -141,9 +131,6 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -151,6 +138,7 @@ func newServiceMetadataMiddleware_opBatchDeleteImage(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "BatchDeleteImage", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetImage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetImage.go index 756873b39fc..ce9b83a3c15 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetImage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetImage.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -71,9 +71,6 @@ type BatchGetImageOutput struct { } func (c *Client) addOperationBatchGetImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetImage{}, middleware.After) if err != nil { return err @@ -82,47 +79,40 @@ func (c *Client) addOperationBatchGetImageMiddlewares(stack *middleware.Stack, o if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchGetImageValidationMiddleware(stack); err != nil { @@ -131,7 +121,7 @@ func (c *Client) addOperationBatchGetImageMiddlewares(stack *middleware.Stack, o if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetImage(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -143,9 +133,6 @@ func (c *Client) addOperationBatchGetImageMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -153,6 +140,7 @@ func newServiceMetadataMiddleware_opBatchGetImage(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "BatchGetImage", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetRepositoryScanningConfiguration.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetRepositoryScanningConfiguration.go index 4d2a19bb230..3611dbe55ed 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetRepositoryScanningConfiguration.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_BatchGetRepositoryScanningConfiguration.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -52,9 +52,6 @@ type BatchGetRepositoryScanningConfigurationOutput struct { } func (c *Client) addOperationBatchGetRepositoryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetRepositoryScanningConfiguration{}, middleware.After) if err != nil { return err @@ -63,47 +60,40 @@ func (c *Client) addOperationBatchGetRepositoryScanningConfigurationMiddlewares( if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetRepositoryScanningConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchGetRepositoryScanningConfigurationValidationMiddleware(stack); err != nil { @@ -112,7 +102,7 @@ func (c *Client) addOperationBatchGetRepositoryScanningConfigurationMiddlewares( if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetRepositoryScanningConfiguration(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -124,9 +114,6 @@ func (c *Client) addOperationBatchGetRepositoryScanningConfigurationMiddlewares( if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -134,6 +121,7 @@ func newServiceMetadataMiddleware_opBatchGetRepositoryScanningConfiguration(regi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "BatchGetRepositoryScanningConfiguration", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CompleteLayerUpload.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CompleteLayerUpload.go index a145f4d5a67..de6185b950f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CompleteLayerUpload.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CompleteLayerUpload.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -79,9 +79,6 @@ type CompleteLayerUploadOutput struct { } func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCompleteLayerUpload{}, middleware.After) if err != nil { return err @@ -90,47 +87,40 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "CompleteLayerUpload"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCompleteLayerUploadValidationMiddleware(stack); err != nil { @@ -139,7 +129,7 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCompleteLayerUpload(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -151,9 +141,6 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -161,6 +148,7 @@ func newServiceMetadataMiddleware_opCompleteLayerUpload(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "CompleteLayerUpload", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreatePullThroughCacheRule.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreatePullThroughCacheRule.go index 8e0f2f8de6a..75c3ee4e719 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreatePullThroughCacheRule.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreatePullThroughCacheRule.go @@ -4,18 +4,16 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a pull through cache rule. A pull through cache rule provides a way to -// cache images from an upstream registry source in your Amazon ECR private -// registry. For more information, see Using pull through cache rules (https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html) -// in the Amazon Elastic Container Registry User Guide. +// cache images from an external public registry in your Amazon ECR private +// registry. func (c *Client) CreatePullThroughCacheRule(ctx context.Context, params *CreatePullThroughCacheRuleInput, optFns ...func(*Options)) (*CreatePullThroughCacheRuleOutput, error) { if params == nil { params = &CreatePullThroughCacheRuleInput{} @@ -39,31 +37,16 @@ type CreatePullThroughCacheRuleInput struct { EcrRepositoryPrefix *string // The registry URL of the upstream public registry to use as the source for the - // pull through cache rule. The following is the syntax to use for each supported - // upstream registry. - // - Amazon ECR Public ( ecr-public ) - public.ecr.aws - // - Docker Hub ( docker-hub ) - registry-1.docker.io - // - Quay ( quay ) - quay.io - // - Kubernetes ( k8s ) - registry.k8s.io - // - GitHub Container Registry ( github-container-registry ) - ghcr.io - // - Microsoft Azure Container Registry ( azure-container-registry ) - - // .azurecr.io + // pull through cache rule. // // This member is required. UpstreamRegistryUrl *string - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret that identifies the credentials to authenticate to the upstream registry. - CredentialArn *string - // The Amazon Web Services account ID associated with the registry to create the // pull through cache rule for. If you do not specify a registry, the default // registry is assumed. RegistryId *string - // The name of the upstream registry. - UpstreamRegistry types.UpstreamRegistry - noSmithyDocumentSerde } @@ -73,19 +56,12 @@ type CreatePullThroughCacheRuleOutput struct { // was created. CreatedAt *time.Time - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret associated with the pull through cache rule. - CredentialArn *string - // The Amazon ECR repository prefix associated with the pull through cache rule. EcrRepositoryPrefix *string // The registry ID associated with the request. RegistryId *string - // The name of the upstream registry associated with the pull through cache rule. - UpstreamRegistry types.UpstreamRegistry - // The upstream registry URL associated with the pull through cache rule. UpstreamRegistryUrl *string @@ -96,9 +72,6 @@ type CreatePullThroughCacheRuleOutput struct { } func (c *Client) addOperationCreatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePullThroughCacheRule{}, middleware.After) if err != nil { return err @@ -107,47 +80,40 @@ func (c *Client) addOperationCreatePullThroughCacheRuleMiddlewares(stack *middle if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePullThroughCacheRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreatePullThroughCacheRuleValidationMiddleware(stack); err != nil { @@ -156,7 +122,7 @@ func (c *Client) addOperationCreatePullThroughCacheRuleMiddlewares(stack *middle if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePullThroughCacheRule(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -168,9 +134,6 @@ func (c *Client) addOperationCreatePullThroughCacheRuleMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -178,6 +141,7 @@ func newServiceMetadataMiddleware_opCreatePullThroughCacheRule(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "CreatePullThroughCacheRule", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreateRepository.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreateRepository.go index 87088e1dd89..362fe54b605 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreateRepository.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_CreateRepository.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -32,9 +32,7 @@ type CreateRepositoryInput struct { // The name to use for the repository. The repository name may be specified on its // own (such as nginx-web-app ) or it can be prepended with a namespace to group - // the repository into a category (such as project-a/nginx-web-app ). The - // repository name must start with a letter and can only contain lowercase letters, - // numbers, hyphens, underscores, and forward slashes. + // the repository into a category (such as project-a/nginx-web-app ). // // This member is required. RepositoryName *string @@ -79,9 +77,6 @@ type CreateRepositoryOutput struct { } func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRepository{}, middleware.After) if err != nil { return err @@ -90,47 +85,40 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRepository"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateRepositoryValidationMiddleware(stack); err != nil { @@ -139,7 +127,7 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepository(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -151,9 +139,6 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -161,6 +146,7 @@ func newServiceMetadataMiddleware_opCreateRepository(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "CreateRepository", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteLifecyclePolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteLifecyclePolicy.go index 0b5887326ba..914a512cd46 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteLifecyclePolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteLifecyclePolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -63,9 +63,6 @@ type DeleteLifecyclePolicyOutput struct { } func (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLifecyclePolicy{}, middleware.After) if err != nil { return err @@ -74,47 +71,40 @@ func (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware. if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLifecyclePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteLifecyclePolicyValidationMiddleware(stack); err != nil { @@ -123,7 +113,7 @@ func (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware. if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLifecyclePolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -135,9 +125,6 @@ func (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -145,6 +132,7 @@ func newServiceMetadataMiddleware_opDeleteLifecyclePolicy(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DeleteLifecyclePolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeletePullThroughCacheRule.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeletePullThroughCacheRule.go index 3340af4fdc7..413c55a2705 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeletePullThroughCacheRule.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeletePullThroughCacheRule.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -48,10 +48,6 @@ type DeletePullThroughCacheRuleOutput struct { // The timestamp associated with the pull through cache rule. CreatedAt *time.Time - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret associated with the pull through cache rule. - CredentialArn *string - // The Amazon ECR repository prefix associated with the request. EcrRepositoryPrefix *string @@ -68,9 +64,6 @@ type DeletePullThroughCacheRuleOutput struct { } func (c *Client) addOperationDeletePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePullThroughCacheRule{}, middleware.After) if err != nil { return err @@ -79,47 +72,40 @@ func (c *Client) addOperationDeletePullThroughCacheRuleMiddlewares(stack *middle if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePullThroughCacheRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeletePullThroughCacheRuleValidationMiddleware(stack); err != nil { @@ -128,7 +114,7 @@ func (c *Client) addOperationDeletePullThroughCacheRuleMiddlewares(stack *middle if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePullThroughCacheRule(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +126,6 @@ func (c *Client) addOperationDeletePullThroughCacheRuleMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -150,6 +133,7 @@ func newServiceMetadataMiddleware_opDeletePullThroughCacheRule(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DeletePullThroughCacheRule", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRegistryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRegistryPolicy.go index 723b0f7fe86..dceab652b1b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRegistryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRegistryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -45,9 +45,6 @@ type DeleteRegistryPolicyOutput struct { } func (c *Client) addOperationDeleteRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRegistryPolicy{}, middleware.After) if err != nil { return err @@ -56,53 +53,46 @@ func (c *Client) addOperationDeleteRegistryPolicyMiddlewares(stack *middleware.S if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRegistryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRegistryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -114,9 +104,6 @@ func (c *Client) addOperationDeleteRegistryPolicyMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -124,6 +111,7 @@ func newServiceMetadataMiddleware_opDeleteRegistryPolicy(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DeleteRegistryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepository.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepository.go index aba90863379..0b2b866ce37 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepository.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepository.go @@ -4,16 +4,15 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a repository. If the repository isn't empty, you must either delete the -// contents of the repository or use the force option to delete the repository and -// have Amazon ECR delete all of its contents on your behalf. +// Deletes a repository. If the repository contains images, you must either delete +// all images in the repository or use the force option to delete the repository. func (c *Client) DeleteRepository(ctx context.Context, params *DeleteRepositoryInput, optFns ...func(*Options)) (*DeleteRepositoryOutput, error) { if params == nil { params = &DeleteRepositoryInput{} @@ -36,8 +35,7 @@ type DeleteRepositoryInput struct { // This member is required. RepositoryName *string - // If true, deleting the repository force deletes the contents of the repository. - // If false, the repository must be empty before attempting to delete it. + // If a repository contains images, forces the deletion. Force bool // The Amazon Web Services account ID associated with the registry that contains @@ -60,9 +58,6 @@ type DeleteRepositoryOutput struct { } func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepository{}, middleware.After) if err != nil { return err @@ -71,47 +66,40 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepository"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRepositoryValidationMiddleware(stack); err != nil { @@ -120,7 +108,7 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepository(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +120,6 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +127,7 @@ func newServiceMetadataMiddleware_opDeleteRepository(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DeleteRepository", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepositoryPolicy.go index 9ebd8906160..593901b8eb0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DeleteRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -60,9 +60,6 @@ type DeleteRepositoryPolicyOutput struct { } func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -71,47 +68,40 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -120,7 +110,7 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +122,6 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +129,7 @@ func newServiceMetadataMiddleware_opDeleteRepositoryPolicy(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DeleteRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageReplicationStatus.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageReplicationStatus.go index 58b518cf2f4..0085efcf27c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageReplicationStatus.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageReplicationStatus.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -64,9 +64,6 @@ type DescribeImageReplicationStatusOutput struct { } func (c *Client) addOperationDescribeImageReplicationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageReplicationStatus{}, middleware.After) if err != nil { return err @@ -75,47 +72,40 @@ func (c *Client) addOperationDescribeImageReplicationStatusMiddlewares(stack *mi if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImageReplicationStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeImageReplicationStatusValidationMiddleware(stack); err != nil { @@ -124,7 +114,7 @@ func (c *Client) addOperationDescribeImageReplicationStatusMiddlewares(stack *mi if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageReplicationStatus(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -136,9 +126,6 @@ func (c *Client) addOperationDescribeImageReplicationStatusMiddlewares(stack *mi if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -146,6 +133,7 @@ func newServiceMetadataMiddleware_opDescribeImageReplicationStatus(region string return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribeImageReplicationStatus", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageScanFindings.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageScanFindings.go index 1947caec398..f75246f03fb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageScanFindings.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImageScanFindings.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" @@ -98,9 +99,6 @@ type DescribeImageScanFindingsOutput struct { } func (c *Client) addOperationDescribeImageScanFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageScanFindings{}, middleware.After) if err != nil { return err @@ -109,47 +107,40 @@ func (c *Client) addOperationDescribeImageScanFindingsMiddlewares(stack *middlew if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImageScanFindings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeImageScanFindingsValidationMiddleware(stack); err != nil { @@ -158,7 +149,7 @@ func (c *Client) addOperationDescribeImageScanFindingsMiddlewares(stack *middlew if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageScanFindings(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -170,9 +161,6 @@ func (c *Client) addOperationDescribeImageScanFindingsMiddlewares(stack *middlew if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -281,17 +269,8 @@ type ImageScanCompleteWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - // MinDelay is the minimum amount of time to delay between retries. If unset, // ImageScanCompleteWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. @@ -390,9 +369,6 @@ func (w *ImageScanCompleteWaiter) WaitForOutput(ctx context.Context, params *Des out, err := w.client.DescribeImageScanFindings(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range options.ClientOptions { - opt(o) - } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -468,6 +444,7 @@ func newServiceMetadataMiddleware_opDescribeImageScanFindings(region string) *aw return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribeImageScanFindings", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImages.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImages.go index 70894b9e57e..dd8e354bc26 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImages.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeImages.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -87,9 +88,6 @@ type DescribeImagesOutput struct { } func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImages{}, middleware.After) if err != nil { return err @@ -98,47 +96,40 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeImagesValidationMiddleware(stack); err != nil { @@ -147,7 +138,7 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImages(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -159,9 +150,6 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -266,6 +254,7 @@ func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribeImages", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribePullThroughCacheRules.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribePullThroughCacheRules.go index aff6fabeb07..fc0b4f64e32 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribePullThroughCacheRules.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribePullThroughCacheRules.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -78,9 +79,6 @@ type DescribePullThroughCacheRulesOutput struct { } func (c *Client) addOperationDescribePullThroughCacheRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePullThroughCacheRules{}, middleware.After) if err != nil { return err @@ -89,53 +87,46 @@ func (c *Client) addOperationDescribePullThroughCacheRulesMiddlewares(stack *mid if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePullThroughCacheRules"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePullThroughCacheRules(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -147,9 +138,6 @@ func (c *Client) addOperationDescribePullThroughCacheRulesMiddlewares(stack *mid if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -258,6 +246,7 @@ func newServiceMetadataMiddleware_opDescribePullThroughCacheRules(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribePullThroughCacheRules", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRegistry.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRegistry.go index c6eeffe540a..79482a793bc 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRegistry.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRegistry.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,9 +48,6 @@ type DescribeRegistryOutput struct { } func (c *Client) addOperationDescribeRegistryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRegistry{}, middleware.After) if err != nil { return err @@ -59,53 +56,46 @@ func (c *Client) addOperationDescribeRegistryMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRegistry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRegistry(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -117,9 +107,6 @@ func (c *Client) addOperationDescribeRegistryMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -127,6 +114,7 @@ func newServiceMetadataMiddleware_opDescribeRegistry(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribeRegistry", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRepositories.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRepositories.go index e2b89ff3c2d..ccf2a1b189c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRepositories.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_DescribeRepositories.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -80,9 +81,6 @@ type DescribeRepositoriesOutput struct { } func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRepositories{}, middleware.After) if err != nil { return err @@ -91,53 +89,46 @@ func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.S if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRepositories"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRepositories(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -149,9 +140,6 @@ func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -258,6 +246,7 @@ func newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "DescribeRepositories", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetAuthorizationToken.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetAuthorizationToken.go index 842f8768b1a..da84860fb75 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetAuthorizationToken.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetAuthorizationToken.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -62,9 +62,6 @@ type GetAuthorizationTokenOutput struct { } func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAuthorizationToken{}, middleware.After) if err != nil { return err @@ -73,53 +70,46 @@ func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware. if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAuthorizationToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAuthorizationToken(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -131,9 +121,6 @@ func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -141,6 +128,7 @@ func newServiceMetadataMiddleware_opGetAuthorizationToken(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetAuthorizationToken", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetDownloadUrlForLayer.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetDownloadUrlForLayer.go index 80808c74002..1873ca1a019 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetDownloadUrlForLayer.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetDownloadUrlForLayer.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -66,9 +66,6 @@ type GetDownloadUrlForLayerOutput struct { } func (c *Client) addOperationGetDownloadUrlForLayerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDownloadUrlForLayer{}, middleware.After) if err != nil { return err @@ -77,47 +74,40 @@ func (c *Client) addOperationGetDownloadUrlForLayerMiddlewares(stack *middleware if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDownloadUrlForLayer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDownloadUrlForLayerValidationMiddleware(stack); err != nil { @@ -126,7 +116,7 @@ func (c *Client) addOperationGetDownloadUrlForLayerMiddlewares(stack *middleware if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDownloadUrlForLayer(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -138,9 +128,6 @@ func (c *Client) addOperationGetDownloadUrlForLayerMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -148,6 +135,7 @@ func newServiceMetadataMiddleware_opGetDownloadUrlForLayer(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetDownloadUrlForLayer", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicy.go index 158119f9b9c..43baec00a01 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -63,9 +63,6 @@ type GetLifecyclePolicyOutput struct { } func (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLifecyclePolicy{}, middleware.After) if err != nil { return err @@ -74,47 +71,40 @@ func (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Sta if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetLifecyclePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetLifecyclePolicyValidationMiddleware(stack); err != nil { @@ -123,7 +113,7 @@ func (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Sta if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLifecyclePolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -135,9 +125,6 @@ func (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -145,6 +132,7 @@ func newServiceMetadataMiddleware_opGetLifecyclePolicy(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetLifecyclePolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicyPreview.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicyPreview.go index c88325e08c1..1b6c4c7dd6f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicyPreview.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetLifecyclePolicyPreview.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" @@ -107,9 +108,6 @@ type GetLifecyclePolicyPreviewOutput struct { } func (c *Client) addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLifecyclePolicyPreview{}, middleware.After) if err != nil { return err @@ -118,47 +116,40 @@ func (c *Client) addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middlew if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetLifecyclePolicyPreview"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetLifecyclePolicyPreviewValidationMiddleware(stack); err != nil { @@ -167,7 +158,7 @@ func (c *Client) addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middlew if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -179,9 +170,6 @@ func (c *Client) addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middlew if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -293,17 +281,8 @@ type LifecyclePolicyPreviewCompleteWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - // MinDelay is the minimum amount of time to delay between retries. If unset, // LifecyclePolicyPreviewCompleteWaiter will use default minimum delay of 5 // seconds. Note that MinDelay must resolve to a value lesser than or equal to the @@ -406,9 +385,6 @@ func (w *LifecyclePolicyPreviewCompleteWaiter) WaitForOutput(ctx context.Context out, err := w.client.GetLifecyclePolicyPreview(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range options.ClientOptions { - opt(o) - } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -484,6 +460,7 @@ func newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(region string) *aw return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetLifecyclePolicyPreview", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryPolicy.go index 9e66e19217b..995a4c6d630 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -45,9 +45,6 @@ type GetRegistryPolicyOutput struct { } func (c *Client) addOperationGetRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryPolicy{}, middleware.After) if err != nil { return err @@ -56,53 +53,46 @@ func (c *Client) addOperationGetRegistryPolicyMiddlewares(stack *middleware.Stac if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRegistryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -114,9 +104,6 @@ func (c *Client) addOperationGetRegistryPolicyMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -124,6 +111,7 @@ func newServiceMetadataMiddleware_opGetRegistryPolicy(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetRegistryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryScanningConfiguration.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryScanningConfiguration.go index ae28541948a..46e3803fed5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryScanningConfiguration.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRegistryScanningConfiguration.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -46,9 +46,6 @@ type GetRegistryScanningConfigurationOutput struct { } func (c *Client) addOperationGetRegistryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryScanningConfiguration{}, middleware.After) if err != nil { return err @@ -57,53 +54,46 @@ func (c *Client) addOperationGetRegistryScanningConfigurationMiddlewares(stack * if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRegistryScanningConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryScanningConfiguration(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -115,9 +105,6 @@ func (c *Client) addOperationGetRegistryScanningConfigurationMiddlewares(stack * if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -125,6 +112,7 @@ func newServiceMetadataMiddleware_opGetRegistryScanningConfiguration(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetRegistryScanningConfiguration", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRepositoryPolicy.go index c74d9e684d4..0e87864b6a8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_GetRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -59,9 +59,6 @@ type GetRepositoryPolicyOutput struct { } func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -70,47 +67,40 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -119,7 +109,7 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -131,9 +121,6 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -141,6 +128,7 @@ func newServiceMetadataMiddleware_opGetRepositoryPolicy(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "GetRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_InitiateLayerUpload.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_InitiateLayerUpload.go index 678763f4ddb..d00c727e242 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_InitiateLayerUpload.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_InitiateLayerUpload.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -63,9 +63,6 @@ type InitiateLayerUploadOutput struct { } func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpInitiateLayerUpload{}, middleware.After) if err != nil { return err @@ -74,47 +71,40 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "InitiateLayerUpload"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpInitiateLayerUploadValidationMiddleware(stack); err != nil { @@ -123,7 +113,7 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitiateLayerUpload(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -135,9 +125,6 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -145,6 +132,7 @@ func newServiceMetadataMiddleware_opInitiateLayerUpload(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "InitiateLayerUpload", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListImages.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListImages.go index 95a1ce2ca3f..f5cb17500d9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListImages.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListImages.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -85,9 +86,6 @@ type ListImagesOutput struct { } func (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListImages{}, middleware.After) if err != nil { return err @@ -96,47 +94,40 @@ func (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, opti if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListImagesValidationMiddleware(stack); err != nil { @@ -145,7 +136,7 @@ func (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, opti if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImages(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -157,9 +148,6 @@ func (c *Client) addOperationListImagesMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -262,6 +250,7 @@ func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.Reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "ListImages", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListTagsForResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListTagsForResource.go index a833645c982..850acd2600e 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListTagsForResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ListTagsForResource.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -50,9 +50,6 @@ type ListTagsForResourceOutput struct { } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err @@ -61,47 +58,40 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { @@ -110,7 +100,7 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -122,9 +112,6 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -132,6 +119,7 @@ func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "ListTagsForResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImage.go index 3bbebb033e3..00269b087cb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImage.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -77,9 +77,6 @@ type PutImageOutput struct { } func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImage{}, middleware.After) if err != nil { return err @@ -88,47 +85,40 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutImageValidationMiddleware(stack); err != nil { @@ -137,7 +127,7 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImage(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -149,9 +139,6 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -159,6 +146,7 @@ func newServiceMetadataMiddleware_opPutImage(region string) *awsmiddleware.Regis return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutImage", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageScanningConfiguration.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageScanningConfiguration.go index e8ff335886f..fbbc75cac37 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageScanningConfiguration.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageScanningConfiguration.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -71,9 +71,6 @@ type PutImageScanningConfigurationOutput struct { } func (c *Client) addOperationPutImageScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImageScanningConfiguration{}, middleware.After) if err != nil { return err @@ -82,47 +79,40 @@ func (c *Client) addOperationPutImageScanningConfigurationMiddlewares(stack *mid if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutImageScanningConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutImageScanningConfigurationValidationMiddleware(stack); err != nil { @@ -131,7 +121,7 @@ func (c *Client) addOperationPutImageScanningConfigurationMiddlewares(stack *mid if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImageScanningConfiguration(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -143,9 +133,6 @@ func (c *Client) addOperationPutImageScanningConfigurationMiddlewares(stack *mid if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -153,6 +140,7 @@ func newServiceMetadataMiddleware_opPutImageScanningConfiguration(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutImageScanningConfiguration", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageTagMutability.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageTagMutability.go index 8fde2774f6b..bd5a2f4f9be 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageTagMutability.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutImageTagMutability.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -69,9 +69,6 @@ type PutImageTagMutabilityOutput struct { } func (c *Client) addOperationPutImageTagMutabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImageTagMutability{}, middleware.After) if err != nil { return err @@ -80,47 +77,40 @@ func (c *Client) addOperationPutImageTagMutabilityMiddlewares(stack *middleware. if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutImageTagMutability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutImageTagMutabilityValidationMiddleware(stack); err != nil { @@ -129,7 +119,7 @@ func (c *Client) addOperationPutImageTagMutabilityMiddlewares(stack *middleware. if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImageTagMutability(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -141,9 +131,6 @@ func (c *Client) addOperationPutImageTagMutabilityMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -151,6 +138,7 @@ func newServiceMetadataMiddleware_opPutImageTagMutability(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutImageTagMutability", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutLifecyclePolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutLifecyclePolicy.go index 133ddac4eef..8a46dfecf05 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutLifecyclePolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutLifecyclePolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -66,9 +66,6 @@ type PutLifecyclePolicyOutput struct { } func (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutLifecyclePolicy{}, middleware.After) if err != nil { return err @@ -77,47 +74,40 @@ func (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Sta if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutLifecyclePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutLifecyclePolicyValidationMiddleware(stack); err != nil { @@ -126,7 +116,7 @@ func (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Sta if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutLifecyclePolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -138,9 +128,6 @@ func (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -148,6 +135,7 @@ func newServiceMetadataMiddleware_opPutLifecyclePolicy(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutLifecyclePolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryPolicy.go index 92ca78c10f1..b02b9353a8c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -57,9 +57,6 @@ type PutRegistryPolicyOutput struct { } func (c *Client) addOperationPutRegistryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryPolicy{}, middleware.After) if err != nil { return err @@ -68,47 +65,40 @@ func (c *Client) addOperationPutRegistryPolicyMiddlewares(stack *middleware.Stac if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutRegistryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutRegistryPolicyValidationMiddleware(stack); err != nil { @@ -117,7 +107,7 @@ func (c *Client) addOperationPutRegistryPolicyMiddlewares(stack *middleware.Stac if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -129,9 +119,6 @@ func (c *Client) addOperationPutRegistryPolicyMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -139,6 +126,7 @@ func newServiceMetadataMiddleware_opPutRegistryPolicy(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutRegistryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryScanningConfiguration.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryScanningConfiguration.go index 74e4ac2895e..4d0f207cfd1 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryScanningConfiguration.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutRegistryScanningConfiguration.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -60,9 +60,6 @@ type PutRegistryScanningConfigurationOutput struct { } func (c *Client) addOperationPutRegistryScanningConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryScanningConfiguration{}, middleware.After) if err != nil { return err @@ -71,47 +68,40 @@ func (c *Client) addOperationPutRegistryScanningConfigurationMiddlewares(stack * if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutRegistryScanningConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutRegistryScanningConfigurationValidationMiddleware(stack); err != nil { @@ -120,7 +110,7 @@ func (c *Client) addOperationPutRegistryScanningConfigurationMiddlewares(stack * if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryScanningConfiguration(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +122,6 @@ func (c *Client) addOperationPutRegistryScanningConfigurationMiddlewares(stack * if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +129,7 @@ func newServiceMetadataMiddleware_opPutRegistryScanningConfiguration(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutRegistryScanningConfiguration", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutReplicationConfiguration.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutReplicationConfiguration.go index 9d5b3cc821e..5f655241519 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutReplicationConfiguration.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_PutReplicationConfiguration.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -58,9 +58,6 @@ type PutReplicationConfigurationOutput struct { } func (c *Client) addOperationPutReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutReplicationConfiguration{}, middleware.After) if err != nil { return err @@ -69,47 +66,40 @@ func (c *Client) addOperationPutReplicationConfigurationMiddlewares(stack *middl if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutReplicationConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutReplicationConfigurationValidationMiddleware(stack); err != nil { @@ -118,7 +108,7 @@ func (c *Client) addOperationPutReplicationConfigurationMiddlewares(stack *middl if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutReplicationConfiguration(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -130,9 +120,6 @@ func (c *Client) addOperationPutReplicationConfigurationMiddlewares(stack *middl if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -140,6 +127,7 @@ func newServiceMetadataMiddleware_opPutReplicationConfiguration(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "PutReplicationConfiguration", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_SetRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_SetRepositoryPolicy.go index 62a700b2ad0..8f0eb1b57d3 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_SetRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_SetRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -74,9 +74,6 @@ type SetRepositoryPolicyOutput struct { } func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -85,47 +82,40 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "SetRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpSetRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -134,7 +124,7 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -146,9 +136,6 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -156,6 +143,7 @@ func newServiceMetadataMiddleware_opSetRepositoryPolicy(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "SetRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartImageScan.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartImageScan.go index 1a2cd6eb728..81b58403eb0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartImageScan.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartImageScan.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -71,9 +71,6 @@ type StartImageScanOutput struct { } func (c *Client) addOperationStartImageScanMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartImageScan{}, middleware.After) if err != nil { return err @@ -82,47 +79,40 @@ func (c *Client) addOperationStartImageScanMiddlewares(stack *middleware.Stack, if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartImageScan"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartImageScanValidationMiddleware(stack); err != nil { @@ -131,7 +121,7 @@ func (c *Client) addOperationStartImageScanMiddlewares(stack *middleware.Stack, if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImageScan(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -143,9 +133,6 @@ func (c *Client) addOperationStartImageScanMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -153,6 +140,7 @@ func newServiceMetadataMiddleware_opStartImageScan(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "StartImageScan", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartLifecyclePolicyPreview.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartLifecyclePolicyPreview.go index 95855b0b973..69db5c084d7 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartLifecyclePolicyPreview.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_StartLifecyclePolicyPreview.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -69,9 +69,6 @@ type StartLifecyclePolicyPreviewOutput struct { } func (c *Client) addOperationStartLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartLifecyclePolicyPreview{}, middleware.After) if err != nil { return err @@ -80,47 +77,40 @@ func (c *Client) addOperationStartLifecyclePolicyPreviewMiddlewares(stack *middl if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartLifecyclePolicyPreview"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartLifecyclePolicyPreviewValidationMiddleware(stack); err != nil { @@ -129,7 +119,7 @@ func (c *Client) addOperationStartLifecyclePolicyPreviewMiddlewares(stack *middl if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartLifecyclePolicyPreview(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -141,9 +131,6 @@ func (c *Client) addOperationStartLifecyclePolicyPreviewMiddlewares(stack *middl if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -151,6 +138,7 @@ func newServiceMetadataMiddleware_opStartLifecyclePolicyPreview(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "StartLifecyclePolicyPreview", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_TagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_TagResource.go index 683bc667e86..84e860d5719 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_TagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_TagResource.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -54,9 +54,6 @@ type TagResourceOutput struct { } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) if err != nil { return err @@ -65,47 +62,40 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { @@ -114,7 +104,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -126,9 +116,6 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -136,6 +123,7 @@ func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "TagResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UntagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UntagResource.go index d1f57f68c50..412384aa1eb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UntagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UntagResource.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -50,9 +50,6 @@ type UntagResourceOutput struct { } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) if err != nil { return err @@ -61,47 +58,40 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { @@ -110,7 +100,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -122,9 +112,6 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -132,6 +119,7 @@ func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "UntagResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UpdatePullThroughCacheRule.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UpdatePullThroughCacheRule.go deleted file mode 100644 index 7b55a8016a8..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UpdatePullThroughCacheRule.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecr - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Updates an existing pull through cache rule. -func (c *Client) UpdatePullThroughCacheRule(ctx context.Context, params *UpdatePullThroughCacheRuleInput, optFns ...func(*Options)) (*UpdatePullThroughCacheRuleOutput, error) { - if params == nil { - params = &UpdatePullThroughCacheRuleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdatePullThroughCacheRule", params, optFns, c.addOperationUpdatePullThroughCacheRuleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdatePullThroughCacheRuleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdatePullThroughCacheRuleInput struct { - - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret that identifies the credentials to authenticate to the upstream registry. - // - // This member is required. - CredentialArn *string - - // The repository name prefix to use when caching images from the source registry. - // - // This member is required. - EcrRepositoryPrefix *string - - // The Amazon Web Services account ID associated with the registry associated with - // the pull through cache rule. If you do not specify a registry, the default - // registry is assumed. - RegistryId *string - - noSmithyDocumentSerde -} - -type UpdatePullThroughCacheRuleOutput struct { - - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret associated with the pull through cache rule. - CredentialArn *string - - // The Amazon ECR repository prefix associated with the pull through cache rule. - EcrRepositoryPrefix *string - - // The registry ID associated with the request. - RegistryId *string - - // The date and time, in JavaScript date format, when the pull through cache rule - // was updated. - UpdatedAt *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePullThroughCacheRule{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePullThroughCacheRule{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePullThroughCacheRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpUpdatePullThroughCacheRuleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePullThroughCacheRule(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdatePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdatePullThroughCacheRule", - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UploadLayerPart.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UploadLayerPart.go index b5160be8d58..60abba05659 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UploadLayerPart.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_UploadLayerPart.go @@ -4,8 +4,8 @@ package ecr import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -88,9 +88,6 @@ type UploadLayerPartOutput struct { } func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUploadLayerPart{}, middleware.After) if err != nil { return err @@ -99,47 +96,40 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "UploadLayerPart"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUploadLayerPartValidationMiddleware(stack); err != nil { @@ -148,7 +138,7 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUploadLayerPart(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -160,9 +150,6 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -170,6 +157,7 @@ func newServiceMetadataMiddleware_opUploadLayerPart(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr", OperationName: "UploadLayerPart", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ValidatePullThroughCacheRule.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ValidatePullThroughCacheRule.go deleted file mode 100644 index 7a97f666052..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/api_op_ValidatePullThroughCacheRule.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecr - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Validates an existing pull through cache rule for an upstream registry that -// requires authentication. This will retrieve the contents of the Amazon Web -// Services Secrets Manager secret, verify the syntax, and then validate that -// authentication to the upstream registry is successful. -func (c *Client) ValidatePullThroughCacheRule(ctx context.Context, params *ValidatePullThroughCacheRuleInput, optFns ...func(*Options)) (*ValidatePullThroughCacheRuleOutput, error) { - if params == nil { - params = &ValidatePullThroughCacheRuleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ValidatePullThroughCacheRule", params, optFns, c.addOperationValidatePullThroughCacheRuleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ValidatePullThroughCacheRuleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ValidatePullThroughCacheRuleInput struct { - - // The repository name prefix associated with the pull through cache rule. - // - // This member is required. - EcrRepositoryPrefix *string - - // The registry ID associated with the pull through cache rule. If you do not - // specify a registry, the default registry is assumed. - RegistryId *string - - noSmithyDocumentSerde -} - -type ValidatePullThroughCacheRuleOutput struct { - - // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager - // secret associated with the pull through cache rule. - CredentialArn *string - - // The Amazon ECR repository prefix associated with the pull through cache rule. - EcrRepositoryPrefix *string - - // The reason the validation failed. For more details about possible causes and - // how to address them, see Using pull through cache rules (https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html) - // in the Amazon Elastic Container Registry User Guide. - Failure *string - - // Whether or not the pull through cache rule was validated. If true , Amazon ECR - // was able to reach the upstream registry and authentication was successful. If - // false , there was an issue and validation failed. The failure reason indicates - // the cause. - IsValid bool - - // The registry ID associated with the request. - RegistryId *string - - // The upstream registry URL associated with the pull through cache rule. - UpstreamRegistryUrl *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationValidatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpValidatePullThroughCacheRule{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpValidatePullThroughCacheRule{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ValidatePullThroughCacheRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpValidatePullThroughCacheRuleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidatePullThroughCacheRule(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opValidatePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ValidatePullThroughCacheRule", - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/auth.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/auth.go deleted file mode 100644 index 86ba7edf6b8..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/auth.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecr - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "ecr") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/deserializers.go index d4c99343a8b..79c79b7aba6 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/deserializers.go @@ -88,6 +88,9 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -95,7 +98,7 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -107,12 +110,13 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -201,6 +205,9 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -208,7 +215,7 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -220,12 +227,13 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -314,6 +322,9 @@ func awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -321,7 +332,7 @@ func awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -333,28 +344,23 @@ func awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("RepositoryNotFoundException", errorCode): return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("UnableToGetUpstreamImageException", errorCode): - return awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -433,6 +439,9 @@ func awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(resp errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -440,7 +449,7 @@ func awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -452,12 +461,13 @@ func awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(resp } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -549,6 +559,9 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -556,7 +569,7 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -568,12 +581,13 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("EmptyUploadException", errorCode): return awsAwsjson11_deserializeErrorEmptyUploadException(response, errorBody) @@ -680,6 +694,9 @@ func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyh errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -687,7 +704,7 @@ func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -699,12 +716,13 @@ func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyh } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -715,18 +733,9 @@ func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyh case strings.EqualFold("PullThroughCacheRuleAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response, errorBody) - case strings.EqualFold("SecretNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody) - case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("UnableToAccessSecretException", errorCode): - return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody) - - case strings.EqualFold("UnableToDecryptSecretValueException", errorCode): - return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody) - case strings.EqualFold("UnsupportedUpstreamRegistryException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response, errorBody) @@ -811,6 +820,9 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -818,7 +830,7 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -830,12 +842,13 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -936,6 +949,9 @@ func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.R errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -943,7 +959,7 @@ func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -955,12 +971,13 @@ func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -974,9 +991,6 @@ func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.R case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1055,6 +1069,9 @@ func awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response *smithyh errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1062,7 +1079,7 @@ func awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1074,12 +1091,13 @@ func awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response *smithyh } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1171,6 +1189,9 @@ func awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response *smithyhttp.Re errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1178,7 +1199,7 @@ func awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1190,12 +1211,13 @@ func awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1287,6 +1309,9 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1294,7 +1319,7 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1306,12 +1331,13 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1406,6 +1432,9 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1413,7 +1442,7 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1425,12 +1454,13 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1522,6 +1552,9 @@ func awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response *smi errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1529,7 +1562,7 @@ func awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response *smi body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1541,12 +1574,13 @@ func awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response *smi } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageNotFoundException", errorCode): return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody) @@ -1641,6 +1675,9 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1648,7 +1685,7 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1660,12 +1697,13 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageNotFoundException", errorCode): return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody) @@ -1757,6 +1795,9 @@ func awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response *smithyht errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1764,7 +1805,7 @@ func awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response *smithyht body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1776,12 +1817,13 @@ func awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response *smithyht } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageNotFoundException", errorCode): return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody) @@ -1879,6 +1921,9 @@ func awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response *smit errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1886,7 +1931,7 @@ func awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response *smit body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1898,12 +1943,13 @@ func awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response *smit } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1995,6 +2041,9 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistry(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2002,7 +2051,7 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistry(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2014,12 +2063,13 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistry(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2108,6 +2158,9 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2115,7 +2168,7 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2127,12 +2180,13 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2221,6 +2275,9 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2228,7 +2285,7 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2240,12 +2297,13 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2331,6 +2389,9 @@ func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp. errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2338,7 +2399,7 @@ func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2350,12 +2411,13 @@ func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2372,9 +2434,6 @@ func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp. case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("UnableToGetUpstreamLayerException", errorCode): - return awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2453,6 +2512,9 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Resp errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2460,7 +2522,7 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2472,12 +2534,13 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2491,9 +2554,6 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Resp case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2572,6 +2632,9 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyht errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2579,7 +2642,7 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyht body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2591,12 +2654,13 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyht } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2610,9 +2674,6 @@ func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyht case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2691,6 +2752,9 @@ func awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response *smithyhttp.Respo errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2698,7 +2762,7 @@ func awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2710,12 +2774,13 @@ func awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2807,6 +2872,9 @@ func awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response *s errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2814,7 +2882,7 @@ func awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response *s body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2826,12 +2894,13 @@ func awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response *s } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2920,6 +2989,9 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2927,7 +2999,7 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2939,12 +3011,13 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3036,6 +3109,9 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3043,7 +3119,7 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3055,12 +3131,13 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3152,6 +3229,9 @@ func awsAwsjson11_deserializeOpErrorListImages(response *smithyhttp.Response, me errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3159,7 +3239,7 @@ func awsAwsjson11_deserializeOpErrorListImages(response *smithyhttp.Response, me body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3171,12 +3251,13 @@ func awsAwsjson11_deserializeOpErrorListImages(response *smithyhttp.Response, me } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3265,6 +3346,9 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3272,7 +3356,7 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3284,12 +3368,13 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3378,6 +3463,9 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3385,7 +3473,7 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3397,12 +3485,13 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorImageAlreadyExistsException(response, errorBody) @@ -3512,6 +3601,9 @@ func awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response *smit errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3519,7 +3611,7 @@ func awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response *smit body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3531,12 +3623,13 @@ func awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response *smit } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3628,6 +3721,9 @@ func awsAwsjson11_deserializeOpErrorPutImageTagMutability(response *smithyhttp.R errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3635,7 +3731,7 @@ func awsAwsjson11_deserializeOpErrorPutImageTagMutability(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3647,12 +3743,13 @@ func awsAwsjson11_deserializeOpErrorPutImageTagMutability(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3741,6 +3838,9 @@ func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Resp errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3748,7 +3848,7 @@ func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3760,12 +3860,13 @@ func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3776,9 +3877,6 @@ func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Resp case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3857,6 +3955,9 @@ func awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response *smithyhttp.Respo errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3864,7 +3965,7 @@ func awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3876,12 +3977,13 @@ func awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3970,6 +4072,9 @@ func awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response *s errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3977,7 +4082,7 @@ func awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response *s body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3989,12 +4094,13 @@ func awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response *s } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4083,6 +4189,9 @@ func awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response *smithy errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4090,7 +4199,7 @@ func awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4102,12 +4211,13 @@ func awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response *smithy } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4196,6 +4306,9 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4203,7 +4316,7 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4215,12 +4328,13 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4309,6 +4423,9 @@ func awsAwsjson11_deserializeOpErrorStartImageScan(response *smithyhttp.Response errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4316,7 +4433,7 @@ func awsAwsjson11_deserializeOpErrorStartImageScan(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4328,12 +4445,13 @@ func awsAwsjson11_deserializeOpErrorStartImageScan(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageNotFoundException", errorCode): return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody) @@ -4434,6 +4552,9 @@ func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithy errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4441,7 +4562,7 @@ func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4453,12 +4574,13 @@ func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithy } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4475,9 +4597,6 @@ func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithy case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4556,6 +4675,9 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4563,7 +4685,7 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4575,12 +4697,13 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4675,6 +4798,9 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4682,7 +4808,7 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4694,12 +4820,13 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4726,14 +4853,14 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdatePullThroughCacheRule struct { +type awsAwsjson11_deserializeOpUploadLayerPart struct { } -func (*awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) ID() string { +func (*awsAwsjson11_deserializeOpUploadLayerPart) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4747,9 +4874,9 @@ func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUploadLayerPart(response, &metadata) } - output := &UpdatePullThroughCacheRuleOutput{} + output := &UploadLayerPartOutput{} out.Result = output var buff [1024]byte @@ -4769,7 +4896,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4783,7 +4910,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4794,6 +4921,9 @@ func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyh errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4801,7 +4931,7 @@ func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4813,33 +4943,34 @@ func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyh } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { + case strings.EqualFold("InvalidLayerPartException", errorCode): + return awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody) + case strings.EqualFold("KmsException", errorCode): + return awsAwsjson11_deserializeErrorKmsException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("SecretNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody) + case strings.EqualFold("RepositoryNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("UnableToAccessSecretException", errorCode): - return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody) - - case strings.EqualFold("UnableToDecryptSecretValueException", errorCode): - return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + case strings.EqualFold("UploadNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4851,36 +4982,11 @@ func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyh } } -type awsAwsjson11_deserializeOpUploadLayerPart struct { -} - -func (*awsAwsjson11_deserializeOpUploadLayerPart) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUploadLayerPart(response, &metadata) - } - output := &UploadLayerPartOutput{} - out.Result = output - +func awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4891,10 +4997,12 @@ func (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx contex Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(&output, shape) + output := &types.EmptyUploadException{} + err := awsAwsjson11_deserializeDocumentEmptyUploadException(&output, shape) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4902,32 +5010,22 @@ func (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx contex Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - return out, metadata, err + errorBody.Seek(0, io.SeekStart) + return output } -func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - +func awsAwsjson11_deserializeErrorImageAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4937,75 +5035,28 @@ func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Respons return err } - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidLayerPartException", errorCode): - return awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("KmsException", errorCode): - return awsAwsjson11_deserializeErrorKmsException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RepositoryNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsAwsjson11_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("UploadNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody) + output := &types.ImageAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentImageAlreadyExistsException(&output, shape) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } - return genericError - + return err } -} - -type awsAwsjson11_deserializeOpValidatePullThroughCacheRule struct { -} -func (*awsAwsjson11_deserializeOpValidatePullThroughCacheRule) ID() string { - return "OperationDeserializer" + errorBody.Seek(0, io.SeekStart) + return output } -func (m *awsAwsjson11_deserializeOpValidatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorValidatePullThroughCacheRule(response, &metadata) - } - output := &ValidatePullThroughCacheRuleOutput{} - out.Result = output - +func awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -5016,173 +5067,12 @@ func (m *awsAwsjson11_deserializeOpValidatePullThroughCacheRule) HandleDeseriali Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsAwsjson11_deserializeOpDocumentValidatePullThroughCacheRuleOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorValidatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsAwsjson11_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.EmptyUploadException{} - err := awsAwsjson11_deserializeDocumentEmptyUploadException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorImageAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ImageAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentImageAlreadyExistsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ImageDigestDoesNotMatchException{} - err := awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(&output, shape) - + output := &types.ImageDigestDoesNotMatchException{} + err := awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(&output, shape) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5827,182 +5717,7 @@ func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *sm return output } -func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RegistryPolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RepositoryAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RepositoryNotEmptyException{} - err := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RepositoryNotFoundException{} - err := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RepositoryPolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6020,8 +5735,8 @@ func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Res return err } - output := &types.ScanNotFoundException{} - err := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape) + output := &types.RegistryPolicyNotFoundException{} + err := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6037,7 +5752,7 @@ func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Res return output } -func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6055,8 +5770,8 @@ func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.R return err } - output := &types.SecretNotFoundException{} - err := awsAwsjson11_deserializeDocumentSecretNotFoundException(&output, shape) + output := &types.RepositoryAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6072,7 +5787,7 @@ func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.R return output } -func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6090,8 +5805,8 @@ func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, return err } - output := &types.ServerException{} - err := awsAwsjson11_deserializeDocumentServerException(&output, shape) + output := &types.RepositoryNotEmptyException{} + err := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6107,7 +5822,7 @@ func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, return output } -func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6125,8 +5840,8 @@ func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Resp return err } - output := &types.TooManyTagsException{} - err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) + output := &types.RepositoryNotFoundException{} + err := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6142,7 +5857,7 @@ func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Resp return output } -func awsAwsjson11_deserializeErrorUnableToAccessSecretException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6160,8 +5875,8 @@ func awsAwsjson11_deserializeErrorUnableToAccessSecretException(response *smithy return err } - output := &types.UnableToAccessSecretException{} - err := awsAwsjson11_deserializeDocumentUnableToAccessSecretException(&output, shape) + output := &types.RepositoryPolicyNotFoundException{} + err := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6177,7 +5892,7 @@ func awsAwsjson11_deserializeErrorUnableToAccessSecretException(response *smithy return output } -func awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6195,8 +5910,8 @@ func awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response * return err } - output := &types.UnableToDecryptSecretValueException{} - err := awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(&output, shape) + output := &types.ScanNotFoundException{} + err := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6212,7 +5927,7 @@ func awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response * return output } -func awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6230,8 +5945,8 @@ func awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response *sm return err } - output := &types.UnableToGetUpstreamImageException{} - err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(&output, shape) + output := &types.ServerException{} + err := awsAwsjson11_deserializeDocumentServerException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6247,7 +5962,7 @@ func awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response *sm return output } -func awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6265,8 +5980,8 @@ func awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response *sm return err } - output := &types.UnableToGetUpstreamLayerException{} - err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(&output, shape) + output := &types.TooManyTagsException{} + err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -9616,15 +9331,6 @@ func awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughC } } - case "credentialArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) - } - sv.CredentialArn = ptr.String(jtv) - } - case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -9643,31 +9349,6 @@ func awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughC sv.RegistryId = ptr.String(jtv) } - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "upstreamRegistry": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value) - } - sv.UpstreamRegistry = types.UpstreamRegistry(jtv) - } - case "upstreamRegistryUrl": if value != nil { jtv, ok := value.(string) @@ -11214,212 +10895,13 @@ func awsAwsjson11_deserializeDocumentScoreDetails(v **types.ScoreDetails, value default: _, _ = key, value - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSecretNotFoundException(v **types.SecretNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SecretNotFoundException - if *v == nil { - sv = &types.SecretNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServerException - if *v == nil { - sv = &types.ServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Tag - if *v == nil { - sv = &types.Tag{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Tag - if *v == nil { - cv = []types.Tag{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Tag - destAddr := &col - if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - + } } - *v = mv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { +func awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11432,9 +10914,9 @@ func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TooManyTagsException + var sv *types.ServerException if *v == nil { - sv = &types.TooManyTagsException{} + sv = &types.ServerException{} } else { sv = *v } @@ -11459,7 +10941,7 @@ func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return nil } -func awsAwsjson11_deserializeDocumentUnableToAccessSecretException(v **types.UnableToAccessSecretException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11472,22 +10954,31 @@ func awsAwsjson11_deserializeDocumentUnableToAccessSecretException(v **types.Una return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnableToAccessSecretException + var sv *types.Tag if *v == nil { - sv = &types.UnableToAccessSecretException{} + sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "Key": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) } default: @@ -11499,7 +10990,7 @@ func awsAwsjson11_deserializeDocumentUnableToAccessSecretException(v **types.Una return nil } -func awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(v **types.UnableToDecryptSecretValueException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11507,39 +10998,33 @@ func awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(v **typ return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnableToDecryptSecretValueException + var cv []types.Tag if *v == nil { - sv = &types.UnableToDecryptSecretValueException{} + cv = []types.Tag{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(v **types.UnableToGetUpstreamImageException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11552,34 +11037,30 @@ func awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnableToGetUpstreamImageException + var mv map[string]string if *v == nil { - sv = &types.UnableToGetUpstreamImageException{} + mv = map[string]string{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + parsedVal = jtv } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(v **types.UnableToGetUpstreamLayerException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11592,9 +11073,9 @@ func awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnableToGetUpstreamLayerException + var sv *types.TooManyTagsException if *v == nil { - sv = &types.UnableToGetUpstreamLayerException{} + sv = &types.TooManyTagsException{} } else { sv = *v } @@ -12189,15 +11670,6 @@ func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **Crea } } - case "credentialArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) - } - sv.CredentialArn = ptr.String(jtv) - } - case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -12216,15 +11688,6 @@ func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **Crea sv.RegistryId = ptr.String(jtv) } - case "upstreamRegistry": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value) - } - sv.UpstreamRegistry = types.UpstreamRegistry(jtv) - } - case "upstreamRegistryUrl": if value != nil { jtv, ok := value.(string) @@ -12391,15 +11854,6 @@ func awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(v **Dele } } - case "credentialArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) - } - sv.CredentialArn = ptr.String(jtv) - } - case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -13986,80 +13440,6 @@ func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return nil } -func awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(v **UpdatePullThroughCacheRuleOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdatePullThroughCacheRuleOutput - if *v == nil { - sv = &UpdatePullThroughCacheRuleOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "credentialArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) - } - sv.CredentialArn = ptr.String(jtv) - } - - case "ecrRepositoryPrefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value) - } - sv.EcrRepositoryPrefix = ptr.String(jtv) - } - - case "registryId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) - } - sv.RegistryId = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14130,117 +13510,3 @@ func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPart *v = sv return nil } - -func awsAwsjson11_deserializeOpDocumentValidatePullThroughCacheRuleOutput(v **ValidatePullThroughCacheRuleOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ValidatePullThroughCacheRuleOutput - if *v == nil { - sv = &ValidatePullThroughCacheRuleOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "credentialArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) - } - sv.CredentialArn = ptr.String(jtv) - } - - case "ecrRepositoryPrefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value) - } - sv.EcrRepositoryPrefix = ptr.String(jtv) - } - - case "failure": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PTCValidateFailure to be of type string, got %T instead", value) - } - sv.Failure = ptr.String(jtv) - } - - case "isValid": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected IsPTCRuleValid to be of type *bool, got %T instead", value) - } - sv.IsValid = jtv - } - - case "registryId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) - } - sv.RegistryId = ptr.String(jtv) - } - - case "upstreamRegistryUrl": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) - } - sv.UpstreamRegistryUrl = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type protocolErrorInfo struct { - Type string `json:"__type"` - Message string - Code any // nonstandard for awsjson but some services do present the type here -} - -func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { - var errInfo protocolErrorInfo - if err := decoder.Decode(&errInfo); err != nil { - if err == io.EOF { - return errInfo, nil - } - return errInfo, err - } - - return errInfo, nil -} - -func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { - if len(headerType) != 0 { - return headerType, true - } else if len(bodyInfo.Type) != 0 { - return bodyInfo.Type, true - } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { - return code, true - } - return "", false -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/endpoints.go index 0cf591df272..e255bc9d524 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/endpoints.go @@ -8,18 +8,10 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" "net/url" - "os" "strings" ) @@ -47,6 +39,13 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -80,10 +79,6 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -99,11 +94,6 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -139,10 +129,27 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) @@ -153,13 +160,12 @@ func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, opti var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. // -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { @@ -170,6 +176,7 @@ func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptio return &wrappedEndpointResolver{ awsResolver: resolver, + resolver: fallbackResolver, } } @@ -191,364 +198,3 @@ func finalizeClientEndpointResolverOptions(options *Options) { } } - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_ECR") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "ECR", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr-fips.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr-fips.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(getOperationInput(ctx), m.options) - endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/generated.json b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/generated.json index 2e7e94262bf..631a65bbaf8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/generated.json +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/generated.json @@ -49,22 +49,15 @@ "api_op_StartLifecyclePolicyPreview.go", "api_op_TagResource.go", "api_op_UntagResource.go", - "api_op_UpdatePullThroughCacheRule.go", "api_op_UploadLayerPart.go", - "api_op_ValidatePullThroughCacheRule.go", - "auth.go", "deserializers.go", "doc.go", "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", - "options.go", "protocol_test.go", "serializers.go", - "snapshot_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/go_module_metadata.go index 8dde998fa92..0e83ac5d005 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/go_module_metadata.go @@ -3,4 +3,4 @@ package ecr // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.27.3" +const goModuleVersion = "1.18.11" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints/endpoints.go index 48d24a1e80b..e2a8a780640 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints/endpoints.go @@ -90,16 +90,14 @@ var partitionRegexp = struct { AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } @@ -235,14 +233,6 @@ var defaultPartitions = endpoints.Partitions{ Region: "ca-central-1", }, }, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{ - Hostname: "api.ecr.ca-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-west-1", - }, - }, endpoints.EndpointKey{ Region: "dkr-us-east-1", }: endpoints.Endpoint{ @@ -451,14 +441,6 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{ - Hostname: "api.ecr.il-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "il-central-1", - }, - }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{ @@ -697,27 +679,6 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "api.ecr-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "api.ecr.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/options.go deleted file mode 100644 index 0de783e381c..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/options.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecr - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom - // endpoint, set the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. If specified in an operation call's - // functional options with a value that is different than the constructed client's - // Options, the Client's Retryer will be wrapped to use the operation's specific - // RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. Currently does not support per operation call - // overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. Currently does not support per operation call - // overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/serializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/serializers.go index fbeb274d4e0..e513d0312fd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/serializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/serializers.go @@ -2215,61 +2215,6 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpUpdatePullThroughCacheRule struct { -} - -func (*awsAwsjson11_serializeOpUpdatePullThroughCacheRule) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdatePullThroughCacheRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdatePullThroughCacheRuleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.UpdatePullThroughCacheRule") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdatePullThroughCacheRuleInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} - type awsAwsjson11_serializeOpUploadLayerPart struct { } @@ -2324,61 +2269,6 @@ func (m *awsAwsjson11_serializeOpUploadLayerPart) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } - -type awsAwsjson11_serializeOpValidatePullThroughCacheRule struct { -} - -func (*awsAwsjson11_serializeOpValidatePullThroughCacheRule) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpValidatePullThroughCacheRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ValidatePullThroughCacheRuleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.ValidatePullThroughCacheRule") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentValidatePullThroughCacheRuleInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} func awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2888,11 +2778,6 @@ func awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePu object := value.Object() defer object.Close() - if v.CredentialArn != nil { - ok := object.Key("credentialArn") - ok.String(*v.CredentialArn) - } - if v.EcrRepositoryPrefix != nil { ok := object.Key("ecrRepositoryPrefix") ok.String(*v.EcrRepositoryPrefix) @@ -2903,11 +2788,6 @@ func awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePu ok.String(*v.RegistryId) } - if len(v.UpstreamRegistry) > 0 { - ok := object.Key("upstreamRegistry") - ok.String(string(v.UpstreamRegistry)) - } - if v.UpstreamRegistryUrl != nil { ok := object.Key("upstreamRegistryUrl") ok.String(*v.UpstreamRegistryUrl) @@ -3652,28 +3532,6 @@ func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } -func awsAwsjson11_serializeOpDocumentUpdatePullThroughCacheRuleInput(v *UpdatePullThroughCacheRuleInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CredentialArn != nil { - ok := object.Key("credentialArn") - ok.String(*v.CredentialArn) - } - - if v.EcrRepositoryPrefix != nil { - ok := object.Key("ecrRepositoryPrefix") - ok.String(*v.EcrRepositoryPrefix) - } - - if v.RegistryId != nil { - ok := object.Key("registryId") - ok.String(*v.RegistryId) - } - - return nil -} - func awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3710,20 +3568,3 @@ func awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInpu return nil } - -func awsAwsjson11_serializeOpDocumentValidatePullThroughCacheRuleInput(v *ValidatePullThroughCacheRuleInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EcrRepositoryPrefix != nil { - ok := object.Key("ecrRepositoryPrefix") - ok.String(*v.EcrRepositoryPrefix) - } - - if v.RegistryId != nil { - ok := object.Key("registryId") - ok.String(*v.RegistryId) - } - - return nil -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/enums.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/enums.go index 1ff5684677f..d782c4ec9c2 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/enums.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/enums.go @@ -73,9 +73,6 @@ const ( ImageFailureCodeMissingDigestAndTag ImageFailureCode = "MissingDigestAndTag" ImageFailureCodeImageReferencedByManifestList ImageFailureCode = "ImageReferencedByManifestList" ImageFailureCodeKmsError ImageFailureCode = "KmsError" - ImageFailureCodeUpstreamAccessDenied ImageFailureCode = "UpstreamAccessDenied" - ImageFailureCodeUpstreamTooManyRequests ImageFailureCode = "UpstreamTooManyRequests" - ImageFailureCodeUpstreamUnavailable ImageFailureCode = "UpstreamUnavailable" ) // Values returns all known values for ImageFailureCode. Note that this can be @@ -90,9 +87,6 @@ func (ImageFailureCode) Values() []ImageFailureCode { "MissingDigestAndTag", "ImageReferencedByManifestList", "KmsError", - "UpstreamAccessDenied", - "UpstreamTooManyRequests", - "UpstreamUnavailable", } } @@ -330,29 +324,3 @@ func (TagStatus) Values() []TagStatus { "ANY", } } - -type UpstreamRegistry string - -// Enum values for UpstreamRegistry -const ( - UpstreamRegistryEcrPublic UpstreamRegistry = "ecr-public" - UpstreamRegistryQuay UpstreamRegistry = "quay" - UpstreamRegistryK8s UpstreamRegistry = "k8s" - UpstreamRegistryDockerHub UpstreamRegistry = "docker-hub" - UpstreamRegistryGitHubContainerRegistry UpstreamRegistry = "github-container-registry" - UpstreamRegistryAzureContainerRegistry UpstreamRegistry = "azure-container-registry" -) - -// Values returns all known values for UpstreamRegistry. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. -func (UpstreamRegistry) Values() []UpstreamRegistry { - return []UpstreamRegistry{ - "ecr-public", - "quay", - "k8s", - "docker-hub", - "github-container-registry", - "azure-container-registry", - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/errors.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/errors.go index 01365bf0bf9..4b4782c5a5d 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/errors.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/errors.go @@ -744,33 +744,6 @@ func (e *ScanNotFoundException) ErrorCode() string { } func (e *ScanNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The ARN of the secret specified in the pull through cache rule was not found. -// Update the pull through cache rule with a valid secret ARN and try again. -type SecretNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *SecretNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *SecretNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *SecretNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "SecretNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *SecretNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - // These errors are usually caused by a server-side issue. type ServerException struct { Message *string @@ -824,117 +797,6 @@ func (e *TooManyTagsException) ErrorCode() string { } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The secret is unable to be accessed. Verify the resource permissions for the -// secret and try again. -type UnableToAccessSecretException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnableToAccessSecretException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnableToAccessSecretException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnableToAccessSecretException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnableToAccessSecretException" - } - return *e.ErrorCodeOverride -} -func (e *UnableToAccessSecretException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The secret is accessible but is unable to be decrypted. Verify the resource -// permisisons and try again. -type UnableToDecryptSecretValueException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnableToDecryptSecretValueException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnableToDecryptSecretValueException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnableToDecryptSecretValueException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnableToDecryptSecretValueException" - } - return *e.ErrorCodeOverride -} -func (e *UnableToDecryptSecretValueException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The image or images were unable to be pulled using the pull through cache rule. -// This is usually caused because of an issue with the Secrets Manager secret -// containing the credentials for the upstream registry. -type UnableToGetUpstreamImageException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnableToGetUpstreamImageException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnableToGetUpstreamImageException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnableToGetUpstreamImageException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnableToGetUpstreamImageException" - } - return *e.ErrorCodeOverride -} -func (e *UnableToGetUpstreamImageException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// There was an issue getting the upstream layer matching the pull through cache -// rule. -type UnableToGetUpstreamLayerException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnableToGetUpstreamLayerException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnableToGetUpstreamLayerException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnableToGetUpstreamLayerException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnableToGetUpstreamLayerException" - } - return *e.ErrorCodeOverride -} -func (e *UnableToGetUpstreamLayerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - // The image is of a type that cannot be scanned. type UnsupportedImageTypeException struct { Message *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/types.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/types.go index e707591dfa9..42509094007 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/types.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/types/types.go @@ -563,10 +563,6 @@ type PullThroughCacheRule struct { // The date and time the pull through cache was created. CreatedAt *time.Time - // The ARN of the Secrets Manager secret associated with the pull through cache - // rule. - CredentialArn *string - // The Amazon ECR repository prefix associated with the pull through cache rule. EcrRepositoryPrefix *string @@ -574,14 +570,6 @@ type PullThroughCacheRule struct { // through cache rule is associated with. RegistryId *string - // The date and time, in JavaScript date format, when the pull through cache rule - // was last updated. - UpdatedAt *time.Time - - // The name of the upstream source registry associated with the pull through cache - // rule. - UpstreamRegistry UpstreamRegistry - // The upstream registry URL associated with the pull through cache rule. UpstreamRegistryUrl *string @@ -624,8 +612,7 @@ type RegistryScanningRule struct { // The frequency that scans are performed at for a private registry. When the // ENHANCED scan type is specified, the supported scan frequencies are // CONTINUOUS_SCAN and SCAN_ON_PUSH . When the BASIC scan type is specified, the - // SCAN_ON_PUSH scan frequency is supported. If scan on push is not specified, then - // the MANUAL scan frequency is set by default. + // SCAN_ON_PUSH and MANUAL scan frequencies are supported. // // This member is required. ScanFrequency ScanFrequency @@ -713,8 +700,7 @@ type Repository struct { // The Amazon Resource Name (ARN) that identifies the repository. The ARN contains // the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web // Services account ID of the repository owner, repository namespace, and - // repository name. For example, - // arn:aws:ecr:region:012345678910:repository-namespace/repository-name . + // repository name. For example, arn:aws:ecr:region:012345678910:repository/test . RepositoryArn *string // The name of the repository. @@ -729,8 +715,8 @@ type Repository struct { // The filter settings used with image replication. Specifying a repository filter // to a replication rule provides a method for controlling which repositories in a -// private registry are replicated. If no filters are added, the contents of all -// repositories are replicated. +// private registry are replicated. If no repository filter is specified, all +// images in the repository are replicated. type RepositoryFilter struct { // The repository filter details. When the PREFIX_MATCH filter type is specified, @@ -849,13 +835,9 @@ type Tag struct { // One part of a key-value pair that make up a tag. A key is a general label that // acts like a category for more specific tag values. - // - // This member is required. Key *string // A value acts as a descriptor within a tag category (key). - // - // This member is required. Value *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/validators.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/validators.go index d9889a1148b..9baf8c8cffe 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/validators.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecr/validators.go @@ -670,26 +670,6 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } -type validateOpUpdatePullThroughCacheRule struct { -} - -func (*validateOpUpdatePullThroughCacheRule) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdatePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdatePullThroughCacheRuleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdatePullThroughCacheRuleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpUploadLayerPart struct { } @@ -710,26 +690,6 @@ func (m *validateOpUploadLayerPart) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } -type validateOpValidatePullThroughCacheRule struct { -} - -func (*validateOpValidatePullThroughCacheRule) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpValidatePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ValidatePullThroughCacheRuleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpValidatePullThroughCacheRuleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - func addOpBatchCheckLayerAvailabilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchCheckLayerAvailability{}, middleware.After) } @@ -862,18 +822,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } -func addOpUpdatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdatePullThroughCacheRule{}, middleware.After) -} - func addOpUploadLayerPartValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUploadLayerPart{}, middleware.After) } -func addOpValidatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpValidatePullThroughCacheRule{}, middleware.After) -} - func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error { if v == nil { return nil @@ -1093,41 +1045,6 @@ func validateScanningRepositoryFilterList(v []types.ScanningRepositoryFilter) er } } -func validateTag(v *types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "Tag"} - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) - } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTagList(v []types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagList"} - for i := range v { - if err := validateTag(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpBatchCheckLayerAvailabilityInput(v *BatchCheckLayerAvailabilityInput) error { if v == nil { return nil @@ -1244,11 +1161,6 @@ func validateOpCreateRepositoryInput(v *CreateRepositoryInput) error { if v.RepositoryName == nil { invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) } - if v.Tags != nil { - if err := validateTagList(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } if v.EncryptionConfiguration != nil { if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) @@ -1664,10 +1576,6 @@ func validateOpTagResourceInput(v *TagResourceInput) error { } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } else if v.Tags != nil { - if err := validateTagList(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } } if invalidParams.Len() > 0 { return invalidParams @@ -1694,24 +1602,6 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } -func validateOpUpdatePullThroughCacheRuleInput(v *UpdatePullThroughCacheRuleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdatePullThroughCacheRuleInput"} - if v.EcrRepositoryPrefix == nil { - invalidParams.Add(smithy.NewErrParamRequired("EcrRepositoryPrefix")) - } - if v.CredentialArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CredentialArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpUploadLayerPartInput(v *UploadLayerPartInput) error { if v == nil { return nil @@ -1738,18 +1628,3 @@ func validateOpUploadLayerPartInput(v *UploadLayerPartInput) error { return nil } } - -func validateOpValidatePullThroughCacheRuleInput(v *ValidatePullThroughCacheRuleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ValidatePullThroughCacheRuleInput"} - if v.EcrRepositoryPrefix == nil { - invalidParams.Add(smithy.NewErrParamRequired("EcrRepositoryPrefix")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/CHANGELOG.md index 8abb8388d49..fb5b96f9014 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/CHANGELOG.md @@ -1,153 +1,3 @@ -# v1.23.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.22.3 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.2 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.22.1 (2024-02-15) - -* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field. - -# v1.22.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.21.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.21.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.20.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.17.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-08-01) - -* No change notes available for this release. - -# v1.17.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.6 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2023-06-15) - -* No change notes available for this release. - -# v1.16.3 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.16.2 (2023-05-04) * No change notes available for this release. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go index b3758ccf435..f6d77354334 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go @@ -4,15 +4,12 @@ package ecrpublic import ( "context" - "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" @@ -49,48 +46,128 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) - resolveEndpointResolverV2(&options) - - resolveAuthSchemeResolver(&options) + resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } - finalizeRetryMaxAttempts(&options) + client := &Client{ + options: options, + } - ignoreAnonymousAuth(&options) + return client +} - wrapWithAnonymousAuth(&options) +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error - resolveAuthSchemes(&options) + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode - client := &Client{ - options: options, + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) } +} - return client +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } } -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) } +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() - for _, fn := range optFns { fn(&options) } - finalizeOperationRetryMaxAttempts(&options, *c) + finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -118,89 +195,8 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - type noSmithyDocumentSerde = smithydocument.NoSerde -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -238,7 +234,6 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -246,7 +241,6 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } @@ -338,15 +332,7 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } @@ -358,39 +344,20 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ecrpublic", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ecrpublic", goModuleVersion)(stack) } -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { @@ -411,48 +378,12 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - }) - if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), } - return nil + return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration @@ -485,18 +416,12 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { return nil } -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - + return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { @@ -507,32 +432,3 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchCheckLayerAvailability.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchCheckLayerAvailability.go index ab4cb1e548e..0962a06e079 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchCheckLayerAvailability.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchCheckLayerAvailability.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -68,9 +68,6 @@ type BatchCheckLayerAvailabilityOutput struct { } func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchCheckLayerAvailability{}, middleware.After) if err != nil { return err @@ -79,47 +76,40 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchCheckLayerAvailability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchCheckLayerAvailabilityValidationMiddleware(stack); err != nil { @@ -128,7 +118,7 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCheckLayerAvailability(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +130,6 @@ func (c *Client) addOperationBatchCheckLayerAvailabilityMiddlewares(stack *middl if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -150,6 +137,7 @@ func newServiceMetadataMiddleware_opBatchCheckLayerAvailability(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "BatchCheckLayerAvailability", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchDeleteImage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchDeleteImage.go index 4ff2a07ef78..8ea3aa36536 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchDeleteImage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_BatchDeleteImage.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -68,9 +68,6 @@ type BatchDeleteImageOutput struct { } func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteImage{}, middleware.After) if err != nil { return err @@ -79,47 +76,40 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "BatchDeleteImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpBatchDeleteImageValidationMiddleware(stack); err != nil { @@ -128,7 +118,7 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteImage(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +130,6 @@ func (c *Client) addOperationBatchDeleteImageMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -150,6 +137,7 @@ func newServiceMetadataMiddleware_opBatchDeleteImage(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "BatchDeleteImage", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CompleteLayerUpload.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CompleteLayerUpload.go index 7a95db650f0..cf1bf511ded 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CompleteLayerUpload.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CompleteLayerUpload.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -80,9 +80,6 @@ type CompleteLayerUploadOutput struct { } func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCompleteLayerUpload{}, middleware.After) if err != nil { return err @@ -91,47 +88,40 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "CompleteLayerUpload"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCompleteLayerUploadValidationMiddleware(stack); err != nil { @@ -140,7 +130,7 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCompleteLayerUpload(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -152,9 +142,6 @@ func (c *Client) addOperationCompleteLayerUploadMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -162,6 +149,7 @@ func newServiceMetadataMiddleware_opCompleteLayerUpload(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "CompleteLayerUpload", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CreateRepository.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CreateRepository.go index 812926059a2..9586b3e3880 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CreateRepository.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_CreateRepository.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -68,9 +68,6 @@ type CreateRepositoryOutput struct { } func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRepository{}, middleware.After) if err != nil { return err @@ -79,47 +76,40 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRepository"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateRepositoryValidationMiddleware(stack); err != nil { @@ -128,7 +118,7 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepository(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +130,6 @@ func (c *Client) addOperationCreateRepositoryMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -150,6 +137,7 @@ func newServiceMetadataMiddleware_opCreateRepository(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "CreateRepository", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepository.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepository.go index 1392b24526b..7fe23d70fac 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepository.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepository.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -61,9 +61,6 @@ type DeleteRepositoryOutput struct { } func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepository{}, middleware.After) if err != nil { return err @@ -72,47 +69,40 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepository"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRepositoryValidationMiddleware(stack); err != nil { @@ -121,7 +111,7 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepository(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -133,9 +123,6 @@ func (c *Client) addOperationDeleteRepositoryMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -143,6 +130,7 @@ func newServiceMetadataMiddleware_opDeleteRepository(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DeleteRepository", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepositoryPolicy.go index fc16deb8a26..20a8b70d438 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DeleteRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -60,9 +60,6 @@ type DeleteRepositoryPolicyOutput struct { } func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -71,47 +68,40 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -120,7 +110,7 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +122,6 @@ func (c *Client) addOperationDeleteRepositoryPolicyMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +129,7 @@ func newServiceMetadataMiddleware_opDeleteRepositoryPolicy(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DeleteRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImageTags.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImageTags.go index fa2e122fe3a..b13ed17b9e5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImageTags.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImageTags.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -77,9 +78,6 @@ type DescribeImageTagsOutput struct { } func (c *Client) addOperationDescribeImageTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImageTags{}, middleware.After) if err != nil { return err @@ -88,47 +86,40 @@ func (c *Client) addOperationDescribeImageTagsMiddlewares(stack *middleware.Stac if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImageTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeImageTagsValidationMiddleware(stack); err != nil { @@ -137,7 +128,7 @@ func (c *Client) addOperationDescribeImageTagsMiddlewares(stack *middleware.Stac if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageTags(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -149,9 +140,6 @@ func (c *Client) addOperationDescribeImageTagsMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -256,6 +244,7 @@ func newServiceMetadataMiddleware_opDescribeImageTags(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DescribeImageTags", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImages.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImages.go index 660e640a717..c070863e370 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImages.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeImages.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -84,9 +85,6 @@ type DescribeImagesOutput struct { } func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeImages{}, middleware.After) if err != nil { return err @@ -95,47 +93,40 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeImagesValidationMiddleware(stack); err != nil { @@ -144,7 +135,7 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImages(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -156,9 +147,6 @@ func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -263,6 +251,7 @@ func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DescribeImages", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRegistries.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRegistries.go index a4a0d06c7d8..7c3c414416e 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRegistries.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRegistries.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -71,9 +72,6 @@ type DescribeRegistriesOutput struct { } func (c *Client) addOperationDescribeRegistriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRegistries{}, middleware.After) if err != nil { return err @@ -82,53 +80,46 @@ func (c *Client) addOperationDescribeRegistriesMiddlewares(stack *middleware.Sta if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRegistries"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRegistries(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -140,9 +131,6 @@ func (c *Client) addOperationDescribeRegistriesMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -248,6 +236,7 @@ func newServiceMetadataMiddleware_opDescribeRegistries(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DescribeRegistries", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRepositories.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRepositories.go index 4646c67603b..1ad26cf7d0b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRepositories.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_DescribeRepositories.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -80,9 +81,6 @@ type DescribeRepositoriesOutput struct { } func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRepositories{}, middleware.After) if err != nil { return err @@ -91,53 +89,46 @@ func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.S if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRepositories"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRepositories(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -149,9 +140,6 @@ func (c *Client) addOperationDescribeRepositoriesMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -258,6 +246,7 @@ func newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "DescribeRepositories", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetAuthorizationToken.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetAuthorizationToken.go index 82d1e20ebfe..0b7eb721799 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetAuthorizationToken.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetAuthorizationToken.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,9 +47,6 @@ type GetAuthorizationTokenOutput struct { } func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAuthorizationToken{}, middleware.After) if err != nil { return err @@ -58,53 +55,46 @@ func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware. if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAuthorizationToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAuthorizationToken(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -116,9 +106,6 @@ func (c *Client) addOperationGetAuthorizationTokenMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -126,6 +113,7 @@ func newServiceMetadataMiddleware_opGetAuthorizationToken(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "GetAuthorizationToken", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRegistryCatalogData.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRegistryCatalogData.go index b6aea611700..4f1b2d42c1f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRegistryCatalogData.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRegistryCatalogData.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -45,9 +45,6 @@ type GetRegistryCatalogDataOutput struct { } func (c *Client) addOperationGetRegistryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegistryCatalogData{}, middleware.After) if err != nil { return err @@ -56,53 +53,46 @@ func (c *Client) addOperationGetRegistryCatalogDataMiddlewares(stack *middleware if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRegistryCatalogData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegistryCatalogData(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -114,9 +104,6 @@ func (c *Client) addOperationGetRegistryCatalogDataMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -124,6 +111,7 @@ func newServiceMetadataMiddleware_opGetRegistryCatalogData(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "GetRegistryCatalogData", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryCatalogData.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryCatalogData.go index b7fc89975e6..fd5877a415e 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryCatalogData.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryCatalogData.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -55,9 +55,6 @@ type GetRepositoryCatalogDataOutput struct { } func (c *Client) addOperationGetRepositoryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryCatalogData{}, middleware.After) if err != nil { return err @@ -66,47 +63,40 @@ func (c *Client) addOperationGetRepositoryCatalogDataMiddlewares(stack *middlewa if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRepositoryCatalogData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRepositoryCatalogDataValidationMiddleware(stack); err != nil { @@ -115,7 +105,7 @@ func (c *Client) addOperationGetRepositoryCatalogDataMiddlewares(stack *middlewa if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryCatalogData(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -127,9 +117,6 @@ func (c *Client) addOperationGetRepositoryCatalogDataMiddlewares(stack *middlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -137,6 +124,7 @@ func newServiceMetadataMiddleware_opGetRepositoryCatalogData(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "GetRepositoryCatalogData", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryPolicy.go index 677f128dacb..90fc8293432 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_GetRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -60,9 +60,6 @@ type GetRepositoryPolicyOutput struct { } func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -71,47 +68,40 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -120,7 +110,7 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +122,6 @@ func (c *Client) addOperationGetRepositoryPolicyMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +129,7 @@ func newServiceMetadataMiddleware_opGetRepositoryPolicy(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "GetRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_InitiateLayerUpload.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_InitiateLayerUpload.go index c0d7d0f637e..42ca47b3d11 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_InitiateLayerUpload.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_InitiateLayerUpload.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -62,9 +62,6 @@ type InitiateLayerUploadOutput struct { } func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpInitiateLayerUpload{}, middleware.After) if err != nil { return err @@ -73,47 +70,40 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "InitiateLayerUpload"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpInitiateLayerUploadValidationMiddleware(stack); err != nil { @@ -122,7 +112,7 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitiateLayerUpload(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -134,9 +124,6 @@ func (c *Client) addOperationInitiateLayerUploadMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -144,6 +131,7 @@ func newServiceMetadataMiddleware_opInitiateLayerUpload(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "InitiateLayerUpload", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_ListTagsForResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_ListTagsForResource.go index 1350ecd3f96..0ffad3cc04e 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_ListTagsForResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_ListTagsForResource.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -50,9 +50,6 @@ type ListTagsForResourceOutput struct { } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err @@ -61,47 +58,40 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { @@ -110,7 +100,7 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -122,9 +112,6 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -132,6 +119,7 @@ func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "ListTagsForResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutImage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutImage.go index 55efd6e929b..91d681d544a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutImage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutImage.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -77,9 +77,6 @@ type PutImageOutput struct { } func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutImage{}, middleware.After) if err != nil { return err @@ -88,47 +85,40 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutImageValidationMiddleware(stack); err != nil { @@ -137,7 +127,7 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutImage(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -149,9 +139,6 @@ func (c *Client) addOperationPutImageMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -159,6 +146,7 @@ func newServiceMetadataMiddleware_opPutImage(region string) *awsmiddleware.Regis return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "PutImage", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRegistryCatalogData.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRegistryCatalogData.go index f54f633f2e8..c6677f81103 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRegistryCatalogData.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRegistryCatalogData.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -51,9 +51,6 @@ type PutRegistryCatalogDataOutput struct { } func (c *Client) addOperationPutRegistryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRegistryCatalogData{}, middleware.After) if err != nil { return err @@ -62,53 +59,46 @@ func (c *Client) addOperationPutRegistryCatalogDataMiddlewares(stack *middleware if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutRegistryCatalogData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRegistryCatalogData(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -120,9 +110,6 @@ func (c *Client) addOperationPutRegistryCatalogDataMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -130,6 +117,7 @@ func newServiceMetadataMiddleware_opPutRegistryCatalogData(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "PutRegistryCatalogData", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRepositoryCatalogData.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRepositoryCatalogData.go index 45d1382fb6e..70e5d3c3c11 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRepositoryCatalogData.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_PutRepositoryCatalogData.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -60,9 +60,6 @@ type PutRepositoryCatalogDataOutput struct { } func (c *Client) addOperationPutRepositoryCatalogDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRepositoryCatalogData{}, middleware.After) if err != nil { return err @@ -71,47 +68,40 @@ func (c *Client) addOperationPutRepositoryCatalogDataMiddlewares(stack *middlewa if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutRepositoryCatalogData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutRepositoryCatalogDataValidationMiddleware(stack); err != nil { @@ -120,7 +110,7 @@ func (c *Client) addOperationPutRepositoryCatalogDataMiddlewares(stack *middlewa if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRepositoryCatalogData(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -132,9 +122,6 @@ func (c *Client) addOperationPutRepositoryCatalogDataMiddlewares(stack *middlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -142,6 +129,7 @@ func newServiceMetadataMiddleware_opPutRepositoryCatalogData(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "PutRepositoryCatalogData", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_SetRepositoryPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_SetRepositoryPolicy.go index d3a93d1d514..ff5cbd65da7 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_SetRepositoryPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_SetRepositoryPolicy.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -73,9 +73,6 @@ type SetRepositoryPolicyOutput struct { } func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetRepositoryPolicy{}, middleware.After) if err != nil { return err @@ -84,47 +81,40 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "SetRepositoryPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpSetRepositoryPolicyValidationMiddleware(stack); err != nil { @@ -133,7 +123,7 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetRepositoryPolicy(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -145,9 +135,6 @@ func (c *Client) addOperationSetRepositoryPolicyMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -155,6 +142,7 @@ func newServiceMetadataMiddleware_opSetRepositoryPolicy(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "SetRepositoryPolicy", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_TagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_TagResource.go index 4f68992313a..b4cf870d560 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_TagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_TagResource.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecrpublic/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -56,9 +56,6 @@ type TagResourceOutput struct { } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) if err != nil { return err @@ -67,47 +64,40 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { @@ -116,7 +106,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -128,9 +118,6 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -138,6 +125,7 @@ func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "TagResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UntagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UntagResource.go index 8ebfae032ba..66502ca4acc 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UntagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UntagResource.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -50,9 +50,6 @@ type UntagResourceOutput struct { } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) if err != nil { return err @@ -61,47 +58,40 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { @@ -110,7 +100,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -122,9 +112,6 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -132,6 +119,7 @@ func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "UntagResource", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UploadLayerPart.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UploadLayerPart.go index bc5d65206fc..f194f0c1a1a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UploadLayerPart.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_op_UploadLayerPart.go @@ -4,8 +4,8 @@ package ecrpublic import ( "context" - "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -88,9 +88,6 @@ type UploadLayerPartOutput struct { } func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUploadLayerPart{}, middleware.After) if err != nil { return err @@ -99,47 +96,40 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err != nil { return err } - if err := addProtocolFinalizerMiddlewares(stack, options, "UploadLayerPart"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = addClientRequestID(stack); err != nil { + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } - if err = addRetry(stack, options); err != nil { + if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addRawResponseToMetadata(stack); err != nil { + if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } - if err = addClientUserAgent(stack, options); err != nil { + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addClientUserAgent(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUploadLayerPartValidationMiddleware(stack); err != nil { @@ -148,7 +138,7 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUploadLayerPart(options.Region), middleware.Before); err != nil { return err } - if err = addRecursionDetection(stack); err != nil { + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { @@ -160,9 +150,6 @@ func (c *Client) addOperationUploadLayerPartMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } return nil } @@ -170,6 +157,7 @@ func newServiceMetadataMiddleware_opUploadLayerPart(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, + SigningName: "ecr-public", OperationName: "UploadLayerPart", } } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/auth.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/auth.go deleted file mode 100644 index 80729fbc78a..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/auth.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecrpublic - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "ecr-public") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/deserializers.go index b6fbd266f60..0ef759a1ca5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/deserializers.go @@ -87,6 +87,9 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -94,7 +97,7 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -106,12 +109,13 @@ func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithy } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -206,6 +210,9 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -213,7 +220,7 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -225,12 +232,13 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -322,6 +330,9 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -329,7 +340,7 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -341,12 +352,13 @@ func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("EmptyUploadException", errorCode): return awsAwsjson11_deserializeErrorEmptyUploadException(response, errorBody) @@ -456,6 +468,9 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -463,7 +478,7 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -475,12 +490,13 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -581,6 +597,9 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -588,7 +607,7 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -600,12 +619,13 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -700,6 +720,9 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -707,7 +730,7 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -719,12 +742,13 @@ func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -819,6 +843,9 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -826,7 +853,7 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -838,12 +865,13 @@ func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageNotFoundException", errorCode): return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody) @@ -938,6 +966,9 @@ func awsAwsjson11_deserializeOpErrorDescribeImageTags(response *smithyhttp.Respo errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -945,7 +976,7 @@ func awsAwsjson11_deserializeOpErrorDescribeImageTags(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -957,12 +988,13 @@ func awsAwsjson11_deserializeOpErrorDescribeImageTags(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1054,6 +1086,9 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistries(response *smithyhttp.Resp errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1061,7 +1096,7 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistries(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1073,12 +1108,13 @@ func awsAwsjson11_deserializeOpErrorDescribeRegistries(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1167,6 +1203,9 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1174,7 +1213,7 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1186,12 +1225,13 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1283,6 +1323,9 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1290,7 +1333,7 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1302,12 +1345,13 @@ func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1396,6 +1440,9 @@ func awsAwsjson11_deserializeOpErrorGetRegistryCatalogData(response *smithyhttp. errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1403,7 +1450,7 @@ func awsAwsjson11_deserializeOpErrorGetRegistryCatalogData(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1415,12 +1462,13 @@ func awsAwsjson11_deserializeOpErrorGetRegistryCatalogData(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) @@ -1506,6 +1554,9 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryCatalogData(response *smithyhtt errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1513,7 +1564,7 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryCatalogData(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1525,12 +1576,13 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryCatalogData(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1625,6 +1677,9 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1632,7 +1687,7 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1644,12 +1699,13 @@ func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1744,6 +1800,9 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1751,7 +1810,7 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1763,12 +1822,13 @@ func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1863,6 +1923,9 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1870,7 +1933,7 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1882,12 +1945,13 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1979,6 +2043,9 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1986,7 +2053,7 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1998,12 +2065,13 @@ func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, meta } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("ImageAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorImageAlreadyExistsException(response, errorBody) @@ -2116,6 +2184,9 @@ func awsAwsjson11_deserializeOpErrorPutRegistryCatalogData(response *smithyhttp. errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2123,7 +2194,7 @@ func awsAwsjson11_deserializeOpErrorPutRegistryCatalogData(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2135,12 +2206,13 @@ func awsAwsjson11_deserializeOpErrorPutRegistryCatalogData(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2229,6 +2301,9 @@ func awsAwsjson11_deserializeOpErrorPutRepositoryCatalogData(response *smithyhtt errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2236,7 +2311,7 @@ func awsAwsjson11_deserializeOpErrorPutRepositoryCatalogData(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2248,12 +2323,13 @@ func awsAwsjson11_deserializeOpErrorPutRepositoryCatalogData(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2345,6 +2421,9 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2352,7 +2431,7 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2364,12 +2443,13 @@ func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2461,6 +2541,9 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2468,7 +2551,7 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2480,12 +2563,13 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2583,6 +2667,9 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2590,7 +2677,7 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2602,12 +2689,13 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2705,6 +2793,9 @@ func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Respons errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2712,7 +2803,7 @@ func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Respons body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2724,12 +2815,13 @@ func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message + if len(message) != 0 { + errorMessage = message } + switch { case strings.EqualFold("InvalidLayerPartException", errorCode): return awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody) @@ -7085,32 +7177,3 @@ func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPart *v = sv return nil } - -type protocolErrorInfo struct { - Type string `json:"__type"` - Message string - Code any // nonstandard for awsjson but some services do present the type here -} - -func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { - var errInfo protocolErrorInfo - if err := decoder.Decode(&errInfo); err != nil { - if err == io.EOF { - return errInfo, nil - } - return errInfo, err - } - - return errInfo, nil -} - -func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { - if len(headerType) != 0 { - return headerType, true - } else if len(bodyInfo.Type) != 0 { - return bodyInfo.Type, true - } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { - return code, true - } - return "", false -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/endpoints.go index 95e0c365a3c..071eca69cbb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/endpoints.go @@ -8,18 +8,10 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" "net/url" - "os" "strings" ) @@ -47,6 +39,13 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -80,10 +79,6 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -99,11 +94,6 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -139,10 +129,27 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) @@ -153,13 +160,12 @@ func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, opti var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. // -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { @@ -170,6 +176,7 @@ func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptio return &wrappedEndpointResolver{ awsResolver: resolver, + resolver: fallbackResolver, } } @@ -191,326 +198,3 @@ func finalizeClientEndpointResolverOptions(options *Options) { } } - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_ECR_PUBLIC") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "ECR PUBLIC", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-public-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-public-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-public.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://api.ecr-public.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(getOperationInput(ctx), m.options) - endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/generated.json b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/generated.json index f11524a5feb..a60655a86d5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/generated.json +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/generated.json @@ -31,19 +31,14 @@ "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UploadLayerPart.go", - "auth.go", "deserializers.go", "doc.go", "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", - "options.go", "protocol_test.go", "serializers.go", - "snapshot_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/go_module_metadata.go index 6bb90d74a0b..70b89eb7633 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/go_module_metadata.go @@ -3,4 +3,4 @@ package ecrpublic // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.3" +const goModuleVersion = "1.16.2" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints/endpoints.go index 7f122295985..0f540b2c2d2 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints/endpoints.go @@ -90,16 +90,14 @@ var partitionRegexp = struct { AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } @@ -255,27 +253,6 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "api.ecr-public-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "api.ecr-public.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/options.go deleted file mode 100644 index 2845b43a8dd..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/options.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ecrpublic - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom - // endpoint, set the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. If specified in an operation call's - // functional options with a value that is different than the constructed client's - // Options, the Client's Retryer will be wrapped to use the operation's specific - // RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. Currently does not support per operation call - // overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. Currently does not support per operation call - // overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index 9cf6cf22b40..cac6f926eb8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,7 +1,3 @@ -# v1.11.2 (2024-03-29) - -* No change notes available for this release. - # v1.11.1 (2024-02-21) * No change notes available for this release. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index 6339b54191a..c5ae0f8735d 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.11.2" +const goModuleVersion = "1.11.1" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 60670452103..ead169d5cfb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,15 +1,3 @@ -# v1.11.9 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.8 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.7 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.11.6 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 24fd480d379..98bea53bdda 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.11.9" +const goModuleVersion = "1.11.6" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md index 481b8b29db3..de4149792da 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md @@ -1,31 +1,3 @@ -# v1.32.1 (2024-05-23) - -* No change notes available for this release. - -# v1.32.0 (2024-05-22) - -* **Feature**: This release includes feature to import customer's asymmetric (RSA, ECC and SM2) and HMAC keys into KMS in China. - -# v1.31.3 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.2 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.1 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.31.0 (2024-04-12) - -* **Feature**: This feature supports the ability to specify a custom rotation period for automatic key rotations, the ability to perform on-demand key rotations, and visibility into your key material rotations. - -# v1.30.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.30.0 (2024-03-18) * **Feature**: Adds the ability to use the default policy name by omitting the policyName parameter in calls to PutKeyPolicy and GetKeyPolicy diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go index 34d958bc941..4cabfbcbbe6 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go @@ -11,28 +11,19 @@ import ( ) // Cancels the deletion of a KMS key. When this operation succeeds, the key state -// of the KMS key is Disabled . To enable the KMS key, use EnableKey. -// -// For more information about scheduling and canceling deletion of a KMS key, see [Deleting KMS keys] -// in the Key Management Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:CancelKeyDeletion] (key policy) -// -// Related operations: ScheduleKeyDeletion -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:CancelKeyDeletion]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Deleting KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// of the KMS key is Disabled . To enable the KMS key, use EnableKey . For more +// information about scheduling and canceling deletion of a KMS key, see Deleting +// KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:CancelKeyDeletion (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: ScheduleKeyDeletion Eventual consistency: The +// KMS API follows an eventual consistency model. For more information, see KMS +// eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) CancelKeyDeletion(ctx context.Context, params *CancelKeyDeletionInput, optFns ...func(*Options)) (*CancelKeyDeletionOutput, error) { if params == nil { params = &CancelKeyDeletionInput{} @@ -50,18 +41,12 @@ func (c *Client) CancelKeyDeletion(ctx context.Context, params *CancelKeyDeletio type CancelKeyDeletionInput struct { - // Identifies the KMS key whose deletion is being canceled. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Identifies the KMS key whose deletion is being canceled. Specify the key ID or + // key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string @@ -71,9 +56,8 @@ type CancelKeyDeletionInput struct { type CancelKeyDeletionOutput struct { - // The Amazon Resource Name ([key ARN] ) of the KMS key whose deletion is canceled. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key whose deletion is canceled. KeyId *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go index 12faa6b1bf0..92021a497b1 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go @@ -10,99 +10,66 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Connects or reconnects a [custom key store] to its backing key store. For an CloudHSM key store, -// ConnectCustomKeyStore connects the key store to its associated CloudHSM cluster. -// For an external key store, ConnectCustomKeyStore connects the key store to the -// external key store proxy that communicates with your external key manager. -// -// The custom key store must be connected before you can create KMS keys in the -// key store or use the KMS keys it contains. You can disconnect and reconnect a -// custom key store at any time. -// -// The connection process for a custom key store can take an extended amount of -// time to complete. This operation starts the connection process, but it does not -// wait for it to complete. When it succeeds, this operation quickly returns an +// Connects or reconnects a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// to its backing key store. For an CloudHSM key store, ConnectCustomKeyStore +// connects the key store to its associated CloudHSM cluster. For an external key +// store, ConnectCustomKeyStore connects the key store to the external key store +// proxy that communicates with your external key manager. The custom key store +// must be connected before you can create KMS keys in the key store or use the KMS +// keys it contains. You can disconnect and reconnect a custom key store at any +// time. The connection process for a custom key store can take an extended amount +// of time to complete. This operation starts the connection process, but it does +// not wait for it to complete. When it succeeds, this operation quickly returns an // HTTP 200 response and a JSON object with no properties. However, this response // does not indicate that the custom key store is connected. To get the connection -// state of the custom key store, use the DescribeCustomKeyStoresoperation. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// The ConnectCustomKeyStore operation might fail for various reasons. To find the -// reason, use the DescribeCustomKeyStoresoperation and see the ConnectionErrorCode in the response. For -// help interpreting the ConnectionErrorCode , see CustomKeyStoresListEntry. -// -// To fix the failure, use the DisconnectCustomKeyStore operation to disconnect the custom key store, -// correct the error, use the UpdateCustomKeyStoreoperation if necessary, and then use -// ConnectCustomKeyStore again. -// -// # CloudHSM key store -// -// During the connection process for an CloudHSM key store, KMS finds the CloudHSM -// cluster that is associated with the custom key store, creates the connection -// infrastructure, connects to the cluster, logs into the CloudHSM client as the -// kmsuser CU, and rotates its password. -// -// To connect an CloudHSM key store, its associated CloudHSM cluster must have at -// least one active HSM. To get the number of active HSMs in a cluster, use the [DescribeClusters] -// operation. To add HSMs to the cluster, use the [CreateHsm]operation. Also, the [kmsuser crypto user]kmsuser +// state of the custom key store, use the DescribeCustomKeyStores operation. This +// operation is part of the custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. The +// ConnectCustomKeyStore operation might fail for various reasons. To find the +// reason, use the DescribeCustomKeyStores operation and see the +// ConnectionErrorCode in the response. For help interpreting the +// ConnectionErrorCode , see CustomKeyStoresListEntry . To fix the failure, use the +// DisconnectCustomKeyStore operation to disconnect the custom key store, correct +// the error, use the UpdateCustomKeyStore operation if necessary, and then use +// ConnectCustomKeyStore again. CloudHSM key store During the connection process +// for an CloudHSM key store, KMS finds the CloudHSM cluster that is associated +// with the custom key store, creates the connection infrastructure, connects to +// the cluster, logs into the CloudHSM client as the kmsuser CU, and rotates its +// password. To connect an CloudHSM key store, its associated CloudHSM cluster must +// have at least one active HSM. To get the number of active HSMs in a cluster, use +// the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) +// operation. To add HSMs to the cluster, use the CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) +// operation. Also, the kmsuser crypto user (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) // (CU) must not be logged into the cluster. This prevents KMS from using this -// account to log in. -// -// If you are having trouble connecting or disconnecting a CloudHSM key store, see [Troubleshooting an CloudHSM key store] -// in the Key Management Service Developer Guide. -// -// # External key store -// -// When you connect an external key store that uses public endpoint connectivity, -// KMS tests its ability to communicate with your external key manager by sending a -// request via the external key store proxy. -// -// When you connect to an external key store that uses VPC endpoint service -// connectivity, KMS establishes the networking elements that it needs to -// communicate with your external key manager via the external key store proxy. -// This includes creating an interface endpoint to the VPC endpoint service and a -// private hosted zone for traffic between KMS and the VPC endpoint service. -// -// To connect an external key store, KMS must be able to connect to the external -// key store proxy, the external key store proxy must be able to communicate with -// your external key manager, and the external key manager must be available for -// cryptographic operations. -// -// If you are having trouble connecting or disconnecting an external key store, -// see [Troubleshooting an external key store]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:ConnectCustomKeyStore] (IAM policy) -// -// # Related operations -// -// # CreateCustomKeyStore -// -// # DeleteCustomKeyStore -// -// # DescribeCustomKeyStores -// -// # DisconnectCustomKeyStore -// -// # UpdateCustomKeyStore +// account to log in. If you are having trouble connecting or disconnecting a +// CloudHSM key store, see Troubleshooting an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) +// in the Key Management Service Developer Guide. External key store When you +// connect an external key store that uses public endpoint connectivity, KMS tests +// its ability to communicate with your external key manager by sending a request +// via the external key store proxy. When you connect to an external key store that +// uses VPC endpoint service connectivity, KMS establishes the networking elements +// that it needs to communicate with your external key manager via the external key +// store proxy. This includes creating an interface endpoint to the VPC endpoint +// service and a private hosted zone for traffic between KMS and the VPC endpoint +// service. To connect an external key store, KMS must be able to connect to the +// external key store proxy, the external key store proxy must be able to +// communicate with your external key manager, and the external key manager must be +// available for cryptographic operations. If you are having trouble connecting or +// disconnecting an external key store, see Troubleshooting an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a custom key store in a different Amazon Web Services +// account. Required permissions: kms:ConnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations +// - CreateCustomKeyStore +// - DeleteCustomKeyStore +// - DescribeCustomKeyStores +// - DisconnectCustomKeyStore +// - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [DescribeClusters]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [kmsuser crypto user]: https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser -// [Troubleshooting an CloudHSM key store]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html -// [CreateHsm]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html -// [kms:ConnectCustomKeyStore]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Troubleshooting an external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ConnectCustomKeyStore(ctx context.Context, params *ConnectCustomKeyStoreInput, optFns ...func(*Options)) (*ConnectCustomKeyStoreOutput, error) { if params == nil { params = &ConnectCustomKeyStoreInput{} @@ -121,7 +88,7 @@ func (c *Client) ConnectCustomKeyStore(ctx context.Context, params *ConnectCusto type ConnectCustomKeyStoreInput struct { // Enter the key store ID of the custom key store that you want to connect. To - // find the ID of a custom key store, use the DescribeCustomKeyStoresoperation. + // find the ID of a custom key store, use the DescribeCustomKeyStores operation. // // This member is required. CustomKeyStoreId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go index a533b6991d0..1ef799fb995 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go @@ -10,62 +10,41 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a friendly name for a KMS key. -// -// Adding, deleting, or updating an alias can allow or deny permission to the KMS -// key. For details, see [ABAC for KMS]in the Key Management Service Developer Guide. -// -// You can use an alias to identify a KMS key in the KMS console, in the DescribeKey -// operation and in [cryptographic operations], such as Encrypt and GenerateDataKey. You can also change the KMS key that's -// associated with the alias (UpdateAlias ) or delete the alias (DeleteAlias ) at any time. These -// operations don't affect the underlying KMS key. -// -// You can associate the alias with any customer managed key in the same Amazon -// Web Services Region. Each alias is associated with only one KMS key at a time, -// but a KMS key can have multiple aliases. A valid KMS key is required. You can't -// create an alias without a KMS key. -// -// The alias must be unique in the account and Region, but you can have aliases -// with the same name in different Regions. For detailed information about aliases, -// see [Using aliases]in the Key Management Service Developer Guide. -// -// This operation does not return a response. To get the alias that you created, -// use the ListAliasesoperation. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on an alias in a -// different Amazon Web Services account. -// -// # Required permissions -// -// [kms:CreateAlias] -// - on the alias (IAM policy). -// -// [kms:CreateAlias] -// - on the KMS key (key policy). -// -// For details, see [Controlling access to aliases] in the Key Management Service Developer Guide. -// -// Related operations: -// -// # DeleteAlias -// -// # ListAliases -// -// # UpdateAlias +// Creates a friendly name for a KMS key. Adding, deleting, or updating an alias +// can allow or deny permission to the KMS key. For details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) +// in the Key Management Service Developer Guide. You can use an alias to identify +// a KMS key in the KMS console, in the DescribeKey operation and in cryptographic +// operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// , such as Encrypt and GenerateDataKey . You can also change the KMS key that's +// associated with the alias ( UpdateAlias ) or delete the alias ( DeleteAlias ) at +// any time. These operations don't affect the underlying KMS key. You can +// associate the alias with any customer managed key in the same Amazon Web +// Services Region. Each alias is associated with only one KMS key at a time, but a +// KMS key can have multiple aliases. A valid KMS key is required. You can't create +// an alias without a KMS key. The alias must be unique in the account and Region, +// but you can have aliases with the same name in different Regions. For detailed +// information about aliases, see Using aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) +// in the Key Management Service Developer Guide. This operation does not return a +// response. To get the alias that you created, use the ListAliases operation. The +// KMS key that you use for this operation must be in a compatible key state. For +// details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on an alias in a different Amazon Web Services account. +// Required permissions +// - kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// - kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the KMS key (key policy). +// +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the Key Management Service Developer Guide. Related operations: +// - DeleteAlias +// - ListAliases +// - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [Using aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html -// [kms:CreateAlias]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Controlling access to aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optFns ...func(*Options)) (*CreateAliasOutput, error) { if params == nil { params = &CreateAliasInput{} @@ -84,43 +63,27 @@ func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optF type CreateAliasInput struct { // Specifies the alias name. This value must begin with alias/ followed by a name, - // such as alias/ExampleAlias . - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // The AliasName value must be string of 1-256 characters. It can contain only - // alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). - // The alias name cannot begin with alias/aws/ . The alias/aws/ prefix is reserved - // for [Amazon Web Services managed keys]. - // - // [Amazon Web Services managed keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + // such as alias/ExampleAlias . Do not include confidential or sensitive + // information in this field. This field may be displayed in plaintext in + // CloudTrail logs and other output. The AliasName value must be string of 1-256 + // characters. It can contain only alphanumeric characters, forward slashes (/), + // underscores (_), and dashes (-). The alias name cannot begin with alias/aws/ . + // The alias/aws/ prefix is reserved for Amazon Web Services managed keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) + // . // // This member is required. AliasName *string - // Associates the alias with the specified [customer managed key]. The KMS key must be in the same - // Amazon Web Services Region. - // - // A valid key ID is required. If you supply a null or empty string value, this - // operation returns an error. - // - // For help finding the key ID and ARN, see [Finding the Key ID and ARN] in the Key Management Service - // Developer Guide . - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Associates the alias with the specified customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) + // . The KMS key must be in the same Amazon Web Services Region. A valid key ID is + // required. If you supply a null or empty string value, this operation returns an + // error. For help finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) + // in the Key Management Service Developer Guide . Specify the key ID or key ARN of + // the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - // [Finding the Key ID and ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. TargetKeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go index 49b072e60b0..00679206d4c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go @@ -11,90 +11,67 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a [custom key store] backed by a key store that you own and manage. When you use a KMS -// key in a custom key store for a cryptographic operation, the cryptographic -// operation is actually performed in your key store using your keys. KMS supports [CloudHSM key stores] -// backed by an [CloudHSM cluster]and [external key stores] backed by an external key store proxy and external key -// manager outside of Amazon Web Services. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// Before you create the custom key store, the required elements must be in place -// and operational. We recommend that you use the test tools that KMS provides to +// Creates a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// backed by a key store that you own and manage. When you use a KMS key in a +// custom key store for a cryptographic operation, the cryptographic operation is +// actually performed in your key store using your keys. KMS supports CloudHSM key +// stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html) +// backed by an CloudHSM cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/clusters.html) +// and external key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html) +// backed by an external key store proxy and external key manager outside of Amazon +// Web Services. This operation is part of the custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. Before +// you create the custom key store, the required elements must be in place and +// operational. We recommend that you use the test tools that KMS provides to // verify the configuration your external key store proxy. For details about the -// required elements and verification tests, see [Assemble the prerequisites (for CloudHSM key stores)]or [Assemble the prerequisites (for external key stores)] in the Key Management Service -// Developer Guide. -// -// To create a custom key store, use the following parameters. -// +// required elements and verification tests, see Assemble the prerequisites (for +// CloudHSM key stores) (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) +// or Assemble the prerequisites (for external key stores) (https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keystore.html#xks-requirements) +// in the Key Management Service Developer Guide. To create a custom key store, use +// the following parameters. // - To create an CloudHSM key store, specify the CustomKeyStoreName , // CloudHsmClusterId , KeyStorePassword , and TrustAnchorCertificate . The // CustomKeyStoreType parameter is optional for CloudHSM key stores. If you // include it, set it to the default value, AWS_CLOUDHSM . For help with -// failures, see [Troubleshooting an CloudHSM key store]in the Key Management Service Developer Guide. -// +// failures, see Troubleshooting an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) +// in the Key Management Service Developer Guide. // - To create an external key store, specify the CustomKeyStoreName and a // CustomKeyStoreType of EXTERNAL_KEY_STORE . Also, specify values for // XksProxyConnectivity , XksProxyAuthenticationCredential , XksProxyUriEndpoint // , and XksProxyUriPath . If your XksProxyConnectivity value is // VPC_ENDPOINT_SERVICE , specify the XksProxyVpcEndpointServiceName parameter. -// For help with failures, see [Troubleshooting an external key store]in the Key Management Service Developer Guide. -// -// For external key stores: -// -// Some external key managers provide a simpler method for creating an external -// key store. For details, see your external key manager documentation. -// -// When creating an external key store in the KMS console, you can upload a -// JSON-based proxy configuration file with the desired values. You cannot use a -// proxy configuration with the CreateCustomKeyStore operation. However, you can -// use the values in the file to help you determine the correct values for the -// CreateCustomKeyStore parameters. -// -// When the operation completes successfully, it returns the ID of the new custom -// key store. Before you can use your new custom key store, you need to use the ConnectCustomKeyStore -// operation to connect a new CloudHSM key store to its CloudHSM cluster, or to -// connect a new external key store to the external key store proxy for your -// external key manager. Even if you are not going to use your custom key store -// immediately, you might want to connect it to verify that all settings are -// correct and then disconnect it until you are ready to use it. -// -// For help with failures, see [Troubleshooting a custom key store] in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:CreateCustomKeyStore] (IAM policy). -// -// Related operations: +// For help with failures, see Troubleshooting an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html) +// in the Key Management Service Developer Guide. // -// # ConnectCustomKeyStore -// -// # DeleteCustomKeyStore -// -// # DescribeCustomKeyStores -// -// # DisconnectCustomKeyStore -// -// # UpdateCustomKeyStore +// For external key stores: Some external key managers provide a simpler method +// for creating an external key store. For details, see your external key manager +// documentation. When creating an external key store in the KMS console, you can +// upload a JSON-based proxy configuration file with the desired values. You cannot +// use a proxy configuration with the CreateCustomKeyStore operation. However, you +// can use the values in the file to help you determine the correct values for the +// CreateCustomKeyStore parameters. When the operation completes successfully, it +// returns the ID of the new custom key store. Before you can use your new custom +// key store, you need to use the ConnectCustomKeyStore operation to connect a new +// CloudHSM key store to its CloudHSM cluster, or to connect a new external key +// store to the external key store proxy for your external key manager. Even if you +// are not going to use your custom key store immediately, you might want to +// connect it to verify that all settings are correct and then disconnect it until +// you are ready to use it. For help with failures, see Troubleshooting a custom +// key store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a custom key store in a different Amazon Web Services +// account. Required permissions: kms:CreateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). Related operations: +// - ConnectCustomKeyStore +// - DeleteCustomKeyStore +// - DescribeCustomKeyStores +// - DisconnectCustomKeyStore +// - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [CloudHSM key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html -// [CloudHSM cluster]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/clusters.html -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [external key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html -// [Troubleshooting an CloudHSM key store]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html -// [Assemble the prerequisites (for CloudHSM key stores)]: https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore -// [Assemble the prerequisites (for external key stores)]: https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keystore.html#xks-requirements -// [Troubleshooting a custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html -// [Troubleshooting an external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html -// [kms:CreateCustomKeyStore]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) CreateCustomKeyStore(ctx context.Context, params *CreateCustomKeyStoreInput, optFns ...func(*Options)) (*CreateCustomKeyStoreOutput, error) { if params == nil { params = &CreateCustomKeyStoreInput{} @@ -114,125 +91,96 @@ type CreateCustomKeyStoreInput struct { // Specifies a friendly name for the custom key store. The name must be unique in // your Amazon Web Services account and Region. This parameter is required for all - // custom key stores. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. + // custom key stores. Do not include confidential or sensitive information in this + // field. This field may be displayed in plaintext in CloudTrail logs and other + // output. // // This member is required. CustomKeyStoreName *string // Identifies the CloudHSM cluster for an CloudHSM key store. This parameter is - // required for custom key stores with CustomKeyStoreType of AWS_CLOUDHSM . - // - // Enter the cluster ID of any active CloudHSM cluster that is not already - // associated with a custom key store. To find the cluster ID, use the [DescribeClusters]operation. - // - // [DescribeClusters]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html + // required for custom key stores with CustomKeyStoreType of AWS_CLOUDHSM . Enter + // the cluster ID of any active CloudHSM cluster that is not already associated + // with a custom key store. To find the cluster ID, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) + // operation. CloudHsmClusterId *string - // Specifies the type of custom key store. The default value is AWS_CLOUDHSM . - // - // For a custom key store backed by an CloudHSM cluster, omit the parameter or - // enter AWS_CLOUDHSM . For a custom key store backed by an external key manager - // outside of Amazon Web Services, enter EXTERNAL_KEY_STORE . You cannot change - // this property after the key store is created. + // Specifies the type of custom key store. The default value is AWS_CLOUDHSM . For + // a custom key store backed by an CloudHSM cluster, omit the parameter or enter + // AWS_CLOUDHSM . For a custom key store backed by an external key manager outside + // of Amazon Web Services, enter EXTERNAL_KEY_STORE . You cannot change this + // property after the key store is created. CustomKeyStoreType types.CustomKeyStoreType // Specifies the kmsuser password for an CloudHSM key store. This parameter is - // required for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . - // - // Enter the password of the [kmsuser crypto user (CU) account]kmsuser in the specified CloudHSM cluster. KMS logs - // into the cluster as this user to manage key material on your behalf. - // - // The password must be a string of 7 to 32 characters. Its value is case - // sensitive. - // - // This parameter tells KMS the kmsuser account password; it does not change the - // password in the CloudHSM cluster. - // - // [kmsuser crypto user (CU) account]: https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser + // required for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . Enter + // the password of the kmsuser crypto user (CU) account (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) + // in the specified CloudHSM cluster. KMS logs into the cluster as this user to + // manage key material on your behalf. The password must be a string of 7 to 32 + // characters. Its value is case sensitive. This parameter tells KMS the kmsuser + // account password; it does not change the password in the CloudHSM cluster. KeyStorePassword *string // Specifies the certificate for an CloudHSM key store. This parameter is required - // for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . - // - // Enter the content of the trust anchor certificate for the CloudHSM cluster. - // This is the content of the customerCA.crt file that you created when you [initialized the cluster]. - // - // [initialized the cluster]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html + // for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . Enter the + // content of the trust anchor certificate for the CloudHSM cluster. This is the + // content of the customerCA.crt file that you created when you initialized the + // cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html) + // . TrustAnchorCertificate *string // Specifies an authentication credential for the external key store proxy (XKS // proxy). This parameter is required for all custom key stores with a - // CustomKeyStoreType of EXTERNAL_KEY_STORE . - // - // The XksProxyAuthenticationCredential has two required elements: - // RawSecretAccessKey , a secret key, and AccessKeyId , a unique identifier for the - // RawSecretAccessKey . For character requirements, see XksProxyAuthenticationCredentialType. - // - // KMS uses this authentication credential to sign requests to the external key - // store proxy on your behalf. This credential is unrelated to Identity and Access - // Management (IAM) and Amazon Web Services credentials. - // - // This parameter doesn't set or change the authentication credentials on the XKS - // proxy. It just tells KMS the credential that you established on your external - // key store proxy. If you rotate your proxy authentication credential, use the UpdateCustomKeyStore - // operation to provide the new credential to KMS. + // CustomKeyStoreType of EXTERNAL_KEY_STORE . The XksProxyAuthenticationCredential + // has two required elements: RawSecretAccessKey , a secret key, and AccessKeyId , + // a unique identifier for the RawSecretAccessKey . For character requirements, see + // XksProxyAuthenticationCredentialType . KMS uses this authentication credential + // to sign requests to the external key store proxy on your behalf. This credential + // is unrelated to Identity and Access Management (IAM) and Amazon Web Services + // credentials. This parameter doesn't set or change the authentication credentials + // on the XKS proxy. It just tells KMS the credential that you established on your + // external key store proxy. If you rotate your proxy authentication credential, + // use the UpdateCustomKeyStore operation to provide the new credential to KMS. XksProxyAuthenticationCredential *types.XksProxyAuthenticationCredentialType // Indicates how KMS communicates with the external key store proxy. This // parameter is required for custom key stores with a CustomKeyStoreType of - // EXTERNAL_KEY_STORE . - // - // If the external key store proxy uses a public endpoint, specify PUBLIC_ENDPOINT - // . If the external key store proxy uses a Amazon VPC endpoint service for - // communication with KMS, specify VPC_ENDPOINT_SERVICE . For help making this - // choice, see [Choosing a connectivity option]in the Key Management Service Developer Guide. - // - // An Amazon VPC endpoint service keeps your communication with KMS in a private - // address space entirely within Amazon Web Services, but it requires more - // configuration, including establishing a Amazon VPC with multiple subnets, a VPC - // endpoint service, a network load balancer, and a verified private DNS name. A - // public endpoint is simpler to set up, but it might be slower and might not - // fulfill your security requirements. You might consider testing with a public - // endpoint, and then establishing a VPC endpoint service for production tasks. - // Note that this choice does not determine the location of the external key store - // proxy. Even if you choose a VPC endpoint service, the proxy can be hosted within - // the VPC or outside of Amazon Web Services such as in your corporate data center. - // - // [Choosing a connectivity option]: https://docs.aws.amazon.com/kms/latest/developerguide/plan-xks-keystore.html#choose-xks-connectivity + // EXTERNAL_KEY_STORE . If the external key store proxy uses a public endpoint, + // specify PUBLIC_ENDPOINT . If the external key store proxy uses a Amazon VPC + // endpoint service for communication with KMS, specify VPC_ENDPOINT_SERVICE . For + // help making this choice, see Choosing a connectivity option (https://docs.aws.amazon.com/kms/latest/developerguide/plan-xks-keystore.html#choose-xks-connectivity) + // in the Key Management Service Developer Guide. An Amazon VPC endpoint service + // keeps your communication with KMS in a private address space entirely within + // Amazon Web Services, but it requires more configuration, including establishing + // a Amazon VPC with multiple subnets, a VPC endpoint service, a network load + // balancer, and a verified private DNS name. A public endpoint is simpler to set + // up, but it might be slower and might not fulfill your security requirements. You + // might consider testing with a public endpoint, and then establishing a VPC + // endpoint service for production tasks. Note that this choice does not determine + // the location of the external key store proxy. Even if you choose a VPC endpoint + // service, the proxy can be hosted within the VPC or outside of Amazon Web + // Services such as in your corporate data center. XksProxyConnectivity types.XksProxyConnectivityType // Specifies the endpoint that KMS uses to send requests to the external key store // proxy (XKS proxy). This parameter is required for custom key stores with a - // CustomKeyStoreType of EXTERNAL_KEY_STORE . - // - // The protocol must be HTTPS. KMS communicates on port 443. Do not specify the - // port in the XksProxyUriEndpoint value. - // - // For external key stores with XksProxyConnectivity value of VPC_ENDPOINT_SERVICE - // , specify https:// followed by the private DNS name of the VPC endpoint service. - // - // For external key stores with PUBLIC_ENDPOINT connectivity, this endpoint must - // be reachable before you create the custom key store. KMS connects to the - // external key store proxy while creating the custom key store. For external key - // stores with VPC_ENDPOINT_SERVICE connectivity, KMS connects when you call the ConnectCustomKeyStore - // operation. - // - // The value of this parameter must begin with https:// . The remainder can contain - // upper and lower case letters (A-Z and a-z), numbers (0-9), dots ( . ), and - // hyphens ( - ). Additional slashes ( / and \ ) are not permitted. - // - // Uniqueness requirements: - // + // CustomKeyStoreType of EXTERNAL_KEY_STORE . The protocol must be HTTPS. KMS + // communicates on port 443. Do not specify the port in the XksProxyUriEndpoint + // value. For external key stores with XksProxyConnectivity value of + // VPC_ENDPOINT_SERVICE , specify https:// followed by the private DNS name of the + // VPC endpoint service. For external key stores with PUBLIC_ENDPOINT + // connectivity, this endpoint must be reachable before you create the custom key + // store. KMS connects to the external key store proxy while creating the custom + // key store. For external key stores with VPC_ENDPOINT_SERVICE connectivity, KMS + // connects when you call the ConnectCustomKeyStore operation. The value of this + // parameter must begin with https:// . The remainder can contain upper and lower + // case letters (A-Z and a-z), numbers (0-9), dots ( . ), and hyphens ( - ). + // Additional slashes ( / and \ ) are not permitted. Uniqueness requirements: // - The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique // in the Amazon Web Services account and Region. - // // - An external key store with PUBLIC_ENDPOINT connectivity cannot use the same // XksProxyUriEndpoint value as an external key store with VPC_ENDPOINT_SERVICE // connectivity in this Amazon Web Services Region. - // // - Each external key store with VPC_ENDPOINT_SERVICE connectivity must have its // own private DNS name. The XksProxyUriEndpoint value for external key stores // with VPC_ENDPOINT_SERVICE connectivity (private DNS name) must be unique in @@ -242,14 +190,10 @@ type CreateCustomKeyStoreInput struct { // Specifies the base path to the proxy APIs for this external key store. To find // this value, see the documentation for your external key store proxy. This // parameter is required for all custom key stores with a CustomKeyStoreType of - // EXTERNAL_KEY_STORE . - // - // The value must start with / and must end with /kms/xks/v1 where v1 represents - // the version of the KMS external key store proxy API. This path can include an - // optional prefix between the required elements such as /prefix/kms/xks/v1 . - // - // Uniqueness requirements: - // + // EXTERNAL_KEY_STORE . The value must start with / and must end with /kms/xks/v1 + // where v1 represents the version of the KMS external key store proxy API. This + // path can include an optional prefix between the required elements such as + // /prefix/kms/xks/v1 . Uniqueness requirements: // - The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique // in the Amazon Web Services account and Region. XksProxyUriPath *string @@ -257,17 +201,12 @@ type CreateCustomKeyStoreInput struct { // Specifies the name of the Amazon VPC endpoint service for interface endpoints // that is used to communicate with your external key store proxy (XKS proxy). This // parameter is required when the value of CustomKeyStoreType is EXTERNAL_KEY_STORE - // and the value of XksProxyConnectivity is VPC_ENDPOINT_SERVICE . - // - // The Amazon VPC endpoint service must [fulfill all requirements] for use with an external key store. - // - // Uniqueness requirements: - // + // and the value of XksProxyConnectivity is VPC_ENDPOINT_SERVICE . The Amazon VPC + // endpoint service must fulfill all requirements (https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keystore.html#xks-requirements) + // for use with an external key store. Uniqueness requirements: // - External key stores with VPC_ENDPOINT_SERVICE connectivity can share an // Amazon VPC, but each external key store must have its own VPC endpoint service // and private DNS name. - // - // [fulfill all requirements]: https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keystore.html#xks-requirements XksProxyVpcEndpointServiceName *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go index 86de7bf6b0e..691a17b45aa 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go @@ -11,65 +11,45 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds a grant to a KMS key. -// -// A grant is a policy instrument that allows Amazon Web Services principals to -// use KMS keys in cryptographic operations. It also can allow them to view a KMS -// key (DescribeKey ) and create and manage grants. When authorizing access to a KMS key, -// grants are considered along with key policies and IAM policies. Grants are often -// used for temporary permissions because you can create one, use its permissions, -// and delete it without changing your key policies or IAM policies. -// -// For detailed information about grants, including grant terminology, see [Grants in KMS] in the -// Key Management Service Developer Guide . For examples of working with grants in -// several programming languages, see [Programming grants]. -// -// The CreateGrant operation returns a GrantToken and a GrantId . -// +// Adds a grant to a KMS key. A grant is a policy instrument that allows Amazon +// Web Services principals to use KMS keys in cryptographic operations. It also can +// allow them to view a KMS key ( DescribeKey ) and create and manage grants. When +// authorizing access to a KMS key, grants are considered along with key policies +// and IAM policies. Grants are often used for temporary permissions because you +// can create one, use its permissions, and delete it without changing your key +// policies or IAM policies. For detailed information about grants, including grant +// terminology, see Grants in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the Key Management Service Developer Guide . For examples of working with +// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html) +// . The CreateGrant operation returns a GrantToken and a GrantId . // - When you create, retire, or revoke a grant, there might be a brief delay, // usually less than five minutes, until the grant is available throughout KMS. // This state is known as eventual consistency. Once the grant has achieved // eventual consistency, the grantee principal can use the permissions in the grant -// without identifying the grant. -// -// However, to use the permissions in the grant immediately, use the GrantToken -// -// that CreateGrant returns. For details, see [Using a grant token]in the Key Management Service -// Developer Guide . -// -// - The CreateGrant operation also returns a GrantId . You can use the GrantId -// and a key identifier to identify the grant in the RetireGrantand RevokeGrantoperations. To find the -// grant ID, use the ListGrantsor ListRetirableGrantsoperations. +// without identifying the grant. However, to use the permissions in the grant +// immediately, use the GrantToken that CreateGrant returns. For details, see +// Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) +// in the Key Management Service Developer Guide . +// - The CreateGrant operation also returns a GrantId . You can use the GrantId +// and a key identifier to identify the grant in the RetireGrant and RevokeGrant +// operations. To find the grant ID, use the ListGrants or ListRetirableGrants +// operations. // // The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation on a KMS key in a different -// Amazon Web Services account, specify the key ARN in the value of the KeyId -// parameter. -// -// Required permissions: [kms:CreateGrant] (key policy) -// -// Related operations: -// -// # ListGrants -// -// # ListRetirableGrants -// -// # RetireGrant -// -// # RevokeGrant +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation on a KMS key in a different Amazon Web Services account, +// specify the key ARN in the value of the KeyId parameter. Required permissions: +// kms:CreateGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - ListGrants +// - ListRetirableGrants +// - RetireGrant +// - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Programming grants]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Grants in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html -// [kms:CreateGrant]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// -// [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) CreateGrant(ctx context.Context, params *CreateGrantInput, optFns ...func(*Options)) (*CreateGrantOutput, error) { if params == nil { params = &CreateGrantInput{} @@ -87,133 +67,100 @@ func (c *Client) CreateGrant(ctx context.Context, params *CreateGrantInput, optF type CreateGrantInput struct { - // The identity that gets the permissions specified in the grant. - // - // To specify the grantee principal, use the Amazon Resource Name (ARN) of an - // Amazon Web Services principal. Valid principals include Amazon Web Services - // accounts, IAM users, IAM roles, federated users, and assumed role users. For - // help with the ARN syntax for a principal, see [IAM ARNs]in the Identity and Access - // Management User Guide . - // - // [IAM ARNs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns + // The identity that gets the permissions specified in the grant. To specify the + // grantee principal, use the Amazon Resource Name (ARN) of an Amazon Web Services + // principal. Valid principals include Amazon Web Services accounts, IAM users, IAM + // roles, federated users, and assumed role users. For help with the ARN syntax for + // a principal, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns) + // in the Identity and Access Management User Guide . // // This member is required. GranteePrincipal *string // Identifies the KMS key for the grant. The grant gives principals permission to - // use this KMS key. - // - // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN. - // - // For example: - // + // use this KMS key. Specify the key ID or key ARN of the KMS key. To specify a KMS + // key in a different Amazon Web Services account, you must use the key ARN. For + // example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // A list of operations that the grant permits. - // - // This list must include only operations that are permitted in a grant. Also, the - // operation must be supported on the KMS key. For example, you cannot create a - // grant for a symmetric encryption KMS key that allows the Signoperation, or a grant - // for an asymmetric KMS key that allows the GenerateDataKeyoperation. If you try, KMS returns a - // ValidationError exception. For details, see [Grant operations] in the Key Management Service - // Developer Guide. - // - // [Grant operations]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations + // A list of operations that the grant permits. This list must include only + // operations that are permitted in a grant. Also, the operation must be supported + // on the KMS key. For example, you cannot create a grant for a symmetric + // encryption KMS key that allows the Sign operation, or a grant for an asymmetric + // KMS key that allows the GenerateDataKey operation. If you try, KMS returns a + // ValidationError exception. For details, see Grant operations (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations) + // in the Key Management Service Developer Guide. // // This member is required. Operations []types.GrantOperation - // Specifies a grant constraint. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // KMS supports the EncryptionContextEquals and EncryptionContextSubset grant - // constraints, which allow the permissions in the grant only when the encryption - // context in the request matches ( EncryptionContextEquals ) or includes ( - // EncryptionContextSubset ) the encryption context specified in the constraint. - // - // The encryption context grant constraints are supported only on [grant operations] that include an - // EncryptionContext parameter, such as cryptographic operations on symmetric - // encryption KMS keys. Grants with grant constraints can include the DescribeKeyand RetireGrant - // operations, but the constraint doesn't apply to these operations. If a grant - // with a grant constraint includes the CreateGrant operation, the constraint - // requires that any grants created with the CreateGrant permission have an - // equally strict or stricter encryption context constraint. - // - // You cannot use an encryption context grant constraint for cryptographic - // operations with asymmetric KMS keys or HMAC KMS keys. Operations with these keys - // don't support an encryption context. - // - // Each constraint value can include up to 8 encryption context pairs. The - // encryption context value in each constraint cannot exceed 384 characters. For - // information about grant constraints, see [Using grant constraints]in the Key Management Service - // Developer Guide. For more information about encryption context, see [Encryption context]in the Key - // Management Service Developer Guide . - // - // [grant operations]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations - // [Using grant constraints]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // Specifies a grant constraint. Do not include confidential or sensitive + // information in this field. This field may be displayed in plaintext in + // CloudTrail logs and other output. KMS supports the EncryptionContextEquals and + // EncryptionContextSubset grant constraints, which allow the permissions in the + // grant only when the encryption context in the request matches ( + // EncryptionContextEquals ) or includes ( EncryptionContextSubset ) the encryption + // context specified in the constraint. The encryption context grant constraints + // are supported only on grant operations (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations) + // that include an EncryptionContext parameter, such as cryptographic operations + // on symmetric encryption KMS keys. Grants with grant constraints can include the + // DescribeKey and RetireGrant operations, but the constraint doesn't apply to + // these operations. If a grant with a grant constraint includes the CreateGrant + // operation, the constraint requires that any grants created with the CreateGrant + // permission have an equally strict or stricter encryption context constraint. You + // cannot use an encryption context grant constraint for cryptographic operations + // with asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't + // support an encryption context. Each constraint value can include up to 8 + // encryption context pairs. The encryption context value in each constraint cannot + // exceed 384 characters. For information about grant constraints, see Using grant + // constraints (https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints) + // in the Key Management Service Developer Guide. For more information about + // encryption context, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide . Constraints *types.GrantConstraints - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // A friendly name for the grant. Use this value to prevent the unintended - // creation of duplicate grants when retrying this request. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // When this value is absent, all CreateGrant requests result in a new grant with - // a unique GrantId even if all the supplied parameters are identical. This can - // result in unintended duplicates when you retry the CreateGrant request. - // - // When this value is present, you can retry a CreateGrant request with identical - // parameters; if the grant already exists, the original GrantId is returned - // without creating a new grant. Note that the returned grant token is unique with - // every CreateGrant request, even when a duplicate GrantId is returned. All grant - // tokens for the same grant ID can be used interchangeably. + // creation of duplicate grants when retrying this request. Do not include + // confidential or sensitive information in this field. This field may be displayed + // in plaintext in CloudTrail logs and other output. When this value is absent, all + // CreateGrant requests result in a new grant with a unique GrantId even if all + // the supplied parameters are identical. This can result in unintended duplicates + // when you retry the CreateGrant request. When this value is present, you can + // retry a CreateGrant request with identical parameters; if the grant already + // exists, the original GrantId is returned without creating a new grant. Note + // that the returned grant token is unique with every CreateGrant request, even + // when a duplicate GrantId is returned. All grant tokens for the same grant ID + // can be used interchangeably. Name *string - // The principal that has permission to use the RetireGrant operation to retire the grant. - // - // To specify the principal, use the [Amazon Resource Name (ARN)] of an Amazon Web Services principal. Valid - // principals include Amazon Web Services accounts, IAM users, IAM roles, federated - // users, and assumed role users. For help with the ARN syntax for a principal, see - // [IAM ARNs]in the Identity and Access Management User Guide . - // - // The grant determines the retiring principal. Other principals might have - // permission to retire the grant or revoke the grant. For details, see RevokeGrantand [Retiring and revoking grants] in - // the Key Management Service Developer Guide. - // - // [IAM ARNs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns - // [Amazon Resource Name (ARN)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - // [Retiring and revoking grants]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete + // The principal that has permission to use the RetireGrant operation to retire + // the grant. To specify the principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of an Amazon Web Services principal. Valid principals include Amazon Web + // Services accounts, IAM users, IAM roles, federated users, and assumed role + // users. For help with the ARN syntax for a principal, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns) + // in the Identity and Access Management User Guide . The grant determines the + // retiring principal. Other principals might have permission to retire the grant + // or revoke the grant. For details, see RevokeGrant and Retiring and revoking + // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) + // in the Key Management Service Developer Guide. RetiringPrincipal *string noSmithyDocumentSerde @@ -221,19 +168,15 @@ type CreateGrantInput struct { type CreateGrantOutput struct { - // The unique identifier for the grant. - // - // You can use the GrantId in a ListGrants, RetireGrant, or RevokeGrant operation. + // The unique identifier for the grant. You can use the GrantId in a ListGrants , + // RetireGrant , or RevokeGrant operation. GrantId *string - // The grant token. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // The grant token. Use a grant token when your permission to call this operation + // comes from a new grant that has not yet achieved eventual consistency. For more + // information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantToken *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go index 8067e00d7d4..85bf140354b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go @@ -11,173 +11,129 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a unique customer managed [KMS key] in your Amazon Web Services account and -// Region. You can use a KMS key in cryptographic operations, such as encryption -// and signing. Some Amazon Web Services services let you use KMS keys that you -// create and manage to protect your service resources. -// -// A KMS key is a logical representation of a cryptographic key. In addition to -// the key material used in cryptographic operations, a KMS key includes metadata, -// such as the key ID, key policy, creation date, description, and key state. For -// details, see [Managing keys]in the Key Management Service Developer Guide -// -// Use the parameters of CreateKey to specify the type of KMS key, the source of -// its key material, its key policy, description, tags, and other properties. -// -// KMS has replaced the term customer master key (CMK) with KMS key and KMS key. -// The concept has not changed. To prevent breaking changes, KMS is keeping some -// variations of this term. -// -// To create different types of KMS keys, use the following guidance: -// -// Symmetric encryption KMS key By default, CreateKey creates a symmetric -// encryption KMS key with key material that KMS generates. This is the basic and -// most widely used type of KMS key, and provides the best performance. -// -// To create a symmetric encryption KMS key, you don't need to specify any -// parameters. The default value for KeySpec , SYMMETRIC_DEFAULT , the default -// value for KeyUsage , ENCRYPT_DECRYPT , and the default value for Origin , -// AWS_KMS , create a symmetric encryption KMS key with KMS key material. -// -// If you need a key for basic encryption and decryption or you are creating a KMS -// key to protect your resources in an Amazon Web Services service, create a -// symmetric encryption KMS key. The key material in a symmetric encryption key -// never leaves KMS unencrypted. You can use a symmetric encryption KMS key to -// encrypt and decrypt data up to 4,096 bytes, but they are typically used to -// generate data keys and data keys pairs. For details, see GenerateDataKeyand GenerateDataKeyPair. -// -// Asymmetric KMS keys To create an asymmetric KMS key, use the KeySpec parameter -// to specify the type of key material in the KMS key. Then, use the KeyUsage -// parameter to determine whether the KMS key will be used to encrypt and decrypt -// or sign and verify. You can't change these properties after the KMS key is -// created. -// -// Asymmetric KMS keys contain an RSA key pair, Elliptic Curve (ECC) key pair, or -// an SM2 key pair (China Regions only). The private key in an asymmetric KMS key -// never leaves KMS unencrypted. However, you can use the GetPublicKeyoperation to download -// the public key so it can be used outside of KMS. KMS keys with RSA or SM2 key -// pairs can be used to encrypt or decrypt data or sign and verify messages (but -// not both). KMS keys with ECC key pairs can be used only to sign and verify -// messages. For information about asymmetric KMS keys, see [Asymmetric KMS keys]in the Key Management -// Service Developer Guide. -// -// HMAC KMS key To create an HMAC KMS key, set the KeySpec parameter to a key spec -// value for HMAC KMS keys. Then set the KeyUsage parameter to GENERATE_VERIFY_MAC -// . You must set the key usage even though GENERATE_VERIFY_MAC is the only valid -// key usage value for HMAC KMS keys. You can't change these properties after the -// KMS key is created. -// -// HMAC KMS keys are symmetric keys that never leave KMS unencrypted. You can use -// HMAC keys to generate (GenerateMac ) and verify (VerifyMac ) HMAC codes for messages up to 4096 -// bytes. -// -// Multi-Region primary keys Imported key material To create a multi-Region -// primary key in the local Amazon Web Services Region, use the MultiRegion -// parameter with a value of True . To create a multi-Region replica key, that is, -// a KMS key with the same key ID and key material as a primary key, but in a -// different Amazon Web Services Region, use the ReplicateKeyoperation. To change a replica -// key to a primary key, and its primary key to a replica key, use the UpdatePrimaryRegionoperation. -// -// You can create multi-Region KMS keys for all supported KMS key types: symmetric -// encryption KMS keys, HMAC KMS keys, asymmetric encryption KMS keys, and -// asymmetric signing KMS keys. You can also create multi-Region keys with imported -// key material. However, you can't create multi-Region keys in a custom key store. -// -// This operation supports multi-Region keys, an KMS feature that lets you create -// multiple interoperable KMS keys in different Amazon Web Services Regions. -// Because these KMS keys have the same key ID, key material, and other metadata, -// you can use them interchangeably to encrypt data in one Amazon Web Services -// Region and decrypt it in a different Amazon Web Services Region without -// re-encrypting the data or making a cross-Region call. For more information about -// multi-Region keys, see [Multi-Region keys in KMS]in the Key Management Service Developer Guide. -// -// To import your own key material into a KMS key, begin by creating a KMS key -// with no key material. To do this, use the Origin parameter of CreateKey with a -// value of EXTERNAL . Next, use GetParametersForImport operation to get a public key and import token. -// Use the wrapping public key to encrypt your key material. Then, use ImportKeyMaterialwith your -// import token to import the key material. For step-by-step instructions, see [Importing Key Material]in -// the Key Management Service Developer Guide . -// -// You can import key material into KMS keys of all supported KMS key types: -// symmetric encryption KMS keys, HMAC KMS keys, asymmetric encryption KMS keys, -// and asymmetric signing KMS keys. You can also create multi-Region keys with -// imported key material. However, you can't import key material into a KMS key in -// a custom key store. -// -// To create a multi-Region primary key with imported key material, use the Origin -// parameter of CreateKey with a value of EXTERNAL and the MultiRegion parameter -// with a value of True . To create replicas of the multi-Region primary key, use -// the ReplicateKeyoperation. For instructions, see [Importing key material into multi-Region keys]. For more information about multi-Region -// keys, see [Multi-Region keys in KMS]in the Key Management Service Developer Guide. -// -// Custom key store A [custom key store] lets you protect your Amazon Web Services resources using -// keys in a backing key store that you own and manage. When you request a -// cryptographic operation with a KMS key in a custom key store, the operation is -// performed in the backing key store using its cryptographic keys. -// -// KMS supports [CloudHSM key stores] backed by an CloudHSM cluster and [external key stores] backed by an external key -// manager outside of Amazon Web Services. When you create a KMS key in an CloudHSM -// key store, KMS generates an encryption key in the CloudHSM cluster and -// associates it with the KMS key. When you create a KMS key in an external key -// store, you specify an existing encryption key in the external key manager. -// -// Some external key managers provide a simpler method for creating a KMS key in -// an external key store. For details, see your external key manager documentation. -// -// Before you create a KMS key in a custom key store, the ConnectionState of the -// key store must be CONNECTED . To connect the custom key store, use the ConnectCustomKeyStore -// operation. To find the ConnectionState , use the DescribeCustomKeyStores operation. -// -// To create a KMS key in a custom key store, use the CustomKeyStoreId . Use the -// default KeySpec value, SYMMETRIC_DEFAULT , and the default KeyUsage value, -// ENCRYPT_DECRYPT to create a symmetric encryption key. No other key type is -// supported in a custom key store. -// -// To create a KMS key in an [CloudHSM key store], use the Origin parameter with a value of -// AWS_CLOUDHSM . The CloudHSM cluster that is associated with the custom key store -// must have at least two active HSMs in different Availability Zones in the Amazon -// Web Services Region. -// -// To create a KMS key in an [external key store], use the Origin parameter with a value of -// EXTERNAL_KEY_STORE and an XksKeyId parameter that identifies an existing -// external key. -// -// Some external key managers provide a simpler method for creating a KMS key in -// an external key store. For details, see your external key manager documentation. -// -// Cross-account use: No. You cannot use this operation to create a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:CreateKey] (IAM policy). To use the Tags parameter, [kms:TagResource] (IAM policy). -// For examples and information about related permissions, see [Allow a user to create KMS keys]in the Key -// Management Service Developer Guide. -// -// Related operations: -// -// # DescribeKey -// -// # ListKeys -// -// # ScheduleKeyDeletion +// Creates a unique customer managed KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys) +// in your Amazon Web Services account and Region. You can use a KMS key in +// cryptographic operations, such as encryption and signing. Some Amazon Web +// Services services let you use KMS keys that you create and manage to protect +// your service resources. A KMS key is a logical representation of a cryptographic +// key. In addition to the key material used in cryptographic operations, a KMS key +// includes metadata, such as the key ID, key policy, creation date, description, +// and key state. For details, see Managing keys (https://docs.aws.amazon.com/kms/latest/developerguide/getting-started.html) +// in the Key Management Service Developer Guide Use the parameters of CreateKey +// to specify the type of KMS key, the source of its key material, its key policy, +// description, tags, and other properties. KMS has replaced the term customer +// master key (CMK) with KMS key and KMS key. The concept has not changed. To +// prevent breaking changes, KMS is keeping some variations of this term. To create +// different types of KMS keys, use the following guidance: Symmetric encryption +// KMS key By default, CreateKey creates a symmetric encryption KMS key with key +// material that KMS generates. This is the basic and most widely used type of KMS +// key, and provides the best performance. To create a symmetric encryption KMS +// key, you don't need to specify any parameters. The default value for KeySpec , +// SYMMETRIC_DEFAULT , the default value for KeyUsage , ENCRYPT_DECRYPT , and the +// default value for Origin , AWS_KMS , create a symmetric encryption KMS key with +// KMS key material. If you need a key for basic encryption and decryption or you +// are creating a KMS key to protect your resources in an Amazon Web Services +// service, create a symmetric encryption KMS key. The key material in a symmetric +// encryption key never leaves KMS unencrypted. You can use a symmetric encryption +// KMS key to encrypt and decrypt data up to 4,096 bytes, but they are typically +// used to generate data keys and data keys pairs. For details, see GenerateDataKey +// and GenerateDataKeyPair . Asymmetric KMS keys To create an asymmetric KMS key, +// use the KeySpec parameter to specify the type of key material in the KMS key. +// Then, use the KeyUsage parameter to determine whether the KMS key will be used +// to encrypt and decrypt or sign and verify. You can't change these properties +// after the KMS key is created. Asymmetric KMS keys contain an RSA key pair, +// Elliptic Curve (ECC) key pair, or an SM2 key pair (China Regions only). The +// private key in an asymmetric KMS key never leaves KMS unencrypted. However, you +// can use the GetPublicKey operation to download the public key so it can be used +// outside of KMS. KMS keys with RSA or SM2 key pairs can be used to encrypt or +// decrypt data or sign and verify messages (but not both). KMS keys with ECC key +// pairs can be used only to sign and verify messages. For information about +// asymmetric KMS keys, see Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the Key Management Service Developer Guide. HMAC KMS key To create an HMAC +// KMS key, set the KeySpec parameter to a key spec value for HMAC KMS keys. Then +// set the KeyUsage parameter to GENERATE_VERIFY_MAC . You must set the key usage +// even though GENERATE_VERIFY_MAC is the only valid key usage value for HMAC KMS +// keys. You can't change these properties after the KMS key is created. HMAC KMS +// keys are symmetric keys that never leave KMS unencrypted. You can use HMAC keys +// to generate ( GenerateMac ) and verify ( VerifyMac ) HMAC codes for messages up +// to 4096 bytes. Multi-Region primary keys Imported key material To create a +// multi-Region primary key in the local Amazon Web Services Region, use the +// MultiRegion parameter with a value of True . To create a multi-Region replica +// key, that is, a KMS key with the same key ID and key material as a primary key, +// but in a different Amazon Web Services Region, use the ReplicateKey operation. +// To change a replica key to a primary key, and its primary key to a replica key, +// use the UpdatePrimaryRegion operation. You can create multi-Region KMS keys for +// all supported KMS key types: symmetric encryption KMS keys, HMAC KMS keys, +// asymmetric encryption KMS keys, and asymmetric signing KMS keys. You can also +// create multi-Region keys with imported key material. However, you can't create +// multi-Region keys in a custom key store. This operation supports multi-Region +// keys, an KMS feature that lets you create multiple interoperable KMS keys in +// different Amazon Web Services Regions. Because these KMS keys have the same key +// ID, key material, and other metadata, you can use them interchangeably to +// encrypt data in one Amazon Web Services Region and decrypt it in a different +// Amazon Web Services Region without re-encrypting the data or making a +// cross-Region call. For more information about multi-Region keys, see +// Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) +// in the Key Management Service Developer Guide. To import your own key material +// into a KMS key, begin by creating a KMS key with no key material. To do this, +// use the Origin parameter of CreateKey with a value of EXTERNAL . Next, use +// GetParametersForImport operation to get a public key and import token. Use the +// wrapping public key to encrypt your key material. Then, use ImportKeyMaterial +// with your import token to import the key material. For step-by-step +// instructions, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the Key Management Service Developer Guide . You can import key material into +// KMS keys of all supported KMS key types: symmetric encryption KMS keys, HMAC KMS +// keys, asymmetric encryption KMS keys, and asymmetric signing KMS keys. You can +// also create multi-Region keys with imported key material. However, you can't +// import key material into a KMS key in a custom key store. To create a +// multi-Region primary key with imported key material, use the Origin parameter +// of CreateKey with a value of EXTERNAL and the MultiRegion parameter with a +// value of True . To create replicas of the multi-Region primary key, use the +// ReplicateKey operation. For instructions, see Importing key material into +// multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html) +// . For more information about multi-Region keys, see Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) +// in the Key Management Service Developer Guide. Custom key store A custom key +// store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// lets you protect your Amazon Web Services resources using keys in a backing key +// store that you own and manage. When you request a cryptographic operation with a +// KMS key in a custom key store, the operation is performed in the backing key +// store using its cryptographic keys. KMS supports CloudHSM key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html) +// backed by an CloudHSM cluster and external key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html) +// backed by an external key manager outside of Amazon Web Services. When you +// create a KMS key in an CloudHSM key store, KMS generates an encryption key in +// the CloudHSM cluster and associates it with the KMS key. When you create a KMS +// key in an external key store, you specify an existing encryption key in the +// external key manager. Some external key managers provide a simpler method for +// creating a KMS key in an external key store. For details, see your external key +// manager documentation. Before you create a KMS key in a custom key store, the +// ConnectionState of the key store must be CONNECTED . To connect the custom key +// store, use the ConnectCustomKeyStore operation. To find the ConnectionState , +// use the DescribeCustomKeyStores operation. To create a KMS key in a custom key +// store, use the CustomKeyStoreId . Use the default KeySpec value, +// SYMMETRIC_DEFAULT , and the default KeyUsage value, ENCRYPT_DECRYPT to create a +// symmetric encryption key. No other key type is supported in a custom key store. +// To create a KMS key in an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html) +// , use the Origin parameter with a value of AWS_CLOUDHSM . The CloudHSM cluster +// that is associated with the custom key store must have at least two active HSMs +// in different Availability Zones in the Amazon Web Services Region. To create a +// KMS key in an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html) +// , use the Origin parameter with a value of EXTERNAL_KEY_STORE and an XksKeyId +// parameter that identifies an existing external key. Some external key managers +// provide a simpler method for creating a KMS key in an external key store. For +// details, see your external key manager documentation. Cross-account use: No. You +// cannot use this operation to create a KMS key in a different Amazon Web Services +// account. Required permissions: kms:CreateKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). To use the Tags parameter, kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). For examples and information about related permissions, see Allow +// a user to create KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key) +// in the Key Management Service Developer Guide. Related operations: +// - DescribeKey +// - ListKeys +// - ScheduleKeyDeletion // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [CloudHSM key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html -// [external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html -// [external key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html -// [Asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [Multi-Region keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html -// [Managing keys]: https://docs.aws.amazon.com/kms/latest/developerguide/getting-started.html -// [KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys -// [Allow a user to create KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [kms:TagResource]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [CloudHSM key store]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html -// [kms:CreateKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Importing key material into multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html -// [Importing Key Material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) CreateKey(ctx context.Context, params *CreateKeyInput, optFns ...func(*Options)) (*CreateKeyOutput, error) { if params == nil { params = &CreateKeyInput{} @@ -196,41 +152,31 @@ func (c *Client) CreateKey(ctx context.Context, params *CreateKeyInput, optFns . type CreateKeyInput struct { // Skips ("bypasses") the key policy lockout safety check. The default value is - // false. - // - // Setting this value to true increases the risk that the KMS key becomes - // unmanageable. Do not set this value to true indiscriminately. - // - // For more information, see [Default key policy] in the Key Management Service Developer Guide. - // - // Use this parameter only when you intend to prevent the principal that is making - // the request from making a subsequent [PutKeyPolicy]request on the KMS key. - // - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key - // [PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html + // false. Setting this value to true increases the risk that the KMS key becomes + // unmanageable. Do not set this value to true indiscriminately. For more + // information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. Use this parameter only when you + // intend to prevent the principal that is making the request from making a + // subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) + // request on the KMS key. BypassPolicyLockoutSafetyCheck bool - // Creates the KMS key in the specified [custom key store]. The ConnectionState of the custom key - // store must be CONNECTED . To find the CustomKeyStoreID and ConnectionState use - // the DescribeCustomKeyStoresoperation. - // + // Creates the KMS key in the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) + // . The ConnectionState of the custom key store must be CONNECTED . To find the + // CustomKeyStoreID and ConnectionState use the DescribeCustomKeyStores operation. // This parameter is valid only for symmetric encryption KMS keys in a single - // Region. You cannot create any other type of KMS key in a custom key store. - // - // When you create a KMS key in an CloudHSM key store, KMS generates a - // non-exportable 256-bit symmetric key in its associated CloudHSM cluster and - // associates it with the KMS key. When you create a KMS key in an external key - // store, you must use the XksKeyId parameter to specify an external key that - // serves as key material for the KMS key. - // - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html + // Region. You cannot create any other type of KMS key in a custom key store. When + // you create a KMS key in an CloudHSM key store, KMS generates a non-exportable + // 256-bit symmetric key in its associated CloudHSM cluster and associates it with + // the KMS key. When you create a KMS key in an external key store, you must use + // the XksKeyId parameter to specify an external key that serves as key material + // for the KMS key. CustomKeyStoreId *string - // Instead, use the KeySpec parameter. - // - // The KeySpec and CustomerMasterKeySpec parameters work the same way. Only the - // names differ. We recommend that you use KeySpec parameter in your code. - // However, to avoid breaking changes, KMS supports both parameters. + // Instead, use the KeySpec parameter. The KeySpec and CustomerMasterKeySpec + // parameters work the same way. Only the names differ. We recommend that you use + // KeySpec parameter in your code. However, to avoid breaking changes, KMS supports + // both parameters. // // Deprecated: This parameter has been deprecated. Instead, use the KeySpec // parameter. @@ -238,232 +184,162 @@ type CreateKeyInput struct { // A description of the KMS key. Use a description that helps you decide whether // the KMS key is appropriate for a task. The default value is an empty string (no - // description). - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // To set or change the description after the key is created, use UpdateKeyDescription. + // description). Do not include confidential or sensitive information in this + // field. This field may be displayed in plaintext in CloudTrail logs and other + // output. To set or change the description after the key is created, use + // UpdateKeyDescription . Description *string // Specifies the type of KMS key to create. The default value, SYMMETRIC_DEFAULT , // creates a KMS key with a 256-bit AES-GCM key that is used for encryption and // decryption, except in China Regions, where it creates a 128-bit symmetric key - // that uses SM4 encryption. For help choosing a key spec for your KMS key, see [Choosing a KMS key type]in - // the Key Management Service Developer Guide . - // - // The KeySpec determines whether the KMS key contains a symmetric key or an - // asymmetric key pair. It also determines the algorithms that the KMS key - // supports. You can't change the KeySpec after the KMS key is created. To further - // restrict the algorithms that can be used with the KMS key, use a condition key - // in its key policy or IAM policy. For more information, see [kms:EncryptionAlgorithm], [kms:MacAlgorithm] or [kms:Signing Algorithm] in the Key - // Management Service Developer Guide . - // - // [Amazon Web Services services that are integrated with KMS]use symmetric encryption KMS keys to protect your data. These services do not - // support asymmetric KMS keys or HMAC KMS keys. - // - // KMS supports the following key specs for KMS keys: - // + // that uses SM4 encryption. For help choosing a key spec for your KMS key, see + // Choosing a KMS key type (https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose) + // in the Key Management Service Developer Guide . The KeySpec determines whether + // the KMS key contains a symmetric key or an asymmetric key pair. It also + // determines the algorithms that the KMS key supports. You can't change the + // KeySpec after the KMS key is created. To further restrict the algorithms that + // can be used with the KMS key, use a condition key in its key policy or IAM + // policy. For more information, see kms:EncryptionAlgorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm) + // , kms:MacAlgorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm) + // or kms:Signing Algorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm) + // in the Key Management Service Developer Guide . Amazon Web Services services + // that are integrated with KMS (http://aws.amazon.com/kms/features/#AWS_Service_Integration) + // use symmetric encryption KMS keys to protect your data. These services do not + // support asymmetric KMS keys or HMAC KMS keys. KMS supports the following key + // specs for KMS keys: // - Symmetric encryption key (default) - // // - SYMMETRIC_DEFAULT - // // - HMAC keys (symmetric) - // // - HMAC_224 - // // - HMAC_256 - // // - HMAC_384 - // // - HMAC_512 - // // - Asymmetric RSA key pairs - // // - RSA_2048 - // // - RSA_3072 - // // - RSA_4096 - // // - Asymmetric NIST-recommended elliptic curve key pairs - // // - ECC_NIST_P256 (secp256r1) - // // - ECC_NIST_P384 (secp384r1) - // // - ECC_NIST_P521 (secp521r1) - // // - Other asymmetric elliptic curve key pairs - // // - ECC_SECG_P256K1 (secp256k1), commonly used for cryptocurrencies. - // // - SM2 key pairs (China Regions only) - // // - SM2 - // - // [kms:EncryptionAlgorithm]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm - // [kms:Signing Algorithm]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm - // [kms:MacAlgorithm]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm - // [Choosing a KMS key type]: https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose - // [Amazon Web Services services that are integrated with KMS]: http://aws.amazon.com/kms/features/#AWS_Service_Integration KeySpec types.KeySpec - // Determines the [cryptographic operations] for which you can use the KMS key. The default value is - // ENCRYPT_DECRYPT . This parameter is optional when you are creating a symmetric - // encryption KMS key; otherwise, it is required. You can't change the KeyUsage - // value after the KMS key is created. - // - // Select only one valid value. - // + // Determines the cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) + // for which you can use the KMS key. The default value is ENCRYPT_DECRYPT . This + // parameter is optional when you are creating a symmetric encryption KMS key; + // otherwise, it is required. You can't change the KeyUsage value after the KMS + // key is created. Select only one valid value. // - For symmetric encryption KMS keys, omit the parameter or specify // ENCRYPT_DECRYPT . - // // - For HMAC KMS keys (symmetric), specify GENERATE_VERIFY_MAC . - // // - For asymmetric KMS keys with RSA key material, specify ENCRYPT_DECRYPT or // SIGN_VERIFY . - // // - For asymmetric KMS keys with ECC key material, specify SIGN_VERIFY . - // // - For asymmetric KMS keys with SM2 key material (China Regions only), specify // ENCRYPT_DECRYPT or SIGN_VERIFY . - // - // [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations KeyUsage types.KeyUsageType // Creates a multi-Region primary key that you can replicate into other Amazon Web - // Services Regions. You cannot change this value after you create the KMS key. - // - // For a multi-Region key, set this parameter to True . For a single-Region KMS - // key, omit this parameter or set it to False . The default value is False . - // - // This operation supports multi-Region keys, an KMS feature that lets you create + // Services Regions. You cannot change this value after you create the KMS key. For + // a multi-Region key, set this parameter to True . For a single-Region KMS key, + // omit this parameter or set it to False . The default value is False . This + // operation supports multi-Region keys, an KMS feature that lets you create // multiple interoperable KMS keys in different Amazon Web Services Regions. // Because these KMS keys have the same key ID, key material, and other metadata, // you can use them interchangeably to encrypt data in one Amazon Web Services // Region and decrypt it in a different Amazon Web Services Region without // re-encrypting the data or making a cross-Region call. For more information about - // multi-Region keys, see [Multi-Region keys in KMS]in the Key Management Service Developer Guide. - // - // This value creates a primary key, not a replica. To create a replica key, use - // the ReplicateKeyoperation. - // - // You can create a symmetric or asymmetric multi-Region key, and you can create a + // multi-Region keys, see Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + // in the Key Management Service Developer Guide. This value creates a primary key, + // not a replica. To create a replica key, use the ReplicateKey operation. You can + // create a symmetric or asymmetric multi-Region key, and you can create a // multi-Region key with imported key material. However, you cannot create a // multi-Region key in a custom key store. - // - // [Multi-Region keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html MultiRegion *bool // The source of the key material for the KMS key. You cannot change the origin // after you create the KMS key. The default is AWS_KMS , which means that KMS - // creates the key material. - // - // To [create a KMS key with no key material] (for imported key material), set this value to EXTERNAL . For more - // information about importing key material into KMS, see [Importing Key Material]in the Key Management - // Service Developer Guide. The EXTERNAL origin value is valid only for symmetric - // KMS keys. - // - // To [create a KMS key in an CloudHSM key store] and create its key material in the associated CloudHSM cluster, set this - // value to AWS_CLOUDHSM . You must also use the CustomKeyStoreId parameter to - // identify the CloudHSM key store. The KeySpec value must be SYMMETRIC_DEFAULT . - // - // To [create a KMS key in an external key store], set this value to EXTERNAL_KEY_STORE . You must also use the - // CustomKeyStoreId parameter to identify the external key store and the XksKeyId - // parameter to identify the associated external key. The KeySpec value must be + // creates the key material. To create a KMS key with no key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html) + // (for imported key material), set this value to EXTERNAL . For more information + // about importing key material into KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) + // in the Key Management Service Developer Guide. The EXTERNAL origin value is + // valid only for symmetric KMS keys. To create a KMS key in an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) + // and create its key material in the associated CloudHSM cluster, set this value + // to AWS_CLOUDHSM . You must also use the CustomKeyStoreId parameter to identify + // the CloudHSM key store. The KeySpec value must be SYMMETRIC_DEFAULT . To create + // a KMS key in an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keys.html) + // , set this value to EXTERNAL_KEY_STORE . You must also use the CustomKeyStoreId + // parameter to identify the external key store and the XksKeyId parameter to + // identify the associated external key. The KeySpec value must be // SYMMETRIC_DEFAULT . - // - // [create a KMS key in an external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keys.html - // [create a KMS key in an CloudHSM key store]: https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html - // [Importing Key Material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html - // [create a KMS key with no key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html Origin types.OriginType - // The key policy to attach to the KMS key. - // - // If you provide a key policy, it must meet the following criteria: - // + // The key policy to attach to the KMS key. If you provide a key policy, it must + // meet the following criteria: // - The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS key - // becomes unmanageable. For more information, see [Default key policy]in the Key Management Service - // Developer Guide. (To omit this condition, set BypassPolicyLockoutSafetyCheck - // to true.) - // + // becomes unmanageable. For more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. (To omit this condition, set + // BypassPolicyLockoutSafetyCheck to true.) // - Each statement in the key policy must contain one or more principals. The // principals in the key policy must exist and be visible to KMS. When you create a // new Amazon Web Services principal, you might need to enforce a delay before // including the new principal in a key policy because the new principal might not - // be immediately visible to KMS. For more information, see [Changes that I make are not always immediately visible]in the Amazon Web - // Services Identity and Access Management User Guide. - // + // be immediately visible to KMS. For more information, see Changes that I make + // are not always immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) + // in the Amazon Web Services Identity and Access Management User Guide. // If you do not provide a key policy, KMS attaches a default key policy to the - // KMS key. For more information, see [Default key policy]in the Key Management Service Developer - // Guide. - // - // The key policy size quota is 32 kilobytes (32768 bytes). - // - // For help writing and formatting a JSON policy document, see the [IAM JSON Policy Reference] in the - // Identity and Access Management User Guide . - // - // [IAM JSON Policy Reference]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default - // [Changes that I make are not always immediately visible]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency + // KMS key. For more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) + // in the Key Management Service Developer Guide. The key policy size quota is 32 + // kilobytes (32768 bytes). For help writing and formatting a JSON policy document, + // see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) + // in the Identity and Access Management User Guide . Policy *string // Assigns one or more tags to the KMS key. Use this parameter to tag the KMS key - // when it is created. To tag an existing KMS key, use the TagResourceoperation. - // + // when it is created. To tag an existing KMS key, use the TagResource operation. // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // Tagging or untagging a KMS key can allow or deny permission to the KMS key. For - // details, see [ABAC for KMS]in the Key Management Service Developer Guide. - // - // To use this parameter, you must have [kms:TagResource] permission in an IAM policy. - // - // Each tag consists of a tag key and a tag value. Both the tag key and the tag - // value are required, but the tag value can be an empty (null) string. You cannot - // have more than one tag on a KMS key with the same tag key. If you specify an - // existing tag key with a different tag value, KMS replaces the current tag value - // with the specified one. - // - // When you add tags to an Amazon Web Services resource, Amazon Web Services - // generates a cost allocation report with usage and costs aggregated by tags. Tags - // can also be used to control access to a KMS key. For details, see [Tagging Keys]. - // - // [kms:TagResource]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html - // [Tagging Keys]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html - // [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html + // may be displayed in plaintext in CloudTrail logs and other output. Tagging or + // untagging a KMS key can allow or deny permission to the KMS key. For details, + // see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) + // in the Key Management Service Developer Guide. To use this parameter, you must + // have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) + // permission in an IAM policy. Each tag consists of a tag key and a tag value. + // Both the tag key and the tag value are required, but the tag value can be an + // empty (null) string. You cannot have more than one tag on a KMS key with the + // same tag key. If you specify an existing tag key with a different tag value, KMS + // replaces the current tag value with the specified one. When you add tags to an + // Amazon Web Services resource, Amazon Web Services generates a cost allocation + // report with usage and costs aggregated by tags. Tags can also be used to control + // access to a KMS key. For details, see Tagging Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) + // . Tags []types.Tag - // Identifies the [external key] that serves as key material for the KMS key in an [external key store]. Specify the - // ID that the [external key store proxy]uses to refer to the external key. For help, see the documentation - // for your external key store proxy. - // - // This parameter is required for a KMS key with an Origin value of - // EXTERNAL_KEY_STORE . It is not valid for KMS keys with any other Origin value. - // - // The external key must be an existing 256-bit AES symmetric encryption key - // hosted outside of Amazon Web Services in an external key manager associated with - // the external key store specified by the CustomKeyStoreId parameter. This key - // must be enabled and configured to perform encryption and decryption. Each KMS - // key in an external key store must use a different external key. For details, see - // [Requirements for a KMS key in an external key store]in the Key Management Service Developer Guide. - // - // Each KMS key in an external key store is associated two backing keys. One is - // key material that KMS generates. The other is the external key specified by this - // parameter. When you use the KMS key in an external key store to encrypt data, - // the encryption operation is performed first by KMS using the KMS key material, - // and then by the external key manager using the specified external key, a process - // known as double encryption. For details, see [Double encryption]in the Key Management Service - // Developer Guide. - // - // [external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html - // [Double encryption]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-double-encryption - // [external key]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key - // [Requirements for a KMS key in an external key store]: https://docs.aws.amazon.com/create-xks-keys.html#xks-key-requirements - // [external key store proxy]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-xks-proxy + // Identifies the external key (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key) + // that serves as key material for the KMS key in an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html) + // . Specify the ID that the external key store proxy (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-xks-proxy) + // uses to refer to the external key. For help, see the documentation for your + // external key store proxy. This parameter is required for a KMS key with an + // Origin value of EXTERNAL_KEY_STORE . It is not valid for KMS keys with any other + // Origin value. The external key must be an existing 256-bit AES symmetric + // encryption key hosted outside of Amazon Web Services in an external key manager + // associated with the external key store specified by the CustomKeyStoreId + // parameter. This key must be enabled and configured to perform encryption and + // decryption. Each KMS key in an external key store must use a different external + // key. For details, see Requirements for a KMS key in an external key store (https://docs.aws.amazon.com/create-xks-keys.html#xks-key-requirements) + // in the Key Management Service Developer Guide. Each KMS key in an external key + // store is associated two backing keys. One is key material that KMS generates. + // The other is the external key specified by this parameter. When you use the KMS + // key in an external key store to encrypt data, the encryption operation is + // performed first by KMS using the KMS key material, and then by the external key + // manager using the specified external key, a process known as double encryption. + // For details, see Double encryption (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-double-encryption) + // in the Key Management Service Developer Guide. XksKeyId *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go index 0eec0c26e40..202bce68cf8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go @@ -13,29 +13,24 @@ import ( // Decrypts ciphertext that was encrypted by a KMS key using any of the following // operations: -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair -// -// # GenerateDataKeyWithoutPlaintext -// -// # GenerateDataKeyPairWithoutPlaintext +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPair +// - GenerateDataKeyWithoutPlaintext +// - GenerateDataKeyPairWithoutPlaintext // // You can use this operation to decrypt ciphertext that was encrypted under a // symmetric encryption KMS key or an asymmetric encryption KMS key. When the KMS // key is asymmetric, you must specify the KMS key and the encryption algorithm // that was used to encrypt the ciphertext. For information about asymmetric KMS -// keys, see [Asymmetric KMS keys]in the Key Management Service Developer Guide. -// -// The Decrypt operation also decrypts ciphertext that was encrypted outside of -// KMS by the public key in an KMS asymmetric KMS key. However, it cannot decrypt -// symmetric ciphertext produced by other libraries, such as the [Amazon Web Services Encryption SDK]or [Amazon S3 client-side encryption]. These -// libraries return a ciphertext format that is incompatible with KMS. -// -// If the ciphertext was encrypted under a symmetric encryption KMS key, the KeyId +// keys, see Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the Key Management Service Developer Guide. The Decrypt operation also +// decrypts ciphertext that was encrypted outside of KMS by the public key in an +// KMS asymmetric KMS key. However, it cannot decrypt symmetric ciphertext produced +// by other libraries, such as the Amazon Web Services Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) +// or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html) +// . These libraries return a ciphertext format that is incompatible with KMS. If +// the ciphertext was encrypted under a symmetric encryption KMS key, the KeyId // parameter is optional. KMS can get this information from metadata that it adds // to the symmetric ciphertext blob. This feature adds durability to your // implementation by ensuring that authorized users can decrypt ciphertext decades @@ -44,57 +39,40 @@ import ( // the KeyId parameter to specify a KMS key, KMS only uses the KMS key you // specify. If the ciphertext was encrypted under a different KMS key, the Decrypt // operation fails. This practice ensures that you use the KMS key that you intend. -// // Whenever possible, use key policies to give users permission to call the Decrypt // operation on a particular KMS key, instead of using &IAM; policies. Otherwise, // you might create an &IAM; policy that gives the user Decrypt permission on all // KMS keys. This user could decrypt ciphertext that was encrypted by KMS keys in // other accounts if the key policy for the cross-account KMS key permits it. If // you must use an IAM policy for Decrypt permissions, limit the user to -// particular KMS keys or particular trusted accounts. For details, see [Best practices for IAM policies]in the Key -// Management Service Developer Guide. -// -// Decrypt also supports [Amazon Web Services Nitro Enclaves], which provide an isolated compute environment in Amazon -// EC2. To call Decrypt for a Nitro enclave, use the [Amazon Web Services Nitro Enclaves SDK] or any Amazon Web Services -// SDK. Use the Recipient parameter to provide the attestation document for the -// enclave. Instead of the plaintext data, the response includes the plaintext data -// encrypted with the public key from the attestation document ( -// CiphertextForRecipient ). For information about the interaction between KMS and -// Amazon Web Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer -// Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. If you use the KeyId parameter to identify a KMS key in -// a different Amazon Web Services account, specify the key ARN or the alias ARN of -// the KMS key. -// -// Required permissions: [kms:Decrypt] (key policy) -// -// Related operations: -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair -// -// # ReEncrypt +// particular KMS keys or particular trusted accounts. For details, see Best +// practices for IAM policies (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices) +// in the Key Management Service Developer Guide. Decrypt also supports Amazon Web +// Services Nitro Enclaves (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html) +// , which provide an isolated compute environment in Amazon EC2. To call Decrypt +// for a Nitro enclave, use the Amazon Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) +// or any Amazon Web Services SDK. Use the Recipient parameter to provide the +// attestation document for the enclave. Instead of the plaintext data, the +// response includes the plaintext data encrypted with the public key from the +// attestation document ( CiphertextForRecipient ). For information about the +// interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon +// Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: Yes. If you use +// the KeyId parameter to identify a KMS key in a different Amazon Web Services +// account, specify the key ARN or the alias ARN of the KMS key. Required +// permissions: kms:Decrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPair +// - ReEncrypt // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Amazon Web Services Encryption SDK]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/ -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:Decrypt]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [Amazon Web Services Nitro Enclaves]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html -// [Amazon S3 client-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html -// [Best practices for IAM policies]: https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices -// [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) Decrypt(ctx context.Context, params *DecryptInput, optFns ...func(*Options)) (*DecryptOutput, error) { if params == nil { params = &DecryptInput{} @@ -117,103 +95,74 @@ type DecryptInput struct { // This member is required. CiphertextBlob []byte - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool // Specifies the encryption algorithm that will be used to decrypt the ciphertext. // Specify the same algorithm that was used to encrypt the data. If you specify a - // different algorithm, the Decrypt operation fails. - // - // This parameter is required only when the ciphertext was encrypted under an - // asymmetric KMS key. The default value, SYMMETRIC_DEFAULT , represents the only - // supported algorithm that is valid for symmetric encryption KMS keys. + // different algorithm, the Decrypt operation fails. This parameter is required + // only when the ciphertext was encrypted under an asymmetric KMS key. The default + // value, SYMMETRIC_DEFAULT , represents the only supported algorithm that is valid + // for symmetric encryption KMS keys. EncryptionAlgorithm types.EncryptionAlgorithmSpec // Specifies the encryption context to use when decrypting the data. An encryption - // context is valid only for [cryptographic operations]with a symmetric encryption KMS key. The standard - // asymmetric encryption algorithms and HMAC algorithms that KMS uses do not - // support an encryption context. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) + // context is valid only for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) + // with a symmetric encryption KMS key. The standard asymmetric encryption + // algorithms and HMAC algorithms that KMS uses do not support an encryption + // context. An encryption context is a collection of non-secret key-value pairs + // that represent additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported only // on operations with symmetric encryption KMS keys. On operations with symmetric // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string - // Specifies the KMS key that KMS uses to decrypt the ciphertext. - // - // Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you - // identify a different KMS key, the Decrypt operation throws an - // IncorrectKeyException . - // - // This parameter is required only when the ciphertext was encrypted under an - // asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the - // KMS key from metadata that it adds to the symmetric ciphertext blob. However, it - // is always recommended as a best practice. This practice ensures that you use the - // KMS key that you intend. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a key ID + // of the KMS key that was used to encrypt the ciphertext. If you identify a + // different KMS key, the Decrypt operation throws an IncorrectKeyException . This + // parameter is required only when the ciphertext was encrypted under an asymmetric + // KMS key. If you used a symmetric encryption KMS key, KMS can get the KMS key + // from metadata that it adds to the symmetric ciphertext blob. However, it is + // always recommended as a best practice. This practice ensures that you use the + // KMS key that you intend. To specify a KMS key, use its key ID, key ARN, alias + // name, or alias ARN. When using an alias name, prefix it with "alias/" . To + // specify a KMS key in a different Amazon Web Services account, you must use the + // key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . KeyId *string - // A signed [attestation document] from an Amazon Web Services Nitro enclave and the encryption - // algorithm to use with the enclave's public key. The only valid encryption - // algorithm is RSAES_OAEP_SHA_256 . - // - // This parameter only supports attestation documents for Amazon Web Services - // Nitro Enclaves. To include this parameter, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services - // SDK. - // - // When you use this parameter, instead of returning the plaintext data, KMS - // encrypts the plaintext data with the public key in the attestation document, and - // returns the resulting ciphertext in the CiphertextForRecipient field in the - // response. This ciphertext can be decrypted only with the private key in the - // enclave. The Plaintext field in the response is null or empty. - // - // For information about the interaction between KMS and Amazon Web Services Nitro - // Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [attestation document]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.html#term-attestdoc - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html - // [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk + // A signed attestation document (https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.html#term-attestdoc) + // from an Amazon Web Services Nitro enclave and the encryption algorithm to use + // with the enclave's public key. The only valid encryption algorithm is + // RSAES_OAEP_SHA_256 . This parameter only supports attestation documents for + // Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon + // Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) + // or any Amazon Web Services SDK. When you use this parameter, instead of + // returning the plaintext data, KMS encrypts the plaintext data with the public + // key in the attestation document, and returns the resulting ciphertext in the + // CiphertextForRecipient field in the response. This ciphertext can be decrypted + // only with the private key in the enclave. The Plaintext field in the response + // is null or empty. For information about the interaction between KMS and Amazon + // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. Recipient *types.RecipientInfo noSmithyDocumentSerde @@ -222,29 +171,24 @@ type DecryptInput struct { type DecryptOutput struct { // The plaintext data encrypted with the public key in the attestation document. - // // This field is included in the response only when the Recipient parameter in the // request includes a valid attestation document from an Amazon Web Services Nitro // enclave. For information about the interaction between KMS and Amazon Web - // Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html + // Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. CiphertextForRecipient []byte // The encryption algorithm that was used to decrypt the ciphertext. EncryptionAlgorithm types.EncryptionAlgorithmSpec - // The Amazon Resource Name ([key ARN] ) of the KMS key that was used to decrypt the - // ciphertext. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that was used to decrypt the ciphertext. KeyId *string // Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services - // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. - // - // If the response includes the CiphertextForRecipient field, the Plaintext field - // is null or empty. + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. If the + // response includes the CiphertextForRecipient field, the Plaintext field is null + // or empty. Plaintext []byte // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go index 06b4062b05a..5f611dd9dcb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go @@ -10,48 +10,31 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the specified alias. +// Deletes the specified alias. Adding, deleting, or updating an alias can allow +// or deny permission to the KMS key. For details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) +// in the Key Management Service Developer Guide. Because an alias is not a +// property of a KMS key, you can delete and change the aliases of a KMS key +// without affecting the KMS key. Also, aliases do not appear in the response from +// the DescribeKey operation. To get the aliases of all KMS keys, use the +// ListAliases operation. Each KMS key can have multiple aliases. To change the +// alias of a KMS key, use DeleteAlias to delete the current alias and CreateAlias +// to create a new alias. To associate an existing alias with a different KMS key, +// call UpdateAlias . Cross-account use: No. You cannot perform this operation on +// an alias in a different Amazon Web Services account. Required permissions +// - kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// - kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the KMS key (key policy). // -// Adding, deleting, or updating an alias can allow or deny permission to the KMS -// key. For details, see [ABAC for KMS]in the Key Management Service Developer Guide. -// -// Because an alias is not a property of a KMS key, you can delete and change the -// aliases of a KMS key without affecting the KMS key. Also, aliases do not appear -// in the response from the DescribeKeyoperation. To get the aliases of all KMS keys, use the ListAliases -// operation. -// -// Each KMS key can have multiple aliases. To change the alias of a KMS key, use DeleteAlias -// to delete the current alias and CreateAliasto create a new alias. To associate an existing -// alias with a different KMS key, call UpdateAlias. -// -// Cross-account use: No. You cannot perform this operation on an alias in a -// different Amazon Web Services account. -// -// # Required permissions -// -// [kms:DeleteAlias] -// - on the alias (IAM policy). -// -// [kms:DeleteAlias] -// - on the KMS key (key policy). -// -// For details, see [Controlling access to aliases] in the Key Management Service Developer Guide. -// -// Related operations: -// -// # CreateAlias -// -// # ListAliases -// -// # UpdateAlias +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the Key Management Service Developer Guide. Related operations: +// - CreateAlias +// - ListAliases +// - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html -// [kms:DeleteAlias]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Controlling access to aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DeleteAlias(ctx context.Context, params *DeleteAliasInput, optFns ...func(*Options)) (*DeleteAliasOutput, error) { if params == nil { params = &DeleteAliasInput{} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go index 14ee592460f..a6711c6f1c8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go @@ -10,65 +10,45 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a [custom key store]. This operation does not affect any backing elements of the custom -// key store. It does not delete the CloudHSM cluster that is associated with an -// CloudHSM key store, or affect any users or keys in the cluster. For an external -// key store, it does not affect the external key store proxy, external key -// manager, or any external keys. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// The custom key store that you delete cannot contain any [KMS keys]. Before deleting the -// key store, verify that you will never need to use any of the KMS keys in the key -// store for any [cryptographic operations]. Then, use ScheduleKeyDeletion to delete the KMS keys from the key store. After the -// required waiting period expires and all KMS keys are deleted from the custom key -// store, use DisconnectCustomKeyStoreto disconnect the key store from KMS. Then, you can delete the -// custom key store. -// -// For keys in an CloudHSM key store, the ScheduleKeyDeletion operation makes a -// best effort to delete the key material from the associated cluster. However, you -// might need to manually [delete the orphaned key material]from the cluster and its backups. KMS never creates, -// manages, or deletes cryptographic keys in the external key manager associated -// with an external key store. You must manage them using your external key manager -// tools. -// -// Instead of deleting the custom key store, consider using the DisconnectCustomKeyStore operation to -// disconnect the custom key store from its backing key store. While the key store -// is disconnected, you cannot create or use the KMS keys in the key store. But, -// you do not need to delete KMS keys and you can reconnect a disconnected custom -// key store at any time. -// -// If the operation succeeds, it returns a JSON object with no properties. -// -// Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:DeleteCustomKeyStore] (IAM policy) -// -// Related operations: -// -// # ConnectCustomKeyStore -// -// # CreateCustomKeyStore -// -// # DescribeCustomKeyStores -// -// # DisconnectCustomKeyStore -// -// # UpdateCustomKeyStore +// Deletes a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// . This operation does not affect any backing elements of the custom key store. +// It does not delete the CloudHSM cluster that is associated with an CloudHSM key +// store, or affect any users or keys in the cluster. For an external key store, it +// does not affect the external key store proxy, external key manager, or any +// external keys. This operation is part of the custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. The +// custom key store that you delete cannot contain any KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys) +// . Before deleting the key store, verify that you will never need to use any of +// the KMS keys in the key store for any cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// . Then, use ScheduleKeyDeletion to delete the KMS keys from the key store. +// After the required waiting period expires and all KMS keys are deleted from the +// custom key store, use DisconnectCustomKeyStore to disconnect the key store from +// KMS. Then, you can delete the custom key store. For keys in an CloudHSM key +// store, the ScheduleKeyDeletion operation makes a best effort to delete the key +// material from the associated cluster. However, you might need to manually +// delete the orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) +// from the cluster and its backups. KMS never creates, manages, or deletes +// cryptographic keys in the external key manager associated with an external key +// store. You must manage them using your external key manager tools. Instead of +// deleting the custom key store, consider using the DisconnectCustomKeyStore +// operation to disconnect the custom key store from its backing key store. While +// the key store is disconnected, you cannot create or use the KMS keys in the key +// store. But, you do not need to delete KMS keys and you can reconnect a +// disconnected custom key store at any time. If the operation succeeds, it returns +// a JSON object with no properties. Cross-account use: No. You cannot perform this +// operation on a custom key store in a different Amazon Web Services account. +// Required permissions: kms:DeleteCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// - ConnectCustomKeyStore +// - CreateCustomKeyStore +// - DescribeCustomKeyStores +// - DisconnectCustomKeyStore +// - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [delete the orphaned key material]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [kms:DeleteCustomKeyStore]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DeleteCustomKeyStore(ctx context.Context, params *DeleteCustomKeyStoreInput, optFns ...func(*Options)) (*DeleteCustomKeyStoreOutput, error) { if params == nil { params = &DeleteCustomKeyStoreInput{} @@ -87,7 +67,7 @@ func (c *Client) DeleteCustomKeyStore(ctx context.Context, params *DeleteCustomK type DeleteCustomKeyStoreInput struct { // Enter the ID of the custom key store you want to delete. To find the ID of a - // custom key store, use the DescribeCustomKeyStoresoperation. + // custom key store, use the DescribeCustomKeyStores operation. // // This member is required. CustomKeyStoreId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go index f6e1d71c0fd..26ac0a15152 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go @@ -13,33 +13,22 @@ import ( // Deletes key material that was previously imported. This operation makes the // specified KMS key temporarily unusable. To restore the usability of the KMS key, // reimport the same key material. For more information about importing key -// material into KMS, see [Importing Key Material]in the Key Management Service Developer Guide. -// -// When the specified KMS key is in the PendingDeletion state, this operation does -// not change the KMS key's state. Otherwise, it changes the KMS key's state to -// PendingImport . -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:DeleteImportedKeyMaterial] (key policy) -// -// Related operations: -// -// # GetParametersForImport -// -// # ImportKeyMaterial +// material into KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the Key Management Service Developer Guide. When the specified KMS key is in +// the PendingDeletion state, this operation does not change the KMS key's state. +// Otherwise, it changes the KMS key's state to PendingImport . The KMS key that +// you use for this operation must be in a compatible key state. For details, see +// Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:DeleteImportedKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - GetParametersForImport +// - ImportKeyMaterial // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:DeleteImportedKeyMaterial]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Importing Key Material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DeleteImportedKeyMaterial(ctx context.Context, params *DeleteImportedKeyMaterialInput, optFns ...func(*Options)) (*DeleteImportedKeyMaterialOutput, error) { if params == nil { params = &DeleteImportedKeyMaterialInput{} @@ -58,18 +47,12 @@ func (c *Client) DeleteImportedKeyMaterial(ctx context.Context, params *DeleteIm type DeleteImportedKeyMaterialInput struct { // Identifies the KMS key from which you are deleting imported key material. The - // Origin of the KMS key must be EXTERNAL . - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Origin of the KMS key must be EXTERNAL . Specify the key ID or key ARN of the + // KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go index 1dc1b384dc8..3204174c2f0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go @@ -11,61 +11,44 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets information about [custom key stores] in the account and Region. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// By default, this operation returns information about all custom key stores in -// the account and Region. To get only information about a particular custom key -// store, use either the CustomKeyStoreName or CustomKeyStoreId parameter (but not -// both). -// +// Gets information about custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// in the account and Region. This operation is part of the custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. By +// default, this operation returns information about all custom key stores in the +// account and Region. To get only information about a particular custom key store, +// use either the CustomKeyStoreName or CustomKeyStoreId parameter (but not both). // To determine whether the custom key store is connected to its CloudHSM cluster // or external key store proxy, use the ConnectionState element in the response. // If an attempt to connect the custom key store failed, the ConnectionState value // is FAILED and the ConnectionErrorCode element in the response indicates the -// cause of the failure. For help interpreting the ConnectionErrorCode , see CustomKeyStoresListEntry. -// -// Custom key stores have a DISCONNECTED connection state if the key store has -// never been connected or you used the DisconnectCustomKeyStoreoperation to disconnect it. Otherwise, the -// connection state is CONNECTED. If your custom key store connection state is -// CONNECTED but you are having trouble using it, verify that the backing store is -// active and available. For an CloudHSM key store, verify that the associated -// CloudHSM cluster is active and contains the minimum number of HSMs required for -// the operation, if any. For an external key store, verify that the external key -// store proxy and its associated external key manager are reachable and enabled. -// -// For help repairing your CloudHSM key store, see the [Troubleshooting CloudHSM key stores]. For help repairing your -// external key store, see the [Troubleshooting external key stores]. Both topics are in the Key Management Service -// Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:DescribeCustomKeyStores] (IAM policy) -// -// Related operations: -// -// # ConnectCustomKeyStore -// -// # CreateCustomKeyStore -// -// # DeleteCustomKeyStore -// -// # DisconnectCustomKeyStore -// -// # UpdateCustomKeyStore +// cause of the failure. For help interpreting the ConnectionErrorCode , see +// CustomKeyStoresListEntry . Custom key stores have a DISCONNECTED connection +// state if the key store has never been connected or you used the +// DisconnectCustomKeyStore operation to disconnect it. Otherwise, the connection +// state is CONNECTED. If your custom key store connection state is CONNECTED but +// you are having trouble using it, verify that the backing store is active and +// available. For an CloudHSM key store, verify that the associated CloudHSM +// cluster is active and contains the minimum number of HSMs required for the +// operation, if any. For an external key store, verify that the external key store +// proxy and its associated external key manager are reachable and enabled. For +// help repairing your CloudHSM key store, see the Troubleshooting CloudHSM key +// stores (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) +// . For help repairing your external key store, see the Troubleshooting external +// key stores (https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html) +// . Both topics are in the Key Management Service Developer Guide. Cross-account +// use: No. You cannot perform this operation on a custom key store in a different +// Amazon Web Services account. Required permissions: kms:DescribeCustomKeyStores (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// - ConnectCustomKeyStore +// - CreateCustomKeyStore +// - DeleteCustomKeyStore +// - DisconnectCustomKeyStore +// - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:DescribeCustomKeyStores]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [Troubleshooting CloudHSM key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html -// [Troubleshooting external key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DescribeCustomKeyStores(ctx context.Context, params *DescribeCustomKeyStoresInput, optFns ...func(*Options)) (*DescribeCustomKeyStoresOutput, error) { if params == nil { params = &DescribeCustomKeyStoresInput{} @@ -84,21 +67,17 @@ func (c *Client) DescribeCustomKeyStores(ctx context.Context, params *DescribeCu type DescribeCustomKeyStoresInput struct { // Gets only information about the specified custom key store. Enter the key store - // ID. - // - // By default, this operation gets information about all custom key stores in the - // account and Region. To limit the output to a particular custom key store, + // ID. By default, this operation gets information about all custom key stores in + // the account and Region. To limit the output to a particular custom key store, // provide either the CustomKeyStoreId or CustomKeyStoreName parameter, but not // both. CustomKeyStoreId *string // Gets only information about the specified custom key store. Enter the friendly - // name of the custom key store. - // - // By default, this operation gets information about all custom key stores in the - // account and Region. To limit the output to a particular custom key store, - // provide either the CustomKeyStoreId or CustomKeyStoreName parameter, but not - // both. + // name of the custom key store. By default, this operation gets information about + // all custom key stores in the account and Region. To limit the output to a + // particular custom key store, provide either the CustomKeyStoreId or + // CustomKeyStoreName parameter, but not both. CustomKeyStoreName *string // Use this parameter to specify the maximum number of items to return. When this @@ -125,7 +104,7 @@ type DescribeCustomKeyStoresOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go index f01c9f627b3..6070fb4343a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go @@ -11,73 +11,51 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Provides detailed information about a KMS key. You can run DescribeKey on a [customer managed key] or -// an [Amazon Web Services managed key]. -// -// This detailed information includes the key ARN, creation date (and deletion +// Provides detailed information about a KMS key. You can run DescribeKey on a +// customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// or an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// . This detailed information includes the key ARN, creation date (and deletion // date, if applicable), the key state, and the origin and expiration date (if any) // of the key material. It includes fields, like KeySpec , that help you // distinguish different types of KMS keys. It also displays the key usage // (encryption, signing, or generating and verifying MACs) and the algorithms that -// the KMS key supports. -// -// For [multi-Region keys], DescribeKey displays the primary key and all related replica keys. For -// KMS keys in [CloudHSM key stores], it includes information about the key store, such as the key -// store ID and the CloudHSM cluster ID. For KMS keys in [external key stores], it includes the custom -// key store ID and the ID of the external key. -// +// the KMS key supports. For multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) +// , DescribeKey displays the primary key and all related replica keys. For KMS +// keys in CloudHSM key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html) +// , it includes information about the key store, such as the key store ID and the +// CloudHSM cluster ID. For KMS keys in external key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html) +// , it includes the custom key store ID and the ID of the external key. // DescribeKey does not return the following information: -// -// - Aliases associated with the KMS key. To get this information, use ListAliases. -// +// - Aliases associated with the KMS key. To get this information, use +// ListAliases . // - Whether automatic key rotation is enabled on the KMS key. To get this -// information, use GetKeyRotationStatus. Also, some key states prevent a KMS key from being -// automatically rotated. For details, see [How Automatic Key Rotation Works]in the Key Management Service -// Developer Guide. -// -// - Tags on the KMS key. To get this information, use ListResourceTags. -// -// - Key policies and grants on the KMS key. To get this information, use GetKeyPolicyand ListGrants. +// information, use GetKeyRotationStatus . Also, some key states prevent a KMS +// key from being automatically rotated. For details, see How Automatic Key +// Rotation Works (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works) +// in the Key Management Service Developer Guide. +// - Tags on the KMS key. To get this information, use ListResourceTags . +// - Key policies and grants on the KMS key. To get this information, use +// GetKeyPolicy and ListGrants . // // In general, DescribeKey is a non-mutating operation. It returns data about KMS // keys, but doesn't change them. However, Amazon Web Services services use -// DescribeKey to create [Amazon Web Services managed keys] from a predefined Amazon Web Services alias with no key -// ID. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:DescribeKey] (key policy) -// -// Related operations: -// -// # GetKeyPolicy -// -// # GetKeyRotationStatus -// -// # ListAliases -// -// # ListGrants -// -// # ListKeys -// -// # ListResourceTags -// -// # ListRetirableGrants +// DescribeKey to create Amazon Web Services managed keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// from a predefined Amazon Web Services alias with no key ID. Cross-account use: +// Yes. To perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:DescribeKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - GetKeyPolicy +// - GetKeyRotationStatus +// - ListAliases +// - ListGrants +// - ListKeys +// - ListResourceTags +// - ListRetirableGrants // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [CloudHSM key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html -// [external key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html -// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk -// [kms:DescribeKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [How Automatic Key Rotation Works]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works -// [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html -// [Amazon Web Services managed keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DescribeKey(ctx context.Context, params *DescribeKeyInput, optFns ...func(*Options)) (*DescribeKeyOutput, error) { if params == nil { params = &DescribeKeyInput{} @@ -95,43 +73,29 @@ func (c *Client) DescribeKey(ctx context.Context, params *DescribeKeyInput, optF type DescribeKeyInput struct { - // Describes the specified KMS key. - // - // If you specify a predefined Amazon Web Services alias (an Amazon Web Services - // alias with no key ID), KMS associates the alias with an [Amazon Web Services managed key]and returns its KeyId - // and Arn in the response. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // Describes the specified KMS key. If you specify a predefined Amazon Web + // Services alias (an Amazon Web Services alias with no key ID), KMS associates the + // alias with an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html##aws-managed-cmk) + // and returns its KeyId and Arn in the response. To specify a KMS key, use its + // key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it + // with "alias/" . To specify a KMS key in a different Amazon Web Services account, + // you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. - // - // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html##aws-managed-cmk + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go index ad7229a7d5e..eeb57e55428 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go @@ -11,28 +11,19 @@ import ( ) // Sets the state of a KMS key to disabled. This change temporarily prevents use -// of the KMS key for [cryptographic operations]. -// -// For more information about how key state affects the use of a KMS key, see [Key states of KMS keys] in -// the Key Management Service Developer Guide . -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:DisableKey] (key policy) -// -// Related operations: EnableKey -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [kms:DisableKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// of the KMS key for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// . For more information about how key state affects the use of a KMS key, see +// Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide . The KMS key that you use for +// this operation must be in a compatible key state. For details, see Key states +// of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:DisableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: EnableKey Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DisableKey(ctx context.Context, params *DisableKeyInput, optFns ...func(*Options)) (*DisableKeyOutput, error) { if params == nil { params = &DisableKeyInput{} @@ -50,18 +41,12 @@ func (c *Client) DisableKey(ctx context.Context, params *DisableKeyInput, optFns type DisableKeyInput struct { - // Identifies the KMS key to disable. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Identifies the KMS key to disable. Specify the key ID or key ARN of the KMS + // key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go index 3b6daa56c4f..6737c36a7af 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go @@ -10,53 +10,33 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disables [automatic rotation of the key material] of the specified symmetric encryption KMS key. -// -// Automatic key rotation is supported only on symmetric encryption KMS keys. You -// cannot enable automatic rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To -// enable or disable automatic rotation of a set of related [multi-Region keys], set the property on -// the primary key. -// -// You can enable (EnableKeyRotation ) and disable automatic rotation of the key material in [customer managed KMS keys]. Key -// material rotation of [Amazon Web Services managed KMS keys]is not configurable. KMS always rotates the key material -// for every year. Rotation of [Amazon Web Services owned KMS keys]varies. -// -// In May 2022, KMS changed the rotation schedule for Amazon Web Services managed -// keys from every three years to every year. For details, see EnableKeyRotation. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:DisableKeyRotation] (key policy) -// -// Related operations: -// -// # EnableKeyRotation -// -// # GetKeyRotationStatus -// -// # ListKeyRotations -// -// # RotateKeyOnDemand +// Disables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) +// of the specified symmetric encryption KMS key. Automatic key rotation is +// supported only on symmetric encryption KMS keys. You cannot enable automatic +// rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// , HMAC KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) +// , KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// , or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// . To enable or disable automatic rotation of a set of related multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) +// , set the property on the primary key. You can enable ( EnableKeyRotation ) and +// disable automatic rotation of the key material in customer managed KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// . Key material rotation of Amazon Web Services managed KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// is not configurable. KMS always rotates the key material for every year. +// Rotation of Amazon Web Services owned KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) +// varies. In May 2022, KMS changed the rotation schedule for Amazon Web Services +// managed keys from every three years to every year. For details, see +// EnableKeyRotation . The KMS key that you use for this operation must be in a +// compatible key state. For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:DisableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - EnableKeyRotation +// - GetKeyRotationStatus // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html -// [Amazon Web Services managed KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [automatic rotation of the key material]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html -// [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [customer managed KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk -// [Amazon Web Services owned KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk -// [kms:DisableKeyRotation]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DisableKeyRotation(ctx context.Context, params *DisableKeyRotationInput, optFns ...func(*Options)) (*DisableKeyRotationOutput, error) { if params == nil { params = &DisableKeyRotationInput{} @@ -75,23 +55,15 @@ func (c *Client) DisableKeyRotation(ctx context.Context, params *DisableKeyRotat type DisableKeyRotationInput struct { // Identifies a symmetric encryption KMS key. You cannot enable or disable - // automatic rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks) + // , HMAC KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) + // , KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) + // , or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) + // . Specify the key ID or key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html - // [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html - // [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go index 80f6654a5b6..f9b7daae145 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go @@ -10,54 +10,36 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disconnects the [custom key store] from its backing key store. This operation disconnects an -// CloudHSM key store from its associated CloudHSM cluster or disconnects an -// external key store from the external key store proxy that communicates with your -// external key manager. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// While a custom key store is disconnected, you can manage the custom key store -// and its KMS keys, but you cannot create or use its KMS keys. You can reconnect -// the custom key store at any time. -// -// While a custom key store is disconnected, all attempts to create KMS keys in -// the custom key store or to use existing KMS keys in [cryptographic operations]will fail. This action can -// prevent users from storing and accessing sensitive data. -// -// When you disconnect a custom key store, its ConnectionState changes to -// Disconnected . To find the connection state of a custom key store, use the DescribeCustomKeyStores -// operation. To reconnect a custom key store, use the ConnectCustomKeyStoreoperation. -// -// If the operation succeeds, it returns a JSON object with no properties. -// -// Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:DisconnectCustomKeyStore] (IAM policy) -// -// Related operations: -// -// # ConnectCustomKeyStore -// -// # CreateCustomKeyStore -// -// # DeleteCustomKeyStore -// -// # DescribeCustomKeyStores -// -// # UpdateCustomKeyStore +// Disconnects the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// from its backing key store. This operation disconnects an CloudHSM key store +// from its associated CloudHSM cluster or disconnects an external key store from +// the external key store proxy that communicates with your external key manager. +// This operation is part of the custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. While a +// custom key store is disconnected, you can manage the custom key store and its +// KMS keys, but you cannot create or use its KMS keys. You can reconnect the +// custom key store at any time. While a custom key store is disconnected, all +// attempts to create KMS keys in the custom key store or to use existing KMS keys +// in cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// will fail. This action can prevent users from storing and accessing sensitive +// data. When you disconnect a custom key store, its ConnectionState changes to +// Disconnected . To find the connection state of a custom key store, use the +// DescribeCustomKeyStores operation. To reconnect a custom key store, use the +// ConnectCustomKeyStore operation. If the operation succeeds, it returns a JSON +// object with no properties. Cross-account use: No. You cannot perform this +// operation on a custom key store in a different Amazon Web Services account. +// Required permissions: kms:DisconnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// - ConnectCustomKeyStore +// - CreateCustomKeyStore +// - DeleteCustomKeyStore +// - DescribeCustomKeyStores +// - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [kms:DisconnectCustomKeyStore]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) DisconnectCustomKeyStore(ctx context.Context, params *DisconnectCustomKeyStoreInput, optFns ...func(*Options)) (*DisconnectCustomKeyStoreOutput, error) { if params == nil { params = &DisconnectCustomKeyStoreInput{} @@ -76,7 +58,7 @@ func (c *Client) DisconnectCustomKeyStore(ctx context.Context, params *Disconnec type DisconnectCustomKeyStoreInput struct { // Enter the ID of the custom key store you want to disconnect. To find the ID of - // a custom key store, use the DescribeCustomKeyStoresoperation. + // a custom key store, use the DescribeCustomKeyStores operation. // // This member is required. CustomKeyStoreId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go index c01d5d97152..1395c9df67b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go @@ -11,25 +11,16 @@ import ( ) // Sets the key state of a KMS key to enabled. This allows you to use the KMS key -// for [cryptographic operations]. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:EnableKey] (key policy) -// -// Related operations: DisableKey -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:EnableKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// . The KMS key that you use for this operation must be in a compatible key state. +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:EnableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: DisableKey Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) EnableKey(ctx context.Context, params *EnableKeyInput, optFns ...func(*Options)) (*EnableKeyOutput, error) { if params == nil { params = &EnableKeyInput{} @@ -47,18 +38,12 @@ func (c *Client) EnableKey(ctx context.Context, params *EnableKeyInput, optFns . type EnableKeyInput struct { - // Identifies the KMS key to enable. - // - // Specify the key ID or key ARN of the KMS key. - // + // Identifies the KMS key to enable. Specify the key ID or key ARN of the KMS key. // For example: - // // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go index d2ada715811..06e237c808f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go @@ -10,77 +10,42 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Enables [automatic rotation of the key material] of the specified symmetric encryption KMS key. -// -// By default, when you enable automatic rotation of a [customer managed KMS key], KMS rotates the key -// material of the KMS key one year (approximately 365 days) from the enable date -// and every year thereafter. You can use the optional RotationPeriodInDays -// parameter to specify a custom rotation period when you enable key rotation, or -// you can use RotationPeriodInDays to modify the rotation period of a key that -// you previously enabled automatic key rotation on. -// -// You can monitor rotation of the key material for your KMS keys in CloudTrail -// and Amazon CloudWatch. To disable rotation of the key material in a customer -// managed KMS key, use the DisableKeyRotationoperation. You can use the GetKeyRotationStatus operation to identify any -// in progress rotations. You can use the ListKeyRotationsoperation to view the details of -// completed rotations. -// -// Automatic key rotation is supported only on [symmetric encryption KMS keys]. You cannot enable automatic -// rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To enable or disable -// automatic rotation of a set of related [multi-Region keys], set the property on the primary key. -// -// You cannot enable or disable automatic rotation of [Amazon Web Services managed KMS keys]. KMS always rotates the key -// material of Amazon Web Services managed keys every year. Rotation of [Amazon Web Services owned KMS keys]is managed -// by the Amazon Web Services service that owns the key. -// -// In May 2022, KMS changed the rotation schedule for Amazon Web Services managed -// keys from every three years (approximately 1,095 days) to every year -// (approximately 365 days). -// -// New Amazon Web Services managed keys are automatically rotated one year after -// they are created, and approximately every year thereafter. -// -// Existing Amazon Web Services managed keys are automatically rotated one year -// after their most recent rotation, and every year thereafter. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:EnableKeyRotation] (key policy) -// -// Related operations: -// -// # DisableKeyRotation -// -// # GetKeyRotationStatus -// -// # ListKeyRotations -// -// RotateKeyOnDemand -// -// - You can perform on-demand (RotateKeyOnDemand ) rotation of the key material in customer -// managed KMS keys, regardless of whether or not automatic key rotation is -// enabled. +// Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) +// of the specified symmetric encryption KMS key. When you enable automatic +// rotation of a customer managed KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// , KMS rotates the key material of the KMS key one year (approximately 365 days) +// from the enable date and every year thereafter. You can monitor rotation of the +// key material for your KMS keys in CloudTrail and Amazon CloudWatch. To disable +// rotation of the key material in a customer managed KMS key, use the +// DisableKeyRotation operation. Automatic key rotation is supported only on +// symmetric encryption KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks) +// . You cannot enable automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// , HMAC KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) +// , KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// , or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// . To enable or disable automatic rotation of a set of related multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) +// , set the property on the primary key. You cannot enable or disable automatic +// rotation Amazon Web Services managed KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// . KMS always rotates the key material of Amazon Web Services managed keys every +// year. Rotation of Amazon Web Services owned KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) +// varies. In May 2022, KMS changed the rotation schedule for Amazon Web Services +// managed keys from every three years (approximately 1,095 days) to every year +// (approximately 365 days). New Amazon Web Services managed keys are automatically +// rotated one year after they are created, and approximately every year +// thereafter. Existing Amazon Web Services managed keys are automatically rotated +// one year after their most recent rotation, and every year thereafter. The KMS +// key that you use for this operation must be in a compatible key state. For +// details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:EnableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - DisableKeyRotation +// - GetKeyRotationStatus // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:EnableKeyRotation]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Amazon Web Services owned KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk -// [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html -// [Amazon Web Services managed KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [customer managed KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk -// [automatic rotation of the key material]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable -// [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [symmetric encryption KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) EnableKeyRotation(ctx context.Context, params *EnableKeyRotationInput, optFns ...func(*Options)) (*EnableKeyRotationOutput, error) { if params == nil { params = &EnableKeyRotationInput{} @@ -99,42 +64,21 @@ func (c *Client) EnableKeyRotation(ctx context.Context, params *EnableKeyRotatio type EnableKeyRotationInput struct { // Identifies a symmetric encryption KMS key. You cannot enable automatic rotation - // of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To enable or disable automatic - // rotation of a set of related [multi-Region keys], set the property on the primary key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) + // , HMAC KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) + // , KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) + // , or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) + // . To enable or disable automatic rotation of a set of related multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) + // , set the property on the primary key. Specify the key ID or key ARN of the KMS + // key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html - // [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html - // [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html - // [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // Use this parameter to specify a custom period of time between each rotation - // date. If no value is specified, the default value is 365 days. - // - // The rotation period defines the number of days after you enable automatic key - // rotation that KMS will rotate your key material, and the number of days between - // each automatic rotation thereafter. - // - // You can use the [kms:RotationPeriodInDays]kms:RotationPeriodInDays condition key to further constrain the - // values that principals can specify in the RotationPeriodInDays parameter. - // - // [kms:RotationPeriodInDays]: https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-rotation-period-in-days - RotationPeriodInDays *int32 - noSmithyDocumentSerde } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go index 2c2b71de556..d6628feb8ec 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go @@ -12,86 +12,57 @@ import ( ) // Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a -// symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT . -// -// You can use this operation to encrypt small amounts of arbitrary data, such as -// a personal identifier or database password, or other sensitive information. You -// don't need to use the Encrypt operation to encrypt a data key. The GenerateDataKey and GenerateDataKeyPair -// operations return a plaintext data key and an encrypted copy of that data key. -// -// If you use a symmetric encryption KMS key, you can use an encryption context to -// add additional security to your encryption operation. If you specify an -// EncryptionContext when encrypting data, you must specify the same encryption -// context (a case-sensitive exact match) when decrypting the data. Otherwise, the -// request to decrypt fails with an InvalidCiphertextException . For more -// information, see [Encryption Context]in the Key Management Service Developer Guide. -// -// If you specify an asymmetric KMS key, you must also specify the encryption -// algorithm. The algorithm must be compatible with the KMS key spec. -// -// When you use an asymmetric KMS key to encrypt or reencrypt data, be sure to -// record the KMS key and encryption algorithm that you choose. You will be -// required to provide the same KMS key and encryption algorithm when you decrypt -// the data. If the KMS key and algorithm do not match the values used to encrypt -// the data, the decrypt operation fails. -// -// You are not required to supply the key ID and encryption algorithm when you -// decrypt with symmetric encryption KMS keys because KMS stores this information -// in the ciphertext blob. KMS cannot store metadata in ciphertext generated with +// symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT . You can use +// this operation to encrypt small amounts of arbitrary data, such as a personal +// identifier or database password, or other sensitive information. You don't need +// to use the Encrypt operation to encrypt a data key. The GenerateDataKey and +// GenerateDataKeyPair operations return a plaintext data key and an encrypted copy +// of that data key. If you use a symmetric encryption KMS key, you can use an +// encryption context to add additional security to your encryption operation. If +// you specify an EncryptionContext when encrypting data, you must specify the +// same encryption context (a case-sensitive exact match) when decrypting the data. +// Otherwise, the request to decrypt fails with an InvalidCiphertextException . For +// more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the Key Management Service Developer Guide. If you specify an asymmetric KMS +// key, you must also specify the encryption algorithm. The algorithm must be +// compatible with the KMS key spec. When you use an asymmetric KMS key to encrypt +// or reencrypt data, be sure to record the KMS key and encryption algorithm that +// you choose. You will be required to provide the same KMS key and encryption +// algorithm when you decrypt the data. If the KMS key and algorithm do not match +// the values used to encrypt the data, the decrypt operation fails. You are not +// required to supply the key ID and encryption algorithm when you decrypt with +// symmetric encryption KMS keys because KMS stores this information in the +// ciphertext blob. KMS cannot store metadata in ciphertext generated with // asymmetric keys. The standard format for asymmetric key ciphertext does not -// include configurable fields. -// -// The maximum size of the data that you can encrypt varies with the type of KMS -// key and the encryption algorithm that you choose. -// +// include configurable fields. The maximum size of the data that you can encrypt +// varies with the type of KMS key and the encryption algorithm that you choose. // - Symmetric encryption KMS keys -// // - SYMMETRIC_DEFAULT : 4096 bytes -// // - RSA_2048 -// // - RSAES_OAEP_SHA_1 : 214 bytes -// // - RSAES_OAEP_SHA_256 : 190 bytes -// // - RSA_3072 -// // - RSAES_OAEP_SHA_1 : 342 bytes -// // - RSAES_OAEP_SHA_256 : 318 bytes -// // - RSA_4096 -// // - RSAES_OAEP_SHA_1 : 470 bytes -// // - RSAES_OAEP_SHA_256 : 446 bytes -// // - SM2PKE : 1024 bytes (China Regions only) // // The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:Encrypt] (key policy) -// -// Related operations: -// -// # Decrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:Encrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Decrypt +// - GenerateDataKey +// - GenerateDataKeyPair // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Encryption Context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [kms:Encrypt]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) Encrypt(ctx context.Context, params *EncryptInput, optFns ...func(*Options)) (*EncryptOutput, error) { if params == nil { params = &EncryptInput{} @@ -110,26 +81,18 @@ func (c *Client) Encrypt(ctx context.Context, params *EncryptInput, optFns ...fu type EncryptInput struct { // Identifies the KMS key to use in the encryption operation. The KMS key must - // have a KeyUsage of ENCRYPT_DECRYPT . To find the KeyUsage of a KMS key, use the DescribeKey - // operation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // have a KeyUsage of ENCRYPT_DECRYPT . To find the KeyUsage of a KMS key, use the + // DescribeKey operation. To specify a KMS key, use its key ID, key ARN, alias + // name, or alias ARN. When using an alias name, prefix it with "alias/" . To + // specify a KMS key in a different Amazon Web Services account, you must use the + // key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string @@ -139,54 +102,40 @@ type EncryptInput struct { // This member is required. Plaintext []byte - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool // Specifies the encryption algorithm that KMS will use to encrypt the plaintext // message. The algorithm must be compatible with the KMS key that you specify. - // // This parameter is required only for asymmetric KMS keys. The default value, // SYMMETRIC_DEFAULT , is the algorithm used for symmetric encryption KMS keys. If - // you are using an asymmetric KMS key, we recommend RSAES_OAEP_SHA_256. - // - // The SM2PKE algorithm is only available in China Regions. + // you are using an asymmetric KMS key, we recommend RSAES_OAEP_SHA_256. The SM2PKE + // algorithm is only available in China Regions. EncryptionAlgorithm types.EncryptionAlgorithmSpec // Specifies the encryption context that will be used to encrypt the data. An - // encryption context is valid only for [cryptographic operations]with a symmetric encryption KMS key. The - // standard asymmetric encryption algorithms and HMAC algorithms that KMS uses do - // not support an encryption context. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric + // encryption context is valid only for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) + // with a symmetric encryption KMS key. The standard asymmetric encryption + // algorithms and HMAC algorithms that KMS uses do not support an encryption + // context. Do not include confidential or sensitive information in this field. + // This field may be displayed in plaintext in CloudTrail logs and other output. An + // encryption context is a collection of non-secret key-value pairs that represent + // additional authenticated data. When you use an encryption context to encrypt + // data, you must specify the same (an exact case-sensitive match) encryption + // context to decrypt the data. An encryption context is supported only on + // operations with symmetric encryption KMS keys. On operations with symmetric // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde @@ -201,10 +150,8 @@ type EncryptOutput struct { // The encryption algorithm that was used to encrypt the plaintext. EncryptionAlgorithm types.EncryptionAlgorithmSpec - // The Amazon Resource Name ([key ARN] ) of the KMS key that was used to encrypt the - // plaintext. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that was used to encrypt the plaintext. KeyId *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go index a188477010f..4a46272c303 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go @@ -16,52 +16,47 @@ import ( // symmetric encryption KMS key that you specify. The bytes in the plaintext key // are random; they are not related to the caller or the KMS key. You can use the // plaintext key to encrypt your data outside of KMS and store the encrypted data -// key with the encrypted data. -// -// To generate a data key, specify the symmetric encryption KMS key that will be -// used to encrypt the data key. You cannot use an asymmetric KMS key to encrypt -// data keys. To get the type of your KMS key, use the DescribeKeyoperation. -// -// You must also specify the length of the data key. Use either the KeySpec or -// NumberOfBytes parameters (but not both). For 128-bit and 256-bit data keys, use -// the KeySpec parameter. -// -// To generate a 128-bit SM4 data key (China Regions only), specify a KeySpec -// value of AES_128 or a NumberOfBytes value of 16 . The symmetric encryption key -// used in China Regions to encrypt your data key is an SM4 encryption key. -// -// To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. To generate an asymmetric -// data key pair, use the GenerateDataKeyPairor GenerateDataKeyPairWithoutPlaintext operation. To get a cryptographically secure random -// byte string, use GenerateRandom. -// -// You can use an optional encryption context to add additional security to the -// encryption operation. If you specify an EncryptionContext , you must specify the -// same encryption context (a case-sensitive exact match) when decrypting the -// encrypted data key. Otherwise, the request to decrypt fails with an -// InvalidCiphertextException . For more information, see [Encryption Context] in the Key Management -// Service Developer Guide. -// -// GenerateDataKey also supports [Amazon Web Services Nitro Enclaves], which provide an isolated compute environment -// in Amazon EC2. To call GenerateDataKey for an Amazon Web Services Nitro -// enclave, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services SDK. Use the Recipient parameter to -// provide the attestation document for the enclave. GenerateDataKey returns a -// copy of the data key encrypted under the specified KMS key, as usual. But -// instead of a plaintext copy of the data key, the response includes a copy of the -// data key encrypted under the public key from the attestation document ( +// key with the encrypted data. To generate a data key, specify the symmetric +// encryption KMS key that will be used to encrypt the data key. You cannot use an +// asymmetric KMS key to encrypt data keys. To get the type of your KMS key, use +// the DescribeKey operation. You must also specify the length of the data key. +// Use either the KeySpec or NumberOfBytes parameters (but not both). For 128-bit +// and 256-bit data keys, use the KeySpec parameter. To generate a 128-bit SM4 +// data key (China Regions only), specify a KeySpec value of AES_128 or a +// NumberOfBytes value of 16 . The symmetric encryption key used in China Regions +// to encrypt your data key is an SM4 encryption key. To get only an encrypted copy +// of the data key, use GenerateDataKeyWithoutPlaintext . To generate an asymmetric +// data key pair, use the GenerateDataKeyPair or +// GenerateDataKeyPairWithoutPlaintext operation. To get a cryptographically secure +// random byte string, use GenerateRandom . You can use an optional encryption +// context to add additional security to the encryption operation. If you specify +// an EncryptionContext , you must specify the same encryption context (a +// case-sensitive exact match) when decrypting the encrypted data key. Otherwise, +// the request to decrypt fails with an InvalidCiphertextException . For more +// information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the Key Management Service Developer Guide. GenerateDataKey also supports +// Amazon Web Services Nitro Enclaves (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html) +// , which provide an isolated compute environment in Amazon EC2. To call +// GenerateDataKey for an Amazon Web Services Nitro enclave, use the Amazon Web +// Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) +// or any Amazon Web Services SDK. Use the Recipient parameter to provide the +// attestation document for the enclave. GenerateDataKey returns a copy of the +// data key encrypted under the specified KMS key, as usual. But instead of a +// plaintext copy of the data key, the response includes a copy of the data key +// encrypted under the public key from the attestation document ( // CiphertextForRecipient ). For information about the interaction between KMS and -// Amazon Web Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer -// Guide.. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// # How to use your data key -// -// We recommend that you use the following pattern to encrypt data locally in your +// Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves +// uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) +// in the Key Management Service Developer Guide.. The KMS key that you use for +// this operation must be in a compatible key state. For details, see Key states +// of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. How to use your data key We +// recommend that you use the following pattern to encrypt data locally in your // application. You can write your own code or use a client-side encryption -// library, such as the [Amazon Web Services Encryption SDK], the [Amazon DynamoDB Encryption Client], or [Amazon S3 client-side encryption] to do these tasks for you. -// -// To encrypt data outside of KMS: +// library, such as the Amazon Web Services Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) +// , the Amazon DynamoDB Encryption Client (https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/) +// , or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html) +// to do these tasks for you. To encrypt data outside of KMS: // // - Use the GenerateDataKey operation to get a data key. // @@ -72,44 +67,24 @@ import ( // with the encrypted data. // // To decrypt data outside of KMS: -// -// - Use the Decryptoperation to decrypt the encrypted data key. The operation returns -// a plaintext copy of the data key. -// +// - Use the Decrypt operation to decrypt the encrypted data key. The operation +// returns a plaintext copy of the data key. // - Use the plaintext data key to decrypt data outside of KMS, then erase the // plaintext data key from memory. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GenerateDataKey] (key policy) -// -// Related operations: -// -// # Decrypt -// -// # Encrypt -// -// # GenerateDataKeyPair -// -// # GenerateDataKeyPairWithoutPlaintext -// -// # GenerateDataKeyWithoutPlaintext +// the KeyId parameter. Required permissions: kms:GenerateDataKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Decrypt +// - Encrypt +// - GenerateDataKeyPair +// - GenerateDataKeyPairWithoutPlaintext +// - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Amazon Web Services Encryption SDK]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/ -// [Amazon DynamoDB Encryption Client]: https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/ -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Encryption Context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [Amazon Web Services Nitro Enclaves]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html -// [Amazon S3 client-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html -// [kms:GenerateDataKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateDataKey(ctx context.Context, params *GenerateDataKeyInput, optFns ...func(*Options)) (*GenerateDataKeyOutput, error) { if params == nil { params = &GenerateDataKeyInput{} @@ -129,102 +104,75 @@ type GenerateDataKeyInput struct { // Specifies the symmetric encryption KMS key that encrypts the data key. You // cannot specify an asymmetric KMS key or a KMS key in a custom key store. To get - // the type and origin of your KMS key, use the DescribeKeyoperation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // the type and origin of your KMS key, use the DescribeKey operation. To specify + // a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an + // alias name, prefix it with "alias/" . To specify a KMS key in a different Amazon + // Web Services account, you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // Specifies the encryption context that will be used when encrypting the data key. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric + // Specifies the encryption context that will be used when encrypting the data + // key. Do not include confidential or sensitive information in this field. This + // field may be displayed in plaintext in CloudTrail logs and other output. An + // encryption context is a collection of non-secret key-value pairs that represent + // additional authenticated data. When you use an encryption context to encrypt + // data, you must specify the same (an exact case-sensitive match) encryption + // context to decrypt the data. An encryption context is supported only on + // operations with symmetric encryption KMS keys. On operations with symmetric // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // Specifies the length of the data key. Use AES_128 to generate a 128-bit - // symmetric key, or AES_256 to generate a 256-bit symmetric key. - // - // You must specify either the KeySpec or the NumberOfBytes parameter (but not - // both) in every GenerateDataKey request. + // symmetric key, or AES_256 to generate a 256-bit symmetric key. You must specify + // either the KeySpec or the NumberOfBytes parameter (but not both) in every + // GenerateDataKey request. KeySpec types.DataKeySpec // Specifies the length of the data key in bytes. For example, use the value 64 to // generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) and - // 256-bit (32-byte) data keys, use the KeySpec parameter. - // - // You must specify either the KeySpec or the NumberOfBytes parameter (but not - // both) in every GenerateDataKey request. + // 256-bit (32-byte) data keys, use the KeySpec parameter. You must specify either + // the KeySpec or the NumberOfBytes parameter (but not both) in every + // GenerateDataKey request. NumberOfBytes *int32 - // A signed [attestation document] from an Amazon Web Services Nitro enclave and the encryption - // algorithm to use with the enclave's public key. The only valid encryption - // algorithm is RSAES_OAEP_SHA_256 . - // - // This parameter only supports attestation documents for Amazon Web Services - // Nitro Enclaves. To include this parameter, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services - // SDK. - // - // When you use this parameter, instead of returning the plaintext data key, KMS - // encrypts the plaintext data key under the public key in the attestation - // document, and returns the resulting ciphertext in the CiphertextForRecipient - // field in the response. This ciphertext can be decrypted only with the private - // key in the enclave. The CiphertextBlob field in the response contains a copy of - // the data key encrypted under the KMS key specified by the KeyId parameter. The - // Plaintext field in the response is null or empty. - // - // For information about the interaction between KMS and Amazon Web Services Nitro - // Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [attestation document]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html - // [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk + // A signed attestation document (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc) + // from an Amazon Web Services Nitro enclave and the encryption algorithm to use + // with the enclave's public key. The only valid encryption algorithm is + // RSAES_OAEP_SHA_256 . This parameter only supports attestation documents for + // Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon + // Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) + // or any Amazon Web Services SDK. When you use this parameter, instead of + // returning the plaintext data key, KMS encrypts the plaintext data key under the + // public key in the attestation document, and returns the resulting ciphertext in + // the CiphertextForRecipient field in the response. This ciphertext can be + // decrypted only with the private key in the enclave. The CiphertextBlob field in + // the response contains a copy of the data key encrypted under the KMS key + // specified by the KeyId parameter. The Plaintext field in the response is null + // or empty. For information about the interaction between KMS and Amazon Web + // Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. Recipient *types.RecipientInfo noSmithyDocumentSerde @@ -238,28 +186,23 @@ type GenerateDataKeyOutput struct { // The plaintext data key encrypted with the public key from the Nitro enclave. // This ciphertext can be decrypted only by using a private key in the Nitro - // enclave. - // - // This field is included in the response only when the Recipient parameter in the - // request includes a valid attestation document from an Amazon Web Services Nitro - // enclave. For information about the interaction between KMS and Amazon Web - // Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html + // enclave. This field is included in the response only when the Recipient + // parameter in the request includes a valid attestation document from an Amazon + // Web Services Nitro enclave. For information about the interaction between KMS + // and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro + // Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. CiphertextForRecipient []byte - // The Amazon Resource Name ([key ARN] ) of the KMS key that encrypted the data key. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that encrypted the data key. KeyId *string // The plaintext data key. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. Use this // data key to encrypt your data outside of KMS. Then, remove it from memory as - // soon as possible. - // - // If the response includes the CiphertextForRecipient field, the Plaintext field - // is null or empty. + // soon as possible. If the response includes the CiphertextForRecipient field, + // the Plaintext field is null or empty. Plaintext []byte // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go index 5076ac095b3..2156fb5f613 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go @@ -17,90 +17,67 @@ import ( // specify. You can use the data key pair to perform asymmetric cryptography and // implement digital signatures outside of KMS. The bytes in the keys are random; // they are not related to the caller or to the KMS key that is used to encrypt the -// private key. -// -// You can use the public key that GenerateDataKeyPair returns to encrypt data or -// verify a signature outside of KMS. Then, store the encrypted private key with -// the data. When you are ready to decrypt data or sign a message, you can use the Decrypt -// operation to decrypt the encrypted private key. -// -// To generate a data key pair, you must specify a symmetric encryption KMS key to +// private key. You can use the public key that GenerateDataKeyPair returns to +// encrypt data or verify a signature outside of KMS. Then, store the encrypted +// private key with the data. When you are ready to decrypt data or sign a message, +// you can use the Decrypt operation to decrypt the encrypted private key. To +// generate a data key pair, you must specify a symmetric encryption KMS key to // encrypt the private key in a data key pair. You cannot use an asymmetric KMS key // or a KMS key in a custom key store. To get the type and origin of your KMS key, -// use the DescribeKeyoperation. -// -// Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data key -// pair. In China Regions, you can also choose an SM2 data key pair. KMS recommends -// that you use ECC key pairs for signing, and use RSA and SM2 key pairs for either -// encryption or signing, but not both. However, KMS cannot enforce any -// restrictions on the use of data key pairs outside of KMS. -// -// If you are using the data key pair to encrypt data, or for any operation where -// you don't immediately need a private key, consider using the GenerateDataKeyPairWithoutPlaintextoperation. +// use the DescribeKey operation. Use the KeyPairSpec parameter to choose an RSA +// or Elliptic Curve (ECC) data key pair. In China Regions, you can also choose an +// SM2 data key pair. KMS recommends that you use ECC key pairs for signing, and +// use RSA and SM2 key pairs for either encryption or signing, but not both. +// However, KMS cannot enforce any restrictions on the use of data key pairs +// outside of KMS. If you are using the data key pair to encrypt data, or for any +// operation where you don't immediately need a private key, consider using the +// GenerateDataKeyPairWithoutPlaintext operation. // GenerateDataKeyPairWithoutPlaintext returns a plaintext public key and an // encrypted private key, but omits the plaintext private key that you need only to // decrypt ciphertext or sign a message. Later, when you need to decrypt the data -// or sign a message, use the Decryptoperation to decrypt the encrypted private key in -// the data key pair. -// -// GenerateDataKeyPair returns a unique data key pair for each request. The bytes -// in the keys are random; they are not related to the caller or the KMS key that -// is used to encrypt the private key. The public key is a DER-encoded X.509 -// SubjectPublicKeyInfo, as specified in [RFC 5280]. The private key is a DER-encoded PKCS8 -// PrivateKeyInfo, as specified in [RFC 5958]. -// -// GenerateDataKeyPair also supports [Amazon Web Services Nitro Enclaves], which provide an isolated compute -// environment in Amazon EC2. To call GenerateDataKeyPair for an Amazon Web -// Services Nitro enclave, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services SDK. Use the -// Recipient parameter to provide the attestation document for the enclave. -// GenerateDataKeyPair returns the public data key and a copy of the private data -// key encrypted under the specified KMS key, as usual. But instead of a plaintext -// copy of the private data key ( PrivateKeyPlaintext ), the response includes a -// copy of the private data key encrypted under the public key from the attestation -// document ( CiphertextForRecipient ). For information about the interaction -// between KMS and Amazon Web Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management -// Service Developer Guide.. -// -// You can use an optional encryption context to add additional security to the -// encryption operation. If you specify an EncryptionContext , you must specify the -// same encryption context (a case-sensitive exact match) when decrypting the -// encrypted data key. Otherwise, the request to decrypt fails with an -// InvalidCiphertextException . For more information, see [Encryption Context] in the Key Management -// Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GenerateDataKeyPair] (key policy) -// -// Related operations: -// -// # Decrypt -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPairWithoutPlaintext -// -// # GenerateDataKeyWithoutPlaintext +// or sign a message, use the Decrypt operation to decrypt the encrypted private +// key in the data key pair. GenerateDataKeyPair returns a unique data key pair +// for each request. The bytes in the keys are random; they are not related to the +// caller or the KMS key that is used to encrypt the private key. The public key is +// a DER-encoded X.509 SubjectPublicKeyInfo, as specified in RFC 5280 (https://tools.ietf.org/html/rfc5280) +// . The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in RFC +// 5958 (https://tools.ietf.org/html/rfc5958) . GenerateDataKeyPair also supports +// Amazon Web Services Nitro Enclaves (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html) +// , which provide an isolated compute environment in Amazon EC2. To call +// GenerateDataKeyPair for an Amazon Web Services Nitro enclave, use the Amazon +// Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) +// or any Amazon Web Services SDK. Use the Recipient parameter to provide the +// attestation document for the enclave. GenerateDataKeyPair returns the public +// data key and a copy of the private data key encrypted under the specified KMS +// key, as usual. But instead of a plaintext copy of the private data key ( +// PrivateKeyPlaintext ), the response includes a copy of the private data key +// encrypted under the public key from the attestation document ( +// CiphertextForRecipient ). For information about the interaction between KMS and +// Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves +// uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) +// in the Key Management Service Developer Guide.. You can use an optional +// encryption context to add additional security to the encryption operation. If +// you specify an EncryptionContext , you must specify the same encryption context +// (a case-sensitive exact match) when decrypting the encrypted data key. +// Otherwise, the request to decrypt fails with an InvalidCiphertextException . For +// more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a KMS key in a different Amazon Web Services account, +// specify the key ARN or alias ARN in the value of the KeyId parameter. Required +// permissions: kms:GenerateDataKeyPair (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Decrypt +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPairWithoutPlaintext +// - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [RFC 5280]: https://tools.ietf.org/html/rfc5280 -// [Encryption Context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [Amazon Web Services Nitro Enclaves]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html -// [RFC 5958]: https://tools.ietf.org/html/rfc5958 -// [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html -// [kms:GenerateDataKeyPair]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateDataKeyPair(ctx context.Context, params *GenerateDataKeyPairInput, optFns ...func(*Options)) (*GenerateDataKeyPairOutput, error) { if params == nil { params = &GenerateDataKeyPairInput{} @@ -120,100 +97,73 @@ type GenerateDataKeyPairInput struct { // Specifies the symmetric encryption KMS key that encrypts the private key in the // data key pair. You cannot specify an asymmetric KMS key or a KMS key in a custom - // key store. To get the type and origin of your KMS key, use the DescribeKeyoperation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // + // key store. To get the type and origin of your KMS key, use the DescribeKey + // operation. To specify a KMS key, use its key ID, key ARN, alias name, or alias + // ARN. When using an alias name, prefix it with "alias/" . To specify a KMS key in + // a different Amazon Web Services account, you must use the key ARN or alias ARN. // For example: - // // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // Determines the type of data key pair that is generated. - // - // The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys to - // encrypt and decrypt or to sign and verify (but not both), and the rule that - // permits you to use ECC KMS keys only to sign and verify, are not effective on - // data key pairs, which are used outside of KMS. The SM2 key spec is only - // available in China Regions. + // Determines the type of data key pair that is generated. The KMS rule that + // restricts the use of asymmetric RSA and SM2 KMS keys to encrypt and decrypt or + // to sign and verify (but not both), and the rule that permits you to use ECC KMS + // keys only to sign and verify, are not effective on data key pairs, which are + // used outside of KMS. The SM2 key spec is only available in China Regions. // // This member is required. KeyPairSpec types.DataKeyPairSpec - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool // Specifies the encryption context that will be used when encrypting the private - // key in the data key pair. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric - // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // key in the data key pair. Do not include confidential or sensitive information + // in this field. This field may be displayed in plaintext in CloudTrail logs and + // other output. An encryption context is a collection of non-secret key-value + // pairs that represent additional authenticated data. When you use an encryption + // context to encrypt data, you must specify the same (an exact case-sensitive + // match) encryption context to decrypt the data. An encryption context is + // supported only on operations with symmetric encryption KMS keys. On operations + // with symmetric encryption KMS keys, an encryption context is optional, but it is + // strongly recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string - // A signed [attestation document] from an Amazon Web Services Nitro enclave and the encryption - // algorithm to use with the enclave's public key. The only valid encryption - // algorithm is RSAES_OAEP_SHA_256 . - // - // This parameter only supports attestation documents for Amazon Web Services - // Nitro Enclaves. To include this parameter, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services - // SDK. - // - // When you use this parameter, instead of returning a plaintext copy of the - // private data key, KMS encrypts the plaintext private data key under the public - // key in the attestation document, and returns the resulting ciphertext in the - // CiphertextForRecipient field in the response. This ciphertext can be decrypted - // only with the private key in the enclave. The CiphertextBlob field in the - // response contains a copy of the private data key encrypted under the KMS key - // specified by the KeyId parameter. The PrivateKeyPlaintext field in the response - // is null or empty. - // - // For information about the interaction between KMS and Amazon Web Services Nitro - // Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [attestation document]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html - // [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk + // A signed attestation document (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc) + // from an Amazon Web Services Nitro enclave and the encryption algorithm to use + // with the enclave's public key. The only valid encryption algorithm is + // RSAES_OAEP_SHA_256 . This parameter only supports attestation documents for + // Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon + // Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) + // or any Amazon Web Services SDK. When you use this parameter, instead of + // returning a plaintext copy of the private data key, KMS encrypts the plaintext + // private data key under the public key in the attestation document, and returns + // the resulting ciphertext in the CiphertextForRecipient field in the response. + // This ciphertext can be decrypted only with the private key in the enclave. The + // CiphertextBlob field in the response contains a copy of the private data key + // encrypted under the KMS key specified by the KeyId parameter. The + // PrivateKeyPlaintext field in the response is null or empty. For information + // about the interaction between KMS and Amazon Web Services Nitro Enclaves, see + // How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. Recipient *types.RecipientInfo noSmithyDocumentSerde @@ -223,19 +173,16 @@ type GenerateDataKeyPairOutput struct { // The plaintext private data key encrypted with the public key from the Nitro // enclave. This ciphertext can be decrypted only by using a private key in the - // Nitro enclave. - // - // This field is included in the response only when the Recipient parameter in the - // request includes a valid attestation document from an Amazon Web Services Nitro - // enclave. For information about the interaction between KMS and Amazon Web - // Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html + // Nitro enclave. This field is included in the response only when the Recipient + // parameter in the request includes a valid attestation document from an Amazon + // Web Services Nitro enclave. For information about the interaction between KMS + // and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro + // Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. CiphertextForRecipient []byte - // The Amazon Resource Name ([key ARN] ) of the KMS key that encrypted the private key. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that encrypted the private key. KeyId *string // The type of data key pair that was generated. @@ -248,9 +195,7 @@ type GenerateDataKeyPairOutput struct { // The plaintext copy of the private key. When you use the HTTP API or the Amazon // Web Services CLI, the value is Base64-encoded. Otherwise, it is not - // Base64-encoded. - // - // If the response includes the CiphertextForRecipient field, the + // Base64-encoded. If the response includes the CiphertextForRecipient field, the // PrivateKeyPlaintext field is null or empty. PrivateKeyPlaintext []byte diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go index f3bc534a0e0..94393a5168b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go @@ -13,68 +13,48 @@ import ( // Returns a unique asymmetric data key pair for use outside of KMS. This // operation returns a plaintext public key and a copy of the private key that is -// encrypted under the symmetric encryption KMS key you specify. Unlike GenerateDataKeyPair, this -// operation does not return a plaintext private key. The bytes in the keys are -// random; they are not related to the caller or to the KMS key that is used to -// encrypt the private key. -// -// You can use the public key that GenerateDataKeyPairWithoutPlaintext returns to -// encrypt data or verify a signature outside of KMS. Then, store the encrypted -// private key with the data. When you are ready to decrypt data or sign a message, -// you can use the Decryptoperation to decrypt the encrypted private key. -// -// To generate a data key pair, you must specify a symmetric encryption KMS key to -// encrypt the private key in a data key pair. You cannot use an asymmetric KMS key -// or a KMS key in a custom key store. To get the type and origin of your KMS key, -// use the DescribeKeyoperation. -// -// Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data key -// pair. In China Regions, you can also choose an SM2 data key pair. KMS recommends -// that you use ECC key pairs for signing, and use RSA and SM2 key pairs for either -// encryption or signing, but not both. However, KMS cannot enforce any -// restrictions on the use of data key pairs outside of KMS. -// +// encrypted under the symmetric encryption KMS key you specify. Unlike +// GenerateDataKeyPair , this operation does not return a plaintext private key. +// The bytes in the keys are random; they are not related to the caller or to the +// KMS key that is used to encrypt the private key. You can use the public key that +// GenerateDataKeyPairWithoutPlaintext returns to encrypt data or verify a +// signature outside of KMS. Then, store the encrypted private key with the data. +// When you are ready to decrypt data or sign a message, you can use the Decrypt +// operation to decrypt the encrypted private key. To generate a data key pair, you +// must specify a symmetric encryption KMS key to encrypt the private key in a data +// key pair. You cannot use an asymmetric KMS key or a KMS key in a custom key +// store. To get the type and origin of your KMS key, use the DescribeKey +// operation. Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve +// (ECC) data key pair. In China Regions, you can also choose an SM2 data key pair. +// KMS recommends that you use ECC key pairs for signing, and use RSA and SM2 key +// pairs for either encryption or signing, but not both. However, KMS cannot +// enforce any restrictions on the use of data key pairs outside of KMS. // GenerateDataKeyPairWithoutPlaintext returns a unique data key pair for each // request. The bytes in the key are not related to the caller or KMS key that is // used to encrypt the private key. The public key is a DER-encoded X.509 -// SubjectPublicKeyInfo, as specified in [RFC 5280]. -// -// You can use an optional encryption context to add additional security to the +// SubjectPublicKeyInfo, as specified in RFC 5280 (https://tools.ietf.org/html/rfc5280) +// . You can use an optional encryption context to add additional security to the // encryption operation. If you specify an EncryptionContext , you must specify the // same encryption context (a case-sensitive exact match) when decrypting the // encrypted data key. Otherwise, the request to decrypt fails with an -// InvalidCiphertextException . For more information, see [Encryption Context] in the Key Management -// Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GenerateDataKeyPairWithoutPlaintext] (key policy) -// -// Related operations: -// -// # Decrypt -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair -// -// # GenerateDataKeyWithoutPlaintext +// InvalidCiphertextException . For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a KMS key in a different Amazon Web Services account, +// specify the key ARN or alias ARN in the value of the KeyId parameter. Required +// permissions: kms:GenerateDataKeyPairWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Decrypt +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPair +// - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [RFC 5280]: https://tools.ietf.org/html/rfc5280 -// [Encryption Context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [kms:GenerateDataKeyPairWithoutPlaintext]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateDataKeyPairWithoutPlaintext(ctx context.Context, params *GenerateDataKeyPairWithoutPlaintextInput, optFns ...func(*Options)) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { if params == nil { params = &GenerateDataKeyPairWithoutPlaintextInput{} @@ -94,75 +74,54 @@ type GenerateDataKeyPairWithoutPlaintextInput struct { // Specifies the symmetric encryption KMS key that encrypts the private key in the // data key pair. You cannot specify an asymmetric KMS key or a KMS key in a custom - // key store. To get the type and origin of your KMS key, use the DescribeKeyoperation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // + // key store. To get the type and origin of your KMS key, use the DescribeKey + // operation. To specify a KMS key, use its key ID, key ARN, alias name, or alias + // ARN. When using an alias name, prefix it with "alias/" . To specify a KMS key in + // a different Amazon Web Services account, you must use the key ARN or alias ARN. // For example: - // // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // Determines the type of data key pair that is generated. - // - // The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys to - // encrypt and decrypt or to sign and verify (but not both), and the rule that - // permits you to use ECC KMS keys only to sign and verify, are not effective on - // data key pairs, which are used outside of KMS. The SM2 key spec is only - // available in China Regions. + // Determines the type of data key pair that is generated. The KMS rule that + // restricts the use of asymmetric RSA and SM2 KMS keys to encrypt and decrypt or + // to sign and verify (but not both), and the rule that permits you to use ECC KMS + // keys only to sign and verify, are not effective on data key pairs, which are + // used outside of KMS. The SM2 key spec is only available in China Regions. // // This member is required. KeyPairSpec types.DataKeyPairSpec - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool // Specifies the encryption context that will be used when encrypting the private - // key in the data key pair. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric - // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // key in the data key pair. Do not include confidential or sensitive information + // in this field. This field may be displayed in plaintext in CloudTrail logs and + // other output. An encryption context is a collection of non-secret key-value + // pairs that represent additional authenticated data. When you use an encryption + // context to encrypt data, you must specify the same (an exact case-sensitive + // match) encryption context to decrypt the data. An encryption context is + // supported only on operations with symmetric encryption KMS keys. On operations + // with symmetric encryption KMS keys, an encryption context is optional, but it is + // strongly recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde @@ -170,9 +129,8 @@ type GenerateDataKeyPairWithoutPlaintextInput struct { type GenerateDataKeyPairWithoutPlaintextOutput struct { - // The Amazon Resource Name ([key ARN] ) of the KMS key that encrypted the private key. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that encrypted the private key. KeyId *string // The type of data key pair that was generated. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go index 3947b622641..0a5af3cd567 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go @@ -14,77 +14,52 @@ import ( // Returns a unique symmetric data key for use outside of KMS. This operation // returns a data key that is encrypted under a symmetric encryption KMS key that // you specify. The bytes in the key are random; they are not related to the caller -// or to the KMS key. -// -// GenerateDataKeyWithoutPlaintext is identical to the GenerateDataKey operation except that it -// does not return a plaintext copy of the data key. -// -// This operation is useful for systems that need to encrypt data at some point, -// but not immediately. When you need to encrypt the data, you call the Decryptoperation -// on the encrypted copy of the key. -// -// It's also useful in distributed systems with different levels of trust. For -// example, you might store encrypted data in containers. One component of your -// system creates new containers and stores an encrypted data key with each -// container. Then, a different component puts the data into the containers. That -// component first decrypts the data key, uses the plaintext data key to encrypt -// data, puts the encrypted data into the container, and then destroys the -// plaintext data key. In this system, the component that creates the containers -// never sees the plaintext data key. -// -// To request an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext operations. -// -// To generate a data key, you must specify the symmetric encryption KMS key that -// is used to encrypt the data key. You cannot use an asymmetric KMS key or a key -// in a custom key store to generate a data key. To get the type of your KMS key, -// use the DescribeKeyoperation. -// -// You must also specify the length of the data key. Use either the KeySpec or -// NumberOfBytes parameters (but not both). For 128-bit and 256-bit data keys, use -// the KeySpec parameter. -// -// To generate an SM4 data key (China Regions only), specify a KeySpec value of -// AES_128 or NumberOfBytes value of 16 . The symmetric encryption key used in -// China Regions to encrypt your data key is an SM4 encryption key. -// -// If the operation succeeds, you will find the encrypted copy of the data key in -// the CiphertextBlob field. -// -// You can use an optional encryption context to add additional security to the -// encryption operation. If you specify an EncryptionContext , you must specify the -// same encryption context (a case-sensitive exact match) when decrypting the -// encrypted data key. Otherwise, the request to decrypt fails with an -// InvalidCiphertextException . For more information, see [Encryption Context] in the Key Management -// Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GenerateDataKeyWithoutPlaintext] (key policy) -// -// Related operations: -// -// # Decrypt -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair -// -// # GenerateDataKeyPairWithoutPlaintext +// or to the KMS key. GenerateDataKeyWithoutPlaintext is identical to the +// GenerateDataKey operation except that it does not return a plaintext copy of the +// data key. This operation is useful for systems that need to encrypt data at some +// point, but not immediately. When you need to encrypt the data, you call the +// Decrypt operation on the encrypted copy of the key. It's also useful in +// distributed systems with different levels of trust. For example, you might store +// encrypted data in containers. One component of your system creates new +// containers and stores an encrypted data key with each container. Then, a +// different component puts the data into the containers. That component first +// decrypts the data key, uses the plaintext data key to encrypt data, puts the +// encrypted data into the container, and then destroys the plaintext data key. In +// this system, the component that creates the containers never sees the plaintext +// data key. To request an asymmetric data key pair, use the GenerateDataKeyPair +// or GenerateDataKeyPairWithoutPlaintext operations. To generate a data key, you +// must specify the symmetric encryption KMS key that is used to encrypt the data +// key. You cannot use an asymmetric KMS key or a key in a custom key store to +// generate a data key. To get the type of your KMS key, use the DescribeKey +// operation. You must also specify the length of the data key. Use either the +// KeySpec or NumberOfBytes parameters (but not both). For 128-bit and 256-bit +// data keys, use the KeySpec parameter. To generate an SM4 data key (China +// Regions only), specify a KeySpec value of AES_128 or NumberOfBytes value of 16 . +// The symmetric encryption key used in China Regions to encrypt your data key is +// an SM4 encryption key. If the operation succeeds, you will find the encrypted +// copy of the data key in the CiphertextBlob field. You can use an optional +// encryption context to add additional security to the encryption operation. If +// you specify an EncryptionContext , you must specify the same encryption context +// (a case-sensitive exact match) when decrypting the encrypted data key. +// Otherwise, the request to decrypt fails with an InvalidCiphertextException . For +// more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a KMS key in a different Amazon Web Services account, +// specify the key ARN or alias ARN in the value of the KeyId parameter. Required +// permissions: kms:GenerateDataKeyWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - Decrypt +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPair +// - GenerateDataKeyPairWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Encryption Context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [kms:GenerateDataKeyWithoutPlaintext]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateDataKeyWithoutPlaintext(ctx context.Context, params *GenerateDataKeyWithoutPlaintextInput, optFns ...func(*Options)) (*GenerateDataKeyWithoutPlaintextOutput, error) { if params == nil { params = &GenerateDataKeyWithoutPlaintextInput{} @@ -104,63 +79,44 @@ type GenerateDataKeyWithoutPlaintextInput struct { // Specifies the symmetric encryption KMS key that encrypts the data key. You // cannot specify an asymmetric KMS key or a KMS key in a custom key store. To get - // the type and origin of your KMS key, use the DescribeKeyoperation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // the type and origin of your KMS key, use the DescribeKey operation. To specify + // a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an + // alias name, prefix it with "alias/" . To specify a KMS key in a different Amazon + // Web Services account, you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // Specifies the encryption context that will be used when encrypting the data key. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric + // Specifies the encryption context that will be used when encrypting the data + // key. Do not include confidential or sensitive information in this field. This + // field may be displayed in plaintext in CloudTrail logs and other output. An + // encryption context is a collection of non-secret key-value pairs that represent + // additional authenticated data. When you use an encryption context to encrypt + // data, you must specify the same (an exact case-sensitive match) encryption + // context to decrypt the data. An encryption context is supported only on + // operations with symmetric encryption KMS keys. On operations with symmetric // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // recommended. For more information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. EncryptionContext map[string]string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // The length of the data key. Use AES_128 to generate a 128-bit symmetric key, or @@ -182,9 +138,8 @@ type GenerateDataKeyWithoutPlaintextOutput struct { // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. CiphertextBlob []byte - // The Amazon Resource Name ([key ARN] ) of the KMS key that encrypted the data key. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that encrypted the data key. KeyId *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go index 1abd90e2cfa..5a2819bdb39 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go @@ -13,42 +13,29 @@ import ( // Generates a hash-based message authentication code (HMAC) for a message using // an HMAC KMS key and a MAC algorithm that the key supports. HMAC KMS keys and the -// HMAC algorithms that KMS uses conform to industry standards defined in [RFC 2104]. -// -// You can use value that GenerateMac returns in the VerifyMac operation to demonstrate -// that the original message has not changed. Also, because a secret key is used to -// create the hash, you can verify that the party that generated the hash has the -// required secret key. You can also use the raw result to implement HMAC-based -// algorithms such as key derivation functions. This operation is part of KMS -// support for HMAC KMS keys. For details, see [HMAC keys in KMS]in the Key Management Service -// Developer Guide . -// -// Best practices recommend that you limit the time during which any signing -// mechanism, including an HMAC, is effective. This deters an attack where the -// actor uses a signed message to establish validity repeatedly or long after the -// message is superseded. HMAC tags do not include a timestamp, but you can include -// a timestamp in the token or message to help you detect when its time to refresh -// the HMAC. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GenerateMac] (key policy) -// -// Related operations: VerifyMac -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:GenerateMac]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [RFC 2104]: https://datatracker.ietf.org/doc/html/rfc2104 -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [HMAC keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html +// HMAC algorithms that KMS uses conform to industry standards defined in RFC 2104 (https://datatracker.ietf.org/doc/html/rfc2104) +// . You can use value that GenerateMac returns in the VerifyMac operation to +// demonstrate that the original message has not changed. Also, because a secret +// key is used to create the hash, you can verify that the party that generated the +// hash has the required secret key. You can also use the raw result to implement +// HMAC-based algorithms such as key derivation functions. This operation is part +// of KMS support for HMAC KMS keys. For details, see HMAC keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) +// in the Key Management Service Developer Guide . Best practices recommend that +// you limit the time during which any signing mechanism, including an HMAC, is +// effective. This deters an attack where the actor uses a signed message to +// establish validity repeatedly or long after the message is superseded. HMAC tags +// do not include a timestamp, but you can include a timestamp in the token or +// message to help you detect when its time to refresh the HMAC. The KMS key that +// you use for this operation must be in a compatible key state. For details, see +// Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:GenerateMac (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: VerifyMac Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateMac(ctx context.Context, params *GenerateMacInput, optFns ...func(*Options)) (*GenerateMacOutput, error) { if params == nil { params = &GenerateMacInput{} @@ -67,50 +54,39 @@ func (c *Client) GenerateMac(ctx context.Context, params *GenerateMacInput, optF type GenerateMacInput struct { // The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC - // for the message and the key as described in [RFC 2104]. - // - // To identify an HMAC KMS key, use the DescribeKey operation and see the KeySpec field in - // the response. - // - // [RFC 2104]: https://datatracker.ietf.org/doc/html/rfc2104 + // for the message and the key as described in RFC 2104 (https://datatracker.ietf.org/doc/html/rfc2104) + // . To identify an HMAC KMS key, use the DescribeKey operation and see the KeySpec + // field in the response. // // This member is required. KeyId *string - // The MAC algorithm used in the operation. - // - // The algorithm must be compatible with the HMAC KMS key that you specify. To - // find the MAC algorithms that your HMAC KMS key supports, use the DescribeKeyoperation and - // see the MacAlgorithms field in the DescribeKey response. + // The MAC algorithm used in the operation. The algorithm must be compatible with + // the HMAC KMS key that you specify. To find the MAC algorithms that your HMAC KMS + // key supports, use the DescribeKey operation and see the MacAlgorithms field in + // the DescribeKey response. // // This member is required. MacAlgorithm types.MacAlgorithmSpec - // The message to be hashed. Specify a message of up to 4,096 bytes. - // - // GenerateMac and VerifyMac do not provide special handling for message digests. If you + // The message to be hashed. Specify a message of up to 4,096 bytes. GenerateMac + // and VerifyMac do not provide special handling for message digests. If you // generate an HMAC for a hash digest of a message, you must verify the HMAC of the // same hash digest. // // This member is required. Message []byte - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde @@ -122,11 +98,8 @@ type GenerateMacOutput struct { KeyId *string // The hash-based message authentication code (HMAC) that was generated for the - // specified message, HMAC KMS key, and MAC algorithm. - // - // This is the standard, raw HMAC defined in [RFC 2104]. - // - // [RFC 2104]: https://datatracker.ietf.org/doc/html/rfc2104 + // specified message, HMAC KMS key, and MAC algorithm. This is the standard, raw + // HMAC defined in RFC 2104 (https://datatracker.ietf.org/doc/html/rfc2104) . Mac []byte // The MAC algorithm that was used to generate the HMAC. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go index 456c544f319..b2a2569ee82 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go @@ -11,40 +11,30 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a random byte string that is cryptographically secure. -// -// You must use the NumberOfBytes parameter to specify the length of the random -// byte string. There is no default value for string length. -// -// By default, the random byte string is generated in KMS. To generate the byte -// string in the CloudHSM cluster associated with an CloudHSM key store, use the -// CustomKeyStoreId parameter. -// -// GenerateRandom also supports [Amazon Web Services Nitro Enclaves], which provide an isolated compute environment in -// Amazon EC2. To call GenerateRandom for a Nitro enclave, use the [Amazon Web Services Nitro Enclaves SDK] or any Amazon -// Web Services SDK. Use the Recipient parameter to provide the attestation -// document for the enclave. Instead of plaintext bytes, the response includes the -// plaintext bytes encrypted under the public key from the attestation document ( -// CiphertextForRecipient ).For information about the interaction between KMS and -// Amazon Web Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer -// Guide. -// -// For more information about entropy and random number generation, see [Key Management Service Cryptographic Details]. -// +// Returns a random byte string that is cryptographically secure. You must use the +// NumberOfBytes parameter to specify the length of the random byte string. There +// is no default value for string length. By default, the random byte string is +// generated in KMS. To generate the byte string in the CloudHSM cluster associated +// with an CloudHSM key store, use the CustomKeyStoreId parameter. GenerateRandom +// also supports Amazon Web Services Nitro Enclaves (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html) +// , which provide an isolated compute environment in Amazon EC2. To call +// GenerateRandom for a Nitro enclave, use the Amazon Web Services Nitro Enclaves +// SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) +// or any Amazon Web Services SDK. Use the Recipient parameter to provide the +// attestation document for the enclave. Instead of plaintext bytes, the response +// includes the plaintext bytes encrypted under the public key from the attestation +// document ( CiphertextForRecipient ).For information about the interaction +// between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services +// Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) +// in the Key Management Service Developer Guide. For more information about +// entropy and random number generation, see Key Management Service Cryptographic +// Details (https://docs.aws.amazon.com/kms/latest/cryptographic-details/) . // Cross-account use: Not applicable. GenerateRandom does not use any -// account-specific resources, such as KMS keys. -// -// Required permissions: [kms:GenerateRandom] (IAM policy) -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:GenerateRandom]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Amazon Web Services Nitro Enclaves]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html -// [Key Management Service Cryptographic Details]: https://docs.aws.amazon.com/kms/latest/cryptographic-details/ -// [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk +// account-specific resources, such as KMS keys. Required permissions: +// kms:GenerateRandom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Eventual consistency: The KMS API follows an eventual consistency +// model. For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GenerateRandom(ctx context.Context, params *GenerateRandomInput, optFns ...func(*Options)) (*GenerateRandomOutput, error) { if params == nil { params = &GenerateRandomInput{} @@ -64,36 +54,28 @@ type GenerateRandomInput struct { // Generates the random byte string in the CloudHSM cluster that is associated // with the specified CloudHSM key store. To find the ID of a custom key store, use - // the DescribeCustomKeyStoresoperation. - // - // External key store IDs are not valid for this parameter. If you specify the ID - // of an external key store, GenerateRandom throws an UnsupportedOperationException - // . + // the DescribeCustomKeyStores operation. External key store IDs are not valid for + // this parameter. If you specify the ID of an external key store, GenerateRandom + // throws an UnsupportedOperationException . CustomKeyStoreId *string // The length of the random byte string. This parameter is required. NumberOfBytes *int32 - // A signed [attestation document] from an Amazon Web Services Nitro enclave and the encryption - // algorithm to use with the enclave's public key. The only valid encryption - // algorithm is RSAES_OAEP_SHA_256 . - // - // This parameter only supports attestation documents for Amazon Web Services - // Nitro Enclaves. To include this parameter, use the [Amazon Web Services Nitro Enclaves SDK]or any Amazon Web Services - // SDK. - // - // When you use this parameter, instead of returning plaintext bytes, KMS encrypts - // the plaintext bytes under the public key in the attestation document, and - // returns the resulting ciphertext in the CiphertextForRecipient field in the - // response. This ciphertext can be decrypted only with the private key in the - // enclave. The Plaintext field in the response is null or empty. - // - // For information about the interaction between KMS and Amazon Web Services Nitro - // Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [attestation document]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html - // [Amazon Web Services Nitro Enclaves SDK]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk + // A signed attestation document (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc) + // from an Amazon Web Services Nitro enclave and the encryption algorithm to use + // with the enclave's public key. The only valid encryption algorithm is + // RSAES_OAEP_SHA_256 . This parameter only supports attestation documents for + // Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon + // Web Services Nitro Enclaves SDK (https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk) + // or any Amazon Web Services SDK. When you use this parameter, instead of + // returning plaintext bytes, KMS encrypts the plaintext bytes under the public key + // in the attestation document, and returns the resulting ciphertext in the + // CiphertextForRecipient field in the response. This ciphertext can be decrypted + // only with the private key in the enclave. The Plaintext field in the response + // is null or empty. For information about the interaction between KMS and Amazon + // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. Recipient *types.RecipientInfo noSmithyDocumentSerde @@ -103,21 +85,18 @@ type GenerateRandomOutput struct { // The plaintext random bytes encrypted with the public key from the Nitro // enclave. This ciphertext can be decrypted only by using a private key in the - // Nitro enclave. - // - // This field is included in the response only when the Recipient parameter in the - // request includes a valid attestation document from an Amazon Web Services Nitro - // enclave. For information about the interaction between KMS and Amazon Web - // Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS]in the Key Management Service Developer Guide. - // - // [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html + // Nitro enclave. This field is included in the response only when the Recipient + // parameter in the request includes a valid attestation document from an Amazon + // Web Services Nitro enclave. For information about the interaction between KMS + // and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro + // Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) + // in the Key Management Service Developer Guide. CiphertextForRecipient []byte // The random byte string. When you use the HTTP API or the Amazon Web Services - // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. - // - // If the response includes the CiphertextForRecipient field, the Plaintext field - // is null or empty. + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. If the + // response includes the CiphertextForRecipient field, the Plaintext field is null + // or empty. Plaintext []byte // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go index b4c238dcb56..2ef4663d36f 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go @@ -10,21 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a key policy attached to the specified KMS key. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:GetKeyPolicy] (key policy) -// -// Related operations: [PutKeyPolicy] -// +// Gets a key policy attached to the specified KMS key. Cross-account use: No. You +// cannot perform this operation on a KMS key in a different Amazon Web Services +// account. Required permissions: kms:GetKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:GetKeyPolicy]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GetKeyPolicy(ctx context.Context, params *GetKeyPolicyInput, optFns ...func(*Options)) (*GetKeyPolicyOutput, error) { if params == nil { params = &GetKeyPolicyInput{} @@ -42,25 +34,19 @@ func (c *Client) GetKeyPolicy(ctx context.Context, params *GetKeyPolicyInput, op type GetKeyPolicyInput struct { - // Gets the key policy for the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Gets the key policy for the specified KMS key. Specify the key ID or key ARN of + // the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // Specifies the name of the key policy. If no policy name is specified, the // default value is default . The only valid name is default . To get the names of - // key policies, use ListKeyPolicies. + // key policies, use ListKeyPolicies . PolicyName *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go index 6fb0cd556e9..2214d4b0120 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go @@ -8,35 +8,32 @@ import ( awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" - "time" ) -// Provides detailed information about the rotation status for a KMS key, -// including whether [automatic rotation of the key material]is enabled for the specified KMS key, the [rotation period], and the next -// scheduled rotation date. -// -// Automatic key rotation is supported only on [symmetric encryption KMS keys]. You cannot enable automatic -// rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To enable or disable -// automatic rotation of a set of related [multi-Region keys], set the property on the primary key.. -// -// You can enable (EnableKeyRotation ) and disable automatic rotation (DisableKeyRotation ) of the key material in -// customer managed KMS keys. Key material rotation of [Amazon Web Services managed KMS keys]is not configurable. KMS -// always rotates the key material in Amazon Web Services managed KMS keys every -// year. The key rotation status for Amazon Web Services managed KMS keys is always -// true . -// -// You can perform on-demand (RotateKeyOnDemand ) rotation of the key material in customer managed -// KMS keys, regardless of whether or not automatic key rotation is enabled. You -// can use GetKeyRotationStatus to identify the date and time that an in progress -// on-demand rotation was initiated. You can use ListKeyRotationsto view the details of completed -// rotations. -// -// In May 2022, KMS changed the rotation schedule for Amazon Web Services managed -// keys from every three years to every year. For details, see EnableKeyRotation. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// +// Gets a Boolean value that indicates whether automatic rotation of the key +// material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) +// is enabled for the specified KMS key. When you enable automatic rotation for +// customer managed KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// , KMS rotates the key material of the KMS key one year (approximately 365 days) +// from the enable date and every year thereafter. You can monitor rotation of the +// key material for your KMS keys in CloudTrail and Amazon CloudWatch. Automatic +// key rotation is supported only on symmetric encryption KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks) +// . You cannot enable automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// , HMAC KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) +// , KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// , or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// . To enable or disable automatic rotation of a set of related multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) +// , set the property on the primary key.. You can enable ( EnableKeyRotation ) and +// disable automatic rotation ( DisableKeyRotation ) of the key material in +// customer managed KMS keys. Key material rotation of Amazon Web Services managed +// KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// is not configurable. KMS always rotates the key material in Amazon Web Services +// managed KMS keys every year. The key rotation status for Amazon Web Services +// managed KMS keys is always true . In May 2022, KMS changed the rotation schedule +// for Amazon Web Services managed keys from every three years to every year. For +// details, see EnableKeyRotation . The KMS key that you use for this operation +// must be in a compatible key state. For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. // - Disabled: The key rotation status does not change when you disable a KMS // key. However, while the KMS key is disabled, KMS does not rotate the key // material. When you re-enable the KMS key, rotation resumes. If the key material @@ -44,42 +41,20 @@ import ( // immediately, and every year thereafter. If it's been less than a year since the // key material in the re-enabled KMS key was rotated, the KMS key resumes its // prior rotation schedule. -// // - Pending deletion: While a KMS key is pending deletion, its key rotation // status is false and KMS does not rotate the key material. If you cancel the // deletion, the original key rotation status returns to true . // // Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId -// parameter. -// -// Required permissions: [kms:GetKeyRotationStatus] (key policy) -// -// Related operations: -// -// # DisableKeyRotation -// -// # EnableKeyRotation -// -// # ListKeyRotations -// -// # RotateKeyOnDemand +// parameter. Required permissions: kms:GetKeyRotationStatus (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - DisableKeyRotation +// - EnableKeyRotation // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html -// [rotation period]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotation-period -// [Amazon Web Services managed KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [kms:GetKeyRotationStatus]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [automatic rotation of the key material]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html -// [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [symmetric encryption KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks -// [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GetKeyRotationStatus(ctx context.Context, params *GetKeyRotationStatusInput, optFns ...func(*Options)) (*GetKeyRotationStatusOutput, error) { if params == nil { params = &GetKeyRotationStatusInput{} @@ -97,19 +72,13 @@ func (c *Client) GetKeyRotationStatus(ctx context.Context, params *GetKeyRotatio type GetKeyRotationStatusInput struct { - // Gets the rotation status for the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN. - // - // For example: - // + // Gets the rotation status for the specified KMS key. Specify the key ID or key + // ARN of the KMS key. To specify a KMS key in a different Amazon Web Services + // account, you must use the key ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string @@ -119,30 +88,9 @@ type GetKeyRotationStatusInput struct { type GetKeyRotationStatusOutput struct { - // Identifies the specified symmetric encryption KMS key. - KeyId *string - // A Boolean value that specifies whether key rotation is enabled. KeyRotationEnabled bool - // The next date that KMS will automatically rotate the key material. - NextRotationDate *time.Time - - // Identifies the date and time that an in progress on-demand rotation was - // initiated. - // - // The KMS API follows an [eventual consistency] model due to the distributed nature of the system. As a - // result, there might be a slight delay between initiating on-demand key rotation - // and the rotation's completion. Once the on-demand rotation is complete, use ListKeyRotationsto - // view the details of the on-demand rotation. - // - // [eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html - OnDemandRotationStartDate *time.Time - - // The number of days between each automatic rotation. The default value is 365 - // days. - RotationPeriodInDays *int32 - // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go index f658e45481c..cf3220739fd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go @@ -13,78 +13,56 @@ import ( ) // Returns the public key and an import token you need to import or reimport key -// material for a KMS key. -// -// By default, KMS keys are created with key material that KMS generates. This -// operation supports [Importing key material], an advanced feature that lets you generate and import the -// cryptographic key material for a KMS key. For more information about importing -// key material into KMS, see [Importing key material]in the Key Management Service Developer Guide. -// -// Before calling GetParametersForImport , use the CreateKey operation with an Origin value -// of EXTERNAL to create a KMS key with no key material. You can import key -// material for a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption -// KMS key, or asymmetric signing KMS key. You can also import key material into a [multi-Region key] +// material for a KMS key. By default, KMS keys are created with key material that +// KMS generates. This operation supports Importing key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// , an advanced feature that lets you generate and import the cryptographic key +// material for a KMS key. For more information about importing key material into +// KMS, see Importing key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the Key Management Service Developer Guide. Before calling +// GetParametersForImport , use the CreateKey operation with an Origin value of +// EXTERNAL to create a KMS key with no key material. You can import key material +// for a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, +// or asymmetric signing KMS key. You can also import key material into a +// multi-Region key (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) // of any supported type. However, you can't import key material into a KMS key in -// a [custom key store]. You can also use GetParametersForImport to get a public key and import -// token to [reimport the original key material]into a KMS key whose key material expired or was deleted. -// -// GetParametersForImport returns the items that you need to import your key -// material. -// -// - The public key (or "wrapping key") of an asymmetric key pair that KMS -// generates. -// -// You will use this public key to encrypt ("wrap") your key material while it's -// -// in transit to KMS. -// -// - A import token that ensures that KMS can decrypt your key material and -// associate it with the correct KMS key. +// a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// . You can also use GetParametersForImport to get a public key and import token +// to reimport the original key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material) +// into a KMS key whose key material expired or was deleted. GetParametersForImport +// returns the items that you need to import your key material. +// - The public key (or "wrapping key") of an RSA key pair that KMS generates. +// You will use this public key to encrypt ("wrap") your key material while it's in +// transit to KMS. +// - A import token that ensures that KMS can decrypt your key material and +// associate it with the correct KMS key. // // The public key and its import token are permanently linked and must be used // together. Each public key and import token set is valid for 24 hours. The // expiration date and time appear in the ParametersValidTo field in the // GetParametersForImport response. You cannot use an expired public key or import -// token in an ImportKeyMaterialrequest. If your key and token expire, send another -// GetParametersForImport request. -// -// GetParametersForImport requires the following information: -// +// token in an ImportKeyMaterial request. If your key and token expire, send +// another GetParametersForImport request. GetParametersForImport requires the +// following information: // - The key ID of the KMS key for which you are importing the key material. -// // - The key spec of the public key ("wrapping key") that you will use to // encrypt your key material during import. -// // - The wrapping algorithm that you will use with the public key to encrypt // your key material. // // You can use the same or a different public key spec and wrapping algorithm each -// time you import or reimport the same key material. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:GetParametersForImport] (key policy) -// -// Related operations: -// -// # ImportKeyMaterial -// -// # DeleteImportedKeyMaterial +// time you import or reimport the same key material. The KMS key that you use for +// this operation must be in a compatible key state. For details, see Key states +// of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:GetParametersForImport (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - ImportKeyMaterial +// - DeleteImportedKeyMaterial // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Importing key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [kms:GetParametersForImport]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [reimport the original key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [multi-Region key]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GetParametersForImport(ctx context.Context, params *GetParametersForImportInput, optFns ...func(*Options)) (*GetParametersForImportOutput, error) { if params == nil { params = &GetParametersForImportInput{} @@ -103,80 +81,47 @@ func (c *Client) GetParametersForImport(ctx context.Context, params *GetParamete type GetParametersForImportInput struct { // The identifier of the KMS key that will be associated with the imported key - // material. The Origin of the KMS key must be EXTERNAL . - // - // All KMS key types are supported, including multi-Region keys. However, you - // cannot import key material into a KMS key in a custom key store. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // material. The Origin of the KMS key must be EXTERNAL . All KMS key types are + // supported, including multi-Region keys. However, you cannot import key material + // into a KMS key in a custom key store. Specify the key ID or key ARN of the KMS + // key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // The algorithm you will use with the asymmetric public key ( PublicKey ) in the - // response to protect your key material during import. For more information, see Select a wrapping algorithm - // in the Key Management Service Developer Guide. - // - // For RSA_AES wrapping algorithms, you encrypt your key material with an AES key - // that you generate, then encrypt your AES key with the RSA public key from KMS. - // For RSAES wrapping algorithms, you encrypt your key material directly with the - // RSA public key from KMS. For SM2PKE wrapping algorithms, you encrypt your key - // material directly with the SM2 public key from KMS. - // - // The wrapping algorithms that you can use depend on the type of key material - // that you are importing. To import an RSA private key, you must use an RSA_AES - // wrapping algorithm, except in China Regions, where you must use the SM2PKE - // wrapping algorithm to import an RSA private key. - // - // The SM2PKE wrapping algorithm is available only in China Regions. The - // RSA_AES_KEY_WRAP_SHA_256 and RSA_AES_KEY_WRAP_SHA_1 wrapping algorithms are not - // supported in China Regions. - // + // The algorithm you will use with the RSA public key ( PublicKey ) in the response + // to protect your key material during import. For more information, see Select a + // wrapping algorithm in the Key Management Service Developer Guide. For RSA_AES + // wrapping algorithms, you encrypt your key material with an AES key that you + // generate, then encrypt your AES key with the RSA public key from KMS. For RSAES + // wrapping algorithms, you encrypt your key material directly with the RSA public + // key from KMS. The wrapping algorithms that you can use depend on the type of key + // material that you are importing. To import an RSA private key, you must use an + // RSA_AES wrapping algorithm. // - RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material. - // // - RSA_AES_KEY_WRAP_SHA_1 — Supported for wrapping RSA and ECC key material. - // // - RSAES_OAEP_SHA_256 — Supported for all types of key material, except RSA - // key material (private key). - // - // You cannot use the RSAES_OAEP_SHA_256 wrapping algorithm with the RSA_2048 - // wrapping key spec to wrap ECC_NIST_P521 key material. - // + // key material (private key). You cannot use the RSAES_OAEP_SHA_256 wrapping + // algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key + // material. // - RSAES_OAEP_SHA_1 — Supported for all types of key material, except RSA key - // material (private key). - // - // You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm with the RSA_2048 - // wrapping key spec to wrap ECC_NIST_P521 key material. - // + // material (private key). You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm + // with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material. // - RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not // support the RSAES_PKCS1_V1_5 wrapping algorithm. // - // - SM2PKE (China Regions only) — supported for wrapping RSA, ECC, and SM2 key - // material. - // // This member is required. WrappingAlgorithm types.AlgorithmSpec - // The type of public key to return in the response. You will use this wrapping - // key with the specified wrapping algorithm to protect your key material during - // import. - // - // Use the longest wrapping key that is practical. - // - // You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private - // key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public - // key. - // - // The SM2 wrapping key spec is available only in China Regions. + // The type of RSA public key to return in the response. You will use this + // wrapping key with the specified wrapping algorithm to protect your key material + // during import. Use the longest RSA wrapping key that is practical. You cannot + // use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key. + // Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key. // // This member is required. WrappingKeySpec types.WrappingKeySpec @@ -189,18 +134,18 @@ type GetParametersForImportOutput struct { // The import token to send in a subsequent ImportKeyMaterial request. ImportToken []byte - // The Amazon Resource Name ([key ARN] ) of the KMS key to use in a subsequent ImportKeyMaterial request. - // This is the same KMS key specified in the GetParametersForImport request. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key to use in a subsequent ImportKeyMaterial request. This is the + // same KMS key specified in the GetParametersForImport request. KeyId *string // The time at which the import token and public key are no longer valid. After - // this time, you cannot use them to make an ImportKeyMaterialrequest and you must send another - // GetParametersForImport request to get new ones. + // this time, you cannot use them to make an ImportKeyMaterial request and you + // must send another GetParametersForImport request to get new ones. ParametersValidTo *time.Time - // The public key to use to encrypt the key material before importing it with ImportKeyMaterial. + // The public key to use to encrypt the key material before importing it with + // ImportKeyMaterial . PublicKey []byte // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go index d0e17429ba3..9c52330f83c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go @@ -15,64 +15,45 @@ import ( // asymmetric KMS key, which never leaves KMS unencrypted, callers with // kms:GetPublicKey permission can download the public key of an asymmetric KMS // key. You can share the public key to allow others to encrypt messages and verify -// signatures outside of KMS. For information about asymmetric KMS keys, see [Asymmetric KMS keys]in -// the Key Management Service Developer Guide. -// -// You do not need to download the public key. Instead, you can use the public key -// within KMS by calling the Encrypt, ReEncrypt, or Verify operations with the identifier of an -// asymmetric KMS key. When you use the public key within KMS, you benefit from the +// signatures outside of KMS. For information about asymmetric KMS keys, see +// Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the Key Management Service Developer Guide. You do not need to download the +// public key. Instead, you can use the public key within KMS by calling the +// Encrypt , ReEncrypt , or Verify operations with the identifier of an asymmetric +// KMS key. When you use the public key within KMS, you benefit from the // authentication, authorization, and logging that are part of every KMS operation. // You also reduce of risk of encrypting data that cannot be decrypted. These -// features are not effective outside of KMS. -// -// To help you use the public key safely outside of KMS, GetPublicKey returns -// important information about the public key in the response, including: -// -// [KeySpec] -// - : The type of key material in the public key, such as RSA_4096 or +// features are not effective outside of KMS. To help you use the public key safely +// outside of KMS, GetPublicKey returns important information about the public key +// in the response, including: +// - KeySpec (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeySpec) +// : The type of key material in the public key, such as RSA_4096 or // ECC_NIST_P521 . -// -// [KeyUsage] -// - : Whether the key is used for encryption or signing. -// -// [EncryptionAlgorithms] -// - or [SigningAlgorithms]: A list of the encryption algorithms or the signing algorithms for the -// key. +// - KeyUsage (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage) +// : Whether the key is used for encryption or signing. +// - EncryptionAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms) +// or SigningAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms) +// : A list of the encryption algorithms or the signing algorithms for the key. // // Although KMS cannot enforce these restrictions on external operations, it is // crucial that you use this information to prevent the public key from being used // improperly. For example, you can prevent a public signing key from being used // encrypt data, or prevent a public key from being used with an encryption // algorithm that is not supported by KMS. You can also avoid errors, such as using -// the wrong signing algorithm in a verification operation. -// -// To verify a signature outside of KMS with an SM2 public key (China Regions -// only), you must specify the distinguishing ID. By default, KMS uses -// 1234567812345678 as the distinguishing ID. For more information, see [Offline verification with SM2 key pairs]. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:GetPublicKey] (key policy) -// -// Related operations: CreateKey -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [SigningAlgorithms]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:GetPublicKey]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [EncryptionAlgorithms]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms -// [Asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [KeySpec]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeySpec -// [Offline verification with SM2 key pairs]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification -// [KeyUsage]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// the wrong signing algorithm in a verification operation. To verify a signature +// outside of KMS with an SM2 public key (China Regions only), you must specify the +// distinguishing ID. By default, KMS uses 1234567812345678 as the distinguishing +// ID. For more information, see Offline verification with SM2 key pairs (https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification) +// . The KMS key that you use for this operation must be in a compatible key state. +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:GetPublicKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: CreateKey Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) GetPublicKey(ctx context.Context, params *GetPublicKeyInput, optFns ...func(*Options)) (*GetPublicKeyOutput, error) { if params == nil { params = &GetPublicKeyInput{} @@ -90,37 +71,26 @@ func (c *Client) GetPublicKey(ctx context.Context, params *GetPublicKeyInput, op type GetPublicKeyInput struct { - // Identifies the asymmetric KMS key that includes the public key. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // Identifies the asymmetric KMS key that includes the public key. To specify a + // KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias + // name, prefix it with "alias/" . To specify a KMS key in a different Amazon Web + // Services account, you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde @@ -128,53 +98,40 @@ type GetPublicKeyInput struct { type GetPublicKeyOutput struct { - // Instead, use the KeySpec field in the GetPublicKey response. - // - // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend - // that you use the KeySpec field in your code. However, to avoid breaking - // changes, KMS supports both fields. + // Instead, use the KeySpec field in the GetPublicKey response. The KeySpec and + // CustomerMasterKeySpec fields have the same value. We recommend that you use the + // KeySpec field in your code. However, to avoid breaking changes, KMS supports + // both fields. // // Deprecated: This field has been deprecated. Instead, use the KeySpec field. CustomerMasterKeySpec types.CustomerMasterKeySpec - // The encryption algorithms that KMS supports for this key. - // - // This information is critical. If a public key encrypts data outside of KMS by - // using an unsupported encryption algorithm, the ciphertext cannot be decrypted. - // - // This field appears in the response only when the KeyUsage of the public key is - // ENCRYPT_DECRYPT . + // The encryption algorithms that KMS supports for this key. This information is + // critical. If a public key encrypts data outside of KMS by using an unsupported + // encryption algorithm, the ciphertext cannot be decrypted. This field appears in + // the response only when the KeyUsage of the public key is ENCRYPT_DECRYPT . EncryptionAlgorithms []types.EncryptionAlgorithmSpec - // The Amazon Resource Name ([key ARN] ) of the asymmetric KMS key from which the public key - // was downloaded. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the asymmetric KMS key from which the public key was downloaded. KeyId *string // The type of the of the public key that was downloaded. KeySpec types.KeySpec // The permitted use of the public key. Valid values are ENCRYPT_DECRYPT or - // SIGN_VERIFY . - // - // This information is critical. If a public key with SIGN_VERIFY key usage - // encrypts data outside of KMS, the ciphertext cannot be decrypted. + // SIGN_VERIFY . This information is critical. If a public key with SIGN_VERIFY + // key usage encrypts data outside of KMS, the ciphertext cannot be decrypted. KeyUsage types.KeyUsageType - // The exported public key. - // - // The value is a DER-encoded X.509 public key, also known as SubjectPublicKeyInfo - // (SPKI), as defined in [RFC 5280]. When you use the HTTP API or the Amazon Web Services - // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. - // - // [RFC 5280]: https://tools.ietf.org/html/rfc5280 + // The exported public key. The value is a DER-encoded X.509 public key, also + // known as SubjectPublicKeyInfo (SPKI), as defined in RFC 5280 (https://tools.ietf.org/html/rfc5280) + // . When you use the HTTP API or the Amazon Web Services CLI, the value is + // Base64-encoded. Otherwise, it is not Base64-encoded. PublicKey []byte - // The signing algorithms that KMS supports for this key. - // - // This field appears in the response only when the KeyUsage of the public key is - // SIGN_VERIFY . + // The signing algorithms that KMS supports for this key. This field appears in + // the response only when the KeyUsage of the public key is SIGN_VERIFY . SigningAlgorithms []types.SigningAlgorithmSpec // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go index b8c0273ec7d..f595a5c9e19 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go @@ -14,109 +14,79 @@ import ( // Imports or reimports key material into an existing KMS key that was created // without key material. ImportKeyMaterial also sets the expiration model and -// expiration date of the imported key material. -// -// By default, KMS keys are created with key material that KMS generates. This -// operation supports [Importing key material], an advanced feature that lets you generate and import the -// cryptographic key material for a KMS key. For more information about importing -// key material into KMS, see [Importing key material]in the Key Management Service Developer Guide. -// -// After you successfully import key material into a KMS key, you can [reimport the same key material] into that -// KMS key, but you cannot import different key material. You might reimport key -// material to replace key material that expired or key material that you deleted. -// You might also reimport key material to change the expiration model or -// expiration date of the key material. -// -// Each time you import key material into KMS, you can determine whether ( -// ExpirationModel ) and when ( ValidTo ) the key material expires. To change the -// expiration of your key material, you must import it again, either by calling -// ImportKeyMaterial or using the import features of the KMS console. -// -// Before calling ImportKeyMaterial : -// +// expiration date of the imported key material. By default, KMS keys are created +// with key material that KMS generates. This operation supports Importing key +// material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// , an advanced feature that lets you generate and import the cryptographic key +// material for a KMS key. For more information about importing key material into +// KMS, see Importing key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the Key Management Service Developer Guide. After you successfully import key +// material into a KMS key, you can reimport the same key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material) +// into that KMS key, but you cannot import different key material. You might +// reimport key material to replace key material that expired or key material that +// you deleted. You might also reimport key material to change the expiration model +// or expiration date of the key material. Each time you import key material into +// KMS, you can determine whether ( ExpirationModel ) and when ( ValidTo ) the key +// material expires. To change the expiration of your key material, you must import +// it again, either by calling ImportKeyMaterial or using the import features of +// the KMS console. Before calling ImportKeyMaterial : // - Create or identify a KMS key with no key material. The KMS key must have an // Origin value of EXTERNAL , which indicates that the KMS key is designed for -// imported key material. -// -// To create an new KMS key for imported key material, call the CreateKeyoperation with an -// -// Origin value of EXTERNAL . You can create a symmetric encryption KMS key, HMAC -// KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key. You can -// also import key material into a multi-Region keyof any supported type. However, you can't -// import key material into a KMS key in a custom key store. -// -// - Use the DescribeKeyoperation to verify that the KeyState of the KMS key is -// PendingImport , which indicates that the KMS key has no key material. -// -// If you are reimporting the same key material into an existing KMS key, you -// -// might need to call the DeleteImportedKeyMaterialto delete its existing key material. -// -// - Call the GetParametersForImportoperation to get a public key and import token set for importing -// key material. -// -// - Use the public key in the GetParametersForImportresponse to encrypt your key material. +// imported key material. To create an new KMS key for imported key material, call +// the CreateKey operation with an Origin value of EXTERNAL . You can create a +// symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or +// asymmetric signing KMS key. You can also import key material into a +// multi-Region key of any supported type. However, you can't import key material +// into a KMS key in a custom key store . +// - Use the DescribeKey operation to verify that the KeyState of the KMS key is +// PendingImport , which indicates that the KMS key has no key material. If you +// are reimporting the same key material into an existing KMS key, you might need +// to call the DeleteImportedKeyMaterial to delete its existing key material. +// - Call the GetParametersForImport operation to get a public key and import +// token set for importing key material. +// - Use the public key in the GetParametersForImport response to encrypt your +// key material. // // Then, in an ImportKeyMaterial request, you submit your encrypted key material // and import token. When calling this operation, you must specify the following // values: -// // - The key ID or key ARN of the KMS key to associate with the imported key // material. Its Origin must be EXTERNAL and its KeyState must be PendingImport . -// You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a -// different Amazon Web Services account. To get the Origin and KeyState of a KMS -// key, call DescribeKey. -// +// You cannot perform this operation on a KMS key in a custom key store , or on a +// KMS key in a different Amazon Web Services account. To get the Origin and +// KeyState of a KMS key, call DescribeKey . // - The encrypted key material. -// -// - The import token that GetParametersForImportreturned. You must use a public key and token from -// the same GetParametersForImport response. -// +// - The import token that GetParametersForImport returned. You must use a public +// key and token from the same GetParametersForImport response. // - Whether the key material expires ( ExpirationModel ) and, if so, when ( -// ValidTo ). For help with this choice, see [Setting an expiration time]in the Key Management Service -// Developer Guide. -// -// If you set an expiration date, KMS deletes the key material from the KMS key on -// -// the specified date, making the KMS key unusable. To use the KMS key in -// cryptographic operations again, you must reimport the same key material. -// However, you can delete and reimport the key material at any time, including -// before the key material expires. Each time you reimport, you can eliminate or -// reset the expiration time. +// ValidTo ). For help with this choice, see Setting an expiration time (https://docs.aws.amazon.com/en_us/kms/latest/developerguide/importing-keys.html#importing-keys-expiration) +// in the Key Management Service Developer Guide. If you set an expiration date, +// KMS deletes the key material from the KMS key on the specified date, making the +// KMS key unusable. To use the KMS key in cryptographic operations again, you must +// reimport the same key material. However, you can delete and reimport the key +// material at any time, including before the key material expires. Each time you +// reimport, you can eliminate or reset the expiration time. // // When this operation is successful, the key state of the KMS key changes from // PendingImport to Enabled , and you can use the KMS key in cryptographic -// operations. -// -// If this operation fails, use the exception to help determine the problem. If -// the error is related to the key material, the import token, or wrapping key, use -// GetParametersForImportto get a new public key and import token for the KMS key and repeat the import -// procedure. For help, see [How To Import Key Material]in the Key Management Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:ImportKeyMaterial] (key policy) -// -// Related operations: -// -// # DeleteImportedKeyMaterial -// -// # GetParametersForImport +// operations. If this operation fails, use the exception to help determine the +// problem. If the error is related to the key material, the import token, or +// wrapping key, use GetParametersForImport to get a new public key and import +// token for the KMS key and repeat the import procedure. For help, see How To +// Import Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:ImportKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - DeleteImportedKeyMaterial +// - GetParametersForImport // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Importing key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [How To Import Key Material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview -// [kms:ImportKeyMaterial]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [reimport the same key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material -// [Setting an expiration time]: https://docs.aws.amazon.com/en_us/kms/latest/developerguide/importing-keys.html#importing-keys-expiration -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ImportKeyMaterial(ctx context.Context, params *ImportKeyMaterialInput, optFns ...func(*Options)) (*ImportKeyMaterialOutput, error) { if params == nil { params = &ImportKeyMaterialInput{} @@ -135,71 +105,57 @@ func (c *Client) ImportKeyMaterial(ctx context.Context, params *ImportKeyMateria type ImportKeyMaterialInput struct { // The encrypted key material to import. The key material must be encrypted under - // the public wrapping key that GetParametersForImportreturned, using the wrapping algorithm that you - // specified in the same GetParametersForImport request. + // the public wrapping key that GetParametersForImport returned, using the + // wrapping algorithm that you specified in the same GetParametersForImport + // request. // // This member is required. EncryptedKeyMaterial []byte - // The import token that you received in the response to a previous GetParametersForImport request. It - // must be from the same response that contained the public key that you used to - // encrypt the key material. + // The import token that you received in the response to a previous + // GetParametersForImport request. It must be from the same response that contained + // the public key that you used to encrypt the key material. // // This member is required. ImportToken []byte // The identifier of the KMS key that will be associated with the imported key // material. This must be the same KMS key specified in the KeyID parameter of the - // corresponding GetParametersForImportrequest. The Origin of the KMS key must be EXTERNAL and its - // KeyState must be PendingImport . - // - // The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric - // encryption KMS key, or asymmetric signing KMS key, including a multi-Region keyof any supported - // type. You cannot perform this operation on a KMS key in a custom key store, or - // on a KMS key in a different Amazon Web Services account. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // corresponding GetParametersForImport request. The Origin of the KMS key must be + // EXTERNAL and its KeyState must be PendingImport . The KMS key can be a symmetric + // encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric + // signing KMS key, including a multi-Region key of any supported type. You cannot + // perform this operation on a KMS key in a custom key store, or on a KMS key in a + // different Amazon Web Services account. Specify the key ID or key ARN of the KMS + // key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES - // . For help with this choice, see [Setting an expiration time]in the Key Management Service Developer Guide. - // - // When the value of ExpirationModel is KEY_MATERIAL_EXPIRES , you must specify a - // value for the ValidTo parameter. When value is KEY_MATERIAL_DOES_NOT_EXPIRE , - // you must omit the ValidTo parameter. - // - // You cannot change the ExpirationModel or ValidTo values for the current import - // after the request completes. To change either value, you must reimport the key - // material. - // - // [Setting an expiration time]: https://docs.aws.amazon.com/en_us/kms/latest/developerguide/importing-keys.html#importing-keys-expiration + // . For help with this choice, see Setting an expiration time (https://docs.aws.amazon.com/en_us/kms/latest/developerguide/importing-keys.html#importing-keys-expiration) + // in the Key Management Service Developer Guide. When the value of ExpirationModel + // is KEY_MATERIAL_EXPIRES , you must specify a value for the ValidTo parameter. + // When value is KEY_MATERIAL_DOES_NOT_EXPIRE , you must omit the ValidTo + // parameter. You cannot change the ExpirationModel or ValidTo values for the + // current import after the request completes. To change either value, you must + // reimport the key material. ExpirationModel types.ExpirationModelType // The date and time when the imported key material expires. This parameter is // required when the value of the ExpirationModel parameter is KEY_MATERIAL_EXPIRES - // . Otherwise it is not valid. - // - // The value of this parameter must be a future date and time. The maximum value - // is 365 days from the request date. - // - // When the key material expires, KMS deletes the key material from the KMS key. - // Without its key material, the KMS key is unusable. To use the KMS key in - // cryptographic operations, you must reimport the same key material. - // - // You cannot change the ExpirationModel or ValidTo values for the current import - // after the request completes. To change either value, you must delete (DeleteImportedKeyMaterial ) and - // reimport the key material. + // . Otherwise it is not valid. The value of this parameter must be a future date + // and time. The maximum value is 365 days from the request date. When the key + // material expires, KMS deletes the key material from the KMS key. Without its key + // material, the KMS key is unusable. To use the KMS key in cryptographic + // operations, you must reimport the same key material. You cannot change the + // ExpirationModel or ValidTo values for the current import after the request + // completes. To change either value, you must delete ( DeleteImportedKeyMaterial ) + // and reimport the key material. ValidTo *time.Time noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go index a9bff503f88..41cfda0d4fc 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go @@ -12,45 +12,29 @@ import ( ) // Gets a list of aliases in the caller's Amazon Web Services account and region. -// For more information about aliases, see CreateAlias. -// -// By default, the ListAliases operation returns all aliases in the account and -// region. To get only the aliases associated with a particular KMS key, use the -// KeyId parameter. -// -// The ListAliases response can include aliases that you created and associated -// with your customer managed keys, and aliases that Amazon Web Services created -// and associated with Amazon Web Services managed keys in your account. You can +// For more information about aliases, see CreateAlias . By default, the +// ListAliases operation returns all aliases in the account and region. To get only +// the aliases associated with a particular KMS key, use the KeyId parameter. The +// ListAliases response can include aliases that you created and associated with +// your customer managed keys, and aliases that Amazon Web Services created and +// associated with Amazon Web Services managed keys in your account. You can // recognize Amazon Web Services aliases because their names have the format aws/ , -// such as aws/dynamodb . -// -// The response might also include aliases that have no TargetKeyId field. These -// are predefined aliases that Amazon Web Services has created but has not yet -// associated with a KMS key. Aliases that Amazon Web Services creates in your -// account, including predefined aliases, do not count against your [KMS aliases quota]. -// -// Cross-account use: No. ListAliases does not return aliases in other Amazon Web -// Services accounts. -// -// Required permissions: [kms:ListAliases] (IAM policy) -// -// For details, see [Controlling access to aliases] in the Key Management Service Developer Guide. -// -// Related operations: -// -// # CreateAlias -// -// # DeleteAlias -// -// # UpdateAlias +// such as aws/dynamodb . The response might also include aliases that have no +// TargetKeyId field. These are predefined aliases that Amazon Web Services has +// created but has not yet associated with a KMS key. Aliases that Amazon Web +// Services creates in your account, including predefined aliases, do not count +// against your KMS aliases quota (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit) +// . Cross-account use: No. ListAliases does not return aliases in other Amazon +// Web Services accounts. Required permissions: kms:ListAliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the Key Management Service Developer Guide. Related operations: +// - CreateAlias +// - DeleteAlias +// - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [KMS aliases quota]: https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit -// [kms:ListAliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Controlling access to aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optFns ...func(*Options)) (*ListAliasesOutput, error) { if params == nil { params = &ListAliasesInput{} @@ -69,29 +53,20 @@ func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optF type ListAliasesInput struct { // Lists only aliases that are associated with the specified KMS key. Enter a KMS - // key in your Amazon Web Services account. - // - // This parameter is optional. If you omit it, ListAliases returns all aliases in - // the account and Region. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // key in your Amazon Web Services account. This parameter is optional. If you omit + // it, ListAliases returns all aliases in the account and Region. Specify the key + // ID or key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . KeyId *string // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit *int32 // Use this parameter in a subsequent request after you receive a response with @@ -113,7 +88,7 @@ type ListAliasesOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -210,10 +185,9 @@ var _ ListAliasesAPIClient = (*Client)(nil) type ListAliasesPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go index e56605b4f01..ab4acaffabd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go @@ -11,45 +11,29 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a list of all grants for the specified KMS key. -// -// You must specify the KMS key in all requests. You can filter the grant list by -// grant ID or grantee principal. -// -// For detailed information about grants, including grant terminology, see [Grants in KMS] in the -// Key Management Service Developer Guide . For examples of working with grants in -// several programming languages, see [Programming grants]. -// -// The GranteePrincipal field in the ListGrants response usually contains the user -// or role designated as the grantee principal in the grant. However, when the +// Gets a list of all grants for the specified KMS key. You must specify the KMS +// key in all requests. You can filter the grant list by grant ID or grantee +// principal. For detailed information about grants, including grant terminology, +// see Grants in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the Key Management Service Developer Guide . For examples of working with +// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html) +// . The GranteePrincipal field in the ListGrants response usually contains the +// user or role designated as the grantee principal in the grant. However, when the // grantee principal in the grant is an Amazon Web Services service, the -// GranteePrincipal field contains the [service principal], which might represent several different -// grantee principals. -// -// Cross-account use: Yes. To perform this operation on a KMS key in a different -// Amazon Web Services account, specify the key ARN in the value of the KeyId -// parameter. -// -// Required permissions: [kms:ListGrants] (key policy) -// -// Related operations: -// -// # CreateGrant -// -// # ListRetirableGrants -// -// # RetireGrant -// -// # RevokeGrant +// GranteePrincipal field contains the service principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) +// , which might represent several different grantee principals. Cross-account use: +// Yes. To perform this operation on a KMS key in a different Amazon Web Services +// account, specify the key ARN in the value of the KeyId parameter. Required +// permissions: kms:ListGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - CreateGrant +// - ListRetirableGrants +// - RetireGrant +// - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Programming grants]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html -// [service principal]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services -// [Grants in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html -// [kms:ListGrants]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListGrants(ctx context.Context, params *ListGrantsInput, optFns ...func(*Options)) (*ListGrantsOutput, error) { if params == nil { params = &ListGrantsInput{} @@ -68,18 +52,12 @@ func (c *Client) ListGrants(ctx context.Context, params *ListGrantsInput, optFns type ListGrantsInput struct { // Returns only grants for the specified KMS key. This parameter is required. - // // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN. - // - // For example: - // + // different Amazon Web Services account, you must use the key ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string @@ -94,10 +72,9 @@ type ListGrantsInput struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit *int32 // Use this parameter in a subsequent request after you receive a response with @@ -119,7 +96,7 @@ type ListGrantsOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -219,10 +196,9 @@ var _ ListGrantsAPIClient = (*Client)(nil) type ListGrantsPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go index 4983a9f67d7..604fbdfa58b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go @@ -11,26 +11,17 @@ import ( ) // Gets the names of the key policies that are attached to a KMS key. This -// operation is designed to get policy names that you can use in a GetKeyPolicyoperation. -// However, the only valid policy name is default . -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:ListKeyPolicies] (key policy) -// -// Related operations: -// -// # GetKeyPolicy -// -// [PutKeyPolicy] +// operation is designed to get policy names that you can use in a GetKeyPolicy +// operation. However, the only valid policy name is default . Cross-account use: +// No. You cannot perform this operation on a KMS key in a different Amazon Web +// Services account. Required permissions: kms:ListKeyPolicies (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - GetKeyPolicy +// - PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:ListKeyPolicies]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListKeyPolicies(ctx context.Context, params *ListKeyPoliciesInput, optFns ...func(*Options)) (*ListKeyPoliciesOutput, error) { if params == nil { params = &ListKeyPoliciesInput{} @@ -48,30 +39,21 @@ func (c *Client) ListKeyPolicies(ctx context.Context, params *ListKeyPoliciesInp type ListKeyPoliciesInput struct { - // Gets the names of key policies for the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Gets the names of key policies for the specified KMS key. Specify the key ID or + // key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. - // - // Only one policy can be attached to a key. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 1000, inclusive. If you do not include a value, it + // defaults to 100. Only one policy can be attached to a key. Limit *int32 // Use this parameter in a subsequent request after you receive a response with @@ -93,7 +75,7 @@ type ListKeyPoliciesOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -194,12 +176,9 @@ var _ ListKeyPoliciesAPIClient = (*Client)(nil) type ListKeyPoliciesPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. - // - // Only one policy can be attached to a key. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 1000, inclusive. If you do not include a value, it + // defaults to 100. Only one policy can be attached to a key. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go deleted file mode 100644 index 42da68b06b7..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package kms - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/kms/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns information about all completed key material rotations for the -// specified KMS key. -// -// You must specify the KMS key in all requests. You can refine the key rotations -// list by limiting the number of rotations returned. -// -// For detailed information about automatic and on-demand key rotations, see [Rotating KMS keys] in -// the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:ListKeyRotations] (key policy) -// -// Related operations: -// -// # EnableKeyRotation -// -// # DisableKeyRotation -// -// # GetKeyRotationStatus -// -// # RotateKeyOnDemand -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Rotating KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html -// [kms:ListKeyRotations]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -func (c *Client) ListKeyRotations(ctx context.Context, params *ListKeyRotationsInput, optFns ...func(*Options)) (*ListKeyRotationsOutput, error) { - if params == nil { - params = &ListKeyRotationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListKeyRotations", params, optFns, c.addOperationListKeyRotationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListKeyRotationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListKeyRotationsInput struct { - - // Gets the key rotations for the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // - // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // - Key ARN: - // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // This member is required. - KeyId *string - - // Use this parameter to specify the maximum number of items to return. When this - // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. - Limit *int32 - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextMarker from the truncated - // response you just received. - Marker *string - - noSmithyDocumentSerde -} - -type ListKeyRotationsOutput struct { - - // When Truncated is true, this element is present and contains the value to use - // for the Marker parameter in a subsequent request. - NextMarker *string - - // A list of completed key material rotations. - Rotations []types.RotationsListEntry - - // A flag that indicates whether there are more items in the list. When this value - // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a - // subsequent request. - Truncated bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListKeyRotationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListKeyRotations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListKeyRotations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListKeyRotations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpListKeyRotationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListKeyRotations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -// ListKeyRotationsAPIClient is a client that implements the ListKeyRotations -// operation. -type ListKeyRotationsAPIClient interface { - ListKeyRotations(context.Context, *ListKeyRotationsInput, ...func(*Options)) (*ListKeyRotationsOutput, error) -} - -var _ ListKeyRotationsAPIClient = (*Client)(nil) - -// ListKeyRotationsPaginatorOptions is the paginator options for ListKeyRotations -type ListKeyRotationsPaginatorOptions struct { - // Use this parameter to specify the maximum number of items to return. When this - // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListKeyRotationsPaginator is a paginator for ListKeyRotations -type ListKeyRotationsPaginator struct { - options ListKeyRotationsPaginatorOptions - client ListKeyRotationsAPIClient - params *ListKeyRotationsInput - nextToken *string - firstPage bool -} - -// NewListKeyRotationsPaginator returns a new ListKeyRotationsPaginator -func NewListKeyRotationsPaginator(client ListKeyRotationsAPIClient, params *ListKeyRotationsInput, optFns ...func(*ListKeyRotationsPaginatorOptions)) *ListKeyRotationsPaginator { - if params == nil { - params = &ListKeyRotationsInput{} - } - - options := ListKeyRotationsPaginatorOptions{} - if params.Limit != nil { - options.Limit = *params.Limit - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListKeyRotationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.Marker, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListKeyRotationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListKeyRotations page. -func (p *ListKeyRotationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyRotationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.Marker = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.Limit = limit - - result, err := p.client.ListKeyRotations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextMarker - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -func newServiceMetadataMiddleware_opListKeyRotations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListKeyRotations", - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go index 1b10793bbec..2a9165710b0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go @@ -12,28 +12,17 @@ import ( ) // Gets a list of all KMS keys in the caller's Amazon Web Services account and -// Region. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:ListKeys] (IAM policy) -// -// Related operations: -// -// # CreateKey -// -// # DescribeKey -// -// # ListAliases -// -// # ListResourceTags +// Region. Cross-account use: No. You cannot perform this operation on a KMS key in +// a different Amazon Web Services account. Required permissions: kms:ListKeys (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// - CreateKey +// - DescribeKey +// - ListAliases +// - ListResourceTags // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [kms:ListKeys]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListKeys(ctx context.Context, params *ListKeysInput, optFns ...func(*Options)) (*ListKeysOutput, error) { if params == nil { params = &ListKeysInput{} @@ -53,10 +42,9 @@ type ListKeysInput struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 1000, inclusive. If you do not include a value, it + // defaults to 100. Limit *int32 // Use this parameter in a subsequent request after you receive a response with @@ -78,7 +66,7 @@ type ListKeysOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -175,10 +163,9 @@ var _ ListKeysAPIClient = (*Client)(nil) type ListKeysPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 1000, - // inclusive. If you do not include a value, it defaults to 100. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 1000, inclusive. If you do not include a value, it + // defaults to 100. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go index 7e87bdef71f..f04cc827c52 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go @@ -11,34 +11,22 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns all tags on the specified KMS key. -// -// For general information about tags, including the format and syntax, see [Tagging Amazon Web Services resources] in -// the Amazon Web Services General Reference. For information about using tags in -// KMS, see [Tagging keys]. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:ListResourceTags] (key policy) -// -// Related operations: -// -// # CreateKey -// -// # ReplicateKey -// -// # TagResource -// -// # UntagResource +// Returns all tags on the specified KMS key. For general information about tags, +// including the format and syntax, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. For information about using tags +// in KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) +// . Cross-account use: No. You cannot perform this operation on a KMS key in a +// different Amazon Web Services account. Required permissions: +// kms:ListResourceTags (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// - CreateKey +// - ReplicateKey +// - TagResource +// - UntagResource // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Tagging keys]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html -// [kms:ListResourceTags]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListResourceTags(ctx context.Context, params *ListResourceTagsInput, optFns ...func(*Options)) (*ListResourceTagsOutput, error) { if params == nil { params = &ListResourceTagsInput{} @@ -56,36 +44,27 @@ func (c *Client) ListResourceTags(ctx context.Context, params *ListResourceTagsI type ListResourceTagsInput struct { - // Gets tags on the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Gets tags on the specified KMS key. Specify the key ID or key ARN of the KMS + // key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 50, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 50, inclusive. If you do not include a value, it defaults + // to 50. Limit *int32 // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated - // response you just received. - // - // Do not attempt to construct this value. Use only the value of NextMarker from - // the truncated response you just received. + // response you just received. Do not attempt to construct this value. Use only the + // value of NextMarker from the truncated response you just received. Marker *string noSmithyDocumentSerde @@ -94,22 +73,19 @@ type ListResourceTagsInput struct { type ListResourceTagsOutput struct { // When Truncated is true, this element is present and contains the value to use - // for the Marker parameter in a subsequent request. - // - // Do not assume or infer any information from this value. + // for the Marker parameter in a subsequent request. Do not assume or infer any + // information from this value. NextMarker *string - // A list of tags. Each tag consists of a tag key and a tag value. - // - // Tagging or untagging a KMS key can allow or deny permission to the KMS key. For - // details, see [ABAC for KMS]in the Key Management Service Developer Guide. - // - // [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html + // A list of tags. Each tag consists of a tag key and a tag value. Tagging or + // untagging a KMS key can allow or deny permission to the KMS key. For details, + // see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) + // in the Key Management Service Developer Guide. Tags []types.Tag // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -210,10 +186,9 @@ var _ ListResourceTagsAPIClient = (*Client)(nil) type ListResourceTagsPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 50, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 50, inclusive. If you do not include a value, it defaults + // to 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go index b0caa931cbf..68d96486ecd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go @@ -12,50 +12,36 @@ import ( ) // Returns information about all grants in the Amazon Web Services account and -// Region that have the specified retiring principal. -// -// You can specify any principal in your Amazon Web Services account. The grants -// that are returned include grants for KMS keys in your Amazon Web Services -// account and other Amazon Web Services accounts. You might use this operation to -// determine which grants you may retire. To retire a grant, use the RetireGrantoperation. -// -// For detailed information about grants, including grant terminology, see [Grants in KMS] in the -// Key Management Service Developer Guide . For examples of working with grants in -// several programming languages, see [Programming grants]. -// -// Cross-account use: You must specify a principal in your Amazon Web Services +// Region that have the specified retiring principal. You can specify any principal +// in your Amazon Web Services account. The grants that are returned include grants +// for KMS keys in your Amazon Web Services account and other Amazon Web Services +// accounts. You might use this operation to determine which grants you may retire. +// To retire a grant, use the RetireGrant operation. For detailed information +// about grants, including grant terminology, see Grants in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the Key Management Service Developer Guide . For examples of working with +// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html) +// . Cross-account use: You must specify a principal in your Amazon Web Services // account. This operation returns a list of grants where the retiring principal // specified in the ListRetirableGrants request is the same retiring principal on // the grant. This can include grants on KMS keys owned by other Amazon Web // Services accounts, but you do not need kms:ListRetirableGrants permission (or // any other additional permission) in any Amazon Web Services account other than -// your own. -// -// Required permissions: [kms:ListRetirableGrants] (IAM policy) in your Amazon Web Services account. -// -// KMS authorizes ListRetirableGrants requests by evaluating the caller account's +// your own. Required permissions: kms:ListRetirableGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) in your Amazon Web Services account. KMS authorizes +// ListRetirableGrants requests by evaluating the caller account's // kms:ListRetirableGrants permissions. The authorized resource in // ListRetirableGrants calls is the retiring principal specified in the request. // KMS does not evaluate the caller's permissions to verify their access to any KMS -// keys or grants that might be returned by the ListRetirableGrants call. -// -// Related operations: -// -// # CreateGrant -// -// # ListGrants -// -// # RetireGrant -// -// # RevokeGrant +// keys or grants that might be returned by the ListRetirableGrants call. Related +// operations: +// - CreateGrant +// - ListGrants +// - RetireGrant +// - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Programming grants]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html -// [kms:ListRetirableGrants]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Grants in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ListRetirableGrants(ctx context.Context, params *ListRetirableGrantsInput, optFns ...func(*Options)) (*ListRetirableGrantsOutput, error) { if params == nil { params = &ListRetirableGrantsInput{} @@ -74,25 +60,21 @@ func (c *Client) ListRetirableGrants(ctx context.Context, params *ListRetirableG type ListRetirableGrantsInput struct { // The retiring principal for which to list grants. Enter a principal in your - // Amazon Web Services account. - // - // To specify the retiring principal, use the [Amazon Resource Name (ARN)] of an Amazon Web Services - // principal. Valid principals include Amazon Web Services accounts, IAM users, IAM - // roles, federated users, and assumed role users. For help with the ARN syntax for - // a principal, see [IAM ARNs]in the Identity and Access Management User Guide . - // - // [IAM ARNs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns - // [Amazon Resource Name (ARN)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // Amazon Web Services account. To specify the retiring principal, use the Amazon + // Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // of an Amazon Web Services principal. Valid principals include Amazon Web + // Services accounts, IAM users, IAM roles, federated users, and assumed role + // users. For help with the ARN syntax for a principal, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns) + // in the Identity and Access Management User Guide . // // This member is required. RetiringPrincipal *string // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit *int32 // Use this parameter in a subsequent request after you receive a response with @@ -114,7 +96,7 @@ type ListRetirableGrantsOutput struct { // A flag that indicates whether there are more items in the list. When this value // is true, the list in this response is truncated. To get more items, pass the - // value of the NextMarker element in this response to the Marker parameter in a + // value of the NextMarker element in thisresponse to the Marker parameter in a // subsequent request. Truncated bool @@ -216,10 +198,9 @@ var _ ListRetirableGrantsAPIClient = (*Client)(nil) type ListRetirableGrantsPaginatorOptions struct { // Use this parameter to specify the maximum number of items to return. When this // value is present, KMS does not return more than the specified number of items, - // but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and 100, - // inclusive. If you do not include a value, it defaults to 50. + // but it might return fewer. This value is optional. If you include a value, it + // must be between 1 and 100, inclusive. If you do not include a value, it defaults + // to 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go index 492e0c40daa..4d9da0789f9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go @@ -10,29 +10,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches a key policy to the specified KMS key. -// -// For more information about key policies, see [Key Policies] in the Key Management Service -// Developer Guide. For help writing and formatting a JSON policy document, see the -// [IAM JSON Policy Reference]in the Identity and Access Management User Guide . For examples of adding a key -// policy in multiple programming languages, see [Setting a key policy]in the Key Management Service -// Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:PutKeyPolicy] (key policy) -// -// Related operations: GetKeyPolicy -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [IAM JSON Policy Reference]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html -// [kms:PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Setting a key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy -// [Key Policies]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// Attaches a key policy to the specified KMS key. For more information about key +// policies, see Key Policies (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) +// in the Key Management Service Developer Guide. For help writing and formatting a +// JSON policy document, see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) +// in the Identity and Access Management User Guide . For examples of adding a key +// policy in multiple programming languages, see Setting a key policy (https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: GetKeyPolicy Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) PutKeyPolicy(ctx context.Context, params *PutKeyPolicyInput, optFns ...func(*Options)) (*PutKeyPolicyOutput, error) { if params == nil { params = &PutKeyPolicyInput{} @@ -50,75 +40,53 @@ func (c *Client) PutKeyPolicy(ctx context.Context, params *PutKeyPolicyInput, op type PutKeyPolicyInput struct { - // Sets the key policy on the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Sets the key policy on the specified KMS key. Specify the key ID or key ARN of + // the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // The key policy to attach to the KMS key. - // - // The key policy must meet the following criteria: - // + // The key policy to attach to the KMS key. The key policy must meet the following + // criteria: // - The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS key - // becomes unmanageable. For more information, see [Default key policy]in the Key Management Service - // Developer Guide. (To omit this condition, set BypassPolicyLockoutSafetyCheck - // to true.) - // + // becomes unmanageable. For more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. (To omit this condition, set + // BypassPolicyLockoutSafetyCheck to true.) // - Each statement in the key policy must contain one or more principals. The // principals in the key policy must exist and be visible to KMS. When you create a // new Amazon Web Services principal, you might need to enforce a delay before // including the new principal in a key policy because the new principal might not - // be immediately visible to KMS. For more information, see [Changes that I make are not always immediately visible]in the Amazon Web - // Services Identity and Access Management User Guide. - // + // be immediately visible to KMS. For more information, see Changes that I make + // are not always immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) + // in the Amazon Web Services Identity and Access Management User Guide. // A key policy document can include only the following characters: - // // - Printable ASCII characters from the space character ( \u0020 ) through the // end of the ASCII character range. - // // - Printable characters in the Basic Latin and Latin-1 Supplement character // set (through \u00FF ). - // // - The tab ( \u0009 ), line feed ( \u000A ), and carriage return ( \u000D ) // special characters - // - // For information about key policies, see [Key policies in KMS] in the Key Management Service - // Developer Guide.For help writing and formatting a JSON policy document, see the [IAM JSON Policy Reference] + // For information about key policies, see Key policies in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // in the Key Management Service Developer Guide.For help writing and formatting a + // JSON policy document, see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) // in the Identity and Access Management User Guide . // - // [Key policies in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html - // [IAM JSON Policy Reference]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key - // [Changes that I make are not always immediately visible]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency - // // This member is required. Policy *string // Skips ("bypasses") the key policy lockout safety check. The default value is - // false. - // - // Setting this value to true increases the risk that the KMS key becomes - // unmanageable. Do not set this value to true indiscriminately. - // - // For more information, see [Default key policy] in the Key Management Service Developer Guide. - // - // Use this parameter only when you intend to prevent the principal that is making - // the request from making a subsequent [PutKeyPolicy]request on the KMS key. - // - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key - // [PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html + // false. Setting this value to true increases the risk that the KMS key becomes + // unmanageable. Do not set this value to true indiscriminately. For more + // information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. Use this parameter only when you + // intend to prevent the principal that is making the request from making a + // subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) + // request on the KMS key. BypassPolicyLockoutSafetyCheck bool // The name of the key policy. If no policy name is specified, the default value diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go index 8eca789a2e6..cbcd4c4934e 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go @@ -13,24 +13,24 @@ import ( // Decrypts ciphertext and then reencrypts it entirely within KMS. You can use // this operation to change the KMS key under which data is encrypted, such as when -// you [manually rotate]a KMS key or change the KMS key that protects a ciphertext. You can also -// use it to reencrypt ciphertext under the same KMS key, such as to change the [encryption context]of -// a ciphertext. -// -// The ReEncrypt operation can decrypt ciphertext that was encrypted by using a -// KMS key in an KMS operation, such as Encryptor GenerateDataKey. It can also decrypt ciphertext that -// was encrypted by using the public key of an [asymmetric KMS key]outside of KMS. However, it cannot -// decrypt ciphertext produced by other libraries, such as the [Amazon Web Services Encryption SDK]or [Amazon S3 client-side encryption]. These -// libraries return a ciphertext format that is incompatible with KMS. -// -// When you use the ReEncrypt operation, you need to provide information for the +// you manually rotate (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually) +// a KMS key or change the KMS key that protects a ciphertext. You can also use it +// to reencrypt ciphertext under the same KMS key, such as to change the +// encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// of a ciphertext. The ReEncrypt operation can decrypt ciphertext that was +// encrypted by using a KMS key in an KMS operation, such as Encrypt or +// GenerateDataKey . It can also decrypt ciphertext that was encrypted by using the +// public key of an asymmetric KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks) +// outside of KMS. However, it cannot decrypt ciphertext produced by other +// libraries, such as the Amazon Web Services Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) +// or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html) +// . These libraries return a ciphertext format that is incompatible with KMS. When +// you use the ReEncrypt operation, you need to provide information for the // decrypt operation and the subsequent encrypt operation. -// // - If your ciphertext was encrypted under an asymmetric KMS key, you must use // the SourceKeyId parameter to identify the KMS key that encrypted the // ciphertext. You must also supply the encryption algorithm that was used. This // information is required to decrypt the data. -// // - If your ciphertext was encrypted under a symmetric encryption KMS key, the // SourceKeyId parameter is optional. KMS can get this information from metadata // that it adds to the symmetric ciphertext blob. This feature adds durability to @@ -41,72 +41,46 @@ import ( // KMS key you specify. If the ciphertext was encrypted under a different KMS key, // the ReEncrypt operation fails. This practice ensures that you use the KMS key // that you intend. -// // - To reencrypt the data, you must use the DestinationKeyId parameter to // specify the KMS key that re-encrypts the data after it is decrypted. If the // destination KMS key is an asymmetric KMS key, you must also provide the // encryption algorithm. The algorithm that you choose must be compatible with the -// KMS key. -// -// When you use an asymmetric KMS key to encrypt or reencrypt data, be sure to -// -// record the KMS key and encryption algorithm that you choose. You will be -// required to provide the same KMS key and encryption algorithm when you decrypt -// the data. If the KMS key and algorithm do not match the values used to encrypt -// the data, the decrypt operation fails. -// -// You are not required to supply the key ID and encryption algorithm when you -// -// decrypt with symmetric encryption KMS keys because KMS stores this information -// in the ciphertext blob. KMS cannot store metadata in ciphertext generated with -// asymmetric keys. The standard format for asymmetric key ciphertext does not -// include configurable fields. +// KMS key. When you use an asymmetric KMS key to encrypt or reencrypt data, be +// sure to record the KMS key and encryption algorithm that you choose. You will be +// required to provide the same KMS key and encryption algorithm when you decrypt +// the data. If the KMS key and algorithm do not match the values used to encrypt +// the data, the decrypt operation fails. You are not required to supply the key ID +// and encryption algorithm when you decrypt with symmetric encryption KMS keys +// because KMS stores this information in the ciphertext blob. KMS cannot store +// metadata in ciphertext generated with asymmetric keys. The standard format for +// asymmetric key ciphertext does not include configurable fields. // // The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. The source KMS key and destination KMS key can be in -// different Amazon Web Services accounts. Either or both KMS keys can be in a -// different account than the caller. To specify a KMS key in a different account, -// you must use its key ARN or alias ARN. -// -// Required permissions: -// -// [kms:ReEncryptFrom] -// - permission on the source KMS key (key policy) -// -// [kms:ReEncryptTo] -// - permission on the destination KMS key (key policy) +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. The +// source KMS key and destination KMS key can be in different Amazon Web Services +// accounts. Either or both KMS keys can be in a different account than the caller. +// To specify a KMS key in a different account, you must use its key ARN or alias +// ARN. Required permissions: +// - kms:ReEncryptFrom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the source KMS key (key policy) +// - kms:ReEncryptTo (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the destination KMS key (key policy) // // To permit reencryption from or to a KMS key, include the "kms:ReEncrypt*" -// permission in your [key policy]. This permission is automatically included in the key -// policy when you use the console to create a KMS key. But you must include it -// manually when you create a KMS key programmatically or when you use the PutKeyPolicy -// operation to set a key policy. -// -// Related operations: -// -// # Decrypt -// -// # Encrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyPair +// permission in your key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) +// . This permission is automatically included in the key policy when you use the +// console to create a KMS key. But you must include it manually when you create a +// KMS key programmatically or when you use the PutKeyPolicy operation to set a +// key policy. Related operations: +// - Decrypt +// - Encrypt +// - GenerateDataKey +// - GenerateDataKeyPair // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Amazon Web Services Encryption SDK]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/ -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [asymmetric KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks -// [key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html -// [Amazon S3 client-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html -// [kms:ReEncryptTo]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [manually rotate]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually -// [kms:ReEncryptFrom]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ReEncrypt(ctx context.Context, params *ReEncryptInput, optFns ...func(*Options)) (*ReEncryptOutput, error) { if params == nil { params = &ReEncryptInput{} @@ -131,135 +105,94 @@ type ReEncryptInput struct { // A unique identifier for the KMS key that is used to reencrypt the data. Specify // a symmetric encryption KMS key or an asymmetric KMS key with a KeyUsage value - // of ENCRYPT_DECRYPT . To find the KeyUsage value of a KMS key, use the DescribeKey - // operation. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // of ENCRYPT_DECRYPT . To find the KeyUsage value of a KMS key, use the + // DescribeKey operation. To specify a KMS key, use its key ID, key ARN, alias + // name, or alias ARN. When using an alias name, prefix it with "alias/" . To + // specify a KMS key in a different Amazon Web Services account, you must use the + // key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. DestinationKeyId *string // Specifies the encryption algorithm that KMS will use to reecrypt the data after // it has decrypted it. The default value, SYMMETRIC_DEFAULT , represents the - // encryption algorithm used for symmetric encryption KMS keys. - // - // This parameter is required only when the destination KMS key is an asymmetric - // KMS key. + // encryption algorithm used for symmetric encryption KMS keys. This parameter is + // required only when the destination KMS key is an asymmetric KMS key. DestinationEncryptionAlgorithm types.EncryptionAlgorithmSpec - // Specifies that encryption context to use when the reencrypting the data. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // A destination encryption context is valid only when the destination KMS key is - // a symmetric encryption KMS key. The standard ciphertext format for asymmetric - // KMS keys does not include fields for metadata. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric - // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // Specifies that encryption context to use when the reencrypting the data. Do not + // include confidential or sensitive information in this field. This field may be + // displayed in plaintext in CloudTrail logs and other output. A destination + // encryption context is valid only when the destination KMS key is a symmetric + // encryption KMS key. The standard ciphertext format for asymmetric KMS keys does + // not include fields for metadata. An encryption context is a collection of + // non-secret key-value pairs that represent additional authenticated data. When + // you use an encryption context to encrypt data, you must specify the same (an + // exact case-sensitive match) encryption context to decrypt the data. An + // encryption context is supported only on operations with symmetric encryption KMS + // keys. On operations with symmetric encryption KMS keys, an encryption context is + // optional, but it is strongly recommended. For more information, see Encryption + // context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. DestinationEncryptionContext map[string]string - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // Specifies the encryption algorithm that KMS will use to decrypt the ciphertext // before it is reencrypted. The default value, SYMMETRIC_DEFAULT , represents the - // algorithm used for symmetric encryption KMS keys. - // - // Specify the same algorithm that was used to encrypt the ciphertext. If you - // specify a different algorithm, the decrypt attempt fails. - // - // This parameter is required only when the ciphertext was encrypted under an - // asymmetric KMS key. + // algorithm used for symmetric encryption KMS keys. Specify the same algorithm + // that was used to encrypt the ciphertext. If you specify a different algorithm, + // the decrypt attempt fails. This parameter is required only when the ciphertext + // was encrypted under an asymmetric KMS key. SourceEncryptionAlgorithm types.EncryptionAlgorithmSpec // Specifies the encryption context to use to decrypt the ciphertext. Enter the - // same encryption context that was used to encrypt the ciphertext. - // - // An encryption context is a collection of non-secret key-value pairs that - // represent additional authenticated data. When you use an encryption context to - // encrypt data, you must specify the same (an exact case-sensitive match) - // encryption context to decrypt the data. An encryption context is supported only - // on operations with symmetric encryption KMS keys. On operations with symmetric - // encryption KMS keys, an encryption context is optional, but it is strongly - // recommended. - // - // For more information, see [Encryption context] in the Key Management Service Developer Guide. - // - // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + // same encryption context that was used to encrypt the ciphertext. An encryption + // context is a collection of non-secret key-value pairs that represent additional + // authenticated data. When you use an encryption context to encrypt data, you must + // specify the same (an exact case-sensitive match) encryption context to decrypt + // the data. An encryption context is supported only on operations with symmetric + // encryption KMS keys. On operations with symmetric encryption KMS keys, an + // encryption context is optional, but it is strongly recommended. For more + // information, see Encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the Key Management Service Developer Guide. SourceEncryptionContext map[string]string // Specifies the KMS key that KMS will use to decrypt the ciphertext before it is - // re-encrypted. - // - // Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you - // identify a different KMS key, the ReEncrypt operation throws an - // IncorrectKeyException . - // - // This parameter is required only when the ciphertext was encrypted under an - // asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the - // KMS key from metadata that it adds to the symmetric ciphertext blob. However, it - // is always recommended as a best practice. This practice ensures that you use the - // KMS key that you intend. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // re-encrypted. Enter a key ID of the KMS key that was used to encrypt the + // ciphertext. If you identify a different KMS key, the ReEncrypt operation throws + // an IncorrectKeyException . This parameter is required only when the ciphertext + // was encrypted under an asymmetric KMS key. If you used a symmetric encryption + // KMS key, KMS can get the KMS key from metadata that it adds to the symmetric + // ciphertext blob. However, it is always recommended as a best practice. This + // practice ensures that you use the KMS key that you intend. To specify a KMS key, + // use its key ID, key ARN, alias name, or alias ARN. When using an alias name, + // prefix it with "alias/" . To specify a KMS key in a different Amazon Web + // Services account, you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . SourceKeyId *string noSmithyDocumentSerde @@ -274,9 +207,8 @@ type ReEncryptOutput struct { // The encryption algorithm that was used to reencrypt the data. DestinationEncryptionAlgorithm types.EncryptionAlgorithmSpec - // The Amazon Resource Name ([key ARN] ) of the KMS key that was used to reencrypt the data. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key that was used to reencrypt the data. KeyId *string // The encryption algorithm that was used to decrypt the ciphertext before it was diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go index 2f6e7ae15c4..4eb5fc4cceb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go @@ -15,24 +15,29 @@ import ( // a multi-Region replica key based on a multi-Region primary key in a different // Region of the same Amazon Web Services partition. You can create multiple // replicas of a primary key, but each must be in a different Region. To create a -// multi-Region primary key, use the CreateKeyoperation. -// -// This operation supports multi-Region keys, an KMS feature that lets you create -// multiple interoperable KMS keys in different Amazon Web Services Regions. -// Because these KMS keys have the same key ID, key material, and other metadata, -// you can use them interchangeably to encrypt data in one Amazon Web Services -// Region and decrypt it in a different Amazon Web Services Region without -// re-encrypting the data or making a cross-Region call. For more information about -// multi-Region keys, see [Multi-Region keys in KMS]in the Key Management Service Developer Guide. -// -// A replica key is a fully-functional KMS key that can be used independently of -// its primary and peer replica keys. A primary key and its replica keys share -// properties that make them interoperable. They have the same [key ID]and key material. -// They also have the same [key spec], [key usage], [key material origin], and [automatic key rotation status]. KMS automatically synchronizes these shared -// properties among related multi-Region keys. All other properties of a replica -// key can differ, including its [key policy], [tags], [aliases], and [Key states of KMS keys]. KMS pricing and quotas for KMS keys -// apply to each primary key and replica key. -// +// multi-Region primary key, use the CreateKey operation. This operation supports +// multi-Region keys, an KMS feature that lets you create multiple interoperable +// KMS keys in different Amazon Web Services Regions. Because these KMS keys have +// the same key ID, key material, and other metadata, you can use them +// interchangeably to encrypt data in one Amazon Web Services Region and decrypt it +// in a different Amazon Web Services Region without re-encrypting the data or +// making a cross-Region call. For more information about multi-Region keys, see +// Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) +// in the Key Management Service Developer Guide. A replica key is a +// fully-functional KMS key that can be used independently of its primary and peer +// replica keys. A primary key and its replica keys share properties that make them +// interoperable. They have the same key ID (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) +// and key material. They also have the same key spec (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec) +// , key usage (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage) +// , key material origin (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin) +// , and automatic key rotation status (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) +// . KMS automatically synchronizes these shared properties among related +// multi-Region keys. All other properties of a replica key can differ, including +// its key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) +// , tags (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) +// , aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) +// , and Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// . KMS pricing and quotas for KMS keys apply to each primary key and replica key. // When this operation completes, the new replica key has a transient key state of // Creating . This key state changes to Enabled (or PendingImport ) after a few // seconds when the process of creating the new replica key is complete. While the @@ -40,64 +45,39 @@ import ( // cryptographic operations. If you are creating and using the replica key // programmatically, retry on KMSInvalidStateException or call DescribeKey to // check its KeyState value before using it. For details about the Creating key -// state, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// You cannot create more than one replica of a primary key in any Region. If the -// Region already includes a replica of the key you're trying to replicate, -// ReplicateKey returns an AlreadyExistsException error. If the key state of the -// existing replica is PendingDeletion , you can cancel the scheduled key deletion (CancelKeyDeletion +// state, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. You cannot create more than one +// replica of a primary key in any Region. If the Region already includes a replica +// of the key you're trying to replicate, ReplicateKey returns an +// AlreadyExistsException error. If the key state of the existing replica is +// PendingDeletion , you can cancel the scheduled key deletion ( CancelKeyDeletion // ) or wait for the key to be deleted. The new replica key you create will have -// the same [shared properties]as the original replica key. -// -// The CloudTrail log of a ReplicateKey operation records a ReplicateKey operation -// in the primary key's Region and a CreateKeyoperation in the replica key's Region. -// -// If you replicate a multi-Region primary key with imported key material, the -// replica key is created with no key material. You must import the same key -// material that you imported into the primary key. For details, see [Importing key material into multi-Region keys]in the Key -// Management Service Developer Guide. -// -// To convert a replica key to a primary key, use the UpdatePrimaryRegion operation. -// -// ReplicateKey uses different default values for the KeyPolicy and Tags -// parameters than those used in the KMS console. For details, see the parameter -// descriptions. -// -// Cross-account use: No. You cannot use this operation to create a replica key in -// a different Amazon Web Services account. -// -// Required permissions: -// +// the same shared properties (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-sync-properties) +// as the original replica key. The CloudTrail log of a ReplicateKey operation +// records a ReplicateKey operation in the primary key's Region and a CreateKey +// operation in the replica key's Region. If you replicate a multi-Region primary +// key with imported key material, the replica key is created with no key material. +// You must import the same key material that you imported into the primary key. +// For details, see Importing key material into multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html) +// in the Key Management Service Developer Guide. To convert a replica key to a +// primary key, use the UpdatePrimaryRegion operation. ReplicateKey uses different +// default values for the KeyPolicy and Tags parameters than those used in the KMS +// console. For details, see the parameter descriptions. Cross-account use: No. You +// cannot use this operation to create a replica key in a different Amazon Web +// Services account. Required permissions: // - kms:ReplicateKey on the primary key (in the primary key's Region). Include // this permission in the primary key's key policy. -// // - kms:CreateKey in an IAM policy in the replica Region. -// // - To use the Tags parameter, kms:TagResource in an IAM policy in the replica // Region. // -// # Related operations -// -// # CreateKey -// -// # UpdatePrimaryRegion +// Related operations +// - CreateKey +// - UpdatePrimaryRegion // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [key ID]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id -// [automatic key rotation status]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html -// [aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html -// [key usage]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage -// [Multi-Region keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html -// [key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [tags]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [key spec]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec -// [Importing key material into multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html -// [key material origin]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin -// [shared properties]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-sync-properties +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ReplicateKey(ctx context.Context, params *ReplicateKeyInput, optFns ...func(*Options)) (*ReplicateKeyOutput, error) { if params == nil { params = &ReplicateKeyInput{} @@ -116,150 +96,108 @@ func (c *Client) ReplicateKey(ctx context.Context, params *ReplicateKeyInput, op type ReplicateKeyInput struct { // Identifies the multi-Region primary key that is being replicated. To determine - // whether a KMS key is a multi-Region primary key, use the DescribeKeyoperation to check the - // value of the MultiRegionKeyType property. - // - // Specify the key ID or key ARN of a multi-Region primary key. - // - // For example: - // + // whether a KMS key is a multi-Region primary key, use the DescribeKey operation + // to check the value of the MultiRegionKeyType property. Specify the key ID or + // key ARN of a multi-Region primary key. For example: // - Key ID: mrk-1234abcd12ab34cd56ef1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // The Region ID of the Amazon Web Services Region for this replica key. - // - // Enter the Region ID, such as us-east-1 or ap-southeast-2 . For a list of Amazon - // Web Services Regions in which KMS is supported, see [KMS service endpoints]in the Amazon Web Services - // General Reference. - // - // HMAC KMS keys are not supported in all Amazon Web Services Regions. If you try - // to replicate an HMAC KMS key in an Amazon Web Services Region in which HMAC keys - // are not supported, the ReplicateKey operation returns an - // UnsupportedOperationException . For a list of Regions in which HMAC KMS keys are - // supported, see [HMAC keys in KMS]in the Key Management Service Developer Guide. - // - // The replica must be in a different Amazon Web Services Region than its primary - // key and other replicas of that primary key, but in the same Amazon Web Services - // partition. KMS must be available in the replica Region. If the Region is not - // enabled by default, the Amazon Web Services account must be enabled in the - // Region. For information about Amazon Web Services partitions, see [Amazon Resource Names (ARNs)]in the Amazon - // Web Services General Reference. For information about enabling and disabling - // Regions, see [Enabling a Region]and [Disabling a Region] in the Amazon Web Services General Reference. - // - // [Disabling a Region]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable - // [Enabling a Region]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable - // [KMS service endpoints]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region - // [HMAC keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html - // [Amazon Resource Names (ARNs)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // The Region ID of the Amazon Web Services Region for this replica key. Enter the + // Region ID, such as us-east-1 or ap-southeast-2 . For a list of Amazon Web + // Services Regions in which KMS is supported, see KMS service endpoints (https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region) + // in the Amazon Web Services General Reference. HMAC KMS keys are not supported in + // all Amazon Web Services Regions. If you try to replicate an HMAC KMS key in an + // Amazon Web Services Region in which HMAC keys are not supported, the + // ReplicateKey operation returns an UnsupportedOperationException . For a list of + // Regions in which HMAC KMS keys are supported, see HMAC keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) + // in the Key Management Service Developer Guide. The replica must be in a + // different Amazon Web Services Region than its primary key and other replicas of + // that primary key, but in the same Amazon Web Services partition. KMS must be + // available in the replica Region. If the Region is not enabled by default, the + // Amazon Web Services account must be enabled in the Region. For information about + // Amazon Web Services partitions, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. For information about enabling and + // disabling Regions, see Enabling a Region (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable) + // and Disabling a Region (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable) + // in the Amazon Web Services General Reference. // // This member is required. ReplicaRegion *string // Skips ("bypasses") the key policy lockout safety check. The default value is - // false. - // - // Setting this value to true increases the risk that the KMS key becomes - // unmanageable. Do not set this value to true indiscriminately. - // - // For more information, see [Default key policy] in the Key Management Service Developer Guide. - // - // Use this parameter only when you intend to prevent the principal that is making - // the request from making a subsequent [PutKeyPolicy]request on the KMS key. - // - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key - // [PutKeyPolicy]: https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html + // false. Setting this value to true increases the risk that the KMS key becomes + // unmanageable. Do not set this value to true indiscriminately. For more + // information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. Use this parameter only when you + // intend to prevent the principal that is making the request from making a + // subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) + // request on the KMS key. BypassPolicyLockoutSafetyCheck bool // A description of the KMS key. The default value is an empty string (no - // description). - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // The description is not a shared property of multi-Region keys. You can specify - // the same description or a different description for each key in a set of related - // multi-Region keys. KMS does not synchronize this property. + // description). Do not include confidential or sensitive information in this + // field. This field may be displayed in plaintext in CloudTrail logs and other + // output. The description is not a shared property of multi-Region keys. You can + // specify the same description or a different description for each key in a set of + // related multi-Region keys. KMS does not synchronize this property. Description *string // The key policy to attach to the KMS key. This parameter is optional. If you do - // not provide a key policy, KMS attaches the [default key policy]to the KMS key. - // - // The key policy is not a shared property of multi-Region keys. You can specify - // the same key policy or a different key policy for each key in a set of related - // multi-Region keys. KMS does not synchronize this property. - // - // If you provide a key policy, it must meet the following criteria: - // + // not provide a key policy, KMS attaches the default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) + // to the KMS key. The key policy is not a shared property of multi-Region keys. + // You can specify the same key policy or a different key policy for each key in a + // set of related multi-Region keys. KMS does not synchronize this property. If you + // provide a key policy, it must meet the following criteria: // - The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS key - // becomes unmanageable. For more information, see [Default key policy]in the Key Management Service - // Developer Guide. (To omit this condition, set BypassPolicyLockoutSafetyCheck - // to true.) - // + // becomes unmanageable. For more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + // in the Key Management Service Developer Guide. (To omit this condition, set + // BypassPolicyLockoutSafetyCheck to true.) // - Each statement in the key policy must contain one or more principals. The // principals in the key policy must exist and be visible to KMS. When you create a // new Amazon Web Services principal, you might need to enforce a delay before // including the new principal in a key policy because the new principal might not - // be immediately visible to KMS. For more information, see [Changes that I make are not always immediately visible]in the Amazon Web - // Services Identity and Access Management User Guide. - // + // be immediately visible to KMS. For more information, see Changes that I make + // are not always immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) + // in the Amazon Web Services Identity and Access Management User Guide. // A key policy document can include only the following characters: - // // - Printable ASCII characters from the space character ( \u0020 ) through the // end of the ASCII character range. - // // - Printable characters in the Basic Latin and Latin-1 Supplement character // set (through \u00FF ). - // // - The tab ( \u0009 ), line feed ( \u000A ), and carriage return ( \u000D ) // special characters - // - // For information about key policies, see [Key policies in KMS] in the Key Management Service - // Developer Guide. For help writing and formatting a JSON policy document, see the - // [IAM JSON Policy Reference]in the Identity and Access Management User Guide . - // - // [Key policies in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html - // [default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default - // [IAM JSON Policy Reference]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html - // [Default key policy]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key - // [Changes that I make are not always immediately visible]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency + // For information about key policies, see Key policies in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // in the Key Management Service Developer Guide. For help writing and formatting a + // JSON policy document, see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) + // in the Identity and Access Management User Guide . Policy *string // Assigns one or more tags to the replica key. Use this parameter to tag the KMS - // key when it is created. To tag an existing KMS key, use the TagResourceoperation. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // + // key when it is created. To tag an existing KMS key, use the TagResource + // operation. Do not include confidential or sensitive information in this field. + // This field may be displayed in plaintext in CloudTrail logs and other output. // Tagging or untagging a KMS key can allow or deny permission to the KMS key. For - // details, see [ABAC for KMS]in the Key Management Service Developer Guide. - // - // To use this parameter, you must have [kms:TagResource] permission in an IAM policy. - // - // Tags are not a shared property of multi-Region keys. You can specify the same - // tags or different tags for each key in a set of related multi-Region keys. KMS - // does not synchronize this property. - // - // Each tag consists of a tag key and a tag value. Both the tag key and the tag - // value are required, but the tag value can be an empty (null) string. You cannot - // have more than one tag on a KMS key with the same tag key. If you specify an - // existing tag key with a different tag value, KMS replaces the current tag value - // with the specified one. - // - // When you add tags to an Amazon Web Services resource, Amazon Web Services - // generates a cost allocation report with usage and costs aggregated by tags. Tags - // can also be used to control access to a KMS key. For details, see [Tagging Keys]. - // - // [kms:TagResource]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html - // [Tagging Keys]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html - // [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html + // details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) + // in the Key Management Service Developer Guide. To use this parameter, you must + // have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) + // permission in an IAM policy. Tags are not a shared property of multi-Region + // keys. You can specify the same tags or different tags for each key in a set of + // related multi-Region keys. KMS does not synchronize this property. Each tag + // consists of a tag key and a tag value. Both the tag key and the tag value are + // required, but the tag value can be an empty (null) string. You cannot have more + // than one tag on a KMS key with the same tag key. If you specify an existing tag + // key with a different tag value, KMS replaces the current tag value with the + // specified one. When you add tags to an Amazon Web Services resource, Amazon Web + // Services generates a cost allocation report with usage and costs aggregated by + // tags. Tags can also be used to control access to a KMS key. For details, see + // Tagging Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) + // . Tags []types.Tag noSmithyDocumentSerde @@ -267,12 +205,11 @@ type ReplicateKeyInput struct { type ReplicateKeyOutput struct { - // Displays details about the new replica key, including its Amazon Resource Name ([key ARN] - // ) and [Key states of KMS keys]. It also includes the ARN and Amazon Web Services Region of its primary - // key and other replica keys. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN - // [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html + // Displays details about the new replica key, including its Amazon Resource Name ( + // key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) and Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) + // . It also includes the ARN and Amazon Web Services Region of its primary key and + // other replica keys. ReplicaKeyMetadata *types.KeyMetadata // The key policy of the new replica key. The value is a key policy document in diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go index df3e02ef06b..e52867b2461 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go @@ -11,44 +11,30 @@ import ( ) // Deletes a grant. Typically, you retire a grant when you no longer need its -// permissions. To identify the grant to retire, use a [grant token], or both the grant ID and -// a key identifier (key ID or key ARN) of the KMS key. The CreateGrantoperation returns both -// values. -// -// This operation can be called by the retiring principal for a grant, by the -// grantee principal if the grant allows the RetireGrant operation, and by the -// Amazon Web Services account in which the grant is created. It can also be called -// by principals to whom permission for retiring a grant is delegated. For details, -// see [Retiring and revoking grants]in the Key Management Service Developer Guide. -// -// For detailed information about grants, including grant terminology, see [Grants in KMS] in the -// Key Management Service Developer Guide . For examples of working with grants in -// several programming languages, see [Programming grants]. -// -// Cross-account use: Yes. You can retire a grant on a KMS key in a different -// Amazon Web Services account. -// -// Required permissions: Permission to retire a grant is determined primarily by -// the grant. For details, see [Retiring and revoking grants]in the Key Management Service Developer Guide. -// -// Related operations: -// -// # CreateGrant -// -// # ListGrants -// -// # ListRetirableGrants -// -// # RevokeGrant +// permissions. To identify the grant to retire, use a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) +// , or both the grant ID and a key identifier (key ID or key ARN) of the KMS key. +// The CreateGrant operation returns both values. This operation can be called by +// the retiring principal for a grant, by the grantee principal if the grant allows +// the RetireGrant operation, and by the Amazon Web Services account in which the +// grant is created. It can also be called by principals to whom permission for +// retiring a grant is delegated. For details, see Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) +// in the Key Management Service Developer Guide. For detailed information about +// grants, including grant terminology, see Grants in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the Key Management Service Developer Guide . For examples of working with +// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html) +// . Cross-account use: Yes. You can retire a grant on a KMS key in a different +// Amazon Web Services account. Required permissions: Permission to retire a grant +// is determined primarily by the grant. For details, see Retiring and revoking +// grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) +// in the Key Management Service Developer Guide. Related operations: +// - CreateGrant +// - ListGrants +// - ListRetirableGrants +// - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Programming grants]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html -// [grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token -// [Retiring and revoking grants]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete -// [Grants in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) RetireGrant(ctx context.Context, params *RetireGrantInput, optFns ...func(*Options)) (*RetireGrantOutput, error) { if params == nil { params = &RetireGrantInput{} @@ -66,34 +52,26 @@ func (c *Client) RetireGrant(ctx context.Context, params *RetireGrantInput, optF type RetireGrantInput struct { - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // Identifies the grant to retire. To get the grant ID, use CreateGrant, ListGrants, or ListRetirableGrants. - // + // Identifies the grant to retire. To get the grant ID, use CreateGrant , + // ListGrants , or ListRetirableGrants . // - Grant ID Example - // 0123456789012345678901234567890123456789012345678901234567890123 GrantId *string // Identifies the grant to be retired. You can use a grant token to identify a new - // grant even before it has achieved eventual consistency. - // - // Only the CreateGrant operation returns a grant token. For details, see [Grant token] and [Eventual consistency] in the Key - // Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency + // grant even before it has achieved eventual consistency. Only the CreateGrant + // operation returns a grant token. For details, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency) + // in the Key Management Service Developer Guide. GrantToken *string - // The key ARN KMS key associated with the grant. To find the key ARN, use the ListKeys - // operation. - // - // For example: + // The key ARN KMS key associated with the grant. To find the key ARN, use the + // ListKeys operation. For example: // arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go index 582f5dbe47a..ca1a1eceb76 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go @@ -11,43 +11,27 @@ import ( ) // Deletes the specified grant. You revoke a grant to terminate the permissions -// that the grant allows. For more information, see [Retiring and revoking grants]in the Key Management Service -// Developer Guide . -// -// When you create, retire, or revoke a grant, there might be a brief delay, -// usually less than five minutes, until the grant is available throughout KMS. -// This state is known as eventual consistency. For details, see [Eventual consistency]in the Key -// Management Service Developer Guide . -// -// For detailed information about grants, including grant terminology, see [Grants in KMS] in the -// Key Management Service Developer Guide . For examples of working with grants in -// several programming languages, see [Programming grants]. -// -// Cross-account use: Yes. To perform this operation on a KMS key in a different +// that the grant allows. For more information, see Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) +// in the Key Management Service Developer Guide . When you create, retire, or +// revoke a grant, there might be a brief delay, usually less than five minutes, +// until the grant is available throughout KMS. This state is known as eventual +// consistency. For details, see Eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency) +// in the Key Management Service Developer Guide . For detailed information about +// grants, including grant terminology, see Grants in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the Key Management Service Developer Guide . For examples of working with +// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html) +// . Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId -// parameter. -// -// Required permissions: [kms:RevokeGrant] (key policy). -// -// Related operations: -// -// # CreateGrant -// -// # ListGrants -// -// # ListRetirableGrants -// -// # RetireGrant +// parameter. Required permissions: kms:RevokeGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy). Related operations: +// - CreateGrant +// - ListGrants +// - ListRetirableGrants +// - RetireGrant // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency -// [Programming grants]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html -// [kms:RevokeGrant]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [Retiring and revoking grants]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete -// [Grants in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) RevokeGrant(ctx context.Context, params *RevokeGrantInput, optFns ...func(*Options)) (*RevokeGrantOutput, error) { if params == nil { params = &RevokeGrantInput{} @@ -65,35 +49,27 @@ func (c *Client) RevokeGrant(ctx context.Context, params *RevokeGrantInput, optF type RevokeGrantInput struct { - // Identifies the grant to revoke. To get the grant ID, use CreateGrant, ListGrants, or ListRetirableGrants. + // Identifies the grant to revoke. To get the grant ID, use CreateGrant , + // ListGrants , or ListRetirableGrants . // // This member is required. GrantId *string // A unique identifier for the KMS key associated with the grant. To get the key - // ID and key ARN for a KMS key, use ListKeysor DescribeKey. - // - // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN. - // - // For example: - // + // ID and key ARN for a KMS key, use ListKeys or DescribeKey . Specify the key ID + // or key ARN of the KMS key. To specify a KMS key in a different Amazon Web + // Services account, you must use the key ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go deleted file mode 100644 index e54b429e78a..00000000000 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package kms - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Immediately initiates rotation of the key material of the specified symmetric -// encryption KMS key. -// -// You can perform [on-demand rotation] of the key material in customer managed KMS keys, regardless -// of whether or not [automatic key rotation]is enabled. On-demand rotations do not change existing -// automatic rotation schedules. For example, consider a KMS key that has automatic -// key rotation enabled with a rotation period of 730 days. If the key is scheduled -// to automatically rotate on April 14, 2024, and you perform an on-demand rotation -// on April 10, 2024, the key will automatically rotate, as scheduled, on April 14, -// 2024 and every 730 days thereafter. -// -// You can perform on-demand key rotation a maximum of 10 times per KMS key. You -// can use the KMS console to view the number of remaining on-demand rotations -// available for a KMS key. -// -// You can use GetKeyRotationStatus to identify any in progress on-demand rotations. You can use ListKeyRotations to -// identify the date that completed on-demand rotations were performed. You can -// monitor rotation of the key material for your KMS keys in CloudTrail and Amazon -// CloudWatch. -// -// On-demand key rotation is supported only on [symmetric encryption KMS keys]. You cannot perform on-demand -// rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To perform on-demand -// rotation of a set of related [multi-Region keys], invoke the on-demand rotation on the primary key. -// -// You cannot initiate on-demand rotation of [Amazon Web Services managed KMS keys]. KMS always rotates the key material -// of Amazon Web Services managed keys every year. Rotation of [Amazon Web Services owned KMS keys]is managed by the -// Amazon Web Services service that owns the key. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:RotateKeyOnDemand] (key policy) -// -// Related operations: -// -// # EnableKeyRotation -// -// # DisableKeyRotation -// -// # GetKeyRotationStatus -// -// # ListKeyRotations -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [on-demand rotation]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-on-demand -// [Amazon Web Services owned KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk -// [automatic key rotation]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable -// [kms:RotateKeyOnDemand]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html -// [Amazon Web Services managed KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [symmetric encryption KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -func (c *Client) RotateKeyOnDemand(ctx context.Context, params *RotateKeyOnDemandInput, optFns ...func(*Options)) (*RotateKeyOnDemandOutput, error) { - if params == nil { - params = &RotateKeyOnDemandInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RotateKeyOnDemand", params, optFns, c.addOperationRotateKeyOnDemandMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RotateKeyOnDemandOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RotateKeyOnDemandInput struct { - - // Identifies a symmetric encryption KMS key. You cannot perform on-demand - // rotation of [asymmetric KMS keys], [HMAC KMS keys], KMS keys with [imported key material], or KMS keys in a [custom key store]. To perform on-demand - // rotation of a set of related [multi-Region keys], invoke the on-demand rotation on the primary key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // - // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // - Key ARN: - // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // [imported key material]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html - // [HMAC KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html - // [asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html - // [multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html - // - // This member is required. - KeyId *string - - noSmithyDocumentSerde -} - -type RotateKeyOnDemandOutput struct { - - // Identifies the symmetric encryption KMS key that you initiated on-demand - // rotation on. - KeyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRotateKeyOnDemandMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpRotateKeyOnDemand{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRotateKeyOnDemand{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RotateKeyOnDemand"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpRotateKeyOnDemandValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRotateKeyOnDemand(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRotateKeyOnDemand(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RotateKeyOnDemand", - } -} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go index f2de79497f1..a8e3354fbc8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go @@ -17,62 +17,46 @@ import ( // operation is successful, the key state of the KMS key changes to PendingDeletion // and the key can't be used in any cryptographic operations. It remains in this // state for the duration of the waiting period. Before the waiting period ends, -// you can use CancelKeyDeletionto cancel the deletion of the KMS key. After the waiting period -// ends, KMS deletes the KMS key, its key material, and all KMS data associated -// with it, including all aliases that refer to it. -// -// Deleting a KMS key is a destructive and potentially dangerous operation. When a -// KMS key is deleted, all data that was encrypted under the KMS key is -// unrecoverable. (The only exception is a [multi-Region replica key], or an asymmetric or HMAC KMS key with imported key material.) To prevent the use of a KMS -// key without deleting it, use DisableKey. -// -// You can schedule the deletion of a multi-Region primary key and its replica -// keys at any time. However, KMS will not delete a multi-Region primary key with -// existing replica keys. If you schedule the deletion of a primary key with -// replicas, its key state changes to PendingReplicaDeletion and it cannot be -// replicated or used in cryptographic operations. This status can continue -// indefinitely. When the last of its replicas keys is deleted (not just -// scheduled), the key state of the primary key changes to PendingDeletion and its -// waiting period ( PendingWindowInDays ) begins. For details, see [Deleting multi-Region keys] in the Key -// Management Service Developer Guide. -// -// When KMS [deletes a KMS key from an CloudHSM key store], it makes a best effort to delete the associated key material from -// the associated CloudHSM cluster. However, you might need to manually [delete the orphaned key material]from the -// cluster and its backups. [Deleting a KMS key from an external key store]has no effect on the associated external key. However, -// for both types of custom key stores, deleting a KMS key is destructive and -// irreversible. You cannot decrypt ciphertext encrypted under the KMS key by using -// only its associated external key or CloudHSM key. Also, you cannot recreate a -// KMS key in an external key store by creating a new KMS key with the same key -// material. -// -// For more information about scheduling a KMS key for deletion, see [Deleting KMS keys] in the Key -// Management Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: kms:ScheduleKeyDeletion (key policy) -// -// # Related operations -// -// # CancelKeyDeletion -// -// # DisableKey +// you can use CancelKeyDeletion to cancel the deletion of the KMS key. After the +// waiting period ends, KMS deletes the KMS key, its key material, and all KMS data +// associated with it, including all aliases that refer to it. Deleting a KMS key +// is a destructive and potentially dangerous operation. When a KMS key is deleted, +// all data that was encrypted under the KMS key is unrecoverable. (The only +// exception is a multi-Region replica key (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) +// , or an asymmetric or HMAC KMS key with imported key material .) To prevent the +// use of a KMS key without deleting it, use DisableKey . You can schedule the +// deletion of a multi-Region primary key and its replica keys at any time. +// However, KMS will not delete a multi-Region primary key with existing replica +// keys. If you schedule the deletion of a primary key with replicas, its key state +// changes to PendingReplicaDeletion and it cannot be replicated or used in +// cryptographic operations. This status can continue indefinitely. When the last +// of its replicas keys is deleted (not just scheduled), the key state of the +// primary key changes to PendingDeletion and its waiting period ( +// PendingWindowInDays ) begins. For details, see Deleting multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) +// in the Key Management Service Developer Guide. When KMS deletes a KMS key from +// an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/delete-cmk-keystore.html) +// , it makes a best effort to delete the associated key material from the +// associated CloudHSM cluster. However, you might need to manually delete the +// orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) +// from the cluster and its backups. Deleting a KMS key from an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/delete-xks-key.html) +// has no effect on the associated external key. However, for both types of custom +// key stores, deleting a KMS key is destructive and irreversible. You cannot +// decrypt ciphertext encrypted under the KMS key by using only its associated +// external key or CloudHSM key. Also, you cannot recreate a KMS key in an external +// key store by creating a new KMS key with the same key material. For more +// information about scheduling a KMS key for deletion, see Deleting KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) +// in the Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:ScheduleKeyDeletion (key policy) Related operations +// - CancelKeyDeletion +// - DisableKey // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [delete the orphaned key material]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Deleting a KMS key from an external key store]: https://docs.aws.amazon.com/kms/latest/developerguide/delete-xks-key.html -// [Deleting multi-Region keys]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html -// [Deleting KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html -// [multi-Region replica key]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [deletes a KMS key from an CloudHSM key store]: https://docs.aws.amazon.com/kms/latest/developerguide/delete-cmk-keystore.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) ScheduleKeyDeletion(ctx context.Context, params *ScheduleKeyDeletionInput, optFns ...func(*Options)) (*ScheduleKeyDeletionOutput, error) { if params == nil { params = &ScheduleKeyDeletionInput{} @@ -90,35 +74,25 @@ func (c *Client) ScheduleKeyDeletion(ctx context.Context, params *ScheduleKeyDel type ScheduleKeyDeletionInput struct { - // The unique identifier of the KMS key to delete. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // The unique identifier of the KMS key to delete. Specify the key ID or key ARN + // of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // The waiting period, specified in number of days. After the waiting period ends, - // KMS deletes the KMS key. - // - // If the KMS key is a multi-Region primary key with replica keys, the waiting - // period begins when the last of its replica keys is deleted. Otherwise, the - // waiting period begins immediately. - // - // This value is optional. If you include a value, it must be between 7 and 30, - // inclusive. If you do not include a value, it defaults to 30. You can use the [kms:ScheduleKeyDeletionPendingWindowInDays] - // kms:ScheduleKeyDeletionPendingWindowInDays condition key to further constrain - // the values that principals can specify in the PendingWindowInDays parameter. - // - // [kms:ScheduleKeyDeletionPendingWindowInDays]: https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-schedule-key-deletion-pending-window-in-days + // KMS deletes the KMS key. If the KMS key is a multi-Region primary key with + // replica keys, the waiting period begins when the last of its replica keys is + // deleted. Otherwise, the waiting period begins immediately. This value is + // optional. If you include a value, it must be between 7 and 30, inclusive. If you + // do not include a value, it defaults to 30. You can use the + // kms:ScheduleKeyDeletionPendingWindowInDays (https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-schedule-key-deletion-pending-window-in-days) + // condition key to further constrain the values that principals can specify in the + // PendingWindowInDays parameter. PendingWindowInDays *int32 noSmithyDocumentSerde @@ -126,31 +100,25 @@ type ScheduleKeyDeletionInput struct { type ScheduleKeyDeletionOutput struct { - // The date and time after which KMS deletes the KMS key. - // - // If the KMS key is a multi-Region primary key with replica keys, this field does - // not appear. The deletion date for the primary key isn't known until its last - // replica key is deleted. + // The date and time after which KMS deletes the KMS key. If the KMS key is a + // multi-Region primary key with replica keys, this field does not appear. The + // deletion date for the primary key isn't known until its last replica key is + // deleted. DeletionDate *time.Time - // The Amazon Resource Name ([key ARN] ) of the KMS key whose deletion is scheduled. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the KMS key whose deletion is scheduled. KeyId *string - // The current status of the KMS key. - // - // For more information about how key state affects the use of a KMS key, see [Key states of KMS keys] in - // the Key Management Service Developer Guide. - // - // [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html + // The current status of the KMS key. For more information about how key state + // affects the use of a KMS key, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) + // in the Key Management Service Developer Guide. KeyState types.KeyState - // The waiting period before the KMS key is deleted. - // - // If the KMS key is a multi-Region primary key with replicas, the waiting period - // begins when the last of its replica keys is deleted. Otherwise, the waiting - // period begins immediately. + // The waiting period before the KMS key is deleted. If the KMS key is a + // multi-Region primary key with replicas, the waiting period begins when the last + // of its replica keys is deleted. Otherwise, the waiting period begins + // immediately. PendingWindowInDays *int32 // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go index ebd7cf5e70e..c69fe69e42c 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go @@ -11,63 +11,48 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a [digital signature] for a message or message digest by using the private key in an -// asymmetric signing KMS key. To verify the signature, use the Verifyoperation, or use -// the public key in the same asymmetric KMS key outside of KMS. For information -// about asymmetric KMS keys, see [Asymmetric KMS keys]in the Key Management Service Developer Guide. -// -// Digital signatures are generated and verified by using asymmetric key pair, -// such as an RSA or ECC pair that is represented by an asymmetric KMS key. The key -// owner (or an authorized user) uses their private key to sign a message. Anyone -// with the public key can verify that the message was signed with that particular -// private key and that the message hasn't changed since it was signed. -// -// To use the Sign operation, provide the following information: -// +// Creates a digital signature (https://en.wikipedia.org/wiki/Digital_signature) +// for a message or message digest by using the private key in an asymmetric +// signing KMS key. To verify the signature, use the Verify operation, or use the +// public key in the same asymmetric KMS key outside of KMS. For information about +// asymmetric KMS keys, see Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the Key Management Service Developer Guide. Digital signatures are generated +// and verified by using asymmetric key pair, such as an RSA or ECC pair that is +// represented by an asymmetric KMS key. The key owner (or an authorized user) uses +// their private key to sign a message. Anyone with the public key can verify that +// the message was signed with that particular private key and that the message +// hasn't changed since it was signed. To use the Sign operation, provide the +// following information: // - Use the KeyId parameter to identify an asymmetric KMS key with a KeyUsage -// value of SIGN_VERIFY . To get the KeyUsage value of a KMS key, use the DescribeKey -// operation. The caller must have kms:Sign permission on the KMS key. -// +// value of SIGN_VERIFY . To get the KeyUsage value of a KMS key, use the +// DescribeKey operation. The caller must have kms:Sign permission on the KMS +// key. // - Use the Message parameter to specify the message or message digest to sign. // You can submit messages of up to 4096 bytes. To sign a larger message, generate // a hash digest of the message, and then provide the hash digest in the Message // parameter. To indicate whether the message is a full message or a digest, use // the MessageType parameter. -// // - Choose a signing algorithm that is compatible with the KMS key. // // When signing a message, be sure to record the KMS key and the signing -// algorithm. This information is required to verify the signature. -// -// Best practices recommend that you limit the time during which any signature is -// effective. This deters an attack where the actor uses a signed message to -// establish validity repeatedly or long after the message is superseded. -// Signatures do not include a timestamp, but you can include a timestamp in the -// signed message to help you detect when its time to refresh the signature. -// -// To verify the signature that this operation generates, use the Verify operation. Or -// use the GetPublicKeyoperation to download the public key and then use the public key to -// verify the signature outside of KMS. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:Sign] (key policy) -// -// Related operations: Verify -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [digital signature]: https://en.wikipedia.org/wiki/Digital_signature -// [Asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [kms:Sign]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// algorithm. This information is required to verify the signature. Best practices +// recommend that you limit the time during which any signature is effective. This +// deters an attack where the actor uses a signed message to establish validity +// repeatedly or long after the message is superseded. Signatures do not include a +// timestamp, but you can include a timestamp in the signed message to help you +// detect when its time to refresh the signature. To verify the signature that this +// operation generates, use the Verify operation. Or use the GetPublicKey +// operation to download the public key and then use the public key to verify the +// signature outside of KMS. The KMS key that you use for this operation must be in +// a compatible key state. For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:Sign (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: Verify Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) Sign(ctx context.Context, params *SignInput, optFns ...func(*Options)) (*SignOutput, error) { if params == nil { params = &SignInput{} @@ -88,95 +73,70 @@ type SignInput struct { // Identifies an asymmetric KMS key. KMS uses the private key in the asymmetric // KMS key to sign the message. The KeyUsage type of the KMS key must be // SIGN_VERIFY . To find the KeyUsage of a KMS key, use the DescribeKey operation. - // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When // using an alias name, prefix it with "alias/" . To specify a KMS key in a // different Amazon Web Services account, you must use the key ARN or alias ARN. - // // For example: - // // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string // Specifies the message or message digest to sign. Messages can be 0-4096 bytes. - // To sign a larger message, provide a message digest. - // - // If you provide a message digest, use the DIGEST value of MessageType to prevent - // the digest from being hashed again while signing. + // To sign a larger message, provide a message digest. If you provide a message + // digest, use the DIGEST value of MessageType to prevent the digest from being + // hashed again while signing. // // This member is required. Message []byte - // Specifies the signing algorithm to use when signing the message. - // - // Choose an algorithm that is compatible with the type and size of the specified - // asymmetric KMS key. When signing with RSA key pairs, RSASSA-PSS algorithms are - // preferred. We include RSASSA-PKCS1-v1_5 algorithms for compatibility with - // existing applications. + // Specifies the signing algorithm to use when signing the message. Choose an + // algorithm that is compatible with the type and size of the specified asymmetric + // KMS key. When signing with RSA key pairs, RSASSA-PSS algorithms are preferred. + // We include RSASSA-PKCS1-v1_5 algorithms for compatibility with existing + // applications. // // This member is required. SigningAlgorithm types.SigningAlgorithmSpec - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // Tells KMS whether the value of the Message parameter should be hashed as part // of the signing algorithm. Use RAW for unhashed messages; use DIGEST for message - // digests, which are already hashed. - // - // When the value of MessageType is RAW , KMS uses the standard signing algorithm, - // which begins with a hash function. When the value is DIGEST , KMS skips the - // hashing step in the signing algorithm. - // - // Use the DIGEST value only when the value of the Message parameter is a message - // digest. If you use the DIGEST value with an unhashed message, the security of - // the signing operation can be compromised. - // - // When the value of MessageType is DIGEST , the length of the Message value must - // match the length of hashed messages for the specified signing algorithm. - // - // You can submit a message digest and omit the MessageType or specify RAW so the - // digest is hashed again while signing. However, this can cause verification - // failures when verifying with a system that assumes a single hash. - // - // The hashing algorithm in that Sign uses is based on the SigningAlgorithm value. - // + // digests, which are already hashed. When the value of MessageType is RAW , KMS + // uses the standard signing algorithm, which begins with a hash function. When the + // value is DIGEST , KMS skips the hashing step in the signing algorithm. Use the + // DIGEST value only when the value of the Message parameter is a message digest. + // If you use the DIGEST value with an unhashed message, the security of the + // signing operation can be compromised. When the value of MessageType is DIGEST , + // the length of the Message value must match the length of hashed messages for + // the specified signing algorithm. You can submit a message digest and omit the + // MessageType or specify RAW so the digest is hashed again while signing. + // However, this can cause verification failures when verifying with a system that + // assumes a single hash. The hashing algorithm in that Sign uses is based on the + // SigningAlgorithm value. // - Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm. - // // - Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm. - // // - Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm. - // - // - SM2DSA uses the SM3 hashing algorithm. For details, see [Offline verification with SM2 key pairs]. - // - // [Offline verification with SM2 key pairs]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification + // - SM2DSA uses the SM3 hashing algorithm. For details, see Offline + // verification with SM2 key pairs (https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification) + // . MessageType types.MessageType noSmithyDocumentSerde @@ -184,27 +144,21 @@ type SignInput struct { type SignOutput struct { - // The Amazon Resource Name ([key ARN] ) of the asymmetric KMS key that was used to sign the - // message. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the asymmetric KMS key that was used to sign the message. KeyId *string // The cryptographic signature that was generated for the message. - // // - When used with the supported RSA signing algorithms, the encoding of this - // value is defined by [PKCS #1 in RFC 8017]. - // + // value is defined by PKCS #1 in RFC 8017 (https://tools.ietf.org/html/rfc8017) + // . // - When used with the ECDSA_SHA_256 , ECDSA_SHA_384 , or ECDSA_SHA_512 signing // algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and - // [RFC 3279 Section 2.2.3]. This is the most commonly used signature format and is appropriate for most + // RFC 3279 Section 2.2.3 (https://tools.ietf.org/html/rfc3279#section-2.2.3) . + // This is the most commonly used signature format and is appropriate for most // uses. - // // When you use the HTTP API or the Amazon Web Services CLI, the value is // Base64-encoded. Otherwise, it is not Base64-encoded. - // - // [RFC 3279 Section 2.2.3]: https://tools.ietf.org/html/rfc3279#section-2.2.3 - // [PKCS #1 in RFC 8017]: https://tools.ietf.org/html/rfc8017 Signature []byte // The signing algorithm that was used to sign the message. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go index f24835fe51e..001db07b674 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go @@ -11,56 +11,38 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds or edits tags on a [customer managed key]. -// -// Tagging or untagging a KMS key can allow or deny permission to the KMS key. For -// details, see [ABAC for KMS]in the Key Management Service Developer Guide. -// -// Each tag consists of a tag key and a tag value, both of which are -// case-sensitive strings. The tag value can be an empty (null) string. To add a -// tag, specify a new tag key and a tag value. To edit a tag, specify an existing -// tag key and a new tag value. -// -// You can use this operation to tag a [customer managed key], but you cannot tag an [Amazon Web Services managed key], an [Amazon Web Services owned key], a [custom key store], or an [alias]. -// -// You can also add tags to a KMS key while creating it (CreateKey ) or replicating it (ReplicateKey ). -// -// For information about using tags in KMS, see [Tagging keys]. For general information about -// tags, including the format and syntax, see [Tagging Amazon Web Services resources]in the Amazon Web Services General -// Reference. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:TagResource] (key policy) -// -// # Related operations -// -// # CreateKey -// -// # ListResourceTags -// -// # ReplicateKey -// -// # UntagResource +// Adds or edits tags on a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// . Tagging or untagging a KMS key can allow or deny permission to the KMS key. +// For details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) +// in the Key Management Service Developer Guide. Each tag consists of a tag key +// and a tag value, both of which are case-sensitive strings. The tag value can be +// an empty (null) string. To add a tag, specify a new tag key and a tag value. To +// edit a tag, specify an existing tag key and a new tag value. You can use this +// operation to tag a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// , but you cannot tag an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// , an Amazon Web Services owned key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) +// , a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#keystore-concept) +// , or an alias (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#alias-concept) +// . You can also add tags to a KMS key while creating it ( CreateKey ) or +// replicating it ( ReplicateKey ). For information about using tags in KMS, see +// Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) +// . For general information about tags, including the format and syntax, see +// Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// - CreateKey +// - ListResourceTags +// - ReplicateKey +// - UntagResource // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Amazon Web Services owned key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:TagResource]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk -// [Tagging keys]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html -// [alias]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#alias-concept -// [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk -// [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#keystore-concept -// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} @@ -78,31 +60,22 @@ func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optF type TagResourceInput struct { - // Identifies a customer managed key in the account and Region. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Identifies a customer managed key in the account and Region. Specify the key ID + // or key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // One or more tags. Each tag consists of a tag key and a tag value. The tag value - // can be an empty (null) string. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // You cannot have more than one tag on a KMS key with the same tag key. If you - // specify an existing tag key with a different tag value, KMS replaces the current - // tag value with the specified one. + // can be an empty (null) string. Do not include confidential or sensitive + // information in this field. This field may be displayed in plaintext in + // CloudTrail logs and other output. You cannot have more than one tag on a KMS key + // with the same tag key. If you specify an existing tag key with a different tag + // value, KMS replaces the current tag value with the specified one. // // This member is required. Tags []types.Tag diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go index 157eb8d0f3f..c3cae702817 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go @@ -10,48 +10,32 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes tags from a [customer managed key]. To delete a tag, specify the tag key and the KMS key. -// -// Tagging or untagging a KMS key can allow or deny permission to the KMS key. For -// details, see [ABAC for KMS]in the Key Management Service Developer Guide. -// -// When it succeeds, the UntagResource operation doesn't return any output. Also, -// if the specified tag key isn't found on the KMS key, it doesn't throw an -// exception or return a response. To confirm that the operation worked, use the ListResourceTags -// operation. -// -// For information about using tags in KMS, see [Tagging keys]. For general information about -// tags, including the format and syntax, see [Tagging Amazon Web Services resources]in the Amazon Web Services General -// Reference. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:UntagResource] (key policy) -// -// # Related operations -// -// # CreateKey -// -// # ListResourceTags -// -// # ReplicateKey -// -// # TagResource +// Deletes tags from a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// . To delete a tag, specify the tag key and the KMS key. Tagging or untagging a +// KMS key can allow or deny permission to the KMS key. For details, see ABAC for +// KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the Key +// Management Service Developer Guide. When it succeeds, the UntagResource +// operation doesn't return any output. Also, if the specified tag key isn't found +// on the KMS key, it doesn't throw an exception or return a response. To confirm +// that the operation worked, use the ListResourceTags operation. For information +// about using tags in KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) +// . For general information about tags, including the format and syntax, see +// Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:UntagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// - CreateKey +// - ListResourceTags +// - ReplicateKey +// - TagResource // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:UntagResource]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk -// [Tagging keys]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html -// [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} @@ -69,18 +53,12 @@ func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, type UntagResourceInput struct { - // Identifies the KMS key from which you are removing tags. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Identifies the KMS key from which you are removing tags. Specify the key ID or + // key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go index f885e497b3c..cb429fd7382 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go @@ -13,60 +13,40 @@ import ( // Associates an existing KMS alias with a different KMS key. Each alias is // associated with only one KMS key at a time, although a KMS key can have multiple // aliases. The alias and the KMS key must be in the same Amazon Web Services -// account and Region. -// -// Adding, deleting, or updating an alias can allow or deny permission to the KMS -// key. For details, see [ABAC for KMS]in the Key Management Service Developer Guide. -// -// The current and new KMS key must be the same type (both symmetric or both -// asymmetric or both HMAC), and they must have the same key usage. This -// restriction prevents errors in code that uses aliases. If you must assign an -// alias to a different type of KMS key, use DeleteAliasto delete the old alias and CreateAlias to -// create a new alias. -// -// You cannot use UpdateAlias to change an alias name. To change an alias name, -// use DeleteAliasto delete the old alias and CreateAlias to create a new alias. -// +// account and Region. Adding, deleting, or updating an alias can allow or deny +// permission to the KMS key. For details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) +// in the Key Management Service Developer Guide. The current and new KMS key must +// be the same type (both symmetric or both asymmetric or both HMAC), and they must +// have the same key usage. This restriction prevents errors in code that uses +// aliases. If you must assign an alias to a different type of KMS key, use +// DeleteAlias to delete the old alias and CreateAlias to create a new alias. You +// cannot use UpdateAlias to change an alias name. To change an alias name, use +// DeleteAlias to delete the old alias and CreateAlias to create a new alias. // Because an alias is not a property of a KMS key, you can create, update, and // delete the aliases of a KMS key without affecting the KMS key. Also, aliases do -// not appear in the response from the DescribeKeyoperation. To get the aliases of all KMS -// keys in the account, use the ListAliasesoperation. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// # Required permissions -// -// [kms:UpdateAlias] -// - on the alias (IAM policy). -// -// [kms:UpdateAlias] -// - on the current KMS key (key policy). -// -// [kms:UpdateAlias] -// - on the new KMS key (key policy). -// -// For details, see [Controlling access to aliases] in the Key Management Service Developer Guide. -// -// Related operations: -// -// # CreateAlias -// -// # DeleteAlias -// -// # ListAliases +// not appear in the response from the DescribeKey operation. To get the aliases +// of all KMS keys in the account, use the ListAliases operation. The KMS key that +// you use for this operation must be in a compatible key state. For details, see +// Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions +// - kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// - kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the current KMS key (key policy). +// - kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the new KMS key (key policy). +// +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the Key Management Service Developer Guide. Related operations: +// - CreateAlias +// - DeleteAlias +// - ListAliases // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [ABAC for KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/abac.html -// [kms:UpdateAlias]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [Controlling access to aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) UpdateAlias(ctx context.Context, params *UpdateAliasInput, optFns ...func(*Options)) (*UpdateAliasOutput, error) { if params == nil { params = &UpdateAliasInput{} @@ -86,37 +66,25 @@ type UpdateAliasInput struct { // Identifies the alias that is changing its KMS key. This value must begin with // alias/ followed by the alias name, such as alias/ExampleAlias . You cannot use - // UpdateAlias to change the alias name. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. + // UpdateAlias to change the alias name. Do not include confidential or sensitive + // information in this field. This field may be displayed in plaintext in + // CloudTrail logs and other output. // // This member is required. AliasName *string - // Identifies the [customer managed key] to associate with the alias. You don't have permission to - // associate an alias with an [Amazon Web Services managed key]. - // - // The KMS key must be in the same Amazon Web Services account and Region as the + // Identifies the customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) + // to associate with the alias. You don't have permission to associate an alias + // with an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) + // . The KMS key must be in the same Amazon Web Services account and Region as the // alias. Also, the new target KMS key must be the same type as the current target // KMS key (both symmetric or both asymmetric or both HMAC) and they must have the - // same key usage. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // same key usage. Specify the key ID or key ARN of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. - // - // To verify that the alias is mapped to the correct KMS key, use ListAliases. - // - // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // verify that the alias is mapped to the correct KMS key, use ListAliases . // // This member is required. TargetKeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go index 578980488c9..14447d9d9b8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go @@ -12,92 +12,67 @@ import ( ) // Changes the properties of a custom key store. You can use this operation to -// change the properties of an CloudHSM key store or an external key store. -// -// Use the required CustomKeyStoreId parameter to identify the custom key store. -// Use the remaining optional parameters to change its properties. This operation -// does not return any property values. To verify the updated property values, use -// the DescribeCustomKeyStoresoperation. -// -// This operation is part of the [custom key stores] feature in KMS, which combines the convenience -// and extensive integration of KMS with the isolation and control of a key store -// that you own and manage. -// -// When updating the properties of an external key store, verify that the updated +// change the properties of an CloudHSM key store or an external key store. Use the +// required CustomKeyStoreId parameter to identify the custom key store. Use the +// remaining optional parameters to change its properties. This operation does not +// return any property values. To verify the updated property values, use the +// DescribeCustomKeyStores operation. This operation is part of the custom key +// stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) +// feature in KMS, which combines the convenience and extensive integration of KMS +// with the isolation and control of a key store that you own and manage. When +// updating the properties of an external key store, verify that the updated // settings connect your key store, via the external key store proxy, to the same // external key manager as the previous settings, or to a backup or snapshot of the // external key manager with the same cryptographic keys. If the updated connection // settings fail, you can fix them and retry, although an extended delay might // disrupt Amazon Web Services services. However, if KMS permanently loses its // access to cryptographic keys, ciphertext encrypted under those keys is -// unrecoverable. -// -// For external key stores: -// -// Some external key managers provide a simpler method for updating an external -// key store. For details, see your external key manager documentation. -// -// When updating an external key store in the KMS console, you can upload a -// JSON-based proxy configuration file with the desired values. You cannot upload -// the proxy configuration file to the UpdateCustomKeyStore operation. However, -// you can use the file to help you determine the correct values for the -// UpdateCustomKeyStore parameters. -// -// For an CloudHSM key store, you can use this operation to change the custom key -// store friendly name ( NewCustomKeyStoreName ), to tell KMS about a change to the +// unrecoverable. For external key stores: Some external key managers provide a +// simpler method for updating an external key store. For details, see your +// external key manager documentation. When updating an external key store in the +// KMS console, you can upload a JSON-based proxy configuration file with the +// desired values. You cannot upload the proxy configuration file to the +// UpdateCustomKeyStore operation. However, you can use the file to help you +// determine the correct values for the UpdateCustomKeyStore parameters. For an +// CloudHSM key store, you can use this operation to change the custom key store +// friendly name ( NewCustomKeyStoreName ), to tell KMS about a change to the // kmsuser crypto user password ( KeyStorePassword ), or to associate the custom // key store with a different, but related, CloudHSM cluster ( CloudHsmClusterId ). // To update any property of an CloudHSM key store, the ConnectionState of the -// CloudHSM key store must be DISCONNECTED . -// -// For an external key store, you can use this operation to change the custom key -// store friendly name ( NewCustomKeyStoreName ), or to tell KMS about a change to -// the external key store proxy authentication credentials ( -// XksProxyAuthenticationCredential ), connection method ( XksProxyConnectivity ), -// external proxy endpoint ( XksProxyUriEndpoint ) and path ( XksProxyUriPath ). -// For external key stores with an XksProxyConnectivity of VPC_ENDPOINT_SERVICE , -// you can also update the Amazon VPC endpoint service name ( -// XksProxyVpcEndpointServiceName ). To update most properties of an external key -// store, the ConnectionState of the external key store must be DISCONNECTED . -// However, you can update the CustomKeyStoreName , +// CloudHSM key store must be DISCONNECTED . For an external key store, you can use +// this operation to change the custom key store friendly name ( +// NewCustomKeyStoreName ), or to tell KMS about a change to the external key store +// proxy authentication credentials ( XksProxyAuthenticationCredential ), +// connection method ( XksProxyConnectivity ), external proxy endpoint ( +// XksProxyUriEndpoint ) and path ( XksProxyUriPath ). For external key stores with +// an XksProxyConnectivity of VPC_ENDPOINT_SERVICE , you can also update the Amazon +// VPC endpoint service name ( XksProxyVpcEndpointServiceName ). To update most +// properties of an external key store, the ConnectionState of the external key +// store must be DISCONNECTED . However, you can update the CustomKeyStoreName , // XksProxyAuthenticationCredential , and XksProxyUriPath of an external key store -// when it is in the CONNECTED or DISCONNECTED state. -// -// If your update requires a DISCONNECTED state, before using UpdateCustomKeyStore -// , use the DisconnectCustomKeyStoreoperation to disconnect the custom key store. After the -// UpdateCustomKeyStore operation completes, use the ConnectCustomKeyStore to reconnect the custom key -// store. To find the ConnectionState of the custom key store, use the DescribeCustomKeyStores operation. -// -// Before updating the custom key store, verify that the new values allow KMS to -// connect the custom key store to its backing key store. For example, before you -// change the XksProxyUriPath value, verify that the external key store proxy is -// reachable at the new path. -// -// If the operation succeeds, it returns a JSON object with no properties. -// +// when it is in the CONNECTED or DISCONNECTED state. If your update requires a +// DISCONNECTED state, before using UpdateCustomKeyStore , use the +// DisconnectCustomKeyStore operation to disconnect the custom key store. After the +// UpdateCustomKeyStore operation completes, use the ConnectCustomKeyStore to +// reconnect the custom key store. To find the ConnectionState of the custom key +// store, use the DescribeCustomKeyStores operation. Before updating the custom +// key store, verify that the new values allow KMS to connect the custom key store +// to its backing key store. For example, before you change the XksProxyUriPath +// value, verify that the external key store proxy is reachable at the new path. If +// the operation succeeds, it returns a JSON object with no properties. // Cross-account use: No. You cannot perform this operation on a custom key store -// in a different Amazon Web Services account. -// -// Required permissions: [kms:UpdateCustomKeyStore] (IAM policy) -// -// Related operations: -// -// # ConnectCustomKeyStore -// -// # CreateCustomKeyStore -// -// # DeleteCustomKeyStore -// -// # DescribeCustomKeyStores -// -// # DisconnectCustomKeyStore +// in a different Amazon Web Services account. Required permissions: +// kms:UpdateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// - ConnectCustomKeyStore +// - CreateCustomKeyStore +// - DeleteCustomKeyStore +// - DescribeCustomKeyStores +// - DisconnectCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [custom key stores]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html -// [kms:UpdateCustomKeyStore]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) UpdateCustomKeyStore(ctx context.Context, params *UpdateCustomKeyStoreInput, optFns ...func(*Options)) (*UpdateCustomKeyStoreOutput, error) { if params == nil { params = &UpdateCustomKeyStoreInput{} @@ -116,119 +91,92 @@ func (c *Client) UpdateCustomKeyStore(ctx context.Context, params *UpdateCustomK type UpdateCustomKeyStoreInput struct { // Identifies the custom key store that you want to update. Enter the ID of the - // custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStoresoperation. + // custom key store. To find the ID of a custom key store, use the + // DescribeCustomKeyStores operation. // // This member is required. CustomKeyStoreId *string // Associates the custom key store with a related CloudHSM cluster. This parameter // is valid only for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . - // - // Enter the cluster ID of the cluster that you used to create the custom key - // store or a cluster that shares a backup history and has the same cluster - // certificate as the original cluster. You cannot use this parameter to associate - // a custom key store with an unrelated cluster. In addition, the replacement - // cluster must [fulfill the requirements]for a cluster associated with a custom key store. To view the - // cluster certificate of a cluster, use the [DescribeClusters]operation. - // - // To change this value, the CloudHSM key store must be disconnected. - // - // [fulfill the requirements]: https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore - // [DescribeClusters]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html + // Enter the cluster ID of the cluster that you used to create the custom key store + // or a cluster that shares a backup history and has the same cluster certificate + // as the original cluster. You cannot use this parameter to associate a custom key + // store with an unrelated cluster. In addition, the replacement cluster must + // fulfill the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) + // for a cluster associated with a custom key store. To view the cluster + // certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) + // operation. To change this value, the CloudHSM key store must be disconnected. CloudHsmClusterId *string // Enter the current password of the kmsuser crypto user (CU) in the CloudHSM // cluster that is associated with the custom key store. This parameter is valid - // only for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . - // - // This parameter tells KMS the current password of the kmsuser crypto user (CU). - // It does not set or change the password of any users in the CloudHSM cluster. - // - // To change this value, the CloudHSM key store must be disconnected. + // only for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM . This + // parameter tells KMS the current password of the kmsuser crypto user (CU). It + // does not set or change the password of any users in the CloudHSM cluster. To + // change this value, the CloudHSM key store must be disconnected. KeyStorePassword *string // Changes the friendly name of the custom key store to the value that you // specify. The custom key store name must be unique in the Amazon Web Services - // account. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // To change this value, an CloudHSM key store must be disconnected. An external - // key store can be connected or disconnected. + // account. Do not include confidential or sensitive information in this field. + // This field may be displayed in plaintext in CloudTrail logs and other output. To + // change this value, an CloudHSM key store must be disconnected. An external key + // store can be connected or disconnected. NewCustomKeyStoreName *string // Changes the credentials that KMS uses to sign requests to the external key // store proxy (XKS proxy). This parameter is valid only for custom key stores with - // a CustomKeyStoreType of EXTERNAL_KEY_STORE . - // - // You must specify both the AccessKeyId and SecretAccessKey value in the - // authentication credential, even if you are only updating one value. - // - // This parameter doesn't establish or change your authentication credentials on - // the proxy. It just tells KMS the credential that you established with your - // external key store proxy. For example, if you rotate the credential on your - // external key store proxy, you can use this parameter to update the credential in - // KMS. - // - // You can change this value when the external key store is connected or - // disconnected. + // a CustomKeyStoreType of EXTERNAL_KEY_STORE . You must specify both the + // AccessKeyId and SecretAccessKey value in the authentication credential, even if + // you are only updating one value. This parameter doesn't establish or change your + // authentication credentials on the proxy. It just tells KMS the credential that + // you established with your external key store proxy. For example, if you rotate + // the credential on your external key store proxy, you can use this parameter to + // update the credential in KMS. You can change this value when the external key + // store is connected or disconnected. XksProxyAuthenticationCredential *types.XksProxyAuthenticationCredentialType // Changes the connectivity setting for the external key store. To indicate that // the external key store proxy uses a Amazon VPC endpoint service to communicate - // with KMS, specify VPC_ENDPOINT_SERVICE . Otherwise, specify PUBLIC_ENDPOINT . - // - // If you change the XksProxyConnectivity to VPC_ENDPOINT_SERVICE , you must also + // with KMS, specify VPC_ENDPOINT_SERVICE . Otherwise, specify PUBLIC_ENDPOINT . If + // you change the XksProxyConnectivity to VPC_ENDPOINT_SERVICE , you must also // change the XksProxyUriEndpoint and add an XksProxyVpcEndpointServiceName value. - // // If you change the XksProxyConnectivity to PUBLIC_ENDPOINT , you must also change // the XksProxyUriEndpoint and specify a null or empty string for the - // XksProxyVpcEndpointServiceName value. - // - // To change this value, the external key store must be disconnected. + // XksProxyVpcEndpointServiceName value. To change this value, the external key + // store must be disconnected. XksProxyConnectivity types.XksProxyConnectivityType // Changes the URI endpoint that KMS uses to connect to your external key store // proxy (XKS proxy). This parameter is valid only for custom key stores with a - // CustomKeyStoreType of EXTERNAL_KEY_STORE . - // - // For external key stores with an XksProxyConnectivity value of PUBLIC_ENDPOINT , - // the protocol must be HTTPS. - // - // For external key stores with an XksProxyConnectivity value of - // VPC_ENDPOINT_SERVICE , specify https:// followed by the private DNS name - // associated with the VPC endpoint service. Each external key store must use a - // different private DNS name. - // + // CustomKeyStoreType of EXTERNAL_KEY_STORE . For external key stores with an + // XksProxyConnectivity value of PUBLIC_ENDPOINT , the protocol must be HTTPS. For + // external key stores with an XksProxyConnectivity value of VPC_ENDPOINT_SERVICE , + // specify https:// followed by the private DNS name associated with the VPC + // endpoint service. Each external key store must use a different private DNS name. // The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique in - // the Amazon Web Services account and Region. - // - // To change this value, the external key store must be disconnected. + // the Amazon Web Services account and Region. To change this value, the external + // key store must be disconnected. XksProxyUriEndpoint *string // Changes the base path to the proxy APIs for this external key store. To find // this value, see the documentation for your external key manager and external key // store proxy (XKS proxy). This parameter is valid only for custom key stores with - // a CustomKeyStoreType of EXTERNAL_KEY_STORE . - // - // The value must start with / and must end with /kms/xks/v1 , where v1 represents - // the version of the KMS external key store proxy API. You can include an optional - // prefix between the required elements such as /example/kms/xks/v1 . - // - // The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique in - // the Amazon Web Services account and Region. - // - // You can change this value when the external key store is connected or + // a CustomKeyStoreType of EXTERNAL_KEY_STORE . The value must start with / and + // must end with /kms/xks/v1 , where v1 represents the version of the KMS external + // key store proxy API. You can include an optional prefix between the required + // elements such as /example/kms/xks/v1 . The combined XksProxyUriEndpoint and + // XksProxyUriPath values must be unique in the Amazon Web Services account and + // Region. You can change this value when the external key store is connected or // disconnected. XksProxyUriPath *string // Changes the name that KMS uses to identify the Amazon VPC endpoint service for // your external key store proxy (XKS proxy). This parameter is valid when the // CustomKeyStoreType is EXTERNAL_KEY_STORE and the XksProxyConnectivity is - // VPC_ENDPOINT_SERVICE . - // - // To change this value, the external key store must be disconnected. + // VPC_ENDPOINT_SERVICE . To change this value, the external key store must be + // disconnected. XksProxyVpcEndpointServiceName *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go index 59aeba93b78..d3636033222 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go @@ -10,29 +10,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the description of a KMS key. To see the description of a KMS key, use DescribeKey -// . -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: No. You cannot perform this operation on a KMS key in a -// different Amazon Web Services account. -// -// Required permissions: [kms:UpdateKeyDescription] (key policy) -// -// # Related operations -// -// # CreateKey -// -// # DescribeKey +// Updates the description of a KMS key. To see the description of a KMS key, use +// DescribeKey . The KMS key that you use for this operation must be in a +// compatible key state. For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a KMS key in a different Amazon Web Services account. +// Required permissions: kms:UpdateKeyDescription (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// - CreateKey +// - DescribeKey // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [kms:UpdateKeyDescription]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) UpdateKeyDescription(ctx context.Context, params *UpdateKeyDescriptionInput, optFns ...func(*Options)) (*UpdateKeyDescriptionOutput, error) { if params == nil { params = &UpdateKeyDescriptionInput{} @@ -50,26 +40,19 @@ func (c *Client) UpdateKeyDescription(ctx context.Context, params *UpdateKeyDesc type UpdateKeyDescriptionInput struct { - // New description for the KMS key. - // - // Do not include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. + // New description for the KMS key. Do not include confidential or sensitive + // information in this field. This field may be displayed in plaintext in + // CloudTrail logs and other output. // // This member is required. Description *string - // Updates the description of the specified KMS key. - // - // Specify the key ID or key ARN of the KMS key. - // - // For example: - // + // Updates the description of the specified KMS key. Specify the key ID or key ARN + // of the KMS key. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go index 2182c64e622..ee5bbc6e8f7 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go @@ -10,81 +10,61 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Changes the primary key of a multi-Region key. -// -// This operation changes the replica key in the specified Region to a primary key -// and changes the former primary key to a replica key. For example, suppose you -// have a primary key in us-east-1 and a replica key in eu-west-2 . If you run -// UpdatePrimaryRegion with a PrimaryRegion value of eu-west-2 , the primary key is -// now the key in eu-west-2 , and the key in us-east-1 becomes a replica key. For -// details, see [Updating the primary Region]in the Key Management Service Developer Guide. -// -// This operation supports multi-Region keys, an KMS feature that lets you create -// multiple interoperable KMS keys in different Amazon Web Services Regions. -// Because these KMS keys have the same key ID, key material, and other metadata, -// you can use them interchangeably to encrypt data in one Amazon Web Services -// Region and decrypt it in a different Amazon Web Services Region without -// re-encrypting the data or making a cross-Region call. For more information about -// multi-Region keys, see [Multi-Region keys in KMS]in the Key Management Service Developer Guide. -// -// The primary key of a multi-Region key is the source for properties that are -// always shared by primary and replica keys, including the key material, [key ID], [key spec], [key usage], [key material origin], -// and [automatic key rotation]. It's the only key that can be replicated. You cannot [delete the primary key] until all replica -// keys are deleted. -// -// The key ID and primary Region that you specify uniquely identify the replica -// key that will become the primary key. The primary Region must already have a -// replica key. This operation does not create a KMS key in the specified Region. -// To find the replica keys, use the DescribeKeyoperation on the primary key or any replica -// key. To create a replica key, use the ReplicateKeyoperation. -// -// You can run this operation while using the affected multi-Region keys in -// cryptographic operations. This operation should not delay, interrupt, or cause -// failures in cryptographic operations. -// -// Even after this operation completes, the process of updating the primary Region -// might still be in progress for a few more seconds. Operations such as -// DescribeKey might display both the old and new primary keys as replicas. The old -// and new primary keys have a transient key state of Updating . The original key -// state is restored when the update is complete. While the key state is Updating , -// you can use the keys in cryptographic operations, but you cannot replicate the -// new primary key or perform certain management operations, such as enabling or -// disabling these keys. For details about the Updating key state, see [Key states of KMS keys] in the Key -// Management Service Developer Guide. -// -// This operation does not return any output. To verify that primary key is -// changed, use the DescribeKeyoperation. -// -// Cross-account use: No. You cannot use this operation in a different Amazon Web -// Services account. -// -// Required permissions: -// +// Changes the primary key of a multi-Region key. This operation changes the +// replica key in the specified Region to a primary key and changes the former +// primary key to a replica key. For example, suppose you have a primary key in +// us-east-1 and a replica key in eu-west-2 . If you run UpdatePrimaryRegion with +// a PrimaryRegion value of eu-west-2 , the primary key is now the key in eu-west-2 +// , and the key in us-east-1 becomes a replica key. For details, see Updating the +// primary Region (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-update) +// in the Key Management Service Developer Guide. This operation supports +// multi-Region keys, an KMS feature that lets you create multiple interoperable +// KMS keys in different Amazon Web Services Regions. Because these KMS keys have +// the same key ID, key material, and other metadata, you can use them +// interchangeably to encrypt data in one Amazon Web Services Region and decrypt it +// in a different Amazon Web Services Region without re-encrypting the data or +// making a cross-Region call. For more information about multi-Region keys, see +// Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) +// in the Key Management Service Developer Guide. The primary key of a multi-Region +// key is the source for properties that are always shared by primary and replica +// keys, including the key material, key ID (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) +// , key spec (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec) +// , key usage (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage) +// , key material origin (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin) +// , and automatic key rotation (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) +// . It's the only key that can be replicated. You cannot delete the primary key (https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) +// until all replica keys are deleted. The key ID and primary Region that you +// specify uniquely identify the replica key that will become the primary key. The +// primary Region must already have a replica key. This operation does not create a +// KMS key in the specified Region. To find the replica keys, use the DescribeKey +// operation on the primary key or any replica key. To create a replica key, use +// the ReplicateKey operation. You can run this operation while using the affected +// multi-Region keys in cryptographic operations. This operation should not delay, +// interrupt, or cause failures in cryptographic operations. Even after this +// operation completes, the process of updating the primary Region might still be +// in progress for a few more seconds. Operations such as DescribeKey might +// display both the old and new primary keys as replicas. The old and new primary +// keys have a transient key state of Updating . The original key state is restored +// when the update is complete. While the key state is Updating , you can use the +// keys in cryptographic operations, but you cannot replicate the new primary key +// or perform certain management operations, such as enabling or disabling these +// keys. For details about the Updating key state, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. This operation does not return +// any output. To verify that primary key is changed, use the DescribeKey +// operation. Cross-account use: No. You cannot use this operation in a different +// Amazon Web Services account. Required permissions: // - kms:UpdatePrimaryRegion on the current primary key (in the primary key's // Region). Include this permission primary key's key policy. -// // - kms:UpdatePrimaryRegion on the current replica key (in the replica key's // Region). Include this permission in the replica key's key policy. // -// # Related operations -// -// # CreateKey -// -// # ReplicateKey +// Related operations +// - CreateKey +// - ReplicateKey // // Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [key ID]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [delete the primary key]: https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html -// [key usage]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage -// [Updating the primary Region]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-update -// [Multi-Region keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html -// [key spec]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec -// [key material origin]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin -// [automatic key rotation]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) UpdatePrimaryRegion(ctx context.Context, params *UpdatePrimaryRegionInput, optFns ...func(*Options)) (*UpdatePrimaryRegionOutput, error) { if params == nil { params = &UpdatePrimaryRegionInput{} @@ -103,28 +83,20 @@ func (c *Client) UpdatePrimaryRegion(ctx context.Context, params *UpdatePrimaryR type UpdatePrimaryRegionInput struct { // Identifies the current primary key. When the operation completes, this KMS key - // will be a replica key. - // - // Specify the key ID or key ARN of a multi-Region primary key. - // - // For example: - // + // will be a replica key. Specify the key ID or key ARN of a multi-Region primary + // key. For example: // - Key ID: mrk-1234abcd12ab34cd56ef1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . // // This member is required. KeyId *string // The Amazon Web Services Region of the new primary key. Enter the Region ID, // such as us-east-1 or ap-southeast-2 . There must be an existing replica key in - // this Region. - // - // When the operation completes, the multi-Region key in this Region will be the - // primary key. + // this Region. When the operation completes, the multi-Region key in this Region + // will be the primary key. // // This member is required. PrimaryRegion *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go index 9c2ba35636c..6b880e43af4 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go @@ -12,56 +12,40 @@ import ( ) // Verifies a digital signature that was generated by the Sign operation. -// // Verification confirms that an authorized user signed the message with the // specified KMS key and signing algorithm, and the message hasn't changed since it // was signed. If the signature is verified, the value of the SignatureValid field // in the response is True . If the signature verification fails, the Verify -// operation fails with an KMSInvalidSignatureException exception. -// -// A digital signature is generated by using the private key in an asymmetric KMS -// key. The signature is verified by using the public key in the same asymmetric -// KMS key. For information about asymmetric KMS keys, see [Asymmetric KMS keys]in the Key Management -// Service Developer Guide. -// -// To use the Verify operation, specify the same asymmetric KMS key, message, and -// signing algorithm that were used to produce the signature. The message type does -// not need to be the same as the one used for signing, but it must indicate -// whether the value of the Message parameter should be hashed as part of the -// verification process. -// -// You can also verify the digital signature by using the public key of the KMS -// key outside of KMS. Use the GetPublicKeyoperation to download the public key in the +// operation fails with an KMSInvalidSignatureException exception. A digital +// signature is generated by using the private key in an asymmetric KMS key. The +// signature is verified by using the public key in the same asymmetric KMS key. +// For information about asymmetric KMS keys, see Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the Key Management Service Developer Guide. To use the Verify operation, +// specify the same asymmetric KMS key, message, and signing algorithm that were +// used to produce the signature. The message type does not need to be the same as +// the one used for signing, but it must indicate whether the value of the Message +// parameter should be hashed as part of the verification process. You can also +// verify the digital signature by using the public key of the KMS key outside of +// KMS. Use the GetPublicKey operation to download the public key in the // asymmetric KMS key and then use the public key to verify the signature outside // of KMS. The advantage of using the Verify operation is that it is performed // within KMS. As a result, it's easy to call, the operation is performed within // the FIPS boundary, it is logged in CloudTrail, and you can use key policy and // IAM policy to determine who is authorized to use the KMS key to verify -// signatures. -// -// To verify a signature outside of KMS with an SM2 public key (China Regions -// only), you must specify the distinguishing ID. By default, KMS uses -// 1234567812345678 as the distinguishing ID. For more information, see [Offline verification with SM2 key pairs]. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:Verify] (key policy) -// -// Related operations: Sign -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [Asymmetric KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html -// [Offline verification with SM2 key pairs]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification -// [kms:Verify]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html +// signatures. To verify a signature outside of KMS with an SM2 public key (China +// Regions only), you must specify the distinguishing ID. By default, KMS uses +// 1234567812345678 as the distinguishing ID. For more information, see Offline +// verification with SM2 key pairs (https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification) +// . The KMS key that you use for this operation must be in a compatible key state. +// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide. Cross-account use: Yes. To +// perform this operation with a KMS key in a different Amazon Web Services +// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// Required permissions: kms:Verify (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: Sign Eventual consistency: The KMS API follows +// an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) Verify(ctx context.Context, params *VerifyInput, optFns ...func(*Options)) (*VerifyOutput, error) { if params == nil { params = &VerifyInput{} @@ -81,36 +65,26 @@ type VerifyInput struct { // Identifies the asymmetric KMS key that will be used to verify the signature. // This must be the same KMS key that was used to generate the signature. If you - // specify a different KMS key, the signature verification fails. - // - // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When - // using an alias name, prefix it with "alias/" . To specify a KMS key in a - // different Amazon Web Services account, you must use the key ARN or alias ARN. - // - // For example: - // + // specify a different KMS key, the signature verification fails. To specify a KMS + // key, use its key ID, key ARN, alias name, or alias ARN. When using an alias + // name, prefix it with "alias/" . To specify a KMS key in a different Amazon Web + // Services account, you must use the key ARN or alias ARN. For example: // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // // - Alias name: alias/ExampleAlias - // // - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - // - // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name - // and alias ARN, use ListAliases. + // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey . To + // get the alias name and alias ARN, use ListAliases . // // This member is required. KeyId *string // Specifies the message that was signed. You can submit a raw message of up to // 4096 bytes, or a hash digest of the message. If you submit a digest, use the - // MessageType parameter with a value of DIGEST . - // - // If the message specified here is different from the message that was signed, - // the signature verification fails. A message and its hash digest are considered - // to be the same message. + // MessageType parameter with a value of DIGEST . If the message specified here is + // different from the message that was signed, the signature verification fails. A + // message and its hash digest are considered to be the same message. // // This member is required. Message []byte @@ -126,56 +100,38 @@ type VerifyInput struct { // This member is required. SigningAlgorithm types.SigningAlgorithmSpec - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string // Tells KMS whether the value of the Message parameter should be hashed as part // of the signing algorithm. Use RAW for unhashed messages; use DIGEST for message - // digests, which are already hashed. - // - // When the value of MessageType is RAW , KMS uses the standard signing algorithm, - // which begins with a hash function. When the value is DIGEST , KMS skips the - // hashing step in the signing algorithm. - // - // Use the DIGEST value only when the value of the Message parameter is a message - // digest. If you use the DIGEST value with an unhashed message, the security of - // the verification operation can be compromised. - // - // When the value of MessageType is DIGEST , the length of the Message value must - // match the length of hashed messages for the specified signing algorithm. - // - // You can submit a message digest and omit the MessageType or specify RAW so the - // digest is hashed again while signing. However, if the signed message is hashed - // once while signing, but twice while verifying, verification fails, even when the - // message hasn't changed. - // - // The hashing algorithm in that Verify uses is based on the SigningAlgorithm - // value. - // + // digests, which are already hashed. When the value of MessageType is RAW , KMS + // uses the standard signing algorithm, which begins with a hash function. When the + // value is DIGEST , KMS skips the hashing step in the signing algorithm. Use the + // DIGEST value only when the value of the Message parameter is a message digest. + // If you use the DIGEST value with an unhashed message, the security of the + // verification operation can be compromised. When the value of MessageType is + // DIGEST , the length of the Message value must match the length of hashed + // messages for the specified signing algorithm. You can submit a message digest + // and omit the MessageType or specify RAW so the digest is hashed again while + // signing. However, if the signed message is hashed once while signing, but twice + // while verifying, verification fails, even when the message hasn't changed. The + // hashing algorithm in that Verify uses is based on the SigningAlgorithm value. // - Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm. - // // - Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm. - // // - Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm. - // - // - SM2DSA uses the SM3 hashing algorithm. For details, see [Offline verification with SM2 key pairs]. - // - // [Offline verification with SM2 key pairs]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification + // - SM2DSA uses the SM3 hashing algorithm. For details, see Offline + // verification with SM2 key pairs (https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification) + // . MessageType types.MessageType noSmithyDocumentSerde @@ -183,10 +139,8 @@ type VerifyInput struct { type VerifyOutput struct { - // The Amazon Resource Name ([key ARN] ) of the asymmetric KMS key that was used to verify - // the signature. - // - // [key ARN]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN + // The Amazon Resource Name ( key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) + // ) of the asymmetric KMS key that was used to verify the signature. KeyId *string // A Boolean value that indicates whether the signature was verified. A value of diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go index 27bfa87ab1b..cbffec19181 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go @@ -17,33 +17,22 @@ import ( // specify, and compares the computed HMAC to the HMAC that you specify. If the // HMACs are identical, the verification succeeds; otherwise, it fails. // Verification indicates that the message hasn't changed since the HMAC was -// calculated, and the specified key was used to generate and verify the HMAC. -// -// HMAC KMS keys and the HMAC algorithms that KMS uses conform to industry -// standards defined in [RFC 2104]. -// -// This operation is part of KMS support for HMAC KMS keys. For details, see [HMAC keys in KMS] in -// the Key Management Service Developer Guide. -// -// The KMS key that you use for this operation must be in a compatible key state. -// For details, see [Key states of KMS keys]in the Key Management Service Developer Guide. -// -// Cross-account use: Yes. To perform this operation with a KMS key in a different -// Amazon Web Services account, specify the key ARN or alias ARN in the value of -// the KeyId parameter. -// -// Required permissions: [kms:VerifyMac] (key policy) -// -// Related operations: GenerateMac -// -// Eventual consistency: The KMS API follows an eventual consistency model. For -// more information, see [KMS eventual consistency]. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html -// [RFC 2104]: https://datatracker.ietf.org/doc/html/rfc2104 -// [kms:VerifyMac]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html -// [KMS eventual consistency]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html -// [HMAC keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html +// calculated, and the specified key was used to generate and verify the HMAC. HMAC +// KMS keys and the HMAC algorithms that KMS uses conform to industry standards +// defined in RFC 2104 (https://datatracker.ietf.org/doc/html/rfc2104) . This +// operation is part of KMS support for HMAC KMS keys. For details, see HMAC keys +// in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) in the +// Key Management Service Developer Guide. The KMS key that you use for this +// operation must be in a compatible key state. For details, see Key states of KMS +// keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in +// the Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a KMS key in a different Amazon Web Services account, +// specify the key ARN or alias ARN in the value of the KeyId parameter. Required +// permissions: kms:VerifyMac (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: GenerateMac Eventual consistency: The KMS API +// follows an eventual consistency model. For more information, see KMS eventual +// consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html) +// . func (c *Client) VerifyMac(ctx context.Context, params *VerifyMacInput, optFns ...func(*Options)) (*VerifyMacOutput, error) { if params == nil { params = &VerifyMacInput{} @@ -61,17 +50,16 @@ func (c *Client) VerifyMac(ctx context.Context, params *VerifyMacInput, optFns . type VerifyMacInput struct { - // The KMS key that will be used in the verification. - // - // Enter a key ID of the KMS key that was used to generate the HMAC. If you - // identify a different KMS key, the VerifyMac operation fails. + // The KMS key that will be used in the verification. Enter a key ID of the KMS + // key that was used to generate the HMAC. If you identify a different KMS key, the + // VerifyMac operation fails. // // This member is required. KeyId *string - // The HMAC to verify. Enter the HMAC that was generated by the GenerateMac operation when - // you specified the same message, HMAC KMS key, and MAC algorithm as the values - // specified in this request. + // The HMAC to verify. Enter the HMAC that was generated by the GenerateMac + // operation when you specified the same message, HMAC KMS key, and MAC algorithm + // as the values specified in this request. // // This member is required. Mac []byte @@ -84,31 +72,23 @@ type VerifyMacInput struct { MacAlgorithm types.MacAlgorithmSpec // The message that will be used in the verification. Enter the same message that - // was used to generate the HMAC. - // - // GenerateMacand VerifyMac do not provide special handling for message digests. If you - // generated an HMAC for a hash digest of a message, you must verify the HMAC for - // the same hash digest. + // was used to generate the HMAC. GenerateMac and VerifyMac do not provide special + // handling for message digests. If you generated an HMAC for a hash digest of a + // message, you must verify the HMAC for the same hash digest. // // This member is required. Message []byte - // Checks if your request will succeed. DryRun is an optional parameter. - // - // To learn more about how to use this parameter, see [Testing your KMS API calls] in the Key Management - // Service Developer Guide. - // - // [Testing your KMS API calls]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html + // Checks if your request will succeed. DryRun is an optional parameter. To learn + // more about how to use this parameter, see Testing your KMS API calls (https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html) + // in the Key Management Service Developer Guide. DryRun *bool - // A list of grant tokens. - // - // Use a grant token when your permission to call this operation comes from a new - // grant that has not yet achieved eventual consistency. For more information, see [Grant token] - // and [Using a grant token]in the Key Management Service Developer Guide. - // - // [Grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token - // [Using a grant token]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token + // A list of grant tokens. Use a grant token when your permission to call this + // operation comes from a new grant that has not yet achieved eventual consistency. + // For more information, see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) + // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) + // in the Key Management Service Developer Guide. GrantTokens []string noSmithyDocumentSerde @@ -124,11 +104,9 @@ type VerifyMacOutput struct { // A Boolean value that indicates whether the HMAC was verified. A value of True // indicates that the HMAC ( Mac ) was generated with the specified Message , HMAC - // KMS key ( KeyID ) and MacAlgorithm. . - // - // If the HMAC is not verified, the VerifyMac operation fails with a - // KMSInvalidMacException exception. This exception indicates that one or more of - // the inputs changed since the HMAC was computed. + // KMS key ( KeyID ) and MacAlgorithm. . If the HMAC is not verified, the VerifyMac + // operation fails with a KMSInvalidMacException exception. This exception + // indicates that one or more of the inputs changed since the HMAC was computed. MacValid bool // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/deserializers.go index c1a69f0f6cb..b4bdc25e3cf 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/deserializers.go @@ -19,17 +19,8 @@ import ( "io" "io/ioutil" "strings" - "time" ) -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - type awsAwsjson11_deserializeOpCancelKeyDeletion struct { } @@ -3894,128 +3885,6 @@ func awsAwsjson11_deserializeOpErrorListKeyPolicies(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListKeyRotations struct { -} - -func (*awsAwsjson11_deserializeOpListKeyRotations) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListKeyRotations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListKeyRotations(response, &metadata) - } - output := &ListKeyRotationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListKeyRotationsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListKeyRotations(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidArnException", errorCode): - return awsAwsjson11_deserializeErrorInvalidArnException(response, errorBody) - - case strings.EqualFold("InvalidMarkerException", errorCode): - return awsAwsjson11_deserializeErrorInvalidMarkerException(response, errorBody) - - case strings.EqualFold("KMSInternalException", errorCode): - return awsAwsjson11_deserializeErrorKMSInternalException(response, errorBody) - - case strings.EqualFold("KMSInvalidStateException", errorCode): - return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - type awsAwsjson11_deserializeOpListKeys struct { } @@ -4950,137 +4819,6 @@ func awsAwsjson11_deserializeOpErrorRevokeGrant(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpRotateKeyOnDemand struct { -} - -func (*awsAwsjson11_deserializeOpRotateKeyOnDemand) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpRotateKeyOnDemand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRotateKeyOnDemand(response, &metadata) - } - output := &RotateKeyOnDemandOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentRotateKeyOnDemandOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorRotateKeyOnDemand(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("DependencyTimeoutException", errorCode): - return awsAwsjson11_deserializeErrorDependencyTimeoutException(response, errorBody) - - case strings.EqualFold("DisabledException", errorCode): - return awsAwsjson11_deserializeErrorDisabledException(response, errorBody) - - case strings.EqualFold("InvalidArnException", errorCode): - return awsAwsjson11_deserializeErrorInvalidArnException(response, errorBody) - - case strings.EqualFold("KMSInternalException", errorCode): - return awsAwsjson11_deserializeErrorKMSInternalException(response, errorBody) - - case strings.EqualFold("KMSInvalidStateException", errorCode): - return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - type awsAwsjson11_deserializeOpScheduleKeyDeletion struct { } @@ -6452,41 +6190,6 @@ func awsAwsjson11_deserializeErrorCloudHsmClusterNotRelatedException(response *s return output } -func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ConflictException{} - err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - func awsAwsjson11_deserializeErrorCustomKeyStoreHasCMKsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -8286,46 +7989,6 @@ func awsAwsjson11_deserializeDocumentCloudHsmClusterNotRelatedException(v **type return nil } -func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ConflictException - if *v == nil { - sv = &types.ConflictException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessageType to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeDocumentCustomKeyStoreHasCMKsException(v **types.CustomKeyStoreHasCMKsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10389,105 +10052,6 @@ func awsAwsjson11_deserializeDocumentPolicyNameList(v *[]string, value interface return nil } -func awsAwsjson11_deserializeDocumentRotationsList(v *[]types.RotationsListEntry, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RotationsListEntry - if *v == nil { - cv = []types.RotationsListEntry{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RotationsListEntry - destAddr := &col - if err := awsAwsjson11_deserializeDocumentRotationsListEntry(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentRotationsListEntry(v **types.RotationsListEntry, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RotationsListEntry - if *v == nil { - sv = &types.RotationsListEntry{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "KeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KeyIdType to be of type string, got %T instead", value) - } - sv.KeyId = ptr.String(jtv) - } - - case "RotationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "RotationType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RotationType to be of type string, got %T instead", value) - } - sv.RotationType = types.RotationType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeDocumentSigningAlgorithmSpecList(v *[]types.SigningAlgorithmSpec, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12266,15 +11830,6 @@ func awsAwsjson11_deserializeOpDocumentGetKeyRotationStatusOutput(v **GetKeyRota for key, value := range shape { switch key { - case "KeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KeyIdType to be of type string, got %T instead", value) - } - sv.KeyId = ptr.String(jtv) - } - case "KeyRotationEnabled": if value != nil { jtv, ok := value.(bool) @@ -12284,51 +11839,6 @@ func awsAwsjson11_deserializeOpDocumentGetKeyRotationStatusOutput(v **GetKeyRota sv.KeyRotationEnabled = jtv } - case "NextRotationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.NextRotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "OnDemandRotationStartDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.OnDemandRotationStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "RotationPeriodInDays": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected RotationPeriodInDaysType to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.RotationPeriodInDays = ptr.Int32(int32(i64)) - } - default: _, _ = key, value @@ -12703,60 +12213,6 @@ func awsAwsjson11_deserializeOpDocumentListKeyPoliciesOutput(v **ListKeyPolicies return nil } -func awsAwsjson11_deserializeOpDocumentListKeyRotationsOutput(v **ListKeyRotationsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListKeyRotationsOutput - if *v == nil { - sv = &ListKeyRotationsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextMarker": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MarkerType to be of type string, got %T instead", value) - } - sv.NextMarker = ptr.String(jtv) - } - - case "Rotations": - if err := awsAwsjson11_deserializeDocumentRotationsList(&sv.Rotations, value); err != nil { - return err - } - - case "Truncated": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BooleanType to be of type *bool, got %T instead", value) - } - sv.Truncated = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeOpDocumentListKeysOutput(v **ListKeysOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13049,46 +12505,6 @@ func awsAwsjson11_deserializeOpDocumentReplicateKeyOutput(v **ReplicateKeyOutput return nil } -func awsAwsjson11_deserializeOpDocumentRotateKeyOnDemandOutput(v **RotateKeyOnDemandOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *RotateKeyOnDemandOutput - if *v == nil { - sv = &RotateKeyOnDemandOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "KeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected KeyIdType to be of type string, got %T instead", value) - } - sv.KeyId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeOpDocumentScheduleKeyDeletionOutput(v **ScheduleKeyDeletionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/doc.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/doc.go index f989361a183..266b4e11176 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/doc.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/doc.go @@ -3,95 +3,62 @@ // Package kms provides the API client, operations, and parameter types for AWS // Key Management Service. // -// # Key Management Service -// -// Key Management Service (KMS) is an encryption and key management web service. -// This guide describes the KMS operations that you can call programmatically. For -// general information about KMS, see the [Key Management Service Developer Guide]. -// -// KMS has replaced the term customer master key (CMK) with KMS key and KMS key. +// Key Management Service Key Management Service (KMS) is an encryption and key +// management web service. This guide describes the KMS operations that you can +// call programmatically. For general information about KMS, see the Key +// Management Service Developer Guide (https://docs.aws.amazon.com/kms/latest/developerguide/) +// . KMS has replaced the term customer master key (CMK) with KMS key and KMS key. // The concept has not changed. To prevent breaking changes, KMS is keeping some -// variations of this term. -// -// Amazon Web Services provides SDKs that consist of libraries and sample code for -// various programming languages and platforms (Java, Ruby, .Net, macOS, Android, -// etc.). The SDKs provide a convenient way to create programmatic access to KMS -// and other Amazon Web Services services. For example, the SDKs take care of tasks -// such as signing requests (see below), managing errors, and retrying requests -// automatically. For more information about the Amazon Web Services SDKs, -// including how to download and install them, see [Tools for Amazon Web Services]. -// -// We recommend that you use the Amazon Web Services SDKs to make programmatic API -// calls to KMS. -// -// If you need to use FIPS 140-2 validated cryptographic modules when -// communicating with Amazon Web Services, use the FIPS endpoint in your preferred -// Amazon Web Services Region. For more information about the available FIPS -// endpoints, see [Service endpoints]in the Key Management Service topic of the Amazon Web Services -// General Reference. -// +// variations of this term. Amazon Web Services provides SDKs that consist of +// libraries and sample code for various programming languages and platforms (Java, +// Ruby, .Net, macOS, Android, etc.). The SDKs provide a convenient way to create +// programmatic access to KMS and other Amazon Web Services services. For example, +// the SDKs take care of tasks such as signing requests (see below), managing +// errors, and retrying requests automatically. For more information about the +// Amazon Web Services SDKs, including how to download and install them, see Tools +// for Amazon Web Services (http://aws.amazon.com/tools/) . We recommend that you +// use the Amazon Web Services SDKs to make programmatic API calls to KMS. If you +// need to use FIPS 140-2 validated cryptographic modules when communicating with +// Amazon Web Services, use the FIPS endpoint in your preferred Amazon Web Services +// Region. For more information about the available FIPS endpoints, see Service +// endpoints (https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region) in +// the Key Management Service topic of the Amazon Web Services General Reference. // All KMS API calls must be signed and be transmitted using Transport Layer // Security (TLS). KMS recommends you always use the latest supported TLS version. // Clients must also support cipher suites with Perfect Forward Secrecy (PFS) such // as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman // (ECDHE). Most modern systems such as Java 7 and later support these modes. -// -// # Signing Requests -// -// Requests must be signed using an access key ID and a secret access key. We -// strongly recommend that you do not use your Amazon Web Services account root -// access key ID and secret access key for everyday work. You can use the access -// key ID and secret access key for an IAM user or you can use the Security Token -// Service (STS) to generate temporary security credentials and use those to sign -// requests. -// -// All KMS requests must be signed with [Signature Version 4]. -// -// # Logging API Requests -// -// KMS supports CloudTrail, a service that logs Amazon Web Services API calls and -// related events for your Amazon Web Services account and delivers them to an -// Amazon S3 bucket that you specify. By using the information collected by -// CloudTrail, you can determine what requests were made to KMS, who made the -// request, when it was made, and so on. To learn more about CloudTrail, including -// how to turn it on and find your log files, see the [CloudTrail User Guide]. -// -// # Additional Resources -// -// For more information about credentials and request signing, see the following: -// -// [Amazon Web Services Security Credentials] -// - - This topic provides general information about the types of credentials -// used to access Amazon Web Services. -// -// [Temporary Security Credentials] -// - - This section of the IAM User Guide describes how to create and use -// temporary security credentials. -// -// [Signature Version 4 Signing Process] -// - - This set of topics walks you through the process of signing a request -// using an access key ID and a secret access key. -// -// # Commonly Used API Operations -// -// Of the API operations discussed in this guide, the following will prove the -// most useful for most applications. You will likely perform operations other than -// these, such as creating keys and assigning policies, by using the console. -// -// # Encrypt -// -// # Decrypt -// -// # GenerateDataKey -// -// # GenerateDataKeyWithoutPlaintext -// -// [Signature Version 4]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html -// [Tools for Amazon Web Services]: http://aws.amazon.com/tools/ -// [Amazon Web Services Security Credentials]: https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html -// [Key Management Service Developer Guide]: https://docs.aws.amazon.com/kms/latest/developerguide/ -// [Service endpoints]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region -// [CloudTrail User Guide]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/ -// [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html +// Signing Requests Requests must be signed using an access key ID and a secret +// access key. We strongly recommend that you do not use your Amazon Web Services +// account root access key ID and secret access key for everyday work. You can use +// the access key ID and secret access key for an IAM user or you can use the +// Security Token Service (STS) to generate temporary security credentials and use +// those to sign requests. All KMS requests must be signed with Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) +// . Logging API Requests KMS supports CloudTrail, a service that logs Amazon Web +// Services API calls and related events for your Amazon Web Services account and +// delivers them to an Amazon S3 bucket that you specify. By using the information +// collected by CloudTrail, you can determine what requests were made to KMS, who +// made the request, when it was made, and so on. To learn more about CloudTrail, +// including how to turn it on and find your log files, see the CloudTrail User +// Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/) . Additional +// Resources For more information about credentials and request signing, see the +// following: +// - Amazon Web Services Security Credentials (https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) +// - This topic provides general information about the types of credentials used to +// access Amazon Web Services. +// - Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) +// - This section of the IAM User Guide describes how to create and use temporary +// security credentials. +// - Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) +// - This set of topics walks you through the process of signing a request using an +// access key ID and a secret access key. +// +// Commonly Used API Operations Of the API operations discussed in this guide, the +// following will prove the most useful for most applications. You will likely +// perform operations other than these, such as creating keys and assigning +// policies, by using the console. +// - Encrypt +// - Decrypt +// - GenerateDataKey +// - GenerateDataKeyWithoutPlaintext package kms diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json index ab000facbdf..0a713e7f403 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json @@ -40,7 +40,6 @@ "api_op_ListAliases.go", "api_op_ListGrants.go", "api_op_ListKeyPolicies.go", - "api_op_ListKeyRotations.go", "api_op_ListKeys.go", "api_op_ListResourceTags.go", "api_op_ListRetirableGrants.go", @@ -49,7 +48,6 @@ "api_op_ReplicateKey.go", "api_op_RetireGrant.go", "api_op_RevokeGrant.go", - "api_op_RotateKeyOnDemand.go", "api_op_ScheduleKeyDeletion.go", "api_op_Sign.go", "api_op_TagResource.go", diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go index 9e459d38e97..9e5cd17e5ba 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go @@ -3,4 +3,4 @@ package kms // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.32.1" +const goModuleVersion = "1.30.0" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go index 11be534415f..b24e2565947 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go @@ -50,10 +50,8 @@ type Options struct { // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a // value for this field will likely prevent you from using any endpoint-related // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service operation. This should be @@ -72,20 +70,17 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable @@ -102,9 +97,8 @@ type Options struct { // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP @@ -149,7 +143,6 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { // Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for // this field will likely prevent you from using any endpoint-related service // features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// // To migrate an EndpointResolver implementation that uses a custom endpoint, set // the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/serializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/serializers.go index da221755ba4..e477fe0ab61 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/serializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/serializers.go @@ -1776,61 +1776,6 @@ func (m *awsAwsjson11_serializeOpListKeyPolicies) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListKeyRotations struct { -} - -func (*awsAwsjson11_serializeOpListKeyRotations) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListKeyRotations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListKeyRotationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("TrentService.ListKeyRotations") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListKeyRotationsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} - type awsAwsjson11_serializeOpListKeys struct { } @@ -2271,61 +2216,6 @@ func (m *awsAwsjson11_serializeOpRevokeGrant) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpRotateKeyOnDemand struct { -} - -func (*awsAwsjson11_serializeOpRotateKeyOnDemand) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpRotateKeyOnDemand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*RotateKeyOnDemandInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("TrentService.RotateKeyOnDemand") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentRotateKeyOnDemandInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} - type awsAwsjson11_serializeOpScheduleKeyDeletion struct { } @@ -3408,11 +3298,6 @@ func awsAwsjson11_serializeOpDocumentEnableKeyRotationInput(v *EnableKeyRotation ok.String(*v.KeyId) } - if v.RotationPeriodInDays != nil { - ok := object.Key("RotationPeriodInDays") - ok.Integer(*v.RotationPeriodInDays) - } - return nil } @@ -3861,28 +3746,6 @@ func awsAwsjson11_serializeOpDocumentListKeyPoliciesInput(v *ListKeyPoliciesInpu return nil } -func awsAwsjson11_serializeOpDocumentListKeyRotationsInput(v *ListKeyRotationsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.KeyId != nil { - ok := object.Key("KeyId") - ok.String(*v.KeyId) - } - - if v.Limit != nil { - ok := object.Key("Limit") - ok.Integer(*v.Limit) - } - - if v.Marker != nil { - ok := object.Key("Marker") - ok.String(*v.Marker) - } - - return nil -} - func awsAwsjson11_serializeOpDocumentListKeysInput(v *ListKeysInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4117,18 +3980,6 @@ func awsAwsjson11_serializeOpDocumentRevokeGrantInput(v *RevokeGrantInput, value return nil } -func awsAwsjson11_serializeOpDocumentRotateKeyOnDemandInput(v *RotateKeyOnDemandInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.KeyId != nil { - ok := object.Key("KeyId") - ok.String(*v.KeyId) - } - - return nil -} - func awsAwsjson11_serializeOpDocumentScheduleKeyDeletionInput(v *ScheduleKeyDeletionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/enums.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/enums.go index f7882c6bc4b..f5da8f5b920 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/enums.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/enums.go @@ -11,13 +11,11 @@ const ( AlgorithmSpecRsaesOaepSha256 AlgorithmSpec = "RSAES_OAEP_SHA_256" AlgorithmSpecRsaAesKeyWrapSha1 AlgorithmSpec = "RSA_AES_KEY_WRAP_SHA_1" AlgorithmSpecRsaAesKeyWrapSha256 AlgorithmSpec = "RSA_AES_KEY_WRAP_SHA_256" - AlgorithmSpecSm2pke AlgorithmSpec = "SM2PKE" ) // Values returns all known values for AlgorithmSpec. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (AlgorithmSpec) Values() []AlgorithmSpec { return []AlgorithmSpec{ "RSAES_PKCS1_V1_5", @@ -25,7 +23,6 @@ func (AlgorithmSpec) Values() []AlgorithmSpec { "RSAES_OAEP_SHA_256", "RSA_AES_KEY_WRAP_SHA_1", "RSA_AES_KEY_WRAP_SHA_256", - "SM2PKE", } } @@ -54,9 +51,8 @@ const ( ) // Values returns all known values for ConnectionErrorCodeType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (ConnectionErrorCodeType) Values() []ConnectionErrorCodeType { return []ConnectionErrorCodeType{ "INVALID_CREDENTIALS", @@ -92,9 +88,8 @@ const ( ) // Values returns all known values for ConnectionStateType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (ConnectionStateType) Values() []ConnectionStateType { return []ConnectionStateType{ "CONNECTED", @@ -125,9 +120,8 @@ const ( ) // Values returns all known values for CustomerMasterKeySpec. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (CustomerMasterKeySpec) Values() []CustomerMasterKeySpec { return []CustomerMasterKeySpec{ "RSA_2048", @@ -155,9 +149,8 @@ const ( ) // Values returns all known values for CustomKeyStoreType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (CustomKeyStoreType) Values() []CustomKeyStoreType { return []CustomKeyStoreType{ "AWS_CLOUDHSM", @@ -180,9 +173,8 @@ const ( ) // Values returns all known values for DataKeyPairSpec. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (DataKeyPairSpec) Values() []DataKeyPairSpec { return []DataKeyPairSpec{ "RSA_2048", @@ -205,9 +197,8 @@ const ( ) // Values returns all known values for DataKeySpec. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. func (DataKeySpec) Values() []DataKeySpec { return []DataKeySpec{ "AES_256", @@ -226,9 +217,8 @@ const ( ) // Values returns all known values for EncryptionAlgorithmSpec. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (EncryptionAlgorithmSpec) Values() []EncryptionAlgorithmSpec { return []EncryptionAlgorithmSpec{ "SYMMETRIC_DEFAULT", @@ -247,9 +237,8 @@ const ( ) // Values returns all known values for ExpirationModelType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (ExpirationModelType) Values() []ExpirationModelType { return []ExpirationModelType{ "KEY_MATERIAL_EXPIRES", @@ -280,9 +269,8 @@ const ( ) // Values returns all known values for GrantOperation. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (GrantOperation) Values() []GrantOperation { return []GrantOperation{ "Decrypt", @@ -312,9 +300,8 @@ const ( ) // Values returns all known values for KeyEncryptionMechanism. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (KeyEncryptionMechanism) Values() []KeyEncryptionMechanism { return []KeyEncryptionMechanism{ "RSAES_OAEP_SHA_256", @@ -330,9 +317,8 @@ const ( ) // Values returns all known values for KeyManagerType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (KeyManagerType) Values() []KeyManagerType { return []KeyManagerType{ "AWS", @@ -360,9 +346,8 @@ const ( ) // Values returns all known values for KeySpec. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. The ordering of this +// slice is not guaranteed to be stable across updates. func (KeySpec) Values() []KeySpec { return []KeySpec{ "RSA_2048", @@ -396,9 +381,8 @@ const ( ) // Values returns all known values for KeyState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. The ordering of this +// slice is not guaranteed to be stable across updates. func (KeyState) Values() []KeyState { return []KeyState{ "Creating", @@ -422,9 +406,8 @@ const ( ) // Values returns all known values for KeyUsageType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (KeyUsageType) Values() []KeyUsageType { return []KeyUsageType{ "SIGN_VERIFY", @@ -444,9 +427,8 @@ const ( ) // Values returns all known values for MacAlgorithmSpec. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (MacAlgorithmSpec) Values() []MacAlgorithmSpec { return []MacAlgorithmSpec{ "HMAC_SHA_224", @@ -465,9 +447,8 @@ const ( ) // Values returns all known values for MessageType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. func (MessageType) Values() []MessageType { return []MessageType{ "RAW", @@ -484,9 +465,8 @@ const ( ) // Values returns all known values for MultiRegionKeyType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (MultiRegionKeyType) Values() []MultiRegionKeyType { return []MultiRegionKeyType{ "PRIMARY", @@ -505,9 +485,8 @@ const ( ) // Values returns all known values for OriginType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. func (OriginType) Values() []OriginType { return []OriginType{ "AWS_KMS", @@ -517,25 +496,6 @@ func (OriginType) Values() []OriginType { } } -type RotationType string - -// Enum values for RotationType -const ( - RotationTypeAutomatic RotationType = "AUTOMATIC" - RotationTypeOnDemand RotationType = "ON_DEMAND" -) - -// Values returns all known values for RotationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RotationType) Values() []RotationType { - return []RotationType{ - "AUTOMATIC", - "ON_DEMAND", - } -} - type SigningAlgorithmSpec string // Enum values for SigningAlgorithmSpec @@ -553,9 +513,8 @@ const ( ) // Values returns all known values for SigningAlgorithmSpec. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (SigningAlgorithmSpec) Values() []SigningAlgorithmSpec { return []SigningAlgorithmSpec{ "RSASSA_PSS_SHA_256", @@ -578,19 +537,16 @@ const ( WrappingKeySpecRsa2048 WrappingKeySpec = "RSA_2048" WrappingKeySpecRsa3072 WrappingKeySpec = "RSA_3072" WrappingKeySpecRsa4096 WrappingKeySpec = "RSA_4096" - WrappingKeySpecSm2 WrappingKeySpec = "SM2" ) // Values returns all known values for WrappingKeySpec. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (WrappingKeySpec) Values() []WrappingKeySpec { return []WrappingKeySpec{ "RSA_2048", "RSA_3072", "RSA_4096", - "SM2", } } @@ -604,7 +560,6 @@ const ( // Values returns all known values for XksProxyConnectivityType. Note that this // can be expanded in the future, and so it is only as up to date as the client. -// // The ordering of this slice is not guaranteed to be stable across updates. func (XksProxyConnectivityType) Values() []XksProxyConnectivityType { return []XksProxyConnectivityType{ diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/errors.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/errors.go index 2221044e458..3421fe7cb64 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/errors.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/errors.go @@ -37,13 +37,10 @@ func (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy. // The request was rejected because the specified CloudHSM cluster is already // associated with an CloudHSM key store in the account, or it shares a backup // history with an CloudHSM key store in the account. Each CloudHSM key store in -// the account must be associated with a different CloudHSM cluster. -// -// CloudHSM clusters that share a backup history have the same cluster -// certificate. To view the cluster certificate of an CloudHSM cluster, use the [DescribeClusters] +// the account must be associated with a different CloudHSM cluster. CloudHSM +// clusters that share a backup history have the same cluster certificate. To view +// the cluster certificate of an CloudHSM cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) // operation. -// -// [DescribeClusters]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html type CloudHsmClusterInUseException struct { Message *string @@ -71,37 +68,30 @@ func (e *CloudHsmClusterInUseException) ErrorFault() smithy.ErrorFault { return // The request was rejected because the associated CloudHSM cluster did not meet // the configuration requirements for an CloudHSM key store. -// // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. -// -// - The [security group for the cluster](cloudhsm-cluster--sg) must include inbound rules and outbound rules -// that allow TCP traffic on ports 2223-2225. The Source in the inbound rules and -// the Destination in the outbound rules must match the security group ID. These -// rules are set by default when you create the CloudHSM cluster. Do not delete or -// change them. To get information about a particular security group, use the [DescribeSecurityGroups] +// - The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) +// (cloudhsm-cluster--sg) must include inbound rules and outbound rules that allow +// TCP traffic on ports 2223-2225. The Source in the inbound rules and the +// Destination in the outbound rules must match the security group ID. These rules +// are set by default when you create the CloudHSM cluster. Do not delete or change +// them. To get information about a particular security group, use the +// DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) // operation. -// // - The CloudHSM cluster must contain at least as many HSMs as the operation -// requires. To add HSMs, use the CloudHSM [CreateHsm]operation. -// -// For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKeyoperations, the CloudHSM cluster must have at least two active -// -// HSMs, each in a different Availability Zone. For the ConnectCustomKeyStoreoperation, the CloudHSM -// must contain at least one active HSM. +// requires. To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) +// operation. For the CreateCustomKeyStore , UpdateCustomKeyStore , and CreateKey +// operations, the CloudHSM cluster must have at least two active HSMs, each in a +// different Availability Zone. For the ConnectCustomKeyStore operation, the +// CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is -// associated with an CloudHSM key store, see [Assemble the Prerequisites]in the Key Management Service -// Developer Guide. For information about creating a private subnet for an CloudHSM -// cluster, see [Create a Private Subnet]in the CloudHSM User Guide. For information about cluster security -// groups, see [Configure a Default Security Group]in the CloudHSM User Guide . -// -// [Assemble the Prerequisites]: https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore -// [Create a Private Subnet]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html -// [Configure a Default Security Group]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html -// [DescribeSecurityGroups]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html -// [CreateHsm]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html -// [security group for the cluster]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html +// associated with an CloudHSM key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) +// in the Key Management Service Developer Guide. For information about creating a +// private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) +// in the CloudHSM User Guide. For information about cluster security groups, see +// Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) +// in the CloudHSM User Guide . type CloudHsmClusterInvalidConfigurationException struct { Message *string @@ -131,9 +121,8 @@ func (e *CloudHsmClusterInvalidConfigurationException) ErrorFault() smithy.Error // The request was rejected because the CloudHSM cluster associated with the // CloudHSM key store is not active. Initialize and activate the cluster and try -// the command again. For detailed instructions, see [Getting Started]in the CloudHSM User Guide. -// -// [Getting Started]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html +// the command again. For detailed instructions, see Getting Started (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) +// in the CloudHSM User Guide. type CloudHsmClusterNotActiveException struct { Message *string @@ -188,18 +177,13 @@ func (e *CloudHsmClusterNotFoundException) ErrorFault() smithy.ErrorFault { retu // The request was rejected because the specified CloudHSM cluster has a different // cluster certificate than the original cluster. You cannot use the operation to -// specify an unrelated cluster for an CloudHSM key store. -// -// Specify an CloudHSM cluster that shares a backup history with the original -// cluster. This includes clusters that were created from a backup of the current -// cluster, and clusters that were created from the same backup that produced the -// current cluster. -// -// CloudHSM clusters that share a backup history have the same cluster -// certificate. To view the cluster certificate of an CloudHSM cluster, use the [DescribeClusters] +// specify an unrelated cluster for an CloudHSM key store. Specify an CloudHSM +// cluster that shares a backup history with the original cluster. This includes +// clusters that were created from a backup of the current cluster, and clusters +// that were created from the same backup that produced the current cluster. +// CloudHSM clusters that share a backup history have the same cluster certificate. +// To view the cluster certificate of an CloudHSM cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) // operation. -// -// [DescribeClusters]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html type CloudHsmClusterNotRelatedException struct { Message *string @@ -227,36 +211,10 @@ func (e *CloudHsmClusterNotRelatedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request was rejected because an automatic rotation of this key is currently -// in progress or scheduled to begin within the next 20 minutes. -type ConflictException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ConflictException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ConflictException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ConflictException" - } - return *e.ErrorCodeOverride -} -func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - // The request was rejected because the custom key store contains KMS keys. After -// verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletionoperation to delete -// the KMS keys. After they are deleted, you can delete the custom key store. +// verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion +// operation to delete the KMS keys. After they are deleted, you can delete the +// custom key store. type CustomKeyStoreHasCMKsException struct { Message *string @@ -283,30 +241,26 @@ func (e *CustomKeyStoreHasCMKsException) ErrorCode() string { func (e *CustomKeyStoreHasCMKsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because of the ConnectionState of the custom key -// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores operation. -// -// This exception is thrown under the following conditions: -// -// - You requested the ConnectCustomKeyStoreoperation on a custom key store with a ConnectionState of -// DISCONNECTING or FAILED . This operation is valid for all other -// ConnectionState values. To reconnect a custom key store in a FAILED state, -// disconnect it (DisconnectCustomKeyStore ), then connect it ( ConnectCustomKeyStore ). -// -// - You requested the CreateKeyoperation in a custom key store that is not connected. -// This operations is valid only when the custom key store ConnectionState is -// CONNECTED . -// -// - You requested the DisconnectCustomKeyStoreoperation on a custom key store with a ConnectionState of -// DISCONNECTING or DISCONNECTED . This operation is valid for all other -// ConnectionState values. -// -// - You requested the UpdateCustomKeyStoreor DeleteCustomKeyStoreoperation on a custom key store that is not -// disconnected. This operation is valid only when the custom key store -// ConnectionState is DISCONNECTED . -// -// - You requested the GenerateRandomoperation in an CloudHSM key store that is not connected. -// This operation is valid only when the CloudHSM key store ConnectionState is -// CONNECTED . +// store. To get the ConnectionState of a custom key store, use the +// DescribeCustomKeyStores operation. This exception is thrown under the following +// conditions: +// - You requested the ConnectCustomKeyStore operation on a custom key store with +// a ConnectionState of DISCONNECTING or FAILED . This operation is valid for all +// other ConnectionState values. To reconnect a custom key store in a FAILED +// state, disconnect it ( DisconnectCustomKeyStore ), then connect it ( +// ConnectCustomKeyStore ). +// - You requested the CreateKey operation in a custom key store that is not +// connected. This operations is valid only when the custom key store +// ConnectionState is CONNECTED . +// - You requested the DisconnectCustomKeyStore operation on a custom key store +// with a ConnectionState of DISCONNECTING or DISCONNECTED . This operation is +// valid for all other ConnectionState values. +// - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation on +// a custom key store that is not disconnected. This operation is valid only when +// the custom key store ConnectionState is DISCONNECTED . +// - You requested the GenerateRandom operation in an CloudHSM key store that is +// not connected. This operation is valid only when the CloudHSM key store +// ConnectionState is CONNECTED . type CustomKeyStoreInvalidStateException struct { Message *string @@ -468,9 +422,9 @@ func (e *DryRunOperationException) ErrorCode() string { } func (e *DryRunOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request was rejected because the specified import token is expired. Use GetParametersForImport to -// get a new import token and public key, use the new public key to encrypt the key -// material, and then try the request again. +// The request was rejected because the specified import token is expired. Use +// GetParametersForImport to get a new import token and public key, use the new +// public key to encrypt the key material, and then try the request again. type ExpiredImportTokenException struct { Message *string @@ -497,8 +451,8 @@ func (e *ExpiredImportTokenException) ErrorCode() string { func (e *ExpiredImportTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the specified KMS key cannot decrypt the data. -// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request must identify the -// same KMS key that was used to encrypt the ciphertext. +// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request must +// identify the same KMS key that was used to encrypt the ciphertext. type IncorrectKeyException struct { Message *string @@ -554,12 +508,9 @@ func (e *IncorrectKeyMaterialException) ErrorFault() smithy.ErrorFault { return // The request was rejected because the trust anchor certificate in the request to // create an CloudHSM key store is not the trust anchor certificate for the -// specified CloudHSM cluster. -// -// When you [initialize the CloudHSM cluster], you create the trust anchor certificate and save it in the -// customerCA.crt file. -// -// [initialize the CloudHSM cluster]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr +// specified CloudHSM cluster. When you initialize the CloudHSM cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr) +// , you create the trust anchor certificate and save it in the customerCA.crt +// file. type IncorrectTrustAnchorException struct { Message *string @@ -638,12 +589,11 @@ func (e *InvalidArnException) ErrorCode() string { } func (e *InvalidArnException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// From the Decrypt or ReEncrypt operation, the request was rejected because the specified -// ciphertext, or additional authenticated data incorporated into the ciphertext, -// such as the encryption context, is corrupted, missing, or otherwise invalid. -// -// From the ImportKeyMaterial operation, the request was rejected because KMS could not decrypt the -// encrypted (wrapped) key material. +// From the Decrypt or ReEncrypt operation, the request was rejected because the +// specified ciphertext, or additional authenticated data incorporated into the +// ciphertext, such as the encryption context, is corrupted, missing, or otherwise +// invalid. From the ImportKeyMaterial operation, the request was rejected because +// KMS could not decrypt the encrypted (wrapped) key material. type InvalidCiphertextException struct { Message *string @@ -749,9 +699,7 @@ func (e *InvalidImportTokenException) ErrorCode() string { func (e *InvalidImportTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected for one of the following reasons: -// // - The KeyUsage value of the KMS key is incompatible with the API operation. -// // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec ). // @@ -759,10 +707,9 @@ func (e *InvalidImportTokenException) ErrorFault() smithy.ErrorFault { return sm // KeyUsage must be ENCRYPT_DECRYPT . For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY . For generating and verifying message // authentication codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC . To find -// the KeyUsage of a KMS key, use the DescribeKey operation. -// -// To find the encryption or signing algorithms supported for a particular KMS -// key, use the DescribeKeyoperation. +// the KeyUsage of a KMS key, use the DescribeKey operation. To find the +// encryption or signing algorithms supported for a particular KMS key, use the +// DescribeKey operation. type InvalidKeyUsageException struct { Message *string @@ -926,22 +873,14 @@ func (e *KMSInvalidSignatureException) ErrorCode() string { func (e *KMSInvalidSignatureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the state of the specified resource is not -// valid for this request. -// -// This exceptions means one of the following: -// -// - The key state of the KMS key is not compatible with the operation. -// -// To find the key state, use the DescribeKeyoperation. For more information about which key -// -// states are compatible with each KMS operation, see [Key states of KMS keys]in the Key Management -// Service Developer Guide . -// -// - For cryptographic operations on KMS keys in custom key stores, this -// exception represents a general failure with many possible causes. To identify -// the cause, see the error message that accompanies the exception. -// -// [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html +// valid for this request. This exceptions means one of the following: +// - The key state of the KMS key is not compatible with the operation. To find +// the key state, use the DescribeKey operation. For more information about which +// key states are compatible with each KMS operation, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the Key Management Service Developer Guide . +// - For cryptographic operations on KMS keys in custom key stores, this +// exception represents a general failure with many possible causes. To identify +// the cause, see the error message that accompanies the exception. type KMSInvalidStateException struct { Message *string @@ -968,9 +907,8 @@ func (e *KMSInvalidStateException) ErrorCode() string { func (e *KMSInvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because a quota was exceeded. For more information, -// see [Quotas]in the Key Management Service Developer Guide. -// -// [Quotas]: https://docs.aws.amazon.com/kms/latest/developerguide/limits.html +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// in the Key Management Service Developer Guide. type LimitExceededException struct { Message *string @@ -1133,7 +1071,6 @@ func (e *XksKeyAlreadyInUseException) ErrorFault() smithy.ErrorFault { return sm // The request was rejected because the external key specified by the XksKeyId // parameter did not meet the configuration requirements for an external key store. -// // The external key must be an AES-256 symmetric key that is enabled and performs // encryption and decryption. type XksKeyInvalidConfigurationException struct { @@ -1166,12 +1103,10 @@ func (e *XksKeyInvalidConfigurationException) ErrorFault() smithy.ErrorFault { // The request was rejected because the external key store proxy could not find // the external key. This exception is thrown when the value of the XksKeyId // parameter doesn't identify a key in the external key manager associated with the -// external key proxy. -// -// Verify that the XksKeyId represents an existing key in the external key -// manager. Use the key identifier that the external key store proxy uses to -// identify the key. For details, see the documentation provided with your external -// key store proxy or key manager. +// external key proxy. Verify that the XksKeyId represents an existing key in the +// external key manager. Use the key identifier that the external key store proxy +// uses to identify the key. For details, see the documentation provided with your +// external key store proxy or key manager. type XksKeyNotFoundException struct { Message *string @@ -1346,9 +1281,8 @@ func (e *XksProxyUriInUseException) ErrorCode() string { func (e *XksProxyUriInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // KMS was unable to reach the specified XksProxyUriPath . The path must be -// reachable before you create the external key store or update its settings. -// -// This exception is also thrown when the external key store proxy response to a +// reachable before you create the external key store or update its settings. This +// exception is also thrown when the external key store proxy response to a // GetHealthStatus request indicates that all external key manager instances are // unavailable. type XksProxyUriUnreachableException struct { @@ -1409,10 +1343,9 @@ func (e *XksProxyVpcEndpointServiceInUseException) ErrorFault() smithy.ErrorFaul // The request was rejected because the Amazon VPC endpoint service configuration // does not fulfill the requirements for an external key store. To identify the -// cause, see the error message that accompanies the exception and [review the requirements]for Amazon VPC -// endpoint service connectivity for an external key store. -// -// [review the requirements]: https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements +// cause, see the error message that accompanies the exception and review the +// requirements (https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements) +// for Amazon VPC endpoint service connectivity for an external key store. type XksProxyVpcEndpointServiceInvalidConfigurationException struct { Message *string @@ -1441,10 +1374,10 @@ func (e *XksProxyVpcEndpointServiceInvalidConfigurationException) ErrorFault() s } // The request was rejected because KMS could not find the specified VPC endpoint -// service. Use DescribeCustomKeyStoresto verify the VPC endpoint service name for the external key -// store. Also, confirm that the Allow principals list for the VPC endpoint -// service includes the KMS service principal for the Region, such as -// cks.kms.us-east-1.amazonaws.com . +// service. Use DescribeCustomKeyStores to verify the VPC endpoint service name +// for the external key store. Also, confirm that the Allow principals list for +// the VPC endpoint service includes the KMS service principal for the Region, such +// as cks.kms.us-east-1.amazonaws.com . type XksProxyVpcEndpointServiceNotFoundException struct { Message *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/types.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/types.go index a0b3f0bf8ac..a5ec972e3e9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/types.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/types/types.go @@ -40,93 +40,77 @@ type CustomKeyStoresListEntry struct { CloudHsmClusterId *string // Describes the connection error. This field appears in the response only when - // the ConnectionState is FAILED . - // - // Many failures can be resolved by updating the properties of the custom key - // store. To update a custom key store, disconnect it (DisconnectCustomKeyStore ), correct the errors (UpdateCustomKeyStore ), - // and try to connect again (ConnectCustomKeyStore ). For additional help resolving these errors, see [How to Fix a Connection Failure] - // in Key Management Service Developer Guide. - // - // All custom key stores: - // + // the ConnectionState is FAILED . Many failures can be resolved by updating the + // properties of the custom key store. To update a custom key store, disconnect it + // ( DisconnectCustomKeyStore ), correct the errors ( UpdateCustomKeyStore ), and + // try to connect again ( ConnectCustomKeyStore ). For additional help resolving + // these errors, see How to Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) + // in Key Management Service Developer Guide. All custom key stores: // - INTERNAL_ERROR — KMS could not complete the request due to an internal // error. Retry the request. For ConnectCustomKeyStore requests, disconnect the // custom key store before trying to connect again. - // // - NETWORK_ERRORS — Network errors are preventing KMS from connecting the // custom key store to its backing key store. - // // CloudHSM key stores: - // // - CLUSTER_NOT_FOUND — KMS cannot find the CloudHSM cluster with the specified // cluster ID. - // // - INSUFFICIENT_CLOUDHSM_HSMS — The associated CloudHSM cluster does not // contain any active HSMs. To connect a custom key store to its CloudHSM cluster, // the cluster must contain at least one active HSM. - // // - INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET — At least one private subnet // associated with the CloudHSM cluster doesn't have any available IP addresses. A // CloudHSM key store connection requires one free IP address in each of the - // associated private subnets, although two are preferable. For details, see [How to Fix a Connection Failure]in - // the Key Management Service Developer Guide. - // + // associated private subnets, although two are preferable. For details, see How + // to Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) + // in the Key Management Service Developer Guide. // - INVALID_CREDENTIALS — The KeyStorePassword for the custom key store doesn't // match the current password of the kmsuser crypto user in the CloudHSM cluster. // Before you can connect your custom key store to its CloudHSM cluster, you must // change the kmsuser account password and update the KeyStorePassword value for // the custom key store. - // // - SUBNET_NOT_FOUND — A subnet in the CloudHSM cluster configuration was // deleted. If KMS cannot find all of the subnets in the cluster configuration, // attempts to connect the custom key store to the CloudHSM cluster fail. To fix // this error, create a cluster from a recent backup and associate it with your // custom key store. (This process creates a new cluster configuration with a VPC - // and private subnets.) For details, see [How to Fix a Connection Failure]in the Key Management Service - // Developer Guide. - // + // and private subnets.) For details, see How to Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) + // in the Key Management Service Developer Guide. // - USER_LOCKED_OUT — The kmsuser CU account is locked out of the associated // CloudHSM cluster due to too many failed password attempts. Before you can // connect your custom key store to its CloudHSM cluster, you must change the // kmsuser account password and update the key store password value for the // custom key store. - // // - USER_LOGGED_IN — The kmsuser CU account is logged into the associated // CloudHSM cluster. This prevents KMS from rotating the kmsuser account password // and logging into the cluster. Before you can connect your custom key store to // its CloudHSM cluster, you must log the kmsuser CU out of the cluster. If you // changed the kmsuser password to log into the cluster, you must also and update - // the key store password value for the custom key store. For help, see [How to Log Out and Reconnect]in the - // Key Management Service Developer Guide. - // + // the key store password value for the custom key store. For help, see How to + // Log Out and Reconnect (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#login-kmsuser-2) + // in the Key Management Service Developer Guide. // - USER_NOT_FOUND — KMS cannot find a kmsuser CU account in the associated // CloudHSM cluster. Before you can connect your custom key store to its CloudHSM // cluster, you must create a kmsuser CU account in the cluster, and then update // the key store password value for the custom key store. - // // External key stores: - // // - INVALID_CREDENTIALS — One or both of the XksProxyAuthenticationCredential // values is not valid on the specified external key store proxy. - // // - XKS_PROXY_ACCESS_DENIED — KMS requests are denied access to the external key // store proxy. If the external key store proxy has authorization rules, verify // that they permit KMS to communicate with the proxy on your behalf. - // // - XKS_PROXY_INVALID_CONFIGURATION — A configuration error is preventing the // external key store from connecting to its proxy. Verify the value of the // XksProxyUriPath . - // // - XKS_PROXY_INVALID_RESPONSE — KMS cannot interpret the response from the // external key store proxy. If you see this connection error code repeatedly, // notify your external key store proxy vendor. - // // - XKS_PROXY_INVALID_TLS_CONFIGURATION — KMS cannot connect to the external key // store proxy because the TLS configuration is invalid. Verify that the XKS proxy // supports TLS 1.2 or 1.3. Also, verify that the TLS certificate is not expired, // and that it matches the hostname in the XksProxyUriEndpoint value, and that it - // is signed by a certificate authority included in the [Trusted Certificate Authorities]list. - // + // is signed by a certificate authority included in the Trusted Certificate + // Authorities (https://github.com/aws/aws-kms-xksproxy-api-spec/blob/main/TrustedCertificateAuthorities) + // list. // - XKS_PROXY_NOT_REACHABLE — KMS can't communicate with your external key store // proxy. Verify that the XksProxyUriEndpoint and XksProxyUriPath are correct. // Use the tools for your external key store proxy to verify that the proxy is @@ -134,70 +118,50 @@ type CustomKeyStoresListEntry struct { // instances are operating properly. Connection attempts fail with this connection // error code if the proxy reports that all external key manager instances are // unavailable. - // // - XKS_PROXY_TIMED_OUT — KMS can connect to the external key store proxy, but // the proxy does not respond to KMS in the time allotted. If you see this // connection error code repeatedly, notify your external key store proxy vendor. - // // - XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION — The Amazon VPC endpoint // service configuration doesn't conform to the requirements for an KMS external // key store. - // // - The VPC endpoint service must be an endpoint service for interface // endpoints in the caller's Amazon Web Services account. - // // - It must have a network load balancer (NLB) connected to at least two // subnets, each in a different Availability Zone. - // // - The Allow principals list must include the KMS service principal for the // Region, cks.kms..amazonaws.com , such as cks.kms.us-east-1.amazonaws.com . - // - // - It must not require [acceptance]of connection requests. - // + // - It must not require acceptance (https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html) + // of connection requests. // - It must have a private DNS name. The private DNS name for an external key // store with VPC_ENDPOINT_SERVICE connectivity must be unique in its Amazon Web // Services Region. - // - // - The domain of the private DNS name must have a [verification status]of verified . - // - // - The [TLS certificate]specifies the private DNS hostname at which the endpoint is reachable. - // + // - The domain of the private DNS name must have a verification status (https://docs.aws.amazon.com/vpc/latest/privatelink/verify-domains.html) + // of verified . + // - The TLS certificate (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html) + // specifies the private DNS hostname at which the endpoint is reachable. // - XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND — KMS can't find the VPC endpoint service // that it uses to communicate with the external key store proxy. Verify that the // XksProxyVpcEndpointServiceName is correct and the KMS service principal has // service consumer permissions on the Amazon VPC endpoint service. - // - // [acceptance]: https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html - // [verification status]: https://docs.aws.amazon.com/vpc/latest/privatelink/verify-domains.html - // [How to Log Out and Reconnect]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#login-kmsuser-2 - // [TLS certificate]: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html - // [Trusted Certificate Authorities]: https://github.com/aws/aws-kms-xksproxy-api-spec/blob/main/TrustedCertificateAuthorities - // [How to Fix a Connection Failure]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed ConnectionErrorCode ConnectionErrorCodeType // Indicates whether the custom key store is connected to its backing key store. // For an CloudHSM key store, the ConnectionState indicates whether it is // connected to its CloudHSM cluster. For an external key store, the // ConnectionState indicates whether it is connected to the external key store - // proxy that communicates with your external key manager. - // - // You can create and use KMS keys in your custom key stores only when its - // ConnectionState is CONNECTED . - // + // proxy that communicates with your external key manager. You can create and use + // KMS keys in your custom key stores only when its ConnectionState is CONNECTED . // The ConnectionState value is DISCONNECTED only if the key store has never been - // connected or you use the DisconnectCustomKeyStoreoperation to disconnect it. If the value is CONNECTED - // but you are having trouble using the custom key store, make sure that the - // backing key store is reachable and active. For an CloudHSM key store, verify - // that its associated CloudHSM cluster is active and contains at least one active - // HSM. For an external key store, verify that the external key store proxy and - // external key manager are connected and enabled. - // - // A value of FAILED indicates that an attempt to connect was unsuccessful. The + // connected or you use the DisconnectCustomKeyStore operation to disconnect it. + // If the value is CONNECTED but you are having trouble using the custom key + // store, make sure that the backing key store is reachable and active. For an + // CloudHSM key store, verify that its associated CloudHSM cluster is active and + // contains at least one active HSM. For an external key store, verify that the + // external key store proxy and external key manager are connected and enabled. A + // value of FAILED indicates that an attempt to connect was unsuccessful. The // ConnectionErrorCode field in the response indicates the cause of the failure. - // For help resolving a connection failure, see [Troubleshooting a custom key store]in the Key Management Service - // Developer Guide. - // - // [Troubleshooting a custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html + // For help resolving a connection failure, see Troubleshooting a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) + // in the Key Management Service Developer Guide. ConnectionState ConnectionStateType // The date and time when the custom key store was created. @@ -216,66 +180,53 @@ type CustomKeyStoresListEntry struct { CustomKeyStoreType CustomKeyStoreType // The trust anchor certificate of the CloudHSM cluster associated with an - // CloudHSM key store. When you [initialize the cluster], you create this certificate and save it in the - // customerCA.crt file. - // - // This field appears only when the CustomKeyStoreType is AWS_CLOUDHSM . - // - // [initialize the cluster]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr + // CloudHSM key store. When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr) + // , you create this certificate and save it in the customerCA.crt file. This + // field appears only when the CustomKeyStoreType is AWS_CLOUDHSM . TrustAnchorCertificate *string // Configuration settings for the external key store proxy (XKS proxy). The // external key store proxy translates KMS requests into a format that your // external key manager can understand. The proxy configuration includes connection - // information that KMS requires. - // - // This field appears only when the CustomKeyStoreType is EXTERNAL_KEY_STORE . + // information that KMS requires. This field appears only when the + // CustomKeyStoreType is EXTERNAL_KEY_STORE . XksProxyConfiguration *XksProxyConfigurationType noSmithyDocumentSerde } -// Use this structure to allow [cryptographic operations] in the grant only when the operation request -// includes the specified [encryption context]. -// -// KMS applies the grant constraints only to cryptographic operations that support -// an encryption context, that is, all cryptographic operations with a [symmetric KMS key]. Grant -// constraints are not applied to operations that do not support an encryption -// context, such as cryptographic operations with asymmetric KMS keys and -// management operations, such as DescribeKeyor RetireGrant. -// -// In a cryptographic operation, the encryption context in the decryption -// operation must be an exact, case-sensitive match for the keys and values in the -// encryption context of the encryption operation. Only the order of the pairs can -// vary. -// +// Use this structure to allow cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) +// in the grant only when the operation request includes the specified encryption +// context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// . KMS applies the grant constraints only to cryptographic operations that +// support an encryption context, that is, all cryptographic operations with a +// symmetric KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#symmetric-cmks) +// . Grant constraints are not applied to operations that do not support an +// encryption context, such as cryptographic operations with asymmetric KMS keys +// and management operations, such as DescribeKey or RetireGrant . In a +// cryptographic operation, the encryption context in the decryption operation must +// be an exact, case-sensitive match for the keys and values in the encryption +// context of the encryption operation. Only the order of the pairs can vary. // However, in a grant constraint, the key in each key-value pair is not case -// sensitive, but the value is case sensitive. -// -// To avoid confusion, do not use multiple encryption context pairs that differ -// only by case. To require a fully case-sensitive encryption context, use the -// kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM or -// key policy. For details, see [kms:EncryptionContext:]in the Key Management Service Developer Guide . -// -// [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations -// [kms:EncryptionContext:]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context -// [encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context -// [symmetric KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#symmetric-cmks +// sensitive, but the value is case sensitive. To avoid confusion, do not use +// multiple encryption context pairs that differ only by case. To require a fully +// case-sensitive encryption context, use the kms:EncryptionContext: and +// kms:EncryptionContextKeys conditions in an IAM or key policy. For details, see +// kms:EncryptionContext: (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context) +// in the Key Management Service Developer Guide . type GrantConstraints struct { - // A list of key-value pairs that must match the encryption context in the [cryptographic operation] + // A list of key-value pairs that must match the encryption context in the + // cryptographic operation (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) // request. The grant allows the operation only when the encryption context in the // request is the same as the encryption context specified in this constraint. - // - // [cryptographic operation]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations EncryptionContextEquals map[string]string // A list of key-value pairs that must be included in the encryption context of - // the [cryptographic operation]request. The grant allows the cryptographic operation only when the - // encryption context in the request includes the key-value pairs specified in this + // the cryptographic operation (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) + // request. The grant allows the cryptographic operation only when the encryption + // context in the request includes the key-value pairs specified in this // constraint, although it can include additional key-value pairs. - // - // [cryptographic operation]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations EncryptionContextSubset map[string]string noSmithyDocumentSerde @@ -294,15 +245,12 @@ type GrantListEntry struct { // The unique identifier for the grant. GrantId *string - // The identity that gets the permissions in the grant. - // - // The GranteePrincipal field in the ListGrants response usually contains the user - // or role designated as the grantee principal in the grant. However, when the - // grantee principal in the grant is an Amazon Web Services service, the - // GranteePrincipal field contains the [service principal], which might represent several different - // grantee principals. - // - // [service principal]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services + // The identity that gets the permissions in the grant. The GranteePrincipal field + // in the ListGrants response usually contains the user or role designated as the + // grantee principal in the grant. However, when the grantee principal in the grant + // is an Amazon Web Services service, the GranteePrincipal field contains the + // service principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) + // , which might represent several different grantee principals. GranteePrincipal *string // The Amazon Web Services account under which the grant was issued. @@ -311,8 +259,8 @@ type GrantListEntry struct { // The unique identifier for the KMS key to which the grant applies. KeyId *string - // The friendly name that identifies the grant. If a name was provided in the CreateGrant - // request, that name is returned. Otherwise this value is null. + // The friendly name that identifies the grant. If a name was provided in the + // CreateGrant request, that name is returned. Otherwise this value is null. Name *string // The list of operations permitted by the grant. @@ -336,9 +284,8 @@ type KeyListEntry struct { noSmithyDocumentSerde } -// Contains metadata about a KMS key. -// -// This data type is used as a response element for the CreateKey, DescribeKey, and ReplicateKey operations. +// Contains metadata about a KMS key. This data type is used as a response element +// for the CreateKey , DescribeKey , and ReplicateKey operations. type KeyMetadata struct { // The globally unique identifier for the KMS key. @@ -350,45 +297,39 @@ type KeyMetadata struct { // KMS key. AWSAccountId *string - // The Amazon Resource Name (ARN) of the KMS key. For examples, see [Key Management Service (KMS)] in the - // Example ARNs section of the Amazon Web Services General Reference. - // - // [Key Management Service (KMS)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms + // The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management + // Service (KMS) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) + // in the Example ARNs section of the Amazon Web Services General Reference. Arn *string // The cluster ID of the CloudHSM cluster that contains the key material for the - // KMS key. When you create a KMS key in an CloudHSM [custom key store], KMS creates the key - // material for the KMS key in the associated CloudHSM cluster. This field is - // present only when the KMS key is created in an CloudHSM key store. - // - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html + // KMS key. When you create a KMS key in an CloudHSM custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) + // , KMS creates the key material for the KMS key in the associated CloudHSM + // cluster. This field is present only when the KMS key is created in an CloudHSM + // key store. CloudHsmClusterId *string // The date and time when the KMS key was created. CreationDate *time.Time - // A unique identifier for the [custom key store] that contains the KMS key. This field is present - // only when the KMS key is created in a custom key store. - // - // [custom key store]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html + // A unique identifier for the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) + // that contains the KMS key. This field is present only when the KMS key is + // created in a custom key store. CustomKeyStoreId *string - // Instead, use the KeySpec field. - // - // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend - // that you use the KeySpec field in your code. However, to avoid breaking - // changes, KMS supports both fields. + // Instead, use the KeySpec field. The KeySpec and CustomerMasterKeySpec fields + // have the same value. We recommend that you use the KeySpec field in your code. + // However, to avoid breaking changes, KMS supports both fields. // // Deprecated: This field has been deprecated. Instead, use the KeySpec field. CustomerMasterKeySpec CustomerMasterKeySpec // The date and time after which KMS deletes this KMS key. This value is present // only when the KMS key is scheduled for deletion, that is, when its KeyState is - // PendingDeletion . - // - // When the primary key in a multi-Region key is scheduled for deletion but still - // has replica keys, its key state is PendingReplicaDeletion and the length of its - // waiting period is displayed in the PendingDeletionWindowInDays field. + // PendingDeletion . When the primary key in a multi-Region key is scheduled for + // deletion but still has replica keys, its key state is PendingReplicaDeletion + // and the length of its waiting period is displayed in the + // PendingDeletionWindowInDays field. DeletionDate *time.Time // The description of the KMS key. @@ -399,9 +340,8 @@ type KeyMetadata struct { Enabled bool // The encryption algorithms that the KMS key supports. You cannot use the KMS key - // with other encryption algorithms within KMS. - // - // This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT . + // with other encryption algorithms within KMS. This value is present only when the + // KeyUsage of the KMS key is ENCRYPT_DECRYPT . EncryptionAlgorithms []EncryptionAlgorithmSpec // Specifies whether the KMS key's key material expires. This value is present @@ -410,53 +350,41 @@ type KeyMetadata struct { // The manager of the KMS key. KMS keys in your Amazon Web Services account are // either customer managed or Amazon Web Services managed. For more information - // about the difference, see [KMS keys]in the Key Management Service Developer Guide. - // - // [KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys + // about the difference, see KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys) + // in the Key Management Service Developer Guide. KeyManager KeyManagerType // Describes the type of key material in the KMS key. KeySpec KeySpec - // The current status of the KMS key. - // - // For more information about how key state affects the use of a KMS key, see [Key states of KMS keys] in - // the Key Management Service Developer Guide. - // - // [Key states of KMS keys]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html + // The current status of the KMS key. For more information about how key state + // affects the use of a KMS key, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) + // in the Key Management Service Developer Guide. KeyState KeyState - // The [cryptographic operations] for which you can use the KMS key. - // - // [cryptographic operations]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations + // The cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) + // for which you can use the KMS key. KeyUsage KeyUsageType // The message authentication code (MAC) algorithm that the HMAC KMS key supports. - // // This value is present only when the KeyUsage of the KMS key is // GENERATE_VERIFY_MAC . MacAlgorithms []MacAlgorithmSpec // Indicates whether the KMS key is a multi-Region ( True ) or regional ( False ) // key. This value is True for multi-Region primary and replica keys and False for - // regional KMS keys. - // - // For more information about multi-Region keys, see [Multi-Region keys in KMS] in the Key Management - // Service Developer Guide. - // - // [Multi-Region keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html + // regional KMS keys. For more information about multi-Region keys, see + // Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + // in the Key Management Service Developer Guide. MultiRegion *bool // Lists the primary and replica keys in same multi-Region key. This field is - // present only when the value of the MultiRegion field is True . - // - // For more information about any listed KMS key, use the DescribeKey operation. - // - // - MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA key. - // + // present only when the value of the MultiRegion field is True . For more + // information about any listed KMS key, use the DescribeKey operation. + // - MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA + // key. // - PrimaryKey displays the key ARN and Region of the primary key. This field // displays the current KMS key if it is the primary key. - // // - ReplicaKeys displays the key ARNs and Regions of all replica keys. This // field includes the current KMS key if it is a replica key. MultiRegionConfiguration *MultiRegionConfiguration @@ -472,22 +400,20 @@ type KeyMetadata struct { // This waiting period begins when the last of its replica keys is deleted. This // value is present only when the KeyState of the KMS key is PendingReplicaDeletion // . That indicates that the KMS key is the primary key in a multi-Region key, it - // is scheduled for deletion, and it still has existing replica keys. - // - // When a single-Region KMS key or a multi-Region replica key is scheduled for - // deletion, its deletion date is displayed in the DeletionDate field. However, - // when the primary key in a multi-Region key is scheduled for deletion, its - // waiting period doesn't begin until all of its replica keys are deleted. This - // value displays that waiting period. When the last replica key in the - // multi-Region key is deleted, the KeyState of the scheduled primary key changes - // from PendingReplicaDeletion to PendingDeletion and the deletion date appears in - // the DeletionDate field. + // is scheduled for deletion, and it still has existing replica keys. When a + // single-Region KMS key or a multi-Region replica key is scheduled for deletion, + // its deletion date is displayed in the DeletionDate field. However, when the + // primary key in a multi-Region key is scheduled for deletion, its waiting period + // doesn't begin until all of its replica keys are deleted. This value displays + // that waiting period. When the last replica key in the multi-Region key is + // deleted, the KeyState of the scheduled primary key changes from + // PendingReplicaDeletion to PendingDeletion and the deletion date appears in the + // DeletionDate field. PendingDeletionWindowInDays *int32 // The signing algorithms that the KMS key supports. You cannot use the KMS key - // with other signing algorithms within KMS. - // - // This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY . + // with other signing algorithms within KMS. This field appears only when the + // KeyUsage of the KMS key is SIGN_VERIFY . SigningAlgorithms []SigningAlgorithmSpec // The time at which the imported key material expires. When the key material @@ -497,20 +423,16 @@ type KeyMetadata struct { ValidTo *time.Time // Information about the external key that is associated with a KMS key in an - // external key store. - // - // For more information, see [External key] in the Key Management Service Developer Guide. - // - // [External key]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key + // external key store. For more information, see External key (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key) + // in the Key Management Service Developer Guide. XksKeyConfiguration *XksKeyConfigurationType noSmithyDocumentSerde } // Describes the configuration of this multi-Region key. This field appears only -// when the KMS key is a primary or replica of a multi-Region key. -// -// For more information about any listed KMS key, use the DescribeKey operation. +// when the KMS key is a primary or replica of a multi-Region key. For more +// information about any listed KMS key, use the DescribeKey operation. type MultiRegionConfiguration struct { // Indicates whether the KMS key is a PRIMARY or REPLICA key. @@ -541,14 +463,11 @@ type MultiRegionKey struct { } // Contains information about the party that receives the response from the API -// operation. -// -// This data type is designed to support Amazon Web Services Nitro Enclaves, which -// lets you create an isolated compute environment in Amazon EC2. For information -// about the interaction between KMS and Amazon Web Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves uses KMS] +// operation. This data type is designed to support Amazon Web Services Nitro +// Enclaves, which lets you create an isolated compute environment in Amazon EC2. +// For information about the interaction between KMS and Amazon Web Services Nitro +// Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) // in the Key Management Service Developer Guide. -// -// [How Amazon Web Services Nitro Enclaves uses KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html type RecipientInfo struct { // The attestation document for an Amazon Web Services Nitro Enclave. This @@ -563,34 +482,13 @@ type RecipientInfo struct { noSmithyDocumentSerde } -// Contains information about completed key material rotations. -type RotationsListEntry struct { - - // Unique identifier of the key. - KeyId *string - - // Date and time that the key material rotation completed. Formatted as Unix time. - RotationDate *time.Time - - // Identifies whether the key material rotation was a scheduled [automatic rotation] or an [on-demand rotation]. - // - // [automatic rotation]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable - // [on-demand rotation]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-on-demand - RotationType RotationType - - noSmithyDocumentSerde -} - // A key-value pair. A tag consists of a tag key and a tag value. Tag keys and tag -// values are both required, but tag values can be empty (null) strings. -// -// Do not include confidential or sensitive information in this field. This field -// may be displayed in plaintext in CloudTrail logs and other output. -// -// For information about the rules that apply to tag keys and tag values, see [User-Defined Tag Restrictions] in -// the Amazon Web Services Billing and Cost Management User Guide. -// -// [User-Defined Tag Restrictions]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html +// values are both required, but tag values can be empty (null) strings. Do not +// include confidential or sensitive information in this field. This field may be +// displayed in plaintext in CloudTrail logs and other output. For information +// about the rules that apply to tag keys and tag values, see User-Defined Tag +// Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) +// in the Amazon Web Services Billing and Cost Management User Guide. type Tag struct { // The key of the tag. @@ -606,20 +504,15 @@ type Tag struct { noSmithyDocumentSerde } -// Information about the [external key]that is associated with a KMS key in an external key -// store. -// -// This element appears in a CreateKey or DescribeKey response only for a KMS key in an external key -// store. -// -// The external key is a symmetric encryption key that is hosted by an external -// key manager outside of Amazon Web Services. When you use the KMS key in an -// external key store in a cryptographic operation, the cryptographic operation is -// performed in the external key manager using the specified external key. For more -// information, see [External key]in the Key Management Service Developer Guide. -// -// [External key]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key -// [external key]: https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key +// Information about the external key (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key) +// that is associated with a KMS key in an external key store. This element appears +// in a CreateKey or DescribeKey response only for a KMS key in an external key +// store. The external key is a symmetric encryption key that is hosted by an +// external key manager outside of Amazon Web Services. When you use the KMS key in +// an external key store in a cryptographic operation, the cryptographic operation +// is performed in the external key manager using the specified external key. For +// more information, see External key (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html#concept-external-key) +// in the Key Management Service Developer Guide. type XksKeyConfigurationType struct { // The ID of the external key in its external key manager. This is the ID that the @@ -631,9 +524,8 @@ type XksKeyConfigurationType struct { // KMS uses the authentication credential to sign requests that it sends to the // external key store proxy (XKS proxy) on your behalf. You establish these -// credentials on your external key store proxy and report them to KMS. -// -// The XksProxyAuthenticationCredential includes two required elements. +// credentials on your external key store proxy and report them to KMS. The +// XksProxyAuthenticationCredential includes two required elements. type XksProxyAuthenticationCredentialType struct { // A unique identifier for the raw secret access key. @@ -652,26 +544,23 @@ type XksProxyAuthenticationCredentialType struct { // Detailed information about the external key store proxy (XKS proxy). Your // external key store proxy translates KMS requests into a format that your -// external key manager can understand. These fields appear in a DescribeCustomKeyStoresresponse only -// when the CustomKeyStoreType is EXTERNAL_KEY_STORE . +// external key manager can understand. These fields appear in a +// DescribeCustomKeyStores response only when the CustomKeyStoreType is +// EXTERNAL_KEY_STORE . type XksProxyConfigurationType struct { - // The part of the external key store [proxy authentication credential] that uniquely identifies the secret access - // key. - // - // [proxy authentication credential]: https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html#KMS-CreateCustomKeyStore-request-XksProxyAuthenticationCredential + // The part of the external key store proxy authentication credential (https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html#KMS-CreateCustomKeyStore-request-XksProxyAuthenticationCredential) + // that uniquely identifies the secret access key. AccessKeyId *string // Indicates whether the external key store proxy uses a public endpoint or an // Amazon VPC endpoint service to communicate with KMS. Connectivity XksProxyConnectivityType - // The URI endpoint for the external key store proxy. - // - // If the external key store proxy has a public endpoint, it is displayed here. - // - // If the external key store proxy uses an Amazon VPC endpoint service name, this - // field displays the private DNS name associated with the VPC endpoint service. + // The URI endpoint for the external key store proxy. If the external key store + // proxy has a public endpoint, it is displayed here. If the external key store + // proxy uses an Amazon VPC endpoint service name, this field displays the private + // DNS name associated with the VPC endpoint service. UriEndpoint *string // The path to the external key store proxy APIs. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/validators.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/validators.go index c4bb2702097..9ca3bd5824a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/validators.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/kms/validators.go @@ -590,26 +590,6 @@ func (m *validateOpListKeyPolicies) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } -type validateOpListKeyRotations struct { -} - -func (*validateOpListKeyRotations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListKeyRotations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListKeyRotationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListKeyRotationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpListResourceTags struct { } @@ -730,26 +710,6 @@ func (m *validateOpRevokeGrant) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } -type validateOpRotateKeyOnDemand struct { -} - -func (*validateOpRotateKeyOnDemand) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRotateKeyOnDemand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RotateKeyOnDemandInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRotateKeyOnDemandInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpScheduleKeyDeletion struct { } @@ -1066,10 +1026,6 @@ func addOpListKeyPoliciesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListKeyPolicies{}, middleware.After) } -func addOpListKeyRotationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListKeyRotations{}, middleware.After) -} - func addOpListResourceTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResourceTags{}, middleware.After) } @@ -1094,10 +1050,6 @@ func addOpRevokeGrantValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRevokeGrant{}, middleware.After) } -func addOpRotateKeyOnDemandValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRotateKeyOnDemand{}, middleware.After) -} - func addOpScheduleKeyDeletionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpScheduleKeyDeletion{}, middleware.After) } @@ -1669,21 +1621,6 @@ func validateOpListKeyPoliciesInput(v *ListKeyPoliciesInput) error { } } -func validateOpListKeyRotationsInput(v *ListKeyRotationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListKeyRotationsInput"} - if v.KeyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("KeyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpListResourceTagsInput(v *ListResourceTagsInput) error { if v == nil { return nil @@ -1791,21 +1728,6 @@ func validateOpRevokeGrantInput(v *RevokeGrantInput) error { } } -func validateOpRotateKeyOnDemandInput(v *RotateKeyOnDemandInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RotateKeyOnDemandInput"} - if v.KeyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("KeyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpScheduleKeyDeletionInput(v *ScheduleKeyDeletionInput) error { if v == nil { return nil diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index d477f4212fc..5a5083094b5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,27 +1,3 @@ -# v1.20.9 (2024-05-23) - -* No change notes available for this release. - -# v1.20.8 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.7 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.6 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.20.5 (2024-04-05) - -* No change notes available for this release. - -# v1.20.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.20.3 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go index 44ad9ff1d23..4b21e8b00a9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go @@ -30,10 +30,9 @@ func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredenti type GetRoleCredentialsInput struct { - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // The token issued by the CreateToken API call. For more information, see + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go index 5861c9bbccb..e44da697c55 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go @@ -29,10 +29,9 @@ func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesI type ListAccountRolesInput struct { - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // The token issued by the CreateToken API call. For more information, see + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go index 7f2b2397879..2d7add067fa 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go @@ -12,10 +12,9 @@ import ( ) // Lists all AWS accounts assigned to the user. These AWS accounts are assigned by -// the administrator of the account. For more information, see [Assign User Access]in the IAM Identity -// Center User Guide. This operation returns a paginated response. -// -// [Assign User Access]: https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers +// the administrator of the account. For more information, see Assign User Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers) +// in the IAM Identity Center User Guide. This operation returns a paginated +// response. func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { if params == nil { params = &ListAccountsInput{} @@ -33,10 +32,9 @@ func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, op type ListAccountsInput struct { - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // The token issued by the CreateToken API call. For more information, see + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go index 65f582a8747..3ee682d19e0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go @@ -12,20 +12,16 @@ import ( // Removes the locally stored SSO tokens from the client-side cache and sends an // API call to the IAM Identity Center service to invalidate the corresponding -// server-side IAM Identity Center sign in session. -// -// If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM -// Identity Center sign in session is used to obtain an IAM session, as specified -// in the corresponding IAM Identity Center permission set. More specifically, IAM -// Identity Center assumes an IAM role in the target account on behalf of the user, -// and the corresponding temporary AWS credentials are returned to the client. -// -// After user logout, any existing IAM role sessions that were created by using -// IAM Identity Center permission sets continue based on the duration configured in -// the permission set. For more information, see [User authentications]in the IAM Identity Center User -// Guide. -// -// [User authentications]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html +// server-side IAM Identity Center sign in session. If a user uses IAM Identity +// Center to access the AWS CLI, the user’s IAM Identity Center sign in session is +// used to obtain an IAM session, as specified in the corresponding IAM Identity +// Center permission set. More specifically, IAM Identity Center assumes an IAM +// role in the target account on behalf of the user, and the corresponding +// temporary AWS credentials are returned to the client. After user logout, any +// existing IAM role sessions that were created by using IAM Identity Center +// permission sets continue based on the duration configured in the permission set. +// For more information, see User authentications (https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html) +// in the IAM Identity Center User Guide. func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) { if params == nil { params = &LogoutInput{} @@ -43,10 +39,9 @@ func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func type LogoutInput struct { - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // The token issued by the CreateToken API call. For more information, see + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go index d6297fa6a15..8bba205f435 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go @@ -13,22 +13,12 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" - "time" ) -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - type awsRestjson1_deserializeOpGetRoleCredentials struct { } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go index 7f6e429fda8..59456d5dc27 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go @@ -6,22 +6,16 @@ // AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web // service that makes it easy for you to assign user access to IAM Identity Center // resources such as the AWS access portal. Users can get AWS account applications -// and roles assigned to them and get federated into the application. -// -// Although AWS Single Sign-On was renamed, the sso and identitystore API -// namespaces will continue to retain their original name for backward -// compatibility purposes. For more information, see [IAM Identity Center rename]. -// -// This reference guide describes the IAM Identity Center Portal operations that +// and roles assigned to them and get federated into the application. Although AWS +// Single Sign-On was renamed, the sso and identitystore API namespaces will +// continue to retain their original name for backward compatibility purposes. For +// more information, see IAM Identity Center rename (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed) +// . This reference guide describes the IAM Identity Center Portal operations that // you can call programatically and includes detailed information on data types and -// errors. -// -// AWS provides SDKs that consist of libraries and sample code for various +// errors. AWS provides SDKs that consist of libraries and sample code for various // programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android. // The SDKs provide a convenient way to create programmatic access to IAM Identity // Center and other AWS services. For more information about the AWS SDKs, -// including how to download and install them, see [Tools for Amazon Web Services]. -// -// [Tools for Amazon Web Services]: http://aws.amazon.com/tools/ -// [IAM Identity Center rename]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed +// including how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/) +// . package sso diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index e9adaf46aa4..e98c0f328e5 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.9" +const goModuleVersion = "1.20.3" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go index 2c3a77ce306..0a00b256e10 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -187,14 +187,6 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-south-1", }, }, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-2", - }, - }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{ @@ -267,14 +259,6 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-south-1", }, }, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-2", - }, - }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{ diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go index 3561c443086..5dee7e53f47 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go @@ -50,10 +50,8 @@ type Options struct { // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a // value for this field will likely prevent you from using any endpoint-related // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service operation. This should be @@ -72,20 +70,17 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable @@ -102,9 +97,8 @@ type Options struct { // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP @@ -149,7 +143,6 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { // Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for // this field will likely prevent you from using any endpoint-related service // features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// // To migrate an EndpointResolver implementation that uses a custom endpoint, set // the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go index 07ac468e318..8dc02296b11 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go @@ -25,24 +25,22 @@ type AccountInfo struct { type RoleCredentials struct { // The identifier used for the temporary security credentials. For more - // information, see [Using Temporary Security Credentials to Request Access to AWS Resources]in the AWS IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + // information, see Using Temporary Security Credentials to Request Access to AWS + // Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. AccessKeyId *string // The date on which temporary security credentials expire. Expiration int64 - // The key that is used to sign the request. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS - // IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + // The key that is used to sign the request. For more information, see Using + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. SecretAccessKey *string - // The token used for temporary credentials. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS - // IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + // The token used for temporary credentials. For more information, see Using + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. SessionToken *string noSmithyDocumentSerde diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index b70701a5287..c6d5ae92e37 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,27 +1,3 @@ -# v1.24.3 (2024-05-23) - -* No change notes available for this release. - -# v1.24.2 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.1 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2024-05-10) - -* **Feature**: Updated request parameters for PKCE support. - -# v1.23.5 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.23.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.23.3 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go index 393ab84b043..63f1eeb1312 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go @@ -32,43 +32,34 @@ func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optF type CreateTokenInput struct { // The unique identifier string for the client or application. This value comes - // from the result of the RegisterClientAPI. + // from the result of the RegisterClient API. // // This member is required. ClientId *string // A secret string generated for the client. This value should come from the - // persisted result of the RegisterClientAPI. + // persisted result of the RegisterClient API. // // This member is required. ClientSecret *string // Supports the following OAuth grant types: Device Code and Refresh Token. // Specify either of the following values, depending on the grant type that you - // want: - // - // * Device Code - urn:ietf:params:oauth:grant-type:device_code - // - // * Refresh Token - refresh_token - // - // For information about how to obtain the device code, see the StartDeviceAuthorization topic. + // want: * Device Code - urn:ietf:params:oauth:grant-type:device_code * Refresh + // Token - refresh_token For information about how to obtain the device code, see + // the StartDeviceAuthorization topic. // // This member is required. GrantType *string // Used only when calling this API for the Authorization Code grant type. The // short-term code is used to identify this authorization request. This grant type - // is currently unsupported for the CreateTokenAPI. + // is currently unsupported for the CreateToken API. Code *string - // Used only when calling this API for the Authorization Code grant type. This - // value is generated by the client and presented to validate the original code - // challenge value the client passed at authorization time. - CodeVerifier *string - // Used only when calling this API for the Device Code grant type. This short-term // code is used to identify this authorization request. This comes from the result - // of the StartDeviceAuthorizationAPI. + // of the StartDeviceAuthorization API. DeviceCode *string // Used only when calling this API for the Authorization Code grant type. This @@ -78,18 +69,16 @@ type CreateTokenInput struct { // Used only when calling this API for the Refresh Token grant type. This token is // used to refresh short-term tokens, such as the access token, that might expire. - // // For more information about the features and limitations of the current IAM // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string // The list of scopes for which authorization is requested. The access token that // is issued is limited to the scopes that are granted. If this value is not // specified, IAM Identity Center authorizes all scopes that are configured for the - // client during the call to RegisterClient. + // client during the call to RegisterClient . Scope []string noSmithyDocumentSerde @@ -97,8 +86,7 @@ type CreateTokenInput struct { type CreateTokenOutput struct { - // A bearer token to access Amazon Web Services accounts and applications assigned - // to a user. + // A bearer token to access AWS accounts and applications assigned to a user. AccessToken *string // Indicates the time in seconds when an access token will expire. @@ -106,22 +94,18 @@ type CreateTokenOutput struct { // The idToken is not implemented or supported. For more information about the // features and limitations of the current IAM Identity Center OIDC implementation, - // see Considerations for Using this Guide in the [IAM Identity Center OIDC API Reference]. - // - // A JSON Web Token (JWT) that identifies who is associated with the issued access - // token. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + // see Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . A JSON Web Token (JWT) that identifies who is associated with the issued + // access token. IdToken *string // A token that, if present, can be used to refresh a previously issued access - // token that might have expired. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string // Used to notify the client that the returned token is an access token. The diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go index 1d54f14d804..63409538940 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -12,8 +12,8 @@ import ( // Creates and returns access and refresh tokens for clients and applications that // are authenticated using IAM entities. The access token can be used to fetch -// short-term credentials for the assigned Amazon Web Services accounts or to -// access application APIs using bearer authentication. +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) { if params == nil { params = &CreateTokenWithIAMInput{} @@ -39,15 +39,10 @@ type CreateTokenWithIAMInput struct { // Supports the following OAuth grant types: Authorization Code, Refresh Token, // JWT Bearer, and Token Exchange. Specify one of the following values, depending - // on the grant type that you want: - // - // * Authorization Code - authorization_code - // - // * Refresh Token - refresh_token - // - // * JWT Bearer - urn:ietf:params:oauth:grant-type:jwt-bearer - // - // * Token Exchange - urn:ietf:params:oauth:grant-type:token-exchange + // on the grant type that you want: * Authorization Code - authorization_code * + // Refresh Token - refresh_token * JWT Bearer - + // urn:ietf:params:oauth:grant-type:jwt-bearer * Token Exchange - + // urn:ietf:params:oauth:grant-type:token-exchange // // This member is required. GrantType *string @@ -64,11 +59,6 @@ type CreateTokenWithIAMInput struct { // in the Authorization Code GrantOptions for the application. Code *string - // Used only when calling this API for the Authorization Code grant type. This - // value is generated by the client and presented to validate the original code - // challenge value the client passed at authorization time. - CodeVerifier *string - // Used only when calling this API for the Authorization Code grant type. This // value specifies the location of the client or application that has registered to // receive the authorization code. @@ -76,21 +66,16 @@ type CreateTokenWithIAMInput struct { // Used only when calling this API for the Refresh Token grant type. This token is // used to refresh short-term tokens, such as the access token, that might expire. - // // For more information about the features and limitations of the current IAM // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string // Used only when calling this API for the Token Exchange grant type. This value // specifies the type of token that the requester can receive. The following values - // are supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token - // - // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + // are supported: * Access Token - urn:ietf:params:oauth:token-type:access_token * + // Refresh Token - urn:ietf:params:oauth:token-type:refresh_token RequestedTokenType *string // The list of scopes for which authorization is requested. The access token that @@ -109,9 +94,8 @@ type CreateTokenWithIAMInput struct { // Used only when calling this API for the Token Exchange grant type. This value // specifies the type of token that is passed as the subject of the exchange. The - // following value is supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token + // following value is supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token SubjectTokenType *string noSmithyDocumentSerde @@ -119,8 +103,7 @@ type CreateTokenWithIAMInput struct { type CreateTokenWithIAMOutput struct { - // A bearer token to access Amazon Web Services accounts and applications assigned - // to a user. + // A bearer token to access AWS accounts and applications assigned to a user. AccessToken *string // Indicates the time in seconds when an access token will expire. @@ -131,21 +114,17 @@ type CreateTokenWithIAMOutput struct { IdToken *string // Indicates the type of tokens that are issued by IAM Identity Center. The - // following values are supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token - // - // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + // following values are supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token * Refresh Token - + // urn:ietf:params:oauth:token-type:refresh_token IssuedTokenType *string // A token that, if present, can be used to refresh a previously issued access - // token that might have expired. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string // The list of scopes for which authorization is granted. The access token that is diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go index 9daccf79b8c..09f016ec1ef 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go @@ -41,25 +41,6 @@ type RegisterClientInput struct { // This member is required. ClientType *string - // This IAM Identity Center application ARN is used to define - // administrator-managed configuration for public client access to resources. At - // authorization, the scopes, grants, and redirect URI available to this client - // will be restricted by this application resource. - EntitledApplicationArn *string - - // The list of OAuth 2.0 grant types that are defined by the client. This list is - // used to restrict the token granting flows available to the client. - GrantTypes []string - - // The IAM Identity Center Issuer URL associated with an instance of IAM Identity - // Center. This value is needed for user access to resources through the client. - IssuerUrl *string - - // The list of redirect URI that are defined by the client. At completion of - // authorization, this list is used to restrict what locations the user agent can - // be redirected back to. - RedirectUris []string - // The list of scopes that are defined by the client. Upon authorization, this // list is used to restrict permissions when granting an access token. Scopes []string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go index 0b727e38b96..c568805b226 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -30,23 +30,22 @@ func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDevi type StartDeviceAuthorizationInput struct { // The unique identifier string for the client that is registered with IAM - // Identity Center. This value should come from the persisted result of the RegisterClientAPI - // operation. + // Identity Center. This value should come from the persisted result of the + // RegisterClient API operation. // // This member is required. ClientId *string // A secret string that is generated for the client. This value should come from - // the persisted result of the RegisterClientAPI operation. + // the persisted result of the RegisterClient API operation. // // This member is required. ClientSecret *string - // The URL for the Amazon Web Services access portal. For more information, see [Using the Amazon Web Services access portal] + // The URL for the Amazon Web Services access portal. For more information, see + // Using the Amazon Web Services access portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html) // in the IAM Identity Center User Guide. // - // [Using the Amazon Web Services access portal]: https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html - // // This member is required. StartUrl *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go index 05e8c6b7e5f..76a1160eceb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go @@ -13,21 +13,11 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" - "time" ) -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - type awsRestjson1_deserializeOpCreateToken struct { } @@ -591,18 +581,12 @@ func awsRestjson1_deserializeOpErrorRegisterClient(response *smithyhttp.Response case strings.EqualFold("InvalidClientMetadataException", errorCode): return awsRestjson1_deserializeErrorInvalidClientMetadataException(response, errorBody) - case strings.EqualFold("InvalidRedirectUriException", errorCode): - return awsRestjson1_deserializeErrorInvalidRedirectUriException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("InvalidScopeException", errorCode): return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) - case strings.EqualFold("UnsupportedGrantTypeException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1174,42 +1158,6 @@ func awsRestjson1_deserializeErrorInvalidGrantException(response *smithyhttp.Res return output } -func awsRestjson1_deserializeErrorInvalidRedirectUriException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRedirectUriException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidRedirectUriException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRequestException{} var buff [1024]byte @@ -1769,55 +1717,6 @@ func awsRestjson1_deserializeDocumentInvalidGrantException(v **types.InvalidGran return nil } -func awsRestjson1_deserializeDocumentInvalidRedirectUriException(v **types.InvalidRedirectUriException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidRedirectUriException - if *v == nil { - sv = &types.InvalidRedirectUriException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go index 1d258e5677b..53cd4f55a03 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go @@ -6,41 +6,33 @@ // IAM Identity Center OpenID Connect (OIDC) is a web service that enables a // client (such as CLI or a native application) to register with IAM Identity // Center. The service also enables the client to fetch the user’s access token -// upon successful authentication and authorization with IAM Identity Center. -// -// IAM Identity Center uses the sso and identitystore API namespaces. -// -// # Considerations for Using This Guide -// -// Before you begin using this guide, we recommend that you first review the -// following important information about how the IAM Identity Center OIDC service -// works. -// +// upon successful authentication and authorization with IAM Identity Center. IAM +// Identity Center uses the sso and identitystore API namespaces. Considerations +// for Using This Guide Before you begin using this guide, we recommend that you +// first review the following important information about how the IAM Identity +// Center OIDC service works. // - The IAM Identity Center OIDC service currently implements only the portions -// of the OAuth 2.0 Device Authorization Grant standard ([https://tools.ietf.org/html/rfc8628] ) that are necessary to -// enable single sign-on authentication with the CLI. -// +// of the OAuth 2.0 Device Authorization Grant standard ( +// https://tools.ietf.org/html/rfc8628 (https://tools.ietf.org/html/rfc8628) ) +// that are necessary to enable single sign-on authentication with the CLI. // - With older versions of the CLI, the service only emits OIDC access tokens, // so to obtain a new token, users must explicitly re-authenticate. To access the // OIDC flow that supports token refresh and doesn’t require re-authentication, // update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with // support for OIDC token refresh and configurable IAM Identity Center session -// durations. For more information, see [Configure Amazon Web Services access portal session duration]. -// +// durations. For more information, see Configure Amazon Web Services access +// portal session duration (https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html) +// . // - The access tokens provided by this service grant access to all Amazon Web // Services account entitlements assigned to an IAM Identity Center user, not just // a particular application. -// // - The documentation in this guide does not describe the mechanism to convert // the access token into Amazon Web Services Auth (“sigv4”) credentials for use // with IAM-protected Amazon Web Services service endpoints. For more information, -// see [GetRoleCredentials]in the IAM Identity Center Portal API Reference Guide. -// -// For general information about IAM Identity Center, see [What is IAM Identity Center?] in the IAM Identity -// Center User Guide. +// see GetRoleCredentials (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html) +// in the IAM Identity Center Portal API Reference Guide. // -// [Configure Amazon Web Services access portal session duration]: https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html -// [GetRoleCredentials]: https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html -// [https://tools.ietf.org/html/rfc8628]: https://tools.ietf.org/html/rfc8628 -// [What is IAM Identity Center?]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html +// For general information about IAM Identity Center, see What is IAM Identity +// Center? (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) +// in the IAM Identity Center User Guide. package ssooidc diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index 80189fbfbc6..e81f202fd82 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.24.3" +const goModuleVersion = "1.23.3" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go index 843edb07428..aa207253432 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -187,14 +187,6 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-south-1", }, }, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-2", - }, - }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{ @@ -267,14 +259,6 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-south-1", }, }, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-2", - }, - }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{ diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go index 69ded47c74c..b964e7e1090 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go @@ -50,10 +50,8 @@ type Options struct { // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a // value for this field will likely prevent you from using any endpoint-related // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service operation. This should be @@ -72,20 +70,17 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable @@ -102,9 +97,8 @@ type Options struct { // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP @@ -149,7 +143,6 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { // Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for // this field will likely prevent you from using any endpoint-related service // features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// // To migrate an EndpointResolver implementation that uses a custom endpoint, set // the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go index 04411bd6167..754218b78e2 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go @@ -95,11 +95,6 @@ func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value ok.String(*v.Code) } - if v.CodeVerifier != nil { - ok := object.Key("codeVerifier") - ok.String(*v.CodeVerifier) - } - if v.DeviceCode != nil { ok := object.Key("deviceCode") ok.String(*v.DeviceCode) @@ -212,11 +207,6 @@ func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithI ok.String(*v.Code) } - if v.CodeVerifier != nil { - ok := object.Key("codeVerifier") - ok.String(*v.CodeVerifier) - } - if v.GrantType != nil { ok := object.Key("grantType") ok.String(*v.GrantType) @@ -334,30 +324,6 @@ func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, ok.String(*v.ClientType) } - if v.EntitledApplicationArn != nil { - ok := object.Key("entitledApplicationArn") - ok.String(*v.EntitledApplicationArn) - } - - if v.GrantTypes != nil { - ok := object.Key("grantTypes") - if err := awsRestjson1_serializeDocumentGrantTypes(v.GrantTypes, ok); err != nil { - return err - } - } - - if v.IssuerUrl != nil { - ok := object.Key("issuerUrl") - ok.String(*v.IssuerUrl) - } - - if v.RedirectUris != nil { - ok := object.Key("redirectUris") - if err := awsRestjson1_serializeDocumentRedirectUris(v.RedirectUris, ok); err != nil { - return err - } - } - if v.Scopes != nil { ok := object.Key("scopes") if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil { @@ -453,28 +419,6 @@ func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDevic return nil } -func awsRestjson1_serializeDocumentGrantTypes(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsRestjson1_serializeDocumentRedirectUris(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - func awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go index 2cfe7b48fed..86b62049fd9 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go @@ -188,7 +188,7 @@ func (e *InvalidClientMetadataException) ErrorCode() string { func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that a request contains an invalid grant. This can occur if a client -// makes a CreateTokenrequest with an invalid grant type. +// makes a CreateToken request with an invalid grant type. type InvalidGrantException struct { Message *string @@ -217,36 +217,6 @@ func (e *InvalidGrantException) ErrorCode() string { } func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Indicates that one or more redirect URI in the request is not supported for -// this operation. -type InvalidRedirectUriException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InvalidRedirectUriException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRedirectUriException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRedirectUriException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRedirectUriException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRedirectUriException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - // Indicates that something is wrong with the input to the request. For example, a // required parameter might be missing or out of range. type InvalidRequestException struct { diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 77cd6034609..1c503194557 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,23 +1,3 @@ -# v1.28.10 (2024-05-23) - -* No change notes available for this release. - -# v1.28.9 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.8 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.7 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.28.6 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - # v1.28.5 (2024-03-18) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go index 936f917bfd2..e0e2c9c2e8d 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go @@ -16,99 +16,69 @@ import ( // Amazon Web Services resources. These temporary credentials consist of an access // key ID, a secret access key, and a security token. Typically, you use AssumeRole // within your account or for cross-account access. For a comparison of AssumeRole -// with other API operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the -// IAM User Guide. -// -// # Permissions -// -// The temporary security credentials created by AssumeRole can be used to make -// API calls to any Amazon Web Services service with the following exception: You -// cannot call the Amazon Web Services STS GetFederationToken or GetSessionToken -// API operations. -// -// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a -// single JSON policy document to use as an inline session policy. You can also -// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed -// session policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. Passing policies to this operation -// returns new temporary credentials. The resulting session's permissions are the -// intersection of the role's identity-based policy and the session policies. You -// can use the role's temporary credentials in subsequent Amazon Web Services API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// When you create a role, you create two policies: a role trust policy that -// specifies who can assume the role, and a permissions policy that specifies what -// can be done with the role. You specify the trusted principal that is allowed to -// assume the role in the role trust policy. -// -// To assume a role from a different account, your Amazon Web Services account -// must be trusted by the role. The trust relationship is defined in the role's -// trust policy when the role is created. That trust policy states which accounts -// are allowed to delegate that access to users in the account. -// -// A user who wants to access a role in a different account must also have -// permissions that are delegated from the account administrator. The administrator -// must attach a policy that allows the user to call AssumeRole for the ARN of the -// role in the other account. -// -// To allow a user to assume a role in the same account, you can do either of the -// following: -// +// with other API operations that produce temporary credentials, see Requesting +// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. Permissions The temporary security credentials created by +// AssumeRole can be used to make API calls to any Amazon Web Services service +// with the following exception: You cannot call the Amazon Web Services STS +// GetFederationToken or GetSessionToken API operations. (Optional) You can pass +// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. When you create a role, you create two policies: a role +// trust policy that specifies who can assume the role, and a permissions policy +// that specifies what can be done with the role. You specify the trusted principal +// that is allowed to assume the role in the role trust policy. To assume a role +// from a different account, your Amazon Web Services account must be trusted by +// the role. The trust relationship is defined in the role's trust policy when the +// role is created. That trust policy states which accounts are allowed to delegate +// that access to users in the account. A user who wants to access a role in a +// different account must also have permissions that are delegated from the account +// administrator. The administrator must attach a policy that allows the user to +// call AssumeRole for the ARN of the role in the other account. To allow a user +// to assume a role in the same account, you can do either of the following: // - Attach a policy to the user that allows the user to call AssumeRole (as long // as the role's trust policy trusts the account). -// // - Add the user as a principal directly in the role's trust policy. // // You can do either because the role’s trust policy acts as an IAM resource-based // policy. When a resource-based policy grants access to a principal in the same // account, no additional identity-based policy is required. For more information -// about trust policies and resource-based policies, see [IAM Policies]in the IAM User Guide. -// -// # Tags -// -// (Optional) You can pass tag key-value pairs to your session. These tags are -// called session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM -// User Guide. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # Using MFA with AssumeRole -// -// (Optional) You can include multi-factor authentication (MFA) information when -// you call AssumeRole . This is useful for cross-account scenarios to ensure that -// the user that assumes the role has been authenticated with an Amazon Web -// Services MFA device. In that scenario, the trust policy of the role being -// assumed includes a condition that tests for MFA authentication. If the caller -// does not include valid MFA information, the request to assume the role is -// denied. The condition in a trust policy that tests for MFA authentication might -// look like the following example. -// -// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} -// -// For more information, see [Configuring MFA-Protected API Access] in the IAM User Guide guide. -// -// To use MFA with AssumeRole , you pass values for the SerialNumber and TokenCode -// parameters. The SerialNumber value identifies the user's hardware or virtual -// MFA device. The TokenCode is the time-based one-time password (TOTP) that the -// MFA device produces. -// -// [Configuring MFA-Protected API Access]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining -// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison -// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [IAM Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +// about trust policies and resource-based policies, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) +// in the IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your +// session. These tags are called session tags. For more information about session +// tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. An administrator must grant you the permissions necessary +// to pass session tags. The administrator can also create granular permissions to +// allow you to pass only specific session tags. For more information, see +// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. You can set the session tags as transitive. Transitive +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. Using MFA with AssumeRole (Optional) You can include +// multi-factor authentication (MFA) information when you call AssumeRole . This is +// useful for cross-account scenarios to ensure that the user that assumes the role +// has been authenticated with an Amazon Web Services MFA device. In that scenario, +// the trust policy of the role being assumed includes a condition that tests for +// MFA authentication. If the caller does not include valid MFA information, the +// request to assume the role is denied. The condition in a trust policy that tests +// for MFA authentication might look like the following example. "Condition": +// {"Bool": {"aws:MultiFactorAuthPresent": true}} For more information, see +// Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) +// in the IAM User Guide guide. To use MFA with AssumeRole , you pass values for +// the SerialNumber and TokenCode parameters. The SerialNumber value identifies +// the user's hardware or virtual MFA device. The TokenCode is the time-based +// one-time password (TOTP) that the MFA device produces. func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) { if params == nil { params = &AssumeRoleInput{} @@ -131,19 +101,17 @@ type AssumeRoleInput struct { // This member is required. RoleArn *string - // An identifier for the assumed role session. - // - // Use the role session name to uniquely identify a session when the same role is - // assumed by different principals or for different reasons. In cross-account - // scenarios, the role session name is visible to, and can be logged by the account - // that owns the role. The role session name is also used in the ARN of the assumed - // role principal. This means that subsequent cross-account API requests that use - // the temporary security credentials will expose the role session name to the - // external account in their CloudTrail logs. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // An identifier for the assumed role session. Use the role session name to + // uniquely identify a session when the same role is assumed by different + // principals or for different reasons. In cross-account scenarios, the role + // session name is visible to, and can be logged by the account that owns the role. + // The role session name is also used in the ARN of the assumed role principal. + // This means that subsequent cross-account API requests that use the temporary + // security credentials will expose the role session name to the external account + // in their CloudTrail logs. The regex used to validate this parameter is a string + // of characters consisting of upper- and lower-case alphanumeric characters with + // no spaces. You can also include underscores or any of the following characters: + // =,.@- // // This member is required. RoleSessionName *string @@ -154,27 +122,23 @@ type AssumeRoleInput struct { // hours. If you specify a value higher than this setting or the administrator // setting (whichever is lower), the operation fails. For example, if you specify a // session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. - // - // Role chaining limits your Amazon Web Services CLI or Amazon Web Services API - // role session to a maximum of one hour. When you use the AssumeRole API - // operation to assume a role, you can specify the duration of your role session - // with the DurationSeconds parameter. You can specify a parameter value of up to - // 43200 seconds (12 hours), depending on the maximum session duration setting for - // your role. However, if you assume a role using role chaining and provide a - // DurationSeconds parameter value greater than one hour, the operation fails. To - // learn how to view the maximum value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration + // duration to 6 hours, your operation fails. Role chaining limits your Amazon Web + // Services CLI or Amazon Web Services API role session to a maximum of one hour. + // When you use the AssumeRole API operation to assume a role, you can specify the + // duration of your role session with the DurationSeconds parameter. You can + // specify a parameter value of up to 43200 seconds (12 hours), depending on the + // maximum session duration setting for your role. However, if you assume a role + // using role chaining and provide a DurationSeconds parameter value greater than + // one hour, the operation fails. To learn how to view the maximum value for your + // role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. By default, the value is set to 3600 seconds. The + // DurationSeconds parameter is separate from the duration of a console session + // that you might request using the returned credentials. The request to the + // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // in the IAM User Guide. DurationSeconds *int32 // A unique identifier that might be required when you assume a role in another @@ -185,79 +149,63 @@ type AssumeRoleInput struct { // the administrator of the trusting account might send an external ID to the // administrator of the trusted account. That way, only someone with the ID can // assume the role, rather than everyone in the account. For more information about - // the external ID, see [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@:/- - // - // [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + // the external ID, see How to Use an External ID When Granting Access to Your + // Amazon Web Services Resources to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@:/- ExternalId *string // An IAM policy in JSON format that you want to use as an inline session policy. - // // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the // role's temporary credentials in subsequent Amazon Web Services API calls to // access resources in the account that owns the role. You cannot use session // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed + // session policies can't exceed 2,048 characters. The JSON policy characters can + // be any ASCII character from the space character to the end of the valid + // character list (\u0020 through \u00FF). It can also include the tab (\u0009), + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // the role. This parameter is optional. You can provide up to 10 managed policy + // ARNs. However, the plaintext that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, see + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType // A list of previously acquired trusted context assertions in the format of a // JSON array. The trusted context assertion is signed and encrypted by Amazon Web - // Services STS. - // - // The following is an example of a ProvidedContext value that includes a single - // trusted context assertion and the ARN of the context provider from which the - // trusted context assertion was generated. - // - // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}] + // Services STS. The following is an example of a ProvidedContext value that + // includes a single trusted context assertion and the ARN of the context provider + // from which the trusted context assertion was generated. + // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}] ProvidedContexts []types.ProvidedContext // The identification number of the MFA device that is associated with the user @@ -265,97 +213,79 @@ type AssumeRoleInput struct { // the role being assumed includes a condition that requires MFA authentication. // The value is either the serial number for a hardware device (such as // GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as - // arn:aws:iam::123456789012:mfa/user ). - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // arn:aws:iam::123456789012:mfa/user ). The regex used to validate this parameter + // is a string of characters consisting of upper- and lower-case alphanumeric + // characters with no spaces. You can also include underscores or any of the + // following characters: =,.@- SerialNumber *string // The source identity specified by the principal that is calling the AssumeRole - // operation. - // - // You can require users to specify a source identity when they assume a role. You - // do this by using the sts:SourceIdentity condition key in a role trust policy. - // You can use source identity information in CloudTrail logs to determine who took - // actions with a role. You can use the aws:SourceIdentity condition key to - // further control access to Amazon Web Services resources based on the value of - // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the - // IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@-. You cannot use a - // value that begins with the text aws: . This prefix is reserved for Amazon Web - // Services internal use. - // - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@-. You cannot use a value that begins with the text aws: . This prefix is + // reserved for Amazon Web Services internal use. SourceIdentity *string // A list of session tags that you want to pass. Each session tag consists of a - // key name and an associated value. For more information about session tags, see [Tagging Amazon Web Services STS Sessions] + // key name and an associated value. For more information about session tags, see + // Tagging Amazon Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. This parameter is optional. You can pass up to 50 session + // tags. The plaintext session tag keys can’t exceed 128 characters, and the values + // can’t exceed 256 characters. For these and additional limits, see IAM and STS + // Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. An Amazon Web Services conversion compresses the passed + // inline session policy, managed policy ARNs, and session tags into a packed + // binary format that has a separate limit. Your request can fail for this limit + // even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. You can pass a session tag with the + // same key as a tag that is already attached to the role. When you do, session + // tags override a role tag with the same key. Tag key–value pairs are not case + // sensitive, but case is preserved. This means that you cannot have separate + // Department and department tag keys. Assume that the role has the Department = + // Marketing tag and you pass the department = engineering session tag. Department + // and department are not saved as separate tags, and the session tag passed in + // the request takes precedence over the role tag. Additionally, if you used + // temporary credentials to perform this operation, the new session inherits any + // transitive session tags from the calling session. If you pass a session tag with + // the same key as an inherited tag, the operation fails. To view the inherited + // tags for a session, see the CloudTrail logs. For more information, see Viewing + // Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs) // in the IAM User Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plaintext - // session tag keys can’t exceed 128 characters, and the values can’t exceed 256 - // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the role. When you do, session tags override a role tag with the same key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This means - // that you cannot have separate Department and department tag keys. Assume that - // the role has the Department = Marketing tag and you pass the department = - // engineering session tag. Department and department are not saved as separate - // tags, and the session tag passed in the request takes precedence over the role - // tag. - // - // Additionally, if you used temporary credentials to perform this operation, the - // new session inherits any transitive session tags from the calling session. If - // you pass a session tag with the same key as an inherited tag, the operation - // fails. To view the inherited tags for a session, see the CloudTrail logs. For - // more information, see [Viewing Session Tags in CloudTrail]in the IAM User Guide. - // - // [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length - // [Viewing Session Tags in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs Tags []types.Tag // The value provided by the MFA device, if the trust policy of the role being // assumed requires MFA. (In other words, if the policy includes a condition that // tests for MFA). If the role being assumed requires MFA and if the TokenCode // value is missing or expired, the AssumeRole call returns an "access denied" - // error. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. + // error. The format for this parameter, as described by its regex pattern, is a + // sequence of six numeric digits. TokenCode *string // A list of keys for session tags that you want to set as transitive. If you set // a tag key as transitive, the corresponding key and value passes to subsequent - // sessions in a role chain. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. - // - // This parameter is optional. When you set session tags as transitive, the - // session policy and session tags packed binary limit is not affected. - // - // If you choose not to specify a transitive tag key, then no tags are passed from - // this session to any subsequent sessions. - // - // [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining + // sessions in a role chain. For more information, see Chaining Roles with Session + // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. This parameter is optional. When you set session tags as + // transitive, the session policy and session tags packed binary limit is not + // affected. If you choose not to specify a transitive tag key, then no tags are + // passed from this session to any subsequent sessions. TransitiveTagKeys []string noSmithyDocumentSerde } -// Contains the response to a successful AssumeRole request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. +// Contains the response to a successful AssumeRole request, including temporary +// Amazon Web Services credentials that can be used to make Amazon Web Services +// requests. type AssumeRoleOutput struct { // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers @@ -366,10 +296,9 @@ type AssumeRoleOutput struct { AssumedRoleUser *types.AssumedRoleUser // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. + // access key, and a security (or session) token. The size of the security token + // that STS API operations return is not fixed. We strongly recommend that you make + // no assumptions about the maximum size. Credentials *types.Credentials // A percentage value that indicates the packed size of the session policies and @@ -379,21 +308,17 @@ type AssumeRoleOutput struct { PackedPolicySize *int32 // The source identity specified by the principal that is calling the AssumeRole - // operation. - // - // You can require users to specify a source identity when they assume a role. You - // do this by using the sts:SourceIdentity condition key in a role trust policy. - // You can use source identity information in CloudTrail logs to determine who took - // actions with a role. You can use the aws:SourceIdentity condition key to - // further control access to Amazon Web Services resources based on the value of - // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the - // IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- SourceIdentity *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go index f88ab4a22b4..2a57b72ac99 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go @@ -16,132 +16,92 @@ import ( // mechanism for tying an enterprise identity store or directory to role-based // Amazon Web Services access without user-specific credentials or configuration. // For a comparison of AssumeRoleWithSAML with the other API operations that -// produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide. -// -// The temporary security credentials returned by this operation consist of an -// access key ID, a secret access key, and a security token. Applications can use -// these temporary security credentials to sign calls to Amazon Web Services -// services. -// -// # Session Duration -// -// By default, the temporary security credentials created by AssumeRoleWithSAML -// last for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. Your role session lasts for the -// duration that you specify, or until the time specified in the SAML -// authentication response's SessionNotOnOrAfter value, whichever is shorter. You -// can provide a DurationSeconds value from 900 seconds (15 minutes) up to the -// maximum session duration setting for the role. This setting can have a value -// from 1 hour to 12 hours. To learn how to view the maximum value for your role, -// see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console URL. -// For more information, see [Using IAM Roles]in the IAM User Guide. -// -// [Role chaining]limits your CLI or Amazon Web Services API role session to a maximum of one +// produce temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. The temporary security credentials returned by this +// operation consist of an access key ID, a secret access key, and a security +// token. Applications can use these temporary security credentials to sign calls +// to Amazon Web Services services. Session Duration By default, the temporary +// security credentials created by AssumeRoleWithSAML last for one hour. However, +// you can use the optional DurationSeconds parameter to specify the duration of +// your session. Your role session lasts for the duration that you specify, or +// until the time specified in the SAML authentication response's +// SessionNotOnOrAfter value, whichever is shorter. You can provide a +// DurationSeconds value from 900 seconds (15 minutes) up to the maximum session +// duration setting for the role. This setting can have a value from 1 hour to 12 +// hours. To learn how to view the maximum value for your role, see View the +// Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// in the IAM User Guide. The maximum session duration limit applies when you use +// the AssumeRole* API operations or the assume-role* CLI commands. However the +// limit does not apply when you use those operations to create a console URL. For +// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining) +// limits your CLI or Amazon Web Services API role session to a maximum of one // hour. When you use the AssumeRole API operation to assume a role, you can // specify the duration of your role session with the DurationSeconds parameter. // You can specify a parameter value of up to 43200 seconds (12 hours), depending // on the maximum session duration setting for your role. However, if you assume a // role using role chaining and provide a DurationSeconds parameter value greater -// than one hour, the operation fails. -// -// # Permissions -// -// The temporary security credentials created by AssumeRoleWithSAML can be used to -// make API calls to any Amazon Web Services service with the following exception: -// you cannot call the STS GetFederationToken or GetSessionToken API operations. -// -// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a -// single JSON policy document to use as an inline session policy. You can also -// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed -// session policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. Passing policies to this operation -// returns new temporary credentials. The resulting session's permissions are the -// intersection of the role's identity-based policy and the session policies. You -// can use the role's temporary credentials in subsequent Amazon Web Services API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// Calling AssumeRoleWithSAML does not require the use of Amazon Web Services -// security credentials. The identity of the caller is validated by using keys in -// the metadata document that is uploaded for the SAML provider entity for your -// identity provider. -// -// Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. The -// entry includes the value in the NameID element of the SAML assertion. We -// recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the -// persistent identifier ( urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). -// -// # Tags -// -// (Optional) You can configure your IdP to pass attributes into your SAML -// assertion as session tags. Each session tag consists of a key name and an -// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User -// Guide. -// -// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed -// 128 characters and the values can’t exceed 256 characters. For these and -// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. -// -// An Amazon Web Services conversion compresses the passed inline session policy, -// managed policy ARNs, and session tags into a packed binary format that has a -// separate limit. Your request can fail for this limit even if your plaintext -// meets the other requirements. The PackedPolicySize response element indicates -// by percentage how close the policies and tags for your request are to the upper -// size limit. -// -// You can pass a session tag with the same key as a tag that is attached to the -// role. When you do, session tags override the role's tags with the same key. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # SAML Configuration -// -// Before your application can call AssumeRoleWithSAML , you must configure your -// SAML identity provider (IdP) to issue the claims required by Amazon Web -// Services. Additionally, you must use Identity and Access Management (IAM) to -// create a SAML provider entity in your Amazon Web Services account that -// represents your identity provider. You must also create an IAM role that -// specifies this SAML provider in its trust policy. -// +// than one hour, the operation fails. Permissions The temporary security +// credentials created by AssumeRoleWithSAML can be used to make API calls to any +// Amazon Web Services service with the following exception: you cannot call the +// STS GetFederationToken or GetSessionToken API operations. (Optional) You can +// pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. Calling AssumeRoleWithSAML does not require the use of +// Amazon Web Services security credentials. The identity of the caller is +// validated by using keys in the metadata document that is uploaded for the SAML +// provider entity for your identity provider. Calling AssumeRoleWithSAML can +// result in an entry in your CloudTrail logs. The entry includes the value in the +// NameID element of the SAML assertion. We recommend that you use a NameIDType +// that is not associated with any personally identifiable information (PII). For +// example, you could instead use the persistent identifier ( +// urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). Tags (Optional) You can +// configure your IdP to pass attributes into your SAML assertion as session tags. +// Each session tag consists of a key name and an associated value. For more +// information about session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session +// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. +// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. An Amazon Web Services conversion compresses the passed +// inline session policy, managed policy ARNs, and session tags into a packed +// binary format that has a separate limit. Your request can fail for this limit +// even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags for +// your request are to the upper size limit. You can pass a session tag with the +// same key as a tag that is attached to the role. When you do, session tags +// override the role's tags with the same key. An administrator must grant you the +// permissions necessary to pass session tags. The administrator can also create +// granular permissions to allow you to pass only specific session tags. For more +// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. You can set the session tags as transitive. Transitive +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. SAML Configuration Before your application can call +// AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to +// issue the claims required by Amazon Web Services. Additionally, you must use +// Identity and Access Management (IAM) to create a SAML provider entity in your +// Amazon Web Services account that represents your identity provider. You must +// also create an IAM role that specifies this SAML provider in its trust policy. // For more information, see the following resources: -// -// [About SAML 2.0-based Federation] -// - in the IAM User Guide. -// -// [Creating SAML Identity Providers] -// - in the IAM User Guide. -// -// [Configuring a Relying Party and Claims] -// - in the IAM User Guide. -// -// [Creating a Role for SAML 2.0 Federation] -// - in the IAM User Guide. -// -// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session -// [Creating a Role for SAML 2.0 Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html -// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length -// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison -// [Creating SAML Identity Providers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html -// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -// [Configuring a Relying Party and Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html -// [Role chaining]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining -// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [About SAML 2.0-based Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining +// - About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) +// in the IAM User Guide. +// - Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) +// in the IAM User Guide. +// - Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) +// in the IAM User Guide. +// - Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) +// in the IAM User Guide. func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) { if params == nil { params = &AssumeRoleWithSAMLInput{} @@ -170,11 +130,9 @@ type AssumeRoleWithSAMLInput struct { // This member is required. RoleArn *string - // The base64 encoded SAML authentication response provided by the IdP. - // - // For more information, see [Configuring a Relying Party and Adding Claims] in the IAM User Guide. - // - // [Configuring a Relying Party and Adding Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html + // The base64 encoded SAML authentication response provided by the IdP. For more + // information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) + // in the IAM User Guide. // // This member is required. SAMLAssertion *string @@ -188,114 +146,92 @@ type AssumeRoleWithSAMLInput struct { // than this setting, the operation fails. For example, if you specify a session // duration of 12 hours, but your administrator set the maximum session duration to // 6 hours, your operation fails. To learn how to view the maximum value for your - // role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration + // role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. By default, the value is set to 3600 seconds. The + // DurationSeconds parameter is separate from the duration of a console session + // that you might request using the returned credentials. The request to the + // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // in the IAM User Guide. DurationSeconds *int32 // An IAM policy in JSON format that you want to use as an inline session policy. - // // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the // role's temporary credentials in subsequent Amazon Web Services API calls to // access resources in the account that owns the role. You cannot use session // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed + // session policies can't exceed 2,048 characters. The JSON policy characters can + // be any ASCII character from the space character to the end of the valid + // character list (\u0020 through \u00FF). It can also include the tab (\u0009), + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // the role. This parameter is optional. You can provide up to 10 managed policy + // ARNs. However, the plaintext that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, see + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType noSmithyDocumentSerde } -// Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. +// Contains the response to a successful AssumeRoleWithSAML request, including +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type AssumeRoleWithSAMLOutput struct { // The identifiers for the temporary security credentials that the operation // returns. AssumedRoleUser *types.AssumedRoleUser - // The value of the Recipient attribute of the SubjectConfirmationData element of + // The value of the Recipient attribute of the SubjectConfirmationData element of // the SAML assertion. Audience *string // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. + // access key, and a security (or session) token. The size of the security token + // that STS API operations return is not fixed. We strongly recommend that you make + // no assumptions about the maximum size. Credentials *types.Credentials // The value of the Issuer element of the SAML assertion. Issuer *string // A hash value based on the concatenation of the following: - // // - The Issuer response value. - // // - The Amazon Web Services account ID. - // // - The friendly name (the last part of the ARN) of the SAML provider in IAM. - // // The combination of NameQualifier and Subject can be used to uniquely identify a - // user. - // - // The following pseudocode shows how the hash value is calculated: - // - // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) + // user. The following pseudocode shows how the hash value is calculated: BASE64 ( + // SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) NameQualifier *string // A percentage value that indicates the packed size of the session policies and @@ -304,36 +240,31 @@ type AssumeRoleWithSAMLOutput struct { // allowed space. PackedPolicySize *int32 - // The value in the SourceIdentity attribute in the SAML assertion. - // - // You can require users to set a source identity value when they assume a role. - // You do this by using the sts:SourceIdentity condition key in a role trust - // policy. That way, actions that are taken with the role are associated with that - // user. After the source identity is set, the value cannot be changed. It is - // present in the request for all actions that are taken by the role and persists - // across [chained role]sessions. You can configure your SAML identity provider to use an - // attribute associated with your users, like user name or email, as the source - // identity when calling AssumeRoleWithSAML . You do this by adding an attribute to - // the SAML assertion. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in - // the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + // The value in the SourceIdentity attribute in the SAML assertion. You can + // require users to set a source identity value when they assume a role. You do + // this by using the sts:SourceIdentity condition key in a role trust policy. That + // way, actions that are taken with the role are associated with that user. After + // the source identity is set, the value cannot be changed. It is present in the + // request for all actions that are taken by the role and persists across chained + // role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your SAML identity provider to use an attribute + // associated with your users, like user name or email, as the source identity when + // calling AssumeRoleWithSAML . You do this by adding an attribute to the SAML + // assertion. For more information about using source identity, see Monitor and + // control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- SourceIdentity *string // The value of the NameID element in the Subject element of the SAML assertion. Subject *string - // The format of the name ID, as defined by the Format attribute in the NameID + // The format of the name ID, as defined by the Format attribute in the NameID // element of the SAML assertion. Typical examples of the format are transient or - // persistent . - // - // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format , - // that prefix is removed. For example, + // persistent . If the format includes the prefix + // urn:oasis:names:tc:SAML:2.0:nameid-format , that prefix is removed. For example, // urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient . // If the format includes any other prefix, the format is returned with no // modifications. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go index 6c8cf43e534..98108ce6af0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go @@ -14,143 +14,105 @@ import ( // Returns a set of temporary security credentials for users who have been // authenticated in a mobile or web application with a web identity provider. // Example providers include the OAuth 2.0 providers Login with Amazon and -// Facebook, or any OpenID Connect-compatible identity provider such as Google or [Amazon Cognito federated identities]. -// -// For mobile applications, we recommend that you use Amazon Cognito. You can use -// Amazon Cognito with the [Amazon Web Services SDK for iOS Developer Guide]and the [Amazon Web Services SDK for Android Developer Guide] to uniquely identify a user. You can also -// supply the user with a consistent identity throughout the lifetime of an -// application. -// -// To learn more about Amazon Cognito, see [Amazon Cognito identity pools] in Amazon Cognito Developer Guide. -// -// Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web -// Services security credentials. Therefore, you can distribute an application (for -// example, on mobile devices) that requests temporary security credentials without -// including long-term Amazon Web Services credentials in the application. You also -// don't need to deploy server-based proxy services that use long-term Amazon Web -// Services credentials. Instead, the identity of the caller is validated by using -// a token from the web identity provider. For a comparison of -// AssumeRoleWithWebIdentity with the other API operations that produce temporary -// credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide. -// -// The temporary security credentials returned by this API consist of an access -// key ID, a secret access key, and a security token. Applications can use these -// temporary security credentials to sign calls to Amazon Web Services service API -// operations. -// -// # Session Duration -// -// By default, the temporary security credentials created by -// AssumeRoleWithWebIdentity last for one hour. However, you can use the optional -// DurationSeconds parameter to specify the duration of your session. You can -// provide a value from 900 seconds (15 minutes) up to the maximum session duration -// setting for the role. This setting can have a value from 1 hour to 12 hours. To -// learn how to view the maximum value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. -// The maximum session duration limit applies when you use the AssumeRole* API -// operations or the assume-role* CLI commands. However the limit does not apply -// when you use those operations to create a console URL. For more information, see -// [Using IAM Roles]in the IAM User Guide. -// -// # Permissions -// -// The temporary security credentials created by AssumeRoleWithWebIdentity can be -// used to make API calls to any Amazon Web Services service with the following -// exception: you cannot call the STS GetFederationToken or GetSessionToken API -// operations. -// -// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a -// single JSON policy document to use as an inline session policy. You can also -// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed -// session policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. Passing policies to this operation -// returns new temporary credentials. The resulting session's permissions are the -// intersection of the role's identity-based policy and the session policies. You -// can use the role's temporary credentials in subsequent Amazon Web Services API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// # Tags -// -// (Optional) You can configure your IdP to pass attributes into your web identity -// token as session tags. Each session tag consists of a key name and an associated -// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide. -// -// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed -// 128 characters and the values can’t exceed 256 characters. For these and -// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. -// -// An Amazon Web Services conversion compresses the passed inline session policy, -// managed policy ARNs, and session tags into a packed binary format that has a -// separate limit. Your request can fail for this limit even if your plaintext -// meets the other requirements. The PackedPolicySize response element indicates -// by percentage how close the policies and tags for your request are to the upper -// size limit. -// -// You can pass a session tag with the same key as a tag that is attached to the -// role. When you do, the session tag overrides the role tag with the same key. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # Identities -// -// Before your application can call AssumeRoleWithWebIdentity , you must have an -// identity token from a supported identity provider and create a role that the -// application can assume. The role that your application assumes must trust the -// identity provider that is associated with the identity token. In other words, -// the identity provider must be specified in the role's trust policy. -// -// Calling AssumeRoleWithWebIdentity can result in an entry in your CloudTrail -// logs. The entry includes the [Subject]of the provided web identity token. We recommend -// that you avoid using any personally identifiable information (PII) in this -// field. For example, you could instead use a GUID or a pairwise identifier, as [suggested in the OIDC specification]. -// -// For more information about how to use web identity federation and the +// Facebook, or any OpenID Connect-compatible identity provider such as Google or +// Amazon Cognito federated identities (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html) +// . For mobile applications, we recommend that you use Amazon Cognito. You can use +// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) +// and the Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) +// to uniquely identify a user. You can also supply the user with a consistent +// identity throughout the lifetime of an application. To learn more about Amazon +// Cognito, see Amazon Cognito identity pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html) +// in Amazon Cognito Developer Guide. Calling AssumeRoleWithWebIdentity does not +// require the use of Amazon Web Services security credentials. Therefore, you can +// distribute an application (for example, on mobile devices) that requests +// temporary security credentials without including long-term Amazon Web Services +// credentials in the application. You also don't need to deploy server-based proxy +// services that use long-term Amazon Web Services credentials. Instead, the +// identity of the caller is validated by using a token from the web identity +// provider. For a comparison of AssumeRoleWithWebIdentity with the other API +// operations that produce temporary credentials, see Requesting Temporary +// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. The temporary security credentials returned by this API +// consist of an access key ID, a secret access key, and a security token. +// Applications can use these temporary security credentials to sign calls to +// Amazon Web Services service API operations. Session Duration By default, the +// temporary security credentials created by AssumeRoleWithWebIdentity last for +// one hour. However, you can use the optional DurationSeconds parameter to +// specify the duration of your session. You can provide a value from 900 seconds +// (15 minutes) up to the maximum session duration setting for the role. This +// setting can have a value from 1 hour to 12 hours. To learn how to view the +// maximum value for your role, see View the Maximum Session Duration Setting for +// a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// in the IAM User Guide. The maximum session duration limit applies when you use +// the AssumeRole* API operations or the assume-role* CLI commands. However the +// limit does not apply when you use those operations to create a console URL. For +// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. Permissions The temporary security credentials created by +// AssumeRoleWithWebIdentity can be used to make API calls to any Amazon Web +// Services service with the following exception: you cannot call the STS +// GetFederationToken or GetSessionToken API operations. (Optional) You can pass +// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. Tags (Optional) You can configure your IdP to pass +// attributes into your web identity token as session tags. Each session tag +// consists of a key name and an associated value. For more information about +// session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session +// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. +// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. An Amazon Web Services conversion compresses the passed +// inline session policy, managed policy ARNs, and session tags into a packed +// binary format that has a separate limit. Your request can fail for this limit +// even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags for +// your request are to the upper size limit. You can pass a session tag with the +// same key as a tag that is attached to the role. When you do, the session tag +// overrides the role tag with the same key. An administrator must grant you the +// permissions necessary to pass session tags. The administrator can also create +// granular permissions to allow you to pass only specific session tags. For more +// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. You can set the session tags as transitive. Transitive +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. Identities Before your application can call +// AssumeRoleWithWebIdentity , you must have an identity token from a supported +// identity provider and create a role that the application can assume. The role +// that your application assumes must trust the identity provider that is +// associated with the identity token. In other words, the identity provider must +// be specified in the role's trust policy. Calling AssumeRoleWithWebIdentity can +// result in an entry in your CloudTrail logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) +// of the provided web identity token. We recommend that you avoid using any +// personally identifiable information (PII) in this field. For example, you could +// instead use a GUID or a pairwise identifier, as suggested in the OIDC +// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes) +// . For more information about how to use web identity federation and the // AssumeRoleWithWebIdentity API, see the following resources: -// -// [Using Web Identity Federation API Operations for Mobile Apps] -// - and [Federation Through a Web-based Identity Provider]. -// -// [Web Identity Federation Playground] -// - . Walk through the process of authenticating through Login with Amazon, +// - Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) +// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// . +// - Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/) +// . Walk through the process of authenticating through Login with Amazon, // Facebook, or Google, getting temporary security credentials, and then using // those credentials to make a request to Amazon Web Services. -// -// [Amazon Web Services SDK for iOS Developer Guide] -// - and [Amazon Web Services SDK for Android Developer Guide]. These toolkits contain sample apps that show how to invoke the -// identity providers. The toolkits then show how to use the information from these +// - Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) +// and Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) +// . These toolkits contain sample apps that show how to invoke the identity +// providers. The toolkits then show how to use the information from these // providers to get and use temporary security credentials. -// -// [Web Identity Federation with Mobile Applications] -// - . This article discusses web identity federation and shows an example of -// how to use web identity federation to get access to content in Amazon S3. -// -// [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/ -// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session -// [Web Identity Federation Playground]: https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/ -// [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/ -// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length -// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison -// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Subject]: http://openid.net/specs/openid-connect-core-1_0.html#Claims -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -// [Amazon Cognito identity pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html -// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity -// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining -// [Web Identity Federation with Mobile Applications]: http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications -// [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html -// [suggested in the OIDC specification]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes +// - Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications) +// . This article discusses web identity federation and shows an example of how to +// use web identity federation to get access to content in Amazon S3. func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) { if params == nil { params = &AssumeRoleWithWebIdentityInput{} @@ -177,11 +139,10 @@ type AssumeRoleWithWebIdentityInput struct { // identifier that is associated with the user who is using your application. That // way, the temporary security credentials that your application will use are // associated with that user. This session name is included as part of the ARN and - // assumed role ID in the AssumedRoleUser response element. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // assumed role ID in the AssumedRoleUser response element. The regex used to + // validate this parameter is a string of characters consisting of upper- and + // lower-case alphanumeric characters with no spaces. You can also include + // underscores or any of the following characters: =,.@- // // This member is required. RoleSessionName *string @@ -201,90 +162,73 @@ type AssumeRoleWithWebIdentityInput struct { // higher than this setting, the operation fails. For example, if you specify a // session duration of 12 hours, but your administrator set the maximum session // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration + // value for your role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. By default, the value is set to 3600 seconds. The + // DurationSeconds parameter is separate from the duration of a console session + // that you might request using the returned credentials. The request to the + // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // in the IAM User Guide. DurationSeconds *int32 // An IAM policy in JSON format that you want to use as an inline session policy. - // // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the // role's temporary credentials in subsequent Amazon Web Services API calls to // access resources in the account that owns the role. You cannot use session // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed + // session policies can't exceed 2,048 characters. The JSON policy characters can + // be any ASCII character from the space character to the end of the valid + // character list (\u0020 through \u00FF). It can also include the tab (\u0009), + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // the role. This parameter is optional. You can provide up to 10 managed policy + // ARNs. However, the plaintext that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, see + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType // The fully qualified host component of the domain name of the OAuth 2.0 identity // provider. Do not specify this value for an OpenID Connect identity provider. - // // Currently www.amazon.com and graph.facebook.com are the only supported identity // providers for OAuth 2.0 access tokens. Do not include URL schemes and port - // numbers. - // - // Do not specify this value for OpenID Connect ID tokens. + // numbers. Do not specify this value for OpenID Connect ID tokens. ProviderId *string noSmithyDocumentSerde } -// Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. +// Contains the response to a successful AssumeRoleWithWebIdentity request, +// including temporary Amazon Web Services credentials that can be used to make +// Amazon Web Services requests. type AssumeRoleWithWebIdentityOutput struct { // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers @@ -300,10 +244,9 @@ type AssumeRoleWithWebIdentityOutput struct { Audience *string // The temporary security credentials, which include an access key ID, a secret - // access key, and a security token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. + // access key, and a security token. The size of the security token that STS API + // operations return is not fixed. We strongly recommend that you make no + // assumptions about the maximum size. Credentials *types.Credentials // A percentage value that indicates the packed size of the session policies and @@ -312,34 +255,30 @@ type AssumeRoleWithWebIdentityOutput struct { // allowed space. PackedPolicySize *int32 - // The issuing authority of the web identity token presented. For OpenID Connect + // The issuing authority of the web identity token presented. For OpenID Connect // ID tokens, this contains the value of the iss field. For OAuth 2.0 access // tokens, this contains the value of the ProviderId parameter that was passed in // the AssumeRoleWithWebIdentity request. Provider *string // The value of the source identity that is returned in the JSON web token (JWT) - // from the identity provider. - // - // You can require users to set a source identity value when they assume a role. - // You do this by using the sts:SourceIdentity condition key in a role trust - // policy. That way, actions that are taken with the role are associated with that - // user. After the source identity is set, the value cannot be changed. It is - // present in the request for all actions that are taken by the role and persists - // across [chained role]sessions. You can configure your identity provider to use an attribute + // from the identity provider. You can require users to set a source identity value + // when they assume a role. You do this by using the sts:SourceIdentity condition + // key in a role trust policy. That way, actions that are taken with the role are + // associated with that user. After the source identity is set, the value cannot be + // changed. It is present in the request for all actions that are taken by the role + // and persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your identity provider to use an attribute // associated with your users, like user name or email, as the source identity when // calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON - // web token. To learn more about OIDC tokens and claims, see [Using Tokens with User Pools]in the Amazon - // Cognito Developer Guide. For more information about using source identity, see [Monitor and control actions taken with assumed roles] - // in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - // [Using Tokens with User Pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html + // web token. To learn more about OIDC tokens and claims, see Using Tokens with + // User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) + // in the Amazon Cognito Developer Guide. For more information about using source + // identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- SourceIdentity *string // The unique user identifier that is returned by the identity provider. This diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go index 186a8cb5838..b4ad54ab2fa 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go @@ -11,39 +11,28 @@ import ( ) // Decodes additional information about the authorization status of a request from -// an encoded message returned in response to an Amazon Web Services request. -// -// For example, if a user is not authorized to perform an operation that he or she -// has requested, the request returns a Client.UnauthorizedOperation response (an -// HTTP 403 response). Some Amazon Web Services operations additionally return an -// encoded message that can provide details about this authorization failure. -// -// Only certain Amazon Web Services operations return an encoded authorization -// message. The documentation for an individual operation indicates whether that -// operation returns an encoded message in addition to returning an HTTP code. -// -// The message is encoded because the details of the authorization status can -// contain privileged information that the user who requested the operation should -// not see. To decode an authorization status message, a user must be granted -// permissions through an IAM [policy]to request the DecodeAuthorizationMessage ( -// sts:DecodeAuthorizationMessage ) action. -// -// The decoded message includes the following type of information: -// +// an encoded message returned in response to an Amazon Web Services request. For +// example, if a user is not authorized to perform an operation that he or she has +// requested, the request returns a Client.UnauthorizedOperation response (an HTTP +// 403 response). Some Amazon Web Services operations additionally return an +// encoded message that can provide details about this authorization failure. Only +// certain Amazon Web Services operations return an encoded authorization message. +// The documentation for an individual operation indicates whether that operation +// returns an encoded message in addition to returning an HTTP code. The message is +// encoded because the details of the authorization status can contain privileged +// information that the user who requested the operation should not see. To decode +// an authorization status message, a user must be granted permissions through an +// IAM policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) +// to request the DecodeAuthorizationMessage ( sts:DecodeAuthorizationMessage ) +// action. The decoded message includes the following type of information: // - Whether the request was denied due to an explicit deny or due to the -// absence of an explicit allow. For more information, see [Determining Whether a Request is Allowed or Denied]in the IAM User -// Guide. -// +// absence of an explicit allow. For more information, see Determining Whether a +// Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) +// in the IAM User Guide. // - The principal who made the request. -// // - The requested action. -// // - The requested resource. -// // - The values of condition keys in the context of the user's request. -// -// [Determining Whether a Request is Allowed or Denied]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow -// [policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) { if params == nil { params = &DecodeAuthorizationMessageInput{} diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go index b6eb6401af0..1f7cbcc2bbb 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go @@ -10,31 +10,23 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the account identifier for the specified access key ID. -// -// Access keys consist of two parts: an access key ID (for example, -// AKIAIOSFODNN7EXAMPLE ) and a secret access key (for example, -// wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). For more information about access -// keys, see [Managing Access Keys for IAM Users]in the IAM User Guide. -// -// When you pass an access key ID to this operation, it returns the ID of the -// Amazon Web Services account to which the keys belong. Access key IDs beginning -// with AKIA are long-term credentials for an IAM user or the Amazon Web Services -// account root user. Access key IDs beginning with ASIA are temporary credentials -// that are created using STS operations. If the account in the response belongs to -// you, you can sign in as the root user and review your root user access keys. -// Then, you can pull a [credentials report]to learn which IAM user owns the keys. To learn who -// requested the temporary credentials for an ASIA access key, view the STS events -// in your [CloudTrail logs]in the IAM User Guide. -// -// This operation does not indicate the state of the access key. The key might be -// active, inactive, or deleted. Active keys might not have permissions to perform -// an operation. Providing a deleted access key might return an error that the key -// doesn't exist. -// -// [credentials report]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html -// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html -// [Managing Access Keys for IAM Users]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html +// Returns the account identifier for the specified access key ID. Access keys +// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE ) and +// a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). +// For more information about access keys, see Managing Access Keys for IAM Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) +// in the IAM User Guide. When you pass an access key ID to this operation, it +// returns the ID of the Amazon Web Services account to which the keys belong. +// Access key IDs beginning with AKIA are long-term credentials for an IAM user or +// the Amazon Web Services account root user. Access key IDs beginning with ASIA +// are temporary credentials that are created using STS operations. If the account +// in the response belongs to you, you can sign in as the root user and review your +// root user access keys. Then, you can pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) +// to learn which IAM user owns the keys. To learn who requested the temporary +// credentials for an ASIA access key, view the STS events in your CloudTrail logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) +// in the IAM User Guide. This operation does not indicate the state of the access +// key. The key might be active, inactive, or deleted. Active keys might not have +// permissions to perform an operation. Providing a deleted access key might return +// an error that the key doesn't exist. func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) { if params == nil { params = &GetAccessKeyInfoInput{} @@ -52,10 +44,9 @@ func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoI type GetAccessKeyInfoInput struct { - // The identifier of an access key. - // - // This parameter allows (through its regex pattern) a string of characters that - // can consist of any upper- or lowercase letter or digit. + // The identifier of an access key. This parameter allows (through its regex + // pattern) a string of characters that can consist of any upper- or lowercase + // letter or digit. // // This member is required. AccessKeyId *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go index ed4c82832a3..acb7ede44fd 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go @@ -12,15 +12,13 @@ import ( ) // Returns details about the IAM user or role whose credentials are used to call -// the operation. -// -// No permissions are required to perform this operation. If an administrator -// attaches a policy to your identity that explicitly denies access to the -// sts:GetCallerIdentity action, you can still perform this operation. Permissions -// are not required because the same information is returned when access is denied. -// To view an example response, see [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]in the IAM User Guide. -// -// [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa +// the operation. No permissions are required to perform this operation. If an +// administrator attaches a policy to your identity that explicitly denies access +// to the sts:GetCallerIdentity action, you can still perform this operation. +// Permissions are not required because the same information is returned when +// access is denied. To view an example response, see I Am Not Authorized to +// Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) +// in the IAM User Guide. func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) { if params == nil { params = &GetCallerIdentityInput{} @@ -40,8 +38,8 @@ type GetCallerIdentityInput struct { noSmithyDocumentSerde } -// Contains the response to a successful GetCallerIdentity request, including information about the -// entity making the request. +// Contains the response to a successful GetCallerIdentity request, including +// information about the entity making the request. type GetCallerIdentityOutput struct { // The Amazon Web Services account ID number of the account that owns or contains @@ -53,10 +51,8 @@ type GetCallerIdentityOutput struct { // The unique identifier of the calling entity. The exact value depends on the // type of entity that is making the call. The values returned are those listed in - // the aws:userid column in the [Principal table]found on the Policy Variables reference page in - // the IAM User Guide. - // - // [Principal table]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable + // the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + // found on the Policy Variables reference page in the IAM User Guide. UserId *string // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go index 37bde0cce6b..3679618cb5a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go @@ -14,100 +14,74 @@ import ( // Returns a set of temporary security credentials (consisting of an access key // ID, a secret access key, and a security token) for a user. A typical use is in a // proxy application that gets temporary security credentials on behalf of -// distributed applications inside a corporate network. -// -// You must call the GetFederationToken operation using the long-term security -// credentials of an IAM user. As a result, this call is appropriate in contexts -// where those credentials can be safeguarded, usually in a server-based -// application. For a comparison of GetFederationToken with the other API -// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide. -// -// Although it is possible to call GetFederationToken using the security -// credentials of an Amazon Web Services account root user rather than an IAM user -// that you create for the purpose of a proxy application, we do not recommend it. -// For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in the IAM User Guide. -// -// You can create a mobile-based or browser-based app that can authenticate users -// using a web identity provider like Login with Amazon, Facebook, Google, or an -// OpenID Connect-compatible identity provider. In this case, we recommend that you -// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User -// Guide. -// -// # Session duration -// -// The temporary credentials are valid for the specified duration, from 900 -// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default -// session duration is 43,200 seconds (12 hours). Temporary credentials obtained by -// using the root user credentials have a maximum duration of 3,600 seconds (1 -// hour). -// -// # Permissions -// -// You can use the temporary credentials created by GetFederationToken in any -// Amazon Web Services service with the following exceptions: -// +// distributed applications inside a corporate network. You must call the +// GetFederationToken operation using the long-term security credentials of an IAM +// user. As a result, this call is appropriate in contexts where those credentials +// can be safeguarded, usually in a server-based application. For a comparison of +// GetFederationToken with the other API operations that produce temporary +// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. Although it is possible to call GetFederationToken using +// the security credentials of an Amazon Web Services account root user rather than +// an IAM user that you create for the purpose of a proxy application, we do not +// recommend it. For more information, see Safeguard your root user credentials +// and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials) +// in the IAM User Guide. You can create a mobile-based or browser-based app that +// can authenticate users using a web identity provider like Login with Amazon, +// Facebook, Google, or an OpenID Connect-compatible identity provider. In this +// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/) +// or AssumeRoleWithWebIdentity . For more information, see Federation Through a +// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. Session duration The temporary credentials are valid for +// the specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600 +// seconds (36 hours). The default session duration is 43,200 seconds (12 hours). +// Temporary credentials obtained by using the root user credentials have a maximum +// duration of 3,600 seconds (1 hour). Permissions You can use the temporary +// credentials created by GetFederationToken in any Amazon Web Services service +// with the following exceptions: // - You cannot call any IAM operations using the CLI or the Amazon Web Services // API. This limitation does not apply to console sessions. -// // - You cannot call any STS operations except GetCallerIdentity . // -// You can use temporary credentials for single sign-on (SSO) to the console. -// -// You must pass an inline or managed [session policy] to this operation. You can pass a single -// JSON policy document to use as an inline session policy. You can also specify up -// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session -// policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. -// +// You can use temporary credentials for single sign-on (SSO) to the console. You +// must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. // Though the session policy parameters are optional, if you do not pass a policy, // then the resulting federated user session has no permissions. When you pass // session policies, the session permissions are the intersection of the IAM user // policies and the session policies that you pass. This gives you a way to further // restrict the permissions for a federated user. You cannot use session policies // to grant more permissions than those that are defined in the permissions policy -// of the IAM user. For more information, see [Session Policies]in the IAM User Guide. For -// information about using GetFederationToken to create temporary security -// credentials, see [GetFederationToken—Federation Through a Custom Identity Broker]. -// -// You can use the credentials to access a resource that has a resource-based +// of the IAM user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. For information about using GetFederationToken to create +// temporary security credentials, see GetFederationToken—Federation Through a +// Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken) +// . You can use the credentials to access a resource that has a resource-based // policy. If that policy specifically references the federated user session in the // Principal element of the policy, the session has the permissions allowed by the // policy. These permissions are granted in addition to the permissions granted by -// the session policies. -// -// # Tags -// -// (Optional) You can pass tag key-value pairs to your session. These are called -// session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM User -// Guide. -// -// You can create a mobile-based or browser-based app that can authenticate users -// using a web identity provider like Login with Amazon, Facebook, Google, or an -// OpenID Connect-compatible identity provider. In this case, we recommend that you -// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User -// Guide. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// Tag key–value pairs are not case sensitive, but case is preserved. This means -// that you cannot have separate Department and department tag keys. Assume that -// the user that you are federating has the Department = Marketing tag and you -// pass the department = engineering session tag. Department and department are -// not saved as separate tags, and the session tag passed in the request takes -// precedence over the user tag. -// -// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity -// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Amazon Cognito]: http://aws.amazon.com/cognito/ -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [GetFederationToken—Federation Through a Custom Identity Broker]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken -// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison -// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +// the session policies. Tags (Optional) You can pass tag key-value pairs to your +// session. These are called session tags. For more information about session tags, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can create a mobile-based or browser-based app that +// can authenticate users using a web identity provider like Login with Amazon, +// Facebook, Google, or an OpenID Connect-compatible identity provider. In this +// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/) +// or AssumeRoleWithWebIdentity . For more information, see Federation Through a +// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. An administrator must grant you the permissions necessary +// to pass session tags. The administrator can also create granular permissions to +// allow you to pass only specific session tags. For more information, see +// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. Tag key–value pairs are not case sensitive, but case is +// preserved. This means that you cannot have separate Department and department +// tag keys. Assume that the user that you are federating has the Department = +// Marketing tag and you pass the department = engineering session tag. Department +// and department are not saved as separate tags, and the session tag passed in +// the request takes precedence over the user tag. func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) { if params == nil { params = &GetFederationTokenInput{} @@ -128,11 +102,10 @@ type GetFederationTokenInput struct { // The name of the federated user. The name is used as an identifier for the // temporary security credentials (such as Bob ). For example, you can reference // the federated user name in a resource-based policy, such as in an Amazon S3 - // bucket policy. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // bucket policy. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- // // This member is required. Name *string @@ -146,127 +119,99 @@ type GetFederationTokenInput struct { DurationSeconds *int32 // An IAM policy in JSON format that you want to use as an inline session policy. - // - // You must pass an inline or managed [session policy] to this operation. You can pass a single - // JSON policy document to use as an inline session policy. You can also specify up - // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session - // policies. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection of - // the IAM user policies and the session policies that you pass. This gives you a - // way to further restrict the permissions for a federated user. You cannot use - // session policies to grant more permissions than those that are defined in the - // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User - // Guide. - // - // The resulting credentials can be used to access a resource that has a - // resource-based policy. If that policy specifically references the federated user - // session in the Principal element of the policy, the session has the permissions - // allowed by the policy. These permissions are granted in addition to the - // permissions that are granted by the session policies. - // + // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // to this operation. You can pass a single JSON policy document to use as an + // inline session policy. You can also specify up to 10 managed policy Amazon + // Resource Names (ARNs) to use as managed session policies. This parameter is + // optional. However, if you do not pass any session policies, then the resulting + // federated user session has no permissions. When you pass session policies, the + // session permissions are the intersection of the IAM user policies and the + // session policies that you pass. This gives you a way to further restrict the + // permissions for a federated user. You cannot use session policies to grant more + // permissions than those that are defined in the permissions policy of the IAM + // user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The resulting credentials can be used to access a + // resource that has a resource-based policy. If that policy specifically + // references the federated user session in the Principal element of the policy, + // the session has the permissions allowed by the policy. These permissions are + // granted in addition to the permissions that are granted by the session policies. // The plaintext that you use for both inline and managed session policies can't // exceed 2,048 characters. The JSON policy characters can be any ASCII character // from the space character to the end of the valid character list (\u0020 through // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // return (\u000D) characters. An Amazon Web Services conversion compresses the + // passed inline session policy, managed policy ARNs, and session tags into a + // packed binary format that has a separate limit. Your request can fail for this + // limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as a managed session policy. The policies must exist in the same account as - // the IAM user that is requesting federated access. - // - // You must pass an inline or managed [session policy] to this operation. You can pass a single - // JSON policy document to use as an inline session policy. You can also specify up - // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session - // policies. The plaintext that you use for both inline and managed session - // policies can't exceed 2,048 characters. You can provide up to 10 managed policy - // ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General - // Reference. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection of - // the IAM user policies and the session policies that you pass. This gives you a - // way to further restrict the permissions for a federated user. You cannot use - // session policies to grant more permissions than those that are defined in the - // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User - // Guide. - // - // The resulting credentials can be used to access a resource that has a - // resource-based policy. If that policy specifically references the federated user - // session in the Principal element of the policy, the session has the permissions - // allowed by the policy. These permissions are granted in addition to the - // permissions that are granted by the session policies. - // + // the IAM user that is requesting federated access. You must pass an inline or + // managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // to this operation. You can pass a single JSON policy document to use as an + // inline session policy. You can also specify up to 10 managed policy Amazon + // Resource Names (ARNs) to use as managed session policies. The plaintext that you + // use for both inline and managed session policies can't exceed 2,048 characters. + // You can provide up to 10 managed policy ARNs. For more information about ARNs, + // see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. This parameter is optional. + // However, if you do not pass any session policies, then the resulting federated + // user session has no permissions. When you pass session policies, the session + // permissions are the intersection of the IAM user policies and the session + // policies that you pass. This gives you a way to further restrict the permissions + // for a federated user. You cannot use session policies to grant more permissions + // than those that are defined in the permissions policy of the IAM user. For more + // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The resulting credentials can be used to access a + // resource that has a resource-based policy. If that policy specifically + // references the federated user session in the Principal element of the policy, + // the session has the permissions allowed by the policy. These permissions are + // granted in addition to the permissions that are granted by the session policies. // An Amazon Web Services conversion compresses the passed inline session policy, // managed policy ARNs, and session tags into a packed binary format that has a // separate limit. Your request can fail for this limit even if your plaintext // meets the other requirements. The PackedPolicySize response element indicates // by percentage how close the policies and tags for your request are to the upper // size limit. - // - // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html PolicyArns []types.PolicyDescriptorType // A list of session tags. Each session tag consists of a key name and an - // associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User - // Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plaintext - // session tag keys can’t exceed 128 characters and the values can’t exceed 256 - // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the user you are federating. When you do, session tags override a user tag - // with the same key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This means - // that you cannot have separate Department and department tag keys. Assume that - // the role has the Department = Marketing tag and you pass the department = - // engineering session tag. Department and department are not saved as separate - // tags, and the session tag passed in the request takes precedence over the role - // tag. - // - // [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // associated value. For more information about session tags, see Passing Session + // Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. This parameter is optional. You can pass up to 50 session + // tags. The plaintext session tag keys can’t exceed 128 characters and the values + // can’t exceed 256 characters. For these and additional limits, see IAM and STS + // Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. An Amazon Web Services conversion compresses the passed + // inline session policy, managed policy ARNs, and session tags into a packed + // binary format that has a separate limit. Your request can fail for this limit + // even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. You can pass a session tag with the + // same key as a tag that is already attached to the user you are federating. When + // you do, session tags override a user tag with the same key. Tag key–value pairs + // are not case sensitive, but case is preserved. This means that you cannot have + // separate Department and department tag keys. Assume that the role has the + // Department = Marketing tag and you pass the department = engineering session + // tag. Department and department are not saved as separate tags, and the session + // tag passed in the request takes precedence over the role tag. Tags []types.Tag noSmithyDocumentSerde } -// Contains the response to a successful GetFederationToken request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. +// Contains the response to a successful GetFederationToken request, including +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type GetFederationTokenOutput struct { // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. + // access key, and a security (or session) token. The size of the security token + // that STS API operations return is not fixed. We strongly recommend that you make + // no assumptions about the maximum size. Credentials *types.Credentials // Identifiers for the federated user associated with the credentials (such as diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go index 097ccd84480..751fb147d4b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go @@ -15,58 +15,43 @@ import ( // IAM user. The credentials consist of an access key ID, a secret access key, and // a security token. Typically, you use GetSessionToken if you want to use MFA to // protect programmatic calls to specific Amazon Web Services API operations like -// Amazon EC2 StopInstances . -// -// MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is -// associated with their MFA device. Using the temporary security credentials that -// the call returns, IAM users can then make programmatic calls to API operations -// that require MFA authentication. An incorrect MFA code causes the API to return -// an access denied error. For a comparison of GetSessionToken with the other API -// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Comparing the Amazon Web Services STS API operations] in the IAM User Guide. -// -// No permissions are required for users to perform this operation. The purpose of -// the sts:GetSessionToken operation is to authenticate the user using MFA. You -// cannot use policies to control authentication operations. For more information, -// see [Permissions for GetSessionToken]in the IAM User Guide. -// -// # Session Duration -// -// The GetSessionToken operation must be called by using the long-term Amazon Web -// Services security credentials of an IAM user. Credentials that are created by -// IAM users are valid for the duration that you specify. This duration can range -// from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), -// with a default of 43,200 seconds (12 hours). Credentials based on account -// credentials can range from 900 seconds (15 minutes) up to 3,600 seconds (1 -// hour), with a default of 1 hour. -// -// # Permissions -// -// The temporary security credentials created by GetSessionToken can be used to -// make API calls to any Amazon Web Services service with the following exceptions: -// +// Amazon EC2 StopInstances . MFA-enabled IAM users must call GetSessionToken and +// submit an MFA code that is associated with their MFA device. Using the temporary +// security credentials that the call returns, IAM users can then make programmatic +// calls to API operations that require MFA authentication. An incorrect MFA code +// causes the API to return an access denied error. For a comparison of +// GetSessionToken with the other API operations that produce temporary +// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. No permissions are required for users to perform this +// operation. The purpose of the sts:GetSessionToken operation is to authenticate +// the user using MFA. You cannot use policies to control authentication +// operations. For more information, see Permissions for GetSessionToken (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html) +// in the IAM User Guide. Session Duration The GetSessionToken operation must be +// called by using the long-term Amazon Web Services security credentials of an IAM +// user. Credentials that are created by IAM users are valid for the duration that +// you specify. This duration can range from 900 seconds (15 minutes) up to a +// maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds (12 +// hours). Credentials based on account credentials can range from 900 seconds (15 +// minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions The +// temporary security credentials created by GetSessionToken can be used to make +// API calls to any Amazon Web Services service with the following exceptions: // - You cannot call any IAM API operations unless MFA authentication // information is included in the request. -// // - You cannot call any STS API except AssumeRole or GetCallerIdentity . // // The credentials that GetSessionToken returns are based on permissions // associated with the IAM user whose credentials were used to call the operation. -// The temporary credentials have the same permissions as the IAM user. -// -// Although it is possible to call GetSessionToken using the security credentials -// of an Amazon Web Services account root user rather than an IAM user, we do not -// recommend it. If GetSessionToken is called using root user credentials, the -// temporary credentials have root user permissions. For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in -// the IAM User Guide -// -// For more information about using GetSessionToken to create temporary -// credentials, see [Temporary Credentials for Users in Untrusted Environments]in the IAM User Guide. -// -// [Permissions for GetSessionToken]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html -// [Comparing the Amazon Web Services STS API operations]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison -// [Temporary Credentials for Users in Untrusted Environments]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken -// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// The temporary credentials have the same permissions as the IAM user. Although it +// is possible to call GetSessionToken using the security credentials of an Amazon +// Web Services account root user rather than an IAM user, we do not recommend it. +// If GetSessionToken is called using root user credentials, the temporary +// credentials have root user permissions. For more information, see Safeguard +// your root user credentials and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials) +// in the IAM User Guide For more information about using GetSessionToken to +// create temporary credentials, see Temporary Credentials for Users in Untrusted +// Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) +// in the IAM User Guide. func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) { if params == nil { params = &GetSessionTokenInput{} @@ -98,11 +83,10 @@ type GetSessionTokenInput struct { // number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name // (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You // can find the device for an IAM user by going to the Amazon Web Services - // Management Console and viewing the user's security credentials. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@:/- + // Management Console and viewing the user's security credentials. The regex used + // to validate this parameter is a string of characters consisting of upper- and + // lower-case alphanumeric characters with no spaces. You can also include + // underscores or any of the following characters: =,.@:/- SerialNumber *string // The value provided by the MFA device, if MFA is required. If any policy @@ -110,24 +94,22 @@ type GetSessionTokenInput struct { // authentication is required, the user must provide a code when requesting a set // of temporary security credentials. A user who fails to provide the code receives // an "access denied" response when requesting resources that require MFA - // authentication. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. + // authentication. The format for this parameter, as described by its regex + // pattern, is a sequence of six numeric digits. TokenCode *string noSmithyDocumentSerde } -// Contains the response to a successful GetSessionToken request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. +// Contains the response to a successful GetSessionToken request, including +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type GetSessionTokenOutput struct { // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. + // access key, and a security (or session) token. The size of the security token + // that STS API operations return is not fixed. We strongly recommend that you make + // no assumptions about the maximum size. Credentials *types.Credentials // Metadata pertaining to the operation's result. diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go index 7e4346ec9fa..5d634ce35c8 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -20,17 +20,8 @@ import ( "io" "strconv" "strings" - "time" ) -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - type awsAwsquery_deserializeOpAssumeRole struct { } diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go index cbb19c7f668..d963fd8d19a 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go @@ -3,11 +3,9 @@ // Package sts provides the API client, operations, and parameter types for AWS // Security Token Service. // -// # Security Token Service -// -// Security Token Service (STS) enables you to request temporary, -// limited-privilege credentials for users. This guide provides descriptions of the -// STS API. For more information about using this service, see [Temporary Security Credentials]. -// -// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html +// Security Token Service Security Token Service (STS) enables you to request +// temporary, limited-privilege credentials for users. This guide provides +// descriptions of the STS API. For more information about using this service, see +// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) +// . package sts diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index f8c5b4e9162..8bba9b7dc15 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.28.10" +const goModuleVersion = "1.28.5" diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go index bb291161aa9..5c1be79f8c0 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go @@ -50,10 +50,8 @@ type Options struct { // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a // value for this field will likely prevent you from using any endpoint-related // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service operation. This should be @@ -72,20 +70,17 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable @@ -102,9 +97,8 @@ type Options struct { // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP @@ -149,7 +143,6 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { // Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for // this field will likely prevent you from using any endpoint-related service // features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// // To migrate an EndpointResolver implementation that uses a custom endpoint, set // the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go index 9573a4b6461..097875b279b 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go @@ -65,10 +65,9 @@ func (e *IDPCommunicationErrorException) ErrorCode() string { func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The identity provider (IdP) reported that authentication failed. This might be -// because the claim is invalid. -// -// If this error is returned for the AssumeRoleWithWebIdentity operation, it can -// also mean that the claim has expired or has been explicitly revoked. +// because the claim is invalid. If this error is returned for the +// AssumeRoleWithWebIdentity operation, it can also mean that the claim has expired +// or has been explicitly revoked. type IDPRejectedClaimException struct { Message *string @@ -184,13 +183,11 @@ func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { retu // compresses the session policy document, session policy ARNs, and session tags // into a packed binary format that has a separate limit. The error message // indicates by percentage how close the policies and tags are to the upper size -// limit. For more information, see [Passing Session Tags in STS]in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see [IAM and STS Entity Character Limits]in the IAM User Guide. -// -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [IAM and STS Entity Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length +// limit. For more information, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You could receive this error even though you meet other +// defined session policy and session tag limits. For more information, see IAM +// and STS Entity Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length) +// in the IAM User Guide. type PackedPolicyTooLargeException struct { Message *string @@ -218,10 +215,9 @@ func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see [Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region]in the IAM -// User Guide. -// -// [Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html +// console to activate STS in that region. For more information, see Activating +// and Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. type RegionDisabledException struct { Message *string diff --git a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go index dff7a3c2e76..e3701d11d15 100644 --- a/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go +++ b/upstream/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go @@ -11,11 +11,10 @@ import ( // returns. type AssumedRoleUser struct { - // The ARN of the temporary security credentials that are returned from the AssumeRole - // action. For more information about ARNs and how to use them in policies, see [IAM Identifiers]in - // the IAM User Guide. - // - // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html + // The ARN of the temporary security credentials that are returned from the + // AssumeRole action. For more information about ARNs and how to use them in + // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // This member is required. Arn *string @@ -62,9 +61,8 @@ type FederatedUser struct { // The ARN that specifies the federated user that is associated with the // credentials. For more information about ARNs and how to use them in policies, - // see [IAM Identifiers]in the IAM User Guide. - // - // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html + // see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // This member is required. Arn *string @@ -83,10 +81,9 @@ type FederatedUser struct { type PolicyDescriptorType struct { // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session - // policy for the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web - // Services General Reference. - // - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // policy for the role. For more information about ARNs, see Amazon Resource Names + // (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. Arn *string noSmithyDocumentSerde @@ -110,30 +107,23 @@ type ProvidedContext struct { // You can pass custom key-value pair attributes when you assume a role or // federate a user. These are called session tags. You can then use the session -// tags to control access to resources. For more information, see [Tagging Amazon Web Services STS Sessions]in the IAM User -// Guide. -// -// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// tags to control access to resources. For more information, see Tagging Amazon +// Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. type Tag struct { - // The key for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag keys can’t - // exceed 128 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User - // Guide. - // - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // The key for a session tag. You can pass up to 50 session tags. The plain text + // session tag keys can’t exceed 128 characters. For these and additional limits, + // see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. // // This member is required. Key *string - // The value for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag values can’t - // exceed 256 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User - // Guide. - // - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // The value for a session tag. You can pass up to 50 session tags. The plain text + // session tag values can’t exceed 256 characters. For these and additional limits, + // see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. // // This member is required. Value *string diff --git a/upstream/vendor/github.com/aws/smithy-go/CHANGELOG.md b/upstream/vendor/github.com/aws/smithy-go/CHANGELOG.md index 39ffae99938..b8d6561a4e1 100644 --- a/upstream/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/upstream/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,7 +1,3 @@ -# Release (2024-03-29) - -* No change notes available for this release. - # Release (2024-02-21) ## Module Highlights diff --git a/upstream/vendor/github.com/aws/smithy-go/go_module_metadata.go b/upstream/vendor/github.com/aws/smithy-go/go_module_metadata.go index a6b22f353d3..341392e10f8 100644 --- a/upstream/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/upstream/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.2" +const goModuleVersion = "1.20.1" diff --git a/upstream/vendor/github.com/cespare/xxhash/v2/README.md b/upstream/vendor/github.com/cespare/xxhash/v2/README.md index 33c88305c46..8bf0e5b7815 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/README.md +++ b/upstream/vendor/github.com/cespare/xxhash/v2/README.md @@ -70,5 +70,3 @@ 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/upstream/vendor/github.com/cespare/xxhash/v2/xxhash.go b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash.go index 78bddf1ceed..a9e0d45c9dc 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash.go +++ b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash.go @@ -19,13 +19,10 @@ 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 for the assembly code. +// contiguous array of 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 @@ -36,31 +33,19 @@ type Digest struct { n int // how much of mem is used } -// New creates a new Digest with a zero seed. +// New creates a new Digest that computes the 64-bit xxHash algorithm. func New() *Digest { - return NewWithSeed(0) -} - -// NewWithSeed creates a new Digest with the given seed. -func NewWithSeed(seed uint64) *Digest { var d Digest - d.ResetWithSeed(seed) + d.Reset() 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.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.v1 = primes[0] + prime2 + d.v2 = prime2 + d.v3 = 0 + d.v4 = -primes[0] d.total = 0 d.n = 0 } diff --git a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go index 78f95f25610..9216e0a40c1 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go +++ b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go @@ -6,7 +6,7 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b with a zero seed. +// Sum64 computes the 64-bit xxHash digest of b. // //go:noescape func Sum64(b []byte) uint64 diff --git a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_other.go b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_other.go index 118e49e819e..26df13bba4b 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_other.go +++ b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_other.go @@ -3,7 +3,7 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b with a zero seed. +// Sum64 computes the 64-bit xxHash digest of b. func Sum64(b []byte) uint64 { // A simpler version would be // d := New() diff --git a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go index 05f5e7dfe7b..e86f1b5fd8e 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go +++ b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go @@ -5,7 +5,7 @@ package xxhash -// Sum64String computes the 64-bit xxHash digest of s with a zero seed. +// Sum64String computes the 64-bit xxHash digest of s. func Sum64String(s string) uint64 { return Sum64([]byte(s)) } diff --git a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go b/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go index cf9d42aed53..1c1638fd88a 100644 --- a/upstream/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go +++ b/upstream/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 with a zero seed. +// Sum64String computes the 64-bit xxHash digest of s. // 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/upstream/vendor/github.com/containerd/containerd/errdefs/errors.go b/upstream/vendor/github.com/containerd/containerd/errdefs/errors.go new file mode 100644 index 00000000000..87622559708 --- /dev/null +++ b/upstream/vendor/github.com/containerd/containerd/errdefs/errors.go @@ -0,0 +1,92 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 errdefs defines the common errors used throughout containerd +// packages. +// +// Use with fmt.Errorf to add context to an error. +// +// To detect an error class, use the IsXXX functions to tell whether an error +// is of a certain type. +// +// The functions ToGRPC and FromGRPC can be used to map server-side and +// client-side errors to the correct types. +package errdefs + +import ( + "context" + "errors" +) + +// Definitions of common error types used throughout containerd. All containerd +// errors returned by most packages will map into one of these errors classes. +// Packages should return errors of these types when they want to instruct a +// client to take a particular action. +// +// For the most part, we just try to provide local grpc errors. Most conditions +// map very well to those defined by grpc. +var ( + ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping. + ErrInvalidArgument = errors.New("invalid argument") + ErrNotFound = errors.New("not found") + ErrAlreadyExists = errors.New("already exists") + ErrFailedPrecondition = errors.New("failed precondition") + ErrUnavailable = errors.New("unavailable") + ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented +) + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errors.Is(err, ErrInvalidArgument) +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errors.Is(err, ErrNotFound) +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errors.Is(err, ErrAlreadyExists) +} + +// IsFailedPrecondition returns true if an operation could not proceed to the +// lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errors.Is(err, ErrFailedPrecondition) +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errors.Is(err, ErrUnavailable) +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errors.Is(err, ErrNotImplemented) +} + +// IsCanceled returns true if the error is due to `context.Canceled`. +func IsCanceled(err error) bool { + return errors.Is(err, context.Canceled) +} + +// IsDeadlineExceeded returns true if the error is due to +// `context.DeadlineExceeded`. +func IsDeadlineExceeded(err error) bool { + return errors.Is(err, context.DeadlineExceeded) +} diff --git a/upstream/vendor/github.com/containerd/containerd/errdefs/grpc.go b/upstream/vendor/github.com/containerd/containerd/errdefs/grpc.go new file mode 100644 index 00000000000..7a9b33e05af --- /dev/null +++ b/upstream/vendor/github.com/containerd/containerd/errdefs/grpc.go @@ -0,0 +1,147 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 errdefs + +import ( + "context" + "fmt" + "strings" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// ToGRPC will attempt to map the backend containerd error into a grpc error, +// using the original error message as a description. +// +// Further information may be extracted from certain errors depending on their +// type. +// +// If the error is unmapped, the original error will be returned to be handled +// by the regular grpc error handling stack. +func ToGRPC(err error) error { + if err == nil { + return nil + } + + if isGRPCError(err) { + // error has already been mapped to grpc + return err + } + + switch { + case IsInvalidArgument(err): + return status.Errorf(codes.InvalidArgument, err.Error()) + case IsNotFound(err): + return status.Errorf(codes.NotFound, err.Error()) + case IsAlreadyExists(err): + return status.Errorf(codes.AlreadyExists, err.Error()) + case IsFailedPrecondition(err): + return status.Errorf(codes.FailedPrecondition, err.Error()) + case IsUnavailable(err): + return status.Errorf(codes.Unavailable, err.Error()) + case IsNotImplemented(err): + return status.Errorf(codes.Unimplemented, err.Error()) + case IsCanceled(err): + return status.Errorf(codes.Canceled, err.Error()) + case IsDeadlineExceeded(err): + return status.Errorf(codes.DeadlineExceeded, err.Error()) + } + + return err +} + +// ToGRPCf maps the error to grpc error codes, assembling the formatting string +// and combining it with the target error string. +// +// This is equivalent to errdefs.ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +func ToGRPCf(err error, format string, args ...interface{}) error { + return ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +} + +// FromGRPC returns the underlying error from a grpc service based on the grpc error code +func FromGRPC(err error) error { + if err == nil { + return nil + } + + var cls error // divide these into error classes, becomes the cause + + switch code(err) { + case codes.InvalidArgument: + cls = ErrInvalidArgument + case codes.AlreadyExists: + cls = ErrAlreadyExists + case codes.NotFound: + cls = ErrNotFound + case codes.Unavailable: + cls = ErrUnavailable + case codes.FailedPrecondition: + cls = ErrFailedPrecondition + case codes.Unimplemented: + cls = ErrNotImplemented + case codes.Canceled: + cls = context.Canceled + case codes.DeadlineExceeded: + cls = context.DeadlineExceeded + default: + cls = ErrUnknown + } + + msg := rebaseMessage(cls, err) + if msg != "" { + err = fmt.Errorf("%s: %w", msg, cls) + } else { + err = cls + } + + return err +} + +// rebaseMessage removes the repeats for an error at the end of an error +// string. This will happen when taking an error over grpc then remapping it. +// +// Effectively, we just remove the string of cls from the end of err if it +// appears there. +func rebaseMessage(cls error, err error) string { + desc := errDesc(err) + clss := cls.Error() + if desc == clss { + return "" + } + + return strings.TrimSuffix(desc, ": "+clss) +} + +func isGRPCError(err error) bool { + _, ok := status.FromError(err) + return ok +} + +func code(err error) codes.Code { + if s, ok := status.FromError(err); ok { + return s.Code() + } + return codes.Unknown +} + +func errDesc(err error) string { + if s, ok := status.FromError(err); ok { + return s.Message() + } + return err.Error() +} diff --git a/upstream/vendor/github.com/containerd/containerd/log/context_deprecated.go b/upstream/vendor/github.com/containerd/containerd/log/context_deprecated.go new file mode 100644 index 00000000000..9e9e8b49135 --- /dev/null +++ b/upstream/vendor/github.com/containerd/containerd/log/context_deprecated.go @@ -0,0 +1,149 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 log + +import ( + "context" + + "github.com/containerd/log" +) + +// G is a shorthand for [GetLogger]. +// +// Deprecated: use [log.G]. +var G = log.G + +// L is an alias for the standard logger. +// +// Deprecated: use [log.L]. +var L = log.L + +// Fields type to pass to "WithFields". +// +// Deprecated: use [log.Fields]. +type Fields = log.Fields + +// Entry is a logging entry. +// +// Deprecated: use [log.Entry]. +type Entry = log.Entry + +// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using +// zeros to ensure the formatted time is always the same number of +// characters. +// +// Deprecated: use [log.RFC3339NanoFixed]. +const RFC3339NanoFixed = log.RFC3339NanoFixed + +// Level is a logging level. +// +// Deprecated: use [log.Level]. +type Level = log.Level + +// Supported log levels. +const ( + // TraceLevel level. + // + // Deprecated: use [log.TraceLevel]. + TraceLevel Level = log.TraceLevel + + // DebugLevel level. + // + // Deprecated: use [log.DebugLevel]. + DebugLevel Level = log.DebugLevel + + // InfoLevel level. + // + // Deprecated: use [log.InfoLevel]. + InfoLevel Level = log.InfoLevel + + // WarnLevel level. + // + // Deprecated: use [log.WarnLevel]. + WarnLevel Level = log.WarnLevel + + // ErrorLevel level + // + // Deprecated: use [log.ErrorLevel]. + ErrorLevel Level = log.ErrorLevel + + // FatalLevel level. + // + // Deprecated: use [log.FatalLevel]. + FatalLevel Level = log.FatalLevel + + // PanicLevel level. + // + // Deprecated: use [log.PanicLevel]. + PanicLevel Level = log.PanicLevel +) + +// SetLevel sets log level globally. It returns an error if the given +// level is not supported. +// +// Deprecated: use [log.SetLevel]. +func SetLevel(level string) error { + return log.SetLevel(level) +} + +// GetLevel returns the current log level. +// +// Deprecated: use [log.GetLevel]. +func GetLevel() log.Level { + return log.GetLevel() +} + +// OutputFormat specifies a log output format. +// +// Deprecated: use [log.OutputFormat]. +type OutputFormat = log.OutputFormat + +// Supported log output formats. +const ( + // TextFormat represents the text logging format. + // + // Deprecated: use [log.TextFormat]. + TextFormat log.OutputFormat = "text" + + // JSONFormat represents the JSON logging format. + // + // Deprecated: use [log.JSONFormat]. + JSONFormat log.OutputFormat = "json" +) + +// SetFormat sets the log output format. +// +// Deprecated: use [log.SetFormat]. +func SetFormat(format OutputFormat) error { + return log.SetFormat(format) +} + +// WithLogger returns a new context with the provided logger. Use in +// combination with logger.WithField(s) for great effect. +// +// Deprecated: use [log.WithLogger]. +func WithLogger(ctx context.Context, logger *log.Entry) context.Context { + return log.WithLogger(ctx, logger) +} + +// GetLogger retrieves the current logger from the context. If no logger is +// available, the default logger is returned. +// +// Deprecated: use [log.GetLogger]. +func GetLogger(ctx context.Context) *log.Entry { + return log.GetLogger(ctx) +} diff --git a/upstream/vendor/github.com/containerd/platforms/compare.go b/upstream/vendor/github.com/containerd/containerd/platforms/compare.go similarity index 100% rename from upstream/vendor/github.com/containerd/platforms/compare.go rename to upstream/vendor/github.com/containerd/containerd/platforms/compare.go diff --git a/upstream/vendor/github.com/containerd/platforms/cpuinfo.go b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo.go similarity index 96% rename from upstream/vendor/github.com/containerd/platforms/cpuinfo.go rename to upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo.go index 91f50e8c88a..8c600fc96b1 100644 --- a/upstream/vendor/github.com/containerd/platforms/cpuinfo.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo.go @@ -20,7 +20,7 @@ import ( "runtime" "sync" - "github.com/containerd/log" + "github.com/containerd/containerd/log" ) // Present the ARM instruction set architecture, eg: v7, v8 diff --git a/upstream/vendor/github.com/containerd/platforms/cpuinfo_linux.go b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go similarity index 94% rename from upstream/vendor/github.com/containerd/platforms/cpuinfo_linux.go rename to upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go index 98c7001f939..722d86c3578 100644 --- a/upstream/vendor/github.com/containerd/platforms/cpuinfo_linux.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go @@ -19,12 +19,12 @@ package platforms import ( "bufio" "bytes" - "errors" "fmt" "os" "runtime" "strings" + "github.com/containerd/containerd/errdefs" "golang.org/x/sys/unix" ) @@ -70,7 +70,7 @@ func getCPUInfo(pattern string) (info string, err error) { return "", err } - return "", fmt.Errorf("getCPUInfo for pattern %s: %w", pattern, errNotFound) + return "", fmt.Errorf("getCPUInfo for pattern %s: %w", pattern, errdefs.ErrNotFound) } // getCPUVariantFromArch get CPU variant from arch through a system call @@ -83,7 +83,7 @@ func getCPUVariantFromArch(arch string) (string, error) { if arch == "aarch64" { variant = "8" } else if arch[0:4] == "armv" && len(arch) >= 5 { - // Valid arch format is in form of armvXx + //Valid arch format is in form of armvXx switch arch[3:5] { case "v8": variant = "8" @@ -101,7 +101,7 @@ func getCPUVariantFromArch(arch string) (string, error) { variant = "unknown" } } else { - return "", fmt.Errorf("getCPUVariantFromArch invalid arch: %s, %w", arch, errInvalidArgument) + return "", fmt.Errorf("getCPUVariantFromArch invalid arch: %s, %w", arch, errdefs.ErrInvalidArgument) } return variant, nil } @@ -112,10 +112,11 @@ func getCPUVariantFromArch(arch string) (string, error) { // This is to cover running ARM in emulated environment on x86 host as this field in /proc/cpuinfo // was not present. func getCPUVariant() (string, error) { + variant, err := getCPUInfo("Cpu architecture") if err != nil { - if errors.Is(err, errNotFound) { - // Let's try getting CPU variant from machine architecture + if errdefs.IsNotFound(err) { + //Let's try getting CPU variant from machine architecture arch, err := getMachineArch() if err != nil { return "", fmt.Errorf("failure getting machine architecture: %v", err) diff --git a/upstream/vendor/github.com/containerd/platforms/cpuinfo_other.go b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go similarity index 94% rename from upstream/vendor/github.com/containerd/platforms/cpuinfo_other.go rename to upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go index 97a1fe8a3e5..fa5f19c427a 100644 --- a/upstream/vendor/github.com/containerd/platforms/cpuinfo_other.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go @@ -21,6 +21,8 @@ package platforms import ( "fmt" "runtime" + + "github.com/containerd/containerd/errdefs" ) func getCPUVariant() (string, error) { @@ -47,8 +49,10 @@ func getCPUVariant() (string, error) { default: variant = "unknown" } + } else { - return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented) + return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errdefs.ErrNotImplemented) + } return variant, nil diff --git a/upstream/vendor/github.com/containerd/platforms/database.go b/upstream/vendor/github.com/containerd/containerd/platforms/database.go similarity index 100% rename from upstream/vendor/github.com/containerd/platforms/database.go rename to upstream/vendor/github.com/containerd/containerd/platforms/database.go diff --git a/upstream/vendor/github.com/containerd/platforms/defaults.go b/upstream/vendor/github.com/containerd/containerd/platforms/defaults.go similarity index 81% rename from upstream/vendor/github.com/containerd/platforms/defaults.go rename to upstream/vendor/github.com/containerd/containerd/platforms/defaults.go index 9d898d60e62..cfa3ff34a19 100644 --- a/upstream/vendor/github.com/containerd/platforms/defaults.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/defaults.go @@ -16,11 +16,9 @@ package platforms -// DefaultString returns the default string specifier for the platform, -// with [PR#6](https://github.com/containerd/platforms/pull/6) the result -// may now also include the OSVersion from the provided platform specification. +// DefaultString returns the default string specifier for the platform. func DefaultString() string { - return FormatAll(DefaultSpec()) + return Format(DefaultSpec()) } // DefaultStrict returns strict form of Default. diff --git a/upstream/vendor/github.com/containerd/platforms/defaults_darwin.go b/upstream/vendor/github.com/containerd/containerd/platforms/defaults_darwin.go similarity index 100% rename from upstream/vendor/github.com/containerd/platforms/defaults_darwin.go rename to upstream/vendor/github.com/containerd/containerd/platforms/defaults_darwin.go diff --git a/upstream/vendor/github.com/containerd/platforms/defaults_freebsd.go b/upstream/vendor/github.com/containerd/containerd/platforms/defaults_freebsd.go similarity index 100% rename from upstream/vendor/github.com/containerd/platforms/defaults_freebsd.go rename to upstream/vendor/github.com/containerd/containerd/platforms/defaults_freebsd.go diff --git a/upstream/vendor/github.com/containerd/platforms/defaults_unix.go b/upstream/vendor/github.com/containerd/containerd/platforms/defaults_unix.go similarity index 100% rename from upstream/vendor/github.com/containerd/platforms/defaults_unix.go rename to upstream/vendor/github.com/containerd/containerd/platforms/defaults_unix.go diff --git a/upstream/vendor/github.com/containerd/platforms/defaults_windows.go b/upstream/vendor/github.com/containerd/containerd/platforms/defaults_windows.go similarity index 88% rename from upstream/vendor/github.com/containerd/platforms/defaults_windows.go rename to upstream/vendor/github.com/containerd/containerd/platforms/defaults_windows.go index 427ed72eb61..d10fa9012bd 100644 --- a/upstream/vendor/github.com/containerd/platforms/defaults_windows.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/defaults_windows.go @@ -22,6 +22,7 @@ import ( "strconv" "strings" + "github.com/Microsoft/hcsshim/osversion" specs "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sys/windows" ) @@ -51,29 +52,29 @@ func (m windowsmatcher) Match(p specs.Platform) bool { if match && m.OS == "windows" { // HPC containers do not have OS version filled - if m.OSVersion == "" || p.OSVersion == "" { + if p.OSVersion == "" { return true } - hostOsVersion := getOSVersion(m.osVersionPrefix) - ctrOsVersion := getOSVersion(p.OSVersion) - return checkHostAndContainerCompat(hostOsVersion, ctrOsVersion) + hostOsVersion := GetOsVersion(m.osVersionPrefix) + ctrOsVersion := GetOsVersion(p.OSVersion) + return osversion.CheckHostAndContainerCompat(hostOsVersion, ctrOsVersion) } return match } -func getOSVersion(osVersionPrefix string) osVersion { +func GetOsVersion(osVersionPrefix string) osversion.OSVersion { parts := strings.Split(osVersionPrefix, ".") if len(parts) < 3 { - return osVersion{} + return osversion.OSVersion{} } majorVersion, _ := strconv.Atoi(parts[0]) minorVersion, _ := strconv.Atoi(parts[1]) buildNumber, _ := strconv.Atoi(parts[2]) - return osVersion{ + return osversion.OSVersion{ MajorVersion: uint8(majorVersion), MinorVersion: uint8(minorVersion), Build: uint16(buildNumber), diff --git a/upstream/vendor/github.com/containerd/platforms/platforms.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms.go similarity index 74% rename from upstream/vendor/github.com/containerd/platforms/platforms.go rename to upstream/vendor/github.com/containerd/containerd/platforms/platforms.go index 1bbbdb91dbc..56613b07656 100644 --- a/upstream/vendor/github.com/containerd/platforms/platforms.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/platforms.go @@ -102,9 +102,6 @@ // unless it is explicitly provided. This is treated as equivalent to armhf. A // previous architecture, armel, will be normalized to arm/v6. // -// Similarly, the most common arm64 version v8, and most common amd64 version v1 -// are represented without the variant. -// // While these normalizations are provided, their support on arm platforms has // not yet been fully implemented and tested. package platforms @@ -118,15 +115,14 @@ import ( "strings" specs "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/errdefs" ) var ( - specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) - osAndVersionRe = regexp.MustCompile(`^([A-Za-z0-9_-]+)(?:\(([A-Za-z0-9_.-]*)\))?$`) + specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) ) -const osAndVersionFormat = "%s(%s)" - // Platform is a type alias for convenience, so there is no need to import image-spec package everywhere. type Platform = specs.Platform @@ -159,68 +155,40 @@ func (m *matcher) Match(platform specs.Platform) bool { } func (m *matcher) String() string { - return FormatAll(m.Platform) -} - -// ParseAll parses a list of platform specifiers into a list of platform. -func ParseAll(specifiers []string) ([]specs.Platform, error) { - platforms := make([]specs.Platform, len(specifiers)) - for i, s := range specifiers { - p, err := Parse(s) - if err != nil { - return nil, fmt.Errorf("invalid platform %s: %w", s, err) - } - platforms[i] = p - } - return platforms, nil + return Format(m.Platform) } // Parse parses the platform specifier syntax into a platform declaration. // -// Platform specifiers are in the format `[()]||[()]/[/]`. +// Platform specifiers are in the format `||/[/]`. // The minimum required information for a platform specifier is the operating -// system or architecture. The OSVersion can be part of the OS like `windows(10.0.17763)` -// When an OSVersion is specified, then specs.Platform.OSVersion is populated with that value, -// and an empty string otherwise. -// If there is only a single string (no slashes), the +// system or architecture. If there is only a single string (no slashes), the // value will be matched against the known set of operating systems, then fall // back to the known set of architectures. The missing component will be // inferred based on the local environment. func Parse(specifier string) (specs.Platform, error) { if strings.Contains(specifier, "*") { // TODO(stevvooe): need to work out exact wildcard handling - return specs.Platform{}, fmt.Errorf("%q: wildcards not yet supported: %w", specifier, errInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: wildcards not yet supported: %w", specifier, errdefs.ErrInvalidArgument) } - // Limit to 4 elements to prevent unbounded split - parts := strings.SplitN(specifier, "/", 4) + parts := strings.Split(specifier, "/") - var p specs.Platform - for i, part := range parts { - if i == 0 { - // First element is [()] - osVer := osAndVersionRe.FindStringSubmatch(part) - if osVer == nil { - return specs.Platform{}, fmt.Errorf("%q is an invalid OS component of %q: OSAndVersion specifier component must match %q: %w", part, specifier, osAndVersionRe.String(), errInvalidArgument) - } - - p.OS = normalizeOS(osVer[1]) - p.OSVersion = osVer[2] - } else { - if !specifierRe.MatchString(part) { - return specs.Platform{}, fmt.Errorf("%q is an invalid component of %q: platform specifier component must match %q: %w", part, specifier, specifierRe.String(), errInvalidArgument) - } + for _, part := range parts { + if !specifierRe.MatchString(part) { + return specs.Platform{}, fmt.Errorf("%q is an invalid component of %q: platform specifier component must match %q: %w", part, specifier, specifierRe.String(), errdefs.ErrInvalidArgument) } } + var p specs.Platform switch len(parts) { case 1: - // in this case, we will test that the value might be an OS (with or - // without the optional OSVersion specified) and look it up. - // If it is not known, we'll treat it as an architecture. Since + // in this case, we will test that the value might be an OS, then look + // it up. If it is not known, we'll treat it as an architecture. Since // we have very little information about the platform here, we are // going to be a little more strict if we don't know about the argument // value. + p.OS = normalizeOS(parts[0]) if isKnownOS(p.OS) { // picks a default architecture p.Architecture = runtime.GOARCH @@ -228,6 +196,10 @@ func Parse(specifier string) (specs.Platform, error) { p.Variant = cpuVariant() } + if p.OS == "windows" { + p.OSVersion = GetWindowsOsVersion() + } + return p, nil } @@ -240,27 +212,37 @@ func Parse(specifier string) (specs.Platform, error) { return p, nil } - return specs.Platform{}, fmt.Errorf("%q: unknown operating system or architecture: %w", specifier, errInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: unknown operating system or architecture: %w", specifier, errdefs.ErrInvalidArgument) case 2: - // In this case, we treat as a regular OS[(OSVersion)]/arch pair. We don't care + // In this case, we treat as a regular os/arch pair. We don't care // about whether or not we know of the platform. + p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], "") if p.Architecture == "arm" && p.Variant == "v7" { p.Variant = "" } + if p.OS == "windows" { + p.OSVersion = GetWindowsOsVersion() + } + return p, nil case 3: // we have a fully specified variant, this is rare + p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], parts[2]) if p.Architecture == "arm64" && p.Variant == "" { p.Variant = "v8" } + if p.OS == "windows" { + p.OSVersion = GetWindowsOsVersion() + } + return p, nil } - return specs.Platform{}, fmt.Errorf("%q: cannot parse platform specifier: %w", specifier, errInvalidArgument) + return specs.Platform{}, fmt.Errorf("%q: cannot parse platform specifier: %w", specifier, errdefs.ErrInvalidArgument) } // MustParse is like Parses but panics if the specifier cannot be parsed. @@ -282,20 +264,6 @@ func Format(platform specs.Platform) string { return path.Join(platform.OS, platform.Architecture, platform.Variant) } -// FormatAll returns a string specifier that also includes the OSVersion from the -// provided platform specification. -func FormatAll(platform specs.Platform) string { - if platform.OS == "" { - return "unknown" - } - - if platform.OSVersion != "" { - OSAndVersion := fmt.Sprintf(osAndVersionFormat, platform.OS, platform.OSVersion) - return path.Join(OSAndVersion, platform.Architecture, platform.Variant) - } - return path.Join(platform.OS, platform.Architecture, platform.Variant) -} - // Normalize validates and translate the platform to the canonical value. // // For example, if "Aarch64" is encountered, we change it to "arm64" or if diff --git a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated.go deleted file mode 100644 index b057304cffc..00000000000 --- a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 platforms - -import ( - "github.com/containerd/platforms" - specs "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Platform is a type alias for convenience, so there is no need to import image-spec package everywhere. -// -// Deprecated: use [specs.Platform]. -type Platform = specs.Platform - -// DefaultSpec returns the current platform's default platform specification. -// -// Deprecated: use [platforms.DefaultSpec]. -func DefaultSpec() specs.Platform { - return platforms.DefaultSpec() -} - -// Default returns the default matcher for the platform. -// -// Deprecated: use [platforms.Default]. -func Default() platforms.MatchComparer { - return platforms.Default() -} - -// DefaultString returns the default string specifier for the platform. -// -// Deprecated: use [platforms.DefaultString]. -func DefaultString() string { - return platforms.Format(platforms.DefaultSpec()) // For 1.7 continue using the old format without os-version included. -} - -// DefaultStrict returns strict form of Default. -// -// Deprecated: use [platforms.DefaultStrict]. -func DefaultStrict() MatchComparer { - return platforms.DefaultStrict() -} - -// MatchComparer is able to match and compare platforms to -// filter and sort platforms. -// -// Deprecated: use [platforms.MatchComparer]. -type MatchComparer = platforms.MatchComparer - -// Matcher matches platforms specifications, provided by an image or runtime. -// -// Deprecated: use [platforms.Matcher]. -type Matcher = platforms.Matcher - -// NewMatcher returns a simple matcher based on the provided platform -// specification. The returned matcher only looks for equality based on os, -// architecture and variant. -// -// One may implement their own matcher if this doesn't provide the required -// functionality. -// -// Applications should opt to use `Match` over directly parsing specifiers. -// -// Deprecated: use [platforms.NewMatcher]. -func NewMatcher(platform specs.Platform) platforms.Matcher { - return platforms.NewMatcher(platform) -} - -// Parse parses the platform specifier syntax into a platform declaration. -// -// Platform specifiers are in the format `||/[/]`. -// The minimum required information for a platform specifier is the operating -// system or architecture. If there is only a single string (no slashes), the -// value will be matched against the known set of operating systems, then fall -// back to the known set of architectures. The missing component will be -// inferred based on the local environment. -// -// Deprecated: use [platforms.Parse]. -func Parse(specifier string) (specs.Platform, error) { - return platforms.Parse(specifier) -} - -// MustParse is like Parses but panics if the specifier cannot be parsed. -// Simplifies initialization of global variables. -// -// Deprecated: use [platforms.MustParse]. -func MustParse(specifier string) specs.Platform { - return platforms.MustParse(specifier) -} - -// Format returns a string specifier from the provided platform specification. -// -// Deprecated: use [platforms.Format]. -func Format(platform specs.Platform) string { - return platforms.Format(platform) -} - -// Normalize validates and translate the platform to the canonical value. -// -// For example, if "Aarch64" is encountered, we change it to "arm64" or if -// "x86_64" is encountered, it becomes "amd64". -// -// Deprecated: use [platforms.Normalize]. -func Normalize(platform specs.Platform) specs.Platform { - return platforms.Normalize(platform) -} - -// Only returns a match comparer for a single platform -// using default resolution logic for the platform. -// -// For arm/v8, will also match arm/v7, arm/v6 and arm/v5 -// For arm/v7, will also match arm/v6 and arm/v5 -// For arm/v6, will also match arm/v5 -// For amd64, will also match 386 -// -// Deprecated: use [platforms.Only]. -func Only(platform specs.Platform) platforms.MatchComparer { - return platforms.Only(platform) -} - -// OnlyStrict returns a match comparer for a single platform. -// -// Unlike Only, OnlyStrict does not match sub platforms. -// So, "arm/vN" will not match "arm/vM" where M < N, -// and "amd64" will not also match "386". -// -// OnlyStrict matches non-canonical forms. -// So, "arm64" matches "arm/64/v8". -// -// Deprecated: use [platforms.OnlyStrict]. -func OnlyStrict(platform specs.Platform) platforms.MatchComparer { - return platforms.OnlyStrict(platform) -} - -// Ordered returns a platform MatchComparer which matches any of the platforms -// but orders them in order they are provided. -// -// Deprecated: use [platforms.Ordered]. -func Ordered(platform ...specs.Platform) platforms.MatchComparer { - return platforms.Ordered(platform...) -} - -// Any returns a platform MatchComparer which matches any of the platforms -// with no preference for ordering. -// -// Deprecated: use [platforms.Any]. -func Any(platform ...specs.Platform) platforms.MatchComparer { - return platforms.Any(platform...) -} - -// All is a platform MatchComparer which matches all platforms -// with preference for ordering. -// -// Deprecated: use [platforms.All]. -var All = platforms.All - -// GetWindowsOsVersion returns the version of Windows of the local system, -// it returns an empty string on other platforms. -// -// Deprecated: this function is deprecated, and removed in github.com/containerd/platforms -func GetWindowsOsVersion() string { - return getWindowsOsVersion() -} diff --git a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_other.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_other.go deleted file mode 100644 index 0d17529ecdc..00000000000 --- a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_other.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 platforms - -func getWindowsOsVersion() string { - return "" -} diff --git a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_windows.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_windows.go deleted file mode 100644 index dc0fdbf12bf..00000000000 --- a/upstream/vendor/github.com/containerd/containerd/platforms/platforms_deprecated_windows.go +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 platforms - -import ( - "fmt" - "strconv" - "strings" - - "github.com/Microsoft/hcsshim/osversion" - "golang.org/x/sys/windows" -) - -func getWindowsOsVersion() string { - major, minor, build := windows.RtlGetNtVersionNumbers() - return fmt.Sprintf("%d.%d.%d", major, minor, build) -} - -// Deprecated: this function is deprecated, and removed in github.com/containerd/platforms -func GetOsVersion(osVersionPrefix string) osversion.OSVersion { - parts := strings.Split(osVersionPrefix, ".") - if len(parts) < 3 { - return osversion.OSVersion{} - } - - majorVersion, _ := strconv.Atoi(parts[0]) - minorVersion, _ := strconv.Atoi(parts[1]) - buildNumber, _ := strconv.Atoi(parts[2]) - - return osversion.OSVersion{ - MajorVersion: uint8(majorVersion), - MinorVersion: uint8(minorVersion), - Build: uint16(buildNumber), - } -} diff --git a/upstream/vendor/github.com/containerd/platforms/platforms_other.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_other.go similarity index 94% rename from upstream/vendor/github.com/containerd/platforms/platforms_other.go rename to upstream/vendor/github.com/containerd/containerd/platforms/platforms_other.go index 03f4dcd9981..59beeb3d1d9 100644 --- a/upstream/vendor/github.com/containerd/platforms/platforms_other.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_other.go @@ -28,3 +28,7 @@ func newDefaultMatcher(platform specs.Platform) Matcher { Platform: Normalize(platform), } } + +func GetWindowsOsVersion() string { + return "" +} diff --git a/upstream/vendor/github.com/containerd/platforms/platforms_windows.go b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_windows.go similarity index 85% rename from upstream/vendor/github.com/containerd/platforms/platforms_windows.go rename to upstream/vendor/github.com/containerd/containerd/platforms/platforms_windows.go index 950e2a2ddbb..733d18ddead 100644 --- a/upstream/vendor/github.com/containerd/platforms/platforms_windows.go +++ b/upstream/vendor/github.com/containerd/containerd/platforms/platforms_windows.go @@ -17,7 +17,10 @@ package platforms import ( + "fmt" + specs "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sys/windows" ) // NewMatcher returns a Windows matcher that will match on osVersionPrefix if @@ -32,3 +35,8 @@ func newDefaultMatcher(platform specs.Platform) Matcher { }, } } + +func GetWindowsOsVersion() string { + major, minor, build := windows.RtlGetNtVersionNumbers() + return fmt.Sprintf("%d.%d.%d", major, minor, build) +} diff --git a/upstream/vendor/github.com/containerd/platforms/.gitattributes b/upstream/vendor/github.com/containerd/platforms/.gitattributes deleted file mode 100644 index a0717e4b3b9..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf \ No newline at end of file diff --git a/upstream/vendor/github.com/containerd/platforms/.golangci.yml b/upstream/vendor/github.com/containerd/platforms/.golangci.yml deleted file mode 100644 index a695775df49..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/.golangci.yml +++ /dev/null @@ -1,30 +0,0 @@ -linters: - enable: - - exportloopref # Checks for pointers to enclosing loop variables - - gofmt - - goimports - - gosec - - ineffassign - - misspell - - nolintlint - - revive - - staticcheck - - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 - - unconvert - - unused - - vet - - dupword # Checks for duplicate words in the source code - disable: - - errcheck - -run: - timeout: 5m - skip-dirs: - - api - - cluster - - design - - docs - - docs/man - - releases - - reports - - test # e2e scripts diff --git a/upstream/vendor/github.com/containerd/platforms/LICENSE b/upstream/vendor/github.com/containerd/platforms/LICENSE deleted file mode 100644 index 584149b6ee2..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/upstream/vendor/github.com/containerd/platforms/README.md b/upstream/vendor/github.com/containerd/platforms/README.md deleted file mode 100644 index 2059de771c5..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# platforms - -A Go package for formatting, normalizing and matching container platforms. - -This package is based on the Open Containers Image Spec definition of a [platform](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go#L52). - -## Platform Specifier - -While the OCI platform specifications provide a tool for components to -specify structured information, user input typically doesn't need the full -context and much can be inferred. To solve this problem, this package introduces -"specifiers". A specifier has the format -`||/[/]`. The user can provide either the -operating system or the architecture or both. - -An example of a common specifier is `linux/amd64`. If the host has a default -runtime that matches this, the user can simply provide the component that -matters. For example, if an image provides `amd64` and `arm64` support, the -operating system, `linux` can be inferred, so they only have to provide -`arm64` or `amd64`. Similar behavior is implemented for operating systems, -where the architecture may be known but a runtime may support images from -different operating systems. - -## Project details - -**platforms** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). -As a containerd sub-project, you will find the: - * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), - * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) - -information in our [`containerd/project`](https://github.com/containerd/project) repository. \ No newline at end of file diff --git a/upstream/vendor/github.com/containerd/platforms/errors.go b/upstream/vendor/github.com/containerd/platforms/errors.go deleted file mode 100644 index 5ad721e779e..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/errors.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 platforms - -import "errors" - -// These errors mirror the errors defined in [github.com/containerd/containerd/errdefs], -// however, they are not exported as they are not expected to be used as sentinel -// errors by consumers of this package. -// -//nolint:unused // not all errors are used on all platforms. -var ( - errNotFound = errors.New("not found") - errInvalidArgument = errors.New("invalid argument") - errNotImplemented = errors.New("not implemented") -) diff --git a/upstream/vendor/github.com/containerd/platforms/platform_compat_windows.go b/upstream/vendor/github.com/containerd/platforms/platform_compat_windows.go deleted file mode 100644 index 89e66f0c090..00000000000 --- a/upstream/vendor/github.com/containerd/platforms/platform_compat_windows.go +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 platforms - -// osVersion is a wrapper for Windows version information -// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx -type osVersion struct { - Version uint32 - MajorVersion uint8 - MinorVersion uint8 - Build uint16 -} - -// Windows Client and Server build numbers. -// -// See: -// https://learn.microsoft.com/en-us/windows/release-health/release-information -// https://learn.microsoft.com/en-us/windows/release-health/windows-server-release-info -// https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information -const ( - // rs5 (version 1809, codename "Redstone 5") corresponds to Windows Server - // 2019 (ltsc2019), and Windows 10 (October 2018 Update). - rs5 = 17763 - - // v21H2Server corresponds to Windows Server 2022 (ltsc2022). - v21H2Server = 20348 - - // v22H2Win11 corresponds to Windows 11 (2022 Update). - v22H2Win11 = 22621 -) - -// List of stable ABI compliant ltsc releases -// Note: List must be sorted in ascending order -var compatLTSCReleases = []uint16{ - v21H2Server, -} - -// CheckHostAndContainerCompat checks if given host and container -// OS versions are compatible. -// It includes support for stable ABI compliant versions as well. -// Every release after WS 2022 will support the previous ltsc -// container image. Stable ABI is in preview mode for windows 11 client. -// Refer: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2022%2Cwindows-10#windows-server-host-os-compatibility -func checkHostAndContainerCompat(host, ctr osVersion) bool { - // check major minor versions of host and guest - if host.MajorVersion != ctr.MajorVersion || - host.MinorVersion != ctr.MinorVersion { - return false - } - - // If host is < WS 2022, exact version match is required - if host.Build < v21H2Server { - return host.Build == ctr.Build - } - - var supportedLtscRelease uint16 - for i := len(compatLTSCReleases) - 1; i >= 0; i-- { - if host.Build >= compatLTSCReleases[i] { - supportedLtscRelease = compatLTSCReleases[i] - break - } - } - return ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build -} diff --git a/upstream/vendor/github.com/docker/docker/AUTHORS b/upstream/vendor/github.com/docker/docker/AUTHORS index 36315d429d1..48d04f9a983 100644 --- a/upstream/vendor/github.com/docker/docker/AUTHORS +++ b/upstream/vendor/github.com/docker/docker/AUTHORS @@ -669,7 +669,6 @@ Erik Hollensbe Erik Inge Bolsø Erik Kristensen Erik Sipsma -Erik Sjölund Erik St. Martin Erik Weathers Erno Hopearuoho @@ -732,7 +731,6 @@ Feroz Salam Ferran Rodenas Filipe Brandenburger Filipe Oliveira -Filipe Pina Flavio Castelli Flavio Crisciani Florian @@ -877,8 +875,6 @@ Hsing-Yu (David) Chen hsinko <21551195@zju.edu.cn> Hu Keping Hu Tao -Huajin Tong -huang-jl <1046678590@qq.com> HuanHuan Ye Huanzhong Zhang Huayi Zhang @@ -973,7 +969,6 @@ Jannick Fahlbusch Januar Wayong Jared Biel Jared Hocutt -Jaroslav Jindrak Jaroslaw Zabiello Jasmine Hegman Jason A. Donenfeld @@ -1017,7 +1012,6 @@ Jeffrey Bolle Jeffrey Morgan Jeffrey van Gogh Jenny Gebske -Jeongseok Kang Jeremy Chambers Jeremy Grosser Jeremy Huntwork @@ -1035,7 +1029,6 @@ Jezeniel Zapanta Jhon Honce Ji.Zhilong Jian Liao -Jian Zeng Jian Zhang Jiang Jinyang Jianyong Wu @@ -1974,7 +1967,6 @@ Sergey Evstifeev Sergii Kabashniuk Sergio Lopez Serhat Gülçiçek -Serhii Nakon SeungUkLee Sevki Hasirci Shane Canon @@ -2261,7 +2253,6 @@ VladimirAus Vladislav Kolesnikov Vlastimil Zeman Vojtech Vitek (V-Teq) -voloder <110066198+voloder@users.noreply.github.com> Walter Leibbrandt Walter Stanish Wang Chao diff --git a/upstream/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/upstream/vendor/github.com/emicklei/go-restful/v3/CHANGES.md index 5edd5a7ca9a..352018e7037 100644 --- a/upstream/vendor/github.com/emicklei/go-restful/v3/CHANGES.md +++ b/upstream/vendor/github.com/emicklei/go-restful/v3/CHANGES.md @@ -1,15 +1,11 @@ # Change history of go-restful -## [v3.11.0] - 2023-08-19 - -- restored behavior as <= v3.9.0 with option to change path strategy using TrimRightSlashEnabled. - -## [v3.10.2] - 2023-03-09 - DO NOT USE +## [v3.10.2] - 2023-03-09 - introduced MergePathStrategy to be able to revert behaviour of path concatenation to 3.9.0 see comment in Readme how to customize this behaviour. -## [v3.10.1] - 2022-11-19 - DO NOT USE +## [v3.10.1] - 2022-11-19 - fix broken 3.10.0 by using path package for joining paths diff --git a/upstream/vendor/github.com/emicklei/go-restful/v3/README.md b/upstream/vendor/github.com/emicklei/go-restful/v3/README.md index e3e30080ec1..85da90128e4 100644 --- a/upstream/vendor/github.com/emicklei/go-restful/v3/README.md +++ b/upstream/vendor/github.com/emicklei/go-restful/v3/README.md @@ -79,7 +79,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Content encoding (gzip,deflate) of request and response payloads - Automatic responses on OPTIONS (using a filter) - Automatic CORS request handling (using a filter) -- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi)) +- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12)) - Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) - Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) - Configurable (trace) logging @@ -96,7 +96,10 @@ There are several hooks to customize the behavior of the go-restful package. - Compression - Encoders for other serializers - Use [jsoniter](https://github.com/json-iterator/go) by building this package using a build tag, e.g. `go build -tags=jsoniter .` -- Use the package variable `TrimRightSlashEnabled` (default true) to control the behavior of matching routes that end with a slash `/` +- Use the variable `MergePathStrategy` to change the behaviour of composing the Route path given a root path and a local route path + - versions >= 3.10.1 has set the value to `PathJoinStrategy` that fixes a reported [security issue](https://github.com/advisories/GHSA-r48q-9g5r-8q2h) but may cause your services not to work correctly anymore. + - versions <= 3.9 had the behaviour that can be restored in newer versions by setting the value to `TrimSlashStrategy`. + - you can set value to a custom implementation (must implement MergePathStrategyFunc) ## Resources @@ -109,4 +112,4 @@ There are several hooks to customize the behavior of the go-restful package. Type ```git shortlog -s``` for a full list of contributors. -© 2012 - 2023, http://ernestmicklei.com. MIT License. Contributions are welcome. +© 2012 - 2022, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/upstream/vendor/github.com/emicklei/go-restful/v3/route.go b/upstream/vendor/github.com/emicklei/go-restful/v3/route.go index 306c44be779..ea05b3da887 100644 --- a/upstream/vendor/github.com/emicklei/go-restful/v3/route.go +++ b/upstream/vendor/github.com/emicklei/go-restful/v3/route.go @@ -40,8 +40,7 @@ type Route struct { ParameterDocs []*Parameter ResponseErrors map[int]ResponseError DefaultResponse *ResponseError - ReadSample, WriteSample interface{} // structs that model an example request or response payload - WriteSamples []interface{} // if more than one return types is possible (oneof) then this will contain multiple values + ReadSample, WriteSample interface{} // structs that model an example request or response payload // Extra information used to store custom information about the route. Metadata map[string]interface{} @@ -165,13 +164,7 @@ func tokenizePath(path string) []string { if "/" == path { return nil } - if TrimRightSlashEnabled { - // 3.9.0 - return strings.Split(strings.Trim(path, "/"), "/") - } else { - // 3.10.2 - return strings.Split(strings.TrimLeft(path, "/"), "/") - } + return strings.Split(strings.TrimLeft(path, "/"), "/") } // for debugging @@ -184,8 +177,4 @@ func (r *Route) EnableContentEncoding(enabled bool) { r.contentEncodingEnabled = &enabled } -// TrimRightSlashEnabled controls whether -// - path on route building is using path.Join -// - the path of the incoming request is trimmed of its slash suffux. -// Value of true matches the behavior of <= 3.9.0 -var TrimRightSlashEnabled = true +var TrimRightSlashEnabled = false diff --git a/upstream/vendor/github.com/emicklei/go-restful/v3/route_builder.go b/upstream/vendor/github.com/emicklei/go-restful/v3/route_builder.go index 75168c12e1a..827f471de00 100644 --- a/upstream/vendor/github.com/emicklei/go-restful/v3/route_builder.go +++ b/upstream/vendor/github.com/emicklei/go-restful/v3/route_builder.go @@ -31,18 +31,17 @@ type RouteBuilder struct { typeNameHandleFunc TypeNameHandleFunction // required // documentation - doc string - notes string - operation string - readSample interface{} - writeSamples []interface{} - parameters []*Parameter - errorMap map[int]ResponseError - defaultResponse *ResponseError - metadata map[string]interface{} - extensions map[string]interface{} - deprecated bool - contentEncodingEnabled *bool + doc string + notes string + operation string + readSample, writeSample interface{} + parameters []*Parameter + errorMap map[int]ResponseError + defaultResponse *ResponseError + metadata map[string]interface{} + extensions map[string]interface{} + deprecated bool + contentEncodingEnabled *bool } // Do evaluates each argument with the RouteBuilder itself. @@ -136,9 +135,9 @@ func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) { return p } -// Writes tells which one of the resource types will be written as the response payload. Optional. -func (b *RouteBuilder) Writes(samples ...interface{}) *RouteBuilder { - b.writeSamples = samples // oneof +// Writes tells what resource type will be written as the response payload. Optional. +func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder { + b.writeSample = sample return b } @@ -343,29 +342,39 @@ func (b *RouteBuilder) Build() Route { ResponseErrors: b.errorMap, DefaultResponse: b.defaultResponse, ReadSample: b.readSample, - WriteSamples: b.writeSamples, + WriteSample: b.writeSample, Metadata: b.metadata, Deprecated: b.deprecated, contentEncodingEnabled: b.contentEncodingEnabled, allowedMethodsWithoutContentType: b.allowedMethodsWithoutContentType, } - // set WriteSample if one specified - if len(b.writeSamples) == 1 { - route.WriteSample = b.writeSamples[0] - } route.Extensions = b.extensions route.postBuild() return route } -// merge two paths using the current (package global) merge path strategy. -func concatPath(rootPath, routePath string) string { +type MergePathStrategyFunc func(rootPath, routePath string) string - if TrimRightSlashEnabled { - return strings.TrimRight(rootPath, "/") + "/" + strings.TrimLeft(routePath, "/") - } else { +var ( + // behavior >= 3.10 + PathJoinStrategy = func(rootPath, routePath string) string { return path.Join(rootPath, routePath) } + + // behavior <= 3.9 + TrimSlashStrategy = func(rootPath, routePath string) string { + return strings.TrimRight(rootPath, "/") + "/" + strings.TrimLeft(routePath, "/") + } + + // MergePathStrategy is the active strategy for merging a Route path when building the routing of all WebServices. + // The value is set to PathJoinStrategy + // PathJoinStrategy is a strategy that is more strict [Security - PRISMA-2022-0227] + MergePathStrategy = PathJoinStrategy +) + +// merge two paths using the current (package global) merge path strategy. +func concatPath(rootPath, routePath string) string { + return MergePathStrategy(rootPath, routePath) } var anonymousFuncCount int32 diff --git a/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go b/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go index 2e6eca44878..a1819b16ace 100644 --- a/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go +++ b/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go @@ -167,19 +167,6 @@ func Marshal(v any) ([]byte, error) { return buf, nil } -func MarshalEscaped(v any, escape bool) ([]byte, error) { - e := newEncodeState() - defer encodeStatePool.Put(e) - - err := e.marshal(v, encOpts{escapeHTML: escape}) - if err != nil { - return nil, err - } - buf := append([]byte(nil), e.Bytes()...) - - return buf, nil -} - // MarshalIndent is like Marshal but applies Indent to format the output. // Each JSON element in the output will begin on a new line beginning with prefix // followed by one or more copies of indent according to the indentation nesting. diff --git a/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go b/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go index 5598ce11fe4..1442ef29eff 100644 --- a/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go +++ b/upstream/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go @@ -6,7 +6,7 @@ package json import ( "bytes" - "encoding/json" + "errors" "io" ) @@ -259,7 +259,27 @@ func (enc *Encoder) SetEscapeHTML(on bool) { // RawMessage is a raw encoded JSON value. // It implements Marshaler and Unmarshaler and can // be used to delay JSON decoding or precompute a JSON encoding. -type RawMessage = json.RawMessage +type RawMessage []byte + +// MarshalJSON returns m as the JSON encoding of m. +func (m RawMessage) MarshalJSON() ([]byte, error) { + if m == nil { + return []byte("null"), nil + } + return m, nil +} + +// UnmarshalJSON sets *m to a copy of data. +func (m *RawMessage) UnmarshalJSON(data []byte) error { + if m == nil { + return errors.New("json.RawMessage: UnmarshalJSON on nil pointer") + } + *m = append((*m)[0:0], data...) + return nil +} + +var _ Marshaler = (*RawMessage)(nil) +var _ Unmarshaler = (*RawMessage)(nil) // A Token holds a value of one of these types: // diff --git a/upstream/vendor/github.com/evanphx/json-patch/v5/merge.go b/upstream/vendor/github.com/evanphx/json-patch/v5/merge.go index f79caf3135a..bbe9f85f28e 100644 --- a/upstream/vendor/github.com/evanphx/json-patch/v5/merge.go +++ b/upstream/vendor/github.com/evanphx/json-patch/v5/merge.go @@ -10,26 +10,26 @@ import ( "github.com/evanphx/json-patch/v5/internal/json" ) -func merge(cur, patch *lazyNode, mergeMerge bool, options *ApplyOptions) *lazyNode { - curDoc, err := cur.intoDoc(options) +func merge(cur, patch *lazyNode, mergeMerge bool) *lazyNode { + curDoc, err := cur.intoDoc() if err != nil { - pruneNulls(patch, options) + pruneNulls(patch) return patch } - patchDoc, err := patch.intoDoc(options) + patchDoc, err := patch.intoDoc() if err != nil { return patch } - mergeDocs(curDoc, patchDoc, mergeMerge, options) + mergeDocs(curDoc, patchDoc, mergeMerge) return cur } -func mergeDocs(doc, patch *partialDoc, mergeMerge bool, options *ApplyOptions) { +func mergeDocs(doc, patch *partialDoc, mergeMerge bool) { for k, v := range patch.obj { if v == nil { if mergeMerge { @@ -45,55 +45,55 @@ func mergeDocs(doc, patch *partialDoc, mergeMerge bool, options *ApplyOptions) { } doc.obj[k] = nil } else { - _ = doc.remove(k, options) + _ = doc.remove(k, &ApplyOptions{}) } } else { cur, ok := doc.obj[k] if !ok || cur == nil { if !mergeMerge { - pruneNulls(v, options) + pruneNulls(v) } - _ = doc.set(k, v, options) + _ = doc.set(k, v, &ApplyOptions{}) } else { - _ = doc.set(k, merge(cur, v, mergeMerge, options), options) + _ = doc.set(k, merge(cur, v, mergeMerge), &ApplyOptions{}) } } } } -func pruneNulls(n *lazyNode, options *ApplyOptions) { - sub, err := n.intoDoc(options) +func pruneNulls(n *lazyNode) { + sub, err := n.intoDoc() if err == nil { - pruneDocNulls(sub, options) + pruneDocNulls(sub) } else { ary, err := n.intoAry() if err == nil { - pruneAryNulls(ary, options) + pruneAryNulls(ary) } } } -func pruneDocNulls(doc *partialDoc, options *ApplyOptions) *partialDoc { +func pruneDocNulls(doc *partialDoc) *partialDoc { for k, v := range doc.obj { if v == nil { _ = doc.remove(k, &ApplyOptions{}) } else { - pruneNulls(v, options) + pruneNulls(v) } } return doc } -func pruneAryNulls(ary *partialArray, options *ApplyOptions) *partialArray { +func pruneAryNulls(ary *partialArray) *partialArray { newAry := []*lazyNode{} for _, v := range ary.nodes { if v != nil { - pruneNulls(v, options) + pruneNulls(v) } newAry = append(newAry, v) } @@ -128,17 +128,11 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { return nil, errBadJSONPatch } - options := NewApplyOptions() - - doc := &partialDoc{ - opts: options, - } + doc := &partialDoc{} docErr := doc.UnmarshalJSON(docData) - patch := &partialDoc{ - opts: options, - } + patch := &partialDoc{} patchErr := patch.UnmarshalJSON(patchData) @@ -164,7 +158,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { if mergeMerge { doc = patch } else { - doc = pruneDocNulls(patch, options) + doc = pruneDocNulls(patch) } } else { patchAry := &partialArray{} @@ -178,7 +172,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { return nil, errBadJSONPatch } - pruneAryNulls(patchAry, options) + pruneAryNulls(patchAry) out, patchErr := json.Marshal(patchAry.nodes) @@ -189,7 +183,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { return out, nil } } else { - mergeDocs(doc, patch, mergeMerge, options) + mergeDocs(doc, patch, mergeMerge) } return json.Marshal(doc) diff --git a/upstream/vendor/github.com/evanphx/json-patch/v5/patch.go b/upstream/vendor/github.com/evanphx/json-patch/v5/patch.go index 7a7f71c8b66..a3bbf1c73b8 100644 --- a/upstream/vendor/github.com/evanphx/json-patch/v5/patch.go +++ b/upstream/vendor/github.com/evanphx/json-patch/v5/patch.go @@ -38,8 +38,6 @@ var ( ErrInvalid = errors.New("invalid state detected") ErrInvalidIndex = errors.New("invalid index referenced") - ErrExpectedObject = errors.New("invalid value, expected object") - rawJSONArray = []byte("[]") rawJSONObject = []byte("{}") rawJSONNull = []byte("null") @@ -62,8 +60,6 @@ type partialDoc struct { self *lazyNode keys []string obj map[string]*lazyNode - - opts *ApplyOptions } type partialArray struct { @@ -94,8 +90,6 @@ type ApplyOptions struct { // EnsurePathExistsOnAdd instructs json-patch to recursively create the missing parts of path on "add" operation. // Default to false. EnsurePathExistsOnAdd bool - - EscapeHTML bool } // NewApplyOptions creates a default set of options for calls to ApplyWithOptions. @@ -105,7 +99,6 @@ func NewApplyOptions() *ApplyOptions { AccumulatedCopySizeLimit: AccumulatedCopySizeLimit, AllowMissingPathOnRemove: false, EnsurePathExistsOnAdd: false, - EscapeHTML: true, } } @@ -141,28 +134,16 @@ func (n *lazyNode) UnmarshalJSON(data []byte) error { } func (n *partialDoc) TrustMarshalJSON(buf *bytes.Buffer) error { - if n.obj == nil { - return ErrExpectedObject - } - if err := buf.WriteByte('{'); err != nil { return err } - escaped := true - - // n.opts should always be set, but in case we missed a case, - // guard. - if n.opts != nil { - escaped = n.opts.EscapeHTML - } - for i, k := range n.keys { if i > 0 { if err := buf.WriteByte(','); err != nil { return err } } - key, err := json.MarshalEscaped(k, escaped) + key, err := json.Marshal(k) if err != nil { return err } @@ -172,7 +153,7 @@ func (n *partialDoc) TrustMarshalJSON(buf *bytes.Buffer) error { if err := buf.WriteByte(':'); err != nil { return err } - value, err := json.MarshalEscaped(n.obj[k], escaped) + value, err := json.Marshal(n.obj[k]) if err != nil { return err } @@ -213,11 +194,11 @@ func (n *partialArray) RedirectMarshalJSON() (interface{}, error) { return n.nodes, nil } -func deepCopy(src *lazyNode, options *ApplyOptions) (*lazyNode, int, error) { +func deepCopy(src *lazyNode) (*lazyNode, int, error) { if src == nil { return nil, 0, nil } - a, err := json.MarshalEscaped(src, options.EscapeHTML) + a, err := json.Marshal(src) if err != nil { return nil, 0, err } @@ -235,7 +216,7 @@ func (n *lazyNode) nextByte() byte { return s[0] } -func (n *lazyNode) intoDoc(options *ApplyOptions) (*partialDoc, error) { +func (n *lazyNode) intoDoc() (*partialDoc, error) { if n.which == eDoc { return n.doc, nil } @@ -254,7 +235,6 @@ func (n *lazyNode) intoDoc(options *ApplyOptions) (*partialDoc, error) { return nil, ErrInvalid } - n.doc.opts = options if err != nil { return nil, err } @@ -565,7 +545,7 @@ func findObject(pd *container, path string, options *ApplyOptions) (container, s return nil, "" } } else { - doc, err = next.intoDoc(options) + doc, err = next.intoDoc() if err != nil { return nil, "" @@ -577,10 +557,6 @@ func findObject(pd *container, path string, options *ApplyOptions) (container, s } func (d *partialDoc) set(key string, val *lazyNode, options *ApplyOptions) error { - if d.obj == nil { - return ErrExpectedObject - } - found := false for _, k := range d.keys { if k == key { @@ -603,11 +579,6 @@ func (d *partialDoc) get(key string, options *ApplyOptions) (*lazyNode, error) { if key == "" { return d.self, nil } - - if d.obj == nil { - return nil, ErrExpectedObject - } - v, ok := d.obj[key] if !ok { return v, errors.Wrapf(ErrMissing, "unable to get nonexistent key: %s", key) @@ -616,10 +587,6 @@ func (d *partialDoc) get(key string, options *ApplyOptions) (*lazyNode, error) { } func (d *partialDoc) remove(key string, options *ApplyOptions) error { - if d.obj == nil { - return ErrExpectedObject - } - _, ok := d.obj[key] if !ok { if options.AllowMissingPathOnRemove { @@ -783,7 +750,6 @@ func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error { } else { pd = &partialDoc{ self: val, - opts: options, } } @@ -889,7 +855,7 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error { newNode := newLazyNode(newRawMessage(rawJSONObject)) doc.add(part, newNode, options) - doc, err = newNode.intoDoc(options) + doc, err = newNode.intoDoc() if err != nil { return err } @@ -902,7 +868,7 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error { return err } } else { - doc, err = target.intoDoc(options) + doc, err = target.intoDoc() if err != nil { return err @@ -988,8 +954,6 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro if !val.tryAry() { return errors.Wrapf(err, "replace operation value must be object or array") } - } else { - val.doc.opts = options } } @@ -1151,7 +1115,7 @@ func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64, op return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path) } - valCopy, sz, err := deepCopy(val, options) + valCopy, sz, err := deepCopy(val) if err != nil { return errors.Wrapf(err, "error while performing deep copy") } @@ -1238,7 +1202,6 @@ func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyO } else { pd = &partialDoc{ self: self, - opts: options, } } @@ -1275,18 +1238,11 @@ func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyO } } - data, err := json.MarshalEscaped(pd, options.EscapeHTML) - if err != nil { - return nil, err - } - - if indent == "" { - return data, nil + if indent != "" { + return json.MarshalIndent(pd, "", indent) } - var buf bytes.Buffer - json.Indent(&buf, data, "", indent) - return buf.Bytes(), nil + return json.Marshal(pd) } // From http://tools.ietf.org/html/rfc6901#section-4 : diff --git a/upstream/vendor/github.com/go-jose/go-jose/v4/shared.go b/upstream/vendor/github.com/go-jose/go-jose/v4/shared.go index 1ec33961265..b485e43bd9f 100644 --- a/upstream/vendor/github.com/go-jose/go-jose/v4/shared.go +++ b/upstream/vendor/github.com/go-jose/go-jose/v4/shared.go @@ -71,12 +71,6 @@ var ( // ErrUnprotectedNonce indicates that while parsing a JWS or JWE object, a // nonce header parameter was included in an unprotected header object. ErrUnprotectedNonce = errors.New("go-jose/go-jose: Nonce parameter included in unprotected header") - - // ErrMissingX5cHeader indicates that the JWT header is missing x5c headers. - ErrMissingX5cHeader = errors.New("go-jose/go-jose: no x5c header present in message") - - // ErrUnsupportedEllipticCurve indicates unsupported or unknown elliptic curve has been found. - ErrUnsupportedEllipticCurve = errors.New("go-jose/go-jose: unsupported/unknown elliptic curve") ) // Key management algorithms @@ -205,7 +199,7 @@ type Header struct { // not be validated with the given verify options. func (h Header) Certificates(opts x509.VerifyOptions) ([][]*x509.Certificate, error) { if len(h.certificates) == 0 { - return nil, ErrMissingX5cHeader + return nil, errors.New("go-jose/go-jose: no x5c header present in message") } leaf := h.certificates[0] @@ -507,7 +501,7 @@ func curveName(crv elliptic.Curve) (string, error) { case elliptic.P521(): return "P-521", nil default: - return "", ErrUnsupportedEllipticCurve + return "", fmt.Errorf("go-jose/go-jose: unsupported/unknown elliptic curve") } } diff --git a/upstream/vendor/github.com/go-jose/go-jose/v4/signing.go b/upstream/vendor/github.com/go-jose/go-jose/v4/signing.go index 46c9a4d96fc..f0b0294f354 100644 --- a/upstream/vendor/github.com/go-jose/go-jose/v4/signing.go +++ b/upstream/vendor/github.com/go-jose/go-jose/v4/signing.go @@ -358,8 +358,6 @@ func (ctx *genericSigner) Options() SignerOptions { // - *rsa.PublicKey // - *JSONWebKey // - JSONWebKey -// - *JSONWebKeySet -// - JSONWebKeySet // - []byte (an HMAC key) // - Any type that implements the OpaqueVerifier interface. // diff --git a/upstream/vendor/github.com/go-logr/logr/README.md b/upstream/vendor/github.com/go-logr/logr/README.md index 7c7f0c69cd9..8969526a6e5 100644 --- a/upstream/vendor/github.com/go-logr/logr/README.md +++ b/upstream/vendor/github.com/go-logr/logr/README.md @@ -1,7 +1,6 @@ # A minimal logging API for Go [![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-logr/logr)](https://goreportcard.com/report/github.com/go-logr/logr) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](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/upstream/vendor/github.com/go-logr/logr/funcr/funcr.go b/upstream/vendor/github.com/go-logr/logr/funcr/funcr.go index 30568e768dc..fb2f866f4b7 100644 --- a/upstream/vendor/github.com/go-logr/logr/funcr/funcr.go +++ b/upstream/vendor/github.com/go-logr/logr/funcr/funcr.go @@ -236,14 +236,15 @@ 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 - depth int - opts *Options - groupName string // for slog groups - groups []groupDef + outputFormat outputFormat + prefix string + values []any + valuesStr string + parentValuesStr string + depth int + opts *Options + group string // for slog groups + groupDepth int } // outputFormat indicates which outputFormat to use. @@ -256,13 +257,6 @@ 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 @@ -270,102 +264,76 @@ 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 record + buf.WriteByte('{') // for the whole line } - // Render builtins vals := builtins if hook := f.opts.RenderBuiltinsHook; hook != nil { vals = hook(f.sanitize(vals)) } - f.flatten(buf, vals, false) // keys are ours, no need to escape + f.flatten(buf, vals, false, false) // keys are ours, no need to escape continuing := len(builtins) > 0 - // 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)) + if f.parentValuesStr != "" { + if continuing { + buf.WriteByte(f.comma()) } - f.flatten(buf, vals, true) // escape user-provided keys - - return buf.String() - }() + buf.WriteString(f.parentValuesStr) + continuing = true + } - // 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 + 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-- } - bodyStr = f.renderGroup(grp.name, grp.values, bodyStr) } - if bodyStr != "" { + if f.valuesStr != "" { if continuing { buf.WriteByte(f.comma()) } - buf.WriteString(bodyStr) - } - - if f.outputFormat == outputJSON { - buf.WriteByte('}') // for the whole record - } - - 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 + buf.WriteString(f.valuesStr) + continuing = true } - continuing := false - if values != "" { - buf.WriteString(values) - continuing = true + vals = args + if hook := f.opts.RenderArgsHook; hook != nil { + vals = hook(f.sanitize(vals)) } + f.flatten(buf, vals, continuing, true) // escape user-provided keys - if args != "" { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(args) + for i := 0; i < groupDepth; i++ { + buf.WriteByte('}') // for the groups } - if needClosingBrace { - buf.WriteByte('}') + if f.outputFormat == outputJSON { + buf.WriteByte('}') // for the whole line } return buf.String() } -// 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. +// 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. // // 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, escapeKeys bool) []any { +func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any { // This logic overlaps with sanitize() but saves one type-cast per key, // which can be measurable. if len(kvList)%2 != 0 { @@ -386,7 +354,7 @@ func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, escapeKeys bool) []a } v := kvList[i+1] - if i > 0 { + if i > 0 || continuing { if f.outputFormat == outputJSON { buf.WriteByte(f.comma()) } else { @@ -798,17 +766,46 @@ 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(name string) { +func (f *Formatter) startGroup(group string) { // Unnamed groups are just inlined. - if name == "" { + if group == "" { return } - n := len(f.groups) - f.groups = append(f.groups[:n:n], groupDef{f.groupName, f.valuesStr}) + // 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() // Start collecting new values. - f.groupName = name + f.group = group + f.groupDepth++ f.valuesStr = "" f.values = nil } @@ -903,7 +900,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, true) // escape user-provided keys + f.flatten(buf, vals, false, true) // escape user-provided keys f.valuesStr = buf.String() } diff --git a/upstream/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go b/upstream/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go index c929e4a02fc..ca85659ba4b 100644 --- a/upstream/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go +++ b/upstream/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go @@ -62,7 +62,7 @@ func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interf case *ecdsa.PublicKey: ecdsaKey = k default: - return newError("ECDSA verify expects *ecdsa.PublicKey", ErrInvalidKeyType) + return newError("ECDSA verify expects *ecsda.PublicKey", ErrInvalidKeyType) } if len(sig) != 2*m.KeySize { @@ -96,7 +96,7 @@ func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) ([]byte case *ecdsa.PrivateKey: ecdsaKey = k default: - return nil, newError("ECDSA sign expects *ecdsa.PrivateKey", ErrInvalidKeyType) + return nil, newError("ECDSA sign expects *ecsda.PrivateKey", ErrInvalidKeyType) } // Create the hasher diff --git a/upstream/vendor/github.com/golang-jwt/jwt/v5/hmac.go b/upstream/vendor/github.com/golang-jwt/jwt/v5/hmac.go index aca600ce1b0..96c62722d18 100644 --- a/upstream/vendor/github.com/golang-jwt/jwt/v5/hmac.go +++ b/upstream/vendor/github.com/golang-jwt/jwt/v5/hmac.go @@ -91,7 +91,7 @@ func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interfa func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, error) { if keyBytes, ok := key.([]byte); ok { if !m.Hash.Available() { - return nil, ErrHashUnavailable + return nil, newError("HMAC sign expects []byte", ErrInvalidKeyType) } hasher := hmac.New(m.Hash.New, keyBytes) @@ -100,5 +100,5 @@ func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, return hasher.Sum(nil), nil } - return nil, newError("HMAC sign expects []byte", ErrInvalidKeyType) + return nil, ErrInvalidKeyType } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/authn.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/authn.go index 1555efae04f..172d218e4fc 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/authn.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/authn.go @@ -15,7 +15,6 @@ package authn import ( - "context" "encoding/base64" "encoding/json" "fmt" @@ -28,22 +27,6 @@ type Authenticator interface { Authorization() (*AuthConfig, error) } -// ContextAuthenticator is like Authenticator, but allows for context to be passed in. -type ContextAuthenticator interface { - // Authorization returns the value to use in an http transport's Authorization header. - AuthorizationContext(context.Context) (*AuthConfig, error) -} - -// Authorization calls AuthorizationContext with ctx if the given [Authenticator] implements [ContextAuthenticator], -// otherwise it calls Resolve with the given [Resource]. -func Authorization(ctx context.Context, authn Authenticator) (*AuthConfig, error) { - if actx, ok := authn.(ContextAuthenticator); ok { - return actx.AuthorizationContext(ctx) - } - - return authn.Authorization() -} - // AuthConfig contains authorization information for connecting to a Registry // Inlined what we use from github.com/docker/cli/cli/config/types type AuthConfig struct { diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/keychain.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/keychain.go index f4c452bdc3a..99e0b81c8d1 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/keychain.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/keychain.go @@ -15,7 +15,6 @@ package authn import ( - "context" "os" "path/filepath" "sync" @@ -46,11 +45,6 @@ type Keychain interface { Resolve(Resource) (Authenticator, error) } -// ContextKeychain is like Keychain, but allows for context to be passed in. -type ContextKeychain interface { - ResolveContext(context.Context, Resource) (Authenticator, error) -} - // defaultKeychain implements Keychain with the semantics of the standard Docker // credential keychain. type defaultKeychain struct { @@ -68,23 +62,8 @@ const ( DefaultAuthKey = "https://" + name.DefaultRegistry + "/v1/" ) -// Resolve calls ResolveContext with ctx if the given [Keychain] implements [ContextKeychain], -// otherwise it calls Resolve with the given [Resource]. -func Resolve(ctx context.Context, keychain Keychain, target Resource) (Authenticator, error) { - if rctx, ok := keychain.(ContextKeychain); ok { - return rctx.ResolveContext(ctx, target) - } - - return keychain.Resolve(target) -} - -// ResolveContext implements ContextKeychain. -func (dk *defaultKeychain) Resolve(target Resource) (Authenticator, error) { - return dk.ResolveContext(context.Background(), target) -} - // Resolve implements Keychain. -func (dk *defaultKeychain) ResolveContext(ctx context.Context, target Resource) (Authenticator, error) { +func (dk *defaultKeychain) Resolve(target Resource) (Authenticator, error) { dk.mu.Lock() defer dk.mu.Unlock() @@ -107,8 +86,8 @@ func (dk *defaultKeychain) ResolveContext(ctx context.Context, target Resource) // config.Load, which may fail if the config can't be parsed. // // If neither was found, look for Podman's auth at - // $REGISTRY_AUTH_FILE or $XDG_RUNTIME_DIR/containers/auth.json - // and attempt to load it as a Docker config. + // $XDG_RUNTIME_DIR/containers/auth.json and attempt to load it as a + // Docker config. // // If neither are found, fallback to Anonymous. var cf *configfile.ConfigFile @@ -117,28 +96,16 @@ func (dk *defaultKeychain) ResolveContext(ctx context.Context, target Resource) if err != nil { return nil, err } - } else if fileExists(os.Getenv("REGISTRY_AUTH_FILE")) { - f, err := os.Open(os.Getenv("REGISTRY_AUTH_FILE")) - if err != nil { - return nil, err - } - defer f.Close() - cf, err = config.LoadFromReader(f) - if err != nil { - return nil, err - } - } else if fileExists(filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "containers/auth.json")) { + } else { f, err := os.Open(filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "containers/auth.json")) if err != nil { - return nil, err + return Anonymous, nil } defer f.Close() cf, err = config.LoadFromReader(f) if err != nil { return nil, err } - } else { - return Anonymous, nil } // See: @@ -201,10 +168,6 @@ func NewKeychainFromHelper(h Helper) Keychain { return wrapper{h} } type wrapper struct{ h Helper } func (w wrapper) Resolve(r Resource) (Authenticator, error) { - return w.ResolveContext(context.Background(), r) -} - -func (w wrapper) ResolveContext(ctx context.Context, r Resource) (Authenticator, error) { u, p, err := w.h.Get(r.RegistryStr()) if err != nil { return Anonymous, nil @@ -231,12 +194,8 @@ type refreshingKeychain struct { } func (r *refreshingKeychain) Resolve(target Resource) (Authenticator, error) { - return r.ResolveContext(context.Background(), target) -} - -func (r *refreshingKeychain) ResolveContext(ctx context.Context, target Resource) (Authenticator, error) { last := time.Now() - auth, err := Resolve(ctx, r.keychain, target) + auth, err := r.keychain.Resolve(target) if err != nil || auth == Anonymous { return auth, err } @@ -265,21 +224,17 @@ type refreshing struct { } func (r *refreshing) Authorization() (*AuthConfig, error) { - return r.AuthorizationContext(context.Background()) -} - -func (r *refreshing) AuthorizationContext(ctx context.Context) (*AuthConfig, error) { r.Lock() defer r.Unlock() if r.cached == nil || r.expired() { r.last = r.now() - auth, err := Resolve(ctx, r.keychain, r.target) + auth, err := r.keychain.Resolve(r.target) if err != nil { return nil, err } r.cached = auth } - return Authorization(ctx, r.cached) + return r.cached.Authorization() } func (r *refreshing) now() time.Time { diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/multikeychain.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/multikeychain.go index fe241a0fd9f..3b1804f5d05 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/multikeychain.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/authn/multikeychain.go @@ -14,8 +14,6 @@ package authn -import "context" - type multiKeychain struct { keychains []Keychain } @@ -30,12 +28,8 @@ func NewMultiKeychain(kcs ...Keychain) Keychain { // Resolve implements Keychain. func (mk *multiKeychain) Resolve(target Resource) (Authenticator, error) { - return mk.ResolveContext(context.Background(), target) -} - -func (mk *multiKeychain) ResolveContext(ctx context.Context, target Resource) (Authenticator, error) { for _, kc := range mk.keychains { - auth, err := Resolve(ctx, kc, target) + auth, err := kc.Resolve(target) if err != nil { return nil, err } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/name/digest.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/name/digest.go index 28f6967ba70..c049c1ef48a 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/name/digest.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/name/digest.go @@ -17,7 +17,6 @@ package name import ( // nolint: depguard _ "crypto/sha256" // Recommended by go-digest. - "encoding/json" "strings" "github.com/opencontainers/go-digest" @@ -60,25 +59,6 @@ func (d Digest) String() string { return d.original } -// MarshalJSON formats the digest into a string for JSON serialization. -func (d Digest) MarshalJSON() ([]byte, error) { - return json.Marshal(d.String()) -} - -// UnmarshalJSON parses a JSON string into a Digest. -func (d *Digest) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - n, err := NewDigest(s) - if err != nil { - return err - } - *d = n - return nil -} - // NewDigest returns a new Digest representing the given name. func NewDigest(name string, opts ...Option) (Digest, error) { // Split on "@" diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/registry/blobs.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/registry/blobs.go index c83e547990f..8386ffdf9e8 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/registry/blobs.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/registry/blobs.go @@ -93,14 +93,6 @@ type redirectError struct { Code int } -type bytesCloser struct { - *bytes.Reader -} - -func (r *bytesCloser) Close() error { - return nil -} - func (e redirectError) Error() string { return fmt.Sprintf("redirecting (%d): %s", e.Code, e.Location) } // errNotFound represents an error locating the blob. @@ -123,7 +115,6 @@ func (m *memHandler) Stat(_ context.Context, _ string, h v1.Hash) (int64, error) } return int64(len(b)), nil } - func (m *memHandler) Get(_ context.Context, _ string, h v1.Hash) (io.ReadCloser, error) { m.lock.Lock() defer m.lock.Unlock() @@ -132,9 +123,8 @@ func (m *memHandler) Get(_ context.Context, _ string, h v1.Hash) (io.ReadCloser, if !found { return nil, errNotFound } - return &bytesCloser{bytes.NewReader(b)}, nil + return io.NopCloser(bytes.NewReader(b)), nil } - func (m *memHandler) Put(_ context.Context, _ string, h v1.Hash, rc io.ReadCloser) error { m.lock.Lock() defer m.lock.Unlock() @@ -147,7 +137,6 @@ func (m *memHandler) Put(_ context.Context, _ string, h v1.Hash, rc io.ReadClose m.m[h.String()] = all return nil } - func (m *memHandler) Delete(_ context.Context, _ string, h v1.Hash) error { m.lock.Lock() defer m.lock.Unlock() @@ -188,7 +177,6 @@ func (b *blobs) handle(resp http.ResponseWriter, req *http.Request) *regError { service := elem[len(elem)-2] digest := req.URL.Query().Get("digest") contentRange := req.Header.Get("Content-Range") - rangeHeader := req.Header.Get("Range") repo := req.URL.Host + path.Join(elem[1:len(elem)-2]...) @@ -277,10 +265,8 @@ func (b *blobs) handle(resp http.ResponseWriter, req *http.Request) *regError { return regErrInternal(err) } - defer rc.Close() r = rc - } else { tmp, err := b.blobHandler.Get(req.Context(), repo, h) if errors.Is(err, errNotFound) { @@ -301,48 +287,9 @@ func (b *blobs) handle(resp http.ResponseWriter, req *http.Request) *regError { r = &buf } - if rangeHeader != "" { - start, end := int64(0), int64(0) - if _, err := fmt.Sscanf(rangeHeader, "bytes=%d-%d", &start, &end); err != nil { - return ®Error{ - Status: http.StatusRequestedRangeNotSatisfiable, - Code: "BLOB_UNKNOWN", - Message: "We don't understand your Range", - } - } - - n := (end + 1) - start - if ra, ok := r.(io.ReaderAt); ok { - if end+1 > size { - return ®Error{ - Status: http.StatusRequestedRangeNotSatisfiable, - Code: "BLOB_UNKNOWN", - Message: fmt.Sprintf("range end %d > %d size", end+1, size), - } - } - r = io.NewSectionReader(ra, start, n) - } else { - if _, err := io.CopyN(io.Discard, r, start); err != nil { - return ®Error{ - Status: http.StatusRequestedRangeNotSatisfiable, - Code: "BLOB_UNKNOWN", - Message: fmt.Sprintf("Failed to discard %d bytes", start), - } - } - - r = io.LimitReader(r, n) - } - - resp.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, end, size)) - resp.Header().Set("Content-Length", fmt.Sprint(n)) - resp.Header().Set("Docker-Content-Digest", h.String()) - resp.WriteHeader(http.StatusPartialContent) - } else { - resp.Header().Set("Content-Length", fmt.Sprint(size)) - resp.Header().Set("Docker-Content-Digest", h.String()) - resp.WriteHeader(http.StatusOK) - } - + resp.Header().Set("Content-Length", fmt.Sprint(size)) + resp.Header().Set("Docker-Content-Digest", h.String()) + resp.WriteHeader(http.StatusOK) io.Copy(resp, r) return nil diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/auth.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/auth.go index 4e64eda43cc..11ae3979695 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/auth.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/auth.go @@ -31,7 +31,7 @@ import ( const cloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" // GetGcloudCmd is exposed so we can test this. -var GetGcloudCmd = func(ctx context.Context) *exec.Cmd { +var GetGcloudCmd = func() *exec.Cmd { // This is odd, but basically what docker-credential-gcr does. // // config-helper is undocumented, but it's purportedly the only supported way @@ -39,15 +39,15 @@ var GetGcloudCmd = func(ctx context.Context) *exec.Cmd { // // --force-auth-refresh means we are getting a token that is valid for about // an hour (we reuse it until it's expired). - return exec.CommandContext(ctx, "gcloud", "config", "config-helper", "--force-auth-refresh", "--format=json(credential)") + return exec.Command("gcloud", "config", "config-helper", "--force-auth-refresh", "--format=json(credential)") } // NewEnvAuthenticator returns an authn.Authenticator that generates access // tokens from the environment we're running in. // // See: https://godoc.org/golang.org/x/oauth2/google#FindDefaultCredentials -func NewEnvAuthenticator(ctx context.Context) (authn.Authenticator, error) { - ts, err := googauth.DefaultTokenSource(ctx, cloudPlatformScope) +func NewEnvAuthenticator() (authn.Authenticator, error) { + ts, err := googauth.DefaultTokenSource(context.Background(), cloudPlatformScope) if err != nil { return nil, err } @@ -62,14 +62,14 @@ func NewEnvAuthenticator(ctx context.Context) (authn.Authenticator, error) { // NewGcloudAuthenticator returns an oauth2.TokenSource that generates access // tokens by shelling out to the gcloud sdk. -func NewGcloudAuthenticator(ctx context.Context) (authn.Authenticator, error) { +func NewGcloudAuthenticator() (authn.Authenticator, error) { if _, err := exec.LookPath("gcloud"); err != nil { // gcloud is not available, fall back to anonymous logs.Warn.Println("gcloud binary not found") return authn.Anonymous, nil } - ts := gcloudSource{ctx, GetGcloudCmd} + ts := gcloudSource{GetGcloudCmd} // Attempt to fetch a token to ensure gcloud is installed and we can run it. token, err := ts.Token() @@ -143,15 +143,13 @@ type gcloudOutput struct { } type gcloudSource struct { - ctx context.Context - // This is passed in so that we mock out gcloud and test Token. - exec func(ctx context.Context) *exec.Cmd + exec func() *exec.Cmd } // Token implements oauath2.TokenSource. func (gs gcloudSource) Token() (*oauth2.Token, error) { - cmd := gs.exec(gs.ctx) + cmd := gs.exec() var out bytes.Buffer cmd.Stdout = &out diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/keychain.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/keychain.go index 0645768c8bf..5472b187970 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/keychain.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/google/keychain.go @@ -15,7 +15,6 @@ package google import ( - "context" "strings" "sync" @@ -53,31 +52,26 @@ type googleKeychain struct { // In general, we don't worry about that here because we expect to use the same // gcloud configuration in the scope of this one process. func (gk *googleKeychain) Resolve(target authn.Resource) (authn.Authenticator, error) { - return gk.ResolveContext(context.Background(), target) -} - -// ResolveContext implements authn.ContextKeychain. -func (gk *googleKeychain) ResolveContext(ctx context.Context, target authn.Resource) (authn.Authenticator, error) { // Only authenticate GCR and AR so it works with authn.NewMultiKeychain to fallback. if !isGoogle(target.RegistryStr()) { return authn.Anonymous, nil } gk.once.Do(func() { - gk.auth = resolve(ctx) + gk.auth = resolve() }) return gk.auth, nil } -func resolve(ctx context.Context) authn.Authenticator { - auth, envErr := NewEnvAuthenticator(ctx) +func resolve() authn.Authenticator { + auth, envErr := NewEnvAuthenticator() if envErr == nil && auth != authn.Anonymous { logs.Debug.Println("google.Keychain: using Application Default Credentials") return auth } - auth, gErr := NewGcloudAuthenticator(ctx) + auth, gErr := NewGcloudAuthenticator() if gErr == nil && auth != authn.Anonymous { logs.Debug.Println("google.Keychain: using gcloud fallback") return auth diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/layout/write.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/layout/write.go index 19e4d1db8a9..d6e35c3914f 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/layout/write.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/layout/write.go @@ -22,8 +22,6 @@ import ( "io" "os" "path/filepath" - "runtime" - "sync" "github.com/google/go-containerregistry/pkg/logs" v1 "github.com/google/go-containerregistry/pkg/v1" @@ -39,9 +37,6 @@ var layoutFile = `{ "imageLayoutVersion": "1.0.0" }` -// renameMutex guards os.Rename calls in AppendImage on Windows only. -var renameMutex sync.Mutex - // AppendImage writes a v1.Image to the Path and updates // the index.json to reference it. func (l Path) AppendImage(img v1.Image, options ...Option) error { @@ -264,11 +259,6 @@ func (l Path) writeBlob(hash v1.Hash, size int64, rc io.ReadCloser, renamer func } renamePath := l.path("blobs", finalHash.Algorithm, finalHash.Hex) - - if runtime.GOOS == "windows" { - renameMutex.Lock() - defer renameMutex.Unlock() - } return os.Rename(w.Name(), renamePath) } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/fetcher.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/fetcher.go index d77b37c0c2e..4e61002bea4 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/fetcher.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/fetcher.go @@ -47,7 +47,7 @@ type fetcher struct { func makeFetcher(ctx context.Context, target resource, o *options) (*fetcher, error) { auth := o.auth if o.keychain != nil { - kauth, err := authn.Resolve(ctx, o.keychain, target) + kauth, err := o.keychain.Resolve(target) if err != nil { return nil, err } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/basic.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/basic.go index f2452469d2b..fdb362b7620 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/basic.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/basic.go @@ -33,7 +33,7 @@ var _ http.RoundTripper = (*basicTransport)(nil) // RoundTrip implements http.RoundTripper func (bt *basicTransport) RoundTrip(in *http.Request) (*http.Response, error) { if bt.auth != authn.Anonymous { - auth, err := authn.Authorization(in.Context(), bt.auth) + auth, err := bt.auth.Authorization() if err != nil { return nil, err } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/bearer.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/bearer.go index be3bec9c377..cb156749691 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/bearer.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/bearer.go @@ -49,7 +49,7 @@ func Exchange(ctx context.Context, reg name.Registry, auth authn.Authenticator, if err != nil { return nil, err } - authcfg, err := authn.Authorization(ctx, auth) + authcfg, err := auth.Authorization() if err != nil { return nil, err } @@ -190,7 +190,7 @@ func (bt *bearerTransport) RoundTrip(in *http.Request) (*http.Response, error) { // The basic token exchange is attempted first, falling back to the oauth flow. // If the IdentityToken is set, this indicates that we should start with the oauth flow. func (bt *bearerTransport) refresh(ctx context.Context) error { - auth, err := authn.Authorization(ctx, bt.basic) + auth, err := bt.basic.Authorization() if err != nil { return err } @@ -295,7 +295,7 @@ func canonicalAddress(host, scheme string) (address string) { // https://docs.docker.com/registry/spec/auth/oauth/ func (bt *bearerTransport) refreshOauth(ctx context.Context) ([]byte, error) { - auth, err := authn.Authorization(ctx, bt.basic) + auth, err := bt.basic.Authorization() if err != nil { return nil, err } diff --git a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go index b730dbb054f..04a3989a6ee 100644 --- a/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go +++ b/upstream/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go @@ -76,7 +76,7 @@ type writer struct { func makeWriter(ctx context.Context, repo name.Repository, ls []v1.Layer, o *options) (*writer, error) { auth := o.auth if o.keychain != nil { - kauth, err := authn.Resolve(ctx, o.keychain, repo) + kauth, err := o.keychain.Resolve(repo) if err != nil { return nil, err } diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der new file mode 100644 index 00000000000..958f3cfaddf Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der new file mode 100644 index 00000000000..d2817641baf Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der new file mode 100644 index 00000000000..d8c3710c85f Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der new file mode 100644 index 00000000000..dae619c0975 Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der new file mode 100644 index 00000000000..ce7f8d31d68 Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der new file mode 100644 index 00000000000..04b0d73600b Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der new file mode 100644 index 00000000000..d8c3710c85f Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem new file mode 100644 index 00000000000..493a5a26481 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 +a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 +OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 +RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK +P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 +HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu +0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 +EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 +/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA +QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ +nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD +X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco +pKklVz0= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem new file mode 100644 index 00000000000..55a7f10c742 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF +l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj ++Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G +4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA +xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh +68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ +/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL +Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA +VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 +9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH +MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt +aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq +xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx +2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv +EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z +aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq +udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs +VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm +56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT +GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V +Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm +HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q +BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH +qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh +GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der new file mode 100644 index 00000000000..04b0d73600b Binary files /dev/null and b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der differ diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem new file mode 100644 index 00000000000..0f98322c724 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT +fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ +qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE +xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es +Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 +Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM +ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR +e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X +POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl +AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg +odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ +PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN +Dhm6uZM= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem new file mode 100644 index 00000000000..81afea783df --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs +8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO +QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk +XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA +Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc +gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf +LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl +jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 +4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q +Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P +nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 +drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE +duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 +L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG +06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm +eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD +uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 +lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL +a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb +hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ +7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j +r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 +eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD +B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz +7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem new file mode 100644 index 00000000000..493a5a26481 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 +a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 +OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 +RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK +P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 +HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu +0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 +EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 +/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA +QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ +nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD +X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco +pKklVz0= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem new file mode 100644 index 00000000000..55a7f10c742 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF +l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj ++Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G +4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA +xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh +68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ +/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL +Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA +VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 +9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH +MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt +aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq +xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx +2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv +EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z +aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq +udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs +VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm +56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT +GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V +Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm +HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q +BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH +qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh +GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem new file mode 100644 index 00000000000..0f98322c724 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT +fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ +qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE +xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es +Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 +Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM +ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR +e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X +POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl +AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg +odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ +PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN +Dhm6uZM= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem new file mode 100644 index 00000000000..81afea783df --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs +8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO +QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk +XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA +Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc +gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf +LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl +jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 +4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q +Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P +nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 +drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE +duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 +L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG +06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm +eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD +uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 +lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL +a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb +hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ +7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j +r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 +eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD +B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz +7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem new file mode 100644 index 00000000000..493a5a26481 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 +a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 +OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 +RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK +P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 +HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu +0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 +EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 +/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA +QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ +nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD +X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco +pKklVz0= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem new file mode 100644 index 00000000000..55a7f10c742 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF +l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj ++Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G +4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA +xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh +68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ +/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL +Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA +VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 +9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH +MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt +aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq +xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx +2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv +EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z +aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq +udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs +VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm +56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT +GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V +Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm +HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q +BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH +qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh +GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem new file mode 100644 index 00000000000..0f98322c724 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT +fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ +qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE +xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es +Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 +Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM +ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR +e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X +POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl +AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg +odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ +PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN +Dhm6uZM= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem new file mode 100644 index 00000000000..81afea783df --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs +8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO +QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk +XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA +Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc +gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf +LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl +jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 +4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q +Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P +nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 +drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE +duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 +L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG +06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm +eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD +uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 +lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL +a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb +hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ +7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j +r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 +eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD +B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz +7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/client_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/client_cert.pem new file mode 100644 index 00000000000..493a5a26481 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/client_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 +a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 +OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 +RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK +P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 +HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu +0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 +EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 +/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA +QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ +nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD +X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco +pKklVz0= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/client_key.pem b/upstream/vendor/github.com/google/s2a-go/testdata/client_key.pem new file mode 100644 index 00000000000..55a7f10c742 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/client_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF +l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj ++Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G +4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA +xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh +68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ +/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL +Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA +VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 +9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH +MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt +aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq +xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx +2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv +EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z +aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq +udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs +VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm +56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT +GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V +Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm +HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q +BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH +qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh +GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem new file mode 100644 index 00000000000..60c4cf06915 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDCDCCAfACFFlYsYCFit01ZpYmfjxpo7/6wMEbMA0GCSqGSIb3DQEBCwUAMEgx +CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEPMA0GA1UECgwGR29vZ2xlMRswGQYD +VQQDDBJ0ZXN0LXMyYS1tdGxzLXJvb3QwHhcNMjMwODIyMTY0NTE4WhcNNDMwODIy +MTY0NTE4WjA5MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExHTAbBgNVBAMMFHRl +c3QtczJhLW10bHMtY2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAqrQQMyxNtmdCB+uY3szgRsfPrKC+TV9Fusnd8PfaCVuGTGcSBKM018nV2TDn +3IYFQ1HgLpGwGwOFDBb3y0o9i2/l2VJySriX1GSNX6nDmVasQlO1wuOLCP7/LRmO +7b6Kise5W0IFhYaptKyWnekn2pS0tAjimqpfn2w0U6FDGtQUqg/trQQmGtTSJHjb +A+OFd0EFC18KGP8Q+jOMaMkJRmpeEiAPyHPDoMhqQNT26RApv9j2Uzo4SuXzHH6T +cAdm1+zG+EXY/UZKX9oDkSbwIJvN+gCmNyORLalJ12gsGYOCjMd8K0mlXBqrmmbO +VHVbUm9062lhE7x59AA8DK4DoQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCPOvtL +dq2hxFHlIy0YUK8jp/DtwJZPwzx1id5FtWwd0CxBS1StIgmkHMxtkJGz1iyQLplI +je+Msd4sTsb5zZi/8kGKehi8Wj4lghp4oP30cpob41OvM68M9RC/wSOVk9igSww+ +l3zof6wKRIswsi5VHrL16ruIVVoDlyFbKr8yk+cp9OPOV8hNNN7ewY9xC8OgnTt8 +YtdaLe6uTplKBLW+j3GtshigRhyfkGJyPFYL4LAeDJCHlC1qmBnkyP0ijMp6vneM +E8TLavnMTMcpihWTWpyKeRkO6HDRsP4AofQAp7VAiAdSOplga+w2qgrVICV+m8MK +BTq2PBvc59T6OFLq +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem b/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem new file mode 100644 index 00000000000..9d112d1e9ff --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCqtBAzLE22Z0IH +65jezOBGx8+soL5NX0W6yd3w99oJW4ZMZxIEozTXydXZMOfchgVDUeAukbAbA4UM +FvfLSj2Lb+XZUnJKuJfUZI1fqcOZVqxCU7XC44sI/v8tGY7tvoqKx7lbQgWFhqm0 +rJad6SfalLS0COKaql+fbDRToUMa1BSqD+2tBCYa1NIkeNsD44V3QQULXwoY/xD6 +M4xoyQlGal4SIA/Ic8OgyGpA1PbpECm/2PZTOjhK5fMcfpNwB2bX7Mb4Rdj9Rkpf +2gORJvAgm836AKY3I5EtqUnXaCwZg4KMx3wrSaVcGquaZs5UdVtSb3TraWETvHn0 +ADwMrgOhAgMBAAECggEAUccupZ1ZY4OHTi0PkNk8rpwFwTFGyeFVEf2ofkr24RnA +NnUAXEllxOUUNlcoFOz9s3kTeavg3qgqgpa0QmdAIb9LMXg+ec6CKkW7trMpGho8 +LxBUWNfSoU4sKEqAvyPT0lWJVo9D/up6/avbAi6TIbOw+Djzel4ZrlHTpabxc3WT +EilXzn4q54b3MzxCQeQjcnzTieW4Q5semG2kLiXFToHIY2di01P/O8awUjgrD+uW +/Cb6H49MnHm9VPkqea1iwZeMQd6Gh5FrC7RezsBjdB1JBcfsv6PFt2ySInjB8SF+ +XR5Gr3Cc5sh9s0LfprZ9Dq0rlSWmwasPMI1COK6SswKBgQDczgeWd3erQ1JX9LEI +wollawqC9y7uJhEsw1hrPqA3uqZYiLUc7Nmi4laZ12mcGoXNDS3R3XmD58qGmGaU +lxEVTb8KDVWBgw450VoBKzSMQnCP6zn4nZxTYxeqMKjDGf6TRB6TZc843qsG3eRC +k91yxrCQ/0HV6PT48C+lieDzLwKBgQDF6aNKiyrswr457undBnM1H8q/Y6xC5ZlK +UtiQdhuyBnicvz0U8WPxBY/8gha0OXWuSnBqq/z77iFVNv/zT6p9K7kM7nBGd8cB +8KO6FNbyaHWFrhCI5zNzRTH4oha0hfvUOoti09vqavCtWD4L+D/63ba1wNLKPO9o +4gWbCnUCLwKBgQC/vus372csgrnvR761LLrEJ8BpGt7WUJh5luoht7DKtHvgRleB +Vu1oVcV+s2Iy/ZVUDC3OIdZ0hcWKPK5YOxfKuEk+IXYvke+4peTTPwHTC59UW6Fs +FPK8N0FFuhvT0a8RlAY5WiAp8rPysp6WcnHMSl7qi8BQUozp4Sp/RsziYQKBgBXv +r4mzoy5a53rEYGd/L4XT4EUWZyGDEVqLlDVu4eL5lKTLDZokp08vrqXuRVX0iHap +CYzJQ2EpI8iuL/BoBB2bmwcz5n3pCMXORld5t9lmeqA2it6hwbIlGUTVsm6P6zm6 +w3hQwy9YaxTLkxUAjxbfPEEo/jQsTNzzMGve3NlBAoGAbgJExpDyMDnaD2Vi5eyr +63b54BsqeLHqxJmADifyRCj7G1SJMm3zMKkNNOS0vsXgoiId973STFf1XQiojiv8 +Slbxyv5rczcY0n3LOuQYcM5OzsjzpNFZsT2dDnMfNRUF3rx3Geu/FuJ9scF1b00r +fVMrcL3jSf/W1Xh4TgtyoU8= +-----END PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem new file mode 100644 index 00000000000..44e436f6ec7 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDcTCCAlmgAwIBAgIUDUkgI+2FZtuUHyUUi0ZBH7JvN00wDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ8wDQYDVQQKDAZHb29nbGUx +GzAZBgNVBAMMEnRlc3QtczJhLW10bHMtcm9vdDAeFw0yMzA4MjEyMTI5MTVaFw00 +MzA4MjEyMTI5MTVaMEgxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEPMA0GA1UE +CgwGR29vZ2xlMRswGQYDVQQDDBJ0ZXN0LXMyYS1tdGxzLXJvb3QwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbFEQfpvla27bATedrN4BAWsI9GSwSnJLW +QWzXcnAk6cKxQBAhnaKHRxHY8ttLhNTtxQeub894CLzJvHE/0xDhuMzjtCCCZ7i2 +r08tKZ1KcEzPJCPNlxlzAXPA45XU3LRlbGvju/PBPhm6n1hCEKTNI/KETJ5DEaYg +Cf2LcXVsl/zW20MwDZ+e2w/9a2a6n6DdpW1ekOR550hXAUOIxvmXRBeYeGLFvp1n +rQgZBhRaxP03UB+PQD2oMi/4mfsS96uGCXdzzX8qV46O8m132HUbnA/wagIwboEe +d7Bx237dERDyHw5GFnll7orgA0FOtoEufXdeQxWVvTjO0+PVPgsvAgMBAAGjUzBR +MB0GA1UdDgQWBBRyMtg/yutV8hw8vOq0i8x0eBQi7DAfBgNVHSMEGDAWgBRyMtg/ +yutV8hw8vOq0i8x0eBQi7DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUA +A4IBAQArN/gdqWMxd5Rvq2eJMTp6I4RepJOT7Go4sMsRsy1caJqqcoS2EvREDZMN +XNEBcyQBB5kYd6TCcZGoLnEtWYXQ4jjEiXG1g7/+rWxyqw0ZYuP7FWzuHg3Uor/x +fApbEKwptP5ywVc+33h4qreGcqXkVCCn+sAcstGgrqubdGZW2T5gazUMyammOOuN +9IWL1PbvXmgEKD+80NUIrk09zanYyrElGdU/zw/kUbZ3Jf6WUBtJGhTzRQ1qZeKa +VnpCbLoG3vObEB8mxDUAlIzwAtfvw4U32BVIZA8xrocz6OOoAnSW1bTlo3EOIo/G +MTV7jmY9TBPtfhRuO/cG650+F+cw +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem new file mode 100644 index 00000000000..68c60613458 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbjCCAlagAwIBAgIUbexZ5sZl86Al9dsI2PkOgtqKnkgwDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ8wDQYDVQQKDAZHb29nbGUx +GzAZBgNVBAMMEnRlc3QtczJhLW10bHMtcm9vdDAeFw0yMzA4MjIwMDMyMDRaFw00 +MzA4MjIwMDMyMDRaMDkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEdMBsGA1UE +AwwUdGVzdC1zMmEtbXRscy1zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCMEzybsGPqfh92GLwy43mt8kQDF3ztr8y06RwU1hVnY7QqYK4obpvh +HkJVnTz9gwNBF3n5nUalqRzactlf2PCydN9oSYNCO8svVmo7vw1CleKAKFAiV5Qn +H76QlqD15oJreh7nSM8R4qj5KukIHvt0cN0gD6CJQzIURDtsKJwkW3yQjYyT/FAK +GYtFrB6buDn3Eg3Hsw6z7uj7CzLBsSl7BIGrQILbpbI9nFNT3rUTUhXZKY/3UtJA +Ob66AjTmMbD16RGYZR4JsPx6CstheifJ6YSI79r5KgD37zX0jMXFWimvb2SmZmFe +LoohtC8K7uTyjm/dROx6nHXdDt5TQYXHAgMBAAGjXzBdMBsGA1UdEQQUMBKHEAAA +AAAAAAAAAAAAAAAAAAAwHQYDVR0OBBYEFI3i2+tIk6YYn0MIxC0q93jk1VsUMB8G +A1UdIwQYMBaAFHIy2D/K61XyHDy86rSLzHR4FCLsMA0GCSqGSIb3DQEBCwUAA4IB +AQAUhk+s/lrIAULBbU7E22C8f93AzTxE1mhyHGNlfPPJP3t1Dl+h4X4WkFpkz5gT +EcNXB//Vvoq99HbEK5/92sxsIPexKdJBdcggeHXIgLDkOrEZEb0Nnh9eaAuU2QDn +JW44hMB+aF6mEaJvOHE6DRkQw3hwFYFisFKKHtlQ3TyOhw5CHGzSExPZusdSFNIe +2E7V/0QzGPJEFnEFUNe9N8nTH2P385Paoi+5+Iizlp/nztVXfzv0Cj/i+qGgtDUs +HB+gBU2wxMw8eYyuNzACH70wqGR1Parj8/JoyYhx0S4+Gjzy3JH3CcAMaxyfH/dI +4Wcvfz/isxgmH1UqIt3oc6ad +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem b/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem new file mode 100644 index 00000000000..b14ad0f724e --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMEzybsGPqfh92 +GLwy43mt8kQDF3ztr8y06RwU1hVnY7QqYK4obpvhHkJVnTz9gwNBF3n5nUalqRza +ctlf2PCydN9oSYNCO8svVmo7vw1CleKAKFAiV5QnH76QlqD15oJreh7nSM8R4qj5 +KukIHvt0cN0gD6CJQzIURDtsKJwkW3yQjYyT/FAKGYtFrB6buDn3Eg3Hsw6z7uj7 +CzLBsSl7BIGrQILbpbI9nFNT3rUTUhXZKY/3UtJAOb66AjTmMbD16RGYZR4JsPx6 +CstheifJ6YSI79r5KgD37zX0jMXFWimvb2SmZmFeLoohtC8K7uTyjm/dROx6nHXd +Dt5TQYXHAgMBAAECggEAIB5zGdIG/yh/Z1GBqfuOFaxFGx5iJ5BVlLAVH9P9IXFz +yPnVRXEjbinFlSMSbqEBeIX9EpcVMXxHIPIP1RIGEy2IYr3kiqXyT771ahDDZh6/ +Spqz0UQatSPqyvW3H9uE0Uc12dvQm23JSCUmPRX5m7gbhDQBIChXzdzdcU4Yi59V +4xmJUvbsAcLw5CBM6kwV+1NGVH9+3mUdhrr9M6B6+sVB/xnaqMGEDfQGiwL8U7EY +QOuc46KXu3Pd/qCdVLn60IrdjSzDJKeC5UZZ+ejNAo+DfbtOovBj3qu3OCUg4XVy +0CDBJ1sTdLvUfF4Gb+crjPsd+qBbXcjVfqdadwhsoQKBgQDBF1Pys/NitW8okJwp +2fiDIASP3TiI+MthWHGyuoZGPvmXQ3H6iuLSm8c/iYI2WPTf53Xff1VcFm1GmQms +GCsYM8Ax94zCeO6Ei1sYYxwcBloEZfOeV37MPA4pjJF4Lt+n5nveNxP+lrsjksJz +wToSEgWPDT1b/xcdt4/5j9J85wKBgQC5tiLx+33mwH4DoaFRmSl0+VuSNYFw6DTQ +SQ+kWqWGH4NENc9wf4Dj2VUZQhpXNhXVSxj+aP2d/ck1NrTJAWqYEXCDtFQOGSa2 +cGPRr+Fhy5NIEaEvR7IXcMBZzx3koYmWVBHricyrXs5FvHrT3N14mGDUG8n24U3f +R799bau0IQKBgQC97UM+lHCPJCWNggiJRgSifcje9VtZp1btjoBvq/bNe74nYkjn +htsrC91Fiu1Qpdlfr50K1IXSyaB886VG6JLjAGxI+dUzqJ38M9LLvxj0G+9JKjsi +AbAQFfZcOg8QZxLJZPVsE0MQhZTXndC06VhEVAOxvPUg214Sde8hK61/+wKBgCRw +O10VhnePT2pw/VEgZ0T/ZFtEylgYB7zSiRIrgwzVBBGPKVueePC8BPmGwdpYz2Hh +cU8B1Ll6QU+Co2hJMdwSl+wPpup5PuJPHRbYlrV0lzpt0x2OyL/WrLcyb2Ab3f40 +EqwPhqwdVwXR3JvTW1U9OMqFhVQ+kuP7lPQMX8NhAoGBAJOgZ7Tokipc4Mi68Olw +SCaOPvjjy4sW2rTRuKyjc1wTAzy7SJ3vXHfGkkN99nTLJFwAyJhWUpnRdwAXGi+x +gyOa95ImsEfRSwEjbluWfF8/P0IU8GR+ZTqT4NnNCOsi8T/xst4Szd1ECJNnnZDe +1ChfPP1AH+/75MJCvu6wQBQv +-----END PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem new file mode 100644 index 00000000000..ad1bad59845 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDITCCAgkCFBS8mLoytMpMWBwpAtnRaq3eIKnsMA0GCSqGSIb3DQEBCwUAME0x +CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UECgwEVGVzdDEiMCAGA1UE +AwwZdGVzdC1zMmEtbXRscy1zZWxmLXNpZ25lZDAeFw0yMzA4MjIyMTE2MDFaFw00 +MzA4MjIyMTE2MDFaME0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UE +CgwEVGVzdDEiMCAGA1UEAwwZdGVzdC1zMmEtbXRscy1zZWxmLXNpZ25lZDCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKFFPsYasKZeCFLEXl3RpE/ZOXFe +2lhutIalSpZvCmso+mQGoZ4cHK7At+kDjBi5CrnXkYcw7quQAhHgU0frhWdj7tsW +HUUtq7T8eaGWKBnVD9fl+MjtAl1BmhXwV9qRBbj4EesSKGDSGpKf66dOtzw83JbB +cU7XlPAH1c1zo2GXC1himcZ+SVGHVrOjn4NmeFs8g94/Dke8dWkHwv5YTMVugFK4 +5KxKgSOKkr4ka7PCBzgxCnW4wYSZNRHcxrqkiArO2HAQq0ACr7u+fVDYH//9mP2Z +ADo/zch7O5yhkiNbjXJIRrptDWEuVYMRloYDhT773h7bV/Q0Wo0NQGtasJ8CAwEA +ATANBgkqhkiG9w0BAQsFAAOCAQEAPjbH0TMyegF/MDvglkc0sXr6DqlmTxDCZZmG +lYPZ5Xy062+rxIHghMARbvO4BxepiG37KsP2agvOldm4TtU8nQ8LyswmSIFm4BQ+ +XQWwdsWyYyd8l0d5sXAdaN6AXwy50fvqCepmEqyreMY6dtLzlwo9gVCBFB7QuAPt +Nc14phpEUZt/KPNuY6cUlB7bz3tmnFbwxUrWj1p0KBEYsr7+KEVZxR+z0wtlU7S9 +ZBrmUvx0fq5Ef7JWtHW0w4ofg1op742sdYl+53C26GZ76ts4MmqVz2/94DScgRaU +gT0GLVuuCZXRDVeTXqTb4mditRCfzFPe9cCegYhGhSqBs8yh5A== +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem b/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem new file mode 100644 index 00000000000..bcf08e4f12f --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQChRT7GGrCmXghS +xF5d0aRP2TlxXtpYbrSGpUqWbwprKPpkBqGeHByuwLfpA4wYuQq515GHMO6rkAIR +4FNH64VnY+7bFh1FLau0/HmhligZ1Q/X5fjI7QJdQZoV8FfakQW4+BHrEihg0hqS +n+unTrc8PNyWwXFO15TwB9XNc6NhlwtYYpnGfklRh1azo5+DZnhbPIPePw5HvHVp +B8L+WEzFboBSuOSsSoEjipK+JGuzwgc4MQp1uMGEmTUR3Ma6pIgKzthwEKtAAq+7 +vn1Q2B///Zj9mQA6P83IezucoZIjW41ySEa6bQ1hLlWDEZaGA4U++94e21f0NFqN +DUBrWrCfAgMBAAECggEAR8e8YwyqJ8KezcgdgIC5M9kp2i4v3UCZFX0or8CI0J2S +pUbWVLuKgLXCpfIwPyjNf15Vpei/spkMcsx4BQDthdFTFSzIpmvni0z9DlD5VFYj +ESOJElV7wepbHPy2/c+izmuL/ic81aturGiFyRgeMq+cN3WuaztFTXkPTrzzsZGF +p/Mx3gqm7Hoc3d2xlv+8L5GjCtEJPlQgZJV+s3ennBjOAd8CC7d9qJetE3Er46pn +r5jedV3bQRZYBzmooYNHjbAs26++wYac/jTE0/U6nKS17eWq4BQZUtlMXUw5N81B +7LKn7C03rj2KCn+Nf5uin9ALmoy888LXCDdvL/NZkQKBgQDduv1Heu+tOZuNYUdQ +Hswmd8sVNAAWGZxdxixHMv58zrgbLFXSX6K89X2l5Sj9XON8TH46MuSFdjSwwWw5 +fBrhVEhA5srcqpvVWIBE05yqPpt0s1NQktMWJKELWlG8jOhVKwM5OYDpdxtwehpz +1g70XJz+nF/LTV8RdTK+OWDDpQKBgQC6MhdbGHUz/56dY3gZpE5TXnN2hkNbZCgk +emr6z85VHhQflZbedhCzB9PUnZnCKWOGQHQdxRTtRfd46LVboZqCdYO1ZNQv6toP +ysS7dTpZZFy7CpQaW0Y6/jS65jW6xIDKR1W40vgltZ3sfpG37JaowpzWdw2WuOnw +Bg0rcJAf8wKBgQCqE+p/z97UwuF8eufWnyj9QNo382E1koOMspv4KTdnyLETtthF +vDH6O1wbykG8xmmASLRyM+NyNA+KnXNETNvZh2q8zctBpGRQK8iIAsGjHM7ln0AD +B/x+ea5GJQuZU4RK/+lDFca6TjBwAFkWDVX/PqL18kDQkxKfM4SuwRhmOQKBgDGh +eoJIsa0LnP787Z2AI3Srf4F/ZmLs/ppCm1OBotEjdF+64v0nYWonUvqgi8SqfaHi +elEZIGvis4ViGj1zhRjzNAlc+AZRxpBhDzGcnNIJI4Kj3jhsTfsZmXqcNIQ1LtM8 +Uogyi/yZPaA1WKg7Aym2vlGYaGHdplXZdxc2KOSrAoGABRkD9l2OVcwK7RyNgFxo +mjxx0tfUdDBhHIi2igih1FiHpeP9E+4/kE/K7PnU9DoDrL1jW1MTpXaYV4seOylk +k9z/9QfcRa9ePD2N4FqbHWSYp5n3aLoIcGq/9jyjTwayZbbIhWO+vNuHE9wIvecZ +8x3gNkxJRb4NaLIoNzAhCoo= +-----END PRIVATE KEY----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/server_cert.pem b/upstream/vendor/github.com/google/s2a-go/testdata/server_cert.pem new file mode 100644 index 00000000000..0f98322c724 --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/server_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL +BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 +YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE +AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN +MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx +ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ +KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT +fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ +qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE +xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es +Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 +Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM +ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR +e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X +POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl +AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg +odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ +PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN +Dhm6uZM= +-----END CERTIFICATE----- diff --git a/upstream/vendor/github.com/google/s2a-go/testdata/server_key.pem b/upstream/vendor/github.com/google/s2a-go/testdata/server_key.pem new file mode 100644 index 00000000000..81afea783df --- /dev/null +++ b/upstream/vendor/github.com/google/s2a-go/testdata/server_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs +8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO +QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk +XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA +Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc +gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf +LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl +jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 +4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q +Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P +nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 +drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE +duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 +L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG +06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm +eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD +uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 +lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL +a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb +hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ +7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j +r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 +eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD +B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz +7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== +-----END RSA PRIVATE KEY----- diff --git a/upstream/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json b/upstream/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json index d51736e7e36..feb372228b4 100644 --- a/upstream/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json +++ b/upstream/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json @@ -1,3 +1,3 @@ { - "v2": "2.12.4" + "v2": "2.12.3" } diff --git a/upstream/vendor/github.com/googleapis/gax-go/v2/CHANGES.md b/upstream/vendor/github.com/googleapis/gax-go/v2/CHANGES.md index 7e36eb48ff8..0d019d97fd3 100644 --- a/upstream/vendor/github.com/googleapis/gax-go/v2/CHANGES.md +++ b/upstream/vendor/github.com/googleapis/gax-go/v2/CHANGES.md @@ -1,12 +1,5 @@ # Changelog -## [2.12.4](https://github.com/googleapis/gax-go/compare/v2.12.3...v2.12.4) (2024-05-03) - - -### Bug Fixes - -* provide unmarshal options for streams ([#343](https://github.com/googleapis/gax-go/issues/343)) ([ddf9a90](https://github.com/googleapis/gax-go/commit/ddf9a90bf180295d49875e15cb80b2136a49dbaf)) - ## [2.12.3](https://github.com/googleapis/gax-go/compare/v2.12.2...v2.12.3) (2024-03-14) diff --git a/upstream/vendor/github.com/googleapis/gax-go/v2/internal/version.go b/upstream/vendor/github.com/googleapis/gax-go/v2/internal/version.go index 3006ad7bd91..90348f303df 100644 --- a/upstream/vendor/github.com/googleapis/gax-go/v2/internal/version.go +++ b/upstream/vendor/github.com/googleapis/gax-go/v2/internal/version.go @@ -30,4 +30,4 @@ package internal // Version is the current tagged release of the library. -const Version = "2.12.4" +const Version = "2.12.3" diff --git a/upstream/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go b/upstream/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go index 9b690d40c46..cc4486eb9e5 100644 --- a/upstream/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go +++ b/upstream/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go @@ -111,8 +111,7 @@ func (s *ProtoJSONStream) Recv() (proto.Message, error) { // Initialize a new instance of the protobuf message to unmarshal the // raw data into. m := s.typ.New().Interface() - unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} - err := unm.Unmarshal(raw, m) + err := protojson.Unmarshal(raw, m) return m, err } diff --git a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go index 5dd4e447862..31553e7848a 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go +++ b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go @@ -148,12 +148,6 @@ 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" { @@ -187,17 +181,18 @@ 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 { - xff = append(xff, remoteIP) + 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)) + } } } - 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/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go index 5682998699a..230cac7b86c 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go +++ b/upstream/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.Warningf("Unknown gRPC error code: %v", code) + grpclog.Infof("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.Errorf("Failed to marshal error message %q: %v", s, merr) + grpclog.Infof("Failed to marshal error message %q: %v", s, merr) w.WriteHeader(http.StatusInternalServerError) if _, err := io.WriteString(w, fallback); err != nil { - grpclog.Errorf("Failed to write response: %v", err) + grpclog.Infof("Failed to write response: %v", err) } return } md, ok := ServerMetadataFromContext(ctx) if !ok { - grpclog.Error("Failed to extract ServerMetadata from context") + grpclog.Infof("Failed to extract ServerMetadata from context") } handleForwardResponseServerMetadata(w, mux, md) @@ -148,7 +148,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh w.WriteHeader(st) if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to write response: %v", err) + grpclog.Infof("Failed to write response: %v", err) } if doForwardTrailers { diff --git a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go index de1eef1f4f8..5e14cf8b0e2 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go @@ -6,7 +6,6 @@ import ( "io" "net/http" "net/textproto" - "strconv" "strings" "google.golang.org/genproto/googleapis/api/httpbody" @@ -18,10 +17,16 @@ 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) { - rc := http.NewResponseController(w) + 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 + } + md, ok := ServerMetadataFromContext(ctx) if !ok { - grpclog.Error("Failed to extract ServerMetadata from context") + grpclog.Infof("Failed to extract ServerMetadata from context") http.Error(w, "unexpected error", http.StatusInternalServerError) return } @@ -76,29 +81,20 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal } if err != nil { - grpclog.Errorf("Failed to marshal response chunk: %v", err) + grpclog.Infof("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.Errorf("Failed to send response chunk: %v", err) + grpclog.Infof("Failed to send response chunk: %v", err) return } wroteHeader = true if _, err := w.Write(delimiter); err != nil { - 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) + grpclog.Infof("Failed to send delimiter chunk: %v", err) return } + f.Flush() } } @@ -140,7 +136,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.Error("Failed to extract ServerMetadata from context") + grpclog.Infof("Failed to extract ServerMetadata from context") } handleForwardResponseServerMetadata(w, mux, md) @@ -172,17 +168,13 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha buf, err = marshaler.Marshal(resp) } if err != nil { - grpclog.Errorf("Marshal error: %v", err) + grpclog.Infof("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.Errorf("Failed to write response: %v", err) + grpclog.Infof("Failed to write response: %v", err) } if doForwardTrailers { @@ -201,7 +193,7 @@ func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, re } for _, opt := range opts { if err := opt(ctx, w, resp); err != nil { - grpclog.Errorf("Error handling ForwardResponseOptions: %v", err) + grpclog.Infof("Error handling ForwardResponseOptions: %v", err) return err } } @@ -217,15 +209,15 @@ func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, mar } buf, err := marshaler.Marshal(msg) if err != nil { - grpclog.Errorf("Failed to marshal an error: %v", err) + grpclog.Infof("Failed to marshal an error: %v", err) return } if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to notify error to client: %v", err) + grpclog.Infof("Failed to notify error to client: %v", err) return } if _, err := w.Write(delimiter); err != nil { - grpclog.Errorf("Failed to send delimiter chunk: %v", err) + grpclog.Infof("Failed to send delimiter chunk: %v", err) return } } diff --git a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go index fe52081ab94..d6aa8257836 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go +++ b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go @@ -24,11 +24,6 @@ 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/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go index 8376d1e0efd..51b8247da2a 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go +++ b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go @@ -30,6 +30,10 @@ 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 @@ -44,17 +48,9 @@ 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 @@ -154,6 +150,9 @@ 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/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go index 0b051e6e894..a714de02406 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go +++ b/upstream/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.Errorf("Failed to parse Content-Type %s: %v", contentTypeVal, err) + grpclog.Infof("Failed to parse Content-Type %s: %v", contentTypeVal, err) continue } if m, ok := mux.marshalers.mimeMap[contentType]; ok { diff --git a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go b/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go index e54507145b6..8f90d15a562 100644 --- a/upstream/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go +++ b/upstream/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.Errorf("unsupported version: %d", version) + grpclog.Infof("unsupported version: %d", version) return Pattern{}, ErrInvalidPattern } l := len(ops) if l%2 != 0 { - grpclog.Errorf("odd number of ops codes: %d", l) + grpclog.Infof("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.Error("pushM appears twice") + grpclog.Infof("pushM appears twice") return Pattern{}, ErrInvalidPattern } pushMSeen = true stack++ case utilities.OpLitPush: if op.operand < 0 || len(pool) <= op.operand { - grpclog.Errorf("negative literal index: %d", op.operand) + grpclog.Infof("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.Errorf("negative concat size: %d", op.operand) + grpclog.Infof("negative concat size: %d", op.operand) return Pattern{}, ErrInvalidPattern } stack -= op.operand if stack < 0 { - grpclog.Error("stack underflow") + grpclog.Info("stack underflow") return Pattern{}, ErrInvalidPattern } stack++ case utilities.OpCapture: if op.operand < 0 || len(pool) <= op.operand { - grpclog.Errorf("variable name index out of bound: %d", op.operand) + grpclog.Infof("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.Error("stack underflow") + grpclog.Infof("stack underflow") return Pattern{}, ErrInvalidPattern } default: - grpclog.Errorf("invalid opcode: %d", op.code) + grpclog.Infof("invalid opcode: %d", op.code) return Pattern{}, ErrInvalidPattern } diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/.go-version b/upstream/vendor/github.com/hashicorp/go-retryablehttp/.go-version deleted file mode 100644 index 6fee2fedb0a..00000000000 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.22.2 diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/upstream/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md deleted file mode 100644 index 68a627c6d97..00000000000 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -## 0.7.7 (May 30, 2024) - -BUG FIXES: - -- client: avoid potentially leaking URL-embedded basic authentication credentials in logs (#158) - -## 0.7.6 (May 9, 2024) - -ENHANCEMENTS: - -- client: support a `RetryPrepare` function for modifying the request before retrying (#216) -- client: support HTTP-date values for `Retry-After` header value (#138) -- client: avoid reading entire body when the body is a `*bytes.Reader` (#197) - -BUG FIXES: - -- client: fix a broken check for invalid server certificate in go 1.20+ (#210) - -## 0.7.5 (Nov 8, 2023) - -BUG FIXES: - -- client: fixes an issue where the request body is not preserved on temporary redirects or re-established HTTP/2 connections (#207) - -## 0.7.4 (Jun 6, 2023) - -BUG FIXES: - -- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 (#194) - -## 0.7.3 (May 15, 2023) - -Initial release diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/upstream/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS deleted file mode 100644 index d6dd78a2dd9..00000000000 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @hashicorp/go-retryablehttp-maintainers diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/LICENSE b/upstream/vendor/github.com/hashicorp/go-retryablehttp/LICENSE index f4f97ee5853..e87a115e462 100644 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/LICENSE +++ b/upstream/vendor/github.com/hashicorp/go-retryablehttp/LICENSE @@ -1,5 +1,3 @@ -Copyright (c) 2015 HashiCorp, Inc. - Mozilla Public License, version 2.0 1. Definitions diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/Makefile b/upstream/vendor/github.com/hashicorp/go-retryablehttp/Makefile index 5255241961e..da17640e644 100644 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/Makefile +++ b/upstream/vendor/github.com/hashicorp/go-retryablehttp/Makefile @@ -2,7 +2,7 @@ default: test test: go vet ./... - go test -v -race ./... + go test -race ./... updatedeps: go get -f -t -u ./... diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/README.md b/upstream/vendor/github.com/hashicorp/go-retryablehttp/README.md index 145a62f218c..8943becf19b 100644 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/README.md +++ b/upstream/vendor/github.com/hashicorp/go-retryablehttp/README.md @@ -59,4 +59,4 @@ standardClient := retryClient.StandardClient() // *http.Client ``` For more usage and examples see the -[pkg.go.dev](https://pkg.go.dev/github.com/hashicorp/go-retryablehttp). +[godoc](http://godoc.org/github.com/hashicorp/go-retryablehttp). diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go b/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go deleted file mode 100644 index b2b27e87225..00000000000 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -//go:build !go1.20 -// +build !go1.20 - -package retryablehttp - -import "crypto/x509" - -func isCertError(err error) bool { - _, ok := err.(x509.UnknownAuthorityError) - return ok -} diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go b/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go deleted file mode 100644 index a3cd315a28b..00000000000 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -//go:build go1.20 -// +build go1.20 - -package retryablehttp - -import "crypto/tls" - -func isCertError(err error) bool { - _, ok := err.(*tls.CertificateVerificationError) - return ok -} diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/client.go b/upstream/vendor/github.com/hashicorp/go-retryablehttp/client.go index efee53c400d..f40d2411cf1 100644 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/upstream/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -1,6 +1,3 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - // Package retryablehttp provides a familiar HTTP client interface with // automatic retries and exponential backoff. It is a thin wrapper over the // standard net/http client library and exposes nearly the same public API. @@ -27,8 +24,10 @@ package retryablehttp import ( "bytes" "context" + "crypto/x509" "fmt" "io" + "io/ioutil" "log" "math" "math/rand" @@ -61,10 +60,6 @@ var ( // limit the size we consume to respReadLimit. respReadLimit = int64(4096) - // timeNow sets the function that returns the current time. - // This defaults to time.Now. Changes to this should only be done in tests. - timeNow = time.Now - // A regular expression to match the error returned by net/http when the // configured number of redirects is exhausted. This error isn't typed // specifically so we resort to matching on the error string. @@ -75,11 +70,6 @@ var ( // specifically so we resort to matching on the error string. schemeErrorRe = regexp.MustCompile(`unsupported protocol scheme`) - // A regular expression to match the error returned by net/http when a - // request header or value is invalid. This error isn't typed - // specifically so we resort to matching on the error string. - invalidHeaderErrorRe = regexp.MustCompile(`invalid header`) - // A regular expression to match the error returned by net/http when the // TLS certificate is not trusted. This error isn't typed // specifically so we resort to matching on the error string. @@ -167,20 +157,6 @@ func (r *Request) SetBody(rawBody interface{}) error { } r.body = bodyReader r.ContentLength = contentLength - if bodyReader != nil { - r.GetBody = func() (io.ReadCloser, error) { - body, err := bodyReader() - if err != nil { - return nil, err - } - if rc, ok := body.(io.ReadCloser); ok { - return rc, nil - } - return io.NopCloser(body), nil - } - } else { - r.GetBody = func() (io.ReadCloser, error) { return http.NoBody, nil } - } return nil } @@ -255,19 +231,21 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro // deal with it seeking so want it to match here instead of the // io.ReadSeeker case. case *bytes.Reader: - snapshot := *body + buf, err := ioutil.ReadAll(body) + if err != nil { + return nil, 0, err + } bodyReader = func() (io.Reader, error) { - r := snapshot - return &r, nil + return bytes.NewReader(buf), nil } - contentLength = int64(body.Len()) + contentLength = int64(len(buf)) // Compat case case io.ReadSeeker: raw := body bodyReader = func() (io.Reader, error) { _, err := raw.Seek(0, 0) - return io.NopCloser(raw), err + return ioutil.NopCloser(raw), err } if lr, ok := raw.(LenReader); ok { contentLength = int64(lr.Len()) @@ -275,21 +253,14 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro // Read all in so we can reset case io.Reader: - buf, err := io.ReadAll(body) + buf, err := ioutil.ReadAll(body) if err != nil { return nil, 0, err } - if len(buf) == 0 { - bodyReader = func() (io.Reader, error) { - return http.NoBody, nil - } - contentLength = 0 - } else { - bodyReader = func() (io.Reader, error) { - return bytes.NewReader(buf), nil - } - contentLength = int64(len(buf)) + bodyReader = func() (io.Reader, error) { + return bytes.NewReader(buf), nil } + contentLength = int64(len(buf)) // No body provided, nothing to do case nil: @@ -321,19 +292,18 @@ func NewRequest(method, url string, rawBody interface{}) (*Request, error) { // The context controls the entire lifetime of a request and its response: // obtaining a connection, sending the request, and reading the response headers and body. func NewRequestWithContext(ctx context.Context, method, url string, rawBody interface{}) (*Request, error) { - httpReq, err := http.NewRequestWithContext(ctx, method, url, nil) + bodyReader, contentLength, err := getBodyReaderAndContentLength(rawBody) if err != nil { return nil, err } - req := &Request{ - Request: httpReq, - } - if err := req.SetBody(rawBody); err != nil { + httpReq, err := http.NewRequestWithContext(ctx, method, url, nil) + if err != nil { return nil, err } + httpReq.ContentLength = contentLength - return req, nil + return &Request{body: bodyReader, Request: httpReq}, nil } // Logger interface allows to use other loggers than @@ -398,9 +368,6 @@ type Backoff func(min, max time.Duration, attemptNum int, resp *http.Response) t // attempted. If overriding this, be sure to close the body if needed. type ErrorHandler func(resp *http.Response, err error, numTries int) (*http.Response, error) -// PrepareRetry is called before retry operation. It can be used for example to re-sign the request -type PrepareRetry func(req *http.Request) error - // Client is used to make HTTP requests. It adds additional functionality // like automatic retries to tolerate minor outages. type Client struct { @@ -429,9 +396,6 @@ type Client struct { // ErrorHandler specifies the custom error handler to use, if any ErrorHandler ErrorHandler - // PrepareRetry can prepare the request for retry operation, for example re-sign it - PrepareRetry PrepareRetry - loggerInit sync.Once clientInit sync.Once } @@ -505,16 +469,11 @@ func baseRetryPolicy(resp *http.Response, err error) (bool, error) { return false, v } - // Don't retry if the error was due to an invalid header. - if invalidHeaderErrorRe.MatchString(v.Error()) { - return false, v - } - // Don't retry if the error was due to TLS cert verification failure. if notTrustedErrorRe.MatchString(v.Error()) { return false, v } - if isCertError(v.Err) { + if _, ok := v.Err.(x509.UnknownAuthorityError); ok { return false, v } } @@ -551,8 +510,10 @@ func baseRetryPolicy(resp *http.Response, err error) (bool, error) { func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration { if resp != nil { if resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode == http.StatusServiceUnavailable { - if sleep, ok := parseRetryAfterHeader(resp.Header["Retry-After"]); ok { - return sleep + if s, ok := resp.Header["Retry-After"]; ok { + if sleep, err := strconv.ParseInt(s[0], 10, 64); err == nil { + return time.Second * time.Duration(sleep) + } } } } @@ -565,41 +526,6 @@ func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response) return sleep } -// parseRetryAfterHeader parses the Retry-After header and returns the -// delay duration according to the spec: https://httpwg.org/specs/rfc7231.html#header.retry-after -// The bool returned will be true if the header was successfully parsed. -// Otherwise, the header was either not present, or was not parseable according to the spec. -// -// Retry-After headers come in two flavors: Seconds or HTTP-Date -// -// Examples: -// * Retry-After: Fri, 31 Dec 1999 23:59:59 GMT -// * Retry-After: 120 -func parseRetryAfterHeader(headers []string) (time.Duration, bool) { - if len(headers) == 0 || headers[0] == "" { - return 0, false - } - header := headers[0] - // Retry-After: 120 - if sleep, err := strconv.ParseInt(header, 10, 64); err == nil { - if sleep < 0 { // a negative sleep doesn't make sense - return 0, false - } - return time.Second * time.Duration(sleep), true - } - - // Retry-After: Fri, 31 Dec 1999 23:59:59 GMT - retryTime, err := time.Parse(time.RFC1123, header) - if err != nil { - return 0, false - } - if until := retryTime.Sub(timeNow()); until > 0 { - return until, true - } - // date is in the past - return 0, true -} - // LinearJitterBackoff provides a callback for Client.Backoff which will // perform linear backoff based on the attempt number and with jitter to // prevent a thundering herd. @@ -627,13 +553,13 @@ func LinearJitterBackoff(min, max time.Duration, attemptNum int, resp *http.Resp } // Seed rand; doing this every time is fine - source := rand.New(rand.NewSource(int64(time.Now().Nanosecond()))) + rand := rand.New(rand.NewSource(int64(time.Now().Nanosecond()))) // Pick a random number that lies somewhere between the min and max and // multiply by the attemptNum. attemptNum starts at zero so we always // increment here. We first get a random percentage, then apply that to the // difference between min and max, and add to min. - jitter := source.Float64() * float64(max-min) + jitter := rand.Float64() * float64(max-min) jitterMin := int64(jitter) + int64(min) return time.Duration(jitterMin * int64(attemptNum)) } @@ -658,19 +584,19 @@ func (c *Client) Do(req *Request) (*http.Response, error) { if logger != nil { switch v := logger.(type) { case LeveledLogger: - v.Debug("performing request", "method", req.Method, "url", redactURL(req.URL)) + v.Debug("performing request", "method", req.Method, "url", req.URL) case Logger: - v.Printf("[DEBUG] %s %s", req.Method, redactURL(req.URL)) + v.Printf("[DEBUG] %s %s", req.Method, req.URL) } } var resp *http.Response var attempt int var shouldRetry bool - var doErr, respErr, checkErr, prepareErr error + var doErr, respErr, checkErr error for i := 0; ; i++ { - doErr, respErr, prepareErr = nil, nil, nil + doErr, respErr = nil, nil attempt++ // Always rewind the request body when non-nil. @@ -683,7 +609,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) { if c, ok := body.(io.ReadCloser); ok { req.Body = c } else { - req.Body = io.NopCloser(body) + req.Body = ioutil.NopCloser(body) } } @@ -715,9 +641,9 @@ func (c *Client) Do(req *Request) (*http.Response, error) { if err != nil { switch v := logger.(type) { case LeveledLogger: - v.Error("request failed", "error", err, "method", req.Method, "url", redactURL(req.URL)) + v.Error("request failed", "error", err, "method", req.Method, "url", req.URL) case Logger: - v.Printf("[ERR] %s %s request failed: %v", req.Method, redactURL(req.URL), err) + v.Printf("[ERR] %s %s request failed: %v", req.Method, req.URL, err) } } else { // Call this here to maintain the behavior of logging all requests, @@ -753,7 +679,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) { wait := c.Backoff(c.RetryWaitMin, c.RetryWaitMax, i, resp) if logger != nil { - desc := fmt.Sprintf("%s %s", req.Method, redactURL(req.URL)) + desc := fmt.Sprintf("%s %s", req.Method, req.URL) if resp != nil { desc = fmt.Sprintf("%s (status: %d)", desc, resp.StatusCode) } @@ -777,26 +703,17 @@ func (c *Client) Do(req *Request) (*http.Response, error) { // without racing against the closeBody call in persistConn.writeLoop. httpreq := *req.Request req.Request = &httpreq - - if c.PrepareRetry != nil { - if err := c.PrepareRetry(req.Request); err != nil { - prepareErr = err - break - } - } } // this is the closest we have to success criteria - if doErr == nil && respErr == nil && checkErr == nil && prepareErr == nil && !shouldRetry { + if doErr == nil && respErr == nil && checkErr == nil && !shouldRetry { return resp, nil } defer c.HTTPClient.CloseIdleConnections() var err error - if prepareErr != nil { - err = prepareErr - } else if checkErr != nil { + if checkErr != nil { err = checkErr } else if respErr != nil { err = respErr @@ -818,17 +735,17 @@ func (c *Client) Do(req *Request) (*http.Response, error) { // communicate why if err == nil { return nil, fmt.Errorf("%s %s giving up after %d attempt(s)", - req.Method, redactURL(req.URL), attempt) + req.Method, req.URL, attempt) } return nil, fmt.Errorf("%s %s giving up after %d attempt(s): %w", - req.Method, redactURL(req.URL), attempt, err) + req.Method, req.URL, attempt, err) } // Try to read the response body so we can reuse this connection. func (c *Client) drainBody(body io.ReadCloser) { defer body.Close() - _, err := io.Copy(io.Discard, io.LimitReader(body, respReadLimit)) + _, err := io.Copy(ioutil.Discard, io.LimitReader(body, respReadLimit)) if err != nil { if c.logger() != nil { switch v := c.logger().(type) { @@ -903,17 +820,3 @@ func (c *Client) StandardClient() *http.Client { Transport: &RoundTripper{Client: c}, } } - -// Taken from url.URL#Redacted() which was introduced in go 1.15. -// We can switch to using it directly if we'll bump the minimum required go version. -func redactURL(u *url.URL) string { - if u == nil { - return "" - } - - ru := *u - if _, has := ru.User.Password(); has { - ru.User = url.UserPassword(ru.User.Username(), "xxxxx") - } - return ru.String() -} diff --git a/upstream/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go b/upstream/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go index 8c407adb3b4..8f3ee358427 100644 --- a/upstream/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go +++ b/upstream/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go @@ -1,6 +1,3 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - package retryablehttp import ( diff --git a/upstream/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/upstream/vendor/github.com/hashicorp/go-version/CHANGELOG.md index 6d48174bfbe..5f16dd140c3 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/CHANGELOG.md +++ b/upstream/vendor/github.com/hashicorp/go-version/CHANGELOG.md @@ -1,22 +1,3 @@ -# 1.7.0 (May 24, 2024) - -ENHANCEMENTS: - -- Remove `reflect` dependency ([#91](https://github.com/hashicorp/go-version/pull/91)) -- Implement the `database/sql.Scanner` and `database/sql/driver.Value` interfaces for `Version` ([#133](https://github.com/hashicorp/go-version/pull/133)) - -INTERNAL: - -- [COMPLIANCE] Add Copyright and License Headers ([#115](https://github.com/hashicorp/go-version/pull/115)) -- [COMPLIANCE] Update MPL-2.0 LICENSE ([#105](https://github.com/hashicorp/go-version/pull/105)) -- Bump actions/cache from 3.0.11 to 3.2.5 ([#116](https://github.com/hashicorp/go-version/pull/116)) -- Bump actions/checkout from 3.2.0 to 3.3.0 ([#111](https://github.com/hashicorp/go-version/pull/111)) -- Bump actions/upload-artifact from 3.1.1 to 3.1.2 ([#112](https://github.com/hashicorp/go-version/pull/112)) -- GHA Migration ([#103](https://github.com/hashicorp/go-version/pull/103)) -- github: Pin external GitHub Actions to hashes ([#107](https://github.com/hashicorp/go-version/pull/107)) -- SEC-090: Automated trusted workflow pinning (2023-04-05) ([#124](https://github.com/hashicorp/go-version/pull/124)) -- update readme ([#104](https://github.com/hashicorp/go-version/pull/104)) - # 1.6.0 (June 28, 2022) FEATURES: diff --git a/upstream/vendor/github.com/hashicorp/go-version/LICENSE b/upstream/vendor/github.com/hashicorp/go-version/LICENSE index 1409d6ab92f..c33dcc7c928 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/LICENSE +++ b/upstream/vendor/github.com/hashicorp/go-version/LICENSE @@ -1,5 +1,3 @@ -Copyright (c) 2014 HashiCorp, Inc. - Mozilla Public License, version 2.0 1. Definitions diff --git a/upstream/vendor/github.com/hashicorp/go-version/README.md b/upstream/vendor/github.com/hashicorp/go-version/README.md index 4b7806cd964..4d250509033 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/README.md +++ b/upstream/vendor/github.com/hashicorp/go-version/README.md @@ -1,5 +1,5 @@ # Versioning Library for Go -![Build Status](https://github.com/hashicorp/go-version/actions/workflows/go-tests.yml/badge.svg) +[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/main) [![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) go-version is a library for parsing versions and version constraints, diff --git a/upstream/vendor/github.com/hashicorp/go-version/constraint.go b/upstream/vendor/github.com/hashicorp/go-version/constraint.go index 29bdc4d2b5d..da5d1aca148 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/constraint.go +++ b/upstream/vendor/github.com/hashicorp/go-version/constraint.go @@ -1,10 +1,8 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - package version import ( "fmt" + "reflect" "regexp" "sort" "strings" @@ -201,7 +199,7 @@ func prereleaseCheck(v, c *Version) bool { case cPre && vPre: // A constraint with a pre-release can only match a pre-release version // with the same base segments. - return v.equalSegments(c) + return reflect.DeepEqual(c.Segments64(), v.Segments64()) case !cPre && vPre: // A constraint without a pre-release can only match a version without a diff --git a/upstream/vendor/github.com/hashicorp/go-version/version.go b/upstream/vendor/github.com/hashicorp/go-version/version.go index 7c683c2813a..e87df69906d 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/version.go +++ b/upstream/vendor/github.com/hashicorp/go-version/version.go @@ -1,12 +1,9 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - package version import ( "bytes" - "database/sql/driver" "fmt" + "reflect" "regexp" "strconv" "strings" @@ -120,8 +117,11 @@ func (v *Version) Compare(other *Version) int { return 0 } + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() + // If the segments are the same, we must compare on prerelease info - if v.equalSegments(other) { + if reflect.DeepEqual(segmentsSelf, segmentsOther) { preSelf := v.Prerelease() preOther := other.Prerelease() if preSelf == "" && preOther == "" { @@ -137,8 +137,6 @@ func (v *Version) Compare(other *Version) int { return comparePrereleases(preSelf, preOther) } - segmentsSelf := v.Segments64() - segmentsOther := other.Segments64() // Get the highest specificity (hS), or if they're equal, just use segmentSelf length lenSelf := len(segmentsSelf) lenOther := len(segmentsOther) @@ -162,7 +160,7 @@ func (v *Version) Compare(other *Version) int { // this means Other had the lower specificity // Check to see if the remaining segments in Self are all zeros - if !allZero(segmentsSelf[i:]) { - // if not, it means that Self has to be greater than Other + //if not, it means that Self has to be greater than Other return 1 } break @@ -182,21 +180,6 @@ func (v *Version) Compare(other *Version) int { return 0 } -func (v *Version) equalSegments(other *Version) bool { - segmentsSelf := v.Segments64() - segmentsOther := other.Segments64() - - if len(segmentsSelf) != len(segmentsOther) { - return false - } - for i, v := range segmentsSelf { - if v != segmentsOther[i] { - return false - } - } - return true -} - func allZero(segs []int64) bool { for _, s := range segs { if s != 0 { @@ -422,20 +405,3 @@ func (v *Version) UnmarshalText(b []byte) error { func (v *Version) MarshalText() ([]byte, error) { return []byte(v.String()), nil } - -// Scan implements the sql.Scanner interface. -func (v *Version) Scan(src interface{}) error { - switch src := src.(type) { - case string: - return v.UnmarshalText([]byte(src)) - case nil: - return nil - default: - return fmt.Errorf("cannot scan %T as Version", src) - } -} - -// Value implements the driver.Valuer interface. -func (v *Version) Value() (driver.Value, error) { - return v.String(), nil -} diff --git a/upstream/vendor/github.com/hashicorp/go-version/version_collection.go b/upstream/vendor/github.com/hashicorp/go-version/version_collection.go index 83547fe13d6..cc888d43e6b 100644 --- a/upstream/vendor/github.com/hashicorp/go-version/version_collection.go +++ b/upstream/vendor/github.com/hashicorp/go-version/version_collection.go @@ -1,6 +1,3 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - package version // Collection is a type that implements the sort.Interface interface diff --git a/upstream/vendor/github.com/hashicorp/vault/api/lifetime_watcher.go b/upstream/vendor/github.com/hashicorp/vault/api/lifetime_watcher.go index 4bc1390b93a..5c060e5a150 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/lifetime_watcher.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/lifetime_watcher.go @@ -6,7 +6,6 @@ package api import ( "errors" "math/rand" - "strings" "sync" "time" @@ -32,7 +31,6 @@ var ( DefaultRenewerRenewBuffer = 5 ) -//go:generate enumer -type=RenewBehavior -trimprefix=RenewBehavior type RenewBehavior uint const ( @@ -290,18 +288,12 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool, switch { case nonRenewable || r.renewBehavior == RenewBehaviorRenewDisabled: // Can't or won't renew, just keep the same expiration so we exit - // when it's re-authentication time + // when it's reauthentication time remainingLeaseDuration = fallbackLeaseDuration default: // Renew the token renewal, err = renew(credString, r.increment) - if err != nil && strings.Contains(err.Error(), "permission denied") { - // We can't renew since the token doesn't have permission to. Fall back - // to the code path for non-renewable tokens. - nonRenewable = true - continue - } if err != nil || renewal == nil || (tokenMode && renewal.Auth == nil) { if r.renewBehavior == RenewBehaviorErrorOnErrors { if err != nil { @@ -357,11 +349,8 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool, if errorBackoff == nil { sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration) - } else { - sleepDuration = errorBackoff.NextBackOff() - if sleepDuration == backoff.Stop { - return err - } + } else if errorBackoff.NextBackOff() == backoff.Stop { + return err } // remainingLeaseDuration becomes the priorDuration for the next loop diff --git a/upstream/vendor/github.com/hashicorp/vault/api/plugin_helpers.go b/upstream/vendor/github.com/hashicorp/vault/api/plugin_helpers.go index d330478f5bf..5d2593668b4 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/plugin_helpers.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/plugin_helpers.go @@ -13,8 +13,7 @@ import ( "net/url" "os" - jose "github.com/go-jose/go-jose/v4" - "github.com/go-jose/go-jose/v4/jwt" + "github.com/go-jose/go-jose/v3/jwt" "github.com/hashicorp/errwrap" ) @@ -41,11 +40,6 @@ const ( // PluginUnwrapTokenEnv is the ENV name used to pass unwrap tokens to the // plugin. PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN" - - // CubbyHoleJWTSignatureAlgorithm is the signature algorithm used for - // the unwrap token that Vault passes to a plugin when auto-mTLS is - // not enabled. - CubbyHoleJWTSignatureAlgorithm = jose.ES512 ) // PluginAPIClientMeta is a helper that plugins can use to configure TLS connections @@ -108,7 +102,7 @@ func VaultPluginTLSProviderContext(ctx context.Context, apiTLSConfig *TLSConfig) return func() (*tls.Config, error) { unwrapToken := os.Getenv(PluginUnwrapTokenEnv) - parsedJWT, err := jwt.ParseSigned(unwrapToken, []jose.SignatureAlgorithm{CubbyHoleJWTSignatureAlgorithm}) + parsedJWT, err := jwt.ParseSigned(unwrapToken) if err != nil { return nil, errwrap.Wrapf("error parsing wrapping token: {{err}}", err) } diff --git a/upstream/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go b/upstream/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go index 2514f1279db..d3acd0d002c 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go @@ -9,9 +9,11 @@ package api import "fmt" -var PluginRuntimeTypes = _PluginRuntimeTypeValues +var PluginRuntimeTypes = []PluginRuntimeType{ + PluginRuntimeTypeUnsupported, + PluginRuntimeTypeContainer, +} -//go:generate enumer -type=PluginRuntimeType -trimprefix=PluginRuntimeType -transform=snake type PluginRuntimeType uint32 // This is a list of PluginRuntimeTypes used by Vault. @@ -20,11 +22,20 @@ const ( PluginRuntimeTypeContainer ) -// ParsePluginRuntimeType is a wrapper around PluginRuntimeTypeString kept for backwards compatibility. +func (r PluginRuntimeType) String() string { + switch r { + case PluginRuntimeTypeContainer: + return "container" + default: + return "unsupported" + } +} + func ParsePluginRuntimeType(PluginRuntimeType string) (PluginRuntimeType, error) { - t, err := PluginRuntimeTypeString(PluginRuntimeType) - if err != nil { + switch PluginRuntimeType { + case "container": + return PluginRuntimeTypeContainer, nil + default: return PluginRuntimeTypeUnsupported, fmt.Errorf("%q is not a supported plugin runtime type", PluginRuntimeType) } - return t, nil } diff --git a/upstream/vendor/github.com/hashicorp/vault/api/pluginruntimetype_enumer.go b/upstream/vendor/github.com/hashicorp/vault/api/pluginruntimetype_enumer.go deleted file mode 100644 index 663f440ff44..00000000000 --- a/upstream/vendor/github.com/hashicorp/vault/api/pluginruntimetype_enumer.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by "enumer -type=PluginRuntimeType -trimprefix=PluginRuntimeType -transform=snake"; DO NOT EDIT. - -package api - -import ( - "fmt" -) - -const _PluginRuntimeTypeName = "unsupportedcontainer" - -var _PluginRuntimeTypeIndex = [...]uint8{0, 11, 20} - -func (i PluginRuntimeType) String() string { - if i >= PluginRuntimeType(len(_PluginRuntimeTypeIndex)-1) { - return fmt.Sprintf("PluginRuntimeType(%d)", i) - } - return _PluginRuntimeTypeName[_PluginRuntimeTypeIndex[i]:_PluginRuntimeTypeIndex[i+1]] -} - -var _PluginRuntimeTypeValues = []PluginRuntimeType{0, 1} - -var _PluginRuntimeTypeNameToValueMap = map[string]PluginRuntimeType{ - _PluginRuntimeTypeName[0:11]: 0, - _PluginRuntimeTypeName[11:20]: 1, -} - -// PluginRuntimeTypeString retrieves an enum value from the enum constants string name. -// Throws an error if the param is not part of the enum. -func PluginRuntimeTypeString(s string) (PluginRuntimeType, error) { - if val, ok := _PluginRuntimeTypeNameToValueMap[s]; ok { - return val, nil - } - return 0, fmt.Errorf("%s does not belong to PluginRuntimeType values", s) -} - -// PluginRuntimeTypeValues returns all values of the enum -func PluginRuntimeTypeValues() []PluginRuntimeType { - return _PluginRuntimeTypeValues -} - -// IsAPluginRuntimeType returns "true" if the value is listed in the enum definition. "false" otherwise -func (i PluginRuntimeType) IsAPluginRuntimeType() bool { - for _, v := range _PluginRuntimeTypeValues { - if i == v { - return true - } - } - return false -} diff --git a/upstream/vendor/github.com/hashicorp/vault/api/renewbehavior_enumer.go b/upstream/vendor/github.com/hashicorp/vault/api/renewbehavior_enumer.go deleted file mode 100644 index 9b272e3e0ce..00000000000 --- a/upstream/vendor/github.com/hashicorp/vault/api/renewbehavior_enumer.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by "enumer -type=RenewBehavior -trimprefix=RenewBehavior"; DO NOT EDIT. - -package api - -import ( - "fmt" -) - -const _RenewBehaviorName = "IgnoreErrorsRenewDisabledErrorOnErrors" - -var _RenewBehaviorIndex = [...]uint8{0, 12, 25, 38} - -func (i RenewBehavior) String() string { - if i >= RenewBehavior(len(_RenewBehaviorIndex)-1) { - return fmt.Sprintf("RenewBehavior(%d)", i) - } - return _RenewBehaviorName[_RenewBehaviorIndex[i]:_RenewBehaviorIndex[i+1]] -} - -var _RenewBehaviorValues = []RenewBehavior{0, 1, 2} - -var _RenewBehaviorNameToValueMap = map[string]RenewBehavior{ - _RenewBehaviorName[0:12]: 0, - _RenewBehaviorName[12:25]: 1, - _RenewBehaviorName[25:38]: 2, -} - -// RenewBehaviorString retrieves an enum value from the enum constants string name. -// Throws an error if the param is not part of the enum. -func RenewBehaviorString(s string) (RenewBehavior, error) { - if val, ok := _RenewBehaviorNameToValueMap[s]; ok { - return val, nil - } - return 0, fmt.Errorf("%s does not belong to RenewBehavior values", s) -} - -// RenewBehaviorValues returns all values of the enum -func RenewBehaviorValues() []RenewBehavior { - return _RenewBehaviorValues -} - -// IsARenewBehavior returns "true" if the value is listed in the enum definition. "false" otherwise -func (i RenewBehavior) IsARenewBehavior() bool { - for _, v := range _RenewBehaviorValues { - if i == v { - return true - } - } - return false -} diff --git a/upstream/vendor/github.com/hashicorp/vault/api/replication_status.go b/upstream/vendor/github.com/hashicorp/vault/api/replication_status.go index d7224ff11d1..9bc02d53935 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/replication_status.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/replication_status.go @@ -19,14 +19,13 @@ const ( ) type ClusterInfo struct { - APIAddr string `json:"api_address,omitempty" mapstructure:"api_address"` - ClusterAddress string `json:"cluster_address,omitempty" mapstructure:"cluster_address"` - ConnectionStatus string `json:"connection_status,omitempty" mapstructure:"connection_status"` - LastHeartBeat string `json:"last_heartbeat,omitempty" mapstructure:"last_heartbeat"` - LastHeartBeatDurationMillis string `json:"last_heartbeat_duration_ms,omitempty" mapstructure:"last_heartbeat_duration_ms"` - ClockSkewMillis string `json:"clock_skew_ms,omitempty" mapstructure:"clock_skew_ms"` - NodeID string `json:"node_id,omitempty" mapstructure:"node_id"` - ReplicationPrimaryCanaryAgeMillis string `json:"replication_primary_canary_age_ms,omitempty" mapstructure:"replication_primary_canary_age_ms"` + APIAddr string `json:"api_address,omitempty" mapstructure:"api_address"` + ClusterAddress string `json:"cluster_address,omitempty" mapstructure:"cluster_address"` + ConnectionStatus string `json:"connection_status,omitempty" mapstructure:"connection_status"` + LastHeartBeat string `json:"last_heartbeat,omitempty" mapstructure:"last_heartbeat"` + LastHeartBeatDurationMillis string `json:"last_heartbeat_duration_ms,omitempty" mapstructure:"last_heartbeat_duration_ms"` + ClockSkewMillis string `json:"clock_skew_ms,omitempty" mapstructure:"clock_skew_ms"` + NodeID string `json:"node_id,omitempty" mapstructure:"node_id"` } type ReplicationStatusGenericResponse struct { diff --git a/upstream/vendor/github.com/hashicorp/vault/api/sys_hastatus.go b/upstream/vendor/github.com/hashicorp/vault/api/sys_hastatus.go index 2e54651e175..58a73b89cbb 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/sys_hastatus.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/sys_hastatus.go @@ -35,15 +35,14 @@ type HAStatusResponse struct { } type HANode struct { - Hostname string `json:"hostname"` - APIAddress string `json:"api_address"` - ClusterAddress string `json:"cluster_address"` - ActiveNode bool `json:"active_node"` - LastEcho *time.Time `json:"last_echo"` - EchoDurationMillis int64 `json:"echo_duration_ms"` - ClockSkewMillis int64 `json:"clock_skew_ms"` - Version string `json:"version"` - UpgradeVersion string `json:"upgrade_version,omitempty"` - RedundancyZone string `json:"redundancy_zone,omitempty"` - ReplicationPrimaryCanaryAgeMillis int64 `json:"replication_primary_canary_age_ms"` + Hostname string `json:"hostname"` + APIAddress string `json:"api_address"` + ClusterAddress string `json:"cluster_address"` + ActiveNode bool `json:"active_node"` + LastEcho *time.Time `json:"last_echo"` + EchoDurationMillis int64 `json:"echo_duration_ms"` + ClockSkewMillis int64 `json:"clock_skew_ms"` + Version string `json:"version"` + UpgradeVersion string `json:"upgrade_version,omitempty"` + RedundancyZone string `json:"redundancy_zone,omitempty"` } diff --git a/upstream/vendor/github.com/hashicorp/vault/api/sys_health.go b/upstream/vendor/github.com/hashicorp/vault/api/sys_health.go index 6868b96d77a..0dc849885ff 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/sys_health.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/sys_health.go @@ -38,19 +38,18 @@ func (c *Sys) HealthWithContext(ctx context.Context) (*HealthResponse, error) { } type HealthResponse struct { - Initialized bool `json:"initialized"` - Sealed bool `json:"sealed"` - Standby bool `json:"standby"` - PerformanceStandby bool `json:"performance_standby"` - ReplicationPerformanceMode string `json:"replication_performance_mode"` - ReplicationDRMode string `json:"replication_dr_mode"` - ServerTimeUTC int64 `json:"server_time_utc"` - Version string `json:"version"` - ClusterName string `json:"cluster_name,omitempty"` - ClusterID string `json:"cluster_id,omitempty"` - LastWAL uint64 `json:"last_wal,omitempty"` - Enterprise bool `json:"enterprise"` - EchoDurationMillis int64 `json:"echo_duration_ms"` - ClockSkewMillis int64 `json:"clock_skew_ms"` - ReplicationPrimaryCanaryAgeMillis int64 `json:"replication_primary_canary_age_ms"` + Initialized bool `json:"initialized"` + Sealed bool `json:"sealed"` + Standby bool `json:"standby"` + PerformanceStandby bool `json:"performance_standby"` + ReplicationPerformanceMode string `json:"replication_performance_mode"` + ReplicationDRMode string `json:"replication_dr_mode"` + ServerTimeUTC int64 `json:"server_time_utc"` + Version string `json:"version"` + ClusterName string `json:"cluster_name,omitempty"` + ClusterID string `json:"cluster_id,omitempty"` + LastWAL uint64 `json:"last_wal,omitempty"` + Enterprise bool `json:"enterprise"` + EchoDurationMillis int64 `json:"echo_duration_ms"` + ClockSkewMillis int64 `json:"clock_skew_ms"` } diff --git a/upstream/vendor/github.com/hashicorp/vault/api/sys_raft.go b/upstream/vendor/github.com/hashicorp/vault/api/sys_raft.go index 699f6e9fd09..4b9487c61d5 100644 --- a/upstream/vendor/github.com/hashicorp/vault/api/sys_raft.go +++ b/upstream/vendor/github.com/hashicorp/vault/api/sys_raft.go @@ -9,7 +9,6 @@ import ( "context" "encoding/json" "errors" - "fmt" "io" "io/ioutil" "net/http" @@ -101,23 +100,6 @@ type AutopilotState struct { OptimisticFailureTolerance int `mapstructure:"optimistic_failure_tolerance,omitempty"` } -func (a *AutopilotState) String() string { - var result string - result += fmt.Sprintf("Healthy: %t. FailureTolerance: %d. Leader: %s. OptimisticFailureTolerance: %d\n", a.Healthy, a.FailureTolerance, a.Leader, a.OptimisticFailureTolerance) - for _, s := range a.Servers { - result += fmt.Sprintf("Server: %s\n", s) - } - result += fmt.Sprintf("Voters: %v\n", a.Voters) - result += fmt.Sprintf("NonVoters: %v\n", a.NonVoters) - - for name, zone := range a.RedundancyZones { - result += fmt.Sprintf("RedundancyZone %s: %s\n", name, &zone) - } - - result += fmt.Sprintf("Upgrade: %s", a.Upgrade) - return result -} - // AutopilotServer represents the server blocks in the response of the raft // autopilot state API. type AutopilotServer struct { @@ -137,21 +119,12 @@ type AutopilotServer struct { NodeType string `mapstructure:"node_type,omitempty"` } -func (a *AutopilotServer) String() string { - return fmt.Sprintf("ID: %s. Name: %s. Address: %s. NodeStatus: %s. LastContact: %s. LastTerm: %d. LastIndex: %d. Healthy: %t. StableSince: %s. Status: %s. Version: %s. UpgradeVersion: %s. RedundancyZone: %s. NodeType: %s", - a.ID, a.Name, a.Address, a.NodeStatus, a.LastContact, a.LastTerm, a.LastIndex, a.Healthy, a.StableSince, a.Status, a.Version, a.UpgradeVersion, a.RedundancyZone, a.NodeType) -} - type AutopilotZone struct { Servers []string `mapstructure:"servers,omitempty"` Voters []string `mapstructure:"voters,omitempty"` FailureTolerance int `mapstructure:"failure_tolerance,omitempty"` } -func (a *AutopilotZone) String() string { - return fmt.Sprintf("Servers: %v. Voters: %v. FailureTolerance: %d", a.Servers, a.Voters, a.FailureTolerance) -} - type AutopilotUpgrade struct { Status string `mapstructure:"status"` TargetVersion string `mapstructure:"target_version,omitempty"` @@ -164,17 +137,6 @@ type AutopilotUpgrade struct { RedundancyZones map[string]AutopilotZoneUpgradeVersions `mapstructure:"redundancy_zones,omitempty"` } -func (a *AutopilotUpgrade) String() string { - result := fmt.Sprintf("Status: %s. TargetVersion: %s. TargetVersionVoters: %v. TargetVersionNonVoters: %v. TargetVersionReadReplicas: %v. OtherVersionVoters: %v. OtherVersionNonVoters: %v. OtherVersionReadReplicas: %v", - a.Status, a.TargetVersion, a.TargetVersionVoters, a.TargetVersionNonVoters, a.TargetVersionReadReplicas, a.OtherVersionVoters, a.OtherVersionNonVoters, a.OtherVersionReadReplicas) - - for name, zone := range a.RedundancyZones { - result += fmt.Sprintf("Redundancy Zone %s: %s", name, zone) - } - - return result -} - type AutopilotZoneUpgradeVersions struct { TargetVersionVoters []string `mapstructure:"target_version_voters,omitempty"` TargetVersionNonVoters []string `mapstructure:"target_version_non_voters,omitempty"` @@ -182,11 +144,6 @@ type AutopilotZoneUpgradeVersions struct { OtherVersionNonVoters []string `mapstructure:"other_version_non_voters,omitempty"` } -func (a *AutopilotZoneUpgradeVersions) String() string { - return fmt.Sprintf("TargetVersionVoters: %v. TargetVersionNonVoters: %v. OtherVersionVoters: %v. OtherVersionNonVoters: %v", - a.TargetVersionVoters, a.TargetVersionNonVoters, a.OtherVersionVoters, a.OtherVersionNonVoters) -} - // RaftJoin wraps RaftJoinWithContext using context.Background. func (c *Sys) RaftJoin(opts *RaftJoinRequest) (*RaftJoinResponse, error) { return c.RaftJoinWithContext(context.Background(), opts) diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/client.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/client.go index d6b152a9cd2..500a0835ecb 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/client.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/client.go @@ -7,8 +7,10 @@ package scm import ( "context" "errors" + "io" "net/http" + "net/url" "strconv" "strings" @@ -180,8 +182,6 @@ func (c *Client) Do(ctx context.Context, in *Request) (*Response, error) { if client == nil { client = http.DefaultClient } - // The callers of this method should do the closing - //nolint:bodyclose res, err := client.Do(req) if err != nil { return nil, err diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/const.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/const.go index 3f1db75fa62..9ac83b17d7f 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/const.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/const.go @@ -157,7 +157,7 @@ func (a Action) String() (s string) { case ActionCompleted: return "completed" default: - return "" + return } } diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go index 7eaabe09c74..d2e6f0daa89 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go @@ -93,8 +93,9 @@ func getIssueCommentAction(src *issueCommentPullRequestHook) scm.Action { return scm.ActionDelete } else if src.Resource.Comment.PublishedDate.Equal(src.Resource.Comment.LastUpdatedDate) { return scm.ActionCreate + } else { + return scm.ActionEdited } - return scm.ActionEdited } func convertPushHook(src *pushHook) *scm.PushHook { diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go index c8b688075b8..e76357e1c81 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go @@ -179,8 +179,8 @@ func (s *repositoryService) ListHooks(ctx context.Context, fullName string, opts } func (s *repositoryService) CreateHook(ctx context.Context, fullName string, input *scm.HookInput) (*scm.Hook, *scm.Response, error) { + /* #nosec */ hook := &scm.Hook{ - //nolint:gosec ID: fmt.Sprintf("%d", rand.Int()), Name: input.Name, Target: input.Target, diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go index f0f20a50cf5..763c7578b96 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go @@ -424,6 +424,6 @@ func convertAction(src string) (action scm.Action) { case "reviewed": return scm.ActionSubmitted default: - return 0 + return } } diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go index b8526aa8a89..82b2e350eb5 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go @@ -32,7 +32,6 @@ type releaseInput struct { Commitish string `json:"target_commitish,omitempty"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` - MakeLatest string `json:"make_latest"` } func (s *releaseService) Find(ctx context.Context, repo string, id int) (*scm.Release, *scm.Response, error) { @@ -98,9 +97,6 @@ func (s *releaseService) Update(ctx context.Context, repo string, id int, input } in.Draft = input.Draft in.Prerelease = input.Prerelease - if !(in.Prerelease || in.Draft) { - in.MakeLatest = "true" - } out := new(release) res, err := s.client.do(ctx, "PATCH", path, in, out) return convertRelease(out), res, err diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitlab/pr.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitlab/pr.go index 2da6fb02b07..379c065c199 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitlab/pr.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/driver/gitlab/pr.go @@ -307,7 +307,6 @@ type pr struct { Labels []*string `json:"labels"` Link string `json:"web_url"` WIP bool `json:"work_in_progress"` - Draft bool `json:"draft"` Author user `json:"author"` MergeStatus string `json:"merge_status"` SourceBranch string `json:"source_branch"` @@ -412,7 +411,7 @@ func (s *pullService) convertPullRequest(ctx context.Context, from *pr) (*scm.Pu Source: from.SourceBranch, Target: from.TargetBranch, Link: from.Link, - Draft: from.WIP || from.Draft, + Draft: from.WIP, Closed: from.State != "opened", Merged: from.State == "merged", Mergeable: scm.ToMergeableState(from.MergeStatus) == scm.MergeableStateMergeable, diff --git a/upstream/vendor/github.com/jenkins-x/go-scm/scm/pr.go b/upstream/vendor/github.com/jenkins-x/go-scm/scm/pr.go index df118450595..45bed6d85aa 100644 --- a/upstream/vendor/github.com/jenkins-x/go-scm/scm/pr.go +++ b/upstream/vendor/github.com/jenkins-x/go-scm/scm/pr.go @@ -215,7 +215,7 @@ func ToMergeableState(text string) MergeableState { switch strings.ToLower(text) { case "clean", "mergeable", "can_be_merged": return MergeableStateMergeable - case "dirty", "conflict", "conflicting", "cannot_be_merged": + case "conflict", "conflicting", "cannot_be_merged": return MergeableStateConflicting default: return MergeableStateUnknown diff --git a/upstream/vendor/github.com/klauspost/compress/README.md b/upstream/vendor/github.com/klauspost/compress/README.md index 4002a16a637..f710a34ec77 100644 --- a/upstream/vendor/github.com/klauspost/compress/README.md +++ b/upstream/vendor/github.com/klauspost/compress/README.md @@ -16,12 +16,6 @@ This package provides various compression algorithms. # changelog -* June 13, 2023 - [v1.16.6](https://github.com/klauspost/compress/releases/tag/v1.16.6) - * zstd: correctly ignore WithEncoderPadding(1) by @ianlancetaylor in https://github.com/klauspost/compress/pull/806 - * zstd: Add amd64 match length assembly https://github.com/klauspost/compress/pull/824 - * gzhttp: Handle informational headers by @rtribotte in https://github.com/klauspost/compress/pull/815 - * s2: Improve Better compression slightly https://github.com/klauspost/compress/pull/663 - * Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5) * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802 * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804 diff --git a/upstream/vendor/github.com/klauspost/compress/SECURITY.md b/upstream/vendor/github.com/klauspost/compress/SECURITY.md index ca6685e2b72..23a43387b61 100644 --- a/upstream/vendor/github.com/klauspost/compress/SECURITY.md +++ b/upstream/vendor/github.com/klauspost/compress/SECURITY.md @@ -20,6 +20,6 @@ Vulnerabilities resulting from compiler/assembler errors should be reported upst If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. -Please disclose it at [security advisory](https://github.com/klauspost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that. +Please disclose it at [security advisory](https://github.com/klaupost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that. This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerabilities will be disclosed in a best effort base. diff --git a/upstream/vendor/github.com/klauspost/compress/zstd/enc_base.go b/upstream/vendor/github.com/klauspost/compress/zstd/enc_base.go index 5ca46038ad9..e008b99298a 100644 --- a/upstream/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/upstream/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -144,7 +144,6 @@ func (e *fastBase) resetBase(d *dict, singleBlock bool) { } else { e.crc.Reset() } - e.blk.dictLitEnc = nil if d != nil { low := e.lowMem if singleBlock { diff --git a/upstream/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/upstream/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index a154c18f741..7d425109adb 100644 --- a/upstream/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/upstream/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -1084,7 +1084,7 @@ func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) { } } e.lastDictID = d.id - allDirty = true + e.allDirty = true } // Reset table to initial state e.cur = e.maxMatchOff diff --git a/upstream/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/upstream/vendor/github.com/klauspost/compress/zstd/enc_fast.go index f45a3da7dae..cbc626eec63 100644 --- a/upstream/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/upstream/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -829,12 +829,13 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { } if true { end := e.maxMatchOff + int32(len(d.content)) - 8 - for i := e.maxMatchOff; i < end; i += 2 { + for i := e.maxMatchOff; i < end; i += 3 { const hashLog = tableBits cv := load6432(d.content, i-e.maxMatchOff) - nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 6 - nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 7 + nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 5 + nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 6 + nextHash2 := hashLen(cv>>16, hashLog, tableFastHashLen) // 2 -> 7 e.dictTable[nextHash] = tableEntry{ val: uint32(cv), offset: i, @@ -843,6 +844,10 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { val: uint32(cv >> 8), offset: i + 1, } + e.dictTable[nextHash2] = tableEntry{ + val: uint32(cv >> 16), + offset: i + 2, + } } } e.lastDictID = d.id diff --git a/upstream/vendor/github.com/mxk/go-flowrate/LICENSE b/upstream/vendor/github.com/mxk/go-flowrate/LICENSE deleted file mode 100644 index e9f9f628ba5..00000000000 --- a/upstream/vendor/github.com/mxk/go-flowrate/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2014 The Go-FlowRate Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of the go-flowrate project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go b/upstream/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go deleted file mode 100644 index 1b727721e14..00000000000 --- a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go +++ /dev/null @@ -1,267 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -// Package flowrate provides the tools for monitoring and limiting the flow rate -// of an arbitrary data stream. -package flowrate - -import ( - "math" - "sync" - "time" -) - -// Monitor monitors and limits the transfer rate of a data stream. -type Monitor struct { - mu sync.Mutex // Mutex guarding access to all internal fields - active bool // Flag indicating an active transfer - start time.Duration // Transfer start time (clock() value) - bytes int64 // Total number of bytes transferred - samples int64 // Total number of samples taken - - rSample float64 // Most recent transfer rate sample (bytes per second) - rEMA float64 // Exponential moving average of rSample - rPeak float64 // Peak transfer rate (max of all rSamples) - rWindow float64 // rEMA window (seconds) - - sBytes int64 // Number of bytes transferred since sLast - sLast time.Duration // Most recent sample time (stop time when inactive) - sRate time.Duration // Sampling rate - - tBytes int64 // Number of bytes expected in the current transfer - tLast time.Duration // Time of the most recent transfer of at least 1 byte -} - -// New creates a new flow control monitor. Instantaneous transfer rate is -// measured and updated for each sampleRate interval. windowSize determines the -// weight of each sample in the exponential moving average (EMA) calculation. -// The exact formulas are: -// -// sampleTime = currentTime - prevSampleTime -// sampleRate = byteCount / sampleTime -// weight = 1 - exp(-sampleTime/windowSize) -// newRate = weight*sampleRate + (1-weight)*oldRate -// -// The default values for sampleRate and windowSize (if <= 0) are 100ms and 1s, -// respectively. -func New(sampleRate, windowSize time.Duration) *Monitor { - if sampleRate = clockRound(sampleRate); sampleRate <= 0 { - sampleRate = 5 * clockRate - } - if windowSize <= 0 { - windowSize = 1 * time.Second - } - now := clock() - return &Monitor{ - active: true, - start: now, - rWindow: windowSize.Seconds(), - sLast: now, - sRate: sampleRate, - tLast: now, - } -} - -// Update records the transfer of n bytes and returns n. It should be called -// after each Read/Write operation, even if n is 0. -func (m *Monitor) Update(n int) int { - m.mu.Lock() - m.update(n) - m.mu.Unlock() - return n -} - -// IO is a convenience method intended to wrap io.Reader and io.Writer method -// execution. It calls m.Update(n) and then returns (n, err) unmodified. -func (m *Monitor) IO(n int, err error) (int, error) { - return m.Update(n), err -} - -// Done marks the transfer as finished and prevents any further updates or -// limiting. Instantaneous and current transfer rates drop to 0. Update, IO, and -// Limit methods become NOOPs. It returns the total number of bytes transferred. -func (m *Monitor) Done() int64 { - m.mu.Lock() - if now := m.update(0); m.sBytes > 0 { - m.reset(now) - } - m.active = false - m.tLast = 0 - n := m.bytes - m.mu.Unlock() - return n -} - -// timeRemLimit is the maximum Status.TimeRem value. -const timeRemLimit = 999*time.Hour + 59*time.Minute + 59*time.Second - -// Status represents the current Monitor status. All transfer rates are in bytes -// per second rounded to the nearest byte. -type Status struct { - Active bool // Flag indicating an active transfer - Start time.Time // Transfer start time - Duration time.Duration // Time period covered by the statistics - Idle time.Duration // Time since the last transfer of at least 1 byte - Bytes int64 // Total number of bytes transferred - Samples int64 // Total number of samples taken - InstRate int64 // Instantaneous transfer rate - CurRate int64 // Current transfer rate (EMA of InstRate) - AvgRate int64 // Average transfer rate (Bytes / Duration) - PeakRate int64 // Maximum instantaneous transfer rate - BytesRem int64 // Number of bytes remaining in the transfer - TimeRem time.Duration // Estimated time to completion - Progress Percent // Overall transfer progress -} - -// Status returns current transfer status information. The returned value -// becomes static after a call to Done. -func (m *Monitor) Status() Status { - m.mu.Lock() - now := m.update(0) - s := Status{ - Active: m.active, - Start: clockToTime(m.start), - Duration: m.sLast - m.start, - Idle: now - m.tLast, - Bytes: m.bytes, - Samples: m.samples, - PeakRate: round(m.rPeak), - BytesRem: m.tBytes - m.bytes, - Progress: percentOf(float64(m.bytes), float64(m.tBytes)), - } - if s.BytesRem < 0 { - s.BytesRem = 0 - } - if s.Duration > 0 { - rAvg := float64(s.Bytes) / s.Duration.Seconds() - s.AvgRate = round(rAvg) - if s.Active { - s.InstRate = round(m.rSample) - s.CurRate = round(m.rEMA) - if s.BytesRem > 0 { - if tRate := 0.8*m.rEMA + 0.2*rAvg; tRate > 0 { - ns := float64(s.BytesRem) / tRate * 1e9 - if ns > float64(timeRemLimit) { - ns = float64(timeRemLimit) - } - s.TimeRem = clockRound(time.Duration(ns)) - } - } - } - } - m.mu.Unlock() - return s -} - -// Limit restricts the instantaneous (per-sample) data flow to rate bytes per -// second. It returns the maximum number of bytes (0 <= n <= want) that may be -// transferred immediately without exceeding the limit. If block == true, the -// call blocks until n > 0. want is returned unmodified if want < 1, rate < 1, -// or the transfer is inactive (after a call to Done). -// -// At least one byte is always allowed to be transferred in any given sampling -// period. Thus, if the sampling rate is 100ms, the lowest achievable flow rate -// is 10 bytes per second. -// -// For usage examples, see the implementation of Reader and Writer in io.go. -func (m *Monitor) Limit(want int, rate int64, block bool) (n int) { - if want < 1 || rate < 1 { - return want - } - m.mu.Lock() - - // Determine the maximum number of bytes that can be sent in one sample - limit := round(float64(rate) * m.sRate.Seconds()) - if limit <= 0 { - limit = 1 - } - - // If block == true, wait until m.sBytes < limit - if now := m.update(0); block { - for m.sBytes >= limit && m.active { - now = m.waitNextSample(now) - } - } - - // Make limit <= want (unlimited if the transfer is no longer active) - if limit -= m.sBytes; limit > int64(want) || !m.active { - limit = int64(want) - } - m.mu.Unlock() - - if limit < 0 { - limit = 0 - } - return int(limit) -} - -// SetTransferSize specifies the total size of the data transfer, which allows -// the Monitor to calculate the overall progress and time to completion. -func (m *Monitor) SetTransferSize(bytes int64) { - if bytes < 0 { - bytes = 0 - } - m.mu.Lock() - m.tBytes = bytes - m.mu.Unlock() -} - -// update accumulates the transferred byte count for the current sample until -// clock() - m.sLast >= m.sRate. The monitor status is updated once the current -// sample is done. -func (m *Monitor) update(n int) (now time.Duration) { - if !m.active { - return - } - if now = clock(); n > 0 { - m.tLast = now - } - m.sBytes += int64(n) - if sTime := now - m.sLast; sTime >= m.sRate { - t := sTime.Seconds() - if m.rSample = float64(m.sBytes) / t; m.rSample > m.rPeak { - m.rPeak = m.rSample - } - - // Exponential moving average using a method similar to *nix load - // average calculation. Longer sampling periods carry greater weight. - if m.samples > 0 { - w := math.Exp(-t / m.rWindow) - m.rEMA = m.rSample + w*(m.rEMA-m.rSample) - } else { - m.rEMA = m.rSample - } - m.reset(now) - } - return -} - -// reset clears the current sample state in preparation for the next sample. -func (m *Monitor) reset(sampleTime time.Duration) { - m.bytes += m.sBytes - m.samples++ - m.sBytes = 0 - m.sLast = sampleTime -} - -// waitNextSample sleeps for the remainder of the current sample. The lock is -// released and reacquired during the actual sleep period, so it's possible for -// the transfer to be inactive when this method returns. -func (m *Monitor) waitNextSample(now time.Duration) time.Duration { - const minWait = 5 * time.Millisecond - current := m.sLast - - // sleep until the last sample time changes (ideally, just one iteration) - for m.sLast == current && m.active { - d := current + m.sRate - now - m.mu.Unlock() - if d < minWait { - d = minWait - } - time.Sleep(d) - m.mu.Lock() - now = m.update(0) - } - return now -} diff --git a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/io.go b/upstream/vendor/github.com/mxk/go-flowrate/flowrate/io.go deleted file mode 100644 index fbe0909725a..00000000000 --- a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/io.go +++ /dev/null @@ -1,133 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -package flowrate - -import ( - "errors" - "io" -) - -// ErrLimit is returned by the Writer when a non-blocking write is short due to -// the transfer rate limit. -var ErrLimit = errors.New("flowrate: flow rate limit exceeded") - -// Limiter is implemented by the Reader and Writer to provide a consistent -// interface for monitoring and controlling data transfer. -type Limiter interface { - Done() int64 - Status() Status - SetTransferSize(bytes int64) - SetLimit(new int64) (old int64) - SetBlocking(new bool) (old bool) -} - -// Reader implements io.ReadCloser with a restriction on the rate of data -// transfer. -type Reader struct { - io.Reader // Data source - *Monitor // Flow control monitor - - limit int64 // Rate limit in bytes per second (unlimited when <= 0) - block bool // What to do when no new bytes can be read due to the limit -} - -// NewReader restricts all Read operations on r to limit bytes per second. -func NewReader(r io.Reader, limit int64) *Reader { - return &Reader{r, New(0, 0), limit, true} -} - -// Read reads up to len(p) bytes into p without exceeding the current transfer -// rate limit. It returns (0, nil) immediately if r is non-blocking and no new -// bytes can be read at this time. -func (r *Reader) Read(p []byte) (n int, err error) { - p = p[:r.Limit(len(p), r.limit, r.block)] - if len(p) > 0 { - n, err = r.IO(r.Reader.Read(p)) - } - return -} - -// SetLimit changes the transfer rate limit to new bytes per second and returns -// the previous setting. -func (r *Reader) SetLimit(new int64) (old int64) { - old, r.limit = r.limit, new - return -} - -// SetBlocking changes the blocking behavior and returns the previous setting. A -// Read call on a non-blocking reader returns immediately if no additional bytes -// may be read at this time due to the rate limit. -func (r *Reader) SetBlocking(new bool) (old bool) { - old, r.block = r.block, new - return -} - -// Close closes the underlying reader if it implements the io.Closer interface. -func (r *Reader) Close() error { - defer r.Done() - if c, ok := r.Reader.(io.Closer); ok { - return c.Close() - } - return nil -} - -// Writer implements io.WriteCloser with a restriction on the rate of data -// transfer. -type Writer struct { - io.Writer // Data destination - *Monitor // Flow control monitor - - limit int64 // Rate limit in bytes per second (unlimited when <= 0) - block bool // What to do when no new bytes can be written due to the limit -} - -// NewWriter restricts all Write operations on w to limit bytes per second. The -// transfer rate and the default blocking behavior (true) can be changed -// directly on the returned *Writer. -func NewWriter(w io.Writer, limit int64) *Writer { - return &Writer{w, New(0, 0), limit, true} -} - -// Write writes len(p) bytes from p to the underlying data stream without -// exceeding the current transfer rate limit. It returns (n, ErrLimit) if w is -// non-blocking and no additional bytes can be written at this time. -func (w *Writer) Write(p []byte) (n int, err error) { - var c int - for len(p) > 0 && err == nil { - s := p[:w.Limit(len(p), w.limit, w.block)] - if len(s) > 0 { - c, err = w.IO(w.Writer.Write(s)) - } else { - return n, ErrLimit - } - p = p[c:] - n += c - } - return -} - -// SetLimit changes the transfer rate limit to new bytes per second and returns -// the previous setting. -func (w *Writer) SetLimit(new int64) (old int64) { - old, w.limit = w.limit, new - return -} - -// SetBlocking changes the blocking behavior and returns the previous setting. A -// Write call on a non-blocking writer returns as soon as no additional bytes -// may be written at this time due to the rate limit. -func (w *Writer) SetBlocking(new bool) (old bool) { - old, w.block = w.block, new - return -} - -// Close closes the underlying writer if it implements the io.Closer interface. -func (w *Writer) Close() error { - defer w.Done() - if c, ok := w.Writer.(io.Closer); ok { - return c.Close() - } - return nil -} diff --git a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/util.go b/upstream/vendor/github.com/mxk/go-flowrate/flowrate/util.go deleted file mode 100644 index 4caac583fc0..00000000000 --- a/upstream/vendor/github.com/mxk/go-flowrate/flowrate/util.go +++ /dev/null @@ -1,67 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -package flowrate - -import ( - "math" - "strconv" - "time" -) - -// clockRate is the resolution and precision of clock(). -const clockRate = 20 * time.Millisecond - -// czero is the process start time rounded down to the nearest clockRate -// increment. -var czero = time.Duration(time.Now().UnixNano()) / clockRate * clockRate - -// clock returns a low resolution timestamp relative to the process start time. -func clock() time.Duration { - return time.Duration(time.Now().UnixNano())/clockRate*clockRate - czero -} - -// clockToTime converts a clock() timestamp to an absolute time.Time value. -func clockToTime(c time.Duration) time.Time { - return time.Unix(0, int64(czero+c)) -} - -// clockRound returns d rounded to the nearest clockRate increment. -func clockRound(d time.Duration) time.Duration { - return (d + clockRate>>1) / clockRate * clockRate -} - -// round returns x rounded to the nearest int64 (non-negative values only). -func round(x float64) int64 { - if _, frac := math.Modf(x); frac >= 0.5 { - return int64(math.Ceil(x)) - } - return int64(math.Floor(x)) -} - -// Percent represents a percentage in increments of 1/1000th of a percent. -type Percent uint32 - -// percentOf calculates what percent of the total is x. -func percentOf(x, total float64) Percent { - if x < 0 || total <= 0 { - return 0 - } else if p := round(x / total * 1e5); p <= math.MaxUint32 { - return Percent(p) - } - return Percent(math.MaxUint32) -} - -func (p Percent) Float() float64 { - return float64(p) * 1e-3 -} - -func (p Percent) String() string { - var buf [12]byte - b := strconv.AppendUint(buf[:0], uint64(p)/1000, 10) - n := len(b) - b = strconv.AppendUint(b, 1000+uint64(p)%1000, 10) - b[n] = '.' - return string(append(b, '%')) -} diff --git a/upstream/vendor/github.com/prometheus/client_model/go/metrics.pb.go b/upstream/vendor/github.com/prometheus/client_model/go/metrics.pb.go index 2f15490758a..cee360db7f3 100644 --- a/upstream/vendor/github.com/prometheus/client_model/go/metrics.pb.go +++ b/upstream/vendor/github.com/prometheus/client_model/go/metrics.pb.go @@ -483,8 +483,6 @@ type Histogram struct { // 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() { @@ -624,13 +622,6 @@ 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 { @@ -932,7 +923,6 @@ 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() { @@ -995,13 +985,6 @@ 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{ @@ -1045,7 +1028,7 @@ var file_io_prometheus_client_metrics_proto_rawDesc = []byte{ 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, + 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xac, 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, 0x2c, 0x0a, 0x12, 0x73, @@ -1088,84 +1071,79 @@ var file_io_prometheus_client_metrics_proto_rawDesc = []byte{ 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, 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, 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, + 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, 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, 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, + 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, 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, 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, + 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, 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, } var ( @@ -1207,23 +1185,22 @@ var file_io_prometheus_client_metrics_proto_depIdxs = []int32{ 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 + 10, // 8: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar + 1, // 9: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair + 13, // 10: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp + 1, // 11: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair + 2, // 12: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge + 3, // 13: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter + 5, // 14: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary + 6, // 15: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped + 7, // 16: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram + 0, // 17: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType + 11, // 18: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_io_prometheus_client_metrics_proto_init() } diff --git a/upstream/vendor/github.com/prometheus/common/expfmt/decode.go b/upstream/vendor/github.com/prometheus/common/expfmt/decode.go index 25cfaa21643..a909b171c86 100644 --- a/upstream/vendor/github.com/prometheus/common/expfmt/decode.go +++ b/upstream/vendor/github.com/prometheus/common/expfmt/decode.go @@ -45,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" @@ -53,36 +53,36 @@ 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.FormatType() { - case TypeProtoDelim: - return &protoDecoder{r: bufio.NewReader(r)} + switch format { + case FmtProtoDelim: + return &protoDecoder{r: r} } return &textDecoder{r: r} } // protoDecoder implements the Decoder interface for protocol buffers. type protoDecoder struct { - r protodelim.Reader + r io.Reader } // Decode implements the Decoder interface. @@ -90,7 +90,7 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error { opts := protodelim.UnmarshalOptions{ MaxSize: -1, } - if err := opts.UnmarshalFrom(d.r, v); err != nil { + if err := opts.UnmarshalFrom(bufio.NewReader(d.r), v); err != nil { return err } if !model.IsValidMetricName(model.LabelValue(v.GetName())) { diff --git a/upstream/vendor/github.com/prometheus/common/expfmt/encode.go b/upstream/vendor/github.com/prometheus/common/expfmt/encode.go index 7f6cbe7d298..02b7a5e8128 100644 --- a/upstream/vendor/github.com/prometheus/common/expfmt/encode.go +++ b/upstream/vendor/github.com/prometheus/common/expfmt/encode.go @@ -22,7 +22,6 @@ import ( "google.golang.org/protobuf/encoding/prototext" "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg" - "github.com/prometheus/common/model" dto "github.com/prometheus/client_model/go" ) @@ -62,32 +61,23 @@ 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 + escapingScheme + return FmtProtoDelim case "text": - return fmtProtoText + escapingScheme + return FmtProtoText case "compact-text": - return fmtProtoCompact + escapingScheme + return FmtProtoCompact } } if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") { - return fmtText + escapingScheme + return FmtText } } - return fmtText + escapingScheme + return FmtText } // NegotiateIncludingOpenMetrics works like Negotiate but includes @@ -95,40 +85,29 @@ 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 + escapingScheme + return FmtProtoDelim case "text": - return fmtProtoText + escapingScheme + return FmtProtoText case "compact-text": - return fmtProtoCompact + escapingScheme + return FmtProtoCompact } } if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") { - return fmtText + escapingScheme + return FmtText } if ac.Type+"/"+ac.SubType == OpenMetricsType && (ver == OpenMetricsVersion_0_0_1 || ver == OpenMetricsVersion_1_0_0 || ver == "") { - switch ver { - case OpenMetricsVersion_1_0_0: - return fmtOpenMetrics_1_0_0 + escapingScheme - default: - return fmtOpenMetrics_0_0_1 + escapingScheme + if ver == OpenMetricsVersion_1_0_0 { + return FmtOpenMetrics_1_0_0 } + return FmtOpenMetrics_0_0_1 } } - return fmtText + escapingScheme + return FmtText } // NewEncoder returns a new encoder based on content type negotiation. All @@ -137,19 +116,9 @@ 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. -// 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: +func NewEncoder(w io.Writer, format Format) Encoder { + switch format { + case FmtProtoDelim: return encoderCloser{ encode: func(v *dto.MetricFamily) error { _, err := protodelim.MarshalTo(w, v) @@ -157,34 +126,34 @@ func NewEncoder(w io.Writer, format Format, options ...EncoderOption) Encoder { }, close: func() error { return nil }, } - case TypeProtoCompact: + case FmtProtoCompact: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := fmt.Fprintln(w, model.EscapeMetricFamily(v, escapingScheme).String()) + _, err := fmt.Fprintln(w, v.String()) return err }, close: func() error { return nil }, } - case TypeProtoText: + case FmtProtoText: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := fmt.Fprintln(w, prototext.Format(model.EscapeMetricFamily(v, escapingScheme))) + _, err := fmt.Fprintln(w, prototext.Format(v)) return err }, close: func() error { return nil }, } - case TypeTextPlain: + case FmtText: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := MetricFamilyToText(w, model.EscapeMetricFamily(v, escapingScheme)) + _, err := MetricFamilyToText(w, v) return err }, close: func() error { return nil }, } - case TypeOpenMetrics: + case FmtOpenMetrics_0_0_1, FmtOpenMetrics_1_0_0: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := MetricFamilyToOpenMetrics(w, model.EscapeMetricFamily(v, escapingScheme), options...) + _, err := MetricFamilyToOpenMetrics(w, v) return err }, close: func() error { diff --git a/upstream/vendor/github.com/prometheus/common/expfmt/expfmt.go b/upstream/vendor/github.com/prometheus/common/expfmt/expfmt.go index 051b38cd178..c4cb20f0d3e 100644 --- a/upstream/vendor/github.com/prometheus/common/expfmt/expfmt.go +++ b/upstream/vendor/github.com/prometheus/common/expfmt/expfmt.go @@ -14,164 +14,30 @@ // 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. 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. +// Constants to assemble the Content-Type values for the different wire protocols. 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. 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` + // 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` ) 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/upstream/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/upstream/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go index 353c5e93f92..21cdddcf054 100644 --- a/upstream/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go +++ b/upstream/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go @@ -22,47 +22,11 @@ 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 @@ -71,18 +35,6 @@ func WithUnit() EncoderOption { // 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 @@ -95,34 +47,20 @@ func WithUnit() EncoderOption { // 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`, `# HELP` and `# UNIT` -// lines. A counter with a missing `_total` suffix is not an error. However, +// 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, // its type will be set to `unknown` in that case to avoid invalid OpenMetrics // output. // -// - 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. +// - No support for the following (optional) features: `# UNIT` line, `_created` +// line, 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, options ...EncoderOption) (written int, err error) { - toOM := encoderOption{} - for _, option := range options { - option(&toOM) - } - +func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) { name := in.GetName() if name == "" { return 0, fmt.Errorf("MetricFamily has no name: %s", in) @@ -145,15 +83,12 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E } var ( - n int - metricType = in.GetType() - compliantName = name + n int + metricType = in.GetType() + shortName = name ) - 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) + if metricType == dto.MetricType_COUNTER && strings.HasSuffix(shortName, "_total") { + shortName = name[:len(name)-6] } // Comments, first HELP, then TYPE. @@ -163,7 +98,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E if err != nil { return } - n, err = writeName(w, compliantName) + n, err = w.WriteString(shortName) written += n if err != nil { return @@ -189,7 +124,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E if err != nil { return } - n, err = writeName(w, compliantName) + n, err = w.WriteString(shortName) written += n if err != nil { return @@ -216,89 +151,55 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E 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", compliantName, metric, + "expected counter in metric %s %s", name, 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, compliantName, "", metric, "", 0, + w, name, "", 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", compliantName, metric, + "expected gauge in metric %s %s", name, metric, ) } n, err = writeOpenMetricsSample( - w, compliantName, "", metric, "", 0, + w, name, "", 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", compliantName, metric, + "expected untyped in metric %s %s", name, metric, ) } n, err = writeOpenMetricsSample( - w, compliantName, "", metric, "", 0, + w, name, "", 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", compliantName, metric, + "expected summary in metric %s %s", name, metric, ) } for _, q := range metric.Summary.Quantile { n, err = writeOpenMetricsSample( - w, compliantName, "", metric, + w, name, "", metric, model.QuantileLabel, q.GetQuantile(), q.GetValue(), 0, false, nil, @@ -309,7 +210,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E } } n, err = writeOpenMetricsSample( - w, compliantName, "_sum", metric, "", 0, + w, name, "_sum", metric, "", 0, metric.Summary.GetSampleSum(), 0, false, nil, ) @@ -318,24 +219,20 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E return } n, err = writeOpenMetricsSample( - w, compliantName, "_count", metric, "", 0, + w, name, "_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", compliantName, metric, + "expected histogram in metric %s %s", name, metric, ) } infSeen := false for _, b := range metric.Histogram.Bucket { n, err = writeOpenMetricsSample( - w, compliantName, "_bucket", metric, + w, name, "_bucket", metric, model.BucketLabel, b.GetUpperBound(), 0, b.GetCumulativeCount(), true, b.Exemplar, @@ -350,7 +247,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E } if !infSeen { n, err = writeOpenMetricsSample( - w, compliantName, "_bucket", metric, + w, name, "_bucket", metric, model.BucketLabel, math.Inf(+1), 0, metric.Histogram.GetSampleCount(), true, nil, @@ -361,7 +258,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E } } n, err = writeOpenMetricsSample( - w, compliantName, "_sum", metric, "", 0, + w, name, "_sum", metric, "", 0, metric.Histogram.GetSampleSum(), 0, false, nil, ) @@ -370,17 +267,13 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E return } n, err = writeOpenMetricsSample( - w, compliantName, "_count", metric, "", 0, + w, name, "_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", compliantName, metric, + "unexpected type in metric %s %s", name, metric, ) } written += n @@ -410,9 +303,21 @@ func writeOpenMetricsSample( floatValue float64, intValue uint64, useIntValue bool, exemplar *dto.Exemplar, ) (int, error) { - written := 0 - n, err := writeOpenMetricsNameAndLabelPairs( - w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue, + 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 += n if err != nil { @@ -445,7 +350,7 @@ func writeOpenMetricsSample( return written, err } } - if exemplar != nil && len(exemplar.Label) > 0 { + if exemplar != nil { n, err = writeExemplar(w, exemplar) written += n if err != nil { @@ -460,58 +365,27 @@ func writeOpenMetricsSample( return written, nil } -// writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but -// formats the float in OpenMetrics style. -func writeOpenMetricsNameAndLabelPairs( +// writeOpenMetricsLabelPairs works like writeOpenMetrics but formats the float +// in OpenMetrics style. +func writeOpenMetricsLabelPairs( w enhancedWriter, - name string, in []*dto.LabelPair, additionalLabelName string, additionalLabelValue float64, ) (int, error) { - var ( - 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 + return 0, nil } - + var ( + written int + separator byte = '{' + ) for _, lp := range in { err := w.WriteByte(separator) written++ if err != nil { return written, err } - n, err := writeName(w, lp.GetName()) + n, err := w.WriteString(lp.GetName()) written += n if err != nil { return written, err @@ -568,49 +442,6 @@ func writeOpenMetricsNameAndLabelPairs( 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) { @@ -620,7 +451,7 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) { if err != nil { return written, err } - n, err = writeOpenMetricsNameAndLabelPairs(w, "", e.Label, "", 0) + n, err = writeOpenMetricsLabelPairs(w, e.Label, "", 0) written += n if err != nil { return written, err diff --git a/upstream/vendor/github.com/prometheus/common/expfmt/text_create.go b/upstream/vendor/github.com/prometheus/common/expfmt/text_create.go index f9b8265a9ec..2946b8f1a64 100644 --- a/upstream/vendor/github.com/prometheus/common/expfmt/text_create.go +++ b/upstream/vendor/github.com/prometheus/common/expfmt/text_create.go @@ -62,18 +62,6 @@ 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. @@ -110,7 +98,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e if err != nil { return } - n, err = writeName(w, name) + n, err = w.WriteString(name) written += n if err != nil { return @@ -136,7 +124,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e if err != nil { return } - n, err = writeName(w, name) + n, err = w.WriteString(name) written += n if err != nil { return @@ -292,9 +280,21 @@ func writeSample( additionalLabelName string, additionalLabelValue float64, value float64, ) (int, error) { - written := 0 - n, err := writeNameAndLabelPairs( - w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue, + 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 += n if err != nil { @@ -330,64 +330,32 @@ func writeSample( return written, nil } -// 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( +// 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( w enhancedWriter, - name string, in []*dto.LabelPair, additionalLabelName string, additionalLabelValue float64, ) (int, error) { - var ( - 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 + return 0, nil } - + var ( + written int + separator byte = '{' + ) for _, lp := range in { err := w.WriteByte(separator) written++ if err != nil { return written, err } - n, err := writeName(w, lp.GetName()) + n, err := w.WriteString(lp.GetName()) written += n if err != nil { return written, err @@ -494,27 +462,3 @@ 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/upstream/vendor/github.com/prometheus/common/model/labels.go b/upstream/vendor/github.com/prometheus/common/model/labels.go index 3317ce22ff7..ef895633546 100644 --- a/upstream/vendor/github.com/prometheus/common/model/labels.go +++ b/upstream/vendor/github.com/prometheus/common/model/labels.go @@ -97,25 +97,17 @@ var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") // therewith. type LabelName string -// 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. +// 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. func (ln LabelName) IsValid() bool { if len(ln) == 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 - } + 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 } @@ -172,7 +164,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 UTF-8. +// IsValid returns true iff the string is a valid UTF8. func (lv LabelValue) IsValid() bool { return utf8.ValidString(string(lv)) } diff --git a/upstream/vendor/github.com/prometheus/common/model/labelset.go b/upstream/vendor/github.com/prometheus/common/model/labelset.go index d0ad88da334..6eda08a7395 100644 --- a/upstream/vendor/github.com/prometheus/common/model/labelset.go +++ b/upstream/vendor/github.com/prometheus/common/model/labelset.go @@ -17,6 +17,7 @@ import ( "encoding/json" "fmt" "sort" + "strings" ) // A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet @@ -128,6 +129,16 @@ 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/upstream/vendor/github.com/prometheus/common/model/labelset_string.go b/upstream/vendor/github.com/prometheus/common/model/labelset_string.go deleted file mode 100644 index 174753ed36c..00000000000 --- a/upstream/vendor/github.com/prometheus/common/model/labelset_string.go +++ /dev/null @@ -1,45 +0,0 @@ -// 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" - "sort" - "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)) - } - sort.Strings(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/upstream/vendor/github.com/prometheus/common/model/labelset_string_go120.go b/upstream/vendor/github.com/prometheus/common/model/labelset_string_go120.go deleted file mode 100644 index c4212685e71..00000000000 --- a/upstream/vendor/github.com/prometheus/common/model/labelset_string_go120.go +++ /dev/null @@ -1,39 +0,0 @@ -// 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/upstream/vendor/github.com/prometheus/common/model/metric.go b/upstream/vendor/github.com/prometheus/common/model/metric.go index eb865e5a59c..f8c5eabaa99 100644 --- a/upstream/vendor/github.com/prometheus/common/model/metric.go +++ b/upstream/vendor/github.com/prometheus/common/model/metric.go @@ -18,77 +18,6 @@ import ( "regexp" "sort" "strings" - "unicode/utf8" - - dto "github.com/prometheus/client_model/go" - "google.golang.org/protobuf/proto" -) - -var ( - // 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 @@ -155,303 +84,17 @@ func (m Metric) FastFingerprint() Fingerprint { return LabelSet(m).FastFingerprint() } -// 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. +// IsValidMetricName returns true iff name matches the pattern of MetricNameRE. // This function, however, does not use MetricNameRE for the check but a much // faster hardcoded implementation. -func IsValidLegacyMetricName(n LabelValue) bool { +func IsValidMetricName(n LabelValue) bool { if len(n) == 0 { return false } for i, b := range n { - if !isValidLegacyRune(b, i) { + if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)) { 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/upstream/vendor/github.com/sigstore/sigstore/pkg/signature/kms/hashivault/client.go b/upstream/vendor/github.com/sigstore/sigstore/pkg/signature/kms/hashivault/client.go index 20656bc8055..1f56f8051a6 100644 --- a/upstream/vendor/github.com/sigstore/sigstore/pkg/signature/kms/hashivault/client.go +++ b/upstream/vendor/github.com/sigstore/sigstore/pkg/signature/kms/hashivault/client.go @@ -276,10 +276,9 @@ func (h hashivaultClient) sign(digest []byte, alg crypto.Hash, opts ...signature } signResult, err := client.Write(fmt.Sprintf("/%s/sign/%s%s", h.transitSecretEnginePath, h.keyPath, hashString(alg)), map[string]interface{}{ - "input": base64.StdEncoding.Strict().EncodeToString(digest), - "prehashed": alg != crypto.Hash(0), - "key_version": keyVersion, - "signature_algorithm": "pkcs1v15", + "input": base64.StdEncoding.Strict().EncodeToString(digest), + "prehashed": alg != crypto.Hash(0), + "key_version": keyVersion, }) if err != nil { return nil, fmt.Errorf("transit: failed to sign payload: %w", err) diff --git a/upstream/vendor/github.com/spiffe/go-spiffe/v2/bundle/x509bundle/bundle.go b/upstream/vendor/github.com/spiffe/go-spiffe/v2/bundle/x509bundle/bundle.go index a70bb62fd70..ffe28561c0e 100644 --- a/upstream/vendor/github.com/spiffe/go-spiffe/v2/bundle/x509bundle/bundle.go +++ b/upstream/vendor/github.com/spiffe/go-spiffe/v2/bundle/x509bundle/bundle.go @@ -63,14 +63,13 @@ func Read(trustDomain spiffeid.TrustDomain, r io.Reader) (*Bundle, error) { // blocks. func Parse(trustDomain spiffeid.TrustDomain, b []byte) (*Bundle, error) { bundle := New(trustDomain) - if len(b) == 0 { - return bundle, nil - } - certs, err := pemutil.ParseCertificates(b) if err != nil { return nil, x509bundleErr.New("cannot parse certificate: %v", err) } + if len(certs) == 0 { + return nil, x509bundleErr.New("no certificates found") + } for _, cert := range certs { bundle.AddX509Authority(cert) } @@ -81,14 +80,13 @@ func Parse(trustDomain spiffeid.TrustDomain, b []byte) (*Bundle, error) { // with no intermediate padding if there are more than one certificate) func ParseRaw(trustDomain spiffeid.TrustDomain, b []byte) (*Bundle, error) { bundle := New(trustDomain) - if len(b) == 0 { - return bundle, nil - } - certs, err := x509.ParseCertificates(b) if err != nil { return nil, x509bundleErr.New("cannot parse certificate: %v", err) } + if len(certs) == 0 { + return nil, x509bundleErr.New("no certificates found") + } for _, cert := range certs { bundle.AddX509Authority(cert) } diff --git a/upstream/vendor/github.com/spiffe/go-spiffe/v2/workloadapi/client.go b/upstream/vendor/github.com/spiffe/go-spiffe/v2/workloadapi/client.go index 4d5de5d59f0..b357468fad9 100644 --- a/upstream/vendor/github.com/spiffe/go-spiffe/v2/workloadapi/client.go +++ b/upstream/vendor/github.com/spiffe/go-spiffe/v2/workloadapi/client.go @@ -4,6 +4,7 @@ import ( "context" "crypto/x509" "errors" + "fmt" "time" "github.com/spiffe/go-spiffe/v2/bundle/jwtbundle" @@ -255,7 +256,7 @@ func (c *Client) ValidateJWTSVID(ctx context.Context, token, audience string) (* func (c *Client) newConn(ctx context.Context) (*grpc.ClientConn, error) { c.config.dialOptions = append(c.config.dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) c.appendDialOptionsOS() - return grpc.DialContext(ctx, c.config.address, c.config.dialOptions...) //nolint:staticcheck // preserve backcompat with WithDialOptions option + return grpc.DialContext(ctx, c.config.address, c.config.dialOptions...) } func (c *Client) handleWatchError(ctx context.Context, err error, backoff *backoff) error { @@ -488,6 +489,9 @@ func parseX509Bundle(spiffeID string, bundle []byte) (*x509bundle.Bundle, error) if err != nil { return nil, err } + if len(certs) == 0 { + return nil, fmt.Errorf("empty X.509 bundle for trust domain %q", td) + } return x509bundle.FromX509Authorities(td, certs), nil } diff --git a/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.pb.go b/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.pb.go index fd081d5d294..1376ba7a8b6 100644 --- a/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.pb.go +++ b/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.pb.go @@ -26,9 +26,6 @@ type CountEntriesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Filters the entries returned in the response. - Filter *CountEntriesRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } func (x *CountEntriesRequest) Reset() { @@ -63,13 +60,6 @@ func (*CountEntriesRequest) Descriptor() ([]byte, []int) { return file_spire_api_server_entry_v1_entry_proto_rawDescGZIP(), []int{0} } -func (x *CountEntriesRequest) GetFilter() *CountEntriesRequest_Filter { - if x != nil { - return x.Filter - } - return nil -} - type CountEntriesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -911,93 +901,6 @@ func (x *EntryRevision) GetRevisionNumber() int64 { return 0 } -type CountEntriesRequest_Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BySpiffeId *types.SPIFFEID `protobuf:"bytes,1,opt,name=by_spiffe_id,json=bySpiffeId,proto3" json:"by_spiffe_id,omitempty"` - ByParentId *types.SPIFFEID `protobuf:"bytes,2,opt,name=by_parent_id,json=byParentId,proto3" json:"by_parent_id,omitempty"` - BySelectors *types.SelectorMatch `protobuf:"bytes,3,opt,name=by_selectors,json=bySelectors,proto3" json:"by_selectors,omitempty"` - ByFederatesWith *types.FederatesWithMatch `protobuf:"bytes,4,opt,name=by_federates_with,json=byFederatesWith,proto3" json:"by_federates_with,omitempty"` - ByHint *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=by_hint,json=byHint,proto3" json:"by_hint,omitempty"` - ByDownstream *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=by_downstream,json=byDownstream,proto3" json:"by_downstream,omitempty"` -} - -func (x *CountEntriesRequest_Filter) Reset() { - *x = CountEntriesRequest_Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountEntriesRequest_Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountEntriesRequest_Filter) ProtoMessage() {} - -func (x *CountEntriesRequest_Filter) ProtoReflect() protoreflect.Message { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CountEntriesRequest_Filter.ProtoReflect.Descriptor instead. -func (*CountEntriesRequest_Filter) Descriptor() ([]byte, []int) { - return file_spire_api_server_entry_v1_entry_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *CountEntriesRequest_Filter) GetBySpiffeId() *types.SPIFFEID { - if x != nil { - return x.BySpiffeId - } - return nil -} - -func (x *CountEntriesRequest_Filter) GetByParentId() *types.SPIFFEID { - if x != nil { - return x.ByParentId - } - return nil -} - -func (x *CountEntriesRequest_Filter) GetBySelectors() *types.SelectorMatch { - if x != nil { - return x.BySelectors - } - return nil -} - -func (x *CountEntriesRequest_Filter) GetByFederatesWith() *types.FederatesWithMatch { - if x != nil { - return x.ByFederatesWith - } - return nil -} - -func (x *CountEntriesRequest_Filter) GetByHint() *wrapperspb.StringValue { - if x != nil { - return x.ByHint - } - return nil -} - -func (x *CountEntriesRequest_Filter) GetByDownstream() *wrapperspb.BoolValue { - if x != nil { - return x.ByDownstream - } - return nil -} - type ListEntriesRequest_Filter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1008,13 +911,12 @@ type ListEntriesRequest_Filter struct { BySelectors *types.SelectorMatch `protobuf:"bytes,3,opt,name=by_selectors,json=bySelectors,proto3" json:"by_selectors,omitempty"` ByFederatesWith *types.FederatesWithMatch `protobuf:"bytes,4,opt,name=by_federates_with,json=byFederatesWith,proto3" json:"by_federates_with,omitempty"` ByHint *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=by_hint,json=byHint,proto3" json:"by_hint,omitempty"` - ByDownstream *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=by_downstream,json=byDownstream,proto3" json:"by_downstream,omitempty"` } func (x *ListEntriesRequest_Filter) Reset() { *x = ListEntriesRequest_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[17] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1027,7 +929,7 @@ func (x *ListEntriesRequest_Filter) String() string { func (*ListEntriesRequest_Filter) ProtoMessage() {} func (x *ListEntriesRequest_Filter) ProtoReflect() protoreflect.Message { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[17] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1078,13 +980,6 @@ func (x *ListEntriesRequest_Filter) GetByHint() *wrapperspb.StringValue { return nil } -func (x *ListEntriesRequest_Filter) GetByDownstream() *wrapperspb.BoolValue { - if x != nil { - return x.ByDownstream - } - return nil -} - type BatchCreateEntryResponse_Result struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1104,7 +999,7 @@ type BatchCreateEntryResponse_Result struct { func (x *BatchCreateEntryResponse_Result) Reset() { *x = BatchCreateEntryResponse_Result{} if protoimpl.UnsafeEnabled { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[18] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1117,7 +1012,7 @@ func (x *BatchCreateEntryResponse_Result) String() string { func (*BatchCreateEntryResponse_Result) ProtoMessage() {} func (x *BatchCreateEntryResponse_Result) ProtoReflect() protoreflect.Message { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[18] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1058,7 @@ type BatchUpdateEntryResponse_Result struct { func (x *BatchUpdateEntryResponse_Result) Reset() { *x = BatchUpdateEntryResponse_Result{} if protoimpl.UnsafeEnabled { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[19] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1176,7 +1071,7 @@ func (x *BatchUpdateEntryResponse_Result) String() string { func (*BatchUpdateEntryResponse_Result) ProtoMessage() {} func (x *BatchUpdateEntryResponse_Result) ProtoReflect() protoreflect.Message { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[19] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1220,7 +1115,7 @@ type BatchDeleteEntryResponse_Result struct { func (x *BatchDeleteEntryResponse_Result) Reset() { *x = BatchDeleteEntryResponse_Result{} if protoimpl.UnsafeEnabled { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[20] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1233,7 +1128,7 @@ func (x *BatchDeleteEntryResponse_Result) String() string { func (*BatchDeleteEntryResponse_Result) ProtoMessage() {} func (x *BatchDeleteEntryResponse_Result) ProtoReflect() protoreflect.Message { - mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[20] + mi := &file_spire_api_server_entry_v1_entry_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1282,107 +1177,99 @@ var file_spire_api_server_entry_v1_entry_proto_rawDesc = []byte{ 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xf5, 0x03, 0x0a, 0x13, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x70, 0x69, - 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x8e, 0x03, 0x0a, 0x06, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x73, 0x70, 0x69, 0x66, 0x66, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, - 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, - 0x46, 0x46, 0x45, 0x49, 0x44, 0x52, 0x0a, 0x62, 0x79, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, - 0x64, 0x12, 0x3b, 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, - 0x49, 0x44, 0x52, 0x0a, 0x62, 0x79, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x41, - 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x0b, 0x62, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x4f, 0x0a, 0x11, 0x62, 0x79, 0x5f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, - 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, - 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x0f, 0x62, 0x79, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, - 0x74, 0x68, 0x12, 0x35, 0x0a, 0x07, 0x62, 0x79, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x06, 0x62, 0x79, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x0d, 0x62, 0x79, 0x5f, - 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x62, 0x79, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x2c, 0x0a, 0x14, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xec, 0x04, 0x0a, 0x12, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x4c, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x34, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, - 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, - 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x8e, 0x03, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x12, 0x3b, 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, - 0x49, 0x44, 0x52, 0x0a, 0x62, 0x79, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x3b, - 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x49, 0x44, 0x52, - 0x0a, 0x62, 0x79, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x41, 0x0a, 0x0c, 0x62, - 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x0b, 0x62, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x4f, - 0x0a, 0x11, 0x62, 0x79, 0x5f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x77, - 0x69, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x70, 0x69, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x65, 0x64, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x0f, - 0x62, 0x79, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x12, - 0x35, 0x0a, 0x07, 0x62, 0x79, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, - 0x62, 0x79, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x0d, 0x62, 0x79, 0x5f, 0x64, 0x6f, 0x77, - 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x62, 0x79, 0x44, 0x6f, 0x77, - 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x6f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, - 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x88, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, - 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, + 0x74, 0x6f, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x14, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xab, 0x04, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, + 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0xcd, 0x02, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x12, 0x3b, 0x0a, 0x0c, 0x62, 0x79, 0x5f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x49, + 0x44, 0x52, 0x0a, 0x62, 0x79, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, + 0x0c, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x49, 0x44, 0x52, 0x0a, + 0x62, 0x79, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x41, 0x0a, 0x0c, 0x62, 0x79, + 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x0b, 0x62, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x4f, 0x0a, + 0x11, 0x62, 0x79, 0x5f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x77, 0x69, + 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x65, 0x64, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x0f, 0x62, + 0x79, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x12, 0x35, + 0x0a, 0x07, 0x62, 0x79, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x62, + 0x79, 0x48, 0x69, 0x6e, 0x74, 0x22, 0x6f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, + 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x26, + 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x88, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, + 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, + 0x6b, 0x22, 0xd9, 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x67, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2f, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2c, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0xc3, 0x01, + 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, + 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4d, - 0x61, 0x73, 0x6b, 0x22, 0xd9, 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, + 0x61, 0x73, 0x6b, 0x22, 0xd9, 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, + 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x67, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, @@ -1391,147 +1278,121 @@ var file_spire_api_server_entry_v1_entry_proto_rawDesc = []byte{ 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, - 0xc3, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x65, - 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, - 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, - 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x2b, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xbb, 0x01, 0x0a, + 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x70, 0x69, + 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, + 0x49, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x70, 0x69, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5a, 0x0a, 0x1b, 0x47, 0x65, + 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x1c, 0x53, 0x79, 0x6e, 0x63, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0xd9, 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x54, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x67, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x22, 0x2b, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xbb, - 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, - 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x73, 0x1a, 0x49, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x70, - 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5a, 0x0a, 0x1b, - 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x1c, 0x53, 0x79, - 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x1d, 0x53, 0x79, - 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x65, - 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0e, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, - 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, - 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x48, 0x0a, 0x0d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x32, 0xc8, - 0x07, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x6f, 0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x0b, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, - 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, - 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x33, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, - 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, + 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x1d, 0x53, 0x79, 0x6e, 0x63, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x07, + 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, 0x6f, + 0x72, 0x65, 0x22, 0x48, 0x0a, 0x0d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x32, 0xc8, 0x07, 0x0a, + 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x6f, 0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x70, 0x69, 0x72, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x2a, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, - 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x36, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x70, 0x69, + 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x7b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x32, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x37, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x36, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, + 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x15, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x15, 0x53, 0x79, 0x6e, + 0x12, 0x37, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x37, 0x2e, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, 0x70, - 0x69, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, - 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x2f, 0x73, - 0x70, 0x69, 0x72, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, 0x70, 0x69, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x2f, 0x73, 0x70, 0x69, + 0x72, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x73, 0x70, 0x69, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1546,7 +1407,7 @@ func file_spire_api_server_entry_v1_entry_proto_rawDescGZIP() []byte { return file_spire_api_server_entry_v1_entry_proto_rawDescData } -var file_spire_api_server_entry_v1_entry_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_spire_api_server_entry_v1_entry_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_spire_api_server_entry_v1_entry_proto_goTypes = []interface{}{ (*CountEntriesRequest)(nil), // 0: spire.api.server.entry.v1.CountEntriesRequest (*CountEntriesResponse)(nil), // 1: spire.api.server.entry.v1.CountEntriesResponse @@ -1564,77 +1425,67 @@ var file_spire_api_server_entry_v1_entry_proto_goTypes = []interface{}{ (*SyncAuthorizedEntriesRequest)(nil), // 13: spire.api.server.entry.v1.SyncAuthorizedEntriesRequest (*SyncAuthorizedEntriesResponse)(nil), // 14: spire.api.server.entry.v1.SyncAuthorizedEntriesResponse (*EntryRevision)(nil), // 15: spire.api.server.entry.v1.EntryRevision - (*CountEntriesRequest_Filter)(nil), // 16: spire.api.server.entry.v1.CountEntriesRequest.Filter - (*ListEntriesRequest_Filter)(nil), // 17: spire.api.server.entry.v1.ListEntriesRequest.Filter - (*BatchCreateEntryResponse_Result)(nil), // 18: spire.api.server.entry.v1.BatchCreateEntryResponse.Result - (*BatchUpdateEntryResponse_Result)(nil), // 19: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result - (*BatchDeleteEntryResponse_Result)(nil), // 20: spire.api.server.entry.v1.BatchDeleteEntryResponse.Result - (*types.EntryMask)(nil), // 21: spire.api.types.EntryMask - (*types.Entry)(nil), // 22: spire.api.types.Entry - (*types.SPIFFEID)(nil), // 23: spire.api.types.SPIFFEID - (*types.SelectorMatch)(nil), // 24: spire.api.types.SelectorMatch - (*types.FederatesWithMatch)(nil), // 25: spire.api.types.FederatesWithMatch - (*wrapperspb.StringValue)(nil), // 26: google.protobuf.StringValue - (*wrapperspb.BoolValue)(nil), // 27: google.protobuf.BoolValue - (*types.Status)(nil), // 28: spire.api.types.Status + (*ListEntriesRequest_Filter)(nil), // 16: spire.api.server.entry.v1.ListEntriesRequest.Filter + (*BatchCreateEntryResponse_Result)(nil), // 17: spire.api.server.entry.v1.BatchCreateEntryResponse.Result + (*BatchUpdateEntryResponse_Result)(nil), // 18: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result + (*BatchDeleteEntryResponse_Result)(nil), // 19: spire.api.server.entry.v1.BatchDeleteEntryResponse.Result + (*types.EntryMask)(nil), // 20: spire.api.types.EntryMask + (*types.Entry)(nil), // 21: spire.api.types.Entry + (*types.SPIFFEID)(nil), // 22: spire.api.types.SPIFFEID + (*types.SelectorMatch)(nil), // 23: spire.api.types.SelectorMatch + (*types.FederatesWithMatch)(nil), // 24: spire.api.types.FederatesWithMatch + (*wrapperspb.StringValue)(nil), // 25: google.protobuf.StringValue + (*types.Status)(nil), // 26: spire.api.types.Status } var file_spire_api_server_entry_v1_entry_proto_depIdxs = []int32{ - 16, // 0: spire.api.server.entry.v1.CountEntriesRequest.filter:type_name -> spire.api.server.entry.v1.CountEntriesRequest.Filter - 17, // 1: spire.api.server.entry.v1.ListEntriesRequest.filter:type_name -> spire.api.server.entry.v1.ListEntriesRequest.Filter - 21, // 2: spire.api.server.entry.v1.ListEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask - 22, // 3: spire.api.server.entry.v1.ListEntriesResponse.entries:type_name -> spire.api.types.Entry - 21, // 4: spire.api.server.entry.v1.GetEntryRequest.output_mask:type_name -> spire.api.types.EntryMask - 22, // 5: spire.api.server.entry.v1.BatchCreateEntryRequest.entries:type_name -> spire.api.types.Entry - 21, // 6: spire.api.server.entry.v1.BatchCreateEntryRequest.output_mask:type_name -> spire.api.types.EntryMask - 18, // 7: spire.api.server.entry.v1.BatchCreateEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchCreateEntryResponse.Result - 22, // 8: spire.api.server.entry.v1.BatchUpdateEntryRequest.entries:type_name -> spire.api.types.Entry - 21, // 9: spire.api.server.entry.v1.BatchUpdateEntryRequest.input_mask:type_name -> spire.api.types.EntryMask - 21, // 10: spire.api.server.entry.v1.BatchUpdateEntryRequest.output_mask:type_name -> spire.api.types.EntryMask - 19, // 11: spire.api.server.entry.v1.BatchUpdateEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchUpdateEntryResponse.Result - 20, // 12: spire.api.server.entry.v1.BatchDeleteEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchDeleteEntryResponse.Result - 21, // 13: spire.api.server.entry.v1.GetAuthorizedEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask - 22, // 14: spire.api.server.entry.v1.GetAuthorizedEntriesResponse.entries:type_name -> spire.api.types.Entry - 21, // 15: spire.api.server.entry.v1.SyncAuthorizedEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask - 15, // 16: spire.api.server.entry.v1.SyncAuthorizedEntriesResponse.entry_revisions:type_name -> spire.api.server.entry.v1.EntryRevision - 22, // 17: spire.api.server.entry.v1.SyncAuthorizedEntriesResponse.entries:type_name -> spire.api.types.Entry - 23, // 18: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_spiffe_id:type_name -> spire.api.types.SPIFFEID - 23, // 19: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_parent_id:type_name -> spire.api.types.SPIFFEID - 24, // 20: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_selectors:type_name -> spire.api.types.SelectorMatch - 25, // 21: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_federates_with:type_name -> spire.api.types.FederatesWithMatch - 26, // 22: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_hint:type_name -> google.protobuf.StringValue - 27, // 23: spire.api.server.entry.v1.CountEntriesRequest.Filter.by_downstream:type_name -> google.protobuf.BoolValue - 23, // 24: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_spiffe_id:type_name -> spire.api.types.SPIFFEID - 23, // 25: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_parent_id:type_name -> spire.api.types.SPIFFEID - 24, // 26: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_selectors:type_name -> spire.api.types.SelectorMatch - 25, // 27: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_federates_with:type_name -> spire.api.types.FederatesWithMatch - 26, // 28: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_hint:type_name -> google.protobuf.StringValue - 27, // 29: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_downstream:type_name -> google.protobuf.BoolValue - 28, // 30: spire.api.server.entry.v1.BatchCreateEntryResponse.Result.status:type_name -> spire.api.types.Status - 22, // 31: spire.api.server.entry.v1.BatchCreateEntryResponse.Result.entry:type_name -> spire.api.types.Entry - 28, // 32: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result.status:type_name -> spire.api.types.Status - 22, // 33: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result.entry:type_name -> spire.api.types.Entry - 28, // 34: spire.api.server.entry.v1.BatchDeleteEntryResponse.Result.status:type_name -> spire.api.types.Status - 0, // 35: spire.api.server.entry.v1.Entry.CountEntries:input_type -> spire.api.server.entry.v1.CountEntriesRequest - 2, // 36: spire.api.server.entry.v1.Entry.ListEntries:input_type -> spire.api.server.entry.v1.ListEntriesRequest - 4, // 37: spire.api.server.entry.v1.Entry.GetEntry:input_type -> spire.api.server.entry.v1.GetEntryRequest - 5, // 38: spire.api.server.entry.v1.Entry.BatchCreateEntry:input_type -> spire.api.server.entry.v1.BatchCreateEntryRequest - 7, // 39: spire.api.server.entry.v1.Entry.BatchUpdateEntry:input_type -> spire.api.server.entry.v1.BatchUpdateEntryRequest - 9, // 40: spire.api.server.entry.v1.Entry.BatchDeleteEntry:input_type -> spire.api.server.entry.v1.BatchDeleteEntryRequest - 11, // 41: spire.api.server.entry.v1.Entry.GetAuthorizedEntries:input_type -> spire.api.server.entry.v1.GetAuthorizedEntriesRequest - 13, // 42: spire.api.server.entry.v1.Entry.SyncAuthorizedEntries:input_type -> spire.api.server.entry.v1.SyncAuthorizedEntriesRequest - 1, // 43: spire.api.server.entry.v1.Entry.CountEntries:output_type -> spire.api.server.entry.v1.CountEntriesResponse - 3, // 44: spire.api.server.entry.v1.Entry.ListEntries:output_type -> spire.api.server.entry.v1.ListEntriesResponse - 22, // 45: spire.api.server.entry.v1.Entry.GetEntry:output_type -> spire.api.types.Entry - 6, // 46: spire.api.server.entry.v1.Entry.BatchCreateEntry:output_type -> spire.api.server.entry.v1.BatchCreateEntryResponse - 8, // 47: spire.api.server.entry.v1.Entry.BatchUpdateEntry:output_type -> spire.api.server.entry.v1.BatchUpdateEntryResponse - 10, // 48: spire.api.server.entry.v1.Entry.BatchDeleteEntry:output_type -> spire.api.server.entry.v1.BatchDeleteEntryResponse - 12, // 49: spire.api.server.entry.v1.Entry.GetAuthorizedEntries:output_type -> spire.api.server.entry.v1.GetAuthorizedEntriesResponse - 14, // 50: spire.api.server.entry.v1.Entry.SyncAuthorizedEntries:output_type -> spire.api.server.entry.v1.SyncAuthorizedEntriesResponse - 43, // [43:51] is the sub-list for method output_type - 35, // [35:43] is the sub-list for method input_type - 35, // [35:35] is the sub-list for extension type_name - 35, // [35:35] is the sub-list for extension extendee - 0, // [0:35] is the sub-list for field type_name + 16, // 0: spire.api.server.entry.v1.ListEntriesRequest.filter:type_name -> spire.api.server.entry.v1.ListEntriesRequest.Filter + 20, // 1: spire.api.server.entry.v1.ListEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask + 21, // 2: spire.api.server.entry.v1.ListEntriesResponse.entries:type_name -> spire.api.types.Entry + 20, // 3: spire.api.server.entry.v1.GetEntryRequest.output_mask:type_name -> spire.api.types.EntryMask + 21, // 4: spire.api.server.entry.v1.BatchCreateEntryRequest.entries:type_name -> spire.api.types.Entry + 20, // 5: spire.api.server.entry.v1.BatchCreateEntryRequest.output_mask:type_name -> spire.api.types.EntryMask + 17, // 6: spire.api.server.entry.v1.BatchCreateEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchCreateEntryResponse.Result + 21, // 7: spire.api.server.entry.v1.BatchUpdateEntryRequest.entries:type_name -> spire.api.types.Entry + 20, // 8: spire.api.server.entry.v1.BatchUpdateEntryRequest.input_mask:type_name -> spire.api.types.EntryMask + 20, // 9: spire.api.server.entry.v1.BatchUpdateEntryRequest.output_mask:type_name -> spire.api.types.EntryMask + 18, // 10: spire.api.server.entry.v1.BatchUpdateEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchUpdateEntryResponse.Result + 19, // 11: spire.api.server.entry.v1.BatchDeleteEntryResponse.results:type_name -> spire.api.server.entry.v1.BatchDeleteEntryResponse.Result + 20, // 12: spire.api.server.entry.v1.GetAuthorizedEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask + 21, // 13: spire.api.server.entry.v1.GetAuthorizedEntriesResponse.entries:type_name -> spire.api.types.Entry + 20, // 14: spire.api.server.entry.v1.SyncAuthorizedEntriesRequest.output_mask:type_name -> spire.api.types.EntryMask + 15, // 15: spire.api.server.entry.v1.SyncAuthorizedEntriesResponse.entry_revisions:type_name -> spire.api.server.entry.v1.EntryRevision + 21, // 16: spire.api.server.entry.v1.SyncAuthorizedEntriesResponse.entries:type_name -> spire.api.types.Entry + 22, // 17: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_spiffe_id:type_name -> spire.api.types.SPIFFEID + 22, // 18: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_parent_id:type_name -> spire.api.types.SPIFFEID + 23, // 19: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_selectors:type_name -> spire.api.types.SelectorMatch + 24, // 20: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_federates_with:type_name -> spire.api.types.FederatesWithMatch + 25, // 21: spire.api.server.entry.v1.ListEntriesRequest.Filter.by_hint:type_name -> google.protobuf.StringValue + 26, // 22: spire.api.server.entry.v1.BatchCreateEntryResponse.Result.status:type_name -> spire.api.types.Status + 21, // 23: spire.api.server.entry.v1.BatchCreateEntryResponse.Result.entry:type_name -> spire.api.types.Entry + 26, // 24: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result.status:type_name -> spire.api.types.Status + 21, // 25: spire.api.server.entry.v1.BatchUpdateEntryResponse.Result.entry:type_name -> spire.api.types.Entry + 26, // 26: spire.api.server.entry.v1.BatchDeleteEntryResponse.Result.status:type_name -> spire.api.types.Status + 0, // 27: spire.api.server.entry.v1.Entry.CountEntries:input_type -> spire.api.server.entry.v1.CountEntriesRequest + 2, // 28: spire.api.server.entry.v1.Entry.ListEntries:input_type -> spire.api.server.entry.v1.ListEntriesRequest + 4, // 29: spire.api.server.entry.v1.Entry.GetEntry:input_type -> spire.api.server.entry.v1.GetEntryRequest + 5, // 30: spire.api.server.entry.v1.Entry.BatchCreateEntry:input_type -> spire.api.server.entry.v1.BatchCreateEntryRequest + 7, // 31: spire.api.server.entry.v1.Entry.BatchUpdateEntry:input_type -> spire.api.server.entry.v1.BatchUpdateEntryRequest + 9, // 32: spire.api.server.entry.v1.Entry.BatchDeleteEntry:input_type -> spire.api.server.entry.v1.BatchDeleteEntryRequest + 11, // 33: spire.api.server.entry.v1.Entry.GetAuthorizedEntries:input_type -> spire.api.server.entry.v1.GetAuthorizedEntriesRequest + 13, // 34: spire.api.server.entry.v1.Entry.SyncAuthorizedEntries:input_type -> spire.api.server.entry.v1.SyncAuthorizedEntriesRequest + 1, // 35: spire.api.server.entry.v1.Entry.CountEntries:output_type -> spire.api.server.entry.v1.CountEntriesResponse + 3, // 36: spire.api.server.entry.v1.Entry.ListEntries:output_type -> spire.api.server.entry.v1.ListEntriesResponse + 21, // 37: spire.api.server.entry.v1.Entry.GetEntry:output_type -> spire.api.types.Entry + 6, // 38: spire.api.server.entry.v1.Entry.BatchCreateEntry:output_type -> spire.api.server.entry.v1.BatchCreateEntryResponse + 8, // 39: spire.api.server.entry.v1.Entry.BatchUpdateEntry:output_type -> spire.api.server.entry.v1.BatchUpdateEntryResponse + 10, // 40: spire.api.server.entry.v1.Entry.BatchDeleteEntry:output_type -> spire.api.server.entry.v1.BatchDeleteEntryResponse + 12, // 41: spire.api.server.entry.v1.Entry.GetAuthorizedEntries:output_type -> spire.api.server.entry.v1.GetAuthorizedEntriesResponse + 14, // 42: spire.api.server.entry.v1.Entry.SyncAuthorizedEntries:output_type -> spire.api.server.entry.v1.SyncAuthorizedEntriesResponse + 35, // [35:43] is the sub-list for method output_type + 27, // [27:35] is the sub-list for method input_type + 27, // [27:27] is the sub-list for extension type_name + 27, // [27:27] is the sub-list for extension extendee + 0, // [0:27] is the sub-list for field type_name } func init() { file_spire_api_server_entry_v1_entry_proto_init() } @@ -1836,18 +1687,6 @@ func file_spire_api_server_entry_v1_entry_proto_init() { } } file_spire_api_server_entry_v1_entry_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountEntriesRequest_Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_spire_api_server_entry_v1_entry_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListEntriesRequest_Filter); i { case 0: return &v.state @@ -1859,7 +1698,7 @@ func file_spire_api_server_entry_v1_entry_proto_init() { return nil } } - file_spire_api_server_entry_v1_entry_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_spire_api_server_entry_v1_entry_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchCreateEntryResponse_Result); i { case 0: return &v.state @@ -1871,7 +1710,7 @@ func file_spire_api_server_entry_v1_entry_proto_init() { return nil } } - file_spire_api_server_entry_v1_entry_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_spire_api_server_entry_v1_entry_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchUpdateEntryResponse_Result); i { case 0: return &v.state @@ -1883,7 +1722,7 @@ func file_spire_api_server_entry_v1_entry_proto_init() { return nil } } - file_spire_api_server_entry_v1_entry_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_spire_api_server_entry_v1_entry_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchDeleteEntryResponse_Result); i { case 0: return &v.state @@ -1902,7 +1741,7 @@ func file_spire_api_server_entry_v1_entry_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_spire_api_server_entry_v1_entry_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.proto b/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.proto index 2b56b80b878..aab4f13b828 100644 --- a/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.proto +++ b/upstream/vendor/github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1/entry.proto @@ -68,17 +68,6 @@ service Entry { } message CountEntriesRequest { - message Filter { - spire.api.types.SPIFFEID by_spiffe_id = 1; - spire.api.types.SPIFFEID by_parent_id = 2; - spire.api.types.SelectorMatch by_selectors = 3; - spire.api.types.FederatesWithMatch by_federates_with = 4; - google.protobuf.StringValue by_hint = 5; - google.protobuf.BoolValue by_downstream = 6; - } - - // Filters the entries returned in the response. - Filter filter = 1; } message CountEntriesResponse { @@ -92,7 +81,6 @@ message ListEntriesRequest { spire.api.types.SelectorMatch by_selectors = 3; spire.api.types.FederatesWithMatch by_federates_with = 4; google.protobuf.StringValue by_hint = 5; - google.protobuf.BoolValue by_downstream = 6; } // Filters the entries returned in the response. diff --git a/upstream/vendor/go.opentelemetry.io/otel/.codespellignore b/upstream/vendor/go.opentelemetry.io/otel/.codespellignore index 6bf3abc41e7..120b63a9c7d 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/.codespellignore +++ b/upstream/vendor/go.opentelemetry.io/otel/.codespellignore @@ -5,5 +5,3 @@ collison consequentially ans nam -valu -thirdparty diff --git a/upstream/vendor/go.opentelemetry.io/otel/.codespellrc b/upstream/vendor/go.opentelemetry.io/otel/.codespellrc index e2cb3ea944b..4afbb1fb3bd 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/.codespellrc +++ b/upstream/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,go.work,go.work.sum,semconv,venv,.tools +skip = .git,go.mod,go.sum,semconv,venv,.tools uri-ignore-words-list = * write = diff --git a/upstream/vendor/go.opentelemetry.io/otel/.gitmodules b/upstream/vendor/go.opentelemetry.io/otel/.gitmodules new file mode 100644 index 00000000000..38a1f56982b --- /dev/null +++ b/upstream/vendor/go.opentelemetry.io/otel/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opentelemetry-proto"] + path = exporters/otlp/internal/opentelemetry-proto + url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/upstream/vendor/go.opentelemetry.io/otel/.golangci.yml b/upstream/vendor/go.opentelemetry.io/otel/.golangci.yml index 6d9c8b64958..a62511f382e 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/.golangci.yml +++ b/upstream/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -11,7 +11,6 @@ linters: enable: - depguard - errcheck - - errorlint - godot - gofumpt - goimports @@ -22,11 +21,8 @@ linters: - misspell - revive - staticcheck - - tenv - typecheck - - unconvert - unused - - unparam issues: # Maximum issues count per one linter. @@ -128,8 +124,6 @@ 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/upstream/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/upstream/vendor/go.opentelemetry.io/otel/CHANGELOG.md index c01e6998e0b..cb28b36b995 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/upstream/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -8,83 +8,6 @@ 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 @@ -110,11 +33,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - 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 @@ -292,7 +210,7 @@ See our [versioning policy](VERSIONING.md) for more information about these stab ## [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. +This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. ### Added @@ -324,15 +242,15 @@ This release brings a breaking change for custom trace API implementations. Some - `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583) - The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type. This extends the `TracerProvider` interface and is is a breaking change for any existing implementation. - Implementers need to update their implementations based on what they want the default behavior of the interface to be. + Implementors 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. + Implementors 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. + Implementors 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) @@ -968,7 +886,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 aggregation. (#3408) +- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#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) @@ -2013,7 +1931,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 reuse its slice of buckets. (#1435) +- Optimize metric histogram aggregator to re-use 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) @@ -3003,9 +2921,7 @@ 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.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 +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.26.0...HEAD [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 diff --git a/upstream/vendor/go.opentelemetry.io/otel/CODEOWNERS b/upstream/vendor/go.opentelemetry.io/otel/CODEOWNERS index 20255493323..31d336d9222 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/CODEOWNERS +++ b/upstream/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -12,6 +12,6 @@ # https://help.github.com/en/articles/about-code-owners # -* @MrAlias @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu +* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu -CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole @XSAM @dmathieu +CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole \ No newline at end of file diff --git a/upstream/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/upstream/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md index b86572f58ea..7847b459088 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md +++ b/upstream/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -570,9 +570,6 @@ 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. @@ -628,15 +625,17 @@ should be canceled. ### Approvers +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics - [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 +- [Aaron Clawson](https://github.com/MadVikingGod), LightStep - [Robert Pająk](https://github.com/pellared), Splunk -- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics - [Tyler Yahn](https://github.com/MrAlias), Splunk ### Emeritus @@ -644,8 +643,6 @@ should be canceled. - [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/upstream/vendor/go.opentelemetry.io/otel/Makefile b/upstream/vendor/go.opentelemetry.io/otel/Makefile index f33619f76a2..ca2f0ad037c 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/Makefile +++ b/upstream/vendor/go.opentelemetry.io/otel/Makefile @@ -14,8 +14,8 @@ TIMEOUT = 60 .DEFAULT_GOAL := precommit .PHONY: precommit ci -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 +precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes test-default +ci: generate dependabot-check license-check lint vanity-import-check verify-readmes build test-default check-clean-work-tree test-coverage # Tools @@ -39,6 +39,9 @@ $(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 @@ -67,7 +70,7 @@ GOVULNCHECK = $(TOOLS)/govulncheck $(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck .PHONY: tools -tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) +tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) # Virtualized python tools via docker @@ -249,6 +252,15 @@ 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 \ @@ -264,7 +276,10 @@ SEMCONVPKG ?= "semconv/" 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)" @@ -277,20 +292,16 @@ gorelease/%:| $(GORELEASE) && $(GORELEASE) \ || echo "" -.PHONY: verify-mods -verify-mods: $(MULTIMOD) - $(MULTIMOD) verify - .PHONY: prerelease -prerelease: verify-mods +prerelease: $(MULTIMOD) @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) - $(MULTIMOD) prerelease -m ${MODSET} + $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET} COMMIT ?= "HEAD" .PHONY: add-tags -add-tags: verify-mods +add-tags: $(MULTIMOD) @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) - $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} + $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} .PHONY: lint-markdown lint-markdown: diff --git a/upstream/vendor/go.opentelemetry.io/otel/README.md b/upstream/vendor/go.opentelemetry.io/otel/README.md index 5a890931731..47f9a41f66d 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/README.md +++ b/upstream/vendor/go.opentelemetry.io/otel/README.md @@ -15,7 +15,7 @@ It provides a set of APIs to directly measure performance and behavior of your s |---------|--------------------| | Traces | Stable | | Metrics | Stable | -| Logs | Beta[^1] | +| Logs | In development[^1] | Progress and status specific to this repository is tracked in our [project boards](https://github.com/open-telemetry/opentelemetry-go/projects) @@ -97,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 | Logs | Metrics | Traces | -|---------------------------------------|:----:|:-------:|:------:| -| [OTLP](./exporters/otlp/) | ✓ | ✓ | ✓ | -| [Prometheus](./exporters/prometheus/) | | ✓ | | -| [stdout](./exporters/stdout/) | ✓ | ✓ | ✓ | -| [Zipkin](./exporters/zipkin/) | | | ✓ | +| Exporter | Metrics | Traces | +|---------------------------------------|:-------:|:------:| +| [OTLP](./exporters/otlp/) | ✓ | ✓ | +| [Prometheus](./exporters/prometheus/) | ✓ | | +| [stdout](./exporters/stdout/) | ✓ | ✓ | +| [Zipkin](./exporters/zipkin/) | | ✓ | ## Contributing diff --git a/upstream/vendor/go.opentelemetry.io/otel/RELEASING.md b/upstream/vendor/go.opentelemetry.io/otel/RELEASING.md index 940f57f3d87..d2691d0bd8b 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/RELEASING.md +++ b/upstream/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -27,12 +27,6 @@ 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 diff --git a/upstream/vendor/go.opentelemetry.io/otel/attribute/value.go b/upstream/vendor/go.opentelemetry.io/otel/attribute/value.go index 9ea0ecbbd27..b320314133a 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/attribute/value.go +++ b/upstream/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -231,27 +231,15 @@ func (v Value) Emit() string { case BOOL: return strconv.FormatBool(v.AsBool()) case INT64SLICE: - j, err := json.Marshal(v.asInt64Slice()) - if err != nil { - return fmt.Sprintf("invalid: %v", v.asInt64Slice()) - } - return string(j) + return fmt.Sprint(v.asInt64Slice()) case INT64: return strconv.FormatInt(v.AsInt64(), 10) case FLOAT64SLICE: - j, err := json.Marshal(v.asFloat64Slice()) - if err != nil { - return fmt.Sprintf("invalid: %v", v.asFloat64Slice()) - } - return string(j) + return fmt.Sprint(v.asFloat64Slice()) case FLOAT64: return fmt.Sprint(v.AsFloat64()) case STRINGSLICE: - j, err := json.Marshal(v.asStringSlice()) - if err != nil { - return fmt.Sprintf("invalid: %v", v.asStringSlice()) - } - return string(j) + return fmt.Sprint(v.asStringSlice()) case STRING: return v.stringly default: diff --git a/upstream/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/upstream/vendor/go.opentelemetry.io/otel/baggage/baggage.go index c40c896cc66..75773bc1ce9 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/baggage/baggage.go +++ b/upstream/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -302,7 +302,7 @@ func parseMember(member string) (Member, error) { // Decode a percent-encoded value. value, err := url.PathUnescape(val) if err != nil { - return newInvalidMember(), fmt.Errorf("%w: %w", errInvalidValue, err) + return newInvalidMember(), fmt.Errorf("%w: %v", errInvalidValue, err) } return Member{key: key, value: value, properties: props, hasData: true}, nil } @@ -335,9 +335,9 @@ func (m Member) String() string { // 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) + s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, valueEscape(m.value)) if len(m.properties) > 0 { - s += propertyDelimiter + m.properties.String() + s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String()) } return s } @@ -735,7 +735,7 @@ func validateKey(s string) bool { } func validateKeyChar(c int32) bool { - return c >= 0 && c < int32(utf8.RuneSelf) && safeKeyCharset[c] + return c >= 0 && c <= int32(utf8.RuneSelf) && safeKeyCharset[c] } func validateValue(s string) bool { @@ -850,7 +850,7 @@ var safeValueCharset = [utf8.RuneSelf]bool{ } func validateValueChar(c int32) bool { - return c >= 0 && c < int32(utf8.RuneSelf) && safeValueCharset[c] + return c >= 0 && c <= int32(utf8.RuneSelf) && safeValueCharset[c] } // valueEscape escapes the string so it can be safely placed inside a baggage value, diff --git a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go index 2ebbc752f4b..45fefc4dd8c 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go +++ b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go @@ -256,9 +256,6 @@ 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 @@ -266,8 +263,6 @@ 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) diff --git a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go index 6497f3ccdd0..4b2758e4e51 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go +++ b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go @@ -56,15 +56,12 @@ func (w wrappedOption) applyHTTPOption(cfg otlpconfig.Config) otlpconfig.Config return w.ApplyHTTPOption(cfg) } -// WithEndpoint sets the target endpoint (host and port) the Exporter will -// connect to. The provided endpoint should resemble "example.com:4318" (no -// scheme or path). +// WithEndpoint sets the target endpoint the Exporter will connect to. // -// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT +// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_METRICS_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. Note, both environment variables include the full -// scheme and path, while WithEndpoint sets only the host and port. +// will take precedence. // // If both this option and WithEndpointURL are used, the last used option will // take precedence. @@ -77,10 +74,9 @@ 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. +// WithEndpointURL sets the target endpoint URL the Exporter will connect to. // -// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT +// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_METRICS_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. diff --git a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go index fc7190d940a..f07a809f0e4 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go +++ b/upstream/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go @@ -5,5 +5,5 @@ 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.27.0" + return "1.26.0" } diff --git a/upstream/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/upstream/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go index 822d8479474..f32766e57f6 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go +++ b/upstream/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go @@ -14,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))).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v) + return cp.Elem().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))).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v) + return cp.Elem().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))).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v) + return cp.Elem().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))).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v) + return cp.Elem().Interface() } // AsBoolSlice converts a bool array into a slice into with same elements as array. diff --git a/upstream/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/upstream/vendor/go.opentelemetry.io/otel/internal/global/instruments.go index 3a0cc42f6a4..0c8ed20a596 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/internal/global/instruments.go +++ b/upstream/vendor/go.opentelemetry.io/otel/internal/global/instruments.go @@ -281,32 +281,6 @@ 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 @@ -384,29 +358,3 @@ 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/upstream/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/upstream/vendor/go.opentelemetry.io/otel/internal/global/meter.go index cfd1df9bfa2..f21898591e5 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/internal/global/meter.go +++ b/upstream/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -65,7 +65,6 @@ 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 { @@ -165,17 +164,6 @@ 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...) @@ -242,17 +230,6 @@ 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/upstream/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/upstream/vendor/go.opentelemetry.io/otel/internal/global/trace.go index e31f442b48f..596f716f40c 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/internal/global/trace.go +++ b/upstream/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -86,7 +86,6 @@ 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 { @@ -102,7 +101,10 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T return t } -type il struct{ name, version, schema string } +type il struct { + name string + version string +} // tracer is a placeholder for a trace.Tracer. // diff --git a/upstream/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/upstream/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go index cf23db77803..c7234f4bc8d 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -39,7 +39,7 @@ type Float64ObservableCounter interface { } // Float64ObservableCounterConfig contains options for asynchronous counter -// instruments that record float64 values. +// instruments that record int64 values. type Float64ObservableCounterConfig struct { description string unit string @@ -97,7 +97,7 @@ type Float64ObservableUpDownCounter interface { } // Float64ObservableUpDownCounterConfig contains options for asynchronous -// counter instruments that record float64 values. +// counter instruments that record int64 values. type Float64ObservableUpDownCounterConfig struct { description string unit string @@ -154,7 +154,7 @@ type Float64ObservableGauge interface { } // Float64ObservableGaugeConfig contains options for asynchronous counter -// instruments that record float64 values. +// instruments that record int64 values. type Float64ObservableGaugeConfig struct { description string unit string diff --git a/upstream/vendor/go.opentelemetry.io/otel/metric/doc.go b/upstream/vendor/go.opentelemetry.io/otel/metric/doc.go index f153745b005..075234b3380 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/doc.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/doc.go @@ -57,23 +57,6 @@ 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 @@ -170,7 +153,6 @@ 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/upstream/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/upstream/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go index 1a9dc68093f..15bebae084a 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go @@ -102,16 +102,6 @@ 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]. // @@ -184,16 +174,6 @@ 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/upstream/vendor/go.opentelemetry.io/otel/metric/instrument.go b/upstream/vendor/go.opentelemetry.io/otel/metric/instrument.go index ea52e402331..451413192a9 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/instrument.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/instrument.go @@ -16,7 +16,6 @@ type InstrumentOption interface { Int64CounterOption Int64UpDownCounterOption Int64HistogramOption - Int64GaugeOption Int64ObservableCounterOption Int64ObservableUpDownCounterOption Int64ObservableGaugeOption @@ -24,7 +23,6 @@ type InstrumentOption interface { Float64CounterOption Float64UpDownCounterOption Float64HistogramOption - Float64GaugeOption Float64ObservableCounterOption Float64ObservableUpDownCounterOption Float64ObservableGaugeOption @@ -53,11 +51,6 @@ 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 @@ -88,11 +81,6 @@ 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 @@ -128,11 +116,6 @@ 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 @@ -163,11 +146,6 @@ func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi return c } -func (o unitOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig { - c.unit = string(o) - return c -} - func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { c.unit = string(o) return c diff --git a/upstream/vendor/go.opentelemetry.io/otel/metric/meter.go b/upstream/vendor/go.opentelemetry.io/otel/metric/meter.go index 6a7991e0151..7aa82e0c17b 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/meter.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -47,37 +47,17 @@ 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 @@ -87,10 +67,6 @@ 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 @@ -101,10 +77,6 @@ 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 @@ -115,47 +87,23 @@ 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 @@ -165,10 +113,6 @@ 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 @@ -179,10 +123,6 @@ 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 @@ -193,10 +133,6 @@ 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/upstream/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/upstream/vendor/go.opentelemetry.io/otel/metric/noop/noop.go index ca6fcbdc099..4524a57d251 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/noop/noop.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/noop/noop.go @@ -32,8 +32,6 @@ var ( _ metric.Float64UpDownCounter = Float64UpDownCounter{} _ metric.Int64Histogram = Int64Histogram{} _ metric.Float64Histogram = Float64Histogram{} - _ metric.Int64Gauge = Int64Gauge{} - _ metric.Float64Gauge = Float64Gauge{} _ metric.Int64ObservableCounter = Int64ObservableCounter{} _ metric.Float64ObservableCounter = Float64ObservableCounter{} _ metric.Int64ObservableGauge = Int64ObservableGauge{} @@ -78,12 +76,6 @@ func (Meter) Int64Histogram(string, ...metric.Int64HistogramOption) (metric.Int6 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) { @@ -120,12 +112,6 @@ func (Meter) Float64Histogram(string, ...metric.Float64HistogramOption) (metric. 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) { @@ -211,20 +197,6 @@ 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 { diff --git a/upstream/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/upstream/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go index 8403a4bad2d..5420d546eb7 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go @@ -28,7 +28,7 @@ type Float64Counter interface { } // Float64CounterConfig contains options for synchronous counter instruments that -// record float64 values. +// record int64 values. type Float64CounterConfig struct { description string unit string @@ -81,7 +81,7 @@ type Float64UpDownCounter interface { } // Float64UpDownCounterConfig contains options for synchronous counter -// instruments that record float64 values. +// instruments that record int64 values. type Float64UpDownCounterConfig struct { description string unit string @@ -133,8 +133,8 @@ type Float64Histogram interface { Record(ctx context.Context, incr float64, options ...RecordOption) } -// Float64HistogramConfig contains options for synchronous histogram -// instruments that record float64 values. +// Float64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. type Float64HistogramConfig struct { description string unit string @@ -172,55 +172,3 @@ func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 { type Float64HistogramOption interface { applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig } - -// Float64Gauge is an instrument that records instantaneous float64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64Gauge interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64Gauge - - // Record records the instantaneous value. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Record(ctx context.Context, value float64, options ...RecordOption) -} - -// Float64GaugeConfig contains options for synchronous gauge instruments that -// record float64 values. -type Float64GaugeConfig struct { - description string - unit string -} - -// NewFloat64GaugeConfig returns a new [Float64GaugeConfig] with all opts -// applied. -func NewFloat64GaugeConfig(opts ...Float64GaugeOption) Float64GaugeConfig { - var config Float64GaugeConfig - for _, o := range opts { - config = o.applyFloat64Gauge(config) - } - return config -} - -// Description returns the configured description. -func (c Float64GaugeConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64GaugeConfig) Unit() string { - return c.unit -} - -// Float64GaugeOption applies options to a [Float64GaugeConfig]. See -// [InstrumentOption] for other options that can be used as a -// Float64GaugeOption. -type Float64GaugeOption interface { - applyFloat64Gauge(Float64GaugeConfig) Float64GaugeConfig -} diff --git a/upstream/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/upstream/vendor/go.opentelemetry.io/otel/metric/syncint64.go index 783fdfba773..0dcbf06db99 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/metric/syncint64.go +++ b/upstream/vendor/go.opentelemetry.io/otel/metric/syncint64.go @@ -133,7 +133,7 @@ type Int64Histogram interface { Record(ctx context.Context, incr int64, options ...RecordOption) } -// Int64HistogramConfig contains options for synchronous histogram instruments +// Int64HistogramConfig contains options for synchronous counter instruments // that record int64 values. type Int64HistogramConfig struct { description string @@ -172,55 +172,3 @@ func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 { type Int64HistogramOption interface { applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig } - -// Int64Gauge is an instrument that records instantaneous int64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64Gauge interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64Gauge - - // Record records the instantaneous value. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Record(ctx context.Context, value int64, options ...RecordOption) -} - -// Int64GaugeConfig contains options for synchronous gauge instruments that -// record int64 values. -type Int64GaugeConfig struct { - description string - unit string -} - -// NewInt64GaugeConfig returns a new [Int64GaugeConfig] with all opts -// applied. -func NewInt64GaugeConfig(opts ...Int64GaugeOption) Int64GaugeConfig { - var config Int64GaugeConfig - for _, o := range opts { - config = o.applyInt64Gauge(config) - } - return config -} - -// Description returns the configured description. -func (c Int64GaugeConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64GaugeConfig) Unit() string { - return c.unit -} - -// Int64GaugeOption applies options to a [Int64GaugeConfig]. See -// [InstrumentOption] for other options that can be used as a -// Int64GaugeOption. -type Int64GaugeOption interface { - applyInt64Gauge(Int64GaugeConfig) Int64GaugeConfig -} diff --git a/upstream/vendor/go.opentelemetry.io/otel/renovate.json b/upstream/vendor/go.opentelemetry.io/otel/renovate.json deleted file mode 100644 index 8c5ac55ca93..00000000000 --- a/upstream/vendor/go.opentelemetry.io/otel/renovate.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$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/upstream/vendor/go.opentelemetry.io/otel/requirements.txt b/upstream/vendor/go.opentelemetry.io/otel/requirements.txt index ab09daf9d53..e0a43e13840 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/requirements.txt +++ b/upstream/vendor/go.opentelemetry.io/otel/requirements.txt @@ -1 +1 @@ -codespell==2.3.0 +codespell==2.2.6 diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go index 07923ed8d94..7eaa0769602 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go @@ -22,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 - // BatchSpanProcessorMaxQueueSize. + // EnvBatchSpanProcessorMaxQueueSize. BatchSpanProcessorMaxExportBatchSizeKey = "OTEL_BSP_MAX_EXPORT_BATCH_SIZE" // AttributeValueLengthKey is the maximum allowed attribute value size. diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go new file mode 100644 index 00000000000..1fc19d3fe3f --- /dev/null +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go @@ -0,0 +1,18 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +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/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go new file mode 100644 index 00000000000..a990092f9d1 --- /dev/null +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/otel/sdk/internal" + +import "time" + +// MonotonicEndTime returns the end time at present +// but offset from start, monotonically. +// +// The monotonic clock is used in subtractions hence +// the duration since start added back to start gives +// end as a monotonic time. +// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks +func MonotonicEndTime(start time.Time) time.Time { + return start.Add(time.Since(start)) +} diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md deleted file mode 100644 index fab61647c2d..00000000000 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go deleted file mode 100644 index 68d296cbed3..00000000000 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go +++ /dev/null @@ -1,66 +0,0 @@ -// 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/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go index 6ac1cdbf7b4..488cabc439a 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go @@ -9,11 +9,9 @@ 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.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type ( @@ -38,8 +36,6 @@ type ( } defaultServiceNameDetector struct{} - - defaultServiceInstanceIDDetector struct{} ) var ( @@ -47,7 +43,6 @@ var ( _ Detector = host{} _ Detector = stringDetector{} _ Detector = defaultServiceNameDetector{} - _ Detector = defaultServiceInstanceIDDetector{} ) // Detect returns a *Resource that describes the OpenTelemetry SDK used. @@ -100,19 +95,3 @@ 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/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/container.go index 5ecd859a52d..f3eeb45aca3 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/container.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/container.go @@ -11,7 +11,7 @@ import ( "os" "regexp" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type containerIDProvider func() (string, error) diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/env.go index 813f0562424..7b221c703f7 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/env.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/env.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) const ( diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go index 2d0f65498a0..5acbec23d92 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go @@ -8,7 +8,7 @@ import ( "errors" "strings" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type hostIDProvider func() (string, error) diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/os.go index 8a48ab4fa32..cf0165a645b 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/os.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/os.go @@ -8,7 +8,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type osDescriptionProvider func() (string, error) diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/process.go index 085fe68fd77..8ba4e9a45cd 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/process.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/process.go @@ -11,7 +11,7 @@ import ( "path/filepath" "runtime" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type ( diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go index ad4b50df404..9f1af3a236d 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go @@ -11,7 +11,6 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/sdk/internal/x" ) // Resource describes an entity about which identifying information @@ -219,17 +218,11 @@ func Empty() *Resource { func Default() *Resource { defaultResourceOnce.Do(func() { var err error - defaultDetectors := []Detector{ + defaultResource, err = Detect( + context.Background(), 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/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go index 1d399a75db2..8a89fffdb4a 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go @@ -381,7 +381,7 @@ func (bsp *batchSpanProcessor) enqueueBlockOnQueueFull(ctx context.Context, sd R } } -func (bsp *batchSpanProcessor) enqueueDrop(_ context.Context, sd ReadOnlySpan) bool { +func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan) bool { if !sd.SpanContext().IsSampled() { return false } diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go index 821c83faa1d..69eb2fdfce3 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go @@ -3,43 +3,23 @@ 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[T any] struct { - queue []T +type evictedQueue struct { + queue []interface{} capacity int droppedCount int - logDropped func() } -func newEvictedQueueEvent(capacity int) evictedQueue[Event] { +func newEvictedQueue(capacity int) evictedQueue { // Do not pre-allocate queue, do this lazily. - 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") }), - } + return evictedQueue{capacity: capacity} } // 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[T]) add(value T) { +func (eq *evictedQueue) add(value interface{}) { if eq.capacity == 0 { eq.droppedCount++ - eq.logDropped() return } @@ -48,12 +28,6 @@ func (eq *evictedQueue[T]) add(value T) { 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/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go index 925bcf99305..f9633d8c576 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go @@ -41,12 +41,7 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace gen.Lock() defer gen.Unlock() sid := trace.SpanID{} - for { - _, _ = gen.randSource.Read(sid[:]) - if sid.IsValid() { - break - } - } + _, _ = gen.randSource.Read(sid[:]) return sid } @@ -56,19 +51,9 @@ 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{} - for { - _, _ = gen.randSource.Read(tid[:]) - if tid.IsValid() { - break - } - } - for { - _, _ = gen.randSource.Read(sid[:]) - if sid.IsValid() { - break - } - } + _, _ = gen.randSource.Read(sid[:]) return tid, sid } diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go index 14c2e5bebda..dec237ca731 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go @@ -291,7 +291,7 @@ func (p *TracerProvider) Shutdown(ctx context.Context) error { retErr = err } else { // Poor man's list of errors - retErr = fmt.Errorf("%w; %w", retErr, err) + retErr = fmt.Errorf("%v; %v", retErr, err) } } } diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/span.go index ac90f1a2600..c44f6b926aa 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/span.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/span.go @@ -17,10 +17,10 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/internal" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" ) @@ -137,13 +137,12 @@ 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[Event] + events evictedQueue // links are stored in FIFO queue capped by configured limit. - links evictedQueue[Link] + links evictedQueue // executionTracerTaskEnd ends the execution tracer span. executionTracerTaskEnd func() @@ -220,7 +219,7 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { limit := s.tracer.provider.spanLimits.AttributeCountLimit if limit == 0 { // No attributes allowed. - s.addDroppedAttr(len(attributes)) + s.droppedAttributes += len(attributes) return } @@ -237,7 +236,7 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { for _, a := range attributes { if !a.Valid() { // Drop all invalid attributes. - s.addDroppedAttr(1) + s.droppedAttributes++ continue } a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a) @@ -245,22 +244,6 @@ 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. @@ -290,7 +273,7 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) { for _, a := range attrs { if !a.Valid() { // Drop all invalid attributes. - s.addDroppedAttr(1) + s.droppedAttributes++ continue } @@ -303,7 +286,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.addDroppedAttr(1) + s.droppedAttributes++ } else { a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a) s.attributes = append(s.attributes, a) @@ -384,7 +367,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 := monotonicEndTime(s.startTime) + et := internal.MonotonicEndTime(s.startTime) // Do relative expensive check now that we have an end time and see if we // need to do any more processing. @@ -435,16 +418,6 @@ 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 @@ -612,7 +585,7 @@ func (s *recordingSpan) Links() []Link { if len(s.links.queue) == 0 { return []Link{} } - return s.links.copy() + return s.interfaceArrayToLinksArray() } // Events returns the events of this span. @@ -622,7 +595,7 @@ func (s *recordingSpan) Events() []Event { if len(s.events.queue) == 0 { return []Event{} } - return s.events.copy() + return s.interfaceArrayToEventArray() } // Status returns the status of this span. @@ -657,11 +630,7 @@ func (s *recordingSpan) Resource() *resource.Resource { } func (s *recordingSpan) AddLink(link trace.Link) { - if !s.IsRecording() { - return - } - if !link.SpanContext.IsValid() && len(link.Attributes) == 0 && - link.SpanContext.TraceState().Len() == 0 { + if !s.IsRecording() || !link.SpanContext.IsValid() { return } @@ -744,16 +713,32 @@ func (s *recordingSpan) snapshot() ReadOnlySpan { } sd.droppedAttributeCount = s.droppedAttributes if len(s.events.queue) > 0 { - sd.events = s.events.copy() + sd.events = s.interfaceArrayToEventArray() sd.droppedEventCount = s.events.droppedCount } if len(s.links.queue) > 0 { - sd.links = s.links.copy() + sd.links = s.interfaceArrayToLinksArray() 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 diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go index 43419d3b541..3668b1387d0 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go @@ -132,8 +132,8 @@ func (tr *tracer) newRecordingSpan(psc, sc trace.SpanContext, name string, sr Sa spanKind: trace.ValidateSpanKind(config.SpanKind()), name: name, startTime: startTime, - events: newEvictedQueueEvent(tr.provider.spanLimits.EventCountLimit), - links: newEvictedQueueLink(tr.provider.spanLimits.LinkCountLimit), + events: newEvictedQueue(tr.provider.spanLimits.EventCountLimit), + links: newEvictedQueue(tr.provider.spanLimits.LinkCountLimit), tracer: tr, } diff --git a/upstream/vendor/go.opentelemetry.io/otel/sdk/version.go b/upstream/vendor/go.opentelemetry.io/otel/sdk/version.go index 33d065a7cb9..ec425157b6c 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/sdk/version.go +++ b/upstream/vendor/go.opentelemetry.io/otel/sdk/version.go @@ -5,5 +5,5 @@ 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.28.0" + return "1.26.0" } diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md new file mode 100644 index 00000000000..0b6cbe960cb --- /dev/null +++ b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md @@ -0,0 +1,3 @@ +# Semconv v1.24.0 + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.24.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.24.0) diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go new file mode 100644 index 00000000000..6e688345cbb --- /dev/null +++ b/upstream/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/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go similarity index 96% rename from upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go rename to upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go index d031bbea784..d27e8a8f8b3 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go +++ b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go @@ -4,6 +4,6 @@ // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the v1.26.0 +// 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.26.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go new file mode 100644 index 00000000000..6c019aafc3e --- /dev/null +++ b/upstream/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/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go similarity index 98% rename from upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go rename to upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go index bfaee0d56e3..7235bb51d9a 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go +++ b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" const ( // ExceptionEventName is the name of the Span event representing an exception. diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go similarity index 77% rename from upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go rename to upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go index fcdb9f48596..a6b953f625e 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go +++ b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go @@ -3,259 +3,109 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.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 + // 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 - 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." + 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 - // deprecated, use `db.client.connection.idle.max` instead. + // maximum number of idle open connections allowed. // Instrument: updowncounter // Unit: {connection} // Stability: Experimental DBClientConnectionsIdleMaxName = "db.client.connections.idle.max" DBClientConnectionsIdleMaxUnit = "{connection}" - DBClientConnectionsIdleMaxDescription = "Deprecated, use `db.client.connection.idle.max` instead." + 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 - // deprecated, use `db.client.connection.idle.min` instead. + // minimum number of idle open connections allowed. // Instrument: updowncounter // Unit: {connection} // Stability: Experimental DBClientConnectionsIdleMinName = "db.client.connections.idle.min" DBClientConnectionsIdleMinUnit = "{connection}" - DBClientConnectionsIdleMinDescription = "Deprecated, use `db.client.connection.idle.min` instead." + 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 - // deprecated, use `db.client.connection.max` instead. + // "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 = "Deprecated, use `db.client.connection.max` instead." + 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 deprecated, use `db.client.connection.pending_requests` instead. + // 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 = "Deprecated, use `db.client.connection.pending_requests` instead." + 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 - // deprecated, use `db.client.connection.timeouts` instead. + // 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 = "Deprecated, use `db.client.connection.timeouts` instead." + 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 - // deprecated, use `db.client.connection.create_time` instead. Note: the unit - // also changed from `ms` to `s`. + // time it took to create a new connection. // 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`." + 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 - // deprecated, use `db.client.connection.wait_time` instead. Note: the unit - // also changed from `ms` to `s`. + // 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 = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`." + 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 - // deprecated, use `db.client.connection.use_time` instead. Note: the unit also - // changed from `ms` to `s`. + // 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 = "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." + 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: Stable + // Stability: Experimental AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts" AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}" AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint." @@ -265,7 +115,7 @@ const ( // number of exceptions caught by exception handling middleware. // Instrument: counter // Unit: {exception} - // Stability: Stable + // Stability: Experimental AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions" AspnetcoreDiagnosticsExceptionsUnit = "{exception}" AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware." @@ -276,7 +126,7 @@ const ( // that hold a rate limiting lease. // Instrument: updowncounter // Unit: {request} - // Stability: Stable + // 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." @@ -287,7 +137,7 @@ const ( // server. // Instrument: histogram // Unit: s - // Stability: Stable + // Stability: Experimental AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration" AspnetcoreRateLimitingRequestLeaseDurationUnit = "s" AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server." @@ -298,7 +148,7 @@ const ( // limiting lease. // Instrument: histogram // Unit: s - // Stability: Stable + // 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." @@ -309,7 +159,7 @@ const ( // acquire a rate limiting lease. // Instrument: updowncounter // Unit: {request} - // Stability: Stable + // 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." @@ -319,17 +169,69 @@ const ( // number of requests that tried to acquire a rate limiting lease. // Instrument: counter // Unit: {request} - // Stability: Stable + // 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: Stable + // Stability: Experimental KestrelActiveConnectionsName = "kestrel.active_connections" KestrelActiveConnectionsUnit = "{connection}" KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server." @@ -339,7 +241,7 @@ const ( // duration of connections on the server. // Instrument: histogram // Unit: s - // Stability: Stable + // Stability: Experimental KestrelConnectionDurationName = "kestrel.connection.duration" KestrelConnectionDurationUnit = "s" KestrelConnectionDurationDescription = "The duration of connections on the server." @@ -349,7 +251,7 @@ const ( // number of connections rejected by the server. // Instrument: counter // Unit: {connection} - // Stability: Stable + // Stability: Experimental KestrelRejectedConnectionsName = "kestrel.rejected_connections" KestrelRejectedConnectionsUnit = "{connection}" KestrelRejectedConnectionsDescription = "Number of connections rejected by the server." @@ -359,7 +261,7 @@ const ( // of connections that are currently queued and are waiting to start. // Instrument: updowncounter // Unit: {connection} - // Stability: Stable + // Stability: Experimental KestrelQueuedConnectionsName = "kestrel.queued_connections" KestrelQueuedConnectionsUnit = "{connection}" KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start." @@ -370,7 +272,7 @@ const ( // currently queued and are waiting to start. // Instrument: updowncounter // Unit: {request} - // Stability: Stable + // 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." @@ -380,7 +282,7 @@ const ( // number of connections that are currently upgraded (WebSockets). . // Instrument: updowncounter // Unit: {connection} - // Stability: Stable + // Stability: Experimental KestrelUpgradedConnectionsName = "kestrel.upgraded_connections" KestrelUpgradedConnectionsUnit = "{connection}" KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ." @@ -390,7 +292,7 @@ const ( // duration of TLS handshakes on the server. // Instrument: histogram // Unit: s - // Stability: Stable + // Stability: Experimental KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration" KestrelTLSHandshakeDurationUnit = "s" KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server." @@ -400,7 +302,7 @@ const ( // number of TLS handshakes that are currently in progress on the server. // Instrument: updowncounter // Unit: {handshake} - // Stability: Stable + // Stability: Experimental KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes" KestrelActiveTLSHandshakesUnit = "{handshake}" KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server." @@ -410,7 +312,7 @@ const ( // duration of connections on the server. // Instrument: histogram // Unit: s - // Stability: Stable + // Stability: Experimental SignalrServerConnectionDurationName = "signalr.server.connection.duration" SignalrServerConnectionDurationUnit = "s" SignalrServerConnectionDurationDescription = "The duration of connections on the server." @@ -420,7 +322,7 @@ const ( // number of connections that are currently active on the server. // Instrument: updowncounter // Unit: {connection} - // Stability: Stable + // Stability: Experimental SignalrServerActiveConnectionsName = "signalr.server.active_connections" SignalrServerActiveConnectionsUnit = "{connection}" SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server." @@ -579,37 +481,6 @@ const ( 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 @@ -802,15 +673,15 @@ const ( 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. + // 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 - MessagingProcessDurationName = "messaging.process.duration" - MessagingProcessDurationUnit = "s" - MessagingProcessDurationDescription = "Measures the duration of process operation." + 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 @@ -832,112 +703,15 @@ const ( 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. + // 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 - 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." + 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 @@ -1109,16 +883,6 @@ const ( 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 @@ -1274,25 +1038,25 @@ const ( 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. + // 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 - SystemProcessCountName = "system.process.count" - SystemProcessCountUnit = "{process}" - SystemProcessCountDescription = "Total number of processes in each state" + SystemProcessesCountName = "system.processes.count" + SystemProcessesCountUnit = "{process}" + SystemProcessesCountDescription = "Total number of processes in each state" - // SystemProcessCreated is the metric conforming to the - // "system.process.created" semantic conventions. It represents the total + // 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 - SystemProcessCreatedName = "system.process.created" - SystemProcessCreatedUnit = "{process}" - SystemProcessCreatedDescription = "Total number of processes created over uptime of the host" + 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 diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go new file mode 100644 index 00000000000..d66bbe9c23d --- /dev/null +++ b/upstream/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/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go similarity index 85% rename from upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go rename to upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go index 4c87c7adcc7..fe80b1731d0 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go +++ b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.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.26.0" +const SchemaURL = "https://opentelemetry.io/schemas/1.24.0" diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go new file mode 100644 index 00000000000..c1718234e52 --- /dev/null +++ b/upstream/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/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md deleted file mode 100644 index 2de1fc3c6be..00000000000 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.26.0 - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.26.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.26.0) diff --git a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go b/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go deleted file mode 100644 index d8dc822b263..00000000000 --- a/upstream/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go +++ /dev/null @@ -1,8996 +0,0 @@ -// 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/upstream/vendor/go.opentelemetry.io/otel/trace/noop/noop.go b/upstream/vendor/go.opentelemetry.io/otel/trace/noop/noop.go index 64a4f1b362f..1dfa52c5216 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/trace/noop/noop.go +++ b/upstream/vendor/go.opentelemetry.io/otel/trace/noop/noop.go @@ -67,13 +67,11 @@ func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) span = Span{sc: sc} } else { // No parent, return a No-Op span with an empty span context. - span = noopSpanInstance + span = Span{} } return trace.ContextWithSpan(ctx, span), span } -var noopSpanInstance trace.Span = Span{} - // Span is an OpenTelemetry No-Op Span. type Span struct { embedded.Span diff --git a/upstream/vendor/go.opentelemetry.io/otel/version.go b/upstream/vendor/go.opentelemetry.io/otel/version.go index ab28960524b..ef97d30f9f5 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/version.go +++ b/upstream/vendor/go.opentelemetry.io/otel/version.go @@ -5,5 +5,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.28.0" + return "1.26.0" } diff --git a/upstream/vendor/go.opentelemetry.io/otel/versions.yaml b/upstream/vendor/go.opentelemetry.io/otel/versions.yaml index 241cfc82a8d..ecd2734e0eb 100644 --- a/upstream/vendor/go.opentelemetry.io/otel/versions.yaml +++ b/upstream/vendor/go.opentelemetry.io/otel/versions.yaml @@ -3,7 +3,7 @@ module-sets: stable-v1: - version: v1.28.0 + version: v1.26.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opencensus @@ -29,12 +29,12 @@ module-sets: - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: - version: v0.50.0 + version: v0.48.0 modules: - go.opentelemetry.io/otel/example/prometheus - go.opentelemetry.io/otel/exporters/prometheus experimental-logs: - version: v0.4.0 + version: v0.2.0-alpha modules: - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/sdk/log @@ -46,4 +46,3 @@ module-sets: - go.opentelemetry.io/otel/schema excluded-modules: - go.opentelemetry.io/otel/internal/tools - - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc diff --git a/upstream/vendor/golang.org/x/crypto/LICENSE b/upstream/vendor/golang.org/x/crypto/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/crypto/LICENSE +++ b/upstream/vendor/golang.org/x/crypto/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/upstream/vendor/golang.org/x/crypto/argon2/blamka_amd64.s index c3895478ed0..6713accac09 100644 --- a/upstream/vendor/golang.org/x/crypto/argon2/blamka_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/argon2/blamka_amd64.s @@ -1,2791 +1,243 @@ -// Code generated by command: go run blamka_amd64.go -out ../blamka_amd64.s -pkg argon2. DO NOT EDIT. +// Copyright 2017 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 amd64 && gc && !purego #include "textflag.h" +DATA ·c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·c40<>(SB), (NOPTR+RODATA), $16 + +DATA ·c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·c48<>(SB), (NOPTR+RODATA), $16 + +#define SHUFFLE(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v6, t1; \ + PUNPCKLQDQ v6, t2; \ + PUNPCKHQDQ v7, v6; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ v7, t2; \ + MOVO t1, v7; \ + MOVO v2, t1; \ + PUNPCKHQDQ t2, v7; \ + PUNPCKLQDQ v3, t2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v3 + +#define SHUFFLE_INV(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v2, t1; \ + PUNPCKLQDQ v2, t2; \ + PUNPCKHQDQ v3, v2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ v3, t2; \ + MOVO t1, v3; \ + MOVO v6, t1; \ + PUNPCKHQDQ t2, v3; \ + PUNPCKLQDQ v7, t2; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v7 + +#define HALF_ROUND(v0, v1, v2, v3, v4, v5, v6, v7, t0, c40, c48) \ + MOVO v0, t0; \ + PMULULQ v2, t0; \ + PADDQ v2, v0; \ + PADDQ t0, v0; \ + PADDQ t0, v0; \ + PXOR v0, v6; \ + PSHUFD $0xB1, v6, v6; \ + MOVO v4, t0; \ + PMULULQ v6, t0; \ + PADDQ v6, v4; \ + PADDQ t0, v4; \ + PADDQ t0, v4; \ + PXOR v4, v2; \ + PSHUFB c40, v2; \ + MOVO v0, t0; \ + PMULULQ v2, t0; \ + PADDQ v2, v0; \ + PADDQ t0, v0; \ + PADDQ t0, v0; \ + PXOR v0, v6; \ + PSHUFB c48, v6; \ + MOVO v4, t0; \ + PMULULQ v6, t0; \ + PADDQ v6, v4; \ + PADDQ t0, v4; \ + PADDQ t0, v4; \ + PXOR v4, v2; \ + MOVO v2, t0; \ + PADDQ v2, t0; \ + PSRLQ $63, v2; \ + PXOR t0, v2; \ + MOVO v1, t0; \ + PMULULQ v3, t0; \ + PADDQ v3, v1; \ + PADDQ t0, v1; \ + PADDQ t0, v1; \ + PXOR v1, v7; \ + PSHUFD $0xB1, v7, v7; \ + MOVO v5, t0; \ + PMULULQ v7, t0; \ + PADDQ v7, v5; \ + PADDQ t0, v5; \ + PADDQ t0, v5; \ + PXOR v5, v3; \ + PSHUFB c40, v3; \ + MOVO v1, t0; \ + PMULULQ v3, t0; \ + PADDQ v3, v1; \ + PADDQ t0, v1; \ + PADDQ t0, v1; \ + PXOR v1, v7; \ + PSHUFB c48, v7; \ + MOVO v5, t0; \ + PMULULQ v7, t0; \ + PADDQ v7, v5; \ + PADDQ t0, v5; \ + PADDQ t0, v5; \ + PXOR v5, v3; \ + MOVO v3, t0; \ + PADDQ v3, t0; \ + PSRLQ $63, v3; \ + PXOR t0, v3 + +#define LOAD_MSG_0(block, off) \ + MOVOU 8*(off+0)(block), X0; \ + MOVOU 8*(off+2)(block), X1; \ + MOVOU 8*(off+4)(block), X2; \ + MOVOU 8*(off+6)(block), X3; \ + MOVOU 8*(off+8)(block), X4; \ + MOVOU 8*(off+10)(block), X5; \ + MOVOU 8*(off+12)(block), X6; \ + MOVOU 8*(off+14)(block), X7 + +#define STORE_MSG_0(block, off) \ + MOVOU X0, 8*(off+0)(block); \ + MOVOU X1, 8*(off+2)(block); \ + MOVOU X2, 8*(off+4)(block); \ + MOVOU X3, 8*(off+6)(block); \ + MOVOU X4, 8*(off+8)(block); \ + MOVOU X5, 8*(off+10)(block); \ + MOVOU X6, 8*(off+12)(block); \ + MOVOU X7, 8*(off+14)(block) + +#define LOAD_MSG_1(block, off) \ + MOVOU 8*off+0*8(block), X0; \ + MOVOU 8*off+16*8(block), X1; \ + MOVOU 8*off+32*8(block), X2; \ + MOVOU 8*off+48*8(block), X3; \ + MOVOU 8*off+64*8(block), X4; \ + MOVOU 8*off+80*8(block), X5; \ + MOVOU 8*off+96*8(block), X6; \ + MOVOU 8*off+112*8(block), X7 + +#define STORE_MSG_1(block, off) \ + MOVOU X0, 8*off+0*8(block); \ + MOVOU X1, 8*off+16*8(block); \ + MOVOU X2, 8*off+32*8(block); \ + MOVOU X3, 8*off+48*8(block); \ + MOVOU X4, 8*off+64*8(block); \ + MOVOU X5, 8*off+80*8(block); \ + MOVOU X6, 8*off+96*8(block); \ + MOVOU X7, 8*off+112*8(block) + +#define BLAMKA_ROUND_0(block, off, t0, t1, c40, c48) \ + LOAD_MSG_0(block, off); \ + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, t0, c40, c48); \ + SHUFFLE(X2, X3, X4, X5, X6, X7, t0, t1); \ + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, t0, c40, c48); \ + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, t0, t1); \ + STORE_MSG_0(block, off) + +#define BLAMKA_ROUND_1(block, off, t0, t1, c40, c48) \ + LOAD_MSG_1(block, off); \ + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, t0, c40, c48); \ + SHUFFLE(X2, X3, X4, X5, X6, X7, t0, t1); \ + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, t0, c40, c48); \ + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, t0, t1); \ + STORE_MSG_1(block, off) + // func blamkaSSE4(b *block) -// Requires: SSE2, SSSE3 -TEXT ·blamkaSSE4(SB), NOSPLIT, $0-8 - MOVQ b+0(FP), AX - MOVOU ·c40<>+0(SB), X10 - MOVOU ·c48<>+0(SB), X11 - MOVOU (AX), X0 - MOVOU 16(AX), X1 - MOVOU 32(AX), X2 - MOVOU 48(AX), X3 - MOVOU 64(AX), X4 - MOVOU 80(AX), X5 - MOVOU 96(AX), X6 - MOVOU 112(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, (AX) - MOVOU X1, 16(AX) - MOVOU X2, 32(AX) - MOVOU X3, 48(AX) - MOVOU X4, 64(AX) - MOVOU X5, 80(AX) - MOVOU X6, 96(AX) - MOVOU X7, 112(AX) - MOVOU 128(AX), X0 - MOVOU 144(AX), X1 - MOVOU 160(AX), X2 - MOVOU 176(AX), X3 - MOVOU 192(AX), X4 - MOVOU 208(AX), X5 - MOVOU 224(AX), X6 - MOVOU 240(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 128(AX) - MOVOU X1, 144(AX) - MOVOU X2, 160(AX) - MOVOU X3, 176(AX) - MOVOU X4, 192(AX) - MOVOU X5, 208(AX) - MOVOU X6, 224(AX) - MOVOU X7, 240(AX) - MOVOU 256(AX), X0 - MOVOU 272(AX), X1 - MOVOU 288(AX), X2 - MOVOU 304(AX), X3 - MOVOU 320(AX), X4 - MOVOU 336(AX), X5 - MOVOU 352(AX), X6 - MOVOU 368(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 256(AX) - MOVOU X1, 272(AX) - MOVOU X2, 288(AX) - MOVOU X3, 304(AX) - MOVOU X4, 320(AX) - MOVOU X5, 336(AX) - MOVOU X6, 352(AX) - MOVOU X7, 368(AX) - MOVOU 384(AX), X0 - MOVOU 400(AX), X1 - MOVOU 416(AX), X2 - MOVOU 432(AX), X3 - MOVOU 448(AX), X4 - MOVOU 464(AX), X5 - MOVOU 480(AX), X6 - MOVOU 496(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 384(AX) - MOVOU X1, 400(AX) - MOVOU X2, 416(AX) - MOVOU X3, 432(AX) - MOVOU X4, 448(AX) - MOVOU X5, 464(AX) - MOVOU X6, 480(AX) - MOVOU X7, 496(AX) - MOVOU 512(AX), X0 - MOVOU 528(AX), X1 - MOVOU 544(AX), X2 - MOVOU 560(AX), X3 - MOVOU 576(AX), X4 - MOVOU 592(AX), X5 - MOVOU 608(AX), X6 - MOVOU 624(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 512(AX) - MOVOU X1, 528(AX) - MOVOU X2, 544(AX) - MOVOU X3, 560(AX) - MOVOU X4, 576(AX) - MOVOU X5, 592(AX) - MOVOU X6, 608(AX) - MOVOU X7, 624(AX) - MOVOU 640(AX), X0 - MOVOU 656(AX), X1 - MOVOU 672(AX), X2 - MOVOU 688(AX), X3 - MOVOU 704(AX), X4 - MOVOU 720(AX), X5 - MOVOU 736(AX), X6 - MOVOU 752(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 640(AX) - MOVOU X1, 656(AX) - MOVOU X2, 672(AX) - MOVOU X3, 688(AX) - MOVOU X4, 704(AX) - MOVOU X5, 720(AX) - MOVOU X6, 736(AX) - MOVOU X7, 752(AX) - MOVOU 768(AX), X0 - MOVOU 784(AX), X1 - MOVOU 800(AX), X2 - MOVOU 816(AX), X3 - MOVOU 832(AX), X4 - MOVOU 848(AX), X5 - MOVOU 864(AX), X6 - MOVOU 880(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 768(AX) - MOVOU X1, 784(AX) - MOVOU X2, 800(AX) - MOVOU X3, 816(AX) - MOVOU X4, 832(AX) - MOVOU X5, 848(AX) - MOVOU X6, 864(AX) - MOVOU X7, 880(AX) - MOVOU 896(AX), X0 - MOVOU 912(AX), X1 - MOVOU 928(AX), X2 - MOVOU 944(AX), X3 - MOVOU 960(AX), X4 - MOVOU 976(AX), X5 - MOVOU 992(AX), X6 - MOVOU 1008(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 896(AX) - MOVOU X1, 912(AX) - MOVOU X2, 928(AX) - MOVOU X3, 944(AX) - MOVOU X4, 960(AX) - MOVOU X5, 976(AX) - MOVOU X6, 992(AX) - MOVOU X7, 1008(AX) - MOVOU (AX), X0 - MOVOU 128(AX), X1 - MOVOU 256(AX), X2 - MOVOU 384(AX), X3 - MOVOU 512(AX), X4 - MOVOU 640(AX), X5 - MOVOU 768(AX), X6 - MOVOU 896(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, (AX) - MOVOU X1, 128(AX) - MOVOU X2, 256(AX) - MOVOU X3, 384(AX) - MOVOU X4, 512(AX) - MOVOU X5, 640(AX) - MOVOU X6, 768(AX) - MOVOU X7, 896(AX) - MOVOU 16(AX), X0 - MOVOU 144(AX), X1 - MOVOU 272(AX), X2 - MOVOU 400(AX), X3 - MOVOU 528(AX), X4 - MOVOU 656(AX), X5 - MOVOU 784(AX), X6 - MOVOU 912(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 16(AX) - MOVOU X1, 144(AX) - MOVOU X2, 272(AX) - MOVOU X3, 400(AX) - MOVOU X4, 528(AX) - MOVOU X5, 656(AX) - MOVOU X6, 784(AX) - MOVOU X7, 912(AX) - MOVOU 32(AX), X0 - MOVOU 160(AX), X1 - MOVOU 288(AX), X2 - MOVOU 416(AX), X3 - MOVOU 544(AX), X4 - MOVOU 672(AX), X5 - MOVOU 800(AX), X6 - MOVOU 928(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 32(AX) - MOVOU X1, 160(AX) - MOVOU X2, 288(AX) - MOVOU X3, 416(AX) - MOVOU X4, 544(AX) - MOVOU X5, 672(AX) - MOVOU X6, 800(AX) - MOVOU X7, 928(AX) - MOVOU 48(AX), X0 - MOVOU 176(AX), X1 - MOVOU 304(AX), X2 - MOVOU 432(AX), X3 - MOVOU 560(AX), X4 - MOVOU 688(AX), X5 - MOVOU 816(AX), X6 - MOVOU 944(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 48(AX) - MOVOU X1, 176(AX) - MOVOU X2, 304(AX) - MOVOU X3, 432(AX) - MOVOU X4, 560(AX) - MOVOU X5, 688(AX) - MOVOU X6, 816(AX) - MOVOU X7, 944(AX) - MOVOU 64(AX), X0 - MOVOU 192(AX), X1 - MOVOU 320(AX), X2 - MOVOU 448(AX), X3 - MOVOU 576(AX), X4 - MOVOU 704(AX), X5 - MOVOU 832(AX), X6 - MOVOU 960(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 64(AX) - MOVOU X1, 192(AX) - MOVOU X2, 320(AX) - MOVOU X3, 448(AX) - MOVOU X4, 576(AX) - MOVOU X5, 704(AX) - MOVOU X6, 832(AX) - MOVOU X7, 960(AX) - MOVOU 80(AX), X0 - MOVOU 208(AX), X1 - MOVOU 336(AX), X2 - MOVOU 464(AX), X3 - MOVOU 592(AX), X4 - MOVOU 720(AX), X5 - MOVOU 848(AX), X6 - MOVOU 976(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 80(AX) - MOVOU X1, 208(AX) - MOVOU X2, 336(AX) - MOVOU X3, 464(AX) - MOVOU X4, 592(AX) - MOVOU X5, 720(AX) - MOVOU X6, 848(AX) - MOVOU X7, 976(AX) - MOVOU 96(AX), X0 - MOVOU 224(AX), X1 - MOVOU 352(AX), X2 - MOVOU 480(AX), X3 - MOVOU 608(AX), X4 - MOVOU 736(AX), X5 - MOVOU 864(AX), X6 - MOVOU 992(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 96(AX) - MOVOU X1, 224(AX) - MOVOU X2, 352(AX) - MOVOU X3, 480(AX) - MOVOU X4, 608(AX) - MOVOU X5, 736(AX) - MOVOU X6, 864(AX) - MOVOU X7, 992(AX) - MOVOU 112(AX), X0 - MOVOU 240(AX), X1 - MOVOU 368(AX), X2 - MOVOU 496(AX), X3 - MOVOU 624(AX), X4 - MOVOU 752(AX), X5 - MOVOU 880(AX), X6 - MOVOU 1008(AX), X7 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFD $0xb1, X6, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - PSHUFB X10, X2 - MOVO X0, X8 - PMULULQ X2, X8 - PADDQ X2, X0 - PADDQ X8, X0 - PADDQ X8, X0 - PXOR X0, X6 - PSHUFB X11, X6 - MOVO X4, X8 - PMULULQ X6, X8 - PADDQ X6, X4 - PADDQ X8, X4 - PADDQ X8, X4 - PXOR X4, X2 - MOVO X2, X8 - PADDQ X2, X8 - PSRLQ $0x3f, X2 - PXOR X8, X2 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFD $0xb1, X7, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - PSHUFB X10, X3 - MOVO X1, X8 - PMULULQ X3, X8 - PADDQ X3, X1 - PADDQ X8, X1 - PADDQ X8, X1 - PXOR X1, X7 - PSHUFB X11, X7 - MOVO X5, X8 - PMULULQ X7, X8 - PADDQ X7, X5 - PADDQ X8, X5 - PADDQ X8, X5 - PXOR X5, X3 - MOVO X3, X8 - PADDQ X3, X8 - PSRLQ $0x3f, X3 - PXOR X8, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU X0, 112(AX) - MOVOU X1, 240(AX) - MOVOU X2, 368(AX) - MOVOU X3, 496(AX) - MOVOU X4, 624(AX) - MOVOU X5, 752(AX) - MOVOU X6, 880(AX) - MOVOU X7, 1008(AX) - RET +TEXT ·blamkaSSE4(SB), 4, $0-8 + MOVQ b+0(FP), AX + + MOVOU ·c40<>(SB), X10 + MOVOU ·c48<>(SB), X11 -DATA ·c40<>+0(SB)/8, $0x0201000706050403 -DATA ·c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·c40<>(SB), RODATA|NOPTR, $16 + BLAMKA_ROUND_0(AX, 0, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 16, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 32, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 48, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 64, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 80, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 96, X8, X9, X10, X11) + BLAMKA_ROUND_0(AX, 112, X8, X9, X10, X11) -DATA ·c48<>+0(SB)/8, $0x0100070605040302 -DATA ·c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·c48<>(SB), RODATA|NOPTR, $16 + BLAMKA_ROUND_1(AX, 0, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 2, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 4, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 6, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 8, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 10, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 12, X8, X9, X10, X11) + BLAMKA_ROUND_1(AX, 14, X8, X9, X10, X11) + RET -// func mixBlocksSSE2(out *block, a *block, b *block, c *block) -// Requires: SSE2 -TEXT ·mixBlocksSSE2(SB), NOSPLIT, $0-32 +// func mixBlocksSSE2(out, a, b, c *block) +TEXT ·mixBlocksSSE2(SB), 4, $0-32 MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX MOVQ c+24(FP), CX - MOVQ $0x00000080, DI + MOVQ $128, DI loop: - MOVOU (AX), X0 - MOVOU (BX), X1 - MOVOU (CX), X2 + MOVOU 0(AX), X0 + MOVOU 0(BX), X1 + MOVOU 0(CX), X2 PXOR X1, X0 PXOR X2, X0 - MOVOU X0, (DX) - ADDQ $0x10, AX - ADDQ $0x10, BX - ADDQ $0x10, CX - ADDQ $0x10, DX - SUBQ $0x02, DI + MOVOU X0, 0(DX) + ADDQ $16, AX + ADDQ $16, BX + ADDQ $16, CX + ADDQ $16, DX + SUBQ $2, DI JA loop RET -// func xorBlocksSSE2(out *block, a *block, b *block, c *block) -// Requires: SSE2 -TEXT ·xorBlocksSSE2(SB), NOSPLIT, $0-32 +// func xorBlocksSSE2(out, a, b, c *block) +TEXT ·xorBlocksSSE2(SB), 4, $0-32 MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX MOVQ c+24(FP), CX - MOVQ $0x00000080, DI + MOVQ $128, DI loop: - MOVOU (AX), X0 - MOVOU (BX), X1 - MOVOU (CX), X2 - MOVOU (DX), X3 + MOVOU 0(AX), X0 + MOVOU 0(BX), X1 + MOVOU 0(CX), X2 + MOVOU 0(DX), X3 PXOR X1, X0 PXOR X2, X0 PXOR X3, X0 - MOVOU X0, (DX) - ADDQ $0x10, AX - ADDQ $0x10, BX - ADDQ $0x10, CX - ADDQ $0x10, DX - SUBQ $0x02, DI + MOVOU X0, 0(DX) + ADDQ $16, AX + ADDQ $16, BX + ADDQ $16, CX + ADDQ $16, DX + SUBQ $2, DI JA loop RET diff --git a/upstream/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/upstream/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index f75162e039c..9ae8206c201 100644 --- a/upstream/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -1,4517 +1,722 @@ -// Code generated by command: go run blake2bAVX2_amd64_asm.go -out ../../blake2bAVX2_amd64.s -pkg blake2b. DO NOT EDIT. +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. //go:build amd64 && gc && !purego #include "textflag.h" +DATA ·AVX2_iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·AVX2_iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +DATA ·AVX2_iv0<>+0x10(SB)/8, $0x3c6ef372fe94f82b +DATA ·AVX2_iv0<>+0x18(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·AVX2_iv0<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_iv1<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·AVX2_iv1<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +DATA ·AVX2_iv1<>+0x10(SB)/8, $0x1f83d9abfb41bd6b +DATA ·AVX2_iv1<>+0x18(SB)/8, $0x5be0cd19137e2179 +GLOBL ·AVX2_iv1<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·AVX2_c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +DATA ·AVX2_c40<>+0x10(SB)/8, $0x0201000706050403 +DATA ·AVX2_c40<>+0x18(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·AVX2_c40<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·AVX2_c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +DATA ·AVX2_c48<>+0x10(SB)/8, $0x0100070605040302 +DATA ·AVX2_c48<>+0x18(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·AVX2_c48<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX_iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·AVX_iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +GLOBL ·AVX_iv0<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv1<>+0x00(SB)/8, $0x3c6ef372fe94f82b +DATA ·AVX_iv1<>+0x08(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·AVX_iv1<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv2<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·AVX_iv2<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +GLOBL ·AVX_iv2<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv3<>+0x00(SB)/8, $0x1f83d9abfb41bd6b +DATA ·AVX_iv3<>+0x08(SB)/8, $0x5be0cd19137e2179 +GLOBL ·AVX_iv3<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·AVX_c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·AVX_c40<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·AVX_c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·AVX_c48<>(SB), (NOPTR+RODATA), $16 + +#define VPERMQ_0x39_Y1_Y1 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xc9; BYTE $0x39 +#define VPERMQ_0x93_Y1_Y1 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xc9; BYTE $0x93 +#define VPERMQ_0x4E_Y2_Y2 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xd2; BYTE $0x4e +#define VPERMQ_0x93_Y3_Y3 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xdb; BYTE $0x93 +#define VPERMQ_0x39_Y3_Y3 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xdb; BYTE $0x39 + +#define ROUND_AVX2(m0, m1, m2, m3, t, c40, c48) \ + VPADDQ m0, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFD $-79, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPSHUFB c40, Y1, Y1; \ + VPADDQ m1, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFB c48, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPADDQ Y1, Y1, t; \ + VPSRLQ $63, Y1, Y1; \ + VPXOR t, Y1, Y1; \ + VPERMQ_0x39_Y1_Y1; \ + VPERMQ_0x4E_Y2_Y2; \ + VPERMQ_0x93_Y3_Y3; \ + VPADDQ m2, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFD $-79, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPSHUFB c40, Y1, Y1; \ + VPADDQ m3, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFB c48, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPADDQ Y1, Y1, t; \ + VPSRLQ $63, Y1, Y1; \ + VPXOR t, Y1, Y1; \ + VPERMQ_0x39_Y3_Y3; \ + VPERMQ_0x4E_Y2_Y2; \ + VPERMQ_0x93_Y1_Y1 + +#define VMOVQ_SI_X11_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x1E +#define VMOVQ_SI_X12_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x26 +#define VMOVQ_SI_X13_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x2E +#define VMOVQ_SI_X14_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x36 +#define VMOVQ_SI_X15_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x3E + +#define VMOVQ_SI_X11(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x5E; BYTE $n +#define VMOVQ_SI_X12(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x66; BYTE $n +#define VMOVQ_SI_X13(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x6E; BYTE $n +#define VMOVQ_SI_X14(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x76; BYTE $n +#define VMOVQ_SI_X15(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x7E; BYTE $n + +#define VPINSRQ_1_SI_X11_0 BYTE $0xC4; BYTE $0x63; BYTE $0xA1; BYTE $0x22; BYTE $0x1E; BYTE $0x01 +#define VPINSRQ_1_SI_X12_0 BYTE $0xC4; BYTE $0x63; BYTE $0x99; BYTE $0x22; BYTE $0x26; BYTE $0x01 +#define VPINSRQ_1_SI_X13_0 BYTE $0xC4; BYTE $0x63; BYTE $0x91; BYTE $0x22; BYTE $0x2E; BYTE $0x01 +#define VPINSRQ_1_SI_X14_0 BYTE $0xC4; BYTE $0x63; BYTE $0x89; BYTE $0x22; BYTE $0x36; BYTE $0x01 +#define VPINSRQ_1_SI_X15_0 BYTE $0xC4; BYTE $0x63; BYTE $0x81; BYTE $0x22; BYTE $0x3E; BYTE $0x01 + +#define VPINSRQ_1_SI_X11(n) BYTE $0xC4; BYTE $0x63; BYTE $0xA1; BYTE $0x22; BYTE $0x5E; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X12(n) BYTE $0xC4; BYTE $0x63; BYTE $0x99; BYTE $0x22; BYTE $0x66; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X13(n) BYTE $0xC4; BYTE $0x63; BYTE $0x91; BYTE $0x22; BYTE $0x6E; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X14(n) BYTE $0xC4; BYTE $0x63; BYTE $0x89; BYTE $0x22; BYTE $0x76; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X15(n) BYTE $0xC4; BYTE $0x63; BYTE $0x81; BYTE $0x22; BYTE $0x7E; BYTE $n; BYTE $0x01 + +#define VMOVQ_R8_X15 BYTE $0xC4; BYTE $0x41; BYTE $0xF9; BYTE $0x6E; BYTE $0xF8 +#define VPINSRQ_1_R9_X15 BYTE $0xC4; BYTE $0x43; BYTE $0x81; BYTE $0x22; BYTE $0xF9; BYTE $0x01 + +// load msg: Y12 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y12(i0, i1, i2, i3) \ + VMOVQ_SI_X12(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X12(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y12, Y12 + +// load msg: Y13 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y13(i0, i1, i2, i3) \ + VMOVQ_SI_X13(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X13(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y13, Y13 + +// load msg: Y14 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y14(i0, i1, i2, i3) \ + VMOVQ_SI_X14(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X14(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y14, Y14 + +// load msg: Y15 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y15(i0, i1, i2, i3) \ + VMOVQ_SI_X15(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X15(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() \ + VMOVQ_SI_X12_0; \ + VMOVQ_SI_X11(4*8); \ + VPINSRQ_1_SI_X12(2*8); \ + VPINSRQ_1_SI_X11(6*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(1, 3, 5, 7); \ + LOAD_MSG_AVX2_Y14(8, 10, 12, 14); \ + LOAD_MSG_AVX2_Y15(9, 11, 13, 15) + +#define LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() \ + LOAD_MSG_AVX2_Y12(14, 4, 9, 13); \ + LOAD_MSG_AVX2_Y13(10, 8, 15, 6); \ + VMOVQ_SI_X11(11*8); \ + VPSHUFD $0x4E, 0*8(SI), X14; \ + VPINSRQ_1_SI_X11(5*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + LOAD_MSG_AVX2_Y15(12, 2, 7, 3) + +#define LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() \ + VMOVQ_SI_X11(5*8); \ + VMOVDQU 11*8(SI), X12; \ + VPINSRQ_1_SI_X11(15*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + VMOVQ_SI_X13(8*8); \ + VMOVQ_SI_X11(2*8); \ + VPINSRQ_1_SI_X13_0; \ + VPINSRQ_1_SI_X11(13*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(10, 3, 7, 9); \ + LOAD_MSG_AVX2_Y15(14, 6, 1, 4) + +#define LOAD_MSG_AVX2_7_3_13_11_9_1_12_14_2_5_4_15_6_10_0_8() \ + LOAD_MSG_AVX2_Y12(7, 3, 13, 11); \ + LOAD_MSG_AVX2_Y13(9, 1, 12, 14); \ + LOAD_MSG_AVX2_Y14(2, 5, 4, 15); \ + VMOVQ_SI_X15(6*8); \ + VMOVQ_SI_X11_0; \ + VPINSRQ_1_SI_X15(10*8); \ + VPINSRQ_1_SI_X11(8*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_9_5_2_10_0_7_4_15_14_11_6_3_1_12_8_13() \ + LOAD_MSG_AVX2_Y12(9, 5, 2, 10); \ + VMOVQ_SI_X13_0; \ + VMOVQ_SI_X11(4*8); \ + VPINSRQ_1_SI_X13(7*8); \ + VPINSRQ_1_SI_X11(15*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(14, 11, 6, 3); \ + LOAD_MSG_AVX2_Y15(1, 12, 8, 13) + +#define LOAD_MSG_AVX2_2_6_0_8_12_10_11_3_4_7_15_1_13_5_14_9() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X11_0; \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X11(8*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(12, 10, 11, 3); \ + LOAD_MSG_AVX2_Y14(4, 7, 15, 1); \ + LOAD_MSG_AVX2_Y15(13, 5, 14, 9) + +#define LOAD_MSG_AVX2_12_1_14_4_5_15_13_10_0_6_9_8_7_3_2_11() \ + LOAD_MSG_AVX2_Y12(12, 1, 14, 4); \ + LOAD_MSG_AVX2_Y13(5, 15, 13, 10); \ + VMOVQ_SI_X14_0; \ + VPSHUFD $0x4E, 8*8(SI), X11; \ + VPINSRQ_1_SI_X14(6*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + LOAD_MSG_AVX2_Y15(7, 3, 2, 11) + +#define LOAD_MSG_AVX2_13_7_12_3_11_14_1_9_5_15_8_2_0_4_6_10() \ + LOAD_MSG_AVX2_Y12(13, 7, 12, 3); \ + LOAD_MSG_AVX2_Y13(11, 14, 1, 9); \ + LOAD_MSG_AVX2_Y14(5, 15, 8, 2); \ + VMOVQ_SI_X15_0; \ + VMOVQ_SI_X11(6*8); \ + VPINSRQ_1_SI_X15(4*8); \ + VPINSRQ_1_SI_X11(10*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_6_14_11_0_15_9_3_8_12_13_1_10_2_7_4_5() \ + VMOVQ_SI_X12(6*8); \ + VMOVQ_SI_X11(11*8); \ + VPINSRQ_1_SI_X12(14*8); \ + VPINSRQ_1_SI_X11_0; \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(15, 9, 3, 8); \ + VMOVQ_SI_X11(1*8); \ + VMOVDQU 12*8(SI), X14; \ + VPINSRQ_1_SI_X11(10*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + VMOVQ_SI_X15(2*8); \ + VMOVDQU 4*8(SI), X11; \ + VPINSRQ_1_SI_X15(7*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() \ + LOAD_MSG_AVX2_Y12(10, 8, 7, 1); \ + VMOVQ_SI_X13(2*8); \ + VPSHUFD $0x4E, 5*8(SI), X11; \ + VPINSRQ_1_SI_X13(4*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(15, 9, 3, 13); \ + VMOVQ_SI_X15(11*8); \ + VMOVQ_SI_X11(12*8); \ + VPINSRQ_1_SI_X15(14*8); \ + VPINSRQ_1_SI_X11_0; \ + VINSERTI128 $1, X11, Y15, Y15 + // func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: AVX, AVX2 -TEXT ·hashBlocksAVX2(SB), NOSPLIT, $320-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, DX - ADDQ $+31, DX - ANDQ $-32, DX - MOVQ CX, 16(DX) - XORQ CX, CX - MOVQ CX, 24(DX) - VMOVDQU ·AVX2_c40<>+0(SB), Y4 - VMOVDQU ·AVX2_c48<>+0(SB), Y5 - VMOVDQU (AX), Y8 +TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, DX + ADDQ $31, DX + ANDQ $~31, DX + + MOVQ CX, 16(DX) + XORQ CX, CX + MOVQ CX, 24(DX) + + VMOVDQU ·AVX2_c40<>(SB), Y4 + VMOVDQU ·AVX2_c48<>(SB), Y5 + + VMOVDQU 0(AX), Y8 VMOVDQU 32(AX), Y9 - VMOVDQU ·AVX2_iv0<>+0(SB), Y6 - VMOVDQU ·AVX2_iv1<>+0(SB), Y7 - MOVQ (BX), R8 - MOVQ 8(BX), R9 - MOVQ R9, 8(DX) + VMOVDQU ·AVX2_iv0<>(SB), Y6 + VMOVDQU ·AVX2_iv1<>(SB), Y7 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 + MOVQ R9, 8(DX) loop: - ADDQ $0x80, R8 - MOVQ R8, (DX) - CMPQ R8, $0x80 + ADDQ $128, R8 + MOVQ R8, 0(DX) + CMPQ R8, $128 JGE noinc INCQ R9 MOVQ R9, 8(DX) noinc: - VMOVDQA Y8, Y0 - VMOVDQA Y9, Y1 - VMOVDQA Y6, Y2 - VPXOR (DX), Y7, Y3 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x26 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x28 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x38 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x70 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VMOVDQA Y12, 32(DX) - VMOVDQA Y13, 64(DX) - VMOVDQA Y14, 96(DX) - VMOVDQA Y15, 128(DX) - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x48 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - VPSHUFD $0x4e, (SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x28 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VMOVDQA Y12, 160(DX) - VMOVDQA Y13, 192(DX) - VMOVDQA Y14, 224(DX) - VMOVDQA Y15, 256(DX) - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x28 - VMOVDQU 88(SI), X12 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x2e - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x58 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x70 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x1e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x2e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x60 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x1e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x08 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x36 - VPSHUFD $0x4e, 64(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x58 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x10 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x3e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x1e - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x18 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - VMOVDQU 96(SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x10 - VMOVDQU 32(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x38 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x08 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x10 - VPSHUFD $0x4e, 40(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x18 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x1e - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPADDQ 32(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 64(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ 96(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 128(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPADDQ 160(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 192(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ 224(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 256(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPXOR Y0, Y8, Y8 - VPXOR Y1, Y9, Y9 - VPXOR Y2, Y8, Y8 - VPXOR Y3, Y9, Y9 - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - MOVQ R8, (BX) - MOVQ R9, 8(BX) - VMOVDQU Y8, (AX) - VMOVDQU Y9, 32(AX) + VMOVDQA Y8, Y0 + VMOVDQA Y9, Y1 + VMOVDQA Y6, Y2 + VPXOR 0(DX), Y7, Y3 + + LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() + VMOVDQA Y12, 32(DX) + VMOVDQA Y13, 64(DX) + VMOVDQA Y14, 96(DX) + VMOVDQA Y15, 128(DX) + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() + VMOVDQA Y12, 160(DX) + VMOVDQA Y13, 192(DX) + VMOVDQA Y14, 224(DX) + VMOVDQA Y15, 256(DX) + + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_7_3_13_11_9_1_12_14_2_5_4_15_6_10_0_8() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_9_5_2_10_0_7_4_15_14_11_6_3_1_12_8_13() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_2_6_0_8_12_10_11_3_4_7_15_1_13_5_14_9() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_12_1_14_4_5_15_13_10_0_6_9_8_7_3_2_11() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_13_7_12_3_11_14_1_9_5_15_8_2_0_4_6_10() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_6_14_11_0_15_9_3_8_12_13_1_10_2_7_4_5() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + + ROUND_AVX2(32(DX), 64(DX), 96(DX), 128(DX), Y10, Y4, Y5) + ROUND_AVX2(160(DX), 192(DX), 224(DX), 256(DX), Y10, Y4, Y5) + + VPXOR Y0, Y8, Y8 + VPXOR Y1, Y9, Y9 + VPXOR Y2, Y8, Y8 + VPXOR Y3, Y9, Y9 + + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop + + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + + VMOVDQU Y8, 0(AX) + VMOVDQU Y9, 32(AX) VZEROUPPER + RET -DATA ·AVX2_c40<>+0(SB)/8, $0x0201000706050403 -DATA ·AVX2_c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -DATA ·AVX2_c40<>+16(SB)/8, $0x0201000706050403 -DATA ·AVX2_c40<>+24(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·AVX2_c40<>(SB), RODATA|NOPTR, $32 +#define VPUNPCKLQDQ_X2_X2_X15 BYTE $0xC5; BYTE $0x69; BYTE $0x6C; BYTE $0xFA +#define VPUNPCKLQDQ_X3_X3_X15 BYTE $0xC5; BYTE $0x61; BYTE $0x6C; BYTE $0xFB +#define VPUNPCKLQDQ_X7_X7_X15 BYTE $0xC5; BYTE $0x41; BYTE $0x6C; BYTE $0xFF +#define VPUNPCKLQDQ_X13_X13_X15 BYTE $0xC4; BYTE $0x41; BYTE $0x11; BYTE $0x6C; BYTE $0xFD +#define VPUNPCKLQDQ_X14_X14_X15 BYTE $0xC4; BYTE $0x41; BYTE $0x09; BYTE $0x6C; BYTE $0xFE + +#define VPUNPCKHQDQ_X15_X2_X2 BYTE $0xC4; BYTE $0xC1; BYTE $0x69; BYTE $0x6D; BYTE $0xD7 +#define VPUNPCKHQDQ_X15_X3_X3 BYTE $0xC4; BYTE $0xC1; BYTE $0x61; BYTE $0x6D; BYTE $0xDF +#define VPUNPCKHQDQ_X15_X6_X6 BYTE $0xC4; BYTE $0xC1; BYTE $0x49; BYTE $0x6D; BYTE $0xF7 +#define VPUNPCKHQDQ_X15_X7_X7 BYTE $0xC4; BYTE $0xC1; BYTE $0x41; BYTE $0x6D; BYTE $0xFF +#define VPUNPCKHQDQ_X15_X3_X2 BYTE $0xC4; BYTE $0xC1; BYTE $0x61; BYTE $0x6D; BYTE $0xD7 +#define VPUNPCKHQDQ_X15_X7_X6 BYTE $0xC4; BYTE $0xC1; BYTE $0x41; BYTE $0x6D; BYTE $0xF7 +#define VPUNPCKHQDQ_X15_X13_X3 BYTE $0xC4; BYTE $0xC1; BYTE $0x11; BYTE $0x6D; BYTE $0xDF +#define VPUNPCKHQDQ_X15_X13_X7 BYTE $0xC4; BYTE $0xC1; BYTE $0x11; BYTE $0x6D; BYTE $0xFF + +#define SHUFFLE_AVX() \ + VMOVDQA X6, X13; \ + VMOVDQA X2, X14; \ + VMOVDQA X4, X6; \ + VPUNPCKLQDQ_X13_X13_X15; \ + VMOVDQA X5, X4; \ + VMOVDQA X6, X5; \ + VPUNPCKHQDQ_X15_X7_X6; \ + VPUNPCKLQDQ_X7_X7_X15; \ + VPUNPCKHQDQ_X15_X13_X7; \ + VPUNPCKLQDQ_X3_X3_X15; \ + VPUNPCKHQDQ_X15_X2_X2; \ + VPUNPCKLQDQ_X14_X14_X15; \ + VPUNPCKHQDQ_X15_X3_X3; \ + +#define SHUFFLE_AVX_INV() \ + VMOVDQA X2, X13; \ + VMOVDQA X4, X14; \ + VPUNPCKLQDQ_X2_X2_X15; \ + VMOVDQA X5, X4; \ + VPUNPCKHQDQ_X15_X3_X2; \ + VMOVDQA X14, X5; \ + VPUNPCKLQDQ_X3_X3_X15; \ + VMOVDQA X6, X14; \ + VPUNPCKHQDQ_X15_X13_X3; \ + VPUNPCKLQDQ_X7_X7_X15; \ + VPUNPCKHQDQ_X15_X6_X6; \ + VPUNPCKLQDQ_X14_X14_X15; \ + VPUNPCKHQDQ_X15_X7_X7; \ + +#define HALF_ROUND_AVX(v0, v1, v2, v3, v4, v5, v6, v7, m0, m1, m2, m3, t0, c40, c48) \ + VPADDQ m0, v0, v0; \ + VPADDQ v2, v0, v0; \ + VPADDQ m1, v1, v1; \ + VPADDQ v3, v1, v1; \ + VPXOR v0, v6, v6; \ + VPXOR v1, v7, v7; \ + VPSHUFD $-79, v6, v6; \ + VPSHUFD $-79, v7, v7; \ + VPADDQ v6, v4, v4; \ + VPADDQ v7, v5, v5; \ + VPXOR v4, v2, v2; \ + VPXOR v5, v3, v3; \ + VPSHUFB c40, v2, v2; \ + VPSHUFB c40, v3, v3; \ + VPADDQ m2, v0, v0; \ + VPADDQ v2, v0, v0; \ + VPADDQ m3, v1, v1; \ + VPADDQ v3, v1, v1; \ + VPXOR v0, v6, v6; \ + VPXOR v1, v7, v7; \ + VPSHUFB c48, v6, v6; \ + VPSHUFB c48, v7, v7; \ + VPADDQ v6, v4, v4; \ + VPADDQ v7, v5, v5; \ + VPXOR v4, v2, v2; \ + VPXOR v5, v3, v3; \ + VPADDQ v2, v2, t0; \ + VPSRLQ $63, v2, v2; \ + VPXOR t0, v2, v2; \ + VPADDQ v3, v3, t0; \ + VPSRLQ $63, v3, v3; \ + VPXOR t0, v3, v3 + +// load msg: X12 = (i0, i1), X13 = (i2, i3), X14 = (i4, i5), X15 = (i6, i7) +// i0, i1, i2, i3, i4, i5, i6, i7 must not be 0 +#define LOAD_MSG_AVX(i0, i1, i2, i3, i4, i5, i6, i7) \ + VMOVQ_SI_X12(i0*8); \ + VMOVQ_SI_X13(i2*8); \ + VMOVQ_SI_X14(i4*8); \ + VMOVQ_SI_X15(i6*8); \ + VPINSRQ_1_SI_X12(i1*8); \ + VPINSRQ_1_SI_X13(i3*8); \ + VPINSRQ_1_SI_X14(i5*8); \ + VPINSRQ_1_SI_X15(i7*8) + +// load msg: X12 = (0, 2), X13 = (4, 6), X14 = (1, 3), X15 = (5, 7) +#define LOAD_MSG_AVX_0_2_4_6_1_3_5_7() \ + VMOVQ_SI_X12_0; \ + VMOVQ_SI_X13(4*8); \ + VMOVQ_SI_X14(1*8); \ + VMOVQ_SI_X15(5*8); \ + VPINSRQ_1_SI_X12(2*8); \ + VPINSRQ_1_SI_X13(6*8); \ + VPINSRQ_1_SI_X14(3*8); \ + VPINSRQ_1_SI_X15(7*8) + +// load msg: X12 = (1, 0), X13 = (11, 5), X14 = (12, 2), X15 = (7, 3) +#define LOAD_MSG_AVX_1_0_11_5_12_2_7_3() \ + VPSHUFD $0x4E, 0*8(SI), X12; \ + VMOVQ_SI_X13(11*8); \ + VMOVQ_SI_X14(12*8); \ + VMOVQ_SI_X15(7*8); \ + VPINSRQ_1_SI_X13(5*8); \ + VPINSRQ_1_SI_X14(2*8); \ + VPINSRQ_1_SI_X15(3*8) + +// load msg: X12 = (11, 12), X13 = (5, 15), X14 = (8, 0), X15 = (2, 13) +#define LOAD_MSG_AVX_11_12_5_15_8_0_2_13() \ + VMOVDQU 11*8(SI), X12; \ + VMOVQ_SI_X13(5*8); \ + VMOVQ_SI_X14(8*8); \ + VMOVQ_SI_X15(2*8); \ + VPINSRQ_1_SI_X13(15*8); \ + VPINSRQ_1_SI_X14_0; \ + VPINSRQ_1_SI_X15(13*8) + +// load msg: X12 = (2, 5), X13 = (4, 15), X14 = (6, 10), X15 = (0, 8) +#define LOAD_MSG_AVX_2_5_4_15_6_10_0_8() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X13(4*8); \ + VMOVQ_SI_X14(6*8); \ + VMOVQ_SI_X15_0; \ + VPINSRQ_1_SI_X12(5*8); \ + VPINSRQ_1_SI_X13(15*8); \ + VPINSRQ_1_SI_X14(10*8); \ + VPINSRQ_1_SI_X15(8*8) -DATA ·AVX2_c48<>+0(SB)/8, $0x0100070605040302 -DATA ·AVX2_c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -DATA ·AVX2_c48<>+16(SB)/8, $0x0100070605040302 -DATA ·AVX2_c48<>+24(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·AVX2_c48<>(SB), RODATA|NOPTR, $32 +// load msg: X12 = (9, 5), X13 = (2, 10), X14 = (0, 7), X15 = (4, 15) +#define LOAD_MSG_AVX_9_5_2_10_0_7_4_15() \ + VMOVQ_SI_X12(9*8); \ + VMOVQ_SI_X13(2*8); \ + VMOVQ_SI_X14_0; \ + VMOVQ_SI_X15(4*8); \ + VPINSRQ_1_SI_X12(5*8); \ + VPINSRQ_1_SI_X13(10*8); \ + VPINSRQ_1_SI_X14(7*8); \ + VPINSRQ_1_SI_X15(15*8) -DATA ·AVX2_iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·AVX2_iv0<>+8(SB)/8, $0xbb67ae8584caa73b -DATA ·AVX2_iv0<>+16(SB)/8, $0x3c6ef372fe94f82b -DATA ·AVX2_iv0<>+24(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·AVX2_iv0<>(SB), RODATA|NOPTR, $32 +// load msg: X12 = (2, 6), X13 = (0, 8), X14 = (12, 10), X15 = (11, 3) +#define LOAD_MSG_AVX_2_6_0_8_12_10_11_3() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X13_0; \ + VMOVQ_SI_X14(12*8); \ + VMOVQ_SI_X15(11*8); \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X13(8*8); \ + VPINSRQ_1_SI_X14(10*8); \ + VPINSRQ_1_SI_X15(3*8) -DATA ·AVX2_iv1<>+0(SB)/8, $0x510e527fade682d1 -DATA ·AVX2_iv1<>+8(SB)/8, $0x9b05688c2b3e6c1f -DATA ·AVX2_iv1<>+16(SB)/8, $0x1f83d9abfb41bd6b -DATA ·AVX2_iv1<>+24(SB)/8, $0x5be0cd19137e2179 -GLOBL ·AVX2_iv1<>(SB), RODATA|NOPTR, $32 +// load msg: X12 = (0, 6), X13 = (9, 8), X14 = (7, 3), X15 = (2, 11) +#define LOAD_MSG_AVX_0_6_9_8_7_3_2_11() \ + MOVQ 0*8(SI), X12; \ + VPSHUFD $0x4E, 8*8(SI), X13; \ + MOVQ 7*8(SI), X14; \ + MOVQ 2*8(SI), X15; \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X14(3*8); \ + VPINSRQ_1_SI_X15(11*8) + +// load msg: X12 = (6, 14), X13 = (11, 0), X14 = (15, 9), X15 = (3, 8) +#define LOAD_MSG_AVX_6_14_11_0_15_9_3_8() \ + MOVQ 6*8(SI), X12; \ + MOVQ 11*8(SI), X13; \ + MOVQ 15*8(SI), X14; \ + MOVQ 3*8(SI), X15; \ + VPINSRQ_1_SI_X12(14*8); \ + VPINSRQ_1_SI_X13_0; \ + VPINSRQ_1_SI_X14(9*8); \ + VPINSRQ_1_SI_X15(8*8) + +// load msg: X12 = (5, 15), X13 = (8, 2), X14 = (0, 4), X15 = (6, 10) +#define LOAD_MSG_AVX_5_15_8_2_0_4_6_10() \ + MOVQ 5*8(SI), X12; \ + MOVQ 8*8(SI), X13; \ + MOVQ 0*8(SI), X14; \ + MOVQ 6*8(SI), X15; \ + VPINSRQ_1_SI_X12(15*8); \ + VPINSRQ_1_SI_X13(2*8); \ + VPINSRQ_1_SI_X14(4*8); \ + VPINSRQ_1_SI_X15(10*8) + +// load msg: X12 = (12, 13), X13 = (1, 10), X14 = (2, 7), X15 = (4, 5) +#define LOAD_MSG_AVX_12_13_1_10_2_7_4_5() \ + VMOVDQU 12*8(SI), X12; \ + MOVQ 1*8(SI), X13; \ + MOVQ 2*8(SI), X14; \ + VPINSRQ_1_SI_X13(10*8); \ + VPINSRQ_1_SI_X14(7*8); \ + VMOVDQU 4*8(SI), X15 + +// load msg: X12 = (15, 9), X13 = (3, 13), X14 = (11, 14), X15 = (12, 0) +#define LOAD_MSG_AVX_15_9_3_13_11_14_12_0() \ + MOVQ 15*8(SI), X12; \ + MOVQ 3*8(SI), X13; \ + MOVQ 11*8(SI), X14; \ + MOVQ 12*8(SI), X15; \ + VPINSRQ_1_SI_X12(9*8); \ + VPINSRQ_1_SI_X13(13*8); \ + VPINSRQ_1_SI_X14(14*8); \ + VPINSRQ_1_SI_X15_0 // func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: AVX, SSE2 -TEXT ·hashBlocksAVX(SB), NOSPLIT, $288-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $0x0f, R10 - ANDQ $-16, R10 - VMOVDQU ·AVX_c40<>+0(SB), X0 - VMOVDQU ·AVX_c48<>+0(SB), X1 +TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 + + VMOVDQU ·AVX_c40<>(SB), X0 + VMOVDQU ·AVX_c48<>(SB), X1 VMOVDQA X0, X8 VMOVDQA X1, X9 - VMOVDQU ·AVX_iv3<>+0(SB), X0 - VMOVDQA X0, (R10) - XORQ CX, (R10) - VMOVDQU (AX), X10 + + VMOVDQU ·AVX_iv3<>(SB), X0 + VMOVDQA X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·AVX_iv3 ^ (CX || 0) + + VMOVDQU 0(AX), X10 VMOVDQU 16(AX), X11 VMOVDQU 32(AX), X2 VMOVDQU 48(AX), X3 - MOVQ (BX), R8 - MOVQ 8(BX), R9 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 loop: - ADDQ $0x80, R8 - CMPQ R8, $0x80 + ADDQ $128, R8 + CMPQ R8, $128 JGE noinc INCQ R9 noinc: - BYTE $0xc4 - BYTE $0x41 - BYTE $0xf9 - BYTE $0x6e - BYTE $0xf8 - BYTE $0xc4 - BYTE $0x43 - BYTE $0x81 - BYTE $0x22 - BYTE $0xf9 - BYTE $0x01 + VMOVQ_R8_X15 + VPINSRQ_1_R9_X15 + VMOVDQA X10, X0 VMOVDQA X11, X1 - VMOVDQU ·AVX_iv0<>+0(SB), X4 - VMOVDQU ·AVX_iv1<>+0(SB), X5 - VMOVDQU ·AVX_iv2<>+0(SB), X6 + VMOVDQU ·AVX_iv0<>(SB), X4 + VMOVDQU ·AVX_iv1<>(SB), X5 + VMOVDQU ·AVX_iv2<>(SB), X6 + VPXOR X15, X6, X6 - VMOVDQA (R10), X7 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x26 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x28 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x38 - BYTE $0x01 + VMOVDQA 0(R10), X7 + + LOAD_MSG_AVX_0_2_4_6_1_3_5_7() VMOVDQA X12, 16(R10) VMOVDQA X13, 32(R10) VMOVDQA X14, 48(R10) VMOVDQA X15, 64(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x78 - BYTE $0x01 + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(8, 10, 12, 14, 9, 11, 13, 15) VMOVDQA X12, 80(R10) VMOVDQA X13, 96(R10) VMOVDQA X14, 112(R10) VMOVDQA X15, 128(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x68 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x30 - BYTE $0x01 + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(14, 4, 9, 13, 10, 8, 15, 6) VMOVDQA X12, 144(R10) VMOVDQA X13, 160(R10) VMOVDQA X14, 176(R10) VMOVDQA X15, 192(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPSHUFD $0x4e, (SI), X12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_1_0_11_5_12_2_7_3() VMOVDQA X12, 208(R10) VMOVDQA X13, 224(R10) VMOVDQA X14, 240(R10) VMOVDQA X15, 256(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VMOVDQU 88(SI), X12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x36 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x68 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x20 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x70 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x3e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x40 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x36 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x78 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x60 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x68 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x2e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x48 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ (SI), X12 - VPSHUFD $0x4e, 64(SI), X13 - MOVQ 56(SI), X14 - MOVQ 16(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x58 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x48 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ 40(SI), X12 - MOVQ 64(SI), X13 - MOVQ (SI), X14 - MOVQ 48(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - MOVQ 48(SI), X12 - MOVQ 88(SI), X13 - MOVQ 120(SI), X14 - MOVQ 24(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x2e - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x40 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VMOVDQU 96(SI), X12 - MOVQ 8(SI), X13 - MOVQ 16(SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - VMOVDQU 32(SI), X15 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x28 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ 120(SI), X12 - MOVQ 24(SI), X13 - MOVQ 88(SI), X14 - MOVQ 96(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x68 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x3e - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VPADDQ 16(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 32(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 48(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 64(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPADDQ 80(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 96(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 112(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 128(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VPADDQ 144(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 160(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 176(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 192(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPADDQ 208(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 224(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 240(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 256(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_11_12_5_15_8_0_2_13() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(10, 3, 7, 9, 14, 6, 1, 4) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(7, 3, 13, 11, 9, 1, 12, 14) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_2_5_4_15_6_10_0_8() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_9_5_2_10_0_7_4_15() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(14, 11, 6, 3, 1, 12, 8, 13) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_2_6_0_8_12_10_11_3() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(4, 7, 15, 1, 13, 5, 14, 9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(12, 1, 14, 4, 5, 15, 13, 10) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_0_6_9_8_7_3_2_11() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(13, 7, 12, 3, 11, 14, 1, 9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_5_15_8_2_0_4_6_10() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_6_14_11_0_15_9_3_8() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_12_13_1_10_2_7_4_5() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(10, 8, 7, 1, 2, 4, 6, 5) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_15_9_3_13_11_14_12_0() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X15, X8, X9) + SHUFFLE_AVX() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X15, X8, X9) + SHUFFLE_AVX_INV() + + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X15, X8, X9) + SHUFFLE_AVX() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X15, X8, X9) + SHUFFLE_AVX_INV() + VMOVDQU 32(AX), X14 VMOVDQU 48(AX), X15 VPXOR X0, X10, X10 @@ -4524,36 +729,16 @@ noinc: VPXOR X7, X15, X3 VMOVDQU X2, 32(AX) VMOVDQU X3, 48(AX) - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - VMOVDQU X10, (AX) - VMOVDQU X11, 16(AX) - MOVQ R8, (BX) - MOVQ R9, 8(BX) - VZEROUPPER - RET -DATA ·AVX_c40<>+0(SB)/8, $0x0201000706050403 -DATA ·AVX_c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·AVX_c40<>(SB), RODATA|NOPTR, $16 + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop -DATA ·AVX_c48<>+0(SB)/8, $0x0100070605040302 -DATA ·AVX_c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·AVX_c48<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv3<>+0(SB)/8, $0x1f83d9abfb41bd6b -DATA ·AVX_iv3<>+8(SB)/8, $0x5be0cd19137e2179 -GLOBL ·AVX_iv3<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·AVX_iv0<>+8(SB)/8, $0xbb67ae8584caa73b -GLOBL ·AVX_iv0<>(SB), RODATA|NOPTR, $16 + VMOVDQU X10, 0(AX) + VMOVDQU X11, 16(AX) -DATA ·AVX_iv1<>+0(SB)/8, $0x3c6ef372fe94f82b -DATA ·AVX_iv1<>+8(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·AVX_iv1<>(SB), RODATA|NOPTR, $16 + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + VZEROUPPER -DATA ·AVX_iv2<>+0(SB)/8, $0x510e527fade682d1 -DATA ·AVX_iv2<>+8(SB)/8, $0x9b05688c2b3e6c1f -GLOBL ·AVX_iv2<>(SB), RODATA|NOPTR, $16 + RET diff --git a/upstream/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/upstream/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s index 9a0ce212446..adfac00c15c 100644 --- a/upstream/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s @@ -1,1441 +1,278 @@ -// Code generated by command: go run blake2b_amd64_asm.go -out ../../blake2b_amd64.s -pkg blake2b. DO NOT EDIT. +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. //go:build amd64 && gc && !purego #include "textflag.h" +DATA ·iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +GLOBL ·iv0<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv1<>+0x00(SB)/8, $0x3c6ef372fe94f82b +DATA ·iv1<>+0x08(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·iv1<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv2<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·iv2<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +GLOBL ·iv2<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv3<>+0x00(SB)/8, $0x1f83d9abfb41bd6b +DATA ·iv3<>+0x08(SB)/8, $0x5be0cd19137e2179 +GLOBL ·iv3<>(SB), (NOPTR+RODATA), $16 + +DATA ·c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·c40<>(SB), (NOPTR+RODATA), $16 + +DATA ·c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·c48<>(SB), (NOPTR+RODATA), $16 + +#define SHUFFLE(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v6, t1; \ + PUNPCKLQDQ v6, t2; \ + PUNPCKHQDQ v7, v6; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ v7, t2; \ + MOVO t1, v7; \ + MOVO v2, t1; \ + PUNPCKHQDQ t2, v7; \ + PUNPCKLQDQ v3, t2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v3 + +#define SHUFFLE_INV(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v2, t1; \ + PUNPCKLQDQ v2, t2; \ + PUNPCKHQDQ v3, v2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ v3, t2; \ + MOVO t1, v3; \ + MOVO v6, t1; \ + PUNPCKHQDQ t2, v3; \ + PUNPCKLQDQ v7, t2; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v7 + +#define HALF_ROUND(v0, v1, v2, v3, v4, v5, v6, v7, m0, m1, m2, m3, t0, c40, c48) \ + PADDQ m0, v0; \ + PADDQ m1, v1; \ + PADDQ v2, v0; \ + PADDQ v3, v1; \ + PXOR v0, v6; \ + PXOR v1, v7; \ + PSHUFD $0xB1, v6, v6; \ + PSHUFD $0xB1, v7, v7; \ + PADDQ v6, v4; \ + PADDQ v7, v5; \ + PXOR v4, v2; \ + PXOR v5, v3; \ + PSHUFB c40, v2; \ + PSHUFB c40, v3; \ + PADDQ m2, v0; \ + PADDQ m3, v1; \ + PADDQ v2, v0; \ + PADDQ v3, v1; \ + PXOR v0, v6; \ + PXOR v1, v7; \ + PSHUFB c48, v6; \ + PSHUFB c48, v7; \ + PADDQ v6, v4; \ + PADDQ v7, v5; \ + PXOR v4, v2; \ + PXOR v5, v3; \ + MOVOU v2, t0; \ + PADDQ v2, t0; \ + PSRLQ $63, v2; \ + PXOR t0, v2; \ + MOVOU v3, t0; \ + PADDQ v3, t0; \ + PSRLQ $63, v3; \ + PXOR t0, v3 + +#define LOAD_MSG(m0, m1, m2, m3, src, i0, i1, i2, i3, i4, i5, i6, i7) \ + MOVQ i0*8(src), m0; \ + PINSRQ $1, i1*8(src), m0; \ + MOVQ i2*8(src), m1; \ + PINSRQ $1, i3*8(src), m1; \ + MOVQ i4*8(src), m2; \ + PINSRQ $1, i5*8(src), m2; \ + MOVQ i6*8(src), m3; \ + PINSRQ $1, i7*8(src), m3 + // func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: SSE2, SSE4.1, SSSE3 -TEXT ·hashBlocksSSE4(SB), NOSPLIT, $288-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $0x0f, R10 - ANDQ $-16, R10 - MOVOU ·iv3<>+0(SB), X0 - MOVO X0, (R10) - XORQ CX, (R10) - MOVOU ·c40<>+0(SB), X13 - MOVOU ·c48<>+0(SB), X14 - MOVOU (AX), X12 +TEXT ·hashBlocksSSE4(SB), 4, $288-48 // frame size = 272 + 16 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 + + MOVOU ·iv3<>(SB), X0 + MOVO X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·iv3 ^ (CX || 0) + + MOVOU ·c40<>(SB), X13 + MOVOU ·c48<>(SB), X14 + + MOVOU 0(AX), X12 MOVOU 16(AX), X15 - MOVQ (BX), R8 - MOVQ 8(BX), R9 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 loop: - ADDQ $0x80, R8 - CMPQ R8, $0x80 + ADDQ $128, R8 + CMPQ R8, $128 JGE noinc INCQ R9 noinc: - MOVQ R8, X8 - PINSRQ $0x01, R9, X8 - MOVO X12, X0 - MOVO X15, X1 - MOVOU 32(AX), X2 - MOVOU 48(AX), X3 - MOVOU ·iv0<>+0(SB), X4 - MOVOU ·iv1<>+0(SB), X5 - MOVOU ·iv2<>+0(SB), X6 - PXOR X8, X6 - MOVO (R10), X7 - MOVQ (SI), X8 - PINSRQ $0x01, 16(SI), X8 - MOVQ 32(SI), X9 - PINSRQ $0x01, 48(SI), X9 - MOVQ 8(SI), X10 - PINSRQ $0x01, 24(SI), X10 - MOVQ 40(SI), X11 - PINSRQ $0x01, 56(SI), X11 - MOVO X8, 16(R10) - MOVO X9, 32(R10) - MOVO X10, 48(R10) - MOVO X11, 64(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 64(SI), X8 - PINSRQ $0x01, 80(SI), X8 - MOVQ 96(SI), X9 - PINSRQ $0x01, 112(SI), X9 - MOVQ 72(SI), X10 - PINSRQ $0x01, 88(SI), X10 - MOVQ 104(SI), X11 - PINSRQ $0x01, 120(SI), X11 - MOVO X8, 80(R10) - MOVO X9, 96(R10) - MOVO X10, 112(R10) - MOVO X11, 128(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 112(SI), X8 - PINSRQ $0x01, 32(SI), X8 - MOVQ 72(SI), X9 - PINSRQ $0x01, 104(SI), X9 - MOVQ 80(SI), X10 - PINSRQ $0x01, 64(SI), X10 - MOVQ 120(SI), X11 - PINSRQ $0x01, 48(SI), X11 - MOVO X8, 144(R10) - MOVO X9, 160(R10) - MOVO X10, 176(R10) - MOVO X11, 192(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 8(SI), X8 - PINSRQ $0x01, (SI), X8 - MOVQ 88(SI), X9 - PINSRQ $0x01, 40(SI), X9 - MOVQ 96(SI), X10 - PINSRQ $0x01, 16(SI), X10 - MOVQ 56(SI), X11 - PINSRQ $0x01, 24(SI), X11 - MOVO X8, 208(R10) - MOVO X9, 224(R10) - MOVO X10, 240(R10) - MOVO X11, 256(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 88(SI), X8 - PINSRQ $0x01, 96(SI), X8 - MOVQ 40(SI), X9 - PINSRQ $0x01, 120(SI), X9 - MOVQ 64(SI), X10 - PINSRQ $0x01, (SI), X10 - MOVQ 16(SI), X11 - PINSRQ $0x01, 104(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 80(SI), X8 - PINSRQ $0x01, 24(SI), X8 - MOVQ 56(SI), X9 - PINSRQ $0x01, 72(SI), X9 - MOVQ 112(SI), X10 - PINSRQ $0x01, 48(SI), X10 - MOVQ 8(SI), X11 - PINSRQ $0x01, 32(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 56(SI), X8 - PINSRQ $0x01, 24(SI), X8 - MOVQ 104(SI), X9 - PINSRQ $0x01, 88(SI), X9 - MOVQ 72(SI), X10 - PINSRQ $0x01, 8(SI), X10 - MOVQ 96(SI), X11 - PINSRQ $0x01, 112(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 16(SI), X8 - PINSRQ $0x01, 40(SI), X8 - MOVQ 32(SI), X9 - PINSRQ $0x01, 120(SI), X9 - MOVQ 48(SI), X10 - PINSRQ $0x01, 80(SI), X10 - MOVQ (SI), X11 - PINSRQ $0x01, 64(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 72(SI), X8 - PINSRQ $0x01, 40(SI), X8 - MOVQ 16(SI), X9 - PINSRQ $0x01, 80(SI), X9 - MOVQ (SI), X10 - PINSRQ $0x01, 56(SI), X10 - MOVQ 32(SI), X11 - PINSRQ $0x01, 120(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 112(SI), X8 - PINSRQ $0x01, 88(SI), X8 - MOVQ 48(SI), X9 - PINSRQ $0x01, 24(SI), X9 - MOVQ 8(SI), X10 - PINSRQ $0x01, 96(SI), X10 - MOVQ 64(SI), X11 - PINSRQ $0x01, 104(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 16(SI), X8 - PINSRQ $0x01, 48(SI), X8 - MOVQ (SI), X9 - PINSRQ $0x01, 64(SI), X9 - MOVQ 96(SI), X10 - PINSRQ $0x01, 80(SI), X10 - MOVQ 88(SI), X11 - PINSRQ $0x01, 24(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 32(SI), X8 - PINSRQ $0x01, 56(SI), X8 - MOVQ 120(SI), X9 - PINSRQ $0x01, 8(SI), X9 - MOVQ 104(SI), X10 - PINSRQ $0x01, 40(SI), X10 - MOVQ 112(SI), X11 - PINSRQ $0x01, 72(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 96(SI), X8 - PINSRQ $0x01, 8(SI), X8 - MOVQ 112(SI), X9 - PINSRQ $0x01, 32(SI), X9 - MOVQ 40(SI), X10 - PINSRQ $0x01, 120(SI), X10 - MOVQ 104(SI), X11 - PINSRQ $0x01, 80(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ (SI), X8 - PINSRQ $0x01, 48(SI), X8 - MOVQ 72(SI), X9 - PINSRQ $0x01, 64(SI), X9 - MOVQ 56(SI), X10 - PINSRQ $0x01, 24(SI), X10 - MOVQ 16(SI), X11 - PINSRQ $0x01, 88(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 104(SI), X8 - PINSRQ $0x01, 56(SI), X8 - MOVQ 96(SI), X9 - PINSRQ $0x01, 24(SI), X9 - MOVQ 88(SI), X10 - PINSRQ $0x01, 112(SI), X10 - MOVQ 8(SI), X11 - PINSRQ $0x01, 72(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 40(SI), X8 - PINSRQ $0x01, 120(SI), X8 - MOVQ 64(SI), X9 - PINSRQ $0x01, 16(SI), X9 - MOVQ (SI), X10 - PINSRQ $0x01, 32(SI), X10 - MOVQ 48(SI), X11 - PINSRQ $0x01, 80(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 48(SI), X8 - PINSRQ $0x01, 112(SI), X8 - MOVQ 88(SI), X9 - PINSRQ $0x01, (SI), X9 - MOVQ 120(SI), X10 - PINSRQ $0x01, 72(SI), X10 - MOVQ 24(SI), X11 - PINSRQ $0x01, 64(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 96(SI), X8 - PINSRQ $0x01, 104(SI), X8 - MOVQ 8(SI), X9 - PINSRQ $0x01, 80(SI), X9 - MOVQ 16(SI), X10 - PINSRQ $0x01, 56(SI), X10 - MOVQ 32(SI), X11 - PINSRQ $0x01, 40(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 80(SI), X8 - PINSRQ $0x01, 64(SI), X8 - MOVQ 56(SI), X9 - PINSRQ $0x01, 8(SI), X9 - MOVQ 16(SI), X10 - PINSRQ $0x01, 32(SI), X10 - MOVQ 48(SI), X11 - PINSRQ $0x01, 40(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 120(SI), X8 - PINSRQ $0x01, 72(SI), X8 - MOVQ 24(SI), X9 - PINSRQ $0x01, 104(SI), X9 - MOVQ 88(SI), X10 - PINSRQ $0x01, 112(SI), X10 - MOVQ 96(SI), X11 - PINSRQ $0x01, (SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - PADDQ 16(R10), X0 - PADDQ 32(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 48(R10), X0 - PADDQ 64(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - PADDQ 80(R10), X0 - PADDQ 96(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 112(R10), X0 - PADDQ 128(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - PADDQ 144(R10), X0 - PADDQ 160(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 176(R10), X0 - PADDQ 192(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - PADDQ 208(R10), X0 - PADDQ 224(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 240(R10), X0 - PADDQ 256(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU 32(AX), X10 - MOVOU 48(AX), X11 - PXOR X0, X12 - PXOR X1, X15 - PXOR X2, X10 - PXOR X3, X11 - PXOR X4, X12 - PXOR X5, X15 - PXOR X6, X10 - PXOR X7, X11 - MOVOU X10, 32(AX) - MOVOU X11, 48(AX) - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - MOVOU X12, (AX) - MOVOU X15, 16(AX) - MOVQ R8, (BX) - MOVQ R9, 8(BX) - RET + MOVQ R8, X8 + PINSRQ $1, R9, X8 + + MOVO X12, X0 + MOVO X15, X1 + MOVOU 32(AX), X2 + MOVOU 48(AX), X3 + MOVOU ·iv0<>(SB), X4 + MOVOU ·iv1<>(SB), X5 + MOVOU ·iv2<>(SB), X6 + + PXOR X8, X6 + MOVO 0(R10), X7 + + LOAD_MSG(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7) + MOVO X8, 16(R10) + MOVO X9, 32(R10) + MOVO X10, 48(R10) + MOVO X11, 64(R10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 8, 10, 12, 14, 9, 11, 13, 15) + MOVO X8, 80(R10) + MOVO X9, 96(R10) + MOVO X10, 112(R10) + MOVO X11, 128(R10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6) + MOVO X8, 144(R10) + MOVO X9, 160(R10) + MOVO X10, 176(R10) + MOVO X11, 192(R10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 1, 0, 11, 5, 12, 2, 7, 3) + MOVO X8, 208(R10) + MOVO X9, 224(R10) + MOVO X10, 240(R10) + MOVO X11, 256(R10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 11, 12, 5, 15, 8, 0, 2, 13) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 10, 3, 7, 9, 14, 6, 1, 4) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 7, 3, 13, 11, 9, 1, 12, 14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 2, 5, 4, 15, 6, 10, 0, 8) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 9, 5, 2, 10, 0, 7, 4, 15) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 14, 11, 6, 3, 1, 12, 8, 13) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·iv3<>+0(SB)/8, $0x1f83d9abfb41bd6b -DATA ·iv3<>+8(SB)/8, $0x5be0cd19137e2179 -GLOBL ·iv3<>(SB), RODATA|NOPTR, $16 + LOAD_MSG(X8, X9, X10, X11, SI, 2, 6, 0, 8, 12, 10, 11, 3) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 4, 7, 15, 1, 13, 5, 14, 9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·c40<>+0(SB)/8, $0x0201000706050403 -DATA ·c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·c40<>(SB), RODATA|NOPTR, $16 + LOAD_MSG(X8, X9, X10, X11, SI, 12, 1, 14, 4, 5, 15, 13, 10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 0, 6, 9, 8, 7, 3, 2, 11) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·c48<>+0(SB)/8, $0x0100070605040302 -DATA ·c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·c48<>(SB), RODATA|NOPTR, $16 + LOAD_MSG(X8, X9, X10, X11, SI, 13, 7, 12, 3, 11, 14, 1, 9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 5, 15, 8, 2, 0, 4, 6, 10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·iv0<>+8(SB)/8, $0xbb67ae8584caa73b -GLOBL ·iv0<>(SB), RODATA|NOPTR, $16 + LOAD_MSG(X8, X9, X10, X11, SI, 6, 14, 11, 0, 15, 9, 3, 8) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 12, 13, 1, 10, 2, 7, 4, 5) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·iv1<>+0(SB)/8, $0x3c6ef372fe94f82b -DATA ·iv1<>+8(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·iv1<>(SB), RODATA|NOPTR, $16 + LOAD_MSG(X8, X9, X10, X11, SI, 10, 8, 7, 1, 2, 4, 6, 5) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 15, 9, 3, 13, 11, 14, 12, 0) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) -DATA ·iv2<>+0(SB)/8, $0x510e527fade682d1 -DATA ·iv2<>+8(SB)/8, $0x9b05688c2b3e6c1f -GLOBL ·iv2<>(SB), RODATA|NOPTR, $16 + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + MOVOU 32(AX), X10 + MOVOU 48(AX), X11 + PXOR X0, X12 + PXOR X1, X15 + PXOR X2, X10 + PXOR X3, X11 + PXOR X4, X12 + PXOR X5, X15 + PXOR X6, X10 + PXOR X7, X11 + MOVOU X10, 32(AX) + MOVOU X11, 48(AX) + + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop + + MOVOU X12, 0(AX) + MOVOU X15, 16(AX) + + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + + RET diff --git a/upstream/vendor/golang.org/x/crypto/blake2s/blake2s.go b/upstream/vendor/golang.org/x/crypto/blake2s/blake2s.go index c25d07d4f46..e3f46aab3a1 100644 --- a/upstream/vendor/golang.org/x/crypto/blake2s/blake2s.go +++ b/upstream/vendor/golang.org/x/crypto/blake2s/blake2s.go @@ -16,10 +16,9 @@ // // BLAKE2X is a construction to compute hash values larger than 32 bytes. It // can produce hash values between 0 and 65535 bytes. -package blake2s +package blake2s // import "golang.org/x/crypto/blake2s" import ( - "crypto" "encoding/binary" "errors" "hash" @@ -56,13 +55,6 @@ func Sum256(data []byte) [Size]byte { // and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash. func New256(key []byte) (hash.Hash, error) { return newDigest(Size, key) } -func init() { - crypto.RegisterHash(crypto.BLAKE2s_256, func() hash.Hash { - h, _ := New256(nil) - return h - }) -} - // New128 returns a new hash.Hash computing the BLAKE2s-128 checksum given a // non-empty key. Note that a 128-bit digest is too small to be secure as a // cryptographic hash and should only be used as a MAC, thus the key argument diff --git a/upstream/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s b/upstream/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s index 57d510fc08d..fe4b818a33a 100644 --- a/upstream/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s @@ -1,2173 +1,432 @@ -// Code generated by command: go run blake2s_amd64_asm.go -out ../blake2s_amd64.s -pkg blake2s. DO NOT EDIT. +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. //go:build amd64 && gc && !purego #include "textflag.h" -// func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) -// Requires: SSE2 -TEXT ·hashBlocksSSE2(SB), $672-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVL flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DX - MOVQ SP, BP - ADDQ $0x0f, BP - ANDQ $-16, BP - MOVQ (BX), R9 - MOVQ R9, (BP) - MOVQ CX, 8(BP) - MOVOU (AX), X0 - MOVOU 16(AX), X1 - MOVOU iv0<>+0(SB), X2 - MOVOU iv1<>+0(SB), X3 - MOVOU counter<>+0(SB), X12 - MOVOU rol16<>+0(SB), X13 - MOVOU rol8<>+0(SB), X14 - MOVO (BP), X15 +DATA iv0<>+0x00(SB)/4, $0x6a09e667 +DATA iv0<>+0x04(SB)/4, $0xbb67ae85 +DATA iv0<>+0x08(SB)/4, $0x3c6ef372 +DATA iv0<>+0x0c(SB)/4, $0xa54ff53a +GLOBL iv0<>(SB), (NOPTR+RODATA), $16 -loop: - MOVO X0, X4 - MOVO X1, X5 - MOVO X2, X6 - MOVO X3, X7 - PADDQ X12, X15 - PXOR X15, X7 - MOVQ (SI), R8 - MOVQ 8(SI), R9 - MOVQ 16(SI), R10 - MOVQ 24(SI), R11 - MOVQ 32(SI), R12 - MOVQ 40(SI), R13 - MOVQ 48(SI), R14 - MOVQ 56(SI), R15 - MOVL R8, 16(BP) - MOVL R8, 116(BP) - MOVL R8, 164(BP) - MOVL R8, 264(BP) - MOVL R8, 288(BP) - MOVL R8, 344(BP) - MOVL R8, 432(BP) - MOVL R8, 512(BP) - MOVL R8, 540(BP) - MOVL R8, 652(BP) - SHRQ $0x20, R8 - MOVL R8, 32(BP) - MOVL R8, 112(BP) - MOVL R8, 200(BP) - MOVL R8, 228(BP) - MOVL R8, 320(BP) - MOVL R8, 380(BP) - MOVL R8, 404(BP) - MOVL R8, 488(BP) - MOVL R8, 568(BP) - MOVL R8, 604(BP) - MOVL R9, 20(BP) - MOVL R9, 132(BP) - MOVL R9, 168(BP) - MOVL R9, 240(BP) - MOVL R9, 280(BP) - MOVL R9, 336(BP) - MOVL R9, 456(BP) - MOVL R9, 508(BP) - MOVL R9, 576(BP) - MOVL R9, 608(BP) - SHRQ $0x20, R9 - MOVL R9, 36(BP) - MOVL R9, 140(BP) - MOVL R9, 180(BP) - MOVL R9, 212(BP) - MOVL R9, 316(BP) - MOVL R9, 364(BP) - MOVL R9, 452(BP) - MOVL R9, 476(BP) - MOVL R9, 552(BP) - MOVL R9, 632(BP) - MOVL R10, 24(BP) - MOVL R10, 84(BP) - MOVL R10, 204(BP) - MOVL R10, 248(BP) - MOVL R10, 296(BP) - MOVL R10, 368(BP) - MOVL R10, 412(BP) - MOVL R10, 516(BP) - MOVL R10, 584(BP) - MOVL R10, 612(BP) - SHRQ $0x20, R10 - MOVL R10, 40(BP) - MOVL R10, 124(BP) - MOVL R10, 152(BP) - MOVL R10, 244(BP) - MOVL R10, 276(BP) - MOVL R10, 388(BP) - MOVL R10, 416(BP) - MOVL R10, 496(BP) - MOVL R10, 588(BP) - MOVL R10, 620(BP) - MOVL R11, 28(BP) - MOVL R11, 108(BP) - MOVL R11, 196(BP) - MOVL R11, 256(BP) - MOVL R11, 312(BP) - MOVL R11, 340(BP) - MOVL R11, 436(BP) - MOVL R11, 520(BP) - MOVL R11, 528(BP) - MOVL R11, 616(BP) - SHRQ $0x20, R11 - MOVL R11, 44(BP) - MOVL R11, 136(BP) - MOVL R11, 184(BP) - MOVL R11, 208(BP) - MOVL R11, 292(BP) - MOVL R11, 372(BP) - MOVL R11, 448(BP) - MOVL R11, 468(BP) - MOVL R11, 580(BP) - MOVL R11, 600(BP) - MOVL R12, 48(BP) - MOVL R12, 100(BP) - MOVL R12, 160(BP) - MOVL R12, 268(BP) - MOVL R12, 328(BP) - MOVL R12, 348(BP) - MOVL R12, 444(BP) - MOVL R12, 504(BP) - MOVL R12, 556(BP) - MOVL R12, 596(BP) - SHRQ $0x20, R12 - MOVL R12, 64(BP) - MOVL R12, 88(BP) - MOVL R12, 188(BP) - MOVL R12, 224(BP) - MOVL R12, 272(BP) - MOVL R12, 396(BP) - MOVL R12, 440(BP) - MOVL R12, 492(BP) - MOVL R12, 548(BP) - MOVL R12, 628(BP) - MOVL R13, 52(BP) - MOVL R13, 96(BP) - MOVL R13, 176(BP) - MOVL R13, 260(BP) - MOVL R13, 284(BP) - MOVL R13, 356(BP) - MOVL R13, 428(BP) - MOVL R13, 524(BP) - MOVL R13, 572(BP) - MOVL R13, 592(BP) - SHRQ $0x20, R13 - MOVL R13, 68(BP) - MOVL R13, 120(BP) - MOVL R13, 144(BP) - MOVL R13, 220(BP) - MOVL R13, 308(BP) - MOVL R13, 360(BP) - MOVL R13, 460(BP) - MOVL R13, 480(BP) - MOVL R13, 536(BP) - MOVL R13, 640(BP) - MOVL R14, 56(BP) - MOVL R14, 128(BP) - MOVL R14, 148(BP) - MOVL R14, 232(BP) - MOVL R14, 324(BP) - MOVL R14, 352(BP) - MOVL R14, 400(BP) - MOVL R14, 472(BP) - MOVL R14, 560(BP) - MOVL R14, 648(BP) - SHRQ $0x20, R14 - MOVL R14, 72(BP) - MOVL R14, 92(BP) - MOVL R14, 172(BP) - MOVL R14, 216(BP) - MOVL R14, 332(BP) - MOVL R14, 384(BP) - MOVL R14, 424(BP) - MOVL R14, 464(BP) - MOVL R14, 564(BP) - MOVL R14, 636(BP) - MOVL R15, 60(BP) - MOVL R15, 80(BP) - MOVL R15, 192(BP) - MOVL R15, 236(BP) - MOVL R15, 304(BP) - MOVL R15, 392(BP) - MOVL R15, 408(BP) - MOVL R15, 484(BP) - MOVL R15, 532(BP) - MOVL R15, 644(BP) - SHRQ $0x20, R15 - MOVL R15, 76(BP) - MOVL R15, 104(BP) - MOVL R15, 156(BP) - MOVL R15, 252(BP) - MOVL R15, 300(BP) - MOVL R15, 376(BP) - MOVL R15, 420(BP) - MOVL R15, 500(BP) - MOVL R15, 544(BP) - MOVL R15, 624(BP) - PADDL 16(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 32(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 48(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 64(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 80(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 96(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 112(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 128(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 144(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 160(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 176(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 192(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 208(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 224(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 240(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 256(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 272(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 288(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 304(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 320(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 336(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 352(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 368(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 384(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 400(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 416(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 432(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 448(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 464(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 480(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 496(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 512(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 528(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 544(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 560(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 576(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 592(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 608(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 624(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x10, X8 - PSRLL $0x10, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 640(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - MOVO X7, X8 - PSLLL $0x18, X8 - PSRLL $0x08, X7 - PXOR X8, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PXOR X4, X0 - PXOR X5, X1 - PXOR X6, X0 - PXOR X7, X1 - LEAQ 64(SI), SI - SUBQ $0x40, DX - JNE loop - MOVO X15, (BP) - MOVQ (BP), R9 - MOVQ R9, (BX) - MOVOU X0, (AX) - MOVOU X1, 16(AX) - RET +DATA iv1<>+0x00(SB)/4, $0x510e527f +DATA iv1<>+0x04(SB)/4, $0x9b05688c +DATA iv1<>+0x08(SB)/4, $0x1f83d9ab +DATA iv1<>+0x0c(SB)/4, $0x5be0cd19 +GLOBL iv1<>(SB), (NOPTR+RODATA), $16 -DATA iv0<>+0(SB)/4, $0x6a09e667 -DATA iv0<>+4(SB)/4, $0xbb67ae85 -DATA iv0<>+8(SB)/4, $0x3c6ef372 -DATA iv0<>+12(SB)/4, $0xa54ff53a -GLOBL iv0<>(SB), RODATA|NOPTR, $16 +DATA rol16<>+0x00(SB)/8, $0x0504070601000302 +DATA rol16<>+0x08(SB)/8, $0x0D0C0F0E09080B0A +GLOBL rol16<>(SB), (NOPTR+RODATA), $16 -DATA iv1<>+0(SB)/4, $0x510e527f -DATA iv1<>+4(SB)/4, $0x9b05688c -DATA iv1<>+8(SB)/4, $0x1f83d9ab -DATA iv1<>+12(SB)/4, $0x5be0cd19 -GLOBL iv1<>(SB), RODATA|NOPTR, $16 +DATA rol8<>+0x00(SB)/8, $0x0407060500030201 +DATA rol8<>+0x08(SB)/8, $0x0C0F0E0D080B0A09 +GLOBL rol8<>(SB), (NOPTR+RODATA), $16 -DATA counter<>+0(SB)/8, $0x0000000000000040 -DATA counter<>+8(SB)/8, $0x0000000000000000 -GLOBL counter<>(SB), RODATA|NOPTR, $16 +DATA counter<>+0x00(SB)/8, $0x40 +DATA counter<>+0x08(SB)/8, $0x0 +GLOBL counter<>(SB), (NOPTR+RODATA), $16 -DATA rol16<>+0(SB)/8, $0x0504070601000302 -DATA rol16<>+8(SB)/8, $0x0d0c0f0e09080b0a -GLOBL rol16<>(SB), RODATA|NOPTR, $16 +#define ROTL_SSE2(n, t, v) \ + MOVO v, t; \ + PSLLL $n, t; \ + PSRLL $(32-n), v; \ + PXOR t, v -DATA rol8<>+0(SB)/8, $0x0407060500030201 -DATA rol8<>+8(SB)/8, $0x0c0f0e0d080b0a09 -GLOBL rol8<>(SB), RODATA|NOPTR, $16 +#define ROTL_SSSE3(c, v) \ + PSHUFB c, v -// func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) -// Requires: SSE2, SSSE3 -TEXT ·hashBlocksSSSE3(SB), $672-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVL flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DX - MOVQ SP, BP - ADDQ $0x0f, BP - ANDQ $-16, BP - MOVQ (BX), R9 - MOVQ R9, (BP) - MOVQ CX, 8(BP) - MOVOU (AX), X0 - MOVOU 16(AX), X1 - MOVOU iv0<>+0(SB), X2 - MOVOU iv1<>+0(SB), X3 - MOVOU counter<>+0(SB), X12 - MOVOU rol16<>+0(SB), X13 - MOVOU rol8<>+0(SB), X14 - MOVO (BP), X15 +#define ROUND_SSE2(v0, v1, v2, v3, m0, m1, m2, m3, t) \ + PADDL m0, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSE2(16, t, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(20, t, v1); \ + PADDL m1, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSE2(24, t, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(25, t, v1); \ + PSHUFL $0x39, v1, v1; \ + PSHUFL $0x4E, v2, v2; \ + PSHUFL $0x93, v3, v3; \ + PADDL m2, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSE2(16, t, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(20, t, v1); \ + PADDL m3, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSE2(24, t, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(25, t, v1); \ + PSHUFL $0x39, v3, v3; \ + PSHUFL $0x4E, v2, v2; \ + PSHUFL $0x93, v1, v1 + +#define ROUND_SSSE3(v0, v1, v2, v3, m0, m1, m2, m3, t, c16, c8) \ + PADDL m0, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSSE3(c16, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(20, t, v1); \ + PADDL m1, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSSE3(c8, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(25, t, v1); \ + PSHUFL $0x39, v1, v1; \ + PSHUFL $0x4E, v2, v2; \ + PSHUFL $0x93, v3, v3; \ + PADDL m2, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSSE3(c16, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(20, t, v1); \ + PADDL m3, v0; \ + PADDL v1, v0; \ + PXOR v0, v3; \ + ROTL_SSSE3(c8, v3); \ + PADDL v3, v2; \ + PXOR v2, v1; \ + ROTL_SSE2(25, t, v1); \ + PSHUFL $0x39, v3, v3; \ + PSHUFL $0x4E, v2, v2; \ + PSHUFL $0x93, v1, v1 + + +#define LOAD_MSG_SSE4(m0, m1, m2, m3, src, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15) \ + MOVL i0*4(src), m0; \ + PINSRD $1, i1*4(src), m0; \ + PINSRD $2, i2*4(src), m0; \ + PINSRD $3, i3*4(src), m0; \ + MOVL i4*4(src), m1; \ + PINSRD $1, i5*4(src), m1; \ + PINSRD $2, i6*4(src), m1; \ + PINSRD $3, i7*4(src), m1; \ + MOVL i8*4(src), m2; \ + PINSRD $1, i9*4(src), m2; \ + PINSRD $2, i10*4(src), m2; \ + PINSRD $3, i11*4(src), m2; \ + MOVL i12*4(src), m3; \ + PINSRD $1, i13*4(src), m3; \ + PINSRD $2, i14*4(src), m3; \ + PINSRD $3, i15*4(src), m3 + +#define PRECOMPUTE_MSG(dst, off, src, R8, R9, R10, R11, R12, R13, R14, R15) \ + MOVQ 0*4(src), R8; \ + MOVQ 2*4(src), R9; \ + MOVQ 4*4(src), R10; \ + MOVQ 6*4(src), R11; \ + MOVQ 8*4(src), R12; \ + MOVQ 10*4(src), R13; \ + MOVQ 12*4(src), R14; \ + MOVQ 14*4(src), R15; \ + \ + MOVL R8, 0*4+off+0(dst); \ + MOVL R8, 9*4+off+64(dst); \ + MOVL R8, 5*4+off+128(dst); \ + MOVL R8, 14*4+off+192(dst); \ + MOVL R8, 4*4+off+256(dst); \ + MOVL R8, 2*4+off+320(dst); \ + MOVL R8, 8*4+off+384(dst); \ + MOVL R8, 12*4+off+448(dst); \ + MOVL R8, 3*4+off+512(dst); \ + MOVL R8, 15*4+off+576(dst); \ + SHRQ $32, R8; \ + MOVL R8, 4*4+off+0(dst); \ + MOVL R8, 8*4+off+64(dst); \ + MOVL R8, 14*4+off+128(dst); \ + MOVL R8, 5*4+off+192(dst); \ + MOVL R8, 12*4+off+256(dst); \ + MOVL R8, 11*4+off+320(dst); \ + MOVL R8, 1*4+off+384(dst); \ + MOVL R8, 6*4+off+448(dst); \ + MOVL R8, 10*4+off+512(dst); \ + MOVL R8, 3*4+off+576(dst); \ + \ + MOVL R9, 1*4+off+0(dst); \ + MOVL R9, 13*4+off+64(dst); \ + MOVL R9, 6*4+off+128(dst); \ + MOVL R9, 8*4+off+192(dst); \ + MOVL R9, 2*4+off+256(dst); \ + MOVL R9, 0*4+off+320(dst); \ + MOVL R9, 14*4+off+384(dst); \ + MOVL R9, 11*4+off+448(dst); \ + MOVL R9, 12*4+off+512(dst); \ + MOVL R9, 4*4+off+576(dst); \ + SHRQ $32, R9; \ + MOVL R9, 5*4+off+0(dst); \ + MOVL R9, 15*4+off+64(dst); \ + MOVL R9, 9*4+off+128(dst); \ + MOVL R9, 1*4+off+192(dst); \ + MOVL R9, 11*4+off+256(dst); \ + MOVL R9, 7*4+off+320(dst); \ + MOVL R9, 13*4+off+384(dst); \ + MOVL R9, 3*4+off+448(dst); \ + MOVL R9, 6*4+off+512(dst); \ + MOVL R9, 10*4+off+576(dst); \ + \ + MOVL R10, 2*4+off+0(dst); \ + MOVL R10, 1*4+off+64(dst); \ + MOVL R10, 15*4+off+128(dst); \ + MOVL R10, 10*4+off+192(dst); \ + MOVL R10, 6*4+off+256(dst); \ + MOVL R10, 8*4+off+320(dst); \ + MOVL R10, 3*4+off+384(dst); \ + MOVL R10, 13*4+off+448(dst); \ + MOVL R10, 14*4+off+512(dst); \ + MOVL R10, 5*4+off+576(dst); \ + SHRQ $32, R10; \ + MOVL R10, 6*4+off+0(dst); \ + MOVL R10, 11*4+off+64(dst); \ + MOVL R10, 2*4+off+128(dst); \ + MOVL R10, 9*4+off+192(dst); \ + MOVL R10, 1*4+off+256(dst); \ + MOVL R10, 13*4+off+320(dst); \ + MOVL R10, 4*4+off+384(dst); \ + MOVL R10, 8*4+off+448(dst); \ + MOVL R10, 15*4+off+512(dst); \ + MOVL R10, 7*4+off+576(dst); \ + \ + MOVL R11, 3*4+off+0(dst); \ + MOVL R11, 7*4+off+64(dst); \ + MOVL R11, 13*4+off+128(dst); \ + MOVL R11, 12*4+off+192(dst); \ + MOVL R11, 10*4+off+256(dst); \ + MOVL R11, 1*4+off+320(dst); \ + MOVL R11, 9*4+off+384(dst); \ + MOVL R11, 14*4+off+448(dst); \ + MOVL R11, 0*4+off+512(dst); \ + MOVL R11, 6*4+off+576(dst); \ + SHRQ $32, R11; \ + MOVL R11, 7*4+off+0(dst); \ + MOVL R11, 14*4+off+64(dst); \ + MOVL R11, 10*4+off+128(dst); \ + MOVL R11, 0*4+off+192(dst); \ + MOVL R11, 5*4+off+256(dst); \ + MOVL R11, 9*4+off+320(dst); \ + MOVL R11, 12*4+off+384(dst); \ + MOVL R11, 1*4+off+448(dst); \ + MOVL R11, 13*4+off+512(dst); \ + MOVL R11, 2*4+off+576(dst); \ + \ + MOVL R12, 8*4+off+0(dst); \ + MOVL R12, 5*4+off+64(dst); \ + MOVL R12, 4*4+off+128(dst); \ + MOVL R12, 15*4+off+192(dst); \ + MOVL R12, 14*4+off+256(dst); \ + MOVL R12, 3*4+off+320(dst); \ + MOVL R12, 11*4+off+384(dst); \ + MOVL R12, 10*4+off+448(dst); \ + MOVL R12, 7*4+off+512(dst); \ + MOVL R12, 1*4+off+576(dst); \ + SHRQ $32, R12; \ + MOVL R12, 12*4+off+0(dst); \ + MOVL R12, 2*4+off+64(dst); \ + MOVL R12, 11*4+off+128(dst); \ + MOVL R12, 4*4+off+192(dst); \ + MOVL R12, 0*4+off+256(dst); \ + MOVL R12, 15*4+off+320(dst); \ + MOVL R12, 10*4+off+384(dst); \ + MOVL R12, 7*4+off+448(dst); \ + MOVL R12, 5*4+off+512(dst); \ + MOVL R12, 9*4+off+576(dst); \ + \ + MOVL R13, 9*4+off+0(dst); \ + MOVL R13, 4*4+off+64(dst); \ + MOVL R13, 8*4+off+128(dst); \ + MOVL R13, 13*4+off+192(dst); \ + MOVL R13, 3*4+off+256(dst); \ + MOVL R13, 5*4+off+320(dst); \ + MOVL R13, 7*4+off+384(dst); \ + MOVL R13, 15*4+off+448(dst); \ + MOVL R13, 11*4+off+512(dst); \ + MOVL R13, 0*4+off+576(dst); \ + SHRQ $32, R13; \ + MOVL R13, 13*4+off+0(dst); \ + MOVL R13, 10*4+off+64(dst); \ + MOVL R13, 0*4+off+128(dst); \ + MOVL R13, 3*4+off+192(dst); \ + MOVL R13, 9*4+off+256(dst); \ + MOVL R13, 6*4+off+320(dst); \ + MOVL R13, 15*4+off+384(dst); \ + MOVL R13, 4*4+off+448(dst); \ + MOVL R13, 2*4+off+512(dst); \ + MOVL R13, 12*4+off+576(dst); \ + \ + MOVL R14, 10*4+off+0(dst); \ + MOVL R14, 12*4+off+64(dst); \ + MOVL R14, 1*4+off+128(dst); \ + MOVL R14, 6*4+off+192(dst); \ + MOVL R14, 13*4+off+256(dst); \ + MOVL R14, 4*4+off+320(dst); \ + MOVL R14, 0*4+off+384(dst); \ + MOVL R14, 2*4+off+448(dst); \ + MOVL R14, 8*4+off+512(dst); \ + MOVL R14, 14*4+off+576(dst); \ + SHRQ $32, R14; \ + MOVL R14, 14*4+off+0(dst); \ + MOVL R14, 3*4+off+64(dst); \ + MOVL R14, 7*4+off+128(dst); \ + MOVL R14, 2*4+off+192(dst); \ + MOVL R14, 15*4+off+256(dst); \ + MOVL R14, 12*4+off+320(dst); \ + MOVL R14, 6*4+off+384(dst); \ + MOVL R14, 0*4+off+448(dst); \ + MOVL R14, 9*4+off+512(dst); \ + MOVL R14, 11*4+off+576(dst); \ + \ + MOVL R15, 11*4+off+0(dst); \ + MOVL R15, 0*4+off+64(dst); \ + MOVL R15, 12*4+off+128(dst); \ + MOVL R15, 7*4+off+192(dst); \ + MOVL R15, 8*4+off+256(dst); \ + MOVL R15, 14*4+off+320(dst); \ + MOVL R15, 2*4+off+384(dst); \ + MOVL R15, 5*4+off+448(dst); \ + MOVL R15, 1*4+off+512(dst); \ + MOVL R15, 13*4+off+576(dst); \ + SHRQ $32, R15; \ + MOVL R15, 15*4+off+0(dst); \ + MOVL R15, 6*4+off+64(dst); \ + MOVL R15, 3*4+off+128(dst); \ + MOVL R15, 11*4+off+192(dst); \ + MOVL R15, 7*4+off+256(dst); \ + MOVL R15, 10*4+off+320(dst); \ + MOVL R15, 5*4+off+384(dst); \ + MOVL R15, 9*4+off+448(dst); \ + MOVL R15, 4*4+off+512(dst); \ + MOVL R15, 8*4+off+576(dst) + +#define BLAKE2s_SSE2() \ + PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSE2(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8) -loop: - MOVO X0, X4 - MOVO X1, X5 - MOVO X2, X6 - MOVO X3, X7 - PADDQ X12, X15 - PXOR X15, X7 - MOVQ (SI), R8 - MOVQ 8(SI), R9 - MOVQ 16(SI), R10 - MOVQ 24(SI), R11 - MOVQ 32(SI), R12 - MOVQ 40(SI), R13 - MOVQ 48(SI), R14 - MOVQ 56(SI), R15 - MOVL R8, 16(BP) - MOVL R8, 116(BP) - MOVL R8, 164(BP) - MOVL R8, 264(BP) - MOVL R8, 288(BP) - MOVL R8, 344(BP) - MOVL R8, 432(BP) - MOVL R8, 512(BP) - MOVL R8, 540(BP) - MOVL R8, 652(BP) - SHRQ $0x20, R8 - MOVL R8, 32(BP) - MOVL R8, 112(BP) - MOVL R8, 200(BP) - MOVL R8, 228(BP) - MOVL R8, 320(BP) - MOVL R8, 380(BP) - MOVL R8, 404(BP) - MOVL R8, 488(BP) - MOVL R8, 568(BP) - MOVL R8, 604(BP) - MOVL R9, 20(BP) - MOVL R9, 132(BP) - MOVL R9, 168(BP) - MOVL R9, 240(BP) - MOVL R9, 280(BP) - MOVL R9, 336(BP) - MOVL R9, 456(BP) - MOVL R9, 508(BP) - MOVL R9, 576(BP) - MOVL R9, 608(BP) - SHRQ $0x20, R9 - MOVL R9, 36(BP) - MOVL R9, 140(BP) - MOVL R9, 180(BP) - MOVL R9, 212(BP) - MOVL R9, 316(BP) - MOVL R9, 364(BP) - MOVL R9, 452(BP) - MOVL R9, 476(BP) - MOVL R9, 552(BP) - MOVL R9, 632(BP) - MOVL R10, 24(BP) - MOVL R10, 84(BP) - MOVL R10, 204(BP) - MOVL R10, 248(BP) - MOVL R10, 296(BP) - MOVL R10, 368(BP) - MOVL R10, 412(BP) - MOVL R10, 516(BP) - MOVL R10, 584(BP) - MOVL R10, 612(BP) - SHRQ $0x20, R10 - MOVL R10, 40(BP) - MOVL R10, 124(BP) - MOVL R10, 152(BP) - MOVL R10, 244(BP) - MOVL R10, 276(BP) - MOVL R10, 388(BP) - MOVL R10, 416(BP) - MOVL R10, 496(BP) - MOVL R10, 588(BP) - MOVL R10, 620(BP) - MOVL R11, 28(BP) - MOVL R11, 108(BP) - MOVL R11, 196(BP) - MOVL R11, 256(BP) - MOVL R11, 312(BP) - MOVL R11, 340(BP) - MOVL R11, 436(BP) - MOVL R11, 520(BP) - MOVL R11, 528(BP) - MOVL R11, 616(BP) - SHRQ $0x20, R11 - MOVL R11, 44(BP) - MOVL R11, 136(BP) - MOVL R11, 184(BP) - MOVL R11, 208(BP) - MOVL R11, 292(BP) - MOVL R11, 372(BP) - MOVL R11, 448(BP) - MOVL R11, 468(BP) - MOVL R11, 580(BP) - MOVL R11, 600(BP) - MOVL R12, 48(BP) - MOVL R12, 100(BP) - MOVL R12, 160(BP) - MOVL R12, 268(BP) - MOVL R12, 328(BP) - MOVL R12, 348(BP) - MOVL R12, 444(BP) - MOVL R12, 504(BP) - MOVL R12, 556(BP) - MOVL R12, 596(BP) - SHRQ $0x20, R12 - MOVL R12, 64(BP) - MOVL R12, 88(BP) - MOVL R12, 188(BP) - MOVL R12, 224(BP) - MOVL R12, 272(BP) - MOVL R12, 396(BP) - MOVL R12, 440(BP) - MOVL R12, 492(BP) - MOVL R12, 548(BP) - MOVL R12, 628(BP) - MOVL R13, 52(BP) - MOVL R13, 96(BP) - MOVL R13, 176(BP) - MOVL R13, 260(BP) - MOVL R13, 284(BP) - MOVL R13, 356(BP) - MOVL R13, 428(BP) - MOVL R13, 524(BP) - MOVL R13, 572(BP) - MOVL R13, 592(BP) - SHRQ $0x20, R13 - MOVL R13, 68(BP) - MOVL R13, 120(BP) - MOVL R13, 144(BP) - MOVL R13, 220(BP) - MOVL R13, 308(BP) - MOVL R13, 360(BP) - MOVL R13, 460(BP) - MOVL R13, 480(BP) - MOVL R13, 536(BP) - MOVL R13, 640(BP) - MOVL R14, 56(BP) - MOVL R14, 128(BP) - MOVL R14, 148(BP) - MOVL R14, 232(BP) - MOVL R14, 324(BP) - MOVL R14, 352(BP) - MOVL R14, 400(BP) - MOVL R14, 472(BP) - MOVL R14, 560(BP) - MOVL R14, 648(BP) - SHRQ $0x20, R14 - MOVL R14, 72(BP) - MOVL R14, 92(BP) - MOVL R14, 172(BP) - MOVL R14, 216(BP) - MOVL R14, 332(BP) - MOVL R14, 384(BP) - MOVL R14, 424(BP) - MOVL R14, 464(BP) - MOVL R14, 564(BP) - MOVL R14, 636(BP) - MOVL R15, 60(BP) - MOVL R15, 80(BP) - MOVL R15, 192(BP) - MOVL R15, 236(BP) - MOVL R15, 304(BP) - MOVL R15, 392(BP) - MOVL R15, 408(BP) - MOVL R15, 484(BP) - MOVL R15, 532(BP) - MOVL R15, 644(BP) - SHRQ $0x20, R15 - MOVL R15, 76(BP) - MOVL R15, 104(BP) - MOVL R15, 156(BP) - MOVL R15, 252(BP) - MOVL R15, 300(BP) - MOVL R15, 376(BP) - MOVL R15, 420(BP) - MOVL R15, 500(BP) - MOVL R15, 544(BP) - MOVL R15, 624(BP) - PADDL 16(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 32(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 48(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 64(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 80(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 96(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 112(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 128(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 144(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 160(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 176(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 192(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 208(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 224(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 240(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 256(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 272(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 288(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 304(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 320(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 336(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 352(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 368(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 384(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 400(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 416(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 432(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 448(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 464(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 480(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 496(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 512(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 528(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 544(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 560(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 576(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PADDL 592(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 608(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL 624(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL 640(BP), X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PXOR X4, X0 - PXOR X5, X1 - PXOR X6, X0 - PXOR X7, X1 - LEAQ 64(SI), SI - SUBQ $0x40, DX - JNE loop - MOVO X15, (BP) - MOVQ (BP), R9 - MOVQ R9, (BX) - MOVOU X0, (AX) - MOVOU X1, 16(AX) +#define BLAKE2s_SSSE3() \ + PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSSE3(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8, X13, X14) + +#define BLAKE2s_SSE4() \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6, 1, 0, 11, 5, 12, 2, 7, 3); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 11, 12, 5, 15, 8, 0, 2, 13, 10, 3, 7, 9, 14, 6, 1, 4); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 7, 3, 13, 11, 9, 1, 12, 14, 2, 5, 4, 15, 6, 10, 0, 8); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 9, 5, 2, 10, 0, 7, 4, 15, 14, 11, 6, 3, 1, 12, 8, 13); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 2, 6, 0, 8, 12, 10, 11, 3, 4, 7, 15, 1, 13, 5, 14, 9); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 12, 1, 14, 4, 5, 15, 13, 10, 0, 6, 9, 8, 7, 3, 2, 11); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 13, 7, 12, 3, 11, 14, 1, 9, 5, 15, 8, 2, 0, 4, 6, 10); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 6, 14, 11, 0, 15, 9, 3, 8, 12, 13, 1, 10, 2, 7, 4, 5); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14); \ + LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0); \ + ROUND_SSSE3(X4, X5, X6, X7, X8, X9, X10, X11, X8, X13, X14) + +#define HASH_BLOCKS(h, c, flag, blocks_base, blocks_len, BLAKE2s_FUNC) \ + MOVQ h, AX; \ + MOVQ c, BX; \ + MOVL flag, CX; \ + MOVQ blocks_base, SI; \ + MOVQ blocks_len, DX; \ + \ + MOVQ SP, BP; \ + ADDQ $15, BP; \ + ANDQ $~15, BP; \ + \ + MOVQ 0(BX), R9; \ + MOVQ R9, 0(BP); \ + MOVQ CX, 8(BP); \ + \ + MOVOU 0(AX), X0; \ + MOVOU 16(AX), X1; \ + MOVOU iv0<>(SB), X2; \ + MOVOU iv1<>(SB), X3 \ + \ + MOVOU counter<>(SB), X12; \ + MOVOU rol16<>(SB), X13; \ + MOVOU rol8<>(SB), X14; \ + MOVO 0(BP), X15; \ + \ + loop: \ + MOVO X0, X4; \ + MOVO X1, X5; \ + MOVO X2, X6; \ + MOVO X3, X7; \ + \ + PADDQ X12, X15; \ + PXOR X15, X7; \ + \ + BLAKE2s_FUNC(); \ + \ + PXOR X4, X0; \ + PXOR X5, X1; \ + PXOR X6, X0; \ + PXOR X7, X1; \ + \ + LEAQ 64(SI), SI; \ + SUBQ $64, DX; \ + JNE loop; \ + \ + MOVO X15, 0(BP); \ + MOVQ 0(BP), R9; \ + MOVQ R9, 0(BX); \ + \ + MOVOU X0, 0(AX); \ + MOVOU X1, 16(AX) + +// func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) +TEXT ·hashBlocksSSE2(SB), 0, $672-48 // frame = 656 + 16 byte alignment + HASH_BLOCKS(h+0(FP), c+8(FP), flag+16(FP), blocks_base+24(FP), blocks_len+32(FP), BLAKE2s_SSE2) RET -// func hashBlocksSSE4(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) -// Requires: SSE2, SSE4.1, SSSE3 -TEXT ·hashBlocksSSE4(SB), $32-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVL flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DX - MOVQ SP, BP - ADDQ $0x0f, BP - ANDQ $-16, BP - MOVQ (BX), R9 - MOVQ R9, (BP) - MOVQ CX, 8(BP) - MOVOU (AX), X0 - MOVOU 16(AX), X1 - MOVOU iv0<>+0(SB), X2 - MOVOU iv1<>+0(SB), X3 - MOVOU counter<>+0(SB), X12 - MOVOU rol16<>+0(SB), X13 - MOVOU rol8<>+0(SB), X14 - MOVO (BP), X15 +// func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) +TEXT ·hashBlocksSSSE3(SB), 0, $672-48 // frame = 656 + 16 byte alignment + HASH_BLOCKS(h+0(FP), c+8(FP), flag+16(FP), blocks_base+24(FP), blocks_len+32(FP), BLAKE2s_SSSE3) + RET -loop: - MOVO X0, X4 - MOVO X1, X5 - MOVO X2, X6 - MOVO X3, X7 - PADDQ X12, X15 - PXOR X15, X7 - MOVL (SI), X8 - PINSRD $0x01, 8(SI), X8 - PINSRD $0x02, 16(SI), X8 - PINSRD $0x03, 24(SI), X8 - MOVL 4(SI), X9 - PINSRD $0x01, 12(SI), X9 - PINSRD $0x02, 20(SI), X9 - PINSRD $0x03, 28(SI), X9 - MOVL 32(SI), X10 - PINSRD $0x01, 40(SI), X10 - PINSRD $0x02, 48(SI), X10 - PINSRD $0x03, 56(SI), X10 - MOVL 36(SI), X11 - PINSRD $0x01, 44(SI), X11 - PINSRD $0x02, 52(SI), X11 - PINSRD $0x03, 60(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 56(SI), X8 - PINSRD $0x01, 16(SI), X8 - PINSRD $0x02, 36(SI), X8 - PINSRD $0x03, 52(SI), X8 - MOVL 40(SI), X9 - PINSRD $0x01, 32(SI), X9 - PINSRD $0x02, 60(SI), X9 - PINSRD $0x03, 24(SI), X9 - MOVL 4(SI), X10 - PINSRD $0x01, (SI), X10 - PINSRD $0x02, 44(SI), X10 - PINSRD $0x03, 20(SI), X10 - MOVL 48(SI), X11 - PINSRD $0x01, 8(SI), X11 - PINSRD $0x02, 28(SI), X11 - PINSRD $0x03, 12(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 44(SI), X8 - PINSRD $0x01, 48(SI), X8 - PINSRD $0x02, 20(SI), X8 - PINSRD $0x03, 60(SI), X8 - MOVL 32(SI), X9 - PINSRD $0x01, (SI), X9 - PINSRD $0x02, 8(SI), X9 - PINSRD $0x03, 52(SI), X9 - MOVL 40(SI), X10 - PINSRD $0x01, 12(SI), X10 - PINSRD $0x02, 28(SI), X10 - PINSRD $0x03, 36(SI), X10 - MOVL 56(SI), X11 - PINSRD $0x01, 24(SI), X11 - PINSRD $0x02, 4(SI), X11 - PINSRD $0x03, 16(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 28(SI), X8 - PINSRD $0x01, 12(SI), X8 - PINSRD $0x02, 52(SI), X8 - PINSRD $0x03, 44(SI), X8 - MOVL 36(SI), X9 - PINSRD $0x01, 4(SI), X9 - PINSRD $0x02, 48(SI), X9 - PINSRD $0x03, 56(SI), X9 - MOVL 8(SI), X10 - PINSRD $0x01, 20(SI), X10 - PINSRD $0x02, 16(SI), X10 - PINSRD $0x03, 60(SI), X10 - MOVL 24(SI), X11 - PINSRD $0x01, 40(SI), X11 - PINSRD $0x02, (SI), X11 - PINSRD $0x03, 32(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 36(SI), X8 - PINSRD $0x01, 20(SI), X8 - PINSRD $0x02, 8(SI), X8 - PINSRD $0x03, 40(SI), X8 - MOVL (SI), X9 - PINSRD $0x01, 28(SI), X9 - PINSRD $0x02, 16(SI), X9 - PINSRD $0x03, 60(SI), X9 - MOVL 56(SI), X10 - PINSRD $0x01, 44(SI), X10 - PINSRD $0x02, 24(SI), X10 - PINSRD $0x03, 12(SI), X10 - MOVL 4(SI), X11 - PINSRD $0x01, 48(SI), X11 - PINSRD $0x02, 32(SI), X11 - PINSRD $0x03, 52(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 8(SI), X8 - PINSRD $0x01, 24(SI), X8 - PINSRD $0x02, (SI), X8 - PINSRD $0x03, 32(SI), X8 - MOVL 48(SI), X9 - PINSRD $0x01, 40(SI), X9 - PINSRD $0x02, 44(SI), X9 - PINSRD $0x03, 12(SI), X9 - MOVL 16(SI), X10 - PINSRD $0x01, 28(SI), X10 - PINSRD $0x02, 60(SI), X10 - PINSRD $0x03, 4(SI), X10 - MOVL 52(SI), X11 - PINSRD $0x01, 20(SI), X11 - PINSRD $0x02, 56(SI), X11 - PINSRD $0x03, 36(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 48(SI), X8 - PINSRD $0x01, 4(SI), X8 - PINSRD $0x02, 56(SI), X8 - PINSRD $0x03, 16(SI), X8 - MOVL 20(SI), X9 - PINSRD $0x01, 60(SI), X9 - PINSRD $0x02, 52(SI), X9 - PINSRD $0x03, 40(SI), X9 - MOVL (SI), X10 - PINSRD $0x01, 24(SI), X10 - PINSRD $0x02, 36(SI), X10 - PINSRD $0x03, 32(SI), X10 - MOVL 28(SI), X11 - PINSRD $0x01, 12(SI), X11 - PINSRD $0x02, 8(SI), X11 - PINSRD $0x03, 44(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 52(SI), X8 - PINSRD $0x01, 28(SI), X8 - PINSRD $0x02, 48(SI), X8 - PINSRD $0x03, 12(SI), X8 - MOVL 44(SI), X9 - PINSRD $0x01, 56(SI), X9 - PINSRD $0x02, 4(SI), X9 - PINSRD $0x03, 36(SI), X9 - MOVL 20(SI), X10 - PINSRD $0x01, 60(SI), X10 - PINSRD $0x02, 32(SI), X10 - PINSRD $0x03, 8(SI), X10 - MOVL (SI), X11 - PINSRD $0x01, 16(SI), X11 - PINSRD $0x02, 24(SI), X11 - PINSRD $0x03, 40(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 24(SI), X8 - PINSRD $0x01, 56(SI), X8 - PINSRD $0x02, 44(SI), X8 - PINSRD $0x03, (SI), X8 - MOVL 60(SI), X9 - PINSRD $0x01, 36(SI), X9 - PINSRD $0x02, 12(SI), X9 - PINSRD $0x03, 32(SI), X9 - MOVL 48(SI), X10 - PINSRD $0x01, 52(SI), X10 - PINSRD $0x02, 4(SI), X10 - PINSRD $0x03, 40(SI), X10 - MOVL 8(SI), X11 - PINSRD $0x01, 28(SI), X11 - PINSRD $0x02, 16(SI), X11 - PINSRD $0x03, 20(SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - MOVL 40(SI), X8 - PINSRD $0x01, 32(SI), X8 - PINSRD $0x02, 28(SI), X8 - PINSRD $0x03, 4(SI), X8 - MOVL 8(SI), X9 - PINSRD $0x01, 16(SI), X9 - PINSRD $0x02, 24(SI), X9 - PINSRD $0x03, 20(SI), X9 - MOVL 60(SI), X10 - PINSRD $0x01, 36(SI), X10 - PINSRD $0x02, 12(SI), X10 - PINSRD $0x03, 52(SI), X10 - MOVL 44(SI), X11 - PINSRD $0x01, 56(SI), X11 - PINSRD $0x02, 48(SI), X11 - PINSRD $0x03, (SI), X11 - PADDL X8, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X9, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X5, X5 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X7, X7 - PADDL X10, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X13, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x14, X8 - PSRLL $0x0c, X5 - PXOR X8, X5 - PADDL X11, X4 - PADDL X5, X4 - PXOR X4, X7 - PSHUFB X14, X7 - PADDL X7, X6 - PXOR X6, X5 - MOVO X5, X8 - PSLLL $0x19, X8 - PSRLL $0x07, X5 - PXOR X8, X5 - PSHUFL $0x39, X7, X7 - PSHUFL $0x4e, X6, X6 - PSHUFL $0x93, X5, X5 - PXOR X4, X0 - PXOR X5, X1 - PXOR X6, X0 - PXOR X7, X1 - LEAQ 64(SI), SI - SUBQ $0x40, DX - JNE loop - MOVO X15, (BP) - MOVQ (BP), R9 - MOVQ R9, (BX) - MOVOU X0, (AX) - MOVOU X1, 16(AX) +// func hashBlocksSSE4(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) +TEXT ·hashBlocksSSE4(SB), 0, $32-48 // frame = 16 + 16 byte alignment + HASH_BLOCKS(h+0(FP), c+8(FP), flag+16(FP), blocks_base+24(FP), blocks_len+32(FP), BLAKE2s_SSE4) RET diff --git a/upstream/vendor/golang.org/x/crypto/blake2s/register.go b/upstream/vendor/golang.org/x/crypto/blake2s/register.go new file mode 100644 index 00000000000..3156148a422 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/blake2s/register.go @@ -0,0 +1,21 @@ +// Copyright 2017 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 go1.9 + +package blake2s + +import ( + "crypto" + "hash" +) + +func init() { + newHash256 := func() hash.Hash { + h, _ := New256(nil) + return h + } + + crypto.RegisterHash(crypto.BLAKE2s_256, newHash256) +} diff --git a/upstream/vendor/golang.org/x/crypto/blowfish/cipher.go b/upstream/vendor/golang.org/x/crypto/blowfish/cipher.go index 0898956807c..213bf204afe 100644 --- a/upstream/vendor/golang.org/x/crypto/blowfish/cipher.go +++ b/upstream/vendor/golang.org/x/crypto/blowfish/cipher.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 blowfish +package blowfish // import "golang.org/x/crypto/blowfish" // The code is a port of Bruce Schneier's C implementation. // See https://www.schneier.com/blowfish.html. diff --git a/upstream/vendor/golang.org/x/crypto/cast5/cast5.go b/upstream/vendor/golang.org/x/crypto/cast5/cast5.go index 016e90215cd..425e8eecb06 100644 --- a/upstream/vendor/golang.org/x/crypto/cast5/cast5.go +++ b/upstream/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 +package cast5 // import "golang.org/x/crypto/cast5" import ( "errors" diff --git a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go index c709b728477..db42e6676ab 100644 --- a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go +++ b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_noasm.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 (!arm64 && !s390x && !ppc64 && !ppc64le) || !gc || purego +//go:build (!arm64 && !s390x && !ppc64le) || !gc || purego package chacha20 diff --git a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go similarity index 89% rename from upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go rename to upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go index bd183d9ba12..3a4287f9900 100644 --- a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go +++ b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.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 gc && !purego && (ppc64 || ppc64le) +//go:build gc && !purego package chacha20 diff --git a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s similarity index 76% rename from upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s rename to upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s index a660b4112fa..c672ccf6986 100644 --- a/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s +++ b/upstream/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s @@ -19,7 +19,7 @@ // The differences in this and the original implementation are // due to the calling conventions and initialization of constants. -//go:build gc && !purego && (ppc64 || ppc64le) +//go:build gc && !purego #include "textflag.h" @@ -36,68 +36,32 @@ // for VPERMXOR #define MASK R18 -DATA consts<>+0x00(SB)/4, $0x61707865 -DATA consts<>+0x04(SB)/4, $0x3320646e -DATA consts<>+0x08(SB)/4, $0x79622d32 -DATA consts<>+0x0c(SB)/4, $0x6b206574 -DATA consts<>+0x10(SB)/4, $0x00000001 -DATA consts<>+0x14(SB)/4, $0x00000000 -DATA consts<>+0x18(SB)/4, $0x00000000 -DATA consts<>+0x1c(SB)/4, $0x00000000 -DATA consts<>+0x20(SB)/4, $0x00000004 -DATA consts<>+0x24(SB)/4, $0x00000000 -DATA consts<>+0x28(SB)/4, $0x00000000 -DATA consts<>+0x2c(SB)/4, $0x00000000 -DATA consts<>+0x30(SB)/4, $0x0e0f0c0d -DATA consts<>+0x34(SB)/4, $0x0a0b0809 -DATA consts<>+0x38(SB)/4, $0x06070405 -DATA consts<>+0x3c(SB)/4, $0x02030001 -DATA consts<>+0x40(SB)/4, $0x0d0e0f0c -DATA consts<>+0x44(SB)/4, $0x090a0b08 -DATA consts<>+0x48(SB)/4, $0x05060704 -DATA consts<>+0x4c(SB)/4, $0x01020300 -DATA consts<>+0x50(SB)/4, $0x61707865 -DATA consts<>+0x54(SB)/4, $0x61707865 -DATA consts<>+0x58(SB)/4, $0x61707865 -DATA consts<>+0x5c(SB)/4, $0x61707865 -DATA consts<>+0x60(SB)/4, $0x3320646e -DATA consts<>+0x64(SB)/4, $0x3320646e -DATA consts<>+0x68(SB)/4, $0x3320646e -DATA consts<>+0x6c(SB)/4, $0x3320646e -DATA consts<>+0x70(SB)/4, $0x79622d32 -DATA consts<>+0x74(SB)/4, $0x79622d32 -DATA consts<>+0x78(SB)/4, $0x79622d32 -DATA consts<>+0x7c(SB)/4, $0x79622d32 -DATA consts<>+0x80(SB)/4, $0x6b206574 -DATA consts<>+0x84(SB)/4, $0x6b206574 -DATA consts<>+0x88(SB)/4, $0x6b206574 -DATA consts<>+0x8c(SB)/4, $0x6b206574 -DATA consts<>+0x90(SB)/4, $0x00000000 -DATA consts<>+0x94(SB)/4, $0x00000001 -DATA consts<>+0x98(SB)/4, $0x00000002 -DATA consts<>+0x9c(SB)/4, $0x00000003 -DATA consts<>+0xa0(SB)/4, $0x11223300 -DATA consts<>+0xa4(SB)/4, $0x55667744 -DATA consts<>+0xa8(SB)/4, $0x99aabb88 -DATA consts<>+0xac(SB)/4, $0xddeeffcc -DATA consts<>+0xb0(SB)/4, $0x22330011 -DATA consts<>+0xb4(SB)/4, $0x66774455 -DATA consts<>+0xb8(SB)/4, $0xaabb8899 -DATA consts<>+0xbc(SB)/4, $0xeeffccdd +DATA consts<>+0x00(SB)/8, $0x3320646e61707865 +DATA consts<>+0x08(SB)/8, $0x6b20657479622d32 +DATA consts<>+0x10(SB)/8, $0x0000000000000001 +DATA consts<>+0x18(SB)/8, $0x0000000000000000 +DATA consts<>+0x20(SB)/8, $0x0000000000000004 +DATA consts<>+0x28(SB)/8, $0x0000000000000000 +DATA consts<>+0x30(SB)/8, $0x0a0b08090e0f0c0d +DATA consts<>+0x38(SB)/8, $0x0203000106070405 +DATA consts<>+0x40(SB)/8, $0x090a0b080d0e0f0c +DATA consts<>+0x48(SB)/8, $0x0102030005060704 +DATA consts<>+0x50(SB)/8, $0x6170786561707865 +DATA consts<>+0x58(SB)/8, $0x6170786561707865 +DATA consts<>+0x60(SB)/8, $0x3320646e3320646e +DATA consts<>+0x68(SB)/8, $0x3320646e3320646e +DATA consts<>+0x70(SB)/8, $0x79622d3279622d32 +DATA consts<>+0x78(SB)/8, $0x79622d3279622d32 +DATA consts<>+0x80(SB)/8, $0x6b2065746b206574 +DATA consts<>+0x88(SB)/8, $0x6b2065746b206574 +DATA consts<>+0x90(SB)/8, $0x0000000100000000 +DATA consts<>+0x98(SB)/8, $0x0000000300000002 +DATA consts<>+0xa0(SB)/8, $0x5566774411223300 +DATA consts<>+0xa8(SB)/8, $0xddeeffcc99aabb88 +DATA consts<>+0xb0(SB)/8, $0x6677445522330011 +DATA consts<>+0xb8(SB)/8, $0xeeffccddaabb8899 GLOBL consts<>(SB), RODATA, $0xc0 -#ifdef GOARCH_ppc64 -#define BE_XXBRW_INIT() \ - LVSL (R0)(R0), V24 \ - VSPLTISB $3, V25 \ - VXOR V24, V25, V24 \ - -#define BE_XXBRW(vr) VPERM vr, vr, V24, vr -#else -#define BE_XXBRW_INIT() -#define BE_XXBRW(vr) -#endif - //func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 MOVD out+0(FP), OUT @@ -130,8 +94,6 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 // Clear V27 VXOR V27, V27, V27 - BE_XXBRW_INIT() - // V28 LXVW4X (CONSTBASE)(R11), VS60 @@ -337,11 +299,6 @@ loop_vsx: VADDUWM V8, V18, V8 VADDUWM V12, V19, V12 - BE_XXBRW(V0) - BE_XXBRW(V4) - BE_XXBRW(V8) - BE_XXBRW(V12) - CMPU LEN, $64 BLT tail_vsx @@ -370,11 +327,6 @@ loop_vsx: VADDUWM V9, V18, V8 VADDUWM V13, V19, V12 - BE_XXBRW(V0) - BE_XXBRW(V4) - BE_XXBRW(V8) - BE_XXBRW(V12) - CMPU LEN, $64 BLT tail_vsx @@ -382,8 +334,8 @@ loop_vsx: LXVW4X (INP)(R8), VS60 LXVW4X (INP)(R9), VS61 LXVW4X (INP)(R10), VS62 + VXOR V27, V0, V27 - VXOR V27, V0, V27 VXOR V28, V4, V28 VXOR V29, V8, V29 VXOR V30, V12, V30 @@ -402,11 +354,6 @@ loop_vsx: VADDUWM V10, V18, V8 VADDUWM V14, V19, V12 - BE_XXBRW(V0) - BE_XXBRW(V4) - BE_XXBRW(V8) - BE_XXBRW(V12) - CMPU LEN, $64 BLT tail_vsx @@ -434,11 +381,6 @@ loop_vsx: VADDUWM V11, V18, V8 VADDUWM V15, V19, V12 - BE_XXBRW(V0) - BE_XXBRW(V4) - BE_XXBRW(V8) - BE_XXBRW(V12) - CMPU LEN, $64 BLT tail_vsx @@ -466,9 +408,9 @@ loop_vsx: done_vsx: // Increment counter by number of 64 byte blocks - MOVWZ (CNT), R14 + MOVD (CNT), R14 ADD BLOCKS, R14 - MOVWZ R14, (CNT) + MOVD R14, (CNT) RET tail_vsx: diff --git a/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go b/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go index 8cf5d8112e4..93da7322bc4 100644 --- a/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go +++ b/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go @@ -5,7 +5,7 @@ // Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD and its // extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and // draft-irtf-cfrg-xchacha-01. -package chacha20poly1305 +package chacha20poly1305 // import "golang.org/x/crypto/chacha20poly1305" import ( "crypto/cipher" diff --git a/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s b/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s index fd5ee845f9f..731d2ac6dbc 100644 --- a/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s @@ -1,9762 +1,2715 @@ -// Code generated by command: go run chacha20poly1305_amd64_asm.go -out ../chacha20poly1305_amd64.s -pkg chacha20poly1305. DO NOT EDIT. +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare. //go:build gc && !purego #include "textflag.h" - -// func polyHashADInternal<>() +// General register allocation +#define oup DI +#define inp SI +#define inl BX +#define adp CX // free to reuse, after we hash the additional data +#define keyp R8 // free to reuse, when we copy the key to stack +#define itr2 R9 // general iterator +#define itr1 CX // general iterator +#define acc0 R10 +#define acc1 R11 +#define acc2 R12 +#define t0 R13 +#define t1 R14 +#define t2 R15 +#define t3 R8 +// Register and stack allocation for the SSE code +#define rStore (0*16)(BP) +#define sStore (1*16)(BP) +#define state1Store (2*16)(BP) +#define state2Store (3*16)(BP) +#define tmpStore (4*16)(BP) +#define ctr0Store (5*16)(BP) +#define ctr1Store (6*16)(BP) +#define ctr2Store (7*16)(BP) +#define ctr3Store (8*16)(BP) +#define A0 X0 +#define A1 X1 +#define A2 X2 +#define B0 X3 +#define B1 X4 +#define B2 X5 +#define C0 X6 +#define C1 X7 +#define C2 X8 +#define D0 X9 +#define D1 X10 +#define D2 X11 +#define T0 X12 +#define T1 X13 +#define T2 X14 +#define T3 X15 +#define A3 T0 +#define B3 T1 +#define C3 T2 +#define D3 T3 +// Register and stack allocation for the AVX2 code +#define rsStoreAVX2 (0*32)(BP) +#define state1StoreAVX2 (1*32)(BP) +#define state2StoreAVX2 (2*32)(BP) +#define ctr0StoreAVX2 (3*32)(BP) +#define ctr1StoreAVX2 (4*32)(BP) +#define ctr2StoreAVX2 (5*32)(BP) +#define ctr3StoreAVX2 (6*32)(BP) +#define tmpStoreAVX2 (7*32)(BP) // 256 bytes on stack +#define AA0 Y0 +#define AA1 Y5 +#define AA2 Y6 +#define AA3 Y7 +#define BB0 Y14 +#define BB1 Y9 +#define BB2 Y10 +#define BB3 Y11 +#define CC0 Y12 +#define CC1 Y13 +#define CC2 Y8 +#define CC3 Y15 +#define DD0 Y4 +#define DD1 Y1 +#define DD2 Y2 +#define DD3 Y3 +#define TT0 DD3 +#define TT1 AA3 +#define TT2 BB3 +#define TT3 CC3 +// ChaCha20 constants +DATA ·chacha20Constants<>+0x00(SB)/4, $0x61707865 +DATA ·chacha20Constants<>+0x04(SB)/4, $0x3320646e +DATA ·chacha20Constants<>+0x08(SB)/4, $0x79622d32 +DATA ·chacha20Constants<>+0x0c(SB)/4, $0x6b206574 +DATA ·chacha20Constants<>+0x10(SB)/4, $0x61707865 +DATA ·chacha20Constants<>+0x14(SB)/4, $0x3320646e +DATA ·chacha20Constants<>+0x18(SB)/4, $0x79622d32 +DATA ·chacha20Constants<>+0x1c(SB)/4, $0x6b206574 +// <<< 16 with PSHUFB +DATA ·rol16<>+0x00(SB)/8, $0x0504070601000302 +DATA ·rol16<>+0x08(SB)/8, $0x0D0C0F0E09080B0A +DATA ·rol16<>+0x10(SB)/8, $0x0504070601000302 +DATA ·rol16<>+0x18(SB)/8, $0x0D0C0F0E09080B0A +// <<< 8 with PSHUFB +DATA ·rol8<>+0x00(SB)/8, $0x0605040702010003 +DATA ·rol8<>+0x08(SB)/8, $0x0E0D0C0F0A09080B +DATA ·rol8<>+0x10(SB)/8, $0x0605040702010003 +DATA ·rol8<>+0x18(SB)/8, $0x0E0D0C0F0A09080B + +DATA ·avx2InitMask<>+0x00(SB)/8, $0x0 +DATA ·avx2InitMask<>+0x08(SB)/8, $0x0 +DATA ·avx2InitMask<>+0x10(SB)/8, $0x1 +DATA ·avx2InitMask<>+0x18(SB)/8, $0x0 + +DATA ·avx2IncMask<>+0x00(SB)/8, $0x2 +DATA ·avx2IncMask<>+0x08(SB)/8, $0x0 +DATA ·avx2IncMask<>+0x10(SB)/8, $0x2 +DATA ·avx2IncMask<>+0x18(SB)/8, $0x0 +// Poly1305 key clamp +DATA ·polyClampMask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF +DATA ·polyClampMask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC +DATA ·polyClampMask<>+0x10(SB)/8, $0xFFFFFFFFFFFFFFFF +DATA ·polyClampMask<>+0x18(SB)/8, $0xFFFFFFFFFFFFFFFF + +DATA ·sseIncMask<>+0x00(SB)/8, $0x1 +DATA ·sseIncMask<>+0x08(SB)/8, $0x0 +// To load/store the last < 16 bytes in a buffer +DATA ·andMask<>+0x00(SB)/8, $0x00000000000000ff +DATA ·andMask<>+0x08(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x10(SB)/8, $0x000000000000ffff +DATA ·andMask<>+0x18(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x20(SB)/8, $0x0000000000ffffff +DATA ·andMask<>+0x28(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x30(SB)/8, $0x00000000ffffffff +DATA ·andMask<>+0x38(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x40(SB)/8, $0x000000ffffffffff +DATA ·andMask<>+0x48(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x50(SB)/8, $0x0000ffffffffffff +DATA ·andMask<>+0x58(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x60(SB)/8, $0x00ffffffffffffff +DATA ·andMask<>+0x68(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x70(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0x78(SB)/8, $0x0000000000000000 +DATA ·andMask<>+0x80(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0x88(SB)/8, $0x00000000000000ff +DATA ·andMask<>+0x90(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0x98(SB)/8, $0x000000000000ffff +DATA ·andMask<>+0xa0(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0xa8(SB)/8, $0x0000000000ffffff +DATA ·andMask<>+0xb0(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0xb8(SB)/8, $0x00000000ffffffff +DATA ·andMask<>+0xc0(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0xc8(SB)/8, $0x000000ffffffffff +DATA ·andMask<>+0xd0(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0xd8(SB)/8, $0x0000ffffffffffff +DATA ·andMask<>+0xe0(SB)/8, $0xffffffffffffffff +DATA ·andMask<>+0xe8(SB)/8, $0x00ffffffffffffff + +GLOBL ·chacha20Constants<>(SB), (NOPTR+RODATA), $32 +GLOBL ·rol16<>(SB), (NOPTR+RODATA), $32 +GLOBL ·rol8<>(SB), (NOPTR+RODATA), $32 +GLOBL ·sseIncMask<>(SB), (NOPTR+RODATA), $16 +GLOBL ·avx2IncMask<>(SB), (NOPTR+RODATA), $32 +GLOBL ·avx2InitMask<>(SB), (NOPTR+RODATA), $32 +GLOBL ·polyClampMask<>(SB), (NOPTR+RODATA), $32 +GLOBL ·andMask<>(SB), (NOPTR+RODATA), $240 +// No PALIGNR in Go ASM yet (but VPALIGNR is present). +#define shiftB0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X3, X3 +#define shiftB1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x04 // PALIGNR $4, X4, X4 +#define shiftB2Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X5, X5 +#define shiftB3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X13, X13 +#define shiftC0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X6, X6 +#define shiftC1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x08 // PALIGNR $8, X7, X7 +#define shiftC2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc0; BYTE $0x08 // PALIGNR $8, X8, X8 +#define shiftC3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X14, X14 +#define shiftD0Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x0c // PALIGNR $12, X9, X9 +#define shiftD1Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x0c // PALIGNR $12, X10, X10 +#define shiftD2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X11, X11 +#define shiftD3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x0c // PALIGNR $12, X15, X15 +#define shiftB0Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X3, X3 +#define shiftB1Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x0c // PALIGNR $12, X4, X4 +#define shiftB2Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X5, X5 +#define shiftB3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X13, X13 +#define shiftC0Right shiftC0Left +#define shiftC1Right shiftC1Left +#define shiftC2Right shiftC2Left +#define shiftC3Right shiftC3Left +#define shiftD0Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x04 // PALIGNR $4, X9, X9 +#define shiftD1Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x04 // PALIGNR $4, X10, X10 +#define shiftD2Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X11, X11 +#define shiftD3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x04 // PALIGNR $4, X15, X15 + +// Some macros + +// ROL rotates the uint32s in register R left by N bits, using temporary T. +#define ROL(N, R, T) \ + MOVO R, T; PSLLL $(N), T; PSRLL $(32-(N)), R; PXOR T, R + +// ROL16 rotates the uint32s in register R left by 16, using temporary T if needed. +#ifdef GOAMD64_v2 +#define ROL16(R, T) PSHUFB ·rol16<>(SB), R +#else +#define ROL16(R, T) ROL(16, R, T) +#endif + +// ROL8 rotates the uint32s in register R left by 8, using temporary T if needed. +#ifdef GOAMD64_v2 +#define ROL8(R, T) PSHUFB ·rol8<>(SB), R +#else +#define ROL8(R, T) ROL(8, R, T) +#endif + +#define chachaQR(A, B, C, D, T) \ + PADDD B, A; PXOR A, D; ROL16(D, T) \ + PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $12, T; PSRLL $20, B; PXOR T, B \ + PADDD B, A; PXOR A, D; ROL8(D, T) \ + PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $7, T; PSRLL $25, B; PXOR T, B + +#define chachaQR_AVX2(A, B, C, D, T) \ + VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol16<>(SB), D, D \ + VPADDD D, C, C; VPXOR C, B, B; VPSLLD $12, B, T; VPSRLD $20, B, B; VPXOR T, B, B \ + VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol8<>(SB), D, D \ + VPADDD D, C, C; VPXOR C, B, B; VPSLLD $7, B, T; VPSRLD $25, B, B; VPXOR T, B, B + +#define polyAdd(S) ADDQ S, acc0; ADCQ 8+S, acc1; ADCQ $1, acc2 +#define polyMulStage1 MOVQ (0*8)(BP), AX; MOVQ AX, t2; MULQ acc0; MOVQ AX, t0; MOVQ DX, t1; MOVQ (0*8)(BP), AX; MULQ acc1; IMULQ acc2, t2; ADDQ AX, t1; ADCQ DX, t2 +#define polyMulStage2 MOVQ (1*8)(BP), AX; MOVQ AX, t3; MULQ acc0; ADDQ AX, t1; ADCQ $0, DX; MOVQ DX, acc0; MOVQ (1*8)(BP), AX; MULQ acc1; ADDQ AX, t2; ADCQ $0, DX +#define polyMulStage3 IMULQ acc2, t3; ADDQ acc0, t2; ADCQ DX, t3 +#define polyMulReduceStage MOVQ t0, acc0; MOVQ t1, acc1; MOVQ t2, acc2; ANDQ $3, acc2; MOVQ t2, t0; ANDQ $-4, t0; MOVQ t3, t1; SHRQ $2, t3, t2; SHRQ $2, t3; ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $0, acc2; ADDQ t2, acc0; ADCQ t3, acc1; ADCQ $0, acc2 + +#define polyMulStage1_AVX2 MOVQ (0*8)(BP), DX; MOVQ DX, t2; MULXQ acc0, t0, t1; IMULQ acc2, t2; MULXQ acc1, AX, DX; ADDQ AX, t1; ADCQ DX, t2 +#define polyMulStage2_AVX2 MOVQ (1*8)(BP), DX; MULXQ acc0, acc0, AX; ADDQ acc0, t1; MULXQ acc1, acc1, t3; ADCQ acc1, t2; ADCQ $0, t3 +#define polyMulStage3_AVX2 IMULQ acc2, DX; ADDQ AX, t2; ADCQ DX, t3 + +#define polyMul polyMulStage1; polyMulStage2; polyMulStage3; polyMulReduceStage +#define polyMulAVX2 polyMulStage1_AVX2; polyMulStage2_AVX2; polyMulStage3_AVX2; polyMulReduceStage +// ---------------------------------------------------------------------------- TEXT polyHashADInternal<>(SB), NOSPLIT, $0 - // Hack: Must declare #define macros inside of a function due to Avo constraints - // ROL rotates the uint32s in register R left by N bits, using temporary T. - #define ROL(N, R, T) \ - MOVO R, T; \ - PSLLL $(N), T; \ - PSRLL $(32-(N)), R; \ - PXOR T, R - - // ROL8 rotates the uint32s in register R left by 8, using temporary T if needed. - #ifdef GOAMD64_v2 - #define ROL8(R, T) PSHUFB ·rol8<>(SB), R - #else - #define ROL8(R, T) ROL(8, R, T) - #endif - - // ROL16 rotates the uint32s in register R left by 16, using temporary T if needed. - #ifdef GOAMD64_v2 - #define ROL16(R, T) PSHUFB ·rol16<>(SB), R - #else - #define ROL16(R, T) ROL(16, R, T) - #endif - XORQ R10, R10 - XORQ R11, R11 - XORQ R12, R12 - CMPQ R9, $0x0d - JNE hashADLoop - MOVQ (CX), R10 - MOVQ 5(CX), R11 - SHRQ $0x18, R11 - MOVQ $0x00000001, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + // adp points to beginning of additional data + // itr2 holds ad length + XORQ acc0, acc0 + XORQ acc1, acc1 + XORQ acc2, acc2 + CMPQ itr2, $13 + JNE hashADLoop + +openFastTLSAD: + // Special treatment for the TLS case of 13 bytes + MOVQ (adp), acc0 + MOVQ 5(adp), acc1 + SHRQ $24, acc1 + MOVQ $1, acc2 + polyMul RET hashADLoop: // Hash in 16 byte chunks - CMPQ R9, $0x10 - JB hashADTail - ADDQ (CX), R10 - ADCQ 8(CX), R11 - ADCQ $0x01, R12 - LEAQ 16(CX), CX - SUBQ $0x10, R9 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - JMP hashADLoop + CMPQ itr2, $16 + JB hashADTail + polyAdd(0(adp)) + LEAQ (1*16)(adp), adp + SUBQ $16, itr2 + polyMul + JMP hashADLoop hashADTail: - CMPQ R9, $0x00 + CMPQ itr2, $0 JE hashADDone // Hash last < 16 byte tail - XORQ R13, R13 - XORQ R14, R14 - XORQ R15, R15 - ADDQ R9, CX + XORQ t0, t0 + XORQ t1, t1 + XORQ t2, t2 + ADDQ itr2, adp hashADTailLoop: - SHLQ $0x08, R13, R14 - SHLQ $0x08, R13 - MOVB -1(CX), R15 - XORQ R15, R13 - DECQ CX - DECQ R9 - JNE hashADTailLoop - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - + SHLQ $8, t0, t1 + SHLQ $8, t0 + MOVB -1(adp), t2 + XORQ t2, t0 + DECQ adp + DECQ itr2 + JNE hashADTailLoop + +hashADTailFinish: + ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 + polyMul + + // Finished AD hashADDone: RET -// func chacha20Poly1305Open(dst []byte, key []uint32, src []byte, ad []byte) bool -// Requires: AVX, AVX2, BMI2, CMOV, SSE2 -TEXT ·chacha20Poly1305Open(SB), $288-97 +// ---------------------------------------------------------------------------- +// func chacha20Poly1305Open(dst, key, src, ad []byte) bool +TEXT ·chacha20Poly1305Open(SB), 0, $288-97 // For aligned stack access MOVQ SP, BP - ADDQ $0x20, BP + ADDQ $32, BP ANDQ $-32, BP - MOVQ dst_base+0(FP), DI - MOVQ key_base+24(FP), R8 - MOVQ src_base+48(FP), SI - MOVQ src_len+56(FP), BX - MOVQ ad_base+72(FP), CX + MOVQ dst+0(FP), oup + MOVQ key+24(FP), keyp + MOVQ src+48(FP), inp + MOVQ src_len+56(FP), inl + MOVQ ad+72(FP), adp // Check for AVX2 support - CMPB ·useAVX2+0(SB), $0x01 + CMPB ·useAVX2(SB), $1 JE chacha20Poly1305Open_AVX2 // Special optimization, for very short buffers - CMPQ BX, $0x80 - JBE openSSE128 + CMPQ inl, $128 + JBE openSSE128 // About 16% faster // For long buffers, prepare the poly key first - MOVOU ·chacha20Constants<>+0(SB), X0 - MOVOU 16(R8), X3 - MOVOU 32(R8), X6 - MOVOU 48(R8), X9 - MOVO X9, X13 + MOVOU ·chacha20Constants<>(SB), A0 + MOVOU (1*16)(keyp), B0 + MOVOU (2*16)(keyp), C0 + MOVOU (3*16)(keyp), D0 + MOVO D0, T1 // Store state on stack for future use - MOVO X3, 32(BP) - MOVO X6, 48(BP) - MOVO X9, 128(BP) - MOVQ $0x0000000a, R9 + MOVO B0, state1Store + MOVO C0, state2Store + MOVO D0, ctr3Store + MOVQ $10, itr2 openSSEPreparePolyKey: - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - DECQ R9 - JNE openSSEPreparePolyKey + chachaQR(A0, B0, C0, D0, T0) + shiftB0Left; shiftC0Left; shiftD0Left + chachaQR(A0, B0, C0, D0, T0) + shiftB0Right; shiftC0Right; shiftD0Right + DECQ itr2 + JNE openSSEPreparePolyKey // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL 32(BP), X3 + PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0 // Clamp and store the key - PAND ·polyClampMask<>+0(SB), X0 - MOVO X0, (BP) - MOVO X3, 16(BP) + PAND ·polyClampMask<>(SB), A0 + MOVO A0, rStore; MOVO B0, sStore // Hash AAD - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) openSSEMainLoop: - CMPQ BX, $0x00000100 + CMPQ inl, $256 JB openSSEMainLoopDone // Load state, increment counter blocks - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X2, X12 - MOVO X5, X13 - MOVO X8, X14 - MOVO X11, X15 - PADDL ·sseIncMask<>+0(SB), X15 + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 // Store counters - MOVO X9, 80(BP) - MOVO X10, 96(BP) - MOVO X11, 112(BP) - MOVO X15, 128(BP) + MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store - // There are 10 ChaCha20 iterations of 2QR each, so for 6 iterations we hash - // 2 blocks, and for the remaining 4 only 1 block - for a total of 16 - MOVQ $0x00000004, CX - MOVQ SI, R9 + // There are 10 ChaCha20 iterations of 2QR each, so for 6 iterations we hash 2 blocks, and for the remaining 4 only 1 block - for a total of 16 + MOVQ $4, itr1 + MOVQ inp, itr2 openSSEInternalLoop: - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x0c - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - LEAQ 16(R9), R9 - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x04 - DECQ CX - JGE openSSEInternalLoop - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(R9), R9 - CMPQ CX, $-6 - JG openSSEInternalLoop + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + polyAdd(0(itr2)) + shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left + shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left + shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left + polyMulStage1 + polyMulStage2 + LEAQ (2*8)(itr2), itr2 + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + polyMulStage3 + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + polyMulReduceStage + shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right + shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right + shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right + DECQ itr1 + JGE openSSEInternalLoop + + polyAdd(0(itr2)) + polyMul + LEAQ (2*8)(itr2), itr2 + + CMPQ itr1, $-6 + JG openSSEInternalLoop // Add in the state - PADDD ·chacha20Constants<>+0(SB), X0 - PADDD ·chacha20Constants<>+0(SB), X1 - PADDD ·chacha20Constants<>+0(SB), X2 - PADDD ·chacha20Constants<>+0(SB), X12 - PADDD 32(BP), X3 - PADDD 32(BP), X4 - PADDD 32(BP), X5 - PADDD 32(BP), X13 - PADDD 48(BP), X6 - PADDD 48(BP), X7 - PADDD 48(BP), X8 - PADDD 48(BP), X14 - PADDD 80(BP), X9 - PADDD 96(BP), X10 - PADDD 112(BP), X11 - PADDD 128(BP), X15 + PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 + PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 + PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 + PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 // Load - xor - store - MOVO X15, 64(BP) - MOVOU (SI), X15 - PXOR X15, X0 - MOVOU X0, (DI) - MOVOU 16(SI), X15 - PXOR X15, X3 - MOVOU X3, 16(DI) - MOVOU 32(SI), X15 - PXOR X15, X6 - MOVOU X6, 32(DI) - MOVOU 48(SI), X15 - PXOR X15, X9 - MOVOU X9, 48(DI) - MOVOU 64(SI), X9 - PXOR X9, X1 - MOVOU X1, 64(DI) - MOVOU 80(SI), X9 - PXOR X9, X4 - MOVOU X4, 80(DI) - MOVOU 96(SI), X9 - PXOR X9, X7 - MOVOU X7, 96(DI) - MOVOU 112(SI), X9 - PXOR X9, X10 - MOVOU X10, 112(DI) - MOVOU 128(SI), X9 - PXOR X9, X2 - MOVOU X2, 128(DI) - MOVOU 144(SI), X9 - PXOR X9, X5 - MOVOU X5, 144(DI) - MOVOU 160(SI), X9 - PXOR X9, X8 - MOVOU X8, 160(DI) - MOVOU 176(SI), X9 - PXOR X9, X11 - MOVOU X11, 176(DI) - MOVOU 192(SI), X9 - PXOR X9, X12 - MOVOU X12, 192(DI) - MOVOU 208(SI), X9 - PXOR X9, X13 - MOVOU X13, 208(DI) - MOVOU 224(SI), X9 - PXOR X9, X14 - MOVOU X14, 224(DI) - MOVOU 240(SI), X9 - PXOR 64(BP), X9 - MOVOU X9, 240(DI) - LEAQ 256(SI), SI - LEAQ 256(DI), DI - SUBQ $0x00000100, BX + MOVO D3, tmpStore + MOVOU (0*16)(inp), D3; PXOR D3, A0; MOVOU A0, (0*16)(oup) + MOVOU (1*16)(inp), D3; PXOR D3, B0; MOVOU B0, (1*16)(oup) + MOVOU (2*16)(inp), D3; PXOR D3, C0; MOVOU C0, (2*16)(oup) + MOVOU (3*16)(inp), D3; PXOR D3, D0; MOVOU D0, (3*16)(oup) + MOVOU (4*16)(inp), D0; PXOR D0, A1; MOVOU A1, (4*16)(oup) + MOVOU (5*16)(inp), D0; PXOR D0, B1; MOVOU B1, (5*16)(oup) + MOVOU (6*16)(inp), D0; PXOR D0, C1; MOVOU C1, (6*16)(oup) + MOVOU (7*16)(inp), D0; PXOR D0, D1; MOVOU D1, (7*16)(oup) + MOVOU (8*16)(inp), D0; PXOR D0, A2; MOVOU A2, (8*16)(oup) + MOVOU (9*16)(inp), D0; PXOR D0, B2; MOVOU B2, (9*16)(oup) + MOVOU (10*16)(inp), D0; PXOR D0, C2; MOVOU C2, (10*16)(oup) + MOVOU (11*16)(inp), D0; PXOR D0, D2; MOVOU D2, (11*16)(oup) + MOVOU (12*16)(inp), D0; PXOR D0, A3; MOVOU A3, (12*16)(oup) + MOVOU (13*16)(inp), D0; PXOR D0, B3; MOVOU B3, (13*16)(oup) + MOVOU (14*16)(inp), D0; PXOR D0, C3; MOVOU C3, (14*16)(oup) + MOVOU (15*16)(inp), D0; PXOR tmpStore, D0; MOVOU D0, (15*16)(oup) + LEAQ 256(inp), inp + LEAQ 256(oup), oup + SUBQ $256, inl JMP openSSEMainLoop openSSEMainLoopDone: // Handle the various tail sizes efficiently - TESTQ BX, BX + TESTQ inl, inl JE openSSEFinalize - CMPQ BX, $0x40 + CMPQ inl, $64 JBE openSSETail64 - CMPQ BX, $0x80 + CMPQ inl, $128 JBE openSSETail128 - CMPQ BX, $0xc0 + CMPQ inl, $192 JBE openSSETail192 JMP openSSETail256 openSSEFinalize: // Hash in the PT, AAD lengths - ADDQ ad_len+80(FP), R10 - ADCQ src_len+56(FP), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + ADDQ ad_len+80(FP), acc0; ADCQ src_len+56(FP), acc1; ADCQ $1, acc2 + polyMul // Final reduce - MOVQ R10, R13 - MOVQ R11, R14 - MOVQ R12, R15 - SUBQ $-5, R10 - SBBQ $-1, R11 - SBBQ $0x03, R12 - CMOVQCS R13, R10 - CMOVQCS R14, R11 - CMOVQCS R15, R12 + MOVQ acc0, t0 + MOVQ acc1, t1 + MOVQ acc2, t2 + SUBQ $-5, acc0 + SBBQ $-1, acc1 + SBBQ $3, acc2 + CMOVQCS t0, acc0 + CMOVQCS t1, acc1 + CMOVQCS t2, acc2 // Add in the "s" part of the key - ADDQ 16(BP), R10 - ADCQ 24(BP), R11 + ADDQ 0+sStore, acc0 + ADCQ 8+sStore, acc1 // Finally, constant time compare to the tag at the end of the message XORQ AX, AX - MOVQ $0x00000001, DX - XORQ (SI), R10 - XORQ 8(SI), R11 - ORQ R11, R10 + MOVQ $1, DX + XORQ (0*8)(inp), acc0 + XORQ (1*8)(inp), acc1 + ORQ acc1, acc0 CMOVQEQ DX, AX // Return true iff tags are equal MOVB AX, ret+96(FP) RET +// ---------------------------------------------------------------------------- +// Special optimization for buffers smaller than 129 bytes openSSE128: - MOVOU ·chacha20Constants<>+0(SB), X0 - MOVOU 16(R8), X3 - MOVOU 32(R8), X6 - MOVOU 48(R8), X9 - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X3, X13 - MOVO X6, X14 - MOVO X10, X15 - MOVQ $0x0000000a, R9 + // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks + MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO B0, T1; MOVO C0, T2; MOVO D1, T3 + MOVQ $10, itr2 openSSE128InnerCipherLoop: - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - DECQ R9 - JNE openSSE128InnerCipherLoop + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Left; shiftB1Left; shiftB2Left + shiftC0Left; shiftC1Left; shiftC2Left + shiftD0Left; shiftD1Left; shiftD2Left + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Right; shiftB1Right; shiftB2Right + shiftC0Right; shiftC1Right; shiftC2Right + shiftD0Right; shiftD1Right; shiftD2Right + DECQ itr2 + JNE openSSE128InnerCipherLoop // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL ·chacha20Constants<>+0(SB), X2 - PADDL X13, X3 - PADDL X13, X4 - PADDL X13, X5 - PADDL X14, X7 - PADDL X14, X8 - PADDL X15, X10 - PADDL ·sseIncMask<>+0(SB), X15 - PADDL X15, X11 + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 + PADDL T1, B0; PADDL T1, B1; PADDL T1, B2 + PADDL T2, C1; PADDL T2, C2 + PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2 // Clamp and store the key - PAND ·polyClampMask<>+0(SB), X0 - MOVOU X0, (BP) - MOVOU X3, 16(BP) + PAND ·polyClampMask<>(SB), A0 + MOVOU A0, rStore; MOVOU B0, sStore // Hash - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) openSSE128Open: - CMPQ BX, $0x10 + CMPQ inl, $16 JB openSSETail16 - SUBQ $0x10, BX + SUBQ $16, inl // Load for hashing - ADDQ (SI), R10 - ADCQ 8(SI), R11 - ADCQ $0x01, R12 + polyAdd(0(inp)) // Load for decryption - MOVOU (SI), X12 - PXOR X12, X1 - MOVOU X1, (DI) - LEAQ 16(SI), SI - LEAQ 16(DI), DI - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + MOVOU (inp), T0; PXOR T0, A1; MOVOU A1, (oup) + LEAQ (1*16)(inp), inp + LEAQ (1*16)(oup), oup + polyMul // Shift the stream "left" - MOVO X4, X1 - MOVO X7, X4 - MOVO X10, X7 - MOVO X2, X10 - MOVO X5, X2 - MOVO X8, X5 - MOVO X11, X8 + MOVO B1, A1 + MOVO C1, B1 + MOVO D1, C1 + MOVO A2, D1 + MOVO B2, A2 + MOVO C2, B2 + MOVO D2, C2 JMP openSSE128Open openSSETail16: - TESTQ BX, BX + TESTQ inl, inl JE openSSEFinalize // We can safely load the CT from the end, because it is padded with the MAC - MOVQ BX, R9 - SHLQ $0x04, R9 - LEAQ ·andMask<>+0(SB), R13 - MOVOU (SI), X12 - ADDQ BX, SI - PAND -16(R13)(R9*1), X12 - MOVO X12, 64(BP) - MOVQ X12, R13 - MOVQ 72(BP), R14 - PXOR X1, X12 + MOVQ inl, itr2 + SHLQ $4, itr2 + LEAQ ·andMask<>(SB), t0 + MOVOU (inp), T0 + ADDQ inl, inp + PAND -16(t0)(itr2*1), T0 + MOVO T0, 0+tmpStore + MOVQ T0, t0 + MOVQ 8+tmpStore, t1 + PXOR A1, T0 // We can only store one byte at a time, since plaintext can be shorter than 16 bytes openSSETail16Store: - MOVQ X12, R8 - MOVB R8, (DI) - PSRLDQ $0x01, X12 - INCQ DI - DECQ BX + MOVQ T0, t3 + MOVB t3, (oup) + PSRLDQ $1, T0 + INCQ oup + DECQ inl JNE openSSETail16Store - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 + polyMul JMP openSSEFinalize +// ---------------------------------------------------------------------------- +// Special optimization for the last 64 bytes of ciphertext openSSETail64: - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X9, 80(BP) - XORQ R9, R9 - MOVQ BX, CX - CMPQ CX, $0x10 - JB openSSETail64LoopB + // Need to decrypt up to 64 bytes - prepare single block + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store + XORQ itr2, itr2 + MOVQ inl, itr1 + CMPQ itr1, $16 + JB openSSETail64LoopB openSSETail64LoopA: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - SUBQ $0x10, CX + // Perform ChaCha rounds, while hashing the remaining input + polyAdd(0(inp)(itr2*1)) + polyMul + SUBQ $16, itr1 openSSETail64LoopB: - ADDQ $0x10, R9 - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - CMPQ CX, $0x10 - JAE openSSETail64LoopA - CMPQ R9, $0xa0 - JNE openSSETail64LoopB - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL 32(BP), X3 - PADDL 48(BP), X6 - PADDL 80(BP), X9 + ADDQ $16, itr2 + chachaQR(A0, B0, C0, D0, T0) + shiftB0Left; shiftC0Left; shiftD0Left + chachaQR(A0, B0, C0, D0, T0) + shiftB0Right; shiftC0Right; shiftD0Right + + CMPQ itr1, $16 + JAE openSSETail64LoopA + + CMPQ itr2, $160 + JNE openSSETail64LoopB + + PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0; PADDL state2Store, C0; PADDL ctr0Store, D0 openSSETail64DecLoop: - CMPQ BX, $0x10 + CMPQ inl, $16 JB openSSETail64DecLoopDone - SUBQ $0x10, BX - MOVOU (SI), X12 - PXOR X12, X0 - MOVOU X0, (DI) - LEAQ 16(SI), SI - LEAQ 16(DI), DI - MOVO X3, X0 - MOVO X6, X3 - MOVO X9, X6 + SUBQ $16, inl + MOVOU (inp), T0 + PXOR T0, A0 + MOVOU A0, (oup) + LEAQ 16(inp), inp + LEAQ 16(oup), oup + MOVO B0, A0 + MOVO C0, B0 + MOVO D0, C0 JMP openSSETail64DecLoop openSSETail64DecLoopDone: - MOVO X0, X1 + MOVO A0, A1 JMP openSSETail16 +// ---------------------------------------------------------------------------- +// Special optimization for the last 128 bytes of ciphertext openSSETail128: - MOVO ·chacha20Constants<>+0(SB), X1 - MOVO 32(BP), X4 - MOVO 48(BP), X7 - MOVO 128(BP), X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X10, 80(BP) - MOVO X1, X0 - MOVO X4, X3 - MOVO X7, X6 - MOVO X10, X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X9, 96(BP) - XORQ R9, R9 - MOVQ BX, CX - ANDQ $-16, CX + // Need to decrypt up to 128 bytes - prepare two blocks + MOVO ·chacha20Constants<>(SB), A1; MOVO state1Store, B1; MOVO state2Store, C1; MOVO ctr3Store, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr0Store + MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr1Store + XORQ itr2, itr2 + MOVQ inl, itr1 + ANDQ $-16, itr1 openSSETail128LoopA: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + // Perform ChaCha rounds, while hashing the remaining input + polyAdd(0(inp)(itr2*1)) + polyMul openSSETail128LoopB: - ADDQ $0x10, R9 - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - CMPQ R9, CX - JB openSSETail128LoopA - CMPQ R9, $0xa0 - JNE openSSETail128LoopB - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL 32(BP), X3 - PADDL 32(BP), X4 - PADDL 48(BP), X6 - PADDL 48(BP), X7 - PADDL 96(BP), X9 - PADDL 80(BP), X10 - MOVOU (SI), X12 - MOVOU 16(SI), X13 - MOVOU 32(SI), X14 - MOVOU 48(SI), X15 - PXOR X12, X1 - PXOR X13, X4 - PXOR X14, X7 - PXOR X15, X10 - MOVOU X1, (DI) - MOVOU X4, 16(DI) - MOVOU X7, 32(DI) - MOVOU X10, 48(DI) - SUBQ $0x40, BX - LEAQ 64(SI), SI - LEAQ 64(DI), DI - JMP openSSETail64DecLoop - + ADDQ $16, itr2 + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) + shiftB0Left; shiftC0Left; shiftD0Left + shiftB1Left; shiftC1Left; shiftD1Left + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) + shiftB0Right; shiftC0Right; shiftD0Right + shiftB1Right; shiftC1Right; shiftD1Right + + CMPQ itr2, itr1 + JB openSSETail128LoopA + + CMPQ itr2, $160 + JNE openSSETail128LoopB + + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1 + PADDL state1Store, B0; PADDL state1Store, B1 + PADDL state2Store, C0; PADDL state2Store, C1 + PADDL ctr1Store, D0; PADDL ctr0Store, D1 + + MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 + PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 + MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup) + + SUBQ $64, inl + LEAQ 64(inp), inp + LEAQ 64(oup), oup + JMP openSSETail64DecLoop + +// ---------------------------------------------------------------------------- +// Special optimization for the last 192 bytes of ciphertext openSSETail192: - MOVO ·chacha20Constants<>+0(SB), X2 - MOVO 32(BP), X5 - MOVO 48(BP), X8 - MOVO 128(BP), X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X11, 80(BP) - MOVO X2, X1 - MOVO X5, X4 - MOVO X8, X7 - MOVO X11, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X10, 96(BP) - MOVO X1, X0 - MOVO X4, X3 - MOVO X7, X6 - MOVO X10, X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X9, 112(BP) - MOVQ BX, CX - MOVQ $0x000000a0, R9 - CMPQ CX, $0xa0 - CMOVQGT R9, CX - ANDQ $-16, CX - XORQ R9, R9 + // Need to decrypt up to 192 bytes - prepare three blocks + MOVO ·chacha20Constants<>(SB), A2; MOVO state1Store, B2; MOVO state2Store, C2; MOVO ctr3Store, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr0Store + MOVO A2, A1; MOVO B2, B1; MOVO C2, C1; MOVO D2, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store + MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr2Store + + MOVQ inl, itr1 + MOVQ $160, itr2 + CMPQ itr1, $160 + CMOVQGT itr2, itr1 + ANDQ $-16, itr1 + XORQ itr2, itr2 openSSLTail192LoopA: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + // Perform ChaCha rounds, while hashing the remaining input + polyAdd(0(inp)(itr2*1)) + polyMul openSSLTail192LoopB: - ADDQ $0x10, R9 - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - CMPQ R9, CX - JB openSSLTail192LoopA - CMPQ R9, $0xa0 - JNE openSSLTail192LoopB - CMPQ BX, $0xb0 - JB openSSLTail192Store - ADDQ 160(SI), R10 - ADCQ 168(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - CMPQ BX, $0xc0 - JB openSSLTail192Store - ADDQ 176(SI), R10 - ADCQ 184(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + ADDQ $16, itr2 + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Left; shiftC0Left; shiftD0Left + shiftB1Left; shiftC1Left; shiftD1Left + shiftB2Left; shiftC2Left; shiftD2Left -openSSLTail192Store: - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL ·chacha20Constants<>+0(SB), X2 - PADDL 32(BP), X3 - PADDL 32(BP), X4 - PADDL 32(BP), X5 - PADDL 48(BP), X6 - PADDL 48(BP), X7 - PADDL 48(BP), X8 - PADDL 112(BP), X9 - PADDL 96(BP), X10 - PADDL 80(BP), X11 - MOVOU (SI), X12 - MOVOU 16(SI), X13 - MOVOU 32(SI), X14 - MOVOU 48(SI), X15 - PXOR X12, X2 - PXOR X13, X5 - PXOR X14, X8 - PXOR X15, X11 - MOVOU X2, (DI) - MOVOU X5, 16(DI) - MOVOU X8, 32(DI) - MOVOU X11, 48(DI) - MOVOU 64(SI), X12 - MOVOU 80(SI), X13 - MOVOU 96(SI), X14 - MOVOU 112(SI), X15 - PXOR X12, X1 - PXOR X13, X4 - PXOR X14, X7 - PXOR X15, X10 - MOVOU X1, 64(DI) - MOVOU X4, 80(DI) - MOVOU X7, 96(DI) - MOVOU X10, 112(DI) - SUBQ $0x80, BX - LEAQ 128(SI), SI - LEAQ 128(DI), DI - JMP openSSETail64DecLoop + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Right; shiftC0Right; shiftD0Right + shiftB1Right; shiftC1Right; shiftD1Right + shiftB2Right; shiftC2Right; shiftD2Right + + CMPQ itr2, itr1 + JB openSSLTail192LoopA + + CMPQ itr2, $160 + JNE openSSLTail192LoopB + + CMPQ inl, $176 + JB openSSLTail192Store + + polyAdd(160(inp)) + polyMul + + CMPQ inl, $192 + JB openSSLTail192Store + + polyAdd(176(inp)) + polyMul +openSSLTail192Store: + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 + PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2 + PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2 + PADDL ctr2Store, D0; PADDL ctr1Store, D1; PADDL ctr0Store, D2 + + MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 + PXOR T0, A2; PXOR T1, B2; PXOR T2, C2; PXOR T3, D2 + MOVOU A2, (0*16)(oup); MOVOU B2, (1*16)(oup); MOVOU C2, (2*16)(oup); MOVOU D2, (3*16)(oup) + + MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3 + PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 + MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) + + SUBQ $128, inl + LEAQ 128(inp), inp + LEAQ 128(oup), oup + JMP openSSETail64DecLoop + +// ---------------------------------------------------------------------------- +// Special optimization for the last 256 bytes of ciphertext openSSETail256: - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X2, X12 - MOVO X5, X13 - MOVO X8, X14 - MOVO X11, X15 - PADDL ·sseIncMask<>+0(SB), X15 + // Need to decrypt up to 256 bytes - prepare four blocks + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 // Store counters - MOVO X9, 80(BP) - MOVO X10, 96(BP) - MOVO X11, 112(BP) - MOVO X15, 128(BP) - XORQ R9, R9 + MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store + XORQ itr2, itr2 openSSETail256Loop: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x0c - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x04 - ADDQ $0x10, R9 - CMPQ R9, $0xa0 - JB openSSETail256Loop - MOVQ BX, CX - ANDQ $-16, CX + // This loop inteleaves 8 ChaCha quarter rounds with 1 poly multiplication + polyAdd(0(inp)(itr2*1)) + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left + shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left + shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left + polyMulStage1 + polyMulStage2 + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + polyMulStage3 + polyMulReduceStage + shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right + shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right + shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right + ADDQ $2*8, itr2 + CMPQ itr2, $160 + JB openSSETail256Loop + MOVQ inl, itr1 + ANDQ $-16, itr1 openSSETail256HashLoop: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ $0x10, R9 - CMPQ R9, CX - JB openSSETail256HashLoop + polyAdd(0(inp)(itr2*1)) + polyMul + ADDQ $2*8, itr2 + CMPQ itr2, itr1 + JB openSSETail256HashLoop // Add in the state - PADDD ·chacha20Constants<>+0(SB), X0 - PADDD ·chacha20Constants<>+0(SB), X1 - PADDD ·chacha20Constants<>+0(SB), X2 - PADDD ·chacha20Constants<>+0(SB), X12 - PADDD 32(BP), X3 - PADDD 32(BP), X4 - PADDD 32(BP), X5 - PADDD 32(BP), X13 - PADDD 48(BP), X6 - PADDD 48(BP), X7 - PADDD 48(BP), X8 - PADDD 48(BP), X14 - PADDD 80(BP), X9 - PADDD 96(BP), X10 - PADDD 112(BP), X11 - PADDD 128(BP), X15 - MOVO X15, 64(BP) + PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 + PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 + PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 + PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 + MOVO D3, tmpStore // Load - xor - store - MOVOU (SI), X15 - PXOR X15, X0 - MOVOU 16(SI), X15 - PXOR X15, X3 - MOVOU 32(SI), X15 - PXOR X15, X6 - MOVOU 48(SI), X15 - PXOR X15, X9 - MOVOU X0, (DI) - MOVOU X3, 16(DI) - MOVOU X6, 32(DI) - MOVOU X9, 48(DI) - MOVOU 64(SI), X0 - MOVOU 80(SI), X3 - MOVOU 96(SI), X6 - MOVOU 112(SI), X9 - PXOR X0, X1 - PXOR X3, X4 - PXOR X6, X7 - PXOR X9, X10 - MOVOU X1, 64(DI) - MOVOU X4, 80(DI) - MOVOU X7, 96(DI) - MOVOU X10, 112(DI) - MOVOU 128(SI), X0 - MOVOU 144(SI), X3 - MOVOU 160(SI), X6 - MOVOU 176(SI), X9 - PXOR X0, X2 - PXOR X3, X5 - PXOR X6, X8 - PXOR X9, X11 - MOVOU X2, 128(DI) - MOVOU X5, 144(DI) - MOVOU X8, 160(DI) - MOVOU X11, 176(DI) - LEAQ 192(SI), SI - LEAQ 192(DI), DI - SUBQ $0xc0, BX - MOVO X12, X0 - MOVO X13, X3 - MOVO X14, X6 - MOVO 64(BP), X9 - JMP openSSETail64DecLoop - + MOVOU (0*16)(inp), D3; PXOR D3, A0 + MOVOU (1*16)(inp), D3; PXOR D3, B0 + MOVOU (2*16)(inp), D3; PXOR D3, C0 + MOVOU (3*16)(inp), D3; PXOR D3, D0 + MOVOU A0, (0*16)(oup) + MOVOU B0, (1*16)(oup) + MOVOU C0, (2*16)(oup) + MOVOU D0, (3*16)(oup) + MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 + PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 + MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) + MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0 + PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 + MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup) + LEAQ 192(inp), inp + LEAQ 192(oup), oup + SUBQ $192, inl + MOVO A3, A0 + MOVO B3, B0 + MOVO C3, C0 + MOVO tmpStore, D0 + + JMP openSSETail64DecLoop + +// ---------------------------------------------------------------------------- +// ------------------------- AVX2 Code ---------------------------------------- chacha20Poly1305Open_AVX2: VZEROUPPER - VMOVDQU ·chacha20Constants<>+0(SB), Y0 - BYTE $0xc4 - BYTE $0x42 - BYTE $0x7d - BYTE $0x5a - BYTE $0x70 - BYTE $0x10 - BYTE $0xc4 - BYTE $0x42 - BYTE $0x7d - BYTE $0x5a - BYTE $0x60 - BYTE $0x20 - BYTE $0xc4 - BYTE $0xc2 - BYTE $0x7d - BYTE $0x5a - BYTE $0x60 - BYTE $0x30 - VPADDD ·avx2InitMask<>+0(SB), Y4, Y4 + VMOVDQU ·chacha20Constants<>(SB), AA0 + BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14 + BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12 + BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4 + VPADDD ·avx2InitMask<>(SB), DD0, DD0 // Special optimization, for very short buffers - CMPQ BX, $0xc0 + CMPQ inl, $192 JBE openAVX2192 - CMPQ BX, $0x00000140 + CMPQ inl, $320 JBE openAVX2320 // For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream - VMOVDQA Y14, 32(BP) - VMOVDQA Y12, 64(BP) - VMOVDQA Y4, 192(BP) - MOVQ $0x0000000a, R9 + VMOVDQA BB0, state1StoreAVX2 + VMOVDQA CC0, state2StoreAVX2 + VMOVDQA DD0, ctr3StoreAVX2 + MOVQ $10, itr2 openAVX2PreparePolyKey: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x04, Y4, Y4, Y4 - DECQ R9 - JNE openAVX2PreparePolyKey - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD 32(BP), Y14, Y14 - VPADDD 64(BP), Y12, Y12 - VPADDD 192(BP), Y4, Y4 - VPERM2I128 $0x02, Y0, Y14, Y3 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 + DECQ itr2 + JNE openAVX2PreparePolyKey + + VPADDD ·chacha20Constants<>(SB), AA0, AA0 + VPADDD state1StoreAVX2, BB0, BB0 + VPADDD state2StoreAVX2, CC0, CC0 + VPADDD ctr3StoreAVX2, DD0, DD0 + + VPERM2I128 $0x02, AA0, BB0, TT0 // Clamp and store poly key - VPAND ·polyClampMask<>+0(SB), Y3, Y3 - VMOVDQA Y3, (BP) + VPAND ·polyClampMask<>(SB), TT0, TT0 + VMOVDQA TT0, rsStoreAVX2 // Stream for the first 64 bytes - VPERM2I128 $0x13, Y0, Y14, Y0 - VPERM2I128 $0x13, Y12, Y4, Y14 + VPERM2I128 $0x13, AA0, BB0, AA0 + VPERM2I128 $0x13, CC0, DD0, BB0 // Hash AD + first 64 bytes - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) - XORQ CX, CX + XORQ itr1, itr1 openAVX2InitialHash64: - ADDQ (SI)(CX*1), R10 - ADCQ 8(SI)(CX*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ $0x10, CX - CMPQ CX, $0x40 - JNE openAVX2InitialHash64 + polyAdd(0(inp)(itr1*1)) + polyMulAVX2 + ADDQ $16, itr1 + CMPQ itr1, $64 + JNE openAVX2InitialHash64 // Decrypt the first 64 bytes - VPXOR (SI), Y0, Y0 - VPXOR 32(SI), Y14, Y14 - VMOVDQU Y0, (DI) - VMOVDQU Y14, 32(DI) - LEAQ 64(SI), SI - LEAQ 64(DI), DI - SUBQ $0x40, BX + VPXOR (0*32)(inp), AA0, AA0 + VPXOR (1*32)(inp), BB0, BB0 + VMOVDQU AA0, (0*32)(oup) + VMOVDQU BB0, (1*32)(oup) + LEAQ (2*32)(inp), inp + LEAQ (2*32)(oup), oup + SUBQ $64, inl openAVX2MainLoop: - CMPQ BX, $0x00000200 + CMPQ inl, $512 JB openAVX2MainLoopDone // Load state, increment counter blocks, store the incremented counters - VMOVDQU ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) - XORQ CX, CX + VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 + VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 + VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 + XORQ itr1, itr1 openAVX2InternalLoop: - ADDQ (SI)(CX*1), R10 - ADCQ 8(SI)(CX*1), R11 - ADCQ $0x01, R12 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - ADDQ 16(SI)(CX*1), R10 - ADCQ 24(SI)(CX*1), R11 - ADCQ $0x01, R12 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x0c, Y3, Y3, Y3 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - ADDQ 32(SI)(CX*1), R10 - ADCQ 40(SI)(CX*1), R11 - ADCQ $0x01, R12 - LEAQ 48(CX), CX - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x04, Y3, Y3, Y3 - CMPQ CX, $0x000001e0 + // Lets just say this spaghetti loop interleaves 2 quarter rounds with 3 poly multiplications + // Effectively per 512 bytes of stream we hash 480 bytes of ciphertext + polyAdd(0*8(inp)(itr1*1)) + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + polyMulStage1_AVX2 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + polyMulStage2_AVX2 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyMulStage3_AVX2 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulReduceStage + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + polyAdd(2*8(inp)(itr1*1)) + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + polyMulStage1_AVX2 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulStage2_AVX2 + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + polyMulStage3_AVX2 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + polyMulReduceStage + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyAdd(4*8(inp)(itr1*1)) + LEAQ (6*8)(itr1), itr1 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulStage1_AVX2 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + polyMulStage2_AVX2 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + polyMulStage3_AVX2 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulReduceStage + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 + CMPQ itr1, $480 JNE openAVX2InternalLoop - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD ·chacha20Constants<>+0(SB), Y7, Y7 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 32(BP), Y11, Y11 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 64(BP), Y15, Y15 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPADDD 192(BP), Y3, Y3 - VMOVDQA Y15, 224(BP) + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 + VMOVDQA CC3, tmpStoreAVX2 // We only hashed 480 of the 512 bytes available - hash the remaining 32 here - ADDQ 480(SI), R10 - ADCQ 488(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPERM2I128 $0x02, Y0, Y14, Y15 - VPERM2I128 $0x13, Y0, Y14, Y14 - VPERM2I128 $0x02, Y12, Y4, Y0 - VPERM2I128 $0x13, Y12, Y4, Y12 - VPXOR (SI), Y15, Y15 - VPXOR 32(SI), Y0, Y0 - VPXOR 64(SI), Y14, Y14 - VPXOR 96(SI), Y12, Y12 - VMOVDQU Y15, (DI) - VMOVDQU Y0, 32(DI) - VMOVDQU Y14, 64(DI) - VMOVDQU Y12, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR 128(SI), Y0, Y0 - VPXOR 160(SI), Y14, Y14 - VPXOR 192(SI), Y12, Y12 - VPXOR 224(SI), Y4, Y4 - VMOVDQU Y0, 128(DI) - VMOVDQU Y14, 160(DI) - VMOVDQU Y12, 192(DI) - VMOVDQU Y4, 224(DI) + polyAdd(480(inp)) + polyMulAVX2 + VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 + VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 + VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 + VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 + VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) // and here - ADDQ 496(SI), R10 - ADCQ 504(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - VPXOR 256(SI), Y0, Y0 - VPXOR 288(SI), Y14, Y14 - VPXOR 320(SI), Y12, Y12 - VPXOR 352(SI), Y4, Y4 - VMOVDQU Y0, 256(DI) - VMOVDQU Y14, 288(DI) - VMOVDQU Y12, 320(DI) - VMOVDQU Y4, 352(DI) - VPERM2I128 $0x02, Y7, Y11, Y0 - VPERM2I128 $0x02, 224(BP), Y3, Y14 - VPERM2I128 $0x13, Y7, Y11, Y12 - VPERM2I128 $0x13, 224(BP), Y3, Y4 - VPXOR 384(SI), Y0, Y0 - VPXOR 416(SI), Y14, Y14 - VPXOR 448(SI), Y12, Y12 - VPXOR 480(SI), Y4, Y4 - VMOVDQU Y0, 384(DI) - VMOVDQU Y14, 416(DI) - VMOVDQU Y12, 448(DI) - VMOVDQU Y4, 480(DI) - LEAQ 512(SI), SI - LEAQ 512(DI), DI - SUBQ $0x00000200, BX + polyAdd(496(inp)) + polyMulAVX2 + VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 + VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 + VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) + VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 + VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0 + VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup) + LEAQ (32*16)(inp), inp + LEAQ (32*16)(oup), oup + SUBQ $(32*16), inl JMP openAVX2MainLoop openAVX2MainLoopDone: // Handle the various tail sizes efficiently - TESTQ BX, BX + TESTQ inl, inl JE openSSEFinalize - CMPQ BX, $0x80 + CMPQ inl, $128 JBE openAVX2Tail128 - CMPQ BX, $0x00000100 + CMPQ inl, $256 JBE openAVX2Tail256 - CMPQ BX, $0x00000180 + CMPQ inl, $384 JBE openAVX2Tail384 JMP openAVX2Tail512 +// ---------------------------------------------------------------------------- +// Special optimization for buffers smaller than 193 bytes openAVX2192: - VMOVDQA Y0, Y5 - VMOVDQA Y14, Y9 - VMOVDQA Y12, Y13 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y0, Y6 - VMOVDQA Y14, Y10 - VMOVDQA Y12, Y8 - VMOVDQA Y4, Y2 - VMOVDQA Y1, Y15 - MOVQ $0x0000000a, R9 + // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks + VMOVDQA AA0, AA1 + VMOVDQA BB0, BB1 + VMOVDQA CC0, CC1 + VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA AA0, AA2 + VMOVDQA BB0, BB2 + VMOVDQA CC0, CC2 + VMOVDQA DD0, DD2 + VMOVDQA DD1, TT3 + MOVQ $10, itr2 openAVX2192InnerCipherLoop: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - DECQ R9 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 + DECQ itr2 JNE openAVX2192InnerCipherLoop - VPADDD Y6, Y0, Y0 - VPADDD Y6, Y5, Y5 - VPADDD Y10, Y14, Y14 - VPADDD Y10, Y9, Y9 - VPADDD Y8, Y12, Y12 - VPADDD Y8, Y13, Y13 - VPADDD Y2, Y4, Y4 - VPADDD Y15, Y1, Y1 - VPERM2I128 $0x02, Y0, Y14, Y3 + VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1 + VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1 + VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1 + VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1 + VPERM2I128 $0x02, AA0, BB0, TT0 // Clamp and store poly key - VPAND ·polyClampMask<>+0(SB), Y3, Y3 - VMOVDQA Y3, (BP) + VPAND ·polyClampMask<>(SB), TT0, TT0 + VMOVDQA TT0, rsStoreAVX2 // Stream for up to 192 bytes - VPERM2I128 $0x13, Y0, Y14, Y0 - VPERM2I128 $0x13, Y12, Y4, Y14 - VPERM2I128 $0x02, Y5, Y9, Y12 - VPERM2I128 $0x02, Y13, Y1, Y4 - VPERM2I128 $0x13, Y5, Y9, Y5 - VPERM2I128 $0x13, Y13, Y1, Y9 + VPERM2I128 $0x13, AA0, BB0, AA0 + VPERM2I128 $0x13, CC0, DD0, BB0 + VPERM2I128 $0x02, AA1, BB1, CC0 + VPERM2I128 $0x02, CC1, DD1, DD0 + VPERM2I128 $0x13, AA1, BB1, AA1 + VPERM2I128 $0x13, CC1, DD1, BB1 openAVX2ShortOpen: // Hash - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) openAVX2ShortOpenLoop: - CMPQ BX, $0x20 + CMPQ inl, $32 JB openAVX2ShortTail32 - SUBQ $0x20, BX + SUBQ $32, inl // Load for hashing - ADDQ (SI), R10 - ADCQ 8(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ 16(SI), R10 - ADCQ 24(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + polyAdd(0*8(inp)) + polyMulAVX2 + polyAdd(2*8(inp)) + polyMulAVX2 // Load for decryption - VPXOR (SI), Y0, Y0 - VMOVDQU Y0, (DI) - LEAQ 32(SI), SI - LEAQ 32(DI), DI + VPXOR (inp), AA0, AA0 + VMOVDQU AA0, (oup) + LEAQ (1*32)(inp), inp + LEAQ (1*32)(oup), oup // Shift stream left - VMOVDQA Y14, Y0 - VMOVDQA Y12, Y14 - VMOVDQA Y4, Y12 - VMOVDQA Y5, Y4 - VMOVDQA Y9, Y5 - VMOVDQA Y13, Y9 - VMOVDQA Y1, Y13 - VMOVDQA Y6, Y1 - VMOVDQA Y10, Y6 + VMOVDQA BB0, AA0 + VMOVDQA CC0, BB0 + VMOVDQA DD0, CC0 + VMOVDQA AA1, DD0 + VMOVDQA BB1, AA1 + VMOVDQA CC1, BB1 + VMOVDQA DD1, CC1 + VMOVDQA AA2, DD1 + VMOVDQA BB2, AA2 JMP openAVX2ShortOpenLoop openAVX2ShortTail32: - CMPQ BX, $0x10 - VMOVDQA X0, X1 + CMPQ inl, $16 + VMOVDQA A0, A1 JB openAVX2ShortDone - SUBQ $0x10, BX + + SUBQ $16, inl // Load for hashing - ADDQ (SI), R10 - ADCQ 8(SI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + polyAdd(0*8(inp)) + polyMulAVX2 // Load for decryption - VPXOR (SI), X0, X12 - VMOVDQU X12, (DI) - LEAQ 16(SI), SI - LEAQ 16(DI), DI - VPERM2I128 $0x11, Y0, Y0, Y0 - VMOVDQA X0, X1 + VPXOR (inp), A0, T0 + VMOVDQU T0, (oup) + LEAQ (1*16)(inp), inp + LEAQ (1*16)(oup), oup + VPERM2I128 $0x11, AA0, AA0, AA0 + VMOVDQA A0, A1 openAVX2ShortDone: VZEROUPPER JMP openSSETail16 +// ---------------------------------------------------------------------------- +// Special optimization for buffers smaller than 321 bytes openAVX2320: - VMOVDQA Y0, Y5 - VMOVDQA Y14, Y9 - VMOVDQA Y12, Y13 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y0, Y6 - VMOVDQA Y14, Y10 - VMOVDQA Y12, Y8 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VMOVDQA Y14, Y7 - VMOVDQA Y12, Y11 - VMOVDQA Y4, Y15 - MOVQ $0x0000000a, R9 + // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks + VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2 + VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3 + MOVQ $10, itr2 openAVX2320InnerCipherLoop: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - DECQ R9 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 + DECQ itr2 JNE openAVX2320InnerCipherLoop - VMOVDQA ·chacha20Constants<>+0(SB), Y3 - VPADDD Y3, Y0, Y0 - VPADDD Y3, Y5, Y5 - VPADDD Y3, Y6, Y6 - VPADDD Y7, Y14, Y14 - VPADDD Y7, Y9, Y9 - VPADDD Y7, Y10, Y10 - VPADDD Y11, Y12, Y12 - VPADDD Y11, Y13, Y13 - VPADDD Y11, Y8, Y8 - VMOVDQA ·avx2IncMask<>+0(SB), Y3 - VPADDD Y15, Y4, Y4 - VPADDD Y3, Y15, Y15 - VPADDD Y15, Y1, Y1 - VPADDD Y3, Y15, Y15 - VPADDD Y15, Y2, Y2 + + VMOVDQA ·chacha20Constants<>(SB), TT0 + VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2 + VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2 + VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2 + VMOVDQA ·avx2IncMask<>(SB), TT0 + VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3 + VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3 + VPADDD TT3, DD2, DD2 // Clamp and store poly key - VPERM2I128 $0x02, Y0, Y14, Y3 - VPAND ·polyClampMask<>+0(SB), Y3, Y3 - VMOVDQA Y3, (BP) + VPERM2I128 $0x02, AA0, BB0, TT0 + VPAND ·polyClampMask<>(SB), TT0, TT0 + VMOVDQA TT0, rsStoreAVX2 // Stream for up to 320 bytes - VPERM2I128 $0x13, Y0, Y14, Y0 - VPERM2I128 $0x13, Y12, Y4, Y14 - VPERM2I128 $0x02, Y5, Y9, Y12 - VPERM2I128 $0x02, Y13, Y1, Y4 - VPERM2I128 $0x13, Y5, Y9, Y5 - VPERM2I128 $0x13, Y13, Y1, Y9 - VPERM2I128 $0x02, Y6, Y10, Y13 - VPERM2I128 $0x02, Y8, Y2, Y1 - VPERM2I128 $0x13, Y6, Y10, Y6 - VPERM2I128 $0x13, Y8, Y2, Y10 + VPERM2I128 $0x13, AA0, BB0, AA0 + VPERM2I128 $0x13, CC0, DD0, BB0 + VPERM2I128 $0x02, AA1, BB1, CC0 + VPERM2I128 $0x02, CC1, DD1, DD0 + VPERM2I128 $0x13, AA1, BB1, AA1 + VPERM2I128 $0x13, CC1, DD1, BB1 + VPERM2I128 $0x02, AA2, BB2, CC1 + VPERM2I128 $0x02, CC2, DD2, DD1 + VPERM2I128 $0x13, AA2, BB2, AA2 + VPERM2I128 $0x13, CC2, DD2, BB2 JMP openAVX2ShortOpen +// ---------------------------------------------------------------------------- +// Special optimization for the last 128 bytes of ciphertext openAVX2Tail128: // Need to decrypt up to 128 bytes - prepare two blocks - VMOVDQA ·chacha20Constants<>+0(SB), Y5 - VMOVDQA 32(BP), Y9 - VMOVDQA 64(BP), Y13 - VMOVDQA 192(BP), Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y1 - VMOVDQA Y1, Y4 - XORQ R9, R9 - MOVQ BX, CX - ANDQ $-16, CX - TESTQ CX, CX - JE openAVX2Tail128LoopB + VMOVDQA ·chacha20Constants<>(SB), AA1 + VMOVDQA state1StoreAVX2, BB1 + VMOVDQA state2StoreAVX2, CC1 + VMOVDQA ctr3StoreAVX2, DD1 + VPADDD ·avx2IncMask<>(SB), DD1, DD1 + VMOVDQA DD1, DD0 + + XORQ itr2, itr2 + MOVQ inl, itr1 + ANDQ $-16, itr1 + TESTQ itr1, itr1 + JE openAVX2Tail128LoopB openAVX2Tail128LoopA: - ADDQ (SI)(R9*1), R10 - ADCQ 8(SI)(R9*1), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + // Perform ChaCha rounds, while hashing the remaining input + polyAdd(0(inp)(itr2*1)) + polyMulAVX2 openAVX2Tail128LoopB: - ADDQ $0x10, R9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y1, Y1, Y1 - CMPQ R9, CX - JB openAVX2Tail128LoopA - CMPQ R9, $0xa0 - JNE openAVX2Tail128LoopB - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD 32(BP), Y9, Y9 - VPADDD 64(BP), Y13, Y13 - VPADDD Y4, Y1, Y1 - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 + ADDQ $16, itr2 + chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $4, BB1, BB1, BB1 + VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $12, DD1, DD1, DD1 + chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $12, BB1, BB1, BB1 + VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $4, DD1, DD1, DD1 + CMPQ itr2, itr1 + JB openAVX2Tail128LoopA + CMPQ itr2, $160 + JNE openAVX2Tail128LoopB + + VPADDD ·chacha20Constants<>(SB), AA1, AA1 + VPADDD state1StoreAVX2, BB1, BB1 + VPADDD state2StoreAVX2, CC1, CC1 + VPADDD DD0, DD1, DD1 + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 openAVX2TailLoop: - CMPQ BX, $0x20 + CMPQ inl, $32 JB openAVX2Tail - SUBQ $0x20, BX + SUBQ $32, inl // Load for decryption - VPXOR (SI), Y0, Y0 - VMOVDQU Y0, (DI) - LEAQ 32(SI), SI - LEAQ 32(DI), DI - VMOVDQA Y14, Y0 - VMOVDQA Y12, Y14 - VMOVDQA Y4, Y12 + VPXOR (inp), AA0, AA0 + VMOVDQU AA0, (oup) + LEAQ (1*32)(inp), inp + LEAQ (1*32)(oup), oup + VMOVDQA BB0, AA0 + VMOVDQA CC0, BB0 + VMOVDQA DD0, CC0 JMP openAVX2TailLoop openAVX2Tail: - CMPQ BX, $0x10 - VMOVDQA X0, X1 + CMPQ inl, $16 + VMOVDQA A0, A1 JB openAVX2TailDone - SUBQ $0x10, BX + SUBQ $16, inl // Load for decryption - VPXOR (SI), X0, X12 - VMOVDQU X12, (DI) - LEAQ 16(SI), SI - LEAQ 16(DI), DI - VPERM2I128 $0x11, Y0, Y0, Y0 - VMOVDQA X0, X1 + VPXOR (inp), A0, T0 + VMOVDQU T0, (oup) + LEAQ (1*16)(inp), inp + LEAQ (1*16)(oup), oup + VPERM2I128 $0x11, AA0, AA0, AA0 + VMOVDQA A0, A1 openAVX2TailDone: VZEROUPPER JMP openSSETail16 +// ---------------------------------------------------------------------------- +// Special optimization for the last 256 bytes of ciphertext openAVX2Tail256: - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y4, Y7 - VMOVDQA Y1, Y11 + // Need to decrypt up to 256 bytes - prepare four blocks + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA DD0, TT1 + VMOVDQA DD1, TT2 // Compute the number of iterations that will hash data - MOVQ BX, 224(BP) - MOVQ BX, CX - SUBQ $0x80, CX - SHRQ $0x04, CX - MOVQ $0x0000000a, R9 - CMPQ CX, $0x0a - CMOVQGT R9, CX - MOVQ SI, BX - XORQ R9, R9 + MOVQ inl, tmpStoreAVX2 + MOVQ inl, itr1 + SUBQ $128, itr1 + SHRQ $4, itr1 + MOVQ $10, itr2 + CMPQ itr1, $10 + CMOVQGT itr2, itr1 + MOVQ inp, inl + XORQ itr2, itr2 openAVX2Tail256LoopA: - ADDQ (BX), R10 - ADCQ 8(BX), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(BX), BX + polyAdd(0(inl)) + polyMulAVX2 + LEAQ 16(inl), inl + // Perform ChaCha rounds, while hashing the remaining input openAVX2Tail256LoopB: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - INCQ R9 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - CMPQ R9, CX + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 + INCQ itr2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 + CMPQ itr2, itr1 JB openAVX2Tail256LoopA - CMPQ R9, $0x0a - JNE openAVX2Tail256LoopB - MOVQ BX, R9 - SUBQ SI, BX - MOVQ BX, CX - MOVQ 224(BP), BX -openAVX2Tail256Hash: - ADDQ $0x10, CX - CMPQ CX, BX - JGT openAVX2Tail256HashEnd - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(R9), R9 - JMP openAVX2Tail256Hash + CMPQ itr2, $10 + JNE openAVX2Tail256LoopB -openAVX2Tail256HashEnd: - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD Y7, Y4, Y4 - VPADDD Y11, Y1, Y1 - VPERM2I128 $0x02, Y0, Y14, Y6 - VPERM2I128 $0x02, Y12, Y4, Y10 - VPERM2I128 $0x13, Y0, Y14, Y8 - VPERM2I128 $0x13, Y12, Y4, Y2 - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR (SI), Y6, Y6 - VPXOR 32(SI), Y10, Y10 - VPXOR 64(SI), Y8, Y8 - VPXOR 96(SI), Y2, Y2 - VMOVDQU Y6, (DI) - VMOVDQU Y10, 32(DI) - VMOVDQU Y8, 64(DI) - VMOVDQU Y2, 96(DI) - LEAQ 128(SI), SI - LEAQ 128(DI), DI - SUBQ $0x80, BX - JMP openAVX2TailLoop + MOVQ inl, itr2 + SUBQ inp, inl + MOVQ inl, itr1 + MOVQ tmpStoreAVX2, inl + // Hash the remainder of data (if any) +openAVX2Tail256Hash: + ADDQ $16, itr1 + CMPQ itr1, inl + JGT openAVX2Tail256HashEnd + polyAdd (0(itr2)) + polyMulAVX2 + LEAQ 16(itr2), itr2 + JMP openAVX2Tail256Hash + +// Store 128 bytes safely, then go to store loop +openAVX2Tail256HashEnd: + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1 + VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1 + VPERM2I128 $0x02, AA0, BB0, AA2; VPERM2I128 $0x02, CC0, DD0, BB2; VPERM2I128 $0x13, AA0, BB0, CC2; VPERM2I128 $0x13, CC0, DD0, DD2 + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 + + VPXOR (0*32)(inp), AA2, AA2; VPXOR (1*32)(inp), BB2, BB2; VPXOR (2*32)(inp), CC2, CC2; VPXOR (3*32)(inp), DD2, DD2 + VMOVDQU AA2, (0*32)(oup); VMOVDQU BB2, (1*32)(oup); VMOVDQU CC2, (2*32)(oup); VMOVDQU DD2, (3*32)(oup) + LEAQ (4*32)(inp), inp + LEAQ (4*32)(oup), oup + SUBQ $4*32, inl + + JMP openAVX2TailLoop + +// ---------------------------------------------------------------------------- +// Special optimization for the last 384 bytes of ciphertext openAVX2Tail384: // Need to decrypt up to 384 bytes - prepare six blocks - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VPADDD ·avx2IncMask<>(SB), DD1, DD2 + VMOVDQA DD0, ctr0StoreAVX2 + VMOVDQA DD1, ctr1StoreAVX2 + VMOVDQA DD2, ctr2StoreAVX2 // Compute the number of iterations that will hash two blocks of data - MOVQ BX, 224(BP) - MOVQ BX, CX - SUBQ $0x00000100, CX - SHRQ $0x04, CX - ADDQ $0x06, CX - MOVQ $0x0000000a, R9 - CMPQ CX, $0x0a - CMOVQGT R9, CX - MOVQ SI, BX - XORQ R9, R9 - + MOVQ inl, tmpStoreAVX2 + MOVQ inl, itr1 + SUBQ $256, itr1 + SHRQ $4, itr1 + ADDQ $6, itr1 + MOVQ $10, itr2 + CMPQ itr1, $10 + CMOVQGT itr2, itr1 + MOVQ inp, inl + XORQ itr2, itr2 + + // Perform ChaCha rounds, while hashing the remaining input openAVX2Tail384LoopB: - ADDQ (BX), R10 - ADCQ 8(BX), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(BX), BX + polyAdd(0(inl)) + polyMulAVX2 + LEAQ 16(inl), inl openAVX2Tail384LoopA: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - ADDQ (BX), R10 - ADCQ 8(BX), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(BX), BX - INCQ R9 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - CMPQ R9, CX - JB openAVX2Tail384LoopB - CMPQ R9, $0x0a - JNE openAVX2Tail384LoopA - MOVQ BX, R9 - SUBQ SI, BX - MOVQ BX, CX - MOVQ 224(BP), BX + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 + polyAdd(0(inl)) + polyMulAVX2 + LEAQ 16(inl), inl + INCQ itr2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 + + CMPQ itr2, itr1 + JB openAVX2Tail384LoopB + + CMPQ itr2, $10 + JNE openAVX2Tail384LoopA + + MOVQ inl, itr2 + SUBQ inp, inl + MOVQ inl, itr1 + MOVQ tmpStoreAVX2, inl openAVX2Tail384Hash: - ADDQ $0x10, CX - CMPQ CX, BX - JGT openAVX2Tail384HashEnd - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(R9), R9 - JMP openAVX2Tail384Hash - + ADDQ $16, itr1 + CMPQ itr1, inl + JGT openAVX2Tail384HashEnd + polyAdd(0(itr2)) + polyMulAVX2 + LEAQ 16(itr2), itr2 + JMP openAVX2Tail384Hash + +// Store 256 bytes safely, then go to store loop openAVX2Tail384HashEnd: - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPERM2I128 $0x02, Y0, Y14, Y3 - VPERM2I128 $0x02, Y12, Y4, Y7 - VPERM2I128 $0x13, Y0, Y14, Y11 - VPERM2I128 $0x13, Y12, Y4, Y15 - VPXOR (SI), Y3, Y3 - VPXOR 32(SI), Y7, Y7 - VPXOR 64(SI), Y11, Y11 - VPXOR 96(SI), Y15, Y15 - VMOVDQU Y3, (DI) - VMOVDQU Y7, 32(DI) - VMOVDQU Y11, 64(DI) - VMOVDQU Y15, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y3 - VPERM2I128 $0x02, Y13, Y1, Y7 - VPERM2I128 $0x13, Y5, Y9, Y11 - VPERM2I128 $0x13, Y13, Y1, Y15 - VPXOR 128(SI), Y3, Y3 - VPXOR 160(SI), Y7, Y7 - VPXOR 192(SI), Y11, Y11 - VPXOR 224(SI), Y15, Y15 - VMOVDQU Y3, 128(DI) - VMOVDQU Y7, 160(DI) - VMOVDQU Y11, 192(DI) - VMOVDQU Y15, 224(DI) - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - LEAQ 256(SI), SI - LEAQ 256(DI), DI - SUBQ $0x00000100, BX + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2 + VPERM2I128 $0x02, AA0, BB0, TT0; VPERM2I128 $0x02, CC0, DD0, TT1; VPERM2I128 $0x13, AA0, BB0, TT2; VPERM2I128 $0x13, CC0, DD0, TT3 + VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 + VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) + VPERM2I128 $0x02, AA1, BB1, TT0; VPERM2I128 $0x02, CC1, DD1, TT1; VPERM2I128 $0x13, AA1, BB1, TT2; VPERM2I128 $0x13, CC1, DD1, TT3 + VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3 + VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup) + VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 + LEAQ (8*32)(inp), inp + LEAQ (8*32)(oup), oup + SUBQ $8*32, inl JMP openAVX2TailLoop +// ---------------------------------------------------------------------------- +// Special optimization for the last 512 bytes of ciphertext openAVX2Tail512: - VMOVDQU ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) - XORQ CX, CX - MOVQ SI, R9 + VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 + VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 + VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 + XORQ itr1, itr1 + MOVQ inp, itr2 openAVX2Tail512LoopB: - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(R9), R9 + polyAdd(0(itr2)) + polyMulAVX2 + LEAQ (2*8)(itr2), itr2 openAVX2Tail512LoopA: - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x0c, Y3, Y3, Y3 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - ADDQ 16(R9), R10 - ADCQ 24(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(R9), R9 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x04, Y3, Y3, Y3 - INCQ CX - CMPQ CX, $0x04 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyAdd(0*8(itr2)) + polyMulAVX2 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyAdd(2*8(itr2)) + polyMulAVX2 + LEAQ (4*8)(itr2), itr2 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 + INCQ itr1 + CMPQ itr1, $4 JLT openAVX2Tail512LoopB - CMPQ CX, $0x0a - JNE openAVX2Tail512LoopA - MOVQ BX, CX - SUBQ $0x00000180, CX - ANDQ $-16, CX + + CMPQ itr1, $10 + JNE openAVX2Tail512LoopA + + MOVQ inl, itr1 + SUBQ $384, itr1 + ANDQ $-16, itr1 openAVX2Tail512HashLoop: - TESTQ CX, CX + TESTQ itr1, itr1 JE openAVX2Tail512HashEnd - ADDQ (R9), R10 - ADCQ 8(R9), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(R9), R9 - SUBQ $0x10, CX + polyAdd(0(itr2)) + polyMulAVX2 + LEAQ 16(itr2), itr2 + SUBQ $16, itr1 JMP openAVX2Tail512HashLoop openAVX2Tail512HashEnd: - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD ·chacha20Constants<>+0(SB), Y7, Y7 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 32(BP), Y11, Y11 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 64(BP), Y15, Y15 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPADDD 192(BP), Y3, Y3 - VMOVDQA Y15, 224(BP) - VPERM2I128 $0x02, Y0, Y14, Y15 - VPERM2I128 $0x13, Y0, Y14, Y14 - VPERM2I128 $0x02, Y12, Y4, Y0 - VPERM2I128 $0x13, Y12, Y4, Y12 - VPXOR (SI), Y15, Y15 - VPXOR 32(SI), Y0, Y0 - VPXOR 64(SI), Y14, Y14 - VPXOR 96(SI), Y12, Y12 - VMOVDQU Y15, (DI) - VMOVDQU Y0, 32(DI) - VMOVDQU Y14, 64(DI) - VMOVDQU Y12, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR 128(SI), Y0, Y0 - VPXOR 160(SI), Y14, Y14 - VPXOR 192(SI), Y12, Y12 - VPXOR 224(SI), Y4, Y4 - VMOVDQU Y0, 128(DI) - VMOVDQU Y14, 160(DI) - VMOVDQU Y12, 192(DI) - VMOVDQU Y4, 224(DI) - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - VPXOR 256(SI), Y0, Y0 - VPXOR 288(SI), Y14, Y14 - VPXOR 320(SI), Y12, Y12 - VPXOR 352(SI), Y4, Y4 - VMOVDQU Y0, 256(DI) - VMOVDQU Y14, 288(DI) - VMOVDQU Y12, 320(DI) - VMOVDQU Y4, 352(DI) - VPERM2I128 $0x02, Y7, Y11, Y0 - VPERM2I128 $0x02, 224(BP), Y3, Y14 - VPERM2I128 $0x13, Y7, Y11, Y12 - VPERM2I128 $0x13, 224(BP), Y3, Y4 - LEAQ 384(SI), SI - LEAQ 384(DI), DI - SUBQ $0x00000180, BX - JMP openAVX2TailLoop - -DATA ·chacha20Constants<>+0(SB)/4, $0x61707865 -DATA ·chacha20Constants<>+4(SB)/4, $0x3320646e -DATA ·chacha20Constants<>+8(SB)/4, $0x79622d32 -DATA ·chacha20Constants<>+12(SB)/4, $0x6b206574 -DATA ·chacha20Constants<>+16(SB)/4, $0x61707865 -DATA ·chacha20Constants<>+20(SB)/4, $0x3320646e -DATA ·chacha20Constants<>+24(SB)/4, $0x79622d32 -DATA ·chacha20Constants<>+28(SB)/4, $0x6b206574 -GLOBL ·chacha20Constants<>(SB), RODATA|NOPTR, $32 - -DATA ·polyClampMask<>+0(SB)/8, $0x0ffffffc0fffffff -DATA ·polyClampMask<>+8(SB)/8, $0x0ffffffc0ffffffc -DATA ·polyClampMask<>+16(SB)/8, $0xffffffffffffffff -DATA ·polyClampMask<>+24(SB)/8, $0xffffffffffffffff -GLOBL ·polyClampMask<>(SB), RODATA|NOPTR, $32 - -DATA ·sseIncMask<>+0(SB)/8, $0x0000000000000001 -DATA ·sseIncMask<>+8(SB)/8, $0x0000000000000000 -GLOBL ·sseIncMask<>(SB), RODATA|NOPTR, $16 - -DATA ·andMask<>+0(SB)/8, $0x00000000000000ff -DATA ·andMask<>+8(SB)/8, $0x0000000000000000 -DATA ·andMask<>+16(SB)/8, $0x000000000000ffff -DATA ·andMask<>+24(SB)/8, $0x0000000000000000 -DATA ·andMask<>+32(SB)/8, $0x0000000000ffffff -DATA ·andMask<>+40(SB)/8, $0x0000000000000000 -DATA ·andMask<>+48(SB)/8, $0x00000000ffffffff -DATA ·andMask<>+56(SB)/8, $0x0000000000000000 -DATA ·andMask<>+64(SB)/8, $0x000000ffffffffff -DATA ·andMask<>+72(SB)/8, $0x0000000000000000 -DATA ·andMask<>+80(SB)/8, $0x0000ffffffffffff -DATA ·andMask<>+88(SB)/8, $0x0000000000000000 -DATA ·andMask<>+96(SB)/8, $0x00ffffffffffffff -DATA ·andMask<>+104(SB)/8, $0x0000000000000000 -DATA ·andMask<>+112(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+120(SB)/8, $0x0000000000000000 -DATA ·andMask<>+128(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+136(SB)/8, $0x00000000000000ff -DATA ·andMask<>+144(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+152(SB)/8, $0x000000000000ffff -DATA ·andMask<>+160(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+168(SB)/8, $0x0000000000ffffff -DATA ·andMask<>+176(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+184(SB)/8, $0x00000000ffffffff -DATA ·andMask<>+192(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+200(SB)/8, $0x000000ffffffffff -DATA ·andMask<>+208(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+216(SB)/8, $0x0000ffffffffffff -DATA ·andMask<>+224(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+232(SB)/8, $0x00ffffffffffffff -GLOBL ·andMask<>(SB), RODATA|NOPTR, $240 - -DATA ·avx2InitMask<>+0(SB)/8, $0x0000000000000000 -DATA ·avx2InitMask<>+8(SB)/8, $0x0000000000000000 -DATA ·avx2InitMask<>+16(SB)/8, $0x0000000000000001 -DATA ·avx2InitMask<>+24(SB)/8, $0x0000000000000000 -GLOBL ·avx2InitMask<>(SB), RODATA|NOPTR, $32 - -DATA ·rol16<>+0(SB)/8, $0x0504070601000302 -DATA ·rol16<>+8(SB)/8, $0x0d0c0f0e09080b0a -DATA ·rol16<>+16(SB)/8, $0x0504070601000302 -DATA ·rol16<>+24(SB)/8, $0x0d0c0f0e09080b0a -GLOBL ·rol16<>(SB), RODATA|NOPTR, $32 - -DATA ·rol8<>+0(SB)/8, $0x0605040702010003 -DATA ·rol8<>+8(SB)/8, $0x0e0d0c0f0a09080b -DATA ·rol8<>+16(SB)/8, $0x0605040702010003 -DATA ·rol8<>+24(SB)/8, $0x0e0d0c0f0a09080b -GLOBL ·rol8<>(SB), RODATA|NOPTR, $32 - -DATA ·avx2IncMask<>+0(SB)/8, $0x0000000000000002 -DATA ·avx2IncMask<>+8(SB)/8, $0x0000000000000000 -DATA ·avx2IncMask<>+16(SB)/8, $0x0000000000000002 -DATA ·avx2IncMask<>+24(SB)/8, $0x0000000000000000 -GLOBL ·avx2IncMask<>(SB), RODATA|NOPTR, $32 - -// func chacha20Poly1305Seal(dst []byte, key []uint32, src []byte, ad []byte) -// Requires: AVX, AVX2, BMI2, CMOV, SSE2 -TEXT ·chacha20Poly1305Seal(SB), $288-96 + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 + VMOVDQA CC3, tmpStoreAVX2 + VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 + VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 + VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 + VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 + VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) + VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 + VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 + VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) + VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 + + LEAQ (12*32)(inp), inp + LEAQ (12*32)(oup), oup + SUBQ $12*32, inl + + JMP openAVX2TailLoop + +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// func chacha20Poly1305Seal(dst, key, src, ad []byte) +TEXT ·chacha20Poly1305Seal(SB), 0, $288-96 + // For aligned stack access MOVQ SP, BP - ADDQ $0x20, BP + ADDQ $32, BP ANDQ $-32, BP - MOVQ dst_base+0(FP), DI - MOVQ key_base+24(FP), R8 - MOVQ src_base+48(FP), SI - MOVQ src_len+56(FP), BX - MOVQ ad_base+72(FP), CX - CMPB ·useAVX2+0(SB), $0x01 + MOVQ dst+0(FP), oup + MOVQ key+24(FP), keyp + MOVQ src+48(FP), inp + MOVQ src_len+56(FP), inl + MOVQ ad+72(FP), adp + + CMPB ·useAVX2(SB), $1 JE chacha20Poly1305Seal_AVX2 // Special optimization, for very short buffers - CMPQ BX, $0x80 - JBE sealSSE128 + CMPQ inl, $128 + JBE sealSSE128 // About 15% faster // In the seal case - prepare the poly key + 3 blocks of stream in the first iteration - MOVOU ·chacha20Constants<>+0(SB), X0 - MOVOU 16(R8), X3 - MOVOU 32(R8), X6 - MOVOU 48(R8), X9 + MOVOU ·chacha20Constants<>(SB), A0 + MOVOU (1*16)(keyp), B0 + MOVOU (2*16)(keyp), C0 + MOVOU (3*16)(keyp), D0 // Store state on stack for future use - MOVO X3, 32(BP) - MOVO X6, 48(BP) + MOVO B0, state1Store + MOVO C0, state2Store // Load state, increment counter blocks - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X2, X12 - MOVO X5, X13 - MOVO X8, X14 - MOVO X11, X15 - PADDL ·sseIncMask<>+0(SB), X15 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 // Store counters - MOVO X9, 80(BP) - MOVO X10, 96(BP) - MOVO X11, 112(BP) - MOVO X15, 128(BP) - MOVQ $0x0000000a, R9 + MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store + MOVQ $10, itr2 sealSSEIntroLoop: - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x0c - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x04 - DECQ R9 - JNE sealSSEIntroLoop + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left + shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left + shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left + + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right + shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right + shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right + DECQ itr2 + JNE sealSSEIntroLoop // Add in the state - PADDD ·chacha20Constants<>+0(SB), X0 - PADDD ·chacha20Constants<>+0(SB), X1 - PADDD ·chacha20Constants<>+0(SB), X2 - PADDD ·chacha20Constants<>+0(SB), X12 - PADDD 32(BP), X3 - PADDD 32(BP), X4 - PADDD 32(BP), X5 - PADDD 32(BP), X13 - PADDD 48(BP), X7 - PADDD 48(BP), X8 - PADDD 48(BP), X14 - PADDD 96(BP), X10 - PADDD 112(BP), X11 - PADDD 128(BP), X15 + PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 + PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 + PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 + PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 // Clamp and store the key - PAND ·polyClampMask<>+0(SB), X0 - MOVO X0, (BP) - MOVO X3, 16(BP) + PAND ·polyClampMask<>(SB), A0 + MOVO A0, rStore + MOVO B0, sStore // Hash AAD - MOVQ ad_len+80(FP), R9 - CALL polyHashADInternal<>(SB) - MOVOU (SI), X0 - MOVOU 16(SI), X3 - MOVOU 32(SI), X6 - MOVOU 48(SI), X9 - PXOR X0, X1 - PXOR X3, X4 - PXOR X6, X7 - PXOR X9, X10 - MOVOU X1, (DI) - MOVOU X4, 16(DI) - MOVOU X7, 32(DI) - MOVOU X10, 48(DI) - MOVOU 64(SI), X0 - MOVOU 80(SI), X3 - MOVOU 96(SI), X6 - MOVOU 112(SI), X9 - PXOR X0, X2 - PXOR X3, X5 - PXOR X6, X8 - PXOR X9, X11 - MOVOU X2, 64(DI) - MOVOU X5, 80(DI) - MOVOU X8, 96(DI) - MOVOU X11, 112(DI) - MOVQ $0x00000080, CX - SUBQ $0x80, BX - LEAQ 128(SI), SI - MOVO X12, X1 - MOVO X13, X4 - MOVO X14, X7 - MOVO X15, X10 - CMPQ BX, $0x40 - JBE sealSSE128SealHash - MOVOU (SI), X0 - MOVOU 16(SI), X3 - MOVOU 32(SI), X6 - MOVOU 48(SI), X9 - PXOR X0, X12 - PXOR X3, X13 - PXOR X6, X14 - PXOR X9, X15 - MOVOU X12, 128(DI) - MOVOU X13, 144(DI) - MOVOU X14, 160(DI) - MOVOU X15, 176(DI) - ADDQ $0x40, CX - SUBQ $0x40, BX - LEAQ 64(SI), SI - MOVQ $0x00000002, CX - MOVQ $0x00000008, R9 - CMPQ BX, $0x40 - JBE sealSSETail64 - CMPQ BX, $0x80 - JBE sealSSETail128 - CMPQ BX, $0xc0 - JBE sealSSETail192 + MOVQ ad_len+80(FP), itr2 + CALL polyHashADInternal<>(SB) + + MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 + PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 + MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup) + MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 + PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 + MOVOU A2, (4*16)(oup); MOVOU B2, (5*16)(oup); MOVOU C2, (6*16)(oup); MOVOU D2, (7*16)(oup) + + MOVQ $128, itr1 + SUBQ $128, inl + LEAQ 128(inp), inp + + MOVO A3, A1; MOVO B3, B1; MOVO C3, C1; MOVO D3, D1 + + CMPQ inl, $64 + JBE sealSSE128SealHash + + MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 + PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3 + MOVOU A3, (8*16)(oup); MOVOU B3, (9*16)(oup); MOVOU C3, (10*16)(oup); MOVOU D3, (11*16)(oup) + + ADDQ $64, itr1 + SUBQ $64, inl + LEAQ 64(inp), inp + + MOVQ $2, itr1 + MOVQ $8, itr2 + + CMPQ inl, $64 + JBE sealSSETail64 + CMPQ inl, $128 + JBE sealSSETail128 + CMPQ inl, $192 + JBE sealSSETail192 sealSSEMainLoop: // Load state, increment counter blocks - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X2, X12 - MOVO X5, X13 - MOVO X8, X14 - MOVO X11, X15 - PADDL ·sseIncMask<>+0(SB), X15 + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 // Store counters - MOVO X9, 80(BP) - MOVO X10, 96(BP) - MOVO X11, 112(BP) - MOVO X15, 128(BP) + MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store sealSSEInnerLoop: - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x0c - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - LEAQ 16(DI), DI - MOVO X14, 64(BP) - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X3 - PXOR X14, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X14) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X3 - PXOR X14, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X4 - PXOR X14, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X14) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X4 - PXOR X14, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x0c, X14 - PSRLL $0x14, X5 - PXOR X14, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X14) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X14 - PSLLL $0x07, X14 - PSRLL $0x19, X5 - PXOR X14, X5 - MOVO 64(BP), X14 - MOVO X7, 64(BP) - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - PADDD X13, X12 - PXOR X12, X15 - ROL16(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x0c, X7 - PSRLL $0x14, X13 - PXOR X7, X13 - PADDD X13, X12 - PXOR X12, X15 - ROL8(X15, X7) - PADDD X15, X14 - PXOR X14, X13 - MOVO X13, X7 - PSLLL $0x07, X7 - PSRLL $0x19, X13 - PXOR X7, X13 - MOVO 64(BP), X7 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x04 - DECQ R9 - JGE sealSSEInnerLoop - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI - DECQ CX - JG sealSSEInnerLoop + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + polyAdd(0(oup)) + shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left + shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left + shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left + polyMulStage1 + polyMulStage2 + LEAQ (2*8)(oup), oup + MOVO C3, tmpStore + chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) + MOVO tmpStore, C3 + MOVO C1, tmpStore + polyMulStage3 + chachaQR(A3, B3, C3, D3, C1) + MOVO tmpStore, C1 + polyMulReduceStage + shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right + shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right + shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right + DECQ itr2 + JGE sealSSEInnerLoop + polyAdd(0(oup)) + polyMul + LEAQ (2*8)(oup), oup + DECQ itr1 + JG sealSSEInnerLoop // Add in the state - PADDD ·chacha20Constants<>+0(SB), X0 - PADDD ·chacha20Constants<>+0(SB), X1 - PADDD ·chacha20Constants<>+0(SB), X2 - PADDD ·chacha20Constants<>+0(SB), X12 - PADDD 32(BP), X3 - PADDD 32(BP), X4 - PADDD 32(BP), X5 - PADDD 32(BP), X13 - PADDD 48(BP), X6 - PADDD 48(BP), X7 - PADDD 48(BP), X8 - PADDD 48(BP), X14 - PADDD 80(BP), X9 - PADDD 96(BP), X10 - PADDD 112(BP), X11 - PADDD 128(BP), X15 - MOVO X15, 64(BP) + PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 + PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 + PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 + PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 + MOVO D3, tmpStore // Load - xor - store - MOVOU (SI), X15 - PXOR X15, X0 - MOVOU 16(SI), X15 - PXOR X15, X3 - MOVOU 32(SI), X15 - PXOR X15, X6 - MOVOU 48(SI), X15 - PXOR X15, X9 - MOVOU X0, (DI) - MOVOU X3, 16(DI) - MOVOU X6, 32(DI) - MOVOU X9, 48(DI) - MOVO 64(BP), X15 - MOVOU 64(SI), X0 - MOVOU 80(SI), X3 - MOVOU 96(SI), X6 - MOVOU 112(SI), X9 - PXOR X0, X1 - PXOR X3, X4 - PXOR X6, X7 - PXOR X9, X10 - MOVOU X1, 64(DI) - MOVOU X4, 80(DI) - MOVOU X7, 96(DI) - MOVOU X10, 112(DI) - MOVOU 128(SI), X0 - MOVOU 144(SI), X3 - MOVOU 160(SI), X6 - MOVOU 176(SI), X9 - PXOR X0, X2 - PXOR X3, X5 - PXOR X6, X8 - PXOR X9, X11 - MOVOU X2, 128(DI) - MOVOU X5, 144(DI) - MOVOU X8, 160(DI) - MOVOU X11, 176(DI) - ADDQ $0xc0, SI - MOVQ $0x000000c0, CX - SUBQ $0xc0, BX - MOVO X12, X1 - MOVO X13, X4 - MOVO X14, X7 - MOVO X15, X10 - CMPQ BX, $0x40 + MOVOU (0*16)(inp), D3; PXOR D3, A0 + MOVOU (1*16)(inp), D3; PXOR D3, B0 + MOVOU (2*16)(inp), D3; PXOR D3, C0 + MOVOU (3*16)(inp), D3; PXOR D3, D0 + MOVOU A0, (0*16)(oup) + MOVOU B0, (1*16)(oup) + MOVOU C0, (2*16)(oup) + MOVOU D0, (3*16)(oup) + MOVO tmpStore, D3 + + MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 + PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 + MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) + MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0 + PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 + MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup) + ADDQ $192, inp + MOVQ $192, itr1 + SUBQ $192, inl + MOVO A3, A1 + MOVO B3, B1 + MOVO C3, C1 + MOVO D3, D1 + CMPQ inl, $64 JBE sealSSE128SealHash - MOVOU (SI), X0 - MOVOU 16(SI), X3 - MOVOU 32(SI), X6 - MOVOU 48(SI), X9 - PXOR X0, X12 - PXOR X3, X13 - PXOR X6, X14 - PXOR X9, X15 - MOVOU X12, 192(DI) - MOVOU X13, 208(DI) - MOVOU X14, 224(DI) - MOVOU X15, 240(DI) - LEAQ 64(SI), SI - SUBQ $0x40, BX - MOVQ $0x00000006, CX - MOVQ $0x00000004, R9 - CMPQ BX, $0xc0 + MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 + PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3 + MOVOU A3, (12*16)(oup); MOVOU B3, (13*16)(oup); MOVOU C3, (14*16)(oup); MOVOU D3, (15*16)(oup) + LEAQ 64(inp), inp + SUBQ $64, inl + MOVQ $6, itr1 + MOVQ $4, itr2 + CMPQ inl, $192 JG sealSSEMainLoop - MOVQ BX, CX - TESTQ BX, BX + + MOVQ inl, itr1 + TESTQ inl, inl JE sealSSE128SealHash - MOVQ $0x00000006, CX - CMPQ BX, $0x40 + MOVQ $6, itr1 + CMPQ inl, $64 JBE sealSSETail64 - CMPQ BX, $0x80 + CMPQ inl, $128 JBE sealSSETail128 JMP sealSSETail192 +// ---------------------------------------------------------------------------- +// Special optimization for the last 64 bytes of plaintext sealSSETail64: - MOVO ·chacha20Constants<>+0(SB), X1 - MOVO 32(BP), X4 - MOVO 48(BP), X7 - MOVO 128(BP), X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X10, 80(BP) + // Need to encrypt up to 64 bytes - prepare single block, hash 192 or 256 bytes + MOVO ·chacha20Constants<>(SB), A1 + MOVO state1Store, B1 + MOVO state2Store, C1 + MOVO ctr3Store, D1 + PADDL ·sseIncMask<>(SB), D1 + MOVO D1, ctr0Store sealSSETail64LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + // Perform ChaCha rounds, while hashing the previously encrypted ciphertext + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealSSETail64LoopB: - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X13) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X13 - PSLLL $0x0c, X13 - PSRLL $0x14, X4 - PXOR X13, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X13) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X13 - PSLLL $0x07, X13 - PSRLL $0x19, X4 - PXOR X13, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X13) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X13 - PSLLL $0x0c, X13 - PSRLL $0x14, X4 - PXOR X13, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X13) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X13 - PSLLL $0x07, X13 - PSRLL $0x19, X4 - PXOR X13, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI - DECQ CX - JG sealSSETail64LoopA - DECQ R9 + chachaQR(A1, B1, C1, D1, T1) + shiftB1Left; shiftC1Left; shiftD1Left + chachaQR(A1, B1, C1, D1, T1) + shiftB1Right; shiftC1Right; shiftD1Right + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup + + DECQ itr1 + JG sealSSETail64LoopA + + DECQ itr2 JGE sealSSETail64LoopB - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL 32(BP), X4 - PADDL 48(BP), X7 - PADDL 80(BP), X10 - JMP sealSSE128Seal + PADDL ·chacha20Constants<>(SB), A1 + PADDL state1Store, B1 + PADDL state2Store, C1 + PADDL ctr0Store, D1 + JMP sealSSE128Seal + +// ---------------------------------------------------------------------------- +// Special optimization for the last 128 bytes of plaintext sealSSETail128: - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X9, 80(BP) - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X10, 96(BP) + // Need to encrypt up to 128 bytes - prepare two blocks, hash 192 or 256 bytes + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store sealSSETail128LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + // Perform ChaCha rounds, while hashing the previously encrypted ciphertext + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealSSETail128LoopB: - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - DECQ CX - JG sealSSETail128LoopA - DECQ R9 - JGE sealSSETail128LoopB - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL 32(BP), X3 - PADDL 32(BP), X4 - PADDL 48(BP), X6 - PADDL 48(BP), X7 - PADDL 80(BP), X9 - PADDL 96(BP), X10 - MOVOU (SI), X12 - MOVOU 16(SI), X13 - MOVOU 32(SI), X14 - MOVOU 48(SI), X15 - PXOR X12, X0 - PXOR X13, X3 - PXOR X14, X6 - PXOR X15, X9 - MOVOU X0, (DI) - MOVOU X3, 16(DI) - MOVOU X6, 32(DI) - MOVOU X9, 48(DI) - MOVQ $0x00000040, CX - LEAQ 64(SI), SI - SUBQ $0x40, BX - JMP sealSSE128SealHash - + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) + shiftB0Left; shiftC0Left; shiftD0Left + shiftB1Left; shiftC1Left; shiftD1Left + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) + shiftB0Right; shiftC0Right; shiftD0Right + shiftB1Right; shiftC1Right; shiftD1Right + + DECQ itr1 + JG sealSSETail128LoopA + + DECQ itr2 + JGE sealSSETail128LoopB + + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1 + PADDL state1Store, B0; PADDL state1Store, B1 + PADDL state2Store, C0; PADDL state2Store, C1 + PADDL ctr0Store, D0; PADDL ctr1Store, D1 + + MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 + PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0 + MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup) + + MOVQ $64, itr1 + LEAQ 64(inp), inp + SUBQ $64, inl + + JMP sealSSE128SealHash + +// ---------------------------------------------------------------------------- +// Special optimization for the last 192 bytes of plaintext sealSSETail192: - MOVO ·chacha20Constants<>+0(SB), X0 - MOVO 32(BP), X3 - MOVO 48(BP), X6 - MOVO 128(BP), X9 - PADDL ·sseIncMask<>+0(SB), X9 - MOVO X9, 80(BP) - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X10, 96(BP) - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X11, 112(BP) + // Need to encrypt up to 192 bytes - prepare three blocks, hash 192 or 256 bytes + MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr2Store sealSSETail192LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + // Perform ChaCha rounds, while hashing the previously encrypted ciphertext + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealSSETail192LoopB: - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - DECQ CX - JG sealSSETail192LoopA - DECQ R9 - JGE sealSSETail192LoopB - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL ·chacha20Constants<>+0(SB), X2 - PADDL 32(BP), X3 - PADDL 32(BP), X4 - PADDL 32(BP), X5 - PADDL 48(BP), X6 - PADDL 48(BP), X7 - PADDL 48(BP), X8 - PADDL 80(BP), X9 - PADDL 96(BP), X10 - PADDL 112(BP), X11 - MOVOU (SI), X12 - MOVOU 16(SI), X13 - MOVOU 32(SI), X14 - MOVOU 48(SI), X15 - PXOR X12, X0 - PXOR X13, X3 - PXOR X14, X6 - PXOR X15, X9 - MOVOU X0, (DI) - MOVOU X3, 16(DI) - MOVOU X6, 32(DI) - MOVOU X9, 48(DI) - MOVOU 64(SI), X12 - MOVOU 80(SI), X13 - MOVOU 96(SI), X14 - MOVOU 112(SI), X15 - PXOR X12, X1 - PXOR X13, X4 - PXOR X14, X7 - PXOR X15, X10 - MOVOU X1, 64(DI) - MOVOU X4, 80(DI) - MOVOU X7, 96(DI) - MOVOU X10, 112(DI) - MOVO X2, X1 - MOVO X5, X4 - MOVO X8, X7 - MOVO X11, X10 - MOVQ $0x00000080, CX - LEAQ 128(SI), SI - SUBQ $0x80, BX - JMP sealSSE128SealHash - + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Left; shiftC0Left; shiftD0Left + shiftB1Left; shiftC1Left; shiftD1Left + shiftB2Left; shiftC2Left; shiftD2Left + + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup + + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Right; shiftC0Right; shiftD0Right + shiftB1Right; shiftC1Right; shiftD1Right + shiftB2Right; shiftC2Right; shiftD2Right + + DECQ itr1 + JG sealSSETail192LoopA + + DECQ itr2 + JGE sealSSETail192LoopB + + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 + PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2 + PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2 + PADDL ctr0Store, D0; PADDL ctr1Store, D1; PADDL ctr2Store, D2 + + MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 + PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0 + MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup) + MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3 + PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 + MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) + + MOVO A2, A1 + MOVO B2, B1 + MOVO C2, C1 + MOVO D2, D1 + MOVQ $128, itr1 + LEAQ 128(inp), inp + SUBQ $128, inl + + JMP sealSSE128SealHash + +// ---------------------------------------------------------------------------- +// Special seal optimization for buffers smaller than 129 bytes sealSSE128: - MOVOU ·chacha20Constants<>+0(SB), X0 - MOVOU 16(R8), X3 - MOVOU 32(R8), X6 - MOVOU 48(R8), X9 - MOVO X0, X1 - MOVO X3, X4 - MOVO X6, X7 - MOVO X9, X10 - PADDL ·sseIncMask<>+0(SB), X10 - MOVO X1, X2 - MOVO X4, X5 - MOVO X7, X8 - MOVO X10, X11 - PADDL ·sseIncMask<>+0(SB), X11 - MOVO X3, X13 - MOVO X6, X14 - MOVO X10, X15 - MOVQ $0x0000000a, R9 + // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks + MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0 + MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 + MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 + MOVO B0, T1; MOVO C0, T2; MOVO D1, T3 + MOVQ $10, itr2 sealSSE128InnerCipherLoop: - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x04 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x0c - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - PADDD X3, X0 - PXOR X0, X9 - ROL16(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X3 - PXOR X12, X3 - PADDD X3, X0 - PXOR X0, X9 - ROL8(X9, X12) - PADDD X9, X6 - PXOR X6, X3 - MOVO X3, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X3 - PXOR X12, X3 - PADDD X4, X1 - PXOR X1, X10 - ROL16(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X4 - PXOR X12, X4 - PADDD X4, X1 - PXOR X1, X10 - ROL8(X10, X12) - PADDD X10, X7 - PXOR X7, X4 - MOVO X4, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X4 - PXOR X12, X4 - PADDD X5, X2 - PXOR X2, X11 - ROL16(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x0c, X12 - PSRLL $0x14, X5 - PXOR X12, X5 - PADDD X5, X2 - PXOR X2, X11 - ROL8(X11, X12) - PADDD X11, X8 - PXOR X8, X5 - MOVO X5, X12 - PSLLL $0x07, X12 - PSRLL $0x19, X5 - PXOR X12, X5 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xe4 - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xed - BYTE $0x0c - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xf6 - BYTE $0x08 - BYTE $0x66 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xff - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc0 - BYTE $0x08 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xc9 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xd2 - BYTE $0x04 - BYTE $0x66 - BYTE $0x45 - BYTE $0x0f - BYTE $0x3a - BYTE $0x0f - BYTE $0xdb - BYTE $0x04 - DECQ R9 - JNE sealSSE128InnerCipherLoop + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Left; shiftB1Left; shiftB2Left + shiftC0Left; shiftC1Left; shiftC2Left + shiftD0Left; shiftD1Left; shiftD2Left + chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) + shiftB0Right; shiftB1Right; shiftB2Right + shiftC0Right; shiftC1Right; shiftC2Right + shiftD0Right; shiftD1Right; shiftD2Right + DECQ itr2 + JNE sealSSE128InnerCipherLoop // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>+0(SB), X0 - PADDL ·chacha20Constants<>+0(SB), X1 - PADDL ·chacha20Constants<>+0(SB), X2 - PADDL X13, X3 - PADDL X13, X4 - PADDL X13, X5 - PADDL X14, X7 - PADDL X14, X8 - PADDL X15, X10 - PADDL ·sseIncMask<>+0(SB), X15 - PADDL X15, X11 - PAND ·polyClampMask<>+0(SB), X0 - MOVOU X0, (BP) - MOVOU X3, 16(BP) + PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 + PADDL T1, B0; PADDL T1, B1; PADDL T1, B2 + PADDL T2, C1; PADDL T2, C2 + PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2 + PAND ·polyClampMask<>(SB), A0 + MOVOU A0, rStore + MOVOU B0, sStore // Hash - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) - XORQ CX, CX + XORQ itr1, itr1 sealSSE128SealHash: - CMPQ CX, $0x10 - JB sealSSE128Seal - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - SUBQ $0x10, CX - ADDQ $0x10, DI - JMP sealSSE128SealHash + // itr1 holds the number of bytes encrypted but not yet hashed + CMPQ itr1, $16 + JB sealSSE128Seal + polyAdd(0(oup)) + polyMul + + SUBQ $16, itr1 + ADDQ $16, oup + + JMP sealSSE128SealHash sealSSE128Seal: - CMPQ BX, $0x10 + CMPQ inl, $16 JB sealSSETail - SUBQ $0x10, BX + SUBQ $16, inl // Load for decryption - MOVOU (SI), X12 - PXOR X12, X1 - MOVOU X1, (DI) - LEAQ 16(SI), SI - LEAQ 16(DI), DI + MOVOU (inp), T0 + PXOR T0, A1 + MOVOU A1, (oup) + LEAQ (1*16)(inp), inp + LEAQ (1*16)(oup), oup // Extract for hashing - MOVQ X1, R13 - PSRLDQ $0x08, X1 - MOVQ X1, R14 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + MOVQ A1, t0 + PSRLDQ $8, A1 + MOVQ A1, t1 + ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 + polyMul // Shift the stream "left" - MOVO X4, X1 - MOVO X7, X4 - MOVO X10, X7 - MOVO X2, X10 - MOVO X5, X2 - MOVO X8, X5 - MOVO X11, X8 + MOVO B1, A1 + MOVO C1, B1 + MOVO D1, C1 + MOVO A2, D1 + MOVO B2, A2 + MOVO C2, B2 + MOVO D2, C2 JMP sealSSE128Seal sealSSETail: - TESTQ BX, BX + TESTQ inl, inl JE sealSSEFinalize // We can only load the PT one byte at a time to avoid read after end of buffer - MOVQ BX, R9 - SHLQ $0x04, R9 - LEAQ ·andMask<>+0(SB), R13 - MOVQ BX, CX - LEAQ -1(SI)(BX*1), SI - XORQ R15, R15 - XORQ R8, R8 + MOVQ inl, itr2 + SHLQ $4, itr2 + LEAQ ·andMask<>(SB), t0 + MOVQ inl, itr1 + LEAQ -1(inp)(inl*1), inp + XORQ t2, t2 + XORQ t3, t3 XORQ AX, AX sealSSETailLoadLoop: - SHLQ $0x08, R15, R8 - SHLQ $0x08, R15 - MOVB (SI), AX - XORQ AX, R15 - LEAQ -1(SI), SI - DECQ CX + SHLQ $8, t2, t3 + SHLQ $8, t2 + MOVB (inp), AX + XORQ AX, t2 + LEAQ -1(inp), inp + DECQ itr1 JNE sealSSETailLoadLoop - MOVQ R15, 64(BP) - MOVQ R8, 72(BP) - PXOR 64(BP), X1 - MOVOU X1, (DI) - MOVOU -16(R13)(R9*1), X12 - PAND X12, X1 - MOVQ X1, R13 - PSRLDQ $0x08, X1 - MOVQ X1, R14 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ BX, DI + MOVQ t2, 0+tmpStore + MOVQ t3, 8+tmpStore + PXOR 0+tmpStore, A1 + MOVOU A1, (oup) + MOVOU -16(t0)(itr2*1), T0 + PAND T0, A1 + MOVQ A1, t0 + PSRLDQ $8, A1 + MOVQ A1, t1 + ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 + polyMul + + ADDQ inl, oup sealSSEFinalize: // Hash in the buffer lengths - ADDQ ad_len+80(FP), R10 - ADCQ src_len+56(FP), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + ADDQ ad_len+80(FP), acc0 + ADCQ src_len+56(FP), acc1 + ADCQ $1, acc2 + polyMul // Final reduce - MOVQ R10, R13 - MOVQ R11, R14 - MOVQ R12, R15 - SUBQ $-5, R10 - SBBQ $-1, R11 - SBBQ $0x03, R12 - CMOVQCS R13, R10 - CMOVQCS R14, R11 - CMOVQCS R15, R12 + MOVQ acc0, t0 + MOVQ acc1, t1 + MOVQ acc2, t2 + SUBQ $-5, acc0 + SBBQ $-1, acc1 + SBBQ $3, acc2 + CMOVQCS t0, acc0 + CMOVQCS t1, acc1 + CMOVQCS t2, acc2 // Add in the "s" part of the key - ADDQ 16(BP), R10 - ADCQ 24(BP), R11 + ADDQ 0+sStore, acc0 + ADCQ 8+sStore, acc1 // Finally store the tag at the end of the message - MOVQ R10, (DI) - MOVQ R11, 8(DI) + MOVQ acc0, (0*8)(oup) + MOVQ acc1, (1*8)(oup) RET +// ---------------------------------------------------------------------------- +// ------------------------- AVX2 Code ---------------------------------------- chacha20Poly1305Seal_AVX2: VZEROUPPER - VMOVDQU ·chacha20Constants<>+0(SB), Y0 - BYTE $0xc4 - BYTE $0x42 - BYTE $0x7d - BYTE $0x5a - BYTE $0x70 - BYTE $0x10 - BYTE $0xc4 - BYTE $0x42 - BYTE $0x7d - BYTE $0x5a - BYTE $0x60 - BYTE $0x20 - BYTE $0xc4 - BYTE $0xc2 - BYTE $0x7d - BYTE $0x5a - BYTE $0x60 - BYTE $0x30 - VPADDD ·avx2InitMask<>+0(SB), Y4, Y4 + VMOVDQU ·chacha20Constants<>(SB), AA0 + BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14 + BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12 + BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4 + VPADDD ·avx2InitMask<>(SB), DD0, DD0 // Special optimizations, for very short buffers - CMPQ BX, $0x000000c0 - JBE seal192AVX2 - CMPQ BX, $0x00000140 - JBE seal320AVX2 + CMPQ inl, $192 + JBE seal192AVX2 // 33% faster + CMPQ inl, $320 + JBE seal320AVX2 // 17% faster // For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA Y14, 32(BP) - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA Y12, 64(BP) - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y4, 96(BP) - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VMOVDQA Y1, 128(BP) - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) - MOVQ $0x0000000a, R9 + VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3; VMOVDQA BB0, state1StoreAVX2 + VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3; VMOVDQA CC0, state2StoreAVX2 + VPADDD ·avx2IncMask<>(SB), DD0, DD1; VMOVDQA DD0, ctr0StoreAVX2 + VPADDD ·avx2IncMask<>(SB), DD1, DD2; VMOVDQA DD1, ctr1StoreAVX2 + VPADDD ·avx2IncMask<>(SB), DD2, DD3; VMOVDQA DD2, ctr2StoreAVX2 + VMOVDQA DD3, ctr3StoreAVX2 + MOVQ $10, itr2 sealAVX2IntroLoop: - VMOVDQA Y15, 224(BP) - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VMOVDQA 224(BP), Y15 - VMOVDQA Y13, 224(BP) - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x0c, Y11, Y13 - VPSRLD $0x14, Y11, Y11 - VPXOR Y13, Y11, Y11 - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x07, Y11, Y13 - VPSRLD $0x19, Y11, Y11 - VPXOR Y13, Y11, Y11 - VMOVDQA 224(BP), Y13 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y3, Y3, Y3 - VMOVDQA Y15, 224(BP) - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VMOVDQA 224(BP), Y15 - VMOVDQA Y13, 224(BP) - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x0c, Y11, Y13 - VPSRLD $0x14, Y11, Y11 - VPXOR Y13, Y11, Y11 - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x07, Y11, Y13 - VPSRLD $0x19, Y11, Y11 - VPXOR Y13, Y11, Y11 - VMOVDQA 224(BP), Y13 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y3, Y3, Y3 - DECQ R9 - JNE sealAVX2IntroLoop - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD ·chacha20Constants<>+0(SB), Y7, Y7 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 32(BP), Y11, Y11 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 64(BP), Y15, Y15 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPADDD 192(BP), Y3, Y3 - VPERM2I128 $0x13, Y12, Y4, Y12 - VPERM2I128 $0x02, Y0, Y14, Y4 - VPERM2I128 $0x13, Y0, Y14, Y0 + VMOVDQA CC3, tmpStoreAVX2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) + VMOVDQA tmpStoreAVX2, CC3 + VMOVDQA CC1, tmpStoreAVX2 + chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) + VMOVDQA tmpStoreAVX2, CC1 + + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 + VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1 + VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2 + VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3 + + VMOVDQA CC3, tmpStoreAVX2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) + VMOVDQA tmpStoreAVX2, CC3 + VMOVDQA CC1, tmpStoreAVX2 + chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) + VMOVDQA tmpStoreAVX2, CC1 + + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 + VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1 + VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2 + VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3 + DECQ itr2 + JNE sealAVX2IntroLoop + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 + + VPERM2I128 $0x13, CC0, DD0, CC0 // Stream bytes 96 - 127 + VPERM2I128 $0x02, AA0, BB0, DD0 // The Poly1305 key + VPERM2I128 $0x13, AA0, BB0, AA0 // Stream bytes 64 - 95 // Clamp and store poly key - VPAND ·polyClampMask<>+0(SB), Y4, Y4 - VMOVDQA Y4, (BP) + VPAND ·polyClampMask<>(SB), DD0, DD0 + VMOVDQA DD0, rsStoreAVX2 // Hash AD - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) // Can store at least 320 bytes - VPXOR (SI), Y0, Y0 - VPXOR 32(SI), Y12, Y12 - VMOVDQU Y0, (DI) - VMOVDQU Y12, 32(DI) - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR 64(SI), Y0, Y0 - VPXOR 96(SI), Y14, Y14 - VPXOR 128(SI), Y12, Y12 - VPXOR 160(SI), Y4, Y4 - VMOVDQU Y0, 64(DI) - VMOVDQU Y14, 96(DI) - VMOVDQU Y12, 128(DI) - VMOVDQU Y4, 160(DI) - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - VPXOR 192(SI), Y0, Y0 - VPXOR 224(SI), Y14, Y14 - VPXOR 256(SI), Y12, Y12 - VPXOR 288(SI), Y4, Y4 - VMOVDQU Y0, 192(DI) - VMOVDQU Y14, 224(DI) - VMOVDQU Y12, 256(DI) - VMOVDQU Y4, 288(DI) - MOVQ $0x00000140, CX - SUBQ $0x00000140, BX - LEAQ 320(SI), SI - VPERM2I128 $0x02, Y7, Y11, Y0 - VPERM2I128 $0x02, Y15, Y3, Y14 - VPERM2I128 $0x13, Y7, Y11, Y12 - VPERM2I128 $0x13, Y15, Y3, Y4 - CMPQ BX, $0x80 + VPXOR (0*32)(inp), AA0, AA0 + VPXOR (1*32)(inp), CC0, CC0 + VMOVDQU AA0, (0*32)(oup) + VMOVDQU CC0, (1*32)(oup) + + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 + VPXOR (2*32)(inp), AA0, AA0; VPXOR (3*32)(inp), BB0, BB0; VPXOR (4*32)(inp), CC0, CC0; VPXOR (5*32)(inp), DD0, DD0 + VMOVDQU AA0, (2*32)(oup); VMOVDQU BB0, (3*32)(oup); VMOVDQU CC0, (4*32)(oup); VMOVDQU DD0, (5*32)(oup) + VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 + VPXOR (6*32)(inp), AA0, AA0; VPXOR (7*32)(inp), BB0, BB0; VPXOR (8*32)(inp), CC0, CC0; VPXOR (9*32)(inp), DD0, DD0 + VMOVDQU AA0, (6*32)(oup); VMOVDQU BB0, (7*32)(oup); VMOVDQU CC0, (8*32)(oup); VMOVDQU DD0, (9*32)(oup) + + MOVQ $320, itr1 + SUBQ $320, inl + LEAQ 320(inp), inp + + VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, CC3, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, CC3, DD3, DD0 + CMPQ inl, $128 JBE sealAVX2SealHash - VPXOR (SI), Y0, Y0 - VPXOR 32(SI), Y14, Y14 - VPXOR 64(SI), Y12, Y12 - VPXOR 96(SI), Y4, Y4 - VMOVDQU Y0, 320(DI) - VMOVDQU Y14, 352(DI) - VMOVDQU Y12, 384(DI) - VMOVDQU Y4, 416(DI) - SUBQ $0x80, BX - LEAQ 128(SI), SI - MOVQ $0x00000008, CX - MOVQ $0x00000002, R9 - CMPQ BX, $0x80 - JBE sealAVX2Tail128 - CMPQ BX, $0x00000100 - JBE sealAVX2Tail256 - CMPQ BX, $0x00000180 - JBE sealAVX2Tail384 - CMPQ BX, $0x00000200 - JBE sealAVX2Tail512 + + VPXOR (0*32)(inp), AA0, AA0; VPXOR (1*32)(inp), BB0, BB0; VPXOR (2*32)(inp), CC0, CC0; VPXOR (3*32)(inp), DD0, DD0 + VMOVDQU AA0, (10*32)(oup); VMOVDQU BB0, (11*32)(oup); VMOVDQU CC0, (12*32)(oup); VMOVDQU DD0, (13*32)(oup) + SUBQ $128, inl + LEAQ 128(inp), inp + + MOVQ $8, itr1 + MOVQ $2, itr2 + + CMPQ inl, $128 + JBE sealAVX2Tail128 + CMPQ inl, $256 + JBE sealAVX2Tail256 + CMPQ inl, $384 + JBE sealAVX2Tail384 + CMPQ inl, $512 + JBE sealAVX2Tail512 // We have 448 bytes to hash, but main loop hashes 512 bytes at a time - perform some rounds, before the main loop - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) - VMOVDQA Y15, 224(BP) - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VMOVDQA 224(BP), Y15 - VMOVDQA Y13, 224(BP) - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x0c, Y11, Y13 - VPSRLD $0x14, Y11, Y11 - VPXOR Y13, Y11, Y11 - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x07, Y11, Y13 - VPSRLD $0x19, Y11, Y11 - VPXOR Y13, Y11, Y11 - VMOVDQA 224(BP), Y13 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y3, Y3, Y3 - VMOVDQA Y15, 224(BP) - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VMOVDQA 224(BP), Y15 - VMOVDQA Y13, 224(BP) - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x0c, Y11, Y13 - VPSRLD $0x14, Y11, Y11 - VPXOR Y13, Y11, Y11 - VPADDD Y11, Y7, Y7 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y3, Y15, Y15 - VPXOR Y15, Y11, Y11 - VPSLLD $0x07, Y11, Y13 - VPSRLD $0x19, Y11, Y11 - VPXOR Y13, Y11, Y11 - VMOVDQA 224(BP), Y13 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y3, Y3, Y3 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - SUBQ $0x10, DI - MOVQ $0x00000009, CX - JMP sealAVX2InternalLoopStart + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 + VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 + + VMOVDQA CC3, tmpStoreAVX2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) + VMOVDQA tmpStoreAVX2, CC3 + VMOVDQA CC1, tmpStoreAVX2 + chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) + VMOVDQA tmpStoreAVX2, CC1 + + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 + VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1 + VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2 + VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3 + + VMOVDQA CC3, tmpStoreAVX2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) + VMOVDQA tmpStoreAVX2, CC3 + VMOVDQA CC1, tmpStoreAVX2 + chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) + VMOVDQA tmpStoreAVX2, CC1 + + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 + VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1 + VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2 + VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + + SUBQ $16, oup // Adjust the pointer + MOVQ $9, itr1 + JMP sealAVX2InternalLoopStart sealAVX2MainLoop: - VMOVDQU ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) - MOVQ $0x0000000a, CX + // Load state, increment counter blocks, store the incremented counters + VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 + VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 + VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 + MOVQ $10, itr1 sealAVX2InternalLoop: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 + polyAdd(0*8(oup)) + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + polyMulStage1_AVX2 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + polyMulStage2_AVX2 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyMulStage3_AVX2 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulReduceStage sealAVX2InternalLoopStart: - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x0c, Y3, Y3, Y3 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - ADDQ 32(DI), R10 - ADCQ 40(DI), R11 - ADCQ $0x01, R12 - LEAQ 48(DI), DI - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x04, Y3, Y3, Y3 - DECQ CX + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + polyAdd(2*8(oup)) + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + polyMulStage1_AVX2 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulStage2_AVX2 + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + polyMulStage3_AVX2 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + polyMulReduceStage + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyAdd(4*8(oup)) + LEAQ (6*8)(oup), oup + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulStage1_AVX2 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + polyMulStage2_AVX2 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + polyMulStage3_AVX2 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyMulReduceStage + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 + DECQ itr1 JNE sealAVX2InternalLoop - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD ·chacha20Constants<>+0(SB), Y7, Y7 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 32(BP), Y11, Y11 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 64(BP), Y15, Y15 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPADDD 192(BP), Y3, Y3 - VMOVDQA Y15, 224(BP) + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 + VMOVDQA CC3, tmpStoreAVX2 // We only hashed 480 of the 512 bytes available - hash the remaining 32 here - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - VPERM2I128 $0x02, Y0, Y14, Y15 - VPERM2I128 $0x13, Y0, Y14, Y14 - VPERM2I128 $0x02, Y12, Y4, Y0 - VPERM2I128 $0x13, Y12, Y4, Y12 - VPXOR (SI), Y15, Y15 - VPXOR 32(SI), Y0, Y0 - VPXOR 64(SI), Y14, Y14 - VPXOR 96(SI), Y12, Y12 - VMOVDQU Y15, (DI) - VMOVDQU Y0, 32(DI) - VMOVDQU Y14, 64(DI) - VMOVDQU Y12, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR 128(SI), Y0, Y0 - VPXOR 160(SI), Y14, Y14 - VPXOR 192(SI), Y12, Y12 - VPXOR 224(SI), Y4, Y4 - VMOVDQU Y0, 128(DI) - VMOVDQU Y14, 160(DI) - VMOVDQU Y12, 192(DI) - VMOVDQU Y4, 224(DI) + polyAdd(0*8(oup)) + polyMulAVX2 + LEAQ (4*8)(oup), oup + VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 + VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 + VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) + VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 + VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 + VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) // and here - ADDQ -16(DI), R10 - ADCQ -8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - VPXOR 256(SI), Y0, Y0 - VPXOR 288(SI), Y14, Y14 - VPXOR 320(SI), Y12, Y12 - VPXOR 352(SI), Y4, Y4 - VMOVDQU Y0, 256(DI) - VMOVDQU Y14, 288(DI) - VMOVDQU Y12, 320(DI) - VMOVDQU Y4, 352(DI) - VPERM2I128 $0x02, Y7, Y11, Y0 - VPERM2I128 $0x02, 224(BP), Y3, Y14 - VPERM2I128 $0x13, Y7, Y11, Y12 - VPERM2I128 $0x13, 224(BP), Y3, Y4 - VPXOR 384(SI), Y0, Y0 - VPXOR 416(SI), Y14, Y14 - VPXOR 448(SI), Y12, Y12 - VPXOR 480(SI), Y4, Y4 - VMOVDQU Y0, 384(DI) - VMOVDQU Y14, 416(DI) - VMOVDQU Y12, 448(DI) - VMOVDQU Y4, 480(DI) - LEAQ 512(SI), SI - SUBQ $0x00000200, BX - CMPQ BX, $0x00000200 + polyAdd(-2*8(oup)) + polyMulAVX2 + VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 + VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 + VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) + VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 + VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0 + VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup) + LEAQ (32*16)(inp), inp + SUBQ $(32*16), inl + CMPQ inl, $512 JG sealAVX2MainLoop // Tail can only hash 480 bytes - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - MOVQ $0x0000000a, CX - MOVQ $0x00000000, R9 - CMPQ BX, $0x80 - JBE sealAVX2Tail128 - CMPQ BX, $0x00000100 - JBE sealAVX2Tail256 - CMPQ BX, $0x00000180 - JBE sealAVX2Tail384 - JMP sealAVX2Tail512 - + polyAdd(0*8(oup)) + polyMulAVX2 + polyAdd(2*8(oup)) + polyMulAVX2 + LEAQ 32(oup), oup + + MOVQ $10, itr1 + MOVQ $0, itr2 + CMPQ inl, $128 + JBE sealAVX2Tail128 + CMPQ inl, $256 + JBE sealAVX2Tail256 + CMPQ inl, $384 + JBE sealAVX2Tail384 + JMP sealAVX2Tail512 + +// ---------------------------------------------------------------------------- +// Special optimization for buffers smaller than 193 bytes seal192AVX2: - VMOVDQA Y0, Y5 - VMOVDQA Y14, Y9 - VMOVDQA Y12, Y13 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y0, Y6 - VMOVDQA Y14, Y10 - VMOVDQA Y12, Y8 - VMOVDQA Y4, Y2 - VMOVDQA Y1, Y15 - MOVQ $0x0000000a, R9 + // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks + VMOVDQA AA0, AA1 + VMOVDQA BB0, BB1 + VMOVDQA CC0, CC1 + VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA AA0, AA2 + VMOVDQA BB0, BB2 + VMOVDQA CC0, CC2 + VMOVDQA DD0, DD2 + VMOVDQA DD1, TT3 + MOVQ $10, itr2 sealAVX2192InnerCipherLoop: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - DECQ R9 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 + DECQ itr2 JNE sealAVX2192InnerCipherLoop - VPADDD Y6, Y0, Y0 - VPADDD Y6, Y5, Y5 - VPADDD Y10, Y14, Y14 - VPADDD Y10, Y9, Y9 - VPADDD Y8, Y12, Y12 - VPADDD Y8, Y13, Y13 - VPADDD Y2, Y4, Y4 - VPADDD Y15, Y1, Y1 - VPERM2I128 $0x02, Y0, Y14, Y3 + VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1 + VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1 + VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1 + VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1 + VPERM2I128 $0x02, AA0, BB0, TT0 // Clamp and store poly key - VPAND ·polyClampMask<>+0(SB), Y3, Y3 - VMOVDQA Y3, (BP) + VPAND ·polyClampMask<>(SB), TT0, TT0 + VMOVDQA TT0, rsStoreAVX2 // Stream for up to 192 bytes - VPERM2I128 $0x13, Y0, Y14, Y0 - VPERM2I128 $0x13, Y12, Y4, Y14 - VPERM2I128 $0x02, Y5, Y9, Y12 - VPERM2I128 $0x02, Y13, Y1, Y4 - VPERM2I128 $0x13, Y5, Y9, Y5 - VPERM2I128 $0x13, Y13, Y1, Y9 + VPERM2I128 $0x13, AA0, BB0, AA0 + VPERM2I128 $0x13, CC0, DD0, BB0 + VPERM2I128 $0x02, AA1, BB1, CC0 + VPERM2I128 $0x02, CC1, DD1, DD0 + VPERM2I128 $0x13, AA1, BB1, AA1 + VPERM2I128 $0x13, CC1, DD1, BB1 sealAVX2ShortSeal: // Hash aad - MOVQ ad_len+80(FP), R9 + MOVQ ad_len+80(FP), itr2 CALL polyHashADInternal<>(SB) - XORQ CX, CX + XORQ itr1, itr1 sealAVX2SealHash: // itr1 holds the number of bytes encrypted but not yet hashed - CMPQ CX, $0x10 - JB sealAVX2ShortSealLoop - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - SUBQ $0x10, CX - ADDQ $0x10, DI - JMP sealAVX2SealHash + CMPQ itr1, $16 + JB sealAVX2ShortSealLoop + polyAdd(0(oup)) + polyMul + SUBQ $16, itr1 + ADDQ $16, oup + JMP sealAVX2SealHash sealAVX2ShortSealLoop: - CMPQ BX, $0x20 + CMPQ inl, $32 JB sealAVX2ShortTail32 - SUBQ $0x20, BX + SUBQ $32, inl // Load for encryption - VPXOR (SI), Y0, Y0 - VMOVDQU Y0, (DI) - LEAQ 32(SI), SI + VPXOR (inp), AA0, AA0 + VMOVDQU AA0, (oup) + LEAQ (1*32)(inp), inp // Now can hash - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI + polyAdd(0*8(oup)) + polyMulAVX2 + polyAdd(2*8(oup)) + polyMulAVX2 + LEAQ (1*32)(oup), oup // Shift stream left - VMOVDQA Y14, Y0 - VMOVDQA Y12, Y14 - VMOVDQA Y4, Y12 - VMOVDQA Y5, Y4 - VMOVDQA Y9, Y5 - VMOVDQA Y13, Y9 - VMOVDQA Y1, Y13 - VMOVDQA Y6, Y1 - VMOVDQA Y10, Y6 + VMOVDQA BB0, AA0 + VMOVDQA CC0, BB0 + VMOVDQA DD0, CC0 + VMOVDQA AA1, DD0 + VMOVDQA BB1, AA1 + VMOVDQA CC1, BB1 + VMOVDQA DD1, CC1 + VMOVDQA AA2, DD1 + VMOVDQA BB2, AA2 JMP sealAVX2ShortSealLoop sealAVX2ShortTail32: - CMPQ BX, $0x10 - VMOVDQA X0, X1 + CMPQ inl, $16 + VMOVDQA A0, A1 JB sealAVX2ShortDone - SUBQ $0x10, BX + + SUBQ $16, inl // Load for encryption - VPXOR (SI), X0, X12 - VMOVDQU X12, (DI) - LEAQ 16(SI), SI + VPXOR (inp), A0, T0 + VMOVDQU T0, (oup) + LEAQ (1*16)(inp), inp // Hash - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI - VPERM2I128 $0x11, Y0, Y0, Y0 - VMOVDQA X0, X1 + polyAdd(0*8(oup)) + polyMulAVX2 + LEAQ (1*16)(oup), oup + VPERM2I128 $0x11, AA0, AA0, AA0 + VMOVDQA A0, A1 sealAVX2ShortDone: VZEROUPPER JMP sealSSETail +// ---------------------------------------------------------------------------- +// Special optimization for buffers smaller than 321 bytes seal320AVX2: - VMOVDQA Y0, Y5 - VMOVDQA Y14, Y9 - VMOVDQA Y12, Y13 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y0, Y6 - VMOVDQA Y14, Y10 - VMOVDQA Y12, Y8 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VMOVDQA Y14, Y7 - VMOVDQA Y12, Y11 - VMOVDQA Y4, Y15 - MOVQ $0x0000000a, R9 + // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks + VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2 + VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3 + MOVQ $10, itr2 sealAVX2320InnerCipherLoop: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - DECQ R9 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 + DECQ itr2 JNE sealAVX2320InnerCipherLoop - VMOVDQA ·chacha20Constants<>+0(SB), Y3 - VPADDD Y3, Y0, Y0 - VPADDD Y3, Y5, Y5 - VPADDD Y3, Y6, Y6 - VPADDD Y7, Y14, Y14 - VPADDD Y7, Y9, Y9 - VPADDD Y7, Y10, Y10 - VPADDD Y11, Y12, Y12 - VPADDD Y11, Y13, Y13 - VPADDD Y11, Y8, Y8 - VMOVDQA ·avx2IncMask<>+0(SB), Y3 - VPADDD Y15, Y4, Y4 - VPADDD Y3, Y15, Y15 - VPADDD Y15, Y1, Y1 - VPADDD Y3, Y15, Y15 - VPADDD Y15, Y2, Y2 + + VMOVDQA ·chacha20Constants<>(SB), TT0 + VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2 + VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2 + VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2 + VMOVDQA ·avx2IncMask<>(SB), TT0 + VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3 + VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3 + VPADDD TT3, DD2, DD2 // Clamp and store poly key - VPERM2I128 $0x02, Y0, Y14, Y3 - VPAND ·polyClampMask<>+0(SB), Y3, Y3 - VMOVDQA Y3, (BP) + VPERM2I128 $0x02, AA0, BB0, TT0 + VPAND ·polyClampMask<>(SB), TT0, TT0 + VMOVDQA TT0, rsStoreAVX2 // Stream for up to 320 bytes - VPERM2I128 $0x13, Y0, Y14, Y0 - VPERM2I128 $0x13, Y12, Y4, Y14 - VPERM2I128 $0x02, Y5, Y9, Y12 - VPERM2I128 $0x02, Y13, Y1, Y4 - VPERM2I128 $0x13, Y5, Y9, Y5 - VPERM2I128 $0x13, Y13, Y1, Y9 - VPERM2I128 $0x02, Y6, Y10, Y13 - VPERM2I128 $0x02, Y8, Y2, Y1 - VPERM2I128 $0x13, Y6, Y10, Y6 - VPERM2I128 $0x13, Y8, Y2, Y10 + VPERM2I128 $0x13, AA0, BB0, AA0 + VPERM2I128 $0x13, CC0, DD0, BB0 + VPERM2I128 $0x02, AA1, BB1, CC0 + VPERM2I128 $0x02, CC1, DD1, DD0 + VPERM2I128 $0x13, AA1, BB1, AA1 + VPERM2I128 $0x13, CC1, DD1, BB1 + VPERM2I128 $0x02, AA2, BB2, CC1 + VPERM2I128 $0x02, CC2, DD2, DD1 + VPERM2I128 $0x13, AA2, BB2, AA2 + VPERM2I128 $0x13, CC2, DD2, BB2 JMP sealAVX2ShortSeal +// ---------------------------------------------------------------------------- +// Special optimization for the last 128 bytes of ciphertext sealAVX2Tail128: - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA 32(BP), Y14 - VMOVDQA 64(BP), Y12 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VMOVDQA Y4, Y1 + // Need to decrypt up to 128 bytes - prepare two blocks + // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed + // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed + VMOVDQA ·chacha20Constants<>(SB), AA0 + VMOVDQA state1StoreAVX2, BB0 + VMOVDQA state2StoreAVX2, CC0 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0 + VMOVDQA DD0, DD1 sealAVX2Tail128LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealAVX2Tail128LoopB: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x04, Y4, Y4, Y4 - DECQ CX - JG sealAVX2Tail128LoopA - DECQ R9 - JGE sealAVX2Tail128LoopB - VPADDD ·chacha20Constants<>+0(SB), Y0, Y5 - VPADDD 32(BP), Y14, Y9 - VPADDD 64(BP), Y12, Y13 - VPADDD Y1, Y4, Y1 - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) + polyAdd(0(oup)) + polyMul + VPALIGNR $4, BB0, BB0, BB0 + VPALIGNR $8, CC0, CC0, CC0 + VPALIGNR $12, DD0, DD0, DD0 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) + polyAdd(16(oup)) + polyMul + LEAQ 32(oup), oup + VPALIGNR $12, BB0, BB0, BB0 + VPALIGNR $8, CC0, CC0, CC0 + VPALIGNR $4, DD0, DD0, DD0 + DECQ itr1 + JG sealAVX2Tail128LoopA + DECQ itr2 + JGE sealAVX2Tail128LoopB + + VPADDD ·chacha20Constants<>(SB), AA0, AA1 + VPADDD state1StoreAVX2, BB0, BB1 + VPADDD state2StoreAVX2, CC0, CC1 + VPADDD DD1, DD0, DD1 + + VPERM2I128 $0x02, AA1, BB1, AA0 + VPERM2I128 $0x02, CC1, DD1, BB0 + VPERM2I128 $0x13, AA1, BB1, CC0 + VPERM2I128 $0x13, CC1, DD1, DD0 JMP sealAVX2ShortSealLoop +// ---------------------------------------------------------------------------- +// Special optimization for the last 256 bytes of ciphertext sealAVX2Tail256: - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA ·chacha20Constants<>+0(SB), Y5 - VMOVDQA 32(BP), Y14 - VMOVDQA 32(BP), Y9 - VMOVDQA 64(BP), Y12 - VMOVDQA 64(BP), Y13 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VMOVDQA Y4, Y7 - VMOVDQA Y1, Y11 + // Need to decrypt up to 256 bytes - prepare two blocks + // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed + // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA ·chacha20Constants<>(SB), AA1 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA state1StoreAVX2, BB1 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA state2StoreAVX2, CC1 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD1 + VMOVDQA DD0, TT1 + VMOVDQA DD1, TT2 sealAVX2Tail256LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealAVX2Tail256LoopB: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - DECQ CX - JG sealAVX2Tail256LoopA - DECQ R9 - JGE sealAVX2Tail256LoopB - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD Y7, Y4, Y4 - VPADDD Y11, Y1, Y1 - VPERM2I128 $0x02, Y0, Y14, Y3 - VPERM2I128 $0x02, Y12, Y4, Y7 - VPERM2I128 $0x13, Y0, Y14, Y11 - VPERM2I128 $0x13, Y12, Y4, Y15 - VPXOR (SI), Y3, Y3 - VPXOR 32(SI), Y7, Y7 - VPXOR 64(SI), Y11, Y11 - VPXOR 96(SI), Y15, Y15 - VMOVDQU Y3, (DI) - VMOVDQU Y7, 32(DI) - VMOVDQU Y11, 64(DI) - VMOVDQU Y15, 96(DI) - MOVQ $0x00000080, CX - LEAQ 128(SI), SI - SUBQ $0x80, BX - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - JMP sealAVX2SealHash - + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + polyAdd(0(oup)) + polyMul + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) + polyAdd(16(oup)) + polyMul + LEAQ 32(oup), oup + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 + DECQ itr1 + JG sealAVX2Tail256LoopA + DECQ itr2 + JGE sealAVX2Tail256LoopB + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1 + VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1 + VPERM2I128 $0x02, AA0, BB0, TT0 + VPERM2I128 $0x02, CC0, DD0, TT1 + VPERM2I128 $0x13, AA0, BB0, TT2 + VPERM2I128 $0x13, CC0, DD0, TT3 + VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 + VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) + MOVQ $128, itr1 + LEAQ 128(inp), inp + SUBQ $128, inl + VPERM2I128 $0x02, AA1, BB1, AA0 + VPERM2I128 $0x02, CC1, DD1, BB0 + VPERM2I128 $0x13, AA1, BB1, CC0 + VPERM2I128 $0x13, CC1, DD1, DD0 + + JMP sealAVX2SealHash + +// ---------------------------------------------------------------------------- +// Special optimization for the last 384 bytes of ciphertext sealAVX2Tail384: - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VMOVDQA Y4, Y7 - VMOVDQA Y1, Y11 - VMOVDQA Y2, Y15 + // Need to decrypt up to 384 bytes - prepare two blocks + // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed + // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2 + VMOVDQA DD0, TT1; VMOVDQA DD1, TT2; VMOVDQA DD2, TT3 sealAVX2Tail384LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealAVX2Tail384LoopB: - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x0c, Y14, Y3 - VPSRLD $0x14, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y14, Y0, Y0 - VPXOR Y0, Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPADDD Y4, Y12, Y12 - VPXOR Y12, Y14, Y14 - VPSLLD $0x07, Y14, Y3 - VPSRLD $0x19, Y14, Y14 - VPXOR Y3, Y14, Y14 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x0c, Y9, Y3 - VPSRLD $0x14, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y9, Y5, Y5 - VPXOR Y5, Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPADDD Y1, Y13, Y13 - VPXOR Y13, Y9, Y9 - VPSLLD $0x07, Y9, Y3 - VPSRLD $0x19, Y9, Y9 - VPXOR Y3, Y9, Y9 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x0c, Y10, Y3 - VPSRLD $0x14, Y10, Y10 - VPXOR Y3, Y10, Y10 - VPADDD Y10, Y6, Y6 - VPXOR Y6, Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPADDD Y2, Y8, Y8 - VPXOR Y8, Y10, Y10 - VPSLLD $0x07, Y10, Y3 - VPSRLD $0x19, Y10, Y10 - VPXOR Y3, Y10, Y10 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - DECQ CX - JG sealAVX2Tail384LoopA - DECQ R9 - JGE sealAVX2Tail384LoopB - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD Y7, Y4, Y4 - VPADDD Y11, Y1, Y1 - VPADDD Y15, Y2, Y2 - VPERM2I128 $0x02, Y0, Y14, Y3 - VPERM2I128 $0x02, Y12, Y4, Y7 - VPERM2I128 $0x13, Y0, Y14, Y11 - VPERM2I128 $0x13, Y12, Y4, Y15 - VPXOR (SI), Y3, Y3 - VPXOR 32(SI), Y7, Y7 - VPXOR 64(SI), Y11, Y11 - VPXOR 96(SI), Y15, Y15 - VMOVDQU Y3, (DI) - VMOVDQU Y7, 32(DI) - VMOVDQU Y11, 64(DI) - VMOVDQU Y15, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y3 - VPERM2I128 $0x02, Y13, Y1, Y7 - VPERM2I128 $0x13, Y5, Y9, Y11 - VPERM2I128 $0x13, Y13, Y1, Y15 - VPXOR 128(SI), Y3, Y3 - VPXOR 160(SI), Y7, Y7 - VPXOR 192(SI), Y11, Y11 - VPXOR 224(SI), Y15, Y15 - VMOVDQU Y3, 128(DI) - VMOVDQU Y7, 160(DI) - VMOVDQU Y11, 192(DI) - VMOVDQU Y15, 224(DI) - MOVQ $0x00000100, CX - LEAQ 256(SI), SI - SUBQ $0x00000100, BX - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - JMP sealAVX2SealHash - + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + polyAdd(0(oup)) + polyMul + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 + chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) + polyAdd(16(oup)) + polyMul + LEAQ 32(oup), oup + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 + DECQ itr1 + JG sealAVX2Tail384LoopA + DECQ itr2 + JGE sealAVX2Tail384LoopB + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2 + VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1; VPADDD TT3, DD2, DD2 + VPERM2I128 $0x02, AA0, BB0, TT0 + VPERM2I128 $0x02, CC0, DD0, TT1 + VPERM2I128 $0x13, AA0, BB0, TT2 + VPERM2I128 $0x13, CC0, DD0, TT3 + VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 + VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) + VPERM2I128 $0x02, AA1, BB1, TT0 + VPERM2I128 $0x02, CC1, DD1, TT1 + VPERM2I128 $0x13, AA1, BB1, TT2 + VPERM2I128 $0x13, CC1, DD1, TT3 + VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3 + VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup) + MOVQ $256, itr1 + LEAQ 256(inp), inp + SUBQ $256, inl + VPERM2I128 $0x02, AA2, BB2, AA0 + VPERM2I128 $0x02, CC2, DD2, BB0 + VPERM2I128 $0x13, AA2, BB2, CC0 + VPERM2I128 $0x13, CC2, DD2, DD0 + + JMP sealAVX2SealHash + +// ---------------------------------------------------------------------------- +// Special optimization for the last 512 bytes of ciphertext sealAVX2Tail512: - VMOVDQA ·chacha20Constants<>+0(SB), Y0 - VMOVDQA Y0, Y5 - VMOVDQA Y0, Y6 - VMOVDQA Y0, Y7 - VMOVDQA 32(BP), Y14 - VMOVDQA Y14, Y9 - VMOVDQA Y14, Y10 - VMOVDQA Y14, Y11 - VMOVDQA 64(BP), Y12 - VMOVDQA Y12, Y13 - VMOVDQA Y12, Y8 - VMOVDQA Y12, Y15 - VMOVDQA 192(BP), Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y4 - VPADDD ·avx2IncMask<>+0(SB), Y4, Y1 - VPADDD ·avx2IncMask<>+0(SB), Y1, Y2 - VPADDD ·avx2IncMask<>+0(SB), Y2, Y3 - VMOVDQA Y4, 96(BP) - VMOVDQA Y1, 128(BP) - VMOVDQA Y2, 160(BP) - VMOVDQA Y3, 192(BP) + // Need to decrypt up to 512 bytes - prepare two blocks + // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed + // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed + VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 + VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 + VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 + VMOVDQA ctr3StoreAVX2, DD0 + VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 + VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 sealAVX2Tail512LoopA: - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), AX - MOVQ AX, R15 - MULQ R10 - MOVQ AX, R13 - MOVQ DX, R14 - MOVQ (BP), AX - MULQ R11 - IMULQ R12, R15 - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), AX - MOVQ AX, R8 - MULQ R10 - ADDQ AX, R14 - ADCQ $0x00, DX - MOVQ DX, R10 - MOVQ 8(BP), AX - MULQ R11 - ADDQ AX, R15 - ADCQ $0x00, DX - IMULQ R12, R8 - ADDQ R10, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 16(DI), DI + polyAdd(0(oup)) + polyMul + LEAQ 16(oup), oup sealAVX2Tail512LoopB: - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - ADDQ (DI), R10 - ADCQ 8(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPALIGNR $0x04, Y14, Y14, Y14 - VPALIGNR $0x04, Y9, Y9, Y9 - VPALIGNR $0x04, Y10, Y10, Y10 - VPALIGNR $0x04, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x0c, Y4, Y4, Y4 - VPALIGNR $0x0c, Y1, Y1, Y1 - VPALIGNR $0x0c, Y2, Y2, Y2 - VPALIGNR $0x0c, Y3, Y3, Y3 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol16<>+0(SB), Y4, Y4 - VPSHUFB ·rol16<>+0(SB), Y1, Y1 - VPSHUFB ·rol16<>+0(SB), Y2, Y2 - VPSHUFB ·rol16<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - ADDQ 16(DI), R10 - ADCQ 24(DI), R11 - ADCQ $0x01, R12 - MOVQ (BP), DX - MOVQ DX, R15 - MULXQ R10, R13, R14 - IMULQ R12, R15 - MULXQ R11, AX, DX - ADDQ AX, R14 - ADCQ DX, R15 - MOVQ 8(BP), DX - MULXQ R10, R10, AX - ADDQ R10, R14 - MULXQ R11, R11, R8 - ADCQ R11, R15 - ADCQ $0x00, R8 - IMULQ R12, DX - ADDQ AX, R15 - ADCQ DX, R8 - MOVQ R13, R10 - MOVQ R14, R11 - MOVQ R15, R12 - ANDQ $0x03, R12 - MOVQ R15, R13 - ANDQ $-4, R13 - MOVQ R8, R14 - SHRQ $0x02, R8, R15 - SHRQ $0x02, R8 - ADDQ R13, R10 - ADCQ R14, R11 - ADCQ $0x00, R12 - ADDQ R15, R10 - ADCQ R8, R11 - ADCQ $0x00, R12 - LEAQ 32(DI), DI - VMOVDQA Y15, 224(BP) - VPSLLD $0x0c, Y14, Y15 - VPSRLD $0x14, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x0c, Y9, Y15 - VPSRLD $0x14, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x0c, Y10, Y15 - VPSRLD $0x14, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x0c, Y11, Y15 - VPSRLD $0x14, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPADDD Y14, Y0, Y0 - VPADDD Y9, Y5, Y5 - VPADDD Y10, Y6, Y6 - VPADDD Y11, Y7, Y7 - VPXOR Y0, Y4, Y4 - VPXOR Y5, Y1, Y1 - VPXOR Y6, Y2, Y2 - VPXOR Y7, Y3, Y3 - VPSHUFB ·rol8<>+0(SB), Y4, Y4 - VPSHUFB ·rol8<>+0(SB), Y1, Y1 - VPSHUFB ·rol8<>+0(SB), Y2, Y2 - VPSHUFB ·rol8<>+0(SB), Y3, Y3 - VPADDD Y4, Y12, Y12 - VPADDD Y1, Y13, Y13 - VPADDD Y2, Y8, Y8 - VPADDD Y3, Y15, Y15 - VPXOR Y12, Y14, Y14 - VPXOR Y13, Y9, Y9 - VPXOR Y8, Y10, Y10 - VPXOR Y15, Y11, Y11 - VMOVDQA Y15, 224(BP) - VPSLLD $0x07, Y14, Y15 - VPSRLD $0x19, Y14, Y14 - VPXOR Y15, Y14, Y14 - VPSLLD $0x07, Y9, Y15 - VPSRLD $0x19, Y9, Y9 - VPXOR Y15, Y9, Y9 - VPSLLD $0x07, Y10, Y15 - VPSRLD $0x19, Y10, Y10 - VPXOR Y15, Y10, Y10 - VPSLLD $0x07, Y11, Y15 - VPSRLD $0x19, Y11, Y11 - VPXOR Y15, Y11, Y11 - VMOVDQA 224(BP), Y15 - VPALIGNR $0x0c, Y14, Y14, Y14 - VPALIGNR $0x0c, Y9, Y9, Y9 - VPALIGNR $0x0c, Y10, Y10, Y10 - VPALIGNR $0x0c, Y11, Y11, Y11 - VPALIGNR $0x08, Y12, Y12, Y12 - VPALIGNR $0x08, Y13, Y13, Y13 - VPALIGNR $0x08, Y8, Y8, Y8 - VPALIGNR $0x08, Y15, Y15, Y15 - VPALIGNR $0x04, Y4, Y4, Y4 - VPALIGNR $0x04, Y1, Y1, Y1 - VPALIGNR $0x04, Y2, Y2, Y2 - VPALIGNR $0x04, Y3, Y3, Y3 - DECQ CX - JG sealAVX2Tail512LoopA - DECQ R9 - JGE sealAVX2Tail512LoopB - VPADDD ·chacha20Constants<>+0(SB), Y0, Y0 - VPADDD ·chacha20Constants<>+0(SB), Y5, Y5 - VPADDD ·chacha20Constants<>+0(SB), Y6, Y6 - VPADDD ·chacha20Constants<>+0(SB), Y7, Y7 - VPADDD 32(BP), Y14, Y14 - VPADDD 32(BP), Y9, Y9 - VPADDD 32(BP), Y10, Y10 - VPADDD 32(BP), Y11, Y11 - VPADDD 64(BP), Y12, Y12 - VPADDD 64(BP), Y13, Y13 - VPADDD 64(BP), Y8, Y8 - VPADDD 64(BP), Y15, Y15 - VPADDD 96(BP), Y4, Y4 - VPADDD 128(BP), Y1, Y1 - VPADDD 160(BP), Y2, Y2 - VPADDD 192(BP), Y3, Y3 - VMOVDQA Y15, 224(BP) - VPERM2I128 $0x02, Y0, Y14, Y15 - VPXOR (SI), Y15, Y15 - VMOVDQU Y15, (DI) - VPERM2I128 $0x02, Y12, Y4, Y15 - VPXOR 32(SI), Y15, Y15 - VMOVDQU Y15, 32(DI) - VPERM2I128 $0x13, Y0, Y14, Y15 - VPXOR 64(SI), Y15, Y15 - VMOVDQU Y15, 64(DI) - VPERM2I128 $0x13, Y12, Y4, Y15 - VPXOR 96(SI), Y15, Y15 - VMOVDQU Y15, 96(DI) - VPERM2I128 $0x02, Y5, Y9, Y0 - VPERM2I128 $0x02, Y13, Y1, Y14 - VPERM2I128 $0x13, Y5, Y9, Y12 - VPERM2I128 $0x13, Y13, Y1, Y4 - VPXOR 128(SI), Y0, Y0 - VPXOR 160(SI), Y14, Y14 - VPXOR 192(SI), Y12, Y12 - VPXOR 224(SI), Y4, Y4 - VMOVDQU Y0, 128(DI) - VMOVDQU Y14, 160(DI) - VMOVDQU Y12, 192(DI) - VMOVDQU Y4, 224(DI) - VPERM2I128 $0x02, Y6, Y10, Y0 - VPERM2I128 $0x02, Y8, Y2, Y14 - VPERM2I128 $0x13, Y6, Y10, Y12 - VPERM2I128 $0x13, Y8, Y2, Y4 - VPXOR 256(SI), Y0, Y0 - VPXOR 288(SI), Y14, Y14 - VPXOR 320(SI), Y12, Y12 - VPXOR 352(SI), Y4, Y4 - VMOVDQU Y0, 256(DI) - VMOVDQU Y14, 288(DI) - VMOVDQU Y12, 320(DI) - VMOVDQU Y4, 352(DI) - MOVQ $0x00000180, CX - LEAQ 384(SI), SI - SUBQ $0x00000180, BX - VPERM2I128 $0x02, Y7, Y11, Y0 - VPERM2I128 $0x02, 224(BP), Y3, Y14 - VPERM2I128 $0x13, Y7, Y11, Y12 - VPERM2I128 $0x13, 224(BP), Y3, Y4 - JMP sealAVX2SealHash + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + polyAdd(0*8(oup)) + polyMulAVX2 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + polyAdd(2*8(oup)) + polyMulAVX2 + LEAQ (4*8)(oup), oup + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 + VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 + VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 + VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 + VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 + VMOVDQA CC3, tmpStoreAVX2 + VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 + VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 + VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 + VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 + VMOVDQA tmpStoreAVX2, CC3 + VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 + VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 + VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 + + DECQ itr1 + JG sealAVX2Tail512LoopA + DECQ itr2 + JGE sealAVX2Tail512LoopB + + VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 + VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 + VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 + VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 + VMOVDQA CC3, tmpStoreAVX2 + VPERM2I128 $0x02, AA0, BB0, CC3 + VPXOR (0*32)(inp), CC3, CC3 + VMOVDQU CC3, (0*32)(oup) + VPERM2I128 $0x02, CC0, DD0, CC3 + VPXOR (1*32)(inp), CC3, CC3 + VMOVDQU CC3, (1*32)(oup) + VPERM2I128 $0x13, AA0, BB0, CC3 + VPXOR (2*32)(inp), CC3, CC3 + VMOVDQU CC3, (2*32)(oup) + VPERM2I128 $0x13, CC0, DD0, CC3 + VPXOR (3*32)(inp), CC3, CC3 + VMOVDQU CC3, (3*32)(oup) + + VPERM2I128 $0x02, AA1, BB1, AA0 + VPERM2I128 $0x02, CC1, DD1, BB0 + VPERM2I128 $0x13, AA1, BB1, CC0 + VPERM2I128 $0x13, CC1, DD1, DD0 + VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 + VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) + + VPERM2I128 $0x02, AA2, BB2, AA0 + VPERM2I128 $0x02, CC2, DD2, BB0 + VPERM2I128 $0x13, AA2, BB2, CC0 + VPERM2I128 $0x13, CC2, DD2, DD0 + VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 + VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) + + MOVQ $384, itr1 + LEAQ 384(inp), inp + SUBQ $384, inl + VPERM2I128 $0x02, AA3, BB3, AA0 + VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0 + VPERM2I128 $0x13, AA3, BB3, CC0 + VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 + + JMP sealAVX2SealHash diff --git a/upstream/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go b/upstream/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go index 90ef6a241de..cda8e3edfd5 100644 --- a/upstream/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go +++ b/upstream/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 +package asn1 // import "golang.org/x/crypto/cryptobyte/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/upstream/vendor/golang.org/x/crypto/cryptobyte/string.go b/upstream/vendor/golang.org/x/crypto/cryptobyte/string.go index 4b0f8097f9e..10692a8a315 100644 --- a/upstream/vendor/golang.org/x/crypto/cryptobyte/string.go +++ b/upstream/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 +package cryptobyte // import "golang.org/x/crypto/cryptobyte" // String represents a string of bytes. It provides methods for parsing // fixed-length and length-prefixed values from it. diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/curve25519.go b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519.go index 21ca3b2ee4b..00f963ea20a 100644 --- a/upstream/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -6,11 +6,9 @@ // performs scalar multiplication on the elliptic curve known as Curve25519. // See RFC 7748. // -// This package is a wrapper for the X25519 implementation +// Starting in Go 1.20, this package is a wrapper for the X25519 implementation // in the crypto/ecdh package. -package curve25519 - -import "crypto/ecdh" +package curve25519 // import "golang.org/x/crypto/curve25519" // ScalarMult sets dst to the product scalar * point. // @@ -18,13 +16,7 @@ import "crypto/ecdh" // zeroes, irrespective of the scalar. Instead, use the X25519 function, which // will return an error. func ScalarMult(dst, scalar, point *[32]byte) { - if _, err := x25519(dst, scalar[:], point[:]); err != nil { - // The only error condition for x25519 when the inputs are 32 bytes long - // is if the output would have been the all-zero value. - for i := range dst { - dst[i] = 0 - } - } + scalarMult(dst, scalar, point) } // ScalarBaseMult sets dst to the product scalar * base where base is the @@ -33,12 +25,7 @@ func ScalarMult(dst, scalar, point *[32]byte) { // It is recommended to use the X25519 function with Basepoint instead, as // copying into fixed size arrays can lead to unexpected bugs. func ScalarBaseMult(dst, scalar *[32]byte) { - curve := ecdh.X25519() - priv, err := curve.NewPrivateKey(scalar[:]) - if err != nil { - panic("curve25519: internal error: scalarBaseMult was not 32 bytes") - } - copy(dst[:], priv.PublicKey().Bytes()) + scalarBaseMult(dst, scalar) } const ( @@ -70,21 +57,3 @@ func X25519(scalar, point []byte) ([]byte, error) { var dst [32]byte return x25519(&dst, scalar, point) } - -func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { - curve := ecdh.X25519() - pub, err := curve.NewPublicKey(point) - if err != nil { - return nil, err - } - priv, err := curve.NewPrivateKey(scalar) - if err != nil { - return nil, err - } - out, err := priv.ECDH(pub) - if err != nil { - return nil, err - } - copy(dst[:], out) - return dst[:], nil -} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go new file mode 100644 index 00000000000..ba647e8d77d --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go @@ -0,0 +1,105 @@ +// Copyright 2019 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 !go1.20 + +package curve25519 + +import ( + "crypto/subtle" + "errors" + "strconv" + + "golang.org/x/crypto/curve25519/internal/field" +) + +func scalarMult(dst, scalar, point *[32]byte) { + var e [32]byte + + copy(e[:], scalar[:]) + e[0] &= 248 + e[31] &= 127 + e[31] |= 64 + + var x1, x2, z2, x3, z3, tmp0, tmp1 field.Element + x1.SetBytes(point[:]) + x2.One() + x3.Set(&x1) + z3.One() + + swap := 0 + for pos := 254; pos >= 0; pos-- { + b := e[pos/8] >> uint(pos&7) + b &= 1 + swap ^= int(b) + x2.Swap(&x3, swap) + z2.Swap(&z3, swap) + swap = int(b) + + tmp0.Subtract(&x3, &z3) + tmp1.Subtract(&x2, &z2) + x2.Add(&x2, &z2) + z2.Add(&x3, &z3) + z3.Multiply(&tmp0, &x2) + z2.Multiply(&z2, &tmp1) + tmp0.Square(&tmp1) + tmp1.Square(&x2) + x3.Add(&z3, &z2) + z2.Subtract(&z3, &z2) + x2.Multiply(&tmp1, &tmp0) + tmp1.Subtract(&tmp1, &tmp0) + z2.Square(&z2) + + z3.Mult32(&tmp1, 121666) + x3.Square(&x3) + tmp0.Add(&tmp0, &z3) + z3.Multiply(&x1, &z2) + z2.Multiply(&tmp1, &tmp0) + } + + x2.Swap(&x3, swap) + z2.Swap(&z3, swap) + + z2.Invert(&z2) + x2.Multiply(&x2, &z2) + copy(dst[:], x2.Bytes()) +} + +func scalarBaseMult(dst, scalar *[32]byte) { + checkBasepoint() + scalarMult(dst, scalar, &basePoint) +} + +func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { + var in [32]byte + if l := len(scalar); l != 32 { + return nil, errors.New("bad scalar length: " + strconv.Itoa(l) + ", expected 32") + } + if l := len(point); l != 32 { + return nil, errors.New("bad point length: " + strconv.Itoa(l) + ", expected 32") + } + copy(in[:], scalar) + if &point[0] == &Basepoint[0] { + scalarBaseMult(dst, &in) + } else { + var base, zero [32]byte + copy(base[:], point) + scalarMult(dst, &in, &base) + if subtle.ConstantTimeCompare(dst[:], zero[:]) == 1 { + return nil, errors.New("bad input point: low order point") + } + } + return dst[:], nil +} + +func checkBasepoint() { + if subtle.ConstantTimeCompare(Basepoint, []byte{ + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }) != 1 { + panic("curve25519: global Basepoint value was modified") + } +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go new file mode 100644 index 00000000000..627df497270 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go @@ -0,0 +1,46 @@ +// Copyright 2022 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 go1.20 + +package curve25519 + +import "crypto/ecdh" + +func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { + curve := ecdh.X25519() + pub, err := curve.NewPublicKey(point) + if err != nil { + return nil, err + } + priv, err := curve.NewPrivateKey(scalar) + if err != nil { + return nil, err + } + out, err := priv.ECDH(pub) + if err != nil { + return nil, err + } + copy(dst[:], out) + return dst[:], nil +} + +func scalarMult(dst, scalar, point *[32]byte) { + if _, err := x25519(dst, scalar[:], point[:]); err != nil { + // The only error condition for x25519 when the inputs are 32 bytes long + // is if the output would have been the all-zero value. + for i := range dst { + dst[i] = 0 + } + } +} + +func scalarBaseMult(dst, scalar *[32]byte) { + curve := ecdh.X25519() + priv, err := curve.NewPrivateKey(scalar[:]) + if err != nil { + panic("curve25519: internal error: scalarBaseMult was not 32 bytes") + } + copy(dst[:], priv.PublicKey().Bytes()) +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/README b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/README new file mode 100644 index 00000000000..e25bca7dc80 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/README @@ -0,0 +1,7 @@ +This package is kept in sync with crypto/ed25519/internal/edwards25519/field in +the standard library. + +If there are any changes in the standard library that need to be synced to this +package, run sync.sh. It will not overwrite any local changes made since the +previous sync, so it's ok to land changes in this package first, and then sync +to the standard library later. diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go new file mode 100644 index 00000000000..ca841ad99e3 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go @@ -0,0 +1,416 @@ +// Copyright (c) 2017 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 field implements fast arithmetic modulo 2^255-19. +package field + +import ( + "crypto/subtle" + "encoding/binary" + "math/bits" +) + +// Element represents an element of the field GF(2^255-19). Note that this +// is not a cryptographically secure group, and should only be used to interact +// with edwards25519.Point coordinates. +// +// This type works similarly to math/big.Int, and all arguments and receivers +// are allowed to alias. +// +// The zero value is a valid zero element. +type Element struct { + // An element t represents the integer + // t.l0 + t.l1*2^51 + t.l2*2^102 + t.l3*2^153 + t.l4*2^204 + // + // Between operations, all limbs are expected to be lower than 2^52. + l0 uint64 + l1 uint64 + l2 uint64 + l3 uint64 + l4 uint64 +} + +const maskLow51Bits uint64 = (1 << 51) - 1 + +var feZero = &Element{0, 0, 0, 0, 0} + +// Zero sets v = 0, and returns v. +func (v *Element) Zero() *Element { + *v = *feZero + return v +} + +var feOne = &Element{1, 0, 0, 0, 0} + +// One sets v = 1, and returns v. +func (v *Element) One() *Element { + *v = *feOne + return v +} + +// reduce reduces v modulo 2^255 - 19 and returns it. +func (v *Element) reduce() *Element { + v.carryPropagate() + + // After the light reduction we now have a field element representation + // v < 2^255 + 2^13 * 19, but need v < 2^255 - 19. + + // If v >= 2^255 - 19, then v + 19 >= 2^255, which would overflow 2^255 - 1, + // generating a carry. That is, c will be 0 if v < 2^255 - 19, and 1 otherwise. + c := (v.l0 + 19) >> 51 + c = (v.l1 + c) >> 51 + c = (v.l2 + c) >> 51 + c = (v.l3 + c) >> 51 + c = (v.l4 + c) >> 51 + + // If v < 2^255 - 19 and c = 0, this will be a no-op. Otherwise, it's + // effectively applying the reduction identity to the carry. + v.l0 += 19 * c + + v.l1 += v.l0 >> 51 + v.l0 = v.l0 & maskLow51Bits + v.l2 += v.l1 >> 51 + v.l1 = v.l1 & maskLow51Bits + v.l3 += v.l2 >> 51 + v.l2 = v.l2 & maskLow51Bits + v.l4 += v.l3 >> 51 + v.l3 = v.l3 & maskLow51Bits + // no additional carry + v.l4 = v.l4 & maskLow51Bits + + return v +} + +// Add sets v = a + b, and returns v. +func (v *Element) Add(a, b *Element) *Element { + v.l0 = a.l0 + b.l0 + v.l1 = a.l1 + b.l1 + v.l2 = a.l2 + b.l2 + v.l3 = a.l3 + b.l3 + v.l4 = a.l4 + b.l4 + // Using the generic implementation here is actually faster than the + // assembly. Probably because the body of this function is so simple that + // the compiler can figure out better optimizations by inlining the carry + // propagation. TODO + return v.carryPropagateGeneric() +} + +// Subtract sets v = a - b, and returns v. +func (v *Element) Subtract(a, b *Element) *Element { + // We first add 2 * p, to guarantee the subtraction won't underflow, and + // then subtract b (which can be up to 2^255 + 2^13 * 19). + v.l0 = (a.l0 + 0xFFFFFFFFFFFDA) - b.l0 + v.l1 = (a.l1 + 0xFFFFFFFFFFFFE) - b.l1 + v.l2 = (a.l2 + 0xFFFFFFFFFFFFE) - b.l2 + v.l3 = (a.l3 + 0xFFFFFFFFFFFFE) - b.l3 + v.l4 = (a.l4 + 0xFFFFFFFFFFFFE) - b.l4 + return v.carryPropagate() +} + +// Negate sets v = -a, and returns v. +func (v *Element) Negate(a *Element) *Element { + return v.Subtract(feZero, a) +} + +// Invert sets v = 1/z mod p, and returns v. +// +// If z == 0, Invert returns v = 0. +func (v *Element) Invert(z *Element) *Element { + // Inversion is implemented as exponentiation with exponent p − 2. It uses the + // same sequence of 255 squarings and 11 multiplications as [Curve25519]. + var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element + + z2.Square(z) // 2 + t.Square(&z2) // 4 + t.Square(&t) // 8 + z9.Multiply(&t, z) // 9 + z11.Multiply(&z9, &z2) // 11 + t.Square(&z11) // 22 + z2_5_0.Multiply(&t, &z9) // 31 = 2^5 - 2^0 + + t.Square(&z2_5_0) // 2^6 - 2^1 + for i := 0; i < 4; i++ { + t.Square(&t) // 2^10 - 2^5 + } + z2_10_0.Multiply(&t, &z2_5_0) // 2^10 - 2^0 + + t.Square(&z2_10_0) // 2^11 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^20 - 2^10 + } + z2_20_0.Multiply(&t, &z2_10_0) // 2^20 - 2^0 + + t.Square(&z2_20_0) // 2^21 - 2^1 + for i := 0; i < 19; i++ { + t.Square(&t) // 2^40 - 2^20 + } + t.Multiply(&t, &z2_20_0) // 2^40 - 2^0 + + t.Square(&t) // 2^41 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^50 - 2^10 + } + z2_50_0.Multiply(&t, &z2_10_0) // 2^50 - 2^0 + + t.Square(&z2_50_0) // 2^51 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^100 - 2^50 + } + z2_100_0.Multiply(&t, &z2_50_0) // 2^100 - 2^0 + + t.Square(&z2_100_0) // 2^101 - 2^1 + for i := 0; i < 99; i++ { + t.Square(&t) // 2^200 - 2^100 + } + t.Multiply(&t, &z2_100_0) // 2^200 - 2^0 + + t.Square(&t) // 2^201 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^250 - 2^50 + } + t.Multiply(&t, &z2_50_0) // 2^250 - 2^0 + + t.Square(&t) // 2^251 - 2^1 + t.Square(&t) // 2^252 - 2^2 + t.Square(&t) // 2^253 - 2^3 + t.Square(&t) // 2^254 - 2^4 + t.Square(&t) // 2^255 - 2^5 + + return v.Multiply(&t, &z11) // 2^255 - 21 +} + +// Set sets v = a, and returns v. +func (v *Element) Set(a *Element) *Element { + *v = *a + return v +} + +// SetBytes sets v to x, which must be a 32-byte little-endian encoding. +// +// Consistent with RFC 7748, the most significant bit (the high bit of the +// last byte) is ignored, and non-canonical values (2^255-19 through 2^255-1) +// are accepted. Note that this is laxer than specified by RFC 8032. +func (v *Element) SetBytes(x []byte) *Element { + if len(x) != 32 { + panic("edwards25519: invalid field element input size") + } + + // Bits 0:51 (bytes 0:8, bits 0:64, shift 0, mask 51). + v.l0 = binary.LittleEndian.Uint64(x[0:8]) + v.l0 &= maskLow51Bits + // Bits 51:102 (bytes 6:14, bits 48:112, shift 3, mask 51). + v.l1 = binary.LittleEndian.Uint64(x[6:14]) >> 3 + v.l1 &= maskLow51Bits + // Bits 102:153 (bytes 12:20, bits 96:160, shift 6, mask 51). + v.l2 = binary.LittleEndian.Uint64(x[12:20]) >> 6 + v.l2 &= maskLow51Bits + // Bits 153:204 (bytes 19:27, bits 152:216, shift 1, mask 51). + v.l3 = binary.LittleEndian.Uint64(x[19:27]) >> 1 + v.l3 &= maskLow51Bits + // Bits 204:251 (bytes 24:32, bits 192:256, shift 12, mask 51). + // Note: not bytes 25:33, shift 4, to avoid overread. + v.l4 = binary.LittleEndian.Uint64(x[24:32]) >> 12 + v.l4 &= maskLow51Bits + + return v +} + +// Bytes returns the canonical 32-byte little-endian encoding of v. +func (v *Element) Bytes() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var out [32]byte + return v.bytes(&out) +} + +func (v *Element) bytes(out *[32]byte) []byte { + t := *v + t.reduce() + + var buf [8]byte + for i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} { + bitsOffset := i * 51 + binary.LittleEndian.PutUint64(buf[:], l<= len(out) { + break + } + out[off] |= bb + } + } + + return out[:] +} + +// Equal returns 1 if v and u are equal, and 0 otherwise. +func (v *Element) Equal(u *Element) int { + sa, sv := u.Bytes(), v.Bytes() + return subtle.ConstantTimeCompare(sa, sv) +} + +// mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise. +func mask64Bits(cond int) uint64 { return ^(uint64(cond) - 1) } + +// Select sets v to a if cond == 1, and to b if cond == 0. +func (v *Element) Select(a, b *Element, cond int) *Element { + m := mask64Bits(cond) + v.l0 = (m & a.l0) | (^m & b.l0) + v.l1 = (m & a.l1) | (^m & b.l1) + v.l2 = (m & a.l2) | (^m & b.l2) + v.l3 = (m & a.l3) | (^m & b.l3) + v.l4 = (m & a.l4) | (^m & b.l4) + return v +} + +// Swap swaps v and u if cond == 1 or leaves them unchanged if cond == 0, and returns v. +func (v *Element) Swap(u *Element, cond int) { + m := mask64Bits(cond) + t := m & (v.l0 ^ u.l0) + v.l0 ^= t + u.l0 ^= t + t = m & (v.l1 ^ u.l1) + v.l1 ^= t + u.l1 ^= t + t = m & (v.l2 ^ u.l2) + v.l2 ^= t + u.l2 ^= t + t = m & (v.l3 ^ u.l3) + v.l3 ^= t + u.l3 ^= t + t = m & (v.l4 ^ u.l4) + v.l4 ^= t + u.l4 ^= t +} + +// IsNegative returns 1 if v is negative, and 0 otherwise. +func (v *Element) IsNegative() int { + return int(v.Bytes()[0] & 1) +} + +// Absolute sets v to |u|, and returns v. +func (v *Element) Absolute(u *Element) *Element { + return v.Select(new(Element).Negate(u), u, u.IsNegative()) +} + +// Multiply sets v = x * y, and returns v. +func (v *Element) Multiply(x, y *Element) *Element { + feMul(v, x, y) + return v +} + +// Square sets v = x * x, and returns v. +func (v *Element) Square(x *Element) *Element { + feSquare(v, x) + return v +} + +// Mult32 sets v = x * y, and returns v. +func (v *Element) Mult32(x *Element, y uint32) *Element { + x0lo, x0hi := mul51(x.l0, y) + x1lo, x1hi := mul51(x.l1, y) + x2lo, x2hi := mul51(x.l2, y) + x3lo, x3hi := mul51(x.l3, y) + x4lo, x4hi := mul51(x.l4, y) + v.l0 = x0lo + 19*x4hi // carried over per the reduction identity + v.l1 = x1lo + x0hi + v.l2 = x2lo + x1hi + v.l3 = x3lo + x2hi + v.l4 = x4lo + x3hi + // The hi portions are going to be only 32 bits, plus any previous excess, + // so we can skip the carry propagation. + return v +} + +// mul51 returns lo + hi * 2⁵¹ = a * b. +func mul51(a uint64, b uint32) (lo uint64, hi uint64) { + mh, ml := bits.Mul64(a, uint64(b)) + lo = ml & maskLow51Bits + hi = (mh << 13) | (ml >> 51) + return +} + +// Pow22523 set v = x^((p-5)/8), and returns v. (p-5)/8 is 2^252-3. +func (v *Element) Pow22523(x *Element) *Element { + var t0, t1, t2 Element + + t0.Square(x) // x^2 + t1.Square(&t0) // x^4 + t1.Square(&t1) // x^8 + t1.Multiply(x, &t1) // x^9 + t0.Multiply(&t0, &t1) // x^11 + t0.Square(&t0) // x^22 + t0.Multiply(&t1, &t0) // x^31 + t1.Square(&t0) // x^62 + for i := 1; i < 5; i++ { // x^992 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // x^1023 -> 1023 = 2^10 - 1 + t1.Square(&t0) // 2^11 - 2 + for i := 1; i < 10; i++ { // 2^20 - 2^10 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^20 - 1 + t2.Square(&t1) // 2^21 - 2 + for i := 1; i < 20; i++ { // 2^40 - 2^20 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^40 - 1 + t1.Square(&t1) // 2^41 - 2 + for i := 1; i < 10; i++ { // 2^50 - 2^10 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^50 - 1 + t1.Square(&t0) // 2^51 - 2 + for i := 1; i < 50; i++ { // 2^100 - 2^50 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^100 - 1 + t2.Square(&t1) // 2^101 - 2 + for i := 1; i < 100; i++ { // 2^200 - 2^100 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^200 - 1 + t1.Square(&t1) // 2^201 - 2 + for i := 1; i < 50; i++ { // 2^250 - 2^50 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^250 - 1 + t0.Square(&t0) // 2^251 - 2 + t0.Square(&t0) // 2^252 - 4 + return v.Multiply(&t0, x) // 2^252 - 3 -> x^(2^252-3) +} + +// sqrtM1 is 2^((p-1)/4), which squared is equal to -1 by Euler's Criterion. +var sqrtM1 = &Element{1718705420411056, 234908883556509, + 2233514472574048, 2117202627021982, 765476049583133} + +// SqrtRatio sets r to the non-negative square root of the ratio of u and v. +// +// If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio +// sets r according to Section 4.3 of draft-irtf-cfrg-ristretto255-decaf448-00, +// and returns r and 0. +func (r *Element) SqrtRatio(u, v *Element) (rr *Element, wasSquare int) { + var a, b Element + + // r = (u * v3) * (u * v7)^((p-5)/8) + v2 := a.Square(v) + uv3 := b.Multiply(u, b.Multiply(v2, v)) + uv7 := a.Multiply(uv3, a.Square(v2)) + r.Multiply(uv3, r.Pow22523(uv7)) + + check := a.Multiply(v, a.Square(r)) // check = v * r^2 + + uNeg := b.Negate(u) + correctSignSqrt := check.Equal(u) + flippedSignSqrt := check.Equal(uNeg) + flippedSignSqrtI := check.Equal(uNeg.Multiply(uNeg, sqrtM1)) + + rPrime := b.Multiply(r, sqrtM1) // r_prime = SQRT_M1 * r + // r = CT_SELECT(r_prime IF flipped_sign_sqrt | flipped_sign_sqrt_i ELSE r) + r.Select(rPrime, r, flippedSignSqrt|flippedSignSqrtI) + + r.Absolute(r) // Choose the nonnegative square root. + return r, correctSignSqrt | flippedSignSqrt +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go new file mode 100644 index 00000000000..70c541692c3 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go @@ -0,0 +1,15 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +//go:build amd64 && gc && !purego + +package field + +// feMul sets out = a * b. It works like feMulGeneric. +// +//go:noescape +func feMul(out *Element, a *Element, b *Element) + +// feSquare sets out = a * a. It works like feSquareGeneric. +// +//go:noescape +func feSquare(out *Element, a *Element) diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s new file mode 100644 index 00000000000..60817acc413 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s @@ -0,0 +1,378 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +//go:build amd64 && gc && !purego + +#include "textflag.h" + +// func feMul(out *Element, a *Element, b *Element) +TEXT ·feMul(SB), NOSPLIT, $0-24 + MOVQ a+8(FP), CX + MOVQ b+16(FP), BX + + // r0 = a0×b0 + MOVQ (CX), AX + MULQ (BX) + MOVQ AX, DI + MOVQ DX, SI + + // r0 += 19×a1×b4 + MOVQ 8(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a2×b3 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a3×b2 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a4×b1 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 8(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r1 = a0×b1 + MOVQ (CX), AX + MULQ 8(BX) + MOVQ AX, R9 + MOVQ DX, R8 + + // r1 += a1×b0 + MOVQ 8(CX), AX + MULQ (BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a2×b4 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a3×b3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a4×b2 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r2 = a0×b2 + MOVQ (CX), AX + MULQ 16(BX) + MOVQ AX, R11 + MOVQ DX, R10 + + // r2 += a1×b1 + MOVQ 8(CX), AX + MULQ 8(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += a2×b0 + MOVQ 16(CX), AX + MULQ (BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a3×b4 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a4×b3 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r3 = a0×b3 + MOVQ (CX), AX + MULQ 24(BX) + MOVQ AX, R13 + MOVQ DX, R12 + + // r3 += a1×b2 + MOVQ 8(CX), AX + MULQ 16(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a2×b1 + MOVQ 16(CX), AX + MULQ 8(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a3×b0 + MOVQ 24(CX), AX + MULQ (BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += 19×a4×b4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r4 = a0×b4 + MOVQ (CX), AX + MULQ 32(BX) + MOVQ AX, R15 + MOVQ DX, R14 + + // r4 += a1×b3 + MOVQ 8(CX), AX + MULQ 24(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a2×b2 + MOVQ 16(CX), AX + MULQ 16(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a3×b1 + MOVQ 24(CX), AX + MULQ 8(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a4×b0 + MOVQ 32(CX), AX + MULQ (BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, DI, SI + SHLQ $0x0d, R9, R8 + SHLQ $0x0d, R11, R10 + SHLQ $0x0d, R13, R12 + SHLQ $0x0d, R15, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Second reduction chain (carryPropagate) + MOVQ DI, SI + SHRQ $0x33, SI + MOVQ R9, R8 + SHRQ $0x33, R8 + MOVQ R11, R10 + SHRQ $0x33, R10 + MOVQ R13, R12 + SHRQ $0x33, R12 + MOVQ R15, R14 + SHRQ $0x33, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Store output + MOVQ out+0(FP), AX + MOVQ DI, (AX) + MOVQ R9, 8(AX) + MOVQ R11, 16(AX) + MOVQ R13, 24(AX) + MOVQ R15, 32(AX) + RET + +// func feSquare(out *Element, a *Element) +TEXT ·feSquare(SB), NOSPLIT, $0-16 + MOVQ a+8(FP), CX + + // r0 = l0×l0 + MOVQ (CX), AX + MULQ (CX) + MOVQ AX, SI + MOVQ DX, BX + + // r0 += 38×l1×l4 + MOVQ 8(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r0 += 38×l2×l3 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 24(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r1 = 2×l0×l1 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 8(CX) + MOVQ AX, R8 + MOVQ DX, DI + + // r1 += 38×l2×l4 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r1 += 19×l3×l3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r2 = 2×l0×l2 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 16(CX) + MOVQ AX, R10 + MOVQ DX, R9 + + // r2 += l1×l1 + MOVQ 8(CX), AX + MULQ 8(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r2 += 38×l3×l4 + MOVQ 24(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r3 = 2×l0×l3 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 24(CX) + MOVQ AX, R12 + MOVQ DX, R11 + + // r3 += 2×l1×l2 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 16(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r3 += 19×l4×l4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r4 = 2×l0×l4 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 32(CX) + MOVQ AX, R14 + MOVQ DX, R13 + + // r4 += 2×l1×l3 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 24(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // r4 += l2×l2 + MOVQ 16(CX), AX + MULQ 16(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, SI, BX + SHLQ $0x0d, R8, DI + SHLQ $0x0d, R10, R9 + SHLQ $0x0d, R12, R11 + SHLQ $0x0d, R14, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Second reduction chain (carryPropagate) + MOVQ SI, BX + SHRQ $0x33, BX + MOVQ R8, DI + SHRQ $0x33, DI + MOVQ R10, R9 + SHRQ $0x33, R9 + MOVQ R12, R11 + SHRQ $0x33, R11 + MOVQ R14, R13 + SHRQ $0x33, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Store output + MOVQ out+0(FP), AX + MOVQ SI, (AX) + MOVQ R8, 8(AX) + MOVQ R10, 16(AX) + MOVQ R12, 24(AX) + MOVQ R14, 32(AX) + RET diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go new file mode 100644 index 00000000000..9da280d1d88 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go @@ -0,0 +1,11 @@ +// Copyright (c) 2019 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 !amd64 || !gc || purego + +package field + +func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } + +func feSquare(v, x *Element) { feSquareGeneric(v, x) } diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go new file mode 100644 index 00000000000..075fe9b9257 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go @@ -0,0 +1,15 @@ +// Copyright (c) 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 arm64 && gc && !purego + +package field + +//go:noescape +func carryPropagate(v *Element) + +func (v *Element) carryPropagate() *Element { + carryPropagate(v) + return v +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s new file mode 100644 index 00000000000..3126a434191 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s @@ -0,0 +1,42 @@ +// Copyright (c) 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 arm64 && gc && !purego + +#include "textflag.h" + +// carryPropagate works exactly like carryPropagateGeneric and uses the +// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but +// avoids loading R0-R4 twice and uses LDP and STP. +// +// See https://golang.org/issues/43145 for the main compiler issue. +// +// func carryPropagate(v *Element) +TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 + MOVD v+0(FP), R20 + + LDP 0(R20), (R0, R1) + LDP 16(R20), (R2, R3) + MOVD 32(R20), R4 + + AND $0x7ffffffffffff, R0, R10 + AND $0x7ffffffffffff, R1, R11 + AND $0x7ffffffffffff, R2, R12 + AND $0x7ffffffffffff, R3, R13 + AND $0x7ffffffffffff, R4, R14 + + ADD R0>>51, R11, R11 + ADD R1>>51, R12, R12 + ADD R2>>51, R13, R13 + ADD R3>>51, R14, R14 + // R4>>51 * 19 + R10 -> R10 + LSR $51, R4, R21 + MOVD $19, R22 + MADD R22, R10, R21, R10 + + STP (R10, R11), 0(R20) + STP (R12, R13), 16(R20) + MOVD R14, 32(R20) + + RET diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go new file mode 100644 index 00000000000..fc029ac12da --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 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 !arm64 || !gc || purego + +package field + +func (v *Element) carryPropagate() *Element { + return v.carryPropagateGeneric() +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go new file mode 100644 index 00000000000..2671217da59 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go @@ -0,0 +1,264 @@ +// Copyright (c) 2017 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 field + +import "math/bits" + +// uint128 holds a 128-bit number as two 64-bit limbs, for use with the +// bits.Mul64 and bits.Add64 intrinsics. +type uint128 struct { + lo, hi uint64 +} + +// mul64 returns a * b. +func mul64(a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + return uint128{lo, hi} +} + +// addMul64 returns v + a * b. +func addMul64(v uint128, a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + lo, c := bits.Add64(lo, v.lo, 0) + hi, _ = bits.Add64(hi, v.hi, c) + return uint128{lo, hi} +} + +// shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits. +func shiftRightBy51(a uint128) uint64 { + return (a.hi << (64 - 51)) | (a.lo >> 51) +} + +func feMulGeneric(v, a, b *Element) { + a0 := a.l0 + a1 := a.l1 + a2 := a.l2 + a3 := a.l3 + a4 := a.l4 + + b0 := b.l0 + b1 := b.l1 + b2 := b.l2 + b3 := b.l3 + b4 := b.l4 + + // Limb multiplication works like pen-and-paper columnar multiplication, but + // with 51-bit limbs instead of digits. + // + // a4 a3 a2 a1 a0 x + // b4 b3 b2 b1 b0 = + // ------------------------ + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a4b1 a3b1 a2b1 a1b1 a0b1 + + // a4b2 a3b2 a2b2 a1b2 a0b2 + + // a4b3 a3b3 a2b3 a1b3 a0b3 + + // a4b4 a3b4 a2b4 a1b4 a0b4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // We can then use the reduction identity (a * 2²⁵⁵ + b = a * 19 + b) to + // reduce the limbs that would overflow 255 bits. r5 * 2²⁵⁵ becomes 19 * r5, + // r6 * 2³⁰⁶ becomes 19 * r6 * 2⁵¹, etc. + // + // Reduction can be carried out simultaneously to multiplication. For + // example, we do not compute r5: whenever the result of a multiplication + // belongs to r5, like a1b4, we multiply it by 19 and add the result to r0. + // + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a3b1 a2b1 a1b1 a0b1 19×a4b1 + + // a2b2 a1b2 a0b2 19×a4b2 19×a3b2 + + // a1b3 a0b3 19×a4b3 19×a3b3 19×a2b3 + + // a0b4 19×a4b4 19×a3b4 19×a2b4 19×a1b4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // Finally we add up the columns into wide, overlapping limbs. + + a1_19 := a1 * 19 + a2_19 := a2 * 19 + a3_19 := a3 * 19 + a4_19 := a4 * 19 + + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + r0 := mul64(a0, b0) + r0 = addMul64(r0, a1_19, b4) + r0 = addMul64(r0, a2_19, b3) + r0 = addMul64(r0, a3_19, b2) + r0 = addMul64(r0, a4_19, b1) + + // r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2) + r1 := mul64(a0, b1) + r1 = addMul64(r1, a1, b0) + r1 = addMul64(r1, a2_19, b4) + r1 = addMul64(r1, a3_19, b3) + r1 = addMul64(r1, a4_19, b2) + + // r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3) + r2 := mul64(a0, b2) + r2 = addMul64(r2, a1, b1) + r2 = addMul64(r2, a2, b0) + r2 = addMul64(r2, a3_19, b4) + r2 = addMul64(r2, a4_19, b3) + + // r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4 + r3 := mul64(a0, b3) + r3 = addMul64(r3, a1, b2) + r3 = addMul64(r3, a2, b1) + r3 = addMul64(r3, a3, b0) + r3 = addMul64(r3, a4_19, b4) + + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + r4 := mul64(a0, b4) + r4 = addMul64(r4, a1, b3) + r4 = addMul64(r4, a2, b2) + r4 = addMul64(r4, a3, b1) + r4 = addMul64(r4, a4, b0) + + // After the multiplication, we need to reduce (carry) the five coefficients + // to obtain a result with limbs that are at most slightly larger than 2⁵¹, + // to respect the Element invariant. + // + // Overall, the reduction works the same as carryPropagate, except with + // wider inputs: we take the carry for each coefficient by shifting it right + // by 51, and add it to the limb above it. The top carry is multiplied by 19 + // according to the reduction identity and added to the lowest limb. + // + // The largest coefficient (r0) will be at most 111 bits, which guarantees + // that all carries are at most 111 - 51 = 60 bits, which fits in a uint64. + // + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + // r0 < 2⁵²×2⁵² + 19×(2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵²) + // r0 < (1 + 19 × 4) × 2⁵² × 2⁵² + // r0 < 2⁷ × 2⁵² × 2⁵² + // r0 < 2¹¹¹ + // + // Moreover, the top coefficient (r4) is at most 107 bits, so c4 is at most + // 56 bits, and c4 * 19 is at most 61 bits, which again fits in a uint64 and + // allows us to easily apply the reduction identity. + // + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + // r4 < 5 × 2⁵² × 2⁵² + // r4 < 2¹⁰⁷ + // + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + // Now all coefficients fit into 64-bit registers but are still too large to + // be passed around as a Element. We therefore do one last carry chain, + // where the carries will be small enough to fit in the wiggle room above 2⁵¹. + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +func feSquareGeneric(v, a *Element) { + l0 := a.l0 + l1 := a.l1 + l2 := a.l2 + l3 := a.l3 + l4 := a.l4 + + // Squaring works precisely like multiplication above, but thanks to its + // symmetry we get to group a few terms together. + // + // l4 l3 l2 l1 l0 x + // l4 l3 l2 l1 l0 = + // ------------------------ + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l4l1 l3l1 l2l1 l1l1 l0l1 + + // l4l2 l3l2 l2l2 l1l2 l0l2 + + // l4l3 l3l3 l2l3 l1l3 l0l3 + + // l4l4 l3l4 l2l4 l1l4 l0l4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l3l1 l2l1 l1l1 l0l1 19×l4l1 + + // l2l2 l1l2 l0l2 19×l4l2 19×l3l2 + + // l1l3 l0l3 19×l4l3 19×l3l3 19×l2l3 + + // l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with + // only three Mul64 and four Add64, instead of five and eight. + + l0_2 := l0 * 2 + l1_2 := l1 * 2 + + l1_38 := l1 * 38 + l2_38 := l2 * 38 + l3_38 := l3 * 38 + + l3_19 := l3 * 19 + l4_19 := l4 * 19 + + // r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3) + r0 := mul64(l0, l0) + r0 = addMul64(r0, l1_38, l4) + r0 = addMul64(r0, l2_38, l3) + + // r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3 + r1 := mul64(l0_2, l1) + r1 = addMul64(r1, l2_38, l4) + r1 = addMul64(r1, l3_19, l3) + + // r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4 + r2 := mul64(l0_2, l2) + r2 = addMul64(r2, l1, l1) + r2 = addMul64(r2, l3_38, l4) + + // r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4 + r3 := mul64(l0_2, l3) + r3 = addMul64(r3, l1_2, l2) + r3 = addMul64(r3, l4_19, l4) + + // r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2 + r4 := mul64(l0_2, l4) + r4 = addMul64(r4, l1_2, l3) + r4 = addMul64(r4, l2, l2) + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction +// identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. TODO inline +func (v *Element) carryPropagateGeneric() *Element { + c0 := v.l0 >> 51 + c1 := v.l1 >> 51 + c2 := v.l2 >> 51 + c3 := v.l3 >> 51 + c4 := v.l4 >> 51 + + v.l0 = v.l0&maskLow51Bits + c4*19 + v.l1 = v.l1&maskLow51Bits + c0 + v.l2 = v.l2&maskLow51Bits + c1 + v.l3 = v.l3&maskLow51Bits + c2 + v.l4 = v.l4&maskLow51Bits + c3 + + return v +} diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint new file mode 100644 index 00000000000..e3685f95cab --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint @@ -0,0 +1 @@ +b0c49ae9f59d233526f8934262c5bbbe14d4358d diff --git a/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh new file mode 100644 index 00000000000..1ba22a8b4c9 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh @@ -0,0 +1,19 @@ +#! /bin/bash +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)" + +STD_PATH=src/crypto/ed25519/internal/edwards25519/field +LOCAL_PATH=curve25519/internal/field +LAST_SYNC_REF=$(cat $LOCAL_PATH/sync.checkpoint) + +git fetch https://go.googlesource.com/go master + +if git diff --quiet $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH; then + echo "No changes." +else + NEW_REF=$(git rev-parse FETCH_HEAD | tee $LOCAL_PATH/sync.checkpoint) + echo "Applying changes from $LAST_SYNC_REF to $NEW_REF..." + git diff $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH | \ + git apply -3 --directory=$LOCAL_PATH +fi diff --git a/upstream/vendor/golang.org/x/crypto/ed25519/ed25519.go b/upstream/vendor/golang.org/x/crypto/ed25519/ed25519.go index 59b3a95a7d2..a7828345fcc 100644 --- a/upstream/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ b/upstream/vendor/golang.org/x/crypto/ed25519/ed25519.go @@ -11,7 +11,9 @@ // operations with the same key more efficient. This package refers to the RFC // 8032 private key as the “seed”. // -// This package is a wrapper around the standard library crypto/ed25519 package. +// Beginning with Go 1.13, the functionality of this package was moved to the +// standard library as crypto/ed25519. This package only acts as a compatibility +// wrapper. package ed25519 import ( diff --git a/upstream/vendor/golang.org/x/crypto/hkdf/hkdf.go b/upstream/vendor/golang.org/x/crypto/hkdf/hkdf.go index 3bee66294ec..f4ded5fee2f 100644 --- a/upstream/vendor/golang.org/x/crypto/hkdf/hkdf.go +++ b/upstream/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 +package hkdf // import "golang.org/x/crypto/hkdf" import ( "crypto/hmac" diff --git a/upstream/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go b/upstream/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go index bd896bdc76d..333da285b32 100644 --- a/upstream/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go +++ b/upstream/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.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 (!amd64 && !ppc64le && !ppc64 && !s390x) || !gc || purego +//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego package poly1305 diff --git a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s index 133757384b7..e0d3c647566 100644 --- a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s @@ -1,93 +1,108 @@ -// Code generated by command: go run sum_amd64_asm.go -out ../sum_amd64.s -pkg poly1305. DO NOT EDIT. +// 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. //go:build gc && !purego -// func update(state *macState, msg []byte) +#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) TEXT ·update(SB), $0-32 MOVQ state+0(FP), DI MOVQ msg_base+8(FP), SI MOVQ msg_len+16(FP), R15 - MOVQ (DI), R8 - MOVQ 8(DI), R9 - MOVQ 16(DI), R10 - MOVQ 24(DI), R11 - MOVQ 32(DI), R12 - CMPQ R15, $0x10 + + 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 JB bytes_between_0_and_15 loop: - ADDQ (SI), R8 - ADCQ 8(SI), R9 - ADCQ $0x01, R10 - LEAQ 16(SI), SI + POLY1305_ADD(SI, R8, R9, R10) multiply: - 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 + POLY1305_MUL(R8, R9, R10, R11, R12, BX, CX, R13, R14) + SUBQ $16, R15 + CMPQ R15, $16 + JAE loop bytes_between_0_and_15: TESTQ R15, R15 JZ done - MOVQ $0x00000001, BX + MOVQ $1, BX XORQ CX, CX XORQ R13, R13 ADDQ R15, SI flush_buffer: - SHLQ $0x08, BX, CX - SHLQ $0x08, BX + SHLQ $8, BX, CX + SHLQ $8, BX MOVB -1(SI), R13 XORQ R13, BX DECQ SI DECQ R15 JNZ flush_buffer + ADDQ BX, R8 ADCQ CX, R9 - ADCQ $0x00, R10 - MOVQ $0x00000010, R15 + ADCQ $0, R10 + MOVQ $16, R15 JMP multiply done: - MOVQ R8, (DI) + MOVQ R8, 0(DI) MOVQ R9, 8(DI) MOVQ R10, 16(DI) RET diff --git a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go similarity index 95% rename from upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go rename to upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go index 1a1679aaad9..4aec4874b50 100644 --- a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go +++ b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.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 gc && !purego && (ppc64 || ppc64le) +//go:build gc && !purego package poly1305 diff --git a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s similarity index 89% rename from upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s rename to upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s index 6899a1dabc0..b3c1699bff5 100644 --- a/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s +++ b/upstream/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s @@ -2,25 +2,15 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego && (ppc64 || ppc64le) +//go:build gc && !purego #include "textflag.h" // This was ported from the amd64 implementation. -#ifdef GOARCH_ppc64le -#define LE_MOVD MOVD -#define LE_MOVWZ MOVWZ -#define LE_MOVHZ MOVHZ -#else -#define LE_MOVD MOVDBR -#define LE_MOVWZ MOVWBR -#define LE_MOVHZ MOVHBR -#endif - #define POLY1305_ADD(msg, h0, h1, h2, t0, t1, t2) \ - LE_MOVD (msg)( R0), t0; \ - LE_MOVD (msg)(R24), t1; \ + MOVD (msg), t0; \ + MOVD 8(msg), t1; \ MOVD $1, t2; \ ADDC t0, h0, h0; \ ADDE t1, h1, h1; \ @@ -60,6 +50,10 @@ ADDE t3, h1, h1; \ ADDZE h2 +DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF +DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC +GLOBL ·poly1305Mask<>(SB), RODATA, $16 + // func update(state *[7]uint64, msg []byte) TEXT ·update(SB), $0-32 MOVD state+0(FP), R3 @@ -72,8 +66,6 @@ TEXT ·update(SB), $0-32 MOVD 24(R3), R11 // r0 MOVD 32(R3), R12 // r1 - MOVD $8, R24 - CMP R5, $16 BLT bytes_between_0_and_15 @@ -102,7 +94,7 @@ flush_buffer: // Greater than 8 -- load the rightmost remaining bytes in msg // and put into R17 (h1) - LE_MOVD (R4)(R21), R17 + MOVD (R4)(R21), R17 MOVD $16, R22 // Find the offset to those bytes @@ -126,7 +118,7 @@ just1: BLT less8 // Exactly 8 - LE_MOVD (R4), R16 + MOVD (R4), R16 CMP R17, $0 @@ -141,7 +133,7 @@ less8: MOVD $0, R22 // shift count CMP R5, $4 BLT less4 - LE_MOVWZ (R4), R16 + MOVWZ (R4), R16 ADD $4, R4 ADD $-4, R5 MOVD $32, R22 @@ -149,7 +141,7 @@ less8: less4: CMP R5, $2 BLT less2 - LE_MOVHZ (R4), R21 + MOVHZ (R4), R21 SLD R22, R21, R21 OR R16, R21, R16 ADD $16, R22 diff --git a/upstream/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go b/upstream/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go index 1fe600ad034..f3c3242a047 100644 --- a/upstream/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go +++ b/upstream/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 +package secretbox // import "golang.org/x/crypto/nacl/secretbox" import ( "golang.org/x/crypto/internal/alias" diff --git a/upstream/vendor/golang.org/x/crypto/ocsp/ocsp.go b/upstream/vendor/golang.org/x/crypto/ocsp/ocsp.go index e6c645e7ceb..bf2259537d2 100644 --- a/upstream/vendor/golang.org/x/crypto/ocsp/ocsp.go +++ b/upstream/vendor/golang.org/x/crypto/ocsp/ocsp.go @@ -5,7 +5,7 @@ // Package ocsp parses OCSP responses as specified in RFC 2560. OCSP responses // are signed messages attesting to the validity of a certificate for a small // period of time. This is used to manage revocation for X.509 certificates. -package ocsp +package ocsp // import "golang.org/x/crypto/ocsp" import ( "crypto" diff --git a/upstream/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go b/upstream/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go index 28cd99c7f3f..904b57e01d7 100644 --- a/upstream/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +++ b/upstream/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go @@ -16,7 +16,7 @@ Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To choose, you can pass the `New` functions from the different SHA packages to pbkdf2.Key. */ -package pbkdf2 +package pbkdf2 // import "golang.org/x/crypto/pbkdf2" import ( "crypto/hmac" diff --git a/upstream/vendor/golang.org/x/crypto/ripemd160/ripemd160.go b/upstream/vendor/golang.org/x/crypto/ripemd160/ripemd160.go index b6d33ef074b..cf3eeb158a9 100644 --- a/upstream/vendor/golang.org/x/crypto/ripemd160/ripemd160.go +++ b/upstream/vendor/golang.org/x/crypto/ripemd160/ripemd160.go @@ -7,7 +7,7 @@ // Deprecated: RIPEMD-160 is a legacy hash and should not be used for new // applications. Also, this package does not and will not provide an optimized // implementation. Instead, use a modern hash like SHA-256 (from crypto/sha256). -package ripemd160 +package ripemd160 // import "golang.org/x/crypto/ripemd160" // RIPEMD-160 is designed by Hans Dobbertin, Antoon Bosselaers, and Bart // Preneel with specifications available at: diff --git a/upstream/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go b/upstream/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go index 3685b344587..3fd05b27516 100644 --- a/upstream/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go +++ b/upstream/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 +package salsa // import "golang.org/x/crypto/salsa20/salsa" import "math/bits" diff --git a/upstream/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/upstream/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s index 3883e0ec229..fcce0234b69 100644 --- a/upstream/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s @@ -1,880 +1,880 @@ -// Code generated by command: go run salsa20_amd64_asm.go -out ../salsa20_amd64.s -pkg salsa. DO NOT EDIT. +// 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. //go:build amd64 && !purego && gc -// 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) +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html -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 +// 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 -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 SP,R12 + ADDQ $31, R12 + ANDQ $~31, R12 -BYTESBETWEEN1AND255: - CMPQ R9, $0x40 - JAE NOCOPY - MOVQ DI, DX - LEAQ 360(R12), DI - MOVQ R9, CX + 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 REP; MOVSB - 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 + 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 REP; MOVSB - -BYTESATLEAST64: -DONE: + BYTESATLEAST64: + DONE: RET - -BYTESATLEAST65: - SUBQ $0x40, R9 - ADDQ $0x40, DI - ADDQ $0x40, SI - JMP BYTESBETWEEN1AND255 + BYTESATLEAST65: + SUBQ $64,R9 + ADDQ $64,DI + ADDQ $64,SI + JMP BYTESBETWEEN1AND255 diff --git a/upstream/vendor/golang.org/x/crypto/scrypt/scrypt.go b/upstream/vendor/golang.org/x/crypto/scrypt/scrypt.go index 76fa40fb20a..c971a99fa67 100644 --- a/upstream/vendor/golang.org/x/crypto/scrypt/scrypt.go +++ b/upstream/vendor/golang.org/x/crypto/scrypt/scrypt.go @@ -5,7 +5,7 @@ // Package scrypt implements the scrypt key derivation function as defined in // Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard // Functions" (https://www.tarsnap.com/scrypt/scrypt.pdf). -package scrypt +package scrypt // import "golang.org/x/crypto/scrypt" import ( "crypto/sha256" diff --git a/upstream/vendor/golang.org/x/crypto/sha3/doc.go b/upstream/vendor/golang.org/x/crypto/sha3/doc.go index bbf391fe6e5..decd8cf9bf7 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/doc.go +++ b/upstream/vendor/golang.org/x/crypto/sha3/doc.go @@ -5,10 +5,6 @@ // Package sha3 implements the SHA-3 fixed-output-length hash functions and // the SHAKE variable-output-length hash functions defined by FIPS-202. // -// All types in this package also implement [encoding.BinaryMarshaler], -// [encoding.BinaryAppender] and [encoding.BinaryUnmarshaler] to marshal and -// unmarshal the internal state of the hash. -// // Both types of hash function use the "sponge" construction and the Keccak // permutation. For a detailed specification see http://keccak.noekeon.org/ // @@ -63,4 +59,4 @@ // They produce output of the same length, with the same security strengths // against all attacks. This means, in particular, that SHA3-256 only has // 128-bit collision resistance, because its output length is 32 bytes. -package sha3 +package sha3 // import "golang.org/x/crypto/sha3" diff --git a/upstream/vendor/golang.org/x/crypto/sha3/hashes.go b/upstream/vendor/golang.org/x/crypto/sha3/hashes.go index 31fffbe0440..0d8043fd2a1 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/hashes.go +++ b/upstream/vendor/golang.org/x/crypto/sha3/hashes.go @@ -9,7 +9,6 @@ package sha3 // bytes. import ( - "crypto" "hash" ) @@ -17,83 +16,53 @@ import ( // Its generic security strength is 224 bits against preimage attacks, // and 112 bits against collision attacks. func New224() hash.Hash { - return new224() + if h := new224Asm(); h != nil { + return h + } + return &state{rate: 144, outputLen: 28, dsbyte: 0x06} } // New256 creates a new SHA3-256 hash. // Its generic security strength is 256 bits against preimage attacks, // and 128 bits against collision attacks. func New256() hash.Hash { - return new256() + if h := new256Asm(); h != nil { + return h + } + return &state{rate: 136, outputLen: 32, dsbyte: 0x06} } // New384 creates a new SHA3-384 hash. // Its generic security strength is 384 bits against preimage attacks, // and 192 bits against collision attacks. func New384() hash.Hash { - return new384() + if h := new384Asm(); h != nil { + return h + } + return &state{rate: 104, outputLen: 48, dsbyte: 0x06} } // New512 creates a new SHA3-512 hash. // Its generic security strength is 512 bits against preimage attacks, // and 256 bits against collision attacks. func New512() hash.Hash { - return new512() -} - -func init() { - crypto.RegisterHash(crypto.SHA3_224, New224) - crypto.RegisterHash(crypto.SHA3_256, New256) - crypto.RegisterHash(crypto.SHA3_384, New384) - crypto.RegisterHash(crypto.SHA3_512, New512) -} - -const ( - dsbyteSHA3 = 0b00000110 - dsbyteKeccak = 0b00000001 - dsbyteShake = 0b00011111 - dsbyteCShake = 0b00000100 - - // rateK[c] is the rate in bytes for Keccak[c] where c is the capacity in - // bits. Given the sponge size is 1600 bits, the rate is 1600 - c bits. - rateK256 = (1600 - 256) / 8 - rateK448 = (1600 - 448) / 8 - rateK512 = (1600 - 512) / 8 - rateK768 = (1600 - 768) / 8 - rateK1024 = (1600 - 1024) / 8 -) - -func new224Generic() *state { - return &state{rate: rateK448, outputLen: 28, dsbyte: dsbyteSHA3} -} - -func new256Generic() *state { - return &state{rate: rateK512, outputLen: 32, dsbyte: dsbyteSHA3} -} - -func new384Generic() *state { - return &state{rate: rateK768, outputLen: 48, dsbyte: dsbyteSHA3} -} - -func new512Generic() *state { - return &state{rate: rateK1024, outputLen: 64, dsbyte: dsbyteSHA3} + if h := new512Asm(); h != nil { + return h + } + return &state{rate: 72, outputLen: 64, dsbyte: 0x06} } // NewLegacyKeccak256 creates a new Keccak-256 hash. // // Only use this function if you require compatibility with an existing cryptosystem // that uses non-standard padding. All other users should use New256 instead. -func NewLegacyKeccak256() hash.Hash { - return &state{rate: rateK512, outputLen: 32, dsbyte: dsbyteKeccak} -} +func NewLegacyKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} } // NewLegacyKeccak512 creates a new Keccak-512 hash. // // Only use this function if you require compatibility with an existing cryptosystem // that uses non-standard padding. All other users should use New512 instead. -func NewLegacyKeccak512() hash.Hash { - return &state{rate: rateK1024, outputLen: 64, dsbyte: dsbyteKeccak} -} +func NewLegacyKeccak512() hash.Hash { return &state{rate: 72, outputLen: 64, dsbyte: 0x01} } // Sum224 returns the SHA3-224 digest of the data. func Sum224(data []byte) (digest [28]byte) { diff --git a/upstream/vendor/golang.org/x/crypto/sha3/hashes_generic.go b/upstream/vendor/golang.org/x/crypto/sha3/hashes_generic.go new file mode 100644 index 00000000000..fe8c84793c0 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/hashes_generic.go @@ -0,0 +1,27 @@ +// Copyright 2017 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 !gc || purego || !s390x + +package sha3 + +import ( + "hash" +) + +// new224Asm returns an assembly implementation of SHA3-224 if available, +// otherwise it returns nil. +func new224Asm() hash.Hash { return nil } + +// new256Asm returns an assembly implementation of SHA3-256 if available, +// otherwise it returns nil. +func new256Asm() hash.Hash { return nil } + +// new384Asm returns an assembly implementation of SHA3-384 if available, +// otherwise it returns nil. +func new384Asm() hash.Hash { return nil } + +// new512Asm returns an assembly implementation of SHA3-512 if available, +// otherwise it returns nil. +func new512Asm() hash.Hash { return nil } diff --git a/upstream/vendor/golang.org/x/crypto/sha3/hashes_noasm.go b/upstream/vendor/golang.org/x/crypto/sha3/hashes_noasm.go deleted file mode 100644 index 9d85fb62144..00000000000 --- a/upstream/vendor/golang.org/x/crypto/sha3/hashes_noasm.go +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -//go:build !gc || purego || !s390x - -package sha3 - -func new224() *state { - return new224Generic() -} - -func new256() *state { - return new256Generic() -} - -func new384() *state { - return new384Generic() -} - -func new512() *state { - return new512Generic() -} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s b/upstream/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s index 99e2f16e971..1f539388619 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s +++ b/upstream/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s @@ -1,5419 +1,390 @@ -// Code generated by command: go run keccakf_amd64_asm.go -out ../keccakf_amd64.s -pkg sha3. DO NOT EDIT. +// 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. //go:build amd64 && !purego && gc +// This code was translated into a form compatible with 6a from the public +// domain sources at https://github.com/gvanas/KeccakCodePackage + +// Offsets in state +#define _ba (0*8) +#define _be (1*8) +#define _bi (2*8) +#define _bo (3*8) +#define _bu (4*8) +#define _ga (5*8) +#define _ge (6*8) +#define _gi (7*8) +#define _go (8*8) +#define _gu (9*8) +#define _ka (10*8) +#define _ke (11*8) +#define _ki (12*8) +#define _ko (13*8) +#define _ku (14*8) +#define _ma (15*8) +#define _me (16*8) +#define _mi (17*8) +#define _mo (18*8) +#define _mu (19*8) +#define _sa (20*8) +#define _se (21*8) +#define _si (22*8) +#define _so (23*8) +#define _su (24*8) + +// Temporary registers +#define rT1 AX + +// Round vars +#define rpState DI +#define rpStack SP + +#define rDa BX +#define rDe CX +#define rDi DX +#define rDo R8 +#define rDu R9 + +#define rBa R10 +#define rBe R11 +#define rBi R12 +#define rBo R13 +#define rBu R14 + +#define rCa SI +#define rCe BP +#define rCi rBi +#define rCo rBo +#define rCu R15 + +#define MOVQ_RBI_RCE MOVQ rBi, rCe +#define XORQ_RT1_RCA XORQ rT1, rCa +#define XORQ_RT1_RCE XORQ rT1, rCe +#define XORQ_RBA_RCU XORQ rBa, rCu +#define XORQ_RBE_RCU XORQ rBe, rCu +#define XORQ_RDU_RCU XORQ rDu, rCu +#define XORQ_RDA_RCA XORQ rDa, rCa +#define XORQ_RDE_RCE XORQ rDe, rCe + +#define mKeccakRound(iState, oState, rc, B_RBI_RCE, G_RT1_RCA, G_RT1_RCE, G_RBA_RCU, K_RT1_RCA, K_RT1_RCE, K_RBA_RCU, M_RT1_RCA, M_RT1_RCE, M_RBE_RCU, S_RDU_RCU, S_RDA_RCA, S_RDE_RCE) \ + /* Prepare round */ \ + MOVQ rCe, rDa; \ + ROLQ $1, rDa; \ + \ + MOVQ _bi(iState), rCi; \ + XORQ _gi(iState), rDi; \ + XORQ rCu, rDa; \ + XORQ _ki(iState), rCi; \ + XORQ _mi(iState), rDi; \ + XORQ rDi, rCi; \ + \ + MOVQ rCi, rDe; \ + ROLQ $1, rDe; \ + \ + MOVQ _bo(iState), rCo; \ + XORQ _go(iState), rDo; \ + XORQ rCa, rDe; \ + XORQ _ko(iState), rCo; \ + XORQ _mo(iState), rDo; \ + XORQ rDo, rCo; \ + \ + MOVQ rCo, rDi; \ + ROLQ $1, rDi; \ + \ + MOVQ rCu, rDo; \ + XORQ rCe, rDi; \ + ROLQ $1, rDo; \ + \ + MOVQ rCa, rDu; \ + XORQ rCi, rDo; \ + ROLQ $1, rDu; \ + \ + /* Result b */ \ + MOVQ _ba(iState), rBa; \ + MOVQ _ge(iState), rBe; \ + XORQ rCo, rDu; \ + MOVQ _ki(iState), rBi; \ + MOVQ _mo(iState), rBo; \ + MOVQ _su(iState), rBu; \ + XORQ rDe, rBe; \ + ROLQ $44, rBe; \ + XORQ rDi, rBi; \ + XORQ rDa, rBa; \ + ROLQ $43, rBi; \ + \ + MOVQ rBe, rCa; \ + MOVQ rc, rT1; \ + ORQ rBi, rCa; \ + XORQ rBa, rT1; \ + XORQ rT1, rCa; \ + MOVQ rCa, _ba(oState); \ + \ + XORQ rDu, rBu; \ + ROLQ $14, rBu; \ + MOVQ rBa, rCu; \ + ANDQ rBe, rCu; \ + XORQ rBu, rCu; \ + MOVQ rCu, _bu(oState); \ + \ + XORQ rDo, rBo; \ + ROLQ $21, rBo; \ + MOVQ rBo, rT1; \ + ANDQ rBu, rT1; \ + XORQ rBi, rT1; \ + MOVQ rT1, _bi(oState); \ + \ + NOTQ rBi; \ + ORQ rBa, rBu; \ + ORQ rBo, rBi; \ + XORQ rBo, rBu; \ + XORQ rBe, rBi; \ + MOVQ rBu, _bo(oState); \ + MOVQ rBi, _be(oState); \ + B_RBI_RCE; \ + \ + /* Result g */ \ + MOVQ _gu(iState), rBe; \ + XORQ rDu, rBe; \ + MOVQ _ka(iState), rBi; \ + ROLQ $20, rBe; \ + XORQ rDa, rBi; \ + ROLQ $3, rBi; \ + MOVQ _bo(iState), rBa; \ + MOVQ rBe, rT1; \ + ORQ rBi, rT1; \ + XORQ rDo, rBa; \ + MOVQ _me(iState), rBo; \ + MOVQ _si(iState), rBu; \ + ROLQ $28, rBa; \ + XORQ rBa, rT1; \ + MOVQ rT1, _ga(oState); \ + G_RT1_RCA; \ + \ + XORQ rDe, rBo; \ + ROLQ $45, rBo; \ + MOVQ rBi, rT1; \ + ANDQ rBo, rT1; \ + XORQ rBe, rT1; \ + MOVQ rT1, _ge(oState); \ + G_RT1_RCE; \ + \ + XORQ rDi, rBu; \ + ROLQ $61, rBu; \ + MOVQ rBu, rT1; \ + ORQ rBa, rT1; \ + XORQ rBo, rT1; \ + MOVQ rT1, _go(oState); \ + \ + ANDQ rBe, rBa; \ + XORQ rBu, rBa; \ + MOVQ rBa, _gu(oState); \ + NOTQ rBu; \ + G_RBA_RCU; \ + \ + ORQ rBu, rBo; \ + XORQ rBi, rBo; \ + MOVQ rBo, _gi(oState); \ + \ + /* Result k */ \ + MOVQ _be(iState), rBa; \ + MOVQ _gi(iState), rBe; \ + MOVQ _ko(iState), rBi; \ + MOVQ _mu(iState), rBo; \ + MOVQ _sa(iState), rBu; \ + XORQ rDi, rBe; \ + ROLQ $6, rBe; \ + XORQ rDo, rBi; \ + ROLQ $25, rBi; \ + MOVQ rBe, rT1; \ + ORQ rBi, rT1; \ + XORQ rDe, rBa; \ + ROLQ $1, rBa; \ + XORQ rBa, rT1; \ + MOVQ rT1, _ka(oState); \ + K_RT1_RCA; \ + \ + XORQ rDu, rBo; \ + ROLQ $8, rBo; \ + MOVQ rBi, rT1; \ + ANDQ rBo, rT1; \ + XORQ rBe, rT1; \ + MOVQ rT1, _ke(oState); \ + K_RT1_RCE; \ + \ + XORQ rDa, rBu; \ + ROLQ $18, rBu; \ + NOTQ rBo; \ + MOVQ rBo, rT1; \ + ANDQ rBu, rT1; \ + XORQ rBi, rT1; \ + MOVQ rT1, _ki(oState); \ + \ + MOVQ rBu, rT1; \ + ORQ rBa, rT1; \ + XORQ rBo, rT1; \ + MOVQ rT1, _ko(oState); \ + \ + ANDQ rBe, rBa; \ + XORQ rBu, rBa; \ + MOVQ rBa, _ku(oState); \ + K_RBA_RCU; \ + \ + /* Result m */ \ + MOVQ _ga(iState), rBe; \ + XORQ rDa, rBe; \ + MOVQ _ke(iState), rBi; \ + ROLQ $36, rBe; \ + XORQ rDe, rBi; \ + MOVQ _bu(iState), rBa; \ + ROLQ $10, rBi; \ + MOVQ rBe, rT1; \ + MOVQ _mi(iState), rBo; \ + ANDQ rBi, rT1; \ + XORQ rDu, rBa; \ + MOVQ _so(iState), rBu; \ + ROLQ $27, rBa; \ + XORQ rBa, rT1; \ + MOVQ rT1, _ma(oState); \ + M_RT1_RCA; \ + \ + XORQ rDi, rBo; \ + ROLQ $15, rBo; \ + MOVQ rBi, rT1; \ + ORQ rBo, rT1; \ + XORQ rBe, rT1; \ + MOVQ rT1, _me(oState); \ + M_RT1_RCE; \ + \ + XORQ rDo, rBu; \ + ROLQ $56, rBu; \ + NOTQ rBo; \ + MOVQ rBo, rT1; \ + ORQ rBu, rT1; \ + XORQ rBi, rT1; \ + MOVQ rT1, _mi(oState); \ + \ + ORQ rBa, rBe; \ + XORQ rBu, rBe; \ + MOVQ rBe, _mu(oState); \ + \ + ANDQ rBa, rBu; \ + XORQ rBo, rBu; \ + MOVQ rBu, _mo(oState); \ + M_RBE_RCU; \ + \ + /* Result s */ \ + MOVQ _bi(iState), rBa; \ + MOVQ _go(iState), rBe; \ + MOVQ _ku(iState), rBi; \ + XORQ rDi, rBa; \ + MOVQ _ma(iState), rBo; \ + ROLQ $62, rBa; \ + XORQ rDo, rBe; \ + MOVQ _se(iState), rBu; \ + ROLQ $55, rBe; \ + \ + XORQ rDu, rBi; \ + MOVQ rBa, rDu; \ + XORQ rDe, rBu; \ + ROLQ $2, rBu; \ + ANDQ rBe, rDu; \ + XORQ rBu, rDu; \ + MOVQ rDu, _su(oState); \ + \ + ROLQ $39, rBi; \ + S_RDU_RCU; \ + NOTQ rBe; \ + XORQ rDa, rBo; \ + MOVQ rBe, rDa; \ + ANDQ rBi, rDa; \ + XORQ rBa, rDa; \ + MOVQ rDa, _sa(oState); \ + S_RDA_RCA; \ + \ + ROLQ $41, rBo; \ + MOVQ rBi, rDe; \ + ORQ rBo, rDe; \ + XORQ rBe, rDe; \ + MOVQ rDe, _se(oState); \ + S_RDE_RCE; \ + \ + MOVQ rBo, rDi; \ + MOVQ rBu, rDo; \ + ANDQ rBu, rDi; \ + ORQ rBa, rDo; \ + XORQ rBi, rDi; \ + XORQ rBo, rDo; \ + MOVQ rDi, _si(oState); \ + MOVQ rDo, _so(oState) \ + // func keccakF1600(a *[25]uint64) -TEXT ·keccakF1600(SB), $200-8 - MOVQ a+0(FP), DI +TEXT ·keccakF1600(SB), 0, $200-8 + MOVQ a+0(FP), rpState // Convert the user state into an internal state - NOTQ 8(DI) - NOTQ 16(DI) - NOTQ 64(DI) - NOTQ 96(DI) - NOTQ 136(DI) - NOTQ 160(DI) + NOTQ _be(rpState) + NOTQ _bi(rpState) + NOTQ _go(rpState) + NOTQ _ki(rpState) + NOTQ _mi(rpState) + NOTQ _sa(rpState) // Execute the KeccakF permutation - MOVQ (DI), SI - MOVQ 8(DI), BP - MOVQ 32(DI), R15 - XORQ 40(DI), SI - XORQ 48(DI), BP - XORQ 72(DI), R15 - XORQ 80(DI), SI - XORQ 88(DI), BP - XORQ 112(DI), R15 - XORQ 120(DI), SI - XORQ 128(DI), BP - XORQ 152(DI), R15 - XORQ 160(DI), SI - XORQ 168(DI), BP - MOVQ 176(DI), DX - MOVQ 184(DI), R8 - XORQ 192(DI), R15 - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000000000001, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000000008082, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x800000000000808a, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000080008000, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x000000000000808b, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000080000001, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000080008081, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000008009, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x000000000000008a, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000000000088, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000080008009, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x000000008000000a, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x000000008000808b, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x800000000000008b, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000008089, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000008003, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000008002, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000000080, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x000000000000800a, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x800000008000000a, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000080008081, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000000008080, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - MOVQ R12, BP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - XORQ R10, R15 - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - XORQ R11, R15 - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(DI), R12 - XORQ 56(DI), DX - XORQ R15, BX - XORQ 96(DI), R12 - XORQ 136(DI), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(DI), R13 - XORQ 64(DI), R8 - XORQ SI, CX - XORQ 104(DI), R13 - XORQ 144(DI), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (DI), R10 - MOVQ 48(DI), R11 - XORQ R13, R9 - MOVQ 96(DI), R12 - MOVQ 144(DI), R13 - MOVQ 192(DI), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x0000000080000001, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (SP) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(SP) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(SP) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(SP) - MOVQ R12, 8(SP) - MOVQ R12, BP - - // Result g - MOVQ 72(DI), R11 - XORQ R9, R11 - MOVQ 80(DI), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(DI), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(DI), R13 - MOVQ 176(DI), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(SP) - XORQ AX, SI - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(SP) - XORQ AX, BP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(SP) - NOTQ R14 - XORQ R10, R15 - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(SP) - - // Result k - MOVQ 8(DI), R10 - MOVQ 56(DI), R11 - MOVQ 104(DI), R12 - MOVQ 152(DI), R13 - MOVQ 160(DI), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(SP) - XORQ AX, SI - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(SP) - XORQ AX, BP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(SP) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(SP) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(SP) - XORQ R10, R15 - - // Result m - MOVQ 40(DI), R11 - XORQ BX, R11 - MOVQ 88(DI), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(DI), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(DI), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(DI), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(SP) - XORQ AX, SI - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(SP) - XORQ AX, BP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(SP) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(SP) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(SP) - XORQ R11, R15 - - // Result s - MOVQ 16(DI), R10 - MOVQ 64(DI), R11 - MOVQ 112(DI), R12 - XORQ DX, R10 - MOVQ 120(DI), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(DI), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(SP) - ROLQ $0x27, R12 - XORQ R9, R15 - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(SP) - XORQ BX, SI - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(SP) - XORQ CX, BP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(SP) - MOVQ R8, 184(SP) - - // Prepare round - MOVQ BP, BX - ROLQ $0x01, BX - MOVQ 16(SP), R12 - XORQ 56(SP), DX - XORQ R15, BX - XORQ 96(SP), R12 - XORQ 136(SP), DX - XORQ DX, R12 - MOVQ R12, CX - ROLQ $0x01, CX - MOVQ 24(SP), R13 - XORQ 64(SP), R8 - XORQ SI, CX - XORQ 104(SP), R13 - XORQ 144(SP), R8 - XORQ R8, R13 - MOVQ R13, DX - ROLQ $0x01, DX - MOVQ R15, R8 - XORQ BP, DX - ROLQ $0x01, R8 - MOVQ SI, R9 - XORQ R12, R8 - ROLQ $0x01, R9 - - // Result b - MOVQ (SP), R10 - MOVQ 48(SP), R11 - XORQ R13, R9 - MOVQ 96(SP), R12 - MOVQ 144(SP), R13 - MOVQ 192(SP), R14 - XORQ CX, R11 - ROLQ $0x2c, R11 - XORQ DX, R12 - XORQ BX, R10 - ROLQ $0x2b, R12 - MOVQ R11, SI - MOVQ $0x8000000080008008, AX - ORQ R12, SI - XORQ R10, AX - XORQ AX, SI - MOVQ SI, (DI) - XORQ R9, R14 - ROLQ $0x0e, R14 - MOVQ R10, R15 - ANDQ R11, R15 - XORQ R14, R15 - MOVQ R15, 32(DI) - XORQ R8, R13 - ROLQ $0x15, R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 16(DI) - NOTQ R12 - ORQ R10, R14 - ORQ R13, R12 - XORQ R13, R14 - XORQ R11, R12 - MOVQ R14, 24(DI) - MOVQ R12, 8(DI) - NOP - - // Result g - MOVQ 72(SP), R11 - XORQ R9, R11 - MOVQ 80(SP), R12 - ROLQ $0x14, R11 - XORQ BX, R12 - ROLQ $0x03, R12 - MOVQ 24(SP), R10 - MOVQ R11, AX - ORQ R12, AX - XORQ R8, R10 - MOVQ 128(SP), R13 - MOVQ 176(SP), R14 - ROLQ $0x1c, R10 - XORQ R10, AX - MOVQ AX, 40(DI) - NOP - XORQ CX, R13 - ROLQ $0x2d, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 48(DI) - NOP - XORQ DX, R14 - ROLQ $0x3d, R14 - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 64(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 72(DI) - NOTQ R14 - NOP - ORQ R14, R13 - XORQ R12, R13 - MOVQ R13, 56(DI) - - // Result k - MOVQ 8(SP), R10 - MOVQ 56(SP), R11 - MOVQ 104(SP), R12 - MOVQ 152(SP), R13 - MOVQ 160(SP), R14 - XORQ DX, R11 - ROLQ $0x06, R11 - XORQ R8, R12 - ROLQ $0x19, R12 - MOVQ R11, AX - ORQ R12, AX - XORQ CX, R10 - ROLQ $0x01, R10 - XORQ R10, AX - MOVQ AX, 80(DI) - NOP - XORQ R9, R13 - ROLQ $0x08, R13 - MOVQ R12, AX - ANDQ R13, AX - XORQ R11, AX - MOVQ AX, 88(DI) - NOP - XORQ BX, R14 - ROLQ $0x12, R14 - NOTQ R13 - MOVQ R13, AX - ANDQ R14, AX - XORQ R12, AX - MOVQ AX, 96(DI) - MOVQ R14, AX - ORQ R10, AX - XORQ R13, AX - MOVQ AX, 104(DI) - ANDQ R11, R10 - XORQ R14, R10 - MOVQ R10, 112(DI) - NOP - - // Result m - MOVQ 40(SP), R11 - XORQ BX, R11 - MOVQ 88(SP), R12 - ROLQ $0x24, R11 - XORQ CX, R12 - MOVQ 32(SP), R10 - ROLQ $0x0a, R12 - MOVQ R11, AX - MOVQ 136(SP), R13 - ANDQ R12, AX - XORQ R9, R10 - MOVQ 184(SP), R14 - ROLQ $0x1b, R10 - XORQ R10, AX - MOVQ AX, 120(DI) - NOP - XORQ DX, R13 - ROLQ $0x0f, R13 - MOVQ R12, AX - ORQ R13, AX - XORQ R11, AX - MOVQ AX, 128(DI) - NOP - XORQ R8, R14 - ROLQ $0x38, R14 - NOTQ R13 - MOVQ R13, AX - ORQ R14, AX - XORQ R12, AX - MOVQ AX, 136(DI) - ORQ R10, R11 - XORQ R14, R11 - MOVQ R11, 152(DI) - ANDQ R10, R14 - XORQ R13, R14 - MOVQ R14, 144(DI) - NOP - - // Result s - MOVQ 16(SP), R10 - MOVQ 64(SP), R11 - MOVQ 112(SP), R12 - XORQ DX, R10 - MOVQ 120(SP), R13 - ROLQ $0x3e, R10 - XORQ R8, R11 - MOVQ 168(SP), R14 - ROLQ $0x37, R11 - XORQ R9, R12 - MOVQ R10, R9 - XORQ CX, R14 - ROLQ $0x02, R14 - ANDQ R11, R9 - XORQ R14, R9 - MOVQ R9, 192(DI) - ROLQ $0x27, R12 - NOP - NOTQ R11 - XORQ BX, R13 - MOVQ R11, BX - ANDQ R12, BX - XORQ R10, BX - MOVQ BX, 160(DI) - NOP - ROLQ $0x29, R13 - MOVQ R12, CX - ORQ R13, CX - XORQ R11, CX - MOVQ CX, 168(DI) - NOP - MOVQ R13, DX - MOVQ R14, R8 - ANDQ R14, DX - ORQ R10, R8 - XORQ R12, DX - XORQ R13, R8 - MOVQ DX, 176(DI) - MOVQ R8, 184(DI) + MOVQ _ba(rpState), rCa + MOVQ _be(rpState), rCe + MOVQ _bu(rpState), rCu + + XORQ _ga(rpState), rCa + XORQ _ge(rpState), rCe + XORQ _gu(rpState), rCu + + XORQ _ka(rpState), rCa + XORQ _ke(rpState), rCe + XORQ _ku(rpState), rCu + + XORQ _ma(rpState), rCa + XORQ _me(rpState), rCe + XORQ _mu(rpState), rCu + + XORQ _sa(rpState), rCa + XORQ _se(rpState), rCe + MOVQ _si(rpState), rDi + MOVQ _so(rpState), rDo + XORQ _su(rpState), rCu + + mKeccakRound(rpState, rpStack, $0x0000000000000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x0000000000008082, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x800000000000808a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000080008000, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x000000000000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000000008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x000000000000008a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x0000000000000088, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x0000000080008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x000000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x000000008000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x800000000000008b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x8000000000008089, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000000008003, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x8000000000008002, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000000000080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x000000000000800a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x800000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000000008080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpState, rpStack, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) + mKeccakRound(rpStack, rpState, $0x8000000080008008, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP) // Revert the internal state to the user state - NOTQ 8(DI) - NOTQ 16(DI) - NOTQ 64(DI) - NOTQ 96(DI) - NOTQ 136(DI) - NOTQ 160(DI) + NOTQ _be(rpState) + NOTQ _bi(rpState) + NOTQ _go(rpState) + NOTQ _ki(rpState) + NOTQ _mi(rpState) + NOTQ _sa(rpState) + RET diff --git a/upstream/vendor/golang.org/x/crypto/sha3/register.go b/upstream/vendor/golang.org/x/crypto/sha3/register.go new file mode 100644 index 00000000000..addfd5049bb --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/register.go @@ -0,0 +1,18 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.4 + +package sha3 + +import ( + "crypto" +) + +func init() { + crypto.RegisterHash(crypto.SHA3_224, New224) + crypto.RegisterHash(crypto.SHA3_256, New256) + crypto.RegisterHash(crypto.SHA3_384, New384) + crypto.RegisterHash(crypto.SHA3_512, New512) +} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/sha3.go b/upstream/vendor/golang.org/x/crypto/sha3/sha3.go index 6658c44479b..4884d172a49 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/sha3.go +++ b/upstream/vendor/golang.org/x/crypto/sha3/sha3.go @@ -4,15 +4,6 @@ package sha3 -import ( - "crypto/subtle" - "encoding/binary" - "errors" - "unsafe" - - "golang.org/x/sys/cpu" -) - // spongeDirection indicates the direction bytes are flowing through the sponge. type spongeDirection int @@ -23,13 +14,17 @@ const ( spongeSqueezing ) -type state struct { - a [1600 / 8]byte // main state of the hash +const ( + // maxRate is the maximum size of the internal buffer. SHAKE-256 + // currently needs the largest buffer. + maxRate = 168 +) - // a[n:rate] is the buffer. If absorbing, it's the remaining space to XOR - // into before running the permutation. If squeezing, it's the remaining - // output to produce before running the permutation. - n, rate int +type state struct { + // Generic sponge components. + a [25]uint64 // main state of the hash + buf []byte // points into storage + rate int // the number of bytes of state to use // dsbyte contains the "domain separation" bits and the first bit of // the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the @@ -45,6 +40,9 @@ type state struct { // Extendable-Output Functions (May 2014)" dsbyte byte + storage storageBuf + + // Specific to SHA-3 and SHAKE. outputLen int // the default output size in bytes state spongeDirection // whether the sponge is absorbing or squeezing } @@ -56,77 +54,103 @@ func (d *state) BlockSize() int { return d.rate } func (d *state) Size() int { return d.outputLen } // Reset clears the internal state by zeroing the sponge state and -// the buffer indexes, and setting Sponge.state to absorbing. +// the byte buffer, and setting Sponge.state to absorbing. func (d *state) Reset() { // Zero the permutation's state. for i := range d.a { d.a[i] = 0 } d.state = spongeAbsorbing - d.n = 0 + d.buf = d.storage.asBytes()[:0] } func (d *state) clone() *state { ret := *d - return &ret -} - -// permute applies the KeccakF-1600 permutation. -func (d *state) permute() { - var a *[25]uint64 - if cpu.IsBigEndian { - a = new([25]uint64) - for i := range a { - a[i] = binary.LittleEndian.Uint64(d.a[i*8:]) - } + if ret.state == spongeAbsorbing { + ret.buf = ret.storage.asBytes()[:len(ret.buf)] } else { - a = (*[25]uint64)(unsafe.Pointer(&d.a)) + ret.buf = ret.storage.asBytes()[d.rate-cap(d.buf) : d.rate] } - keccakF1600(a) - d.n = 0 + return &ret +} - if cpu.IsBigEndian { - for i := range a { - binary.LittleEndian.PutUint64(d.a[i*8:], a[i]) - } +// permute applies the KeccakF-1600 permutation. It handles +// any input-output buffering. +func (d *state) permute() { + switch d.state { + case spongeAbsorbing: + // If we're absorbing, we need to xor the input into the state + // before applying the permutation. + xorIn(d, d.buf) + d.buf = d.storage.asBytes()[:0] + keccakF1600(&d.a) + case spongeSqueezing: + // If we're squeezing, we need to apply the permutation before + // copying more output. + keccakF1600(&d.a) + d.buf = d.storage.asBytes()[:d.rate] + copyOut(d, d.buf) } } // pads appends the domain separation bits in dsbyte, applies // the multi-bitrate 10..1 padding rule, and permutes the state. -func (d *state) padAndPermute() { +func (d *state) padAndPermute(dsbyte byte) { + if d.buf == nil { + d.buf = d.storage.asBytes()[:0] + } // Pad with this instance's domain-separator bits. We know that there's - // at least one byte of space in the sponge because, if it were full, + // at least one byte of space in d.buf because, if it were full, // permute would have been called to empty it. dsbyte also contains the // first one bit for the padding. See the comment in the state struct. - d.a[d.n] ^= d.dsbyte + d.buf = append(d.buf, dsbyte) + zerosStart := len(d.buf) + d.buf = d.storage.asBytes()[:d.rate] + for i := zerosStart; i < d.rate; i++ { + d.buf[i] = 0 + } // This adds the final one bit for the padding. Because of the way that // bits are numbered from the LSB upwards, the final bit is the MSB of // the last byte. - d.a[d.rate-1] ^= 0x80 + d.buf[d.rate-1] ^= 0x80 // Apply the permutation d.permute() d.state = spongeSqueezing + d.buf = d.storage.asBytes()[:d.rate] + copyOut(d, d.buf) } // Write absorbs more data into the hash's state. It panics if any // output has already been read. -func (d *state) Write(p []byte) (n int, err error) { +func (d *state) Write(p []byte) (written int, err error) { if d.state != spongeAbsorbing { panic("sha3: Write after Read") } - - n = len(p) + if d.buf == nil { + d.buf = d.storage.asBytes()[:0] + } + written = len(p) for len(p) > 0 { - x := subtle.XORBytes(d.a[d.n:d.rate], d.a[d.n:d.rate], p) - d.n += x - p = p[x:] - - // If the sponge is full, apply the permutation. - if d.n == d.rate { - d.permute() + if len(d.buf) == 0 && len(p) >= d.rate { + // The fast path; absorb a full "rate" bytes of input and apply the permutation. + xorIn(d, p[:d.rate]) + p = p[d.rate:] + keccakF1600(&d.a) + } else { + // The slow path; buffer the input until we can fill the sponge, and then xor it in. + todo := d.rate - len(d.buf) + if todo > len(p) { + todo = len(p) + } + d.buf = append(d.buf, p[:todo]...) + p = p[todo:] + + // If the sponge is full, apply the permutation. + if len(d.buf) == d.rate { + d.permute() + } } } @@ -137,21 +161,21 @@ func (d *state) Write(p []byte) (n int, err error) { func (d *state) Read(out []byte) (n int, err error) { // If we're still absorbing, pad and apply the permutation. if d.state == spongeAbsorbing { - d.padAndPermute() + d.padAndPermute(d.dsbyte) } n = len(out) // Now, do the squeezing. for len(out) > 0 { + n := copy(out, d.buf) + d.buf = d.buf[n:] + out = out[n:] + // Apply the permutation if we've squeezed the sponge dry. - if d.n == d.rate { + if len(d.buf) == 0 { d.permute() } - - x := copy(out, d.a[d.n:d.rate]) - d.n += x - out = out[x:] } return @@ -171,74 +195,3 @@ func (d *state) Sum(in []byte) []byte { dup.Read(hash) return append(in, hash...) } - -const ( - magicSHA3 = "sha\x08" - magicShake = "sha\x09" - magicCShake = "sha\x0a" - magicKeccak = "sha\x0b" - // magic || rate || main state || n || sponge direction - marshaledSize = len(magicSHA3) + 1 + 200 + 1 + 1 -) - -func (d *state) MarshalBinary() ([]byte, error) { - return d.AppendBinary(make([]byte, 0, marshaledSize)) -} - -func (d *state) AppendBinary(b []byte) ([]byte, error) { - switch d.dsbyte { - case dsbyteSHA3: - b = append(b, magicSHA3...) - case dsbyteShake: - b = append(b, magicShake...) - case dsbyteCShake: - b = append(b, magicCShake...) - case dsbyteKeccak: - b = append(b, magicKeccak...) - default: - panic("unknown dsbyte") - } - // rate is at most 168, and n is at most rate. - b = append(b, byte(d.rate)) - b = append(b, d.a[:]...) - b = append(b, byte(d.n), byte(d.state)) - return b, nil -} - -func (d *state) UnmarshalBinary(b []byte) error { - if len(b) != marshaledSize { - return errors.New("sha3: invalid hash state") - } - - magic := string(b[:len(magicSHA3)]) - b = b[len(magicSHA3):] - switch { - case magic == magicSHA3 && d.dsbyte == dsbyteSHA3: - case magic == magicShake && d.dsbyte == dsbyteShake: - case magic == magicCShake && d.dsbyte == dsbyteCShake: - case magic == magicKeccak && d.dsbyte == dsbyteKeccak: - default: - return errors.New("sha3: invalid hash state identifier") - } - - rate := int(b[0]) - b = b[1:] - if rate != d.rate { - return errors.New("sha3: invalid hash state function") - } - - copy(d.a[:], b) - b = b[len(d.a):] - - n, state := int(b[0]), spongeDirection(b[1]) - if n > d.rate { - return errors.New("sha3: invalid hash state") - } - d.n = n - if state != spongeAbsorbing && state != spongeSqueezing { - return errors.New("sha3: invalid hash state") - } - d.state = state - - return nil -} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/sha3_s390x.go b/upstream/vendor/golang.org/x/crypto/sha3/sha3_s390x.go index 00d8034ae62..d861bca5286 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/sha3_s390x.go +++ b/upstream/vendor/golang.org/x/crypto/sha3/sha3_s390x.go @@ -143,12 +143,6 @@ func (s *asmState) Write(b []byte) (int, error) { // Read squeezes an arbitrary number of bytes from the sponge. func (s *asmState) Read(out []byte) (n int, err error) { - // The 'compute last message digest' instruction only stores the digest - // at the first operand (dst) for SHAKE functions. - if s.function != shake_128 && s.function != shake_256 { - panic("sha3: can only call Read for SHAKE functions") - } - n = len(out) // need to pad if we were absorbing @@ -208,17 +202,8 @@ func (s *asmState) Sum(b []byte) []byte { // Hash the buffer. Note that we don't clear it because we // aren't updating the state. - switch s.function { - case sha3_224, sha3_256, sha3_384, sha3_512: - klmd(s.function, &a, nil, s.buf) - return append(b, a[:s.outputLen]...) - case shake_128, shake_256: - d := make([]byte, s.outputLen, 64) - klmd(s.function, &a, d, s.buf) - return append(b, d[:s.outputLen]...) - default: - panic("sha3: unknown function") - } + klmd(s.function, &a, nil, s.buf) + return append(b, a[:s.outputLen]...) } // Reset resets the Hash to its initial state. @@ -248,56 +233,56 @@ func (s *asmState) Clone() ShakeHash { return s.clone() } -// new224 returns an assembly implementation of SHA3-224 if available, -// otherwise it returns a generic implementation. -func new224() hash.Hash { +// new224Asm returns an assembly implementation of SHA3-224 if available, +// otherwise it returns nil. +func new224Asm() hash.Hash { if cpu.S390X.HasSHA3 { return newAsmState(sha3_224) } - return new224Generic() + return nil } -// new256 returns an assembly implementation of SHA3-256 if available, -// otherwise it returns a generic implementation. -func new256() hash.Hash { +// new256Asm returns an assembly implementation of SHA3-256 if available, +// otherwise it returns nil. +func new256Asm() hash.Hash { if cpu.S390X.HasSHA3 { return newAsmState(sha3_256) } - return new256Generic() + return nil } -// new384 returns an assembly implementation of SHA3-384 if available, -// otherwise it returns a generic implementation. -func new384() hash.Hash { +// new384Asm returns an assembly implementation of SHA3-384 if available, +// otherwise it returns nil. +func new384Asm() hash.Hash { if cpu.S390X.HasSHA3 { return newAsmState(sha3_384) } - return new384Generic() + return nil } -// new512 returns an assembly implementation of SHA3-512 if available, -// otherwise it returns a generic implementation. -func new512() hash.Hash { +// new512Asm returns an assembly implementation of SHA3-512 if available, +// otherwise it returns nil. +func new512Asm() hash.Hash { if cpu.S390X.HasSHA3 { return newAsmState(sha3_512) } - return new512Generic() + return nil } -// newShake128 returns an assembly implementation of SHAKE-128 if available, -// otherwise it returns a generic implementation. -func newShake128() ShakeHash { +// newShake128Asm returns an assembly implementation of SHAKE-128 if available, +// otherwise it returns nil. +func newShake128Asm() ShakeHash { if cpu.S390X.HasSHA3 { return newAsmState(shake_128) } - return newShake128Generic() + return nil } -// newShake256 returns an assembly implementation of SHAKE-256 if available, -// otherwise it returns a generic implementation. -func newShake256() ShakeHash { +// newShake256Asm returns an assembly implementation of SHAKE-256 if available, +// otherwise it returns nil. +func newShake256Asm() ShakeHash { if cpu.S390X.HasSHA3 { return newAsmState(shake_256) } - return newShake256Generic() + return nil } diff --git a/upstream/vendor/golang.org/x/crypto/sha3/shake.go b/upstream/vendor/golang.org/x/crypto/sha3/shake.go index a6b3a4281f5..bb69984027f 100644 --- a/upstream/vendor/golang.org/x/crypto/sha3/shake.go +++ b/upstream/vendor/golang.org/x/crypto/sha3/shake.go @@ -16,12 +16,9 @@ package sha3 // [2] https://doi.org/10.6028/NIST.SP.800-185 import ( - "bytes" "encoding/binary" - "errors" "hash" "io" - "math/bits" ) // ShakeHash defines the interface to hash functions that support @@ -53,36 +50,44 @@ type cshakeState struct { initBlock []byte } -func bytepad(data []byte, rate int) []byte { - out := make([]byte, 0, 9+len(data)+rate-1) - out = append(out, leftEncode(uint64(rate))...) - out = append(out, data...) - if padlen := rate - len(out)%rate; padlen < rate { - out = append(out, make([]byte, padlen)...) - } - return out -} +// Consts for configuring initial SHA-3 state +const ( + dsbyteShake = 0x1f + dsbyteCShake = 0x04 + rate128 = 168 + rate256 = 136 +) -func leftEncode(x uint64) []byte { - // Let n be the smallest positive integer for which 2^(8n) > x. - n := (bits.Len64(x) + 7) / 8 - if n == 0 { - n = 1 +func bytepad(input []byte, w int) []byte { + // leftEncode always returns max 9 bytes + buf := make([]byte, 0, 9+len(input)+w) + buf = append(buf, leftEncode(uint64(w))...) + buf = append(buf, input...) + padlen := w - (len(buf) % w) + return append(buf, make([]byte, padlen)...) +} + +func leftEncode(value uint64) []byte { + var b [9]byte + binary.BigEndian.PutUint64(b[1:], value) + // Trim all but last leading zero bytes + i := byte(1) + for i < 8 && b[i] == 0 { + i++ } - // Return n || x with n as a byte and x an n bytes in big-endian order. - b := make([]byte, 9) - binary.BigEndian.PutUint64(b[1:], x) - b = b[9-n-1:] - b[0] = byte(n) - return b + // Prepend number of encoded bytes + b[i-1] = 9 - i + return b[i-1:] } func newCShake(N, S []byte, rate, outputLen int, dsbyte byte) ShakeHash { c := cshakeState{state: &state{rate: rate, outputLen: outputLen, dsbyte: dsbyte}} - c.initBlock = make([]byte, 0, 9+len(N)+9+len(S)) // leftEncode returns max 9 bytes - c.initBlock = append(c.initBlock, leftEncode(uint64(len(N))*8)...) + + // leftEncode returns max 9 bytes + c.initBlock = make([]byte, 0, 9*2+len(N)+len(S)) + c.initBlock = append(c.initBlock, leftEncode(uint64(len(N)*8))...) c.initBlock = append(c.initBlock, N...) - c.initBlock = append(c.initBlock, leftEncode(uint64(len(S))*8)...) + c.initBlock = append(c.initBlock, leftEncode(uint64(len(S)*8))...) c.initBlock = append(c.initBlock, S...) c.Write(bytepad(c.initBlock, c.rate)) return &c @@ -106,50 +111,24 @@ func (c *state) Clone() ShakeHash { return c.clone() } -func (c *cshakeState) MarshalBinary() ([]byte, error) { - return c.AppendBinary(make([]byte, 0, marshaledSize+len(c.initBlock))) -} - -func (c *cshakeState) AppendBinary(b []byte) ([]byte, error) { - b, err := c.state.AppendBinary(b) - if err != nil { - return nil, err - } - b = append(b, c.initBlock...) - return b, nil -} - -func (c *cshakeState) UnmarshalBinary(b []byte) error { - if len(b) <= marshaledSize { - return errors.New("sha3: invalid hash state") - } - if err := c.state.UnmarshalBinary(b[:marshaledSize]); err != nil { - return err - } - c.initBlock = bytes.Clone(b[marshaledSize:]) - return nil -} - // NewShake128 creates a new SHAKE128 variable-output-length ShakeHash. // Its generic security strength is 128 bits against all attacks if at // least 32 bytes of its output are used. func NewShake128() ShakeHash { - return newShake128() + if h := newShake128Asm(); h != nil { + return h + } + return &state{rate: rate128, outputLen: 32, dsbyte: dsbyteShake} } // NewShake256 creates a new SHAKE256 variable-output-length ShakeHash. // Its generic security strength is 256 bits against all attacks if // at least 64 bytes of its output are used. func NewShake256() ShakeHash { - return newShake256() -} - -func newShake128Generic() *state { - return &state{rate: rateK256, outputLen: 32, dsbyte: dsbyteShake} -} - -func newShake256Generic() *state { - return &state{rate: rateK512, outputLen: 64, dsbyte: dsbyteShake} + if h := newShake256Asm(); h != nil { + return h + } + return &state{rate: rate256, outputLen: 64, dsbyte: dsbyteShake} } // NewCShake128 creates a new instance of cSHAKE128 variable-output-length ShakeHash, @@ -162,7 +141,7 @@ func NewCShake128(N, S []byte) ShakeHash { if len(N) == 0 && len(S) == 0 { return NewShake128() } - return newCShake(N, S, rateK256, 32, dsbyteCShake) + return newCShake(N, S, rate128, 32, dsbyteCShake) } // NewCShake256 creates a new instance of cSHAKE256 variable-output-length ShakeHash, @@ -175,7 +154,7 @@ func NewCShake256(N, S []byte) ShakeHash { if len(N) == 0 && len(S) == 0 { return NewShake256() } - return newCShake(N, S, rateK512, 64, dsbyteCShake) + return newCShake(N, S, rate256, 64, dsbyteCShake) } // ShakeSum128 writes an arbitrary-length digest of data into hash. diff --git a/upstream/vendor/golang.org/x/crypto/sha3/shake_generic.go b/upstream/vendor/golang.org/x/crypto/sha3/shake_generic.go new file mode 100644 index 00000000000..8d31cf5be2d --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/shake_generic.go @@ -0,0 +1,19 @@ +// Copyright 2017 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 !gc || purego || !s390x + +package sha3 + +// newShake128Asm returns an assembly implementation of SHAKE-128 if available, +// otherwise it returns nil. +func newShake128Asm() ShakeHash { + return nil +} + +// newShake256Asm returns an assembly implementation of SHAKE-256 if available, +// otherwise it returns nil. +func newShake256Asm() ShakeHash { + return nil +} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/shake_noasm.go b/upstream/vendor/golang.org/x/crypto/sha3/shake_noasm.go deleted file mode 100644 index 4276ba4ab2c..00000000000 --- a/upstream/vendor/golang.org/x/crypto/sha3/shake_noasm.go +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -//go:build !gc || purego || !s390x - -package sha3 - -func newShake128() *state { - return newShake128Generic() -} - -func newShake256() *state { - return newShake256Generic() -} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/xor.go b/upstream/vendor/golang.org/x/crypto/sha3/xor.go new file mode 100644 index 00000000000..7337cca88ed --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/xor.go @@ -0,0 +1,23 @@ +// 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. + +//go:build (!amd64 && !386 && !ppc64le) || purego + +package sha3 + +// A storageBuf is an aligned array of maxRate bytes. +type storageBuf [maxRate]byte + +func (b *storageBuf) asBytes() *[maxRate]byte { + return (*[maxRate]byte)(b) +} + +var ( + xorIn = xorInGeneric + copyOut = copyOutGeneric + xorInUnaligned = xorInGeneric + copyOutUnaligned = copyOutGeneric +) + +const xorImplementationUnaligned = "generic" diff --git a/upstream/vendor/golang.org/x/crypto/sha3/xor_generic.go b/upstream/vendor/golang.org/x/crypto/sha3/xor_generic.go new file mode 100644 index 00000000000..8d947711272 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/xor_generic.go @@ -0,0 +1,28 @@ +// 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 sha3 + +import "encoding/binary" + +// xorInGeneric xors the bytes in buf into the state; it +// makes no non-portable assumptions about memory layout +// or alignment. +func xorInGeneric(d *state, buf []byte) { + n := len(buf) / 8 + + for i := 0; i < n; i++ { + a := binary.LittleEndian.Uint64(buf) + d.a[i] ^= a + buf = buf[8:] + } +} + +// copyOutGeneric copies uint64s to a byte buffer. +func copyOutGeneric(d *state, b []byte) { + for i := 0; len(b) >= 8; i++ { + binary.LittleEndian.PutUint64(b, d.a[i]) + b = b[8:] + } +} diff --git a/upstream/vendor/golang.org/x/crypto/sha3/xor_unaligned.go b/upstream/vendor/golang.org/x/crypto/sha3/xor_unaligned.go new file mode 100644 index 00000000000..870e2d16e07 --- /dev/null +++ b/upstream/vendor/golang.org/x/crypto/sha3/xor_unaligned.go @@ -0,0 +1,66 @@ +// 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. + +//go:build (amd64 || 386 || ppc64le) && !purego + +package sha3 + +import "unsafe" + +// A storageBuf is an aligned array of maxRate bytes. +type storageBuf [maxRate / 8]uint64 + +func (b *storageBuf) asBytes() *[maxRate]byte { + return (*[maxRate]byte)(unsafe.Pointer(b)) +} + +// xorInUnaligned uses unaligned reads and writes to update d.a to contain d.a +// XOR buf. +func xorInUnaligned(d *state, buf []byte) { + n := len(buf) + bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8] + if n >= 72 { + d.a[0] ^= bw[0] + d.a[1] ^= bw[1] + d.a[2] ^= bw[2] + d.a[3] ^= bw[3] + d.a[4] ^= bw[4] + d.a[5] ^= bw[5] + d.a[6] ^= bw[6] + d.a[7] ^= bw[7] + d.a[8] ^= bw[8] + } + if n >= 104 { + d.a[9] ^= bw[9] + d.a[10] ^= bw[10] + d.a[11] ^= bw[11] + d.a[12] ^= bw[12] + } + if n >= 136 { + d.a[13] ^= bw[13] + d.a[14] ^= bw[14] + d.a[15] ^= bw[15] + d.a[16] ^= bw[16] + } + if n >= 144 { + d.a[17] ^= bw[17] + } + if n >= 168 { + d.a[18] ^= bw[18] + d.a[19] ^= bw[19] + d.a[20] ^= bw[20] + } +} + +func copyOutUnaligned(d *state, buf []byte) { + ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) + copy(buf, ab[:]) +} + +var ( + xorIn = xorInUnaligned + copyOut = copyOutUnaligned +) + +const xorImplementationUnaligned = "unaligned" diff --git a/upstream/vendor/golang.org/x/crypto/ssh/agent/client.go b/upstream/vendor/golang.org/x/crypto/ssh/agent/client.go index 106708d289e..fecba8eb384 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/agent/client.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/agent/client.go @@ -10,7 +10,7 @@ // References: // // [PROTOCOL.agent]: https://tools.ietf.org/html/draft-miller-ssh-agent-00 -package agent +package agent // import "golang.org/x/crypto/ssh/agent" import ( "bytes" diff --git a/upstream/vendor/golang.org/x/crypto/ssh/agent/keyring.go b/upstream/vendor/golang.org/x/crypto/ssh/agent/keyring.go index c1b43610873..21bfa870fa4 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/agent/keyring.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/agent/keyring.go @@ -175,15 +175,6 @@ func (r *keyring) Add(key AddedKey) error { p.expire = &t } - // If we already have a Signer with the same public key, replace it with the - // new one. - for idx, k := range r.keys { - if bytes.Equal(k.signer.PublicKey().Marshal(), p.signer.PublicKey().Marshal()) { - r.keys[idx] = p - return nil - } - } - r.keys = append(r.keys, p) return nil diff --git a/upstream/vendor/golang.org/x/crypto/ssh/client_auth.go b/upstream/vendor/golang.org/x/crypto/ssh/client_auth.go index b86dde151d7..34bf089d0bb 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -71,10 +71,6 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { for auth := AuthMethod(new(noneAuth)); auth != nil; { ok, methods, err := auth.auth(sessionID, config.User, c.transport, config.Rand, extensions) if err != nil { - // On disconnect, return error immediately - if _, ok := err.(*disconnectMsg); ok { - return err - } // We return the error later if there is no other method left to // try. ok = authFailure @@ -408,10 +404,10 @@ func validateKey(key PublicKey, algo string, user string, c packetConn) (bool, e return false, err } - return confirmKeyAck(key, c) + return confirmKeyAck(key, algo, c) } -func confirmKeyAck(key PublicKey, c packetConn) (bool, error) { +func confirmKeyAck(key PublicKey, algo string, c packetConn) (bool, error) { pubKey := key.Marshal() for { @@ -429,15 +425,7 @@ func confirmKeyAck(key PublicKey, c packetConn) (bool, error) { if err := Unmarshal(packet, &msg); err != nil { return false, err } - // According to RFC 4252 Section 7 the algorithm in - // SSH_MSG_USERAUTH_PK_OK should match that of the request but some - // servers send the key type instead. OpenSSH allows any algorithm - // that matches the public key, so we do the same. - // https://github.com/openssh/openssh-portable/blob/86bdd385/sshconnect2.c#L709 - if !contains(algorithmsForKeyFormat(key.Type()), msg.Algo) { - return false, nil - } - if !bytes.Equal(msg.PubKey, pubKey) { + if msg.Algo != algo || !bytes.Equal(msg.PubKey, pubKey) { return false, nil } return true, nil @@ -555,7 +543,6 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe } gotMsgExtInfo := false - gotUserAuthInfoRequest := false for { packet, err := c.readPacket() if err != nil { @@ -586,9 +573,6 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe if msg.PartialSuccess { return authPartialSuccess, msg.Methods, nil } - if !gotUserAuthInfoRequest { - return authFailure, msg.Methods, unexpectedMessageError(msgUserAuthInfoRequest, packet[0]) - } return authFailure, msg.Methods, nil case msgUserAuthSuccess: return authSuccess, nil, nil @@ -600,7 +584,6 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe if err := Unmarshal(packet, &msg); err != nil { return authFailure, nil, err } - gotUserAuthInfoRequest = true // Manually unpack the prompt/echo pairs. rest := msg.Prompts diff --git a/upstream/vendor/golang.org/x/crypto/ssh/doc.go b/upstream/vendor/golang.org/x/crypto/ssh/doc.go index f5d352fe3a0..edbe63340d3 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/doc.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/doc.go @@ -20,4 +20,4 @@ References: This package does not fall under the stability promise of the Go language itself, so its API may be changed when pressing needs arise. */ -package ssh +package ssh // import "golang.org/x/crypto/ssh" diff --git a/upstream/vendor/golang.org/x/crypto/ssh/keys.go b/upstream/vendor/golang.org/x/crypto/ssh/keys.go index 98e6706d5d7..df4ebdada50 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/keys.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/keys.go @@ -488,49 +488,7 @@ func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { h := hash.New() h.Write(data) digest := h.Sum(nil) - - // Signatures in PKCS1v15 must match the key's modulus in - // length. However with SSH, some signers provide RSA - // signatures which are missing the MSB 0's of the bignum - // represented. With ssh-rsa signatures, this is encouraged by - // the spec (even though e.g. OpenSSH will give the full - // length unconditionally). With rsa-sha2-* signatures, the - // verifier is allowed to support these, even though they are - // out of spec. See RFC 4253 Section 6.6 for ssh-rsa and RFC - // 8332 Section 3 for rsa-sha2-* details. - // - // In practice: - // * OpenSSH always allows "short" signatures: - // https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L526 - // but always generates padded signatures: - // https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L439 - // - // * PuTTY versions 0.81 and earlier will generate short - // signatures for all RSA signature variants. Note that - // PuTTY is embedded in other software, such as WinSCP and - // FileZilla. At the time of writing, a patch has been - // applied to PuTTY to generate padded signatures for - // rsa-sha2-*, but not yet released: - // https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a5bcf3d384e1bf15a51a6923c3724cbbee022d8e - // - // * SSH.NET versions 2024.0.0 and earlier will generate short - // signatures for all RSA signature variants, fixed in 2024.1.0: - // https://github.com/sshnet/SSH.NET/releases/tag/2024.1.0 - // - // As a result, we pad these up to the key size by inserting - // leading 0's. - // - // Note that support for short signatures with rsa-sha2-* may - // be removed in the future due to such signatures not being - // allowed by the spec. - blob := sig.Blob - keySize := (*rsa.PublicKey)(r).Size() - if len(blob) < keySize { - padded := make([]byte, keySize) - copy(padded[keySize-len(blob):], blob) - blob = padded - } - return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, blob) + return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, sig.Blob) } func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { @@ -946,10 +904,6 @@ func (k *skECDSAPublicKey) Verify(data []byte, sig *Signature) error { return errors.New("ssh: signature did not verify") } -func (k *skECDSAPublicKey) CryptoPublicKey() crypto.PublicKey { - return &k.PublicKey -} - type skEd25519PublicKey struct { // application is a URL-like string, typically "ssh:" for SSH. // see openssh/PROTOCOL.u2f for details. @@ -1046,10 +1000,6 @@ func (k *skEd25519PublicKey) Verify(data []byte, sig *Signature) error { return nil } -func (k *skEd25519PublicKey) CryptoPublicKey() crypto.PublicKey { - return k.PublicKey -} - // NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, // *ecdsa.PrivateKey or any other crypto.Signer and returns a // corresponding Signer instance. ECDSA keys must use P-256, P-384 or diff --git a/upstream/vendor/golang.org/x/crypto/ssh/server.go b/upstream/vendor/golang.org/x/crypto/ssh/server.go index 5b5ccd96f45..e2ae4f891bb 100644 --- a/upstream/vendor/golang.org/x/crypto/ssh/server.go +++ b/upstream/vendor/golang.org/x/crypto/ssh/server.go @@ -149,7 +149,7 @@ func (s *ServerConfig) AddHostKey(key Signer) { } // cachedPubKey contains the results of querying whether a public key is -// acceptable for a user. This is a FIFO cache. +// acceptable for a user. type cachedPubKey struct { user string pubKeyData []byte @@ -157,13 +157,7 @@ type cachedPubKey struct { perms *Permissions } -// maxCachedPubKeys is the number of cache entries we store. -// -// Due to consistent misuse of the PublicKeyCallback API, we have reduced this -// to 1, such that the only key in the cache is the most recently seen one. This -// forces the behavior that the last call to PublicKeyCallback will always be -// with the key that is used for authentication. -const maxCachedPubKeys = 1 +const maxCachedPubKeys = 16 // pubKeyCache caches tests for public keys. Since SSH clients // will query whether a public key is acceptable before attempting to @@ -185,10 +179,9 @@ func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) { // add adds the given tuple to the cache. func (c *pubKeyCache) add(candidate cachedPubKey) { - if len(c.keys) >= maxCachedPubKeys { - c.keys = c.keys[1:] + if len(c.keys) < maxCachedPubKeys { + c.keys = append(c.keys, candidate) } - c.keys = append(c.keys, candidate) } // ServerConn is an authenticated SSH connection, as seen from the @@ -469,24 +462,6 @@ func (p *PartialSuccessError) Error() string { // It is returned in ServerAuthError.Errors from NewServerConn. var ErrNoAuth = errors.New("ssh: no auth passed yet") -// BannerError is an error that can be returned by authentication handlers in -// ServerConfig to send a banner message to the client. -type BannerError struct { - Err error - Message string -} - -func (b *BannerError) Unwrap() error { - return b.Err -} - -func (b *BannerError) Error() string { - if b.Err == nil { - return b.Message - } - return b.Err.Error() -} - func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { sessionID := s.transport.getSessionID() var cache pubKeyCache @@ -517,8 +492,8 @@ userAuthLoop: if err := s.transport.writePacket(Marshal(discMsg)); err != nil { return nil, err } - authErrs = append(authErrs, discMsg) - return nil, &ServerAuthError{Errors: authErrs} + + return nil, discMsg } var userAuthReq userAuthRequestMsg @@ -759,18 +734,6 @@ userAuthLoop: config.AuthLogCallback(s, userAuthReq.Method, authErr) } - var bannerErr *BannerError - if errors.As(authErr, &bannerErr) { - if bannerErr.Message != "" { - bannerMsg := &userAuthBannerMsg{ - Message: bannerErr.Message, - } - if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil { - return nil, err - } - } - } - if authErr == nil { break userAuthLoop } diff --git a/upstream/vendor/golang.org/x/net/LICENSE b/upstream/vendor/golang.org/x/net/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/net/LICENSE +++ b/upstream/vendor/golang.org/x/net/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/net/html/atom/atom.go b/upstream/vendor/golang.org/x/net/html/atom/atom.go deleted file mode 100644 index cd0a8ac1545..00000000000 --- a/upstream/vendor/golang.org/x/net/html/atom/atom.go +++ /dev/null @@ -1,78 +0,0 @@ -// 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. - -// Package atom provides integer codes (also known as atoms) for a fixed set of -// frequently occurring HTML strings: tag names and attribute keys such as "p" -// and "id". -// -// Sharing an atom's name between all elements with the same tag can result in -// fewer string allocations when tokenizing and parsing HTML. Integer -// comparisons are also generally faster than string comparisons. -// -// The value of an atom's particular code is not guaranteed to stay the same -// between versions of this package. Neither is any ordering guaranteed: -// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to -// be dense. The only guarantees are that e.g. looking up "div" will yield -// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0. -package atom // import "golang.org/x/net/html/atom" - -// Atom is an integer code for a string. The zero value maps to "". -type Atom uint32 - -// String returns the atom's name. -func (a Atom) String() string { - start := uint32(a >> 8) - n := uint32(a & 0xff) - if start+n > uint32(len(atomText)) { - return "" - } - return atomText[start : start+n] -} - -func (a Atom) string() string { - return atomText[a>>8 : a>>8+a&0xff] -} - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s []byte) uint32 { - for i := range s { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -func match(s string, t []byte) bool { - for i, c := range t { - if s[i] != c { - return false - } - } - return true -} - -// Lookup returns the atom whose name is s. It returns zero if there is no -// such atom. The lookup is case sensitive. -func Lookup(s []byte) Atom { - if len(s) == 0 || len(s) > maxAtomLen { - return 0 - } - h := fnv(hash0, s) - if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { - return a - } - if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { - return a - } - return 0 -} - -// String returns a string whose contents are equal to s. In that sense, it is -// equivalent to string(s) but may be more efficient. -func String(s []byte) string { - if a := Lookup(s); a != 0 { - return a.String() - } - return string(s) -} diff --git a/upstream/vendor/golang.org/x/net/html/atom/table.go b/upstream/vendor/golang.org/x/net/html/atom/table.go deleted file mode 100644 index 2a938864cb9..00000000000 --- a/upstream/vendor/golang.org/x/net/html/atom/table.go +++ /dev/null @@ -1,783 +0,0 @@ -// Code generated by go generate gen.go; DO NOT EDIT. - -//go:generate go run gen.go - -package atom - -const ( - A Atom = 0x1 - Abbr Atom = 0x4 - Accept Atom = 0x1a06 - AcceptCharset Atom = 0x1a0e - Accesskey Atom = 0x2c09 - Acronym Atom = 0xaa07 - Action Atom = 0x27206 - Address Atom = 0x6f307 - Align Atom = 0xb105 - Allowfullscreen Atom = 0x2080f - Allowpaymentrequest Atom = 0xc113 - Allowusermedia Atom = 0xdd0e - Alt Atom = 0xf303 - Annotation Atom = 0x1c90a - AnnotationXml Atom = 0x1c90e - Applet Atom = 0x31906 - Area Atom = 0x35604 - Article Atom = 0x3fc07 - As Atom = 0x3c02 - Aside Atom = 0x10705 - Async Atom = 0xff05 - Audio Atom = 0x11505 - Autocomplete Atom = 0x2780c - Autofocus Atom = 0x12109 - Autoplay Atom = 0x13c08 - B Atom = 0x101 - Base Atom = 0x3b04 - Basefont Atom = 0x3b08 - Bdi Atom = 0xba03 - Bdo Atom = 0x14b03 - Bgsound Atom = 0x15e07 - Big Atom = 0x17003 - Blink Atom = 0x17305 - Blockquote Atom = 0x1870a - Body Atom = 0x2804 - Br Atom = 0x202 - Button Atom = 0x19106 - Canvas Atom = 0x10306 - Caption Atom = 0x23107 - Center Atom = 0x22006 - Challenge Atom = 0x29b09 - Charset Atom = 0x2107 - Checked Atom = 0x47907 - Cite Atom = 0x19c04 - Class Atom = 0x56405 - Code Atom = 0x5c504 - Col Atom = 0x1ab03 - Colgroup Atom = 0x1ab08 - Color Atom = 0x1bf05 - Cols Atom = 0x1c404 - Colspan Atom = 0x1c407 - Command Atom = 0x1d707 - Content Atom = 0x58b07 - Contenteditable Atom = 0x58b0f - Contextmenu Atom = 0x3800b - Controls Atom = 0x1de08 - Coords Atom = 0x1ea06 - Crossorigin Atom = 0x1fb0b - Data Atom = 0x4a504 - Datalist Atom = 0x4a508 - Datetime Atom = 0x2b808 - Dd Atom = 0x2d702 - Default Atom = 0x10a07 - Defer Atom = 0x5c705 - Del Atom = 0x45203 - Desc Atom = 0x56104 - Details Atom = 0x7207 - Dfn Atom = 0x8703 - Dialog Atom = 0xbb06 - Dir Atom = 0x9303 - Dirname Atom = 0x9307 - Disabled Atom = 0x16408 - Div Atom = 0x16b03 - Dl Atom = 0x5e602 - Download Atom = 0x46308 - Draggable Atom = 0x17a09 - Dropzone Atom = 0x40508 - Dt Atom = 0x64b02 - Em Atom = 0x6e02 - Embed Atom = 0x6e05 - Enctype Atom = 0x28d07 - Face Atom = 0x21e04 - Fieldset Atom = 0x22608 - Figcaption Atom = 0x22e0a - Figure Atom = 0x24806 - Font Atom = 0x3f04 - Footer Atom = 0xf606 - For Atom = 0x25403 - ForeignObject Atom = 0x2540d - Foreignobject Atom = 0x2610d - Form Atom = 0x26e04 - Formaction Atom = 0x26e0a - Formenctype Atom = 0x2890b - Formmethod Atom = 0x2a40a - Formnovalidate Atom = 0x2ae0e - Formtarget Atom = 0x2c00a - Frame Atom = 0x8b05 - Frameset Atom = 0x8b08 - H1 Atom = 0x15c02 - H2 Atom = 0x2de02 - H3 Atom = 0x30d02 - H4 Atom = 0x34502 - H5 Atom = 0x34f02 - H6 Atom = 0x64d02 - Head Atom = 0x33104 - Header Atom = 0x33106 - Headers Atom = 0x33107 - Height Atom = 0x5206 - Hgroup Atom = 0x2ca06 - Hidden Atom = 0x2d506 - High Atom = 0x2db04 - Hr Atom = 0x15702 - Href Atom = 0x2e004 - Hreflang Atom = 0x2e008 - Html Atom = 0x5604 - HttpEquiv Atom = 0x2e80a - I Atom = 0x601 - Icon Atom = 0x58a04 - Id Atom = 0x10902 - Iframe Atom = 0x2fc06 - Image Atom = 0x30205 - Img Atom = 0x30703 - Input Atom = 0x44b05 - Inputmode Atom = 0x44b09 - Ins Atom = 0x20403 - Integrity Atom = 0x23f09 - Is Atom = 0x16502 - Isindex Atom = 0x30f07 - Ismap Atom = 0x31605 - Itemid Atom = 0x38b06 - Itemprop Atom = 0x19d08 - Itemref Atom = 0x3cd07 - Itemscope Atom = 0x67109 - Itemtype Atom = 0x31f08 - Kbd Atom = 0xb903 - Keygen Atom = 0x3206 - Keytype Atom = 0xd607 - Kind Atom = 0x17704 - Label Atom = 0x5905 - Lang Atom = 0x2e404 - Legend Atom = 0x18106 - Li Atom = 0xb202 - Link Atom = 0x17404 - List Atom = 0x4a904 - Listing Atom = 0x4a907 - Loop Atom = 0x5d04 - Low Atom = 0xc303 - Main Atom = 0x1004 - Malignmark Atom = 0xb00a - Manifest Atom = 0x6d708 - Map Atom = 0x31803 - Mark Atom = 0xb604 - Marquee Atom = 0x32707 - Math Atom = 0x32e04 - Max Atom = 0x33d03 - Maxlength Atom = 0x33d09 - Media Atom = 0xe605 - Mediagroup Atom = 0xe60a - Menu Atom = 0x38704 - Menuitem Atom = 0x38708 - Meta Atom = 0x4b804 - Meter Atom = 0x9805 - Method Atom = 0x2a806 - Mglyph Atom = 0x30806 - Mi Atom = 0x34702 - Min Atom = 0x34703 - Minlength Atom = 0x34709 - Mn Atom = 0x2b102 - Mo Atom = 0xa402 - Ms Atom = 0x67402 - Mtext Atom = 0x35105 - Multiple Atom = 0x35f08 - Muted Atom = 0x36705 - Name Atom = 0x9604 - Nav Atom = 0x1303 - Nobr Atom = 0x3704 - Noembed Atom = 0x6c07 - Noframes Atom = 0x8908 - Nomodule Atom = 0xa208 - Nonce Atom = 0x1a605 - Noscript Atom = 0x21608 - Novalidate Atom = 0x2b20a - Object Atom = 0x26806 - Ol Atom = 0x13702 - Onabort Atom = 0x19507 - Onafterprint Atom = 0x2360c - Onautocomplete Atom = 0x2760e - Onautocompleteerror Atom = 0x27613 - Onauxclick Atom = 0x61f0a - Onbeforeprint Atom = 0x69e0d - Onbeforeunload Atom = 0x6e70e - Onblur Atom = 0x56d06 - Oncancel Atom = 0x11908 - Oncanplay Atom = 0x14d09 - Oncanplaythrough Atom = 0x14d10 - Onchange Atom = 0x41b08 - Onclick Atom = 0x2f507 - Onclose Atom = 0x36c07 - Oncontextmenu Atom = 0x37e0d - Oncopy Atom = 0x39106 - Oncuechange Atom = 0x3970b - Oncut Atom = 0x3a205 - Ondblclick Atom = 0x3a70a - Ondrag Atom = 0x3b106 - Ondragend Atom = 0x3b109 - Ondragenter Atom = 0x3ba0b - Ondragexit Atom = 0x3c50a - Ondragleave Atom = 0x3df0b - Ondragover Atom = 0x3ea0a - Ondragstart Atom = 0x3f40b - Ondrop Atom = 0x40306 - Ondurationchange Atom = 0x41310 - Onemptied Atom = 0x40a09 - Onended Atom = 0x42307 - Onerror Atom = 0x42a07 - Onfocus Atom = 0x43107 - Onhashchange Atom = 0x43d0c - Oninput Atom = 0x44907 - Oninvalid Atom = 0x45509 - Onkeydown Atom = 0x45e09 - Onkeypress Atom = 0x46b0a - Onkeyup Atom = 0x48007 - Onlanguagechange Atom = 0x48d10 - Onload Atom = 0x49d06 - Onloadeddata Atom = 0x49d0c - Onloadedmetadata Atom = 0x4b010 - Onloadend Atom = 0x4c609 - Onloadstart Atom = 0x4cf0b - Onmessage Atom = 0x4da09 - Onmessageerror Atom = 0x4da0e - Onmousedown Atom = 0x4e80b - Onmouseenter Atom = 0x4f30c - Onmouseleave Atom = 0x4ff0c - Onmousemove Atom = 0x50b0b - Onmouseout Atom = 0x5160a - Onmouseover Atom = 0x5230b - Onmouseup Atom = 0x52e09 - Onmousewheel Atom = 0x53c0c - Onoffline Atom = 0x54809 - Ononline Atom = 0x55108 - Onpagehide Atom = 0x5590a - Onpageshow Atom = 0x5730a - Onpaste Atom = 0x57f07 - Onpause Atom = 0x59a07 - Onplay Atom = 0x5a406 - Onplaying Atom = 0x5a409 - Onpopstate Atom = 0x5ad0a - Onprogress Atom = 0x5b70a - Onratechange Atom = 0x5cc0c - Onrejectionhandled Atom = 0x5d812 - Onreset Atom = 0x5ea07 - Onresize Atom = 0x5f108 - Onscroll Atom = 0x60008 - Onsecuritypolicyviolation Atom = 0x60819 - Onseeked Atom = 0x62908 - Onseeking Atom = 0x63109 - Onselect Atom = 0x63a08 - Onshow Atom = 0x64406 - Onsort Atom = 0x64f06 - Onstalled Atom = 0x65909 - Onstorage Atom = 0x66209 - Onsubmit Atom = 0x66b08 - Onsuspend Atom = 0x67b09 - Ontimeupdate Atom = 0x400c - Ontoggle Atom = 0x68408 - Onunhandledrejection Atom = 0x68c14 - Onunload Atom = 0x6ab08 - Onvolumechange Atom = 0x6b30e - Onwaiting Atom = 0x6c109 - Onwheel Atom = 0x6ca07 - Open Atom = 0x1a304 - Optgroup Atom = 0x5f08 - Optimum Atom = 0x6d107 - Option Atom = 0x6e306 - Output Atom = 0x51d06 - P Atom = 0xc01 - Param Atom = 0xc05 - Pattern Atom = 0x6607 - Picture Atom = 0x7b07 - Ping Atom = 0xef04 - Placeholder Atom = 0x1310b - Plaintext Atom = 0x1b209 - Playsinline Atom = 0x1400b - Poster Atom = 0x2cf06 - Pre Atom = 0x47003 - Preload Atom = 0x48607 - Progress Atom = 0x5b908 - Prompt Atom = 0x53606 - Public Atom = 0x58606 - Q Atom = 0xcf01 - Radiogroup Atom = 0x30a - Rb Atom = 0x3a02 - Readonly Atom = 0x35708 - Referrerpolicy Atom = 0x3d10e - Rel Atom = 0x48703 - Required Atom = 0x24c08 - Reversed Atom = 0x8008 - Rows Atom = 0x9c04 - Rowspan Atom = 0x9c07 - Rp Atom = 0x23c02 - Rt Atom = 0x19a02 - Rtc Atom = 0x19a03 - Ruby Atom = 0xfb04 - S Atom = 0x2501 - Samp Atom = 0x7804 - Sandbox Atom = 0x12907 - Scope Atom = 0x67505 - Scoped Atom = 0x67506 - Script Atom = 0x21806 - Seamless Atom = 0x37108 - Section Atom = 0x56807 - Select Atom = 0x63c06 - Selected Atom = 0x63c08 - Shape Atom = 0x1e505 - Size Atom = 0x5f504 - Sizes Atom = 0x5f505 - Slot Atom = 0x1ef04 - Small Atom = 0x20605 - Sortable Atom = 0x65108 - Sorted Atom = 0x33706 - Source Atom = 0x37806 - Spacer Atom = 0x43706 - Span Atom = 0x9f04 - Spellcheck Atom = 0x4740a - Src Atom = 0x5c003 - Srcdoc Atom = 0x5c006 - Srclang Atom = 0x5f907 - Srcset Atom = 0x6f906 - Start Atom = 0x3fa05 - Step Atom = 0x58304 - Strike Atom = 0xd206 - Strong Atom = 0x6dd06 - Style Atom = 0x6ff05 - Sub Atom = 0x66d03 - Summary Atom = 0x70407 - Sup Atom = 0x70b03 - Svg Atom = 0x70e03 - System Atom = 0x71106 - Tabindex Atom = 0x4be08 - Table Atom = 0x59505 - Target Atom = 0x2c406 - Tbody Atom = 0x2705 - Td Atom = 0x9202 - Template Atom = 0x71408 - Textarea Atom = 0x35208 - Tfoot Atom = 0xf505 - Th Atom = 0x15602 - Thead Atom = 0x33005 - Time Atom = 0x4204 - Title Atom = 0x11005 - Tr Atom = 0xcc02 - Track Atom = 0x1ba05 - Translate Atom = 0x1f209 - Tt Atom = 0x6802 - Type Atom = 0xd904 - Typemustmatch Atom = 0x2900d - U Atom = 0xb01 - Ul Atom = 0xa702 - Updateviacache Atom = 0x460e - Usemap Atom = 0x59e06 - Value Atom = 0x1505 - Var Atom = 0x16d03 - Video Atom = 0x2f105 - Wbr Atom = 0x57c03 - Width Atom = 0x64905 - Workertype Atom = 0x71c0a - Wrap Atom = 0x72604 - Xmp Atom = 0x12f03 -) - -const hash0 = 0x81cdf10e - -const maxAtomLen = 25 - -var table = [1 << 9]Atom{ - 0x1: 0xe60a, // mediagroup - 0x2: 0x2e404, // lang - 0x4: 0x2c09, // accesskey - 0x5: 0x8b08, // frameset - 0x7: 0x63a08, // onselect - 0x8: 0x71106, // system - 0xa: 0x64905, // width - 0xc: 0x2890b, // formenctype - 0xd: 0x13702, // ol - 0xe: 0x3970b, // oncuechange - 0x10: 0x14b03, // bdo - 0x11: 0x11505, // audio - 0x12: 0x17a09, // draggable - 0x14: 0x2f105, // video - 0x15: 0x2b102, // mn - 0x16: 0x38704, // menu - 0x17: 0x2cf06, // poster - 0x19: 0xf606, // footer - 0x1a: 0x2a806, // method - 0x1b: 0x2b808, // datetime - 0x1c: 0x19507, // onabort - 0x1d: 0x460e, // updateviacache - 0x1e: 0xff05, // async - 0x1f: 0x49d06, // onload - 0x21: 0x11908, // oncancel - 0x22: 0x62908, // onseeked - 0x23: 0x30205, // image - 0x24: 0x5d812, // onrejectionhandled - 0x26: 0x17404, // link - 0x27: 0x51d06, // output - 0x28: 0x33104, // head - 0x29: 0x4ff0c, // onmouseleave - 0x2a: 0x57f07, // onpaste - 0x2b: 0x5a409, // onplaying - 0x2c: 0x1c407, // colspan - 0x2f: 0x1bf05, // color - 0x30: 0x5f504, // size - 0x31: 0x2e80a, // http-equiv - 0x33: 0x601, // i - 0x34: 0x5590a, // onpagehide - 0x35: 0x68c14, // onunhandledrejection - 0x37: 0x42a07, // onerror - 0x3a: 0x3b08, // basefont - 0x3f: 0x1303, // nav - 0x40: 0x17704, // kind - 0x41: 0x35708, // readonly - 0x42: 0x30806, // mglyph - 0x44: 0xb202, // li - 0x46: 0x2d506, // hidden - 0x47: 0x70e03, // svg - 0x48: 0x58304, // step - 0x49: 0x23f09, // integrity - 0x4a: 0x58606, // public - 0x4c: 0x1ab03, // col - 0x4d: 0x1870a, // blockquote - 0x4e: 0x34f02, // h5 - 0x50: 0x5b908, // progress - 0x51: 0x5f505, // sizes - 0x52: 0x34502, // h4 - 0x56: 0x33005, // thead - 0x57: 0xd607, // keytype - 0x58: 0x5b70a, // onprogress - 0x59: 0x44b09, // inputmode - 0x5a: 0x3b109, // ondragend - 0x5d: 0x3a205, // oncut - 0x5e: 0x43706, // spacer - 0x5f: 0x1ab08, // colgroup - 0x62: 0x16502, // is - 0x65: 0x3c02, // as - 0x66: 0x54809, // onoffline - 0x67: 0x33706, // sorted - 0x69: 0x48d10, // onlanguagechange - 0x6c: 0x43d0c, // onhashchange - 0x6d: 0x9604, // name - 0x6e: 0xf505, // tfoot - 0x6f: 0x56104, // desc - 0x70: 0x33d03, // max - 0x72: 0x1ea06, // coords - 0x73: 0x30d02, // h3 - 0x74: 0x6e70e, // onbeforeunload - 0x75: 0x9c04, // rows - 0x76: 0x63c06, // select - 0x77: 0x9805, // meter - 0x78: 0x38b06, // itemid - 0x79: 0x53c0c, // onmousewheel - 0x7a: 0x5c006, // srcdoc - 0x7d: 0x1ba05, // track - 0x7f: 0x31f08, // itemtype - 0x82: 0xa402, // mo - 0x83: 0x41b08, // onchange - 0x84: 0x33107, // headers - 0x85: 0x5cc0c, // onratechange - 0x86: 0x60819, // onsecuritypolicyviolation - 0x88: 0x4a508, // datalist - 0x89: 0x4e80b, // onmousedown - 0x8a: 0x1ef04, // slot - 0x8b: 0x4b010, // onloadedmetadata - 0x8c: 0x1a06, // accept - 0x8d: 0x26806, // object - 0x91: 0x6b30e, // onvolumechange - 0x92: 0x2107, // charset - 0x93: 0x27613, // onautocompleteerror - 0x94: 0xc113, // allowpaymentrequest - 0x95: 0x2804, // body - 0x96: 0x10a07, // default - 0x97: 0x63c08, // selected - 0x98: 0x21e04, // face - 0x99: 0x1e505, // shape - 0x9b: 0x68408, // ontoggle - 0x9e: 0x64b02, // dt - 0x9f: 0xb604, // mark - 0xa1: 0xb01, // u - 0xa4: 0x6ab08, // onunload - 0xa5: 0x5d04, // loop - 0xa6: 0x16408, // disabled - 0xaa: 0x42307, // onended - 0xab: 0xb00a, // malignmark - 0xad: 0x67b09, // onsuspend - 0xae: 0x35105, // mtext - 0xaf: 0x64f06, // onsort - 0xb0: 0x19d08, // itemprop - 0xb3: 0x67109, // itemscope - 0xb4: 0x17305, // blink - 0xb6: 0x3b106, // ondrag - 0xb7: 0xa702, // ul - 0xb8: 0x26e04, // form - 0xb9: 0x12907, // sandbox - 0xba: 0x8b05, // frame - 0xbb: 0x1505, // value - 0xbc: 0x66209, // onstorage - 0xbf: 0xaa07, // acronym - 0xc0: 0x19a02, // rt - 0xc2: 0x202, // br - 0xc3: 0x22608, // fieldset - 0xc4: 0x2900d, // typemustmatch - 0xc5: 0xa208, // nomodule - 0xc6: 0x6c07, // noembed - 0xc7: 0x69e0d, // onbeforeprint - 0xc8: 0x19106, // button - 0xc9: 0x2f507, // onclick - 0xca: 0x70407, // summary - 0xcd: 0xfb04, // ruby - 0xce: 0x56405, // class - 0xcf: 0x3f40b, // ondragstart - 0xd0: 0x23107, // caption - 0xd4: 0xdd0e, // allowusermedia - 0xd5: 0x4cf0b, // onloadstart - 0xd9: 0x16b03, // div - 0xda: 0x4a904, // list - 0xdb: 0x32e04, // math - 0xdc: 0x44b05, // input - 0xdf: 0x3ea0a, // ondragover - 0xe0: 0x2de02, // h2 - 0xe2: 0x1b209, // plaintext - 0xe4: 0x4f30c, // onmouseenter - 0xe7: 0x47907, // checked - 0xe8: 0x47003, // pre - 0xea: 0x35f08, // multiple - 0xeb: 0xba03, // bdi - 0xec: 0x33d09, // maxlength - 0xed: 0xcf01, // q - 0xee: 0x61f0a, // onauxclick - 0xf0: 0x57c03, // wbr - 0xf2: 0x3b04, // base - 0xf3: 0x6e306, // option - 0xf5: 0x41310, // ondurationchange - 0xf7: 0x8908, // noframes - 0xf9: 0x40508, // dropzone - 0xfb: 0x67505, // scope - 0xfc: 0x8008, // reversed - 0xfd: 0x3ba0b, // ondragenter - 0xfe: 0x3fa05, // start - 0xff: 0x12f03, // xmp - 0x100: 0x5f907, // srclang - 0x101: 0x30703, // img - 0x104: 0x101, // b - 0x105: 0x25403, // for - 0x106: 0x10705, // aside - 0x107: 0x44907, // oninput - 0x108: 0x35604, // area - 0x109: 0x2a40a, // formmethod - 0x10a: 0x72604, // wrap - 0x10c: 0x23c02, // rp - 0x10d: 0x46b0a, // onkeypress - 0x10e: 0x6802, // tt - 0x110: 0x34702, // mi - 0x111: 0x36705, // muted - 0x112: 0xf303, // alt - 0x113: 0x5c504, // code - 0x114: 0x6e02, // em - 0x115: 0x3c50a, // ondragexit - 0x117: 0x9f04, // span - 0x119: 0x6d708, // manifest - 0x11a: 0x38708, // menuitem - 0x11b: 0x58b07, // content - 0x11d: 0x6c109, // onwaiting - 0x11f: 0x4c609, // onloadend - 0x121: 0x37e0d, // oncontextmenu - 0x123: 0x56d06, // onblur - 0x124: 0x3fc07, // article - 0x125: 0x9303, // dir - 0x126: 0xef04, // ping - 0x127: 0x24c08, // required - 0x128: 0x45509, // oninvalid - 0x129: 0xb105, // align - 0x12b: 0x58a04, // icon - 0x12c: 0x64d02, // h6 - 0x12d: 0x1c404, // cols - 0x12e: 0x22e0a, // figcaption - 0x12f: 0x45e09, // onkeydown - 0x130: 0x66b08, // onsubmit - 0x131: 0x14d09, // oncanplay - 0x132: 0x70b03, // sup - 0x133: 0xc01, // p - 0x135: 0x40a09, // onemptied - 0x136: 0x39106, // oncopy - 0x137: 0x19c04, // cite - 0x138: 0x3a70a, // ondblclick - 0x13a: 0x50b0b, // onmousemove - 0x13c: 0x66d03, // sub - 0x13d: 0x48703, // rel - 0x13e: 0x5f08, // optgroup - 0x142: 0x9c07, // rowspan - 0x143: 0x37806, // source - 0x144: 0x21608, // noscript - 0x145: 0x1a304, // open - 0x146: 0x20403, // ins - 0x147: 0x2540d, // foreignObject - 0x148: 0x5ad0a, // onpopstate - 0x14a: 0x28d07, // enctype - 0x14b: 0x2760e, // onautocomplete - 0x14c: 0x35208, // textarea - 0x14e: 0x2780c, // autocomplete - 0x14f: 0x15702, // hr - 0x150: 0x1de08, // controls - 0x151: 0x10902, // id - 0x153: 0x2360c, // onafterprint - 0x155: 0x2610d, // foreignobject - 0x156: 0x32707, // marquee - 0x157: 0x59a07, // onpause - 0x158: 0x5e602, // dl - 0x159: 0x5206, // height - 0x15a: 0x34703, // min - 0x15b: 0x9307, // dirname - 0x15c: 0x1f209, // translate - 0x15d: 0x5604, // html - 0x15e: 0x34709, // minlength - 0x15f: 0x48607, // preload - 0x160: 0x71408, // template - 0x161: 0x3df0b, // ondragleave - 0x162: 0x3a02, // rb - 0x164: 0x5c003, // src - 0x165: 0x6dd06, // strong - 0x167: 0x7804, // samp - 0x168: 0x6f307, // address - 0x169: 0x55108, // ononline - 0x16b: 0x1310b, // placeholder - 0x16c: 0x2c406, // target - 0x16d: 0x20605, // small - 0x16e: 0x6ca07, // onwheel - 0x16f: 0x1c90a, // annotation - 0x170: 0x4740a, // spellcheck - 0x171: 0x7207, // details - 0x172: 0x10306, // canvas - 0x173: 0x12109, // autofocus - 0x174: 0xc05, // param - 0x176: 0x46308, // download - 0x177: 0x45203, // del - 0x178: 0x36c07, // onclose - 0x179: 0xb903, // kbd - 0x17a: 0x31906, // applet - 0x17b: 0x2e004, // href - 0x17c: 0x5f108, // onresize - 0x17e: 0x49d0c, // onloadeddata - 0x180: 0xcc02, // tr - 0x181: 0x2c00a, // formtarget - 0x182: 0x11005, // title - 0x183: 0x6ff05, // style - 0x184: 0xd206, // strike - 0x185: 0x59e06, // usemap - 0x186: 0x2fc06, // iframe - 0x187: 0x1004, // main - 0x189: 0x7b07, // picture - 0x18c: 0x31605, // ismap - 0x18e: 0x4a504, // data - 0x18f: 0x5905, // label - 0x191: 0x3d10e, // referrerpolicy - 0x192: 0x15602, // th - 0x194: 0x53606, // prompt - 0x195: 0x56807, // section - 0x197: 0x6d107, // optimum - 0x198: 0x2db04, // high - 0x199: 0x15c02, // h1 - 0x19a: 0x65909, // onstalled - 0x19b: 0x16d03, // var - 0x19c: 0x4204, // time - 0x19e: 0x67402, // ms - 0x19f: 0x33106, // header - 0x1a0: 0x4da09, // onmessage - 0x1a1: 0x1a605, // nonce - 0x1a2: 0x26e0a, // formaction - 0x1a3: 0x22006, // center - 0x1a4: 0x3704, // nobr - 0x1a5: 0x59505, // table - 0x1a6: 0x4a907, // listing - 0x1a7: 0x18106, // legend - 0x1a9: 0x29b09, // challenge - 0x1aa: 0x24806, // figure - 0x1ab: 0xe605, // media - 0x1ae: 0xd904, // type - 0x1af: 0x3f04, // font - 0x1b0: 0x4da0e, // onmessageerror - 0x1b1: 0x37108, // seamless - 0x1b2: 0x8703, // dfn - 0x1b3: 0x5c705, // defer - 0x1b4: 0xc303, // low - 0x1b5: 0x19a03, // rtc - 0x1b6: 0x5230b, // onmouseover - 0x1b7: 0x2b20a, // novalidate - 0x1b8: 0x71c0a, // workertype - 0x1ba: 0x3cd07, // itemref - 0x1bd: 0x1, // a - 0x1be: 0x31803, // map - 0x1bf: 0x400c, // ontimeupdate - 0x1c0: 0x15e07, // bgsound - 0x1c1: 0x3206, // keygen - 0x1c2: 0x2705, // tbody - 0x1c5: 0x64406, // onshow - 0x1c7: 0x2501, // s - 0x1c8: 0x6607, // pattern - 0x1cc: 0x14d10, // oncanplaythrough - 0x1ce: 0x2d702, // dd - 0x1cf: 0x6f906, // srcset - 0x1d0: 0x17003, // big - 0x1d2: 0x65108, // sortable - 0x1d3: 0x48007, // onkeyup - 0x1d5: 0x5a406, // onplay - 0x1d7: 0x4b804, // meta - 0x1d8: 0x40306, // ondrop - 0x1da: 0x60008, // onscroll - 0x1db: 0x1fb0b, // crossorigin - 0x1dc: 0x5730a, // onpageshow - 0x1dd: 0x4, // abbr - 0x1de: 0x9202, // td - 0x1df: 0x58b0f, // contenteditable - 0x1e0: 0x27206, // action - 0x1e1: 0x1400b, // playsinline - 0x1e2: 0x43107, // onfocus - 0x1e3: 0x2e008, // hreflang - 0x1e5: 0x5160a, // onmouseout - 0x1e6: 0x5ea07, // onreset - 0x1e7: 0x13c08, // autoplay - 0x1e8: 0x63109, // onseeking - 0x1ea: 0x67506, // scoped - 0x1ec: 0x30a, // radiogroup - 0x1ee: 0x3800b, // contextmenu - 0x1ef: 0x52e09, // onmouseup - 0x1f1: 0x2ca06, // hgroup - 0x1f2: 0x2080f, // allowfullscreen - 0x1f3: 0x4be08, // tabindex - 0x1f6: 0x30f07, // isindex - 0x1f7: 0x1a0e, // accept-charset - 0x1f8: 0x2ae0e, // formnovalidate - 0x1fb: 0x1c90e, // annotation-xml - 0x1fc: 0x6e05, // embed - 0x1fd: 0x21806, // script - 0x1fe: 0xbb06, // dialog - 0x1ff: 0x1d707, // command -} - -const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" + - "asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" + - "sampictureversedfnoframesetdirnameterowspanomoduleacronymali" + - "gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" + - "ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" + - "dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" + - "bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" + - "penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" + - "ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" + - "ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" + - "ignObjectforeignobjectformactionautocompleteerrorformenctype" + - "mustmatchallengeformmethodformnovalidatetimeformtargethgroup" + - "osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" + - "ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" + - "inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" + - "extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" + - "enterondragexitemreferrerpolicyondragleaveondragoverondragst" + - "articleondropzonemptiedondurationchangeonendedonerroronfocus" + - "paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" + - "spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" + - "onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" + - "usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" + - "seoveronmouseupromptonmousewheelonofflineononlineonpagehides" + - "classectionbluronpageshowbronpastepublicontenteditableonpaus" + - "emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" + - "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" + - "violationauxclickonseekedonseekingonselectedonshowidth6onsor" + - "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" + - "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" + - "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" + - "arysupsvgsystemplateworkertypewrap" diff --git a/upstream/vendor/golang.org/x/net/html/const.go b/upstream/vendor/golang.org/x/net/html/const.go deleted file mode 100644 index ff7acf2d5b4..00000000000 --- a/upstream/vendor/golang.org/x/net/html/const.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2011 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 html - -// Section 12.2.4.2 of the HTML5 specification says "The following elements -// have varying levels of special parsing rules". -// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements -var isSpecialElementMap = map[string]bool{ - "address": true, - "applet": true, - "area": true, - "article": true, - "aside": true, - "base": true, - "basefont": true, - "bgsound": true, - "blockquote": true, - "body": true, - "br": true, - "button": true, - "caption": true, - "center": true, - "col": true, - "colgroup": true, - "dd": true, - "details": true, - "dir": true, - "div": true, - "dl": true, - "dt": true, - "embed": true, - "fieldset": true, - "figcaption": true, - "figure": true, - "footer": true, - "form": true, - "frame": true, - "frameset": true, - "h1": true, - "h2": true, - "h3": true, - "h4": true, - "h5": true, - "h6": true, - "head": true, - "header": true, - "hgroup": true, - "hr": true, - "html": true, - "iframe": true, - "img": true, - "input": true, - "keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility. - "li": true, - "link": true, - "listing": true, - "main": true, - "marquee": true, - "menu": true, - "meta": true, - "nav": true, - "noembed": true, - "noframes": true, - "noscript": true, - "object": true, - "ol": true, - "p": true, - "param": true, - "plaintext": true, - "pre": true, - "script": true, - "section": true, - "select": true, - "source": true, - "style": true, - "summary": true, - "table": true, - "tbody": true, - "td": true, - "template": true, - "textarea": true, - "tfoot": true, - "th": true, - "thead": true, - "title": true, - "tr": true, - "track": true, - "ul": true, - "wbr": true, - "xmp": true, -} - -func isSpecialElement(element *Node) bool { - switch element.Namespace { - case "", "html": - return isSpecialElementMap[element.Data] - case "math": - switch element.Data { - case "mi", "mo", "mn", "ms", "mtext", "annotation-xml": - return true - } - case "svg": - switch element.Data { - case "foreignObject", "desc", "title": - return true - } - } - return false -} diff --git a/upstream/vendor/golang.org/x/net/html/doc.go b/upstream/vendor/golang.org/x/net/html/doc.go deleted file mode 100644 index 3a7e5ab1765..00000000000 --- a/upstream/vendor/golang.org/x/net/html/doc.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2010 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 html implements an HTML5-compliant tokenizer and parser. - -Tokenization is done by creating a Tokenizer for an io.Reader r. It is the -caller's responsibility to ensure that r provides UTF-8 encoded HTML. - - z := html.NewTokenizer(r) - -Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(), -which parses the next token and returns its type, or an error: - - for { - tt := z.Next() - if tt == html.ErrorToken { - // ... - return ... - } - // Process the current token. - } - -There are two APIs for retrieving the current token. The high-level API is to -call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs -allow optionally calling Raw after Next but before Token, Text, TagName, or -TagAttr. In EBNF notation, the valid call sequence per token is: - - Next {Raw} [ Token | Text | TagName {TagAttr} ] - -Token returns an independent data structure that completely describes a token. -Entities (such as "<") are unescaped, tag names and attribute keys are -lower-cased, and attributes are collected into a []Attribute. For example: - - for { - if z.Next() == html.ErrorToken { - // Returning io.EOF indicates success. - return z.Err() - } - emitToken(z.Token()) - } - -The low-level API performs fewer allocations and copies, but the contents of -the []byte values returned by Text, TagName and TagAttr may change on the next -call to Next. For example, to extract an HTML page's anchor text: - - depth := 0 - for { - tt := z.Next() - switch tt { - case html.ErrorToken: - return z.Err() - case html.TextToken: - if depth > 0 { - // emitBytes should copy the []byte it receives, - // if it doesn't process it immediately. - emitBytes(z.Text()) - } - case html.StartTagToken, html.EndTagToken: - tn, _ := z.TagName() - if len(tn) == 1 && tn[0] == 'a' { - if tt == html.StartTagToken { - depth++ - } else { - depth-- - } - } - } - } - -Parsing is done by calling Parse with an io.Reader, which returns the root of -the parse tree (the document element) as a *Node. It is the caller's -responsibility to ensure that the Reader provides UTF-8 encoded HTML. For -example, to process each anchor node in depth-first order: - - doc, err := html.Parse(r) - if err != nil { - // ... - } - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.ElementNode && n.Data == "a" { - // Do something with n... - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - f(doc) - -The relevant specifications include: -https://html.spec.whatwg.org/multipage/syntax.html and -https://html.spec.whatwg.org/multipage/syntax.html#tokenization - -# Security Considerations - -Care should be taken when parsing and interpreting HTML, whether full documents -or fragments, within the framework of the HTML specification, especially with -regard to untrusted inputs. - -This package provides both a tokenizer and a parser, which implement the -tokenization, and tokenization and tree construction stages of the WHATWG HTML -parsing specification respectively. While the tokenizer parses and normalizes -individual HTML tokens, only the parser constructs the DOM tree from the -tokenized HTML, as described in the tree construction stage of the -specification, dynamically modifying or extending the document's DOM tree. - -If your use case requires semantically well-formed HTML documents, as defined by -the WHATWG specification, the parser should be used rather than the tokenizer. - -In security contexts, if trust decisions are being made using the tokenized or -parsed content, the input must be re-serialized (for instance by using Render or -Token.String) in order for those trust decisions to hold, as the process of -tokenization or parsing may alter the content. -*/ -package html // import "golang.org/x/net/html" - -// The tokenization algorithm implemented by this package is not a line-by-line -// transliteration of the relatively verbose state-machine in the WHATWG -// specification. A more direct approach is used instead, where the program -// counter implies the state, such as whether it is tokenizing a tag or a text -// node. Specification compliance is verified by checking expected and actual -// outputs over a test suite rather than aiming for algorithmic fidelity. - -// TODO(nigeltao): Does a DOM API belong in this package or a separate one? -// TODO(nigeltao): How does parsing interact with a JavaScript engine? diff --git a/upstream/vendor/golang.org/x/net/html/doctype.go b/upstream/vendor/golang.org/x/net/html/doctype.go deleted file mode 100644 index c484e5a94fb..00000000000 --- a/upstream/vendor/golang.org/x/net/html/doctype.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2011 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 html - -import ( - "strings" -) - -// parseDoctype parses the data from a DoctypeToken into a name, -// public identifier, and system identifier. It returns a Node whose Type -// is DoctypeNode, whose Data is the name, and which has attributes -// named "system" and "public" for the two identifiers if they were present. -// quirks is whether the document should be parsed in "quirks mode". -func parseDoctype(s string) (n *Node, quirks bool) { - n = &Node{Type: DoctypeNode} - - // Find the name. - space := strings.IndexAny(s, whitespace) - if space == -1 { - space = len(s) - } - n.Data = s[:space] - // The comparison to "html" is case-sensitive. - if n.Data != "html" { - quirks = true - } - n.Data = strings.ToLower(n.Data) - s = strings.TrimLeft(s[space:], whitespace) - - if len(s) < 6 { - // It can't start with "PUBLIC" or "SYSTEM". - // Ignore the rest of the string. - return n, quirks || s != "" - } - - key := strings.ToLower(s[:6]) - s = s[6:] - for key == "public" || key == "system" { - s = strings.TrimLeft(s, whitespace) - if s == "" { - break - } - quote := s[0] - if quote != '"' && quote != '\'' { - break - } - s = s[1:] - q := strings.IndexRune(s, rune(quote)) - var id string - if q == -1 { - id = s - s = "" - } else { - id = s[:q] - s = s[q+1:] - } - n.Attr = append(n.Attr, Attribute{Key: key, Val: id}) - if key == "public" { - key = "system" - } else { - key = "" - } - } - - if key != "" || s != "" { - quirks = true - } else if len(n.Attr) > 0 { - if n.Attr[0].Key == "public" { - public := strings.ToLower(n.Attr[0].Val) - switch public { - case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html": - quirks = true - default: - for _, q := range quirkyIDs { - if strings.HasPrefix(public, q) { - quirks = true - break - } - } - } - // The following two public IDs only cause quirks mode if there is no system ID. - if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") || - strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) { - quirks = true - } - } - if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && - strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { - quirks = true - } - } - - return n, quirks -} - -// quirkyIDs is a list of public doctype identifiers that cause a document -// to be interpreted in quirks mode. The identifiers should be in lower case. -var quirkyIDs = []string{ - "+//silmaril//dtd html pro v0r11 19970101//", - "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", - "-//as//dtd html 3.0 aswedit + extensions//", - "-//ietf//dtd html 2.0 level 1//", - "-//ietf//dtd html 2.0 level 2//", - "-//ietf//dtd html 2.0 strict level 1//", - "-//ietf//dtd html 2.0 strict level 2//", - "-//ietf//dtd html 2.0 strict//", - "-//ietf//dtd html 2.0//", - "-//ietf//dtd html 2.1e//", - "-//ietf//dtd html 3.0//", - "-//ietf//dtd html 3.2 final//", - "-//ietf//dtd html 3.2//", - "-//ietf//dtd html 3//", - "-//ietf//dtd html level 0//", - "-//ietf//dtd html level 1//", - "-//ietf//dtd html level 2//", - "-//ietf//dtd html level 3//", - "-//ietf//dtd html strict level 0//", - "-//ietf//dtd html strict level 1//", - "-//ietf//dtd html strict level 2//", - "-//ietf//dtd html strict level 3//", - "-//ietf//dtd html strict//", - "-//ietf//dtd html//", - "-//metrius//dtd metrius presentational//", - "-//microsoft//dtd internet explorer 2.0 html strict//", - "-//microsoft//dtd internet explorer 2.0 html//", - "-//microsoft//dtd internet explorer 2.0 tables//", - "-//microsoft//dtd internet explorer 3.0 html strict//", - "-//microsoft//dtd internet explorer 3.0 html//", - "-//microsoft//dtd internet explorer 3.0 tables//", - "-//netscape comm. corp.//dtd html//", - "-//netscape comm. corp.//dtd strict html//", - "-//o'reilly and associates//dtd html 2.0//", - "-//o'reilly and associates//dtd html extended 1.0//", - "-//o'reilly and associates//dtd html extended relaxed 1.0//", - "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", - "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", - "-//spyglass//dtd html 2.0 extended//", - "-//sq//dtd html 2.0 hotmetal + extensions//", - "-//sun microsystems corp.//dtd hotjava html//", - "-//sun microsystems corp.//dtd hotjava strict html//", - "-//w3c//dtd html 3 1995-03-24//", - "-//w3c//dtd html 3.2 draft//", - "-//w3c//dtd html 3.2 final//", - "-//w3c//dtd html 3.2//", - "-//w3c//dtd html 3.2s draft//", - "-//w3c//dtd html 4.0 frameset//", - "-//w3c//dtd html 4.0 transitional//", - "-//w3c//dtd html experimental 19960712//", - "-//w3c//dtd html experimental 970421//", - "-//w3c//dtd w3 html//", - "-//w3o//dtd w3 html 3.0//", - "-//webtechs//dtd mozilla html 2.0//", - "-//webtechs//dtd mozilla html//", -} diff --git a/upstream/vendor/golang.org/x/net/html/entity.go b/upstream/vendor/golang.org/x/net/html/entity.go deleted file mode 100644 index b628880a014..00000000000 --- a/upstream/vendor/golang.org/x/net/html/entity.go +++ /dev/null @@ -1,2253 +0,0 @@ -// Copyright 2010 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 html - -// All entities that do not end with ';' are 6 or fewer bytes long. -const longestEntityWithoutSemicolon = 6 - -// entity is a map from HTML entity names to their values. The semicolon matters: -// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references -// lists both "amp" and "amp;" as two separate entries. -// -// Note that the HTML5 list is larger than the HTML4 list at -// http://www.w3.org/TR/html4/sgml/entities.html -var entity = map[string]rune{ - "AElig;": '\U000000C6', - "AMP;": '\U00000026', - "Aacute;": '\U000000C1', - "Abreve;": '\U00000102', - "Acirc;": '\U000000C2', - "Acy;": '\U00000410', - "Afr;": '\U0001D504', - "Agrave;": '\U000000C0', - "Alpha;": '\U00000391', - "Amacr;": '\U00000100', - "And;": '\U00002A53', - "Aogon;": '\U00000104', - "Aopf;": '\U0001D538', - "ApplyFunction;": '\U00002061', - "Aring;": '\U000000C5', - "Ascr;": '\U0001D49C', - "Assign;": '\U00002254', - "Atilde;": '\U000000C3', - "Auml;": '\U000000C4', - "Backslash;": '\U00002216', - "Barv;": '\U00002AE7', - "Barwed;": '\U00002306', - "Bcy;": '\U00000411', - "Because;": '\U00002235', - "Bernoullis;": '\U0000212C', - "Beta;": '\U00000392', - "Bfr;": '\U0001D505', - "Bopf;": '\U0001D539', - "Breve;": '\U000002D8', - "Bscr;": '\U0000212C', - "Bumpeq;": '\U0000224E', - "CHcy;": '\U00000427', - "COPY;": '\U000000A9', - "Cacute;": '\U00000106', - "Cap;": '\U000022D2', - "CapitalDifferentialD;": '\U00002145', - "Cayleys;": '\U0000212D', - "Ccaron;": '\U0000010C', - "Ccedil;": '\U000000C7', - "Ccirc;": '\U00000108', - "Cconint;": '\U00002230', - "Cdot;": '\U0000010A', - "Cedilla;": '\U000000B8', - "CenterDot;": '\U000000B7', - "Cfr;": '\U0000212D', - "Chi;": '\U000003A7', - "CircleDot;": '\U00002299', - "CircleMinus;": '\U00002296', - "CirclePlus;": '\U00002295', - "CircleTimes;": '\U00002297', - "ClockwiseContourIntegral;": '\U00002232', - "CloseCurlyDoubleQuote;": '\U0000201D', - "CloseCurlyQuote;": '\U00002019', - "Colon;": '\U00002237', - "Colone;": '\U00002A74', - "Congruent;": '\U00002261', - "Conint;": '\U0000222F', - "ContourIntegral;": '\U0000222E', - "Copf;": '\U00002102', - "Coproduct;": '\U00002210', - "CounterClockwiseContourIntegral;": '\U00002233', - "Cross;": '\U00002A2F', - "Cscr;": '\U0001D49E', - "Cup;": '\U000022D3', - "CupCap;": '\U0000224D', - "DD;": '\U00002145', - "DDotrahd;": '\U00002911', - "DJcy;": '\U00000402', - "DScy;": '\U00000405', - "DZcy;": '\U0000040F', - "Dagger;": '\U00002021', - "Darr;": '\U000021A1', - "Dashv;": '\U00002AE4', - "Dcaron;": '\U0000010E', - "Dcy;": '\U00000414', - "Del;": '\U00002207', - "Delta;": '\U00000394', - "Dfr;": '\U0001D507', - "DiacriticalAcute;": '\U000000B4', - "DiacriticalDot;": '\U000002D9', - "DiacriticalDoubleAcute;": '\U000002DD', - "DiacriticalGrave;": '\U00000060', - "DiacriticalTilde;": '\U000002DC', - "Diamond;": '\U000022C4', - "DifferentialD;": '\U00002146', - "Dopf;": '\U0001D53B', - "Dot;": '\U000000A8', - "DotDot;": '\U000020DC', - "DotEqual;": '\U00002250', - "DoubleContourIntegral;": '\U0000222F', - "DoubleDot;": '\U000000A8', - "DoubleDownArrow;": '\U000021D3', - "DoubleLeftArrow;": '\U000021D0', - "DoubleLeftRightArrow;": '\U000021D4', - "DoubleLeftTee;": '\U00002AE4', - "DoubleLongLeftArrow;": '\U000027F8', - "DoubleLongLeftRightArrow;": '\U000027FA', - "DoubleLongRightArrow;": '\U000027F9', - "DoubleRightArrow;": '\U000021D2', - "DoubleRightTee;": '\U000022A8', - "DoubleUpArrow;": '\U000021D1', - "DoubleUpDownArrow;": '\U000021D5', - "DoubleVerticalBar;": '\U00002225', - "DownArrow;": '\U00002193', - "DownArrowBar;": '\U00002913', - "DownArrowUpArrow;": '\U000021F5', - "DownBreve;": '\U00000311', - "DownLeftRightVector;": '\U00002950', - "DownLeftTeeVector;": '\U0000295E', - "DownLeftVector;": '\U000021BD', - "DownLeftVectorBar;": '\U00002956', - "DownRightTeeVector;": '\U0000295F', - "DownRightVector;": '\U000021C1', - "DownRightVectorBar;": '\U00002957', - "DownTee;": '\U000022A4', - "DownTeeArrow;": '\U000021A7', - "Downarrow;": '\U000021D3', - "Dscr;": '\U0001D49F', - "Dstrok;": '\U00000110', - "ENG;": '\U0000014A', - "ETH;": '\U000000D0', - "Eacute;": '\U000000C9', - "Ecaron;": '\U0000011A', - "Ecirc;": '\U000000CA', - "Ecy;": '\U0000042D', - "Edot;": '\U00000116', - "Efr;": '\U0001D508', - "Egrave;": '\U000000C8', - "Element;": '\U00002208', - "Emacr;": '\U00000112', - "EmptySmallSquare;": '\U000025FB', - "EmptyVerySmallSquare;": '\U000025AB', - "Eogon;": '\U00000118', - "Eopf;": '\U0001D53C', - "Epsilon;": '\U00000395', - "Equal;": '\U00002A75', - "EqualTilde;": '\U00002242', - "Equilibrium;": '\U000021CC', - "Escr;": '\U00002130', - "Esim;": '\U00002A73', - "Eta;": '\U00000397', - "Euml;": '\U000000CB', - "Exists;": '\U00002203', - "ExponentialE;": '\U00002147', - "Fcy;": '\U00000424', - "Ffr;": '\U0001D509', - "FilledSmallSquare;": '\U000025FC', - "FilledVerySmallSquare;": '\U000025AA', - "Fopf;": '\U0001D53D', - "ForAll;": '\U00002200', - "Fouriertrf;": '\U00002131', - "Fscr;": '\U00002131', - "GJcy;": '\U00000403', - "GT;": '\U0000003E', - "Gamma;": '\U00000393', - "Gammad;": '\U000003DC', - "Gbreve;": '\U0000011E', - "Gcedil;": '\U00000122', - "Gcirc;": '\U0000011C', - "Gcy;": '\U00000413', - "Gdot;": '\U00000120', - "Gfr;": '\U0001D50A', - "Gg;": '\U000022D9', - "Gopf;": '\U0001D53E', - "GreaterEqual;": '\U00002265', - "GreaterEqualLess;": '\U000022DB', - "GreaterFullEqual;": '\U00002267', - "GreaterGreater;": '\U00002AA2', - "GreaterLess;": '\U00002277', - "GreaterSlantEqual;": '\U00002A7E', - "GreaterTilde;": '\U00002273', - "Gscr;": '\U0001D4A2', - "Gt;": '\U0000226B', - "HARDcy;": '\U0000042A', - "Hacek;": '\U000002C7', - "Hat;": '\U0000005E', - "Hcirc;": '\U00000124', - "Hfr;": '\U0000210C', - "HilbertSpace;": '\U0000210B', - "Hopf;": '\U0000210D', - "HorizontalLine;": '\U00002500', - "Hscr;": '\U0000210B', - "Hstrok;": '\U00000126', - "HumpDownHump;": '\U0000224E', - "HumpEqual;": '\U0000224F', - "IEcy;": '\U00000415', - "IJlig;": '\U00000132', - "IOcy;": '\U00000401', - "Iacute;": '\U000000CD', - "Icirc;": '\U000000CE', - "Icy;": '\U00000418', - "Idot;": '\U00000130', - "Ifr;": '\U00002111', - "Igrave;": '\U000000CC', - "Im;": '\U00002111', - "Imacr;": '\U0000012A', - "ImaginaryI;": '\U00002148', - "Implies;": '\U000021D2', - "Int;": '\U0000222C', - "Integral;": '\U0000222B', - "Intersection;": '\U000022C2', - "InvisibleComma;": '\U00002063', - "InvisibleTimes;": '\U00002062', - "Iogon;": '\U0000012E', - "Iopf;": '\U0001D540', - "Iota;": '\U00000399', - "Iscr;": '\U00002110', - "Itilde;": '\U00000128', - "Iukcy;": '\U00000406', - "Iuml;": '\U000000CF', - "Jcirc;": '\U00000134', - "Jcy;": '\U00000419', - "Jfr;": '\U0001D50D', - "Jopf;": '\U0001D541', - "Jscr;": '\U0001D4A5', - "Jsercy;": '\U00000408', - "Jukcy;": '\U00000404', - "KHcy;": '\U00000425', - "KJcy;": '\U0000040C', - "Kappa;": '\U0000039A', - "Kcedil;": '\U00000136', - "Kcy;": '\U0000041A', - "Kfr;": '\U0001D50E', - "Kopf;": '\U0001D542', - "Kscr;": '\U0001D4A6', - "LJcy;": '\U00000409', - "LT;": '\U0000003C', - "Lacute;": '\U00000139', - "Lambda;": '\U0000039B', - "Lang;": '\U000027EA', - "Laplacetrf;": '\U00002112', - "Larr;": '\U0000219E', - "Lcaron;": '\U0000013D', - "Lcedil;": '\U0000013B', - "Lcy;": '\U0000041B', - "LeftAngleBracket;": '\U000027E8', - "LeftArrow;": '\U00002190', - "LeftArrowBar;": '\U000021E4', - "LeftArrowRightArrow;": '\U000021C6', - "LeftCeiling;": '\U00002308', - "LeftDoubleBracket;": '\U000027E6', - "LeftDownTeeVector;": '\U00002961', - "LeftDownVector;": '\U000021C3', - "LeftDownVectorBar;": '\U00002959', - "LeftFloor;": '\U0000230A', - "LeftRightArrow;": '\U00002194', - "LeftRightVector;": '\U0000294E', - "LeftTee;": '\U000022A3', - "LeftTeeArrow;": '\U000021A4', - "LeftTeeVector;": '\U0000295A', - "LeftTriangle;": '\U000022B2', - "LeftTriangleBar;": '\U000029CF', - "LeftTriangleEqual;": '\U000022B4', - "LeftUpDownVector;": '\U00002951', - "LeftUpTeeVector;": '\U00002960', - "LeftUpVector;": '\U000021BF', - "LeftUpVectorBar;": '\U00002958', - "LeftVector;": '\U000021BC', - "LeftVectorBar;": '\U00002952', - "Leftarrow;": '\U000021D0', - "Leftrightarrow;": '\U000021D4', - "LessEqualGreater;": '\U000022DA', - "LessFullEqual;": '\U00002266', - "LessGreater;": '\U00002276', - "LessLess;": '\U00002AA1', - "LessSlantEqual;": '\U00002A7D', - "LessTilde;": '\U00002272', - "Lfr;": '\U0001D50F', - "Ll;": '\U000022D8', - "Lleftarrow;": '\U000021DA', - "Lmidot;": '\U0000013F', - "LongLeftArrow;": '\U000027F5', - "LongLeftRightArrow;": '\U000027F7', - "LongRightArrow;": '\U000027F6', - "Longleftarrow;": '\U000027F8', - "Longleftrightarrow;": '\U000027FA', - "Longrightarrow;": '\U000027F9', - "Lopf;": '\U0001D543', - "LowerLeftArrow;": '\U00002199', - "LowerRightArrow;": '\U00002198', - "Lscr;": '\U00002112', - "Lsh;": '\U000021B0', - "Lstrok;": '\U00000141', - "Lt;": '\U0000226A', - "Map;": '\U00002905', - "Mcy;": '\U0000041C', - "MediumSpace;": '\U0000205F', - "Mellintrf;": '\U00002133', - "Mfr;": '\U0001D510', - "MinusPlus;": '\U00002213', - "Mopf;": '\U0001D544', - "Mscr;": '\U00002133', - "Mu;": '\U0000039C', - "NJcy;": '\U0000040A', - "Nacute;": '\U00000143', - "Ncaron;": '\U00000147', - "Ncedil;": '\U00000145', - "Ncy;": '\U0000041D', - "NegativeMediumSpace;": '\U0000200B', - "NegativeThickSpace;": '\U0000200B', - "NegativeThinSpace;": '\U0000200B', - "NegativeVeryThinSpace;": '\U0000200B', - "NestedGreaterGreater;": '\U0000226B', - "NestedLessLess;": '\U0000226A', - "NewLine;": '\U0000000A', - "Nfr;": '\U0001D511', - "NoBreak;": '\U00002060', - "NonBreakingSpace;": '\U000000A0', - "Nopf;": '\U00002115', - "Not;": '\U00002AEC', - "NotCongruent;": '\U00002262', - "NotCupCap;": '\U0000226D', - "NotDoubleVerticalBar;": '\U00002226', - "NotElement;": '\U00002209', - "NotEqual;": '\U00002260', - "NotExists;": '\U00002204', - "NotGreater;": '\U0000226F', - "NotGreaterEqual;": '\U00002271', - "NotGreaterLess;": '\U00002279', - "NotGreaterTilde;": '\U00002275', - "NotLeftTriangle;": '\U000022EA', - "NotLeftTriangleEqual;": '\U000022EC', - "NotLess;": '\U0000226E', - "NotLessEqual;": '\U00002270', - "NotLessGreater;": '\U00002278', - "NotLessTilde;": '\U00002274', - "NotPrecedes;": '\U00002280', - "NotPrecedesSlantEqual;": '\U000022E0', - "NotReverseElement;": '\U0000220C', - "NotRightTriangle;": '\U000022EB', - "NotRightTriangleEqual;": '\U000022ED', - "NotSquareSubsetEqual;": '\U000022E2', - "NotSquareSupersetEqual;": '\U000022E3', - "NotSubsetEqual;": '\U00002288', - "NotSucceeds;": '\U00002281', - "NotSucceedsSlantEqual;": '\U000022E1', - "NotSupersetEqual;": '\U00002289', - "NotTilde;": '\U00002241', - "NotTildeEqual;": '\U00002244', - "NotTildeFullEqual;": '\U00002247', - "NotTildeTilde;": '\U00002249', - "NotVerticalBar;": '\U00002224', - "Nscr;": '\U0001D4A9', - "Ntilde;": '\U000000D1', - "Nu;": '\U0000039D', - "OElig;": '\U00000152', - "Oacute;": '\U000000D3', - "Ocirc;": '\U000000D4', - "Ocy;": '\U0000041E', - "Odblac;": '\U00000150', - "Ofr;": '\U0001D512', - "Ograve;": '\U000000D2', - "Omacr;": '\U0000014C', - "Omega;": '\U000003A9', - "Omicron;": '\U0000039F', - "Oopf;": '\U0001D546', - "OpenCurlyDoubleQuote;": '\U0000201C', - "OpenCurlyQuote;": '\U00002018', - "Or;": '\U00002A54', - "Oscr;": '\U0001D4AA', - "Oslash;": '\U000000D8', - "Otilde;": '\U000000D5', - "Otimes;": '\U00002A37', - "Ouml;": '\U000000D6', - "OverBar;": '\U0000203E', - "OverBrace;": '\U000023DE', - "OverBracket;": '\U000023B4', - "OverParenthesis;": '\U000023DC', - "PartialD;": '\U00002202', - "Pcy;": '\U0000041F', - "Pfr;": '\U0001D513', - "Phi;": '\U000003A6', - "Pi;": '\U000003A0', - "PlusMinus;": '\U000000B1', - "Poincareplane;": '\U0000210C', - "Popf;": '\U00002119', - "Pr;": '\U00002ABB', - "Precedes;": '\U0000227A', - "PrecedesEqual;": '\U00002AAF', - "PrecedesSlantEqual;": '\U0000227C', - "PrecedesTilde;": '\U0000227E', - "Prime;": '\U00002033', - "Product;": '\U0000220F', - "Proportion;": '\U00002237', - "Proportional;": '\U0000221D', - "Pscr;": '\U0001D4AB', - "Psi;": '\U000003A8', - "QUOT;": '\U00000022', - "Qfr;": '\U0001D514', - "Qopf;": '\U0000211A', - "Qscr;": '\U0001D4AC', - "RBarr;": '\U00002910', - "REG;": '\U000000AE', - "Racute;": '\U00000154', - "Rang;": '\U000027EB', - "Rarr;": '\U000021A0', - "Rarrtl;": '\U00002916', - "Rcaron;": '\U00000158', - "Rcedil;": '\U00000156', - "Rcy;": '\U00000420', - "Re;": '\U0000211C', - "ReverseElement;": '\U0000220B', - "ReverseEquilibrium;": '\U000021CB', - "ReverseUpEquilibrium;": '\U0000296F', - "Rfr;": '\U0000211C', - "Rho;": '\U000003A1', - "RightAngleBracket;": '\U000027E9', - "RightArrow;": '\U00002192', - "RightArrowBar;": '\U000021E5', - "RightArrowLeftArrow;": '\U000021C4', - "RightCeiling;": '\U00002309', - "RightDoubleBracket;": '\U000027E7', - "RightDownTeeVector;": '\U0000295D', - "RightDownVector;": '\U000021C2', - "RightDownVectorBar;": '\U00002955', - "RightFloor;": '\U0000230B', - "RightTee;": '\U000022A2', - "RightTeeArrow;": '\U000021A6', - "RightTeeVector;": '\U0000295B', - "RightTriangle;": '\U000022B3', - "RightTriangleBar;": '\U000029D0', - "RightTriangleEqual;": '\U000022B5', - "RightUpDownVector;": '\U0000294F', - "RightUpTeeVector;": '\U0000295C', - "RightUpVector;": '\U000021BE', - "RightUpVectorBar;": '\U00002954', - "RightVector;": '\U000021C0', - "RightVectorBar;": '\U00002953', - "Rightarrow;": '\U000021D2', - "Ropf;": '\U0000211D', - "RoundImplies;": '\U00002970', - "Rrightarrow;": '\U000021DB', - "Rscr;": '\U0000211B', - "Rsh;": '\U000021B1', - "RuleDelayed;": '\U000029F4', - "SHCHcy;": '\U00000429', - "SHcy;": '\U00000428', - "SOFTcy;": '\U0000042C', - "Sacute;": '\U0000015A', - "Sc;": '\U00002ABC', - "Scaron;": '\U00000160', - "Scedil;": '\U0000015E', - "Scirc;": '\U0000015C', - "Scy;": '\U00000421', - "Sfr;": '\U0001D516', - "ShortDownArrow;": '\U00002193', - "ShortLeftArrow;": '\U00002190', - "ShortRightArrow;": '\U00002192', - "ShortUpArrow;": '\U00002191', - "Sigma;": '\U000003A3', - "SmallCircle;": '\U00002218', - "Sopf;": '\U0001D54A', - "Sqrt;": '\U0000221A', - "Square;": '\U000025A1', - "SquareIntersection;": '\U00002293', - "SquareSubset;": '\U0000228F', - "SquareSubsetEqual;": '\U00002291', - "SquareSuperset;": '\U00002290', - "SquareSupersetEqual;": '\U00002292', - "SquareUnion;": '\U00002294', - "Sscr;": '\U0001D4AE', - "Star;": '\U000022C6', - "Sub;": '\U000022D0', - "Subset;": '\U000022D0', - "SubsetEqual;": '\U00002286', - "Succeeds;": '\U0000227B', - "SucceedsEqual;": '\U00002AB0', - "SucceedsSlantEqual;": '\U0000227D', - "SucceedsTilde;": '\U0000227F', - "SuchThat;": '\U0000220B', - "Sum;": '\U00002211', - "Sup;": '\U000022D1', - "Superset;": '\U00002283', - "SupersetEqual;": '\U00002287', - "Supset;": '\U000022D1', - "THORN;": '\U000000DE', - "TRADE;": '\U00002122', - "TSHcy;": '\U0000040B', - "TScy;": '\U00000426', - "Tab;": '\U00000009', - "Tau;": '\U000003A4', - "Tcaron;": '\U00000164', - "Tcedil;": '\U00000162', - "Tcy;": '\U00000422', - "Tfr;": '\U0001D517', - "Therefore;": '\U00002234', - "Theta;": '\U00000398', - "ThinSpace;": '\U00002009', - "Tilde;": '\U0000223C', - "TildeEqual;": '\U00002243', - "TildeFullEqual;": '\U00002245', - "TildeTilde;": '\U00002248', - "Topf;": '\U0001D54B', - "TripleDot;": '\U000020DB', - "Tscr;": '\U0001D4AF', - "Tstrok;": '\U00000166', - "Uacute;": '\U000000DA', - "Uarr;": '\U0000219F', - "Uarrocir;": '\U00002949', - "Ubrcy;": '\U0000040E', - "Ubreve;": '\U0000016C', - "Ucirc;": '\U000000DB', - "Ucy;": '\U00000423', - "Udblac;": '\U00000170', - "Ufr;": '\U0001D518', - "Ugrave;": '\U000000D9', - "Umacr;": '\U0000016A', - "UnderBar;": '\U0000005F', - "UnderBrace;": '\U000023DF', - "UnderBracket;": '\U000023B5', - "UnderParenthesis;": '\U000023DD', - "Union;": '\U000022C3', - "UnionPlus;": '\U0000228E', - "Uogon;": '\U00000172', - "Uopf;": '\U0001D54C', - "UpArrow;": '\U00002191', - "UpArrowBar;": '\U00002912', - "UpArrowDownArrow;": '\U000021C5', - "UpDownArrow;": '\U00002195', - "UpEquilibrium;": '\U0000296E', - "UpTee;": '\U000022A5', - "UpTeeArrow;": '\U000021A5', - "Uparrow;": '\U000021D1', - "Updownarrow;": '\U000021D5', - "UpperLeftArrow;": '\U00002196', - "UpperRightArrow;": '\U00002197', - "Upsi;": '\U000003D2', - "Upsilon;": '\U000003A5', - "Uring;": '\U0000016E', - "Uscr;": '\U0001D4B0', - "Utilde;": '\U00000168', - "Uuml;": '\U000000DC', - "VDash;": '\U000022AB', - "Vbar;": '\U00002AEB', - "Vcy;": '\U00000412', - "Vdash;": '\U000022A9', - "Vdashl;": '\U00002AE6', - "Vee;": '\U000022C1', - "Verbar;": '\U00002016', - "Vert;": '\U00002016', - "VerticalBar;": '\U00002223', - "VerticalLine;": '\U0000007C', - "VerticalSeparator;": '\U00002758', - "VerticalTilde;": '\U00002240', - "VeryThinSpace;": '\U0000200A', - "Vfr;": '\U0001D519', - "Vopf;": '\U0001D54D', - "Vscr;": '\U0001D4B1', - "Vvdash;": '\U000022AA', - "Wcirc;": '\U00000174', - "Wedge;": '\U000022C0', - "Wfr;": '\U0001D51A', - "Wopf;": '\U0001D54E', - "Wscr;": '\U0001D4B2', - "Xfr;": '\U0001D51B', - "Xi;": '\U0000039E', - "Xopf;": '\U0001D54F', - "Xscr;": '\U0001D4B3', - "YAcy;": '\U0000042F', - "YIcy;": '\U00000407', - "YUcy;": '\U0000042E', - "Yacute;": '\U000000DD', - "Ycirc;": '\U00000176', - "Ycy;": '\U0000042B', - "Yfr;": '\U0001D51C', - "Yopf;": '\U0001D550', - "Yscr;": '\U0001D4B4', - "Yuml;": '\U00000178', - "ZHcy;": '\U00000416', - "Zacute;": '\U00000179', - "Zcaron;": '\U0000017D', - "Zcy;": '\U00000417', - "Zdot;": '\U0000017B', - "ZeroWidthSpace;": '\U0000200B', - "Zeta;": '\U00000396', - "Zfr;": '\U00002128', - "Zopf;": '\U00002124', - "Zscr;": '\U0001D4B5', - "aacute;": '\U000000E1', - "abreve;": '\U00000103', - "ac;": '\U0000223E', - "acd;": '\U0000223F', - "acirc;": '\U000000E2', - "acute;": '\U000000B4', - "acy;": '\U00000430', - "aelig;": '\U000000E6', - "af;": '\U00002061', - "afr;": '\U0001D51E', - "agrave;": '\U000000E0', - "alefsym;": '\U00002135', - "aleph;": '\U00002135', - "alpha;": '\U000003B1', - "amacr;": '\U00000101', - "amalg;": '\U00002A3F', - "amp;": '\U00000026', - "and;": '\U00002227', - "andand;": '\U00002A55', - "andd;": '\U00002A5C', - "andslope;": '\U00002A58', - "andv;": '\U00002A5A', - "ang;": '\U00002220', - "ange;": '\U000029A4', - "angle;": '\U00002220', - "angmsd;": '\U00002221', - "angmsdaa;": '\U000029A8', - "angmsdab;": '\U000029A9', - "angmsdac;": '\U000029AA', - "angmsdad;": '\U000029AB', - "angmsdae;": '\U000029AC', - "angmsdaf;": '\U000029AD', - "angmsdag;": '\U000029AE', - "angmsdah;": '\U000029AF', - "angrt;": '\U0000221F', - "angrtvb;": '\U000022BE', - "angrtvbd;": '\U0000299D', - "angsph;": '\U00002222', - "angst;": '\U000000C5', - "angzarr;": '\U0000237C', - "aogon;": '\U00000105', - "aopf;": '\U0001D552', - "ap;": '\U00002248', - "apE;": '\U00002A70', - "apacir;": '\U00002A6F', - "ape;": '\U0000224A', - "apid;": '\U0000224B', - "apos;": '\U00000027', - "approx;": '\U00002248', - "approxeq;": '\U0000224A', - "aring;": '\U000000E5', - "ascr;": '\U0001D4B6', - "ast;": '\U0000002A', - "asymp;": '\U00002248', - "asympeq;": '\U0000224D', - "atilde;": '\U000000E3', - "auml;": '\U000000E4', - "awconint;": '\U00002233', - "awint;": '\U00002A11', - "bNot;": '\U00002AED', - "backcong;": '\U0000224C', - "backepsilon;": '\U000003F6', - "backprime;": '\U00002035', - "backsim;": '\U0000223D', - "backsimeq;": '\U000022CD', - "barvee;": '\U000022BD', - "barwed;": '\U00002305', - "barwedge;": '\U00002305', - "bbrk;": '\U000023B5', - "bbrktbrk;": '\U000023B6', - "bcong;": '\U0000224C', - "bcy;": '\U00000431', - "bdquo;": '\U0000201E', - "becaus;": '\U00002235', - "because;": '\U00002235', - "bemptyv;": '\U000029B0', - "bepsi;": '\U000003F6', - "bernou;": '\U0000212C', - "beta;": '\U000003B2', - "beth;": '\U00002136', - "between;": '\U0000226C', - "bfr;": '\U0001D51F', - "bigcap;": '\U000022C2', - "bigcirc;": '\U000025EF', - "bigcup;": '\U000022C3', - "bigodot;": '\U00002A00', - "bigoplus;": '\U00002A01', - "bigotimes;": '\U00002A02', - "bigsqcup;": '\U00002A06', - "bigstar;": '\U00002605', - "bigtriangledown;": '\U000025BD', - "bigtriangleup;": '\U000025B3', - "biguplus;": '\U00002A04', - "bigvee;": '\U000022C1', - "bigwedge;": '\U000022C0', - "bkarow;": '\U0000290D', - "blacklozenge;": '\U000029EB', - "blacksquare;": '\U000025AA', - "blacktriangle;": '\U000025B4', - "blacktriangledown;": '\U000025BE', - "blacktriangleleft;": '\U000025C2', - "blacktriangleright;": '\U000025B8', - "blank;": '\U00002423', - "blk12;": '\U00002592', - "blk14;": '\U00002591', - "blk34;": '\U00002593', - "block;": '\U00002588', - "bnot;": '\U00002310', - "bopf;": '\U0001D553', - "bot;": '\U000022A5', - "bottom;": '\U000022A5', - "bowtie;": '\U000022C8', - "boxDL;": '\U00002557', - "boxDR;": '\U00002554', - "boxDl;": '\U00002556', - "boxDr;": '\U00002553', - "boxH;": '\U00002550', - "boxHD;": '\U00002566', - "boxHU;": '\U00002569', - "boxHd;": '\U00002564', - "boxHu;": '\U00002567', - "boxUL;": '\U0000255D', - "boxUR;": '\U0000255A', - "boxUl;": '\U0000255C', - "boxUr;": '\U00002559', - "boxV;": '\U00002551', - "boxVH;": '\U0000256C', - "boxVL;": '\U00002563', - "boxVR;": '\U00002560', - "boxVh;": '\U0000256B', - "boxVl;": '\U00002562', - "boxVr;": '\U0000255F', - "boxbox;": '\U000029C9', - "boxdL;": '\U00002555', - "boxdR;": '\U00002552', - "boxdl;": '\U00002510', - "boxdr;": '\U0000250C', - "boxh;": '\U00002500', - "boxhD;": '\U00002565', - "boxhU;": '\U00002568', - "boxhd;": '\U0000252C', - "boxhu;": '\U00002534', - "boxminus;": '\U0000229F', - "boxplus;": '\U0000229E', - "boxtimes;": '\U000022A0', - "boxuL;": '\U0000255B', - "boxuR;": '\U00002558', - "boxul;": '\U00002518', - "boxur;": '\U00002514', - "boxv;": '\U00002502', - "boxvH;": '\U0000256A', - "boxvL;": '\U00002561', - "boxvR;": '\U0000255E', - "boxvh;": '\U0000253C', - "boxvl;": '\U00002524', - "boxvr;": '\U0000251C', - "bprime;": '\U00002035', - "breve;": '\U000002D8', - "brvbar;": '\U000000A6', - "bscr;": '\U0001D4B7', - "bsemi;": '\U0000204F', - "bsim;": '\U0000223D', - "bsime;": '\U000022CD', - "bsol;": '\U0000005C', - "bsolb;": '\U000029C5', - "bsolhsub;": '\U000027C8', - "bull;": '\U00002022', - "bullet;": '\U00002022', - "bump;": '\U0000224E', - "bumpE;": '\U00002AAE', - "bumpe;": '\U0000224F', - "bumpeq;": '\U0000224F', - "cacute;": '\U00000107', - "cap;": '\U00002229', - "capand;": '\U00002A44', - "capbrcup;": '\U00002A49', - "capcap;": '\U00002A4B', - "capcup;": '\U00002A47', - "capdot;": '\U00002A40', - "caret;": '\U00002041', - "caron;": '\U000002C7', - "ccaps;": '\U00002A4D', - "ccaron;": '\U0000010D', - "ccedil;": '\U000000E7', - "ccirc;": '\U00000109', - "ccups;": '\U00002A4C', - "ccupssm;": '\U00002A50', - "cdot;": '\U0000010B', - "cedil;": '\U000000B8', - "cemptyv;": '\U000029B2', - "cent;": '\U000000A2', - "centerdot;": '\U000000B7', - "cfr;": '\U0001D520', - "chcy;": '\U00000447', - "check;": '\U00002713', - "checkmark;": '\U00002713', - "chi;": '\U000003C7', - "cir;": '\U000025CB', - "cirE;": '\U000029C3', - "circ;": '\U000002C6', - "circeq;": '\U00002257', - "circlearrowleft;": '\U000021BA', - "circlearrowright;": '\U000021BB', - "circledR;": '\U000000AE', - "circledS;": '\U000024C8', - "circledast;": '\U0000229B', - "circledcirc;": '\U0000229A', - "circleddash;": '\U0000229D', - "cire;": '\U00002257', - "cirfnint;": '\U00002A10', - "cirmid;": '\U00002AEF', - "cirscir;": '\U000029C2', - "clubs;": '\U00002663', - "clubsuit;": '\U00002663', - "colon;": '\U0000003A', - "colone;": '\U00002254', - "coloneq;": '\U00002254', - "comma;": '\U0000002C', - "commat;": '\U00000040', - "comp;": '\U00002201', - "compfn;": '\U00002218', - "complement;": '\U00002201', - "complexes;": '\U00002102', - "cong;": '\U00002245', - "congdot;": '\U00002A6D', - "conint;": '\U0000222E', - "copf;": '\U0001D554', - "coprod;": '\U00002210', - "copy;": '\U000000A9', - "copysr;": '\U00002117', - "crarr;": '\U000021B5', - "cross;": '\U00002717', - "cscr;": '\U0001D4B8', - "csub;": '\U00002ACF', - "csube;": '\U00002AD1', - "csup;": '\U00002AD0', - "csupe;": '\U00002AD2', - "ctdot;": '\U000022EF', - "cudarrl;": '\U00002938', - "cudarrr;": '\U00002935', - "cuepr;": '\U000022DE', - "cuesc;": '\U000022DF', - "cularr;": '\U000021B6', - "cularrp;": '\U0000293D', - "cup;": '\U0000222A', - "cupbrcap;": '\U00002A48', - "cupcap;": '\U00002A46', - "cupcup;": '\U00002A4A', - "cupdot;": '\U0000228D', - "cupor;": '\U00002A45', - "curarr;": '\U000021B7', - "curarrm;": '\U0000293C', - "curlyeqprec;": '\U000022DE', - "curlyeqsucc;": '\U000022DF', - "curlyvee;": '\U000022CE', - "curlywedge;": '\U000022CF', - "curren;": '\U000000A4', - "curvearrowleft;": '\U000021B6', - "curvearrowright;": '\U000021B7', - "cuvee;": '\U000022CE', - "cuwed;": '\U000022CF', - "cwconint;": '\U00002232', - "cwint;": '\U00002231', - "cylcty;": '\U0000232D', - "dArr;": '\U000021D3', - "dHar;": '\U00002965', - "dagger;": '\U00002020', - "daleth;": '\U00002138', - "darr;": '\U00002193', - "dash;": '\U00002010', - "dashv;": '\U000022A3', - "dbkarow;": '\U0000290F', - "dblac;": '\U000002DD', - "dcaron;": '\U0000010F', - "dcy;": '\U00000434', - "dd;": '\U00002146', - "ddagger;": '\U00002021', - "ddarr;": '\U000021CA', - "ddotseq;": '\U00002A77', - "deg;": '\U000000B0', - "delta;": '\U000003B4', - "demptyv;": '\U000029B1', - "dfisht;": '\U0000297F', - "dfr;": '\U0001D521', - "dharl;": '\U000021C3', - "dharr;": '\U000021C2', - "diam;": '\U000022C4', - "diamond;": '\U000022C4', - "diamondsuit;": '\U00002666', - "diams;": '\U00002666', - "die;": '\U000000A8', - "digamma;": '\U000003DD', - "disin;": '\U000022F2', - "div;": '\U000000F7', - "divide;": '\U000000F7', - "divideontimes;": '\U000022C7', - "divonx;": '\U000022C7', - "djcy;": '\U00000452', - "dlcorn;": '\U0000231E', - "dlcrop;": '\U0000230D', - "dollar;": '\U00000024', - "dopf;": '\U0001D555', - "dot;": '\U000002D9', - "doteq;": '\U00002250', - "doteqdot;": '\U00002251', - "dotminus;": '\U00002238', - "dotplus;": '\U00002214', - "dotsquare;": '\U000022A1', - "doublebarwedge;": '\U00002306', - "downarrow;": '\U00002193', - "downdownarrows;": '\U000021CA', - "downharpoonleft;": '\U000021C3', - "downharpoonright;": '\U000021C2', - "drbkarow;": '\U00002910', - "drcorn;": '\U0000231F', - "drcrop;": '\U0000230C', - "dscr;": '\U0001D4B9', - "dscy;": '\U00000455', - "dsol;": '\U000029F6', - "dstrok;": '\U00000111', - "dtdot;": '\U000022F1', - "dtri;": '\U000025BF', - "dtrif;": '\U000025BE', - "duarr;": '\U000021F5', - "duhar;": '\U0000296F', - "dwangle;": '\U000029A6', - "dzcy;": '\U0000045F', - "dzigrarr;": '\U000027FF', - "eDDot;": '\U00002A77', - "eDot;": '\U00002251', - "eacute;": '\U000000E9', - "easter;": '\U00002A6E', - "ecaron;": '\U0000011B', - "ecir;": '\U00002256', - "ecirc;": '\U000000EA', - "ecolon;": '\U00002255', - "ecy;": '\U0000044D', - "edot;": '\U00000117', - "ee;": '\U00002147', - "efDot;": '\U00002252', - "efr;": '\U0001D522', - "eg;": '\U00002A9A', - "egrave;": '\U000000E8', - "egs;": '\U00002A96', - "egsdot;": '\U00002A98', - "el;": '\U00002A99', - "elinters;": '\U000023E7', - "ell;": '\U00002113', - "els;": '\U00002A95', - "elsdot;": '\U00002A97', - "emacr;": '\U00000113', - "empty;": '\U00002205', - "emptyset;": '\U00002205', - "emptyv;": '\U00002205', - "emsp;": '\U00002003', - "emsp13;": '\U00002004', - "emsp14;": '\U00002005', - "eng;": '\U0000014B', - "ensp;": '\U00002002', - "eogon;": '\U00000119', - "eopf;": '\U0001D556', - "epar;": '\U000022D5', - "eparsl;": '\U000029E3', - "eplus;": '\U00002A71', - "epsi;": '\U000003B5', - "epsilon;": '\U000003B5', - "epsiv;": '\U000003F5', - "eqcirc;": '\U00002256', - "eqcolon;": '\U00002255', - "eqsim;": '\U00002242', - "eqslantgtr;": '\U00002A96', - "eqslantless;": '\U00002A95', - "equals;": '\U0000003D', - "equest;": '\U0000225F', - "equiv;": '\U00002261', - "equivDD;": '\U00002A78', - "eqvparsl;": '\U000029E5', - "erDot;": '\U00002253', - "erarr;": '\U00002971', - "escr;": '\U0000212F', - "esdot;": '\U00002250', - "esim;": '\U00002242', - "eta;": '\U000003B7', - "eth;": '\U000000F0', - "euml;": '\U000000EB', - "euro;": '\U000020AC', - "excl;": '\U00000021', - "exist;": '\U00002203', - "expectation;": '\U00002130', - "exponentiale;": '\U00002147', - "fallingdotseq;": '\U00002252', - "fcy;": '\U00000444', - "female;": '\U00002640', - "ffilig;": '\U0000FB03', - "fflig;": '\U0000FB00', - "ffllig;": '\U0000FB04', - "ffr;": '\U0001D523', - "filig;": '\U0000FB01', - "flat;": '\U0000266D', - "fllig;": '\U0000FB02', - "fltns;": '\U000025B1', - "fnof;": '\U00000192', - "fopf;": '\U0001D557', - "forall;": '\U00002200', - "fork;": '\U000022D4', - "forkv;": '\U00002AD9', - "fpartint;": '\U00002A0D', - "frac12;": '\U000000BD', - "frac13;": '\U00002153', - "frac14;": '\U000000BC', - "frac15;": '\U00002155', - "frac16;": '\U00002159', - "frac18;": '\U0000215B', - "frac23;": '\U00002154', - "frac25;": '\U00002156', - "frac34;": '\U000000BE', - "frac35;": '\U00002157', - "frac38;": '\U0000215C', - "frac45;": '\U00002158', - "frac56;": '\U0000215A', - "frac58;": '\U0000215D', - "frac78;": '\U0000215E', - "frasl;": '\U00002044', - "frown;": '\U00002322', - "fscr;": '\U0001D4BB', - "gE;": '\U00002267', - "gEl;": '\U00002A8C', - "gacute;": '\U000001F5', - "gamma;": '\U000003B3', - "gammad;": '\U000003DD', - "gap;": '\U00002A86', - "gbreve;": '\U0000011F', - "gcirc;": '\U0000011D', - "gcy;": '\U00000433', - "gdot;": '\U00000121', - "ge;": '\U00002265', - "gel;": '\U000022DB', - "geq;": '\U00002265', - "geqq;": '\U00002267', - "geqslant;": '\U00002A7E', - "ges;": '\U00002A7E', - "gescc;": '\U00002AA9', - "gesdot;": '\U00002A80', - "gesdoto;": '\U00002A82', - "gesdotol;": '\U00002A84', - "gesles;": '\U00002A94', - "gfr;": '\U0001D524', - "gg;": '\U0000226B', - "ggg;": '\U000022D9', - "gimel;": '\U00002137', - "gjcy;": '\U00000453', - "gl;": '\U00002277', - "glE;": '\U00002A92', - "gla;": '\U00002AA5', - "glj;": '\U00002AA4', - "gnE;": '\U00002269', - "gnap;": '\U00002A8A', - "gnapprox;": '\U00002A8A', - "gne;": '\U00002A88', - "gneq;": '\U00002A88', - "gneqq;": '\U00002269', - "gnsim;": '\U000022E7', - "gopf;": '\U0001D558', - "grave;": '\U00000060', - "gscr;": '\U0000210A', - "gsim;": '\U00002273', - "gsime;": '\U00002A8E', - "gsiml;": '\U00002A90', - "gt;": '\U0000003E', - "gtcc;": '\U00002AA7', - "gtcir;": '\U00002A7A', - "gtdot;": '\U000022D7', - "gtlPar;": '\U00002995', - "gtquest;": '\U00002A7C', - "gtrapprox;": '\U00002A86', - "gtrarr;": '\U00002978', - "gtrdot;": '\U000022D7', - "gtreqless;": '\U000022DB', - "gtreqqless;": '\U00002A8C', - "gtrless;": '\U00002277', - "gtrsim;": '\U00002273', - "hArr;": '\U000021D4', - "hairsp;": '\U0000200A', - "half;": '\U000000BD', - "hamilt;": '\U0000210B', - "hardcy;": '\U0000044A', - "harr;": '\U00002194', - "harrcir;": '\U00002948', - "harrw;": '\U000021AD', - "hbar;": '\U0000210F', - "hcirc;": '\U00000125', - "hearts;": '\U00002665', - "heartsuit;": '\U00002665', - "hellip;": '\U00002026', - "hercon;": '\U000022B9', - "hfr;": '\U0001D525', - "hksearow;": '\U00002925', - "hkswarow;": '\U00002926', - "hoarr;": '\U000021FF', - "homtht;": '\U0000223B', - "hookleftarrow;": '\U000021A9', - "hookrightarrow;": '\U000021AA', - "hopf;": '\U0001D559', - "horbar;": '\U00002015', - "hscr;": '\U0001D4BD', - "hslash;": '\U0000210F', - "hstrok;": '\U00000127', - "hybull;": '\U00002043', - "hyphen;": '\U00002010', - "iacute;": '\U000000ED', - "ic;": '\U00002063', - "icirc;": '\U000000EE', - "icy;": '\U00000438', - "iecy;": '\U00000435', - "iexcl;": '\U000000A1', - "iff;": '\U000021D4', - "ifr;": '\U0001D526', - "igrave;": '\U000000EC', - "ii;": '\U00002148', - "iiiint;": '\U00002A0C', - "iiint;": '\U0000222D', - "iinfin;": '\U000029DC', - "iiota;": '\U00002129', - "ijlig;": '\U00000133', - "imacr;": '\U0000012B', - "image;": '\U00002111', - "imagline;": '\U00002110', - "imagpart;": '\U00002111', - "imath;": '\U00000131', - "imof;": '\U000022B7', - "imped;": '\U000001B5', - "in;": '\U00002208', - "incare;": '\U00002105', - "infin;": '\U0000221E', - "infintie;": '\U000029DD', - "inodot;": '\U00000131', - "int;": '\U0000222B', - "intcal;": '\U000022BA', - "integers;": '\U00002124', - "intercal;": '\U000022BA', - "intlarhk;": '\U00002A17', - "intprod;": '\U00002A3C', - "iocy;": '\U00000451', - "iogon;": '\U0000012F', - "iopf;": '\U0001D55A', - "iota;": '\U000003B9', - "iprod;": '\U00002A3C', - "iquest;": '\U000000BF', - "iscr;": '\U0001D4BE', - "isin;": '\U00002208', - "isinE;": '\U000022F9', - "isindot;": '\U000022F5', - "isins;": '\U000022F4', - "isinsv;": '\U000022F3', - "isinv;": '\U00002208', - "it;": '\U00002062', - "itilde;": '\U00000129', - "iukcy;": '\U00000456', - "iuml;": '\U000000EF', - "jcirc;": '\U00000135', - "jcy;": '\U00000439', - "jfr;": '\U0001D527', - "jmath;": '\U00000237', - "jopf;": '\U0001D55B', - "jscr;": '\U0001D4BF', - "jsercy;": '\U00000458', - "jukcy;": '\U00000454', - "kappa;": '\U000003BA', - "kappav;": '\U000003F0', - "kcedil;": '\U00000137', - "kcy;": '\U0000043A', - "kfr;": '\U0001D528', - "kgreen;": '\U00000138', - "khcy;": '\U00000445', - "kjcy;": '\U0000045C', - "kopf;": '\U0001D55C', - "kscr;": '\U0001D4C0', - "lAarr;": '\U000021DA', - "lArr;": '\U000021D0', - "lAtail;": '\U0000291B', - "lBarr;": '\U0000290E', - "lE;": '\U00002266', - "lEg;": '\U00002A8B', - "lHar;": '\U00002962', - "lacute;": '\U0000013A', - "laemptyv;": '\U000029B4', - "lagran;": '\U00002112', - "lambda;": '\U000003BB', - "lang;": '\U000027E8', - "langd;": '\U00002991', - "langle;": '\U000027E8', - "lap;": '\U00002A85', - "laquo;": '\U000000AB', - "larr;": '\U00002190', - "larrb;": '\U000021E4', - "larrbfs;": '\U0000291F', - "larrfs;": '\U0000291D', - "larrhk;": '\U000021A9', - "larrlp;": '\U000021AB', - "larrpl;": '\U00002939', - "larrsim;": '\U00002973', - "larrtl;": '\U000021A2', - "lat;": '\U00002AAB', - "latail;": '\U00002919', - "late;": '\U00002AAD', - "lbarr;": '\U0000290C', - "lbbrk;": '\U00002772', - "lbrace;": '\U0000007B', - "lbrack;": '\U0000005B', - "lbrke;": '\U0000298B', - "lbrksld;": '\U0000298F', - "lbrkslu;": '\U0000298D', - "lcaron;": '\U0000013E', - "lcedil;": '\U0000013C', - "lceil;": '\U00002308', - "lcub;": '\U0000007B', - "lcy;": '\U0000043B', - "ldca;": '\U00002936', - "ldquo;": '\U0000201C', - "ldquor;": '\U0000201E', - "ldrdhar;": '\U00002967', - "ldrushar;": '\U0000294B', - "ldsh;": '\U000021B2', - "le;": '\U00002264', - "leftarrow;": '\U00002190', - "leftarrowtail;": '\U000021A2', - "leftharpoondown;": '\U000021BD', - "leftharpoonup;": '\U000021BC', - "leftleftarrows;": '\U000021C7', - "leftrightarrow;": '\U00002194', - "leftrightarrows;": '\U000021C6', - "leftrightharpoons;": '\U000021CB', - "leftrightsquigarrow;": '\U000021AD', - "leftthreetimes;": '\U000022CB', - "leg;": '\U000022DA', - "leq;": '\U00002264', - "leqq;": '\U00002266', - "leqslant;": '\U00002A7D', - "les;": '\U00002A7D', - "lescc;": '\U00002AA8', - "lesdot;": '\U00002A7F', - "lesdoto;": '\U00002A81', - "lesdotor;": '\U00002A83', - "lesges;": '\U00002A93', - "lessapprox;": '\U00002A85', - "lessdot;": '\U000022D6', - "lesseqgtr;": '\U000022DA', - "lesseqqgtr;": '\U00002A8B', - "lessgtr;": '\U00002276', - "lesssim;": '\U00002272', - "lfisht;": '\U0000297C', - "lfloor;": '\U0000230A', - "lfr;": '\U0001D529', - "lg;": '\U00002276', - "lgE;": '\U00002A91', - "lhard;": '\U000021BD', - "lharu;": '\U000021BC', - "lharul;": '\U0000296A', - "lhblk;": '\U00002584', - "ljcy;": '\U00000459', - "ll;": '\U0000226A', - "llarr;": '\U000021C7', - "llcorner;": '\U0000231E', - "llhard;": '\U0000296B', - "lltri;": '\U000025FA', - "lmidot;": '\U00000140', - "lmoust;": '\U000023B0', - "lmoustache;": '\U000023B0', - "lnE;": '\U00002268', - "lnap;": '\U00002A89', - "lnapprox;": '\U00002A89', - "lne;": '\U00002A87', - "lneq;": '\U00002A87', - "lneqq;": '\U00002268', - "lnsim;": '\U000022E6', - "loang;": '\U000027EC', - "loarr;": '\U000021FD', - "lobrk;": '\U000027E6', - "longleftarrow;": '\U000027F5', - "longleftrightarrow;": '\U000027F7', - "longmapsto;": '\U000027FC', - "longrightarrow;": '\U000027F6', - "looparrowleft;": '\U000021AB', - "looparrowright;": '\U000021AC', - "lopar;": '\U00002985', - "lopf;": '\U0001D55D', - "loplus;": '\U00002A2D', - "lotimes;": '\U00002A34', - "lowast;": '\U00002217', - "lowbar;": '\U0000005F', - "loz;": '\U000025CA', - "lozenge;": '\U000025CA', - "lozf;": '\U000029EB', - "lpar;": '\U00000028', - "lparlt;": '\U00002993', - "lrarr;": '\U000021C6', - "lrcorner;": '\U0000231F', - "lrhar;": '\U000021CB', - "lrhard;": '\U0000296D', - "lrm;": '\U0000200E', - "lrtri;": '\U000022BF', - "lsaquo;": '\U00002039', - "lscr;": '\U0001D4C1', - "lsh;": '\U000021B0', - "lsim;": '\U00002272', - "lsime;": '\U00002A8D', - "lsimg;": '\U00002A8F', - "lsqb;": '\U0000005B', - "lsquo;": '\U00002018', - "lsquor;": '\U0000201A', - "lstrok;": '\U00000142', - "lt;": '\U0000003C', - "ltcc;": '\U00002AA6', - "ltcir;": '\U00002A79', - "ltdot;": '\U000022D6', - "lthree;": '\U000022CB', - "ltimes;": '\U000022C9', - "ltlarr;": '\U00002976', - "ltquest;": '\U00002A7B', - "ltrPar;": '\U00002996', - "ltri;": '\U000025C3', - "ltrie;": '\U000022B4', - "ltrif;": '\U000025C2', - "lurdshar;": '\U0000294A', - "luruhar;": '\U00002966', - "mDDot;": '\U0000223A', - "macr;": '\U000000AF', - "male;": '\U00002642', - "malt;": '\U00002720', - "maltese;": '\U00002720', - "map;": '\U000021A6', - "mapsto;": '\U000021A6', - "mapstodown;": '\U000021A7', - "mapstoleft;": '\U000021A4', - "mapstoup;": '\U000021A5', - "marker;": '\U000025AE', - "mcomma;": '\U00002A29', - "mcy;": '\U0000043C', - "mdash;": '\U00002014', - "measuredangle;": '\U00002221', - "mfr;": '\U0001D52A', - "mho;": '\U00002127', - "micro;": '\U000000B5', - "mid;": '\U00002223', - "midast;": '\U0000002A', - "midcir;": '\U00002AF0', - "middot;": '\U000000B7', - "minus;": '\U00002212', - "minusb;": '\U0000229F', - "minusd;": '\U00002238', - "minusdu;": '\U00002A2A', - "mlcp;": '\U00002ADB', - "mldr;": '\U00002026', - "mnplus;": '\U00002213', - "models;": '\U000022A7', - "mopf;": '\U0001D55E', - "mp;": '\U00002213', - "mscr;": '\U0001D4C2', - "mstpos;": '\U0000223E', - "mu;": '\U000003BC', - "multimap;": '\U000022B8', - "mumap;": '\U000022B8', - "nLeftarrow;": '\U000021CD', - "nLeftrightarrow;": '\U000021CE', - "nRightarrow;": '\U000021CF', - "nVDash;": '\U000022AF', - "nVdash;": '\U000022AE', - "nabla;": '\U00002207', - "nacute;": '\U00000144', - "nap;": '\U00002249', - "napos;": '\U00000149', - "napprox;": '\U00002249', - "natur;": '\U0000266E', - "natural;": '\U0000266E', - "naturals;": '\U00002115', - "nbsp;": '\U000000A0', - "ncap;": '\U00002A43', - "ncaron;": '\U00000148', - "ncedil;": '\U00000146', - "ncong;": '\U00002247', - "ncup;": '\U00002A42', - "ncy;": '\U0000043D', - "ndash;": '\U00002013', - "ne;": '\U00002260', - "neArr;": '\U000021D7', - "nearhk;": '\U00002924', - "nearr;": '\U00002197', - "nearrow;": '\U00002197', - "nequiv;": '\U00002262', - "nesear;": '\U00002928', - "nexist;": '\U00002204', - "nexists;": '\U00002204', - "nfr;": '\U0001D52B', - "nge;": '\U00002271', - "ngeq;": '\U00002271', - "ngsim;": '\U00002275', - "ngt;": '\U0000226F', - "ngtr;": '\U0000226F', - "nhArr;": '\U000021CE', - "nharr;": '\U000021AE', - "nhpar;": '\U00002AF2', - "ni;": '\U0000220B', - "nis;": '\U000022FC', - "nisd;": '\U000022FA', - "niv;": '\U0000220B', - "njcy;": '\U0000045A', - "nlArr;": '\U000021CD', - "nlarr;": '\U0000219A', - "nldr;": '\U00002025', - "nle;": '\U00002270', - "nleftarrow;": '\U0000219A', - "nleftrightarrow;": '\U000021AE', - "nleq;": '\U00002270', - "nless;": '\U0000226E', - "nlsim;": '\U00002274', - "nlt;": '\U0000226E', - "nltri;": '\U000022EA', - "nltrie;": '\U000022EC', - "nmid;": '\U00002224', - "nopf;": '\U0001D55F', - "not;": '\U000000AC', - "notin;": '\U00002209', - "notinva;": '\U00002209', - "notinvb;": '\U000022F7', - "notinvc;": '\U000022F6', - "notni;": '\U0000220C', - "notniva;": '\U0000220C', - "notnivb;": '\U000022FE', - "notnivc;": '\U000022FD', - "npar;": '\U00002226', - "nparallel;": '\U00002226', - "npolint;": '\U00002A14', - "npr;": '\U00002280', - "nprcue;": '\U000022E0', - "nprec;": '\U00002280', - "nrArr;": '\U000021CF', - "nrarr;": '\U0000219B', - "nrightarrow;": '\U0000219B', - "nrtri;": '\U000022EB', - "nrtrie;": '\U000022ED', - "nsc;": '\U00002281', - "nsccue;": '\U000022E1', - "nscr;": '\U0001D4C3', - "nshortmid;": '\U00002224', - "nshortparallel;": '\U00002226', - "nsim;": '\U00002241', - "nsime;": '\U00002244', - "nsimeq;": '\U00002244', - "nsmid;": '\U00002224', - "nspar;": '\U00002226', - "nsqsube;": '\U000022E2', - "nsqsupe;": '\U000022E3', - "nsub;": '\U00002284', - "nsube;": '\U00002288', - "nsubseteq;": '\U00002288', - "nsucc;": '\U00002281', - "nsup;": '\U00002285', - "nsupe;": '\U00002289', - "nsupseteq;": '\U00002289', - "ntgl;": '\U00002279', - "ntilde;": '\U000000F1', - "ntlg;": '\U00002278', - "ntriangleleft;": '\U000022EA', - "ntrianglelefteq;": '\U000022EC', - "ntriangleright;": '\U000022EB', - "ntrianglerighteq;": '\U000022ED', - "nu;": '\U000003BD', - "num;": '\U00000023', - "numero;": '\U00002116', - "numsp;": '\U00002007', - "nvDash;": '\U000022AD', - "nvHarr;": '\U00002904', - "nvdash;": '\U000022AC', - "nvinfin;": '\U000029DE', - "nvlArr;": '\U00002902', - "nvrArr;": '\U00002903', - "nwArr;": '\U000021D6', - "nwarhk;": '\U00002923', - "nwarr;": '\U00002196', - "nwarrow;": '\U00002196', - "nwnear;": '\U00002927', - "oS;": '\U000024C8', - "oacute;": '\U000000F3', - "oast;": '\U0000229B', - "ocir;": '\U0000229A', - "ocirc;": '\U000000F4', - "ocy;": '\U0000043E', - "odash;": '\U0000229D', - "odblac;": '\U00000151', - "odiv;": '\U00002A38', - "odot;": '\U00002299', - "odsold;": '\U000029BC', - "oelig;": '\U00000153', - "ofcir;": '\U000029BF', - "ofr;": '\U0001D52C', - "ogon;": '\U000002DB', - "ograve;": '\U000000F2', - "ogt;": '\U000029C1', - "ohbar;": '\U000029B5', - "ohm;": '\U000003A9', - "oint;": '\U0000222E', - "olarr;": '\U000021BA', - "olcir;": '\U000029BE', - "olcross;": '\U000029BB', - "oline;": '\U0000203E', - "olt;": '\U000029C0', - "omacr;": '\U0000014D', - "omega;": '\U000003C9', - "omicron;": '\U000003BF', - "omid;": '\U000029B6', - "ominus;": '\U00002296', - "oopf;": '\U0001D560', - "opar;": '\U000029B7', - "operp;": '\U000029B9', - "oplus;": '\U00002295', - "or;": '\U00002228', - "orarr;": '\U000021BB', - "ord;": '\U00002A5D', - "order;": '\U00002134', - "orderof;": '\U00002134', - "ordf;": '\U000000AA', - "ordm;": '\U000000BA', - "origof;": '\U000022B6', - "oror;": '\U00002A56', - "orslope;": '\U00002A57', - "orv;": '\U00002A5B', - "oscr;": '\U00002134', - "oslash;": '\U000000F8', - "osol;": '\U00002298', - "otilde;": '\U000000F5', - "otimes;": '\U00002297', - "otimesas;": '\U00002A36', - "ouml;": '\U000000F6', - "ovbar;": '\U0000233D', - "par;": '\U00002225', - "para;": '\U000000B6', - "parallel;": '\U00002225', - "parsim;": '\U00002AF3', - "parsl;": '\U00002AFD', - "part;": '\U00002202', - "pcy;": '\U0000043F', - "percnt;": '\U00000025', - "period;": '\U0000002E', - "permil;": '\U00002030', - "perp;": '\U000022A5', - "pertenk;": '\U00002031', - "pfr;": '\U0001D52D', - "phi;": '\U000003C6', - "phiv;": '\U000003D5', - "phmmat;": '\U00002133', - "phone;": '\U0000260E', - "pi;": '\U000003C0', - "pitchfork;": '\U000022D4', - "piv;": '\U000003D6', - "planck;": '\U0000210F', - "planckh;": '\U0000210E', - "plankv;": '\U0000210F', - "plus;": '\U0000002B', - "plusacir;": '\U00002A23', - "plusb;": '\U0000229E', - "pluscir;": '\U00002A22', - "plusdo;": '\U00002214', - "plusdu;": '\U00002A25', - "pluse;": '\U00002A72', - "plusmn;": '\U000000B1', - "plussim;": '\U00002A26', - "plustwo;": '\U00002A27', - "pm;": '\U000000B1', - "pointint;": '\U00002A15', - "popf;": '\U0001D561', - "pound;": '\U000000A3', - "pr;": '\U0000227A', - "prE;": '\U00002AB3', - "prap;": '\U00002AB7', - "prcue;": '\U0000227C', - "pre;": '\U00002AAF', - "prec;": '\U0000227A', - "precapprox;": '\U00002AB7', - "preccurlyeq;": '\U0000227C', - "preceq;": '\U00002AAF', - "precnapprox;": '\U00002AB9', - "precneqq;": '\U00002AB5', - "precnsim;": '\U000022E8', - "precsim;": '\U0000227E', - "prime;": '\U00002032', - "primes;": '\U00002119', - "prnE;": '\U00002AB5', - "prnap;": '\U00002AB9', - "prnsim;": '\U000022E8', - "prod;": '\U0000220F', - "profalar;": '\U0000232E', - "profline;": '\U00002312', - "profsurf;": '\U00002313', - "prop;": '\U0000221D', - "propto;": '\U0000221D', - "prsim;": '\U0000227E', - "prurel;": '\U000022B0', - "pscr;": '\U0001D4C5', - "psi;": '\U000003C8', - "puncsp;": '\U00002008', - "qfr;": '\U0001D52E', - "qint;": '\U00002A0C', - "qopf;": '\U0001D562', - "qprime;": '\U00002057', - "qscr;": '\U0001D4C6', - "quaternions;": '\U0000210D', - "quatint;": '\U00002A16', - "quest;": '\U0000003F', - "questeq;": '\U0000225F', - "quot;": '\U00000022', - "rAarr;": '\U000021DB', - "rArr;": '\U000021D2', - "rAtail;": '\U0000291C', - "rBarr;": '\U0000290F', - "rHar;": '\U00002964', - "racute;": '\U00000155', - "radic;": '\U0000221A', - "raemptyv;": '\U000029B3', - "rang;": '\U000027E9', - "rangd;": '\U00002992', - "range;": '\U000029A5', - "rangle;": '\U000027E9', - "raquo;": '\U000000BB', - "rarr;": '\U00002192', - "rarrap;": '\U00002975', - "rarrb;": '\U000021E5', - "rarrbfs;": '\U00002920', - "rarrc;": '\U00002933', - "rarrfs;": '\U0000291E', - "rarrhk;": '\U000021AA', - "rarrlp;": '\U000021AC', - "rarrpl;": '\U00002945', - "rarrsim;": '\U00002974', - "rarrtl;": '\U000021A3', - "rarrw;": '\U0000219D', - "ratail;": '\U0000291A', - "ratio;": '\U00002236', - "rationals;": '\U0000211A', - "rbarr;": '\U0000290D', - "rbbrk;": '\U00002773', - "rbrace;": '\U0000007D', - "rbrack;": '\U0000005D', - "rbrke;": '\U0000298C', - "rbrksld;": '\U0000298E', - "rbrkslu;": '\U00002990', - "rcaron;": '\U00000159', - "rcedil;": '\U00000157', - "rceil;": '\U00002309', - "rcub;": '\U0000007D', - "rcy;": '\U00000440', - "rdca;": '\U00002937', - "rdldhar;": '\U00002969', - "rdquo;": '\U0000201D', - "rdquor;": '\U0000201D', - "rdsh;": '\U000021B3', - "real;": '\U0000211C', - "realine;": '\U0000211B', - "realpart;": '\U0000211C', - "reals;": '\U0000211D', - "rect;": '\U000025AD', - "reg;": '\U000000AE', - "rfisht;": '\U0000297D', - "rfloor;": '\U0000230B', - "rfr;": '\U0001D52F', - "rhard;": '\U000021C1', - "rharu;": '\U000021C0', - "rharul;": '\U0000296C', - "rho;": '\U000003C1', - "rhov;": '\U000003F1', - "rightarrow;": '\U00002192', - "rightarrowtail;": '\U000021A3', - "rightharpoondown;": '\U000021C1', - "rightharpoonup;": '\U000021C0', - "rightleftarrows;": '\U000021C4', - "rightleftharpoons;": '\U000021CC', - "rightrightarrows;": '\U000021C9', - "rightsquigarrow;": '\U0000219D', - "rightthreetimes;": '\U000022CC', - "ring;": '\U000002DA', - "risingdotseq;": '\U00002253', - "rlarr;": '\U000021C4', - "rlhar;": '\U000021CC', - "rlm;": '\U0000200F', - "rmoust;": '\U000023B1', - "rmoustache;": '\U000023B1', - "rnmid;": '\U00002AEE', - "roang;": '\U000027ED', - "roarr;": '\U000021FE', - "robrk;": '\U000027E7', - "ropar;": '\U00002986', - "ropf;": '\U0001D563', - "roplus;": '\U00002A2E', - "rotimes;": '\U00002A35', - "rpar;": '\U00000029', - "rpargt;": '\U00002994', - "rppolint;": '\U00002A12', - "rrarr;": '\U000021C9', - "rsaquo;": '\U0000203A', - "rscr;": '\U0001D4C7', - "rsh;": '\U000021B1', - "rsqb;": '\U0000005D', - "rsquo;": '\U00002019', - "rsquor;": '\U00002019', - "rthree;": '\U000022CC', - "rtimes;": '\U000022CA', - "rtri;": '\U000025B9', - "rtrie;": '\U000022B5', - "rtrif;": '\U000025B8', - "rtriltri;": '\U000029CE', - "ruluhar;": '\U00002968', - "rx;": '\U0000211E', - "sacute;": '\U0000015B', - "sbquo;": '\U0000201A', - "sc;": '\U0000227B', - "scE;": '\U00002AB4', - "scap;": '\U00002AB8', - "scaron;": '\U00000161', - "sccue;": '\U0000227D', - "sce;": '\U00002AB0', - "scedil;": '\U0000015F', - "scirc;": '\U0000015D', - "scnE;": '\U00002AB6', - "scnap;": '\U00002ABA', - "scnsim;": '\U000022E9', - "scpolint;": '\U00002A13', - "scsim;": '\U0000227F', - "scy;": '\U00000441', - "sdot;": '\U000022C5', - "sdotb;": '\U000022A1', - "sdote;": '\U00002A66', - "seArr;": '\U000021D8', - "searhk;": '\U00002925', - "searr;": '\U00002198', - "searrow;": '\U00002198', - "sect;": '\U000000A7', - "semi;": '\U0000003B', - "seswar;": '\U00002929', - "setminus;": '\U00002216', - "setmn;": '\U00002216', - "sext;": '\U00002736', - "sfr;": '\U0001D530', - "sfrown;": '\U00002322', - "sharp;": '\U0000266F', - "shchcy;": '\U00000449', - "shcy;": '\U00000448', - "shortmid;": '\U00002223', - "shortparallel;": '\U00002225', - "shy;": '\U000000AD', - "sigma;": '\U000003C3', - "sigmaf;": '\U000003C2', - "sigmav;": '\U000003C2', - "sim;": '\U0000223C', - "simdot;": '\U00002A6A', - "sime;": '\U00002243', - "simeq;": '\U00002243', - "simg;": '\U00002A9E', - "simgE;": '\U00002AA0', - "siml;": '\U00002A9D', - "simlE;": '\U00002A9F', - "simne;": '\U00002246', - "simplus;": '\U00002A24', - "simrarr;": '\U00002972', - "slarr;": '\U00002190', - "smallsetminus;": '\U00002216', - "smashp;": '\U00002A33', - "smeparsl;": '\U000029E4', - "smid;": '\U00002223', - "smile;": '\U00002323', - "smt;": '\U00002AAA', - "smte;": '\U00002AAC', - "softcy;": '\U0000044C', - "sol;": '\U0000002F', - "solb;": '\U000029C4', - "solbar;": '\U0000233F', - "sopf;": '\U0001D564', - "spades;": '\U00002660', - "spadesuit;": '\U00002660', - "spar;": '\U00002225', - "sqcap;": '\U00002293', - "sqcup;": '\U00002294', - "sqsub;": '\U0000228F', - "sqsube;": '\U00002291', - "sqsubset;": '\U0000228F', - "sqsubseteq;": '\U00002291', - "sqsup;": '\U00002290', - "sqsupe;": '\U00002292', - "sqsupset;": '\U00002290', - "sqsupseteq;": '\U00002292', - "squ;": '\U000025A1', - "square;": '\U000025A1', - "squarf;": '\U000025AA', - "squf;": '\U000025AA', - "srarr;": '\U00002192', - "sscr;": '\U0001D4C8', - "ssetmn;": '\U00002216', - "ssmile;": '\U00002323', - "sstarf;": '\U000022C6', - "star;": '\U00002606', - "starf;": '\U00002605', - "straightepsilon;": '\U000003F5', - "straightphi;": '\U000003D5', - "strns;": '\U000000AF', - "sub;": '\U00002282', - "subE;": '\U00002AC5', - "subdot;": '\U00002ABD', - "sube;": '\U00002286', - "subedot;": '\U00002AC3', - "submult;": '\U00002AC1', - "subnE;": '\U00002ACB', - "subne;": '\U0000228A', - "subplus;": '\U00002ABF', - "subrarr;": '\U00002979', - "subset;": '\U00002282', - "subseteq;": '\U00002286', - "subseteqq;": '\U00002AC5', - "subsetneq;": '\U0000228A', - "subsetneqq;": '\U00002ACB', - "subsim;": '\U00002AC7', - "subsub;": '\U00002AD5', - "subsup;": '\U00002AD3', - "succ;": '\U0000227B', - "succapprox;": '\U00002AB8', - "succcurlyeq;": '\U0000227D', - "succeq;": '\U00002AB0', - "succnapprox;": '\U00002ABA', - "succneqq;": '\U00002AB6', - "succnsim;": '\U000022E9', - "succsim;": '\U0000227F', - "sum;": '\U00002211', - "sung;": '\U0000266A', - "sup;": '\U00002283', - "sup1;": '\U000000B9', - "sup2;": '\U000000B2', - "sup3;": '\U000000B3', - "supE;": '\U00002AC6', - "supdot;": '\U00002ABE', - "supdsub;": '\U00002AD8', - "supe;": '\U00002287', - "supedot;": '\U00002AC4', - "suphsol;": '\U000027C9', - "suphsub;": '\U00002AD7', - "suplarr;": '\U0000297B', - "supmult;": '\U00002AC2', - "supnE;": '\U00002ACC', - "supne;": '\U0000228B', - "supplus;": '\U00002AC0', - "supset;": '\U00002283', - "supseteq;": '\U00002287', - "supseteqq;": '\U00002AC6', - "supsetneq;": '\U0000228B', - "supsetneqq;": '\U00002ACC', - "supsim;": '\U00002AC8', - "supsub;": '\U00002AD4', - "supsup;": '\U00002AD6', - "swArr;": '\U000021D9', - "swarhk;": '\U00002926', - "swarr;": '\U00002199', - "swarrow;": '\U00002199', - "swnwar;": '\U0000292A', - "szlig;": '\U000000DF', - "target;": '\U00002316', - "tau;": '\U000003C4', - "tbrk;": '\U000023B4', - "tcaron;": '\U00000165', - "tcedil;": '\U00000163', - "tcy;": '\U00000442', - "tdot;": '\U000020DB', - "telrec;": '\U00002315', - "tfr;": '\U0001D531', - "there4;": '\U00002234', - "therefore;": '\U00002234', - "theta;": '\U000003B8', - "thetasym;": '\U000003D1', - "thetav;": '\U000003D1', - "thickapprox;": '\U00002248', - "thicksim;": '\U0000223C', - "thinsp;": '\U00002009', - "thkap;": '\U00002248', - "thksim;": '\U0000223C', - "thorn;": '\U000000FE', - "tilde;": '\U000002DC', - "times;": '\U000000D7', - "timesb;": '\U000022A0', - "timesbar;": '\U00002A31', - "timesd;": '\U00002A30', - "tint;": '\U0000222D', - "toea;": '\U00002928', - "top;": '\U000022A4', - "topbot;": '\U00002336', - "topcir;": '\U00002AF1', - "topf;": '\U0001D565', - "topfork;": '\U00002ADA', - "tosa;": '\U00002929', - "tprime;": '\U00002034', - "trade;": '\U00002122', - "triangle;": '\U000025B5', - "triangledown;": '\U000025BF', - "triangleleft;": '\U000025C3', - "trianglelefteq;": '\U000022B4', - "triangleq;": '\U0000225C', - "triangleright;": '\U000025B9', - "trianglerighteq;": '\U000022B5', - "tridot;": '\U000025EC', - "trie;": '\U0000225C', - "triminus;": '\U00002A3A', - "triplus;": '\U00002A39', - "trisb;": '\U000029CD', - "tritime;": '\U00002A3B', - "trpezium;": '\U000023E2', - "tscr;": '\U0001D4C9', - "tscy;": '\U00000446', - "tshcy;": '\U0000045B', - "tstrok;": '\U00000167', - "twixt;": '\U0000226C', - "twoheadleftarrow;": '\U0000219E', - "twoheadrightarrow;": '\U000021A0', - "uArr;": '\U000021D1', - "uHar;": '\U00002963', - "uacute;": '\U000000FA', - "uarr;": '\U00002191', - "ubrcy;": '\U0000045E', - "ubreve;": '\U0000016D', - "ucirc;": '\U000000FB', - "ucy;": '\U00000443', - "udarr;": '\U000021C5', - "udblac;": '\U00000171', - "udhar;": '\U0000296E', - "ufisht;": '\U0000297E', - "ufr;": '\U0001D532', - "ugrave;": '\U000000F9', - "uharl;": '\U000021BF', - "uharr;": '\U000021BE', - "uhblk;": '\U00002580', - "ulcorn;": '\U0000231C', - "ulcorner;": '\U0000231C', - "ulcrop;": '\U0000230F', - "ultri;": '\U000025F8', - "umacr;": '\U0000016B', - "uml;": '\U000000A8', - "uogon;": '\U00000173', - "uopf;": '\U0001D566', - "uparrow;": '\U00002191', - "updownarrow;": '\U00002195', - "upharpoonleft;": '\U000021BF', - "upharpoonright;": '\U000021BE', - "uplus;": '\U0000228E', - "upsi;": '\U000003C5', - "upsih;": '\U000003D2', - "upsilon;": '\U000003C5', - "upuparrows;": '\U000021C8', - "urcorn;": '\U0000231D', - "urcorner;": '\U0000231D', - "urcrop;": '\U0000230E', - "uring;": '\U0000016F', - "urtri;": '\U000025F9', - "uscr;": '\U0001D4CA', - "utdot;": '\U000022F0', - "utilde;": '\U00000169', - "utri;": '\U000025B5', - "utrif;": '\U000025B4', - "uuarr;": '\U000021C8', - "uuml;": '\U000000FC', - "uwangle;": '\U000029A7', - "vArr;": '\U000021D5', - "vBar;": '\U00002AE8', - "vBarv;": '\U00002AE9', - "vDash;": '\U000022A8', - "vangrt;": '\U0000299C', - "varepsilon;": '\U000003F5', - "varkappa;": '\U000003F0', - "varnothing;": '\U00002205', - "varphi;": '\U000003D5', - "varpi;": '\U000003D6', - "varpropto;": '\U0000221D', - "varr;": '\U00002195', - "varrho;": '\U000003F1', - "varsigma;": '\U000003C2', - "vartheta;": '\U000003D1', - "vartriangleleft;": '\U000022B2', - "vartriangleright;": '\U000022B3', - "vcy;": '\U00000432', - "vdash;": '\U000022A2', - "vee;": '\U00002228', - "veebar;": '\U000022BB', - "veeeq;": '\U0000225A', - "vellip;": '\U000022EE', - "verbar;": '\U0000007C', - "vert;": '\U0000007C', - "vfr;": '\U0001D533', - "vltri;": '\U000022B2', - "vopf;": '\U0001D567', - "vprop;": '\U0000221D', - "vrtri;": '\U000022B3', - "vscr;": '\U0001D4CB', - "vzigzag;": '\U0000299A', - "wcirc;": '\U00000175', - "wedbar;": '\U00002A5F', - "wedge;": '\U00002227', - "wedgeq;": '\U00002259', - "weierp;": '\U00002118', - "wfr;": '\U0001D534', - "wopf;": '\U0001D568', - "wp;": '\U00002118', - "wr;": '\U00002240', - "wreath;": '\U00002240', - "wscr;": '\U0001D4CC', - "xcap;": '\U000022C2', - "xcirc;": '\U000025EF', - "xcup;": '\U000022C3', - "xdtri;": '\U000025BD', - "xfr;": '\U0001D535', - "xhArr;": '\U000027FA', - "xharr;": '\U000027F7', - "xi;": '\U000003BE', - "xlArr;": '\U000027F8', - "xlarr;": '\U000027F5', - "xmap;": '\U000027FC', - "xnis;": '\U000022FB', - "xodot;": '\U00002A00', - "xopf;": '\U0001D569', - "xoplus;": '\U00002A01', - "xotime;": '\U00002A02', - "xrArr;": '\U000027F9', - "xrarr;": '\U000027F6', - "xscr;": '\U0001D4CD', - "xsqcup;": '\U00002A06', - "xuplus;": '\U00002A04', - "xutri;": '\U000025B3', - "xvee;": '\U000022C1', - "xwedge;": '\U000022C0', - "yacute;": '\U000000FD', - "yacy;": '\U0000044F', - "ycirc;": '\U00000177', - "ycy;": '\U0000044B', - "yen;": '\U000000A5', - "yfr;": '\U0001D536', - "yicy;": '\U00000457', - "yopf;": '\U0001D56A', - "yscr;": '\U0001D4CE', - "yucy;": '\U0000044E', - "yuml;": '\U000000FF', - "zacute;": '\U0000017A', - "zcaron;": '\U0000017E', - "zcy;": '\U00000437', - "zdot;": '\U0000017C', - "zeetrf;": '\U00002128', - "zeta;": '\U000003B6', - "zfr;": '\U0001D537', - "zhcy;": '\U00000436', - "zigrarr;": '\U000021DD', - "zopf;": '\U0001D56B', - "zscr;": '\U0001D4CF', - "zwj;": '\U0000200D', - "zwnj;": '\U0000200C', - "AElig": '\U000000C6', - "AMP": '\U00000026', - "Aacute": '\U000000C1', - "Acirc": '\U000000C2', - "Agrave": '\U000000C0', - "Aring": '\U000000C5', - "Atilde": '\U000000C3', - "Auml": '\U000000C4', - "COPY": '\U000000A9', - "Ccedil": '\U000000C7', - "ETH": '\U000000D0', - "Eacute": '\U000000C9', - "Ecirc": '\U000000CA', - "Egrave": '\U000000C8', - "Euml": '\U000000CB', - "GT": '\U0000003E', - "Iacute": '\U000000CD', - "Icirc": '\U000000CE', - "Igrave": '\U000000CC', - "Iuml": '\U000000CF', - "LT": '\U0000003C', - "Ntilde": '\U000000D1', - "Oacute": '\U000000D3', - "Ocirc": '\U000000D4', - "Ograve": '\U000000D2', - "Oslash": '\U000000D8', - "Otilde": '\U000000D5', - "Ouml": '\U000000D6', - "QUOT": '\U00000022', - "REG": '\U000000AE', - "THORN": '\U000000DE', - "Uacute": '\U000000DA', - "Ucirc": '\U000000DB', - "Ugrave": '\U000000D9', - "Uuml": '\U000000DC', - "Yacute": '\U000000DD', - "aacute": '\U000000E1', - "acirc": '\U000000E2', - "acute": '\U000000B4', - "aelig": '\U000000E6', - "agrave": '\U000000E0', - "amp": '\U00000026', - "aring": '\U000000E5', - "atilde": '\U000000E3', - "auml": '\U000000E4', - "brvbar": '\U000000A6', - "ccedil": '\U000000E7', - "cedil": '\U000000B8', - "cent": '\U000000A2', - "copy": '\U000000A9', - "curren": '\U000000A4', - "deg": '\U000000B0', - "divide": '\U000000F7', - "eacute": '\U000000E9', - "ecirc": '\U000000EA', - "egrave": '\U000000E8', - "eth": '\U000000F0', - "euml": '\U000000EB', - "frac12": '\U000000BD', - "frac14": '\U000000BC', - "frac34": '\U000000BE', - "gt": '\U0000003E', - "iacute": '\U000000ED', - "icirc": '\U000000EE', - "iexcl": '\U000000A1', - "igrave": '\U000000EC', - "iquest": '\U000000BF', - "iuml": '\U000000EF', - "laquo": '\U000000AB', - "lt": '\U0000003C', - "macr": '\U000000AF', - "micro": '\U000000B5', - "middot": '\U000000B7', - "nbsp": '\U000000A0', - "not": '\U000000AC', - "ntilde": '\U000000F1', - "oacute": '\U000000F3', - "ocirc": '\U000000F4', - "ograve": '\U000000F2', - "ordf": '\U000000AA', - "ordm": '\U000000BA', - "oslash": '\U000000F8', - "otilde": '\U000000F5', - "ouml": '\U000000F6', - "para": '\U000000B6', - "plusmn": '\U000000B1', - "pound": '\U000000A3', - "quot": '\U00000022', - "raquo": '\U000000BB', - "reg": '\U000000AE', - "sect": '\U000000A7', - "shy": '\U000000AD', - "sup1": '\U000000B9', - "sup2": '\U000000B2', - "sup3": '\U000000B3', - "szlig": '\U000000DF', - "thorn": '\U000000FE', - "times": '\U000000D7', - "uacute": '\U000000FA', - "ucirc": '\U000000FB', - "ugrave": '\U000000F9', - "uml": '\U000000A8', - "uuml": '\U000000FC', - "yacute": '\U000000FD', - "yen": '\U000000A5', - "yuml": '\U000000FF', -} - -// HTML entities that are two unicode codepoints. -var entity2 = map[string][2]rune{ - // TODO(nigeltao): Handle replacements that are wider than their names. - // "nLt;": {'\u226A', '\u20D2'}, - // "nGt;": {'\u226B', '\u20D2'}, - "NotEqualTilde;": {'\u2242', '\u0338'}, - "NotGreaterFullEqual;": {'\u2267', '\u0338'}, - "NotGreaterGreater;": {'\u226B', '\u0338'}, - "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, - "NotHumpDownHump;": {'\u224E', '\u0338'}, - "NotHumpEqual;": {'\u224F', '\u0338'}, - "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, - "NotLessLess;": {'\u226A', '\u0338'}, - "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, - "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, - "NotNestedLessLess;": {'\u2AA1', '\u0338'}, - "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, - "NotRightTriangleBar;": {'\u29D0', '\u0338'}, - "NotSquareSubset;": {'\u228F', '\u0338'}, - "NotSquareSuperset;": {'\u2290', '\u0338'}, - "NotSubset;": {'\u2282', '\u20D2'}, - "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, - "NotSucceedsTilde;": {'\u227F', '\u0338'}, - "NotSuperset;": {'\u2283', '\u20D2'}, - "ThickSpace;": {'\u205F', '\u200A'}, - "acE;": {'\u223E', '\u0333'}, - "bne;": {'\u003D', '\u20E5'}, - "bnequiv;": {'\u2261', '\u20E5'}, - "caps;": {'\u2229', '\uFE00'}, - "cups;": {'\u222A', '\uFE00'}, - "fjlig;": {'\u0066', '\u006A'}, - "gesl;": {'\u22DB', '\uFE00'}, - "gvertneqq;": {'\u2269', '\uFE00'}, - "gvnE;": {'\u2269', '\uFE00'}, - "lates;": {'\u2AAD', '\uFE00'}, - "lesg;": {'\u22DA', '\uFE00'}, - "lvertneqq;": {'\u2268', '\uFE00'}, - "lvnE;": {'\u2268', '\uFE00'}, - "nGg;": {'\u22D9', '\u0338'}, - "nGtv;": {'\u226B', '\u0338'}, - "nLl;": {'\u22D8', '\u0338'}, - "nLtv;": {'\u226A', '\u0338'}, - "nang;": {'\u2220', '\u20D2'}, - "napE;": {'\u2A70', '\u0338'}, - "napid;": {'\u224B', '\u0338'}, - "nbump;": {'\u224E', '\u0338'}, - "nbumpe;": {'\u224F', '\u0338'}, - "ncongdot;": {'\u2A6D', '\u0338'}, - "nedot;": {'\u2250', '\u0338'}, - "nesim;": {'\u2242', '\u0338'}, - "ngE;": {'\u2267', '\u0338'}, - "ngeqq;": {'\u2267', '\u0338'}, - "ngeqslant;": {'\u2A7E', '\u0338'}, - "nges;": {'\u2A7E', '\u0338'}, - "nlE;": {'\u2266', '\u0338'}, - "nleqq;": {'\u2266', '\u0338'}, - "nleqslant;": {'\u2A7D', '\u0338'}, - "nles;": {'\u2A7D', '\u0338'}, - "notinE;": {'\u22F9', '\u0338'}, - "notindot;": {'\u22F5', '\u0338'}, - "nparsl;": {'\u2AFD', '\u20E5'}, - "npart;": {'\u2202', '\u0338'}, - "npre;": {'\u2AAF', '\u0338'}, - "npreceq;": {'\u2AAF', '\u0338'}, - "nrarrc;": {'\u2933', '\u0338'}, - "nrarrw;": {'\u219D', '\u0338'}, - "nsce;": {'\u2AB0', '\u0338'}, - "nsubE;": {'\u2AC5', '\u0338'}, - "nsubset;": {'\u2282', '\u20D2'}, - "nsubseteqq;": {'\u2AC5', '\u0338'}, - "nsucceq;": {'\u2AB0', '\u0338'}, - "nsupE;": {'\u2AC6', '\u0338'}, - "nsupset;": {'\u2283', '\u20D2'}, - "nsupseteqq;": {'\u2AC6', '\u0338'}, - "nvap;": {'\u224D', '\u20D2'}, - "nvge;": {'\u2265', '\u20D2'}, - "nvgt;": {'\u003E', '\u20D2'}, - "nvle;": {'\u2264', '\u20D2'}, - "nvlt;": {'\u003C', '\u20D2'}, - "nvltrie;": {'\u22B4', '\u20D2'}, - "nvrtrie;": {'\u22B5', '\u20D2'}, - "nvsim;": {'\u223C', '\u20D2'}, - "race;": {'\u223D', '\u0331'}, - "smtes;": {'\u2AAC', '\uFE00'}, - "sqcaps;": {'\u2293', '\uFE00'}, - "sqcups;": {'\u2294', '\uFE00'}, - "varsubsetneq;": {'\u228A', '\uFE00'}, - "varsubsetneqq;": {'\u2ACB', '\uFE00'}, - "varsupsetneq;": {'\u228B', '\uFE00'}, - "varsupsetneqq;": {'\u2ACC', '\uFE00'}, - "vnsub;": {'\u2282', '\u20D2'}, - "vnsup;": {'\u2283', '\u20D2'}, - "vsubnE;": {'\u2ACB', '\uFE00'}, - "vsubne;": {'\u228A', '\uFE00'}, - "vsupnE;": {'\u2ACC', '\uFE00'}, - "vsupne;": {'\u228B', '\uFE00'}, -} diff --git a/upstream/vendor/golang.org/x/net/html/escape.go b/upstream/vendor/golang.org/x/net/html/escape.go deleted file mode 100644 index 04c6bec2107..00000000000 --- a/upstream/vendor/golang.org/x/net/html/escape.go +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright 2010 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 html - -import ( - "bytes" - "strings" - "unicode/utf8" -) - -// These replacements permit compatibility with old numeric entities that -// assumed Windows-1252 encoding. -// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference -var replacementTable = [...]rune{ - '\u20AC', // First entry is what 0x80 should be replaced with. - '\u0081', - '\u201A', - '\u0192', - '\u201E', - '\u2026', - '\u2020', - '\u2021', - '\u02C6', - '\u2030', - '\u0160', - '\u2039', - '\u0152', - '\u008D', - '\u017D', - '\u008F', - '\u0090', - '\u2018', - '\u2019', - '\u201C', - '\u201D', - '\u2022', - '\u2013', - '\u2014', - '\u02DC', - '\u2122', - '\u0161', - '\u203A', - '\u0153', - '\u009D', - '\u017E', - '\u0178', // Last entry is 0x9F. - // 0x00->'\uFFFD' is handled programmatically. - // 0x0D->'\u000D' is a no-op. -} - -// unescapeEntity reads an entity like "<" from b[src:] and writes the -// corresponding "<" to b[dst:], returning the incremented dst and src cursors. -// Precondition: b[src] == '&' && dst <= src. -// attribute should be true if parsing an attribute value. -func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) { - // https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference - - // i starts at 1 because we already know that s[0] == '&'. - i, s := 1, b[src:] - - if len(s) <= 1 { - b[dst] = b[src] - return dst + 1, src + 1 - } - - if s[i] == '#' { - if len(s) <= 3 { // We need to have at least "&#.". - b[dst] = b[src] - return dst + 1, src + 1 - } - i++ - c := s[i] - hex := false - if c == 'x' || c == 'X' { - hex = true - i++ - } - - x := '\x00' - for i < len(s) { - c = s[i] - i++ - if hex { - if '0' <= c && c <= '9' { - x = 16*x + rune(c) - '0' - continue - } else if 'a' <= c && c <= 'f' { - x = 16*x + rune(c) - 'a' + 10 - continue - } else if 'A' <= c && c <= 'F' { - x = 16*x + rune(c) - 'A' + 10 - continue - } - } else if '0' <= c && c <= '9' { - x = 10*x + rune(c) - '0' - continue - } - if c != ';' { - i-- - } - break - } - - if i <= 3 { // No characters matched. - b[dst] = b[src] - return dst + 1, src + 1 - } - - if 0x80 <= x && x <= 0x9F { - // Replace characters from Windows-1252 with UTF-8 equivalents. - x = replacementTable[x-0x80] - } else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF { - // Replace invalid characters with the replacement character. - x = '\uFFFD' - } - - return dst + utf8.EncodeRune(b[dst:], x), src + i - } - - // Consume the maximum number of characters possible, with the - // consumed characters matching one of the named references. - - for i < len(s) { - c := s[i] - i++ - // Lower-cased characters are more common in entities, so we check for them first. - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { - continue - } - if c != ';' { - i-- - } - break - } - - entityName := string(s[1:i]) - if entityName == "" { - // No-op. - } else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' { - // No-op. - } else if x := entity[entityName]; x != 0 { - return dst + utf8.EncodeRune(b[dst:], x), src + i - } else if x := entity2[entityName]; x[0] != 0 { - dst1 := dst + utf8.EncodeRune(b[dst:], x[0]) - return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i - } else if !attribute { - maxLen := len(entityName) - 1 - if maxLen > longestEntityWithoutSemicolon { - maxLen = longestEntityWithoutSemicolon - } - for j := maxLen; j > 1; j-- { - if x := entity[entityName[:j]]; x != 0 { - return dst + utf8.EncodeRune(b[dst:], x), src + j + 1 - } - } - } - - dst1, src1 = dst+i, src+i - copy(b[dst:dst1], b[src:src1]) - return dst1, src1 -} - -// unescape unescapes b's entities in-place, so that "a<b" becomes "a' byte that, per above, we'd like to avoid escaping unless we have to. -// -// Studying the summary table (and T actions in its '>' column) closely, we -// only need to escape in states 43, 44, 49, 51 and 52. State 43 is at the -// start of the comment data. State 52 is after a '!'. The other three states -// are after a '-'. -// -// Our algorithm is thus to escape every '&' and to escape '>' if and only if: -// - The '>' is after a '!' or '-' (in the unescaped data) or -// - The '>' is at the start of the comment data (after the opening ""); err != nil { - return err - } - return nil - case DoctypeNode: - if _, err := w.WriteString("') - case RawNode: - _, err := w.WriteString(n.Data) - return err - default: - return errors.New("html: unknown node type") - } - - // Render the opening tag. - if err := w.WriteByte('<'); err != nil { - return err - } - if _, err := w.WriteString(n.Data); err != nil { - return err - } - for _, a := range n.Attr { - if err := w.WriteByte(' '); err != nil { - return err - } - if a.Namespace != "" { - if _, err := w.WriteString(a.Namespace); err != nil { - return err - } - if err := w.WriteByte(':'); err != nil { - return err - } - } - if _, err := w.WriteString(a.Key); err != nil { - return err - } - if _, err := w.WriteString(`="`); err != nil { - return err - } - if err := escape(w, a.Val); err != nil { - return err - } - if err := w.WriteByte('"'); err != nil { - return err - } - } - if voidElements[n.Data] { - if n.FirstChild != nil { - return fmt.Errorf("html: void element <%s> has child nodes", n.Data) - } - _, err := w.WriteString("/>") - return err - } - if err := w.WriteByte('>'); err != nil { - return err - } - - // Add initial newline where there is danger of a newline beging ignored. - if c := n.FirstChild; c != nil && c.Type == TextNode && strings.HasPrefix(c.Data, "\n") { - switch n.Data { - case "pre", "listing", "textarea": - if err := w.WriteByte('\n'); err != nil { - return err - } - } - } - - // Render any child nodes - if childTextNodesAreLiteral(n) { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == TextNode { - if _, err := w.WriteString(c.Data); err != nil { - return err - } - } else { - if err := render1(w, c); err != nil { - return err - } - } - } - if n.Data == "plaintext" { - // Don't render anything else. must be the - // last element in the file, with no closing tag. - return plaintextAbort - } - } else { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := render1(w, c); err != nil { - return err - } - } - } - - // Render the </xxx> closing tag. - if _, err := w.WriteString("</"); err != nil { - return err - } - if _, err := w.WriteString(n.Data); err != nil { - return err - } - return w.WriteByte('>') -} - -func childTextNodesAreLiteral(n *Node) bool { - // Per WHATWG HTML 13.3, if the parent of the current node is a style, - // script, xmp, iframe, noembed, noframes, or plaintext element, and the - // current node is a text node, append the value of the node's data - // literally. The specification is not explicit about it, but we only - // enforce this if we are in the HTML namespace (i.e. when the namespace is - // ""). - // NOTE: we also always include noscript elements, although the - // specification states that they should only be rendered as such if - // scripting is enabled for the node (which is not something we track). - if n.Namespace != "" { - return false - } - switch n.Data { - case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp": - return true - default: - return false - } -} - -// writeQuoted writes s to w surrounded by quotes. Normally it will use double -// quotes, but if s contains a double quote, it will use single quotes. -// It is used for writing the identifiers in a doctype declaration. -// In valid HTML, they can't contain both types of quotes. -func writeQuoted(w writer, s string) error { - var q byte = '"' - if strings.Contains(s, `"`) { - q = '\'' - } - if err := w.WriteByte(q); err != nil { - return err - } - if _, err := w.WriteString(s); err != nil { - return err - } - if err := w.WriteByte(q); err != nil { - return err - } - return nil -} - -// Section 12.1.2, "Elements", gives this list of void elements. Void elements -// are those that can't have any contents. -var voidElements = map[string]bool{ - "area": true, - "base": true, - "br": true, - "col": true, - "embed": true, - "hr": true, - "img": true, - "input": true, - "keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility. - "link": true, - "meta": true, - "param": true, - "source": true, - "track": true, - "wbr": true, -} diff --git a/upstream/vendor/golang.org/x/net/html/token.go b/upstream/vendor/golang.org/x/net/html/token.go deleted file mode 100644 index 3c57880d697..00000000000 --- a/upstream/vendor/golang.org/x/net/html/token.go +++ /dev/null @@ -1,1272 +0,0 @@ -// Copyright 2010 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 html - -import ( - "bytes" - "errors" - "io" - "strconv" - "strings" - - "golang.org/x/net/html/atom" -) - -// A TokenType is the type of a Token. -type TokenType uint32 - -const ( - // ErrorToken means that an error occurred during tokenization. - ErrorToken TokenType = iota - // TextToken means a text node. - TextToken - // A StartTagToken looks like <a>. - StartTagToken - // An EndTagToken looks like </a>. - EndTagToken - // A SelfClosingTagToken tag looks like <br/>. - SelfClosingTagToken - // A CommentToken looks like <!--x-->. - CommentToken - // A DoctypeToken looks like <!DOCTYPE x> - DoctypeToken -) - -// ErrBufferExceeded means that the buffering limit was exceeded. -var ErrBufferExceeded = errors.New("max buffer exceeded") - -// String returns a string representation of the TokenType. -func (t TokenType) String() string { - switch t { - case ErrorToken: - return "Error" - case TextToken: - return "Text" - case StartTagToken: - return "StartTag" - case EndTagToken: - return "EndTag" - case SelfClosingTagToken: - return "SelfClosingTag" - case CommentToken: - return "Comment" - case DoctypeToken: - return "Doctype" - } - return "Invalid(" + strconv.Itoa(int(t)) + ")" -} - -// An Attribute is an attribute namespace-key-value triple. Namespace is -// non-empty for foreign attributes like xlink, Key is alphabetic (and hence -// does not contain escapable characters like '&', '<' or '>'), and Val is -// unescaped (it looks like "a<b" rather than "a&lt;b"). -// -// Namespace is only used by the parser, not the tokenizer. -type Attribute struct { - Namespace, Key, Val string -} - -// A Token consists of a TokenType and some Data (tag name for start and end -// tags, content for text, comments and doctypes). A tag Token may also contain -// a slice of Attributes. Data is unescaped for all Tokens (it looks like "a<b" -// rather than "a&lt;b"). For tag Tokens, DataAtom is the atom for Data, or -// zero if Data is not a known tag name. -type Token struct { - Type TokenType - DataAtom atom.Atom - Data string - Attr []Attribute -} - -// tagString returns a string representation of a tag Token's Data and Attr. -func (t Token) tagString() string { - if len(t.Attr) == 0 { - return t.Data - } - buf := bytes.NewBufferString(t.Data) - for _, a := range t.Attr { - buf.WriteByte(' ') - buf.WriteString(a.Key) - buf.WriteString(`="`) - escape(buf, a.Val) - buf.WriteByte('"') - } - return buf.String() -} - -// String returns a string representation of the Token. -func (t Token) String() string { - switch t.Type { - case ErrorToken: - return "" - case TextToken: - return EscapeString(t.Data) - case StartTagToken: - return "<" + t.tagString() + ">" - case EndTagToken: - return "</" + t.tagString() + ">" - case SelfClosingTagToken: - return "<" + t.tagString() + "/>" - case CommentToken: - return "<!--" + escapeCommentString(t.Data) + "-->" - case DoctypeToken: - return "<!DOCTYPE " + EscapeString(t.Data) + ">" - } - return "Invalid(" + strconv.Itoa(int(t.Type)) + ")" -} - -// span is a range of bytes in a Tokenizer's buffer. The start is inclusive, -// the end is exclusive. -type span struct { - start, end int -} - -// A Tokenizer returns a stream of HTML Tokens. -type Tokenizer struct { - // r is the source of the HTML text. - r io.Reader - // tt is the TokenType of the current token. - tt TokenType - // err is the first error encountered during tokenization. It is possible - // for tt != Error && err != nil to hold: this means that Next returned a - // valid token but the subsequent Next call will return an error token. - // For example, if the HTML text input was just "plain", then the first - // Next call would set z.err to io.EOF but return a TextToken, and all - // subsequent Next calls would return an ErrorToken. - // err is never reset. Once it becomes non-nil, it stays non-nil. - err error - // readErr is the error returned by the io.Reader r. It is separate from - // err because it is valid for an io.Reader to return (n int, err1 error) - // such that n > 0 && err1 != nil, and callers should always process the - // n > 0 bytes before considering the error err1. - readErr error - // buf[raw.start:raw.end] holds the raw bytes of the current token. - // buf[raw.end:] is buffered input that will yield future tokens. - raw span - buf []byte - // maxBuf limits the data buffered in buf. A value of 0 means unlimited. - maxBuf int - // buf[data.start:data.end] holds the raw bytes of the current token's data: - // a text token's text, a tag token's tag name, etc. - data span - // pendingAttr is the attribute key and value currently being tokenized. - // When complete, pendingAttr is pushed onto attr. nAttrReturned is - // incremented on each call to TagAttr. - pendingAttr [2]span - attr [][2]span - nAttrReturned int - // rawTag is the "script" in "</script>" that closes the next token. If - // non-empty, the subsequent call to Next will return a raw or RCDATA text - // token: one that treats "<p>" as text instead of an element. - // rawTag's contents are lower-cased. - rawTag string - // textIsRaw is whether the current text token's data is not escaped. - textIsRaw bool - // convertNUL is whether NUL bytes in the current token's data should - // be converted into \ufffd replacement characters. - convertNUL bool - // allowCDATA is whether CDATA sections are allowed in the current context. - allowCDATA bool -} - -// AllowCDATA sets whether or not the tokenizer recognizes <![CDATA[foo]]> as -// the text "foo". The default value is false, which means to recognize it as -// a bogus comment "<!-- [CDATA[foo]] -->" instead. -// -// Strictly speaking, an HTML5 compliant tokenizer should allow CDATA if and -// only if tokenizing foreign content, such as MathML and SVG. However, -// tracking foreign-contentness is difficult to do purely in the tokenizer, -// as opposed to the parser, due to HTML integration points: an <svg> element -// can contain a <foreignObject> that is foreign-to-SVG but not foreign-to- -// HTML. For strict compliance with the HTML5 tokenization algorithm, it is the -// responsibility of the user of a tokenizer to call AllowCDATA as appropriate. -// In practice, if using the tokenizer without caring whether MathML or SVG -// CDATA is text or comments, such as tokenizing HTML to find all the anchor -// text, it is acceptable to ignore this responsibility. -func (z *Tokenizer) AllowCDATA(allowCDATA bool) { - z.allowCDATA = allowCDATA -} - -// NextIsNotRawText instructs the tokenizer that the next token should not be -// considered as 'raw text'. Some elements, such as script and title elements, -// normally require the next token after the opening tag to be 'raw text' that -// has no child elements. For example, tokenizing "<title>a<b>c</b>d</title>" -// yields a start tag token for "<title>", a text token for "a<b>c</b>d", and -// an end tag token for "</title>". There are no distinct start tag or end tag -// tokens for the "<b>" and "</b>". -// -// This tokenizer implementation will generally look for raw text at the right -// times. Strictly speaking, an HTML5 compliant tokenizer should not look for -// raw text if in foreign content: <title> generally needs raw text, but a -// <title> inside an <svg> does not. Another example is that a <textarea> -// generally needs raw text, but a <textarea> is not allowed as an immediate -// child of a <select>; in normal parsing, a <textarea> implies </select>, but -// one cannot close the implicit element when parsing a <select>'s InnerHTML. -// Similarly to AllowCDATA, tracking the correct moment to override raw-text- -// ness is difficult to do purely in the tokenizer, as opposed to the parser. -// For strict compliance with the HTML5 tokenization algorithm, it is the -// responsibility of the user of a tokenizer to call NextIsNotRawText as -// appropriate. In practice, like AllowCDATA, it is acceptable to ignore this -// responsibility for basic usage. -// -// Note that this 'raw text' concept is different from the one offered by the -// Tokenizer.Raw method. -func (z *Tokenizer) NextIsNotRawText() { - z.rawTag = "" -} - -// Err returns the error associated with the most recent ErrorToken token. -// This is typically io.EOF, meaning the end of tokenization. -func (z *Tokenizer) Err() error { - if z.tt != ErrorToken { - return nil - } - return z.err -} - -// readByte returns the next byte from the input stream, doing a buffered read -// from z.r into z.buf if necessary. z.buf[z.raw.start:z.raw.end] remains a contiguous byte -// slice that holds all the bytes read so far for the current token. -// It sets z.err if the underlying reader returns an error. -// Pre-condition: z.err == nil. -func (z *Tokenizer) readByte() byte { - if z.raw.end >= len(z.buf) { - // Our buffer is exhausted and we have to read from z.r. Check if the - // previous read resulted in an error. - if z.readErr != nil { - z.err = z.readErr - return 0 - } - // We copy z.buf[z.raw.start:z.raw.end] to the beginning of z.buf. If the length - // z.raw.end - z.raw.start is more than half the capacity of z.buf, then we - // allocate a new buffer before the copy. - c := cap(z.buf) - d := z.raw.end - z.raw.start - var buf1 []byte - if 2*d > c { - buf1 = make([]byte, d, 2*c) - } else { - buf1 = z.buf[:d] - } - copy(buf1, z.buf[z.raw.start:z.raw.end]) - if x := z.raw.start; x != 0 { - // Adjust the data/attr spans to refer to the same contents after the copy. - z.data.start -= x - z.data.end -= x - z.pendingAttr[0].start -= x - z.pendingAttr[0].end -= x - z.pendingAttr[1].start -= x - z.pendingAttr[1].end -= x - for i := range z.attr { - z.attr[i][0].start -= x - z.attr[i][0].end -= x - z.attr[i][1].start -= x - z.attr[i][1].end -= x - } - } - z.raw.start, z.raw.end, z.buf = 0, d, buf1[:d] - // Now that we have copied the live bytes to the start of the buffer, - // we read from z.r into the remainder. - var n int - n, z.readErr = readAtLeastOneByte(z.r, buf1[d:cap(buf1)]) - if n == 0 { - z.err = z.readErr - return 0 - } - z.buf = buf1[:d+n] - } - x := z.buf[z.raw.end] - z.raw.end++ - if z.maxBuf > 0 && z.raw.end-z.raw.start >= z.maxBuf { - z.err = ErrBufferExceeded - return 0 - } - return x -} - -// Buffered returns a slice containing data buffered but not yet tokenized. -func (z *Tokenizer) Buffered() []byte { - return z.buf[z.raw.end:] -} - -// readAtLeastOneByte wraps an io.Reader so that reading cannot return (0, nil). -// It returns io.ErrNoProgress if the underlying r.Read method returns (0, nil) -// too many times in succession. -func readAtLeastOneByte(r io.Reader, b []byte) (int, error) { - for i := 0; i < 100; i++ { - if n, err := r.Read(b); n != 0 || err != nil { - return n, err - } - } - return 0, io.ErrNoProgress -} - -// skipWhiteSpace skips past any white space. -func (z *Tokenizer) skipWhiteSpace() { - if z.err != nil { - return - } - for { - c := z.readByte() - if z.err != nil { - return - } - switch c { - case ' ', '\n', '\r', '\t', '\f': - // No-op. - default: - z.raw.end-- - return - } - } -} - -// readRawOrRCDATA reads until the next "</foo>", where "foo" is z.rawTag and -// is typically something like "script" or "textarea". -func (z *Tokenizer) readRawOrRCDATA() { - if z.rawTag == "script" { - z.readScript() - z.textIsRaw = true - z.rawTag = "" - return - } -loop: - for { - c := z.readByte() - if z.err != nil { - break loop - } - if c != '<' { - continue loop - } - c = z.readByte() - if z.err != nil { - break loop - } - if c != '/' { - z.raw.end-- - continue loop - } - if z.readRawEndTag() || z.err != nil { - break loop - } - } - z.data.end = z.raw.end - // A textarea's or title's RCDATA can contain escaped entities. - z.textIsRaw = z.rawTag != "textarea" && z.rawTag != "title" - z.rawTag = "" -} - -// readRawEndTag attempts to read a tag like "</foo>", where "foo" is z.rawTag. -// If it succeeds, it backs up the input position to reconsume the tag and -// returns true. Otherwise it returns false. The opening "</" has already been -// consumed. -func (z *Tokenizer) readRawEndTag() bool { - for i := 0; i < len(z.rawTag); i++ { - c := z.readByte() - if z.err != nil { - return false - } - if c != z.rawTag[i] && c != z.rawTag[i]-('a'-'A') { - z.raw.end-- - return false - } - } - c := z.readByte() - if z.err != nil { - return false - } - switch c { - case ' ', '\n', '\r', '\t', '\f', '/', '>': - // The 3 is 2 for the leading "</" plus 1 for the trailing character c. - z.raw.end -= 3 + len(z.rawTag) - return true - } - z.raw.end-- - return false -} - -// readScript reads until the next </script> tag, following the byzantine -// rules for escaping/hiding the closing tag. -func (z *Tokenizer) readScript() { - defer func() { - z.data.end = z.raw.end - }() - var c byte - -scriptData: - c = z.readByte() - if z.err != nil { - return - } - if c == '<' { - goto scriptDataLessThanSign - } - goto scriptData - -scriptDataLessThanSign: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '/': - goto scriptDataEndTagOpen - case '!': - goto scriptDataEscapeStart - } - z.raw.end-- - goto scriptData - -scriptDataEndTagOpen: - if z.readRawEndTag() || z.err != nil { - return - } - goto scriptData - -scriptDataEscapeStart: - c = z.readByte() - if z.err != nil { - return - } - if c == '-' { - goto scriptDataEscapeStartDash - } - z.raw.end-- - goto scriptData - -scriptDataEscapeStartDash: - c = z.readByte() - if z.err != nil { - return - } - if c == '-' { - goto scriptDataEscapedDashDash - } - z.raw.end-- - goto scriptData - -scriptDataEscaped: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataEscapedDash - case '<': - goto scriptDataEscapedLessThanSign - } - goto scriptDataEscaped - -scriptDataEscapedDash: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataEscapedDashDash - case '<': - goto scriptDataEscapedLessThanSign - } - goto scriptDataEscaped - -scriptDataEscapedDashDash: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataEscapedDashDash - case '<': - goto scriptDataEscapedLessThanSign - case '>': - goto scriptData - } - goto scriptDataEscaped - -scriptDataEscapedLessThanSign: - c = z.readByte() - if z.err != nil { - return - } - if c == '/' { - goto scriptDataEscapedEndTagOpen - } - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' { - goto scriptDataDoubleEscapeStart - } - z.raw.end-- - goto scriptData - -scriptDataEscapedEndTagOpen: - if z.readRawEndTag() || z.err != nil { - return - } - goto scriptDataEscaped - -scriptDataDoubleEscapeStart: - z.raw.end-- - for i := 0; i < len("script"); i++ { - c = z.readByte() - if z.err != nil { - return - } - if c != "script"[i] && c != "SCRIPT"[i] { - z.raw.end-- - goto scriptDataEscaped - } - } - c = z.readByte() - if z.err != nil { - return - } - switch c { - case ' ', '\n', '\r', '\t', '\f', '/', '>': - goto scriptDataDoubleEscaped - } - z.raw.end-- - goto scriptDataEscaped - -scriptDataDoubleEscaped: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataDoubleEscapedDash - case '<': - goto scriptDataDoubleEscapedLessThanSign - } - goto scriptDataDoubleEscaped - -scriptDataDoubleEscapedDash: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataDoubleEscapedDashDash - case '<': - goto scriptDataDoubleEscapedLessThanSign - } - goto scriptDataDoubleEscaped - -scriptDataDoubleEscapedDashDash: - c = z.readByte() - if z.err != nil { - return - } - switch c { - case '-': - goto scriptDataDoubleEscapedDashDash - case '<': - goto scriptDataDoubleEscapedLessThanSign - case '>': - goto scriptData - } - goto scriptDataDoubleEscaped - -scriptDataDoubleEscapedLessThanSign: - c = z.readByte() - if z.err != nil { - return - } - if c == '/' { - goto scriptDataDoubleEscapeEnd - } - z.raw.end-- - goto scriptDataDoubleEscaped - -scriptDataDoubleEscapeEnd: - if z.readRawEndTag() { - z.raw.end += len("</script>") - goto scriptDataEscaped - } - if z.err != nil { - return - } - goto scriptDataDoubleEscaped -} - -// readComment reads the next comment token starting with "<!--". The opening -// "<!--" has already been consumed. -func (z *Tokenizer) readComment() { - // When modifying this function, consider manually increasing the - // maxSuffixLen constant in func TestComments, from 6 to e.g. 9 or more. - // That increase should only be temporary, not committed, as it - // exponentially affects the test running time. - - z.data.start = z.raw.end - defer func() { - if z.data.end < z.data.start { - // It's a comment with no data, like <!-->. - z.data.end = z.data.start - } - }() - - var dashCount int - beginning := true - for { - c := z.readByte() - if z.err != nil { - z.data.end = z.calculateAbruptCommentDataEnd() - return - } - switch c { - case '-': - dashCount++ - continue - case '>': - if dashCount >= 2 || beginning { - z.data.end = z.raw.end - len("-->") - return - } - case '!': - if dashCount >= 2 { - c = z.readByte() - if z.err != nil { - z.data.end = z.calculateAbruptCommentDataEnd() - return - } else if c == '>' { - z.data.end = z.raw.end - len("--!>") - return - } else if c == '-' { - dashCount = 1 - beginning = false - continue - } - } - } - dashCount = 0 - beginning = false - } -} - -func (z *Tokenizer) calculateAbruptCommentDataEnd() int { - raw := z.Raw() - const prefixLen = len("<!--") - if len(raw) >= prefixLen { - raw = raw[prefixLen:] - if hasSuffix(raw, "--!") { - return z.raw.end - 3 - } else if hasSuffix(raw, "--") { - return z.raw.end - 2 - } else if hasSuffix(raw, "-") { - return z.raw.end - 1 - } - } - return z.raw.end -} - -func hasSuffix(b []byte, suffix string) bool { - if len(b) < len(suffix) { - return false - } - b = b[len(b)-len(suffix):] - for i := range b { - if b[i] != suffix[i] { - return false - } - } - return true -} - -// readUntilCloseAngle reads until the next ">". -func (z *Tokenizer) readUntilCloseAngle() { - z.data.start = z.raw.end - for { - c := z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return - } - if c == '>' { - z.data.end = z.raw.end - len(">") - return - } - } -} - -// readMarkupDeclaration reads the next token starting with "<!". It might be -// a "<!--comment-->", a "<!DOCTYPE foo>", a "<![CDATA[section]]>" or -// "<!a bogus comment". The opening "<!" has already been consumed. -func (z *Tokenizer) readMarkupDeclaration() TokenType { - z.data.start = z.raw.end - var c [2]byte - for i := 0; i < 2; i++ { - c[i] = z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return CommentToken - } - } - if c[0] == '-' && c[1] == '-' { - z.readComment() - return CommentToken - } - z.raw.end -= 2 - if z.readDoctype() { - return DoctypeToken - } - if z.allowCDATA && z.readCDATA() { - z.convertNUL = true - return TextToken - } - // It's a bogus comment. - z.readUntilCloseAngle() - return CommentToken -} - -// readDoctype attempts to read a doctype declaration and returns true if -// successful. The opening "<!" has already been consumed. -func (z *Tokenizer) readDoctype() bool { - const s = "DOCTYPE" - for i := 0; i < len(s); i++ { - c := z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return false - } - if c != s[i] && c != s[i]+('a'-'A') { - // Back up to read the fragment of "DOCTYPE" again. - z.raw.end = z.data.start - return false - } - } - if z.skipWhiteSpace(); z.err != nil { - z.data.start = z.raw.end - z.data.end = z.raw.end - return true - } - z.readUntilCloseAngle() - return true -} - -// readCDATA attempts to read a CDATA section and returns true if -// successful. The opening "<!" has already been consumed. -func (z *Tokenizer) readCDATA() bool { - const s = "[CDATA[" - for i := 0; i < len(s); i++ { - c := z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return false - } - if c != s[i] { - // Back up to read the fragment of "[CDATA[" again. - z.raw.end = z.data.start - return false - } - } - z.data.start = z.raw.end - brackets := 0 - for { - c := z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return true - } - switch c { - case ']': - brackets++ - case '>': - if brackets >= 2 { - z.data.end = z.raw.end - len("]]>") - return true - } - brackets = 0 - default: - brackets = 0 - } - } -} - -// startTagIn returns whether the start tag in z.buf[z.data.start:z.data.end] -// case-insensitively matches any element of ss. -func (z *Tokenizer) startTagIn(ss ...string) bool { -loop: - for _, s := range ss { - if z.data.end-z.data.start != len(s) { - continue loop - } - for i := 0; i < len(s); i++ { - c := z.buf[z.data.start+i] - if 'A' <= c && c <= 'Z' { - c += 'a' - 'A' - } - if c != s[i] { - continue loop - } - } - return true - } - return false -} - -// readStartTag reads the next start tag token. The opening "<a" has already -// been consumed, where 'a' means anything in [A-Za-z]. -func (z *Tokenizer) readStartTag() TokenType { - z.readTag(true) - if z.err != nil { - return ErrorToken - } - // Several tags flag the tokenizer's next token as raw. - c, raw := z.buf[z.data.start], false - if 'A' <= c && c <= 'Z' { - c += 'a' - 'A' - } - switch c { - case 'i': - raw = z.startTagIn("iframe") - case 'n': - raw = z.startTagIn("noembed", "noframes", "noscript") - case 'p': - raw = z.startTagIn("plaintext") - case 's': - raw = z.startTagIn("script", "style") - case 't': - raw = z.startTagIn("textarea", "title") - case 'x': - raw = z.startTagIn("xmp") - } - if raw { - z.rawTag = strings.ToLower(string(z.buf[z.data.start:z.data.end])) - } - // Look for a self-closing token like "<br/>". - if z.err == nil && z.buf[z.raw.end-2] == '/' { - return SelfClosingTagToken - } - return StartTagToken -} - -// readTag reads the next tag token and its attributes. If saveAttr, those -// attributes are saved in z.attr, otherwise z.attr is set to an empty slice. -// The opening "<a" or "</a" has already been consumed, where 'a' means anything -// in [A-Za-z]. -func (z *Tokenizer) readTag(saveAttr bool) { - z.attr = z.attr[:0] - z.nAttrReturned = 0 - // Read the tag name and attribute key/value pairs. - z.readTagName() - if z.skipWhiteSpace(); z.err != nil { - return - } - for { - c := z.readByte() - if z.err != nil || c == '>' { - break - } - z.raw.end-- - z.readTagAttrKey() - z.readTagAttrVal() - // Save pendingAttr if saveAttr and that attribute has a non-empty key. - if saveAttr && z.pendingAttr[0].start != z.pendingAttr[0].end { - z.attr = append(z.attr, z.pendingAttr) - } - if z.skipWhiteSpace(); z.err != nil { - break - } - } -} - -// readTagName sets z.data to the "div" in "<div k=v>". The reader (z.raw.end) -// is positioned such that the first byte of the tag name (the "d" in "<div") -// has already been consumed. -func (z *Tokenizer) readTagName() { - z.data.start = z.raw.end - 1 - for { - c := z.readByte() - if z.err != nil { - z.data.end = z.raw.end - return - } - switch c { - case ' ', '\n', '\r', '\t', '\f': - z.data.end = z.raw.end - 1 - return - case '/', '>': - z.raw.end-- - z.data.end = z.raw.end - return - } - } -} - -// readTagAttrKey sets z.pendingAttr[0] to the "k" in "<div k=v>". -// Precondition: z.err == nil. -func (z *Tokenizer) readTagAttrKey() { - z.pendingAttr[0].start = z.raw.end - for { - c := z.readByte() - if z.err != nil { - z.pendingAttr[0].end = z.raw.end - return - } - switch c { - case '=': - if z.pendingAttr[0].start+1 == z.raw.end { - // WHATWG 13.2.5.32, if we see an equals sign before the attribute name - // begins, we treat it as a character in the attribute name and continue. - continue - } - fallthrough - case ' ', '\n', '\r', '\t', '\f', '/', '>': - // WHATWG 13.2.5.33 Attribute name state - // We need to reconsume the char in the after attribute name state to support the / character - z.raw.end-- - z.pendingAttr[0].end = z.raw.end - return - } - } -} - -// readTagAttrVal sets z.pendingAttr[1] to the "v" in "<div k=v>". -func (z *Tokenizer) readTagAttrVal() { - z.pendingAttr[1].start = z.raw.end - z.pendingAttr[1].end = z.raw.end - if z.skipWhiteSpace(); z.err != nil { - return - } - c := z.readByte() - if z.err != nil { - return - } - if c == '/' { - // WHATWG 13.2.5.34 After attribute name state - // U+002F SOLIDUS (/) - Switch to the self-closing start tag state. - return - } - if c != '=' { - z.raw.end-- - return - } - if z.skipWhiteSpace(); z.err != nil { - return - } - quote := z.readByte() - if z.err != nil { - return - } - switch quote { - case '>': - z.raw.end-- - return - - case '\'', '"': - z.pendingAttr[1].start = z.raw.end - for { - c := z.readByte() - if z.err != nil { - z.pendingAttr[1].end = z.raw.end - return - } - if c == quote { - z.pendingAttr[1].end = z.raw.end - 1 - return - } - } - - default: - z.pendingAttr[1].start = z.raw.end - 1 - for { - c := z.readByte() - if z.err != nil { - z.pendingAttr[1].end = z.raw.end - return - } - switch c { - case ' ', '\n', '\r', '\t', '\f': - z.pendingAttr[1].end = z.raw.end - 1 - return - case '>': - z.raw.end-- - z.pendingAttr[1].end = z.raw.end - return - } - } - } -} - -// Next scans the next token and returns its type. -func (z *Tokenizer) Next() TokenType { - z.raw.start = z.raw.end - z.data.start = z.raw.end - z.data.end = z.raw.end - if z.err != nil { - z.tt = ErrorToken - return z.tt - } - if z.rawTag != "" { - if z.rawTag == "plaintext" { - // Read everything up to EOF. - for z.err == nil { - z.readByte() - } - z.data.end = z.raw.end - z.textIsRaw = true - } else { - z.readRawOrRCDATA() - } - if z.data.end > z.data.start { - z.tt = TextToken - z.convertNUL = true - return z.tt - } - } - z.textIsRaw = false - z.convertNUL = false - -loop: - for { - c := z.readByte() - if z.err != nil { - break loop - } - if c != '<' { - continue loop - } - - // Check if the '<' we have just read is part of a tag, comment - // or doctype. If not, it's part of the accumulated text token. - c = z.readByte() - if z.err != nil { - break loop - } - var tokenType TokenType - switch { - case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': - tokenType = StartTagToken - case c == '/': - tokenType = EndTagToken - case c == '!' || c == '?': - // We use CommentToken to mean any of "<!--actual comments-->", - // "<!DOCTYPE declarations>" and "<?xml processing instructions?>". - tokenType = CommentToken - default: - // Reconsume the current character. - z.raw.end-- - continue - } - - // We have a non-text token, but we might have accumulated some text - // before that. If so, we return the text first, and return the non- - // text token on the subsequent call to Next. - if x := z.raw.end - len("<a"); z.raw.start < x { - z.raw.end = x - z.data.end = x - z.tt = TextToken - return z.tt - } - switch tokenType { - case StartTagToken: - z.tt = z.readStartTag() - return z.tt - case EndTagToken: - c = z.readByte() - if z.err != nil { - break loop - } - if c == '>' { - // "</>" does not generate a token at all. Generate an empty comment - // to allow passthrough clients to pick up the data using Raw. - // Reset the tokenizer state and start again. - z.tt = CommentToken - return z.tt - } - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' { - z.readTag(false) - if z.err != nil { - z.tt = ErrorToken - } else { - z.tt = EndTagToken - } - return z.tt - } - z.raw.end-- - z.readUntilCloseAngle() - z.tt = CommentToken - return z.tt - case CommentToken: - if c == '!' { - z.tt = z.readMarkupDeclaration() - return z.tt - } - z.raw.end-- - z.readUntilCloseAngle() - z.tt = CommentToken - return z.tt - } - } - if z.raw.start < z.raw.end { - z.data.end = z.raw.end - z.tt = TextToken - return z.tt - } - z.tt = ErrorToken - return z.tt -} - -// Raw returns the unmodified text of the current token. Calling Next, Token, -// Text, TagName or TagAttr may change the contents of the returned slice. -// -// The token stream's raw bytes partition the byte stream (up until an -// ErrorToken). There are no overlaps or gaps between two consecutive token's -// raw bytes. One implication is that the byte offset of the current token is -// the sum of the lengths of all previous tokens' raw bytes. -func (z *Tokenizer) Raw() []byte { - return z.buf[z.raw.start:z.raw.end] -} - -// convertNewlines converts "\r" and "\r\n" in s to "\n". -// The conversion happens in place, but the resulting slice may be shorter. -func convertNewlines(s []byte) []byte { - for i, c := range s { - if c != '\r' { - continue - } - - src := i + 1 - if src >= len(s) || s[src] != '\n' { - s[i] = '\n' - continue - } - - dst := i - for src < len(s) { - if s[src] == '\r' { - if src+1 < len(s) && s[src+1] == '\n' { - src++ - } - s[dst] = '\n' - } else { - s[dst] = s[src] - } - src++ - dst++ - } - return s[:dst] - } - return s -} - -var ( - nul = []byte("\x00") - replacement = []byte("\ufffd") -) - -// Text returns the unescaped text of a text, comment or doctype token. The -// contents of the returned slice may change on the next call to Next. -func (z *Tokenizer) Text() []byte { - switch z.tt { - case TextToken, CommentToken, DoctypeToken: - s := z.buf[z.data.start:z.data.end] - z.data.start = z.raw.end - z.data.end = z.raw.end - s = convertNewlines(s) - if (z.convertNUL || z.tt == CommentToken) && bytes.Contains(s, nul) { - s = bytes.Replace(s, nul, replacement, -1) - } - if !z.textIsRaw { - s = unescape(s, false) - } - return s - } - return nil -} - -// TagName returns the lower-cased name of a tag token (the `img` out of -// `<IMG SRC="foo">`) and whether the tag has attributes. -// The contents of the returned slice may change on the next call to Next. -func (z *Tokenizer) TagName() (name []byte, hasAttr bool) { - if z.data.start < z.data.end { - switch z.tt { - case StartTagToken, EndTagToken, SelfClosingTagToken: - s := z.buf[z.data.start:z.data.end] - z.data.start = z.raw.end - z.data.end = z.raw.end - return lower(s), z.nAttrReturned < len(z.attr) - } - } - return nil, false -} - -// TagAttr returns the lower-cased key and unescaped value of the next unparsed -// attribute for the current tag token and whether there are more attributes. -// The contents of the returned slices may change on the next call to Next. -func (z *Tokenizer) TagAttr() (key, val []byte, moreAttr bool) { - if z.nAttrReturned < len(z.attr) { - switch z.tt { - case StartTagToken, SelfClosingTagToken: - x := z.attr[z.nAttrReturned] - z.nAttrReturned++ - key = z.buf[x[0].start:x[0].end] - val = z.buf[x[1].start:x[1].end] - return lower(key), unescape(convertNewlines(val), true), z.nAttrReturned < len(z.attr) - } - } - return nil, nil, false -} - -// Token returns the current Token. The result's Data and Attr values remain -// valid after subsequent Next calls. -func (z *Tokenizer) Token() Token { - t := Token{Type: z.tt} - switch z.tt { - case TextToken, CommentToken, DoctypeToken: - t.Data = string(z.Text()) - case StartTagToken, SelfClosingTagToken, EndTagToken: - name, moreAttr := z.TagName() - for moreAttr { - var key, val []byte - key, val, moreAttr = z.TagAttr() - t.Attr = append(t.Attr, Attribute{"", atom.String(key), string(val)}) - } - if a := atom.Lookup(name); a != 0 { - t.DataAtom, t.Data = a, a.String() - } else { - t.DataAtom, t.Data = 0, string(name) - } - } - return t -} - -// SetMaxBuf sets a limit on the amount of data buffered during tokenization. -// A value of 0 means unlimited. -func (z *Tokenizer) SetMaxBuf(n int) { - z.maxBuf = n -} - -// NewTokenizer returns a new HTML Tokenizer for the given Reader. -// The input is assumed to be UTF-8 encoded. -func NewTokenizer(r io.Reader) *Tokenizer { - return NewTokenizerFragment(r, "") -} - -// NewTokenizerFragment returns a new HTML Tokenizer for the given Reader, for -// tokenizing an existing element's InnerHTML fragment. contextTag is that -// element's tag, such as "div" or "iframe". -// -// For example, how the InnerHTML "a<b" is tokenized depends on whether it is -// for a <p> tag or a <script> tag. -// -// The input is assumed to be UTF-8 encoded. -func NewTokenizerFragment(r io.Reader, contextTag string) *Tokenizer { - z := &Tokenizer{ - r: r, - buf: make([]byte, 0, 4096), - } - if contextTag != "" { - switch s := strings.ToLower(contextTag); s { - case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "title", "textarea", "xmp": - z.rawTag = s - } - } - return z -} diff --git a/upstream/vendor/golang.org/x/net/http/httpguts/httplex.go b/upstream/vendor/golang.org/x/net/http/httpguts/httplex.go index 9b4de94019b..6e071e85243 100644 --- a/upstream/vendor/golang.org/x/net/http/httpguts/httplex.go +++ b/upstream/vendor/golang.org/x/net/http/httpguts/httplex.go @@ -12,7 +12,7 @@ import ( "golang.org/x/net/idna" ) -var isTokenTable = [256]bool{ +var isTokenTable = [127]bool{ '!': true, '#': true, '$': true, @@ -93,7 +93,12 @@ var isTokenTable = [256]bool{ } func IsTokenRune(r rune) bool { - return r < utf8.RuneSelf && isTokenTable[byte(r)] + i := int(r) + return i < len(isTokenTable) && isTokenTable[i] +} + +func isNotToken(r rune) bool { + return !IsTokenRune(r) } // HeaderValuesContainsToken reports whether any string in values @@ -197,8 +202,8 @@ func ValidHeaderFieldName(v string) bool { if len(v) == 0 { return false } - for i := 0; i < len(v); i++ { - if !isTokenTable[v[i]] { + for _, r := range v { + if !IsTokenRune(r) { return false } } diff --git a/upstream/vendor/golang.org/x/net/http2/frame.go b/upstream/vendor/golang.org/x/net/http2/frame.go index 105c3b279c0..43557ab7e97 100644 --- a/upstream/vendor/golang.org/x/net/http2/frame.go +++ b/upstream/vendor/golang.org/x/net/http2/frame.go @@ -490,9 +490,6 @@ 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 { @@ -1524,7 +1521,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) (Frame, error) { +func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { if fr.AllowIllegalReads { return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders") } @@ -1595,7 +1592,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, 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 mh, ConnectionError(ErrCodeProtocol) + return nil, ConnectionError(ErrCodeProtocol) } // Also close the connection after any CONTINUATION frame following an @@ -1607,11 +1604,11 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, 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 mh, ConnectionError(ErrCodeProtocol) + return nil, ConnectionError(ErrCodeProtocol) } if _, err := hdec.Write(frag); err != nil { - return mh, ConnectionError(ErrCodeCompression) + return nil, ConnectionError(ErrCodeCompression) } if hc.HeadersEnded() { @@ -1628,7 +1625,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { mh.HeadersFrame.invalidate() if err := hdec.Close(); err != nil { - return mh, ConnectionError(ErrCodeCompression) + return nil, ConnectionError(ErrCodeCompression) } if invalid != nil { fr.errDetail = invalid diff --git a/upstream/vendor/golang.org/x/net/http2/http2.go b/upstream/vendor/golang.org/x/net/http2/http2.go index 003e649f30c..6f2df281872 100644 --- a/upstream/vendor/golang.org/x/net/http2/http2.go +++ b/upstream/vendor/golang.org/x/net/http2/http2.go @@ -17,7 +17,6 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" - "context" "crypto/tls" "fmt" "io" @@ -27,7 +26,6 @@ import ( "strconv" "strings" "sync" - "time" "golang.org/x/net/http/httpguts" ) @@ -212,6 +210,12 @@ 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{} @@ -379,14 +383,3 @@ 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/upstream/vendor/golang.org/x/net/http2/server.go b/upstream/vendor/golang.org/x/net/http2/server.go index 6c349f3ec64..ce2e8b40eee 100644 --- a/upstream/vendor/golang.org/x/net/http2/server.go +++ b/upstream/vendor/golang.org/x/net/http2/server.go @@ -154,39 +154,6 @@ 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 { @@ -433,10 +400,6 @@ 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() @@ -463,9 +426,6 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon pushEnabled: true, sawClientPreface: opts.SawClientPreface, } - if newf != nil { - newf(sc) - } s.state.registerConn(sc) defer s.state.unregisterConn(sc) @@ -639,8 +599,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 timer // nil until used - idleTimer timer // nil if unused + shutdownTimer *time.Timer // nil until used + idleTimer *time.Timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer @@ -689,12 +649,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 timer // nil if unused - writeDeadline 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 *time.Timer // nil if unused + writeDeadline *time.Timer // nil if unused + closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer @@ -772,7 +732,11 @@ func isClosedConnError(err error) bool { return false } - if errors.Is(err, net.ErrClosed) { + // 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") { return true } @@ -851,9 +815,8 @@ type readFrameResult struct { // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { - sc.srv.markNewGoroutine() - gate := make(chan struct{}) - gateDone := func() { gate <- struct{}{} } + gate := make(gate) + gateDone := gate.Done for { f, err := sc.framer.ReadFrame() select { @@ -884,7 +847,6 @@ 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) @@ -964,13 +926,13 @@ func (sc *serverConn) serve() { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { - sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above - settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) + settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() loopNum := 0 @@ -1099,10 +1061,10 @@ func (sc *serverConn) readPreface() error { errc <- nil } }() - timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? + timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { - case <-timer.C(): + case <-timer.C: return errPrefaceTimeout case err := <-errc: if err == nil { @@ -1467,7 +1429,7 @@ func (sc *serverConn) goAway(code ErrCode) { func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() - sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) + sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { @@ -1520,11 +1482,6 @@ 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 @@ -1681,7 +1638,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 && sc.idleTimer != nil { + if sc.srv.IdleTimeout > 0 { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { @@ -1703,7 +1660,6 @@ 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) } @@ -2064,7 +2020,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 = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) @@ -2162,7 +2118,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 = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st @@ -2386,7 +2342,6 @@ 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() { @@ -2683,7 +2638,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 = rws.conn.srv.now().UTC().Format(http.TimeFormat) + date = time.Now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { @@ -2805,7 +2760,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() { func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { + if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() @@ -2821,9 +2776,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { - st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) + st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) } else { - st.readDeadline.Reset(deadline.Sub(sc.srv.now())) + st.readDeadline.Reset(deadline.Sub(time.Now())) } }) return nil @@ -2831,7 +2786,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(w.rws.conn.srv.now()) { + if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() @@ -2847,9 +2802,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { - st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) + st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) } else { - st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) + st.writeDeadline.Reset(deadline.Sub(time.Now())) } }) return nil diff --git a/upstream/vendor/golang.org/x/net/http2/testsync.go b/upstream/vendor/golang.org/x/net/http2/testsync.go new file mode 100644 index 00000000000..61075bd16d3 --- /dev/null +++ b/upstream/vendor/golang.org/x/net/http2/testsync.go @@ -0,0 +1,331 @@ +// 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/upstream/vendor/golang.org/x/net/http2/timer.go b/upstream/vendor/golang.org/x/net/http2/timer.go deleted file mode 100644 index 0b1c17b8129..00000000000 --- a/upstream/vendor/golang.org/x/net/http2/timer.go +++ /dev/null @@ -1,20 +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 "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/upstream/vendor/golang.org/x/net/http2/transport.go b/upstream/vendor/golang.org/x/net/http2/transport.go index 61f511f97aa..ce375c8c753 100644 --- a/upstream/vendor/golang.org/x/net/http2/transport.go +++ b/upstream/vendor/golang.org/x/net/http2/transport.go @@ -185,45 +185,7 @@ type Transport struct { connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool - *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) + syncHooks *testSyncHooks } func (t *Transport) maxHeaderListSize() uint32 { @@ -390,6 +352,60 @@ 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 @@ -471,7 +487,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.cond.Broadcast() + cs.cc.condBroadcast() } } @@ -481,7 +497,7 @@ func (cs *clientStream) abortRequestBodyWrite() { defer cc.mu.Unlock() if cs.reqBody != nil && cs.reqBodyClosed == nil { cs.closeReqBodyLocked() - cc.cond.Broadcast() + cc.condBroadcast() } } @@ -491,11 +507,10 @@ func (cs *clientStream) closeReqBodyLocked() { } cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed - go func() { - cs.cc.t.markNewGoroutine() + cs.cc.goRun(func() { cs.reqBody.Close() close(reqBodyClosed) - }() + }) } type stickyErrWriter struct { @@ -611,7 +626,21 @@ 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) - tm := t.newTimer(d) + 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) + } select { case <-tm.C(): t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) @@ -696,8 +725,8 @@ func canRetryError(err error) bool { } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.transportTestHooks != nil { - return t.newClientConn(nil, singleUse) + if t.syncHooks != nil { + return t.newClientConn(nil, singleUse, t.syncHooks) } host, _, err := net.SplitHostPort(addr) if err != nil { @@ -707,7 +736,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b if err != nil { return nil, err } - return t.newClientConn(tconn, singleUse) + return t.newClientConn(tconn, singleUse, nil) } func (t *Transport) newTLSConfig(host string) *tls.Config { @@ -773,10 +802,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, t.disableKeepAlives()) + return t.newClientConn(c, t.disableKeepAlives(), nil) } -func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { +func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) { cc := &ClientConn{ t: t, tconn: c, @@ -791,12 +820,16 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), + syncHooks: hooks, } - if t.transportTestHooks != nil { - t.markNewGoroutine() - t.transportTestHooks.newclientconn(cc) + if hooks != nil { + hooks.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()) } @@ -827,6 +860,10 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro 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 @@ -856,13 +893,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro return nil, cc.werr } - // 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() + cc.goRun(cc.readLoop) return cc, nil } @@ -870,7 +901,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.t.contextWithTimeout(context.Background(), pingTimeout) + ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) @@ -905,20 +936,7 @@ func (cc *ClientConn) setGoAway(f *GoAwayFrame) { } last := f.LastStreamID for streamID, cs := range cc.streams { - 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. + if streamID > last { cs.abortStreamLocked(errClientConnGotGoAway) } } @@ -1113,8 +1131,7 @@ 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 - go func() { - cc.t.markNewGoroutine() + cc.goRun(func() { cc.mu.Lock() defer cc.mu.Unlock() for { @@ -1126,9 +1143,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { if cancelled { break } - cc.cond.Wait() + cc.condWait() } - }() + }) shutdownEnterWaitStateHook() select { case <-done: @@ -1138,7 +1155,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { cc.mu.Lock() // Free the goroutine above cancelled = true - cc.cond.Broadcast() + cc.condBroadcast() cc.mu.Unlock() return ctx.Err() } @@ -1176,7 +1193,7 @@ func (cc *ClientConn) closeForError(err error) { for _, cs := range cc.streams { cs.abortStreamLocked(err) } - cc.cond.Broadcast() + cc.condBroadcast() cc.mu.Unlock() cc.closeConn() } @@ -1291,30 +1308,23 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) respHeaderRecv: make(chan struct{}), donec: make(chan struct{}), } - - // 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) + cc.goRun(func() { + cs.doRequest(req) + }) 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 @@ -1375,7 +1385,24 @@ 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() @@ -1405,9 +1432,8 @@ 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, streamf func(*clientStream)) { - cs.cc.t.markNewGoroutine() - err := cs.writeRequest(req, streamf) +func (cs *clientStream) doRequest(req *http.Request) { + err := cs.writeRequest(req) cs.cleanupWriteRequest(err) } @@ -1418,7 +1444,7 @@ func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream) // // 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, streamf func(*clientStream)) (err error) { +func (cs *clientStream) writeRequest(req *http.Request) (err error) { cc := cs.cc ctx := cs.ctx @@ -1432,6 +1458,21 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre 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: @@ -1456,8 +1497,28 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre } cc.mu.Unlock() - if streamf != nil { - streamf(cs) + 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 } continueTimeout := cc.t.expectContinueTimeout() @@ -1520,7 +1581,7 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { - timer := cc.t.newTimer(d) + timer := cc.newTimer(d) defer timer.Stop() respHeaderTimer = timer.C() respHeaderRecv = cs.respHeaderRecv @@ -1529,6 +1590,21 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre // 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 @@ -1677,7 +1753,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { return nil } cc.pendingRequests++ - cc.cond.Wait() + cc.condWait() cc.pendingRequests-- select { case <-cs.abort: @@ -1939,7 +2015,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) cs.flow.take(take) return take, nil } - cc.cond.Wait() + cc.condWait() } } @@ -2222,7 +2298,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) { } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. - cc.cond.Broadcast() + cc.condBroadcast() closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { @@ -2244,7 +2320,6 @@ 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() @@ -2311,7 +2386,7 @@ func (rl *clientConnReadLoop) cleanup() { cs.abortStreamLocked(err) } } - cc.cond.Broadcast() + cc.condBroadcast() cc.mu.Unlock() } @@ -2348,7 +2423,7 @@ func (rl *clientConnReadLoop) run() error { readIdleTimeout := cc.t.ReadIdleTimeout var t timer if readIdleTimeout != 0 { - t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) + t = cc.afterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() @@ -2946,7 +3021,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { for _, cs := range cc.streams { cs.flow.add(delta) } - cc.cond.Broadcast() + cc.condBroadcast() cc.initialWindowSize = s.Val case SettingHeaderTableSize: @@ -3001,7 +3076,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { return ConnectionError(ErrCodeFlowControl) } - cc.cond.Broadcast() + cc.condBroadcast() return nil } @@ -3045,8 +3120,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } var pingError error errc := make(chan struct{}) - go func() { - cc.t.markNewGoroutine() + cc.goRun(func() { cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { @@ -3057,7 +3131,20 @@ 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/upstream/vendor/golang.org/x/net/http2/writesched_priority.go b/upstream/vendor/golang.org/x/net/http2/writesched_priority.go index f6783339d11..0a242c669e2 100644 --- a/upstream/vendor/golang.org/x/net/http2/writesched_priority.go +++ b/upstream/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 n.kids != nil { - n.kids.setParent(n.parent) + for k := n.kids; k != nil; k = k.next { + k.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) diff --git a/upstream/vendor/golang.org/x/net/proxy/per_host.go b/upstream/vendor/golang.org/x/net/proxy/per_host.go index d7d4b8b6e35..573fe79e86e 100644 --- a/upstream/vendor/golang.org/x/net/proxy/per_host.go +++ b/upstream/vendor/golang.org/x/net/proxy/per_host.go @@ -137,7 +137,9 @@ func (p *PerHost) AddNetwork(net *net.IPNet) { // AddZone specifies a DNS suffix that will use the bypass proxy. A zone of // "example.com" matches "example.com" and all of its subdomains. func (p *PerHost) AddZone(zone string) { - zone = strings.TrimSuffix(zone, ".") + if strings.HasSuffix(zone, ".") { + zone = zone[:len(zone)-1] + } if !strings.HasPrefix(zone, ".") { zone = "." + zone } @@ -146,6 +148,8 @@ func (p *PerHost) AddZone(zone string) { // AddHost specifies a host name that will use the bypass proxy. func (p *PerHost) AddHost(host string) { - host = strings.TrimSuffix(host, ".") + if strings.HasSuffix(host, ".") { + host = host[:len(host)-1] + } p.bypassHosts = append(p.bypassHosts, host) } diff --git a/upstream/vendor/golang.org/x/oauth2/LICENSE b/upstream/vendor/golang.org/x/oauth2/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/oauth2/LICENSE +++ b/upstream/vendor/golang.org/x/oauth2/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/oauth2/google/appengine.go b/upstream/vendor/golang.org/x/oauth2/google/appengine.go index 564920bd424..feb1157b15b 100644 --- a/upstream/vendor/golang.org/x/oauth2/google/appengine.go +++ b/upstream/vendor/golang.org/x/oauth2/google/appengine.go @@ -6,13 +6,16 @@ package google import ( "context" - "log" - "sync" + "time" "golang.org/x/oauth2" ) -var logOnce sync.Once // only spam about deprecation once +// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. +var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) + +// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. +var appengineAppIDFunc func(c context.Context) string // AppEngineTokenSource returns a token source that fetches tokens from either // the current application's service account or from the metadata server, @@ -20,10 +23,8 @@ var logOnce sync.Once // only spam about deprecation once // details. If you are implementing a 3-legged OAuth 2.0 flow on App Engine that // involves user accounts, see oauth2.Config instead. // -// The current version of this library requires at least Go 1.17 to build, -// so first generation App Engine runtimes (<= Go 1.9) are unsupported. -// Previously, on first generation App Engine runtimes, AppEngineTokenSource -// returned a token source that fetches tokens issued to the +// First generation App Engine runtimes (<= Go 1.9): +// AppEngineTokenSource returns a token source that fetches tokens issued to the // current App Engine application's service account. The provided context must have // come from appengine.NewContext. // @@ -33,8 +34,5 @@ var logOnce sync.Once // only spam about deprecation once // context and scopes are not used. Please use DefaultTokenSource (or ComputeTokenSource, // which DefaultTokenSource will use in this case) instead. func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - logOnce.Do(func() { - log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") - }) - return ComputeTokenSource("") + return appEngineTokenSource(ctx, scope...) } diff --git a/upstream/vendor/golang.org/x/oauth2/google/appengine_gen1.go b/upstream/vendor/golang.org/x/oauth2/google/appengine_gen1.go new file mode 100644 index 00000000000..e61587945b0 --- /dev/null +++ b/upstream/vendor/golang.org/x/oauth2/google/appengine_gen1.go @@ -0,0 +1,77 @@ +// 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 + +// This file applies to App Engine first generation runtimes (<= Go 1.9). + +package google + +import ( + "context" + "sort" + "strings" + "sync" + + "golang.org/x/oauth2" + "google.golang.org/appengine" +) + +func init() { + appengineTokenFunc = appengine.AccessToken + appengineAppIDFunc = appengine.AppID +} + +// See comment on AppEngineTokenSource in appengine.go. +func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { + scopes := append([]string{}, scope...) + sort.Strings(scopes) + return &gaeTokenSource{ + ctx: ctx, + scopes: scopes, + key: strings.Join(scopes, " "), + } +} + +// aeTokens helps the fetched tokens to be reused until their expiration. +var ( + aeTokensMu sync.Mutex + aeTokens = make(map[string]*tokenLock) // key is space-separated scopes +) + +type tokenLock struct { + mu sync.Mutex // guards t; held while fetching or updating t + t *oauth2.Token +} + +type gaeTokenSource struct { + ctx context.Context + scopes []string + key string // to aeTokens map; space-separated scopes +} + +func (ts *gaeTokenSource) Token() (*oauth2.Token, error) { + aeTokensMu.Lock() + tok, ok := aeTokens[ts.key] + if !ok { + tok = &tokenLock{} + aeTokens[ts.key] = tok + } + aeTokensMu.Unlock() + + tok.mu.Lock() + defer tok.mu.Unlock() + if tok.t.Valid() { + return tok.t, nil + } + access, exp, err := appengineTokenFunc(ts.ctx, ts.scopes...) + if err != nil { + return nil, err + } + tok.t = &oauth2.Token{ + AccessToken: access, + Expiry: exp, + } + return tok.t, nil +} diff --git a/upstream/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go b/upstream/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go new file mode 100644 index 00000000000..9c79aa0a0cc --- /dev/null +++ b/upstream/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go @@ -0,0 +1,27 @@ +// 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 + +// This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible. + +package google + +import ( + "context" + "log" + "sync" + + "golang.org/x/oauth2" +) + +var logOnce sync.Once // only spam about deprecation once + +// See comment on AppEngineTokenSource in appengine.go. +func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { + logOnce.Do(func() { + log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") + }) + return ComputeTokenSource("") +} diff --git a/upstream/vendor/golang.org/x/oauth2/google/default.go b/upstream/vendor/golang.org/x/oauth2/google/default.go index df958359a87..18f369851bf 100644 --- a/upstream/vendor/golang.org/x/oauth2/google/default.go +++ b/upstream/vendor/golang.org/x/oauth2/google/default.go @@ -42,17 +42,6 @@ type Credentials struct { // running on Google Cloud Platform. JSON []byte - // UniverseDomainProvider returns the default service domain for a given - // Cloud universe. Optional. - // - // On GCE, UniverseDomainProvider should return the universe domain value - // from Google Compute Engine (GCE)'s metadata server. See also [The attached service - // account](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa). - // If the GCE metadata server returns a 404 error, the default universe - // domain value should be returned. If the GCE metadata server returns an - // error other than 404, the error should be returned. - UniverseDomainProvider func() (string, error) - udMu sync.Mutex // guards universeDomain // universeDomain is the default service domain for a given Cloud universe. universeDomain string @@ -75,32 +64,54 @@ func (c *Credentials) UniverseDomain() string { } // GetUniverseDomain returns the default service domain for a given Cloud -// universe. If present, UniverseDomainProvider will be invoked and its return -// value will be cached. +// universe. // // The default value is "googleapis.com". +// +// It obtains the universe domain from the attached service account on GCE when +// authenticating via the GCE metadata server. See also [The attached service +// account](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa). +// If the GCE metadata server returns a 404 error, the default value is +// returned. If the GCE metadata server returns an error other than 404, the +// error is returned. func (c *Credentials) GetUniverseDomain() (string, error) { c.udMu.Lock() defer c.udMu.Unlock() - if c.universeDomain == "" && c.UniverseDomainProvider != nil { - // On Google Compute Engine, an App Engine standard second generation - // runtime, or App Engine flexible, use an externally provided function - // to request the universe domain from the metadata server. - ud, err := c.UniverseDomainProvider() + if c.universeDomain == "" && metadata.OnGCE() { + // If we're on Google Compute Engine, an App Engine standard second + // generation runtime, or App Engine flexible, use the metadata server. + err := c.computeUniverseDomain() if err != nil { return "", err } - c.universeDomain = ud } - // If no UniverseDomainProvider (meaning not on Google Compute Engine), or - // in case of any (non-error) empty return value from - // UniverseDomainProvider, set the default universe domain. + // If not on Google Compute Engine, or in case of any non-error path in + // computeUniverseDomain that did not set universeDomain, set the default + // universe domain. if c.universeDomain == "" { c.universeDomain = defaultUniverseDomain } return c.universeDomain, nil } +// computeUniverseDomain fetches the default service domain for a given Cloud +// universe from Google Compute Engine (GCE)'s metadata server. It's only valid +// to use this method if your program is running on a GCE instance. +func (c *Credentials) computeUniverseDomain() error { + var err error + c.universeDomain, err = metadata.Get("universe/universe_domain") + if err != nil { + if _, ok := err.(metadata.NotDefinedError); ok { + // http.StatusNotFound (404) + c.universeDomain = defaultUniverseDomain + return nil + } else { + return err + } + } + return nil +} + // DefaultCredentials is the old name of Credentials. // // Deprecated: use Credentials instead. @@ -188,7 +199,9 @@ func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSourc // 2. A JSON file in a location known to the gcloud command-line tool. // On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. // On other systems, $HOME/.config/gcloud/application_default_credentials.json. -// 3. On Google Compute Engine, Google App Engine standard second generation runtimes +// 3. On Google App Engine standard first generation runtimes (<= Go 1.9) it uses +// the appengine.AccessToken function. +// 4. On Google Compute Engine, Google App Engine standard second generation runtimes // (>= Go 1.11), and Google App Engine flexible environment, it fetches // credentials from the metadata server. func FindDefaultCredentialsWithParams(ctx context.Context, params CredentialsParams) (*Credentials, error) { @@ -211,27 +224,24 @@ func FindDefaultCredentialsWithParams(ctx context.Context, params CredentialsPar return CredentialsFromJSONWithParams(ctx, b, params) } - // Third, if we're on Google Compute Engine, an App Engine standard second generation runtime, + // Third, if we're on a Google App Engine standard first generation runtime (<= Go 1.9) + // use those credentials. App Engine standard second generation runtimes (>= Go 1.11) + // and App Engine flexible use ComputeTokenSource and the metadata server. + if appengineTokenFunc != nil { + return &Credentials{ + ProjectID: appengineAppIDFunc(ctx), + TokenSource: AppEngineTokenSource(ctx, params.Scopes...), + }, nil + } + + // Fourth, if we're on Google Compute Engine, an App Engine standard second generation runtime, // or App Engine flexible, use the metadata server. if metadata.OnGCE() { id, _ := metadata.ProjectID() - universeDomainProvider := func() (string, error) { - universeDomain, err := metadata.Get("universe/universe_domain") - if err != nil { - if _, ok := err.(metadata.NotDefinedError); ok { - // http.StatusNotFound (404) - return defaultUniverseDomain, nil - } else { - return "", err - } - } - return universeDomain, nil - } return &Credentials{ - ProjectID: id, - TokenSource: computeTokenSource("", params.EarlyTokenRefresh, params.Scopes...), - UniverseDomainProvider: universeDomainProvider, - universeDomain: params.UniverseDomain, + ProjectID: id, + TokenSource: computeTokenSource("", params.EarlyTokenRefresh, params.Scopes...), + universeDomain: params.UniverseDomain, }, nil } diff --git a/upstream/vendor/golang.org/x/oauth2/google/externalaccount/aws.go b/upstream/vendor/golang.org/x/oauth2/google/externalaccount/aws.go index ca27c2e98c9..da61d0c0e84 100644 --- a/upstream/vendor/golang.org/x/oauth2/google/externalaccount/aws.go +++ b/upstream/vendor/golang.org/x/oauth2/google/externalaccount/aws.go @@ -520,6 +520,7 @@ func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, h if err != nil { return result, err } + req.Header.Add("Content-Type", "application/json") for name, value := range headers { req.Header.Add(name, value) diff --git a/upstream/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go b/upstream/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go index 6c81a68728e..400aa0a072a 100644 --- a/upstream/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go +++ b/upstream/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go @@ -471,12 +471,11 @@ func (ts tokenSource) Token() (*oauth2.Token, error) { AccessToken: stsResp.AccessToken, TokenType: stsResp.TokenType, } - - // The RFC8693 doesn't define the explicit 0 of "expires_in" field behavior. - if stsResp.ExpiresIn <= 0 { + if stsResp.ExpiresIn < 0 { return nil, fmt.Errorf("oauth2/google/externalaccount: got invalid expiry from security token service") + } else if stsResp.ExpiresIn >= 0 { + accessToken.Expiry = now().Add(time.Duration(stsResp.ExpiresIn) * time.Second) } - accessToken.Expiry = now().Add(time.Duration(stsResp.ExpiresIn) * time.Second) if stsResp.RefreshToken != "" { accessToken.RefreshToken = stsResp.RefreshToken diff --git a/upstream/vendor/golang.org/x/oauth2/google/google.go b/upstream/vendor/golang.org/x/oauth2/google/google.go index 7b82e7a0837..ba931c2c3de 100644 --- a/upstream/vendor/golang.org/x/oauth2/google/google.go +++ b/upstream/vendor/golang.org/x/oauth2/google/google.go @@ -252,10 +252,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar // Further information about retrieving access tokens from the GCE metadata // server can be found at https://cloud.google.com/compute/docs/authentication. func ComputeTokenSource(account string, scope ...string) oauth2.TokenSource { - // refresh 3 minutes and 45 seconds early. The shortest MDS cache is currently 4 minutes, so any - // refreshes earlier are a waste of compute. - earlyExpirySecs := 225 * time.Second - return computeTokenSource(account, earlyExpirySecs, scope...) + return computeTokenSource(account, 0, scope...) } func computeTokenSource(account string, earlyExpiry time.Duration, scope ...string) oauth2.TokenSource { diff --git a/upstream/vendor/golang.org/x/oauth2/internal/client_appengine.go b/upstream/vendor/golang.org/x/oauth2/internal/client_appengine.go new file mode 100644 index 00000000000..d28140f789e --- /dev/null +++ b/upstream/vendor/golang.org/x/oauth2/internal/client_appengine.go @@ -0,0 +1,13 @@ +// 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 + +package internal + +import "google.golang.org/appengine/urlfetch" + +func init() { + appengineClientHook = urlfetch.Client +} diff --git a/upstream/vendor/golang.org/x/oauth2/internal/transport.go b/upstream/vendor/golang.org/x/oauth2/internal/transport.go index b9db01ddfdf..572074a637d 100644 --- a/upstream/vendor/golang.org/x/oauth2/internal/transport.go +++ b/upstream/vendor/golang.org/x/oauth2/internal/transport.go @@ -18,11 +18,16 @@ 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/upstream/vendor/golang.org/x/oauth2/oauth2.go b/upstream/vendor/golang.org/x/oauth2/oauth2.go index 09f6a49b80a..90a2c3d6dcb 100644 --- a/upstream/vendor/golang.org/x/oauth2/oauth2.go +++ b/upstream/vendor/golang.org/x/oauth2/oauth2.go @@ -393,7 +393,7 @@ func ReuseTokenSource(t *Token, src TokenSource) TokenSource { } } -// ReuseTokenSourceWithExpiry returns a TokenSource that acts in the same manner as the +// ReuseTokenSource 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/upstream/vendor/golang.org/x/sync/LICENSE b/upstream/vendor/golang.org/x/sync/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/sync/LICENSE +++ b/upstream/vendor/golang.org/x/sync/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/sys/LICENSE b/upstream/vendor/golang.org/x/sys/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/sys/LICENSE +++ b/upstream/vendor/golang.org/x/sys/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s b/upstream/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s deleted file mode 100644 index ec2acfe540e..00000000000 --- a/upstream/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s +++ /dev/null @@ -1,17 +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. - -//go:build darwin && amd64 && gc - -#include "textflag.h" - -TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_sysctl(SB) -GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 -DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) - -TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_sysctlbyname(SB) -GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 -DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu.go b/upstream/vendor/golang.org/x/sys/cpu/cpu.go index 02609d5b21d..4756ad5f795 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu.go @@ -103,10 +103,7 @@ 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 } @@ -201,25 +198,6 @@ 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/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.go index af2aa99f9f0..f3eb993bf24 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -28,7 +28,6 @@ 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}, @@ -38,8 +37,6 @@ 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}, } } @@ -147,11 +144,6 @@ 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: @@ -172,20 +164,6 @@ 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/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.s index 22cc99844a7..fcb9a388820 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -29,11 +29,3 @@ 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/upstream/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go deleted file mode 100644 index b838cb9e956..00000000000 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go +++ /dev/null @@ -1,61 +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. - -//go:build darwin && amd64 && gc - -package cpu - -// darwinSupportsAVX512 checks Darwin kernel for AVX512 support via sysctl -// call (see issue 43089). It also restricts AVX512 support for Darwin to -// kernel version 21.3.0 (MacOS 12.2.0) or later (see issue 49233). -// -// Background: -// Darwin implements a special mechanism to economize on thread state when -// AVX512 specific registers are not in use. This scheme minimizes state when -// preempting threads that haven't yet used any AVX512 instructions, but adds -// special requirements to check for AVX512 hardware support at runtime (e.g. -// via sysctl call or commpage inspection). See issue 43089 and link below for -// full background: -// https://github.com/apple-oss-distributions/xnu/blob/xnu-11215.1.10/osfmk/i386/fpu.c#L214-L240 -// -// Additionally, all versions of the Darwin kernel from 19.6.0 through 21.2.0 -// (corresponding to MacOS 10.15.6 - 12.1) have a bug that can cause corruption -// of the AVX512 mask registers (K0-K7) upon signal return. For this reason -// AVX512 is considered unsafe to use on Darwin for kernel versions prior to -// 21.3.0, where a fix has been confirmed. See issue 49233 for full background. -func darwinSupportsAVX512() bool { - return darwinSysctlEnabled([]byte("hw.optional.avx512f\x00")) && darwinKernelVersionCheck(21, 3, 0) -} - -// Ensure Darwin kernel version is at least major.minor.patch, avoiding dependencies -func darwinKernelVersionCheck(major, minor, patch int) bool { - var release [256]byte - err := darwinOSRelease(&release) - if err != nil { - return false - } - - var mmp [3]int - c := 0 -Loop: - for _, b := range release[:] { - switch { - case b >= '0' && b <= '9': - mmp[c] = 10*mmp[c] + int(b-'0') - case b == '.': - c++ - if c > 2 { - return false - } - case b == 0: - break Loop - default: - return false - } - } - if c != 2 { - return false - } - return mmp[0] > major || mmp[0] == major && (mmp[1] > minor || mmp[1] == minor && mmp[2] >= patch) -} diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index 6ac6e1efb20..a8acd3e3285 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -9,4 +9,3 @@ package cpu func getisar0() uint64 func getisar1() uint64 func getpfr0() uint64 -func getzfr0() uint64 diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go index 32a44514e24..910728fb163 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -6,10 +6,10 @@ package cpu -// cpuid is implemented in cpu_gc_x86.s for gc compiler +// cpuid is implemented in cpu_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) -// xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler +// xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func xgetbv() (eax, edx uint32) diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go index 170d21ddfda..99c60fe9f9c 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go @@ -23,3 +23,9 @@ func xgetbv() (eax, edx uint32) { gccgoXgetbv(&a, &d) return a, d } + +// gccgo doesn't build on Darwin, per: +// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76 +func darwinSupportsAVX512() bool { + return false +} diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go index f1caf0f78e2..a968b80fa6a 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -35,10 +35,6 @@ 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 @@ -108,11 +104,6 @@ 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/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go index 7d902b6847b..cd63e733557 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +++ b/upstream/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 && !riscv64 +//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x package cpu diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go deleted file mode 100644 index cb4a0c57280..00000000000 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +++ /dev/null @@ -1,137 +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 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/upstream/vendor/golang.org/x/sys/cpu/cpu_other_x86.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_other_x86.go deleted file mode 100644 index a0fd7e2f75d..00000000000 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_other_x86.go +++ /dev/null @@ -1,11 +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. - -//go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) - -package cpu - -func darwinSupportsAVX512() bool { - panic("only implemented for gc && amd64 && darwin") -} diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_riscv64.go index aca3199c911..7f0c79c004b 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_riscv64.go @@ -8,13 +8,4 @@ package cpu const cacheLineSize = 64 -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}, - } -} +func initOptions() {} diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.go b/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.go index 600a6807861..c29f5e4c5a6 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.go +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -92,8 +92,10 @@ func archInit() { osSupportsAVX = isSet(1, eax) && isSet(2, eax) if runtime.GOOS == "darwin" { - // Darwin requires special AVX512 checks, see cpu_darwin_x86.go - osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512() + // Darwin doesn't save/restore AVX-512 mask registers correctly across signal handlers. + // Since users can't rely on mask register contents, let's not advertise AVX-512 support. + // See issue 49233. + osSupportsAVX512 = false } else { // Check if OPMASK and ZMM registers have OS support. osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax) diff --git a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.s b/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.s similarity index 94% rename from upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.s rename to upstream/vendor/golang.org/x/sys/cpu/cpu_x86.s index ce208ce6d6a..7d7ba33efb8 100644 --- a/upstream/vendor/golang.org/x/sys/cpu/cpu_gc_x86.s +++ b/upstream/vendor/golang.org/x/sys/cpu/cpu_x86.s @@ -18,7 +18,7 @@ TEXT ·cpuid(SB), NOSPLIT, $0-24 RET // func xgetbv() (eax, edx uint32) -TEXT ·xgetbv(SB), NOSPLIT, $0-8 +TEXT ·xgetbv(SB),NOSPLIT,$0-8 MOVL $0, CX XGETBV MOVL AX, eax+0(FP) diff --git a/upstream/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go b/upstream/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go deleted file mode 100644 index 4d0888b0c01..00000000000 --- a/upstream/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go +++ /dev/null @@ -1,98 +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. - -// Minimal copy of x/sys/unix so the cpu package can make a -// system call on Darwin without depending on x/sys/unix. - -//go:build darwin && amd64 && gc - -package cpu - -import ( - "syscall" - "unsafe" -) - -type _C_int int32 - -// adapted from unix.Uname() at x/sys/unix/syscall_darwin.go L419 -func darwinOSRelease(release *[256]byte) error { - // from x/sys/unix/zerrors_openbsd_amd64.go - const ( - CTL_KERN = 0x1 - KERN_OSRELEASE = 0x2 - ) - - mib := []_C_int{CTL_KERN, KERN_OSRELEASE} - n := unsafe.Sizeof(*release) - - return sysctl(mib, &release[0], &n, nil, 0) -} - -type Errno = syscall.Errno - -var _zero uintptr // Single-word zero for use when we need a valid pointer to 0 bytes. - -// from x/sys/unix/zsyscall_darwin_amd64.go L791-807 -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - if _, _, err := syscall_syscall6( - libc_sysctl_trampoline_addr, - uintptr(_p0), - uintptr(len(mib)), - uintptr(unsafe.Pointer(old)), - uintptr(unsafe.Pointer(oldlen)), - uintptr(unsafe.Pointer(new)), - uintptr(newlen), - ); err != 0 { - return err - } - - return nil -} - -var libc_sysctl_trampoline_addr uintptr - -// adapted from internal/cpu/cpu_arm64_darwin.go -func darwinSysctlEnabled(name []byte) bool { - out := int32(0) - nout := unsafe.Sizeof(out) - if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil { - return false - } - return out > 0 -} - -//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" - -var libc_sysctlbyname_trampoline_addr uintptr - -// adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix -func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { - if _, _, err := syscall_syscall6( - libc_sysctlbyname_trampoline_addr, - uintptr(unsafe.Pointer(name)), - uintptr(unsafe.Pointer(old)), - uintptr(unsafe.Pointer(oldlen)), - uintptr(unsafe.Pointer(new)), - uintptr(newlen), - 0, - ); err != 0 { - return err - } - - return nil -} - -//go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib" - -// Implemented in the runtime package (runtime/sys_darwin.go) -func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) - -//go:linkname syscall_syscall6 syscall.syscall6 diff --git a/upstream/vendor/golang.org/x/sys/unix/README.md b/upstream/vendor/golang.org/x/sys/unix/README.md index 6e08a76a716..7d3c060e122 100644 --- a/upstream/vendor/golang.org/x/sys/unix/README.md +++ b/upstream/vendor/golang.org/x/sys/unix/README.md @@ -156,7 +156,7 @@ from the generated architecture-specific files listed below, and merge these into a common file for each OS. The merge is performed in the following steps: -1. Construct the set of common code that is identical in all architecture-specific files. +1. Construct the set of common code that is idential in all architecture-specific files. 2. Write this common code to the merged file. 3. Remove the common code from all architecture-specific files. diff --git a/upstream/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/upstream/vendor/golang.org/x/sys/unix/asm_zos_s390x.s index 813dfad7d26..2f67ba86d57 100644 --- a/upstream/vendor/golang.org/x/sys/unix/asm_zos_s390x.s +++ b/upstream/vendor/golang.org/x/sys/unix/asm_zos_s390x.s @@ -9,11 +9,9 @@ #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 CEECAATHDID(x) 976(x) // in the CAA -#define EDCHPXV(x) 1016(x) // in the CAA -#define GOCB(x) 1104(x) // in the CAA +#define EDCHPXV(x) 1016(x) // in the CAA +#define SAVSTACK_ASYNC(x) 336(x) // in the LCA // SS_*, where x=SAVSTACK_ASYNC #define SS_LE(x) 0(x) @@ -21,362 +19,405 @@ #define SS_ERRNO(x) 16(x) #define SS_ERRNOJR(x) 20(x) -// Function Descriptor Offsets -#define __errno 0x156*16 -#define __err2ad 0x16C*16 +#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6 -// 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) +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 $(__errno), R9 - LMG 0(R9), R5, R6 + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + ADD $(0x156*16), 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 -// 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) +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 - MOVD argv+8(FP), R1 // Move function arguments into registers - MOVD dsa+16(FP), g - MOVD fnptr+0(FP), R15 + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 - BYTE $0x0D // Branch to function - BYTE $0xEF + // 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 - 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 + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + // 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 -// 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 +TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56 + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 -error: - MOVD $0, ret+8(FP) // Return 0 on failure + // 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) + + // 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 -// 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 +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 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 CEECAATHDID - MOVD CAA(R8), R9 - MOVD CEECAATHDID(R9), R9 - MOVD R9, ret+0(FP) + // 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) + + // 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 -// -// 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) +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 // Restore LE stack. - 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 - 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) + 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 - MOVW (R3), R2 // retrieve errno2 - MOVD R2, errno2+40(FP) // store in return area - + 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) done: - MOVD R4, 0(R9) // Save stack pointer. RET -// -// 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) +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 // Restore LE stack. - 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, $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) + 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 NOPH - 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) + 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 NOPH - MOVW (R3), R2 // retrieve errno2 - MOVD R2, errno2+40(FP) // store in return area - XOR R2, R2 - MOVWZ R2, (R3) // clear errno2 + 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 + +error: + MOVD $0, addr+8(FP) // Return 0 on failure done: - MOVD R4, 0(R9) // Save stack pointer. + XOR R0, R0 // Reset r0 to 0 RET -// -// 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 +// 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 RET -// -// 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 +// 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) + RET diff --git a/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.go b/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.go deleted file mode 100644 index 39d647d863a..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.go +++ /dev/null @@ -1,657 +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. - -//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/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.s b/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.s deleted file mode 100644 index 4bd4a179821..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/bpxsvc_zos.s +++ /dev/null @@ -1,192 +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. - -#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/upstream/vendor/golang.org/x/sys/unix/epoll_zos.go b/upstream/vendor/golang.org/x/sys/unix/epoll_zos.go new file mode 100644 index 00000000000..7753fddea81 --- /dev/null +++ b/upstream/vendor/golang.org/x/sys/unix/epoll_zos.go @@ -0,0 +1,220 @@ +// 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/upstream/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/upstream/vendor/golang.org/x/sys/unix/fstatfs_zos.go new file mode 100644 index 00000000000..c8bde601e77 --- /dev/null +++ b/upstream/vendor/golang.org/x/sys/unix/fstatfs_zos.go @@ -0,0 +1,163 @@ +// 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/upstream/vendor/golang.org/x/sys/unix/ioctl_linux.go b/upstream/vendor/golang.org/x/sys/unix/ioctl_linux.go index 7ca4fa12aa6..dbe680eab88 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ioctl_linux.go +++ b/upstream/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -58,102 +58,6 @@ func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) { return &value, err } -// IoctlGetEthtoolTsInfo fetches ethtool timestamping and PHC -// association for the network device specified by ifname. -func IoctlGetEthtoolTsInfo(fd int, ifname string) (*EthtoolTsInfo, error) { - ifr, err := NewIfreq(ifname) - if err != nil { - return nil, err - } - - value := EthtoolTsInfo{Cmd: ETHTOOL_GET_TS_INFO} - ifrd := ifr.withData(unsafe.Pointer(&value)) - - err = ioctlIfreqData(fd, SIOCETHTOOL, &ifrd) - return &value, err -} - -// IoctlGetHwTstamp retrieves the hardware timestamping configuration -// for the network device specified by ifname. -func IoctlGetHwTstamp(fd int, ifname string) (*HwTstampConfig, error) { - ifr, err := NewIfreq(ifname) - if err != nil { - return nil, err - } - - value := HwTstampConfig{} - ifrd := ifr.withData(unsafe.Pointer(&value)) - - err = ioctlIfreqData(fd, SIOCGHWTSTAMP, &ifrd) - return &value, err -} - -// IoctlSetHwTstamp updates the hardware timestamping configuration for -// the network device specified by ifname. -func IoctlSetHwTstamp(fd int, ifname string, cfg *HwTstampConfig) error { - ifr, err := NewIfreq(ifname) - if err != nil { - return err - } - ifrd := ifr.withData(unsafe.Pointer(cfg)) - return ioctlIfreqData(fd, SIOCSHWTSTAMP, &ifrd) -} - -// FdToClockID derives the clock ID from the file descriptor number -// - see clock_gettime(3), FD_TO_CLOCKID macros. The resulting ID is -// suitable for system calls like ClockGettime. -func FdToClockID(fd int) int32 { return int32((int(^fd) << 3) | 3) } - -// IoctlPtpClockGetcaps returns the description of a given PTP device. -func IoctlPtpClockGetcaps(fd int) (*PtpClockCaps, error) { - var value PtpClockCaps - err := ioctlPtr(fd, PTP_CLOCK_GETCAPS2, unsafe.Pointer(&value)) - return &value, err -} - -// IoctlPtpSysOffsetPrecise returns a description of the clock -// offset compared to the system clock. -func IoctlPtpSysOffsetPrecise(fd int) (*PtpSysOffsetPrecise, error) { - var value PtpSysOffsetPrecise - err := ioctlPtr(fd, PTP_SYS_OFFSET_PRECISE2, unsafe.Pointer(&value)) - return &value, err -} - -// IoctlPtpSysOffsetExtended returns an extended description of the -// clock offset compared to the system clock. The samples parameter -// specifies the desired number of measurements. -func IoctlPtpSysOffsetExtended(fd int, samples uint) (*PtpSysOffsetExtended, error) { - value := PtpSysOffsetExtended{Samples: uint32(samples)} - err := ioctlPtr(fd, PTP_SYS_OFFSET_EXTENDED2, unsafe.Pointer(&value)) - return &value, err -} - -// IoctlPtpPinGetfunc returns the configuration of the specified -// I/O pin on given PTP device. -func IoctlPtpPinGetfunc(fd int, index uint) (*PtpPinDesc, error) { - value := PtpPinDesc{Index: uint32(index)} - err := ioctlPtr(fd, PTP_PIN_GETFUNC2, unsafe.Pointer(&value)) - return &value, err -} - -// IoctlPtpPinSetfunc updates configuration of the specified PTP -// I/O pin. -func IoctlPtpPinSetfunc(fd int, pd *PtpPinDesc) error { - return ioctlPtr(fd, PTP_PIN_SETFUNC2, unsafe.Pointer(pd)) -} - -// IoctlPtpPeroutRequest configures the periodic output mode of the -// PTP I/O pins. -func IoctlPtpPeroutRequest(fd int, r *PtpPeroutRequest) error { - return ioctlPtr(fd, PTP_PEROUT_REQUEST2, unsafe.Pointer(r)) -} - -// IoctlPtpExttsRequest configures the external timestamping mode -// of the PTP I/O pins. -func IoctlPtpExttsRequest(fd int, r *PtpExttsRequest) error { - return ioctlPtr(fd, PTP_EXTTS_REQUEST2, unsafe.Pointer(r)) -} - // IoctlGetWatchdogInfo fetches information about a watchdog device from the // Linux watchdog API. For more information, see: // https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. diff --git a/upstream/vendor/golang.org/x/sys/unix/mkerrors.sh b/upstream/vendor/golang.org/x/sys/unix/mkerrors.sh index 6ab02b6c312..fdcaa974d23 100644 --- a/upstream/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/upstream/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -58,7 +58,6 @@ includes_Darwin=' #define _DARWIN_USE_64_BIT_INODE #define __APPLE_USE_RFC_3542 #include <stdint.h> -#include <sys/stdio.h> #include <sys/attr.h> #include <sys/clonefile.h> #include <sys/kern_control.h> @@ -158,16 +157,6 @@ includes_Linux=' #endif #define _GNU_SOURCE -// See the description in unix/linux/types.go -#if defined(__ARM_EABI__) || \ - (defined(__mips__) && (_MIPS_SIM == _ABIO32)) || \ - (defined(__powerpc__) && (!defined(__powerpc64__))) -# ifdef _TIME_BITS -# undef _TIME_BITS -# endif -# define _TIME_BITS 32 -#endif - // <sys/ioctl.h> is broken on powerpc64, as it fails to include definitions of // these structures. We just include them copied from <bits/termios.h>. #if defined(__powerpc__) @@ -266,7 +255,6 @@ struct ltchars { #include <linux/nsfs.h> #include <linux/perf_event.h> #include <linux/pps.h> -#include <linux/ptp_clock.h> #include <linux/ptrace.h> #include <linux/random.h> #include <linux/reboot.h> @@ -275,7 +263,6 @@ struct ltchars { #include <linux/sched.h> #include <linux/seccomp.h> #include <linux/serial.h> -#include <linux/sock_diag.h> #include <linux/sockios.h> #include <linux/taskstats.h> #include <linux/tipc.h> @@ -538,7 +525,6 @@ ccflags="$@" $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || - $2 ~ /^PTP_/ || $2 ~ /^RAW_PAYLOAD_/ || $2 ~ /^[US]F_/ || $2 ~ /^TP_STATUS_/ || @@ -563,8 +549,6 @@ ccflags="$@" $2 !~ "NLA_TYPE_MASK" && $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || - $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || - $2 ~ /^(CONNECT|SAE)_/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || @@ -668,7 +652,7 @@ errors=$( signals=$( echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | + grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | sort ) @@ -678,7 +662,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | sort >_error.grep echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | - grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | + grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | sort >_signal.grep echo '// mkerrors.sh' "$@" diff --git a/upstream/vendor/golang.org/x/sys/unix/mremap.go b/upstream/vendor/golang.org/x/sys/unix/mremap.go index 3a5e776f895..fd45fe529da 100644 --- a/upstream/vendor/golang.org/x/sys/unix/mremap.go +++ b/upstream/vendor/golang.org/x/sys/unix/mremap.go @@ -50,8 +50,3 @@ func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data [ func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { return mapper.Mremap(oldData, newLength, flags) } - -func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) { - xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr)) - return unsafe.Pointer(xaddr), err -} diff --git a/upstream/vendor/golang.org/x/sys/unix/pagesize_unix.go b/upstream/vendor/golang.org/x/sys/unix/pagesize_unix.go index 0482408d7c6..4d0a3430edc 100644 --- a/upstream/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/upstream/vendor/golang.org/x/sys/unix/pagesize_unix.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 aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // For Unix, get the pagesize from the runtime. diff --git a/upstream/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/upstream/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go index b903c00604b..130398b6b76 100644 --- a/upstream/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/upstream/vendor/golang.org/x/sys/unix/readdirent_getdirentries.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 darwin || zos +//go:build darwin package unix diff --git a/upstream/vendor/golang.org/x/sys/unix/sockcmsg_zos.go b/upstream/vendor/golang.org/x/sys/unix/sockcmsg_zos.go deleted file mode 100644 index 3e53dbc0286..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/sockcmsg_zos.go +++ /dev/null @@ -1,58 +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. - -// Socket control messages - -package unix - -import "unsafe" - -// UnixCredentials encodes credentials into a socket control message -// for sending to another process. This can be used for -// authentication. -func UnixCredentials(ucred *Ucred) []byte { - b := make([]byte, CmsgSpace(SizeofUcred)) - h := (*Cmsghdr)(unsafe.Pointer(&b[0])) - h.Level = SOL_SOCKET - h.Type = SCM_CREDENTIALS - h.SetLen(CmsgLen(SizeofUcred)) - *(*Ucred)(h.data(0)) = *ucred - return b -} - -// ParseUnixCredentials decodes a socket control message that contains -// credentials in a Ucred structure. To receive such a message, the -// SO_PASSCRED option must be enabled on the socket. -func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { - if m.Header.Level != SOL_SOCKET { - return nil, EINVAL - } - if m.Header.Type != SCM_CREDENTIALS { - return nil, EINVAL - } - ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) - return &ucred, nil -} - -// PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. -func PktInfo4(info *Inet4Pktinfo) []byte { - b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) - h := (*Cmsghdr)(unsafe.Pointer(&b[0])) - h.Level = SOL_IP - h.Type = IP_PKTINFO - h.SetLen(CmsgLen(SizeofInet4Pktinfo)) - *(*Inet4Pktinfo)(h.data(0)) = *info - return b -} - -// PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. -func PktInfo6(info *Inet6Pktinfo) []byte { - b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) - h := (*Cmsghdr)(unsafe.Pointer(&b[0])) - h.Level = SOL_IPV6 - h.Type = IPV6_PKTINFO - h.SetLen(CmsgLen(SizeofInet6Pktinfo)) - *(*Inet6Pktinfo)(h.data(0)) = *info - return b -} diff --git a/upstream/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s b/upstream/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s deleted file mode 100644 index 3c4f33cb6a8..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s +++ /dev/null @@ -1,75 +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. - -//go:build zos && s390x && gc - -#include "textflag.h" - -// provide the address of function variable to be fixed up. - -TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Pipe2(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Flock(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Getxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Nanosleep(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Setxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Wait4(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Mount(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Unmount(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·UtimesNanoAt(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·UtimesNano(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Mkfifoat(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Chtag(SB), R8 - MOVD R8, ret+0(FP) - RET - -TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Readlinkat(SB), R8 - MOVD R8, ret+0(FP) - RET - diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_aix.go b/upstream/vendor/golang.org/x/sys/unix/syscall_aix.go index 6f15ba1eaff..67ce6cef2d5 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -360,7 +360,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, var status _C_int var r Pid_t err = ERESTART - // AIX wait4 may return with ERESTART errno, while the process is still + // AIX wait4 may return with ERESTART errno, while the processus is still // active. for err == ERESTART { r, err = wait4(Pid_t(pid), &status, options, rusage) diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_darwin.go b/upstream/vendor/golang.org/x/sys/unix/syscall_darwin.go index 099867deede..59542a897d2 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -402,18 +402,6 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq)) } -//sys renamexNp(from string, to string, flag uint32) (err error) - -func RenamexNp(from string, to string, flag uint32) (err error) { - return renamexNp(from, to, flag) -} - -//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) - -func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { - return renameatxNp(fromfd, from, tofd, to, flag) -} - //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { @@ -554,55 +542,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { } } -//sys pthread_chdir_np(path string) (err error) - -func PthreadChdir(path string) (err error) { - return pthread_chdir_np(path) -} - -//sys pthread_fchdir_np(fd int) (err error) - -func PthreadFchdir(fd int) (err error) { - return pthread_fchdir_np(fd) -} - -// Connectx calls connectx(2) to initiate a connection on a socket. -// -// srcIf, srcAddr, and dstAddr are filled into a [SaEndpoints] struct and passed as the endpoints argument. -// -// - srcIf is the optional source interface index. 0 means unspecified. -// - srcAddr is the optional source address. nil means unspecified. -// - dstAddr is the destination address. -// -// On success, Connectx returns the number of bytes enqueued for transmission. -func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocID, flags uint32, iov []Iovec, connid *SaeConnID) (n uintptr, err error) { - endpoints := SaEndpoints{ - Srcif: srcIf, - } - - if srcAddr != nil { - addrp, addrlen, err := srcAddr.sockaddr() - if err != nil { - return 0, err - } - endpoints.Srcaddr = (*RawSockaddr)(addrp) - endpoints.Srcaddrlen = uint32(addrlen) - } - - if dstAddr != nil { - addrp, addrlen, err := dstAddr.sockaddr() - if err != nil { - return 0, err - } - endpoints.Dstaddr = (*RawSockaddr)(addrp) - endpoints.Dstaddrlen = uint32(addrlen) - } - - err = connectx(fd, &endpoints, associd, flags, iov, &n, connid) - return -} - -//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_hurd.go b/upstream/vendor/golang.org/x/sys/unix/syscall_hurd.go index a6a2d2fc2b9..ba46651f8e3 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_hurd.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_hurd.go @@ -11,7 +11,6 @@ package unix int ioctl(int, unsigned long int, uintptr_t); */ import "C" -import "unsafe" func ioctl(fd int, req uint, arg uintptr) (err error) { r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_linux.go b/upstream/vendor/golang.org/x/sys/unix/syscall_linux.go index 230a94549a7..5682e2628ad 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1295,48 +1295,6 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { return &value, err } -// GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas" -// algorithm. -// -// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: -// -// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) -func GetsockoptTCPCCVegasInfo(fd, level, opt int) (*TCPVegasInfo, error) { - var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment - vallen := _Socklen(SizeofTCPCCInfo) - err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) - out := (*TCPVegasInfo)(unsafe.Pointer(&value[0])) - return out, err -} - -// GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp" -// algorithm. -// -// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: -// -// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) -func GetsockoptTCPCCDCTCPInfo(fd, level, opt int) (*TCPDCTCPInfo, error) { - var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment - vallen := _Socklen(SizeofTCPCCInfo) - err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) - out := (*TCPDCTCPInfo)(unsafe.Pointer(&value[0])) - return out, err -} - -// GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr" -// algorithm. -// -// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: -// -// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) -func GetsockoptTCPCCBBRInfo(fd, level, opt int) (*TCPBBRInfo, error) { - var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment - vallen := _Socklen(SizeofTCPCCInfo) - err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) - out := (*TCPBBRInfo)(unsafe.Pointer(&value[0])) - return out, err -} - // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { @@ -1860,7 +1818,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys ClockAdjtime(clockid int32, buf *Timex) (state int, err error) //sys ClockGetres(clockid int32, res *Timespec) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) -//sys ClockSettime(clockid int32, time *Timespec) (err error) //sys ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) //sys Close(fd int) (err error) //sys CloseRange(first uint, last uint, flags uint) (err error) @@ -2002,26 +1959,7 @@ func Getpgrp() (pid int) { //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) - -func Getrandom(buf []byte, flags int) (n int, err error) { - vdsoRet, supported := vgetrandom(buf, uint32(flags)) - if supported { - if vdsoRet < 0 { - return 0, errnoErr(syscall.Errno(-vdsoRet)) - } - return vdsoRet, nil - } - var p *byte - if len(buf) > 0 { - p = &buf[0] - } - r, _, e := Syscall(SYS_GETRANDOM, uintptr(unsafe.Pointer(p)), uintptr(len(buf)), uintptr(flags)) - if e != 0 { - return 0, errnoErr(e) - } - return int(r), nil -} - +//sys Getrandom(buf []byte, flags int) (n int, err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettid() (tid int) @@ -2654,4 +2592,3 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) -//sys Mseal(b []byte, flags uint) (err error) diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 745e5c7e6c0..cf2ee6c75ef 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -182,5 +182,3 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } - -const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index dd2262a4079..3d0e98451f8 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -214,5 +214,3 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } - -const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index 8cf3670bda6..6f5a288944d 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -187,5 +187,3 @@ func RISCVHWProbe(pairs []RISCVHWProbePairs, set *CPUSet, flags uint) (err error } return riscvHWProbe(pairs, setSize, set, flags) } - -const SYS_FSTATAT = SYS_NEWFSTATAT diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/upstream/vendor/golang.org/x/sys/unix/syscall_openbsd.go index b86ded549c6..b25343c71a4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -293,7 +293,6 @@ func Uname(uname *Utsname) error { //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) -//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_unix.go b/upstream/vendor/golang.org/x/sys/unix/syscall_unix.go index 4e92e5aa406..77081de8c7d 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -154,15 +154,6 @@ func Munmap(b []byte) (err error) { return mapper.Munmap(b) } -func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { - xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) - return unsafe.Pointer(xaddr), err -} - -func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { - return mapper.munmap(uintptr(addr), length) -} - func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { diff --git a/upstream/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/upstream/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index 7bf5c04bb0a..27c41b6f0a1 100644 --- a/upstream/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -4,21 +4,11 @@ //go:build zos && s390x -// Many of the following syscalls are not available on all versions of z/OS. -// Some missing calls have legacy implementations/simulations but others -// will be missing completely. To achieve consistent failing behaviour on -// legacy systems, we first test the function pointer via a safeloading -// mechanism to see if the function exists on a given system. Then execution -// is branched to either continue the function call, or return an error. - package unix import ( "bytes" "fmt" - "os" - "reflect" - "regexp" "runtime" "sort" "strings" @@ -27,205 +17,17 @@ import ( "unsafe" ) -//go:noescape -func initZosLibVec() - -//go:noescape -func GetZosLibVec() uintptr - -func init() { - initZosLibVec() - r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACE\x00"))[0]))) - if r0 != 0 { - n, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) - ZosTraceLevel = int(n) - r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACEFD\x00"))[0]))) - if r0 != 0 { - fd, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) - f := os.NewFile(fd, "zostracefile") - if f != nil { - ZosTracefile = f - } - } - - } -} - -//go:noescape -func CallLeFuncWithErr(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) - -//go:noescape -func CallLeFuncWithPtrReturn(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) - -// ------------------------------- -// pointer validity test -// good pointer returns 0 -// bad pointer returns 1 -// -//go:nosplit -func ptrtest(uintptr) uint64 - -// Load memory at ptr location with error handling if the location is invalid -// -//go:noescape -func safeload(ptr uintptr) (value uintptr, error uintptr) - const ( - entrypointLocationOffset = 8 // From function descriptor - - xplinkEyecatcher = 0x00c300c500c500f1 // ".C.E.E.1" - eyecatcherOffset = 16 // From function entrypoint (negative) - ppa1LocationOffset = 8 // From function entrypoint (negative) - - nameLenOffset = 0x14 // From PPA1 start - nameOffset = 0x16 // From PPA1 start + O_CLOEXEC = 0 // Dummy value (not supported). + AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX ) -func getPpaOffset(funcptr uintptr) int64 { - entrypoint, err := safeload(funcptr + entrypointLocationOffset) - if err != 0 { - return -1 - } - - // XPLink functions have ".C.E.E.1" as the first 8 bytes (EBCDIC) - val, err := safeload(entrypoint - eyecatcherOffset) - if err != 0 { - return -1 - } - if val != xplinkEyecatcher { - return -1 - } - - ppaoff, err := safeload(entrypoint - ppa1LocationOffset) - if err != 0 { - return -1 - } - - ppaoff >>= 32 - return int64(ppaoff) -} - -//------------------------------- -// function descriptor pointer validity test -// good pointer returns 0 -// bad pointer returns 1 - -// TODO: currently mksyscall_zos_s390x.go generate empty string for funcName -// have correct funcName pass to the funcptrtest function -func funcptrtest(funcptr uintptr, funcName string) uint64 { - entrypoint, err := safeload(funcptr + entrypointLocationOffset) - if err != 0 { - return 1 - } - - ppaoff := getPpaOffset(funcptr) - if ppaoff == -1 { - return 1 - } - - // PPA1 offset value is from the start of the entire function block, not the entrypoint - ppa1 := (entrypoint - eyecatcherOffset) + uintptr(ppaoff) - - nameLen, err := safeload(ppa1 + nameLenOffset) - if err != 0 { - return 1 - } - - nameLen >>= 48 - if nameLen > 128 { - return 1 - } - - // no function name input to argument end here - if funcName == "" { - return 0 - } - - var funcname [128]byte - for i := 0; i < int(nameLen); i += 8 { - v, err := safeload(ppa1 + nameOffset + uintptr(i)) - if err != 0 { - return 1 - } - funcname[i] = byte(v >> 56) - funcname[i+1] = byte(v >> 48) - funcname[i+2] = byte(v >> 40) - funcname[i+3] = byte(v >> 32) - funcname[i+4] = byte(v >> 24) - funcname[i+5] = byte(v >> 16) - funcname[i+6] = byte(v >> 8) - funcname[i+7] = byte(v) - } - - runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l - []uintptr{uintptr(unsafe.Pointer(&funcname[0])), nameLen}) - - name := string(funcname[:nameLen]) - if name != funcName { - return 1 - } - - return 0 -} - -// For detection of capabilities on a system. -// Is function descriptor f a valid function? -func isValidLeFunc(f uintptr) error { - ret := funcptrtest(f, "") - if ret != 0 { - return fmt.Errorf("Bad pointer, not an LE function ") - } - return nil -} - -// Retrieve function name from descriptor -func getLeFuncName(f uintptr) (string, error) { - // assume it has been checked, only check ppa1 validity here - entry := ((*[2]uintptr)(unsafe.Pointer(f)))[1] - preamp := ((*[4]uint32)(unsafe.Pointer(entry - eyecatcherOffset))) - - offsetPpa1 := preamp[2] - if offsetPpa1 > 0x0ffff { - return "", fmt.Errorf("PPA1 offset seems too big 0x%x\n", offsetPpa1) - } - - ppa1 := uintptr(unsafe.Pointer(preamp)) + uintptr(offsetPpa1) - res := ptrtest(ppa1) - if res != 0 { - return "", fmt.Errorf("PPA1 address not valid") - } - - size := *(*uint16)(unsafe.Pointer(ppa1 + nameLenOffset)) - if size > 128 { - return "", fmt.Errorf("Function name seems too long, length=%d\n", size) - } - - var name [128]byte - funcname := (*[128]byte)(unsafe.Pointer(ppa1 + nameOffset)) - copy(name[0:size], funcname[0:size]) - - runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l - []uintptr{uintptr(unsafe.Pointer(&name[0])), uintptr(size)}) - - return string(name[:size]), nil -} - -// Check z/OS version -func zosLeVersion() (version, release uint32) { - p1 := (*(*uintptr)(unsafe.Pointer(uintptr(1208)))) >> 32 - p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 88))) - p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 8))) - p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 984))) - vrm := *(*uint32)(unsafe.Pointer(p1 + 80)) - version = (vrm & 0x00ff0000) >> 16 - release = (vrm & 0x0000ff00) >> 8 - return -} - -// returns a zos C FILE * for stdio fd 0, 1, 2 -func ZosStdioFilep(fd int32) uintptr { - return uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(uint64(*(*uint32)(unsafe.Pointer(uintptr(1208)))) + 80))) + uint64((fd+2)<<3)))))))) -} +func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) func copyStat(stat *Stat_t, statLE *Stat_LE_t) { stat.Dev = uint64(statLE.Dev) @@ -263,21 +65,6 @@ func (d *Dirent) NameString() string { } } -func DecodeData(dest []byte, sz int, val uint64) { - for i := 0; i < sz; i++ { - dest[sz-1-i] = byte((val >> (uint64(i * 8))) & 0xff) - } -} - -func EncodeData(data []byte) uint64 { - var value uint64 - sz := len(data) - for i := 0; i < sz; i++ { - value |= uint64(data[i]) << uint64(((sz - i - 1) * 8)) - } - return value -} - func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL @@ -287,9 +74,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -303,9 +88,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -363,9 +146,7 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_INET6: @@ -374,9 +155,7 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT @@ -398,43 +177,6 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { return } -func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { - var rsa RawSockaddrAny - var len _Socklen = SizeofSockaddrAny - nfd, err = accept4(fd, &rsa, &len, flags) - if err != nil { - return - } - if len > SizeofSockaddrAny { - panic("RawSockaddrAny too small") - } - // TODO(neeilan): Remove 0 in call - sa, err = anyToSockaddr(0, &rsa) - if err != nil { - Close(nfd) - nfd = 0 - } - return -} - -func Ctermid() (tty string, err error) { - var termdev [1025]byte - runtime.EnterSyscall() - r0, err2, err1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___CTERMID_A<<4, uintptr(unsafe.Pointer(&termdev[0]))) - runtime.ExitSyscall() - if r0 == 0 { - return "", fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) - } - s := string(termdev[:]) - idx := strings.Index(s, string(rune(0))) - if idx == -1 { - tty = s - } else { - tty = s[:idx] - } - return -} - func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } @@ -448,16 +190,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { } //sys fcntl(fd int, cmd int, arg int) (val int, err error) -//sys Flistxattr(fd int, dest []byte) (sz int, err error) = SYS___FLISTXATTR_A -//sys Fremovexattr(fd int, attr string) (err error) = SYS___FREMOVEXATTR_A //sys read(fd int, p []byte) (n int, err error) //sys write(fd int, p []byte) (n int, err error) -//sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) = SYS___FGETXATTR_A -//sys Fsetxattr(fd int, attr string, data []byte, flag int) (err error) = SYS___FSETXATTR_A - //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = SYS___ACCEPT_A -//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = SYS___ACCEPT4_A //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___BIND_A //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___CONNECT_A //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) @@ -468,7 +204,6 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETPEERNAME_A //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETSOCKNAME_A -//sys Removexattr(path string, attr string) (err error) = SYS___REMOVEXATTR_A //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = SYS___RECVFROM_A //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = SYS___SENDTO_A //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___RECVMSG_A @@ -477,10 +212,6 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sys munmap(addr uintptr, length uintptr) (err error) = SYS_MUNMAP //sys ioctl(fd int, req int, arg uintptr) (err error) = SYS_IOCTL //sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = SYS_IOCTL -//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) = SYS_SHMAT -//sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) = SYS_SHMCTL64 -//sys shmdt(addr uintptr) (err error) = SYS_SHMDT -//sys shmget(key int, size int, flag int) (id int, err error) = SYS_SHMGET //sys Access(path string, mode uint32) (err error) = SYS___ACCESS_A //sys Chdir(path string) (err error) = SYS___CHDIR_A @@ -489,31 +220,14 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sys Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A //sys Dup(oldfd int) (fd int, err error) //sys Dup2(oldfd int, newfd int) (err error) -//sys Dup3(oldfd int, newfd int, flags int) (err error) = SYS_DUP3 -//sys Dirfd(dirp uintptr) (fd int, err error) = SYS_DIRFD -//sys EpollCreate(size int) (fd int, err error) = SYS_EPOLL_CREATE -//sys EpollCreate1(flags int) (fd int, err error) = SYS_EPOLL_CREATE1 -//sys EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) = SYS_EPOLL_CTL -//sys EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) = SYS_EPOLL_PWAIT -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_WAIT //sys Errno2() (er2 int) = SYS___ERRNO2 -//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD +//sys Err2ad() (eadd *int) = SYS___ERR2AD //sys Exit(code int) -//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FACCESSAT_A - -func Faccessat2(dirfd int, path string, mode uint32, flags int) (err error) { - return Faccessat(dirfd, path, mode, flags) -} - //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) -//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FCHMODAT_A //sys Fchown(fd int, uid int, gid int) (err error) -//sys Fchownat(fd int, path string, uid int, gid int, flags int) (err error) = SYS___FCHOWNAT_A //sys FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) = SYS_FCNTL -//sys Fdatasync(fd int) (err error) = SYS_FDATASYNC //sys fstat(fd int, stat *Stat_LE_t) (err error) -//sys fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) = SYS___FSTATAT_A func Fstat(fd int, stat *Stat_t) (err error) { var statLE Stat_LE_t @@ -522,208 +236,28 @@ func Fstat(fd int, stat *Stat_t) (err error) { return } -func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { - var statLE Stat_LE_t - err = fstatat(dirfd, path, &statLE, flags) - copyStat(stat, &statLE) - return -} - -func impl_Getxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_GetxattrAddr() *(func(path string, attr string, dest []byte) (sz int, err error)) - -var Getxattr = enter_Getxattr - -func enter_Getxattr(path string, attr string, dest []byte) (sz int, err error) { - funcref := get_GetxattrAddr() - if validGetxattr() { - *funcref = impl_Getxattr - } else { - *funcref = error_Getxattr - } - return (*funcref)(path, attr, dest) -} - -func error_Getxattr(path string, attr string, dest []byte) (sz int, err error) { - return -1, ENOSYS -} - -func validGetxattr() bool { - if funcptrtest(GetZosLibVec()+SYS___GETXATTR_A<<4, "") == 0 { - if name, err := getLeFuncName(GetZosLibVec() + SYS___GETXATTR_A<<4); err == nil { - return name == "__getxattr_a" - } - } - return false -} - -//sys Lgetxattr(link string, attr string, dest []byte) (sz int, err error) = SYS___LGETXATTR_A -//sys Lsetxattr(path string, attr string, data []byte, flags int) (err error) = SYS___LSETXATTR_A - -func impl_Setxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_SetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) - -var Setxattr = enter_Setxattr - -func enter_Setxattr(path string, attr string, data []byte, flags int) (err error) { - funcref := get_SetxattrAddr() - if validSetxattr() { - *funcref = impl_Setxattr - } else { - *funcref = error_Setxattr - } - return (*funcref)(path, attr, data, flags) -} - -func error_Setxattr(path string, attr string, data []byte, flags int) (err error) { - return ENOSYS -} - -func validSetxattr() bool { - if funcptrtest(GetZosLibVec()+SYS___SETXATTR_A<<4, "") == 0 { - if name, err := getLeFuncName(GetZosLibVec() + SYS___SETXATTR_A<<4); err == nil { - return name == "__setxattr_a" - } - } - return false -} - -//sys Fstatfs(fd int, buf *Statfs_t) (err error) = SYS_FSTATFS //sys Fstatvfs(fd int, stat *Statvfs_t) (err error) = SYS_FSTATVFS //sys Fsync(fd int) (err error) -//sys Futimes(fd int, tv []Timeval) (err error) = SYS_FUTIMES -//sys Futimesat(dirfd int, path string, tv []Timeval) (err error) = SYS___FUTIMESAT_A //sys Ftruncate(fd int, length int64) (err error) -//sys Getrandom(buf []byte, flags int) (n int, err error) = SYS_GETRANDOM -//sys InotifyInit() (fd int, err error) = SYS_INOTIFY_INIT -//sys InotifyInit1(flags int) (fd int, err error) = SYS_INOTIFY_INIT1 -//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) = SYS___INOTIFY_ADD_WATCH_A -//sys InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) = SYS_INOTIFY_RM_WATCH -//sys Listxattr(path string, dest []byte) (sz int, err error) = SYS___LISTXATTR_A -//sys Llistxattr(path string, dest []byte) (sz int, err error) = SYS___LLISTXATTR_A -//sys Lremovexattr(path string, attr string) (err error) = SYS___LREMOVEXATTR_A -//sys Lutimes(path string, tv []Timeval) (err error) = SYS___LUTIMES_A +//sys Getpagesize() (pgsize int) = SYS_GETPAGESIZE //sys Mprotect(b []byte, prot int) (err error) = SYS_MPROTECT //sys Msync(b []byte, flags int) (err error) = SYS_MSYNC -//sys Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) = SYS___CONSOLE2 - -// Pipe2 begin - -//go:nosplit -func getPipe2Addr() *(func([]int, int) error) - -var Pipe2 = pipe2Enter - -func pipe2Enter(p []int, flags int) (err error) { - if funcptrtest(GetZosLibVec()+SYS_PIPE2<<4, "") == 0 { - *getPipe2Addr() = pipe2Impl - } else { - *getPipe2Addr() = pipe2Error - } - return (*getPipe2Addr())(p, flags) -} - -func pipe2Impl(p []int, flags int) (err error) { - var pp [2]_C_int - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE2<<4, uintptr(unsafe.Pointer(&pp[0])), uintptr(flags)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } else { - p[0] = int(pp[0]) - p[1] = int(pp[1]) - } - return -} -func pipe2Error(p []int, flags int) (err error) { - return fmt.Errorf("Pipe2 is not available on this system") -} - -// Pipe2 end - //sys Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL - -func Readdir(dir uintptr) (dirent *Dirent, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_A<<4, uintptr(dir)) - runtime.ExitSyscall() - dirent = (*Dirent)(unsafe.Pointer(r0)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//sys Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) = SYS___READDIR_R_A -//sys Statfs(path string, buf *Statfs_t) (err error) = SYS___STATFS_A -//sys Syncfs(fd int) (err error) = SYS_SYNCFS //sys Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES //sys W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT //sys W_Getmntent_A(buff *byte, size int) (lastsys int, err error) = SYS___W_GETMNTENT_A //sys mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A -//sys unmount_LE(filesystem string, mtm int) (err error) = SYS___UMOUNT_A +//sys unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A //sys Chroot(path string) (err error) = SYS___CHROOT_A //sys Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) = SYS_SELECT -//sysnb Uname(buf *Utsname) (err error) = SYS_____OSNAME_A -//sys Unshare(flags int) (err error) = SYS_UNSHARE +//sysnb Uname(buf *Utsname) (err error) = SYS___UNAME_A func Ptsname(fd int) (name string, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___PTSNAME_A<<4, uintptr(fd)) - runtime.ExitSyscall() - if r0 == 0 { - err = errnoErr2(e1, e2) - } else { - name = u2s(unsafe.Pointer(r0)) + r0, _, e1 := syscall_syscall(SYS___PTSNAME_A, uintptr(fd), 0, 0) + name = u2s(unsafe.Pointer(r0)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -738,19 +272,13 @@ func u2s(cstr unsafe.Pointer) string { } func Close(fd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) - runtime.ExitSyscall() + _, _, e1 := syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) for i := 0; e1 == EAGAIN && i < 10; i++ { - runtime.EnterSyscall() - CallLeFuncWithErr(GetZosLibVec()+SYS_USLEEP<<4, uintptr(10)) - runtime.ExitSyscall() - runtime.EnterSyscall() - r0, e2, e1 = CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) - runtime.ExitSyscall() + _, _, _ = syscall_syscall(SYS_USLEEP, uintptr(10), 0, 0) + _, _, e1 = syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) } - if r0 != 0 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -760,24 +288,9 @@ func Madvise(b []byte, advice int) (err error) { return } -func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { - return mapper.Mmap(fd, offset, length, prot, flags) -} - -func Munmap(b []byte) (err error) { - return mapper.Munmap(b) -} - -func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { - xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) - return unsafe.Pointer(xaddr), err -} - -func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { - return mapper.munmap(uintptr(addr), length) -} - //sys Gethostname(buf []byte) (err error) = SYS___GETHOSTNAME_A +//sysnb Getegid() (egid int) +//sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpid() (pid int) //sysnb Getpgid(pid int) (pgid int, err error) = SYS_GETPGID @@ -804,14 +317,11 @@ func Getrusage(who int, rusage *Rusage) (err error) { return } -//sys Getegid() (egid int) = SYS_GETEGID -//sys Geteuid() (euid int) = SYS_GETEUID //sysnb Getsid(pid int) (sid int, err error) = SYS_GETSID //sysnb Getuid() (uid int) //sysnb Kill(pid int, sig Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) = SYS___LCHOWN_A //sys Link(path string, link string) (err error) = SYS___LINK_A -//sys Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) = SYS___LINKAT_A //sys Listen(s int, n int) (err error) //sys lstat(path string, stat *Stat_LE_t) (err error) = SYS___LSTAT_A @@ -822,150 +332,15 @@ func Lstat(path string, stat *Stat_t) (err error) { return } -// for checking symlinks begins with $VERSION/ $SYSNAME/ $SYSSYMR/ $SYSSYMA/ -func isSpecialPath(path []byte) (v bool) { - var special = [4][8]byte{ - {'V', 'E', 'R', 'S', 'I', 'O', 'N', '/'}, - {'S', 'Y', 'S', 'N', 'A', 'M', 'E', '/'}, - {'S', 'Y', 'S', 'S', 'Y', 'M', 'R', '/'}, - {'S', 'Y', 'S', 'S', 'Y', 'M', 'A', '/'}} - - var i, j int - for i = 0; i < len(special); i++ { - for j = 0; j < len(special[i]); j++ { - if path[j] != special[i][j] { - break - } - } - if j == len(special[i]) { - return true - } - } - return false -} - -func realpath(srcpath string, abspath []byte) (pathlen int, errno int) { - var source [1024]byte - copy(source[:], srcpath) - source[len(srcpath)] = 0 - ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___REALPATH_A<<4, //__realpath_a() - []uintptr{uintptr(unsafe.Pointer(&source[0])), - uintptr(unsafe.Pointer(&abspath[0]))}) - if ret != 0 { - index := bytes.IndexByte(abspath[:], byte(0)) - if index != -1 { - return index, 0 - } - } else { - errptr := (*int)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) //__errno() - return 0, *errptr - } - return 0, 245 // EBADDATA 245 -} - -func Readlink(path string, buf []byte) (n int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(buf) > 0 { - _p1 = unsafe.Pointer(&buf[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - n = int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___READLINK_A<<4, - []uintptr{uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))})) - runtime.KeepAlive(unsafe.Pointer(_p0)) - if n == -1 { - value := *(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) - err = errnoErr(Errno(value)) - } else { - if buf[0] == '$' { - if isSpecialPath(buf[1:9]) { - cnt, err1 := realpath(path, buf) - if err1 == 0 { - n = cnt - } - } - } - } - return -} - -func impl_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(buf) > 0 { - _p1 = unsafe.Pointer(&buf[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - return n, err - } else { - if buf[0] == '$' { - if isSpecialPath(buf[1:9]) { - cnt, err1 := realpath(path, buf) - if err1 == 0 { - n = cnt - } - } - } - } - return -} - -//go:nosplit -func get_ReadlinkatAddr() *(func(dirfd int, path string, buf []byte) (n int, err error)) - -var Readlinkat = enter_Readlinkat - -func enter_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { - funcref := get_ReadlinkatAddr() - if funcptrtest(GetZosLibVec()+SYS___READLINKAT_A<<4, "") == 0 { - *funcref = impl_Readlinkat - } else { - *funcref = error_Readlinkat - } - return (*funcref)(dirfd, path, buf) -} - -func error_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { - n = -1 - err = ENOSYS - return -} - //sys Mkdir(path string, mode uint32) (err error) = SYS___MKDIR_A -//sys Mkdirat(dirfd int, path string, mode uint32) (err error) = SYS___MKDIRAT_A //sys Mkfifo(path string, mode uint32) (err error) = SYS___MKFIFO_A //sys Mknod(path string, mode uint32, dev int) (err error) = SYS___MKNOD_A -//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) = SYS___MKNODAT_A -//sys PivotRoot(newroot string, oldroot string) (err error) = SYS___PIVOT_ROOT_A //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) -//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) = SYS___PRCTL_A -//sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT +//sys Readlink(path string, buf []byte) (n int, err error) = SYS___READLINK_A //sys Rename(from string, to string) (err error) = SYS___RENAME_A -//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) = SYS___RENAMEAT_A -//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) = SYS___RENAMEAT2_A //sys Rmdir(path string) (err error) = SYS___RMDIR_A //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK -//sys Setegid(egid int) (err error) = SYS_SETEGID -//sys Seteuid(euid int) (err error) = SYS_SETEUID -//sys Sethostname(p []byte) (err error) = SYS___SETHOSTNAME_A -//sys Setns(fd int, nstype int) (err error) = SYS_SETNS //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setpgid(pid int, pgid int) (err error) = SYS_SETPGID //sysnb Setrlimit(resource int, lim *Rlimit) (err error) @@ -985,57 +360,32 @@ func Stat(path string, sta *Stat_t) (err error) { } //sys Symlink(path string, link string) (err error) = SYS___SYMLINK_A -//sys Symlinkat(oldPath string, dirfd int, newPath string) (err error) = SYS___SYMLINKAT_A //sys Sync() = SYS_SYNC //sys Truncate(path string, length int64) (err error) = SYS___TRUNCATE_A //sys Tcgetattr(fildes int, termptr *Termios) (err error) = SYS_TCGETATTR //sys Tcsetattr(fildes int, when int, termptr *Termios) (err error) = SYS_TCSETATTR //sys Umask(mask int) (oldmask int) //sys Unlink(path string) (err error) = SYS___UNLINK_A -//sys Unlinkat(dirfd int, path string, flags int) (err error) = SYS___UNLINKAT_A //sys Utime(path string, utim *Utimbuf) (err error) = SYS___UTIME_A //sys open(path string, mode int, perm uint32) (fd int, err error) = SYS___OPEN_A func Open(path string, mode int, perm uint32) (fd int, err error) { - if mode&O_ACCMODE == 0 { - mode |= O_RDONLY - } return open(path, mode, perm) } -//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) = SYS___OPENAT_A - -func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { - if flags&O_ACCMODE == 0 { - flags |= O_RDONLY +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + wd, err := Getwd() + if err != nil { + return err } - return openat(dirfd, path, flags, mode) -} -//sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) = SYS___OPENAT2_A - -func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { - if how.Flags&O_ACCMODE == 0 { - how.Flags |= O_RDONLY + if err := Fchdir(dirfd); err != nil { + return err } - return openat2(dirfd, path, how, SizeofOpenHow) -} + defer Chdir(wd) -func ZosFdToPath(dirfd int) (path string, err error) { - var buffer [1024]byte - runtime.EnterSyscall() - ret, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_IOCTL<<4, uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))) - runtime.ExitSyscall() - if ret == 0 { - zb := bytes.IndexByte(buffer[:], 0) - if zb == -1 { - zb = len(buffer) - } - CallLeFuncWithErr(GetZosLibVec()+SYS___E2A_L<<4, uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)) - return string(buffer[:zb]), nil - } - return "", errnoErr2(e1, e2) + return Mkfifo(path, mode) } //sys remove(path string) (err error) @@ -1053,12 +403,10 @@ func Getcwd(buf []byte) (n int, err error) { } else { p = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___GETCWD_A<<4, uintptr(p), uintptr(len(buf))) - runtime.ExitSyscall() + _, _, e := syscall_syscall(SYS___GETCWD_A, uintptr(p), uintptr(len(buf)), 0) n = clen(buf) + 1 - if r0 == 0 { - err = errnoErr2(e1, e2) + if e != 0 { + err = errnoErr(e) } return } @@ -1172,41 +520,9 @@ func (w WaitStatus) StopSignal() Signal { func (w WaitStatus) TrapCause() int { return -1 } -//sys waitid(idType int, id int, info *Siginfo, options int) (err error) - -func Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) { - return waitid(idType, id, info, options) -} - //sys waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) -func impl_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAIT4<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage))) - runtime.ExitSyscall() - wpid = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_Wait4Addr() *(func(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)) - -var Wait4 = enter_Wait4 - -func enter_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { - funcref := get_Wait4Addr() - if funcptrtest(GetZosLibVec()+SYS_WAIT4<<4, "") == 0 { - *funcref = impl_Wait4 - } else { - *funcref = legacyWait4 - } - return (*funcref)(pid, wstatus, options, rusage) -} - -func legacyWait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { +func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { // TODO(mundaym): z/OS doesn't have wait4. I don't think getrusage does what we want. // At the moment rusage will not be touched. var status _C_int @@ -1255,62 +571,23 @@ func Pipe(p []int) (err error) { } var pp [2]_C_int err = pipe(&pp) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return } //sys utimes(path string, timeval *[2]Timeval) (err error) = SYS___UTIMES_A func Utimes(path string, tv []Timeval) (err error) { - if tv == nil { - return utimes(path, nil) - } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -//sys utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) = SYS___UTIMENSAT_A - -func validUtimensat() bool { - if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { - if name, err := getLeFuncName(GetZosLibVec() + SYS___UTIMENSAT_A<<4); err == nil { - return name == "__utimensat_a" - } - } - return false -} - -// Begin UtimesNano - -//go:nosplit -func get_UtimesNanoAddr() *(func(path string, ts []Timespec) (err error)) - -var UtimesNano = enter_UtimesNano - -func enter_UtimesNano(path string, ts []Timespec) (err error) { - funcref := get_UtimesNanoAddr() - if validUtimensat() { - *funcref = utimesNanoImpl - } else { - *funcref = legacyUtimesNano - } - return (*funcref)(path, ts) -} - -func utimesNanoImpl(path string, ts []Timespec) (err error) { - if ts == nil { - return utimensat(AT_FDCWD, path, nil, 0) - } - if len(ts) != 2 { - return EINVAL - } - return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) -} - -func legacyUtimesNano(path string, ts []Timespec) (err error) { +func UtimesNano(path string, ts []Timespec) error { if len(ts) != 2 { return EINVAL } @@ -1323,70 +600,6 @@ func legacyUtimesNano(path string, ts []Timespec) (err error) { return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -// End UtimesNano - -// Begin UtimesNanoAt - -//go:nosplit -func get_UtimesNanoAtAddr() *(func(dirfd int, path string, ts []Timespec, flags int) (err error)) - -var UtimesNanoAt = enter_UtimesNanoAt - -func enter_UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { - funcref := get_UtimesNanoAtAddr() - if validUtimensat() { - *funcref = utimesNanoAtImpl - } else { - *funcref = legacyUtimesNanoAt - } - return (*funcref)(dirfd, path, ts, flags) -} - -func utimesNanoAtImpl(dirfd int, path string, ts []Timespec, flags int) (err error) { - if ts == nil { - return utimensat(dirfd, path, nil, flags) - } - if len(ts) != 2 { - return EINVAL - } - return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) -} - -func legacyUtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { - if path[0] != '/' { - dirPath, err := ZosFdToPath(dirfd) - if err != nil { - return err - } - path = dirPath + "/" + path - } - if flags == AT_SYMLINK_NOFOLLOW { - if len(ts) != 2 { - return EINVAL - } - - if ts[0].Nsec >= 5e8 { - ts[0].Sec++ - } - ts[0].Nsec = 0 - if ts[1].Nsec >= 5e8 { - ts[1].Sec++ - } - ts[1].Nsec = 0 - - // Not as efficient as it could be because Timespec and - // Timeval have different types in the different OSes - tv := []Timeval{ - NsecToTimeval(TimespecToNsec(ts[0])), - NsecToTimeval(TimespecToNsec(ts[1])), - } - return Lutimes(path, tv) - } - return UtimesNano(path, ts) -} - -// End UtimesNanoAt - func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny @@ -1978,13 +1191,10 @@ func Opendir(name string) (uintptr, error) { if err != nil { return 0, err } - err = nil - runtime.EnterSyscall() - dir, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___OPENDIR_A<<4, uintptr(unsafe.Pointer(p))) - runtime.ExitSyscall() + dir, _, e := syscall_syscall(SYS___OPENDIR_A, uintptr(unsafe.Pointer(p)), 0, 0) runtime.KeepAlive(unsafe.Pointer(p)) - if dir == 0 { - err = errnoErr2(e1, e2) + if e != 0 { + err = errnoErr(e) } return dir, err } @@ -1992,27 +1202,51 @@ func Opendir(name string) (uintptr, error) { // clearsyscall.Errno resets the errno value to 0. func clearErrno() +func Readdir(dir uintptr) (*Dirent, error) { + var ent Dirent + var res uintptr + // __readdir_r_a returns errno at the end of the directory stream, rather than 0. + // Therefore to avoid false positives we clear errno before calling it. + + // TODO(neeilan): Commented this out to get sys/unix compiling on z/OS. Uncomment and fix. Error: "undefined: clearsyscall" + //clearsyscall.Errno() // TODO(mundaym): check pre-emption rules. + + e, _, _ := syscall_syscall(SYS___READDIR_R_A, dir, uintptr(unsafe.Pointer(&ent)), uintptr(unsafe.Pointer(&res))) + var err error + if e != 0 { + err = errnoErr(Errno(e)) + } + if res == 0 { + return nil, err + } + return &ent, err +} + +func readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { + r0, _, e1 := syscall_syscall(SYS___READDIR_R_A, dirp, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) + if int64(r0) == -1 { + err = errnoErr(Errno(e1)) + } + return +} + func Closedir(dir uintptr) error { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSEDIR<<4, dir) - runtime.ExitSyscall() - if r0 != 0 { - return errnoErr2(e1, e2) + _, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0) + if e != 0 { + return errnoErr(e) } return nil } func Seekdir(dir uintptr, pos int) { - runtime.EnterSyscall() - CallLeFuncWithErr(GetZosLibVec()+SYS_SEEKDIR<<4, dir, uintptr(pos)) - runtime.ExitSyscall() + _, _, _ = syscall_syscall(SYS_SEEKDIR, dir, uintptr(pos), 0) } func Telldir(dir uintptr) (int, error) { - p, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TELLDIR<<4, dir) + p, _, e := syscall_syscall(SYS_TELLDIR, dir, 0, 0) pos := int(p) - if int64(p) == -1 { - return pos, errnoErr2(e1, e2) + if pos == -1 { + return pos, errnoErr(e) } return pos, nil } @@ -2027,55 +1261,19 @@ func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { *(*int64)(unsafe.Pointer(&flock[4])) = lk.Start *(*int64)(unsafe.Pointer(&flock[12])) = lk.Len *(*int32)(unsafe.Pointer(&flock[20])) = lk.Pid - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) - runtime.ExitSyscall() + _, _, errno := syscall_syscall(SYS_FCNTL, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) lk.Type = *(*int16)(unsafe.Pointer(&flock[0])) lk.Whence = *(*int16)(unsafe.Pointer(&flock[2])) lk.Start = *(*int64)(unsafe.Pointer(&flock[4])) lk.Len = *(*int64)(unsafe.Pointer(&flock[12])) lk.Pid = *(*int32)(unsafe.Pointer(&flock[20])) - if r0 == 0 { + if errno == 0 { return nil } - return errnoErr2(e1, e2) -} - -func impl_Flock(fd int, how int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FLOCK<<4, uintptr(fd), uintptr(how)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FlockAddr() *(func(fd int, how int) (err error)) - -var Flock = enter_Flock - -func validFlock(fp uintptr) bool { - if funcptrtest(GetZosLibVec()+SYS_FLOCK<<4, "") == 0 { - if name, err := getLeFuncName(GetZosLibVec() + SYS_FLOCK<<4); err == nil { - return name == "flock" - } - } - return false -} - -func enter_Flock(fd int, how int) (err error) { - funcref := get_FlockAddr() - if validFlock(GetZosLibVec() + SYS_FLOCK<<4) { - *funcref = impl_Flock - } else { - *funcref = legacyFlock - } - return (*funcref)(fd, how) + return errno } -func legacyFlock(fd int, how int) error { +func Flock(fd int, how int) error { var flock_type int16 var fcntl_cmd int @@ -2109,51 +1307,41 @@ func legacyFlock(fd int, how int) error { } func Mlock(b []byte) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) - runtime.ExitSyscall() - if r0 != 0 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } func Mlock2(b []byte, flags int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) - runtime.ExitSyscall() - if r0 != 0 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } func Mlockall(flags int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) - runtime.ExitSyscall() - if r0 != 0 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } func Munlock(b []byte) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) - runtime.ExitSyscall() - if r0 != 0 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } func Munlockall() (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) - runtime.ExitSyscall() - if r0 != 0 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2175,113 +1363,24 @@ func ClockGettime(clockid int32, ts *Timespec) error { _, err := Times(&tm) if err != nil { return EFAULT - } - ts.Sec = int64(tm.Utime / ticks_per_sec) - ts.Nsec = int64(tm.Utime) * nsec_per_sec / int64(ticks_per_sec) - } else { - return EINVAL - } - return nil -} - -// Chtag - -//go:nosplit -func get_ChtagAddr() *(func(path string, ccsid uint64, textbit uint64) error) - -var Chtag = enter_Chtag - -func enter_Chtag(path string, ccsid uint64, textbit uint64) error { - funcref := get_ChtagAddr() - if validSetxattr() { - *funcref = impl_Chtag - } else { - *funcref = legacy_Chtag - } - return (*funcref)(path, ccsid, textbit) -} - -func legacy_Chtag(path string, ccsid uint64, textbit uint64) error { - tag := ccsid<<16 | textbit<<15 - var tag_buff [8]byte - DecodeData(tag_buff[:], 8, tag) - return Setxattr(path, "filetag", tag_buff[:], XATTR_REPLACE) -} - -func impl_Chtag(path string, ccsid uint64, textbit uint64) error { - tag := ccsid<<16 | textbit<<15 - var tag_buff [4]byte - DecodeData(tag_buff[:], 4, tag) - return Setxattr(path, "system.filetag", tag_buff[:], XATTR_REPLACE) -} - -// End of Chtag - -// Nanosleep - -//go:nosplit -func get_NanosleepAddr() *(func(time *Timespec, leftover *Timespec) error) - -var Nanosleep = enter_Nanosleep - -func enter_Nanosleep(time *Timespec, leftover *Timespec) error { - funcref := get_NanosleepAddr() - if funcptrtest(GetZosLibVec()+SYS_NANOSLEEP<<4, "") == 0 { - *funcref = impl_Nanosleep + } + ts.Sec = int64(tm.Utime / ticks_per_sec) + ts.Nsec = int64(tm.Utime) * nsec_per_sec / int64(ticks_per_sec) } else { - *funcref = legacyNanosleep - } - return (*funcref)(time, leftover) -} - -func impl_Nanosleep(time *Timespec, leftover *Timespec) error { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_NANOSLEEP<<4, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover))) - runtime.ExitSyscall() - if int64(r0) == -1 { - return errnoErr2(e1, e2) + return EINVAL } return nil } -func legacyNanosleep(time *Timespec, leftover *Timespec) error { - t0 := runtime.Nanotime1() - var secrem uint32 - var nsecrem uint32 - total := time.Sec*1000000000 + time.Nsec - elapsed := runtime.Nanotime1() - t0 - var rv int32 - var rc int32 - var err error - // repeatedly sleep for 1 second until less than 1 second left - for total-elapsed > 1000000000 { - rv, rc, _ = BpxCondTimedWait(uint32(1), uint32(0), uint32(CW_CONDVAR), &secrem, &nsecrem) - if rv != 0 && rc != 112 { // 112 is EAGAIN - if leftover != nil && rc == 120 { // 120 is EINTR - leftover.Sec = int64(secrem) - leftover.Nsec = int64(nsecrem) - } - err = Errno(rc) - return err - } - elapsed = runtime.Nanotime1() - t0 - } - // sleep the remainder - if total > elapsed { - rv, rc, _ = BpxCondTimedWait(uint32(0), uint32(total-elapsed), uint32(CW_CONDVAR), &secrem, &nsecrem) - } - if leftover != nil && rc == 120 { - leftover.Sec = int64(secrem) - leftover.Nsec = int64(nsecrem) - } - if rv != 0 && rc != 112 { - err = Errno(rc) +func Statfs(path string, stat *Statfs_t) (err error) { + fd, err := open(path, O_RDONLY, 0) + defer Close(fd) + if err != nil { + return err } - return err + return Fstatfs(fd, stat) } -// End of Nanosleep - var ( Stdin = 0 Stdout = 1 @@ -2296,9 +1395,6 @@ var ( errENOENT error = syscall.ENOENT ) -var ZosTraceLevel int -var ZosTracefile *os.File - var ( signalNameMapOnce sync.Once signalNameMap map[string]syscall.Signal @@ -2320,56 +1416,6 @@ func errnoErr(e Errno) error { return e } -var reg *regexp.Regexp - -// enhanced with zos specific errno2 -func errnoErr2(e Errno, e2 uintptr) error { - switch e { - case 0: - return nil - case EAGAIN: - return errEAGAIN - /* - Allow the retrieval of errno2 for EINVAL and ENOENT on zos - case EINVAL: - return errEINVAL - case ENOENT: - return errENOENT - */ - } - if ZosTraceLevel > 0 { - var name string - if reg == nil { - reg = regexp.MustCompile("(^unix\\.[^/]+$|.*\\/unix\\.[^/]+$)") - } - i := 1 - pc, file, line, ok := runtime.Caller(i) - if ok { - name = runtime.FuncForPC(pc).Name() - } - for ok && reg.MatchString(runtime.FuncForPC(pc).Name()) { - i += 1 - pc, file, line, ok = runtime.Caller(i) - } - if ok { - if ZosTracefile == nil { - ZosConsolePrintf("From %s:%d\n", file, line) - ZosConsolePrintf("%s: %s (errno2=0x%x)\n", name, e.Error(), e2) - } else { - fmt.Fprintf(ZosTracefile, "From %s:%d\n", file, line) - fmt.Fprintf(ZosTracefile, "%s: %s (errno2=0x%x)\n", name, e.Error(), e2) - } - } else { - if ZosTracefile == nil { - ZosConsolePrintf("%s (errno2=0x%x)\n", e.Error(), e2) - } else { - fmt.Fprintf(ZosTracefile, "%s (errno2=0x%x)\n", e.Error(), e2) - } - } - } - return e -} - // ErrnoName returns the error name for error number e. func ErrnoName(e Errno) string { i := sort.Search(len(errorList), func(i int) bool { @@ -2428,9 +1474,6 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d return nil, EINVAL } - // Set __MAP_64 by default - flags |= __MAP_64 - // Map the requested memory. addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) if errno != nil { @@ -2477,6 +1520,14 @@ func (m *mmapper) Munmap(data []byte) (err error) { return nil } +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (err error) { + return mapper.Munmap(b) +} + func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { @@ -2735,170 +1786,83 @@ func Exec(argv0 string, argv []string, envv []string) error { return syscall.Exec(argv0, argv, envv) } -func Getag(path string) (ccsid uint16, flag uint16, err error) { - var val [8]byte - sz, err := Getxattr(path, "ccsid", val[:]) - if err != nil { - return - } - ccsid = uint16(EncodeData(val[0:sz])) - sz, err = Getxattr(path, "flags", val[:]) - if err != nil { - return - } - flag = uint16(EncodeData(val[0:sz]) >> 15) - return -} - -// Mount begin -func impl_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(source) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(target) - if err != nil { - return - } - var _p2 *byte - _p2, err = BytePtrFromString(fstype) - if err != nil { - return - } - var _p3 *byte - _p3, err = BytePtrFromString(data) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT1_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(_p3))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_MountAddr() *(func(source string, target string, fstype string, flags uintptr, data string) (err error)) - -var Mount = enter_Mount - -func enter_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { - funcref := get_MountAddr() - if validMount() { - *funcref = impl_Mount - } else { - *funcref = legacyMount - } - return (*funcref)(source, target, fstype, flags, data) -} - -func legacyMount(source string, target string, fstype string, flags uintptr, data string) (err error) { +func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { if needspace := 8 - len(fstype); needspace <= 0 { - fstype = fstype[0:8] + fstype = fstype[:8] } else { - fstype += " "[0:needspace] + fstype += " "[:needspace] } return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data) } -func validMount() bool { - if funcptrtest(GetZosLibVec()+SYS___MOUNT1_A<<4, "") == 0 { - if name, err := getLeFuncName(GetZosLibVec() + SYS___MOUNT1_A<<4); err == nil { - return name == "__mount1_a" - } - } - return false -} - -// Mount end - -// Unmount begin -func impl_Unmount(target string, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(target) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT2_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_UnmountAddr() *(func(target string, flags int) (err error)) - -var Unmount = enter_Unmount - -func enter_Unmount(target string, flags int) (err error) { - funcref := get_UnmountAddr() - if funcptrtest(GetZosLibVec()+SYS___UMOUNT2_A<<4, "") == 0 { - *funcref = impl_Unmount - } else { - *funcref = legacyUnmount - } - return (*funcref)(target, flags) -} - -func legacyUnmount(name string, mtm int) (err error) { +func Unmount(name string, mtm int) (err error) { // mountpoint is always a full path and starts with a '/' // check if input string is not a mountpoint but a filesystem name if name[0] != '/' { - return unmount_LE(name, mtm) + return unmount(name, mtm) } // treat name as mountpoint b2s := func(arr []byte) string { - var str string - for i := 0; i < len(arr); i++ { - if arr[i] == 0 { - str = string(arr[:i]) - break - } + nulli := bytes.IndexByte(arr, 0) + if nulli == -1 { + return string(arr) + } else { + return string(arr[:nulli]) } - return str } var buffer struct { header W_Mnth fsinfo [64]W_Mntent } - fs_count, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer))) - if err == nil { - err = EINVAL - for i := 0; i < fs_count; i++ { - if b2s(buffer.fsinfo[i].Mountpoint[:]) == name { - err = unmount_LE(b2s(buffer.fsinfo[i].Fsname[:]), mtm) - break - } + fsCount, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer))) + if err != nil { + return err + } + if fsCount == 0 { + return EINVAL + } + for i := 0; i < fsCount; i++ { + if b2s(buffer.fsinfo[i].Mountpoint[:]) == name { + err = unmount(b2s(buffer.fsinfo[i].Fsname[:]), mtm) + break } - } else if fs_count == 0 { - err = EINVAL } return err } -// Unmount end - -func direntIno(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) -} - -func direntReclen(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) -} - -func direntNamlen(buf []byte) (uint64, bool) { - reclen, ok := direntReclen(buf) - if !ok { - return 0, false +func fdToPath(dirfd int) (path string, err error) { + var buffer [1024]byte + // w_ctrl() + ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4, + []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))}) + if ret == 0 { + zb := bytes.IndexByte(buffer[:], 0) + if zb == -1 { + zb = len(buffer) + } + // __e2a_l() + runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, + []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)}) + return string(buffer[:zb]), nil + } + // __errno() + errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, + []uintptr{})))) + // __errno2() + errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4, + []uintptr{})) + // strerror_r() + ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4, + []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024}) + if ret == 0 { + zb := bytes.IndexByte(buffer[:], 0) + if zb == -1 { + zb = len(buffer) + } + return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2) + } else { + return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) } - return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } func direntLeToDirentUnix(dirent *direntLE, dir uintptr, path string) (Dirent, error) { @@ -2940,7 +1904,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { } // Get path from fd to avoid unavailable call (fdopendir) - path, err := ZosFdToPath(fd) + path, err := fdToPath(fd) if err != nil { return 0, err } @@ -2954,7 +1918,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { for { var entryLE direntLE var entrypLE *direntLE - e := Readdir_r(d, &entryLE, &entrypLE) + e := readdir_r(d, &entryLE, &entrypLE) if e != nil { return n, e } @@ -3000,214 +1964,23 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { return n, nil } -func Err2ad() (eadd *int) { - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERR2AD<<4) - eadd = (*int)(unsafe.Pointer(r0)) - return -} - -func ZosConsolePrintf(format string, v ...interface{}) (int, error) { - type __cmsg struct { - _ uint16 - _ [2]uint8 - __msg_length uint32 - __msg uintptr - _ [4]uint8 - } - msg := fmt.Sprintf(format, v...) - strptr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&msg)).Data) - len := (*reflect.StringHeader)(unsafe.Pointer(&msg)).Len - cmsg := __cmsg{__msg_length: uint32(len), __msg: uintptr(strptr)} - cmd := uint32(0) - runtime.EnterSyscall() - rc, err2, err1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____CONSOLE_A<<4, uintptr(unsafe.Pointer(&cmsg)), 0, uintptr(unsafe.Pointer(&cmd))) - runtime.ExitSyscall() - if rc != 0 { - return 0, fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) - } - return 0, nil -} -func ZosStringToEbcdicBytes(str string, nullterm bool) (ebcdicBytes []byte) { - if nullterm { - ebcdicBytes = []byte(str + "\x00") - } else { - ebcdicBytes = []byte(str) - } - A2e(ebcdicBytes) - return -} -func ZosEbcdicBytesToString(b []byte, trimRight bool) (str string) { - res := make([]byte, len(b)) - copy(res, b) - E2a(res) - if trimRight { - str = string(bytes.TrimRight(res, " \x00")) - } else { - str = string(res) - } - return -} - -func fdToPath(dirfd int) (path string, err error) { - var buffer [1024]byte - // w_ctrl() - ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4, - []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))}) - if ret == 0 { - zb := bytes.IndexByte(buffer[:], 0) - if zb == -1 { - zb = len(buffer) - } - // __e2a_l() - runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, - []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)}) - return string(buffer[:zb]), nil - } - // __errno() - errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, - []uintptr{})))) - // __errno2() - errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4, - []uintptr{})) - // strerror_r() - ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4, - []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024}) - if ret == 0 { - zb := bytes.IndexByte(buffer[:], 0) - if zb == -1 { - zb = len(buffer) - } - return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2) - } else { - return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) - } -} - -func impl_Mkfifoat(dirfd int, path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFOAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_MkfifoatAddr() *(func(dirfd int, path string, mode uint32) (err error)) - -var Mkfifoat = enter_Mkfifoat - -func enter_Mkfifoat(dirfd int, path string, mode uint32) (err error) { - funcref := get_MkfifoatAddr() - if funcptrtest(GetZosLibVec()+SYS___MKFIFOAT_A<<4, "") == 0 { - *funcref = impl_Mkfifoat - } else { - *funcref = legacy_Mkfifoat - } - return (*funcref)(dirfd, path, mode) -} - -func legacy_Mkfifoat(dirfd int, path string, mode uint32) (err error) { - dirname, err := ZosFdToPath(dirfd) - if err != nil { - return err - } - return Mkfifo(dirname+"/"+path, mode) -} - -//sys Posix_openpt(oflag int) (fd int, err error) = SYS_POSIX_OPENPT -//sys Grantpt(fildes int) (rc int, err error) = SYS_GRANTPT -//sys Unlockpt(fildes int) (rc int, err error) = SYS_UNLOCKPT - -func fcntlAsIs(fd uintptr, cmd int, arg uintptr) (val int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), arg) - runtime.ExitSyscall() - val = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return +func ReadDirent(fd int, buf []byte) (n int, err error) { + var base = (*uintptr)(unsafe.Pointer(new(uint64))) + return Getdirentries(fd, buf, base) } -func Fcntl(fd uintptr, cmd int, op interface{}) (ret int, err error) { - switch op.(type) { - case *Flock_t: - err = FcntlFlock(fd, cmd, op.(*Flock_t)) - if err != nil { - ret = -1 - } - return - case int: - return FcntlInt(fd, cmd, op.(int)) - case *F_cnvrt: - return fcntlAsIs(fd, cmd, uintptr(unsafe.Pointer(op.(*F_cnvrt)))) - case unsafe.Pointer: - return fcntlAsIs(fd, cmd, uintptr(op.(unsafe.Pointer))) - default: - return -1, EINVAL - } - return +func direntIno(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } -func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - return sendfile(outfd, infd, offset, count) +func direntReclen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } -func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - // TODO: use LE call instead if the call is implemented - originalOffset, err := Seek(infd, 0, SEEK_CUR) - if err != nil { - return -1, err - } - //start reading data from in_fd - if offset != nil { - _, err := Seek(infd, *offset, SEEK_SET) - if err != nil { - return -1, err - } - } - - buf := make([]byte, count) - readBuf := make([]byte, 0) - var n int = 0 - for i := 0; i < count; i += n { - n, err := Read(infd, buf) - if n == 0 { - if err != nil { - return -1, err - } else { // EOF - break - } - } - readBuf = append(readBuf, buf...) - buf = buf[0:0] - } - - n2, err := Write(outfd, readBuf) - if err != nil { - return -1, err - } - - //When sendfile() returns, this variable will be set to the - // offset of the byte following the last byte that was read. - if offset != nil { - *offset = *offset + int64(n) - // If offset is not NULL, then sendfile() does not modify the file - // offset of in_fd - _, err := Seek(infd, originalOffset, SEEK_SET) - if err != nil { - return -1, err - } +func direntNamlen(buf []byte) (uint64, bool) { + reclen, ok := direntReclen(buf) + if !ok { + return 0, false } - return n2, nil + return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } diff --git a/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix.go index 672d6b0a880..79a84f18b46 100644 --- a/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix.go +++ b/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix.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 (darwin && !ios) || linux || zos +//go:build (darwin && !ios) || linux package unix diff --git a/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go b/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go index 8b7977a28c0..9eb0db664cb 100644 --- a/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go +++ b/upstream/vendor/golang.org/x/sys/unix/sysvshm_unix_other.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 (darwin && !ios) || zos +//go:build darwin && !ios package unix diff --git a/upstream/vendor/golang.org/x/sys/unix/vgetrandom_linux.go b/upstream/vendor/golang.org/x/sys/unix/vgetrandom_linux.go deleted file mode 100644 index 07ac8e09d1b..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/vgetrandom_linux.go +++ /dev/null @@ -1,13 +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. - -//go:build linux && go1.24 - -package unix - -import _ "unsafe" - -//go:linkname vgetrandom runtime.vgetrandom -//go:noescape -func vgetrandom(p []byte, flags uint32) (ret int, supported bool) diff --git a/upstream/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go b/upstream/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go deleted file mode 100644 index 297e97bce92..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go +++ /dev/null @@ -1,11 +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. - -//go:build !linux || !go1.24 - -package unix - -func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { - return -1, false -} diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index d73c4652e6c..e40fa85245f 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -237,9 +237,6 @@ const ( CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 - CONNECT_DATA_AUTHENTICATED = 0x4 - CONNECT_DATA_IDEMPOTENT = 0x2 - CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 @@ -1172,11 +1169,6 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 - RENAME_EXCL = 0x4 - RENAME_NOFOLLOW_ANY = 0x10 - RENAME_RESERVED1 = 0x8 - RENAME_SECLUDE = 0x1 - RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1268,10 +1260,6 @@ const ( RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 - SAE_ASSOCID_ALL = 0xffffffff - SAE_ASSOCID_ANY = 0x0 - SAE_CONNID_ALL = 0xffffffff - SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index 4a55a400588..bb02aa6c056 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -237,9 +237,6 @@ const ( CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 - CONNECT_DATA_AUTHENTICATED = 0x4 - CONNECT_DATA_IDEMPOTENT = 0x2 - CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 @@ -1172,11 +1169,6 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 - RENAME_EXCL = 0x4 - RENAME_NOFOLLOW_ANY = 0x10 - RENAME_RESERVED1 = 0x8 - RENAME_SECLUDE = 0x1 - RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1268,10 +1260,6 @@ const ( RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 - SAE_ASSOCID_ALL = 0xffffffff - SAE_ASSOCID_ANY = 0x0 - SAE_CONNID_ALL = 0xffffffff - SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux.go index 6ebc48b3fec..36bf8399f4f 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -321,9 +321,6 @@ const ( AUDIT_INTEGRITY_STATUS = 0x70a AUDIT_IPC = 0x517 AUDIT_IPC_SET_PERM = 0x51f - AUDIT_IPE_ACCESS = 0x58c - AUDIT_IPE_CONFIG_CHANGE = 0x58d - AUDIT_IPE_POLICY_LOAD = 0x58e AUDIT_KERNEL = 0x7d0 AUDIT_KERNEL_OTHER = 0x524 AUDIT_KERN_MODULE = 0x532 @@ -460,7 +457,6 @@ const ( B600 = 0x8 B75 = 0x2 B9600 = 0xd - BCACHEFS_SUPER_MAGIC = 0xca451a4e BDEVFS_MAGIC = 0x62646576 BINDERFS_SUPER_MAGIC = 0x6c6f6f70 BINFMTFS_MAGIC = 0x42494e4d @@ -492,14 +488,11 @@ const ( BPF_F_ID = 0x20 BPF_F_NETFILTER_IP_DEFRAG = 0x1 BPF_F_QUERY_EFFECTIVE = 0x1 - BPF_F_REDIRECT_FLAGS = 0x19 BPF_F_REPLACE = 0x4 BPF_F_SLEEPABLE = 0x10 BPF_F_STRICT_ALIGNMENT = 0x1 - BPF_F_TEST_REG_INVARIANTS = 0x80 BPF_F_TEST_RND_HI32 = 0x4 BPF_F_TEST_RUN_ON_CPU = 0x1 - BPF_F_TEST_SKB_CHECKSUM_COMPLETE = 0x4 BPF_F_TEST_STATE_FREQ = 0x8 BPF_F_TEST_XDP_LIVE_FRAMES = 0x2 BPF_F_XDP_DEV_BOUND_ONLY = 0x40 @@ -508,7 +501,6 @@ const ( BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 - BPF_JCOND = 0xe0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 @@ -664,9 +656,6 @@ const ( CAN_NPROTO = 0x8 CAN_RAW = 0x1 CAN_RAW_FILTER_MAX = 0x200 - CAN_RAW_XL_VCID_RX_FILTER = 0x4 - CAN_RAW_XL_VCID_TX_PASS = 0x2 - CAN_RAW_XL_VCID_TX_SET = 0x1 CAN_RTR_FLAG = 0x40000000 CAN_SFF_ID_BITS = 0xb CAN_SFF_MASK = 0x7ff @@ -934,7 +923,6 @@ const ( EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 - EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 ESP_V4_FLOW = 0xa ESP_V6_FLOW = 0xc @@ -948,6 +936,9 @@ const ( ETHTOOL_FEC_OFF = 0x4 ETHTOOL_FEC_RS = 0x8 ETHTOOL_FLAG_ALL = 0x7 + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_FLASHDEV = 0x33 ETHTOOL_FLASH_MAX_FILENAME = 0x80 ETHTOOL_FWVERS_LEN = 0x20 @@ -1170,7 +1161,6 @@ const ( EXTA = 0xe EXTB = 0xf F2FS_SUPER_MAGIC = 0xf2f52010 - FALLOC_FL_ALLOCATE_RANGE = 0x0 FALLOC_FL_COLLAPSE_RANGE = 0x8 FALLOC_FL_INSERT_RANGE = 0x20 FALLOC_FL_KEEP_SIZE = 0x1 @@ -1348,7 +1338,6 @@ const ( F_OFD_SETLK = 0x25 F_OFD_SETLKW = 0x26 F_OK = 0x0 - F_SEAL_EXEC = 0x20 F_SEAL_FUTURE_WRITE = 0x10 F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 @@ -1637,7 +1626,6 @@ const ( IP_FREEBIND = 0xf IP_HDRINCL = 0x3 IP_IPSEC_POLICY = 0x10 - IP_LOCAL_PORT_RANGE = 0x33 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 @@ -1664,7 +1652,6 @@ const ( IP_PMTUDISC_OMIT = 0x5 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 - IP_PROTOCOL = 0x34 IP_RECVERR = 0xb IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 @@ -1710,8 +1697,6 @@ const ( KEXEC_ARCH_S390 = 0x160000 KEXEC_ARCH_SH = 0x2a0000 KEXEC_ARCH_X86_64 = 0x3e0000 - KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 - KEXEC_FILE_DEBUG = 0x8 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 KEXEC_FILE_UNLOAD = 0x1 @@ -1786,7 +1771,6 @@ const ( KEY_SPEC_USER_KEYRING = -0x4 KEY_SPEC_USER_SESSION_KEYRING = -0x5 LANDLOCK_ACCESS_FS_EXECUTE = 0x1 - LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000 LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800 LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40 LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80 @@ -1804,8 +1788,6 @@ const ( LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 - LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 - LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef LINUX_REBOOT_CMD_HALT = 0xcdef0123 @@ -1870,19 +1852,6 @@ const ( MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 - MAP_HUGE_16GB = 0x88000000 - MAP_HUGE_16KB = 0x38000000 - MAP_HUGE_16MB = 0x60000000 - MAP_HUGE_1GB = 0x78000000 - MAP_HUGE_1MB = 0x50000000 - MAP_HUGE_256MB = 0x70000000 - MAP_HUGE_2GB = 0x7c000000 - MAP_HUGE_2MB = 0x54000000 - MAP_HUGE_32MB = 0x64000000 - MAP_HUGE_512KB = 0x4c000000 - MAP_HUGE_512MB = 0x74000000 - MAP_HUGE_64KB = 0x40000000 - MAP_HUGE_8MB = 0x5c000000 MAP_HUGE_MASK = 0x3f MAP_HUGE_SHIFT = 0x1a MAP_PRIVATE = 0x2 @@ -1929,9 +1898,6 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 - MNT_ID_REQ_SIZE_VER0 = 0x18 - MNT_ID_REQ_SIZE_VER1 = 0x20 - MNT_NS_INFO_SIZE_VER0 = 0x10 MODULE_INIT_COMPRESSED_FILE = 0x4 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 @@ -2197,10 +2163,10 @@ const ( NFT_REG_SIZE = 0x10 NFT_REJECT_ICMPX_MAX = 0x3 NFT_RT_MAX = 0x4 - NFT_SECMARK_CTX_MAXLEN = 0x1000 + NFT_SECMARK_CTX_MAXLEN = 0x100 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 - NFT_TABLE_F_MASK = 0x7 + NFT_TABLE_F_MASK = 0x3 NFT_TABLE_MAXNAMELEN = 0x100 NFT_TRACETYPE_MAX = 0x3 NFT_TUNNEL_F_MASK = 0x7 @@ -2336,7 +2302,6 @@ const ( PERF_AUX_FLAG_PARTIAL = 0x4 PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00 PERF_AUX_FLAG_TRUNCATED = 0x1 - PERF_BRANCH_ENTRY_INFO_BITS_MAX = 0x21 PERF_BR_ARM64_DEBUG_DATA = 0x7 PERF_BR_ARM64_DEBUG_EXIT = 0x5 PERF_BR_ARM64_DEBUG_HALT = 0x4 @@ -2366,11 +2331,9 @@ const ( PERF_MEM_LVLNUM_IO = 0xa PERF_MEM_LVLNUM_L1 = 0x1 PERF_MEM_LVLNUM_L2 = 0x2 - PERF_MEM_LVLNUM_L2_MHB = 0x5 PERF_MEM_LVLNUM_L3 = 0x3 PERF_MEM_LVLNUM_L4 = 0x4 PERF_MEM_LVLNUM_LFB = 0xc - PERF_MEM_LVLNUM_MSC = 0x6 PERF_MEM_LVLNUM_NA = 0xf PERF_MEM_LVLNUM_PMEM = 0xe PERF_MEM_LVLNUM_RAM = 0xd @@ -2436,14 +2399,12 @@ const ( PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 - PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c PPPIOCNEWUNIT = 0xc004743e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 - PROCFS_IOCTL_MAGIC = 'f' PROC_SUPER_MAGIC = 0x9fa0 PROT_EXEC = 0x4 PROT_GROWSDOWN = 0x1000000 @@ -2525,23 +2486,6 @@ const ( PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c - PR_PPC_DEXCR_CTRL_CLEAR = 0x4 - PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 - PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 - PR_PPC_DEXCR_CTRL_MASK = 0x1f - PR_PPC_DEXCR_CTRL_SET = 0x2 - PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8 - PR_PPC_DEXCR_IBRTPD = 0x1 - PR_PPC_DEXCR_NPHIE = 0x3 - PR_PPC_DEXCR_SBHE = 0x0 - PR_PPC_DEXCR_SRAPD = 0x2 - PR_PPC_GET_DEXCR = 0x48 - PR_PPC_SET_DEXCR = 0x49 - PR_RISCV_CTX_SW_FENCEI_OFF = 0x1 - PR_RISCV_CTX_SW_FENCEI_ON = 0x0 - PR_RISCV_SCOPE_PER_PROCESS = 0x0 - PR_RISCV_SCOPE_PER_THREAD = 0x1 - PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47 PR_RISCV_V_GET_CONTROL = 0x46 PR_RISCV_V_SET_CONTROL = 0x45 PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3 @@ -2633,28 +2577,6 @@ const ( PR_UNALIGN_NOPRINT = 0x1 PR_UNALIGN_SIGBUS = 0x2 PSTOREFS_MAGIC = 0x6165676c - PTP_CLK_MAGIC = '=' - PTP_ENABLE_FEATURE = 0x1 - PTP_EXTTS_EDGES = 0x6 - PTP_EXTTS_EVENT_VALID = 0x1 - PTP_EXTTS_V1_VALID_FLAGS = 0x7 - PTP_EXTTS_VALID_FLAGS = 0x1f - PTP_EXT_OFFSET = 0x10 - PTP_FALLING_EDGE = 0x4 - PTP_MAX_SAMPLES = 0x19 - PTP_PEROUT_DUTY_CYCLE = 0x2 - PTP_PEROUT_ONE_SHOT = 0x1 - PTP_PEROUT_PHASE = 0x4 - PTP_PEROUT_V1_VALID_FLAGS = 0x0 - PTP_PEROUT_VALID_FLAGS = 0x7 - PTP_PIN_GETFUNC = 0xc0603d06 - PTP_PIN_GETFUNC2 = 0xc0603d0f - PTP_RISING_EDGE = 0x2 - PTP_STRICT_FLAGS = 0x8 - PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09 - PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12 - PTP_SYS_OFFSET_PRECISE = 0xc0403d08 - PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11 PTRACE_ATTACH = 0x10 PTRACE_CONT = 0x7 PTRACE_DETACH = 0x11 @@ -2968,17 +2890,14 @@ const ( RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 - RWF_ATOMIC = 0x40 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 - RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x7f + RWF_SUPPORTED = 0x1f RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 SCHED_DEADLINE = 0x6 - SCHED_EXT = 0x7 SCHED_FIFO = 0x1 SCHED_FLAG_ALL = 0x7f SCHED_FLAG_DL_OVERRUN = 0x4 @@ -2995,9 +2914,7 @@ const ( SCHED_RESET_ON_FORK = 0x40000000 SCHED_RR = 0x2 SCM_CREDENTIALS = 0x2 - SCM_PIDFD = 0x4 SCM_RIGHTS = 0x1 - SCM_SECURITY = 0x3 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 SECCOMP_ADDFD_FLAG_SEND = 0x2 @@ -3130,8 +3047,6 @@ const ( SIOCSMIIREG = 0x8949 SIOCSRARP = 0x8962 SIOCWANDEV = 0x894a - SK_DIAG_BPF_STORAGE_MAX = 0x3 - SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1 SMACK_MAGIC = 0x43415d53 SMART_AUTOSAVE = 0xd2 SMART_AUTO_OFFLINE = 0xdb @@ -3152,8 +3067,6 @@ const ( SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 - SOCK_DESTROY = 0x15 - SOCK_DIAG_BY_FAMILY = 0x14 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 @@ -3247,7 +3160,6 @@ const ( STATX_ATTR_MOUNT_ROOT = 0x2000 STATX_ATTR_NODUMP = 0x40 STATX_ATTR_VERITY = 0x100000 - STATX_ATTR_WRITE_ATOMIC = 0x400000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 @@ -3256,15 +3168,12 @@ const ( STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 - STATX_MNT_ID_UNIQUE = 0x4000 STATX_MODE = 0x2 STATX_MTIME = 0x40 STATX_NLINK = 0x4 STATX_SIZE = 0x200 - STATX_SUBVOL = 0x8000 STATX_TYPE = 0x1 STATX_UID = 0x8 - STATX_WRITE_ATOMIC = 0x10000 STATX__RESERVED = 0x80000000 SYNC_FILE_RANGE_WAIT_AFTER = 0x4 SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 @@ -3346,7 +3255,6 @@ const ( TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_EXT = 0x20 - TCP_MD5SIG_FLAG_IFINDEX = 0x2 TCP_MD5SIG_FLAG_PREFIX = 0x1 TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 @@ -3654,17 +3562,12 @@ const ( XDP_RX_RING = 0x2 XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 - XDP_TXMD_FLAGS_CHECKSUM = 0x2 - XDP_TXMD_FLAGS_TIMESTAMP = 0x1 - XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 XDP_UMEM_COMPLETION_RING = 0x6 XDP_UMEM_FILL_RING = 0x5 XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 XDP_UMEM_PGOFF_FILL_RING = 0x100000000 XDP_UMEM_REG = 0x4 - XDP_UMEM_TX_METADATA_LEN = 0x4 - XDP_UMEM_TX_SW_CSUM = 0x2 XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1 XDP_USE_NEED_WAKEUP = 0x8 XDP_USE_SG = 0x10 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index c0d45e32050..42ff8c3c1b0 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -109,7 +107,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -121,7 +118,6 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 - MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 @@ -154,14 +150,9 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -238,20 +229,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETFPREGS = 0xe PTRACE_GETFPXREGS = 0x12 PTRACE_GET_THREAD_AREA = 0x19 @@ -298,8 +275,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -338,9 +313,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c731d24f025..dca436004fa 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -109,7 +107,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -121,7 +118,6 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 - MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 @@ -154,14 +150,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -238,20 +229,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_ARCH_PRCTL = 0x1e PTRACE_GETFPREGS = 0xe PTRACE_GETFPXREGS = 0x12 @@ -299,8 +276,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -339,9 +314,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 680018a4a7c..5cca668ac30 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETCRUNCHREGS = 0x19 PTRACE_GETFDPIC = 0x1f PTRACE_GETFDPIC_EXEC = 0x0 @@ -304,8 +282,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -344,9 +320,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index a63909f308d..d8cae6d1534 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 ESR_MAGIC = 0x45535201 EXTPROC = 0x10000 @@ -89,7 +87,6 @@ const ( FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 - FPMR_MAGIC = 0x46504d52 FPSIMD_MAGIC = 0x46508001 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 @@ -112,7 +109,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -155,14 +151,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -206,7 +197,6 @@ const ( PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 - POE_MAGIC = 0x504f4530 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 @@ -242,20 +232,6 @@ const ( PROT_BTI = 0x10 PROT_MTE = 0x20 PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_PEEKMTETAGS = 0x21 PTRACE_POKEMTETAGS = 0x22 PTRACE_SYSEMU = 0x1f @@ -296,8 +272,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -336,9 +310,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 9b0a2573fe3..28e39afdcb4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -109,7 +107,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -155,14 +152,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -239,20 +231,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 RLIMIT_AS = 0x9 @@ -291,8 +269,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -331,9 +307,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 958e6e0645a..cd66e92cb42 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 @@ -297,8 +275,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -337,9 +313,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 50c7f25bd16..c1595eba78e 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 @@ -297,8 +275,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -337,9 +313,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index ced21d66d95..ee9456b0da7 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 @@ -297,8 +275,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -337,9 +313,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 226c0441902..8cfca81e1b5 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 @@ -297,8 +275,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -337,9 +313,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 3122737cd46..60b0deb3af7 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 @@ -153,14 +150,9 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 @@ -238,20 +230,6 @@ const ( PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 @@ -352,8 +330,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -392,9 +368,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index eb5d3467edf..f90aa7281bf 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 @@ -153,14 +150,9 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 @@ -238,20 +230,6 @@ const ( PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 @@ -356,8 +334,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -396,9 +372,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index e921ebc60b7..ba9e0150338 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 @@ -153,14 +150,9 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 @@ -238,20 +230,6 @@ const ( PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 @@ -356,8 +334,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -396,9 +372,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 38ba81c55c1..07cdfd6e9fd 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETFDPIC = 0x21 PTRACE_GETFDPIC_EXEC = 0x0 PTRACE_GETFDPIC_INTERP = 0x1 @@ -288,8 +266,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -328,9 +304,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 71f0400977b..2f1dd214a74 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -78,8 +78,6 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -108,7 +106,6 @@ const ( HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -151,14 +148,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 @@ -235,20 +227,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_DISABLE_TE = 0x5010 PTRACE_ENABLE_TE = 0x5009 PTRACE_GET_LAST_BREAK = 0x5006 @@ -360,8 +338,6 @@ const ( RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -400,9 +376,6 @@ const ( SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index c44a313322c..f40519d9018 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -82,8 +82,6 @@ const ( EFD_CLOEXEC = 0x400000 EFD_NONBLOCK = 0x4000 EMT_TAGOVF = 0x1 - EPIOCGPARAMS = 0x40088a02 - EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x400000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -112,7 +110,6 @@ const ( HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 - HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -156,14 +153,9 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 - NS_GET_PID_FROM_PIDNS = 0x4004b706 - NS_GET_PID_IN_PIDNS = 0x4004b708 - NS_GET_TGID_FROM_PIDNS = 0x4004b707 - NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 @@ -240,20 +232,6 @@ const ( PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x40503d01 - PTP_CLOCK_GETCAPS2 = 0x40503d0a - PTP_ENABLE_PPS = 0x80043d04 - PTP_ENABLE_PPS2 = 0x80043d0d - PTP_EXTTS_REQUEST = 0x80103d02 - PTP_EXTTS_REQUEST2 = 0x80103d0b - PTP_MASK_CLEAR_ALL = 0x20003d13 - PTP_MASK_EN_SINGLE = 0x80043d14 - PTP_PEROUT_REQUEST = 0x80383d03 - PTP_PEROUT_REQUEST2 = 0x80383d0c - PTP_PIN_SETFUNC = 0x80603d07 - PTP_PIN_SETFUNC2 = 0x80603d10 - PTP_SYS_OFFSET = 0x83403d05 - PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPAREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETFPREGS64 = 0x19 @@ -351,8 +329,6 @@ const ( RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f - SCM_DEVMEM_DMABUF = 0x58 - SCM_DEVMEM_LINEAR = 0x57 SCM_TIMESTAMPING = 0x23 SCM_TIMESTAMPING_OPT_STATS = 0x38 SCM_TIMESTAMPING_PKTINFO = 0x3c @@ -439,9 +415,6 @@ const ( SO_CNX_ADVICE = 0x37 SO_COOKIE = 0x3b SO_DETACH_REUSEPORT_BPF = 0x47 - SO_DEVMEM_DMABUF = 0x58 - SO_DEVMEM_DONTNEED = 0x59 - SO_DEVMEM_LINEAR = 0x57 SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 diff --git a/upstream/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/upstream/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go index 1ec2b1407b1..4dfd2e051d3 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -10,99 +10,41 @@ package unix const ( - BRKINT = 0x0001 - CLOCAL = 0x1 - CLOCK_MONOTONIC = 0x1 - CLOCK_PROCESS_CPUTIME_ID = 0x2 - CLOCK_REALTIME = 0x0 - CLOCK_THREAD_CPUTIME_ID = 0x3 - CLONE_NEWIPC = 0x08000000 - CLONE_NEWNET = 0x40000000 - CLONE_NEWNS = 0x00020000 - CLONE_NEWPID = 0x20000000 - CLONE_NEWUTS = 0x04000000 - CLONE_PARENT = 0x00008000 - CS8 = 0x0030 - CSIZE = 0x0030 - ECHO = 0x00000008 - ECHONL = 0x00000001 - EFD_SEMAPHORE = 0x00002000 - EFD_CLOEXEC = 0x00001000 - EFD_NONBLOCK = 0x00000004 - EPOLL_CLOEXEC = 0x00001000 - EPOLL_CTL_ADD = 0 - EPOLL_CTL_MOD = 1 - EPOLL_CTL_DEL = 2 - EPOLLRDNORM = 0x0001 - EPOLLRDBAND = 0x0002 - EPOLLIN = 0x0003 - EPOLLOUT = 0x0004 - EPOLLWRBAND = 0x0008 - EPOLLPRI = 0x0010 - EPOLLERR = 0x0020 - EPOLLHUP = 0x0040 - EPOLLEXCLUSIVE = 0x20000000 - EPOLLONESHOT = 0x40000000 - FD_CLOEXEC = 0x01 - FD_CLOFORK = 0x02 - FD_SETSIZE = 0x800 - FNDELAY = 0x04 - F_CLOSFD = 9 - F_CONTROL_CVT = 13 - F_DUPFD = 0 - F_DUPFD2 = 8 - F_GETFD = 1 - F_GETFL = 259 - F_GETLK = 5 - F_GETOWN = 10 - F_OK = 0x0 - F_RDLCK = 1 - F_SETFD = 2 - F_SETFL = 4 - F_SETLK = 6 - F_SETLKW = 7 - F_SETOWN = 11 - F_SETTAG = 12 - F_UNLCK = 3 - F_WRLCK = 2 - FSTYPE_ZFS = 0xe9 //"Z" - FSTYPE_HFS = 0xc8 //"H" - FSTYPE_NFS = 0xd5 //"N" - FSTYPE_TFS = 0xe3 //"T" - FSTYPE_AUTOMOUNT = 0xc1 //"A" - GRND_NONBLOCK = 1 - GRND_RANDOM = 2 - HUPCL = 0x0100 // Hang up on last close - IN_CLOEXEC = 0x00001000 - IN_NONBLOCK = 0x00000004 - IN_ACCESS = 0x00000001 - IN_MODIFY = 0x00000002 - IN_ATTRIB = 0x00000004 - IN_CLOSE_WRITE = 0x00000008 - IN_CLOSE_NOWRITE = 0x00000010 - IN_OPEN = 0x00000020 - IN_MOVED_FROM = 0x00000040 - IN_MOVED_TO = 0x00000080 - IN_CREATE = 0x00000100 - IN_DELETE = 0x00000200 - IN_DELETE_SELF = 0x00000400 - IN_MOVE_SELF = 0x00000800 - IN_UNMOUNT = 0x00002000 - IN_Q_OVERFLOW = 0x00004000 - IN_IGNORED = 0x00008000 - IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) - IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO) - IN_ALL_EVENTS = (IN_ACCESS | IN_MODIFY | IN_ATTRIB | - IN_CLOSE | IN_OPEN | IN_MOVE | - IN_CREATE | IN_DELETE | IN_DELETE_SELF | - IN_MOVE_SELF) - IN_ONLYDIR = 0x01000000 - IN_DONT_FOLLOW = 0x02000000 - IN_EXCL_UNLINK = 0x04000000 - IN_MASK_CREATE = 0x10000000 - IN_MASK_ADD = 0x20000000 - IN_ISDIR = 0x40000000 - IN_ONESHOT = 0x80000000 + BRKINT = 0x0001 + CLOCK_MONOTONIC = 0x1 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_THREAD_CPUTIME_ID = 0x3 + CS8 = 0x0030 + CSIZE = 0x0030 + ECHO = 0x00000008 + ECHONL = 0x00000001 + FD_CLOEXEC = 0x01 + FD_CLOFORK = 0x02 + FNDELAY = 0x04 + F_CLOSFD = 9 + F_CONTROL_CVT = 13 + F_DUPFD = 0 + F_DUPFD2 = 8 + F_GETFD = 1 + F_GETFL = 259 + F_GETLK = 5 + F_GETOWN = 10 + F_OK = 0x0 + F_RDLCK = 1 + F_SETFD = 2 + F_SETFL = 4 + F_SETLK = 6 + F_SETLKW = 7 + F_SETOWN = 11 + F_SETTAG = 12 + F_UNLCK = 3 + F_WRLCK = 2 + FSTYPE_ZFS = 0xe9 //"Z" + FSTYPE_HFS = 0xc8 //"H" + FSTYPE_NFS = 0xd5 //"N" + FSTYPE_TFS = 0xe3 //"T" + FSTYPE_AUTOMOUNT = 0xc1 //"A" IP6F_MORE_FRAG = 0x0001 IP6F_OFF_MASK = 0xfff8 IP6F_RESERVED_MASK = 0x0006 @@ -210,18 +152,10 @@ const ( IP_PKTINFO = 101 IP_RECVPKTINFO = 102 IP_TOS = 2 - IP_TTL = 14 + IP_TTL = 3 IP_UNBLOCK_SOURCE = 11 - ICMP6_FILTER = 1 - MCAST_INCLUDE = 0 - MCAST_EXCLUDE = 1 - MCAST_JOIN_GROUP = 40 - MCAST_LEAVE_GROUP = 41 - MCAST_JOIN_SOURCE_GROUP = 42 - MCAST_LEAVE_SOURCE_GROUP = 43 - MCAST_BLOCK_SOURCE = 44 - MCAST_UNBLOCK_SOURCE = 46 ICANON = 0x0010 + ICMP6_FILTER = 0x26 ICRNL = 0x0002 IEXTEN = 0x0020 IGNBRK = 0x0004 @@ -231,10 +165,10 @@ const ( ISTRIP = 0x0080 IXON = 0x0200 IXOFF = 0x0100 - LOCK_SH = 0x1 - LOCK_EX = 0x2 - LOCK_NB = 0x4 - LOCK_UN = 0x8 + LOCK_SH = 0x1 // Not exist on zOS + LOCK_EX = 0x2 // Not exist on zOS + LOCK_NB = 0x4 // Not exist on zOS + LOCK_UN = 0x8 // Not exist on zOS POLLIN = 0x0003 POLLOUT = 0x0004 POLLPRI = 0x0010 @@ -248,29 +182,15 @@ const ( MAP_PRIVATE = 0x1 // changes are private MAP_SHARED = 0x2 // changes are shared MAP_FIXED = 0x4 // place exactly - __MAP_MEGA = 0x8 - __MAP_64 = 0x10 - MAP_ANON = 0x20 - MAP_ANONYMOUS = 0x20 + MCAST_JOIN_GROUP = 40 + MCAST_LEAVE_GROUP = 41 + MCAST_JOIN_SOURCE_GROUP = 42 + MCAST_LEAVE_SOURCE_GROUP = 43 + MCAST_BLOCK_SOURCE = 44 + MCAST_UNBLOCK_SOURCE = 45 MS_SYNC = 0x1 // msync - synchronous writes MS_ASYNC = 0x2 // asynchronous writes MS_INVALIDATE = 0x4 // invalidate mappings - MS_BIND = 0x00001000 - MS_MOVE = 0x00002000 - MS_NOSUID = 0x00000002 - MS_PRIVATE = 0x00040000 - MS_REC = 0x00004000 - MS_REMOUNT = 0x00008000 - MS_RDONLY = 0x00000001 - MS_UNBINDABLE = 0x00020000 - MNT_DETACH = 0x00000004 - ZOSDSFS_SUPER_MAGIC = 0x44534653 // zOS DSFS - NFS_SUPER_MAGIC = 0x6969 // NFS - NSFS_MAGIC = 0x6e736673 // PROCNS - PROC_SUPER_MAGIC = 0x9fa0 // proc FS - ZOSTFS_SUPER_MAGIC = 0x544653 // zOS TFS - ZOSUFS_SUPER_MAGIC = 0x554653 // zOS UFS - ZOSZFS_SUPER_MAGIC = 0x5A4653 // zOS ZFS MTM_RDONLY = 0x80000000 MTM_RDWR = 0x40000000 MTM_UMOUNT = 0x10000000 @@ -285,20 +205,13 @@ const ( MTM_REMOUNT = 0x00000100 MTM_NOSECURITY = 0x00000080 NFDBITS = 0x20 - ONLRET = 0x0020 // NL performs CR function O_ACCMODE = 0x03 O_APPEND = 0x08 O_ASYNCSIG = 0x0200 O_CREAT = 0x80 - O_DIRECT = 0x00002000 - O_NOFOLLOW = 0x00004000 - O_DIRECTORY = 0x00008000 - O_PATH = 0x00080000 - O_CLOEXEC = 0x00001000 O_EXCL = 0x40 O_GETFL = 0x0F O_LARGEFILE = 0x0400 - O_NDELAY = 0x4 O_NONBLOCK = 0x04 O_RDONLY = 0x02 O_RDWR = 0x03 @@ -335,7 +248,6 @@ const ( AF_IUCV = 17 AF_LAT = 14 AF_LINK = 18 - AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX AF_MAX = 30 AF_NBS = 7 AF_NDD = 23 @@ -373,33 +285,15 @@ const ( RLIMIT_AS = 5 RLIMIT_NOFILE = 6 RLIMIT_MEMLIMIT = 7 - RLIMIT_MEMLOCK = 0x8 RLIM_INFINITY = 2147483647 - SCHED_FIFO = 0x2 - SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x01 SF_CLOSE = 0x00000002 SF_REUSE = 0x00000001 - SHM_RND = 0x2 - SHM_RDONLY = 0x1 - SHMLBA = 0x1000 - IPC_STAT = 0x3 - IPC_SET = 0x2 - IPC_RMID = 0x1 - IPC_PRIVATE = 0x0 - IPC_CREAT = 0x1000000 - __IPC_MEGA = 0x4000000 - __IPC_SHAREAS = 0x20000000 - __IPC_BELOWBAR = 0x10000000 - IPC_EXCL = 0x2000000 - __IPC_GIGA = 0x8000000 SHUT_RD = 0 SHUT_RDWR = 2 SHUT_WR = 1 - SOCK_CLOEXEC = 0x00001000 SOCK_CONN_DGRAM = 6 SOCK_DGRAM = 2 - SOCK_NONBLOCK = 0x800 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 @@ -484,6 +378,8 @@ const ( S_IFMST = 0x00FF0000 TCP_KEEPALIVE = 0x8 TCP_NODELAY = 0x1 + TCP_INFO = 0xb + TCP_USER_TIMEOUT = 0x1 TIOCGWINSZ = 0x4008a368 TIOCSWINSZ = 0x8008a367 TIOCSBRK = 0x2000a77b @@ -531,10 +427,7 @@ const ( VSUSP = 9 VTIME = 10 WCONTINUED = 0x4 - WEXITED = 0x8 WNOHANG = 0x1 - WNOWAIT = 0x20 - WSTOPPED = 0x10 WUNTRACED = 0x2 _BPX_SWAP = 1 _BPX_NONSWAP = 2 @@ -559,30 +452,8 @@ const ( MADV_FREE = 15 // for Linux compatibility -- no zos semantics MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics - AT_SYMLINK_FOLLOW = 0x400 - AT_SYMLINK_NOFOLLOW = 0x100 - XATTR_CREATE = 0x1 - XATTR_REPLACE = 0x2 - P_PID = 0 - P_PGID = 1 - P_ALL = 2 - PR_SET_NAME = 15 - PR_GET_NAME = 16 - PR_SET_NO_NEW_PRIVS = 38 - PR_GET_NO_NEW_PRIVS = 39 - PR_SET_DUMPABLE = 4 - PR_GET_DUMPABLE = 3 - PR_SET_PDEATHSIG = 1 - PR_GET_PDEATHSIG = 2 - PR_SET_CHILD_SUBREAPER = 36 - PR_GET_CHILD_SUBREAPER = 37 - AT_FDCWD = -100 - AT_EACCESS = 0x200 - AT_EMPTY_PATH = 0x1000 - AT_REMOVEDIR = 0x200 - RENAME_NOREPLACE = 1 << 0 - ST_RDONLY = 1 - ST_NOSUID = 2 + AT_SYMLINK_NOFOLLOW = 1 // for Unix compatibility -- no zos semantics + AT_FDCWD = 2 // for Unix compatibility -- no zos semantics ) const ( @@ -605,7 +476,6 @@ const ( EMLINK = Errno(125) ENAMETOOLONG = Errno(126) ENFILE = Errno(127) - ENOATTR = Errno(265) ENODEV = Errno(128) ENOENT = Errno(129) ENOEXEC = Errno(130) @@ -830,7 +700,7 @@ var errorList = [...]struct { {145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."}, {146, "EDC5146I", "Too many levels of symbolic links."}, {147, "EDC5147I", "Illegal byte sequence."}, - {148, "EDC5148I", "The named attribute or data not available."}, + {148, "", ""}, {149, "EDC5149I", "Value Overflow Error."}, {150, "EDC5150I", "UNIX System Services is not active."}, {151, "EDC5151I", "Dynamic allocation error."}, @@ -873,7 +743,6 @@ var errorList = [...]struct { {259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."}, {260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."}, {262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."}, - {265, "EDC5265I", "The named attribute not available."}, {1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."}, {1001, "EDC8001I", "An error was found in the IUCV header."}, {1002, "EDC8002I", "A socket descriptor is out of range."}, diff --git a/upstream/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s b/upstream/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s deleted file mode 100644 index b77ff5db90d..00000000000 --- a/upstream/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s +++ /dev/null @@ -1,364 +0,0 @@ -// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s -// Code generated by the command above; see README.md. DO NOT EDIT. - -//go:build zos && s390x -#include "textflag.h" - -// provide the address of function variable to be fixed up. - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Flistxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fremovexattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fgetxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fsetxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_accept4Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·accept4(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_RemovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Removexattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_Dup3Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Dup3(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_DirfdAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Dirfd(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EpollCreateAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·EpollCreate(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EpollCreate1Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·EpollCreate1(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EpollCtlAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·EpollCtl(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EpollPwaitAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·EpollPwait(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EpollWaitAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·EpollWait(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_EventfdAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Eventfd(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FaccessatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Faccessat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FchmodatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fchmodat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FchownatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fchownat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FdatasyncAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fdatasync(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_fstatatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·fstatat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Lgetxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Lsetxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FstatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Fstatfs(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Futimes(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_FutimesatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Futimesat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_GetrandomAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Getrandom(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_InotifyInitAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·InotifyInit(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_InotifyInit1Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·InotifyInit1(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_InotifyAddWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·InotifyAddWatch(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_InotifyRmWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·InotifyRmWatch(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_ListxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Listxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Llistxattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Lremovexattr(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Lutimes(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_StatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Statfs(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_SyncfsAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Syncfs(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_UnshareAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Unshare(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_LinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Linkat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_MkdiratAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Mkdirat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_MknodatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Mknodat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_PivotRootAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·PivotRoot(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_PrctlAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Prctl(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_PrlimitAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Prlimit(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_RenameatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Renameat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_Renameat2Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Renameat2(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_SethostnameAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Sethostname(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_SetnsAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Setns(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_SymlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Symlinkat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_UnlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·Unlinkat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_openatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·openat(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_openat2Addr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·openat2(SB), R8 - MOVD R8, ret+0(FP) - RET - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -TEXT ·get_utimensatAddr(SB), NOSPLIT|NOFRAME, $0-8 - MOVD $·utimensat(SB), R8 - MOVD R8, ret+0(FP) - RET diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 24b346e1a35..ccb02f240a4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -740,54 +740,6 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func renamexNp(from string, to string, flag uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) - if err != nil { - return - } - _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_renamex_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_renameatx_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -808,59 +760,6 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pthread_chdir_np(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_pthread_chdir_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pthread_fchdir_np(fd int) (err error) { - _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_pthread_fchdir_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { - var _p0 unsafe.Pointer - if len(iov) > 0 { - _p0 = unsafe.Pointer(&iov[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_connectx_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index ebd213100b3..8b8bb284028 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -223,36 +223,11 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) -TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_renamex_np(SB) -GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) - -TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_renameatx_np(SB) -GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) - TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) -TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_pthread_chdir_np(SB) -GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) - -TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_pthread_fchdir_np(SB) -GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) - -TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_connectx(SB) -GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 -DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) - TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 824b9c2d5e0..1b40b997b52 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -740,54 +740,6 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func renamexNp(from string, to string, flag uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) - if err != nil { - return - } - _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_renamex_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_renameatx_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -808,59 +760,6 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pthread_chdir_np(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_pthread_chdir_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pthread_fchdir_np(fd int) (err error) { - _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_pthread_fchdir_np_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { - var _p0 unsafe.Pointer - if len(iov) > 0 { - _p0 = unsafe.Pointer(&iov[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_connectx_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 4f178a22934..08362c1ab74 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -223,36 +223,11 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) -TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_renamex_np(SB) -GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) - -TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_renameatx_np(SB) -GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) - TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) -TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_pthread_chdir_np(SB) -GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) - -TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_pthread_fchdir_np(SB) -GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 -DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) - -TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_connectx(SB) -GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 -DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) - TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 5cc1e8eb2f3..87d8612a1dc 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -592,16 +592,6 @@ func ClockGettime(clockid int32, time *Timespec) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ClockSettime(clockid int32, time *Timespec) (err error) { - _, _, e1 := Syscall(SYS_CLOCK_SETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) { _, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0) if e1 != 0 { @@ -981,6 +971,23 @@ func Getpriority(which int, who int) (prio int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Getrandom(buf []byte, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { @@ -2222,19 +2229,3 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) } return } - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Mseal(b []byte, flags uint) (err error) { - var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 1851df14e87..9dc42410b78 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 0b43c693656..41b5617316c 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 -DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index e1ec0dbe4ec..0d3a0751cd4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 880c6d6e316..4019a656f6d 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 -DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 7c8452a63e9..c39f7776db3 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index b8ef95b0fa1..ac4af24f908 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 -DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 2ffdf861f75..57571d072fe 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index 2af3b5c762f..f77d532121b 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 -DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 1da08d52675..e62963e67e2 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index b7a251353b0..fae140b62c9 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 -DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 6e85b0aac95..00831354c82 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index f15dadf0552..9d1e0ff06d0 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -555,12 +555,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - CALL libc_mount(SB) - RET -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 -DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_nanosleep(SB) RET diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 28b487df251..79029ed5848 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1493,30 +1493,6 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(fsType) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(dir) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_mount_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_mount mount "libc.so" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 1e7f321e436..da115f9a4b6 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -463,11 +463,6 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) -TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_mount(SB) -GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 -DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) - TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/upstream/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/upstream/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go index 7ccf66b7ee0..94f01123831 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go @@ -1,4 +1,4 @@ -// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s +// go run mksyscall.go -tags zos,s390x syscall_zos_s390x.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x @@ -6,100 +6,17 @@ package unix import ( - "runtime" - "syscall" "unsafe" ) -var _ syscall.Errno - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Flistxattr(fd int, dest []byte) (sz int, err error) { - var _p0 unsafe.Pointer - if len(dest) > 0 { - _p0 = unsafe.Pointer(&dest[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FLISTXATTR_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(dest))) - runtime.ExitSyscall() - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FlistxattrAddr() *(func(fd int, dest []byte) (sz int, err error)) - -var Flistxattr = enter_Flistxattr - -func enter_Flistxattr(fd int, dest []byte) (sz int, err error) { - funcref := get_FlistxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___FLISTXATTR_A<<4, "") == 0 { - *funcref = impl_Flistxattr - } else { - *funcref = error_Flistxattr - } - return (*funcref)(fd, dest) -} - -func error_Flistxattr(fd int, dest []byte) (sz int, err error) { - sz = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fremovexattr(fd int, attr string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(attr) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FremovexattrAddr() *(func(fd int, attr string) (err error)) - -var Fremovexattr = enter_Fremovexattr - -func enter_Fremovexattr(fd int, attr string) (err error) { - funcref := get_FremovexattrAddr() - if funcptrtest(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, "") == 0 { - *funcref = impl_Fremovexattr - } else { - *funcref = error_Fremovexattr + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(fd, attr) -} - -func error_Fremovexattr(fd int, attr string) (err error) { - err = ENOSYS return } @@ -112,12 +29,10 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_READ<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -131,159 +46,31 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(attr) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FGETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - runtime.ExitSyscall() - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FgetxattrAddr() *(func(fd int, attr string, dest []byte) (sz int, err error)) - -var Fgetxattr = enter_Fgetxattr - -func enter_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { - funcref := get_FgetxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___FGETXATTR_A<<4, "") == 0 { - *funcref = impl_Fgetxattr - } else { - *funcref = error_Fgetxattr - } - return (*funcref)(fd, attr, dest) -} - -func error_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { - sz = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(attr) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(data) > 0 { - _p1 = unsafe.Pointer(&data[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(data)), uintptr(flag)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FsetxattrAddr() *(func(fd int, attr string, data []byte, flag int) (err error)) - -var Fsetxattr = enter_Fsetxattr - -func enter_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { - funcref := get_FsetxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___FSETXATTR_A<<4, "") == 0 { - *funcref = impl_Fsetxattr - } else { - *funcref = error_Fsetxattr + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(fd, attr, data, flag) -} - -func error_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT4_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS___ACCEPT_A, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_accept4Addr() *(func(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)) - -var accept4 = enter_accept4 - -func enter_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { - funcref := get_accept4Addr() - if funcptrtest(GetZosLibVec()+SYS___ACCEPT4_A<<4, "") == 0 { - *funcref = impl_accept4 - } else { - *funcref = error_accept4 + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(s, rsa, addrlen, flags) -} - -func error_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { - fd = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___BIND_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___BIND_A, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -291,11 +78,9 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONNECT_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___CONNECT_A, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -303,10 +88,10 @@ func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) + r0, _, e1 := syscall_rawsyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -314,9 +99,9 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -324,11 +109,9 @@ func setgroups(n int, list *_Gid_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -336,11 +119,9 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -348,10 +129,10 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKET<<4, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawsyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -359,9 +140,9 @@ func socket(domain int, typ int, proto int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKETPAIR<<4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -369,9 +150,9 @@ func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETPEERNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS___GETPEERNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -379,52 +160,10 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETSOCKNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Removexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(attr) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_RemovexattrAddr() *(func(path string, attr string) (err error)) - -var Removexattr = enter_Removexattr - -func enter_Removexattr(path string, attr string) (err error) { - funcref := get_RemovexattrAddr() - if funcptrtest(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, "") == 0 { - *funcref = impl_Removexattr - } else { - *funcref = error_Removexattr + _, _, e1 := syscall_rawsyscall(SYS___GETSOCKNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(path, attr) -} - -func error_Removexattr(path string, attr string) (err error) { - err = ENOSYS return } @@ -437,12 +176,10 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVFROM_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall6(SYS___RECVFROM_A, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -456,11 +193,9 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDTO_A<<4, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall6(SYS___SENDTO_A, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -468,12 +203,10 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS___RECVMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -481,12 +214,10 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS___SENDMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -494,12 +225,10 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MMAP<<4, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -507,11 +236,9 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MUNMAP<<4, uintptr(addr), uintptr(length)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -519,11 +246,9 @@ func munmap(addr uintptr, length uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req int, arg uintptr) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -531,62 +256,9 @@ func ioctl(fd int, req int, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMAT<<4, uintptr(id), uintptr(addr), uintptr(flag)) - runtime.ExitSyscall() - ret = uintptr(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMCTL64<<4, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) - runtime.ExitSyscall() - result = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func shmdt(addr uintptr) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMDT<<4, uintptr(addr)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func shmget(key int, size int, flag int) (id int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMGET<<4, uintptr(key), uintptr(size), uintptr(flag)) - runtime.ExitSyscall() - id = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -599,11 +271,9 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCESS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___ACCESS_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -616,11 +286,9 @@ func Chdir(path string) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHDIR_A<<4, uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___CHDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -633,11 +301,9 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___CHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -650,11 +316,9 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHMOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___CHMOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -667,12 +331,10 @@ func Creat(path string, mode uint32) (fd int, err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CREAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS___CREAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -680,12 +342,10 @@ func Creat(path string, mode uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP<<4, uintptr(oldfd)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -693,2216 +353,617 @@ func Dup(oldfd int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP2<<4, uintptr(oldfd), uintptr(newfd)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Dup3(oldfd int, newfd int, flags int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP3<<4, uintptr(oldfd), uintptr(newfd), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } +func Errno2() (er2 int) { + uer2, _, _ := syscall_syscall(SYS___ERRNO2, 0, 0, 0) + er2 = int(uer2) return } -//go:nosplit -func get_Dup3Addr() *(func(oldfd int, newfd int, flags int) (err error)) - -var Dup3 = enter_Dup3 +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Dup3(oldfd int, newfd int, flags int) (err error) { - funcref := get_Dup3Addr() - if funcptrtest(GetZosLibVec()+SYS_DUP3<<4, "") == 0 { - *funcref = impl_Dup3 - } else { - *funcref = error_Dup3 - } - return (*funcref)(oldfd, newfd, flags) +func Err2ad() (eadd *int) { + ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0) + eadd = (*int)(unsafe.Pointer(ueadd)) + return } -func error_Dup3(oldfd int, newfd int, flags int) (err error) { - err = ENOSYS +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + syscall_syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Dirfd(dirp uintptr) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DIRFD<<4, uintptr(dirp)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Fchdir(fd int) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_DirfdAddr() *(func(dirp uintptr) (fd int, err error)) - -var Dirfd = enter_Dirfd +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Dirfd(dirp uintptr) (fd int, err error) { - funcref := get_DirfdAddr() - if funcptrtest(GetZosLibVec()+SYS_DIRFD<<4, "") == 0 { - *funcref = impl_Dirfd - } else { - *funcref = error_Dirfd +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(dirp) -} - -func error_Dirfd(dirp uintptr) (fd int, err error) { - fd = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_EpollCreate(size int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE<<4, uintptr(size)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Fchown(fd int, uid int, gid int) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_EpollCreateAddr() *(func(size int) (fd int, err error)) - -var EpollCreate = enter_EpollCreate +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_EpollCreate(size int) (fd int, err error) { - funcref := get_EpollCreateAddr() - if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE<<4, "") == 0 { - *funcref = impl_EpollCreate - } else { - *funcref = error_EpollCreate +func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { + r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + retval = int(r0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(size) -} - -func error_EpollCreate(size int) (fd int, err error) { - fd = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_EpollCreate1(flags int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, uintptr(flags)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func fstat(fd int, stat *Stat_LE_t) (err error) { + _, _, e1 := syscall_syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_EpollCreate1Addr() *(func(flags int) (fd int, err error)) - -var EpollCreate1 = enter_EpollCreate1 +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_EpollCreate1(flags int) (fd int, err error) { - funcref := get_EpollCreate1Addr() - if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, "") == 0 { - *funcref = impl_EpollCreate1 - } else { - *funcref = error_EpollCreate1 +func Fstatvfs(fd int, stat *Statvfs_t) (err error) { + _, _, e1 := syscall_syscall(SYS_FSTATVFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(flags) -} - -func error_EpollCreate1(flags int) (fd int, err error) { - fd = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CTL<<4, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Fsync(fd int) (err error) { + _, _, e1 := syscall_syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_EpollCtlAddr() *(func(epfd int, op int, fd int, event *EpollEvent) (err error)) - -var EpollCtl = enter_EpollCtl +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { - funcref := get_EpollCtlAddr() - if funcptrtest(GetZosLibVec()+SYS_EPOLL_CTL<<4, "") == 0 { - *funcref = impl_EpollCtl - } else { - *funcref = error_EpollCtl +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := syscall_syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(epfd, op, fd, event) + return } -func error_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { - err = ENOSYS +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpagesize() (pgsize int) { + r0, _, _ := syscall_syscall(SYS_GETPAGESIZE, 0, 0, 0) + pgsize = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { +func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), uintptr(unsafe.Pointer(sigmask))) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_EpollPwaitAddr() *(func(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error)) - -var EpollPwait = enter_EpollPwait +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { - funcref := get_EpollPwaitAddr() - if funcptrtest(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, "") == 0 { - *funcref = impl_EpollPwait +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) } else { - *funcref = error_EpollPwait + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(epfd, events, msec, sigmask) -} - -func error_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { - n = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { +func Poll(fds []PollFd, timeout int) (n int, err error) { var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) + if len(fds) > 0 { + _p0 = unsafe.Pointer(&fds[0]) } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_WAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_POLL, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_EpollWaitAddr() *(func(epfd int, events []EpollEvent, msec int) (n int, err error)) - -var EpollWait = enter_EpollWait - -func enter_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - funcref := get_EpollWaitAddr() - if funcptrtest(GetZosLibVec()+SYS_EPOLL_WAIT<<4, "") == 0 { - *funcref = impl_EpollWait - } else { - *funcref = error_EpollWait + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(epfd, events, msec) -} - -func error_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - n = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Errno2() (er2 int) { - runtime.EnterSyscall() - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERRNO2<<4) - runtime.ExitSyscall() - er2 = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Eventfd(initval uint, flags int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EVENTFD<<4, uintptr(initval), uintptr(flags)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Times(tms *Tms) (ticks uintptr, err error) { + r0, _, e1 := syscall_syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + ticks = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_EventfdAddr() *(func(initval uint, flags int) (fd int, err error)) - -var Eventfd = enter_Eventfd +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Eventfd(initval uint, flags int) (fd int, err error) { - funcref := get_EventfdAddr() - if funcptrtest(GetZosLibVec()+SYS_EVENTFD<<4, "") == 0 { - *funcref = impl_Eventfd - } else { - *funcref = error_Eventfd +func W_Getmntent(buff *byte, size int) (lastsys int, err error) { + r0, _, e1 := syscall_syscall(SYS_W_GETMNTENT, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) + lastsys = int(r0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(initval, flags) -} - -func error_Eventfd(initval uint, flags int) (fd int, err error) { - fd = -1 - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Exit(code int) { - runtime.EnterSyscall() - CallLeFuncWithErr(GetZosLibVec()+SYS_EXIT<<4, uintptr(code)) - runtime.ExitSyscall() +func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { + r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) + lastsys = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { +func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FACCESSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + var _p1 *byte + _p1, err = BytePtrFromString(filesystem) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(fstype) + if err != nil { + return + } + var _p3 *byte + _p3, err = BytePtrFromString(parm) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(SYS___MOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_FaccessatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -var Faccessat = enter_Faccessat - -func enter_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { - funcref := get_FaccessatAddr() - if funcptrtest(GetZosLibVec()+SYS___FACCESSAT_A<<4, "") == 0 { - *funcref = impl_Faccessat - } else { - *funcref = error_Faccessat - } - return (*funcref)(dirfd, path, mode, flags) -} - -func error_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fchdir(fd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHDIR<<4, uintptr(fd)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fchmod(fd int, mode uint32) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHMOD<<4, uintptr(fd), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHMODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FchmodatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) - -var Fchmodat = enter_Fchmodat - -func enter_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - funcref := get_FchmodatAddr() - if funcptrtest(GetZosLibVec()+SYS___FCHMODAT_A<<4, "") == 0 { - *funcref = impl_Fchmodat - } else { - *funcref = error_Fchmodat - } - return (*funcref)(dirfd, path, mode, flags) -} - -func error_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fchown(fd int, uid int, gid int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHOWN<<4, uintptr(fd), uintptr(uid), uintptr(gid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHOWNAT_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FchownatAddr() *(func(fd int, path string, uid int, gid int, flags int) (err error)) - -var Fchownat = enter_Fchownat - -func enter_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { - funcref := get_FchownatAddr() - if funcptrtest(GetZosLibVec()+SYS___FCHOWNAT_A<<4, "") == 0 { - *funcref = impl_Fchownat - } else { - *funcref = error_Fchownat - } - return (*funcref)(fd, path, uid, gid, flags) -} - -func error_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) - runtime.ExitSyscall() - retval = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fdatasync(fd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FDATASYNC<<4, uintptr(fd)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FdatasyncAddr() *(func(fd int) (err error)) - -var Fdatasync = enter_Fdatasync - -func enter_Fdatasync(fd int) (err error) { - funcref := get_FdatasyncAddr() - if funcptrtest(GetZosLibVec()+SYS_FDATASYNC<<4, "") == 0 { - *funcref = impl_Fdatasync - } else { - *funcref = error_Fdatasync - } - return (*funcref)(fd) -} - -func error_Fdatasync(fd int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func fstat(fd int, stat *Stat_LE_t) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTAT<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSTATAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_fstatatAddr() *(func(dirfd int, path string, stat *Stat_LE_t, flags int) (err error)) - -var fstatat = enter_fstatat - -func enter_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { - funcref := get_fstatatAddr() - if funcptrtest(GetZosLibVec()+SYS___FSTATAT_A<<4, "") == 0 { - *funcref = impl_fstatat - } else { - *funcref = error_fstatat - } - return (*funcref)(dirfd, path, stat, flags) -} - -func error_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { +func unmount(filesystem string, mtm int) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(link) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(attr) + _p0, err = BytePtrFromString(filesystem) if err != nil { return } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LGETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) - runtime.ExitSyscall() - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___UMOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mtm), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_LgetxattrAddr() *(func(link string, attr string, dest []byte) (sz int, err error)) - -var Lgetxattr = enter_Lgetxattr - -func enter_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { - funcref := get_LgetxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___LGETXATTR_A<<4, "") == 0 { - *funcref = impl_Lgetxattr - } else { - *funcref = error_Lgetxattr - } - return (*funcref)(link, attr, dest) -} - -func error_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { - sz = -1 - err = ENOSYS - return -} - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { +func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - var _p1 *byte - _p1, err = BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_LsetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) - -var Lsetxattr = enter_Lsetxattr - -func enter_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { - funcref := get_LsetxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___LSETXATTR_A<<4, "") == 0 { - *funcref = impl_Lsetxattr - } else { - *funcref = error_Lsetxattr - } - return (*funcref)(path, attr, data, flags) -} - -func error_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Fstatfs(fd int, buf *Statfs_t) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATFS<<4, uintptr(fd), uintptr(unsafe.Pointer(buf))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FstatfsAddr() *(func(fd int, buf *Statfs_t) (err error)) - -var Fstatfs = enter_Fstatfs - -func enter_Fstatfs(fd int, buf *Statfs_t) (err error) { - funcref := get_FstatfsAddr() - if funcptrtest(GetZosLibVec()+SYS_FSTATFS<<4, "") == 0 { - *funcref = impl_Fstatfs - } else { - *funcref = error_Fstatfs - } - return (*funcref)(fd, buf) -} - -func error_Fstatfs(fd int, buf *Statfs_t) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstatvfs(fd int, stat *Statvfs_t) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATVFS<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___CHROOT_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fsync(fd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSYNC<<4, uintptr(fd)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Uname(buf *Utsname) (err error) { + _, _, e1 := syscall_rawsyscall(SYS___UNAME_A, uintptr(unsafe.Pointer(buf)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Futimes(fd int, tv []Timeval) (err error) { +func Gethostname(buf []byte) (err error) { var _p0 unsafe.Pointer - if len(tv) > 0 { - _p0 = unsafe.Pointer(&tv[0]) + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FUTIMES<<4, uintptr(fd), uintptr(_p0), uintptr(len(tv))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FutimesAddr() *(func(fd int, tv []Timeval) (err error)) - -var Futimes = enter_Futimes - -func enter_Futimes(fd int, tv []Timeval) (err error) { - funcref := get_FutimesAddr() - if funcptrtest(GetZosLibVec()+SYS_FUTIMES<<4, "") == 0 { - *funcref = impl_Futimes - } else { - *funcref = error_Futimes + _, _, e1 := syscall_syscall(SYS___GETHOSTNAME_A, uintptr(_p0), uintptr(len(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(fd, tv) -} - -func error_Futimes(fd int, tv []Timeval) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Futimesat(dirfd int, path string, tv []Timeval) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(tv) > 0 { - _p1 = unsafe.Pointer(&tv[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FUTIMESAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_FutimesatAddr() *(func(dirfd int, path string, tv []Timeval) (err error)) - -var Futimesat = enter_Futimesat - -func enter_Futimesat(dirfd int, path string, tv []Timeval) (err error) { - funcref := get_FutimesatAddr() - if funcptrtest(GetZosLibVec()+SYS___FUTIMESAT_A<<4, "") == 0 { - *funcref = impl_Futimesat - } else { - *funcref = error_Futimesat - } - return (*funcref)(dirfd, path, tv) -} - -func error_Futimesat(dirfd int, path string, tv []Timeval) (err error) { - err = ENOSYS +func Getegid() (egid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Ftruncate(fd int, length int64) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FTRUNCATE<<4, uintptr(fd), uintptr(length)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } +func Geteuid() (uid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Getrandom(buf []byte, flags int) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRANDOM<<4, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_GetrandomAddr() *(func(buf []byte, flags int) (n int, err error)) - -var Getrandom = enter_Getrandom - -func enter_Getrandom(buf []byte, flags int) (n int, err error) { - funcref := get_GetrandomAddr() - if funcptrtest(GetZosLibVec()+SYS_GETRANDOM<<4, "") == 0 { - *funcref = impl_Getrandom - } else { - *funcref = error_Getrandom - } - return (*funcref)(buf, flags) -} - -func error_Getrandom(buf []byte, flags int) (n int, err error) { - n = -1 - err = ENOSYS +func Getgid() (gid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_InotifyInit() (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_INOTIFY_INIT<<4) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_InotifyInitAddr() *(func() (fd int, err error)) - -var InotifyInit = enter_InotifyInit - -func enter_InotifyInit() (fd int, err error) { - funcref := get_InotifyInitAddr() - if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT<<4, "") == 0 { - *funcref = impl_InotifyInit - } else { - *funcref = error_InotifyInit - } - return (*funcref)() -} - -func error_InotifyInit() (fd int, err error) { - fd = -1 - err = ENOSYS +func Getpid() (pid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_InotifyInit1(flags int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, uintptr(flags)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_InotifyInit1Addr() *(func(flags int) (fd int, err error)) - -var InotifyInit1 = enter_InotifyInit1 - -func enter_InotifyInit1(flags int) (fd int, err error) { - funcref := get_InotifyInit1Addr() - if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, "") == 0 { - *funcref = impl_InotifyInit1 - } else { - *funcref = error_InotifyInit1 - } - return (*funcref)(flags) -} - -func error_InotifyInit1(flags int) (fd int, err error) { - fd = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(pathname) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - runtime.ExitSyscall() - watchdesc = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_InotifyAddWatchAddr() *(func(fd int, pathname string, mask uint32) (watchdesc int, err error)) - -var InotifyAddWatch = enter_InotifyAddWatch - -func enter_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { - funcref := get_InotifyAddWatchAddr() - if funcptrtest(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, "") == 0 { - *funcref = impl_InotifyAddWatch - } else { - *funcref = error_InotifyAddWatch - } - return (*funcref)(fd, pathname, mask) -} - -func error_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { - watchdesc = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, uintptr(fd), uintptr(watchdesc)) - runtime.ExitSyscall() - success = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_InotifyRmWatchAddr() *(func(fd int, watchdesc uint32) (success int, err error)) - -var InotifyRmWatch = enter_InotifyRmWatch - -func enter_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { - funcref := get_InotifyRmWatchAddr() - if funcptrtest(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, "") == 0 { - *funcref = impl_InotifyRmWatch - } else { - *funcref = error_InotifyRmWatch - } - return (*funcref)(fd, watchdesc) -} - -func error_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { - success = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Listxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - runtime.ExitSyscall() - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_ListxattrAddr() *(func(path string, dest []byte) (sz int, err error)) - -var Listxattr = enter_Listxattr - -func enter_Listxattr(path string, dest []byte) (sz int, err error) { - funcref := get_ListxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___LISTXATTR_A<<4, "") == 0 { - *funcref = impl_Listxattr - } else { - *funcref = error_Listxattr - } - return (*funcref)(path, dest) -} - -func error_Listxattr(path string, dest []byte) (sz int, err error) { - sz = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LLISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - runtime.ExitSyscall() - sz = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_LlistxattrAddr() *(func(path string, dest []byte) (sz int, err error)) - -var Llistxattr = enter_Llistxattr - -func enter_Llistxattr(path string, dest []byte) (sz int, err error) { - funcref := get_LlistxattrAddr() - if funcptrtest(GetZosLibVec()+SYS___LLISTXATTR_A<<4, "") == 0 { - *funcref = impl_Llistxattr - } else { - *funcref = error_Llistxattr - } - return (*funcref)(path, dest) -} - -func error_Llistxattr(path string, dest []byte) (sz int, err error) { - sz = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(attr) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_LremovexattrAddr() *(func(path string, attr string) (err error)) - -var Lremovexattr = enter_Lremovexattr - -func enter_Lremovexattr(path string, attr string) (err error) { - funcref := get_LremovexattrAddr() - if funcptrtest(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, "") == 0 { - *funcref = impl_Lremovexattr - } else { - *funcref = error_Lremovexattr - } - return (*funcref)(path, attr) -} - -func error_Lremovexattr(path string, attr string) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Lutimes(path string, tv []Timeval) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(tv) > 0 { - _p1 = unsafe.Pointer(&tv[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LUTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_LutimesAddr() *(func(path string, tv []Timeval) (err error)) - -var Lutimes = enter_Lutimes - -func enter_Lutimes(path string, tv []Timeval) (err error) { - funcref := get_LutimesAddr() - if funcptrtest(GetZosLibVec()+SYS___LUTIMES_A<<4, "") == 0 { - *funcref = impl_Lutimes - } else { - *funcref = error_Lutimes - } - return (*funcref)(path, tv) -} - -func error_Lutimes(path string, tv []Timeval) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Mprotect(b []byte, prot int) (err error) { - var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MPROTECT<<4, uintptr(_p0), uintptr(len(b)), uintptr(prot)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Msync(b []byte, flags int) (err error) { - var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MSYNC<<4, uintptr(_p0), uintptr(len(b)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONSOLE2<<4, uintptr(unsafe.Pointer(cmsg)), uintptr(unsafe.Pointer(modstr)), uintptr(unsafe.Pointer(concmd))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Poll(fds []PollFd, timeout int) (n int, err error) { - var _p0 unsafe.Pointer - if len(fds) > 0 { - _p0 = unsafe.Pointer(&fds[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POLL<<4, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_R_A<<4, uintptr(dirp), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Statfs(path string, buf *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STATFS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_StatfsAddr() *(func(path string, buf *Statfs_t) (err error)) - -var Statfs = enter_Statfs - -func enter_Statfs(path string, buf *Statfs_t) (err error) { - funcref := get_StatfsAddr() - if funcptrtest(GetZosLibVec()+SYS___STATFS_A<<4, "") == 0 { - *funcref = impl_Statfs - } else { - *funcref = error_Statfs - } - return (*funcref)(path, buf) -} - -func error_Statfs(path string, buf *Statfs_t) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Syncfs(fd int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SYNCFS<<4, uintptr(fd)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_SyncfsAddr() *(func(fd int) (err error)) - -var Syncfs = enter_Syncfs - -func enter_Syncfs(fd int) (err error) { - funcref := get_SyncfsAddr() - if funcptrtest(GetZosLibVec()+SYS_SYNCFS<<4, "") == 0 { - *funcref = impl_Syncfs - } else { - *funcref = error_Syncfs - } - return (*funcref)(fd) -} - -func error_Syncfs(fd int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Times(tms *Tms) (ticks uintptr, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TIMES<<4, uintptr(unsafe.Pointer(tms))) - runtime.ExitSyscall() - ticks = uintptr(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func W_Getmntent(buff *byte, size int) (lastsys int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_GETMNTENT<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) - runtime.ExitSyscall() - lastsys = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___W_GETMNTENT_A<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) - runtime.ExitSyscall() - lastsys = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(filesystem) - if err != nil { - return - } - var _p2 *byte - _p2, err = BytePtrFromString(fstype) - if err != nil { - return - } - var _p3 *byte - _p3, err = BytePtrFromString(parm) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func unmount_LE(filesystem string, mtm int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(filesystem) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mtm)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Chroot(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHROOT_A<<4, uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SELECT<<4, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout))) - runtime.ExitSyscall() - ret = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Uname(buf *Utsname) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____OSNAME_A<<4, uintptr(unsafe.Pointer(buf))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Unshare(flags int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNSHARE<<4, uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_UnshareAddr() *(func(flags int) (err error)) - -var Unshare = enter_Unshare - -func enter_Unshare(flags int) (err error) { - funcref := get_UnshareAddr() - if funcptrtest(GetZosLibVec()+SYS_UNSHARE<<4, "") == 0 { - *funcref = impl_Unshare - } else { - *funcref = error_Unshare - } - return (*funcref)(flags) -} - -func error_Unshare(flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Gethostname(buf []byte) (err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(buf))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getgid() (gid int) { - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETGID<<4) - gid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getpid() (pid int) { - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPID<<4) - pid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getpgid(pid int) (pgid int, err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPGID<<4, uintptr(pid)) - pgid = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (pid int) { - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPPID<<4) - pid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getpriority(which int, who int) (prio int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPRIORITY<<4, uintptr(which), uintptr(who)) - runtime.ExitSyscall() - prio = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getrlimit(resource int, rlim *Rlimit) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(rlim))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func getrusage(who int, rusage *rusage_zos) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRUSAGE<<4, uintptr(who), uintptr(unsafe.Pointer(rusage))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getegid() (egid int) { - runtime.EnterSyscall() - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEGID<<4) - runtime.ExitSyscall() - egid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Geteuid() (euid int) { - runtime.EnterSyscall() - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEUID<<4) - runtime.ExitSyscall() - euid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getsid(pid int) (sid int, err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSID<<4, uintptr(pid)) - sid = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getuid() (uid int) { - r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETUID<<4) - uid = int(r0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Kill(pid int, sig Signal) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_KILL<<4, uintptr(pid), uintptr(sig)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Lchown(path string, uid int, gid int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LCHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Link(path string, link string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(link) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(oldPath) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(newPath) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINKAT_A<<4, uintptr(oldDirFd), uintptr(unsafe.Pointer(_p0)), uintptr(newDirFd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_LinkatAddr() *(func(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error)) - -var Linkat = enter_Linkat - -func enter_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { - funcref := get_LinkatAddr() - if funcptrtest(GetZosLibVec()+SYS___LINKAT_A<<4, "") == 0 { - *funcref = impl_Linkat - } else { - *funcref = error_Linkat - } - return (*funcref)(oldDirFd, oldPath, newDirFd, newPath, flags) -} - -func error_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Listen(s int, n int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LISTEN<<4, uintptr(s), uintptr(n)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lstat(path string, stat *Stat_LE_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSTAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Mkdir(path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Mkdirat(dirfd int, path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIRAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_MkdiratAddr() *(func(dirfd int, path string, mode uint32) (err error)) - -var Mkdirat = enter_Mkdirat - -func enter_Mkdirat(dirfd int, path string, mode uint32) (err error) { - funcref := get_MkdiratAddr() - if funcptrtest(GetZosLibVec()+SYS___MKDIRAT_A<<4, "") == 0 { - *funcref = impl_Mkdirat - } else { - *funcref = error_Mkdirat - } - return (*funcref)(dirfd, path, mode) -} - -func error_Mkdirat(dirfd int, path string, mode uint32) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Mkfifo(path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFO_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Mknod(path string, mode uint32, dev int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_MknodatAddr() *(func(dirfd int, path string, mode uint32, dev int) (err error)) - -var Mknodat = enter_Mknodat - -func enter_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { - funcref := get_MknodatAddr() - if funcptrtest(GetZosLibVec()+SYS___MKNODAT_A<<4, "") == 0 { - *funcref = impl_Mknodat - } else { - *funcref = error_Mknodat - } - return (*funcref)(dirfd, path, mode, dev) -} - -func error_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_PivotRoot(newroot string, oldroot string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(newroot) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(oldroot) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_PivotRootAddr() *(func(newroot string, oldroot string) (err error)) - -var PivotRoot = enter_PivotRoot - -func enter_PivotRoot(newroot string, oldroot string) (err error) { - funcref := get_PivotRootAddr() - if funcptrtest(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, "") == 0 { - *funcref = impl_PivotRoot - } else { - *funcref = error_PivotRoot - } - return (*funcref)(newroot, oldroot) -} - -func error_PivotRoot(newroot string, oldroot string) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Pread(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PREAD<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } + r0, _, _ := syscall_rawsyscall(SYS_GETPPID, 0, 0, 0) + pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PWRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) - runtime.ExitSyscall() - n = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := syscall_syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PRCTL_A<<4, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Getrlimit(resource int, rlim *Rlimit) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_PrctlAddr() *(func(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)) - -var Prctl = enter_Prctl +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { - funcref := get_PrctlAddr() - if funcptrtest(GetZosLibVec()+SYS___PRCTL_A<<4, "") == 0 { - *funcref = impl_Prctl - } else { - *funcref = error_Prctl +func getrusage(who int, rusage *rusage_zos) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(option, arg2, arg3, arg4, arg5) -} - -func error_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PRLIMIT<<4, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_PrlimitAddr() *(func(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error)) - -var Prlimit = enter_Prlimit +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { - funcref := get_PrlimitAddr() - if funcptrtest(GetZosLibVec()+SYS_PRLIMIT<<4, "") == 0 { - *funcref = impl_Prlimit - } else { - *funcref = error_Prlimit - } - return (*funcref)(pid, resource, newlimit, old) +func Getuid() (uid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return } -func error_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { - err = ENOSYS +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig Signal) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + if e1 != 0 { + err = errnoErr(e1) + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Rename(from string, to string) (err error) { +func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) + _p0, err = BytePtrFromString(path) if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___LCHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { +func Link(path string, link string) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(oldpath) + _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte - _p1, err = BytePtrFromString(newpath) + _p1, err = BytePtrFromString(link) if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___LINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_RenameatAddr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)) - -var Renameat = enter_Renameat +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { - funcref := get_RenameatAddr() - if funcptrtest(GetZosLibVec()+SYS___RENAMEAT_A<<4, "") == 0 { - *funcref = impl_Renameat - } else { - *funcref = error_Renameat +func Listen(s int, n int) (err error) { + _, _, e1 := syscall_syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(olddirfd, oldpath, newdirfd, newpath) -} - -func error_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { +func lstat(path string, stat *Stat_LE_t) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(oldpath) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(newpath) + _p0, err = BytePtrFromString(path) if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT2_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_Renameat2Addr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)) - -var Renameat2 = enter_Renameat2 - -func enter_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { - funcref := get_Renameat2Addr() - if funcptrtest(GetZosLibVec()+SYS___RENAMEAT2_A<<4, "") == 0 { - *funcref = impl_Renameat2 - } else { - *funcref = error_Renameat2 + _, _, e1 := syscall_syscall(SYS___LSTAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(olddirfd, oldpath, newdirfd, newpath, flags) -} - -func error_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Rmdir(path string) (err error) { +func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RMDIR_A<<4, uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___MKDIR_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Seek(fd int, offset int64, whence int) (off int64, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LSEEK<<4, uintptr(fd), uintptr(offset), uintptr(whence)) - runtime.ExitSyscall() - off = int64(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___MKFIFO_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setegid(egid int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEGID<<4, uintptr(egid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___MKNOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Seteuid(euid int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEUID<<4, uintptr(euid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Sethostname(p []byte) (err error) { +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(p))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + r0, _, e1 := syscall_syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_SethostnameAddr() *(func(p []byte) (err error)) - -var Sethostname = enter_Sethostname +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Sethostname(p []byte) (err error) { - funcref := get_SethostnameAddr() - if funcptrtest(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, "") == 0 { - *funcref = impl_Sethostname +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) } else { - *funcref = error_Sethostname + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(SYS___READLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(p) -} - -func error_Sethostname(p []byte) (err error) { - err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func impl_Setns(fd int, nstype int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETNS<<4, uintptr(fd), uintptr(nstype)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___RENAME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_SetnsAddr() *(func(fd int, nstype int) (err error)) - -var Setns = enter_Setns +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func enter_Setns(fd int, nstype int) (err error) { - funcref := get_SetnsAddr() - if funcptrtest(GetZosLibVec()+SYS_SETNS<<4, "") == 0 { - *funcref = impl_Setns - } else { - *funcref = error_Setns +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___RMDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(fd, nstype) + return } -func error_Setns(fd int, nstype int) (err error) { - err = ENOSYS +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, _, e1 := syscall_syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + off = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPRIORITY<<4, uintptr(which), uintptr(who), uintptr(prio)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2910,9 +971,9 @@ func Setpriority(which int, who int, prio int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPGID<<4, uintptr(pid), uintptr(pgid)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2920,9 +981,9 @@ func Setpgid(pid int, pgid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, lim *Rlimit) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(lim))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2930,9 +991,9 @@ func Setrlimit(resource int, lim *Rlimit) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREGID<<4, uintptr(rgid), uintptr(egid)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2940,9 +1001,9 @@ func Setregid(rgid int, egid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREUID<<4, uintptr(ruid), uintptr(euid)) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2950,10 +1011,10 @@ func Setreuid(ruid int, euid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_SETSID<<4) + r0, _, e1 := syscall_rawsyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2961,11 +1022,9 @@ func Setsid() (pid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETUID<<4, uintptr(uid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2973,11 +1032,9 @@ func Setuid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(uid int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGID<<4, uintptr(uid)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_SETGID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -2985,11 +1042,9 @@ func Setgid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHUTDOWN<<4, uintptr(fd), uintptr(how)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3002,11 +1057,9 @@ func stat(path string, statLE *Stat_LE_t) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___STAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3024,63 +1077,17 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(oldPath) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(newPath) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINKAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(dirfd), uintptr(unsafe.Pointer(_p1))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___SYMLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } -//go:nosplit -func get_SymlinkatAddr() *(func(oldPath string, dirfd int, newPath string) (err error)) - -var Symlinkat = enter_Symlinkat - -func enter_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { - funcref := get_SymlinkatAddr() - if funcptrtest(GetZosLibVec()+SYS___SYMLINKAT_A<<4, "") == 0 { - *funcref = impl_Symlinkat - } else { - *funcref = error_Symlinkat - } - return (*funcref)(oldPath, dirfd, newPath) -} - -func error_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { - err = ENOSYS - return -} - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { - runtime.EnterSyscall() - CallLeFuncWithErr(GetZosLibVec() + SYS_SYNC<<4) - runtime.ExitSyscall() + syscall_syscall(SYS_SYNC, 0, 0, 0) return } @@ -3092,11 +1099,9 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___TRUNCATE_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(length)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___TRUNCATE_A, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3104,11 +1109,9 @@ func Truncate(path string, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcgetattr(fildes int, termptr *Termios) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCGETATTR<<4, uintptr(fildes), uintptr(unsafe.Pointer(termptr))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_TCGETATTR, uintptr(fildes), uintptr(unsafe.Pointer(termptr)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3116,11 +1119,9 @@ func Tcgetattr(fildes int, termptr *Termios) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCSETATTR<<4, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_TCSETATTR, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3128,9 +1129,7 @@ func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { - runtime.EnterSyscall() - r0, _, _ := CallLeFuncWithErr(GetZosLibVec()+SYS_UMASK<<4, uintptr(mask)) - runtime.ExitSyscall() + r0, _, _ := syscall_syscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } @@ -3143,49 +1142,10 @@ func Unlink(path string) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINK_A<<4, uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_Unlinkat(dirfd int, path string, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_UnlinkatAddr() *(func(dirfd int, path string, flags int) (err error)) - -var Unlinkat = enter_Unlinkat - -func enter_Unlinkat(dirfd int, path string, flags int) (err error) { - funcref := get_UnlinkatAddr() - if funcptrtest(GetZosLibVec()+SYS___UNLINKAT_A<<4, "") == 0 { - *funcref = impl_Unlinkat - } else { - *funcref = error_Unlinkat + _, _, e1 := syscall_syscall(SYS___UNLINK_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(dirfd, path, flags) -} - -func error_Unlinkat(dirfd int, path string, flags int) (err error) { - err = ENOSYS return } @@ -3197,11 +1157,9 @@ func Utime(path string, utim *Utimbuf) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___UTIME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3214,91 +1172,11 @@ func open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPEN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_openatAddr() *(func(dirfd int, path string, flags int, mode uint32) (fd int, err error)) - -var openat = enter_openat - -func enter_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { - funcref := get_openatAddr() - if funcptrtest(GetZosLibVec()+SYS___OPENAT_A<<4, "") == 0 { - *funcref = impl_openat - } else { - *funcref = error_openat - } - return (*funcref)(dirfd, path, flags, mode) -} - -func error_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { - fd = -1 - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT2_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS___OPEN_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_openat2Addr() *(func(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error)) - -var openat2 = enter_openat2 - -func enter_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { - funcref := get_openat2Addr() - if funcptrtest(GetZosLibVec()+SYS___OPENAT2_A<<4, "") == 0 { - *funcref = impl_openat2 - } else { - *funcref = error_openat2 + if e1 != 0 { + err = errnoErr(e1) } - return (*funcref)(dirfd, path, open_how, size) -} - -func error_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { - fd = -1 - err = ENOSYS return } @@ -3310,23 +1188,9 @@ func remove(path string) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_REMOVE<<4, uintptr(unsafe.Pointer(_p0))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func waitid(idType int, id int, info *Siginfo, options int) (err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITID<<4, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3334,12 +1198,10 @@ func waitid(idType int, id int, info *Siginfo, options int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITPID<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) - runtime.ExitSyscall() + r0, _, e1 := syscall_syscall(SYS_WAITPID, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) wpid = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3347,9 +1209,9 @@ func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tv *timeval_zos) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETTIMEOFDAY<<4, uintptr(unsafe.Pointer(tv))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3357,9 +1219,9 @@ func gettimeofday(tv *timeval_zos) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE<<4, uintptr(unsafe.Pointer(p))) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_rawsyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) } return } @@ -3372,87 +1234,20 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval))) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func impl_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMENSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(ts)), uintptr(flags)) - runtime.ExitSyscall() - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -//go:nosplit -func get_utimensatAddr() *(func(dirfd int, path string, ts *[2]Timespec, flags int) (err error)) - -var utimensat = enter_utimensat - -func enter_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { - funcref := get_utimensatAddr() - if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { - *funcref = impl_utimensat - } else { - *funcref = error_utimensat - } - return (*funcref)(dirfd, path, ts, flags) -} - -func error_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { - err = ENOSYS - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Posix_openpt(oflag int) (fd int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POSIX_OPENPT<<4, uintptr(oflag)) - runtime.ExitSyscall() - fd = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) + _, _, e1 := syscall_syscall(SYS___UTIMES_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Grantpt(fildes int) (rc int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GRANTPT<<4, uintptr(fildes)) - runtime.ExitSyscall() - rc = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Unlockpt(fildes int) (rc int, err error) { - runtime.EnterSyscall() - r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNLOCKPT<<4, uintptr(fildes)) - runtime.ExitSyscall() - rc = int(r0) - if int64(r0) == -1 { - err = errnoErr2(e1, e2) +func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) { + r0, _, e1 := syscall_syscall6(SYS_SELECT, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) } return } diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 524b0820cbc..0cc3ce496e2 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -452,10 +452,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index f485dbf4565..856d92d69ef 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -341,7 +341,6 @@ const ( SYS_STATX = 332 SYS_IO_PGETEVENTS = 333 SYS_RSEQ = 334 - SYS_URETPROBE = 335 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 @@ -375,10 +374,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 70b35bf3b09..8d467094cf5 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -416,10 +416,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 1893e2fe884..edc173244d0 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -85,7 +85,7 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 - SYS_NEWFSTATAT = 79 + SYS_FSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 @@ -319,10 +319,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 16a4017da0a..445eba20615 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -84,8 +84,6 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 - SYS_NEWFSTATAT = 79 - SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 SYS_FDATASYNC = 83 @@ -315,10 +313,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 7e567f1efff..adba01bca70 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -436,10 +436,4 @@ const ( SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 - SYS_STATMOUNT = 4457 - SYS_LISTMOUNT = 4458 - SYS_LSM_GET_SELF_ATTR = 4459 - SYS_LSM_SET_SELF_ATTR = 4460 - SYS_LSM_LIST_MODULES = 4461 - SYS_MSEAL = 4462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 38ae55e5ef8..014c4e9c7a7 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -366,10 +366,4 @@ const ( SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 - SYS_STATMOUNT = 5457 - SYS_LISTMOUNT = 5458 - SYS_LSM_GET_SELF_ATTR = 5459 - SYS_LSM_SET_SELF_ATTR = 5460 - SYS_LSM_LIST_MODULES = 5461 - SYS_MSEAL = 5462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 55e92e60a82..ccc97d74d05 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -366,10 +366,4 @@ const ( SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 - SYS_STATMOUNT = 5457 - SYS_LISTMOUNT = 5458 - SYS_LSM_GET_SELF_ATTR = 5459 - SYS_LSM_SET_SELF_ATTR = 5460 - SYS_LSM_LIST_MODULES = 5461 - SYS_MSEAL = 5462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 60658d6a021..ec2b64a95d7 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -436,10 +436,4 @@ const ( SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 - SYS_STATMOUNT = 4457 - SYS_LISTMOUNT = 4458 - SYS_LSM_GET_SELF_ATTR = 4459 - SYS_LSM_SET_SELF_ATTR = 4460 - SYS_LSM_LIST_MODULES = 4461 - SYS_MSEAL = 4462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index e203e8a7ed4..21a839e338b 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -443,10 +443,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 5944b97d546..c11121ec3b4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -415,10 +415,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index c66d416dad1..909b631fcb4 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -415,10 +415,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index a5459e766f5..e49bed16ea6 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -84,7 +84,7 @@ const ( SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 - SYS_NEWFSTATAT = 79 + SYS_FSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 @@ -320,10 +320,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 01d86825bb9..66017d2d32b 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -381,10 +381,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 7b703e77cda..47bab18dced 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -394,10 +394,4 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 - SYS_STATMOUNT = 457 - SYS_LISTMOUNT = 458 - SYS_LSM_GET_SELF_ATTR = 459 - SYS_LSM_SET_SELF_ATTR = 460 - SYS_LSM_LIST_MODULES = 461 - SYS_MSEAL = 462 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/upstream/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go index 5e8c263ca9c..b2e30858199 100644 --- a/upstream/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go @@ -1,2852 +1,2669 @@ -// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s -// Code generated by the command above; see README.md. DO NOT EDIT. +// 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 -const ( - SYS_LOG = 0x17 // 23 - SYS_COSH = 0x18 // 24 - SYS_TANH = 0x19 // 25 - SYS_EXP = 0x1A // 26 - SYS_MODF = 0x1B // 27 - SYS_LOG10 = 0x1C // 28 - SYS_FREXP = 0x1D // 29 - SYS_LDEXP = 0x1E // 30 - SYS_CEIL = 0x1F // 31 - SYS_POW = 0x20 // 32 - SYS_SQRT = 0x21 // 33 - SYS_FLOOR = 0x22 // 34 - SYS_J1 = 0x23 // 35 - SYS_FABS = 0x24 // 36 - SYS_FMOD = 0x25 // 37 - SYS_J0 = 0x26 // 38 - SYS_YN = 0x27 // 39 - SYS_JN = 0x28 // 40 - SYS_Y0 = 0x29 // 41 - SYS_Y1 = 0x2A // 42 - SYS_HYPOT = 0x2B // 43 - SYS_ERF = 0x2C // 44 - SYS_ERFC = 0x2D // 45 - SYS_GAMMA = 0x2E // 46 - SYS_ISALPHA = 0x30 // 48 - SYS_ISALNUM = 0x31 // 49 - SYS_ISLOWER = 0x32 // 50 - SYS_ISCNTRL = 0x33 // 51 - SYS_ISDIGIT = 0x34 // 52 - SYS_ISGRAPH = 0x35 // 53 - SYS_ISUPPER = 0x36 // 54 - SYS_ISPRINT = 0x37 // 55 - SYS_ISPUNCT = 0x38 // 56 - SYS_ISSPACE = 0x39 // 57 - SYS_SETLOCAL = 0x3A // 58 - SYS_SETLOCALE = 0x3A // 58 - SYS_ISXDIGIT = 0x3B // 59 - SYS_TOLOWER = 0x3C // 60 - SYS_TOUPPER = 0x3D // 61 - SYS_ASIN = 0x3E // 62 - SYS_SIN = 0x3F // 63 - SYS_COS = 0x40 // 64 - SYS_TAN = 0x41 // 65 - SYS_SINH = 0x42 // 66 - SYS_ACOS = 0x43 // 67 - SYS_ATAN = 0x44 // 68 - SYS_ATAN2 = 0x45 // 69 - SYS_FTELL = 0x46 // 70 - SYS_FGETPOS = 0x47 // 71 - SYS_FSEEK = 0x48 // 72 - SYS_FSETPOS = 0x49 // 73 - SYS_FERROR = 0x4A // 74 - SYS_REWIND = 0x4B // 75 - SYS_CLEARERR = 0x4C // 76 - SYS_FEOF = 0x4D // 77 - SYS_ATOL = 0x4E // 78 - SYS_PERROR = 0x4F // 79 - SYS_ATOF = 0x50 // 80 - SYS_ATOI = 0x51 // 81 - SYS_RAND = 0x52 // 82 - SYS_STRTOD = 0x53 // 83 - SYS_STRTOL = 0x54 // 84 - SYS_STRTOUL = 0x55 // 85 - SYS_MALLOC = 0x56 // 86 - SYS_SRAND = 0x57 // 87 - SYS_CALLOC = 0x58 // 88 - SYS_FREE = 0x59 // 89 - SYS_EXIT = 0x5A // 90 - SYS_REALLOC = 0x5B // 91 - SYS_ABORT = 0x5C // 92 - SYS___ABORT = 0x5C // 92 - SYS_ATEXIT = 0x5D // 93 - SYS_RAISE = 0x5E // 94 - SYS_SETJMP = 0x5F // 95 - SYS_LONGJMP = 0x60 // 96 - SYS_SIGNAL = 0x61 // 97 - SYS_TMPNAM = 0x62 // 98 - SYS_REMOVE = 0x63 // 99 - SYS_RENAME = 0x64 // 100 - SYS_TMPFILE = 0x65 // 101 - SYS_FREOPEN = 0x66 // 102 - SYS_FCLOSE = 0x67 // 103 - SYS_FFLUSH = 0x68 // 104 - SYS_FOPEN = 0x69 // 105 - SYS_FSCANF = 0x6A // 106 - SYS_SETBUF = 0x6B // 107 - SYS_SETVBUF = 0x6C // 108 - SYS_FPRINTF = 0x6D // 109 - SYS_SSCANF = 0x6E // 110 - SYS_PRINTF = 0x6F // 111 - SYS_SCANF = 0x70 // 112 - SYS_SPRINTF = 0x71 // 113 - SYS_FGETC = 0x72 // 114 - SYS_VFPRINTF = 0x73 // 115 - SYS_VPRINTF = 0x74 // 116 - SYS_VSPRINTF = 0x75 // 117 - SYS_GETC = 0x76 // 118 - SYS_FGETS = 0x77 // 119 - SYS_FPUTC = 0x78 // 120 - SYS_FPUTS = 0x79 // 121 - SYS_PUTCHAR = 0x7A // 122 - SYS_GETCHAR = 0x7B // 123 - SYS_GETS = 0x7C // 124 - SYS_PUTC = 0x7D // 125 - SYS_FWRITE = 0x7E // 126 - SYS_PUTS = 0x7F // 127 - SYS_UNGETC = 0x80 // 128 - SYS_FREAD = 0x81 // 129 - SYS_WCSTOMBS = 0x82 // 130 - SYS_MBTOWC = 0x83 // 131 - SYS_WCTOMB = 0x84 // 132 - SYS_MBSTOWCS = 0x85 // 133 - SYS_WCSCPY = 0x86 // 134 - SYS_WCSCAT = 0x87 // 135 - SYS_WCSCHR = 0x88 // 136 - SYS_WCSCMP = 0x89 // 137 - SYS_WCSNCMP = 0x8A // 138 - SYS_WCSCSPN = 0x8B // 139 - SYS_WCSLEN = 0x8C // 140 - SYS_WCSNCAT = 0x8D // 141 - SYS_WCSSPN = 0x8E // 142 - SYS_WCSNCPY = 0x8F // 143 - SYS_ABS = 0x90 // 144 - SYS_DIV = 0x91 // 145 - SYS_LABS = 0x92 // 146 - SYS_STRNCPY = 0x93 // 147 - SYS_MEMCPY = 0x94 // 148 - SYS_MEMMOVE = 0x95 // 149 - SYS_STRCPY = 0x96 // 150 - SYS_STRCMP = 0x97 // 151 - SYS_STRCAT = 0x98 // 152 - SYS_STRNCAT = 0x99 // 153 - SYS_MEMCMP = 0x9A // 154 - SYS_MEMCHR = 0x9B // 155 - SYS_STRCOLL = 0x9C // 156 - SYS_STRNCMP = 0x9D // 157 - SYS_STRXFRM = 0x9E // 158 - SYS_STRRCHR = 0x9F // 159 - SYS_STRCHR = 0xA0 // 160 - SYS_STRCSPN = 0xA1 // 161 - SYS_STRPBRK = 0xA2 // 162 - SYS_MEMSET = 0xA3 // 163 - SYS_STRSPN = 0xA4 // 164 - SYS_STRSTR = 0xA5 // 165 - SYS_STRTOK = 0xA6 // 166 - SYS_DIFFTIME = 0xA7 // 167 - SYS_STRERROR = 0xA8 // 168 - SYS_STRLEN = 0xA9 // 169 - SYS_CLOCK = 0xAA // 170 - SYS_CTIME = 0xAB // 171 - SYS_MKTIME = 0xAC // 172 - SYS_TIME = 0xAD // 173 - SYS_ASCTIME = 0xAE // 174 - SYS_MBLEN = 0xAF // 175 - SYS_GMTIME = 0xB0 // 176 - SYS_LOCALTIM = 0xB1 // 177 - SYS_LOCALTIME = 0xB1 // 177 - SYS_STRFTIME = 0xB2 // 178 - SYS___GETCB = 0xB4 // 180 - SYS_FUPDATE = 0xB5 // 181 - SYS___FUPDT = 0xB5 // 181 - SYS_CLRMEMF = 0xBD // 189 - SYS___CLRMF = 0xBD // 189 - SYS_FETCHEP = 0xBF // 191 - SYS___FTCHEP = 0xBF // 191 - SYS_FLDATA = 0xC1 // 193 - SYS___FLDATA = 0xC1 // 193 - SYS_DYNFREE = 0xC2 // 194 - SYS___DYNFRE = 0xC2 // 194 - SYS_DYNALLOC = 0xC3 // 195 - SYS___DYNALL = 0xC3 // 195 - SYS___CDUMP = 0xC4 // 196 - SYS_CSNAP = 0xC5 // 197 - SYS___CSNAP = 0xC5 // 197 - SYS_CTRACE = 0xC6 // 198 - SYS___CTRACE = 0xC6 // 198 - SYS___CTEST = 0xC7 // 199 - SYS_SETENV = 0xC8 // 200 - SYS___SETENV = 0xC8 // 200 - SYS_CLEARENV = 0xC9 // 201 - SYS___CLRENV = 0xC9 // 201 - SYS___REGCOMP_STD = 0xEA // 234 - SYS_NL_LANGINFO = 0xFC // 252 - SYS_GETSYNTX = 0xFD // 253 - SYS_ISBLANK = 0xFE // 254 - SYS___ISBLNK = 0xFE // 254 - SYS_ISWALNUM = 0xFF // 255 - SYS_ISWALPHA = 0x100 // 256 - SYS_ISWBLANK = 0x101 // 257 - SYS___ISWBLK = 0x101 // 257 - SYS_ISWCNTRL = 0x102 // 258 - SYS_ISWDIGIT = 0x103 // 259 - SYS_ISWGRAPH = 0x104 // 260 - SYS_ISWLOWER = 0x105 // 261 - SYS_ISWPRINT = 0x106 // 262 - SYS_ISWPUNCT = 0x107 // 263 - SYS_ISWSPACE = 0x108 // 264 - SYS_ISWUPPER = 0x109 // 265 - SYS_ISWXDIGI = 0x10A // 266 - SYS_ISWXDIGIT = 0x10A // 266 - SYS_WCTYPE = 0x10B // 267 - SYS_ISWCTYPE = 0x10C // 268 - SYS_TOWLOWER = 0x10D // 269 - SYS_TOWUPPER = 0x10E // 270 - SYS_MBSINIT = 0x10F // 271 - SYS_WCTOB = 0x110 // 272 - SYS_MBRLEN = 0x111 // 273 - SYS_MBRTOWC = 0x112 // 274 - SYS_MBSRTOWC = 0x113 // 275 - SYS_MBSRTOWCS = 0x113 // 275 - SYS_WCRTOMB = 0x114 // 276 - SYS_WCSRTOMB = 0x115 // 277 - SYS_WCSRTOMBS = 0x115 // 277 - SYS___CSID = 0x116 // 278 - SYS___WCSID = 0x117 // 279 - SYS_STRPTIME = 0x118 // 280 - SYS___STRPTM = 0x118 // 280 - SYS_STRFMON = 0x119 // 281 - SYS___RPMTCH = 0x11A // 282 - SYS_WCSSTR = 0x11B // 283 - SYS_WCSTOK = 0x12C // 300 - SYS_WCSTOL = 0x12D // 301 - SYS_WCSTOD = 0x12E // 302 - SYS_WCSTOUL = 0x12F // 303 - SYS_WCSCOLL = 0x130 // 304 - SYS_WCSXFRM = 0x131 // 305 - SYS_WCSWIDTH = 0x132 // 306 - SYS_WCWIDTH = 0x133 // 307 - SYS_WCSFTIME = 0x134 // 308 - SYS_SWPRINTF = 0x135 // 309 - SYS_VSWPRINT = 0x136 // 310 - SYS_VSWPRINTF = 0x136 // 310 - SYS_SWSCANF = 0x137 // 311 - SYS_REGCOMP = 0x138 // 312 - SYS_REGEXEC = 0x139 // 313 - SYS_REGFREE = 0x13A // 314 - SYS_REGERROR = 0x13B // 315 - SYS_FGETWC = 0x13C // 316 - SYS_FGETWS = 0x13D // 317 - SYS_FPUTWC = 0x13E // 318 - SYS_FPUTWS = 0x13F // 319 - SYS_GETWC = 0x140 // 320 - SYS_GETWCHAR = 0x141 // 321 - SYS_PUTWC = 0x142 // 322 - SYS_PUTWCHAR = 0x143 // 323 - SYS_UNGETWC = 0x144 // 324 - SYS_ICONV_OPEN = 0x145 // 325 - SYS_ICONV = 0x146 // 326 - SYS_ICONV_CLOSE = 0x147 // 327 - SYS_ISMCCOLLEL = 0x14C // 332 - SYS_STRTOCOLL = 0x14D // 333 - SYS_COLLTOSTR = 0x14E // 334 - SYS_COLLEQUIV = 0x14F // 335 - SYS_COLLRANGE = 0x150 // 336 - SYS_CCLASS = 0x151 // 337 - SYS_COLLORDER = 0x152 // 338 - SYS___DEMANGLE = 0x154 // 340 - SYS_FDOPEN = 0x155 // 341 - SYS___ERRNO = 0x156 // 342 - SYS___ERRNO2 = 0x157 // 343 - SYS___TERROR = 0x158 // 344 - SYS_MAXCOLL = 0x169 // 361 - SYS_GETMCCOLL = 0x16A // 362 - SYS_GETWMCCOLL = 0x16B // 363 - SYS___ERR2AD = 0x16C // 364 - SYS_DLLQUERYFN = 0x16D // 365 - SYS_DLLQUERYVAR = 0x16E // 366 - SYS_DLLFREE = 0x16F // 367 - SYS_DLLLOAD = 0x170 // 368 - SYS__EXIT = 0x174 // 372 - SYS_ACCESS = 0x175 // 373 - SYS_ALARM = 0x176 // 374 - SYS_CFGETISPEED = 0x177 // 375 - SYS_CFGETOSPEED = 0x178 // 376 - SYS_CFSETISPEED = 0x179 // 377 - SYS_CFSETOSPEED = 0x17A // 378 - SYS_CHDIR = 0x17B // 379 - SYS_CHMOD = 0x17C // 380 - SYS_CHOWN = 0x17D // 381 - SYS_CLOSE = 0x17E // 382 - SYS_CLOSEDIR = 0x17F // 383 - SYS_CREAT = 0x180 // 384 - SYS_CTERMID = 0x181 // 385 - SYS_DUP = 0x182 // 386 - SYS_DUP2 = 0x183 // 387 - SYS_EXECL = 0x184 // 388 - SYS_EXECLE = 0x185 // 389 - SYS_EXECLP = 0x186 // 390 - SYS_EXECV = 0x187 // 391 - SYS_EXECVE = 0x188 // 392 - SYS_EXECVP = 0x189 // 393 - SYS_FCHMOD = 0x18A // 394 - SYS_FCHOWN = 0x18B // 395 - SYS_FCNTL = 0x18C // 396 - SYS_FILENO = 0x18D // 397 - SYS_FORK = 0x18E // 398 - SYS_FPATHCONF = 0x18F // 399 - SYS_FSTAT = 0x190 // 400 - SYS_FSYNC = 0x191 // 401 - SYS_FTRUNCATE = 0x192 // 402 - SYS_GETCWD = 0x193 // 403 - SYS_GETEGID = 0x194 // 404 - SYS_GETEUID = 0x195 // 405 - SYS_GETGID = 0x196 // 406 - SYS_GETGRGID = 0x197 // 407 - SYS_GETGRNAM = 0x198 // 408 - SYS_GETGROUPS = 0x199 // 409 - SYS_GETLOGIN = 0x19A // 410 - SYS_W_GETMNTENT = 0x19B // 411 - SYS_GETPGRP = 0x19C // 412 - SYS_GETPID = 0x19D // 413 - SYS_GETPPID = 0x19E // 414 - SYS_GETPWNAM = 0x19F // 415 - SYS_GETPWUID = 0x1A0 // 416 - SYS_GETUID = 0x1A1 // 417 - SYS_W_IOCTL = 0x1A2 // 418 - SYS_ISATTY = 0x1A3 // 419 - SYS_KILL = 0x1A4 // 420 - SYS_LINK = 0x1A5 // 421 - SYS_LSEEK = 0x1A6 // 422 - SYS_LSTAT = 0x1A7 // 423 - SYS_MKDIR = 0x1A8 // 424 - SYS_MKFIFO = 0x1A9 // 425 - SYS_MKNOD = 0x1AA // 426 - SYS_MOUNT = 0x1AB // 427 - SYS_OPEN = 0x1AC // 428 - SYS_OPENDIR = 0x1AD // 429 - SYS_PATHCONF = 0x1AE // 430 - SYS_PAUSE = 0x1AF // 431 - SYS_PIPE = 0x1B0 // 432 - SYS_W_GETPSENT = 0x1B1 // 433 - SYS_READ = 0x1B2 // 434 - SYS_READDIR = 0x1B3 // 435 - SYS_READLINK = 0x1B4 // 436 - SYS_REWINDDIR = 0x1B5 // 437 - SYS_RMDIR = 0x1B6 // 438 - SYS_SETEGID = 0x1B7 // 439 - SYS_SETEUID = 0x1B8 // 440 - SYS_SETGID = 0x1B9 // 441 - SYS_SETPGID = 0x1BA // 442 - SYS_SETSID = 0x1BB // 443 - SYS_SETUID = 0x1BC // 444 - SYS_SIGACTION = 0x1BD // 445 - SYS_SIGADDSET = 0x1BE // 446 - SYS_SIGDELSET = 0x1BF // 447 - SYS_SIGEMPTYSET = 0x1C0 // 448 - SYS_SIGFILLSET = 0x1C1 // 449 - SYS_SIGISMEMBER = 0x1C2 // 450 - SYS_SIGLONGJMP = 0x1C3 // 451 - SYS_SIGPENDING = 0x1C4 // 452 - SYS_SIGPROCMASK = 0x1C5 // 453 - SYS_SIGSETJMP = 0x1C6 // 454 - SYS_SIGSUSPEND = 0x1C7 // 455 - SYS_SLEEP = 0x1C8 // 456 - SYS_STAT = 0x1C9 // 457 - SYS_W_STATFS = 0x1CA // 458 - SYS_SYMLINK = 0x1CB // 459 - SYS_SYSCONF = 0x1CC // 460 - SYS_TCDRAIN = 0x1CD // 461 - SYS_TCFLOW = 0x1CE // 462 - SYS_TCFLUSH = 0x1CF // 463 - SYS_TCGETATTR = 0x1D0 // 464 - SYS_TCGETPGRP = 0x1D1 // 465 - SYS_TCSENDBREAK = 0x1D2 // 466 - SYS_TCSETATTR = 0x1D3 // 467 - SYS_TCSETPGRP = 0x1D4 // 468 - SYS_TIMES = 0x1D5 // 469 - SYS_TTYNAME = 0x1D6 // 470 - SYS_TZSET = 0x1D7 // 471 - SYS_UMASK = 0x1D8 // 472 - SYS_UMOUNT = 0x1D9 // 473 - SYS_UNAME = 0x1DA // 474 - SYS_UNLINK = 0x1DB // 475 - SYS_UTIME = 0x1DC // 476 - SYS_WAIT = 0x1DD // 477 - SYS_WAITPID = 0x1DE // 478 - SYS_WRITE = 0x1DF // 479 - SYS_CHAUDIT = 0x1E0 // 480 - SYS_FCHAUDIT = 0x1E1 // 481 - SYS_GETGROUPSBYNAME = 0x1E2 // 482 - SYS_SIGWAIT = 0x1E3 // 483 - SYS_PTHREAD_EXIT = 0x1E4 // 484 - SYS_PTHREAD_KILL = 0x1E5 // 485 - SYS_PTHREAD_ATTR_INIT = 0x1E6 // 486 - SYS_PTHREAD_ATTR_DESTROY = 0x1E7 // 487 - SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 // 488 - SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 // 489 - SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA // 490 - SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB // 491 - SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC // 492 - SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED // 493 - SYS_PTHREAD_CANCEL = 0x1EE // 494 - SYS_PTHREAD_CLEANUP_PUSH = 0x1EF // 495 - SYS_PTHREAD_CLEANUP_POP = 0x1F0 // 496 - SYS_PTHREAD_CONDATTR_INIT = 0x1F1 // 497 - SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 // 498 - SYS_PTHREAD_COND_INIT = 0x1F3 // 499 - SYS_PTHREAD_COND_DESTROY = 0x1F4 // 500 - SYS_PTHREAD_COND_SIGNAL = 0x1F5 // 501 - SYS_PTHREAD_COND_BROADCAST = 0x1F6 // 502 - SYS_PTHREAD_COND_WAIT = 0x1F7 // 503 - SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 // 504 - SYS_PTHREAD_CREATE = 0x1F9 // 505 - SYS_PTHREAD_DETACH = 0x1FA // 506 - SYS_PTHREAD_EQUAL = 0x1FB // 507 - SYS_PTHREAD_GETSPECIFIC = 0x1FC // 508 - SYS_PTHREAD_JOIN = 0x1FD // 509 - SYS_PTHREAD_KEY_CREATE = 0x1FE // 510 - SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF // 511 - SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 // 512 - SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 // 513 - SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 // 514 - SYS_PTHREAD_MUTEX_INIT = 0x203 // 515 - SYS_PTHREAD_MUTEX_DESTROY = 0x204 // 516 - SYS_PTHREAD_MUTEX_LOCK = 0x205 // 517 - SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 // 518 - SYS_PTHREAD_MUTEX_UNLOCK = 0x207 // 519 - SYS_PTHREAD_ONCE = 0x209 // 521 - SYS_PTHREAD_SELF = 0x20A // 522 - SYS_PTHREAD_SETINTR = 0x20B // 523 - SYS_PTHREAD_SETINTRTYPE = 0x20C // 524 - SYS_PTHREAD_SETSPECIFIC = 0x20D // 525 - SYS_PTHREAD_TESTINTR = 0x20E // 526 - SYS_PTHREAD_YIELD = 0x20F // 527 - SYS_TW_OPEN = 0x210 // 528 - SYS_TW_FCNTL = 0x211 // 529 - SYS_PTHREAD_JOIN_D4_NP = 0x212 // 530 - SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 // 531 - SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 // 532 - SYS_EXTLINK_NP = 0x215 // 533 - SYS___PASSWD = 0x216 // 534 - SYS_SETGROUPS = 0x217 // 535 - SYS_INITGROUPS = 0x218 // 536 - SYS_WCSPBRK = 0x23F // 575 - SYS_WCSRCHR = 0x240 // 576 - SYS_SVC99 = 0x241 // 577 - SYS___SVC99 = 0x241 // 577 - SYS_WCSWCS = 0x242 // 578 - SYS_LOCALECO = 0x243 // 579 - SYS_LOCALECONV = 0x243 // 579 - SYS___LIBREL = 0x244 // 580 - SYS_RELEASE = 0x245 // 581 - SYS___RLSE = 0x245 // 581 - SYS_FLOCATE = 0x246 // 582 - SYS___FLOCT = 0x246 // 582 - SYS_FDELREC = 0x247 // 583 - SYS___FDLREC = 0x247 // 583 - SYS_FETCH = 0x248 // 584 - SYS___FETCH = 0x248 // 584 - SYS_QSORT = 0x249 // 585 - SYS_GETENV = 0x24A // 586 - SYS_SYSTEM = 0x24B // 587 - SYS_BSEARCH = 0x24C // 588 - SYS_LDIV = 0x24D // 589 - SYS___THROW = 0x25E // 606 - SYS___RETHROW = 0x25F // 607 - SYS___CLEANUPCATCH = 0x260 // 608 - SYS___CATCHMATCH = 0x261 // 609 - SYS___CLEAN2UPCATCH = 0x262 // 610 - SYS_PUTENV = 0x26A // 618 - SYS___GETENV = 0x26F // 623 - SYS_GETPRIORITY = 0x270 // 624 - SYS_NICE = 0x271 // 625 - SYS_SETPRIORITY = 0x272 // 626 - SYS_GETITIMER = 0x273 // 627 - SYS_SETITIMER = 0x274 // 628 - SYS_MSGCTL = 0x275 // 629 - SYS_MSGGET = 0x276 // 630 - SYS_MSGRCV = 0x277 // 631 - SYS_MSGSND = 0x278 // 632 - SYS_MSGXRCV = 0x279 // 633 - SYS___MSGXR = 0x279 // 633 - SYS_SEMCTL = 0x27A // 634 - SYS_SEMGET = 0x27B // 635 - SYS_SEMOP = 0x27C // 636 - SYS_SHMAT = 0x27D // 637 - SYS_SHMCTL = 0x27E // 638 - SYS_SHMDT = 0x27F // 639 - SYS_SHMGET = 0x280 // 640 - SYS___GETIPC = 0x281 // 641 - SYS_SETGRENT = 0x282 // 642 - SYS_GETGRENT = 0x283 // 643 - SYS_ENDGRENT = 0x284 // 644 - SYS_SETPWENT = 0x285 // 645 - SYS_GETPWENT = 0x286 // 646 - SYS_ENDPWENT = 0x287 // 647 - SYS_BSD_SIGNAL = 0x288 // 648 - SYS_KILLPG = 0x289 // 649 - SYS_SIGALTSTACK = 0x28A // 650 - SYS_SIGHOLD = 0x28B // 651 - SYS_SIGIGNORE = 0x28C // 652 - SYS_SIGINTERRUPT = 0x28D // 653 - SYS_SIGPAUSE = 0x28E // 654 - SYS_SIGRELSE = 0x28F // 655 - SYS_SIGSET = 0x290 // 656 - SYS_SIGSTACK = 0x291 // 657 - SYS_GETRLIMIT = 0x292 // 658 - SYS_SETRLIMIT = 0x293 // 659 - SYS_GETRUSAGE = 0x294 // 660 - SYS_MMAP = 0x295 // 661 - SYS_MPROTECT = 0x296 // 662 - SYS_MSYNC = 0x297 // 663 - SYS_MUNMAP = 0x298 // 664 - SYS_CONFSTR = 0x299 // 665 - SYS_GETOPT = 0x29A // 666 - SYS_LCHOWN = 0x29B // 667 - SYS_TRUNCATE = 0x29C // 668 - SYS_GETSUBOPT = 0x29D // 669 - SYS_SETPGRP = 0x29E // 670 - SYS___GDERR = 0x29F // 671 - SYS___TZONE = 0x2A0 // 672 - SYS___DLGHT = 0x2A1 // 673 - SYS___OPARGF = 0x2A2 // 674 - SYS___OPOPTF = 0x2A3 // 675 - SYS___OPINDF = 0x2A4 // 676 - SYS___OPERRF = 0x2A5 // 677 - SYS_GETDATE = 0x2A6 // 678 - SYS_WAIT3 = 0x2A7 // 679 - SYS_WAITID = 0x2A8 // 680 - SYS___CATTRM = 0x2A9 // 681 - SYS___GDTRM = 0x2AA // 682 - SYS___RNDTRM = 0x2AB // 683 - SYS_CRYPT = 0x2AC // 684 - SYS_ENCRYPT = 0x2AD // 685 - SYS_SETKEY = 0x2AE // 686 - SYS___CNVBLK = 0x2AF // 687 - SYS___CRYTRM = 0x2B0 // 688 - SYS___ECRTRM = 0x2B1 // 689 - SYS_DRAND48 = 0x2B2 // 690 - SYS_ERAND48 = 0x2B3 // 691 - SYS_FSTATVFS = 0x2B4 // 692 - SYS_STATVFS = 0x2B5 // 693 - SYS_CATCLOSE = 0x2B6 // 694 - SYS_CATGETS = 0x2B7 // 695 - SYS_CATOPEN = 0x2B8 // 696 - SYS_BCMP = 0x2B9 // 697 - SYS_BCOPY = 0x2BA // 698 - SYS_BZERO = 0x2BB // 699 - SYS_FFS = 0x2BC // 700 - SYS_INDEX = 0x2BD // 701 - SYS_RINDEX = 0x2BE // 702 - SYS_STRCASECMP = 0x2BF // 703 - SYS_STRDUP = 0x2C0 // 704 - SYS_STRNCASECMP = 0x2C1 // 705 - SYS_INITSTATE = 0x2C2 // 706 - SYS_SETSTATE = 0x2C3 // 707 - SYS_RANDOM = 0x2C4 // 708 - SYS_SRANDOM = 0x2C5 // 709 - SYS_HCREATE = 0x2C6 // 710 - SYS_HDESTROY = 0x2C7 // 711 - SYS_HSEARCH = 0x2C8 // 712 - SYS_LFIND = 0x2C9 // 713 - SYS_LSEARCH = 0x2CA // 714 - SYS_TDELETE = 0x2CB // 715 - SYS_TFIND = 0x2CC // 716 - SYS_TSEARCH = 0x2CD // 717 - SYS_TWALK = 0x2CE // 718 - SYS_INSQUE = 0x2CF // 719 - SYS_REMQUE = 0x2D0 // 720 - SYS_POPEN = 0x2D1 // 721 - SYS_PCLOSE = 0x2D2 // 722 - SYS_SWAB = 0x2D3 // 723 - SYS_MEMCCPY = 0x2D4 // 724 - SYS_GETPAGESIZE = 0x2D8 // 728 - SYS_FCHDIR = 0x2D9 // 729 - SYS___OCLCK = 0x2DA // 730 - SYS___ATOE = 0x2DB // 731 - SYS___ATOE_L = 0x2DC // 732 - SYS___ETOA = 0x2DD // 733 - SYS___ETOA_L = 0x2DE // 734 - SYS_SETUTXENT = 0x2DF // 735 - SYS_GETUTXENT = 0x2E0 // 736 - SYS_ENDUTXENT = 0x2E1 // 737 - SYS_GETUTXID = 0x2E2 // 738 - SYS_GETUTXLINE = 0x2E3 // 739 - SYS_PUTUTXLINE = 0x2E4 // 740 - SYS_FMTMSG = 0x2E5 // 741 - SYS_JRAND48 = 0x2E6 // 742 - SYS_LRAND48 = 0x2E7 // 743 - SYS_MRAND48 = 0x2E8 // 744 - SYS_NRAND48 = 0x2E9 // 745 - SYS_LCONG48 = 0x2EA // 746 - SYS_SRAND48 = 0x2EB // 747 - SYS_SEED48 = 0x2EC // 748 - SYS_ISASCII = 0x2ED // 749 - SYS_TOASCII = 0x2EE // 750 - SYS_A64L = 0x2EF // 751 - SYS_L64A = 0x2F0 // 752 - SYS_UALARM = 0x2F1 // 753 - SYS_USLEEP = 0x2F2 // 754 - SYS___UTXTRM = 0x2F3 // 755 - SYS___SRCTRM = 0x2F4 // 756 - SYS_FTIME = 0x2F5 // 757 - SYS_GETTIMEOFDAY = 0x2F6 // 758 - SYS_DBM_CLEARERR = 0x2F7 // 759 - SYS_DBM_CLOSE = 0x2F8 // 760 - SYS_DBM_DELETE = 0x2F9 // 761 - SYS_DBM_ERROR = 0x2FA // 762 - SYS_DBM_FETCH = 0x2FB // 763 - SYS_DBM_FIRSTKEY = 0x2FC // 764 - SYS_DBM_NEXTKEY = 0x2FD // 765 - SYS_DBM_OPEN = 0x2FE // 766 - SYS_DBM_STORE = 0x2FF // 767 - SYS___NDMTRM = 0x300 // 768 - SYS_FTOK = 0x301 // 769 - SYS_BASENAME = 0x302 // 770 - SYS_DIRNAME = 0x303 // 771 - SYS_GETDTABLESIZE = 0x304 // 772 - SYS_MKSTEMP = 0x305 // 773 - SYS_MKTEMP = 0x306 // 774 - SYS_NFTW = 0x307 // 775 - SYS_GETWD = 0x308 // 776 - SYS_LOCKF = 0x309 // 777 - SYS__LONGJMP = 0x30D // 781 - SYS__SETJMP = 0x30E // 782 - SYS_VFORK = 0x30F // 783 - SYS_WORDEXP = 0x310 // 784 - SYS_WORDFREE = 0x311 // 785 - SYS_GETPGID = 0x312 // 786 - SYS_GETSID = 0x313 // 787 - SYS___UTMPXNAME = 0x314 // 788 - SYS_CUSERID = 0x315 // 789 - SYS_GETPASS = 0x316 // 790 - SYS_FNMATCH = 0x317 // 791 - SYS_FTW = 0x318 // 792 - SYS_GETW = 0x319 // 793 - SYS_GLOB = 0x31A // 794 - SYS_GLOBFREE = 0x31B // 795 - SYS_PUTW = 0x31C // 796 - SYS_SEEKDIR = 0x31D // 797 - SYS_TELLDIR = 0x31E // 798 - SYS_TEMPNAM = 0x31F // 799 - SYS_ACOSH = 0x320 // 800 - SYS_ASINH = 0x321 // 801 - SYS_ATANH = 0x322 // 802 - SYS_CBRT = 0x323 // 803 - SYS_EXPM1 = 0x324 // 804 - SYS_ILOGB = 0x325 // 805 - SYS_LOGB = 0x326 // 806 - SYS_LOG1P = 0x327 // 807 - SYS_NEXTAFTER = 0x328 // 808 - SYS_RINT = 0x329 // 809 - SYS_REMAINDER = 0x32A // 810 - SYS_SCALB = 0x32B // 811 - SYS_LGAMMA = 0x32C // 812 - SYS_TTYSLOT = 0x32D // 813 - SYS_GETTIMEOFDAY_R = 0x32E // 814 - SYS_SYNC = 0x32F // 815 - SYS_SPAWN = 0x330 // 816 - SYS_SPAWNP = 0x331 // 817 - SYS_GETLOGIN_UU = 0x332 // 818 - SYS_ECVT = 0x333 // 819 - SYS_FCVT = 0x334 // 820 - SYS_GCVT = 0x335 // 821 - SYS_ACCEPT = 0x336 // 822 - SYS_BIND = 0x337 // 823 - SYS_CONNECT = 0x338 // 824 - SYS_ENDHOSTENT = 0x339 // 825 - SYS_ENDPROTOENT = 0x33A // 826 - SYS_ENDSERVENT = 0x33B // 827 - SYS_GETHOSTBYADDR_R = 0x33C // 828 - SYS_GETHOSTBYADDR = 0x33D // 829 - SYS_GETHOSTBYNAME_R = 0x33E // 830 - SYS_GETHOSTBYNAME = 0x33F // 831 - SYS_GETHOSTENT = 0x340 // 832 - SYS_GETHOSTID = 0x341 // 833 - SYS_GETHOSTNAME = 0x342 // 834 - SYS_GETNETBYADDR = 0x343 // 835 - SYS_GETNETBYNAME = 0x344 // 836 - SYS_GETNETENT = 0x345 // 837 - SYS_GETPEERNAME = 0x346 // 838 - SYS_GETPROTOBYNAME = 0x347 // 839 - SYS_GETPROTOBYNUMBER = 0x348 // 840 - SYS_GETPROTOENT = 0x349 // 841 - SYS_GETSERVBYNAME = 0x34A // 842 - SYS_GETSERVBYPORT = 0x34B // 843 - SYS_GETSERVENT = 0x34C // 844 - SYS_GETSOCKNAME = 0x34D // 845 - SYS_GETSOCKOPT = 0x34E // 846 - SYS_INET_ADDR = 0x34F // 847 - SYS_INET_LNAOF = 0x350 // 848 - SYS_INET_MAKEADDR = 0x351 // 849 - SYS_INET_NETOF = 0x352 // 850 - SYS_INET_NETWORK = 0x353 // 851 - SYS_INET_NTOA = 0x354 // 852 - SYS_IOCTL = 0x355 // 853 - SYS_LISTEN = 0x356 // 854 - SYS_READV = 0x357 // 855 - SYS_RECV = 0x358 // 856 - SYS_RECVFROM = 0x359 // 857 - SYS_SELECT = 0x35B // 859 - SYS_SELECTEX = 0x35C // 860 - SYS_SEND = 0x35D // 861 - SYS_SENDTO = 0x35F // 863 - SYS_SETHOSTENT = 0x360 // 864 - SYS_SETNETENT = 0x361 // 865 - SYS_SETPEER = 0x362 // 866 - SYS_SETPROTOENT = 0x363 // 867 - SYS_SETSERVENT = 0x364 // 868 - SYS_SETSOCKOPT = 0x365 // 869 - SYS_SHUTDOWN = 0x366 // 870 - SYS_SOCKET = 0x367 // 871 - SYS_SOCKETPAIR = 0x368 // 872 - SYS_WRITEV = 0x369 // 873 - SYS_CHROOT = 0x36A // 874 - SYS_W_STATVFS = 0x36B // 875 - SYS_ULIMIT = 0x36C // 876 - SYS_ISNAN = 0x36D // 877 - SYS_UTIMES = 0x36E // 878 - SYS___H_ERRNO = 0x36F // 879 - SYS_ENDNETENT = 0x370 // 880 - SYS_CLOSELOG = 0x371 // 881 - SYS_OPENLOG = 0x372 // 882 - SYS_SETLOGMASK = 0x373 // 883 - SYS_SYSLOG = 0x374 // 884 - SYS_PTSNAME = 0x375 // 885 - SYS_SETREUID = 0x376 // 886 - SYS_SETREGID = 0x377 // 887 - SYS_REALPATH = 0x378 // 888 - SYS___SIGNGAM = 0x379 // 889 - SYS_GRANTPT = 0x37A // 890 - SYS_UNLOCKPT = 0x37B // 891 - SYS_TCGETSID = 0x37C // 892 - SYS___TCGETCP = 0x37D // 893 - SYS___TCSETCP = 0x37E // 894 - SYS___TCSETTABLES = 0x37F // 895 - SYS_POLL = 0x380 // 896 - SYS_REXEC = 0x381 // 897 - SYS___ISASCII2 = 0x382 // 898 - SYS___TOASCII2 = 0x383 // 899 - SYS_CHPRIORITY = 0x384 // 900 - SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 // 901 - SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 // 902 - SYS_PTHREAD_SET_LIMIT_NP = 0x387 // 903 - SYS___STNETENT = 0x388 // 904 - SYS___STPROTOENT = 0x389 // 905 - SYS___STSERVENT = 0x38A // 906 - SYS___STHOSTENT = 0x38B // 907 - SYS_NLIST = 0x38C // 908 - SYS___IPDBCS = 0x38D // 909 - SYS___IPDSPX = 0x38E // 910 - SYS___IPMSGC = 0x38F // 911 - SYS___SELECT1 = 0x390 // 912 - SYS_PTHREAD_SECURITY_NP = 0x391 // 913 - SYS___CHECK_RESOURCE_AUTH_NP = 0x392 // 914 - SYS___CONVERT_ID_NP = 0x393 // 915 - SYS___OPENVMREL = 0x394 // 916 - SYS_WMEMCHR = 0x395 // 917 - SYS_WMEMCMP = 0x396 // 918 - SYS_WMEMCPY = 0x397 // 919 - SYS_WMEMMOVE = 0x398 // 920 - SYS_WMEMSET = 0x399 // 921 - SYS___FPUTWC = 0x400 // 1024 - SYS___PUTWC = 0x401 // 1025 - SYS___PWCHAR = 0x402 // 1026 - SYS___WCSFTM = 0x403 // 1027 - SYS___WCSTOK = 0x404 // 1028 - SYS___WCWDTH = 0x405 // 1029 - SYS_T_ACCEPT = 0x409 // 1033 - SYS_T_ALLOC = 0x40A // 1034 - SYS_T_BIND = 0x40B // 1035 - SYS_T_CLOSE = 0x40C // 1036 - SYS_T_CONNECT = 0x40D // 1037 - SYS_T_ERROR = 0x40E // 1038 - SYS_T_FREE = 0x40F // 1039 - SYS_T_GETINFO = 0x410 // 1040 - SYS_T_GETPROTADDR = 0x411 // 1041 - SYS_T_GETSTATE = 0x412 // 1042 - SYS_T_LISTEN = 0x413 // 1043 - SYS_T_LOOK = 0x414 // 1044 - SYS_T_OPEN = 0x415 // 1045 - SYS_T_OPTMGMT = 0x416 // 1046 - SYS_T_RCV = 0x417 // 1047 - SYS_T_RCVCONNECT = 0x418 // 1048 - SYS_T_RCVDIS = 0x419 // 1049 - SYS_T_RCVREL = 0x41A // 1050 - SYS_T_RCVUDATA = 0x41B // 1051 - SYS_T_RCVUDERR = 0x41C // 1052 - SYS_T_SND = 0x41D // 1053 - SYS_T_SNDDIS = 0x41E // 1054 - SYS_T_SNDREL = 0x41F // 1055 - SYS_T_SNDUDATA = 0x420 // 1056 - SYS_T_STRERROR = 0x421 // 1057 - SYS_T_SYNC = 0x422 // 1058 - SYS_T_UNBIND = 0x423 // 1059 - SYS___T_ERRNO = 0x424 // 1060 - SYS___RECVMSG2 = 0x425 // 1061 - SYS___SENDMSG2 = 0x426 // 1062 - SYS_FATTACH = 0x427 // 1063 - SYS_FDETACH = 0x428 // 1064 - SYS_GETMSG = 0x429 // 1065 - SYS_GETPMSG = 0x42A // 1066 - SYS_ISASTREAM = 0x42B // 1067 - SYS_PUTMSG = 0x42C // 1068 - SYS_PUTPMSG = 0x42D // 1069 - SYS___ISPOSIXON = 0x42E // 1070 - SYS___OPENMVSREL = 0x42F // 1071 - SYS_GETCONTEXT = 0x430 // 1072 - SYS_SETCONTEXT = 0x431 // 1073 - SYS_MAKECONTEXT = 0x432 // 1074 - SYS_SWAPCONTEXT = 0x433 // 1075 - SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 // 1076 - SYS_GETCLIENTID = 0x470 // 1136 - SYS___GETCLIENTID = 0x471 // 1137 - SYS_GETSTABLESIZE = 0x472 // 1138 - SYS_GETIBMOPT = 0x473 // 1139 - SYS_GETIBMSOCKOPT = 0x474 // 1140 - SYS_GIVESOCKET = 0x475 // 1141 - SYS_IBMSFLUSH = 0x476 // 1142 - SYS_MAXDESC = 0x477 // 1143 - SYS_SETIBMOPT = 0x478 // 1144 - SYS_SETIBMSOCKOPT = 0x479 // 1145 - SYS_SOCK_DEBUG = 0x47A // 1146 - SYS_SOCK_DO_TESTSTOR = 0x47D // 1149 - SYS_TAKESOCKET = 0x47E // 1150 - SYS___SERVER_INIT = 0x47F // 1151 - SYS___SERVER_PWU = 0x480 // 1152 - SYS_PTHREAD_TAG_NP = 0x481 // 1153 - SYS___CONSOLE = 0x482 // 1154 - SYS___WSINIT = 0x483 // 1155 - SYS___IPTCPN = 0x489 // 1161 - SYS___SMF_RECORD = 0x48A // 1162 - SYS___IPHOST = 0x48B // 1163 - SYS___IPNODE = 0x48C // 1164 - SYS___SERVER_CLASSIFY_CREATE = 0x48D // 1165 - SYS___SERVER_CLASSIFY_DESTROY = 0x48E // 1166 - SYS___SERVER_CLASSIFY_RESET = 0x48F // 1167 - SYS___SERVER_CLASSIFY = 0x490 // 1168 - SYS___HEAPRPT = 0x496 // 1174 - SYS___FNWSA = 0x49B // 1179 - SYS___SPAWN2 = 0x49D // 1181 - SYS___SPAWNP2 = 0x49E // 1182 - SYS___GDRR = 0x4A1 // 1185 - SYS___HRRNO = 0x4A2 // 1186 - SYS___OPRG = 0x4A3 // 1187 - SYS___OPRR = 0x4A4 // 1188 - SYS___OPND = 0x4A5 // 1189 - SYS___OPPT = 0x4A6 // 1190 - SYS___SIGGM = 0x4A7 // 1191 - SYS___DGHT = 0x4A8 // 1192 - SYS___TZNE = 0x4A9 // 1193 - SYS___TZZN = 0x4AA // 1194 - SYS___TRRNO = 0x4AF // 1199 - SYS___ENVN = 0x4B0 // 1200 - SYS___MLOCKALL = 0x4B1 // 1201 - SYS_CREATEWO = 0x4B2 // 1202 - SYS_CREATEWORKUNIT = 0x4B2 // 1202 - SYS_CONTINUE = 0x4B3 // 1203 - SYS_CONTINUEWORKUNIT = 0x4B3 // 1203 - SYS_CONNECTW = 0x4B4 // 1204 - SYS_CONNECTWORKMGR = 0x4B4 // 1204 - SYS_CONNECTS = 0x4B5 // 1205 - SYS_CONNECTSERVER = 0x4B5 // 1205 - SYS_DISCONNE = 0x4B6 // 1206 - SYS_DISCONNECTSERVER = 0x4B6 // 1206 - SYS_JOINWORK = 0x4B7 // 1207 - SYS_JOINWORKUNIT = 0x4B7 // 1207 - SYS_LEAVEWOR = 0x4B8 // 1208 - SYS_LEAVEWORKUNIT = 0x4B8 // 1208 - SYS_DELETEWO = 0x4B9 // 1209 - SYS_DELETEWORKUNIT = 0x4B9 // 1209 - SYS_QUERYMET = 0x4BA // 1210 - SYS_QUERYMETRICS = 0x4BA // 1210 - SYS_QUERYSCH = 0x4BB // 1211 - SYS_QUERYSCHENV = 0x4BB // 1211 - SYS_CHECKSCH = 0x4BC // 1212 - SYS_CHECKSCHENV = 0x4BC // 1212 - SYS___PID_AFFINITY = 0x4BD // 1213 - SYS___ASINH_B = 0x4BE // 1214 - SYS___ATAN_B = 0x4BF // 1215 - SYS___CBRT_B = 0x4C0 // 1216 - SYS___CEIL_B = 0x4C1 // 1217 - SYS_COPYSIGN = 0x4C2 // 1218 - SYS___COS_B = 0x4C3 // 1219 - SYS___ERF_B = 0x4C4 // 1220 - SYS___ERFC_B = 0x4C5 // 1221 - SYS___EXPM1_B = 0x4C6 // 1222 - SYS___FABS_B = 0x4C7 // 1223 - SYS_FINITE = 0x4C8 // 1224 - SYS___FLOOR_B = 0x4C9 // 1225 - SYS___FREXP_B = 0x4CA // 1226 - SYS___ILOGB_B = 0x4CB // 1227 - SYS___ISNAN_B = 0x4CC // 1228 - SYS___LDEXP_B = 0x4CD // 1229 - SYS___LOG1P_B = 0x4CE // 1230 - SYS___LOGB_B = 0x4CF // 1231 - SYS_MATHERR = 0x4D0 // 1232 - SYS___MODF_B = 0x4D1 // 1233 - SYS___NEXTAFTER_B = 0x4D2 // 1234 - SYS___RINT_B = 0x4D3 // 1235 - SYS_SCALBN = 0x4D4 // 1236 - SYS_SIGNIFIC = 0x4D5 // 1237 - SYS_SIGNIFICAND = 0x4D5 // 1237 - SYS___SIN_B = 0x4D6 // 1238 - SYS___TAN_B = 0x4D7 // 1239 - SYS___TANH_B = 0x4D8 // 1240 - SYS___ACOS_B = 0x4D9 // 1241 - SYS___ACOSH_B = 0x4DA // 1242 - SYS___ASIN_B = 0x4DB // 1243 - SYS___ATAN2_B = 0x4DC // 1244 - SYS___ATANH_B = 0x4DD // 1245 - SYS___COSH_B = 0x4DE // 1246 - SYS___EXP_B = 0x4DF // 1247 - SYS___FMOD_B = 0x4E0 // 1248 - SYS___GAMMA_B = 0x4E1 // 1249 - SYS_GAMMA_R = 0x4E2 // 1250 - SYS___HYPOT_B = 0x4E3 // 1251 - SYS___J0_B = 0x4E4 // 1252 - SYS___Y0_B = 0x4E5 // 1253 - SYS___J1_B = 0x4E6 // 1254 - SYS___Y1_B = 0x4E7 // 1255 - SYS___JN_B = 0x4E8 // 1256 - SYS___YN_B = 0x4E9 // 1257 - SYS___LGAMMA_B = 0x4EA // 1258 - SYS_LGAMMA_R = 0x4EB // 1259 - SYS___LOG_B = 0x4EC // 1260 - SYS___LOG10_B = 0x4ED // 1261 - SYS___POW_B = 0x4EE // 1262 - SYS___REMAINDER_B = 0x4EF // 1263 - SYS___SCALB_B = 0x4F0 // 1264 - SYS___SINH_B = 0x4F1 // 1265 - SYS___SQRT_B = 0x4F2 // 1266 - SYS___OPENDIR2 = 0x4F3 // 1267 - SYS___READDIR2 = 0x4F4 // 1268 - SYS___LOGIN = 0x4F5 // 1269 - SYS___OPEN_STAT = 0x4F6 // 1270 - SYS_ACCEPT_AND_RECV = 0x4F7 // 1271 - SYS___FP_SETMODE = 0x4F8 // 1272 - SYS___SIGACTIONSET = 0x4FB // 1275 - SYS___UCREATE = 0x4FC // 1276 - SYS___UMALLOC = 0x4FD // 1277 - SYS___UFREE = 0x4FE // 1278 - SYS___UHEAPREPORT = 0x4FF // 1279 - SYS___ISBFP = 0x500 // 1280 - SYS___FP_CAST = 0x501 // 1281 - SYS___CERTIFICATE = 0x502 // 1282 - SYS_SEND_FILE = 0x503 // 1283 - SYS_AIO_CANCEL = 0x504 // 1284 - SYS_AIO_ERROR = 0x505 // 1285 - SYS_AIO_READ = 0x506 // 1286 - SYS_AIO_RETURN = 0x507 // 1287 - SYS_AIO_SUSPEND = 0x508 // 1288 - SYS_AIO_WRITE = 0x509 // 1289 - SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A // 1290 - SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B // 1291 - SYS_PTHREAD_RWLOCK_DESTROY = 0x50C // 1292 - SYS_PTHREAD_RWLOCK_INIT = 0x50D // 1293 - SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E // 1294 - SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F // 1295 - SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 // 1296 - SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 // 1297 - SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 // 1298 - SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 // 1299 - SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 // 1300 - SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 // 1301 - SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 // 1302 - SYS___CTTBL = 0x517 // 1303 - SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 // 1304 - SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 // 1305 - SYS___FP_CLR_FLAG = 0x51A // 1306 - SYS___FP_READ_FLAG = 0x51B // 1307 - SYS___FP_RAISE_XCP = 0x51C // 1308 - SYS___FP_CLASS = 0x51D // 1309 - SYS___FP_FINITE = 0x51E // 1310 - SYS___FP_ISNAN = 0x51F // 1311 - SYS___FP_UNORDERED = 0x520 // 1312 - SYS___FP_READ_RND = 0x521 // 1313 - SYS___FP_READ_RND_B = 0x522 // 1314 - SYS___FP_SWAP_RND = 0x523 // 1315 - SYS___FP_SWAP_RND_B = 0x524 // 1316 - SYS___FP_LEVEL = 0x525 // 1317 - SYS___FP_BTOH = 0x526 // 1318 - SYS___FP_HTOB = 0x527 // 1319 - SYS___FPC_RD = 0x528 // 1320 - SYS___FPC_WR = 0x529 // 1321 - SYS___FPC_RW = 0x52A // 1322 - SYS___FPC_SM = 0x52B // 1323 - SYS___FPC_RS = 0x52C // 1324 - SYS_SIGTIMEDWAIT = 0x52D // 1325 - SYS_SIGWAITINFO = 0x52E // 1326 - SYS___CHKBFP = 0x52F // 1327 - SYS___W_PIOCTL = 0x59E // 1438 - SYS___OSENV = 0x59F // 1439 - SYS_EXPORTWO = 0x5A1 // 1441 - SYS_EXPORTWORKUNIT = 0x5A1 // 1441 - SYS_UNDOEXPO = 0x5A2 // 1442 - SYS_UNDOEXPORTWORKUNIT = 0x5A2 // 1442 - SYS_IMPORTWO = 0x5A3 // 1443 - SYS_IMPORTWORKUNIT = 0x5A3 // 1443 - SYS_UNDOIMPO = 0x5A4 // 1444 - SYS_UNDOIMPORTWORKUNIT = 0x5A4 // 1444 - SYS_EXTRACTW = 0x5A5 // 1445 - SYS_EXTRACTWORKUNIT = 0x5A5 // 1445 - SYS___CPL = 0x5A6 // 1446 - SYS___MAP_INIT = 0x5A7 // 1447 - SYS___MAP_SERVICE = 0x5A8 // 1448 - SYS_SIGQUEUE = 0x5A9 // 1449 - SYS___MOUNT = 0x5AA // 1450 - SYS___GETUSERID = 0x5AB // 1451 - SYS___IPDOMAINNAME = 0x5AC // 1452 - SYS_QUERYENC = 0x5AD // 1453 - SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD // 1453 - SYS_CONNECTE = 0x5AE // 1454 - SYS_CONNECTEXPORTIMPORT = 0x5AE // 1454 - SYS___FP_SWAPMODE = 0x5AF // 1455 - SYS_STRTOLL = 0x5B0 // 1456 - SYS_STRTOULL = 0x5B1 // 1457 - SYS___DSA_PREV = 0x5B2 // 1458 - SYS___EP_FIND = 0x5B3 // 1459 - SYS___SERVER_THREADS_QUERY = 0x5B4 // 1460 - SYS___MSGRCV_TIMED = 0x5B7 // 1463 - SYS___SEMOP_TIMED = 0x5B8 // 1464 - SYS___GET_CPUID = 0x5B9 // 1465 - SYS___GET_SYSTEM_SETTINGS = 0x5BA // 1466 - SYS_FTELLO = 0x5C8 // 1480 - SYS_FSEEKO = 0x5C9 // 1481 - SYS_LLDIV = 0x5CB // 1483 - SYS_WCSTOLL = 0x5CC // 1484 - SYS_WCSTOULL = 0x5CD // 1485 - SYS_LLABS = 0x5CE // 1486 - SYS___CONSOLE2 = 0x5D2 // 1490 - SYS_INET_NTOP = 0x5D3 // 1491 - SYS_INET_PTON = 0x5D4 // 1492 - SYS___RES = 0x5D6 // 1494 - SYS_RES_MKQUERY = 0x5D7 // 1495 - SYS_RES_INIT = 0x5D8 // 1496 - SYS_RES_QUERY = 0x5D9 // 1497 - SYS_RES_SEARCH = 0x5DA // 1498 - SYS_RES_SEND = 0x5DB // 1499 - SYS_RES_QUERYDOMAIN = 0x5DC // 1500 - SYS_DN_EXPAND = 0x5DD // 1501 - SYS_DN_SKIPNAME = 0x5DE // 1502 - SYS_DN_COMP = 0x5DF // 1503 - SYS_ASCTIME_R = 0x5E0 // 1504 - SYS_CTIME_R = 0x5E1 // 1505 - SYS_GMTIME_R = 0x5E2 // 1506 - SYS_LOCALTIME_R = 0x5E3 // 1507 - SYS_RAND_R = 0x5E4 // 1508 - SYS_STRTOK_R = 0x5E5 // 1509 - SYS_READDIR_R = 0x5E6 // 1510 - SYS_GETGRGID_R = 0x5E7 // 1511 - SYS_GETGRNAM_R = 0x5E8 // 1512 - SYS_GETLOGIN_R = 0x5E9 // 1513 - SYS_GETPWNAM_R = 0x5EA // 1514 - SYS_GETPWUID_R = 0x5EB // 1515 - SYS_TTYNAME_R = 0x5EC // 1516 - SYS_PTHREAD_ATFORK = 0x5ED // 1517 - SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE // 1518 - SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF // 1519 - SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 // 1520 - SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 // 1521 - SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 // 1522 - SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 // 1523 - SYS_PTHREAD_GETCONCURRENCY = 0x5F4 // 1524 - SYS_PTHREAD_KEY_DELETE = 0x5F5 // 1525 - SYS_PTHREAD_SETCONCURRENCY = 0x5F6 // 1526 - SYS_PTHREAD_SIGMASK = 0x5F7 // 1527 - SYS___DISCARDDATA = 0x5F8 // 1528 - SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 // 1529 - SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA // 1530 - SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB // 1531 - SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC // 1532 - SYS_PTHREAD_DETACH_U98 = 0x5FD // 1533 - SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE // 1534 - SYS_PTHREAD_SETCANCELSTATE = 0x5FF // 1535 - SYS_PTHREAD_SETCANCELTYPE = 0x600 // 1536 - SYS_PTHREAD_TESTCANCEL = 0x601 // 1537 - SYS___ATANF_B = 0x602 // 1538 - SYS___ATANL_B = 0x603 // 1539 - SYS___CEILF_B = 0x604 // 1540 - SYS___CEILL_B = 0x605 // 1541 - SYS___COSF_B = 0x606 // 1542 - SYS___COSL_B = 0x607 // 1543 - SYS___FABSF_B = 0x608 // 1544 - SYS___FABSL_B = 0x609 // 1545 - SYS___FLOORF_B = 0x60A // 1546 - SYS___FLOORL_B = 0x60B // 1547 - SYS___FREXPF_B = 0x60C // 1548 - SYS___FREXPL_B = 0x60D // 1549 - SYS___LDEXPF_B = 0x60E // 1550 - SYS___LDEXPL_B = 0x60F // 1551 - SYS___SINF_B = 0x610 // 1552 - SYS___SINL_B = 0x611 // 1553 - SYS___TANF_B = 0x612 // 1554 - SYS___TANL_B = 0x613 // 1555 - SYS___TANHF_B = 0x614 // 1556 - SYS___TANHL_B = 0x615 // 1557 - SYS___ACOSF_B = 0x616 // 1558 - SYS___ACOSL_B = 0x617 // 1559 - SYS___ASINF_B = 0x618 // 1560 - SYS___ASINL_B = 0x619 // 1561 - SYS___ATAN2F_B = 0x61A // 1562 - SYS___ATAN2L_B = 0x61B // 1563 - SYS___COSHF_B = 0x61C // 1564 - SYS___COSHL_B = 0x61D // 1565 - SYS___EXPF_B = 0x61E // 1566 - SYS___EXPL_B = 0x61F // 1567 - SYS___LOGF_B = 0x620 // 1568 - SYS___LOGL_B = 0x621 // 1569 - SYS___LOG10F_B = 0x622 // 1570 - SYS___LOG10L_B = 0x623 // 1571 - SYS___POWF_B = 0x624 // 1572 - SYS___POWL_B = 0x625 // 1573 - SYS___SINHF_B = 0x626 // 1574 - SYS___SINHL_B = 0x627 // 1575 - SYS___SQRTF_B = 0x628 // 1576 - SYS___SQRTL_B = 0x629 // 1577 - SYS___ABSF_B = 0x62A // 1578 - SYS___ABS_B = 0x62B // 1579 - SYS___ABSL_B = 0x62C // 1580 - SYS___FMODF_B = 0x62D // 1581 - SYS___FMODL_B = 0x62E // 1582 - SYS___MODFF_B = 0x62F // 1583 - SYS___MODFL_B = 0x630 // 1584 - SYS_ABSF = 0x631 // 1585 - SYS_ABSL = 0x632 // 1586 - SYS_ACOSF = 0x633 // 1587 - SYS_ACOSL = 0x634 // 1588 - SYS_ASINF = 0x635 // 1589 - SYS_ASINL = 0x636 // 1590 - SYS_ATAN2F = 0x637 // 1591 - SYS_ATAN2L = 0x638 // 1592 - SYS_ATANF = 0x639 // 1593 - SYS_ATANL = 0x63A // 1594 - SYS_CEILF = 0x63B // 1595 - SYS_CEILL = 0x63C // 1596 - SYS_COSF = 0x63D // 1597 - SYS_COSL = 0x63E // 1598 - SYS_COSHF = 0x63F // 1599 - SYS_COSHL = 0x640 // 1600 - SYS_EXPF = 0x641 // 1601 - SYS_EXPL = 0x642 // 1602 - SYS_TANHF = 0x643 // 1603 - SYS_TANHL = 0x644 // 1604 - SYS_LOG10F = 0x645 // 1605 - SYS_LOG10L = 0x646 // 1606 - SYS_LOGF = 0x647 // 1607 - SYS_LOGL = 0x648 // 1608 - SYS_POWF = 0x649 // 1609 - SYS_POWL = 0x64A // 1610 - SYS_SINF = 0x64B // 1611 - SYS_SINL = 0x64C // 1612 - SYS_SQRTF = 0x64D // 1613 - SYS_SQRTL = 0x64E // 1614 - SYS_SINHF = 0x64F // 1615 - SYS_SINHL = 0x650 // 1616 - SYS_TANF = 0x651 // 1617 - SYS_TANL = 0x652 // 1618 - SYS_FABSF = 0x653 // 1619 - SYS_FABSL = 0x654 // 1620 - SYS_FLOORF = 0x655 // 1621 - SYS_FLOORL = 0x656 // 1622 - SYS_FMODF = 0x657 // 1623 - SYS_FMODL = 0x658 // 1624 - SYS_FREXPF = 0x659 // 1625 - SYS_FREXPL = 0x65A // 1626 - SYS_LDEXPF = 0x65B // 1627 - SYS_LDEXPL = 0x65C // 1628 - SYS_MODFF = 0x65D // 1629 - SYS_MODFL = 0x65E // 1630 - SYS_BTOWC = 0x65F // 1631 - SYS___CHATTR = 0x660 // 1632 - SYS___FCHATTR = 0x661 // 1633 - SYS___TOCCSID = 0x662 // 1634 - SYS___CSNAMETYPE = 0x663 // 1635 - SYS___TOCSNAME = 0x664 // 1636 - SYS___CCSIDTYPE = 0x665 // 1637 - SYS___AE_CORRESTBL_QUERY = 0x666 // 1638 - SYS___AE_AUTOCONVERT_STATE = 0x667 // 1639 - SYS_DN_FIND = 0x668 // 1640 - SYS___GETHOSTBYADDR_A = 0x669 // 1641 - SYS___GETHOSTBYNAME_A = 0x66A // 1642 - SYS___RES_INIT_A = 0x66B // 1643 - SYS___GETHOSTBYADDR_R_A = 0x66C // 1644 - SYS___GETHOSTBYNAME_R_A = 0x66D // 1645 - SYS___CHARMAP_INIT_A = 0x66E // 1646 - SYS___MBLEN_A = 0x66F // 1647 - SYS___MBLEN_SB_A = 0x670 // 1648 - SYS___MBLEN_STD_A = 0x671 // 1649 - SYS___MBLEN_UTF = 0x672 // 1650 - SYS___MBSTOWCS_A = 0x673 // 1651 - SYS___MBSTOWCS_STD_A = 0x674 // 1652 - SYS___MBTOWC_A = 0x675 // 1653 - SYS___MBTOWC_ISO1 = 0x676 // 1654 - SYS___MBTOWC_SBCS = 0x677 // 1655 - SYS___MBTOWC_MBCS = 0x678 // 1656 - SYS___MBTOWC_UTF = 0x679 // 1657 - SYS___WCSTOMBS_A = 0x67A // 1658 - SYS___WCSTOMBS_STD_A = 0x67B // 1659 - SYS___WCSWIDTH_A = 0x67C // 1660 - SYS___GETGRGID_R_A = 0x67D // 1661 - SYS___WCSWIDTH_STD_A = 0x67E // 1662 - SYS___WCSWIDTH_ASIA = 0x67F // 1663 - SYS___CSID_A = 0x680 // 1664 - SYS___CSID_STD_A = 0x681 // 1665 - SYS___WCSID_A = 0x682 // 1666 - SYS___WCSID_STD_A = 0x683 // 1667 - SYS___WCTOMB_A = 0x684 // 1668 - SYS___WCTOMB_ISO1 = 0x685 // 1669 - SYS___WCTOMB_STD_A = 0x686 // 1670 - SYS___WCTOMB_UTF = 0x687 // 1671 - SYS___WCWIDTH_A = 0x688 // 1672 - SYS___GETGRNAM_R_A = 0x689 // 1673 - SYS___WCWIDTH_STD_A = 0x68A // 1674 - SYS___WCWIDTH_ASIA = 0x68B // 1675 - SYS___GETPWNAM_R_A = 0x68C // 1676 - SYS___GETPWUID_R_A = 0x68D // 1677 - SYS___GETLOGIN_R_A = 0x68E // 1678 - SYS___TTYNAME_R_A = 0x68F // 1679 - SYS___READDIR_R_A = 0x690 // 1680 - SYS___E2A_S = 0x691 // 1681 - SYS___FNMATCH_A = 0x692 // 1682 - SYS___FNMATCH_C_A = 0x693 // 1683 - SYS___EXECL_A = 0x694 // 1684 - SYS___FNMATCH_STD_A = 0x695 // 1685 - SYS___REGCOMP_A = 0x696 // 1686 - SYS___REGCOMP_STD_A = 0x697 // 1687 - SYS___REGERROR_A = 0x698 // 1688 - SYS___REGERROR_STD_A = 0x699 // 1689 - SYS___REGEXEC_A = 0x69A // 1690 - SYS___REGEXEC_STD_A = 0x69B // 1691 - SYS___REGFREE_A = 0x69C // 1692 - SYS___REGFREE_STD_A = 0x69D // 1693 - SYS___STRCOLL_A = 0x69E // 1694 - SYS___STRCOLL_C_A = 0x69F // 1695 - SYS___EXECLE_A = 0x6A0 // 1696 - SYS___STRCOLL_STD_A = 0x6A1 // 1697 - SYS___STRXFRM_A = 0x6A2 // 1698 - SYS___STRXFRM_C_A = 0x6A3 // 1699 - SYS___EXECLP_A = 0x6A4 // 1700 - SYS___STRXFRM_STD_A = 0x6A5 // 1701 - SYS___WCSCOLL_A = 0x6A6 // 1702 - SYS___WCSCOLL_C_A = 0x6A7 // 1703 - SYS___WCSCOLL_STD_A = 0x6A8 // 1704 - SYS___WCSXFRM_A = 0x6A9 // 1705 - SYS___WCSXFRM_C_A = 0x6AA // 1706 - SYS___WCSXFRM_STD_A = 0x6AB // 1707 - SYS___COLLATE_INIT_A = 0x6AC // 1708 - SYS___WCTYPE_A = 0x6AD // 1709 - SYS___GET_WCTYPE_STD_A = 0x6AE // 1710 - SYS___CTYPE_INIT_A = 0x6AF // 1711 - SYS___ISWCTYPE_A = 0x6B0 // 1712 - SYS___EXECV_A = 0x6B1 // 1713 - SYS___IS_WCTYPE_STD_A = 0x6B2 // 1714 - SYS___TOWLOWER_A = 0x6B3 // 1715 - SYS___TOWLOWER_STD_A = 0x6B4 // 1716 - SYS___TOWUPPER_A = 0x6B5 // 1717 - SYS___TOWUPPER_STD_A = 0x6B6 // 1718 - SYS___LOCALE_INIT_A = 0x6B7 // 1719 - SYS___LOCALECONV_A = 0x6B8 // 1720 - SYS___LOCALECONV_STD_A = 0x6B9 // 1721 - SYS___NL_LANGINFO_A = 0x6BA // 1722 - SYS___NL_LNAGINFO_STD_A = 0x6BB // 1723 - SYS___MONETARY_INIT_A = 0x6BC // 1724 - SYS___STRFMON_A = 0x6BD // 1725 - SYS___STRFMON_STD_A = 0x6BE // 1726 - SYS___GETADDRINFO_A = 0x6BF // 1727 - SYS___CATGETS_A = 0x6C0 // 1728 - SYS___EXECVE_A = 0x6C1 // 1729 - SYS___EXECVP_A = 0x6C2 // 1730 - SYS___SPAWN_A = 0x6C3 // 1731 - SYS___GETNAMEINFO_A = 0x6C4 // 1732 - SYS___SPAWNP_A = 0x6C5 // 1733 - SYS___NUMERIC_INIT_A = 0x6C6 // 1734 - SYS___RESP_INIT_A = 0x6C7 // 1735 - SYS___RPMATCH_A = 0x6C8 // 1736 - SYS___RPMATCH_C_A = 0x6C9 // 1737 - SYS___RPMATCH_STD_A = 0x6CA // 1738 - SYS___TIME_INIT_A = 0x6CB // 1739 - SYS___STRFTIME_A = 0x6CC // 1740 - SYS___STRFTIME_STD_A = 0x6CD // 1741 - SYS___STRPTIME_A = 0x6CE // 1742 - SYS___STRPTIME_STD_A = 0x6CF // 1743 - SYS___WCSFTIME_A = 0x6D0 // 1744 - SYS___WCSFTIME_STD_A = 0x6D1 // 1745 - SYS_____SPAWN2_A = 0x6D2 // 1746 - SYS_____SPAWNP2_A = 0x6D3 // 1747 - SYS___SYNTAX_INIT_A = 0x6D4 // 1748 - SYS___TOD_INIT_A = 0x6D5 // 1749 - SYS___NL_CSINFO_A = 0x6D6 // 1750 - SYS___NL_MONINFO_A = 0x6D7 // 1751 - SYS___NL_NUMINFO_A = 0x6D8 // 1752 - SYS___NL_RESPINFO_A = 0x6D9 // 1753 - SYS___NL_TIMINFO_A = 0x6DA // 1754 - SYS___IF_NAMETOINDEX_A = 0x6DB // 1755 - SYS___IF_INDEXTONAME_A = 0x6DC // 1756 - SYS___PRINTF_A = 0x6DD // 1757 - SYS___ICONV_OPEN_A = 0x6DE // 1758 - SYS___DLLLOAD_A = 0x6DF // 1759 - SYS___DLLQUERYFN_A = 0x6E0 // 1760 - SYS___DLLQUERYVAR_A = 0x6E1 // 1761 - SYS_____CHATTR_A = 0x6E2 // 1762 - SYS___E2A_L = 0x6E3 // 1763 - SYS_____TOCCSID_A = 0x6E4 // 1764 - SYS_____TOCSNAME_A = 0x6E5 // 1765 - SYS_____CCSIDTYPE_A = 0x6E6 // 1766 - SYS_____CSNAMETYPE_A = 0x6E7 // 1767 - SYS___CHMOD_A = 0x6E8 // 1768 - SYS___MKDIR_A = 0x6E9 // 1769 - SYS___STAT_A = 0x6EA // 1770 - SYS___STAT_O_A = 0x6EB // 1771 - SYS___MKFIFO_A = 0x6EC // 1772 - SYS_____OPEN_STAT_A = 0x6ED // 1773 - SYS___LSTAT_A = 0x6EE // 1774 - SYS___LSTAT_O_A = 0x6EF // 1775 - SYS___MKNOD_A = 0x6F0 // 1776 - SYS___MOUNT_A = 0x6F1 // 1777 - SYS___UMOUNT_A = 0x6F2 // 1778 - SYS___CHAUDIT_A = 0x6F4 // 1780 - SYS___W_GETMNTENT_A = 0x6F5 // 1781 - SYS___CREAT_A = 0x6F6 // 1782 - SYS___OPEN_A = 0x6F7 // 1783 - SYS___SETLOCALE_A = 0x6F9 // 1785 - SYS___FPRINTF_A = 0x6FA // 1786 - SYS___SPRINTF_A = 0x6FB // 1787 - SYS___VFPRINTF_A = 0x6FC // 1788 - SYS___VPRINTF_A = 0x6FD // 1789 - SYS___VSPRINTF_A = 0x6FE // 1790 - SYS___VSWPRINTF_A = 0x6FF // 1791 - SYS___SWPRINTF_A = 0x700 // 1792 - SYS___FSCANF_A = 0x701 // 1793 - SYS___SCANF_A = 0x702 // 1794 - SYS___SSCANF_A = 0x703 // 1795 - SYS___SWSCANF_A = 0x704 // 1796 - SYS___ATOF_A = 0x705 // 1797 - SYS___ATOI_A = 0x706 // 1798 - SYS___ATOL_A = 0x707 // 1799 - SYS___STRTOD_A = 0x708 // 1800 - SYS___STRTOL_A = 0x709 // 1801 - SYS___STRTOUL_A = 0x70A // 1802 - SYS_____AE_CORRESTBL_QUERY_A = 0x70B // 1803 - SYS___A64L_A = 0x70C // 1804 - SYS___ECVT_A = 0x70D // 1805 - SYS___FCVT_A = 0x70E // 1806 - SYS___GCVT_A = 0x70F // 1807 - SYS___L64A_A = 0x710 // 1808 - SYS___STRERROR_A = 0x711 // 1809 - SYS___PERROR_A = 0x712 // 1810 - SYS___FETCH_A = 0x713 // 1811 - SYS___GETENV_A = 0x714 // 1812 - SYS___MKSTEMP_A = 0x717 // 1815 - SYS___PTSNAME_A = 0x718 // 1816 - SYS___PUTENV_A = 0x719 // 1817 - SYS___REALPATH_A = 0x71A // 1818 - SYS___SETENV_A = 0x71B // 1819 - SYS___SYSTEM_A = 0x71C // 1820 - SYS___GETOPT_A = 0x71D // 1821 - SYS___CATOPEN_A = 0x71E // 1822 - SYS___ACCESS_A = 0x71F // 1823 - SYS___CHDIR_A = 0x720 // 1824 - SYS___CHOWN_A = 0x721 // 1825 - SYS___CHROOT_A = 0x722 // 1826 - SYS___GETCWD_A = 0x723 // 1827 - SYS___GETWD_A = 0x724 // 1828 - SYS___LCHOWN_A = 0x725 // 1829 - SYS___LINK_A = 0x726 // 1830 - SYS___PATHCONF_A = 0x727 // 1831 - SYS___IF_NAMEINDEX_A = 0x728 // 1832 - SYS___READLINK_A = 0x729 // 1833 - SYS___RMDIR_A = 0x72A // 1834 - SYS___STATVFS_A = 0x72B // 1835 - SYS___SYMLINK_A = 0x72C // 1836 - SYS___TRUNCATE_A = 0x72D // 1837 - SYS___UNLINK_A = 0x72E // 1838 - SYS___GAI_STRERROR_A = 0x72F // 1839 - SYS___EXTLINK_NP_A = 0x730 // 1840 - SYS___ISALNUM_A = 0x731 // 1841 - SYS___ISALPHA_A = 0x732 // 1842 - SYS___A2E_S = 0x733 // 1843 - SYS___ISCNTRL_A = 0x734 // 1844 - SYS___ISDIGIT_A = 0x735 // 1845 - SYS___ISGRAPH_A = 0x736 // 1846 - SYS___ISLOWER_A = 0x737 // 1847 - SYS___ISPRINT_A = 0x738 // 1848 - SYS___ISPUNCT_A = 0x739 // 1849 - SYS___ISSPACE_A = 0x73A // 1850 - SYS___ISUPPER_A = 0x73B // 1851 - SYS___ISXDIGIT_A = 0x73C // 1852 - SYS___TOLOWER_A = 0x73D // 1853 - SYS___TOUPPER_A = 0x73E // 1854 - SYS___ISWALNUM_A = 0x73F // 1855 - SYS___ISWALPHA_A = 0x740 // 1856 - SYS___A2E_L = 0x741 // 1857 - SYS___ISWCNTRL_A = 0x742 // 1858 - SYS___ISWDIGIT_A = 0x743 // 1859 - SYS___ISWGRAPH_A = 0x744 // 1860 - SYS___ISWLOWER_A = 0x745 // 1861 - SYS___ISWPRINT_A = 0x746 // 1862 - SYS___ISWPUNCT_A = 0x747 // 1863 - SYS___ISWSPACE_A = 0x748 // 1864 - SYS___ISWUPPER_A = 0x749 // 1865 - SYS___ISWXDIGIT_A = 0x74A // 1866 - SYS___CONFSTR_A = 0x74B // 1867 - SYS___FTOK_A = 0x74C // 1868 - SYS___MKTEMP_A = 0x74D // 1869 - SYS___FDOPEN_A = 0x74E // 1870 - SYS___FLDATA_A = 0x74F // 1871 - SYS___REMOVE_A = 0x750 // 1872 - SYS___RENAME_A = 0x751 // 1873 - SYS___TMPNAM_A = 0x752 // 1874 - SYS___FOPEN_A = 0x753 // 1875 - SYS___FREOPEN_A = 0x754 // 1876 - SYS___CUSERID_A = 0x755 // 1877 - SYS___POPEN_A = 0x756 // 1878 - SYS___TEMPNAM_A = 0x757 // 1879 - SYS___FTW_A = 0x758 // 1880 - SYS___GETGRENT_A = 0x759 // 1881 - SYS___GETGRGID_A = 0x75A // 1882 - SYS___GETGRNAM_A = 0x75B // 1883 - SYS___GETGROUPSBYNAME_A = 0x75C // 1884 - SYS___GETHOSTENT_A = 0x75D // 1885 - SYS___GETHOSTNAME_A = 0x75E // 1886 - SYS___GETLOGIN_A = 0x75F // 1887 - SYS___INET_NTOP_A = 0x760 // 1888 - SYS___GETPASS_A = 0x761 // 1889 - SYS___GETPWENT_A = 0x762 // 1890 - SYS___GETPWNAM_A = 0x763 // 1891 - SYS___GETPWUID_A = 0x764 // 1892 - SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 // 1893 - SYS___CHECKSCHENV_A = 0x766 // 1894 - SYS___CONNECTSERVER_A = 0x767 // 1895 - SYS___CONNECTWORKMGR_A = 0x768 // 1896 - SYS_____CONSOLE_A = 0x769 // 1897 - SYS___CREATEWORKUNIT_A = 0x76A // 1898 - SYS___CTERMID_A = 0x76B // 1899 - SYS___FMTMSG_A = 0x76C // 1900 - SYS___INITGROUPS_A = 0x76D // 1901 - SYS_____LOGIN_A = 0x76E // 1902 - SYS___MSGRCV_A = 0x76F // 1903 - SYS___MSGSND_A = 0x770 // 1904 - SYS___MSGXRCV_A = 0x771 // 1905 - SYS___NFTW_A = 0x772 // 1906 - SYS_____PASSWD_A = 0x773 // 1907 - SYS___PTHREAD_SECURITY_NP_A = 0x774 // 1908 - SYS___QUERYMETRICS_A = 0x775 // 1909 - SYS___QUERYSCHENV = 0x776 // 1910 - SYS___READV_A = 0x777 // 1911 - SYS_____SERVER_CLASSIFY_A = 0x778 // 1912 - SYS_____SERVER_INIT_A = 0x779 // 1913 - SYS_____SERVER_PWU_A = 0x77A // 1914 - SYS___STRCASECMP_A = 0x77B // 1915 - SYS___STRNCASECMP_A = 0x77C // 1916 - SYS___TTYNAME_A = 0x77D // 1917 - SYS___UNAME_A = 0x77E // 1918 - SYS___UTIMES_A = 0x77F // 1919 - SYS___W_GETPSENT_A = 0x780 // 1920 - SYS___WRITEV_A = 0x781 // 1921 - SYS___W_STATFS_A = 0x782 // 1922 - SYS___W_STATVFS_A = 0x783 // 1923 - SYS___FPUTC_A = 0x784 // 1924 - SYS___PUTCHAR_A = 0x785 // 1925 - SYS___PUTS_A = 0x786 // 1926 - SYS___FGETS_A = 0x787 // 1927 - SYS___GETS_A = 0x788 // 1928 - SYS___FPUTS_A = 0x789 // 1929 - SYS___FREAD_A = 0x78A // 1930 - SYS___FWRITE_A = 0x78B // 1931 - SYS___OPEN_O_A = 0x78C // 1932 - SYS___ISASCII = 0x78D // 1933 - SYS___CREAT_O_A = 0x78E // 1934 - SYS___ENVNA = 0x78F // 1935 - SYS___PUTC_A = 0x790 // 1936 - SYS___AE_THREAD_SETMODE = 0x791 // 1937 - SYS___AE_THREAD_SWAPMODE = 0x792 // 1938 - SYS___GETNETBYADDR_A = 0x793 // 1939 - SYS___GETNETBYNAME_A = 0x794 // 1940 - SYS___GETNETENT_A = 0x795 // 1941 - SYS___GETPROTOBYNAME_A = 0x796 // 1942 - SYS___GETPROTOBYNUMBER_A = 0x797 // 1943 - SYS___GETPROTOENT_A = 0x798 // 1944 - SYS___GETSERVBYNAME_A = 0x799 // 1945 - SYS___GETSERVBYPORT_A = 0x79A // 1946 - SYS___GETSERVENT_A = 0x79B // 1947 - SYS___ASCTIME_A = 0x79C // 1948 - SYS___CTIME_A = 0x79D // 1949 - SYS___GETDATE_A = 0x79E // 1950 - SYS___TZSET_A = 0x79F // 1951 - SYS___UTIME_A = 0x7A0 // 1952 - SYS___ASCTIME_R_A = 0x7A1 // 1953 - SYS___CTIME_R_A = 0x7A2 // 1954 - SYS___STRTOLL_A = 0x7A3 // 1955 - SYS___STRTOULL_A = 0x7A4 // 1956 - SYS___FPUTWC_A = 0x7A5 // 1957 - SYS___PUTWC_A = 0x7A6 // 1958 - SYS___PUTWCHAR_A = 0x7A7 // 1959 - SYS___FPUTWS_A = 0x7A8 // 1960 - SYS___UNGETWC_A = 0x7A9 // 1961 - SYS___FGETWC_A = 0x7AA // 1962 - SYS___GETWC_A = 0x7AB // 1963 - SYS___GETWCHAR_A = 0x7AC // 1964 - SYS___FGETWS_A = 0x7AD // 1965 - SYS___GETTIMEOFDAY_A = 0x7AE // 1966 - SYS___GMTIME_A = 0x7AF // 1967 - SYS___GMTIME_R_A = 0x7B0 // 1968 - SYS___LOCALTIME_A = 0x7B1 // 1969 - SYS___LOCALTIME_R_A = 0x7B2 // 1970 - SYS___MKTIME_A = 0x7B3 // 1971 - SYS___TZZNA = 0x7B4 // 1972 - SYS_UNATEXIT = 0x7B5 // 1973 - SYS___CEE3DMP_A = 0x7B6 // 1974 - SYS___CDUMP_A = 0x7B7 // 1975 - SYS___CSNAP_A = 0x7B8 // 1976 - SYS___CTEST_A = 0x7B9 // 1977 - SYS___CTRACE_A = 0x7BA // 1978 - SYS___VSWPRNTF2_A = 0x7BB // 1979 - SYS___INET_PTON_A = 0x7BC // 1980 - SYS___SYSLOG_A = 0x7BD // 1981 - SYS___CRYPT_A = 0x7BE // 1982 - SYS_____OPENDIR2_A = 0x7BF // 1983 - SYS_____READDIR2_A = 0x7C0 // 1984 - SYS___OPENDIR_A = 0x7C2 // 1986 - SYS___READDIR_A = 0x7C3 // 1987 - SYS_PREAD = 0x7C7 // 1991 - SYS_PWRITE = 0x7C8 // 1992 - SYS_M_CREATE_LAYOUT = 0x7C9 // 1993 - SYS_M_DESTROY_LAYOUT = 0x7CA // 1994 - SYS_M_GETVALUES_LAYOUT = 0x7CB // 1995 - SYS_M_SETVALUES_LAYOUT = 0x7CC // 1996 - SYS_M_TRANSFORM_LAYOUT = 0x7CD // 1997 - SYS_M_WTRANSFORM_LAYOUT = 0x7CE // 1998 - SYS_FWPRINTF = 0x7D1 // 2001 - SYS_WPRINTF = 0x7D2 // 2002 - SYS_VFWPRINT = 0x7D3 // 2003 - SYS_VFWPRINTF = 0x7D3 // 2003 - SYS_VWPRINTF = 0x7D4 // 2004 - SYS_FWSCANF = 0x7D5 // 2005 - SYS_WSCANF = 0x7D6 // 2006 - SYS_WCTRANS = 0x7D7 // 2007 - SYS_TOWCTRAN = 0x7D8 // 2008 - SYS_TOWCTRANS = 0x7D8 // 2008 - SYS___WCSTOD_A = 0x7D9 // 2009 - SYS___WCSTOL_A = 0x7DA // 2010 - SYS___WCSTOUL_A = 0x7DB // 2011 - SYS___BASENAME_A = 0x7DC // 2012 - SYS___DIRNAME_A = 0x7DD // 2013 - SYS___GLOB_A = 0x7DE // 2014 - SYS_FWIDE = 0x7DF // 2015 - SYS___OSNAME = 0x7E0 // 2016 - SYS_____OSNAME_A = 0x7E1 // 2017 - SYS___BTOWC_A = 0x7E4 // 2020 - SYS___WCTOB_A = 0x7E5 // 2021 - SYS___DBM_OPEN_A = 0x7E6 // 2022 - SYS___VFPRINTF2_A = 0x7E7 // 2023 - SYS___VPRINTF2_A = 0x7E8 // 2024 - SYS___VSPRINTF2_A = 0x7E9 // 2025 - SYS___CEIL_H = 0x7EA // 2026 - SYS___FLOOR_H = 0x7EB // 2027 - SYS___MODF_H = 0x7EC // 2028 - SYS___FABS_H = 0x7ED // 2029 - SYS___J0_H = 0x7EE // 2030 - SYS___J1_H = 0x7EF // 2031 - SYS___JN_H = 0x7F0 // 2032 - SYS___Y0_H = 0x7F1 // 2033 - SYS___Y1_H = 0x7F2 // 2034 - SYS___YN_H = 0x7F3 // 2035 - SYS___CEILF_H = 0x7F4 // 2036 - SYS___CEILL_H = 0x7F5 // 2037 - SYS___FLOORF_H = 0x7F6 // 2038 - SYS___FLOORL_H = 0x7F7 // 2039 - SYS___MODFF_H = 0x7F8 // 2040 - SYS___MODFL_H = 0x7F9 // 2041 - SYS___FABSF_H = 0x7FA // 2042 - SYS___FABSL_H = 0x7FB // 2043 - SYS___MALLOC24 = 0x7FC // 2044 - SYS___MALLOC31 = 0x7FD // 2045 - SYS_ACL_INIT = 0x7FE // 2046 - SYS_ACL_FREE = 0x7FF // 2047 - SYS_ACL_FIRST_ENTRY = 0x800 // 2048 - SYS_ACL_GET_ENTRY = 0x801 // 2049 - SYS_ACL_VALID = 0x802 // 2050 - SYS_ACL_CREATE_ENTRY = 0x803 // 2051 - SYS_ACL_DELETE_ENTRY = 0x804 // 2052 - SYS_ACL_UPDATE_ENTRY = 0x805 // 2053 - SYS_ACL_DELETE_FD = 0x806 // 2054 - SYS_ACL_DELETE_FILE = 0x807 // 2055 - SYS_ACL_GET_FD = 0x808 // 2056 - SYS_ACL_GET_FILE = 0x809 // 2057 - SYS_ACL_SET_FD = 0x80A // 2058 - SYS_ACL_SET_FILE = 0x80B // 2059 - SYS_ACL_FROM_TEXT = 0x80C // 2060 - SYS_ACL_TO_TEXT = 0x80D // 2061 - SYS_ACL_SORT = 0x80E // 2062 - SYS___SHUTDOWN_REGISTRATION = 0x80F // 2063 - SYS___ERFL_B = 0x810 // 2064 - SYS___ERFCL_B = 0x811 // 2065 - SYS___LGAMMAL_B = 0x812 // 2066 - SYS___SETHOOKEVENTS = 0x813 // 2067 - SYS_IF_NAMETOINDEX = 0x814 // 2068 - SYS_IF_INDEXTONAME = 0x815 // 2069 - SYS_IF_NAMEINDEX = 0x816 // 2070 - SYS_IF_FREENAMEINDEX = 0x817 // 2071 - SYS_GETADDRINFO = 0x818 // 2072 - SYS_GETNAMEINFO = 0x819 // 2073 - SYS_FREEADDRINFO = 0x81A // 2074 - SYS_GAI_STRERROR = 0x81B // 2075 - SYS_REXEC_AF = 0x81C // 2076 - SYS___POE = 0x81D // 2077 - SYS___DYNALLOC_A = 0x81F // 2079 - SYS___DYNFREE_A = 0x820 // 2080 - SYS___RES_QUERY_A = 0x821 // 2081 - SYS___RES_SEARCH_A = 0x822 // 2082 - SYS___RES_QUERYDOMAIN_A = 0x823 // 2083 - SYS___RES_MKQUERY_A = 0x824 // 2084 - SYS___RES_SEND_A = 0x825 // 2085 - SYS___DN_EXPAND_A = 0x826 // 2086 - SYS___DN_SKIPNAME_A = 0x827 // 2087 - SYS___DN_COMP_A = 0x828 // 2088 - SYS___DN_FIND_A = 0x829 // 2089 - SYS___NLIST_A = 0x82A // 2090 - SYS_____TCGETCP_A = 0x82B // 2091 - SYS_____TCSETCP_A = 0x82C // 2092 - SYS_____W_PIOCTL_A = 0x82E // 2094 - SYS___INET_ADDR_A = 0x82F // 2095 - SYS___INET_NTOA_A = 0x830 // 2096 - SYS___INET_NETWORK_A = 0x831 // 2097 - SYS___ACCEPT_A = 0x832 // 2098 - SYS___ACCEPT_AND_RECV_A = 0x833 // 2099 - SYS___BIND_A = 0x834 // 2100 - SYS___CONNECT_A = 0x835 // 2101 - SYS___GETPEERNAME_A = 0x836 // 2102 - SYS___GETSOCKNAME_A = 0x837 // 2103 - SYS___RECVFROM_A = 0x838 // 2104 - SYS___SENDTO_A = 0x839 // 2105 - SYS___SENDMSG_A = 0x83A // 2106 - SYS___RECVMSG_A = 0x83B // 2107 - SYS_____LCHATTR_A = 0x83C // 2108 - SYS___CABEND = 0x83D // 2109 - SYS___LE_CIB_GET = 0x83E // 2110 - SYS___SET_LAA_FOR_JIT = 0x83F // 2111 - SYS___LCHATTR = 0x840 // 2112 - SYS___WRITEDOWN = 0x841 // 2113 - SYS_PTHREAD_MUTEX_INIT2 = 0x842 // 2114 - SYS___ACOSHF_B = 0x843 // 2115 - SYS___ACOSHL_B = 0x844 // 2116 - SYS___ASINHF_B = 0x845 // 2117 - SYS___ASINHL_B = 0x846 // 2118 - SYS___ATANHF_B = 0x847 // 2119 - SYS___ATANHL_B = 0x848 // 2120 - SYS___CBRTF_B = 0x849 // 2121 - SYS___CBRTL_B = 0x84A // 2122 - SYS___COPYSIGNF_B = 0x84B // 2123 - SYS___COPYSIGNL_B = 0x84C // 2124 - SYS___COTANF_B = 0x84D // 2125 - SYS___COTAN_B = 0x84E // 2126 - SYS___COTANL_B = 0x84F // 2127 - SYS___EXP2F_B = 0x850 // 2128 - SYS___EXP2L_B = 0x851 // 2129 - SYS___EXPM1F_B = 0x852 // 2130 - SYS___EXPM1L_B = 0x853 // 2131 - SYS___FDIMF_B = 0x854 // 2132 - SYS___FDIM_B = 0x855 // 2133 - SYS___FDIML_B = 0x856 // 2134 - SYS___HYPOTF_B = 0x857 // 2135 - SYS___HYPOTL_B = 0x858 // 2136 - SYS___LOG1PF_B = 0x859 // 2137 - SYS___LOG1PL_B = 0x85A // 2138 - SYS___LOG2F_B = 0x85B // 2139 - SYS___LOG2_B = 0x85C // 2140 - SYS___LOG2L_B = 0x85D // 2141 - SYS___REMAINDERF_B = 0x85E // 2142 - SYS___REMAINDERL_B = 0x85F // 2143 - SYS___REMQUOF_B = 0x860 // 2144 - SYS___REMQUO_B = 0x861 // 2145 - SYS___REMQUOL_B = 0x862 // 2146 - SYS___TGAMMAF_B = 0x863 // 2147 - SYS___TGAMMA_B = 0x864 // 2148 - SYS___TGAMMAL_B = 0x865 // 2149 - SYS___TRUNCF_B = 0x866 // 2150 - SYS___TRUNC_B = 0x867 // 2151 - SYS___TRUNCL_B = 0x868 // 2152 - SYS___LGAMMAF_B = 0x869 // 2153 - SYS___LROUNDF_B = 0x86A // 2154 - SYS___LROUND_B = 0x86B // 2155 - SYS___ERFF_B = 0x86C // 2156 - SYS___ERFCF_B = 0x86D // 2157 - SYS_ACOSHF = 0x86E // 2158 - SYS_ACOSHL = 0x86F // 2159 - SYS_ASINHF = 0x870 // 2160 - SYS_ASINHL = 0x871 // 2161 - SYS_ATANHF = 0x872 // 2162 - SYS_ATANHL = 0x873 // 2163 - SYS_CBRTF = 0x874 // 2164 - SYS_CBRTL = 0x875 // 2165 - SYS_COPYSIGNF = 0x876 // 2166 - SYS_CPYSIGNF = 0x876 // 2166 - SYS_COPYSIGNL = 0x877 // 2167 - SYS_CPYSIGNL = 0x877 // 2167 - SYS_COTANF = 0x878 // 2168 - SYS___COTANF = 0x878 // 2168 - SYS_COTAN = 0x879 // 2169 - SYS___COTAN = 0x879 // 2169 - SYS_COTANL = 0x87A // 2170 - SYS___COTANL = 0x87A // 2170 - SYS_EXP2F = 0x87B // 2171 - SYS_EXP2L = 0x87C // 2172 - SYS_EXPM1F = 0x87D // 2173 - SYS_EXPM1L = 0x87E // 2174 - SYS_FDIMF = 0x87F // 2175 - SYS_FDIM = 0x881 // 2177 - SYS_FDIML = 0x882 // 2178 - SYS_HYPOTF = 0x883 // 2179 - SYS_HYPOTL = 0x884 // 2180 - SYS_LOG1PF = 0x885 // 2181 - SYS_LOG1PL = 0x886 // 2182 - SYS_LOG2F = 0x887 // 2183 - SYS_LOG2 = 0x888 // 2184 - SYS_LOG2L = 0x889 // 2185 - SYS_REMAINDERF = 0x88A // 2186 - SYS_REMAINDF = 0x88A // 2186 - SYS_REMAINDERL = 0x88B // 2187 - SYS_REMAINDL = 0x88B // 2187 - SYS_REMQUOF = 0x88C // 2188 - SYS_REMQUO = 0x88D // 2189 - SYS_REMQUOL = 0x88E // 2190 - SYS_TGAMMAF = 0x88F // 2191 - SYS_TGAMMA = 0x890 // 2192 - SYS_TGAMMAL = 0x891 // 2193 - SYS_TRUNCF = 0x892 // 2194 - SYS_TRUNC = 0x893 // 2195 - SYS_TRUNCL = 0x894 // 2196 - SYS_LGAMMAF = 0x895 // 2197 - SYS_LGAMMAL = 0x896 // 2198 - SYS_LROUNDF = 0x897 // 2199 - SYS_LROUND = 0x898 // 2200 - SYS_ERFF = 0x899 // 2201 - SYS_ERFL = 0x89A // 2202 - SYS_ERFCF = 0x89B // 2203 - SYS_ERFCL = 0x89C // 2204 - SYS___EXP2_B = 0x89D // 2205 - SYS_EXP2 = 0x89E // 2206 - SYS___FAR_JUMP = 0x89F // 2207 - SYS___TCGETATTR_A = 0x8A1 // 2209 - SYS___TCSETATTR_A = 0x8A2 // 2210 - SYS___SUPERKILL = 0x8A4 // 2212 - SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 // 2213 - SYS___LE_MSG_ADD_INSERT = 0x8A6 // 2214 - SYS___LE_MSG_GET = 0x8A7 // 2215 - SYS___LE_MSG_GET_AND_WRITE = 0x8A8 // 2216 - SYS___LE_MSG_WRITE = 0x8A9 // 2217 - SYS___ITOA = 0x8AA // 2218 - SYS___UTOA = 0x8AB // 2219 - SYS___LTOA = 0x8AC // 2220 - SYS___ULTOA = 0x8AD // 2221 - SYS___LLTOA = 0x8AE // 2222 - SYS___ULLTOA = 0x8AF // 2223 - SYS___ITOA_A = 0x8B0 // 2224 - SYS___UTOA_A = 0x8B1 // 2225 - SYS___LTOA_A = 0x8B2 // 2226 - SYS___ULTOA_A = 0x8B3 // 2227 - SYS___LLTOA_A = 0x8B4 // 2228 - SYS___ULLTOA_A = 0x8B5 // 2229 - SYS_____GETENV_A = 0x8C3 // 2243 - SYS___REXEC_A = 0x8C4 // 2244 - SYS___REXEC_AF_A = 0x8C5 // 2245 - SYS___GETUTXENT_A = 0x8C6 // 2246 - SYS___GETUTXID_A = 0x8C7 // 2247 - SYS___GETUTXLINE_A = 0x8C8 // 2248 - SYS___PUTUTXLINE_A = 0x8C9 // 2249 - SYS_____UTMPXNAME_A = 0x8CA // 2250 - SYS___PUTC_UNLOCKED_A = 0x8CB // 2251 - SYS___PUTCHAR_UNLOCKED_A = 0x8CC // 2252 - SYS___SNPRINTF_A = 0x8CD // 2253 - SYS___VSNPRINTF_A = 0x8CE // 2254 - SYS___DLOPEN_A = 0x8D0 // 2256 - SYS___DLSYM_A = 0x8D1 // 2257 - SYS___DLERROR_A = 0x8D2 // 2258 - SYS_FLOCKFILE = 0x8D3 // 2259 - SYS_FTRYLOCKFILE = 0x8D4 // 2260 - SYS_FUNLOCKFILE = 0x8D5 // 2261 - SYS_GETC_UNLOCKED = 0x8D6 // 2262 - SYS_GETCHAR_UNLOCKED = 0x8D7 // 2263 - SYS_PUTC_UNLOCKED = 0x8D8 // 2264 - SYS_PUTCHAR_UNLOCKED = 0x8D9 // 2265 - SYS_SNPRINTF = 0x8DA // 2266 - SYS_VSNPRINTF = 0x8DB // 2267 - SYS_DLOPEN = 0x8DD // 2269 - SYS_DLSYM = 0x8DE // 2270 - SYS_DLCLOSE = 0x8DF // 2271 - SYS_DLERROR = 0x8E0 // 2272 - SYS___SET_EXCEPTION_HANDLER = 0x8E2 // 2274 - SYS___RESET_EXCEPTION_HANDLER = 0x8E3 // 2275 - SYS___VHM_EVENT = 0x8E4 // 2276 - SYS___ABS_H = 0x8E6 // 2278 - SYS___ABSF_H = 0x8E7 // 2279 - SYS___ABSL_H = 0x8E8 // 2280 - SYS___ACOS_H = 0x8E9 // 2281 - SYS___ACOSF_H = 0x8EA // 2282 - SYS___ACOSL_H = 0x8EB // 2283 - SYS___ACOSH_H = 0x8EC // 2284 - SYS___ASIN_H = 0x8ED // 2285 - SYS___ASINF_H = 0x8EE // 2286 - SYS___ASINL_H = 0x8EF // 2287 - SYS___ASINH_H = 0x8F0 // 2288 - SYS___ATAN_H = 0x8F1 // 2289 - SYS___ATANF_H = 0x8F2 // 2290 - SYS___ATANL_H = 0x8F3 // 2291 - SYS___ATANH_H = 0x8F4 // 2292 - SYS___ATANHF_H = 0x8F5 // 2293 - SYS___ATANHL_H = 0x8F6 // 2294 - SYS___ATAN2_H = 0x8F7 // 2295 - SYS___ATAN2F_H = 0x8F8 // 2296 - SYS___ATAN2L_H = 0x8F9 // 2297 - SYS___CBRT_H = 0x8FA // 2298 - SYS___COPYSIGNF_H = 0x8FB // 2299 - SYS___COPYSIGNL_H = 0x8FC // 2300 - SYS___COS_H = 0x8FD // 2301 - SYS___COSF_H = 0x8FE // 2302 - SYS___COSL_H = 0x8FF // 2303 - SYS___COSHF_H = 0x900 // 2304 - SYS___COSHL_H = 0x901 // 2305 - SYS___COTAN_H = 0x902 // 2306 - SYS___COTANF_H = 0x903 // 2307 - SYS___COTANL_H = 0x904 // 2308 - SYS___ERF_H = 0x905 // 2309 - SYS___ERFF_H = 0x906 // 2310 - SYS___ERFL_H = 0x907 // 2311 - SYS___ERFC_H = 0x908 // 2312 - SYS___ERFCF_H = 0x909 // 2313 - SYS___ERFCL_H = 0x90A // 2314 - SYS___EXP_H = 0x90B // 2315 - SYS___EXPF_H = 0x90C // 2316 - SYS___EXPL_H = 0x90D // 2317 - SYS___EXPM1_H = 0x90E // 2318 - SYS___FDIM_H = 0x90F // 2319 - SYS___FDIMF_H = 0x910 // 2320 - SYS___FDIML_H = 0x911 // 2321 - SYS___FMOD_H = 0x912 // 2322 - SYS___FMODF_H = 0x913 // 2323 - SYS___FMODL_H = 0x914 // 2324 - SYS___GAMMA_H = 0x915 // 2325 - SYS___HYPOT_H = 0x916 // 2326 - SYS___ILOGB_H = 0x917 // 2327 - SYS___LGAMMA_H = 0x918 // 2328 - SYS___LGAMMAF_H = 0x919 // 2329 - SYS___LOG_H = 0x91A // 2330 - SYS___LOGF_H = 0x91B // 2331 - SYS___LOGL_H = 0x91C // 2332 - SYS___LOGB_H = 0x91D // 2333 - SYS___LOG2_H = 0x91E // 2334 - SYS___LOG2F_H = 0x91F // 2335 - SYS___LOG2L_H = 0x920 // 2336 - SYS___LOG1P_H = 0x921 // 2337 - SYS___LOG10_H = 0x922 // 2338 - SYS___LOG10F_H = 0x923 // 2339 - SYS___LOG10L_H = 0x924 // 2340 - SYS___LROUND_H = 0x925 // 2341 - SYS___LROUNDF_H = 0x926 // 2342 - SYS___NEXTAFTER_H = 0x927 // 2343 - SYS___POW_H = 0x928 // 2344 - SYS___POWF_H = 0x929 // 2345 - SYS___POWL_H = 0x92A // 2346 - SYS___REMAINDER_H = 0x92B // 2347 - SYS___RINT_H = 0x92C // 2348 - SYS___SCALB_H = 0x92D // 2349 - SYS___SIN_H = 0x92E // 2350 - SYS___SINF_H = 0x92F // 2351 - SYS___SINL_H = 0x930 // 2352 - SYS___SINH_H = 0x931 // 2353 - SYS___SINHF_H = 0x932 // 2354 - SYS___SINHL_H = 0x933 // 2355 - SYS___SQRT_H = 0x934 // 2356 - SYS___SQRTF_H = 0x935 // 2357 - SYS___SQRTL_H = 0x936 // 2358 - SYS___TAN_H = 0x937 // 2359 - SYS___TANF_H = 0x938 // 2360 - SYS___TANL_H = 0x939 // 2361 - SYS___TANH_H = 0x93A // 2362 - SYS___TANHF_H = 0x93B // 2363 - SYS___TANHL_H = 0x93C // 2364 - SYS___TGAMMA_H = 0x93D // 2365 - SYS___TGAMMAF_H = 0x93E // 2366 - SYS___TRUNC_H = 0x93F // 2367 - SYS___TRUNCF_H = 0x940 // 2368 - SYS___TRUNCL_H = 0x941 // 2369 - SYS___COSH_H = 0x942 // 2370 - SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 // 2371 - SYS_VFSCANF = 0x944 // 2372 - SYS_VSCANF = 0x946 // 2374 - SYS_VSSCANF = 0x948 // 2376 - SYS_VFWSCANF = 0x94A // 2378 - SYS_VWSCANF = 0x94C // 2380 - SYS_VSWSCANF = 0x94E // 2382 - SYS_IMAXABS = 0x950 // 2384 - SYS_IMAXDIV = 0x951 // 2385 - SYS_STRTOIMAX = 0x952 // 2386 - SYS_STRTOUMAX = 0x953 // 2387 - SYS_WCSTOIMAX = 0x954 // 2388 - SYS_WCSTOUMAX = 0x955 // 2389 - SYS_ATOLL = 0x956 // 2390 - SYS_STRTOF = 0x957 // 2391 - SYS_STRTOLD = 0x958 // 2392 - SYS_WCSTOF = 0x959 // 2393 - SYS_WCSTOLD = 0x95A // 2394 - SYS_INET6_RTH_SPACE = 0x95B // 2395 - SYS_INET6_RTH_INIT = 0x95C // 2396 - SYS_INET6_RTH_ADD = 0x95D // 2397 - SYS_INET6_RTH_REVERSE = 0x95E // 2398 - SYS_INET6_RTH_SEGMENTS = 0x95F // 2399 - SYS_INET6_RTH_GETADDR = 0x960 // 2400 - SYS_INET6_OPT_INIT = 0x961 // 2401 - SYS_INET6_OPT_APPEND = 0x962 // 2402 - SYS_INET6_OPT_FINISH = 0x963 // 2403 - SYS_INET6_OPT_SET_VAL = 0x964 // 2404 - SYS_INET6_OPT_NEXT = 0x965 // 2405 - SYS_INET6_OPT_FIND = 0x966 // 2406 - SYS_INET6_OPT_GET_VAL = 0x967 // 2407 - SYS___POW_I = 0x987 // 2439 - SYS___POW_I_B = 0x988 // 2440 - SYS___POW_I_H = 0x989 // 2441 - SYS___POW_II = 0x98A // 2442 - SYS___POW_II_B = 0x98B // 2443 - SYS___POW_II_H = 0x98C // 2444 - SYS_CABS = 0x98E // 2446 - SYS___CABS_B = 0x98F // 2447 - SYS___CABS_H = 0x990 // 2448 - SYS_CABSF = 0x991 // 2449 - SYS___CABSF_B = 0x992 // 2450 - SYS___CABSF_H = 0x993 // 2451 - SYS_CABSL = 0x994 // 2452 - SYS___CABSL_B = 0x995 // 2453 - SYS___CABSL_H = 0x996 // 2454 - SYS_CACOS = 0x997 // 2455 - SYS___CACOS_B = 0x998 // 2456 - SYS___CACOS_H = 0x999 // 2457 - SYS_CACOSF = 0x99A // 2458 - SYS___CACOSF_B = 0x99B // 2459 - SYS___CACOSF_H = 0x99C // 2460 - SYS_CACOSL = 0x99D // 2461 - SYS___CACOSL_B = 0x99E // 2462 - SYS___CACOSL_H = 0x99F // 2463 - SYS_CACOSH = 0x9A0 // 2464 - SYS___CACOSH_B = 0x9A1 // 2465 - SYS___CACOSH_H = 0x9A2 // 2466 - SYS_CACOSHF = 0x9A3 // 2467 - SYS___CACOSHF_B = 0x9A4 // 2468 - SYS___CACOSHF_H = 0x9A5 // 2469 - SYS_CACOSHL = 0x9A6 // 2470 - SYS___CACOSHL_B = 0x9A7 // 2471 - SYS___CACOSHL_H = 0x9A8 // 2472 - SYS_CARG = 0x9A9 // 2473 - SYS___CARG_B = 0x9AA // 2474 - SYS___CARG_H = 0x9AB // 2475 - SYS_CARGF = 0x9AC // 2476 - SYS___CARGF_B = 0x9AD // 2477 - SYS___CARGF_H = 0x9AE // 2478 - SYS_CARGL = 0x9AF // 2479 - SYS___CARGL_B = 0x9B0 // 2480 - SYS___CARGL_H = 0x9B1 // 2481 - SYS_CASIN = 0x9B2 // 2482 - SYS___CASIN_B = 0x9B3 // 2483 - SYS___CASIN_H = 0x9B4 // 2484 - SYS_CASINF = 0x9B5 // 2485 - SYS___CASINF_B = 0x9B6 // 2486 - SYS___CASINF_H = 0x9B7 // 2487 - SYS_CASINL = 0x9B8 // 2488 - SYS___CASINL_B = 0x9B9 // 2489 - SYS___CASINL_H = 0x9BA // 2490 - SYS_CASINH = 0x9BB // 2491 - SYS___CASINH_B = 0x9BC // 2492 - SYS___CASINH_H = 0x9BD // 2493 - SYS_CASINHF = 0x9BE // 2494 - SYS___CASINHF_B = 0x9BF // 2495 - SYS___CASINHF_H = 0x9C0 // 2496 - SYS_CASINHL = 0x9C1 // 2497 - SYS___CASINHL_B = 0x9C2 // 2498 - SYS___CASINHL_H = 0x9C3 // 2499 - SYS_CATAN = 0x9C4 // 2500 - SYS___CATAN_B = 0x9C5 // 2501 - SYS___CATAN_H = 0x9C6 // 2502 - SYS_CATANF = 0x9C7 // 2503 - SYS___CATANF_B = 0x9C8 // 2504 - SYS___CATANF_H = 0x9C9 // 2505 - SYS_CATANL = 0x9CA // 2506 - SYS___CATANL_B = 0x9CB // 2507 - SYS___CATANL_H = 0x9CC // 2508 - SYS_CATANH = 0x9CD // 2509 - SYS___CATANH_B = 0x9CE // 2510 - SYS___CATANH_H = 0x9CF // 2511 - SYS_CATANHF = 0x9D0 // 2512 - SYS___CATANHF_B = 0x9D1 // 2513 - SYS___CATANHF_H = 0x9D2 // 2514 - SYS_CATANHL = 0x9D3 // 2515 - SYS___CATANHL_B = 0x9D4 // 2516 - SYS___CATANHL_H = 0x9D5 // 2517 - SYS_CCOS = 0x9D6 // 2518 - SYS___CCOS_B = 0x9D7 // 2519 - SYS___CCOS_H = 0x9D8 // 2520 - SYS_CCOSF = 0x9D9 // 2521 - SYS___CCOSF_B = 0x9DA // 2522 - SYS___CCOSF_H = 0x9DB // 2523 - SYS_CCOSL = 0x9DC // 2524 - SYS___CCOSL_B = 0x9DD // 2525 - SYS___CCOSL_H = 0x9DE // 2526 - SYS_CCOSH = 0x9DF // 2527 - SYS___CCOSH_B = 0x9E0 // 2528 - SYS___CCOSH_H = 0x9E1 // 2529 - SYS_CCOSHF = 0x9E2 // 2530 - SYS___CCOSHF_B = 0x9E3 // 2531 - SYS___CCOSHF_H = 0x9E4 // 2532 - SYS_CCOSHL = 0x9E5 // 2533 - SYS___CCOSHL_B = 0x9E6 // 2534 - SYS___CCOSHL_H = 0x9E7 // 2535 - SYS_CEXP = 0x9E8 // 2536 - SYS___CEXP_B = 0x9E9 // 2537 - SYS___CEXP_H = 0x9EA // 2538 - SYS_CEXPF = 0x9EB // 2539 - SYS___CEXPF_B = 0x9EC // 2540 - SYS___CEXPF_H = 0x9ED // 2541 - SYS_CEXPL = 0x9EE // 2542 - SYS___CEXPL_B = 0x9EF // 2543 - SYS___CEXPL_H = 0x9F0 // 2544 - SYS_CIMAG = 0x9F1 // 2545 - SYS___CIMAG_B = 0x9F2 // 2546 - SYS___CIMAG_H = 0x9F3 // 2547 - SYS_CIMAGF = 0x9F4 // 2548 - SYS___CIMAGF_B = 0x9F5 // 2549 - SYS___CIMAGF_H = 0x9F6 // 2550 - SYS_CIMAGL = 0x9F7 // 2551 - SYS___CIMAGL_B = 0x9F8 // 2552 - SYS___CIMAGL_H = 0x9F9 // 2553 - SYS___CLOG = 0x9FA // 2554 - SYS___CLOG_B = 0x9FB // 2555 - SYS___CLOG_H = 0x9FC // 2556 - SYS_CLOGF = 0x9FD // 2557 - SYS___CLOGF_B = 0x9FE // 2558 - SYS___CLOGF_H = 0x9FF // 2559 - SYS_CLOGL = 0xA00 // 2560 - SYS___CLOGL_B = 0xA01 // 2561 - SYS___CLOGL_H = 0xA02 // 2562 - SYS_CONJ = 0xA03 // 2563 - SYS___CONJ_B = 0xA04 // 2564 - SYS___CONJ_H = 0xA05 // 2565 - SYS_CONJF = 0xA06 // 2566 - SYS___CONJF_B = 0xA07 // 2567 - SYS___CONJF_H = 0xA08 // 2568 - SYS_CONJL = 0xA09 // 2569 - SYS___CONJL_B = 0xA0A // 2570 - SYS___CONJL_H = 0xA0B // 2571 - SYS_CPOW = 0xA0C // 2572 - SYS___CPOW_B = 0xA0D // 2573 - SYS___CPOW_H = 0xA0E // 2574 - SYS_CPOWF = 0xA0F // 2575 - SYS___CPOWF_B = 0xA10 // 2576 - SYS___CPOWF_H = 0xA11 // 2577 - SYS_CPOWL = 0xA12 // 2578 - SYS___CPOWL_B = 0xA13 // 2579 - SYS___CPOWL_H = 0xA14 // 2580 - SYS_CPROJ = 0xA15 // 2581 - SYS___CPROJ_B = 0xA16 // 2582 - SYS___CPROJ_H = 0xA17 // 2583 - SYS_CPROJF = 0xA18 // 2584 - SYS___CPROJF_B = 0xA19 // 2585 - SYS___CPROJF_H = 0xA1A // 2586 - SYS_CPROJL = 0xA1B // 2587 - SYS___CPROJL_B = 0xA1C // 2588 - SYS___CPROJL_H = 0xA1D // 2589 - SYS_CREAL = 0xA1E // 2590 - SYS___CREAL_B = 0xA1F // 2591 - SYS___CREAL_H = 0xA20 // 2592 - SYS_CREALF = 0xA21 // 2593 - SYS___CREALF_B = 0xA22 // 2594 - SYS___CREALF_H = 0xA23 // 2595 - SYS_CREALL = 0xA24 // 2596 - SYS___CREALL_B = 0xA25 // 2597 - SYS___CREALL_H = 0xA26 // 2598 - SYS_CSIN = 0xA27 // 2599 - SYS___CSIN_B = 0xA28 // 2600 - SYS___CSIN_H = 0xA29 // 2601 - SYS_CSINF = 0xA2A // 2602 - SYS___CSINF_B = 0xA2B // 2603 - SYS___CSINF_H = 0xA2C // 2604 - SYS_CSINL = 0xA2D // 2605 - SYS___CSINL_B = 0xA2E // 2606 - SYS___CSINL_H = 0xA2F // 2607 - SYS_CSINH = 0xA30 // 2608 - SYS___CSINH_B = 0xA31 // 2609 - SYS___CSINH_H = 0xA32 // 2610 - SYS_CSINHF = 0xA33 // 2611 - SYS___CSINHF_B = 0xA34 // 2612 - SYS___CSINHF_H = 0xA35 // 2613 - SYS_CSINHL = 0xA36 // 2614 - SYS___CSINHL_B = 0xA37 // 2615 - SYS___CSINHL_H = 0xA38 // 2616 - SYS_CSQRT = 0xA39 // 2617 - SYS___CSQRT_B = 0xA3A // 2618 - SYS___CSQRT_H = 0xA3B // 2619 - SYS_CSQRTF = 0xA3C // 2620 - SYS___CSQRTF_B = 0xA3D // 2621 - SYS___CSQRTF_H = 0xA3E // 2622 - SYS_CSQRTL = 0xA3F // 2623 - SYS___CSQRTL_B = 0xA40 // 2624 - SYS___CSQRTL_H = 0xA41 // 2625 - SYS_CTAN = 0xA42 // 2626 - SYS___CTAN_B = 0xA43 // 2627 - SYS___CTAN_H = 0xA44 // 2628 - SYS_CTANF = 0xA45 // 2629 - SYS___CTANF_B = 0xA46 // 2630 - SYS___CTANF_H = 0xA47 // 2631 - SYS_CTANL = 0xA48 // 2632 - SYS___CTANL_B = 0xA49 // 2633 - SYS___CTANL_H = 0xA4A // 2634 - SYS_CTANH = 0xA4B // 2635 - SYS___CTANH_B = 0xA4C // 2636 - SYS___CTANH_H = 0xA4D // 2637 - SYS_CTANHF = 0xA4E // 2638 - SYS___CTANHF_B = 0xA4F // 2639 - SYS___CTANHF_H = 0xA50 // 2640 - SYS_CTANHL = 0xA51 // 2641 - SYS___CTANHL_B = 0xA52 // 2642 - SYS___CTANHL_H = 0xA53 // 2643 - SYS___ACOSHF_H = 0xA54 // 2644 - SYS___ACOSHL_H = 0xA55 // 2645 - SYS___ASINHF_H = 0xA56 // 2646 - SYS___ASINHL_H = 0xA57 // 2647 - SYS___CBRTF_H = 0xA58 // 2648 - SYS___CBRTL_H = 0xA59 // 2649 - SYS___COPYSIGN_B = 0xA5A // 2650 - SYS___EXPM1F_H = 0xA5B // 2651 - SYS___EXPM1L_H = 0xA5C // 2652 - SYS___EXP2_H = 0xA5D // 2653 - SYS___EXP2F_H = 0xA5E // 2654 - SYS___EXP2L_H = 0xA5F // 2655 - SYS___LOG1PF_H = 0xA60 // 2656 - SYS___LOG1PL_H = 0xA61 // 2657 - SYS___LGAMMAL_H = 0xA62 // 2658 - SYS_FMA = 0xA63 // 2659 - SYS___FMA_B = 0xA64 // 2660 - SYS___FMA_H = 0xA65 // 2661 - SYS_FMAF = 0xA66 // 2662 - SYS___FMAF_B = 0xA67 // 2663 - SYS___FMAF_H = 0xA68 // 2664 - SYS_FMAL = 0xA69 // 2665 - SYS___FMAL_B = 0xA6A // 2666 - SYS___FMAL_H = 0xA6B // 2667 - SYS_FMAX = 0xA6C // 2668 - SYS___FMAX_B = 0xA6D // 2669 - SYS___FMAX_H = 0xA6E // 2670 - SYS_FMAXF = 0xA6F // 2671 - SYS___FMAXF_B = 0xA70 // 2672 - SYS___FMAXF_H = 0xA71 // 2673 - SYS_FMAXL = 0xA72 // 2674 - SYS___FMAXL_B = 0xA73 // 2675 - SYS___FMAXL_H = 0xA74 // 2676 - SYS_FMIN = 0xA75 // 2677 - SYS___FMIN_B = 0xA76 // 2678 - SYS___FMIN_H = 0xA77 // 2679 - SYS_FMINF = 0xA78 // 2680 - SYS___FMINF_B = 0xA79 // 2681 - SYS___FMINF_H = 0xA7A // 2682 - SYS_FMINL = 0xA7B // 2683 - SYS___FMINL_B = 0xA7C // 2684 - SYS___FMINL_H = 0xA7D // 2685 - SYS_ILOGBF = 0xA7E // 2686 - SYS___ILOGBF_B = 0xA7F // 2687 - SYS___ILOGBF_H = 0xA80 // 2688 - SYS_ILOGBL = 0xA81 // 2689 - SYS___ILOGBL_B = 0xA82 // 2690 - SYS___ILOGBL_H = 0xA83 // 2691 - SYS_LLRINT = 0xA84 // 2692 - SYS___LLRINT_B = 0xA85 // 2693 - SYS___LLRINT_H = 0xA86 // 2694 - SYS_LLRINTF = 0xA87 // 2695 - SYS___LLRINTF_B = 0xA88 // 2696 - SYS___LLRINTF_H = 0xA89 // 2697 - SYS_LLRINTL = 0xA8A // 2698 - SYS___LLRINTL_B = 0xA8B // 2699 - SYS___LLRINTL_H = 0xA8C // 2700 - SYS_LLROUND = 0xA8D // 2701 - SYS___LLROUND_B = 0xA8E // 2702 - SYS___LLROUND_H = 0xA8F // 2703 - SYS_LLROUNDF = 0xA90 // 2704 - SYS___LLROUNDF_B = 0xA91 // 2705 - SYS___LLROUNDF_H = 0xA92 // 2706 - SYS_LLROUNDL = 0xA93 // 2707 - SYS___LLROUNDL_B = 0xA94 // 2708 - SYS___LLROUNDL_H = 0xA95 // 2709 - SYS_LOGBF = 0xA96 // 2710 - SYS___LOGBF_B = 0xA97 // 2711 - SYS___LOGBF_H = 0xA98 // 2712 - SYS_LOGBL = 0xA99 // 2713 - SYS___LOGBL_B = 0xA9A // 2714 - SYS___LOGBL_H = 0xA9B // 2715 - SYS_LRINT = 0xA9C // 2716 - SYS___LRINT_B = 0xA9D // 2717 - SYS___LRINT_H = 0xA9E // 2718 - SYS_LRINTF = 0xA9F // 2719 - SYS___LRINTF_B = 0xAA0 // 2720 - SYS___LRINTF_H = 0xAA1 // 2721 - SYS_LRINTL = 0xAA2 // 2722 - SYS___LRINTL_B = 0xAA3 // 2723 - SYS___LRINTL_H = 0xAA4 // 2724 - SYS_LROUNDL = 0xAA5 // 2725 - SYS___LROUNDL_B = 0xAA6 // 2726 - SYS___LROUNDL_H = 0xAA7 // 2727 - SYS_NAN = 0xAA8 // 2728 - SYS___NAN_B = 0xAA9 // 2729 - SYS_NANF = 0xAAA // 2730 - SYS___NANF_B = 0xAAB // 2731 - SYS_NANL = 0xAAC // 2732 - SYS___NANL_B = 0xAAD // 2733 - SYS_NEARBYINT = 0xAAE // 2734 - SYS___NEARBYINT_B = 0xAAF // 2735 - SYS___NEARBYINT_H = 0xAB0 // 2736 - SYS_NEARBYINTF = 0xAB1 // 2737 - SYS___NEARBYINTF_B = 0xAB2 // 2738 - SYS___NEARBYINTF_H = 0xAB3 // 2739 - SYS_NEARBYINTL = 0xAB4 // 2740 - SYS___NEARBYINTL_B = 0xAB5 // 2741 - SYS___NEARBYINTL_H = 0xAB6 // 2742 - SYS_NEXTAFTERF = 0xAB7 // 2743 - SYS___NEXTAFTERF_B = 0xAB8 // 2744 - SYS___NEXTAFTERF_H = 0xAB9 // 2745 - SYS_NEXTAFTERL = 0xABA // 2746 - SYS___NEXTAFTERL_B = 0xABB // 2747 - SYS___NEXTAFTERL_H = 0xABC // 2748 - SYS_NEXTTOWARD = 0xABD // 2749 - SYS___NEXTTOWARD_B = 0xABE // 2750 - SYS___NEXTTOWARD_H = 0xABF // 2751 - SYS_NEXTTOWARDF = 0xAC0 // 2752 - SYS___NEXTTOWARDF_B = 0xAC1 // 2753 - SYS___NEXTTOWARDF_H = 0xAC2 // 2754 - SYS_NEXTTOWARDL = 0xAC3 // 2755 - SYS___NEXTTOWARDL_B = 0xAC4 // 2756 - SYS___NEXTTOWARDL_H = 0xAC5 // 2757 - SYS___REMAINDERF_H = 0xAC6 // 2758 - SYS___REMAINDERL_H = 0xAC7 // 2759 - SYS___REMQUO_H = 0xAC8 // 2760 - SYS___REMQUOF_H = 0xAC9 // 2761 - SYS___REMQUOL_H = 0xACA // 2762 - SYS_RINTF = 0xACB // 2763 - SYS___RINTF_B = 0xACC // 2764 - SYS_RINTL = 0xACD // 2765 - SYS___RINTL_B = 0xACE // 2766 - SYS_ROUND = 0xACF // 2767 - SYS___ROUND_B = 0xAD0 // 2768 - SYS___ROUND_H = 0xAD1 // 2769 - SYS_ROUNDF = 0xAD2 // 2770 - SYS___ROUNDF_B = 0xAD3 // 2771 - SYS___ROUNDF_H = 0xAD4 // 2772 - SYS_ROUNDL = 0xAD5 // 2773 - SYS___ROUNDL_B = 0xAD6 // 2774 - SYS___ROUNDL_H = 0xAD7 // 2775 - SYS_SCALBLN = 0xAD8 // 2776 - SYS___SCALBLN_B = 0xAD9 // 2777 - SYS___SCALBLN_H = 0xADA // 2778 - SYS_SCALBLNF = 0xADB // 2779 - SYS___SCALBLNF_B = 0xADC // 2780 - SYS___SCALBLNF_H = 0xADD // 2781 - SYS_SCALBLNL = 0xADE // 2782 - SYS___SCALBLNL_B = 0xADF // 2783 - SYS___SCALBLNL_H = 0xAE0 // 2784 - SYS___SCALBN_B = 0xAE1 // 2785 - SYS___SCALBN_H = 0xAE2 // 2786 - SYS_SCALBNF = 0xAE3 // 2787 - SYS___SCALBNF_B = 0xAE4 // 2788 - SYS___SCALBNF_H = 0xAE5 // 2789 - SYS_SCALBNL = 0xAE6 // 2790 - SYS___SCALBNL_B = 0xAE7 // 2791 - SYS___SCALBNL_H = 0xAE8 // 2792 - SYS___TGAMMAL_H = 0xAE9 // 2793 - SYS_FECLEAREXCEPT = 0xAEA // 2794 - SYS_FEGETENV = 0xAEB // 2795 - SYS_FEGETEXCEPTFLAG = 0xAEC // 2796 - SYS_FEGETROUND = 0xAED // 2797 - SYS_FEHOLDEXCEPT = 0xAEE // 2798 - SYS_FERAISEEXCEPT = 0xAEF // 2799 - SYS_FESETENV = 0xAF0 // 2800 - SYS_FESETEXCEPTFLAG = 0xAF1 // 2801 - SYS_FESETROUND = 0xAF2 // 2802 - SYS_FETESTEXCEPT = 0xAF3 // 2803 - SYS_FEUPDATEENV = 0xAF4 // 2804 - SYS___COPYSIGN_H = 0xAF5 // 2805 - SYS___HYPOTF_H = 0xAF6 // 2806 - SYS___HYPOTL_H = 0xAF7 // 2807 - SYS___CLASS = 0xAFA // 2810 - SYS___CLASS_B = 0xAFB // 2811 - SYS___CLASS_H = 0xAFC // 2812 - SYS___ISBLANK_A = 0xB2E // 2862 - SYS___ISWBLANK_A = 0xB2F // 2863 - SYS___LROUND_FIXUP = 0xB30 // 2864 - SYS___LROUNDF_FIXUP = 0xB31 // 2865 - SYS_SCHED_YIELD = 0xB32 // 2866 - SYS_STRERROR_R = 0xB33 // 2867 - SYS_UNSETENV = 0xB34 // 2868 - SYS___LGAMMA_H_C99 = 0xB38 // 2872 - SYS___LGAMMA_B_C99 = 0xB39 // 2873 - SYS___LGAMMA_R_C99 = 0xB3A // 2874 - SYS___FTELL2 = 0xB3B // 2875 - SYS___FSEEK2 = 0xB3C // 2876 - SYS___STATIC_REINIT = 0xB3D // 2877 - SYS_PTHREAD_ATTR_GETSTACK = 0xB3E // 2878 - SYS_PTHREAD_ATTR_SETSTACK = 0xB3F // 2879 - SYS___TGAMMA_H_C99 = 0xB78 // 2936 - SYS___TGAMMAF_H_C99 = 0xB79 // 2937 - SYS___LE_TRACEBACK = 0xB7A // 2938 - SYS___MUST_STAY_CLEAN = 0xB7C // 2940 - SYS___O_ENV = 0xB7D // 2941 - SYS_ACOSD32 = 0xB7E // 2942 - SYS_ACOSD64 = 0xB7F // 2943 - SYS_ACOSD128 = 0xB80 // 2944 - SYS_ACOSHD32 = 0xB81 // 2945 - SYS_ACOSHD64 = 0xB82 // 2946 - SYS_ACOSHD128 = 0xB83 // 2947 - SYS_ASIND32 = 0xB84 // 2948 - SYS_ASIND64 = 0xB85 // 2949 - SYS_ASIND128 = 0xB86 // 2950 - SYS_ASINHD32 = 0xB87 // 2951 - SYS_ASINHD64 = 0xB88 // 2952 - SYS_ASINHD128 = 0xB89 // 2953 - SYS_ATAND32 = 0xB8A // 2954 - SYS_ATAND64 = 0xB8B // 2955 - SYS_ATAND128 = 0xB8C // 2956 - SYS_ATAN2D32 = 0xB8D // 2957 - SYS_ATAN2D64 = 0xB8E // 2958 - SYS_ATAN2D128 = 0xB8F // 2959 - SYS_ATANHD32 = 0xB90 // 2960 - SYS_ATANHD64 = 0xB91 // 2961 - SYS_ATANHD128 = 0xB92 // 2962 - SYS_CBRTD32 = 0xB93 // 2963 - SYS_CBRTD64 = 0xB94 // 2964 - SYS_CBRTD128 = 0xB95 // 2965 - SYS_CEILD32 = 0xB96 // 2966 - SYS_CEILD64 = 0xB97 // 2967 - SYS_CEILD128 = 0xB98 // 2968 - SYS___CLASS2 = 0xB99 // 2969 - SYS___CLASS2_B = 0xB9A // 2970 - SYS___CLASS2_H = 0xB9B // 2971 - SYS_COPYSIGND32 = 0xB9C // 2972 - SYS_COPYSIGND64 = 0xB9D // 2973 - SYS_COPYSIGND128 = 0xB9E // 2974 - SYS_COSD32 = 0xB9F // 2975 - SYS_COSD64 = 0xBA0 // 2976 - SYS_COSD128 = 0xBA1 // 2977 - SYS_COSHD32 = 0xBA2 // 2978 - SYS_COSHD64 = 0xBA3 // 2979 - SYS_COSHD128 = 0xBA4 // 2980 - SYS_ERFD32 = 0xBA5 // 2981 - SYS_ERFD64 = 0xBA6 // 2982 - SYS_ERFD128 = 0xBA7 // 2983 - SYS_ERFCD32 = 0xBA8 // 2984 - SYS_ERFCD64 = 0xBA9 // 2985 - SYS_ERFCD128 = 0xBAA // 2986 - SYS_EXPD32 = 0xBAB // 2987 - SYS_EXPD64 = 0xBAC // 2988 - SYS_EXPD128 = 0xBAD // 2989 - SYS_EXP2D32 = 0xBAE // 2990 - SYS_EXP2D64 = 0xBAF // 2991 - SYS_EXP2D128 = 0xBB0 // 2992 - SYS_EXPM1D32 = 0xBB1 // 2993 - SYS_EXPM1D64 = 0xBB2 // 2994 - SYS_EXPM1D128 = 0xBB3 // 2995 - SYS_FABSD32 = 0xBB4 // 2996 - SYS_FABSD64 = 0xBB5 // 2997 - SYS_FABSD128 = 0xBB6 // 2998 - SYS_FDIMD32 = 0xBB7 // 2999 - SYS_FDIMD64 = 0xBB8 // 3000 - SYS_FDIMD128 = 0xBB9 // 3001 - SYS_FE_DEC_GETROUND = 0xBBA // 3002 - SYS_FE_DEC_SETROUND = 0xBBB // 3003 - SYS_FLOORD32 = 0xBBC // 3004 - SYS_FLOORD64 = 0xBBD // 3005 - SYS_FLOORD128 = 0xBBE // 3006 - SYS_FMAD32 = 0xBBF // 3007 - SYS_FMAD64 = 0xBC0 // 3008 - SYS_FMAD128 = 0xBC1 // 3009 - SYS_FMAXD32 = 0xBC2 // 3010 - SYS_FMAXD64 = 0xBC3 // 3011 - SYS_FMAXD128 = 0xBC4 // 3012 - SYS_FMIND32 = 0xBC5 // 3013 - SYS_FMIND64 = 0xBC6 // 3014 - SYS_FMIND128 = 0xBC7 // 3015 - SYS_FMODD32 = 0xBC8 // 3016 - SYS_FMODD64 = 0xBC9 // 3017 - SYS_FMODD128 = 0xBCA // 3018 - SYS___FP_CAST_D = 0xBCB // 3019 - SYS_FREXPD32 = 0xBCC // 3020 - SYS_FREXPD64 = 0xBCD // 3021 - SYS_FREXPD128 = 0xBCE // 3022 - SYS_HYPOTD32 = 0xBCF // 3023 - SYS_HYPOTD64 = 0xBD0 // 3024 - SYS_HYPOTD128 = 0xBD1 // 3025 - SYS_ILOGBD32 = 0xBD2 // 3026 - SYS_ILOGBD64 = 0xBD3 // 3027 - SYS_ILOGBD128 = 0xBD4 // 3028 - SYS_LDEXPD32 = 0xBD5 // 3029 - SYS_LDEXPD64 = 0xBD6 // 3030 - SYS_LDEXPD128 = 0xBD7 // 3031 - SYS_LGAMMAD32 = 0xBD8 // 3032 - SYS_LGAMMAD64 = 0xBD9 // 3033 - SYS_LGAMMAD128 = 0xBDA // 3034 - SYS_LLRINTD32 = 0xBDB // 3035 - SYS_LLRINTD64 = 0xBDC // 3036 - SYS_LLRINTD128 = 0xBDD // 3037 - SYS_LLROUNDD32 = 0xBDE // 3038 - SYS_LLROUNDD64 = 0xBDF // 3039 - SYS_LLROUNDD128 = 0xBE0 // 3040 - SYS_LOGD32 = 0xBE1 // 3041 - SYS_LOGD64 = 0xBE2 // 3042 - SYS_LOGD128 = 0xBE3 // 3043 - SYS_LOG10D32 = 0xBE4 // 3044 - SYS_LOG10D64 = 0xBE5 // 3045 - SYS_LOG10D128 = 0xBE6 // 3046 - SYS_LOG1PD32 = 0xBE7 // 3047 - SYS_LOG1PD64 = 0xBE8 // 3048 - SYS_LOG1PD128 = 0xBE9 // 3049 - SYS_LOG2D32 = 0xBEA // 3050 - SYS_LOG2D64 = 0xBEB // 3051 - SYS_LOG2D128 = 0xBEC // 3052 - SYS_LOGBD32 = 0xBED // 3053 - SYS_LOGBD64 = 0xBEE // 3054 - SYS_LOGBD128 = 0xBEF // 3055 - SYS_LRINTD32 = 0xBF0 // 3056 - SYS_LRINTD64 = 0xBF1 // 3057 - SYS_LRINTD128 = 0xBF2 // 3058 - SYS_LROUNDD32 = 0xBF3 // 3059 - SYS_LROUNDD64 = 0xBF4 // 3060 - SYS_LROUNDD128 = 0xBF5 // 3061 - SYS_MODFD32 = 0xBF6 // 3062 - SYS_MODFD64 = 0xBF7 // 3063 - SYS_MODFD128 = 0xBF8 // 3064 - SYS_NAND32 = 0xBF9 // 3065 - SYS_NAND64 = 0xBFA // 3066 - SYS_NAND128 = 0xBFB // 3067 - SYS_NEARBYINTD32 = 0xBFC // 3068 - SYS_NEARBYINTD64 = 0xBFD // 3069 - SYS_NEARBYINTD128 = 0xBFE // 3070 - SYS_NEXTAFTERD32 = 0xBFF // 3071 - SYS_NEXTAFTERD64 = 0xC00 // 3072 - SYS_NEXTAFTERD128 = 0xC01 // 3073 - SYS_NEXTTOWARDD32 = 0xC02 // 3074 - SYS_NEXTTOWARDD64 = 0xC03 // 3075 - SYS_NEXTTOWARDD128 = 0xC04 // 3076 - SYS_POWD32 = 0xC05 // 3077 - SYS_POWD64 = 0xC06 // 3078 - SYS_POWD128 = 0xC07 // 3079 - SYS_QUANTIZED32 = 0xC08 // 3080 - SYS_QUANTIZED64 = 0xC09 // 3081 - SYS_QUANTIZED128 = 0xC0A // 3082 - SYS_REMAINDERD32 = 0xC0B // 3083 - SYS_REMAINDERD64 = 0xC0C // 3084 - SYS_REMAINDERD128 = 0xC0D // 3085 - SYS___REMQUOD32 = 0xC0E // 3086 - SYS___REMQUOD64 = 0xC0F // 3087 - SYS___REMQUOD128 = 0xC10 // 3088 - SYS_RINTD32 = 0xC11 // 3089 - SYS_RINTD64 = 0xC12 // 3090 - SYS_RINTD128 = 0xC13 // 3091 - SYS_ROUNDD32 = 0xC14 // 3092 - SYS_ROUNDD64 = 0xC15 // 3093 - SYS_ROUNDD128 = 0xC16 // 3094 - SYS_SAMEQUANTUMD32 = 0xC17 // 3095 - SYS_SAMEQUANTUMD64 = 0xC18 // 3096 - SYS_SAMEQUANTUMD128 = 0xC19 // 3097 - SYS_SCALBLND32 = 0xC1A // 3098 - SYS_SCALBLND64 = 0xC1B // 3099 - SYS_SCALBLND128 = 0xC1C // 3100 - SYS_SCALBND32 = 0xC1D // 3101 - SYS_SCALBND64 = 0xC1E // 3102 - SYS_SCALBND128 = 0xC1F // 3103 - SYS_SIND32 = 0xC20 // 3104 - SYS_SIND64 = 0xC21 // 3105 - SYS_SIND128 = 0xC22 // 3106 - SYS_SINHD32 = 0xC23 // 3107 - SYS_SINHD64 = 0xC24 // 3108 - SYS_SINHD128 = 0xC25 // 3109 - SYS_SQRTD32 = 0xC26 // 3110 - SYS_SQRTD64 = 0xC27 // 3111 - SYS_SQRTD128 = 0xC28 // 3112 - SYS_STRTOD32 = 0xC29 // 3113 - SYS_STRTOD64 = 0xC2A // 3114 - SYS_STRTOD128 = 0xC2B // 3115 - SYS_TAND32 = 0xC2C // 3116 - SYS_TAND64 = 0xC2D // 3117 - SYS_TAND128 = 0xC2E // 3118 - SYS_TANHD32 = 0xC2F // 3119 - SYS_TANHD64 = 0xC30 // 3120 - SYS_TANHD128 = 0xC31 // 3121 - SYS_TGAMMAD32 = 0xC32 // 3122 - SYS_TGAMMAD64 = 0xC33 // 3123 - SYS_TGAMMAD128 = 0xC34 // 3124 - SYS_TRUNCD32 = 0xC3E // 3134 - SYS_TRUNCD64 = 0xC3F // 3135 - SYS_TRUNCD128 = 0xC40 // 3136 - SYS_WCSTOD32 = 0xC41 // 3137 - SYS_WCSTOD64 = 0xC42 // 3138 - SYS_WCSTOD128 = 0xC43 // 3139 - SYS___CODEPAGE_INFO = 0xC64 // 3172 - SYS_POSIX_OPENPT = 0xC66 // 3174 - SYS_PSELECT = 0xC67 // 3175 - SYS_SOCKATMARK = 0xC68 // 3176 - SYS_AIO_FSYNC = 0xC69 // 3177 - SYS_LIO_LISTIO = 0xC6A // 3178 - SYS___ATANPID32 = 0xC6B // 3179 - SYS___ATANPID64 = 0xC6C // 3180 - SYS___ATANPID128 = 0xC6D // 3181 - SYS___COSPID32 = 0xC6E // 3182 - SYS___COSPID64 = 0xC6F // 3183 - SYS___COSPID128 = 0xC70 // 3184 - SYS___SINPID32 = 0xC71 // 3185 - SYS___SINPID64 = 0xC72 // 3186 - SYS___SINPID128 = 0xC73 // 3187 - SYS_SETIPV4SOURCEFILTER = 0xC76 // 3190 - SYS_GETIPV4SOURCEFILTER = 0xC77 // 3191 - SYS_SETSOURCEFILTER = 0xC78 // 3192 - SYS_GETSOURCEFILTER = 0xC79 // 3193 - SYS_FWRITE_UNLOCKED = 0xC7A // 3194 - SYS_FREAD_UNLOCKED = 0xC7B // 3195 - SYS_FGETS_UNLOCKED = 0xC7C // 3196 - SYS_GETS_UNLOCKED = 0xC7D // 3197 - SYS_FPUTS_UNLOCKED = 0xC7E // 3198 - SYS_PUTS_UNLOCKED = 0xC7F // 3199 - SYS_FGETC_UNLOCKED = 0xC80 // 3200 - SYS_FPUTC_UNLOCKED = 0xC81 // 3201 - SYS_DLADDR = 0xC82 // 3202 - SYS_SHM_OPEN = 0xC8C // 3212 - SYS_SHM_UNLINK = 0xC8D // 3213 - SYS___CLASS2F = 0xC91 // 3217 - SYS___CLASS2L = 0xC92 // 3218 - SYS___CLASS2F_B = 0xC93 // 3219 - SYS___CLASS2F_H = 0xC94 // 3220 - SYS___CLASS2L_B = 0xC95 // 3221 - SYS___CLASS2L_H = 0xC96 // 3222 - SYS___CLASS2D32 = 0xC97 // 3223 - SYS___CLASS2D64 = 0xC98 // 3224 - SYS___CLASS2D128 = 0xC99 // 3225 - SYS___TOCSNAME2 = 0xC9A // 3226 - SYS___D1TOP = 0xC9B // 3227 - SYS___D2TOP = 0xC9C // 3228 - SYS___D4TOP = 0xC9D // 3229 - SYS___PTOD1 = 0xC9E // 3230 - SYS___PTOD2 = 0xC9F // 3231 - SYS___PTOD4 = 0xCA0 // 3232 - SYS_CLEARERR_UNLOCKED = 0xCA1 // 3233 - SYS_FDELREC_UNLOCKED = 0xCA2 // 3234 - SYS_FEOF_UNLOCKED = 0xCA3 // 3235 - SYS_FERROR_UNLOCKED = 0xCA4 // 3236 - SYS_FFLUSH_UNLOCKED = 0xCA5 // 3237 - SYS_FGETPOS_UNLOCKED = 0xCA6 // 3238 - SYS_FGETWC_UNLOCKED = 0xCA7 // 3239 - SYS_FGETWS_UNLOCKED = 0xCA8 // 3240 - SYS_FILENO_UNLOCKED = 0xCA9 // 3241 - SYS_FLDATA_UNLOCKED = 0xCAA // 3242 - SYS_FLOCATE_UNLOCKED = 0xCAB // 3243 - SYS_FPRINTF_UNLOCKED = 0xCAC // 3244 - SYS_FPUTWC_UNLOCKED = 0xCAD // 3245 - SYS_FPUTWS_UNLOCKED = 0xCAE // 3246 - SYS_FSCANF_UNLOCKED = 0xCAF // 3247 - SYS_FSEEK_UNLOCKED = 0xCB0 // 3248 - SYS_FSEEKO_UNLOCKED = 0xCB1 // 3249 - SYS_FSETPOS_UNLOCKED = 0xCB3 // 3251 - SYS_FTELL_UNLOCKED = 0xCB4 // 3252 - SYS_FTELLO_UNLOCKED = 0xCB5 // 3253 - SYS_FUPDATE_UNLOCKED = 0xCB7 // 3255 - SYS_FWIDE_UNLOCKED = 0xCB8 // 3256 - SYS_FWPRINTF_UNLOCKED = 0xCB9 // 3257 - SYS_FWSCANF_UNLOCKED = 0xCBA // 3258 - SYS_GETWC_UNLOCKED = 0xCBB // 3259 - SYS_GETWCHAR_UNLOCKED = 0xCBC // 3260 - SYS_PERROR_UNLOCKED = 0xCBD // 3261 - SYS_PRINTF_UNLOCKED = 0xCBE // 3262 - SYS_PUTWC_UNLOCKED = 0xCBF // 3263 - SYS_PUTWCHAR_UNLOCKED = 0xCC0 // 3264 - SYS_REWIND_UNLOCKED = 0xCC1 // 3265 - SYS_SCANF_UNLOCKED = 0xCC2 // 3266 - SYS_UNGETC_UNLOCKED = 0xCC3 // 3267 - SYS_UNGETWC_UNLOCKED = 0xCC4 // 3268 - SYS_VFPRINTF_UNLOCKED = 0xCC5 // 3269 - SYS_VFSCANF_UNLOCKED = 0xCC7 // 3271 - SYS_VFWPRINTF_UNLOCKED = 0xCC9 // 3273 - SYS_VFWSCANF_UNLOCKED = 0xCCB // 3275 - SYS_VPRINTF_UNLOCKED = 0xCCD // 3277 - SYS_VSCANF_UNLOCKED = 0xCCF // 3279 - SYS_VWPRINTF_UNLOCKED = 0xCD1 // 3281 - SYS_VWSCANF_UNLOCKED = 0xCD3 // 3283 - SYS_WPRINTF_UNLOCKED = 0xCD5 // 3285 - SYS_WSCANF_UNLOCKED = 0xCD6 // 3286 - SYS_ASCTIME64 = 0xCD7 // 3287 - SYS_ASCTIME64_R = 0xCD8 // 3288 - SYS_CTIME64 = 0xCD9 // 3289 - SYS_CTIME64_R = 0xCDA // 3290 - SYS_DIFFTIME64 = 0xCDB // 3291 - SYS_GMTIME64 = 0xCDC // 3292 - SYS_GMTIME64_R = 0xCDD // 3293 - SYS_LOCALTIME64 = 0xCDE // 3294 - SYS_LOCALTIME64_R = 0xCDF // 3295 - SYS_MKTIME64 = 0xCE0 // 3296 - SYS_TIME64 = 0xCE1 // 3297 - SYS___LOGIN_APPLID = 0xCE2 // 3298 - SYS___PASSWD_APPLID = 0xCE3 // 3299 - SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 // 3300 - SYS___GETTHENT = 0xCE5 // 3301 - SYS_FREEIFADDRS = 0xCE6 // 3302 - SYS_GETIFADDRS = 0xCE7 // 3303 - SYS_POSIX_FALLOCATE = 0xCE8 // 3304 - SYS_POSIX_MEMALIGN = 0xCE9 // 3305 - SYS_SIZEOF_ALLOC = 0xCEA // 3306 - SYS_RESIZE_ALLOC = 0xCEB // 3307 - SYS_FREAD_NOUPDATE = 0xCEC // 3308 - SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED // 3309 - SYS_FGETPOS64 = 0xCEE // 3310 - SYS_FSEEK64 = 0xCEF // 3311 - SYS_FSEEKO64 = 0xCF0 // 3312 - SYS_FSETPOS64 = 0xCF1 // 3313 - SYS_FTELL64 = 0xCF2 // 3314 - SYS_FTELLO64 = 0xCF3 // 3315 - SYS_FGETPOS64_UNLOCKED = 0xCF4 // 3316 - SYS_FSEEK64_UNLOCKED = 0xCF5 // 3317 - SYS_FSEEKO64_UNLOCKED = 0xCF6 // 3318 - SYS_FSETPOS64_UNLOCKED = 0xCF7 // 3319 - SYS_FTELL64_UNLOCKED = 0xCF8 // 3320 - SYS_FTELLO64_UNLOCKED = 0xCF9 // 3321 - SYS_FOPEN_UNLOCKED = 0xCFA // 3322 - SYS_FREOPEN_UNLOCKED = 0xCFB // 3323 - SYS_FDOPEN_UNLOCKED = 0xCFC // 3324 - SYS_TMPFILE_UNLOCKED = 0xCFD // 3325 - SYS___MOSERVICES = 0xD3D // 3389 - SYS___GETTOD = 0xD3E // 3390 - SYS_C16RTOMB = 0xD40 // 3392 - SYS_C32RTOMB = 0xD41 // 3393 - SYS_MBRTOC16 = 0xD42 // 3394 - SYS_MBRTOC32 = 0xD43 // 3395 - SYS_QUANTEXPD32 = 0xD44 // 3396 - SYS_QUANTEXPD64 = 0xD45 // 3397 - SYS_QUANTEXPD128 = 0xD46 // 3398 - SYS___LOCALE_CTL = 0xD47 // 3399 - SYS___SMF_RECORD2 = 0xD48 // 3400 - SYS_FOPEN64 = 0xD49 // 3401 - SYS_FOPEN64_UNLOCKED = 0xD4A // 3402 - SYS_FREOPEN64 = 0xD4B // 3403 - SYS_FREOPEN64_UNLOCKED = 0xD4C // 3404 - SYS_TMPFILE64 = 0xD4D // 3405 - SYS_TMPFILE64_UNLOCKED = 0xD4E // 3406 - SYS_GETDATE64 = 0xD4F // 3407 - SYS_GETTIMEOFDAY64 = 0xD50 // 3408 - SYS_BIND2ADDRSEL = 0xD59 // 3417 - SYS_INET6_IS_SRCADDR = 0xD5A // 3418 - SYS___GETGRGID1 = 0xD5B // 3419 - SYS___GETGRNAM1 = 0xD5C // 3420 - SYS___FBUFSIZE = 0xD60 // 3424 - SYS___FPENDING = 0xD61 // 3425 - SYS___FLBF = 0xD62 // 3426 - SYS___FREADABLE = 0xD63 // 3427 - SYS___FWRITABLE = 0xD64 // 3428 - SYS___FREADING = 0xD65 // 3429 - SYS___FWRITING = 0xD66 // 3430 - SYS___FSETLOCKING = 0xD67 // 3431 - SYS__FLUSHLBF = 0xD68 // 3432 - SYS___FPURGE = 0xD69 // 3433 - SYS___FREADAHEAD = 0xD6A // 3434 - SYS___FSETERR = 0xD6B // 3435 - SYS___FPENDING_UNLOCKED = 0xD6C // 3436 - SYS___FREADING_UNLOCKED = 0xD6D // 3437 - SYS___FWRITING_UNLOCKED = 0xD6E // 3438 - SYS__FLUSHLBF_UNLOCKED = 0xD6F // 3439 - SYS___FPURGE_UNLOCKED = 0xD70 // 3440 - SYS___FREADAHEAD_UNLOCKED = 0xD71 // 3441 - SYS___LE_CEEGTJS = 0xD72 // 3442 - SYS___LE_RECORD_DUMP = 0xD73 // 3443 - SYS_FSTAT64 = 0xD74 // 3444 - SYS_LSTAT64 = 0xD75 // 3445 - SYS_STAT64 = 0xD76 // 3446 - SYS___READDIR2_64 = 0xD77 // 3447 - SYS___OPEN_STAT64 = 0xD78 // 3448 - SYS_FTW64 = 0xD79 // 3449 - SYS_NFTW64 = 0xD7A // 3450 - SYS_UTIME64 = 0xD7B // 3451 - SYS_UTIMES64 = 0xD7C // 3452 - SYS___GETIPC64 = 0xD7D // 3453 - SYS_MSGCTL64 = 0xD7E // 3454 - SYS_SEMCTL64 = 0xD7F // 3455 - SYS_SHMCTL64 = 0xD80 // 3456 - SYS_MSGXRCV64 = 0xD81 // 3457 - SYS___MGXR64 = 0xD81 // 3457 - SYS_W_GETPSENT64 = 0xD82 // 3458 - SYS_PTHREAD_COND_TIMEDWAIT64 = 0xD83 // 3459 - SYS_FTIME64 = 0xD85 // 3461 - SYS_GETUTXENT64 = 0xD86 // 3462 - SYS_GETUTXID64 = 0xD87 // 3463 - SYS_GETUTXLINE64 = 0xD88 // 3464 - SYS_PUTUTXLINE64 = 0xD89 // 3465 - SYS_NEWLOCALE = 0xD8A // 3466 - SYS_FREELOCALE = 0xD8B // 3467 - SYS_USELOCALE = 0xD8C // 3468 - SYS_DUPLOCALE = 0xD8D // 3469 - SYS___CHATTR64 = 0xD9C // 3484 - SYS___LCHATTR64 = 0xD9D // 3485 - SYS___FCHATTR64 = 0xD9E // 3486 - SYS_____CHATTR64_A = 0xD9F // 3487 - SYS_____LCHATTR64_A = 0xDA0 // 3488 - SYS___LE_CEEUSGD = 0xDA1 // 3489 - SYS___LE_IFAM_CON = 0xDA2 // 3490 - SYS___LE_IFAM_DSC = 0xDA3 // 3491 - SYS___LE_IFAM_GET = 0xDA4 // 3492 - SYS___LE_IFAM_QRY = 0xDA5 // 3493 - SYS_ALIGNED_ALLOC = 0xDA6 // 3494 - SYS_ACCEPT4 = 0xDA7 // 3495 - SYS___ACCEPT4_A = 0xDA8 // 3496 - SYS_COPYFILERANGE = 0xDA9 // 3497 - SYS_GETLINE = 0xDAA // 3498 - SYS___GETLINE_A = 0xDAB // 3499 - SYS_DIRFD = 0xDAC // 3500 - SYS_CLOCK_GETTIME = 0xDAD // 3501 - SYS_DUP3 = 0xDAE // 3502 - SYS_EPOLL_CREATE = 0xDAF // 3503 - SYS_EPOLL_CREATE1 = 0xDB0 // 3504 - SYS_EPOLL_CTL = 0xDB1 // 3505 - SYS_EPOLL_WAIT = 0xDB2 // 3506 - SYS_EPOLL_PWAIT = 0xDB3 // 3507 - SYS_EVENTFD = 0xDB4 // 3508 - SYS_STATFS = 0xDB5 // 3509 - SYS___STATFS_A = 0xDB6 // 3510 - SYS_FSTATFS = 0xDB7 // 3511 - SYS_INOTIFY_INIT = 0xDB8 // 3512 - SYS_INOTIFY_INIT1 = 0xDB9 // 3513 - SYS_INOTIFY_ADD_WATCH = 0xDBA // 3514 - SYS___INOTIFY_ADD_WATCH_A = 0xDBB // 3515 - SYS_INOTIFY_RM_WATCH = 0xDBC // 3516 - SYS_PIPE2 = 0xDBD // 3517 - SYS_PIVOT_ROOT = 0xDBE // 3518 - SYS___PIVOT_ROOT_A = 0xDBF // 3519 - SYS_PRCTL = 0xDC0 // 3520 - SYS_PRLIMIT = 0xDC1 // 3521 - SYS_SETHOSTNAME = 0xDC2 // 3522 - SYS___SETHOSTNAME_A = 0xDC3 // 3523 - SYS_SETRESUID = 0xDC4 // 3524 - SYS_SETRESGID = 0xDC5 // 3525 - SYS_PTHREAD_CONDATTR_GETCLOCK = 0xDC6 // 3526 - SYS_FLOCK = 0xDC7 // 3527 - SYS_FGETXATTR = 0xDC8 // 3528 - SYS___FGETXATTR_A = 0xDC9 // 3529 - SYS_FLISTXATTR = 0xDCA // 3530 - SYS___FLISTXATTR_A = 0xDCB // 3531 - SYS_FREMOVEXATTR = 0xDCC // 3532 - SYS___FREMOVEXATTR_A = 0xDCD // 3533 - SYS_FSETXATTR = 0xDCE // 3534 - SYS___FSETXATTR_A = 0xDCF // 3535 - SYS_GETXATTR = 0xDD0 // 3536 - SYS___GETXATTR_A = 0xDD1 // 3537 - SYS_LGETXATTR = 0xDD2 // 3538 - SYS___LGETXATTR_A = 0xDD3 // 3539 - SYS_LISTXATTR = 0xDD4 // 3540 - SYS___LISTXATTR_A = 0xDD5 // 3541 - SYS_LLISTXATTR = 0xDD6 // 3542 - SYS___LLISTXATTR_A = 0xDD7 // 3543 - SYS_LREMOVEXATTR = 0xDD8 // 3544 - SYS___LREMOVEXATTR_A = 0xDD9 // 3545 - SYS_LSETXATTR = 0xDDA // 3546 - SYS___LSETXATTR_A = 0xDDB // 3547 - SYS_REMOVEXATTR = 0xDDC // 3548 - SYS___REMOVEXATTR_A = 0xDDD // 3549 - SYS_SETXATTR = 0xDDE // 3550 - SYS___SETXATTR_A = 0xDDF // 3551 - SYS_FDATASYNC = 0xDE0 // 3552 - SYS_SYNCFS = 0xDE1 // 3553 - SYS_FUTIMES = 0xDE2 // 3554 - SYS_FUTIMESAT = 0xDE3 // 3555 - SYS___FUTIMESAT_A = 0xDE4 // 3556 - SYS_LUTIMES = 0xDE5 // 3557 - SYS___LUTIMES_A = 0xDE6 // 3558 - SYS_INET_ATON = 0xDE7 // 3559 - SYS_GETRANDOM = 0xDE8 // 3560 - SYS_GETTID = 0xDE9 // 3561 - SYS_MEMFD_CREATE = 0xDEA // 3562 - SYS___MEMFD_CREATE_A = 0xDEB // 3563 - SYS_FACCESSAT = 0xDEC // 3564 - SYS___FACCESSAT_A = 0xDED // 3565 - SYS_FCHMODAT = 0xDEE // 3566 - SYS___FCHMODAT_A = 0xDEF // 3567 - SYS_FCHOWNAT = 0xDF0 // 3568 - SYS___FCHOWNAT_A = 0xDF1 // 3569 - SYS_FSTATAT = 0xDF2 // 3570 - SYS___FSTATAT_A = 0xDF3 // 3571 - SYS_LINKAT = 0xDF4 // 3572 - SYS___LINKAT_A = 0xDF5 // 3573 - SYS_MKDIRAT = 0xDF6 // 3574 - SYS___MKDIRAT_A = 0xDF7 // 3575 - SYS_MKFIFOAT = 0xDF8 // 3576 - SYS___MKFIFOAT_A = 0xDF9 // 3577 - SYS_MKNODAT = 0xDFA // 3578 - SYS___MKNODAT_A = 0xDFB // 3579 - SYS_OPENAT = 0xDFC // 3580 - SYS___OPENAT_A = 0xDFD // 3581 - SYS_READLINKAT = 0xDFE // 3582 - SYS___READLINKAT_A = 0xDFF // 3583 - SYS_RENAMEAT = 0xE00 // 3584 - SYS___RENAMEAT_A = 0xE01 // 3585 - SYS_RENAMEAT2 = 0xE02 // 3586 - SYS___RENAMEAT2_A = 0xE03 // 3587 - SYS_SYMLINKAT = 0xE04 // 3588 - SYS___SYMLINKAT_A = 0xE05 // 3589 - SYS_UNLINKAT = 0xE06 // 3590 - SYS___UNLINKAT_A = 0xE07 // 3591 - SYS_SYSINFO = 0xE08 // 3592 - SYS_WAIT4 = 0xE0A // 3594 - SYS_CLONE = 0xE0B // 3595 - SYS_UNSHARE = 0xE0C // 3596 - SYS_SETNS = 0xE0D // 3597 - SYS_CAPGET = 0xE0E // 3598 - SYS_CAPSET = 0xE0F // 3599 - SYS_STRCHRNUL = 0xE10 // 3600 - SYS_PTHREAD_CONDATTR_SETCLOCK = 0xE12 // 3602 - SYS_OPEN_BY_HANDLE_AT = 0xE13 // 3603 - SYS___OPEN_BY_HANDLE_AT_A = 0xE14 // 3604 - SYS___INET_ATON_A = 0xE15 // 3605 - SYS_MOUNT1 = 0xE16 // 3606 - SYS___MOUNT1_A = 0xE17 // 3607 - SYS_UMOUNT1 = 0xE18 // 3608 - SYS___UMOUNT1_A = 0xE19 // 3609 - SYS_UMOUNT2 = 0xE1A // 3610 - SYS___UMOUNT2_A = 0xE1B // 3611 - SYS___PRCTL_A = 0xE1C // 3612 - SYS_LOCALTIME_R2 = 0xE1D // 3613 - SYS___LOCALTIME_R2_A = 0xE1E // 3614 - SYS_OPENAT2 = 0xE1F // 3615 - SYS___OPENAT2_A = 0xE20 // 3616 - SYS___LE_CEEMICT = 0xE21 // 3617 - SYS_GETENTROPY = 0xE22 // 3618 - SYS_NANOSLEEP = 0xE23 // 3619 - SYS_UTIMENSAT = 0xE24 // 3620 - SYS___UTIMENSAT_A = 0xE25 // 3621 - SYS_ASPRINTF = 0xE26 // 3622 - SYS___ASPRINTF_A = 0xE27 // 3623 - SYS_VASPRINTF = 0xE28 // 3624 - SYS___VASPRINTF_A = 0xE29 // 3625 - SYS_DPRINTF = 0xE2A // 3626 - SYS___DPRINTF_A = 0xE2B // 3627 - SYS_GETOPT_LONG = 0xE2C // 3628 - SYS___GETOPT_LONG_A = 0xE2D // 3629 - SYS_PSIGNAL = 0xE2E // 3630 - SYS___PSIGNAL_A = 0xE2F // 3631 - SYS_PSIGNAL_UNLOCKED = 0xE30 // 3632 - SYS___PSIGNAL_UNLOCKED_A = 0xE31 // 3633 - SYS_FSTATAT_O = 0xE32 // 3634 - SYS___FSTATAT_O_A = 0xE33 // 3635 - SYS_FSTATAT64 = 0xE34 // 3636 - SYS___FSTATAT64_A = 0xE35 // 3637 - SYS___CHATTRAT = 0xE36 // 3638 - SYS_____CHATTRAT_A = 0xE37 // 3639 - SYS___CHATTRAT64 = 0xE38 // 3640 - SYS_____CHATTRAT64_A = 0xE39 // 3641 - SYS_MADVISE = 0xE3A // 3642 - SYS___AUTHENTICATE = 0xE3B // 3643 +// TODO: auto-generate. +const ( + SYS_ACOSD128 = 0xB80 + SYS_ACOSD32 = 0xB7E + SYS_ACOSD64 = 0xB7F + SYS_ACOSHD128 = 0xB83 + SYS_ACOSHD32 = 0xB81 + SYS_ACOSHD64 = 0xB82 + SYS_AIO_FSYNC = 0xC69 + SYS_ASCTIME = 0x0AE + SYS_ASCTIME64 = 0xCD7 + SYS_ASCTIME64_R = 0xCD8 + SYS_ASIND128 = 0xB86 + SYS_ASIND32 = 0xB84 + SYS_ASIND64 = 0xB85 + SYS_ASINHD128 = 0xB89 + SYS_ASINHD32 = 0xB87 + SYS_ASINHD64 = 0xB88 + SYS_ATAN2D128 = 0xB8F + SYS_ATAN2D32 = 0xB8D + SYS_ATAN2D64 = 0xB8E + SYS_ATAND128 = 0xB8C + SYS_ATAND32 = 0xB8A + SYS_ATAND64 = 0xB8B + SYS_ATANHD128 = 0xB92 + SYS_ATANHD32 = 0xB90 + SYS_ATANHD64 = 0xB91 + SYS_BIND2ADDRSEL = 0xD59 + SYS_C16RTOMB = 0xD40 + SYS_C32RTOMB = 0xD41 + SYS_CBRTD128 = 0xB95 + SYS_CBRTD32 = 0xB93 + SYS_CBRTD64 = 0xB94 + SYS_CEILD128 = 0xB98 + SYS_CEILD32 = 0xB96 + SYS_CEILD64 = 0xB97 + SYS_CLEARENV = 0x0C9 + SYS_CLEARERR_UNLOCKED = 0xCA1 + SYS_CLOCK = 0x0AA + SYS_CLOGL = 0xA00 + SYS_CLRMEMF = 0x0BD + SYS_CONJ = 0xA03 + SYS_CONJF = 0xA06 + SYS_CONJL = 0xA09 + SYS_COPYSIGND128 = 0xB9E + SYS_COPYSIGND32 = 0xB9C + SYS_COPYSIGND64 = 0xB9D + SYS_COSD128 = 0xBA1 + SYS_COSD32 = 0xB9F + SYS_COSD64 = 0xBA0 + SYS_COSHD128 = 0xBA4 + SYS_COSHD32 = 0xBA2 + SYS_COSHD64 = 0xBA3 + SYS_CPOW = 0xA0C + SYS_CPOWF = 0xA0F + SYS_CPOWL = 0xA12 + SYS_CPROJ = 0xA15 + SYS_CPROJF = 0xA18 + SYS_CPROJL = 0xA1B + SYS_CREAL = 0xA1E + SYS_CREALF = 0xA21 + SYS_CREALL = 0xA24 + SYS_CSIN = 0xA27 + SYS_CSINF = 0xA2A + SYS_CSINH = 0xA30 + SYS_CSINHF = 0xA33 + SYS_CSINHL = 0xA36 + SYS_CSINL = 0xA2D + SYS_CSNAP = 0x0C5 + SYS_CSQRT = 0xA39 + SYS_CSQRTF = 0xA3C + SYS_CSQRTL = 0xA3F + SYS_CTAN = 0xA42 + SYS_CTANF = 0xA45 + SYS_CTANH = 0xA4B + SYS_CTANHF = 0xA4E + SYS_CTANHL = 0xA51 + SYS_CTANL = 0xA48 + SYS_CTIME = 0x0AB + SYS_CTIME64 = 0xCD9 + SYS_CTIME64_R = 0xCDA + SYS_CTRACE = 0x0C6 + SYS_DIFFTIME = 0x0A7 + SYS_DIFFTIME64 = 0xCDB + SYS_DLADDR = 0xC82 + SYS_DYNALLOC = 0x0C3 + SYS_DYNFREE = 0x0C2 + SYS_ERFCD128 = 0xBAA + SYS_ERFCD32 = 0xBA8 + SYS_ERFCD64 = 0xBA9 + SYS_ERFD128 = 0xBA7 + SYS_ERFD32 = 0xBA5 + SYS_ERFD64 = 0xBA6 + SYS_EXP2D128 = 0xBB0 + SYS_EXP2D32 = 0xBAE + SYS_EXP2D64 = 0xBAF + SYS_EXPD128 = 0xBAD + SYS_EXPD32 = 0xBAB + SYS_EXPD64 = 0xBAC + SYS_EXPM1D128 = 0xBB3 + SYS_EXPM1D32 = 0xBB1 + SYS_EXPM1D64 = 0xBB2 + SYS_FABSD128 = 0xBB6 + SYS_FABSD32 = 0xBB4 + SYS_FABSD64 = 0xBB5 + SYS_FDELREC_UNLOCKED = 0xCA2 + SYS_FDIMD128 = 0xBB9 + SYS_FDIMD32 = 0xBB7 + SYS_FDIMD64 = 0xBB8 + SYS_FDOPEN_UNLOCKED = 0xCFC + SYS_FECLEAREXCEPT = 0xAEA + SYS_FEGETENV = 0xAEB + SYS_FEGETEXCEPTFLAG = 0xAEC + SYS_FEGETROUND = 0xAED + SYS_FEHOLDEXCEPT = 0xAEE + SYS_FEOF_UNLOCKED = 0xCA3 + SYS_FERAISEEXCEPT = 0xAEF + SYS_FERROR_UNLOCKED = 0xCA4 + SYS_FESETENV = 0xAF0 + SYS_FESETEXCEPTFLAG = 0xAF1 + SYS_FESETROUND = 0xAF2 + SYS_FETCHEP = 0x0BF + SYS_FETESTEXCEPT = 0xAF3 + SYS_FEUPDATEENV = 0xAF4 + SYS_FE_DEC_GETROUND = 0xBBA + SYS_FE_DEC_SETROUND = 0xBBB + SYS_FFLUSH_UNLOCKED = 0xCA5 + SYS_FGETC_UNLOCKED = 0xC80 + SYS_FGETPOS64 = 0xCEE + SYS_FGETPOS64_UNLOCKED = 0xCF4 + SYS_FGETPOS_UNLOCKED = 0xCA6 + SYS_FGETS_UNLOCKED = 0xC7C + SYS_FGETWC_UNLOCKED = 0xCA7 + SYS_FGETWS_UNLOCKED = 0xCA8 + SYS_FILENO_UNLOCKED = 0xCA9 + SYS_FLDATA = 0x0C1 + SYS_FLDATA_UNLOCKED = 0xCAA + SYS_FLOCATE_UNLOCKED = 0xCAB + SYS_FLOORD128 = 0xBBE + SYS_FLOORD32 = 0xBBC + SYS_FLOORD64 = 0xBBD + SYS_FMA = 0xA63 + SYS_FMAD128 = 0xBC1 + SYS_FMAD32 = 0xBBF + SYS_FMAD64 = 0xBC0 + SYS_FMAF = 0xA66 + SYS_FMAL = 0xA69 + SYS_FMAX = 0xA6C + SYS_FMAXD128 = 0xBC4 + SYS_FMAXD32 = 0xBC2 + SYS_FMAXD64 = 0xBC3 + SYS_FMAXF = 0xA6F + SYS_FMAXL = 0xA72 + SYS_FMIN = 0xA75 + SYS_FMIND128 = 0xBC7 + SYS_FMIND32 = 0xBC5 + SYS_FMIND64 = 0xBC6 + SYS_FMINF = 0xA78 + SYS_FMINL = 0xA7B + SYS_FMODD128 = 0xBCA + SYS_FMODD32 = 0xBC8 + SYS_FMODD64 = 0xBC9 + SYS_FOPEN64 = 0xD49 + SYS_FOPEN64_UNLOCKED = 0xD4A + SYS_FOPEN_UNLOCKED = 0xCFA + SYS_FPRINTF_UNLOCKED = 0xCAC + SYS_FPUTC_UNLOCKED = 0xC81 + SYS_FPUTS_UNLOCKED = 0xC7E + SYS_FPUTWC_UNLOCKED = 0xCAD + SYS_FPUTWS_UNLOCKED = 0xCAE + SYS_FREAD_NOUPDATE = 0xCEC + SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED + SYS_FREAD_UNLOCKED = 0xC7B + SYS_FREEIFADDRS = 0xCE6 + SYS_FREOPEN64 = 0xD4B + SYS_FREOPEN64_UNLOCKED = 0xD4C + SYS_FREOPEN_UNLOCKED = 0xCFB + SYS_FREXPD128 = 0xBCE + SYS_FREXPD32 = 0xBCC + SYS_FREXPD64 = 0xBCD + SYS_FSCANF_UNLOCKED = 0xCAF + SYS_FSEEK64 = 0xCEF + SYS_FSEEK64_UNLOCKED = 0xCF5 + SYS_FSEEKO64 = 0xCF0 + SYS_FSEEKO64_UNLOCKED = 0xCF6 + SYS_FSEEKO_UNLOCKED = 0xCB1 + SYS_FSEEK_UNLOCKED = 0xCB0 + SYS_FSETPOS64 = 0xCF1 + SYS_FSETPOS64_UNLOCKED = 0xCF7 + SYS_FSETPOS_UNLOCKED = 0xCB3 + SYS_FTELL64 = 0xCF2 + SYS_FTELL64_UNLOCKED = 0xCF8 + SYS_FTELLO64 = 0xCF3 + SYS_FTELLO64_UNLOCKED = 0xCF9 + SYS_FTELLO_UNLOCKED = 0xCB5 + SYS_FTELL_UNLOCKED = 0xCB4 + SYS_FUPDATE = 0x0B5 + SYS_FUPDATE_UNLOCKED = 0xCB7 + SYS_FWIDE_UNLOCKED = 0xCB8 + SYS_FWPRINTF_UNLOCKED = 0xCB9 + SYS_FWRITE_UNLOCKED = 0xC7A + SYS_FWSCANF_UNLOCKED = 0xCBA + SYS_GETDATE64 = 0xD4F + SYS_GETIFADDRS = 0xCE7 + SYS_GETIPV4SOURCEFILTER = 0xC77 + SYS_GETSOURCEFILTER = 0xC79 + SYS_GETSYNTX = 0x0FD + SYS_GETS_UNLOCKED = 0xC7D + SYS_GETTIMEOFDAY64 = 0xD50 + SYS_GETWCHAR_UNLOCKED = 0xCBC + SYS_GETWC_UNLOCKED = 0xCBB + SYS_GMTIME = 0x0B0 + SYS_GMTIME64 = 0xCDC + SYS_GMTIME64_R = 0xCDD + SYS_HYPOTD128 = 0xBD1 + SYS_HYPOTD32 = 0xBCF + SYS_HYPOTD64 = 0xBD0 + SYS_ILOGBD128 = 0xBD4 + SYS_ILOGBD32 = 0xBD2 + SYS_ILOGBD64 = 0xBD3 + SYS_ILOGBF = 0xA7E + SYS_ILOGBL = 0xA81 + SYS_INET6_IS_SRCADDR = 0xD5A + SYS_ISBLANK = 0x0FE + SYS_ISWALNUM = 0x0FF + SYS_LDEXPD128 = 0xBD7 + SYS_LDEXPD32 = 0xBD5 + SYS_LDEXPD64 = 0xBD6 + SYS_LGAMMAD128 = 0xBDA + SYS_LGAMMAD32 = 0xBD8 + SYS_LGAMMAD64 = 0xBD9 + SYS_LIO_LISTIO = 0xC6A + SYS_LLRINT = 0xA84 + SYS_LLRINTD128 = 0xBDD + SYS_LLRINTD32 = 0xBDB + SYS_LLRINTD64 = 0xBDC + SYS_LLRINTF = 0xA87 + SYS_LLRINTL = 0xA8A + SYS_LLROUND = 0xA8D + SYS_LLROUNDD128 = 0xBE0 + SYS_LLROUNDD32 = 0xBDE + SYS_LLROUNDD64 = 0xBDF + SYS_LLROUNDF = 0xA90 + SYS_LLROUNDL = 0xA93 + SYS_LOCALTIM = 0x0B1 + SYS_LOCALTIME = 0x0B1 + SYS_LOCALTIME64 = 0xCDE + SYS_LOCALTIME64_R = 0xCDF + SYS_LOG10D128 = 0xBE6 + SYS_LOG10D32 = 0xBE4 + SYS_LOG10D64 = 0xBE5 + SYS_LOG1PD128 = 0xBE9 + SYS_LOG1PD32 = 0xBE7 + SYS_LOG1PD64 = 0xBE8 + SYS_LOG2D128 = 0xBEC + SYS_LOG2D32 = 0xBEA + SYS_LOG2D64 = 0xBEB + SYS_LOGBD128 = 0xBEF + SYS_LOGBD32 = 0xBED + SYS_LOGBD64 = 0xBEE + SYS_LOGBF = 0xA96 + SYS_LOGBL = 0xA99 + SYS_LOGD128 = 0xBE3 + SYS_LOGD32 = 0xBE1 + SYS_LOGD64 = 0xBE2 + SYS_LRINT = 0xA9C + SYS_LRINTD128 = 0xBF2 + SYS_LRINTD32 = 0xBF0 + SYS_LRINTD64 = 0xBF1 + SYS_LRINTF = 0xA9F + SYS_LRINTL = 0xAA2 + SYS_LROUNDD128 = 0xBF5 + SYS_LROUNDD32 = 0xBF3 + SYS_LROUNDD64 = 0xBF4 + SYS_LROUNDL = 0xAA5 + SYS_MBLEN = 0x0AF + SYS_MBRTOC16 = 0xD42 + SYS_MBRTOC32 = 0xD43 + SYS_MEMSET = 0x0A3 + SYS_MKTIME = 0x0AC + SYS_MKTIME64 = 0xCE0 + SYS_MODFD128 = 0xBF8 + SYS_MODFD32 = 0xBF6 + SYS_MODFD64 = 0xBF7 + SYS_NAN = 0xAA8 + SYS_NAND128 = 0xBFB + SYS_NAND32 = 0xBF9 + SYS_NAND64 = 0xBFA + SYS_NANF = 0xAAA + SYS_NANL = 0xAAC + SYS_NEARBYINT = 0xAAE + SYS_NEARBYINTD128 = 0xBFE + SYS_NEARBYINTD32 = 0xBFC + SYS_NEARBYINTD64 = 0xBFD + SYS_NEARBYINTF = 0xAB1 + SYS_NEARBYINTL = 0xAB4 + SYS_NEXTAFTERD128 = 0xC01 + SYS_NEXTAFTERD32 = 0xBFF + SYS_NEXTAFTERD64 = 0xC00 + SYS_NEXTAFTERF = 0xAB7 + SYS_NEXTAFTERL = 0xABA + SYS_NEXTTOWARD = 0xABD + SYS_NEXTTOWARDD128 = 0xC04 + SYS_NEXTTOWARDD32 = 0xC02 + SYS_NEXTTOWARDD64 = 0xC03 + SYS_NEXTTOWARDF = 0xAC0 + SYS_NEXTTOWARDL = 0xAC3 + SYS_NL_LANGINFO = 0x0FC + SYS_PERROR_UNLOCKED = 0xCBD + SYS_POSIX_FALLOCATE = 0xCE8 + SYS_POSIX_MEMALIGN = 0xCE9 + SYS_POSIX_OPENPT = 0xC66 + SYS_POWD128 = 0xC07 + SYS_POWD32 = 0xC05 + SYS_POWD64 = 0xC06 + SYS_PRINTF_UNLOCKED = 0xCBE + SYS_PSELECT = 0xC67 + SYS_PTHREAD_ATTR_GETSTACK = 0xB3E + SYS_PTHREAD_ATTR_SETSTACK = 0xB3F + SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 + SYS_PUTS_UNLOCKED = 0xC7F + SYS_PUTWCHAR_UNLOCKED = 0xCC0 + SYS_PUTWC_UNLOCKED = 0xCBF + SYS_QUANTEXPD128 = 0xD46 + SYS_QUANTEXPD32 = 0xD44 + SYS_QUANTEXPD64 = 0xD45 + SYS_QUANTIZED128 = 0xC0A + SYS_QUANTIZED32 = 0xC08 + SYS_QUANTIZED64 = 0xC09 + SYS_REMAINDERD128 = 0xC0D + SYS_REMAINDERD32 = 0xC0B + SYS_REMAINDERD64 = 0xC0C + SYS_RESIZE_ALLOC = 0xCEB + SYS_REWIND_UNLOCKED = 0xCC1 + SYS_RINTD128 = 0xC13 + SYS_RINTD32 = 0xC11 + SYS_RINTD64 = 0xC12 + SYS_RINTF = 0xACB + SYS_RINTL = 0xACD + SYS_ROUND = 0xACF + SYS_ROUNDD128 = 0xC16 + SYS_ROUNDD32 = 0xC14 + SYS_ROUNDD64 = 0xC15 + SYS_ROUNDF = 0xAD2 + SYS_ROUNDL = 0xAD5 + SYS_SAMEQUANTUMD128 = 0xC19 + SYS_SAMEQUANTUMD32 = 0xC17 + SYS_SAMEQUANTUMD64 = 0xC18 + SYS_SCALBLN = 0xAD8 + SYS_SCALBLND128 = 0xC1C + SYS_SCALBLND32 = 0xC1A + SYS_SCALBLND64 = 0xC1B + SYS_SCALBLNF = 0xADB + SYS_SCALBLNL = 0xADE + SYS_SCALBND128 = 0xC1F + SYS_SCALBND32 = 0xC1D + SYS_SCALBND64 = 0xC1E + SYS_SCALBNF = 0xAE3 + SYS_SCALBNL = 0xAE6 + SYS_SCANF_UNLOCKED = 0xCC2 + SYS_SCHED_YIELD = 0xB32 + SYS_SETENV = 0x0C8 + SYS_SETIPV4SOURCEFILTER = 0xC76 + SYS_SETSOURCEFILTER = 0xC78 + SYS_SHM_OPEN = 0xC8C + SYS_SHM_UNLINK = 0xC8D + SYS_SIND128 = 0xC22 + SYS_SIND32 = 0xC20 + SYS_SIND64 = 0xC21 + SYS_SINHD128 = 0xC25 + SYS_SINHD32 = 0xC23 + SYS_SINHD64 = 0xC24 + SYS_SIZEOF_ALLOC = 0xCEA + SYS_SOCKATMARK = 0xC68 + SYS_SQRTD128 = 0xC28 + SYS_SQRTD32 = 0xC26 + SYS_SQRTD64 = 0xC27 + SYS_STRCHR = 0x0A0 + SYS_STRCSPN = 0x0A1 + SYS_STRERROR = 0x0A8 + SYS_STRERROR_R = 0xB33 + SYS_STRFTIME = 0x0B2 + SYS_STRLEN = 0x0A9 + SYS_STRPBRK = 0x0A2 + SYS_STRSPN = 0x0A4 + SYS_STRSTR = 0x0A5 + SYS_STRTOD128 = 0xC2B + SYS_STRTOD32 = 0xC29 + SYS_STRTOD64 = 0xC2A + SYS_STRTOK = 0x0A6 + SYS_TAND128 = 0xC2E + SYS_TAND32 = 0xC2C + SYS_TAND64 = 0xC2D + SYS_TANHD128 = 0xC31 + SYS_TANHD32 = 0xC2F + SYS_TANHD64 = 0xC30 + SYS_TGAMMAD128 = 0xC34 + SYS_TGAMMAD32 = 0xC32 + SYS_TGAMMAD64 = 0xC33 + SYS_TIME = 0x0AD + SYS_TIME64 = 0xCE1 + SYS_TMPFILE64 = 0xD4D + SYS_TMPFILE64_UNLOCKED = 0xD4E + SYS_TMPFILE_UNLOCKED = 0xCFD + SYS_TRUNCD128 = 0xC40 + SYS_TRUNCD32 = 0xC3E + SYS_TRUNCD64 = 0xC3F + SYS_UNGETC_UNLOCKED = 0xCC3 + SYS_UNGETWC_UNLOCKED = 0xCC4 + SYS_UNSETENV = 0xB34 + SYS_VFPRINTF_UNLOCKED = 0xCC5 + SYS_VFSCANF_UNLOCKED = 0xCC7 + SYS_VFWPRINTF_UNLOCKED = 0xCC9 + SYS_VFWSCANF_UNLOCKED = 0xCCB + SYS_VPRINTF_UNLOCKED = 0xCCD + SYS_VSCANF_UNLOCKED = 0xCCF + SYS_VWPRINTF_UNLOCKED = 0xCD1 + SYS_VWSCANF_UNLOCKED = 0xCD3 + SYS_WCSTOD128 = 0xC43 + SYS_WCSTOD32 = 0xC41 + SYS_WCSTOD64 = 0xC42 + SYS_WPRINTF_UNLOCKED = 0xCD5 + SYS_WSCANF_UNLOCKED = 0xCD6 + SYS__FLUSHLBF = 0xD68 + SYS__FLUSHLBF_UNLOCKED = 0xD6F + SYS___ACOSHF_H = 0xA54 + SYS___ACOSHL_H = 0xA55 + SYS___ASINHF_H = 0xA56 + SYS___ASINHL_H = 0xA57 + SYS___ATANPID128 = 0xC6D + SYS___ATANPID32 = 0xC6B + SYS___ATANPID64 = 0xC6C + SYS___CBRTF_H = 0xA58 + SYS___CBRTL_H = 0xA59 + SYS___CDUMP = 0x0C4 + SYS___CLASS = 0xAFA + SYS___CLASS2 = 0xB99 + SYS___CLASS2D128 = 0xC99 + SYS___CLASS2D32 = 0xC97 + SYS___CLASS2D64 = 0xC98 + SYS___CLASS2F = 0xC91 + SYS___CLASS2F_B = 0xC93 + SYS___CLASS2F_H = 0xC94 + SYS___CLASS2L = 0xC92 + SYS___CLASS2L_B = 0xC95 + SYS___CLASS2L_H = 0xC96 + SYS___CLASS2_B = 0xB9A + SYS___CLASS2_H = 0xB9B + SYS___CLASS_B = 0xAFB + SYS___CLASS_H = 0xAFC + SYS___CLOGL_B = 0xA01 + SYS___CLOGL_H = 0xA02 + SYS___CLRENV = 0x0C9 + SYS___CLRMF = 0x0BD + SYS___CODEPAGE_INFO = 0xC64 + SYS___CONJF_B = 0xA07 + SYS___CONJF_H = 0xA08 + SYS___CONJL_B = 0xA0A + SYS___CONJL_H = 0xA0B + SYS___CONJ_B = 0xA04 + SYS___CONJ_H = 0xA05 + SYS___COPYSIGN_B = 0xA5A + SYS___COPYSIGN_H = 0xAF5 + SYS___COSPID128 = 0xC70 + SYS___COSPID32 = 0xC6E + SYS___COSPID64 = 0xC6F + SYS___CPOWF_B = 0xA10 + SYS___CPOWF_H = 0xA11 + SYS___CPOWL_B = 0xA13 + SYS___CPOWL_H = 0xA14 + SYS___CPOW_B = 0xA0D + SYS___CPOW_H = 0xA0E + SYS___CPROJF_B = 0xA19 + SYS___CPROJF_H = 0xA1A + SYS___CPROJL_B = 0xA1C + SYS___CPROJL_H = 0xA1D + SYS___CPROJ_B = 0xA16 + SYS___CPROJ_H = 0xA17 + SYS___CREALF_B = 0xA22 + SYS___CREALF_H = 0xA23 + SYS___CREALL_B = 0xA25 + SYS___CREALL_H = 0xA26 + SYS___CREAL_B = 0xA1F + SYS___CREAL_H = 0xA20 + SYS___CSINF_B = 0xA2B + SYS___CSINF_H = 0xA2C + SYS___CSINHF_B = 0xA34 + SYS___CSINHF_H = 0xA35 + SYS___CSINHL_B = 0xA37 + SYS___CSINHL_H = 0xA38 + SYS___CSINH_B = 0xA31 + SYS___CSINH_H = 0xA32 + SYS___CSINL_B = 0xA2E + SYS___CSINL_H = 0xA2F + SYS___CSIN_B = 0xA28 + SYS___CSIN_H = 0xA29 + SYS___CSNAP = 0x0C5 + SYS___CSQRTF_B = 0xA3D + SYS___CSQRTF_H = 0xA3E + SYS___CSQRTL_B = 0xA40 + SYS___CSQRTL_H = 0xA41 + SYS___CSQRT_B = 0xA3A + SYS___CSQRT_H = 0xA3B + SYS___CTANF_B = 0xA46 + SYS___CTANF_H = 0xA47 + SYS___CTANHF_B = 0xA4F + SYS___CTANHF_H = 0xA50 + SYS___CTANHL_B = 0xA52 + SYS___CTANHL_H = 0xA53 + SYS___CTANH_B = 0xA4C + SYS___CTANH_H = 0xA4D + SYS___CTANL_B = 0xA49 + SYS___CTANL_H = 0xA4A + SYS___CTAN_B = 0xA43 + SYS___CTAN_H = 0xA44 + SYS___CTEST = 0x0C7 + SYS___CTRACE = 0x0C6 + SYS___D1TOP = 0xC9B + SYS___D2TOP = 0xC9C + SYS___D4TOP = 0xC9D + SYS___DYNALL = 0x0C3 + SYS___DYNFRE = 0x0C2 + SYS___EXP2F_H = 0xA5E + SYS___EXP2L_H = 0xA5F + SYS___EXP2_H = 0xA5D + SYS___EXPM1F_H = 0xA5B + SYS___EXPM1L_H = 0xA5C + SYS___FBUFSIZE = 0xD60 + SYS___FLBF = 0xD62 + SYS___FLDATA = 0x0C1 + SYS___FMAF_B = 0xA67 + SYS___FMAF_H = 0xA68 + SYS___FMAL_B = 0xA6A + SYS___FMAL_H = 0xA6B + SYS___FMAXF_B = 0xA70 + SYS___FMAXF_H = 0xA71 + SYS___FMAXL_B = 0xA73 + SYS___FMAXL_H = 0xA74 + SYS___FMAX_B = 0xA6D + SYS___FMAX_H = 0xA6E + SYS___FMA_B = 0xA64 + SYS___FMA_H = 0xA65 + SYS___FMINF_B = 0xA79 + SYS___FMINF_H = 0xA7A + SYS___FMINL_B = 0xA7C + SYS___FMINL_H = 0xA7D + SYS___FMIN_B = 0xA76 + SYS___FMIN_H = 0xA77 + SYS___FPENDING = 0xD61 + SYS___FPENDING_UNLOCKED = 0xD6C + SYS___FPURGE = 0xD69 + SYS___FPURGE_UNLOCKED = 0xD70 + SYS___FP_CAST_D = 0xBCB + SYS___FREADABLE = 0xD63 + SYS___FREADAHEAD = 0xD6A + SYS___FREADAHEAD_UNLOCKED = 0xD71 + SYS___FREADING = 0xD65 + SYS___FREADING_UNLOCKED = 0xD6D + SYS___FSEEK2 = 0xB3C + SYS___FSETERR = 0xD6B + SYS___FSETLOCKING = 0xD67 + SYS___FTCHEP = 0x0BF + SYS___FTELL2 = 0xB3B + SYS___FUPDT = 0x0B5 + SYS___FWRITABLE = 0xD64 + SYS___FWRITING = 0xD66 + SYS___FWRITING_UNLOCKED = 0xD6E + SYS___GETCB = 0x0B4 + SYS___GETGRGID1 = 0xD5B + SYS___GETGRNAM1 = 0xD5C + SYS___GETTHENT = 0xCE5 + SYS___GETTOD = 0xD3E + SYS___HYPOTF_H = 0xAF6 + SYS___HYPOTL_H = 0xAF7 + SYS___ILOGBF_B = 0xA7F + SYS___ILOGBF_H = 0xA80 + SYS___ILOGBL_B = 0xA82 + SYS___ILOGBL_H = 0xA83 + SYS___ISBLANK_A = 0xB2E + SYS___ISBLNK = 0x0FE + SYS___ISWBLANK_A = 0xB2F + SYS___LE_CEEGTJS = 0xD72 + SYS___LE_TRACEBACK = 0xB7A + SYS___LGAMMAL_H = 0xA62 + SYS___LGAMMA_B_C99 = 0xB39 + SYS___LGAMMA_H_C99 = 0xB38 + SYS___LGAMMA_R_C99 = 0xB3A + SYS___LLRINTF_B = 0xA88 + SYS___LLRINTF_H = 0xA89 + SYS___LLRINTL_B = 0xA8B + SYS___LLRINTL_H = 0xA8C + SYS___LLRINT_B = 0xA85 + SYS___LLRINT_H = 0xA86 + SYS___LLROUNDF_B = 0xA91 + SYS___LLROUNDF_H = 0xA92 + SYS___LLROUNDL_B = 0xA94 + SYS___LLROUNDL_H = 0xA95 + SYS___LLROUND_B = 0xA8E + SYS___LLROUND_H = 0xA8F + SYS___LOCALE_CTL = 0xD47 + SYS___LOG1PF_H = 0xA60 + SYS___LOG1PL_H = 0xA61 + SYS___LOGBF_B = 0xA97 + SYS___LOGBF_H = 0xA98 + SYS___LOGBL_B = 0xA9A + SYS___LOGBL_H = 0xA9B + SYS___LOGIN_APPLID = 0xCE2 + SYS___LRINTF_B = 0xAA0 + SYS___LRINTF_H = 0xAA1 + SYS___LRINTL_B = 0xAA3 + SYS___LRINTL_H = 0xAA4 + SYS___LRINT_B = 0xA9D + SYS___LRINT_H = 0xA9E + SYS___LROUNDF_FIXUP = 0xB31 + SYS___LROUNDL_B = 0xAA6 + SYS___LROUNDL_H = 0xAA7 + SYS___LROUND_FIXUP = 0xB30 + SYS___MOSERVICES = 0xD3D + SYS___MUST_STAY_CLEAN = 0xB7C + SYS___NANF_B = 0xAAB + SYS___NANL_B = 0xAAD + SYS___NAN_B = 0xAA9 + SYS___NEARBYINTF_B = 0xAB2 + SYS___NEARBYINTF_H = 0xAB3 + SYS___NEARBYINTL_B = 0xAB5 + SYS___NEARBYINTL_H = 0xAB6 + SYS___NEARBYINT_B = 0xAAF + SYS___NEARBYINT_H = 0xAB0 + SYS___NEXTAFTERF_B = 0xAB8 + SYS___NEXTAFTERF_H = 0xAB9 + SYS___NEXTAFTERL_B = 0xABB + SYS___NEXTAFTERL_H = 0xABC + SYS___NEXTTOWARDF_B = 0xAC1 + SYS___NEXTTOWARDF_H = 0xAC2 + SYS___NEXTTOWARDL_B = 0xAC4 + SYS___NEXTTOWARDL_H = 0xAC5 + SYS___NEXTTOWARD_B = 0xABE + SYS___NEXTTOWARD_H = 0xABF + SYS___O_ENV = 0xB7D + SYS___PASSWD_APPLID = 0xCE3 + SYS___PTOD1 = 0xC9E + SYS___PTOD2 = 0xC9F + SYS___PTOD4 = 0xCA0 + SYS___REGCOMP_STD = 0x0EA + SYS___REMAINDERF_H = 0xAC6 + SYS___REMAINDERL_H = 0xAC7 + SYS___REMQUOD128 = 0xC10 + SYS___REMQUOD32 = 0xC0E + SYS___REMQUOD64 = 0xC0F + SYS___REMQUOF_H = 0xAC9 + SYS___REMQUOL_H = 0xACA + SYS___REMQUO_H = 0xAC8 + SYS___RINTF_B = 0xACC + SYS___RINTL_B = 0xACE + SYS___ROUNDF_B = 0xAD3 + SYS___ROUNDF_H = 0xAD4 + SYS___ROUNDL_B = 0xAD6 + SYS___ROUNDL_H = 0xAD7 + SYS___ROUND_B = 0xAD0 + SYS___ROUND_H = 0xAD1 + SYS___SCALBLNF_B = 0xADC + SYS___SCALBLNF_H = 0xADD + SYS___SCALBLNL_B = 0xADF + SYS___SCALBLNL_H = 0xAE0 + SYS___SCALBLN_B = 0xAD9 + SYS___SCALBLN_H = 0xADA + SYS___SCALBNF_B = 0xAE4 + SYS___SCALBNF_H = 0xAE5 + SYS___SCALBNL_B = 0xAE7 + SYS___SCALBNL_H = 0xAE8 + SYS___SCALBN_B = 0xAE1 + SYS___SCALBN_H = 0xAE2 + SYS___SETENV = 0x0C8 + SYS___SINPID128 = 0xC73 + SYS___SINPID32 = 0xC71 + SYS___SINPID64 = 0xC72 + SYS___SMF_RECORD2 = 0xD48 + SYS___STATIC_REINIT = 0xB3D + SYS___TGAMMAF_H_C99 = 0xB79 + SYS___TGAMMAL_H = 0xAE9 + SYS___TGAMMA_H_C99 = 0xB78 + SYS___TOCSNAME2 = 0xC9A + SYS_CEIL = 0x01F + SYS_CHAUDIT = 0x1E0 + SYS_EXP = 0x01A + SYS_FCHAUDIT = 0x1E1 + SYS_FREXP = 0x01D + SYS_GETGROUPSBYNAME = 0x1E2 + SYS_GETPWUID = 0x1A0 + SYS_GETUID = 0x1A1 + SYS_ISATTY = 0x1A3 + SYS_KILL = 0x1A4 + SYS_LDEXP = 0x01E + SYS_LINK = 0x1A5 + SYS_LOG10 = 0x01C + SYS_LSEEK = 0x1A6 + SYS_LSTAT = 0x1A7 + SYS_MKDIR = 0x1A8 + SYS_MKFIFO = 0x1A9 + SYS_MKNOD = 0x1AA + SYS_MODF = 0x01B + SYS_MOUNT = 0x1AB + SYS_OPEN = 0x1AC + SYS_OPENDIR = 0x1AD + SYS_PATHCONF = 0x1AE + SYS_PAUSE = 0x1AF + SYS_PIPE = 0x1B0 + SYS_PTHREAD_ATTR_DESTROY = 0x1E7 + SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB + SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 + SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED + SYS_PTHREAD_ATTR_INIT = 0x1E6 + SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA + SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 + SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC + SYS_PTHREAD_CANCEL = 0x1EE + SYS_PTHREAD_CLEANUP_POP = 0x1F0 + SYS_PTHREAD_CLEANUP_PUSH = 0x1EF + SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 + SYS_PTHREAD_CONDATTR_INIT = 0x1F1 + SYS_PTHREAD_COND_BROADCAST = 0x1F6 + SYS_PTHREAD_COND_DESTROY = 0x1F4 + SYS_PTHREAD_COND_INIT = 0x1F3 + SYS_PTHREAD_COND_SIGNAL = 0x1F5 + SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 + SYS_PTHREAD_COND_WAIT = 0x1F7 + SYS_PTHREAD_CREATE = 0x1F9 + SYS_PTHREAD_DETACH = 0x1FA + SYS_PTHREAD_EQUAL = 0x1FB + SYS_PTHREAD_EXIT = 0x1E4 + SYS_PTHREAD_GETSPECIFIC = 0x1FC + SYS_PTHREAD_JOIN = 0x1FD + SYS_PTHREAD_KEY_CREATE = 0x1FE + SYS_PTHREAD_KILL = 0x1E5 + SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF + SYS_READ = 0x1B2 + SYS_READDIR = 0x1B3 + SYS_READLINK = 0x1B4 + SYS_REWINDDIR = 0x1B5 + SYS_RMDIR = 0x1B6 + SYS_SETEGID = 0x1B7 + SYS_SETEUID = 0x1B8 + SYS_SETGID = 0x1B9 + SYS_SETPGID = 0x1BA + SYS_SETSID = 0x1BB + SYS_SETUID = 0x1BC + SYS_SIGACTION = 0x1BD + SYS_SIGADDSET = 0x1BE + SYS_SIGDELSET = 0x1BF + SYS_SIGEMPTYSET = 0x1C0 + SYS_SIGFILLSET = 0x1C1 + SYS_SIGISMEMBER = 0x1C2 + SYS_SIGLONGJMP = 0x1C3 + SYS_SIGPENDING = 0x1C4 + SYS_SIGPROCMASK = 0x1C5 + SYS_SIGSETJMP = 0x1C6 + SYS_SIGSUSPEND = 0x1C7 + SYS_SIGWAIT = 0x1E3 + SYS_SLEEP = 0x1C8 + SYS_STAT = 0x1C9 + SYS_SYMLINK = 0x1CB + SYS_SYSCONF = 0x1CC + SYS_TCDRAIN = 0x1CD + SYS_TCFLOW = 0x1CE + SYS_TCFLUSH = 0x1CF + SYS_TCGETATTR = 0x1D0 + SYS_TCGETPGRP = 0x1D1 + SYS_TCSENDBREAK = 0x1D2 + SYS_TCSETATTR = 0x1D3 + SYS_TCSETPGRP = 0x1D4 + SYS_TIMES = 0x1D5 + SYS_TTYNAME = 0x1D6 + SYS_TZSET = 0x1D7 + SYS_UMASK = 0x1D8 + SYS_UMOUNT = 0x1D9 + SYS_UNAME = 0x1DA + SYS_UNLINK = 0x1DB + SYS_UTIME = 0x1DC + SYS_WAIT = 0x1DD + SYS_WAITPID = 0x1DE + SYS_WRITE = 0x1DF + SYS_W_GETPSENT = 0x1B1 + SYS_W_IOCTL = 0x1A2 + SYS_W_STATFS = 0x1CA + SYS_A64L = 0x2EF + SYS_BCMP = 0x2B9 + SYS_BCOPY = 0x2BA + SYS_BZERO = 0x2BB + SYS_CATCLOSE = 0x2B6 + SYS_CATGETS = 0x2B7 + SYS_CATOPEN = 0x2B8 + SYS_CRYPT = 0x2AC + SYS_DBM_CLEARERR = 0x2F7 + SYS_DBM_CLOSE = 0x2F8 + SYS_DBM_DELETE = 0x2F9 + SYS_DBM_ERROR = 0x2FA + SYS_DBM_FETCH = 0x2FB + SYS_DBM_FIRSTKEY = 0x2FC + SYS_DBM_NEXTKEY = 0x2FD + SYS_DBM_OPEN = 0x2FE + SYS_DBM_STORE = 0x2FF + SYS_DRAND48 = 0x2B2 + SYS_ENCRYPT = 0x2AD + SYS_ENDUTXENT = 0x2E1 + SYS_ERAND48 = 0x2B3 + SYS_ERF = 0x02C + SYS_ERFC = 0x02D + SYS_FCHDIR = 0x2D9 + SYS_FFS = 0x2BC + SYS_FMTMSG = 0x2E5 + SYS_FSTATVFS = 0x2B4 + SYS_FTIME = 0x2F5 + SYS_GAMMA = 0x02E + SYS_GETDATE = 0x2A6 + SYS_GETPAGESIZE = 0x2D8 + SYS_GETTIMEOFDAY = 0x2F6 + SYS_GETUTXENT = 0x2E0 + SYS_GETUTXID = 0x2E2 + SYS_GETUTXLINE = 0x2E3 + SYS_HCREATE = 0x2C6 + SYS_HDESTROY = 0x2C7 + SYS_HSEARCH = 0x2C8 + SYS_HYPOT = 0x02B + SYS_INDEX = 0x2BD + SYS_INITSTATE = 0x2C2 + SYS_INSQUE = 0x2CF + SYS_ISASCII = 0x2ED + SYS_JRAND48 = 0x2E6 + SYS_L64A = 0x2F0 + SYS_LCONG48 = 0x2EA + SYS_LFIND = 0x2C9 + SYS_LRAND48 = 0x2E7 + SYS_LSEARCH = 0x2CA + SYS_MEMCCPY = 0x2D4 + SYS_MRAND48 = 0x2E8 + SYS_NRAND48 = 0x2E9 + SYS_PCLOSE = 0x2D2 + SYS_POPEN = 0x2D1 + SYS_PUTUTXLINE = 0x2E4 + SYS_RANDOM = 0x2C4 + SYS_REMQUE = 0x2D0 + SYS_RINDEX = 0x2BE + SYS_SEED48 = 0x2EC + SYS_SETKEY = 0x2AE + SYS_SETSTATE = 0x2C3 + SYS_SETUTXENT = 0x2DF + SYS_SRAND48 = 0x2EB + SYS_SRANDOM = 0x2C5 + SYS_STATVFS = 0x2B5 + SYS_STRCASECMP = 0x2BF + SYS_STRDUP = 0x2C0 + SYS_STRNCASECMP = 0x2C1 + SYS_SWAB = 0x2D3 + SYS_TDELETE = 0x2CB + SYS_TFIND = 0x2CC + SYS_TOASCII = 0x2EE + SYS_TSEARCH = 0x2CD + SYS_TWALK = 0x2CE + SYS_UALARM = 0x2F1 + SYS_USLEEP = 0x2F2 + SYS_WAIT3 = 0x2A7 + SYS_WAITID = 0x2A8 + SYS_Y1 = 0x02A + SYS___ATOE = 0x2DB + SYS___ATOE_L = 0x2DC + SYS___CATTRM = 0x2A9 + SYS___CNVBLK = 0x2AF + SYS___CRYTRM = 0x2B0 + SYS___DLGHT = 0x2A1 + SYS___ECRTRM = 0x2B1 + SYS___ETOA = 0x2DD + SYS___ETOA_L = 0x2DE + SYS___GDTRM = 0x2AA + SYS___OCLCK = 0x2DA + SYS___OPARGF = 0x2A2 + SYS___OPERRF = 0x2A5 + SYS___OPINDF = 0x2A4 + SYS___OPOPTF = 0x2A3 + SYS___RNDTRM = 0x2AB + SYS___SRCTRM = 0x2F4 + SYS___TZONE = 0x2A0 + SYS___UTXTRM = 0x2F3 + SYS_ASIN = 0x03E + SYS_ISXDIGIT = 0x03B + SYS_SETLOCAL = 0x03A + SYS_SETLOCALE = 0x03A + SYS_SIN = 0x03F + SYS_TOLOWER = 0x03C + SYS_TOUPPER = 0x03D + SYS_ACCEPT_AND_RECV = 0x4F7 + SYS_ATOL = 0x04E + SYS_CHECKSCH = 0x4BC + SYS_CHECKSCHENV = 0x4BC + SYS_CLEARERR = 0x04C + SYS_CONNECTS = 0x4B5 + SYS_CONNECTSERVER = 0x4B5 + SYS_CONNECTW = 0x4B4 + SYS_CONNECTWORKMGR = 0x4B4 + SYS_CONTINUE = 0x4B3 + SYS_CONTINUEWORKUNIT = 0x4B3 + SYS_COPYSIGN = 0x4C2 + SYS_CREATEWO = 0x4B2 + SYS_CREATEWORKUNIT = 0x4B2 + SYS_DELETEWO = 0x4B9 + SYS_DELETEWORKUNIT = 0x4B9 + SYS_DISCONNE = 0x4B6 + SYS_DISCONNECTSERVER = 0x4B6 + SYS_FEOF = 0x04D + SYS_FERROR = 0x04A + SYS_FINITE = 0x4C8 + SYS_GAMMA_R = 0x4E2 + SYS_JOINWORK = 0x4B7 + SYS_JOINWORKUNIT = 0x4B7 + SYS_LEAVEWOR = 0x4B8 + SYS_LEAVEWORKUNIT = 0x4B8 + SYS_LGAMMA_R = 0x4EB + SYS_MATHERR = 0x4D0 + SYS_PERROR = 0x04F + SYS_QUERYMET = 0x4BA + SYS_QUERYMETRICS = 0x4BA + SYS_QUERYSCH = 0x4BB + SYS_QUERYSCHENV = 0x4BB + SYS_REWIND = 0x04B + SYS_SCALBN = 0x4D4 + SYS_SIGNIFIC = 0x4D5 + SYS_SIGNIFICAND = 0x4D5 + SYS___ACOSH_B = 0x4DA + SYS___ACOS_B = 0x4D9 + SYS___ASINH_B = 0x4BE + SYS___ASIN_B = 0x4DB + SYS___ATAN2_B = 0x4DC + SYS___ATANH_B = 0x4DD + SYS___ATAN_B = 0x4BF + SYS___CBRT_B = 0x4C0 + SYS___CEIL_B = 0x4C1 + SYS___COSH_B = 0x4DE + SYS___COS_B = 0x4C3 + SYS___DGHT = 0x4A8 + SYS___ENVN = 0x4B0 + SYS___ERFC_B = 0x4C5 + SYS___ERF_B = 0x4C4 + SYS___EXPM1_B = 0x4C6 + SYS___EXP_B = 0x4DF + SYS___FABS_B = 0x4C7 + SYS___FLOOR_B = 0x4C9 + SYS___FMOD_B = 0x4E0 + SYS___FP_SETMODE = 0x4F8 + SYS___FREXP_B = 0x4CA + SYS___GAMMA_B = 0x4E1 + SYS___GDRR = 0x4A1 + SYS___HRRNO = 0x4A2 + SYS___HYPOT_B = 0x4E3 + SYS___ILOGB_B = 0x4CB + SYS___ISNAN_B = 0x4CC + SYS___J0_B = 0x4E4 + SYS___J1_B = 0x4E6 + SYS___JN_B = 0x4E8 + SYS___LDEXP_B = 0x4CD + SYS___LGAMMA_B = 0x4EA + SYS___LOG10_B = 0x4ED + SYS___LOG1P_B = 0x4CE + SYS___LOGB_B = 0x4CF + SYS___LOGIN = 0x4F5 + SYS___LOG_B = 0x4EC + SYS___MLOCKALL = 0x4B1 + SYS___MODF_B = 0x4D1 + SYS___NEXTAFTER_B = 0x4D2 + SYS___OPENDIR2 = 0x4F3 + SYS___OPEN_STAT = 0x4F6 + SYS___OPND = 0x4A5 + SYS___OPPT = 0x4A6 + SYS___OPRG = 0x4A3 + SYS___OPRR = 0x4A4 + SYS___PID_AFFINITY = 0x4BD + SYS___POW_B = 0x4EE + SYS___READDIR2 = 0x4F4 + SYS___REMAINDER_B = 0x4EF + SYS___RINT_B = 0x4D3 + SYS___SCALB_B = 0x4F0 + SYS___SIGACTIONSET = 0x4FB + SYS___SIGGM = 0x4A7 + SYS___SINH_B = 0x4F1 + SYS___SIN_B = 0x4D6 + SYS___SQRT_B = 0x4F2 + SYS___TANH_B = 0x4D8 + SYS___TAN_B = 0x4D7 + SYS___TRRNO = 0x4AF + SYS___TZNE = 0x4A9 + SYS___TZZN = 0x4AA + SYS___UCREATE = 0x4FC + SYS___UFREE = 0x4FE + SYS___UHEAPREPORT = 0x4FF + SYS___UMALLOC = 0x4FD + SYS___Y0_B = 0x4E5 + SYS___Y1_B = 0x4E7 + SYS___YN_B = 0x4E9 + SYS_ABORT = 0x05C + SYS_ASCTIME_R = 0x5E0 + SYS_ATEXIT = 0x05D + SYS_CONNECTE = 0x5AE + SYS_CONNECTEXPORTIMPORT = 0x5AE + SYS_CTIME_R = 0x5E1 + SYS_DN_COMP = 0x5DF + SYS_DN_EXPAND = 0x5DD + SYS_DN_SKIPNAME = 0x5DE + SYS_EXIT = 0x05A + SYS_EXPORTWO = 0x5A1 + SYS_EXPORTWORKUNIT = 0x5A1 + SYS_EXTRACTW = 0x5A5 + SYS_EXTRACTWORKUNIT = 0x5A5 + SYS_FSEEKO = 0x5C9 + SYS_FTELLO = 0x5C8 + SYS_GETGRGID_R = 0x5E7 + SYS_GETGRNAM_R = 0x5E8 + SYS_GETLOGIN_R = 0x5E9 + SYS_GETPWNAM_R = 0x5EA + SYS_GETPWUID_R = 0x5EB + SYS_GMTIME_R = 0x5E2 + SYS_IMPORTWO = 0x5A3 + SYS_IMPORTWORKUNIT = 0x5A3 + SYS_INET_NTOP = 0x5D3 + SYS_INET_PTON = 0x5D4 + SYS_LLABS = 0x5CE + SYS_LLDIV = 0x5CB + SYS_LOCALTIME_R = 0x5E3 + SYS_PTHREAD_ATFORK = 0x5ED + SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB + SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE + SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 + SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF + SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC + SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 + SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA + SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 + SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 + SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 + SYS_PTHREAD_DETACH_U98 = 0x5FD + SYS_PTHREAD_GETCONCURRENCY = 0x5F4 + SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE + SYS_PTHREAD_KEY_DELETE = 0x5F5 + SYS_PTHREAD_SETCANCELSTATE = 0x5FF + SYS_PTHREAD_SETCONCURRENCY = 0x5F6 + SYS_PTHREAD_SIGMASK = 0x5F7 + SYS_QUERYENC = 0x5AD + SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD + SYS_RAISE = 0x05E + SYS_RAND_R = 0x5E4 + SYS_READDIR_R = 0x5E6 + SYS_REALLOC = 0x05B + SYS_RES_INIT = 0x5D8 + SYS_RES_MKQUERY = 0x5D7 + SYS_RES_QUERY = 0x5D9 + SYS_RES_QUERYDOMAIN = 0x5DC + SYS_RES_SEARCH = 0x5DA + SYS_RES_SEND = 0x5DB + SYS_SETJMP = 0x05F + SYS_SIGQUEUE = 0x5A9 + SYS_STRTOK_R = 0x5E5 + SYS_STRTOLL = 0x5B0 + SYS_STRTOULL = 0x5B1 + SYS_TTYNAME_R = 0x5EC + SYS_UNDOEXPO = 0x5A2 + SYS_UNDOEXPORTWORKUNIT = 0x5A2 + SYS_UNDOIMPO = 0x5A4 + SYS_UNDOIMPORTWORKUNIT = 0x5A4 + SYS_WCSTOLL = 0x5CC + SYS_WCSTOULL = 0x5CD + SYS___ABORT = 0x05C + SYS___CONSOLE2 = 0x5D2 + SYS___CPL = 0x5A6 + SYS___DISCARDDATA = 0x5F8 + SYS___DSA_PREV = 0x5B2 + SYS___EP_FIND = 0x5B3 + SYS___FP_SWAPMODE = 0x5AF + SYS___GETUSERID = 0x5AB + SYS___GET_CPUID = 0x5B9 + SYS___GET_SYSTEM_SETTINGS = 0x5BA + SYS___IPDOMAINNAME = 0x5AC + SYS___MAP_INIT = 0x5A7 + SYS___MAP_SERVICE = 0x5A8 + SYS___MOUNT = 0x5AA + SYS___MSGRCV_TIMED = 0x5B7 + SYS___RES = 0x5D6 + SYS___SEMOP_TIMED = 0x5B8 + SYS___SERVER_THREADS_QUERY = 0x5B4 + SYS_FPRINTF = 0x06D + SYS_FSCANF = 0x06A + SYS_PRINTF = 0x06F + SYS_SETBUF = 0x06B + SYS_SETVBUF = 0x06C + SYS_SSCANF = 0x06E + SYS___CATGETS_A = 0x6C0 + SYS___CHAUDIT_A = 0x6F4 + SYS___CHMOD_A = 0x6E8 + SYS___COLLATE_INIT_A = 0x6AC + SYS___CREAT_A = 0x6F6 + SYS___CTYPE_INIT_A = 0x6AF + SYS___DLLLOAD_A = 0x6DF + SYS___DLLQUERYFN_A = 0x6E0 + SYS___DLLQUERYVAR_A = 0x6E1 + SYS___E2A_L = 0x6E3 + SYS___EXECLE_A = 0x6A0 + SYS___EXECLP_A = 0x6A4 + SYS___EXECVE_A = 0x6C1 + SYS___EXECVP_A = 0x6C2 + SYS___EXECV_A = 0x6B1 + SYS___FPRINTF_A = 0x6FA + SYS___GETADDRINFO_A = 0x6BF + SYS___GETNAMEINFO_A = 0x6C4 + SYS___GET_WCTYPE_STD_A = 0x6AE + SYS___ICONV_OPEN_A = 0x6DE + SYS___IF_INDEXTONAME_A = 0x6DC + SYS___IF_NAMETOINDEX_A = 0x6DB + SYS___ISWCTYPE_A = 0x6B0 + SYS___IS_WCTYPE_STD_A = 0x6B2 + SYS___LOCALECONV_A = 0x6B8 + SYS___LOCALECONV_STD_A = 0x6B9 + SYS___LOCALE_INIT_A = 0x6B7 + SYS___LSTAT_A = 0x6EE + SYS___LSTAT_O_A = 0x6EF + SYS___MKDIR_A = 0x6E9 + SYS___MKFIFO_A = 0x6EC + SYS___MKNOD_A = 0x6F0 + SYS___MONETARY_INIT_A = 0x6BC + SYS___MOUNT_A = 0x6F1 + SYS___NL_CSINFO_A = 0x6D6 + SYS___NL_LANGINFO_A = 0x6BA + SYS___NL_LNAGINFO_STD_A = 0x6BB + SYS___NL_MONINFO_A = 0x6D7 + SYS___NL_NUMINFO_A = 0x6D8 + SYS___NL_RESPINFO_A = 0x6D9 + SYS___NL_TIMINFO_A = 0x6DA + SYS___NUMERIC_INIT_A = 0x6C6 + SYS___OPEN_A = 0x6F7 + SYS___PRINTF_A = 0x6DD + SYS___RESP_INIT_A = 0x6C7 + SYS___RPMATCH_A = 0x6C8 + SYS___RPMATCH_C_A = 0x6C9 + SYS___RPMATCH_STD_A = 0x6CA + SYS___SETLOCALE_A = 0x6F9 + SYS___SPAWNP_A = 0x6C5 + SYS___SPAWN_A = 0x6C3 + SYS___SPRINTF_A = 0x6FB + SYS___STAT_A = 0x6EA + SYS___STAT_O_A = 0x6EB + SYS___STRCOLL_STD_A = 0x6A1 + SYS___STRFMON_A = 0x6BD + SYS___STRFMON_STD_A = 0x6BE + SYS___STRFTIME_A = 0x6CC + SYS___STRFTIME_STD_A = 0x6CD + SYS___STRPTIME_A = 0x6CE + SYS___STRPTIME_STD_A = 0x6CF + SYS___STRXFRM_A = 0x6A2 + SYS___STRXFRM_C_A = 0x6A3 + SYS___STRXFRM_STD_A = 0x6A5 + SYS___SYNTAX_INIT_A = 0x6D4 + SYS___TIME_INIT_A = 0x6CB + SYS___TOD_INIT_A = 0x6D5 + SYS___TOWLOWER_A = 0x6B3 + SYS___TOWLOWER_STD_A = 0x6B4 + SYS___TOWUPPER_A = 0x6B5 + SYS___TOWUPPER_STD_A = 0x6B6 + SYS___UMOUNT_A = 0x6F2 + SYS___VFPRINTF_A = 0x6FC + SYS___VPRINTF_A = 0x6FD + SYS___VSPRINTF_A = 0x6FE + SYS___VSWPRINTF_A = 0x6FF + SYS___WCSCOLL_A = 0x6A6 + SYS___WCSCOLL_C_A = 0x6A7 + SYS___WCSCOLL_STD_A = 0x6A8 + SYS___WCSFTIME_A = 0x6D0 + SYS___WCSFTIME_STD_A = 0x6D1 + SYS___WCSXFRM_A = 0x6A9 + SYS___WCSXFRM_C_A = 0x6AA + SYS___WCSXFRM_STD_A = 0x6AB + SYS___WCTYPE_A = 0x6AD + SYS___W_GETMNTENT_A = 0x6F5 + SYS_____CCSIDTYPE_A = 0x6E6 + SYS_____CHATTR_A = 0x6E2 + SYS_____CSNAMETYPE_A = 0x6E7 + SYS_____OPEN_STAT_A = 0x6ED + SYS_____SPAWN2_A = 0x6D2 + SYS_____SPAWNP2_A = 0x6D3 + SYS_____TOCCSID_A = 0x6E4 + SYS_____TOCSNAME_A = 0x6E5 + SYS_ACL_FREE = 0x7FF + SYS_ACL_INIT = 0x7FE + SYS_FWIDE = 0x7DF + SYS_FWPRINTF = 0x7D1 + SYS_FWRITE = 0x07E + SYS_FWSCANF = 0x7D5 + SYS_GETCHAR = 0x07B + SYS_GETS = 0x07C + SYS_M_CREATE_LAYOUT = 0x7C9 + SYS_M_DESTROY_LAYOUT = 0x7CA + SYS_M_GETVALUES_LAYOUT = 0x7CB + SYS_M_SETVALUES_LAYOUT = 0x7CC + SYS_M_TRANSFORM_LAYOUT = 0x7CD + SYS_M_WTRANSFORM_LAYOUT = 0x7CE + SYS_PREAD = 0x7C7 + SYS_PUTC = 0x07D + SYS_PUTCHAR = 0x07A + SYS_PUTS = 0x07F + SYS_PWRITE = 0x7C8 + SYS_TOWCTRAN = 0x7D8 + SYS_TOWCTRANS = 0x7D8 + SYS_UNATEXIT = 0x7B5 + SYS_VFWPRINT = 0x7D3 + SYS_VFWPRINTF = 0x7D3 + SYS_VWPRINTF = 0x7D4 + SYS_WCTRANS = 0x7D7 + SYS_WPRINTF = 0x7D2 + SYS_WSCANF = 0x7D6 + SYS___ASCTIME_R_A = 0x7A1 + SYS___BASENAME_A = 0x7DC + SYS___BTOWC_A = 0x7E4 + SYS___CDUMP_A = 0x7B7 + SYS___CEE3DMP_A = 0x7B6 + SYS___CEILF_H = 0x7F4 + SYS___CEILL_H = 0x7F5 + SYS___CEIL_H = 0x7EA + SYS___CRYPT_A = 0x7BE + SYS___CSNAP_A = 0x7B8 + SYS___CTEST_A = 0x7B9 + SYS___CTIME_R_A = 0x7A2 + SYS___CTRACE_A = 0x7BA + SYS___DBM_OPEN_A = 0x7E6 + SYS___DIRNAME_A = 0x7DD + SYS___FABSF_H = 0x7FA + SYS___FABSL_H = 0x7FB + SYS___FABS_H = 0x7ED + SYS___FGETWC_A = 0x7AA + SYS___FGETWS_A = 0x7AD + SYS___FLOORF_H = 0x7F6 + SYS___FLOORL_H = 0x7F7 + SYS___FLOOR_H = 0x7EB + SYS___FPUTWC_A = 0x7A5 + SYS___FPUTWS_A = 0x7A8 + SYS___GETTIMEOFDAY_A = 0x7AE + SYS___GETWCHAR_A = 0x7AC + SYS___GETWC_A = 0x7AB + SYS___GLOB_A = 0x7DE + SYS___GMTIME_A = 0x7AF + SYS___GMTIME_R_A = 0x7B0 + SYS___INET_PTON_A = 0x7BC + SYS___J0_H = 0x7EE + SYS___J1_H = 0x7EF + SYS___JN_H = 0x7F0 + SYS___LOCALTIME_A = 0x7B1 + SYS___LOCALTIME_R_A = 0x7B2 + SYS___MALLOC24 = 0x7FC + SYS___MALLOC31 = 0x7FD + SYS___MKTIME_A = 0x7B3 + SYS___MODFF_H = 0x7F8 + SYS___MODFL_H = 0x7F9 + SYS___MODF_H = 0x7EC + SYS___OPENDIR_A = 0x7C2 + SYS___OSNAME = 0x7E0 + SYS___PUTWCHAR_A = 0x7A7 + SYS___PUTWC_A = 0x7A6 + SYS___READDIR_A = 0x7C3 + SYS___STRTOLL_A = 0x7A3 + SYS___STRTOULL_A = 0x7A4 + SYS___SYSLOG_A = 0x7BD + SYS___TZZNA = 0x7B4 + SYS___UNGETWC_A = 0x7A9 + SYS___UTIME_A = 0x7A0 + SYS___VFPRINTF2_A = 0x7E7 + SYS___VPRINTF2_A = 0x7E8 + SYS___VSPRINTF2_A = 0x7E9 + SYS___VSWPRNTF2_A = 0x7BB + SYS___WCSTOD_A = 0x7D9 + SYS___WCSTOL_A = 0x7DA + SYS___WCSTOUL_A = 0x7DB + SYS___WCTOB_A = 0x7E5 + SYS___Y0_H = 0x7F1 + SYS___Y1_H = 0x7F2 + SYS___YN_H = 0x7F3 + SYS_____OPENDIR2_A = 0x7BF + SYS_____OSNAME_A = 0x7E1 + SYS_____READDIR2_A = 0x7C0 + SYS_DLCLOSE = 0x8DF + SYS_DLERROR = 0x8E0 + SYS_DLOPEN = 0x8DD + SYS_DLSYM = 0x8DE + SYS_FLOCKFILE = 0x8D3 + SYS_FTRYLOCKFILE = 0x8D4 + SYS_FUNLOCKFILE = 0x8D5 + SYS_GETCHAR_UNLOCKED = 0x8D7 + SYS_GETC_UNLOCKED = 0x8D6 + SYS_PUTCHAR_UNLOCKED = 0x8D9 + SYS_PUTC_UNLOCKED = 0x8D8 + SYS_SNPRINTF = 0x8DA + SYS_VSNPRINTF = 0x8DB + SYS_WCSCSPN = 0x08B + SYS_WCSLEN = 0x08C + SYS_WCSNCAT = 0x08D + SYS_WCSNCMP = 0x08A + SYS_WCSNCPY = 0x08F + SYS_WCSSPN = 0x08E + SYS___ABSF_H = 0x8E7 + SYS___ABSL_H = 0x8E8 + SYS___ABS_H = 0x8E6 + SYS___ACOSF_H = 0x8EA + SYS___ACOSH_H = 0x8EC + SYS___ACOSL_H = 0x8EB + SYS___ACOS_H = 0x8E9 + SYS___ASINF_H = 0x8EE + SYS___ASINH_H = 0x8F0 + SYS___ASINL_H = 0x8EF + SYS___ASIN_H = 0x8ED + SYS___ATAN2F_H = 0x8F8 + SYS___ATAN2L_H = 0x8F9 + SYS___ATAN2_H = 0x8F7 + SYS___ATANF_H = 0x8F2 + SYS___ATANHF_H = 0x8F5 + SYS___ATANHL_H = 0x8F6 + SYS___ATANH_H = 0x8F4 + SYS___ATANL_H = 0x8F3 + SYS___ATAN_H = 0x8F1 + SYS___CBRT_H = 0x8FA + SYS___COPYSIGNF_H = 0x8FB + SYS___COPYSIGNL_H = 0x8FC + SYS___COSF_H = 0x8FE + SYS___COSL_H = 0x8FF + SYS___COS_H = 0x8FD + SYS___DLERROR_A = 0x8D2 + SYS___DLOPEN_A = 0x8D0 + SYS___DLSYM_A = 0x8D1 + SYS___GETUTXENT_A = 0x8C6 + SYS___GETUTXID_A = 0x8C7 + SYS___GETUTXLINE_A = 0x8C8 + SYS___ITOA = 0x8AA + SYS___ITOA_A = 0x8B0 + SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 + SYS___LE_MSG_ADD_INSERT = 0x8A6 + SYS___LE_MSG_GET = 0x8A7 + SYS___LE_MSG_GET_AND_WRITE = 0x8A8 + SYS___LE_MSG_WRITE = 0x8A9 + SYS___LLTOA = 0x8AE + SYS___LLTOA_A = 0x8B4 + SYS___LTOA = 0x8AC + SYS___LTOA_A = 0x8B2 + SYS___PUTCHAR_UNLOCKED_A = 0x8CC + SYS___PUTC_UNLOCKED_A = 0x8CB + SYS___PUTUTXLINE_A = 0x8C9 + SYS___RESET_EXCEPTION_HANDLER = 0x8E3 + SYS___REXEC_A = 0x8C4 + SYS___REXEC_AF_A = 0x8C5 + SYS___SET_EXCEPTION_HANDLER = 0x8E2 + SYS___SNPRINTF_A = 0x8CD + SYS___SUPERKILL = 0x8A4 + SYS___TCGETATTR_A = 0x8A1 + SYS___TCSETATTR_A = 0x8A2 + SYS___ULLTOA = 0x8AF + SYS___ULLTOA_A = 0x8B5 + SYS___ULTOA = 0x8AD + SYS___ULTOA_A = 0x8B3 + SYS___UTOA = 0x8AB + SYS___UTOA_A = 0x8B1 + SYS___VHM_EVENT = 0x8E4 + SYS___VSNPRINTF_A = 0x8CE + SYS_____GETENV_A = 0x8C3 + SYS_____UTMPXNAME_A = 0x8CA + SYS_CACOSH = 0x9A0 + SYS_CACOSHF = 0x9A3 + SYS_CACOSHL = 0x9A6 + SYS_CARG = 0x9A9 + SYS_CARGF = 0x9AC + SYS_CARGL = 0x9AF + SYS_CASIN = 0x9B2 + SYS_CASINF = 0x9B5 + SYS_CASINH = 0x9BB + SYS_CASINHF = 0x9BE + SYS_CASINHL = 0x9C1 + SYS_CASINL = 0x9B8 + SYS_CATAN = 0x9C4 + SYS_CATANF = 0x9C7 + SYS_CATANH = 0x9CD + SYS_CATANHF = 0x9D0 + SYS_CATANHL = 0x9D3 + SYS_CATANL = 0x9CA + SYS_CCOS = 0x9D6 + SYS_CCOSF = 0x9D9 + SYS_CCOSH = 0x9DF + SYS_CCOSHF = 0x9E2 + SYS_CCOSHL = 0x9E5 + SYS_CCOSL = 0x9DC + SYS_CEXP = 0x9E8 + SYS_CEXPF = 0x9EB + SYS_CEXPL = 0x9EE + SYS_CIMAG = 0x9F1 + SYS_CIMAGF = 0x9F4 + SYS_CIMAGL = 0x9F7 + SYS_CLOGF = 0x9FD + SYS_MEMCHR = 0x09B + SYS_MEMCMP = 0x09A + SYS_STRCOLL = 0x09C + SYS_STRNCMP = 0x09D + SYS_STRRCHR = 0x09F + SYS_STRXFRM = 0x09E + SYS___CACOSHF_B = 0x9A4 + SYS___CACOSHF_H = 0x9A5 + SYS___CACOSHL_B = 0x9A7 + SYS___CACOSHL_H = 0x9A8 + SYS___CACOSH_B = 0x9A1 + SYS___CACOSH_H = 0x9A2 + SYS___CARGF_B = 0x9AD + SYS___CARGF_H = 0x9AE + SYS___CARGL_B = 0x9B0 + SYS___CARGL_H = 0x9B1 + SYS___CARG_B = 0x9AA + SYS___CARG_H = 0x9AB + SYS___CASINF_B = 0x9B6 + SYS___CASINF_H = 0x9B7 + SYS___CASINHF_B = 0x9BF + SYS___CASINHF_H = 0x9C0 + SYS___CASINHL_B = 0x9C2 + SYS___CASINHL_H = 0x9C3 + SYS___CASINH_B = 0x9BC + SYS___CASINH_H = 0x9BD + SYS___CASINL_B = 0x9B9 + SYS___CASINL_H = 0x9BA + SYS___CASIN_B = 0x9B3 + SYS___CASIN_H = 0x9B4 + SYS___CATANF_B = 0x9C8 + SYS___CATANF_H = 0x9C9 + SYS___CATANHF_B = 0x9D1 + SYS___CATANHF_H = 0x9D2 + SYS___CATANHL_B = 0x9D4 + SYS___CATANHL_H = 0x9D5 + SYS___CATANH_B = 0x9CE + SYS___CATANH_H = 0x9CF + SYS___CATANL_B = 0x9CB + SYS___CATANL_H = 0x9CC + SYS___CATAN_B = 0x9C5 + SYS___CATAN_H = 0x9C6 + SYS___CCOSF_B = 0x9DA + SYS___CCOSF_H = 0x9DB + SYS___CCOSHF_B = 0x9E3 + SYS___CCOSHF_H = 0x9E4 + SYS___CCOSHL_B = 0x9E6 + SYS___CCOSHL_H = 0x9E7 + SYS___CCOSH_B = 0x9E0 + SYS___CCOSH_H = 0x9E1 + SYS___CCOSL_B = 0x9DD + SYS___CCOSL_H = 0x9DE + SYS___CCOS_B = 0x9D7 + SYS___CCOS_H = 0x9D8 + SYS___CEXPF_B = 0x9EC + SYS___CEXPF_H = 0x9ED + SYS___CEXPL_B = 0x9EF + SYS___CEXPL_H = 0x9F0 + SYS___CEXP_B = 0x9E9 + SYS___CEXP_H = 0x9EA + SYS___CIMAGF_B = 0x9F5 + SYS___CIMAGF_H = 0x9F6 + SYS___CIMAGL_B = 0x9F8 + SYS___CIMAGL_H = 0x9F9 + SYS___CIMAG_B = 0x9F2 + SYS___CIMAG_H = 0x9F3 + SYS___CLOG = 0x9FA + SYS___CLOGF_B = 0x9FE + SYS___CLOGF_H = 0x9FF + SYS___CLOG_B = 0x9FB + SYS___CLOG_H = 0x9FC + SYS_ISWCTYPE = 0x10C + SYS_ISWXDIGI = 0x10A + SYS_ISWXDIGIT = 0x10A + SYS_MBSINIT = 0x10F + SYS_TOWLOWER = 0x10D + SYS_TOWUPPER = 0x10E + SYS_WCTYPE = 0x10B + SYS_WCSSTR = 0x11B + SYS___RPMTCH = 0x11A + SYS_WCSTOD = 0x12E + SYS_WCSTOK = 0x12C + SYS_WCSTOL = 0x12D + SYS_WCSTOUL = 0x12F + SYS_FGETWC = 0x13C + SYS_FGETWS = 0x13D + SYS_FPUTWC = 0x13E + SYS_FPUTWS = 0x13F + SYS_REGERROR = 0x13B + SYS_REGFREE = 0x13A + SYS_COLLEQUIV = 0x14F + SYS_COLLTOSTR = 0x14E + SYS_ISMCCOLLEL = 0x14C + SYS_STRTOCOLL = 0x14D + SYS_DLLFREE = 0x16F + SYS_DLLQUERYFN = 0x16D + SYS_DLLQUERYVAR = 0x16E + SYS_GETMCCOLL = 0x16A + SYS_GETWMCCOLL = 0x16B + SYS___ERR2AD = 0x16C + SYS_CFSETOSPEED = 0x17A + SYS_CHDIR = 0x17B + SYS_CHMOD = 0x17C + SYS_CHOWN = 0x17D + SYS_CLOSE = 0x17E + SYS_CLOSEDIR = 0x17F + SYS_LOG = 0x017 + SYS_COSH = 0x018 + SYS_FCHMOD = 0x18A + SYS_FCHOWN = 0x18B + SYS_FCNTL = 0x18C + SYS_FILENO = 0x18D + SYS_FORK = 0x18E + SYS_FPATHCONF = 0x18F + SYS_GETLOGIN = 0x19A + SYS_GETPGRP = 0x19C + SYS_GETPID = 0x19D + SYS_GETPPID = 0x19E + SYS_GETPWNAM = 0x19F + SYS_TANH = 0x019 + SYS_W_GETMNTENT = 0x19B + SYS_POW = 0x020 + SYS_PTHREAD_SELF = 0x20A + SYS_PTHREAD_SETINTR = 0x20B + SYS_PTHREAD_SETINTRTYPE = 0x20C + SYS_PTHREAD_SETSPECIFIC = 0x20D + SYS_PTHREAD_TESTINTR = 0x20E + SYS_PTHREAD_YIELD = 0x20F + SYS_SQRT = 0x021 + SYS_FLOOR = 0x022 + SYS_J1 = 0x023 + SYS_WCSPBRK = 0x23F + SYS_BSEARCH = 0x24C + SYS_FABS = 0x024 + SYS_GETENV = 0x24A + SYS_LDIV = 0x24D + SYS_SYSTEM = 0x24B + SYS_FMOD = 0x025 + SYS___RETHROW = 0x25F + SYS___THROW = 0x25E + SYS_J0 = 0x026 + SYS_PUTENV = 0x26A + SYS___GETENV = 0x26F + SYS_SEMCTL = 0x27A + SYS_SEMGET = 0x27B + SYS_SEMOP = 0x27C + SYS_SHMAT = 0x27D + SYS_SHMCTL = 0x27E + SYS_SHMDT = 0x27F + SYS_YN = 0x027 + SYS_JN = 0x028 + SYS_SIGALTSTACK = 0x28A + SYS_SIGHOLD = 0x28B + SYS_SIGIGNORE = 0x28C + SYS_SIGINTERRUPT = 0x28D + SYS_SIGPAUSE = 0x28E + SYS_SIGRELSE = 0x28F + SYS_GETOPT = 0x29A + SYS_GETSUBOPT = 0x29D + SYS_LCHOWN = 0x29B + SYS_SETPGRP = 0x29E + SYS_TRUNCATE = 0x29C + SYS_Y0 = 0x029 + SYS___GDERR = 0x29F + SYS_ISALPHA = 0x030 + SYS_VFORK = 0x30F + SYS__LONGJMP = 0x30D + SYS__SETJMP = 0x30E + SYS_GLOB = 0x31A + SYS_GLOBFREE = 0x31B + SYS_ISALNUM = 0x031 + SYS_PUTW = 0x31C + SYS_SEEKDIR = 0x31D + SYS_TELLDIR = 0x31E + SYS_TEMPNAM = 0x31F + SYS_GETTIMEOFDAY_R = 0x32E + SYS_ISLOWER = 0x032 + SYS_LGAMMA = 0x32C + SYS_REMAINDER = 0x32A + SYS_SCALB = 0x32B + SYS_SYNC = 0x32F + SYS_TTYSLOT = 0x32D + SYS_ENDPROTOENT = 0x33A + SYS_ENDSERVENT = 0x33B + SYS_GETHOSTBYADDR = 0x33D + SYS_GETHOSTBYADDR_R = 0x33C + SYS_GETHOSTBYNAME = 0x33F + SYS_GETHOSTBYNAME_R = 0x33E + SYS_ISCNTRL = 0x033 + SYS_GETSERVBYNAME = 0x34A + SYS_GETSERVBYPORT = 0x34B + SYS_GETSERVENT = 0x34C + SYS_GETSOCKNAME = 0x34D + SYS_GETSOCKOPT = 0x34E + SYS_INET_ADDR = 0x34F + SYS_ISDIGIT = 0x034 + SYS_ISGRAPH = 0x035 + SYS_SELECT = 0x35B + SYS_SELECTEX = 0x35C + SYS_SEND = 0x35D + SYS_SENDTO = 0x35F + SYS_CHROOT = 0x36A + SYS_ISNAN = 0x36D + SYS_ISUPPER = 0x036 + SYS_ULIMIT = 0x36C + SYS_UTIMES = 0x36E + SYS_W_STATVFS = 0x36B + SYS___H_ERRNO = 0x36F + SYS_GRANTPT = 0x37A + SYS_ISPRINT = 0x037 + SYS_TCGETSID = 0x37C + SYS_UNLOCKPT = 0x37B + SYS___TCGETCP = 0x37D + SYS___TCSETCP = 0x37E + SYS___TCSETTABLES = 0x37F + SYS_ISPUNCT = 0x038 + SYS_NLIST = 0x38C + SYS___IPDBCS = 0x38D + SYS___IPDSPX = 0x38E + SYS___IPMSGC = 0x38F + SYS___STHOSTENT = 0x38B + SYS___STSERVENT = 0x38A + SYS_ISSPACE = 0x039 + SYS_COS = 0x040 + SYS_T_ALLOC = 0x40A + SYS_T_BIND = 0x40B + SYS_T_CLOSE = 0x40C + SYS_T_CONNECT = 0x40D + SYS_T_ERROR = 0x40E + SYS_T_FREE = 0x40F + SYS_TAN = 0x041 + SYS_T_RCVREL = 0x41A + SYS_T_RCVUDATA = 0x41B + SYS_T_RCVUDERR = 0x41C + SYS_T_SND = 0x41D + SYS_T_SNDDIS = 0x41E + SYS_T_SNDREL = 0x41F + SYS_GETPMSG = 0x42A + SYS_ISASTREAM = 0x42B + SYS_PUTMSG = 0x42C + SYS_PUTPMSG = 0x42D + SYS_SINH = 0x042 + SYS___ISPOSIXON = 0x42E + SYS___OPENMVSREL = 0x42F + SYS_ACOS = 0x043 + SYS_ATAN = 0x044 + SYS_ATAN2 = 0x045 + SYS_FTELL = 0x046 + SYS_FGETPOS = 0x047 + SYS_SOCK_DEBUG = 0x47A + SYS_SOCK_DO_TESTSTOR = 0x47D + SYS_TAKESOCKET = 0x47E + SYS___SERVER_INIT = 0x47F + SYS_FSEEK = 0x048 + SYS___IPHOST = 0x48B + SYS___IPNODE = 0x48C + SYS___SERVER_CLASSIFY_CREATE = 0x48D + SYS___SERVER_CLASSIFY_DESTROY = 0x48E + SYS___SERVER_CLASSIFY_RESET = 0x48F + SYS___SMF_RECORD = 0x48A + SYS_FSETPOS = 0x049 + SYS___FNWSA = 0x49B + SYS___SPAWN2 = 0x49D + SYS___SPAWNP2 = 0x49E + SYS_ATOF = 0x050 + SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A + SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B + SYS_PTHREAD_RWLOCK_DESTROY = 0x50C + SYS_PTHREAD_RWLOCK_INIT = 0x50D + SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E + SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F + SYS_ATOI = 0x051 + SYS___FP_CLASS = 0x51D + SYS___FP_CLR_FLAG = 0x51A + SYS___FP_FINITE = 0x51E + SYS___FP_ISNAN = 0x51F + SYS___FP_RAISE_XCP = 0x51C + SYS___FP_READ_FLAG = 0x51B + SYS_RAND = 0x052 + SYS_SIGTIMEDWAIT = 0x52D + SYS_SIGWAITINFO = 0x52E + SYS___CHKBFP = 0x52F + SYS___FPC_RS = 0x52C + SYS___FPC_RW = 0x52A + SYS___FPC_SM = 0x52B + SYS_STRTOD = 0x053 + SYS_STRTOL = 0x054 + SYS_STRTOUL = 0x055 + SYS_MALLOC = 0x056 + SYS_SRAND = 0x057 + SYS_CALLOC = 0x058 + SYS_FREE = 0x059 + SYS___OSENV = 0x59F + SYS___W_PIOCTL = 0x59E + SYS_LONGJMP = 0x060 + SYS___FLOORF_B = 0x60A + SYS___FLOORL_B = 0x60B + SYS___FREXPF_B = 0x60C + SYS___FREXPL_B = 0x60D + SYS___LDEXPF_B = 0x60E + SYS___LDEXPL_B = 0x60F + SYS_SIGNAL = 0x061 + SYS___ATAN2F_B = 0x61A + SYS___ATAN2L_B = 0x61B + SYS___COSHF_B = 0x61C + SYS___COSHL_B = 0x61D + SYS___EXPF_B = 0x61E + SYS___EXPL_B = 0x61F + SYS_TMPNAM = 0x062 + SYS___ABSF_B = 0x62A + SYS___ABSL_B = 0x62C + SYS___ABS_B = 0x62B + SYS___FMODF_B = 0x62D + SYS___FMODL_B = 0x62E + SYS___MODFF_B = 0x62F + SYS_ATANL = 0x63A + SYS_CEILF = 0x63B + SYS_CEILL = 0x63C + SYS_COSF = 0x63D + SYS_COSHF = 0x63F + SYS_COSL = 0x63E + SYS_REMOVE = 0x063 + SYS_POWL = 0x64A + SYS_RENAME = 0x064 + SYS_SINF = 0x64B + SYS_SINHF = 0x64F + SYS_SINL = 0x64C + SYS_SQRTF = 0x64D + SYS_SQRTL = 0x64E + SYS_BTOWC = 0x65F + SYS_FREXPL = 0x65A + SYS_LDEXPF = 0x65B + SYS_LDEXPL = 0x65C + SYS_MODFF = 0x65D + SYS_MODFL = 0x65E + SYS_TMPFILE = 0x065 + SYS_FREOPEN = 0x066 + SYS___CHARMAP_INIT_A = 0x66E + SYS___GETHOSTBYADDR_R_A = 0x66C + SYS___GETHOSTBYNAME_A = 0x66A + SYS___GETHOSTBYNAME_R_A = 0x66D + SYS___MBLEN_A = 0x66F + SYS___RES_INIT_A = 0x66B + SYS_FCLOSE = 0x067 + SYS___GETGRGID_R_A = 0x67D + SYS___WCSTOMBS_A = 0x67A + SYS___WCSTOMBS_STD_A = 0x67B + SYS___WCSWIDTH_A = 0x67C + SYS___WCSWIDTH_ASIA = 0x67F + SYS___WCSWIDTH_STD_A = 0x67E + SYS_FFLUSH = 0x068 + SYS___GETLOGIN_R_A = 0x68E + SYS___GETPWNAM_R_A = 0x68C + SYS___GETPWUID_R_A = 0x68D + SYS___TTYNAME_R_A = 0x68F + SYS___WCWIDTH_ASIA = 0x68B + SYS___WCWIDTH_STD_A = 0x68A + SYS_FOPEN = 0x069 + SYS___REGEXEC_A = 0x69A + SYS___REGEXEC_STD_A = 0x69B + SYS___REGFREE_A = 0x69C + SYS___REGFREE_STD_A = 0x69D + SYS___STRCOLL_A = 0x69E + SYS___STRCOLL_C_A = 0x69F + SYS_SCANF = 0x070 + SYS___A64L_A = 0x70C + SYS___ECVT_A = 0x70D + SYS___FCVT_A = 0x70E + SYS___GCVT_A = 0x70F + SYS___STRTOUL_A = 0x70A + SYS_____AE_CORRESTBL_QUERY_A = 0x70B + SYS_SPRINTF = 0x071 + SYS___ACCESS_A = 0x71F + SYS___CATOPEN_A = 0x71E + SYS___GETOPT_A = 0x71D + SYS___REALPATH_A = 0x71A + SYS___SETENV_A = 0x71B + SYS___SYSTEM_A = 0x71C + SYS_FGETC = 0x072 + SYS___GAI_STRERROR_A = 0x72F + SYS___RMDIR_A = 0x72A + SYS___STATVFS_A = 0x72B + SYS___SYMLINK_A = 0x72C + SYS___TRUNCATE_A = 0x72D + SYS___UNLINK_A = 0x72E + SYS_VFPRINTF = 0x073 + SYS___ISSPACE_A = 0x73A + SYS___ISUPPER_A = 0x73B + SYS___ISWALNUM_A = 0x73F + SYS___ISXDIGIT_A = 0x73C + SYS___TOLOWER_A = 0x73D + SYS___TOUPPER_A = 0x73E + SYS_VPRINTF = 0x074 + SYS___CONFSTR_A = 0x74B + SYS___FDOPEN_A = 0x74E + SYS___FLDATA_A = 0x74F + SYS___FTOK_A = 0x74C + SYS___ISWXDIGIT_A = 0x74A + SYS___MKTEMP_A = 0x74D + SYS_VSPRINTF = 0x075 + SYS___GETGRGID_A = 0x75A + SYS___GETGRNAM_A = 0x75B + SYS___GETGROUPSBYNAME_A = 0x75C + SYS___GETHOSTENT_A = 0x75D + SYS___GETHOSTNAME_A = 0x75E + SYS___GETLOGIN_A = 0x75F + SYS_GETC = 0x076 + SYS___CREATEWORKUNIT_A = 0x76A + SYS___CTERMID_A = 0x76B + SYS___FMTMSG_A = 0x76C + SYS___INITGROUPS_A = 0x76D + SYS___MSGRCV_A = 0x76F + SYS_____LOGIN_A = 0x76E + SYS_FGETS = 0x077 + SYS___STRCASECMP_A = 0x77B + SYS___STRNCASECMP_A = 0x77C + SYS___TTYNAME_A = 0x77D + SYS___UNAME_A = 0x77E + SYS___UTIMES_A = 0x77F + SYS_____SERVER_PWU_A = 0x77A + SYS_FPUTC = 0x078 + SYS___CREAT_O_A = 0x78E + SYS___ENVNA = 0x78F + SYS___FREAD_A = 0x78A + SYS___FWRITE_A = 0x78B + SYS___ISASCII = 0x78D + SYS___OPEN_O_A = 0x78C + SYS_FPUTS = 0x079 + SYS___ASCTIME_A = 0x79C + SYS___CTIME_A = 0x79D + SYS___GETDATE_A = 0x79E + SYS___GETSERVBYPORT_A = 0x79A + SYS___GETSERVENT_A = 0x79B + SYS___TZSET_A = 0x79F + SYS_ACL_FROM_TEXT = 0x80C + SYS_ACL_SET_FD = 0x80A + SYS_ACL_SET_FILE = 0x80B + SYS_ACL_SORT = 0x80E + SYS_ACL_TO_TEXT = 0x80D + SYS_UNGETC = 0x080 + SYS___SHUTDOWN_REGISTRATION = 0x80F + SYS_FREAD = 0x081 + SYS_FREEADDRINFO = 0x81A + SYS_GAI_STRERROR = 0x81B + SYS_REXEC_AF = 0x81C + SYS___DYNALLOC_A = 0x81F + SYS___POE = 0x81D + SYS_WCSTOMBS = 0x082 + SYS___INET_ADDR_A = 0x82F + SYS___NLIST_A = 0x82A + SYS_____TCGETCP_A = 0x82B + SYS_____TCSETCP_A = 0x82C + SYS_____W_PIOCTL_A = 0x82E + SYS_MBTOWC = 0x083 + SYS___CABEND = 0x83D + SYS___LE_CIB_GET = 0x83E + SYS___RECVMSG_A = 0x83B + SYS___SENDMSG_A = 0x83A + SYS___SET_LAA_FOR_JIT = 0x83F + SYS_____LCHATTR_A = 0x83C + SYS_WCTOMB = 0x084 + SYS___CBRTL_B = 0x84A + SYS___COPYSIGNF_B = 0x84B + SYS___COPYSIGNL_B = 0x84C + SYS___COTANF_B = 0x84D + SYS___COTANL_B = 0x84F + SYS___COTAN_B = 0x84E + SYS_MBSTOWCS = 0x085 + SYS___LOG1PL_B = 0x85A + SYS___LOG2F_B = 0x85B + SYS___LOG2L_B = 0x85D + SYS___LOG2_B = 0x85C + SYS___REMAINDERF_B = 0x85E + SYS___REMAINDERL_B = 0x85F + SYS_ACOSHF = 0x86E + SYS_ACOSHL = 0x86F + SYS_WCSCPY = 0x086 + SYS___ERFCF_B = 0x86D + SYS___ERFF_B = 0x86C + SYS___LROUNDF_B = 0x86A + SYS___LROUND_B = 0x86B + SYS_COTANL = 0x87A + SYS_EXP2F = 0x87B + SYS_EXP2L = 0x87C + SYS_EXPM1F = 0x87D + SYS_EXPM1L = 0x87E + SYS_FDIMF = 0x87F + SYS_WCSCAT = 0x087 + SYS___COTANL = 0x87A + SYS_REMAINDERF = 0x88A + SYS_REMAINDERL = 0x88B + SYS_REMAINDF = 0x88A + SYS_REMAINDL = 0x88B + SYS_REMQUO = 0x88D + SYS_REMQUOF = 0x88C + SYS_REMQUOL = 0x88E + SYS_TGAMMAF = 0x88F + SYS_WCSCHR = 0x088 + SYS_ERFCF = 0x89B + SYS_ERFCL = 0x89C + SYS_ERFL = 0x89A + SYS_EXP2 = 0x89E + SYS_WCSCMP = 0x089 + SYS___EXP2_B = 0x89D + SYS___FAR_JUMP = 0x89F + SYS_ABS = 0x090 + SYS___ERFCL_H = 0x90A + SYS___EXPF_H = 0x90C + SYS___EXPL_H = 0x90D + SYS___EXPM1_H = 0x90E + SYS___EXP_H = 0x90B + SYS___FDIM_H = 0x90F + SYS_DIV = 0x091 + SYS___LOG2F_H = 0x91F + SYS___LOG2_H = 0x91E + SYS___LOGB_H = 0x91D + SYS___LOGF_H = 0x91B + SYS___LOGL_H = 0x91C + SYS___LOG_H = 0x91A + SYS_LABS = 0x092 + SYS___POWL_H = 0x92A + SYS___REMAINDER_H = 0x92B + SYS___RINT_H = 0x92C + SYS___SCALB_H = 0x92D + SYS___SINF_H = 0x92F + SYS___SIN_H = 0x92E + SYS_STRNCPY = 0x093 + SYS___TANHF_H = 0x93B + SYS___TANHL_H = 0x93C + SYS___TANH_H = 0x93A + SYS___TGAMMAF_H = 0x93E + SYS___TGAMMA_H = 0x93D + SYS___TRUNC_H = 0x93F + SYS_MEMCPY = 0x094 + SYS_VFWSCANF = 0x94A + SYS_VSWSCANF = 0x94E + SYS_VWSCANF = 0x94C + SYS_INET6_RTH_ADD = 0x95D + SYS_INET6_RTH_INIT = 0x95C + SYS_INET6_RTH_REVERSE = 0x95E + SYS_INET6_RTH_SEGMENTS = 0x95F + SYS_INET6_RTH_SPACE = 0x95B + SYS_MEMMOVE = 0x095 + SYS_WCSTOLD = 0x95A + SYS_STRCPY = 0x096 + SYS_STRCMP = 0x097 + SYS_CABS = 0x98E + SYS_STRCAT = 0x098 + SYS___CABS_B = 0x98F + SYS___POW_II = 0x98A + SYS___POW_II_B = 0x98B + SYS___POW_II_H = 0x98C + SYS_CACOSF = 0x99A + SYS_CACOSL = 0x99D + SYS_STRNCAT = 0x099 + SYS___CACOSF_B = 0x99B + SYS___CACOSF_H = 0x99C + SYS___CACOSL_B = 0x99E + SYS___CACOSL_H = 0x99F + SYS_ISWALPHA = 0x100 + SYS_ISWBLANK = 0x101 + SYS___ISWBLK = 0x101 + SYS_ISWCNTRL = 0x102 + SYS_ISWDIGIT = 0x103 + SYS_ISWGRAPH = 0x104 + SYS_ISWLOWER = 0x105 + SYS_ISWPRINT = 0x106 + SYS_ISWPUNCT = 0x107 + SYS_ISWSPACE = 0x108 + SYS_ISWUPPER = 0x109 + SYS_WCTOB = 0x110 + SYS_MBRLEN = 0x111 + SYS_MBRTOWC = 0x112 + SYS_MBSRTOWC = 0x113 + SYS_MBSRTOWCS = 0x113 + SYS_WCRTOMB = 0x114 + SYS_WCSRTOMB = 0x115 + SYS_WCSRTOMBS = 0x115 + SYS___CSID = 0x116 + SYS___WCSID = 0x117 + SYS_STRPTIME = 0x118 + SYS___STRPTM = 0x118 + SYS_STRFMON = 0x119 + SYS_WCSCOLL = 0x130 + SYS_WCSXFRM = 0x131 + SYS_WCSWIDTH = 0x132 + SYS_WCWIDTH = 0x133 + SYS_WCSFTIME = 0x134 + SYS_SWPRINTF = 0x135 + SYS_VSWPRINT = 0x136 + SYS_VSWPRINTF = 0x136 + SYS_SWSCANF = 0x137 + SYS_REGCOMP = 0x138 + SYS_REGEXEC = 0x139 + SYS_GETWC = 0x140 + SYS_GETWCHAR = 0x141 + SYS_PUTWC = 0x142 + SYS_PUTWCHAR = 0x143 + SYS_UNGETWC = 0x144 + SYS_ICONV_OPEN = 0x145 + SYS_ICONV = 0x146 + SYS_ICONV_CLOSE = 0x147 + SYS_COLLRANGE = 0x150 + SYS_CCLASS = 0x151 + SYS_COLLORDER = 0x152 + SYS___DEMANGLE = 0x154 + SYS_FDOPEN = 0x155 + SYS___ERRNO = 0x156 + SYS___ERRNO2 = 0x157 + SYS___TERROR = 0x158 + SYS_MAXCOLL = 0x169 + SYS_DLLLOAD = 0x170 + SYS__EXIT = 0x174 + SYS_ACCESS = 0x175 + SYS_ALARM = 0x176 + SYS_CFGETISPEED = 0x177 + SYS_CFGETOSPEED = 0x178 + SYS_CFSETISPEED = 0x179 + SYS_CREAT = 0x180 + SYS_CTERMID = 0x181 + SYS_DUP = 0x182 + SYS_DUP2 = 0x183 + SYS_EXECL = 0x184 + SYS_EXECLE = 0x185 + SYS_EXECLP = 0x186 + SYS_EXECV = 0x187 + SYS_EXECVE = 0x188 + SYS_EXECVP = 0x189 + SYS_FSTAT = 0x190 + SYS_FSYNC = 0x191 + SYS_FTRUNCATE = 0x192 + SYS_GETCWD = 0x193 + SYS_GETEGID = 0x194 + SYS_GETEUID = 0x195 + SYS_GETGID = 0x196 + SYS_GETGRGID = 0x197 + SYS_GETGRNAM = 0x198 + SYS_GETGROUPS = 0x199 + SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 + SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 + SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 + SYS_PTHREAD_MUTEX_INIT = 0x203 + SYS_PTHREAD_MUTEX_DESTROY = 0x204 + SYS_PTHREAD_MUTEX_LOCK = 0x205 + SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 + SYS_PTHREAD_MUTEX_UNLOCK = 0x207 + SYS_PTHREAD_ONCE = 0x209 + SYS_TW_OPEN = 0x210 + SYS_TW_FCNTL = 0x211 + SYS_PTHREAD_JOIN_D4_NP = 0x212 + SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 + SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 + SYS_EXTLINK_NP = 0x215 + SYS___PASSWD = 0x216 + SYS_SETGROUPS = 0x217 + SYS_INITGROUPS = 0x218 + SYS_WCSRCHR = 0x240 + SYS_SVC99 = 0x241 + SYS___SVC99 = 0x241 + SYS_WCSWCS = 0x242 + SYS_LOCALECO = 0x243 + SYS_LOCALECONV = 0x243 + SYS___LIBREL = 0x244 + SYS_RELEASE = 0x245 + SYS___RLSE = 0x245 + SYS_FLOCATE = 0x246 + SYS___FLOCT = 0x246 + SYS_FDELREC = 0x247 + SYS___FDLREC = 0x247 + SYS_FETCH = 0x248 + SYS___FETCH = 0x248 + SYS_QSORT = 0x249 + SYS___CLEANUPCATCH = 0x260 + SYS___CATCHMATCH = 0x261 + SYS___CLEAN2UPCATCH = 0x262 + SYS_GETPRIORITY = 0x270 + SYS_NICE = 0x271 + SYS_SETPRIORITY = 0x272 + SYS_GETITIMER = 0x273 + SYS_SETITIMER = 0x274 + SYS_MSGCTL = 0x275 + SYS_MSGGET = 0x276 + SYS_MSGRCV = 0x277 + SYS_MSGSND = 0x278 + SYS_MSGXRCV = 0x279 + SYS___MSGXR = 0x279 + SYS_SHMGET = 0x280 + SYS___GETIPC = 0x281 + SYS_SETGRENT = 0x282 + SYS_GETGRENT = 0x283 + SYS_ENDGRENT = 0x284 + SYS_SETPWENT = 0x285 + SYS_GETPWENT = 0x286 + SYS_ENDPWENT = 0x287 + SYS_BSD_SIGNAL = 0x288 + SYS_KILLPG = 0x289 + SYS_SIGSET = 0x290 + SYS_SIGSTACK = 0x291 + SYS_GETRLIMIT = 0x292 + SYS_SETRLIMIT = 0x293 + SYS_GETRUSAGE = 0x294 + SYS_MMAP = 0x295 + SYS_MPROTECT = 0x296 + SYS_MSYNC = 0x297 + SYS_MUNMAP = 0x298 + SYS_CONFSTR = 0x299 + SYS___NDMTRM = 0x300 + SYS_FTOK = 0x301 + SYS_BASENAME = 0x302 + SYS_DIRNAME = 0x303 + SYS_GETDTABLESIZE = 0x304 + SYS_MKSTEMP = 0x305 + SYS_MKTEMP = 0x306 + SYS_NFTW = 0x307 + SYS_GETWD = 0x308 + SYS_LOCKF = 0x309 + SYS_WORDEXP = 0x310 + SYS_WORDFREE = 0x311 + SYS_GETPGID = 0x312 + SYS_GETSID = 0x313 + SYS___UTMPXNAME = 0x314 + SYS_CUSERID = 0x315 + SYS_GETPASS = 0x316 + SYS_FNMATCH = 0x317 + SYS_FTW = 0x318 + SYS_GETW = 0x319 + SYS_ACOSH = 0x320 + SYS_ASINH = 0x321 + SYS_ATANH = 0x322 + SYS_CBRT = 0x323 + SYS_EXPM1 = 0x324 + SYS_ILOGB = 0x325 + SYS_LOGB = 0x326 + SYS_LOG1P = 0x327 + SYS_NEXTAFTER = 0x328 + SYS_RINT = 0x329 + SYS_SPAWN = 0x330 + SYS_SPAWNP = 0x331 + SYS_GETLOGIN_UU = 0x332 + SYS_ECVT = 0x333 + SYS_FCVT = 0x334 + SYS_GCVT = 0x335 + SYS_ACCEPT = 0x336 + SYS_BIND = 0x337 + SYS_CONNECT = 0x338 + SYS_ENDHOSTENT = 0x339 + SYS_GETHOSTENT = 0x340 + SYS_GETHOSTID = 0x341 + SYS_GETHOSTNAME = 0x342 + SYS_GETNETBYADDR = 0x343 + SYS_GETNETBYNAME = 0x344 + SYS_GETNETENT = 0x345 + SYS_GETPEERNAME = 0x346 + SYS_GETPROTOBYNAME = 0x347 + SYS_GETPROTOBYNUMBER = 0x348 + SYS_GETPROTOENT = 0x349 + SYS_INET_LNAOF = 0x350 + SYS_INET_MAKEADDR = 0x351 + SYS_INET_NETOF = 0x352 + SYS_INET_NETWORK = 0x353 + SYS_INET_NTOA = 0x354 + SYS_IOCTL = 0x355 + SYS_LISTEN = 0x356 + SYS_READV = 0x357 + SYS_RECV = 0x358 + SYS_RECVFROM = 0x359 + SYS_SETHOSTENT = 0x360 + SYS_SETNETENT = 0x361 + SYS_SETPEER = 0x362 + SYS_SETPROTOENT = 0x363 + SYS_SETSERVENT = 0x364 + SYS_SETSOCKOPT = 0x365 + SYS_SHUTDOWN = 0x366 + SYS_SOCKET = 0x367 + SYS_SOCKETPAIR = 0x368 + SYS_WRITEV = 0x369 + SYS_ENDNETENT = 0x370 + SYS_CLOSELOG = 0x371 + SYS_OPENLOG = 0x372 + SYS_SETLOGMASK = 0x373 + SYS_SYSLOG = 0x374 + SYS_PTSNAME = 0x375 + SYS_SETREUID = 0x376 + SYS_SETREGID = 0x377 + SYS_REALPATH = 0x378 + SYS___SIGNGAM = 0x379 + SYS_POLL = 0x380 + SYS_REXEC = 0x381 + SYS___ISASCII2 = 0x382 + SYS___TOASCII2 = 0x383 + SYS_CHPRIORITY = 0x384 + SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 + SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 + SYS_PTHREAD_SET_LIMIT_NP = 0x387 + SYS___STNETENT = 0x388 + SYS___STPROTOENT = 0x389 + SYS___SELECT1 = 0x390 + SYS_PTHREAD_SECURITY_NP = 0x391 + SYS___CHECK_RESOURCE_AUTH_NP = 0x392 + SYS___CONVERT_ID_NP = 0x393 + SYS___OPENVMREL = 0x394 + SYS_WMEMCHR = 0x395 + SYS_WMEMCMP = 0x396 + SYS_WMEMCPY = 0x397 + SYS_WMEMMOVE = 0x398 + SYS_WMEMSET = 0x399 + SYS___FPUTWC = 0x400 + SYS___PUTWC = 0x401 + SYS___PWCHAR = 0x402 + SYS___WCSFTM = 0x403 + SYS___WCSTOK = 0x404 + SYS___WCWDTH = 0x405 + SYS_T_ACCEPT = 0x409 + SYS_T_GETINFO = 0x410 + SYS_T_GETPROTADDR = 0x411 + SYS_T_GETSTATE = 0x412 + SYS_T_LISTEN = 0x413 + SYS_T_LOOK = 0x414 + SYS_T_OPEN = 0x415 + SYS_T_OPTMGMT = 0x416 + SYS_T_RCV = 0x417 + SYS_T_RCVCONNECT = 0x418 + SYS_T_RCVDIS = 0x419 + SYS_T_SNDUDATA = 0x420 + SYS_T_STRERROR = 0x421 + SYS_T_SYNC = 0x422 + SYS_T_UNBIND = 0x423 + SYS___T_ERRNO = 0x424 + SYS___RECVMSG2 = 0x425 + SYS___SENDMSG2 = 0x426 + SYS_FATTACH = 0x427 + SYS_FDETACH = 0x428 + SYS_GETMSG = 0x429 + SYS_GETCONTEXT = 0x430 + SYS_SETCONTEXT = 0x431 + SYS_MAKECONTEXT = 0x432 + SYS_SWAPCONTEXT = 0x433 + SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 + SYS_GETCLIENTID = 0x470 + SYS___GETCLIENTID = 0x471 + SYS_GETSTABLESIZE = 0x472 + SYS_GETIBMOPT = 0x473 + SYS_GETIBMSOCKOPT = 0x474 + SYS_GIVESOCKET = 0x475 + SYS_IBMSFLUSH = 0x476 + SYS_MAXDESC = 0x477 + SYS_SETIBMOPT = 0x478 + SYS_SETIBMSOCKOPT = 0x479 + SYS___SERVER_PWU = 0x480 + SYS_PTHREAD_TAG_NP = 0x481 + SYS___CONSOLE = 0x482 + SYS___WSINIT = 0x483 + SYS___IPTCPN = 0x489 + SYS___SERVER_CLASSIFY = 0x490 + SYS___HEAPRPT = 0x496 + SYS___ISBFP = 0x500 + SYS___FP_CAST = 0x501 + SYS___CERTIFICATE = 0x502 + SYS_SEND_FILE = 0x503 + SYS_AIO_CANCEL = 0x504 + SYS_AIO_ERROR = 0x505 + SYS_AIO_READ = 0x506 + SYS_AIO_RETURN = 0x507 + SYS_AIO_SUSPEND = 0x508 + SYS_AIO_WRITE = 0x509 + SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 + SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 + SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 + SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 + SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 + SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 + SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 + SYS___CTTBL = 0x517 + SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 + SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 + SYS___FP_UNORDERED = 0x520 + SYS___FP_READ_RND = 0x521 + SYS___FP_READ_RND_B = 0x522 + SYS___FP_SWAP_RND = 0x523 + SYS___FP_SWAP_RND_B = 0x524 + SYS___FP_LEVEL = 0x525 + SYS___FP_BTOH = 0x526 + SYS___FP_HTOB = 0x527 + SYS___FPC_RD = 0x528 + SYS___FPC_WR = 0x529 + SYS_PTHREAD_SETCANCELTYPE = 0x600 + SYS_PTHREAD_TESTCANCEL = 0x601 + SYS___ATANF_B = 0x602 + SYS___ATANL_B = 0x603 + SYS___CEILF_B = 0x604 + SYS___CEILL_B = 0x605 + SYS___COSF_B = 0x606 + SYS___COSL_B = 0x607 + SYS___FABSF_B = 0x608 + SYS___FABSL_B = 0x609 + SYS___SINF_B = 0x610 + SYS___SINL_B = 0x611 + SYS___TANF_B = 0x612 + SYS___TANL_B = 0x613 + SYS___TANHF_B = 0x614 + SYS___TANHL_B = 0x615 + SYS___ACOSF_B = 0x616 + SYS___ACOSL_B = 0x617 + SYS___ASINF_B = 0x618 + SYS___ASINL_B = 0x619 + SYS___LOGF_B = 0x620 + SYS___LOGL_B = 0x621 + SYS___LOG10F_B = 0x622 + SYS___LOG10L_B = 0x623 + SYS___POWF_B = 0x624 + SYS___POWL_B = 0x625 + SYS___SINHF_B = 0x626 + SYS___SINHL_B = 0x627 + SYS___SQRTF_B = 0x628 + SYS___SQRTL_B = 0x629 + SYS___MODFL_B = 0x630 + SYS_ABSF = 0x631 + SYS_ABSL = 0x632 + SYS_ACOSF = 0x633 + SYS_ACOSL = 0x634 + SYS_ASINF = 0x635 + SYS_ASINL = 0x636 + SYS_ATAN2F = 0x637 + SYS_ATAN2L = 0x638 + SYS_ATANF = 0x639 + SYS_COSHL = 0x640 + SYS_EXPF = 0x641 + SYS_EXPL = 0x642 + SYS_TANHF = 0x643 + SYS_TANHL = 0x644 + SYS_LOG10F = 0x645 + SYS_LOG10L = 0x646 + SYS_LOGF = 0x647 + SYS_LOGL = 0x648 + SYS_POWF = 0x649 + SYS_SINHL = 0x650 + SYS_TANF = 0x651 + SYS_TANL = 0x652 + SYS_FABSF = 0x653 + SYS_FABSL = 0x654 + SYS_FLOORF = 0x655 + SYS_FLOORL = 0x656 + SYS_FMODF = 0x657 + SYS_FMODL = 0x658 + SYS_FREXPF = 0x659 + SYS___CHATTR = 0x660 + SYS___FCHATTR = 0x661 + SYS___TOCCSID = 0x662 + SYS___CSNAMETYPE = 0x663 + SYS___TOCSNAME = 0x664 + SYS___CCSIDTYPE = 0x665 + SYS___AE_CORRESTBL_QUERY = 0x666 + SYS___AE_AUTOCONVERT_STATE = 0x667 + SYS_DN_FIND = 0x668 + SYS___GETHOSTBYADDR_A = 0x669 + SYS___MBLEN_SB_A = 0x670 + SYS___MBLEN_STD_A = 0x671 + SYS___MBLEN_UTF = 0x672 + SYS___MBSTOWCS_A = 0x673 + SYS___MBSTOWCS_STD_A = 0x674 + SYS___MBTOWC_A = 0x675 + SYS___MBTOWC_ISO1 = 0x676 + SYS___MBTOWC_SBCS = 0x677 + SYS___MBTOWC_MBCS = 0x678 + SYS___MBTOWC_UTF = 0x679 + SYS___CSID_A = 0x680 + SYS___CSID_STD_A = 0x681 + SYS___WCSID_A = 0x682 + SYS___WCSID_STD_A = 0x683 + SYS___WCTOMB_A = 0x684 + SYS___WCTOMB_ISO1 = 0x685 + SYS___WCTOMB_STD_A = 0x686 + SYS___WCTOMB_UTF = 0x687 + SYS___WCWIDTH_A = 0x688 + SYS___GETGRNAM_R_A = 0x689 + SYS___READDIR_R_A = 0x690 + SYS___E2A_S = 0x691 + SYS___FNMATCH_A = 0x692 + SYS___FNMATCH_C_A = 0x693 + SYS___EXECL_A = 0x694 + SYS___FNMATCH_STD_A = 0x695 + SYS___REGCOMP_A = 0x696 + SYS___REGCOMP_STD_A = 0x697 + SYS___REGERROR_A = 0x698 + SYS___REGERROR_STD_A = 0x699 + SYS___SWPRINTF_A = 0x700 + SYS___FSCANF_A = 0x701 + SYS___SCANF_A = 0x702 + SYS___SSCANF_A = 0x703 + SYS___SWSCANF_A = 0x704 + SYS___ATOF_A = 0x705 + SYS___ATOI_A = 0x706 + SYS___ATOL_A = 0x707 + SYS___STRTOD_A = 0x708 + SYS___STRTOL_A = 0x709 + SYS___L64A_A = 0x710 + SYS___STRERROR_A = 0x711 + SYS___PERROR_A = 0x712 + SYS___FETCH_A = 0x713 + SYS___GETENV_A = 0x714 + SYS___MKSTEMP_A = 0x717 + SYS___PTSNAME_A = 0x718 + SYS___PUTENV_A = 0x719 + SYS___CHDIR_A = 0x720 + SYS___CHOWN_A = 0x721 + SYS___CHROOT_A = 0x722 + SYS___GETCWD_A = 0x723 + SYS___GETWD_A = 0x724 + SYS___LCHOWN_A = 0x725 + SYS___LINK_A = 0x726 + SYS___PATHCONF_A = 0x727 + SYS___IF_NAMEINDEX_A = 0x728 + SYS___READLINK_A = 0x729 + SYS___EXTLINK_NP_A = 0x730 + SYS___ISALNUM_A = 0x731 + SYS___ISALPHA_A = 0x732 + SYS___A2E_S = 0x733 + SYS___ISCNTRL_A = 0x734 + SYS___ISDIGIT_A = 0x735 + SYS___ISGRAPH_A = 0x736 + SYS___ISLOWER_A = 0x737 + SYS___ISPRINT_A = 0x738 + SYS___ISPUNCT_A = 0x739 + SYS___ISWALPHA_A = 0x740 + SYS___A2E_L = 0x741 + SYS___ISWCNTRL_A = 0x742 + SYS___ISWDIGIT_A = 0x743 + SYS___ISWGRAPH_A = 0x744 + SYS___ISWLOWER_A = 0x745 + SYS___ISWPRINT_A = 0x746 + SYS___ISWPUNCT_A = 0x747 + SYS___ISWSPACE_A = 0x748 + SYS___ISWUPPER_A = 0x749 + SYS___REMOVE_A = 0x750 + SYS___RENAME_A = 0x751 + SYS___TMPNAM_A = 0x752 + SYS___FOPEN_A = 0x753 + SYS___FREOPEN_A = 0x754 + SYS___CUSERID_A = 0x755 + SYS___POPEN_A = 0x756 + SYS___TEMPNAM_A = 0x757 + SYS___FTW_A = 0x758 + SYS___GETGRENT_A = 0x759 + SYS___INET_NTOP_A = 0x760 + SYS___GETPASS_A = 0x761 + SYS___GETPWENT_A = 0x762 + SYS___GETPWNAM_A = 0x763 + SYS___GETPWUID_A = 0x764 + SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 + SYS___CHECKSCHENV_A = 0x766 + SYS___CONNECTSERVER_A = 0x767 + SYS___CONNECTWORKMGR_A = 0x768 + SYS_____CONSOLE_A = 0x769 + SYS___MSGSND_A = 0x770 + SYS___MSGXRCV_A = 0x771 + SYS___NFTW_A = 0x772 + SYS_____PASSWD_A = 0x773 + SYS___PTHREAD_SECURITY_NP_A = 0x774 + SYS___QUERYMETRICS_A = 0x775 + SYS___QUERYSCHENV = 0x776 + SYS___READV_A = 0x777 + SYS_____SERVER_CLASSIFY_A = 0x778 + SYS_____SERVER_INIT_A = 0x779 + SYS___W_GETPSENT_A = 0x780 + SYS___WRITEV_A = 0x781 + SYS___W_STATFS_A = 0x782 + SYS___W_STATVFS_A = 0x783 + SYS___FPUTC_A = 0x784 + SYS___PUTCHAR_A = 0x785 + SYS___PUTS_A = 0x786 + SYS___FGETS_A = 0x787 + SYS___GETS_A = 0x788 + SYS___FPUTS_A = 0x789 + SYS___PUTC_A = 0x790 + SYS___AE_THREAD_SETMODE = 0x791 + SYS___AE_THREAD_SWAPMODE = 0x792 + SYS___GETNETBYADDR_A = 0x793 + SYS___GETNETBYNAME_A = 0x794 + SYS___GETNETENT_A = 0x795 + SYS___GETPROTOBYNAME_A = 0x796 + SYS___GETPROTOBYNUMBER_A = 0x797 + SYS___GETPROTOENT_A = 0x798 + SYS___GETSERVBYNAME_A = 0x799 + SYS_ACL_FIRST_ENTRY = 0x800 + SYS_ACL_GET_ENTRY = 0x801 + SYS_ACL_VALID = 0x802 + SYS_ACL_CREATE_ENTRY = 0x803 + SYS_ACL_DELETE_ENTRY = 0x804 + SYS_ACL_UPDATE_ENTRY = 0x805 + SYS_ACL_DELETE_FD = 0x806 + SYS_ACL_DELETE_FILE = 0x807 + SYS_ACL_GET_FD = 0x808 + SYS_ACL_GET_FILE = 0x809 + SYS___ERFL_B = 0x810 + SYS___ERFCL_B = 0x811 + SYS___LGAMMAL_B = 0x812 + SYS___SETHOOKEVENTS = 0x813 + SYS_IF_NAMETOINDEX = 0x814 + SYS_IF_INDEXTONAME = 0x815 + SYS_IF_NAMEINDEX = 0x816 + SYS_IF_FREENAMEINDEX = 0x817 + SYS_GETADDRINFO = 0x818 + SYS_GETNAMEINFO = 0x819 + SYS___DYNFREE_A = 0x820 + SYS___RES_QUERY_A = 0x821 + SYS___RES_SEARCH_A = 0x822 + SYS___RES_QUERYDOMAIN_A = 0x823 + SYS___RES_MKQUERY_A = 0x824 + SYS___RES_SEND_A = 0x825 + SYS___DN_EXPAND_A = 0x826 + SYS___DN_SKIPNAME_A = 0x827 + SYS___DN_COMP_A = 0x828 + SYS___DN_FIND_A = 0x829 + SYS___INET_NTOA_A = 0x830 + SYS___INET_NETWORK_A = 0x831 + SYS___ACCEPT_A = 0x832 + SYS___ACCEPT_AND_RECV_A = 0x833 + SYS___BIND_A = 0x834 + SYS___CONNECT_A = 0x835 + SYS___GETPEERNAME_A = 0x836 + SYS___GETSOCKNAME_A = 0x837 + SYS___RECVFROM_A = 0x838 + SYS___SENDTO_A = 0x839 + SYS___LCHATTR = 0x840 + SYS___WRITEDOWN = 0x841 + SYS_PTHREAD_MUTEX_INIT2 = 0x842 + SYS___ACOSHF_B = 0x843 + SYS___ACOSHL_B = 0x844 + SYS___ASINHF_B = 0x845 + SYS___ASINHL_B = 0x846 + SYS___ATANHF_B = 0x847 + SYS___ATANHL_B = 0x848 + SYS___CBRTF_B = 0x849 + SYS___EXP2F_B = 0x850 + SYS___EXP2L_B = 0x851 + SYS___EXPM1F_B = 0x852 + SYS___EXPM1L_B = 0x853 + SYS___FDIMF_B = 0x854 + SYS___FDIM_B = 0x855 + SYS___FDIML_B = 0x856 + SYS___HYPOTF_B = 0x857 + SYS___HYPOTL_B = 0x858 + SYS___LOG1PF_B = 0x859 + SYS___REMQUOF_B = 0x860 + SYS___REMQUO_B = 0x861 + SYS___REMQUOL_B = 0x862 + SYS___TGAMMAF_B = 0x863 + SYS___TGAMMA_B = 0x864 + SYS___TGAMMAL_B = 0x865 + SYS___TRUNCF_B = 0x866 + SYS___TRUNC_B = 0x867 + SYS___TRUNCL_B = 0x868 + SYS___LGAMMAF_B = 0x869 + SYS_ASINHF = 0x870 + SYS_ASINHL = 0x871 + SYS_ATANHF = 0x872 + SYS_ATANHL = 0x873 + SYS_CBRTF = 0x874 + SYS_CBRTL = 0x875 + SYS_COPYSIGNF = 0x876 + SYS_CPYSIGNF = 0x876 + SYS_COPYSIGNL = 0x877 + SYS_CPYSIGNL = 0x877 + SYS_COTANF = 0x878 + SYS___COTANF = 0x878 + SYS_COTAN = 0x879 + SYS___COTAN = 0x879 + SYS_FDIM = 0x881 + SYS_FDIML = 0x882 + SYS_HYPOTF = 0x883 + SYS_HYPOTL = 0x884 + SYS_LOG1PF = 0x885 + SYS_LOG1PL = 0x886 + SYS_LOG2F = 0x887 + SYS_LOG2 = 0x888 + SYS_LOG2L = 0x889 + SYS_TGAMMA = 0x890 + SYS_TGAMMAL = 0x891 + SYS_TRUNCF = 0x892 + SYS_TRUNC = 0x893 + SYS_TRUNCL = 0x894 + SYS_LGAMMAF = 0x895 + SYS_LGAMMAL = 0x896 + SYS_LROUNDF = 0x897 + SYS_LROUND = 0x898 + SYS_ERFF = 0x899 + SYS___COSHF_H = 0x900 + SYS___COSHL_H = 0x901 + SYS___COTAN_H = 0x902 + SYS___COTANF_H = 0x903 + SYS___COTANL_H = 0x904 + SYS___ERF_H = 0x905 + SYS___ERFF_H = 0x906 + SYS___ERFL_H = 0x907 + SYS___ERFC_H = 0x908 + SYS___ERFCF_H = 0x909 + SYS___FDIMF_H = 0x910 + SYS___FDIML_H = 0x911 + SYS___FMOD_H = 0x912 + SYS___FMODF_H = 0x913 + SYS___FMODL_H = 0x914 + SYS___GAMMA_H = 0x915 + SYS___HYPOT_H = 0x916 + SYS___ILOGB_H = 0x917 + SYS___LGAMMA_H = 0x918 + SYS___LGAMMAF_H = 0x919 + SYS___LOG2L_H = 0x920 + SYS___LOG1P_H = 0x921 + SYS___LOG10_H = 0x922 + SYS___LOG10F_H = 0x923 + SYS___LOG10L_H = 0x924 + SYS___LROUND_H = 0x925 + SYS___LROUNDF_H = 0x926 + SYS___NEXTAFTER_H = 0x927 + SYS___POW_H = 0x928 + SYS___POWF_H = 0x929 + SYS___SINL_H = 0x930 + SYS___SINH_H = 0x931 + SYS___SINHF_H = 0x932 + SYS___SINHL_H = 0x933 + SYS___SQRT_H = 0x934 + SYS___SQRTF_H = 0x935 + SYS___SQRTL_H = 0x936 + SYS___TAN_H = 0x937 + SYS___TANF_H = 0x938 + SYS___TANL_H = 0x939 + SYS___TRUNCF_H = 0x940 + SYS___TRUNCL_H = 0x941 + SYS___COSH_H = 0x942 + SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 + SYS_VFSCANF = 0x944 + SYS_VSCANF = 0x946 + SYS_VSSCANF = 0x948 + SYS_IMAXABS = 0x950 + SYS_IMAXDIV = 0x951 + SYS_STRTOIMAX = 0x952 + SYS_STRTOUMAX = 0x953 + SYS_WCSTOIMAX = 0x954 + SYS_WCSTOUMAX = 0x955 + SYS_ATOLL = 0x956 + SYS_STRTOF = 0x957 + SYS_STRTOLD = 0x958 + SYS_WCSTOF = 0x959 + SYS_INET6_RTH_GETADDR = 0x960 + SYS_INET6_OPT_INIT = 0x961 + SYS_INET6_OPT_APPEND = 0x962 + SYS_INET6_OPT_FINISH = 0x963 + SYS_INET6_OPT_SET_VAL = 0x964 + SYS_INET6_OPT_NEXT = 0x965 + SYS_INET6_OPT_FIND = 0x966 + SYS_INET6_OPT_GET_VAL = 0x967 + SYS___POW_I = 0x987 + SYS___POW_I_B = 0x988 + SYS___POW_I_H = 0x989 + SYS___CABS_H = 0x990 + SYS_CABSF = 0x991 + SYS___CABSF_B = 0x992 + SYS___CABSF_H = 0x993 + SYS_CABSL = 0x994 + SYS___CABSL_B = 0x995 + SYS___CABSL_H = 0x996 + SYS_CACOS = 0x997 + SYS___CACOS_B = 0x998 + SYS___CACOS_H = 0x999 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 17c53bd9b33..091d107f3a5 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -306,19 +306,6 @@ type XVSockPgen struct { type _Socklen uint32 -type SaeAssocID uint32 - -type SaeConnID uint32 - -type SaEndpoints struct { - Srcif uint32 - Srcaddr *RawSockaddr - Srcaddrlen uint32 - Dstaddr *RawSockaddr - Dstaddrlen uint32 - _ [4]byte -} - type Xucred struct { Version uint32 Uid uint32 @@ -462,14 +449,11 @@ type FdSet struct { const ( SizeofIfMsghdr = 0x70 - SizeofIfMsghdr2 = 0xa0 SizeofIfData = 0x60 - SizeofIfData64 = 0x80 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr2 = 0x14 SizeofRtMsghdr = 0x5c - SizeofRtMsghdr2 = 0x5c SizeofRtMetrics = 0x38 ) @@ -483,20 +467,6 @@ type IfMsghdr struct { Data IfData } -type IfMsghdr2 struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Snd_len int32 - Snd_maxlen int32 - Snd_drops int32 - Timer int32 - Data IfData64 -} - type IfData struct { Type uint8 Typelen uint8 @@ -529,34 +499,6 @@ type IfData struct { Reserved2 uint32 } -type IfData64 struct { - Type uint8 - Typelen uint8 - Physical uint8 - Addrlen uint8 - Hdrlen uint8 - Recvquota uint8 - Xmitquota uint8 - Unused1 uint8 - Mtu uint32 - Metric uint32 - Baudrate uint64 - Ipackets uint64 - Ierrors uint64 - Opackets uint64 - Oerrors uint64 - Collisions uint64 - Ibytes uint64 - Obytes uint64 - Imcasts uint64 - Omcasts uint64 - Iqdrops uint64 - Noproto uint64 - Recvtiming uint32 - Xmittiming uint32 - Lastchange Timeval32 -} - type IfaMsghdr struct { Msglen uint16 Version uint8 @@ -602,21 +544,6 @@ type RtMsghdr struct { Rmx RtMetrics } -type RtMsghdr2 struct { - Msglen uint16 - Version uint8 - Type uint8 - Index uint16 - Flags int32 - Addrs int32 - Refcnt int32 - Parentflags int32 - Reserved int32 - Use int32 - Inits uint32 - Rmx RtMetrics -} - type RtMetrics struct { Locks uint32 Mtu uint32 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index 2392226a743..28ff4ef74d0 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -306,19 +306,6 @@ type XVSockPgen struct { type _Socklen uint32 -type SaeAssocID uint32 - -type SaeConnID uint32 - -type SaEndpoints struct { - Srcif uint32 - Srcaddr *RawSockaddr - Srcaddrlen uint32 - Dstaddr *RawSockaddr - Dstaddrlen uint32 - _ [4]byte -} - type Xucred struct { Version uint32 Uid uint32 @@ -462,14 +449,11 @@ type FdSet struct { const ( SizeofIfMsghdr = 0x70 - SizeofIfMsghdr2 = 0xa0 SizeofIfData = 0x60 - SizeofIfData64 = 0x80 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr2 = 0x14 SizeofRtMsghdr = 0x5c - SizeofRtMsghdr2 = 0x5c SizeofRtMetrics = 0x38 ) @@ -483,20 +467,6 @@ type IfMsghdr struct { Data IfData } -type IfMsghdr2 struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Snd_len int32 - Snd_maxlen int32 - Snd_drops int32 - Timer int32 - Data IfData64 -} - type IfData struct { Type uint8 Typelen uint8 @@ -529,34 +499,6 @@ type IfData struct { Reserved2 uint32 } -type IfData64 struct { - Type uint8 - Typelen uint8 - Physical uint8 - Addrlen uint8 - Hdrlen uint8 - Recvquota uint8 - Xmitquota uint8 - Unused1 uint8 - Mtu uint32 - Metric uint32 - Baudrate uint64 - Ipackets uint64 - Ierrors uint64 - Opackets uint64 - Oerrors uint64 - Collisions uint64 - Ibytes uint64 - Obytes uint64 - Imcasts uint64 - Omcasts uint64 - Iqdrops uint64 - Noproto uint64 - Recvtiming uint32 - Xmittiming uint32 - Lastchange Timeval32 -} - type IfaMsghdr struct { Msglen uint16 Version uint8 @@ -602,21 +544,6 @@ type RtMsghdr struct { Rmx RtMetrics } -type RtMsghdr2 struct { - Msglen uint16 - Version uint8 - Type uint8 - Index uint16 - Flags int32 - Addrs int32 - Refcnt int32 - Parentflags int32 - Reserved int32 - Use int32 - Inits uint32 - Rmx RtMetrics -} - type RtMetrics struct { Locks uint32 Mtu uint32 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 51e13eb055f..6cbd094a3aa 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -625,7 +625,6 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 - POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index d002d8ef3cc..7c03b6ee77f 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -630,7 +630,6 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 - POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index 3f863d898dd..422107ee8b1 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -616,7 +616,6 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 - POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index 61c72931066..505a12acfd9 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -610,7 +610,6 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 - POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go index b5d17414f03..cc986c79006 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go @@ -612,7 +612,6 @@ const ( POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 - POLLRDHUP = 0x4000 ) type CapRights struct { diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux.go index 5537148dcbb..eff6bcdef81 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -87,35 +87,30 @@ type StatxTimestamp struct { } type Statx_t struct { - Mask uint32 - Blksize uint32 - Attributes uint64 - Nlink uint32 - Uid uint32 - Gid uint32 - Mode uint16 - _ [1]uint16 - Ino uint64 - Size uint64 - Blocks uint64 - Attributes_mask uint64 - Atime StatxTimestamp - Btime StatxTimestamp - Ctime StatxTimestamp - Mtime StatxTimestamp - Rdev_major uint32 - Rdev_minor uint32 - Dev_major uint32 - Dev_minor uint32 - Mnt_id uint64 - Dio_mem_align uint32 - Dio_offset_align uint32 - Subvol uint64 - Atomic_write_unit_min uint32 - Atomic_write_unit_max uint32 - Atomic_write_segments_max uint32 - _ [1]uint32 - _ [9]uint64 + Mask uint32 + Blksize uint32 + Attributes uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Mode uint16 + _ [1]uint16 + Ino uint64 + Size uint64 + Blocks uint64 + Attributes_mask uint64 + Atime StatxTimestamp + Btime StatxTimestamp + Ctime StatxTimestamp + Mtime StatxTimestamp + Rdev_major uint32 + Rdev_minor uint32 + Dev_major uint32 + Dev_minor uint32 + Mnt_id uint64 + Dio_mem_align uint32 + Dio_offset_align uint32 + _ [12]uint64 } type Fsid struct { @@ -520,29 +515,6 @@ type TCPInfo struct { Total_rto_time uint32 } -type TCPVegasInfo struct { - Enabled uint32 - Rttcnt uint32 - Rtt uint32 - Minrtt uint32 -} - -type TCPDCTCPInfo struct { - Enabled uint16 - Ce_state uint16 - Alpha uint32 - Ab_ecn uint32 - Ab_tot uint32 -} - -type TCPBBRInfo struct { - Bw_lo uint32 - Bw_hi uint32 - Min_rtt uint32 - Pacing_gain uint32 - Cwnd_gain uint32 -} - type CanFilter struct { Id uint32 Mask uint32 @@ -584,7 +556,6 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0xf8 - SizeofTCPCCInfo = 0x14 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 ) @@ -1207,8 +1178,7 @@ const ( PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 0x10 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 0x11 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 0x12 - PERF_SAMPLE_BRANCH_COUNTERS = 0x80000 - PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x14 + PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x13 PERF_SAMPLE_BRANCH_USER = 0x1 PERF_SAMPLE_BRANCH_KERNEL = 0x2 PERF_SAMPLE_BRANCH_HV = 0x4 @@ -1228,7 +1198,7 @@ const ( PERF_SAMPLE_BRANCH_TYPE_SAVE = 0x10000 PERF_SAMPLE_BRANCH_HW_INDEX = 0x20000 PERF_SAMPLE_BRANCH_PRIV_SAVE = 0x40000 - PERF_SAMPLE_BRANCH_MAX = 0x100000 + PERF_SAMPLE_BRANCH_MAX = 0x80000 PERF_BR_UNKNOWN = 0x0 PERF_BR_COND = 0x1 PERF_BR_UNCOND = 0x2 @@ -1752,6 +1722,12 @@ const ( IFLA_IPVLAN_UNSPEC = 0x0 IFLA_IPVLAN_MODE = 0x1 IFLA_IPVLAN_FLAGS = 0x2 + NETKIT_NEXT = -0x1 + NETKIT_PASS = 0x0 + NETKIT_DROP = 0x2 + NETKIT_REDIRECT = 0x7 + NETKIT_L2 = 0x0 + NETKIT_L3 = 0x1 IFLA_NETKIT_UNSPEC = 0x0 IFLA_NETKIT_PEER_INFO = 0x1 IFLA_NETKIT_PRIMARY = 0x2 @@ -1790,7 +1766,6 @@ const ( IFLA_VXLAN_DF = 0x1d IFLA_VXLAN_VNIFILTER = 0x1e IFLA_VXLAN_LOCALBYPASS = 0x1f - IFLA_VXLAN_LABEL_POLICY = 0x20 IFLA_GENEVE_UNSPEC = 0x0 IFLA_GENEVE_ID = 0x1 IFLA_GENEVE_REMOTE = 0x2 @@ -1820,8 +1795,6 @@ const ( IFLA_GTP_ROLE = 0x4 IFLA_GTP_CREATE_SOCKETS = 0x5 IFLA_GTP_RESTART_COUNT = 0x6 - IFLA_GTP_LOCAL = 0x7 - IFLA_GTP_LOCAL6 = 0x8 IFLA_BOND_UNSPEC = 0x0 IFLA_BOND_MODE = 0x1 IFLA_BOND_ACTIVE_SLAVE = 0x2 @@ -1854,7 +1827,6 @@ const ( IFLA_BOND_AD_LACP_ACTIVE = 0x1d IFLA_BOND_MISSED_MAX = 0x1e IFLA_BOND_NS_IP6_TARGET = 0x1f - IFLA_BOND_COUPLED_CONTROL = 0x20 IFLA_BOND_AD_INFO_UNSPEC = 0x0 IFLA_BOND_AD_INFO_AGGREGATOR = 0x1 IFLA_BOND_AD_INFO_NUM_PORTS = 0x2 @@ -1923,7 +1895,6 @@ const ( IFLA_HSR_SEQ_NR = 0x5 IFLA_HSR_VERSION = 0x6 IFLA_HSR_PROTOCOL = 0x7 - IFLA_HSR_INTERLINK = 0x8 IFLA_STATS_UNSPEC = 0x0 IFLA_STATS_LINK_64 = 0x1 IFLA_STATS_LINK_XSTATS = 0x2 @@ -1976,15 +1947,6 @@ const ( IFLA_DSA_MASTER = 0x1 ) -const ( - NETKIT_NEXT = -0x1 - NETKIT_PASS = 0x0 - NETKIT_DROP = 0x2 - NETKIT_REDIRECT = 0x7 - NETKIT_L2 = 0x0 - NETKIT_L3 = 0x1 -) - const ( NF_INET_PRE_ROUTING = 0x0 NF_INET_LOCAL_IN = 0x1 @@ -2519,15 +2481,6 @@ type XDPMmapOffsets struct { Cr XDPRingOffset } -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - Tx_metadata_len uint32 -} - type XDPStatistics struct { Rx_dropped uint64 Rx_invalid_descs uint64 @@ -2594,8 +2547,8 @@ const ( SOF_TIMESTAMPING_BIND_PHC = 0x8000 SOF_TIMESTAMPING_OPT_ID_TCP = 0x10000 - SOF_TIMESTAMPING_LAST = 0x20000 - SOF_TIMESTAMPING_MASK = 0x3ffff + SOF_TIMESTAMPING_LAST = 0x10000 + SOF_TIMESTAMPING_MASK = 0x1ffff SCM_TSTAMP_SND = 0x0 SCM_TSTAMP_SCHED = 0x1 @@ -2982,7 +2935,7 @@ const ( BPF_TCP_LISTEN = 0xa BPF_TCP_CLOSING = 0xb BPF_TCP_NEW_SYN_RECV = 0xc - BPF_TCP_MAX_STATES = 0xe + BPF_TCP_MAX_STATES = 0xd TCP_BPF_IW = 0x3e9 TCP_BPF_SNDCWND_CLAMP = 0x3ea TCP_BPF_DELACK_MAX = 0x3eb @@ -3258,7 +3211,7 @@ const ( DEVLINK_CMD_LINECARD_NEW = 0x50 DEVLINK_CMD_LINECARD_DEL = 0x51 DEVLINK_CMD_SELFTESTS_GET = 0x52 - DEVLINK_CMD_MAX = 0x54 + DEVLINK_CMD_MAX = 0x53 DEVLINK_PORT_TYPE_NOTSET = 0x0 DEVLINK_PORT_TYPE_AUTO = 0x1 DEVLINK_PORT_TYPE_ETH = 0x2 @@ -3510,7 +3463,7 @@ const ( DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5 ) type FsverityDigest struct { @@ -3541,7 +3494,7 @@ type Nhmsg struct { type NexthopGrp struct { Id uint32 Weight uint8 - High uint8 + Resvd1 uint8 Resvd2 uint16 } @@ -3802,7 +3755,7 @@ const ( ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 - ETHTOOL_MSG_USER_MAX = 0x2d + ETHTOOL_MSG_USER_MAX = 0x2b ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3842,15 +3795,12 @@ const ( ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 - ETHTOOL_MSG_KERNEL_MAX = 0x2e - ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 - ETHTOOL_FLAG_OMIT_REPLY = 0x2 - ETHTOOL_FLAG_STATS = 0x4 + ETHTOOL_MSG_KERNEL_MAX = 0x2b ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 ETHTOOL_A_HEADER_FLAGS = 0x3 - ETHTOOL_A_HEADER_MAX = 0x4 + ETHTOOL_A_HEADER_MAX = 0x3 ETHTOOL_A_BITSET_BIT_UNSPEC = 0x0 ETHTOOL_A_BITSET_BIT_INDEX = 0x1 ETHTOOL_A_BITSET_BIT_NAME = 0x2 @@ -3987,7 +3937,7 @@ const ( ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX = 0x18 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX = 0x19 - ETHTOOL_A_COALESCE_MAX = 0x1e + ETHTOOL_A_COALESCE_MAX = 0x1c ETHTOOL_A_PAUSE_UNSPEC = 0x0 ETHTOOL_A_PAUSE_HEADER = 0x1 ETHTOOL_A_PAUSE_AUTONEG = 0x2 @@ -4015,7 +3965,7 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x6 + ETHTOOL_A_TSINFO_MAX = 0x5 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4031,11 +3981,11 @@ const ( ETHTOOL_A_CABLE_RESULT_UNSPEC = 0x0 ETHTOOL_A_CABLE_RESULT_PAIR = 0x1 ETHTOOL_A_CABLE_RESULT_CODE = 0x2 - ETHTOOL_A_CABLE_RESULT_MAX = 0x3 + ETHTOOL_A_CABLE_RESULT_MAX = 0x2 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC = 0x0 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR = 0x1 ETHTOOL_A_CABLE_FAULT_LENGTH_CM = 0x2 - ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = 0x3 + ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = 0x2 ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED = 0x1 ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED = 0x2 @@ -4118,107 +4068,6 @@ type EthtoolDrvinfo struct { Regdump_len uint32 } -type EthtoolTsInfo struct { - Cmd uint32 - So_timestamping uint32 - Phc_index int32 - Tx_types uint32 - Tx_reserved [3]uint32 - Rx_filters uint32 - Rx_reserved [3]uint32 -} - -type HwTstampConfig struct { - Flags int32 - Tx_type int32 - Rx_filter int32 -} - -const ( - HWTSTAMP_FILTER_NONE = 0x0 - HWTSTAMP_FILTER_ALL = 0x1 - HWTSTAMP_FILTER_SOME = 0x2 - HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 - HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 - HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 - HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc -) - -const ( - HWTSTAMP_TX_OFF = 0x0 - HWTSTAMP_TX_ON = 0x1 - HWTSTAMP_TX_ONESTEP_SYNC = 0x2 -) - -type ( - PtpClockCaps struct { - Max_adj int32 - N_alarm int32 - N_ext_ts int32 - N_per_out int32 - Pps int32 - N_pins int32 - Cross_timestamping int32 - Adjust_phase int32 - Max_phase_adj int32 - Rsv [11]int32 - } - PtpClockTime struct { - Sec int64 - Nsec uint32 - Reserved uint32 - } - PtpExttsEvent struct { - T PtpClockTime - Index uint32 - Flags uint32 - Rsv [2]uint32 - } - PtpExttsRequest struct { - Index uint32 - Flags uint32 - Rsv [2]uint32 - } - PtpPeroutRequest struct { - StartOrPhase PtpClockTime - Period PtpClockTime - Index uint32 - Flags uint32 - On PtpClockTime - } - PtpPinDesc struct { - Name [64]byte - Index uint32 - Func uint32 - Chan uint32 - Rsv [5]uint32 - } - PtpSysOffset struct { - Samples uint32 - Rsv [3]uint32 - Ts [51]PtpClockTime - } - PtpSysOffsetExtended struct { - Samples uint32 - Clockid int32 - Rsv [2]uint32 - Ts [25][3]PtpClockTime - } - PtpSysOffsetPrecise struct { - Device PtpClockTime - Realtime PtpClockTime - Monoraw PtpClockTime - Rsv [4]uint32 - } -) - -const ( - PTP_PF_NONE = 0x0 - PTP_PF_EXTTS = 0x1 - PTP_PF_PEROUT = 0x2 - PTP_PF_PHYSYNC = 0x3 -) - type ( HIDRawReportDescriptor struct { Size uint32 @@ -4400,7 +4249,6 @@ const ( type LandlockRulesetAttr struct { Access_fs uint64 Access_net uint64 - Scoped uint64 } type LandlockPathBeneathAttr struct { @@ -4747,7 +4595,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14c + NL80211_ATTR_MAX = 0x146 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -5013,7 +4861,7 @@ const ( NL80211_BSS_FREQUENCY_OFFSET = 0x14 NL80211_BSS_INFORMATION_ELEMENTS = 0x6 NL80211_BSS_LAST_SEEN_BOOTTIME = 0xf - NL80211_BSS_MAX = 0x18 + NL80211_BSS_MAX = 0x16 NL80211_BSS_MLD_ADDR = 0x16 NL80211_BSS_MLO_LINK_ID = 0x15 NL80211_BSS_PAD = 0x10 @@ -5117,7 +4965,7 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x9b + NL80211_CMD_MAX = 0x9a NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5351,7 +5199,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x21 + NL80211_FREQUENCY_ATTR_MAX = 0x1c NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5845,7 +5693,7 @@ const ( NL80211_STA_FLAG_ASSOCIATED = 0x7 NL80211_STA_FLAG_AUTHENTICATED = 0x5 NL80211_STA_FLAG_AUTHORIZED = 0x1 - NL80211_STA_FLAG_MAX = 0x8 + NL80211_STA_FLAG_MAX = 0x7 NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 @@ -6143,34 +5991,3 @@ type CachestatRange struct { Off uint64 Len uint64 } - -const ( - SK_MEMINFO_RMEM_ALLOC = 0x0 - SK_MEMINFO_RCVBUF = 0x1 - SK_MEMINFO_WMEM_ALLOC = 0x2 - SK_MEMINFO_SNDBUF = 0x3 - SK_MEMINFO_FWD_ALLOC = 0x4 - SK_MEMINFO_WMEM_QUEUED = 0x5 - SK_MEMINFO_OPTMEM = 0x6 - SK_MEMINFO_BACKLOG = 0x7 - SK_MEMINFO_DROPS = 0x8 - SK_MEMINFO_VARS = 0x9 - SKNLGRP_NONE = 0x0 - SKNLGRP_INET_TCP_DESTROY = 0x1 - SKNLGRP_INET_UDP_DESTROY = 0x2 - SKNLGRP_INET6_TCP_DESTROY = 0x3 - SKNLGRP_INET6_UDP_DESTROY = 0x4 - SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0 - SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1 - SK_DIAG_BPF_STORAGE_REP_NONE = 0x0 - SK_DIAG_BPF_STORAGE = 0x1 - SK_DIAG_BPF_STORAGE_NONE = 0x0 - SK_DIAG_BPF_STORAGE_PAD = 0x1 - SK_DIAG_BPF_STORAGE_MAP_ID = 0x2 - SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3 -) - -type SockDiagReq struct { - Family uint8 - Protocol uint8 -} diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fd402da43fc..438a30affad 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -477,6 +477,14 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index eb7a5e1864a..adceca3553b 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -492,6 +492,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index d78ac108b6c..eeaa00a37d6 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -470,6 +470,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index cd06d47f1f7..6739aa91d4e 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -471,6 +471,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 2f28fe26c1a..9920ef6317d 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -472,6 +472,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 71d6cac2f1a..2923b799a48 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -476,6 +476,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 8596d453563..ce2750ee415 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -474,6 +474,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index cd60ea18662..3038811d70b 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -474,6 +474,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index b0ae420c489..efc6fed18c1 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -476,6 +476,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 8359728759b..9a654b75a90 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -482,6 +482,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 69eb6a5c689..40d358e33e3 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -481,6 +481,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 5f583cb62bf..148c6ceb869 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -481,6 +481,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index ad05b51a603..72ba81543ef 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -499,6 +499,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 @@ -727,37 +736,6 @@ const ( RISCV_HWPROBE_EXT_ZBA = 0x8 RISCV_HWPROBE_EXT_ZBB = 0x10 RISCV_HWPROBE_EXT_ZBS = 0x20 - RISCV_HWPROBE_EXT_ZICBOZ = 0x40 - RISCV_HWPROBE_EXT_ZBC = 0x80 - RISCV_HWPROBE_EXT_ZBKB = 0x100 - RISCV_HWPROBE_EXT_ZBKC = 0x200 - RISCV_HWPROBE_EXT_ZBKX = 0x400 - RISCV_HWPROBE_EXT_ZKND = 0x800 - RISCV_HWPROBE_EXT_ZKNE = 0x1000 - RISCV_HWPROBE_EXT_ZKNH = 0x2000 - RISCV_HWPROBE_EXT_ZKSED = 0x4000 - RISCV_HWPROBE_EXT_ZKSH = 0x8000 - RISCV_HWPROBE_EXT_ZKT = 0x10000 - RISCV_HWPROBE_EXT_ZVBB = 0x20000 - RISCV_HWPROBE_EXT_ZVBC = 0x40000 - RISCV_HWPROBE_EXT_ZVKB = 0x80000 - RISCV_HWPROBE_EXT_ZVKG = 0x100000 - RISCV_HWPROBE_EXT_ZVKNED = 0x200000 - RISCV_HWPROBE_EXT_ZVKNHA = 0x400000 - RISCV_HWPROBE_EXT_ZVKNHB = 0x800000 - RISCV_HWPROBE_EXT_ZVKSED = 0x1000000 - RISCV_HWPROBE_EXT_ZVKSH = 0x2000000 - RISCV_HWPROBE_EXT_ZVKT = 0x4000000 - RISCV_HWPROBE_EXT_ZFH = 0x8000000 - RISCV_HWPROBE_EXT_ZFHMIN = 0x10000000 - RISCV_HWPROBE_EXT_ZIHINTNTL = 0x20000000 - RISCV_HWPROBE_EXT_ZVFH = 0x40000000 - RISCV_HWPROBE_EXT_ZVFHMIN = 0x80000000 - RISCV_HWPROBE_EXT_ZFA = 0x100000000 - RISCV_HWPROBE_EXT_ZTSO = 0x200000000 - RISCV_HWPROBE_EXT_ZACAS = 0x400000000 - RISCV_HWPROBE_EXT_ZICOND = 0x800000000 - RISCV_HWPROBE_EXT_ZIHINTPAUSE = 0x1000000000 RISCV_HWPROBE_KEY_CPUPERF_0 = 0x5 RISCV_HWPROBE_MISALIGNED_UNKNOWN = 0x0 RISCV_HWPROBE_MISALIGNED_EMULATED = 0x1 @@ -765,6 +743,4 @@ const ( RISCV_HWPROBE_MISALIGNED_FAST = 0x3 RISCV_HWPROBE_MISALIGNED_UNSUPPORTED = 0x4 RISCV_HWPROBE_MISALIGNED_MASK = 0x7 - RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6 - RISCV_HWPROBE_WHICH_CPUS = 0x1 ) diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index cf3ce900377..71e765508e2 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -495,6 +495,15 @@ const ( BLKPG = 0x1269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 590b56739c5..4abbdb9de93 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -476,6 +476,15 @@ const ( BLKPG = 0x20001269 ) +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/upstream/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/upstream/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go index 2e5d5a44357..54f31be6373 100644 --- a/upstream/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +++ b/upstream/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -25,13 +25,10 @@ const ( SizeofIPv6Mreq = 20 SizeofICMPv6Filter = 32 SizeofIPv6MTUInfo = 32 - SizeofInet4Pktinfo = 8 - SizeofInet6Pktinfo = 20 SizeofLinger = 8 SizeofSockaddrInet4 = 16 SizeofSockaddrInet6 = 28 SizeofTCPInfo = 0x68 - SizeofUcred = 12 ) type ( @@ -72,17 +69,12 @@ type Utimbuf struct { } type Utsname struct { - Sysname [16]byte - Nodename [32]byte - Release [8]byte - Version [8]byte - Machine [16]byte -} - -type Ucred struct { - Pid int32 - Uid uint32 - Gid uint32 + Sysname [65]byte + Nodename [65]byte + Release [65]byte + Version [65]byte + Machine [65]byte + Domainname [65]byte } type RawSockaddrInet4 struct { @@ -333,7 +325,7 @@ type Statvfs_t struct { } type Statfs_t struct { - Type uint64 + Type uint32 Bsize uint64 Blocks uint64 Bfree uint64 @@ -344,7 +336,6 @@ type Statfs_t struct { Namelen uint64 Frsize uint64 Flags uint64 - _ [4]uint64 } type direntLE struct { @@ -377,12 +368,6 @@ type Flock_t struct { Pid int32 } -type F_cnvrt struct { - Cvtcmd int32 - Pccsid int16 - Fccsid int16 -} - type Termios struct { Cflag uint32 Iflag uint32 @@ -427,126 +412,3 @@ type W_Mntent struct { Quiesceowner [8]byte _ [38]byte } - -type EpollEvent struct { - Events uint32 - _ int32 - Fd int32 - Pad int32 -} - -type InotifyEvent struct { - Wd int32 - Mask uint32 - Cookie uint32 - Len uint32 - Name string -} - -const ( - SizeofInotifyEvent = 0x10 -) - -type ConsMsg2 struct { - Cm2Format uint16 - Cm2R1 uint16 - Cm2Msglength uint32 - Cm2Msg *byte - Cm2R2 [4]byte - Cm2R3 [4]byte - Cm2Routcde *uint32 - Cm2Descr *uint32 - Cm2Msgflag uint32 - Cm2Token uint32 - Cm2Msgid *uint32 - Cm2R4 [4]byte - Cm2DomToken uint32 - Cm2DomMsgid *uint32 - Cm2ModCartptr *byte - Cm2ModConsidptr *byte - Cm2MsgCart [8]byte - Cm2MsgConsid [4]byte - Cm2R5 [12]byte -} - -const ( - CC_modify = 1 - CC_stop = 2 - CONSOLE_FORMAT_2 = 2 - CONSOLE_FORMAT_3 = 3 - CONSOLE_HRDCPY = 0x80000000 -) - -type OpenHow struct { - Flags uint64 - Mode uint64 - Resolve uint64 -} - -const SizeofOpenHow = 0x18 - -const ( - RESOLVE_CACHED = 0x20 - RESOLVE_BENEATH = 0x8 - RESOLVE_IN_ROOT = 0x10 - RESOLVE_NO_MAGICLINKS = 0x2 - RESOLVE_NO_SYMLINKS = 0x4 - RESOLVE_NO_XDEV = 0x1 -) - -type Siginfo struct { - Signo int32 - Errno int32 - Code int32 - Pid int32 - Uid uint32 - _ [44]byte -} - -type SysvIpcPerm struct { - Uid uint32 - Gid uint32 - Cuid uint32 - Cgid uint32 - Mode int32 -} - -type SysvShmDesc struct { - Perm SysvIpcPerm - _ [4]byte - Lpid int32 - Cpid int32 - Nattch uint32 - _ [4]byte - _ [4]byte - _ [4]byte - _ int32 - _ uint8 - _ uint8 - _ uint16 - _ *byte - Segsz uint64 - Atime Time_t - Dtime Time_t - Ctime Time_t -} - -type SysvShmDesc64 struct { - Perm SysvIpcPerm - _ [4]byte - Lpid int32 - Cpid int32 - Nattch uint32 - _ [4]byte - _ [4]byte - _ [4]byte - _ int32 - _ byte - _ uint8 - _ uint16 - _ *byte - Segsz uint64 - Atime int64 - Dtime int64 - Ctime int64 -} diff --git a/upstream/vendor/golang.org/x/sys/windows/aliases.go b/upstream/vendor/golang.org/x/sys/windows/aliases.go index 16f90560a23..ce2d713d62e 100644 --- a/upstream/vendor/golang.org/x/sys/windows/aliases.go +++ b/upstream/vendor/golang.org/x/sys/windows/aliases.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 windows +//go:build windows && go1.9 package windows diff --git a/upstream/vendor/golang.org/x/sys/windows/dll_windows.go b/upstream/vendor/golang.org/x/sys/windows/dll_windows.go index 4e613cf6335..115341fba66 100644 --- a/upstream/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/upstream/vendor/golang.org/x/sys/windows/dll_windows.go @@ -65,7 +65,7 @@ func LoadDLL(name string) (dll *DLL, err error) { return d, nil } -// MustLoadDLL is like LoadDLL but panics if load operation fails. +// MustLoadDLL is like LoadDLL but panics if load operation failes. func MustLoadDLL(name string) *DLL { d, e := LoadDLL(name) if e != nil { diff --git a/upstream/vendor/golang.org/x/sys/windows/empty.s b/upstream/vendor/golang.org/x/sys/windows/empty.s new file mode 100644 index 00000000000..ba64caca5d3 --- /dev/null +++ b/upstream/vendor/golang.org/x/sys/windows/empty.s @@ -0,0 +1,8 @@ +// Copyright 2019 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 !go1.12 + +// This file is here to allow bodyless functions with go:linkname for Go 1.11 +// and earlier (see https://golang.org/issue/23311). diff --git a/upstream/vendor/golang.org/x/sys/windows/security_windows.go b/upstream/vendor/golang.org/x/sys/windows/security_windows.go index b6e1ab76f82..26be94a8a7b 100644 --- a/upstream/vendor/golang.org/x/sys/windows/security_windows.go +++ b/upstream/vendor/golang.org/x/sys/windows/security_windows.go @@ -68,7 +68,6 @@ type UserInfo10 struct { //sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo //sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation //sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree -//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum const ( // do not reorder @@ -894,7 +893,7 @@ type ACL struct { aclRevision byte sbz1 byte aclSize uint16 - AceCount uint16 + aceCount uint16 sbz2 uint16 } @@ -1087,27 +1086,6 @@ type EXPLICIT_ACCESS struct { Trustee TRUSTEE } -// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header -type ACE_HEADER struct { - AceType uint8 - AceFlags uint8 - AceSize uint16 -} - -// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-access_allowed_ace -type ACCESS_ALLOWED_ACE struct { - Header ACE_HEADER - Mask ACCESS_MASK - SidStart uint32 -} - -const ( - // Constants for AceType - // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header - ACCESS_ALLOWED_ACE_TYPE = 0 - ACCESS_DENIED_ACE_TYPE = 1 -) - // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. type TrusteeValue uintptr @@ -1179,7 +1157,6 @@ type OBJECTS_AND_NAME struct { //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW -//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { diff --git a/upstream/vendor/golang.org/x/sys/windows/syscall_windows.go b/upstream/vendor/golang.org/x/sys/windows/syscall_windows.go index 4a325438685..6525c62f3c2 100644 --- a/upstream/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/upstream/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -17,10 +17,8 @@ import ( "unsafe" ) -type ( - Handle uintptr - HWND uintptr -) +type Handle uintptr +type HWND uintptr const ( InvalidHandle = ^Handle(0) @@ -168,8 +166,6 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) [failretval==InvalidHandle] = CreateNamedPipeW //sys ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) //sys DisconnectNamedPipe(pipe Handle) (err error) -//sys GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) -//sys GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) //sys GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) //sys GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW //sys SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState @@ -215,10 +211,6 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId -//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW -//sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout -//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout -//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx //sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow //sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW //sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx @@ -315,10 +307,6 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode //sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo //sys setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition -//sys GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP -//sys GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP -//sys SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP -//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP //sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW //sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW //sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole @@ -727,12 +715,20 @@ func DurationSinceBoot() time.Duration { } func Ftruncate(fd Handle, length int64) (err error) { - type _FILE_END_OF_FILE_INFO struct { - EndOfFile int64 + curoffset, e := Seek(fd, 0, 1) + if e != nil { + return e + } + defer Seek(fd, curoffset, 0) + _, e = Seek(fd, length, 0) + if e != nil { + return e } - var info _FILE_END_OF_FILE_INFO - info.EndOfFile = length - return SetFileInformationByHandle(fd, FileEndOfFileInfo, (*byte)(unsafe.Pointer(&info)), uint32(unsafe.Sizeof(info))) + e = SetEndOfFile(fd) + if e != nil { + return e + } + return nil } func Gettimeofday(tv *Timeval) (err error) { @@ -888,11 +884,6 @@ const socket_error = uintptr(^uint32(0)) //sys GetACP() (acp uint32) = kernel32.GetACP //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx -//sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex -//sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry -//sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange -//sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange -//sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2 // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. @@ -1377,11 +1368,9 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } - func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } - func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } @@ -1684,16 +1673,13 @@ func (s NTStatus) Error() string { // do not use NTUnicodeString, and instead UTF16PtrFromString should be used for // the more common *uint16 string type. func NewNTUnicodeString(s string) (*NTUnicodeString, error) { - s16, err := UTF16FromString(s) + var u NTUnicodeString + s16, err := UTF16PtrFromString(s) if err != nil { return nil, err } - n := uint16(len(s16) * 2) - return &NTUnicodeString{ - Length: n - 2, // subtract 2 bytes for the NULL terminator - MaximumLength: n, - Buffer: &s16[0], - }, nil + RtlInitUnicodeString(&u, s16) + return &u, nil } // Slice returns a uint16 slice that aliases the data in the NTUnicodeString. diff --git a/upstream/vendor/golang.org/x/sys/windows/types_windows.go b/upstream/vendor/golang.org/x/sys/windows/types_windows.go index 9d138de5fed..d8cb71db0a6 100644 --- a/upstream/vendor/golang.org/x/sys/windows/types_windows.go +++ b/upstream/vendor/golang.org/x/sys/windows/types_windows.go @@ -176,7 +176,6 @@ const ( WAIT_FAILED = 0xFFFFFFFF // Access rights for process. - PROCESS_ALL_ACCESS = 0xFFFF PROCESS_CREATE_PROCESS = 0x0080 PROCESS_CREATE_THREAD = 0x0002 PROCESS_DUP_HANDLE = 0x0040 @@ -1061,7 +1060,6 @@ const ( SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6 SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4 SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12 - SIO_UDP_NETRESET = IOC_IN | IOC_VENDOR | 15 // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460 @@ -2005,21 +2003,7 @@ const ( MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 ) -// Flags for GetAdaptersAddresses, see -// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses. -const ( - GAA_FLAG_SKIP_UNICAST = 0x1 - GAA_FLAG_SKIP_ANYCAST = 0x2 - GAA_FLAG_SKIP_MULTICAST = 0x4 - GAA_FLAG_SKIP_DNS_SERVER = 0x8 - GAA_FLAG_INCLUDE_PREFIX = 0x10 - GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20 - GAA_FLAG_INCLUDE_WINS_INFO = 0x40 - GAA_FLAG_INCLUDE_GATEWAYS = 0x80 - GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100 - GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200 - GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400 -) +const GAA_FLAG_INCLUDE_PREFIX = 0x00000010 const ( IF_TYPE_OTHER = 1 @@ -2033,50 +2017,6 @@ const ( IF_TYPE_IEEE1394 = 144 ) -// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see -// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin -const ( - IpPrefixOriginOther = 0 - IpPrefixOriginManual = 1 - IpPrefixOriginWellKnown = 2 - IpPrefixOriginDhcp = 3 - IpPrefixOriginRouterAdvertisement = 4 - IpPrefixOriginUnchanged = 1 << 4 -) - -// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see -// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin -const ( - NlsoOther = 0 - NlsoManual = 1 - NlsoWellKnown = 2 - NlsoDhcp = 3 - NlsoLinkLayerAddress = 4 - NlsoRandom = 5 - IpSuffixOriginOther = 0 - IpSuffixOriginManual = 1 - IpSuffixOriginWellKnown = 2 - IpSuffixOriginDhcp = 3 - IpSuffixOriginLinkLayerAddress = 4 - IpSuffixOriginRandom = 5 - IpSuffixOriginUnchanged = 1 << 4 -) - -// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see -// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state -const ( - NldsInvalid = 0 - NldsTentative = 1 - NldsDuplicate = 2 - NldsDeprecated = 3 - NldsPreferred = 4 - IpDadStateInvalid = 0 - IpDadStateTentative = 1 - IpDadStateDuplicate = 2 - IpDadStateDeprecated = 3 - IpDadStatePreferred = 4 -) - type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 @@ -2204,132 +2144,6 @@ const ( IfOperStatusLowerLayerDown = 7 ) -const ( - IF_MAX_PHYS_ADDRESS_LENGTH = 32 - IF_MAX_STRING_SIZE = 256 -) - -// MIB_IF_ENTRY_LEVEL enumeration from netioapi.h or -// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-getifentry2ex. -const ( - MibIfEntryNormal = 0 - MibIfEntryNormalWithoutStatistics = 2 -) - -// MIB_NOTIFICATION_TYPE enumeration from netioapi.h or -// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ne-netioapi-mib_notification_type. -const ( - MibParameterNotification = 0 - MibAddInstance = 1 - MibDeleteInstance = 2 - MibInitialNotification = 3 -) - -// MibIfRow2 stores information about a particular interface. See -// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_if_row2. -type MibIfRow2 struct { - InterfaceLuid uint64 - InterfaceIndex uint32 - InterfaceGuid GUID - Alias [IF_MAX_STRING_SIZE + 1]uint16 - Description [IF_MAX_STRING_SIZE + 1]uint16 - PhysicalAddressLength uint32 - PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8 - PermanentPhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8 - Mtu uint32 - Type uint32 - TunnelType uint32 - MediaType uint32 - PhysicalMediumType uint32 - AccessType uint32 - DirectionType uint32 - InterfaceAndOperStatusFlags uint8 - OperStatus uint32 - AdminStatus uint32 - MediaConnectState uint32 - NetworkGuid GUID - ConnectionType uint32 - TransmitLinkSpeed uint64 - ReceiveLinkSpeed uint64 - InOctets uint64 - InUcastPkts uint64 - InNUcastPkts uint64 - InDiscards uint64 - InErrors uint64 - InUnknownProtos uint64 - InUcastOctets uint64 - InMulticastOctets uint64 - InBroadcastOctets uint64 - OutOctets uint64 - OutUcastPkts uint64 - OutNUcastPkts uint64 - OutDiscards uint64 - OutErrors uint64 - OutUcastOctets uint64 - OutMulticastOctets uint64 - OutBroadcastOctets uint64 - OutQLen uint64 -} - -// MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See -// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row. -type MibUnicastIpAddressRow struct { - Address RawSockaddrInet6 // SOCKADDR_INET union - InterfaceLuid uint64 - InterfaceIndex uint32 - PrefixOrigin uint32 - SuffixOrigin uint32 - ValidLifetime uint32 - PreferredLifetime uint32 - OnLinkPrefixLength uint8 - SkipAsSource uint8 - DadState uint32 - ScopeId uint32 - CreationTimeStamp Filetime -} - -const ScopeLevelCount = 16 - -// MIB_IPINTERFACE_ROW stores interface management information for a particular IP address family on a network interface. -// See https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_row. -type MibIpInterfaceRow struct { - Family uint16 - InterfaceLuid uint64 - InterfaceIndex uint32 - MaxReassemblySize uint32 - InterfaceIdentifier uint64 - MinRouterAdvertisementInterval uint32 - MaxRouterAdvertisementInterval uint32 - AdvertisingEnabled uint8 - ForwardingEnabled uint8 - WeakHostSend uint8 - WeakHostReceive uint8 - UseAutomaticMetric uint8 - UseNeighborUnreachabilityDetection uint8 - ManagedAddressConfigurationSupported uint8 - OtherStatefulConfigurationSupported uint8 - AdvertiseDefaultRoute uint8 - RouterDiscoveryBehavior uint32 - DadTransmits uint32 - BaseReachableTime uint32 - RetransmitTime uint32 - PathMtuDiscoveryTimeout uint32 - LinkLocalAddressBehavior uint32 - LinkLocalAddressTimeout uint32 - ZoneIndices [ScopeLevelCount]uint32 - SitePrefixLength uint32 - Metric uint32 - NlMtu uint32 - Connected uint8 - SupportsWakeUpPatterns uint8 - SupportsNeighborDiscovery uint8 - SupportsRouterDiscovery uint8 - ReachableTime uint32 - TransmitOffload uint32 - ReceiveOffload uint32 - DisableDefaultRoutes uint8 -} - // Console related constants used for the mode parameter to SetConsoleMode. See // https://docs.microsoft.com/en-us/windows/console/setconsolemode for details. @@ -3590,14 +3404,3 @@ type DCB struct { EvtChar byte wReserved1 uint16 } - -// Keyboard Layout Flags. -// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw -const ( - KLF_ACTIVATE = 0x00000001 - KLF_SUBSTITUTE_OK = 0x00000002 - KLF_REORDER = 0x00000008 - KLF_REPLACELANG = 0x00000010 - KLF_NOTELLSHELL = 0x00000080 - KLF_SETFORPROCESS = 0x00000100 -) diff --git a/upstream/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/upstream/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 01c0716c2c4..5c6035ddfa9 100644 --- a/upstream/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/upstream/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -91,7 +91,6 @@ var ( procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") procEqualSid = modadvapi32.NewProc("EqualSid") procFreeSid = modadvapi32.NewProc("FreeSid") - procGetAce = modadvapi32.NewProc("GetAce") procGetLengthSid = modadvapi32.NewProc("GetLengthSid") procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW") procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl") @@ -181,15 +180,10 @@ var ( procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree") procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute") procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute") - procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2") procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") - procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") - procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") - procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") - procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") procCancelIo = modkernel32.NewProc("CancelIo") @@ -252,9 +246,7 @@ var ( procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") - procGetConsoleCP = modkernel32.NewProc("GetConsoleCP") procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") - procGetConsoleOutputCP = modkernel32.NewProc("GetConsoleOutputCP") procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo") procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") @@ -280,10 +272,8 @@ var ( procGetMaximumProcessorCount = modkernel32.NewProc("GetMaximumProcessorCount") procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") procGetModuleHandleExW = modkernel32.NewProc("GetModuleHandleExW") - procGetNamedPipeClientProcessId = modkernel32.NewProc("GetNamedPipeClientProcessId") procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetNamedPipeServerProcessId = modkernel32.NewProc("GetNamedPipeServerProcessId") procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult") procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") procGetProcAddress = modkernel32.NewProc("GetProcAddress") @@ -356,10 +346,8 @@ var ( procSetCommMask = modkernel32.NewProc("SetCommMask") procSetCommState = modkernel32.NewProc("SetCommState") procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") - procSetConsoleCP = modkernel32.NewProc("SetConsoleCP") procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") - procSetConsoleOutputCP = modkernel32.NewProc("SetConsoleOutputCP") procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") @@ -413,7 +401,6 @@ var ( procTransmitFile = modmswsock.NewProc("TransmitFile") procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") - procNetUserEnum = modnetapi32.NewProc("NetUserEnum") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") @@ -489,16 +476,12 @@ var ( procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") - procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") procGetShellWindow = moduser32.NewProc("GetShellWindow") procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") procIsWindow = moduser32.NewProc("IsWindow") procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") procIsWindowVisible = moduser32.NewProc("IsWindowVisible") - procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") procMessageBoxW = moduser32.NewProc("MessageBoxW") - procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") - procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") @@ -804,14 +787,6 @@ func FreeSid(sid *SID) (err error) { return } -func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { - r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func GetLengthSid(sid *SID) (len uint32) { r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) len = uint32(r0) @@ -1613,14 +1588,6 @@ func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si return } -func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { - r0, _, _ := syscall.Syscall(procCancelMibChangeNotify2.Addr(), 1, uintptr(notificationHandle), 0, 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0) if r0 != 0 { @@ -1653,46 +1620,6 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) { return } -func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry2Ex.Addr(), 2, uintptr(level), uintptr(unsafe.Pointer(row)), 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { - var _p0 uint32 - if initialNotification { - _p0 = 1 - } - r0, _, _ := syscall.Syscall6(procNotifyIpInterfaceChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { - var _p0 uint32 - if initialNotification { - _p0 = 1 - } - r0, _, _ := syscall.Syscall6(procNotifyUnicastIpAddressChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - func AddDllDirectory(path *uint16) (cookie uintptr, err error) { r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) cookie = uintptr(r0) @@ -2221,15 +2148,6 @@ func GetComputerName(buf *uint16, n *uint32) (err error) { return } -func GetConsoleCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) - cp = uint32(r0) - if cp == 0 { - err = errnoErr(e1) - } - return -} - func GetConsoleMode(console Handle, mode *uint32) (err error) { r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0) if r1 == 0 { @@ -2238,15 +2156,6 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) { return } -func GetConsoleOutputCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0) - cp = uint32(r0) - if cp == 0 { - err = errnoErr(e1) - } - return -} - func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0) if r1 == 0 { @@ -2448,14 +2357,6 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er return } -func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeClientProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) if r1 == 0 { @@ -2472,14 +2373,6 @@ func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint3 return } -func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeServerProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) { var _p0 uint32 if wait { @@ -3131,14 +3024,6 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { return } -func SetConsoleCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func setConsoleCursorPosition(console Handle, position uint32) (err error) { r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0) if r1 == 0 { @@ -3155,14 +3040,6 @@ func SetConsoleMode(console Handle, mode uint32) (err error) { return } -func SetConsoleOutputCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func SetCurrentDirectory(path *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) if r1 == 0 { @@ -3609,14 +3486,6 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete return } -func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { - r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) - if r0 != 0 { - neterr = syscall.Errno(r0) - } - return -} - func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) if r0 != 0 { @@ -4195,12 +4064,6 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { return } -func GetKeyboardLayout(tid uint32) (hkl Handle) { - r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) - hkl = Handle(r0) - return -} - func GetShellWindow() (shellWindow HWND) { r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) shellWindow = HWND(r0) @@ -4234,15 +4097,6 @@ func IsWindowVisible(hwnd HWND) (isVisible bool) { return } -func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) - hkl = Handle(r0) - if hkl == 0 { - err = errnoErr(e1) - } - return -} - func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) ret = int32(r0) @@ -4252,20 +4106,6 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i return } -func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { - r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) - ret = int32(r0) - return -} - -func UnloadKeyboardLayout(hkl Handle) (err error) { - r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { var _p0 uint32 if inheritExisting { diff --git a/upstream/vendor/golang.org/x/term/LICENSE b/upstream/vendor/golang.org/x/term/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/term/LICENSE +++ b/upstream/vendor/golang.org/x/term/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/term/README.md b/upstream/vendor/golang.org/x/term/README.md index 05ff623f94f..d03d0aefef6 100644 --- a/upstream/vendor/golang.org/x/term/README.md +++ b/upstream/vendor/golang.org/x/term/README.md @@ -4,13 +4,16 @@ This repository provides Go terminal and console support packages. +## Download/Install + +The easiest way to install is to run `go get -u golang.org/x/term`. You can +also manually git clone the repository to `$GOPATH/src/golang.org/x/term`. + ## Report Issues / Send Patches This repository uses Gerrit for code changes. To learn how to submit changes to -this repository, see https://go.dev/doc/contribute. - -The git repository is https://go.googlesource.com/term. +this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the term repository is located at -https://go.dev/issues. Prefix your issue with "x/term:" in the +https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the subject line, so it is easy to find. diff --git a/upstream/vendor/golang.org/x/term/term_windows.go b/upstream/vendor/golang.org/x/term/term_windows.go index df6bf948e14..465f560604e 100644 --- a/upstream/vendor/golang.org/x/term/term_windows.go +++ b/upstream/vendor/golang.org/x/term/term_windows.go @@ -26,7 +26,6 @@ func makeRaw(fd int) (*State, error) { return nil, err } raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) - raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { return nil, err } diff --git a/upstream/vendor/golang.org/x/text/LICENSE b/upstream/vendor/golang.org/x/text/LICENSE index 2a7cf70da6e..6a66aea5eaf 100644 --- a/upstream/vendor/golang.org/x/text/LICENSE +++ b/upstream/vendor/golang.org/x/text/LICENSE @@ -1,4 +1,4 @@ -Copyright 2009 The Go Authors. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -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 LLC nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/upstream/vendor/golang.org/x/tools/cmd/stringer/stringer.go b/upstream/vendor/golang.org/x/tools/cmd/stringer/stringer.go new file mode 100644 index 00000000000..2b19c93e8ea --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/cmd/stringer/stringer.go @@ -0,0 +1,660 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer +// interface. Given the name of a (signed or unsigned) integer type T that has constants +// defined, stringer will create a new self-contained Go source file implementing +// +// func (t T) String() string +// +// The file is created in the same package and directory as the package that defines T. +// It has helpful defaults designed for use with go generate. +// +// Stringer works best with constants that are consecutive values such as created using iota, +// but creates good code regardless. In the future it might also provide custom support for +// constant sets that are bit patterns. +// +// For example, given this snippet, +// +// package painkiller +// +// type Pill int +// +// const ( +// Placebo Pill = iota +// Aspirin +// Ibuprofen +// Paracetamol +// Acetaminophen = Paracetamol +// ) +// +// running this command +// +// stringer -type=Pill +// +// in the same directory will create the file pill_string.go, in package painkiller, +// containing a definition of +// +// func (Pill) String() string +// +// That method will translate the value of a Pill constant to the string representation +// of the respective constant name, so that the call fmt.Print(painkiller.Aspirin) will +// print the string "Aspirin". +// +// Typically this process would be run using go generate, like this: +// +// //go:generate stringer -type=Pill +// +// If multiple constants have the same value, the lexically first matching name will +// be used (in the example, Acetaminophen will print as "Paracetamol"). +// +// With no arguments, it processes the package in the current directory. +// Otherwise, the arguments must name a single directory holding a Go package +// or a set of Go source files that represent a single Go package. +// +// The -type flag accepts a comma-separated list of types so a single run can +// generate methods for multiple types. The default output file is t_string.go, +// where t is the lower-cased name of the first type listed. It can be overridden +// with the -output flag. +// +// The -linecomment flag tells stringer to generate the text of any line comment, trimmed +// of leading spaces, instead of the constant name. For instance, if the constants above had a +// Pill prefix, one could write +// +// PillAspirin // Aspirin +// +// to suppress it in the output. +package main // import "golang.org/x/tools/cmd/stringer" + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/constant" + "go/format" + "go/token" + "go/types" + "log" + "os" + "path/filepath" + "sort" + "strings" + + "golang.org/x/tools/go/packages" +) + +var ( + typeNames = flag.String("type", "", "comma-separated list of type names; must be set") + output = flag.String("output", "", "output file name; default srcdir/<type>_string.go") + trimprefix = flag.String("trimprefix", "", "trim the `prefix` from the generated constant names") + linecomment = flag.Bool("linecomment", false, "use line comment text as printed text when present") + buildTags = flag.String("tags", "", "comma-separated list of build tags to apply") +) + +// Usage is a replacement usage function for the flags package. +func Usage() { + fmt.Fprintf(os.Stderr, "Usage of stringer:\n") + fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T [directory]\n") + fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T files... # Must be a single package\n") + fmt.Fprintf(os.Stderr, "For more information, see:\n") + fmt.Fprintf(os.Stderr, "\thttps://pkg.go.dev/golang.org/x/tools/cmd/stringer\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() +} + +func main() { + log.SetFlags(0) + log.SetPrefix("stringer: ") + flag.Usage = Usage + flag.Parse() + if len(*typeNames) == 0 { + flag.Usage() + os.Exit(2) + } + types := strings.Split(*typeNames, ",") + var tags []string + if len(*buildTags) > 0 { + tags = strings.Split(*buildTags, ",") + } + + // We accept either one directory or a list of files. Which do we have? + args := flag.Args() + if len(args) == 0 { + // Default: process whole package in current directory. + args = []string{"."} + } + + // Parse the package once. + var dir string + g := Generator{ + trimPrefix: *trimprefix, + lineComment: *linecomment, + } + // TODO(suzmue): accept other patterns for packages (directories, list of files, import paths, etc). + if len(args) == 1 && isDirectory(args[0]) { + dir = args[0] + } else { + if len(tags) != 0 { + log.Fatal("-tags option applies only to directories, not when files are specified") + } + dir = filepath.Dir(args[0]) + } + + g.parsePackage(args, tags) + + // Print the header and package clause. + g.Printf("// Code generated by \"stringer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) + g.Printf("\n") + g.Printf("package %s", g.pkg.name) + g.Printf("\n") + g.Printf("import \"strconv\"\n") // Used by all methods. + + // Run generate for each type. + for _, typeName := range types { + g.generate(typeName) + } + + // Format the output. + src := g.format() + + // Write to file. + outputName := *output + if outputName == "" { + baseName := fmt.Sprintf("%s_string.go", types[0]) + outputName = filepath.Join(dir, strings.ToLower(baseName)) + } + err := os.WriteFile(outputName, src, 0644) + if err != nil { + log.Fatalf("writing output: %s", err) + } +} + +// isDirectory reports whether the named file is a directory. +func isDirectory(name string) bool { + info, err := os.Stat(name) + if err != nil { + log.Fatal(err) + } + return info.IsDir() +} + +// Generator holds the state of the analysis. Primarily used to buffer +// the output for format.Source. +type Generator struct { + buf bytes.Buffer // Accumulated output. + pkg *Package // Package we are scanning. + + trimPrefix string + lineComment bool + + logf func(format string, args ...interface{}) // test logging hook; nil when not testing +} + +func (g *Generator) Printf(format string, args ...interface{}) { + fmt.Fprintf(&g.buf, format, args...) +} + +// File holds a single parsed file and associated data. +type File struct { + pkg *Package // Package to which this file belongs. + file *ast.File // Parsed AST. + // These fields are reset for each type being generated. + typeName string // Name of the constant type. + values []Value // Accumulator for constant values of that type. + + trimPrefix string + lineComment bool +} + +type Package struct { + name string + defs map[*ast.Ident]types.Object + files []*File +} + +// parsePackage analyzes the single package constructed from the patterns and tags. +// parsePackage exits if there is an error. +func (g *Generator) parsePackage(patterns []string, tags []string) { + cfg := &packages.Config{ + Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax, + // TODO: Need to think about constants in test files. Maybe write type_string_test.go + // in a separate pass? For later. + Tests: false, + BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))}, + Logf: g.logf, + } + pkgs, err := packages.Load(cfg, patterns...) + if err != nil { + log.Fatal(err) + } + if len(pkgs) != 1 { + log.Fatalf("error: %d packages matching %v", len(pkgs), strings.Join(patterns, " ")) + } + g.addPackage(pkgs[0]) +} + +// addPackage adds a type checked Package and its syntax files to the generator. +func (g *Generator) addPackage(pkg *packages.Package) { + g.pkg = &Package{ + name: pkg.Name, + defs: pkg.TypesInfo.Defs, + files: make([]*File, len(pkg.Syntax)), + } + + for i, file := range pkg.Syntax { + g.pkg.files[i] = &File{ + file: file, + pkg: g.pkg, + trimPrefix: g.trimPrefix, + lineComment: g.lineComment, + } + } +} + +// generate produces the String method for the named type. +func (g *Generator) generate(typeName string) { + values := make([]Value, 0, 100) + for _, file := range g.pkg.files { + // Set the state for this run of the walker. + file.typeName = typeName + file.values = nil + if file.file != nil { + ast.Inspect(file.file, file.genDecl) + values = append(values, file.values...) + } + } + + if len(values) == 0 { + log.Fatalf("no values defined for type %s", typeName) + } + // Generate code that will fail if the constants change value. + g.Printf("func _() {\n") + g.Printf("\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n") + g.Printf("\t// Re-run the stringer command to generate them again.\n") + g.Printf("\tvar x [1]struct{}\n") + for _, v := range values { + g.Printf("\t_ = x[%s - %s]\n", v.originalName, v.str) + } + g.Printf("}\n") + runs := splitIntoRuns(values) + // The decision of which pattern to use depends on the number of + // runs in the numbers. If there's only one, it's easy. For more than + // one, there's a tradeoff between complexity and size of the data + // and code vs. the simplicity of a map. A map takes more space, + // but so does the code. The decision here (crossover at 10) is + // arbitrary, but considers that for large numbers of runs the cost + // of the linear scan in the switch might become important, and + // rather than use yet another algorithm such as binary search, + // we punt and use a map. In any case, the likelihood of a map + // being necessary for any realistic example other than bitmasks + // is very low. And bitmasks probably deserve their own analysis, + // to be done some other day. + switch { + case len(runs) == 1: + g.buildOneRun(runs, typeName) + case len(runs) <= 10: + g.buildMultipleRuns(runs, typeName) + default: + g.buildMap(runs, typeName) + } +} + +// splitIntoRuns breaks the values into runs of contiguous sequences. +// For example, given 1,2,3,5,6,7 it returns {1,2,3},{5,6,7}. +// The input slice is known to be non-empty. +func splitIntoRuns(values []Value) [][]Value { + // We use stable sort so the lexically first name is chosen for equal elements. + sort.Stable(byValue(values)) + // Remove duplicates. Stable sort has put the one we want to print first, + // so use that one. The String method won't care about which named constant + // was the argument, so the first name for the given value is the only one to keep. + // We need to do this because identical values would cause the switch or map + // to fail to compile. + j := 1 + for i := 1; i < len(values); i++ { + if values[i].value != values[i-1].value { + values[j] = values[i] + j++ + } + } + values = values[:j] + runs := make([][]Value, 0, 10) + for len(values) > 0 { + // One contiguous sequence per outer loop. + i := 1 + for i < len(values) && values[i].value == values[i-1].value+1 { + i++ + } + runs = append(runs, values[:i]) + values = values[i:] + } + return runs +} + +// format returns the gofmt-ed contents of the Generator's buffer. +func (g *Generator) format() []byte { + src, err := format.Source(g.buf.Bytes()) + if err != nil { + // Should never happen, but can arise when developing this code. + // The user can compile the output to see the error. + log.Printf("warning: internal error: invalid Go generated: %s", err) + log.Printf("warning: compile the package to analyze the error") + return g.buf.Bytes() + } + return src +} + +// Value represents a declared constant. +type Value struct { + originalName string // The name of the constant. + name string // The name with trimmed prefix. + // The value is stored as a bit pattern alone. The boolean tells us + // whether to interpret it as an int64 or a uint64; the only place + // this matters is when sorting. + // Much of the time the str field is all we need; it is printed + // by Value.String. + value uint64 // Will be converted to int64 when needed. + signed bool // Whether the constant is a signed type. + str string // The string representation given by the "go/constant" package. +} + +func (v *Value) String() string { + return v.str +} + +// byValue lets us sort the constants into increasing order. +// We take care in the Less method to sort in signed or unsigned order, +// as appropriate. +type byValue []Value + +func (b byValue) Len() int { return len(b) } +func (b byValue) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +func (b byValue) Less(i, j int) bool { + if b[i].signed { + return int64(b[i].value) < int64(b[j].value) + } + return b[i].value < b[j].value +} + +// genDecl processes one declaration clause. +func (f *File) genDecl(node ast.Node) bool { + decl, ok := node.(*ast.GenDecl) + if !ok || decl.Tok != token.CONST { + // We only care about const declarations. + return true + } + // The name of the type of the constants we are declaring. + // Can change if this is a multi-element declaration. + typ := "" + // Loop over the elements of the declaration. Each element is a ValueSpec: + // a list of names possibly followed by a type, possibly followed by values. + // If the type and value are both missing, we carry down the type (and value, + // but the "go/types" package takes care of that). + for _, spec := range decl.Specs { + vspec := spec.(*ast.ValueSpec) // Guaranteed to succeed as this is CONST. + if vspec.Type == nil && len(vspec.Values) > 0 { + // "X = 1". With no type but a value. If the constant is untyped, + // skip this vspec and reset the remembered type. + typ = "" + + // If this is a simple type conversion, remember the type. + // We don't mind if this is actually a call; a qualified call won't + // be matched (that will be SelectorExpr, not Ident), and only unusual + // situations will result in a function call that appears to be + // a type conversion. + ce, ok := vspec.Values[0].(*ast.CallExpr) + if !ok { + continue + } + id, ok := ce.Fun.(*ast.Ident) + if !ok { + continue + } + typ = id.Name + } + if vspec.Type != nil { + // "X T". We have a type. Remember it. + ident, ok := vspec.Type.(*ast.Ident) + if !ok { + continue + } + typ = ident.Name + } + if typ != f.typeName { + // This is not the type we're looking for. + continue + } + // We now have a list of names (from one line of source code) all being + // declared with the desired type. + // Grab their names and actual values and store them in f.values. + for _, name := range vspec.Names { + if name.Name == "_" { + continue + } + // This dance lets the type checker find the values for us. It's a + // bit tricky: look up the object declared by the name, find its + // types.Const, and extract its value. + obj, ok := f.pkg.defs[name] + if !ok { + log.Fatalf("no value for constant %s", name) + } + info := obj.Type().Underlying().(*types.Basic).Info() + if info&types.IsInteger == 0 { + log.Fatalf("can't handle non-integer constant type %s", typ) + } + value := obj.(*types.Const).Val() // Guaranteed to succeed as this is CONST. + if value.Kind() != constant.Int { + log.Fatalf("can't happen: constant is not an integer %s", name) + } + i64, isInt := constant.Int64Val(value) + u64, isUint := constant.Uint64Val(value) + if !isInt && !isUint { + log.Fatalf("internal error: value of %s is not an integer: %s", name, value.String()) + } + if !isInt { + u64 = uint64(i64) + } + v := Value{ + originalName: name.Name, + value: u64, + signed: info&types.IsUnsigned == 0, + str: value.String(), + } + if c := vspec.Comment; f.lineComment && c != nil && len(c.List) == 1 { + v.name = strings.TrimSpace(c.Text()) + } else { + v.name = strings.TrimPrefix(v.originalName, f.trimPrefix) + } + f.values = append(f.values, v) + } + } + return false +} + +// Helpers + +// usize returns the number of bits of the smallest unsigned integer +// type that will hold n. Used to create the smallest possible slice of +// integers to use as indexes into the concatenated strings. +func usize(n int) int { + switch { + case n < 1<<8: + return 8 + case n < 1<<16: + return 16 + default: + // 2^32 is enough constants for anyone. + return 32 + } +} + +// declareIndexAndNameVars declares the index slices and concatenated names +// strings representing the runs of values. +func (g *Generator) declareIndexAndNameVars(runs [][]Value, typeName string) { + var indexes, names []string + for i, run := range runs { + index, name := g.createIndexAndNameDecl(run, typeName, fmt.Sprintf("_%d", i)) + if len(run) != 1 { + indexes = append(indexes, index) + } + names = append(names, name) + } + g.Printf("const (\n") + for _, name := range names { + g.Printf("\t%s\n", name) + } + g.Printf(")\n\n") + + if len(indexes) > 0 { + g.Printf("var (") + for _, index := range indexes { + g.Printf("\t%s\n", index) + } + g.Printf(")\n\n") + } +} + +// declareIndexAndNameVar is the single-run version of declareIndexAndNameVars +func (g *Generator) declareIndexAndNameVar(run []Value, typeName string) { + index, name := g.createIndexAndNameDecl(run, typeName, "") + g.Printf("const %s\n", name) + g.Printf("var %s\n", index) +} + +// createIndexAndNameDecl returns the pair of declarations for the run. The caller will add "const" and "var". +func (g *Generator) createIndexAndNameDecl(run []Value, typeName string, suffix string) (string, string) { + b := new(bytes.Buffer) + indexes := make([]int, len(run)) + for i := range run { + b.WriteString(run[i].name) + indexes[i] = b.Len() + } + nameConst := fmt.Sprintf("_%s_name%s = %q", typeName, suffix, b.String()) + nameLen := b.Len() + b.Reset() + fmt.Fprintf(b, "_%s_index%s = [...]uint%d{0, ", typeName, suffix, usize(nameLen)) + for i, v := range indexes { + if i > 0 { + fmt.Fprintf(b, ", ") + } + fmt.Fprintf(b, "%d", v) + } + fmt.Fprintf(b, "}") + return b.String(), nameConst +} + +// declareNameVars declares the concatenated names string representing all the values in the runs. +func (g *Generator) declareNameVars(runs [][]Value, typeName string, suffix string) { + g.Printf("const _%s_name%s = \"", typeName, suffix) + for _, run := range runs { + for i := range run { + g.Printf("%s", run[i].name) + } + } + g.Printf("\"\n") +} + +// buildOneRun generates the variables and String method for a single run of contiguous values. +func (g *Generator) buildOneRun(runs [][]Value, typeName string) { + values := runs[0] + g.Printf("\n") + g.declareIndexAndNameVar(values, typeName) + // The generated code is simple enough to write as a Printf format. + lessThanZero := "" + if values[0].signed { + lessThanZero = "i < 0 || " + } + if values[0].value == 0 { // Signed or unsigned, 0 is still 0. + g.Printf(stringOneRun, typeName, usize(len(values)), lessThanZero) + } else { + g.Printf(stringOneRunWithOffset, typeName, values[0].String(), usize(len(values)), lessThanZero) + } +} + +// Arguments to format are: +// +// [1]: type name +// [2]: size of index element (8 for uint8 etc.) +// [3]: less than zero check (for signed types) +const stringOneRun = `func (i %[1]s) String() string { + if %[3]si >= %[1]s(len(_%[1]s_index)-1) { + return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _%[1]s_name[_%[1]s_index[i]:_%[1]s_index[i+1]] +} +` + +// Arguments to format are: +// [1]: type name +// [2]: lowest defined value for type, as a string +// [3]: size of index element (8 for uint8 etc.) +// [4]: less than zero check (for signed types) +/* + */ +const stringOneRunWithOffset = `func (i %[1]s) String() string { + i -= %[2]s + if %[4]si >= %[1]s(len(_%[1]s_index)-1) { + return "%[1]s(" + strconv.FormatInt(int64(i + %[2]s), 10) + ")" + } + return _%[1]s_name[_%[1]s_index[i] : _%[1]s_index[i+1]] +} +` + +// buildMultipleRuns generates the variables and String method for multiple runs of contiguous values. +// For this pattern, a single Printf format won't do. +func (g *Generator) buildMultipleRuns(runs [][]Value, typeName string) { + g.Printf("\n") + g.declareIndexAndNameVars(runs, typeName) + g.Printf("func (i %s) String() string {\n", typeName) + g.Printf("\tswitch {\n") + for i, values := range runs { + if len(values) == 1 { + g.Printf("\tcase i == %s:\n", &values[0]) + g.Printf("\t\treturn _%s_name_%d\n", typeName, i) + continue + } + if values[0].value == 0 && !values[0].signed { + // For an unsigned lower bound of 0, "0 <= i" would be redundant. + g.Printf("\tcase i <= %s:\n", &values[len(values)-1]) + } else { + g.Printf("\tcase %s <= i && i <= %s:\n", &values[0], &values[len(values)-1]) + } + if values[0].value != 0 { + g.Printf("\t\ti -= %s\n", &values[0]) + } + g.Printf("\t\treturn _%s_name_%d[_%s_index_%d[i]:_%s_index_%d[i+1]]\n", + typeName, i, typeName, i, typeName, i) + } + g.Printf("\tdefault:\n") + g.Printf("\t\treturn \"%s(\" + strconv.FormatInt(int64(i), 10) + \")\"\n", typeName) + g.Printf("\t}\n") + g.Printf("}\n") +} + +// buildMap handles the case where the space is so sparse a map is a reasonable fallback. +// It's a rare situation but has simple code. +func (g *Generator) buildMap(runs [][]Value, typeName string) { + g.Printf("\n") + g.declareNameVars(runs, typeName, "") + g.Printf("\nvar _%s_map = map[%s]string{\n", typeName, typeName) + n := 0 + for _, values := range runs { + for _, value := range values { + g.Printf("\t%s: _%s_name[%d:%d],\n", &value, typeName, n, n+len(value.name)) + n += len(value.name) + } + } + g.Printf("}\n\n") + g.Printf(stringMap, typeName) +} + +// Argument to format is the type name. +const stringMap = `func (i %[1]s) String() string { + if str, ok := _%[1]s_map[i]; ok { + return str + } + return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" +} +` diff --git a/upstream/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/upstream/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go new file mode 100644 index 00000000000..03543bd4bb8 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -0,0 +1,186 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gcexportdata provides functions for locating, reading, and +// writing export data files containing type information produced by the +// gc compiler. This package supports go1.7 export data format and all +// later versions. +// +// Although it might seem convenient for this package to live alongside +// go/types in the standard library, this would cause version skew +// problems for developer tools that use it, since they must be able to +// consume the outputs of the gc compiler both before and after a Go +// update such as from Go 1.7 to Go 1.8. Because this package lives in +// golang.org/x/tools, sites can update their version of this repo some +// time before the Go 1.8 release and rebuild and redeploy their +// developer tools, which will then be able to consume both Go 1.7 and +// Go 1.8 export data files, so they will work before and after the +// Go update. (See discussion at https://golang.org/issue/15651.) +package gcexportdata // import "golang.org/x/tools/go/gcexportdata" + +import ( + "bufio" + "bytes" + "encoding/json" + "fmt" + "go/token" + "go/types" + "io" + "os/exec" + + "golang.org/x/tools/internal/gcimporter" +) + +// Find returns the name of an object (.o) or archive (.a) file +// containing type information for the specified import path, +// using the go command. +// If no file was found, an empty filename is returned. +// +// A relative srcDir is interpreted relative to the current working directory. +// +// Find also returns the package's resolved (canonical) import path, +// reflecting the effects of srcDir and vendoring on importPath. +// +// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, +// which is more efficient. +func Find(importPath, srcDir string) (filename, path string) { + cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) + cmd.Dir = srcDir + out, err := cmd.CombinedOutput() + if err != nil { + return "", "" + } + var data struct { + ImportPath string + Export string + } + json.Unmarshal(out, &data) + return data.Export, data.ImportPath +} + +// NewReader returns a reader for the export data section of an object +// (.o) or archive (.a) file read from r. The new reader may provide +// additional trailing data beyond the end of the export data. +func NewReader(r io.Reader) (io.Reader, error) { + buf := bufio.NewReader(r) + _, size, err := gcimporter.FindExportData(buf) + if err != nil { + return nil, err + } + + if size >= 0 { + // We were given an archive and found the __.PKGDEF in it. + // This tells us the size of the export data, and we don't + // need to return the entire file. + return &io.LimitedReader{ + R: buf, + N: size, + }, nil + } else { + // We were given an object file. As such, we don't know how large + // the export data is and must return the entire file. + return buf, nil + } +} + +// readAll works the same way as io.ReadAll, but avoids allocations and copies +// by preallocating a byte slice of the necessary size if the size is known up +// front. This is always possible when the input is an archive. In that case, +// NewReader will return the known size using an io.LimitedReader. +func readAll(r io.Reader) ([]byte, error) { + if lr, ok := r.(*io.LimitedReader); ok { + data := make([]byte, lr.N) + _, err := io.ReadFull(lr, data) + return data, err + } + return io.ReadAll(r) +} + +// Read reads export data from in, decodes it, and returns type +// information for the package. +// +// The package path (effectively its linker symbol prefix) is +// specified by path, since unlike the package name, this information +// may not be recorded in the export data. +// +// File position information is added to fset. +// +// Read may inspect and add to the imports map to ensure that references +// within the export data to other packages are consistent. The caller +// must ensure that imports[path] does not exist, or exists but is +// incomplete (see types.Package.Complete), and Read inserts the +// resulting package into this map entry. +// +// On return, the state of the reader is undefined. +func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { + data, err := readAll(in) + if err != nil { + return nil, fmt.Errorf("reading export data for %q: %v", path, err) + } + + if bytes.HasPrefix(data, []byte("!<arch>")) { + return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) + } + + // The indexed export format starts with an 'i'; the older + // binary export format starts with a 'c', 'd', or 'v' + // (from "version"). Select appropriate importer. + if len(data) > 0 { + switch data[0] { + case 'v', 'c', 'd': // binary, till go1.10 + return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) + + case 'i': // indexed, till go1.19 + _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) + return pkg, err + + case 'u': // unified, from go1.20 + _, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path) + return pkg, err + + default: + l := len(data) + if l > 10 { + l = 10 + } + return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path) + } + } + return nil, fmt.Errorf("empty export data for %s", path) +} + +// Write writes encoded type information for the specified package to out. +// The FileSet provides file position information for named objects. +func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { + if _, err := io.WriteString(out, "i"); err != nil { + return err + } + return gcimporter.IExportData(out, fset, pkg) +} + +// ReadBundle reads an export bundle from in, decodes it, and returns type +// information for the packages. +// File position information is added to fset. +// +// ReadBundle may inspect and add to the imports map to ensure that references +// within the export bundle to other packages are consistent. +// +// On return, the state of the reader is undefined. +// +// Experimental: This API is experimental and may change in the future. +func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { + data, err := readAll(in) + if err != nil { + return nil, fmt.Errorf("reading export bundle: %v", err) + } + return gcimporter.IImportBundle(fset, imports, data) +} + +// WriteBundle writes encoded type information for the specified packages to out. +// The FileSet provides file position information for named objects. +// +// Experimental: This API is experimental and may change in the future. +func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { + return gcimporter.IExportBundle(out, fset, pkgs) +} diff --git a/upstream/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/upstream/vendor/golang.org/x/tools/go/gcexportdata/importer.go new file mode 100644 index 00000000000..37a7247e268 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/gcexportdata/importer.go @@ -0,0 +1,75 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gcexportdata + +import ( + "fmt" + "go/token" + "go/types" + "os" +) + +// NewImporter returns a new instance of the types.Importer interface +// that reads type information from export data files written by gc. +// The Importer also satisfies types.ImporterFrom. +// +// Export data files are located using "go build" workspace conventions +// and the build.Default context. +// +// Use this importer instead of go/importer.For("gc", ...) to avoid the +// version-skew problems described in the documentation of this package, +// or to control the FileSet or access the imports map populated during +// package loading. +// +// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, +// which is more efficient. +func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { + return importer{fset, imports} +} + +type importer struct { + fset *token.FileSet + imports map[string]*types.Package +} + +func (imp importer) Import(importPath string) (*types.Package, error) { + return imp.ImportFrom(importPath, "", 0) +} + +func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { + filename, path := Find(importPath, srcDir) + if filename == "" { + if importPath == "unsafe" { + // Even for unsafe, call Find first in case + // the package was vendored. + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %s", importPath) + } + + if pkg, ok := imp.imports[path]; ok && pkg.Complete() { + return pkg, nil // cache hit + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + f.Close() + if err != nil { + // add file name to error + err = fmt.Errorf("reading export data: %s: %v", filename, err) + } + }() + + r, err := NewReader(f) + if err != nil { + return nil, err + } + + return Read(r, imp.fset, imp.imports, path) +} diff --git a/upstream/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/upstream/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go new file mode 100644 index 00000000000..333676b7cfc --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -0,0 +1,53 @@ +// 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. + +// Package packagesdriver fetches type sizes for go/packages and go/analysis. +package packagesdriver + +import ( + "context" + "fmt" + "strings" + + "golang.org/x/tools/internal/gocommand" +) + +func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { + inv.Verb = "list" + inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} + stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) + var goarch, compiler string + if rawErr != nil { + rawErrMsg := rawErr.Error() + if strings.Contains(rawErrMsg, "cannot find main module") || + strings.Contains(rawErrMsg, "go.mod file not found") { + // User's running outside of a module. + // All bets are off. Get GOARCH and guess compiler is gc. + // TODO(matloob): Is this a problem in practice? + inv.Verb = "env" + inv.Args = []string{"GOARCH"} + envout, enverr := gocmdRunner.Run(ctx, inv) + if enverr != nil { + return "", "", enverr + } + goarch = strings.TrimSpace(envout.String()) + compiler = "gc" + } else if friendlyErr != nil { + return "", "", friendlyErr + } else { + // This should be unreachable, but be defensive + // in case RunRaw's error results are inconsistent. + return "", "", rawErr + } + } else { + fields := strings.Fields(stdout.String()) + if len(fields) < 2 { + return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \"<GOARCH> <compiler>\":\nstdout: <<%s>>\nstderr: <<%s>>", + stdout.String(), stderr.String()) + } + goarch = fields[0] + compiler = fields[1] + } + return compiler, goarch, nil +} diff --git a/upstream/vendor/golang.org/x/tools/go/packages/doc.go b/upstream/vendor/golang.org/x/tools/go/packages/doc.go new file mode 100644 index 00000000000..b2a0b7c6a67 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/doc.go @@ -0,0 +1,240 @@ +// 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. + +/* +Package packages loads Go packages for inspection and analysis. + +The [Load] function takes as input a list of patterns and returns a +list of [Package] values describing individual packages matched by those +patterns. +A [Config] specifies configuration options, the most important of which is +the [LoadMode], which controls the amount of detail in the loaded packages. + +Load passes most patterns directly to the underlying build tool. +The default build tool is the go command. +Its supported patterns are described at +https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns. + +Load may be used in Go projects that use alternative build systems, by +installing an appropriate "driver" program for the build system and +specifying its location in the GOPACKAGESDRIVER environment variable. +For example, +https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration +explains how to use the driver for Bazel. +The driver program is responsible for interpreting patterns in its +preferred notation and reporting information about the packages that +they identify. +(See driverRequest and driverResponse types for the JSON +schema used by the protocol. +Though the protocol is supported, these types are currently unexported; +see #64608 for a proposal to publish them.) + +Regardless of driver, all patterns with the prefix "query=", where query is a +non-empty string of letters from [a-z], are reserved and may be +interpreted as query operators. + +Two query operators are currently supported: "file" and "pattern". + +The query "file=path/to/file.go" matches the package or packages enclosing +the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" +might return the packages "fmt" and "fmt [fmt.test]". + +The query "pattern=string" causes "string" to be passed directly to +the underlying build tool. In most cases this is unnecessary, +but an application can use Load("pattern=" + x) as an escaping mechanism +to ensure that x is not interpreted as a query operator if it contains '='. + +All other query operators are reserved for future use and currently +cause Load to report an error. + +The Package struct provides basic information about the package, including + + - ID, a unique identifier for the package in the returned set; + - GoFiles, the names of the package's Go source files; + - Imports, a map from source import strings to the Packages they name; + - Types, the type information for the package's exported symbols; + - Syntax, the parsed syntax trees for the package's source code; and + - TypesInfo, the result of a complete type-check of the package syntax trees. + +(See the documentation for type Package for the complete list of fields +and more detailed descriptions.) + +For example, + + Load(nil, "bytes", "unicode...") + +returns four Package structs describing the standard library packages +bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern +can match multiple packages and that a package might be matched by +multiple patterns: in general it is not possible to determine which +packages correspond to which patterns. + +Note that the list returned by Load contains only the packages matched +by the patterns. Their dependencies can be found by walking the import +graph using the Imports fields. + +The Load function can be configured by passing a pointer to a Config as +the first argument. A nil Config is equivalent to the zero Config, which +causes Load to run in LoadFiles mode, collecting minimal information. +See the documentation for type Config for details. + +As noted earlier, the Config.Mode controls the amount of detail +reported about the loaded packages. See the documentation for type LoadMode +for details. + +Most tools should pass their command-line arguments (after any flags) +uninterpreted to [Load], so that it can interpret them +according to the conventions of the underlying build system. +See the Example function for typical usage. +*/ +package packages // import "golang.org/x/tools/go/packages" + +/* + +Motivation and design considerations + +The new package's design solves problems addressed by two existing +packages: go/build, which locates and describes packages, and +golang.org/x/tools/go/loader, which loads, parses and type-checks them. +The go/build.Package structure encodes too much of the 'go build' way +of organizing projects, leaving us in need of a data type that describes a +package of Go source code independent of the underlying build system. +We wanted something that works equally well with go build and vgo, and +also other build systems such as Bazel and Blaze, making it possible to +construct analysis tools that work in all these environments. +Tools such as errcheck and staticcheck were essentially unavailable to +the Go community at Google, and some of Google's internal tools for Go +are unavailable externally. +This new package provides a uniform way to obtain package metadata by +querying each of these build systems, optionally supporting their +preferred command-line notations for packages, so that tools integrate +neatly with users' build environments. The Metadata query function +executes an external query tool appropriate to the current workspace. + +Loading packages always returns the complete import graph "all the way down", +even if all you want is information about a single package, because the query +mechanisms of all the build systems we currently support ({go,vgo} list, and +blaze/bazel aspect-based query) cannot provide detailed information +about one package without visiting all its dependencies too, so there is +no additional asymptotic cost to providing transitive information. +(This property might not be true of a hypothetical 5th build system.) + +In calls to TypeCheck, all initial packages, and any package that +transitively depends on one of them, must be loaded from source. +Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from +source; D may be loaded from export data, and E may not be loaded at all +(though it's possible that D's export data mentions it, so a +types.Package may be created for it and exposed.) + +The old loader had a feature to suppress type-checking of function +bodies on a per-package basis, primarily intended to reduce the work of +obtaining type information for imported packages. Now that imports are +satisfied by export data, the optimization no longer seems necessary. + +Despite some early attempts, the old loader did not exploit export data, +instead always using the equivalent of WholeProgram mode. This was due +to the complexity of mixing source and export data packages (now +resolved by the upward traversal mentioned above), and because export data +files were nearly always missing or stale. Now that 'go build' supports +caching, all the underlying build systems can guarantee to produce +export data in a reasonable (amortized) time. + +Test "main" packages synthesized by the build system are now reported as +first-class packages, avoiding the need for clients (such as go/ssa) to +reinvent this generation logic. + +One way in which go/packages is simpler than the old loader is in its +treatment of in-package tests. In-package tests are packages that +consist of all the files of the library under test, plus the test files. +The old loader constructed in-package tests by a two-phase process of +mutation called "augmentation": first it would construct and type check +all the ordinary library packages and type-check the packages that +depend on them; then it would add more (test) files to the package and +type-check again. This two-phase approach had four major problems: +1) in processing the tests, the loader modified the library package, + leaving no way for a client application to see both the test + package and the library package; one would mutate into the other. +2) because test files can declare additional methods on types defined in + the library portion of the package, the dispatch of method calls in + the library portion was affected by the presence of the test files. + This should have been a clue that the packages were logically + different. +3) this model of "augmentation" assumed at most one in-package test + per library package, which is true of projects using 'go build', + but not other build systems. +4) because of the two-phase nature of test processing, all packages that + import the library package had to be processed before augmentation, + forcing a "one-shot" API and preventing the client from calling Load + in several times in sequence as is now possible in WholeProgram mode. + (TypeCheck mode has a similar one-shot restriction for a different reason.) + +Early drafts of this package supported "multi-shot" operation. +Although it allowed clients to make a sequence of calls (or concurrent +calls) to Load, building up the graph of Packages incrementally, +it was of marginal value: it complicated the API +(since it allowed some options to vary across calls but not others), +it complicated the implementation, +it cannot be made to work in Types mode, as explained above, +and it was less efficient than making one combined call (when this is possible). +Among the clients we have inspected, none made multiple calls to load +but could not be easily and satisfactorily modified to make only a single call. +However, applications changes may be required. +For example, the ssadump command loads the user-specified packages +and in addition the runtime package. It is tempting to simply append +"runtime" to the user-provided list, but that does not work if the user +specified an ad-hoc package such as [a.go b.go]. +Instead, ssadump no longer requests the runtime package, +but seeks it among the dependencies of the user-specified packages, +and emits an error if it is not found. + +Overlays: The Overlay field in the Config allows providing alternate contents +for Go source files, by providing a mapping from file path to contents. +go/packages will pull in new imports added in overlay files when go/packages +is run in LoadImports mode or greater. +Overlay support for the go list driver isn't complete yet: if the file doesn't +exist on disk, it will only be recognized in an overlay if it is a non-test file +and the package would be reported even without the overlay. + +Questions & Tasks + +- Add GOARCH/GOOS? + They are not portable concepts, but could be made portable. + Our goal has been to allow users to express themselves using the conventions + of the underlying build system: if the build system honors GOARCH + during a build and during a metadata query, then so should + applications built atop that query mechanism. + Conversely, if the target architecture of the build is determined by + command-line flags, the application can pass the relevant + flags through to the build system using a command such as: + myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" + However, this approach is low-level, unwieldy, and non-portable. + GOOS and GOARCH seem important enough to warrant a dedicated option. + +- How should we handle partial failures such as a mixture of good and + malformed patterns, existing and non-existent packages, successful and + failed builds, import failures, import cycles, and so on, in a call to + Load? + +- Support bazel, blaze, and go1.10 list, not just go1.11 list. + +- Handle (and test) various partial success cases, e.g. + a mixture of good packages and: + invalid patterns + nonexistent packages + empty packages + packages with malformed package or import declarations + unreadable files + import cycles + other parse errors + type errors + Make sure we record errors at the correct place in the graph. + +- Missing packages among initial arguments are not reported. + Return bogus packages for them, like golist does. + +- "undeclared name" errors (for example) are reported out of source file + order. I suspect this is due to the breadth-first resolution now used + by go/types. Is that a bug? Discuss with gri. + +*/ diff --git a/upstream/vendor/golang.org/x/tools/go/packages/external.go b/upstream/vendor/golang.org/x/tools/go/packages/external.go new file mode 100644 index 00000000000..7db1d1293ab --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/external.go @@ -0,0 +1,101 @@ +// 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. + +// This file enables an external tool to intercept package requests. +// If the tool is present then its results are used in preference to +// the go list command. + +package packages + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "os/exec" + "strings" +) + +// The Driver Protocol +// +// The driver, given the inputs to a call to Load, returns metadata about the packages specified. +// This allows for different build systems to support go/packages by telling go/packages how the +// packages' source is organized. +// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in +// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package +// documentation in doc.go for the full description of the patterns that need to be supported. +// A driver receives as a JSON-serialized driverRequest struct in standard input and will +// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. + +// driverRequest is used to provide the portion of Load's Config that is needed by a driver. +type driverRequest struct { + Mode LoadMode `json:"mode"` + // Env specifies the environment the underlying build system should be run in. + Env []string `json:"env"` + // BuildFlags are flags that should be passed to the underlying build system. + BuildFlags []string `json:"build_flags"` + // Tests specifies whether the patterns should also return test packages. + Tests bool `json:"tests"` + // Overlay maps file paths (relative to the driver's working directory) to the byte contents + // of overlay files. + Overlay map[string][]byte `json:"overlay"` +} + +// findExternalDriver returns the file path of a tool that supplies +// the build system package structure, or "" if not found." +// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its +// value, otherwise it searches for a binary named gopackagesdriver on the PATH. +func findExternalDriver(cfg *Config) driver { + const toolPrefix = "GOPACKAGESDRIVER=" + tool := "" + for _, env := range cfg.Env { + if val := strings.TrimPrefix(env, toolPrefix); val != env { + tool = val + } + } + if tool != "" && tool == "off" { + return nil + } + if tool == "" { + var err error + tool, err = exec.LookPath("gopackagesdriver") + if err != nil { + return nil + } + } + return func(cfg *Config, words ...string) (*driverResponse, error) { + req, err := json.Marshal(driverRequest{ + Mode: cfg.Mode, + Env: cfg.Env, + BuildFlags: cfg.BuildFlags, + Tests: cfg.Tests, + Overlay: cfg.Overlay, + }) + if err != nil { + return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) + } + + buf := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.CommandContext(cfg.Context, tool, words...) + cmd.Dir = cfg.Dir + cmd.Env = cfg.Env + cmd.Stdin = bytes.NewReader(req) + cmd.Stdout = buf + cmd.Stderr = stderr + + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) + } + if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { + fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) + } + + var response driverResponse + if err := json.Unmarshal(buf.Bytes(), &response); err != nil { + return nil, err + } + return &response, nil + } +} diff --git a/upstream/vendor/golang.org/x/tools/go/packages/golist.go b/upstream/vendor/golang.org/x/tools/go/packages/golist.go new file mode 100644 index 00000000000..cd375fbc3c2 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/golist.go @@ -0,0 +1,1107 @@ +// 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. + +package packages + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "reflect" + "sort" + "strconv" + "strings" + "sync" + "unicode" + + "golang.org/x/tools/go/internal/packagesdriver" + "golang.org/x/tools/internal/gocommand" + "golang.org/x/tools/internal/packagesinternal" +) + +// debug controls verbose logging. +var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) + +// A goTooOldError reports that the go command +// found by exec.LookPath is too old to use the new go list behavior. +type goTooOldError struct { + error +} + +// responseDeduper wraps a driverResponse, deduplicating its contents. +type responseDeduper struct { + seenRoots map[string]bool + seenPackages map[string]*Package + dr *driverResponse +} + +func newDeduper() *responseDeduper { + return &responseDeduper{ + dr: &driverResponse{}, + seenRoots: map[string]bool{}, + seenPackages: map[string]*Package{}, + } +} + +// addAll fills in r with a driverResponse. +func (r *responseDeduper) addAll(dr *driverResponse) { + for _, pkg := range dr.Packages { + r.addPackage(pkg) + } + for _, root := range dr.Roots { + r.addRoot(root) + } + r.dr.GoVersion = dr.GoVersion +} + +func (r *responseDeduper) addPackage(p *Package) { + if r.seenPackages[p.ID] != nil { + return + } + r.seenPackages[p.ID] = p + r.dr.Packages = append(r.dr.Packages, p) +} + +func (r *responseDeduper) addRoot(id string) { + if r.seenRoots[id] { + return + } + r.seenRoots[id] = true + r.dr.Roots = append(r.dr.Roots, id) +} + +type golistState struct { + cfg *Config + ctx context.Context + + envOnce sync.Once + goEnvError error + goEnv map[string]string + + rootsOnce sync.Once + rootDirsError error + rootDirs map[string]string + + goVersionOnce sync.Once + goVersionError error + goVersion int // The X in Go 1.X. + + // vendorDirs caches the (non)existence of vendor directories. + vendorDirs map[string]bool +} + +// getEnv returns Go environment variables. Only specific variables are +// populated -- computing all of them is slow. +func (state *golistState) getEnv() (map[string]string, error) { + state.envOnce.Do(func() { + var b *bytes.Buffer + b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") + if state.goEnvError != nil { + return + } + + state.goEnv = make(map[string]string) + decoder := json.NewDecoder(b) + if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { + return + } + }) + return state.goEnv, state.goEnvError +} + +// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. +func (state *golistState) mustGetEnv() map[string]string { + env, err := state.getEnv() + if err != nil { + panic(fmt.Sprintf("mustGetEnv: %v", err)) + } + return env +} + +// goListDriver uses the go list command to interpret the patterns and produce +// the build system package structure. +// See driver for more details. +func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { + // Make sure that any asynchronous go commands are killed when we return. + parentCtx := cfg.Context + if parentCtx == nil { + parentCtx = context.Background() + } + ctx, cancel := context.WithCancel(parentCtx) + defer cancel() + + response := newDeduper() + + state := &golistState{ + cfg: cfg, + ctx: ctx, + vendorDirs: map[string]bool{}, + } + + // Fill in response.Sizes asynchronously if necessary. + var sizeserr error + var sizeswg sync.WaitGroup + if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { + sizeswg.Add(1) + go func() { + compiler, arch, err := packagesdriver.GetSizesForArgsGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) + sizeserr = err + response.dr.Compiler = compiler + response.dr.Arch = arch + sizeswg.Done() + }() + } + + // Determine files requested in contains patterns + var containFiles []string + restPatterns := make([]string, 0, len(patterns)) + // Extract file= and other [querytype]= patterns. Report an error if querytype + // doesn't exist. +extractQueries: + for _, pattern := range patterns { + eqidx := strings.Index(pattern, "=") + if eqidx < 0 { + restPatterns = append(restPatterns, pattern) + } else { + query, value := pattern[:eqidx], pattern[eqidx+len("="):] + switch query { + case "file": + containFiles = append(containFiles, value) + case "pattern": + restPatterns = append(restPatterns, value) + case "": // not a reserved query + restPatterns = append(restPatterns, pattern) + default: + for _, rune := range query { + if rune < 'a' || rune > 'z' { // not a reserved query + restPatterns = append(restPatterns, pattern) + continue extractQueries + } + } + // Reject all other patterns containing "=" + return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) + } + } + } + + // See if we have any patterns to pass through to go list. Zero initial + // patterns also requires a go list call, since it's the equivalent of + // ".". + if len(restPatterns) > 0 || len(patterns) == 0 { + dr, err := state.createDriverResponse(restPatterns...) + if err != nil { + return nil, err + } + response.addAll(dr) + } + + if len(containFiles) != 0 { + if err := state.runContainsQueries(response, containFiles); err != nil { + return nil, err + } + } + + sizeswg.Wait() + if sizeserr != nil { + return nil, sizeserr + } + return response.dr, nil +} + +func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { + for _, query := range queries { + // TODO(matloob): Do only one query per directory. + fdir := filepath.Dir(query) + // Pass absolute path of directory to go list so that it knows to treat it as a directory, + // not a package path. + pattern, err := filepath.Abs(fdir) + if err != nil { + return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) + } + dirResponse, err := state.createDriverResponse(pattern) + + // If there was an error loading the package, or no packages are returned, + // or the package is returned with errors, try to load the file as an + // ad-hoc package. + // Usually the error will appear in a returned package, but may not if we're + // in module mode and the ad-hoc is located outside a module. + if err != nil || len(dirResponse.Packages) == 0 || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && + len(dirResponse.Packages[0].Errors) == 1 { + var queryErr error + if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { + return err // return the original error + } + } + isRoot := make(map[string]bool, len(dirResponse.Roots)) + for _, root := range dirResponse.Roots { + isRoot[root] = true + } + for _, pkg := range dirResponse.Packages { + // Add any new packages to the main set + // We don't bother to filter packages that will be dropped by the changes of roots, + // that will happen anyway during graph construction outside this function. + // Over-reporting packages is not a problem. + response.addPackage(pkg) + // if the package was not a root one, it cannot have the file + if !isRoot[pkg.ID] { + continue + } + for _, pkgFile := range pkg.GoFiles { + if filepath.Base(query) == filepath.Base(pkgFile) { + response.addRoot(pkg.ID) + break + } + } + } + } + return nil +} + +// adhocPackage attempts to load or construct an ad-hoc package for a given +// query, if the original call to the driver produced inadequate results. +func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, error) { + response, err := state.createDriverResponse(query) + if err != nil { + return nil, err + } + // If we get nothing back from `go list`, + // try to make this file into its own ad-hoc package. + // TODO(rstambler): Should this check against the original response? + if len(response.Packages) == 0 { + response.Packages = append(response.Packages, &Package{ + ID: "command-line-arguments", + PkgPath: query, + GoFiles: []string{query}, + CompiledGoFiles: []string{query}, + Imports: make(map[string]*Package), + }) + response.Roots = append(response.Roots, "command-line-arguments") + } + // Handle special cases. + if len(response.Packages) == 1 { + // golang/go#33482: If this is a file= query for ad-hoc packages where + // the file only exists on an overlay, and exists outside of a module, + // add the file to the package and remove the errors. + if response.Packages[0].ID == "command-line-arguments" || + filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { + if len(response.Packages[0].GoFiles) == 0 { + filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath + // TODO(matloob): check if the file is outside of a root dir? + for path := range state.cfg.Overlay { + if path == filename { + response.Packages[0].Errors = nil + response.Packages[0].GoFiles = []string{path} + response.Packages[0].CompiledGoFiles = []string{path} + } + } + } + } + } + return response, nil +} + +// Fields must match go list; +// see $GOROOT/src/cmd/go/internal/load/pkg.go. +type jsonPackage struct { + ImportPath string + Dir string + Name string + Export string + GoFiles []string + CompiledGoFiles []string + IgnoredGoFiles []string + IgnoredOtherFiles []string + EmbedPatterns []string + EmbedFiles []string + CFiles []string + CgoFiles []string + CXXFiles []string + MFiles []string + HFiles []string + FFiles []string + SFiles []string + SwigFiles []string + SwigCXXFiles []string + SysoFiles []string + Imports []string + ImportMap map[string]string + Deps []string + Module *Module + TestGoFiles []string + TestImports []string + XTestGoFiles []string + XTestImports []string + ForTest string // q in a "p [q.test]" package, else "" + DepOnly bool + + Error *packagesinternal.PackageError + DepsErrors []*packagesinternal.PackageError +} + +type jsonPackageError struct { + ImportStack []string + Pos string + Err string +} + +func otherFiles(p *jsonPackage) [][]string { + return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} +} + +// createDriverResponse uses the "go list" command to expand the pattern +// words and return a response for the specified packages. +func (state *golistState) createDriverResponse(words ...string) (*driverResponse, error) { + // go list uses the following identifiers in ImportPath and Imports: + // + // "p" -- importable package or main (command) + // "q.test" -- q's test executable + // "p [q.test]" -- variant of p as built for q's test executable + // "q_test [q.test]" -- q's external test package + // + // The packages p that are built differently for a test q.test + // are q itself, plus any helpers used by the external test q_test, + // typically including "testing" and all its dependencies. + + // Run "go list" for complete + // information on the specified packages. + goVersion, err := state.getGoVersion() + if err != nil { + return nil, err + } + buf, err := state.invokeGo("list", golistargs(state.cfg, words, goVersion)...) + if err != nil { + return nil, err + } + + seen := make(map[string]*jsonPackage) + pkgs := make(map[string]*Package) + additionalErrors := make(map[string][]Error) + // Decode the JSON and convert it to Package form. + response := &driverResponse{ + GoVersion: goVersion, + } + for dec := json.NewDecoder(buf); dec.More(); { + p := new(jsonPackage) + if err := dec.Decode(p); err != nil { + return nil, fmt.Errorf("JSON decoding failed: %v", err) + } + + if p.ImportPath == "" { + // The documentation for go list says that “[e]rroneous packages will have + // a non-empty ImportPath”. If for some reason it comes back empty, we + // prefer to error out rather than silently discarding data or handing + // back a package without any way to refer to it. + if p.Error != nil { + return nil, Error{ + Pos: p.Error.Pos, + Msg: p.Error.Err, + } + } + return nil, fmt.Errorf("package missing import path: %+v", p) + } + + // Work around https://golang.org/issue/33157: + // go list -e, when given an absolute path, will find the package contained at + // that directory. But when no package exists there, it will return a fake package + // with an error and the ImportPath set to the absolute path provided to go list. + // Try to convert that absolute path to what its package path would be if it's + // contained in a known module or GOPATH entry. This will allow the package to be + // properly "reclaimed" when overlays are processed. + if filepath.IsAbs(p.ImportPath) && p.Error != nil { + pkgPath, ok, err := state.getPkgPath(p.ImportPath) + if err != nil { + return nil, err + } + if ok { + p.ImportPath = pkgPath + } + } + + if old, found := seen[p.ImportPath]; found { + // If one version of the package has an error, and the other doesn't, assume + // that this is a case where go list is reporting a fake dependency variant + // of the imported package: When a package tries to invalidly import another + // package, go list emits a variant of the imported package (with the same + // import path, but with an error on it, and the package will have a + // DepError set on it). An example of when this can happen is for imports of + // main packages: main packages can not be imported, but they may be + // separately matched and listed by another pattern. + // See golang.org/issue/36188 for more details. + + // The plan is that eventually, hopefully in Go 1.15, the error will be + // reported on the importing package rather than the duplicate "fake" + // version of the imported package. Once all supported versions of Go + // have the new behavior this logic can be deleted. + // TODO(matloob): delete the workaround logic once all supported versions of + // Go return the errors on the proper package. + + // There should be exactly one version of a package that doesn't have an + // error. + if old.Error == nil && p.Error == nil { + if !reflect.DeepEqual(p, old) { + return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) + } + continue + } + + // Determine if this package's error needs to be bubbled up. + // This is a hack, and we expect for go list to eventually set the error + // on the package. + if old.Error != nil { + var errkind string + if strings.Contains(old.Error.Err, "not an importable package") { + errkind = "not an importable package" + } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { + errkind = "use of internal package not allowed" + } + if errkind != "" { + if len(old.Error.ImportStack) < 1 { + return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) + } + importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] + if importingPkg == old.ImportPath { + // Using an older version of Go which put this package itself on top of import + // stack, instead of the importer. Look for importer in second from top + // position. + if len(old.Error.ImportStack) < 2 { + return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) + } + importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] + } + additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ + Pos: old.Error.Pos, + Msg: old.Error.Err, + Kind: ListError, + }) + } + } + + // Make sure that if there's a version of the package without an error, + // that's the one reported to the user. + if old.Error == nil { + continue + } + + // This package will replace the old one at the end of the loop. + } + seen[p.ImportPath] = p + + pkg := &Package{ + Name: p.Name, + ID: p.ImportPath, + GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), + CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), + OtherFiles: absJoin(p.Dir, otherFiles(p)...), + EmbedFiles: absJoin(p.Dir, p.EmbedFiles), + EmbedPatterns: absJoin(p.Dir, p.EmbedPatterns), + IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), + forTest: p.ForTest, + depsErrors: p.DepsErrors, + Module: p.Module, + } + + if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 { + if len(p.CompiledGoFiles) > len(p.GoFiles) { + // We need the cgo definitions, which are in the first + // CompiledGoFile after the non-cgo ones. This is a hack but there + // isn't currently a better way to find it. We also need the pure + // Go files and unprocessed cgo files, all of which are already + // in pkg.GoFiles. + cgoTypes := p.CompiledGoFiles[len(p.GoFiles)] + pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...) + } else { + // golang/go#38990: go list silently fails to do cgo processing + pkg.CompiledGoFiles = nil + pkg.Errors = append(pkg.Errors, Error{ + Msg: "go list failed to return CompiledGoFiles. This may indicate failure to perform cgo processing; try building at the command line. See https://golang.org/issue/38990.", + Kind: ListError, + }) + } + } + + // Work around https://golang.org/issue/28749: + // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. + // Remove files from CompiledGoFiles that are non-go files + // (or are not files that look like they are from the cache). + if len(pkg.CompiledGoFiles) > 0 { + out := pkg.CompiledGoFiles[:0] + for _, f := range pkg.CompiledGoFiles { + if ext := filepath.Ext(f); ext != ".go" && ext != "" { // ext == "" means the file is from the cache, so probably cgo-processed file + continue + } + out = append(out, f) + } + pkg.CompiledGoFiles = out + } + + // Extract the PkgPath from the package's ID. + if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { + pkg.PkgPath = pkg.ID[:i] + } else { + pkg.PkgPath = pkg.ID + } + + if pkg.PkgPath == "unsafe" { + pkg.CompiledGoFiles = nil // ignore fake unsafe.go file (#59929) + } else if len(pkg.CompiledGoFiles) == 0 { + // Work around for pre-go.1.11 versions of go list. + // TODO(matloob): they should be handled by the fallback. + // Can we delete this? + pkg.CompiledGoFiles = pkg.GoFiles + } + + // Assume go list emits only absolute paths for Dir. + if p.Dir != "" && !filepath.IsAbs(p.Dir) { + log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) + } + + if p.Export != "" && !filepath.IsAbs(p.Export) { + pkg.ExportFile = filepath.Join(p.Dir, p.Export) + } else { + pkg.ExportFile = p.Export + } + + // imports + // + // Imports contains the IDs of all imported packages. + // ImportsMap records (path, ID) only where they differ. + ids := make(map[string]bool) + for _, id := range p.Imports { + ids[id] = true + } + pkg.Imports = make(map[string]*Package) + for path, id := range p.ImportMap { + pkg.Imports[path] = &Package{ID: id} // non-identity import + delete(ids, id) + } + for id := range ids { + if id == "C" { + continue + } + + pkg.Imports[id] = &Package{ID: id} // identity import + } + if !p.DepOnly { + response.Roots = append(response.Roots, pkg.ID) + } + + // Temporary work-around for golang/go#39986. Parse filenames out of + // error messages. This happens if there are unrecoverable syntax + // errors in the source, so we can't match on a specific error message. + // + // TODO(rfindley): remove this heuristic, in favor of considering + // InvalidGoFiles from the list driver. + if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) { + addFilenameFromPos := func(pos string) bool { + split := strings.Split(pos, ":") + if len(split) < 1 { + return false + } + filename := strings.TrimSpace(split[0]) + if filename == "" { + return false + } + if !filepath.IsAbs(filename) { + filename = filepath.Join(state.cfg.Dir, filename) + } + info, _ := os.Stat(filename) + if info == nil { + return false + } + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) + pkg.GoFiles = append(pkg.GoFiles, filename) + return true + } + found := addFilenameFromPos(err.Pos) + // In some cases, go list only reports the error position in the + // error text, not the error position. One such case is when the + // file's package name is a keyword (see golang.org/issue/39763). + if !found { + addFilenameFromPos(err.Err) + } + } + + if p.Error != nil { + msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. + // Address golang.org/issue/35964 by appending import stack to error message. + if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { + msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) + } + pkg.Errors = append(pkg.Errors, Error{ + Pos: p.Error.Pos, + Msg: msg, + Kind: ListError, + }) + } + + pkgs[pkg.ID] = pkg + } + + for id, errs := range additionalErrors { + if p, ok := pkgs[id]; ok { + p.Errors = append(p.Errors, errs...) + } + } + for _, pkg := range pkgs { + response.Packages = append(response.Packages, pkg) + } + sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) + + return response, nil +} + +func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { + if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 { + return false + } + + goV, err := state.getGoVersion() + if err != nil { + return false + } + + // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. + // The import stack behaves differently for these versions than newer Go versions. + if goV < 15 { + return len(p.Error.ImportStack) == 0 + } + + // On Go 1.15 and later, only parse filenames out of error if there's no import stack, + // or the current package is at the top of the import stack. This is not guaranteed + // to work perfectly, but should avoid some cases where files in errors don't belong to this + // package. + return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath +} + +// getGoVersion returns the effective minor version of the go command. +func (state *golistState) getGoVersion() (int, error) { + state.goVersionOnce.Do(func() { + state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.cfg.gocmdRunner) + }) + return state.goVersion, state.goVersionError +} + +// getPkgPath finds the package path of a directory if it's relative to a root +// directory. +func (state *golistState) getPkgPath(dir string) (string, bool, error) { + absDir, err := filepath.Abs(dir) + if err != nil { + return "", false, err + } + roots, err := state.determineRootDirs() + if err != nil { + return "", false, err + } + + for rdir, rpath := range roots { + // Make sure that the directory is in the module, + // to avoid creating a path relative to another module. + if !strings.HasPrefix(absDir, rdir) { + continue + } + // TODO(matloob): This doesn't properly handle symlinks. + r, err := filepath.Rel(rdir, dir) + if err != nil { + continue + } + if rpath != "" { + // We choose only one root even though the directory even it can belong in multiple modules + // or GOPATH entries. This is okay because we only need to work with absolute dirs when a + // file is missing from disk, for instance when gopls calls go/packages in an overlay. + // Once the file is saved, gopls, or the next invocation of the tool will get the correct + // result straight from golist. + // TODO(matloob): Implement module tiebreaking? + return path.Join(rpath, filepath.ToSlash(r)), true, nil + } + return filepath.ToSlash(r), true, nil + } + return "", false, nil +} + +// absJoin absolutizes and flattens the lists of files. +func absJoin(dir string, fileses ...[]string) (res []string) { + for _, files := range fileses { + for _, file := range files { + if !filepath.IsAbs(file) { + file = filepath.Join(dir, file) + } + res = append(res, file) + } + } + return res +} + +func jsonFlag(cfg *Config, goVersion int) string { + if goVersion < 19 { + return "-json" + } + var fields []string + added := make(map[string]bool) + addFields := func(fs ...string) { + for _, f := range fs { + if !added[f] { + added[f] = true + fields = append(fields, f) + } + } + } + addFields("Name", "ImportPath", "Error") // These fields are always needed + if cfg.Mode&NeedFiles != 0 || cfg.Mode&NeedTypes != 0 { + addFields("Dir", "GoFiles", "IgnoredGoFiles", "IgnoredOtherFiles", "CFiles", + "CgoFiles", "CXXFiles", "MFiles", "HFiles", "FFiles", "SFiles", + "SwigFiles", "SwigCXXFiles", "SysoFiles") + if cfg.Tests { + addFields("TestGoFiles", "XTestGoFiles") + } + } + if cfg.Mode&NeedTypes != 0 { + // CompiledGoFiles seems to be required for the test case TestCgoNoSyntax, + // even when -compiled isn't passed in. + // TODO(#52435): Should we make the test ask for -compiled, or automatically + // request CompiledGoFiles in certain circumstances? + addFields("Dir", "CompiledGoFiles") + } + if cfg.Mode&NeedCompiledGoFiles != 0 { + addFields("Dir", "CompiledGoFiles", "Export") + } + if cfg.Mode&NeedImports != 0 { + // When imports are requested, DepOnly is used to distinguish between packages + // explicitly requested and transitive imports of those packages. + addFields("DepOnly", "Imports", "ImportMap") + if cfg.Tests { + addFields("TestImports", "XTestImports") + } + } + if cfg.Mode&NeedDeps != 0 { + addFields("DepOnly") + } + if usesExportData(cfg) { + // Request Dir in the unlikely case Export is not absolute. + addFields("Dir", "Export") + } + if cfg.Mode&needInternalForTest != 0 { + addFields("ForTest") + } + if cfg.Mode&needInternalDepsErrors != 0 { + addFields("DepsErrors") + } + if cfg.Mode&NeedModule != 0 { + addFields("Module") + } + if cfg.Mode&NeedEmbedFiles != 0 { + addFields("EmbedFiles") + } + if cfg.Mode&NeedEmbedPatterns != 0 { + addFields("EmbedPatterns") + } + return "-json=" + strings.Join(fields, ",") +} + +func golistargs(cfg *Config, words []string, goVersion int) []string { + const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo + fullargs := []string{ + "-e", jsonFlag(cfg, goVersion), + fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), + fmt.Sprintf("-test=%t", cfg.Tests), + fmt.Sprintf("-export=%t", usesExportData(cfg)), + fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), + // go list doesn't let you pass -test and -find together, + // probably because you'd just get the TestMain. + fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)), + } + + // golang/go#60456: with go1.21 and later, go list serves pgo variants, which + // can be costly to compute and may result in redundant processing for the + // caller. Disable these variants. If someone wants to add e.g. a NeedPGO + // mode flag, that should be a separate proposal. + if goVersion >= 21 { + fullargs = append(fullargs, "-pgo=off") + } + + fullargs = append(fullargs, cfg.BuildFlags...) + fullargs = append(fullargs, "--") + fullargs = append(fullargs, words...) + return fullargs +} + +// cfgInvocation returns an Invocation that reflects cfg's settings. +func (state *golistState) cfgInvocation() gocommand.Invocation { + cfg := state.cfg + return gocommand.Invocation{ + BuildFlags: cfg.BuildFlags, + ModFile: cfg.modFile, + ModFlag: cfg.modFlag, + CleanEnv: cfg.Env != nil, + Env: cfg.Env, + Logf: cfg.Logf, + WorkingDir: cfg.Dir, + } +} + +// invokeGo returns the stdout of a go command invocation. +func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { + cfg := state.cfg + + inv := state.cfgInvocation() + + // For Go versions 1.16 and above, `go list` accepts overlays directly via + // the -overlay flag. Set it, if it's available. + // + // The check for "list" is not necessarily required, but we should avoid + // getting the go version if possible. + if verb == "list" { + goVersion, err := state.getGoVersion() + if err != nil { + return nil, err + } + if goVersion >= 16 { + filename, cleanup, err := state.writeOverlays() + if err != nil { + return nil, err + } + defer cleanup() + inv.Overlay = filename + } + } + inv.Verb = verb + inv.Args = args + gocmdRunner := cfg.gocmdRunner + if gocmdRunner == nil { + gocmdRunner = &gocommand.Runner{} + } + stdout, stderr, friendlyErr, err := gocmdRunner.RunRaw(cfg.Context, inv) + if err != nil { + // Check for 'go' executable not being found. + if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { + return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) + } + + exitErr, ok := err.(*exec.ExitError) + if !ok { + // Catastrophic error: + // - context cancellation + return nil, fmt.Errorf("couldn't run 'go': %w", err) + } + + // Old go version? + if strings.Contains(stderr.String(), "flag provided but not defined") { + return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} + } + + // Related to #24854 + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { + return nil, friendlyErr + } + + // Is there an error running the C compiler in cgo? This will be reported in the "Error" field + // and should be suppressed by go list -e. + // + // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. + isPkgPathRune := func(r rune) bool { + // From https://golang.org/ref/spec#Import_declarations: + // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings + // using only characters belonging to Unicode's L, M, N, P, and S general categories + // (the Graphic characters without spaces) and may also exclude the + // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. + return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && + !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) + } + // golang/go#36770: Handle case where cmd/go prints module download messages before the error. + msg := stderr.String() + for strings.HasPrefix(msg, "go: downloading") { + msg = msg[strings.IndexRune(msg, '\n')+1:] + } + if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { + msg := msg[len("# "):] + if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { + return stdout, nil + } + // Treat pkg-config errors as a special case (golang.org/issue/36770). + if strings.HasPrefix(msg, "pkg-config") { + return stdout, nil + } + } + + // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show + // the error in the Err section of stdout in case -e option is provided. + // This fix is provided for backwards compatibility. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Similar to the previous error, but currently lacks a fix in Go. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. + // If the package doesn't exist, put the absolute path of the directory into the error message, + // as Go 1.13 list does. + const noSuchDirectory = "no such directory" + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { + errstr := stderr.String() + abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + abspath, strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. + // Note that the error message we look for in this case is different that the one looked for above. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a + // directory outside any module. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Another variation of the previous error + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit + // status if there's a dependency on a package that doesn't exist. But it should return + // a zero exit status and set an error on that package. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { + // Don't clobber stdout if `go list` actually returned something. + if len(stdout.String()) > 0 { + return stdout, nil + } + // try to extract package name from string + stderrStr := stderr.String() + var importPath string + colon := strings.Index(stderrStr, ":") + if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { + importPath = stderrStr[len("go build "):colon] + } + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + importPath, strings.Trim(stderrStr, "\n")) + return bytes.NewBufferString(output), nil + } + + // Export mode entails a build. + // If that build fails, errors appear on stderr + // (despite the -e flag) and the Export field is blank. + // Do not fail in that case. + // The same is true if an ad-hoc package given to go list doesn't exist. + // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when + // packages don't exist or a build fails. + if !usesExportData(cfg) && !containsGoFile(args) { + return nil, friendlyErr + } + } + return stdout, nil +} + +// OverlayJSON is the format overlay files are expected to be in. +// The Replace map maps from overlaid paths to replacement paths: +// the Go command will forward all reads trying to open +// each overlaid path to its replacement path, or consider the overlaid +// path not to exist if the replacement path is empty. +// +// From golang/go#39958. +type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` +} + +// writeOverlays writes out files for go list's -overlay flag, as described +// above. +func (state *golistState) writeOverlays() (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(state.cfg.Overlay) == 0 { + return "", func() {}, nil + } + dir, err := os.MkdirTemp("", "gopackages-*") + if err != nil { + return "", nil, err + } + // The caller must clean up this directory, unless this function returns an + // error. + cleanup = func() { + os.RemoveAll(dir) + } + defer func() { + if err != nil { + cleanup() + } + }() + overlays := map[string]string{} + for k, v := range state.cfg.Overlay { + // Create a unique filename for the overlaid files, to avoid + // creating nested directories. + noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") + f, err := os.CreateTemp(dir, fmt.Sprintf("*-%s", noSeparator)) + if err != nil { + return "", func() {}, err + } + if _, err := f.Write(v); err != nil { + return "", func() {}, err + } + if err := f.Close(); err != nil { + return "", func() {}, err + } + overlays[k] = f.Name() + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", func() {}, err + } + // Write out the overlay file that contains the filepath mappings. + filename = filepath.Join(dir, "overlay.json") + if err := os.WriteFile(filename, b, 0665); err != nil { + return "", func() {}, err + } + return filename, cleanup, nil +} + +func containsGoFile(s []string) bool { + for _, f := range s { + if strings.HasSuffix(f, ".go") { + return true + } + } + return false +} + +func cmdDebugStr(cmd *exec.Cmd) string { + env := make(map[string]string) + for _, kv := range cmd.Env { + split := strings.SplitN(kv, "=", 2) + k, v := split[0], split[1] + env[k] = v + } + + var args []string + for _, arg := range cmd.Args { + quoted := strconv.Quote(arg) + if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { + args = append(args, quoted) + } else { + args = append(args, arg) + } + } + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) +} diff --git a/upstream/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/upstream/vendor/golang.org/x/tools/go/packages/golist_overlay.go new file mode 100644 index 00000000000..d823c474ad3 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/golist_overlay.go @@ -0,0 +1,83 @@ +// 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. + +package packages + +import ( + "encoding/json" + "path/filepath" + + "golang.org/x/tools/internal/gocommand" +) + +// determineRootDirs returns a mapping from absolute directories that could +// contain code to their corresponding import path prefixes. +func (state *golistState) determineRootDirs() (map[string]string, error) { + env, err := state.getEnv() + if err != nil { + return nil, err + } + if env["GOMOD"] != "" { + state.rootsOnce.Do(func() { + state.rootDirs, state.rootDirsError = state.determineRootDirsModules() + }) + } else { + state.rootsOnce.Do(func() { + state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() + }) + } + return state.rootDirs, state.rootDirsError +} + +func (state *golistState) determineRootDirsModules() (map[string]string, error) { + // List all of the modules--the first will be the directory for the main + // module. Any replaced modules will also need to be treated as roots. + // Editing files in the module cache isn't a great idea, so we don't + // plan to ever support that. + out, err := state.invokeGo("list", "-m", "-json", "all") + if err != nil { + // 'go list all' will fail if we're outside of a module and + // GO111MODULE=on. Try falling back without 'all'. + var innerErr error + out, innerErr = state.invokeGo("list", "-m", "-json") + if innerErr != nil { + return nil, err + } + } + roots := map[string]string{} + modules := map[string]string{} + var i int + for dec := json.NewDecoder(out); dec.More(); { + mod := new(gocommand.ModuleJSON) + if err := dec.Decode(mod); err != nil { + return nil, err + } + if mod.Dir != "" && mod.Path != "" { + // This is a valid module; add it to the map. + absDir, err := filepath.Abs(mod.Dir) + if err != nil { + return nil, err + } + modules[absDir] = mod.Path + // The first result is the main module. + if i == 0 || mod.Replace != nil && mod.Replace.Path != "" { + roots[absDir] = mod.Path + } + } + i++ + } + return roots, nil +} + +func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { + m := map[string]string{} + for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { + absDir, err := filepath.Abs(dir) + if err != nil { + return nil, err + } + m[filepath.Join(absDir, "src")] = "" + } + return m, nil +} diff --git a/upstream/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/upstream/vendor/golang.org/x/tools/go/packages/loadmode_string.go new file mode 100644 index 00000000000..5c080d21b54 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/loadmode_string.go @@ -0,0 +1,57 @@ +// Copyright 2019 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 packages + +import ( + "fmt" + "strings" +) + +var allModes = []LoadMode{ + NeedName, + NeedFiles, + NeedCompiledGoFiles, + NeedImports, + NeedDeps, + NeedExportFile, + NeedTypes, + NeedSyntax, + NeedTypesInfo, + NeedTypesSizes, +} + +var modeStrings = []string{ + "NeedName", + "NeedFiles", + "NeedCompiledGoFiles", + "NeedImports", + "NeedDeps", + "NeedExportFile", + "NeedTypes", + "NeedSyntax", + "NeedTypesInfo", + "NeedTypesSizes", +} + +func (mod LoadMode) String() string { + m := mod + if m == 0 { + return "LoadMode(0)" + } + var out []string + for i, x := range allModes { + if x > m { + break + } + if (m & x) != 0 { + out = append(out, modeStrings[i]) + m = m ^ x + } + } + if m != 0 { + out = append(out, "Unknown") + } + return fmt.Sprintf("LoadMode(%s)", strings.Join(out, "|")) +} diff --git a/upstream/vendor/golang.org/x/tools/go/packages/packages.go b/upstream/vendor/golang.org/x/tools/go/packages/packages.go new file mode 100644 index 00000000000..81e9e6a727d --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/packages.go @@ -0,0 +1,1347 @@ +// 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. + +package packages + +// See doc.go for package documentation and implementation notes. + +import ( + "context" + "encoding/json" + "fmt" + "go/ast" + "go/parser" + "go/scanner" + "go/token" + "go/types" + "io" + "log" + "os" + "path/filepath" + "runtime" + "strings" + "sync" + "time" + + "golang.org/x/tools/go/gcexportdata" + "golang.org/x/tools/internal/gocommand" + "golang.org/x/tools/internal/packagesinternal" + "golang.org/x/tools/internal/typesinternal" + "golang.org/x/tools/internal/versions" +) + +// A LoadMode controls the amount of detail to return when loading. +// The bits below can be combined to specify which fields should be +// filled in the result packages. +// The zero value is a special case, equivalent to combining +// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. +// ID and Errors (if present) will always be filled. +// Load may return more information than requested. +type LoadMode int + +const ( + // NeedName adds Name and PkgPath. + NeedName LoadMode = 1 << iota + + // NeedFiles adds GoFiles and OtherFiles. + NeedFiles + + // NeedCompiledGoFiles adds CompiledGoFiles. + NeedCompiledGoFiles + + // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain + // "placeholder" Packages with only the ID set. + NeedImports + + // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. + NeedDeps + + // NeedExportFile adds ExportFile. + NeedExportFile + + // NeedTypes adds Types, Fset, and IllTyped. + NeedTypes + + // NeedSyntax adds Syntax. + NeedSyntax + + // NeedTypesInfo adds TypesInfo. + NeedTypesInfo + + // NeedTypesSizes adds TypesSizes. + NeedTypesSizes + + // needInternalDepsErrors adds the internal deps errors field for use by gopls. + needInternalDepsErrors + + // needInternalForTest adds the internal forTest field. + // Tests must also be set on the context for this field to be populated. + needInternalForTest + + // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+. + // Modifies CompiledGoFiles and Types, and has no effect on its own. + typecheckCgo + + // NeedModule adds Module. + NeedModule + + // NeedEmbedFiles adds EmbedFiles. + NeedEmbedFiles + + // NeedEmbedPatterns adds EmbedPatterns. + NeedEmbedPatterns +) + +const ( + // Deprecated: LoadFiles exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles + + // Deprecated: LoadImports exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadImports = LoadFiles | NeedImports + + // Deprecated: LoadTypes exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadTypes = LoadImports | NeedTypes | NeedTypesSizes + + // Deprecated: LoadSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo + + // Deprecated: LoadAllSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadAllSyntax = LoadSyntax | NeedDeps + + // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile. + NeedExportsFile = NeedExportFile +) + +// A Config specifies details about how packages should be loaded. +// The zero value is a valid configuration. +// Calls to Load do not modify this struct. +type Config struct { + // Mode controls the level of information returned for each package. + Mode LoadMode + + // Context specifies the context for the load operation. + // If the context is cancelled, the loader may stop early + // and return an ErrCancelled error. + // If Context is nil, the load cannot be cancelled. + Context context.Context + + // Logf is the logger for the config. + // If the user provides a logger, debug logging is enabled. + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the logger is nil, default to log.Printf. + Logf func(format string, args ...interface{}) + + // Dir is the directory in which to run the build system's query tool + // that provides information about the packages. + // If Dir is empty, the tool is run in the current directory. + Dir string + + // Env is the environment to use when invoking the build system's query tool. + // If Env is nil, the current environment is used. + // As in os/exec's Cmd, only the last value in the slice for + // each environment key is used. To specify the setting of only + // a few variables, append to the current environment, as in: + // + // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") + // + Env []string + + // gocmdRunner guards go command calls from concurrency errors. + gocmdRunner *gocommand.Runner + + // BuildFlags is a list of command-line flags to be passed through to + // the build system's query tool. + BuildFlags []string + + // modFile will be used for -modfile in go command invocations. + modFile string + + // modFlag will be used for -modfile in go command invocations. + modFlag string + + // Fset provides source position information for syntax trees and types. + // If Fset is nil, Load will use a new fileset, but preserve Fset's value. + Fset *token.FileSet + + // ParseFile is called to read and parse each file + // when preparing a package's type-checked syntax tree. + // It must be safe to call ParseFile simultaneously from multiple goroutines. + // If ParseFile is nil, the loader will uses parser.ParseFile. + // + // ParseFile should parse the source from src and use filename only for + // recording position information. + // + // An application may supply a custom implementation of ParseFile + // to change the effective file contents or the behavior of the parser, + // or to modify the syntax tree. For example, selectively eliminating + // unwanted function bodies can significantly accelerate type checking. + ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) + + // If Tests is set, the loader includes not just the packages + // matching a particular pattern but also any related test packages, + // including test-only variants of the package and the test executable. + // + // For example, when using the go command, loading "fmt" with Tests=true + // returns four packages, with IDs "fmt" (the standard package), + // "fmt [fmt.test]" (the package as compiled for the test), + // "fmt_test" (the test functions from source files in package fmt_test), + // and "fmt.test" (the test binary). + // + // In build systems with explicit names for tests, + // setting Tests may have no effect. + Tests bool + + // Overlay provides a mapping of absolute file paths to file contents. + // If the file with the given path already exists, the parser will use the + // alternative file contents provided by the map. + // + // Overlays provide incomplete support for when a given file doesn't + // already exist on disk. See the package doc above for more details. + Overlay map[string][]byte +} + +// driver is the type for functions that query the build system for the +// packages named by the patterns. +type driver func(cfg *Config, patterns ...string) (*driverResponse, error) + +// driverResponse contains the results for a driver query. +type driverResponse struct { + // NotHandled is returned if the request can't be handled by the current + // driver. If an external driver returns a response with NotHandled, the + // rest of the driverResponse is ignored, and go/packages will fallback + // to the next driver. If go/packages is extended in the future to support + // lists of multiple drivers, go/packages will fall back to the next driver. + NotHandled bool + + // Compiler and Arch are the arguments pass of types.SizesFor + // to get a types.Sizes to use when type checking. + Compiler string + Arch string + + // Roots is the set of package IDs that make up the root packages. + // We have to encode this separately because when we encode a single package + // we cannot know if it is one of the roots as that requires knowledge of the + // graph it is part of. + Roots []string `json:",omitempty"` + + // Packages is the full set of packages in the graph. + // The packages are not connected into a graph. + // The Imports if populated will be stubs that only have their ID set. + // Imports will be connected and then type and syntax information added in a + // later pass (see refine). + Packages []*Package + + // GoVersion is the minor version number used by the driver + // (e.g. the go command on the PATH) when selecting .go files. + // Zero means unknown. + GoVersion int +} + +// Load loads and returns the Go packages named by the given patterns. +// +// Config specifies loading options; +// nil behaves the same as an empty Config. +// +// Load returns an error if any of the patterns was invalid +// as defined by the underlying build system. +// It may return an empty list of packages without an error, +// for instance for an empty expansion of a valid wildcard. +// Errors associated with a particular package are recorded in the +// corresponding Package's Errors list, and do not cause Load to +// return an error. Clients may need to handle such errors before +// proceeding with further analysis. The PrintErrors function is +// provided for convenient display of all errors. +func Load(cfg *Config, patterns ...string) ([]*Package, error) { + ld := newLoader(cfg) + response, external, err := defaultDriver(&ld.Config, patterns...) + if err != nil { + return nil, err + } + + ld.sizes = types.SizesFor(response.Compiler, response.Arch) + if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 { + // Type size information is needed but unavailable. + if external { + // An external driver may fail to populate the Compiler/GOARCH fields, + // especially since they are relatively new (see #63700). + // Provide a sensible fallback in this case. + ld.sizes = types.SizesFor("gc", runtime.GOARCH) + if ld.sizes == nil { // gccgo-only arch + ld.sizes = types.SizesFor("gc", "amd64") + } + } else { + // Go list should never fail to deliver accurate size information. + // Reject the whole Load since the error is the same for every package. + return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", + response.Compiler, response.Arch) + } + } + + return ld.refine(response) +} + +// defaultDriver is a driver that implements go/packages' fallback behavior. +// It will try to request to an external driver, if one exists. If there's +// no external driver, or the driver returns a response with NotHandled set, +// defaultDriver will fall back to the go list driver. +// The boolean result indicates that an external driver handled the request. +func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, bool, error) { + if driver := findExternalDriver(cfg); driver != nil { + response, err := driver(cfg, patterns...) + if err != nil { + return nil, false, err + } else if !response.NotHandled { + return response, true, nil + } + // (fall through) + } + + response, err := goListDriver(cfg, patterns...) + return response, false, err +} + +// A Package describes a loaded Go package. +type Package struct { + // ID is a unique identifier for a package, + // in a syntax provided by the underlying build system. + // + // Because the syntax varies based on the build system, + // clients should treat IDs as opaque and not attempt to + // interpret them. + ID string + + // Name is the package name as it appears in the package source code. + Name string + + // PkgPath is the package path as used by the go/types package. + PkgPath string + + // Errors contains any errors encountered querying the metadata + // of the package, or while parsing or type-checking its files. + Errors []Error + + // TypeErrors contains the subset of errors produced during type checking. + TypeErrors []types.Error + + // GoFiles lists the absolute file paths of the package's Go source files. + // It may include files that should not be compiled, for example because + // they contain non-matching build tags, are documentary pseudo-files such as + // unsafe/unsafe.go or builtin/builtin.go, or are subject to cgo preprocessing. + GoFiles []string + + // CompiledGoFiles lists the absolute file paths of the package's source + // files that are suitable for type checking. + // This may differ from GoFiles if files are processed before compilation. + CompiledGoFiles []string + + // OtherFiles lists the absolute file paths of the package's non-Go source files, + // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. + OtherFiles []string + + // EmbedFiles lists the absolute file paths of the package's files + // embedded with go:embed. + EmbedFiles []string + + // EmbedPatterns lists the absolute file patterns of the package's + // files embedded with go:embed. + EmbedPatterns []string + + // IgnoredFiles lists source files that are not part of the package + // using the current build configuration but that might be part of + // the package using other build configurations. + IgnoredFiles []string + + // ExportFile is the absolute path to a file containing type + // information for the package as provided by the build system. + ExportFile string + + // Imports maps import paths appearing in the package's Go source files + // to corresponding loaded Packages. + Imports map[string]*Package + + // Types provides type information for the package. + // The NeedTypes LoadMode bit sets this field for packages matching the + // patterns; type information for dependencies may be missing or incomplete, + // unless NeedDeps and NeedImports are also set. + Types *types.Package + + // Fset provides position information for Types, TypesInfo, and Syntax. + // It is set only when Types is set. + Fset *token.FileSet + + // IllTyped indicates whether the package or any dependency contains errors. + // It is set only when Types is set. + IllTyped bool + + // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. + // + // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. + // If NeedDeps and NeedImports are also set, this field will also be populated + // for dependencies. + // + // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are + // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles. + Syntax []*ast.File + + // TypesInfo provides type information about the package's syntax trees. + // It is set only when Syntax is set. + TypesInfo *types.Info + + // TypesSizes provides the effective size function for types in TypesInfo. + TypesSizes types.Sizes + + // forTest is the package under test, if any. + forTest string + + // depsErrors is the DepsErrors field from the go list response, if any. + depsErrors []*packagesinternal.PackageError + + // module is the module information for the package if it exists. + Module *Module +} + +// Module provides module information for a package. +type Module struct { + Path string // module path + Version string // module version + Replace *Module // replaced by this module + Time *time.Time // time version was created + Main bool // is this the main module? + Indirect bool // is this module only an indirect dependency of main module? + Dir string // directory holding files for this module, if any + GoMod string // path to go.mod file used when loading this module, if any + GoVersion string // go version used in module + Error *ModuleError // error loading module +} + +// ModuleError holds errors loading a module. +type ModuleError struct { + Err string // the error itself +} + +func init() { + packagesinternal.GetForTest = func(p interface{}) string { + return p.(*Package).forTest + } + packagesinternal.GetDepsErrors = func(p interface{}) []*packagesinternal.PackageError { + return p.(*Package).depsErrors + } + packagesinternal.SetModFile = func(config interface{}, value string) { + config.(*Config).modFile = value + } + packagesinternal.SetModFlag = func(config interface{}, value string) { + config.(*Config).modFlag = value + } + packagesinternal.TypecheckCgo = int(typecheckCgo) + packagesinternal.DepsErrors = int(needInternalDepsErrors) + packagesinternal.ForTest = int(needInternalForTest) +} + +// An Error describes a problem with a package's metadata, syntax, or types. +type Error struct { + Pos string // "file:line:col" or "file:line" or "" or "-" + Msg string + Kind ErrorKind +} + +// ErrorKind describes the source of the error, allowing the user to +// differentiate between errors generated by the driver, the parser, or the +// type-checker. +type ErrorKind int + +const ( + UnknownError ErrorKind = iota + ListError + ParseError + TypeError +) + +func (err Error) Error() string { + pos := err.Pos + if pos == "" { + pos = "-" // like token.Position{}.String() + } + return pos + ": " + err.Msg +} + +// flatPackage is the JSON form of Package +// It drops all the type and syntax fields, and transforms the Imports +// +// TODO(adonovan): identify this struct with Package, effectively +// publishing the JSON protocol. +type flatPackage struct { + ID string + Name string `json:",omitempty"` + PkgPath string `json:",omitempty"` + Errors []Error `json:",omitempty"` + GoFiles []string `json:",omitempty"` + CompiledGoFiles []string `json:",omitempty"` + OtherFiles []string `json:",omitempty"` + EmbedFiles []string `json:",omitempty"` + EmbedPatterns []string `json:",omitempty"` + IgnoredFiles []string `json:",omitempty"` + ExportFile string `json:",omitempty"` + Imports map[string]string `json:",omitempty"` +} + +// MarshalJSON returns the Package in its JSON form. +// For the most part, the structure fields are written out unmodified, and +// the type and syntax fields are skipped. +// The imports are written out as just a map of path to package id. +// The errors are written using a custom type that tries to preserve the +// structure of error types we know about. +// +// This method exists to enable support for additional build systems. It is +// not intended for use by clients of the API and we may change the format. +func (p *Package) MarshalJSON() ([]byte, error) { + flat := &flatPackage{ + ID: p.ID, + Name: p.Name, + PkgPath: p.PkgPath, + Errors: p.Errors, + GoFiles: p.GoFiles, + CompiledGoFiles: p.CompiledGoFiles, + OtherFiles: p.OtherFiles, + EmbedFiles: p.EmbedFiles, + EmbedPatterns: p.EmbedPatterns, + IgnoredFiles: p.IgnoredFiles, + ExportFile: p.ExportFile, + } + if len(p.Imports) > 0 { + flat.Imports = make(map[string]string, len(p.Imports)) + for path, ipkg := range p.Imports { + flat.Imports[path] = ipkg.ID + } + } + return json.Marshal(flat) +} + +// UnmarshalJSON reads in a Package from its JSON format. +// See MarshalJSON for details about the format accepted. +func (p *Package) UnmarshalJSON(b []byte) error { + flat := &flatPackage{} + if err := json.Unmarshal(b, &flat); err != nil { + return err + } + *p = Package{ + ID: flat.ID, + Name: flat.Name, + PkgPath: flat.PkgPath, + Errors: flat.Errors, + GoFiles: flat.GoFiles, + CompiledGoFiles: flat.CompiledGoFiles, + OtherFiles: flat.OtherFiles, + EmbedFiles: flat.EmbedFiles, + EmbedPatterns: flat.EmbedPatterns, + ExportFile: flat.ExportFile, + } + if len(flat.Imports) > 0 { + p.Imports = make(map[string]*Package, len(flat.Imports)) + for path, id := range flat.Imports { + p.Imports[path] = &Package{ID: id} + } + } + return nil +} + +func (p *Package) String() string { return p.ID } + +// loaderPackage augments Package with state used during the loading phase +type loaderPackage struct { + *Package + importErrors map[string]error // maps each bad import to its error + loadOnce sync.Once + color uint8 // for cycle detection + needsrc bool // load from source (Mode >= LoadTypes) + needtypes bool // type information is either requested or depended on + initial bool // package was matched by a pattern + goVersion int // minor version number of go command on PATH +} + +// loader holds the working state of a single call to load. +type loader struct { + pkgs map[string]*loaderPackage + Config + sizes types.Sizes // non-nil if needed by mode + parseCache map[string]*parseValue + parseCacheMu sync.Mutex + exportMu sync.Mutex // enforces mutual exclusion of exportdata operations + + // Config.Mode contains the implied mode (see impliedLoadMode). + // Implied mode contains all the fields we need the data for. + // In requestedMode there are the actually requested fields. + // We'll zero them out before returning packages to the user. + // This makes it easier for us to get the conditions where + // we need certain modes right. + requestedMode LoadMode +} + +type parseValue struct { + f *ast.File + err error + ready chan struct{} +} + +func newLoader(cfg *Config) *loader { + ld := &loader{ + parseCache: map[string]*parseValue{}, + } + if cfg != nil { + ld.Config = *cfg + // If the user has provided a logger, use it. + ld.Config.Logf = cfg.Logf + } + if ld.Config.Logf == nil { + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the user has not provided a logger, default to log.Printf. + if debug { + ld.Config.Logf = log.Printf + } else { + ld.Config.Logf = func(format string, args ...interface{}) {} + } + } + if ld.Config.Mode == 0 { + ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. + } + if ld.Config.Env == nil { + ld.Config.Env = os.Environ() + } + if ld.Config.gocmdRunner == nil { + ld.Config.gocmdRunner = &gocommand.Runner{} + } + if ld.Context == nil { + ld.Context = context.Background() + } + if ld.Dir == "" { + if dir, err := os.Getwd(); err == nil { + ld.Dir = dir + } + } + + // Save the actually requested fields. We'll zero them out before returning packages to the user. + ld.requestedMode = ld.Mode + ld.Mode = impliedLoadMode(ld.Mode) + + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + if ld.Fset == nil { + ld.Fset = token.NewFileSet() + } + + // ParseFile is required even in LoadTypes mode + // because we load source if export data is missing. + if ld.ParseFile == nil { + ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { + const mode = parser.AllErrors | parser.ParseComments + return parser.ParseFile(fset, filename, src, mode) + } + } + } + + return ld +} + +// refine connects the supplied packages into a graph and then adds type +// and syntax information as requested by the LoadMode. +func (ld *loader) refine(response *driverResponse) ([]*Package, error) { + roots := response.Roots + rootMap := make(map[string]int, len(roots)) + for i, root := range roots { + rootMap[root] = i + } + ld.pkgs = make(map[string]*loaderPackage) + // first pass, fixup and build the map and roots + var initial = make([]*loaderPackage, len(roots)) + for _, pkg := range response.Packages { + rootIndex := -1 + if i, found := rootMap[pkg.ID]; found { + rootIndex = i + } + + // Overlays can invalidate export data. + // TODO(matloob): make this check fine-grained based on dependencies on overlaid files + exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" + // This package needs type information if the caller requested types and the package is + // either a root, or it's a non-root and the user requested dependencies ... + needtypes := (ld.Mode&NeedTypes|NeedTypesInfo != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) + // This package needs source if the call requested source (or types info, which implies source) + // and the package is either a root, or itas a non- root and the user requested dependencies... + needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || + // ... or if we need types and the exportData is invalid. We fall back to (incompletely) + // typechecking packages from source if they fail to compile. + (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" + lpkg := &loaderPackage{ + Package: pkg, + needtypes: needtypes, + needsrc: needsrc, + goVersion: response.GoVersion, + } + ld.pkgs[lpkg.ID] = lpkg + if rootIndex >= 0 { + initial[rootIndex] = lpkg + lpkg.initial = true + } + } + for i, root := range roots { + if initial[i] == nil { + return nil, fmt.Errorf("root package %v is missing", root) + } + } + + if ld.Mode&NeedImports != 0 { + // Materialize the import graph. + + const ( + white = 0 // new + grey = 1 // in progress + black = 2 // complete + ) + + // visit traverses the import graph, depth-first, + // and materializes the graph as Packages.Imports. + // + // Valid imports are saved in the Packages.Import map. + // Invalid imports (cycles and missing nodes) are saved in the importErrors map. + // Thus, even in the presence of both kinds of errors, + // the Import graph remains a DAG. + // + // visit returns whether the package needs src or has a transitive + // dependency on a package that does. These are the only packages + // for which we load source code. + var stack []*loaderPackage + var visit func(lpkg *loaderPackage) bool + visit = func(lpkg *loaderPackage) bool { + switch lpkg.color { + case black: + return lpkg.needsrc + case grey: + panic("internal error: grey node") + } + lpkg.color = grey + stack = append(stack, lpkg) // push + stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports + lpkg.Imports = make(map[string]*Package, len(stubs)) + for importPath, ipkg := range stubs { + var importErr error + imp := ld.pkgs[ipkg.ID] + if imp == nil { + // (includes package "C" when DisableCgo) + importErr = fmt.Errorf("missing package: %q", ipkg.ID) + } else if imp.color == grey { + importErr = fmt.Errorf("import cycle: %s", stack) + } + if importErr != nil { + if lpkg.importErrors == nil { + lpkg.importErrors = make(map[string]error) + } + lpkg.importErrors[importPath] = importErr + continue + } + + if visit(imp) { + lpkg.needsrc = true + } + lpkg.Imports[importPath] = imp.Package + } + + // Complete type information is required for the + // immediate dependencies of each source package. + if lpkg.needsrc && ld.Mode&NeedTypes != 0 { + for _, ipkg := range lpkg.Imports { + ld.pkgs[ipkg.ID].needtypes = true + } + } + + // NeedTypeSizes causes TypeSizes to be set even + // on packages for which types aren't needed. + if ld.Mode&NeedTypesSizes != 0 { + lpkg.TypesSizes = ld.sizes + } + stack = stack[:len(stack)-1] // pop + lpkg.color = black + + return lpkg.needsrc + } + + // For each initial package, create its import DAG. + for _, lpkg := range initial { + visit(lpkg) + } + + } else { + // !NeedImports: drop the stub (ID-only) import packages + // that we are not even going to try to resolve. + for _, lpkg := range initial { + lpkg.Imports = nil + } + } + + // Load type data and syntax if needed, starting at + // the initial packages (roots of the import DAG). + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + var wg sync.WaitGroup + for _, lpkg := range initial { + wg.Add(1) + go func(lpkg *loaderPackage) { + ld.loadRecursive(lpkg) + wg.Done() + }(lpkg) + } + wg.Wait() + } + + result := make([]*Package, len(initial)) + for i, lpkg := range initial { + result[i] = lpkg.Package + } + for i := range ld.pkgs { + // Clear all unrequested fields, + // to catch programs that use more than they request. + if ld.requestedMode&NeedName == 0 { + ld.pkgs[i].Name = "" + ld.pkgs[i].PkgPath = "" + } + if ld.requestedMode&NeedFiles == 0 { + ld.pkgs[i].GoFiles = nil + ld.pkgs[i].OtherFiles = nil + ld.pkgs[i].IgnoredFiles = nil + } + if ld.requestedMode&NeedEmbedFiles == 0 { + ld.pkgs[i].EmbedFiles = nil + } + if ld.requestedMode&NeedEmbedPatterns == 0 { + ld.pkgs[i].EmbedPatterns = nil + } + if ld.requestedMode&NeedCompiledGoFiles == 0 { + ld.pkgs[i].CompiledGoFiles = nil + } + if ld.requestedMode&NeedImports == 0 { + ld.pkgs[i].Imports = nil + } + if ld.requestedMode&NeedExportFile == 0 { + ld.pkgs[i].ExportFile = "" + } + if ld.requestedMode&NeedTypes == 0 { + ld.pkgs[i].Types = nil + ld.pkgs[i].Fset = nil + ld.pkgs[i].IllTyped = false + } + if ld.requestedMode&NeedSyntax == 0 { + ld.pkgs[i].Syntax = nil + } + if ld.requestedMode&NeedTypesInfo == 0 { + ld.pkgs[i].TypesInfo = nil + } + if ld.requestedMode&NeedTypesSizes == 0 { + ld.pkgs[i].TypesSizes = nil + } + if ld.requestedMode&NeedModule == 0 { + ld.pkgs[i].Module = nil + } + } + + return result, nil +} + +// loadRecursive loads the specified package and its dependencies, +// recursively, in parallel, in topological order. +// It is atomic and idempotent. +// Precondition: ld.Mode&NeedTypes. +func (ld *loader) loadRecursive(lpkg *loaderPackage) { + lpkg.loadOnce.Do(func() { + // Load the direct dependencies, in parallel. + var wg sync.WaitGroup + for _, ipkg := range lpkg.Imports { + imp := ld.pkgs[ipkg.ID] + wg.Add(1) + go func(imp *loaderPackage) { + ld.loadRecursive(imp) + wg.Done() + }(imp) + } + wg.Wait() + ld.loadPackage(lpkg) + }) +} + +// loadPackage loads the specified package. +// It must be called only once per Package, +// after immediate dependencies are loaded. +// Precondition: ld.Mode & NeedTypes. +func (ld *loader) loadPackage(lpkg *loaderPackage) { + if lpkg.PkgPath == "unsafe" { + // Fill in the blanks to avoid surprises. + lpkg.Types = types.Unsafe + lpkg.Fset = ld.Fset + lpkg.Syntax = []*ast.File{} + lpkg.TypesInfo = new(types.Info) + lpkg.TypesSizes = ld.sizes + return + } + + // Call NewPackage directly with explicit name. + // This avoids skew between golist and go/types when the files' + // package declarations are inconsistent. + lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) + lpkg.Fset = ld.Fset + + // Subtle: we populate all Types fields with an empty Package + // before loading export data so that export data processing + // never has to create a types.Package for an indirect dependency, + // which would then require that such created packages be explicitly + // inserted back into the Import graph as a final step after export data loading. + // (Hence this return is after the Types assignment.) + // The Diamond test exercises this case. + if !lpkg.needtypes && !lpkg.needsrc { + return + } + if !lpkg.needsrc { + if err := ld.loadFromExportData(lpkg); err != nil { + lpkg.Errors = append(lpkg.Errors, Error{ + Pos: "-", + Msg: err.Error(), + Kind: UnknownError, // e.g. can't find/open/parse export data + }) + } + return // not a source package, don't get syntax trees + } + + appendError := func(err error) { + // Convert various error types into the one true Error. + var errs []Error + switch err := err.(type) { + case Error: + // from driver + errs = append(errs, err) + + case *os.PathError: + // from parser + errs = append(errs, Error{ + Pos: err.Path + ":1", + Msg: err.Err.Error(), + Kind: ParseError, + }) + + case scanner.ErrorList: + // from parser + for _, err := range err { + errs = append(errs, Error{ + Pos: err.Pos.String(), + Msg: err.Msg, + Kind: ParseError, + }) + } + + case types.Error: + // from type checker + lpkg.TypeErrors = append(lpkg.TypeErrors, err) + errs = append(errs, Error{ + Pos: err.Fset.Position(err.Pos).String(), + Msg: err.Msg, + Kind: TypeError, + }) + + default: + // unexpected impoverished error from parser? + errs = append(errs, Error{ + Pos: "-", + Msg: err.Error(), + Kind: UnknownError, + }) + + // If you see this error message, please file a bug. + log.Printf("internal error: error %q (%T) without position", err, err) + } + + lpkg.Errors = append(lpkg.Errors, errs...) + } + + // If the go command on the PATH is newer than the runtime, + // then the go/{scanner,ast,parser,types} packages from the + // standard library may be unable to process the files + // selected by go list. + // + // There is currently no way to downgrade the effective + // version of the go command (see issue 52078), so we proceed + // with the newer go command but, in case of parse or type + // errors, we emit an additional diagnostic. + // + // See: + // - golang.org/issue/52078 (flag to set release tags) + // - golang.org/issue/50825 (gopls legacy version support) + // - golang.org/issue/55883 (go/packages confusing error) + // + // Should we assert a hard minimum of (currently) go1.16 here? + var runtimeVersion int + if _, err := fmt.Sscanf(runtime.Version(), "go1.%d", &runtimeVersion); err == nil && runtimeVersion < lpkg.goVersion { + defer func() { + if len(lpkg.Errors) > 0 { + appendError(Error{ + Pos: "-", + Msg: fmt.Sprintf("This application uses version go1.%d of the source-processing packages but runs version go1.%d of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.", runtimeVersion, lpkg.goVersion), + Kind: UnknownError, + }) + } + }() + } + + if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { + // The config requested loading sources and types, but sources are missing. + // Add an error to the package and fall back to loading from export data. + appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) + _ = ld.loadFromExportData(lpkg) // ignore any secondary errors + + return // can't get syntax trees for this package + } + + files, errs := ld.parseFiles(lpkg.CompiledGoFiles) + for _, err := range errs { + appendError(err) + } + + lpkg.Syntax = files + if ld.Config.Mode&NeedTypes == 0 { + return + } + + lpkg.TypesInfo = &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), + Defs: make(map[*ast.Ident]types.Object), + Uses: make(map[*ast.Ident]types.Object), + Implicits: make(map[ast.Node]types.Object), + Instances: make(map[*ast.Ident]types.Instance), + Scopes: make(map[ast.Node]*types.Scope), + Selections: make(map[*ast.SelectorExpr]*types.Selection), + } + versions.InitFileVersions(lpkg.TypesInfo) + lpkg.TypesSizes = ld.sizes + + importer := importerFunc(func(path string) (*types.Package, error) { + if path == "unsafe" { + return types.Unsafe, nil + } + + // The imports map is keyed by import path. + ipkg := lpkg.Imports[path] + if ipkg == nil { + if err := lpkg.importErrors[path]; err != nil { + return nil, err + } + // There was skew between the metadata and the + // import declarations, likely due to an edit + // race, or because the ParseFile feature was + // used to supply alternative file contents. + return nil, fmt.Errorf("no metadata for %s", path) + } + + if ipkg.Types != nil && ipkg.Types.Complete() { + return ipkg.Types, nil + } + log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg) + panic("unreachable") + }) + + // type-check + tc := &types.Config{ + Importer: importer, + + // Type-check bodies of functions only in initial packages. + // Example: for import graph A->B->C and initial packages {A,C}, + // we can ignore function bodies in B. + IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, + + Error: appendError, + Sizes: ld.sizes, // may be nil + } + if lpkg.Module != nil && lpkg.Module.GoVersion != "" { + typesinternal.SetGoVersion(tc, "go"+lpkg.Module.GoVersion) + } + if (ld.Mode & typecheckCgo) != 0 { + if !typesinternal.SetUsesCgo(tc) { + appendError(Error{ + Msg: "typecheckCgo requires Go 1.15+", + Kind: ListError, + }) + return + } + } + types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) + + lpkg.importErrors = nil // no longer needed + + // If !Cgo, the type-checker uses FakeImportC mode, so + // it doesn't invoke the importer for import "C", + // nor report an error for the import, + // or for any undefined C.f reference. + // We must detect this explicitly and correctly + // mark the package as IllTyped (by reporting an error). + // TODO(adonovan): if these errors are annoying, + // we could just set IllTyped quietly. + if tc.FakeImportC { + outer: + for _, f := range lpkg.Syntax { + for _, imp := range f.Imports { + if imp.Path.Value == `"C"` { + err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} + appendError(err) + break outer + } + } + } + } + + // Record accumulated errors. + illTyped := len(lpkg.Errors) > 0 + if !illTyped { + for _, imp := range lpkg.Imports { + if imp.IllTyped { + illTyped = true + break + } + } + } + lpkg.IllTyped = illTyped +} + +// An importFunc is an implementation of the single-method +// types.Importer interface based on a function value. +type importerFunc func(path string) (*types.Package, error) + +func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } + +// We use a counting semaphore to limit +// the number of parallel I/O calls per process. +var ioLimit = make(chan bool, 20) + +func (ld *loader) parseFile(filename string) (*ast.File, error) { + ld.parseCacheMu.Lock() + v, ok := ld.parseCache[filename] + if ok { + // cache hit + ld.parseCacheMu.Unlock() + <-v.ready + } else { + // cache miss + v = &parseValue{ready: make(chan struct{})} + ld.parseCache[filename] = v + ld.parseCacheMu.Unlock() + + var src []byte + for f, contents := range ld.Config.Overlay { + if sameFile(f, filename) { + src = contents + } + } + var err error + if src == nil { + ioLimit <- true // wait + src, err = os.ReadFile(filename) + <-ioLimit // signal + } + if err != nil { + v.err = err + } else { + v.f, v.err = ld.ParseFile(ld.Fset, filename, src) + } + + close(v.ready) + } + return v.f, v.err +} + +// parseFiles reads and parses the Go source files and returns the ASTs +// of the ones that could be at least partially parsed, along with a +// list of I/O and parse errors encountered. +// +// Because files are scanned in parallel, the token.Pos +// positions of the resulting ast.Files are not ordered. +func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { + var wg sync.WaitGroup + n := len(filenames) + parsed := make([]*ast.File, n) + errors := make([]error, n) + for i, file := range filenames { + if ld.Config.Context.Err() != nil { + parsed[i] = nil + errors[i] = ld.Config.Context.Err() + continue + } + wg.Add(1) + go func(i int, filename string) { + parsed[i], errors[i] = ld.parseFile(filename) + wg.Done() + }(i, file) + } + wg.Wait() + + // Eliminate nils, preserving order. + var o int + for _, f := range parsed { + if f != nil { + parsed[o] = f + o++ + } + } + parsed = parsed[:o] + + o = 0 + for _, err := range errors { + if err != nil { + errors[o] = err + o++ + } + } + errors = errors[:o] + + return parsed, errors +} + +// sameFile returns true if x and y have the same basename and denote +// the same file. +func sameFile(x, y string) bool { + if x == y { + // It could be the case that y doesn't exist. + // For instance, it may be an overlay file that + // hasn't been written to disk. To handle that case + // let x == y through. (We added the exact absolute path + // string to the CompiledGoFiles list, so the unwritten + // overlay case implies x==y.) + return true + } + if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) + if xi, err := os.Stat(x); err == nil { + if yi, err := os.Stat(y); err == nil { + return os.SameFile(xi, yi) + } + } + } + return false +} + +// loadFromExportData ensures that type information is present for the specified +// package, loading it from an export data file on the first request. +// On success it sets lpkg.Types to a new Package. +func (ld *loader) loadFromExportData(lpkg *loaderPackage) error { + if lpkg.PkgPath == "" { + log.Fatalf("internal error: Package %s has no PkgPath", lpkg) + } + + // Because gcexportdata.Read has the potential to create or + // modify the types.Package for each node in the transitive + // closure of dependencies of lpkg, all exportdata operations + // must be sequential. (Finer-grained locking would require + // changes to the gcexportdata API.) + // + // The exportMu lock guards the lpkg.Types field and the + // types.Package it points to, for each loaderPackage in the graph. + // + // Not all accesses to Package.Pkg need to be protected by exportMu: + // graph ordering ensures that direct dependencies of source + // packages are fully loaded before the importer reads their Pkg field. + ld.exportMu.Lock() + defer ld.exportMu.Unlock() + + if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { + return nil // cache hit + } + + lpkg.IllTyped = true // fail safe + + if lpkg.ExportFile == "" { + // Errors while building export data will have been printed to stderr. + return fmt.Errorf("no export data file") + } + f, err := os.Open(lpkg.ExportFile) + if err != nil { + return err + } + defer f.Close() + + // Read gc export data. + // + // We don't currently support gccgo export data because all + // underlying workspaces use the gc toolchain. (Even build + // systems that support gccgo don't use it for workspace + // queries.) + r, err := gcexportdata.NewReader(f) + if err != nil { + return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + + // Build the view. + // + // The gcexportdata machinery has no concept of package ID. + // It identifies packages by their PkgPath, which although not + // globally unique is unique within the scope of one invocation + // of the linker, type-checker, or gcexportdata. + // + // So, we must build a PkgPath-keyed view of the global + // (conceptually ID-keyed) cache of packages and pass it to + // gcexportdata. The view must contain every existing + // package that might possibly be mentioned by the + // current package---its transitive closure. + // + // In loadPackage, we unconditionally create a types.Package for + // each dependency so that export data loading does not + // create new ones. + // + // TODO(adonovan): it would be simpler and more efficient + // if the export data machinery invoked a callback to + // get-or-create a package instead of a map. + // + view := make(map[string]*types.Package) // view seen by gcexportdata + seen := make(map[*loaderPackage]bool) // all visited packages + var visit func(pkgs map[string]*Package) + visit = func(pkgs map[string]*Package) { + for _, p := range pkgs { + lpkg := ld.pkgs[p.ID] + if !seen[lpkg] { + seen[lpkg] = true + view[lpkg.PkgPath] = lpkg.Types + visit(lpkg.Imports) + } + } + } + visit(lpkg.Imports) + + viewLen := len(view) + 1 // adding the self package + // Parse the export data. + // (May modify incomplete packages in view but not create new ones.) + tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) + if err != nil { + return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + if _, ok := view["go.shape"]; ok { + // Account for the pseudopackage "go.shape" that gets + // created by generic code. + viewLen++ + } + if viewLen != len(view) { + log.Panicf("golang.org/x/tools/go/packages: unexpected new packages during load of %s", lpkg.PkgPath) + } + + lpkg.Types = tpkg + lpkg.IllTyped = false + return nil +} + +// impliedLoadMode returns loadMode with its dependencies. +func impliedLoadMode(loadMode LoadMode) LoadMode { + if loadMode&(NeedDeps|NeedTypes|NeedTypesInfo) != 0 { + // All these things require knowing the import graph. + loadMode |= NeedImports + } + + return loadMode +} + +func usesExportData(cfg *Config) bool { + return cfg.Mode&NeedExportFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 +} + +var _ interface{} = io.Discard // assert build toolchain is go1.16 or later diff --git a/upstream/vendor/golang.org/x/tools/go/packages/visit.go b/upstream/vendor/golang.org/x/tools/go/packages/visit.go new file mode 100644 index 00000000000..a1dcc40b727 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/packages/visit.go @@ -0,0 +1,59 @@ +// 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. + +package packages + +import ( + "fmt" + "os" + "sort" +) + +// Visit visits all the packages in the import graph whose roots are +// pkgs, calling the optional pre function the first time each package +// is encountered (preorder), and the optional post function after a +// package's dependencies have been visited (postorder). +// The boolean result of pre(pkg) determines whether +// the imports of package pkg are visited. +func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { + seen := make(map[*Package]bool) + var visit func(*Package) + visit = func(pkg *Package) { + if !seen[pkg] { + seen[pkg] = true + + if pre == nil || pre(pkg) { + paths := make([]string, 0, len(pkg.Imports)) + for path := range pkg.Imports { + paths = append(paths, path) + } + sort.Strings(paths) // Imports is a map, this makes visit stable + for _, path := range paths { + visit(pkg.Imports[path]) + } + } + + if post != nil { + post(pkg) + } + } + } + for _, pkg := range pkgs { + visit(pkg) + } +} + +// PrintErrors prints to os.Stderr the accumulated errors of all +// packages in the import graph rooted at pkgs, dependencies first. +// PrintErrors returns the number of errors printed. +func PrintErrors(pkgs []*Package) int { + var n int + Visit(pkgs, nil, func(pkg *Package) { + for _, err := range pkg.Errors { + fmt.Fprintln(os.Stderr, err) + n++ + } + }) + return n +} diff --git a/upstream/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/upstream/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go new file mode 100644 index 00000000000..11d5c8c3adf --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -0,0 +1,752 @@ +// 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. + +// Package objectpath defines a naming scheme for types.Objects +// (that is, named entities in Go programs) relative to their enclosing +// package. +// +// Type-checker objects are canonical, so they are usually identified by +// their address in memory (a pointer), but a pointer has meaning only +// within one address space. By contrast, objectpath names allow the +// identity of an object to be sent from one program to another, +// establishing a correspondence between types.Object variables that are +// distinct but logically equivalent. +// +// A single object may have multiple paths. In this example, +// +// type A struct{ X int } +// type B A +// +// the field X has two paths due to its membership of both A and B. +// The For(obj) function always returns one of these paths, arbitrarily +// but consistently. +package objectpath + +import ( + "fmt" + "go/types" + "strconv" + "strings" + + "golang.org/x/tools/internal/typeparams" +) + +// A Path is an opaque name that identifies a types.Object +// relative to its package. Conceptually, the name consists of a +// sequence of destructuring operations applied to the package scope +// to obtain the original object. +// The name does not include the package itself. +type Path string + +// Encoding +// +// An object path is a textual and (with training) human-readable encoding +// of a sequence of destructuring operators, starting from a types.Package. +// The sequences represent a path through the package/object/type graph. +// We classify these operators by their type: +// +// PO package->object Package.Scope.Lookup +// OT object->type Object.Type +// TT type->type Type.{Elem,Key,Params,Results,Underlying} [EKPRU] +// TO type->object Type.{At,Field,Method,Obj} [AFMO] +// +// All valid paths start with a package and end at an object +// and thus may be defined by the regular language: +// +// objectpath = PO (OT TT* TO)* +// +// The concrete encoding follows directly: +// - The only PO operator is Package.Scope.Lookup, which requires an identifier. +// - The only OT operator is Object.Type, +// which we encode as '.' because dot cannot appear in an identifier. +// - The TT operators are encoded as [EKPRUTC]; +// one of these (TypeParam) requires an integer operand, +// which is encoded as a string of decimal digits. +// - The TO operators are encoded as [AFMO]; +// three of these (At,Field,Method) require an integer operand, +// which is encoded as a string of decimal digits. +// These indices are stable across different representations +// of the same package, even source and export data. +// The indices used are implementation specific and may not correspond to +// the argument to the go/types function. +// +// In the example below, +// +// package p +// +// type T interface { +// f() (a string, b struct{ X int }) +// } +// +// field X has the path "T.UM0.RA1.F0", +// representing the following sequence of operations: +// +// p.Lookup("T") T +// .Type().Underlying().Method(0). f +// .Type().Results().At(1) b +// .Type().Field(0) X +// +// The encoding is not maximally compact---every R or P is +// followed by an A, for example---but this simplifies the +// encoder and decoder. +const ( + // object->type operators + opType = '.' // .Type() (Object) + + // type->type operators + opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) + opKey = 'K' // .Key() (Map) + opParams = 'P' // .Params() (Signature) + opResults = 'R' // .Results() (Signature) + opUnderlying = 'U' // .Underlying() (Named) + opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) + opConstraint = 'C' // .Constraint() (TypeParam) + + // type->object operators + opAt = 'A' // .At(i) (Tuple) + opField = 'F' // .Field(i) (Struct) + opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) + opObj = 'O' // .Obj() (Named, TypeParam) +) + +// For is equivalent to new(Encoder).For(obj). +// +// It may be more efficient to reuse a single Encoder across several calls. +func For(obj types.Object) (Path, error) { + return new(Encoder).For(obj) +} + +// An Encoder amortizes the cost of encoding the paths of multiple objects. +// The zero value of an Encoder is ready to use. +type Encoder struct { + scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects +} + +// For returns the path to an object relative to its package, +// or an error if the object is not accessible from the package's Scope. +// +// The For function guarantees to return a path only for the following objects: +// - package-level types +// - exported package-level non-types +// - methods +// - parameter and result variables +// - struct fields +// These objects are sufficient to define the API of their package. +// The objects described by a package's export data are drawn from this set. +// +// The set of objects accessible from a package's Scope depends on +// whether the package was produced by type-checking syntax, or +// reading export data; the latter may have a smaller Scope since +// export data trims objects that are not reachable from an exported +// declaration. For example, the For function will return a path for +// an exported method of an unexported type that is not reachable +// from any public declaration; this path will cause the Object +// function to fail if called on a package loaded from export data. +// TODO(adonovan): is this a bug or feature? Should this package +// compute accessibility in the same way? +// +// For does not return a path for predeclared names, imported package +// names, local names, and unexported package-level names (except +// types). +// +// Example: given this definition, +// +// package p +// +// type T interface { +// f() (a string, b struct{ X int }) +// } +// +// For(X) would return a path that denotes the following sequence of operations: +// +// p.Scope().Lookup("T") (TypeName T) +// .Type().Underlying().Method(0). (method Func f) +// .Type().Results().At(1) (field Var b) +// .Type().Field(0) (field Var X) +// +// where p is the package (*types.Package) to which X belongs. +func (enc *Encoder) For(obj types.Object) (Path, error) { + pkg := obj.Pkg() + + // This table lists the cases of interest. + // + // Object Action + // ------ ------ + // nil reject + // builtin reject + // pkgname reject + // label reject + // var + // package-level accept + // func param/result accept + // local reject + // struct field accept + // const + // package-level accept + // local reject + // func + // package-level accept + // init functions reject + // concrete method accept + // interface method accept + // type + // package-level accept + // local reject + // + // The only accessible package-level objects are members of pkg itself. + // + // The cases are handled in four steps: + // + // 1. reject nil and builtin + // 2. accept package-level objects + // 3. reject obviously invalid objects + // 4. search the API for the path to the param/result/field/method. + + // 1. reference to nil or builtin? + if pkg == nil { + return "", fmt.Errorf("predeclared %s has no path", obj) + } + scope := pkg.Scope() + + // 2. package-level object? + if scope.Lookup(obj.Name()) == obj { + // Only exported objects (and non-exported types) have a path. + // Non-exported types may be referenced by other objects. + if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() { + return "", fmt.Errorf("no path for non-exported %v", obj) + } + return Path(obj.Name()), nil + } + + // 3. Not a package-level object. + // Reject obviously non-viable cases. + switch obj := obj.(type) { + case *types.TypeName: + if _, ok := obj.Type().(*types.TypeParam); !ok { + // With the exception of type parameters, only package-level type names + // have a path. + return "", fmt.Errorf("no path for %v", obj) + } + case *types.Const, // Only package-level constants have a path. + *types.Label, // Labels are function-local. + *types.PkgName: // PkgNames are file-local. + return "", fmt.Errorf("no path for %v", obj) + + case *types.Var: + // Could be: + // - a field (obj.IsField()) + // - a func parameter or result + // - a local var. + // Sadly there is no way to distinguish + // a param/result from a local + // so we must proceed to the find. + + case *types.Func: + // A func, if not package-level, must be a method. + if recv := obj.Type().(*types.Signature).Recv(); recv == nil { + return "", fmt.Errorf("func is not a method: %v", obj) + } + + if path, ok := enc.concreteMethod(obj); ok { + // Fast path for concrete methods that avoids looping over scope. + return path, nil + } + + default: + panic(obj) + } + + // 4. Search the API for the path to the var (field/param/result) or method. + + // First inspect package-level named types. + // In the presence of path aliases, these give + // the best paths because non-types may + // refer to types, but not the reverse. + empty := make([]byte, 0, 48) // initial space + objs := enc.scopeObjects(scope) + for _, o := range objs { + tname, ok := o.(*types.TypeName) + if !ok { + continue // handle non-types in second pass + } + + path := append(empty, o.Name()...) + path = append(path, opType) + + T := o.Type() + + if tname.IsAlias() { + // type alias + if r := find(obj, T, path, nil); r != nil { + return Path(r), nil + } + } else { + if named, _ := T.(*types.Named); named != nil { + if r := findTypeParam(obj, named.TypeParams(), path, nil); r != nil { + // generic named type + return Path(r), nil + } + } + // defined (named) type + if r := find(obj, T.Underlying(), append(path, opUnderlying), nil); r != nil { + return Path(r), nil + } + } + } + + // Then inspect everything else: + // non-types, and declared methods of defined types. + for _, o := range objs { + path := append(empty, o.Name()...) + if _, ok := o.(*types.TypeName); !ok { + if o.Exported() { + // exported non-type (const, var, func) + if r := find(obj, o.Type(), append(path, opType), nil); r != nil { + return Path(r), nil + } + } + continue + } + + // Inspect declared methods of defined types. + if T, ok := o.Type().(*types.Named); ok { + path = append(path, opType) + // The method index here is always with respect + // to the underlying go/types data structures, + // which ultimately derives from source order + // and must be preserved by export data. + for i := 0; i < T.NumMethods(); i++ { + m := T.Method(i) + path2 := appendOpArg(path, opMethod, i) + if m == obj { + return Path(path2), nil // found declared method + } + if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { + return Path(r), nil + } + } + } + } + + return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path()) +} + +func appendOpArg(path []byte, op byte, arg int) []byte { + path = append(path, op) + path = strconv.AppendInt(path, int64(arg), 10) + return path +} + +// concreteMethod returns the path for meth, which must have a non-nil receiver. +// The second return value indicates success and may be false if the method is +// an interface method or if it is an instantiated method. +// +// This function is just an optimization that avoids the general scope walking +// approach. You are expected to fall back to the general approach if this +// function fails. +func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { + // Concrete methods can only be declared on package-scoped named types. For + // that reason we can skip the expensive walk over the package scope: the + // path will always be package -> named type -> method. We can trivially get + // the type name from the receiver, and only have to look over the type's + // methods to find the method index. + // + // Methods on generic types require special consideration, however. Consider + // the following package: + // + // L1: type S[T any] struct{} + // L2: func (recv S[A]) Foo() { recv.Bar() } + // L3: func (recv S[B]) Bar() { } + // L4: type Alias = S[int] + // L5: func _[T any]() { var s S[int]; s.Foo() } + // + // The receivers of methods on generic types are instantiations. L2 and L3 + // instantiate S with the type-parameters A and B, which are scoped to the + // respective methods. L4 and L5 each instantiate S with int. Each of these + // instantiations has its own method set, full of methods (and thus objects) + // with receivers whose types are the respective instantiations. In other + // words, we have + // + // S[A].Foo, S[A].Bar + // S[B].Foo, S[B].Bar + // S[int].Foo, S[int].Bar + // + // We may thus be trying to produce object paths for any of these objects. + // + // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo + // and S.Bar, which are the paths that this function naturally produces. + // + // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that + // don't correspond to the origin methods. For S[int], this is significant. + // The most precise object path for S[int].Foo, for example, is Alias.Foo, + // not S.Foo. Our function, however, would produce S.Foo, which would + // resolve to a different object. + // + // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are + // still the correct paths, since only the origin methods have meaningful + // paths. But this is likely only true for trivial cases and has edge cases. + // Since this function is only an optimization, we err on the side of giving + // up, deferring to the slower but definitely correct algorithm. Most users + // of objectpath will only be giving us origin methods, anyway, as referring + // to instantiated methods is usually not useful. + + if typeparams.OriginMethod(meth) != meth { + return "", false + } + + recvT := meth.Type().(*types.Signature).Recv().Type() + if ptr, ok := recvT.(*types.Pointer); ok { + recvT = ptr.Elem() + } + + named, ok := recvT.(*types.Named) + if !ok { + return "", false + } + + if types.IsInterface(named) { + // Named interfaces don't have to be package-scoped + // + // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface + // methods, too, I think. + return "", false + } + + // Preallocate space for the name, opType, opMethod, and some digits. + name := named.Obj().Name() + path := make([]byte, 0, len(name)+8) + path = append(path, name...) + path = append(path, opType) + + // Method indices are w.r.t. the go/types data structures, + // ultimately deriving from source order, + // which is preserved by export data. + for i := 0; i < named.NumMethods(); i++ { + if named.Method(i) == meth { + path = appendOpArg(path, opMethod, i) + return Path(path), true + } + } + + // Due to golang/go#59944, go/types fails to associate the receiver with + // certain methods on cgo types. + // + // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go + // versions gopls supports. + return "", false + // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named))) +} + +// find finds obj within type T, returning the path to it, or nil if not found. +// +// The seen map is used to short circuit cycles through type parameters. If +// nil, it will be allocated as necessary. +func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName]bool) []byte { + switch T := T.(type) { + case *types.Basic, *types.Named: + // Named types belonging to pkg were handled already, + // so T must belong to another package. No path. + return nil + case *types.Pointer: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Slice: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Array: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Chan: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Map: + if r := find(obj, T.Key(), append(path, opKey), seen); r != nil { + return r + } + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Signature: + if r := findTypeParam(obj, T.TypeParams(), path, seen); r != nil { + return r + } + if r := find(obj, T.Params(), append(path, opParams), seen); r != nil { + return r + } + return find(obj, T.Results(), append(path, opResults), seen) + case *types.Struct: + for i := 0; i < T.NumFields(); i++ { + fld := T.Field(i) + path2 := appendOpArg(path, opField, i) + if fld == obj { + return path2 // found field var + } + if r := find(obj, fld.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.Tuple: + for i := 0; i < T.Len(); i++ { + v := T.At(i) + path2 := appendOpArg(path, opAt, i) + if v == obj { + return path2 // found param/result var + } + if r := find(obj, v.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.Interface: + for i := 0; i < T.NumMethods(); i++ { + m := T.Method(i) + path2 := appendOpArg(path, opMethod, i) + if m == obj { + return path2 // found interface method + } + if r := find(obj, m.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.TypeParam: + name := T.Obj() + if name == obj { + return append(path, opObj) + } + if seen[name] { + return nil + } + if seen == nil { + seen = make(map[*types.TypeName]bool) + } + seen[name] = true + if r := find(obj, T.Constraint(), append(path, opConstraint), seen); r != nil { + return r + } + return nil + } + panic(T) +} + +func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte { + for i := 0; i < list.Len(); i++ { + tparam := list.At(i) + path2 := appendOpArg(path, opTypeParam, i) + if r := find(obj, tparam, path2, seen); r != nil { + return r + } + } + return nil +} + +// Object returns the object denoted by path p within the package pkg. +func Object(pkg *types.Package, p Path) (types.Object, error) { + pathstr := string(p) + if pathstr == "" { + return nil, fmt.Errorf("empty path") + } + + var pkgobj, suffix string + if dot := strings.IndexByte(pathstr, opType); dot < 0 { + pkgobj = pathstr + } else { + pkgobj = pathstr[:dot] + suffix = pathstr[dot:] // suffix starts with "." + } + + obj := pkg.Scope().Lookup(pkgobj) + if obj == nil { + return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) + } + + // abstraction of *types.{Pointer,Slice,Array,Chan,Map} + type hasElem interface { + Elem() types.Type + } + // abstraction of *types.{Named,Signature} + type hasTypeParams interface { + TypeParams() *types.TypeParamList + } + // abstraction of *types.{Named,TypeParam} + type hasObj interface { + Obj() *types.TypeName + } + + // The loop state is the pair (t, obj), + // exactly one of which is non-nil, initially obj. + // All suffixes start with '.' (the only object->type operation), + // followed by optional type->type operations, + // then a type->object operation. + // The cycle then repeats. + var t types.Type + for suffix != "" { + code := suffix[0] + suffix = suffix[1:] + + // Codes [AFM] have an integer operand. + var index int + switch code { + case opAt, opField, opMethod, opTypeParam: + rest := strings.TrimLeft(suffix, "0123456789") + numerals := suffix[:len(suffix)-len(rest)] + suffix = rest + i, err := strconv.Atoi(numerals) + if err != nil { + return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code) + } + index = int(i) + case opObj: + // no operand + default: + // The suffix must end with a type->object operation. + if suffix == "" { + return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code) + } + } + + if code == opType { + if t != nil { + return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType) + } + t = obj.Type() + obj = nil + continue + } + + if t == nil { + return nil, fmt.Errorf("invalid path: code %q in object context", code) + } + + // Inv: t != nil, obj == nil + + switch code { + case opElem: + hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t) + } + t = hasElem.Elem() + + case opKey: + mapType, ok := t.(*types.Map) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t) + } + t = mapType.Key() + + case opParams: + sig, ok := t.(*types.Signature) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + t = sig.Params() + + case opResults: + sig, ok := t.(*types.Signature) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + t = sig.Results() + + case opUnderlying: + named, ok := t.(*types.Named) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t) + } + t = named.Underlying() + + case opTypeParam: + hasTypeParams, ok := t.(hasTypeParams) // Named, Signature + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t) + } + tparams := hasTypeParams.TypeParams() + if n := tparams.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + t = tparams.At(index) + + case opConstraint: + tparam, ok := t.(*types.TypeParam) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) + } + t = tparam.Constraint() + + case opAt: + tuple, ok := t.(*types.Tuple) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t) + } + if n := tuple.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + obj = tuple.At(index) + t = nil + + case opField: + structType, ok := t.(*types.Struct) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t) + } + if n := structType.NumFields(); index >= n { + return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n) + } + obj = structType.Field(index) + t = nil + + case opMethod: + switch t := t.(type) { + case *types.Interface: + if index >= t.NumMethods() { + return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) + } + obj = t.Method(index) // Id-ordered + + case *types.Named: + if index >= t.NumMethods() { + return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) + } + obj = t.Method(index) + + default: + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) + } + t = nil + + case opObj: + hasObj, ok := t.(hasObj) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t) + } + obj = hasObj.Obj() + t = nil + + default: + return nil, fmt.Errorf("invalid path: unknown code %q", code) + } + } + + if obj.Pkg() != pkg { + return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) + } + + return obj, nil // success +} + +// scopeObjects is a memoization of scope objects. +// Callers must not modify the result. +func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object { + m := enc.scopeMemo + if m == nil { + m = make(map[*types.Scope][]types.Object) + enc.scopeMemo = m + } + objs, ok := m[scope] + if !ok { + names := scope.Names() // allocates and sorts + objs = make([]types.Object, len(names)) + for i, name := range names { + objs[i] = scope.Lookup(name) + } + m[scope] = objs + } + return objs +} diff --git a/upstream/vendor/golang.org/x/tools/internal/event/tag/tag.go b/upstream/vendor/golang.org/x/tools/internal/event/tag/tag.go new file mode 100644 index 00000000000..581b26c2041 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/event/tag/tag.go @@ -0,0 +1,59 @@ +// Copyright 2019 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 tag provides the labels used for telemetry throughout gopls. +package tag + +import ( + "golang.org/x/tools/internal/event/keys" +) + +var ( + // create the label keys we use + Method = keys.NewString("method", "") + StatusCode = keys.NewString("status.code", "") + StatusMessage = keys.NewString("status.message", "") + RPCID = keys.NewString("id", "") + RPCDirection = keys.NewString("direction", "") + File = keys.NewString("file", "") + Directory = keys.New("directory", "") + URI = keys.New("URI", "") + Package = keys.NewString("package", "") // sorted comma-separated list of Package IDs + PackagePath = keys.NewString("package_path", "") + Query = keys.New("query", "") + Snapshot = keys.NewUInt64("snapshot", "") + Operation = keys.NewString("operation", "") + + Position = keys.New("position", "") + Category = keys.NewString("category", "") + PackageCount = keys.NewInt("packages", "") + Files = keys.New("files", "") + Port = keys.NewInt("port", "") + Type = keys.New("type", "") + HoverKind = keys.NewString("hoverkind", "") + + NewServer = keys.NewString("new_server", "A new server was added") + EndServer = keys.NewString("end_server", "A server was shut down") + + ServerID = keys.NewString("server", "The server ID an event is related to") + Logfile = keys.NewString("logfile", "") + DebugAddress = keys.NewString("debug_address", "") + GoplsPath = keys.NewString("gopls_path", "") + ClientID = keys.NewString("client_id", "") + + Level = keys.NewInt("level", "The logging level") +) + +var ( + // create the stats we measure + Started = keys.NewInt64("started", "Count of started RPCs.") + ReceivedBytes = keys.NewInt64("received_bytes", "Bytes received.") //, unit.Bytes) + SentBytes = keys.NewInt64("sent_bytes", "Bytes sent.") //, unit.Bytes) + Latency = keys.NewFloat64("latency_ms", "Elapsed time in milliseconds") //, unit.Milliseconds) +) + +const ( + Inbound = "in" + Outbound = "out" +) diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/bimport.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/bimport.go new file mode 100644 index 00000000000..d98b0db2a9a --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/bimport.go @@ -0,0 +1,150 @@ +// 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. + +// This file contains the remaining vestiges of +// $GOROOT/src/go/internal/gcimporter/bimport.go. + +package gcimporter + +import ( + "fmt" + "go/token" + "go/types" + "sync" +) + +func errorf(format string, args ...interface{}) { + panic(fmt.Sprintf(format, args...)) +} + +const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go + +// Synthesize a token.Pos +type fakeFileSet struct { + fset *token.FileSet + files map[string]*fileInfo +} + +type fileInfo struct { + file *token.File + lastline int +} + +const maxlines = 64 * 1024 + +func (s *fakeFileSet) pos(file string, line, column int) token.Pos { + // TODO(mdempsky): Make use of column. + + // Since we don't know the set of needed file positions, we reserve maxlines + // positions per file. We delay calling token.File.SetLines until all + // positions have been calculated (by way of fakeFileSet.setLines), so that + // we can avoid setting unnecessary lines. See also golang/go#46586. + f := s.files[file] + if f == nil { + f = &fileInfo{file: s.fset.AddFile(file, -1, maxlines)} + s.files[file] = f + } + if line > maxlines { + line = 1 + } + if line > f.lastline { + f.lastline = line + } + + // Return a fake position assuming that f.file consists only of newlines. + return token.Pos(f.file.Base() + line - 1) +} + +func (s *fakeFileSet) setLines() { + fakeLinesOnce.Do(func() { + fakeLines = make([]int, maxlines) + for i := range fakeLines { + fakeLines[i] = i + } + }) + for _, f := range s.files { + f.file.SetLines(fakeLines[:f.lastline]) + } +} + +var ( + fakeLines []int + fakeLinesOnce sync.Once +) + +func chanDir(d int) types.ChanDir { + // tag values must match the constants in cmd/compile/internal/gc/go.go + switch d { + case 1 /* Crecv */ : + return types.RecvOnly + case 2 /* Csend */ : + return types.SendOnly + case 3 /* Cboth */ : + return types.SendRecv + default: + errorf("unexpected channel dir %d", d) + return 0 + } +} + +var predeclOnce sync.Once +var predecl []types.Type // initialized lazily + +func predeclared() []types.Type { + predeclOnce.Do(func() { + // initialize lazily to be sure that all + // elements have been initialized before + predecl = []types.Type{ // basic types + types.Typ[types.Bool], + types.Typ[types.Int], + types.Typ[types.Int8], + types.Typ[types.Int16], + types.Typ[types.Int32], + types.Typ[types.Int64], + types.Typ[types.Uint], + types.Typ[types.Uint8], + types.Typ[types.Uint16], + types.Typ[types.Uint32], + types.Typ[types.Uint64], + types.Typ[types.Uintptr], + types.Typ[types.Float32], + types.Typ[types.Float64], + types.Typ[types.Complex64], + types.Typ[types.Complex128], + types.Typ[types.String], + + // basic type aliases + types.Universe.Lookup("byte").Type(), + types.Universe.Lookup("rune").Type(), + + // error + types.Universe.Lookup("error").Type(), + + // untyped types + types.Typ[types.UntypedBool], + types.Typ[types.UntypedInt], + types.Typ[types.UntypedRune], + types.Typ[types.UntypedFloat], + types.Typ[types.UntypedComplex], + types.Typ[types.UntypedString], + types.Typ[types.UntypedNil], + + // package unsafe + types.Typ[types.UnsafePointer], + + // invalid type + types.Typ[types.Invalid], // only appears in packages with errors + + // used internally by gc; never used by this package or in .a files + anyType{}, + } + predecl = append(predecl, additionalPredeclared()...) + }) + return predecl +} + +type anyType struct{} + +func (t anyType) Underlying() types.Type { return t } +func (t anyType) String() string { return "any" } diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go new file mode 100644 index 00000000000..f6437feb1cf --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go @@ -0,0 +1,99 @@ +// Copyright 2011 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. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. + +// This file implements FindExportData. + +package gcimporter + +import ( + "bufio" + "fmt" + "io" + "strconv" + "strings" +) + +func readGopackHeader(r *bufio.Reader) (name string, size int64, err error) { + // See $GOROOT/include/ar.h. + hdr := make([]byte, 16+12+6+6+8+10+2) + _, err = io.ReadFull(r, hdr) + if err != nil { + return + } + // leave for debugging + if false { + fmt.Printf("header: %s", hdr) + } + s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) + length, err := strconv.Atoi(s) + size = int64(length) + if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { + err = fmt.Errorf("invalid archive header") + return + } + name = strings.TrimSpace(string(hdr[:16])) + return +} + +// FindExportData positions the reader r at the beginning of the +// export data section of an underlying GC-created object/archive +// file by reading from it. The reader must be positioned at the +// start of the file before calling this function. The hdr result +// is the string before the export data, either "$$" or "$$B". +// The size result is the length of the export data in bytes, or -1 if not known. +func FindExportData(r *bufio.Reader) (hdr string, size int64, err error) { + // Read first line to make sure this is an object file. + line, err := r.ReadSlice('\n') + if err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + + if string(line) == "!<arch>\n" { + // Archive file. Scan to __.PKGDEF. + var name string + if name, size, err = readGopackHeader(r); err != nil { + return + } + + // First entry should be __.PKGDEF. + if name != "__.PKGDEF" { + err = fmt.Errorf("go archive is missing __.PKGDEF") + return + } + + // Read first line of __.PKGDEF data, so that line + // is once again the first line of the input. + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + size -= int64(len(line)) + } + + // Now at __.PKGDEF in archive or still at beginning of file. + // Either way, line should begin with "go object ". + if !strings.HasPrefix(string(line), "go object ") { + err = fmt.Errorf("not a Go object file") + return + } + + // Skip over object header to export data. + // Begins after first line starting with $$. + for line[0] != '$' { + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + size -= int64(len(line)) + } + hdr = string(line) + if size < 0 { + size = -1 + } + + return +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go new file mode 100644 index 00000000000..2d078ccb19c --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go @@ -0,0 +1,273 @@ +// Copyright 2011 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. + +// This file is a reduced copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go. + +// Package gcimporter provides various functions for reading +// gc-generated object files that can be used to implement the +// Importer interface defined by the Go 1.5 standard library package. +// +// The encoding is deterministic: if the encoder is applied twice to +// the same types.Package data structure, both encodings are equal. +// This property may be important to avoid spurious changes in +// applications such as build systems. +// +// However, the encoder is not necessarily idempotent. Importing an +// exported package may yield a types.Package that, while it +// represents the same set of Go types as the original, may differ in +// the details of its internal representation. Because of these +// differences, re-encoding the imported package may yield a +// different, but equally valid, encoding of the package. +package gcimporter // import "golang.org/x/tools/internal/gcimporter" + +import ( + "bufio" + "bytes" + "fmt" + "go/build" + "go/token" + "go/types" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + "sync" +) + +const ( + // Enable debug during development: it adds some additional checks, and + // prevents errors from being recovered. + debug = false + + // If trace is set, debugging output is printed to std out. + trace = false +) + +var exportMap sync.Map // package dir → func() (string, bool) + +// lookupGorootExport returns the location of the export data +// (normally found in the build cache, but located in GOROOT/pkg +// in prior Go releases) for the package located in pkgDir. +// +// (We use the package's directory instead of its import path +// mainly to simplify handling of the packages in src/vendor +// and cmd/vendor.) +func lookupGorootExport(pkgDir string) (string, bool) { + f, ok := exportMap.Load(pkgDir) + if !ok { + var ( + listOnce sync.Once + exportPath string + ) + f, _ = exportMap.LoadOrStore(pkgDir, func() (string, bool) { + listOnce.Do(func() { + cmd := exec.Command("go", "list", "-export", "-f", "{{.Export}}", pkgDir) + cmd.Dir = build.Default.GOROOT + var output []byte + output, err := cmd.Output() + if err != nil { + return + } + + exports := strings.Split(string(bytes.TrimSpace(output)), "\n") + if len(exports) != 1 { + return + } + + exportPath = exports[0] + }) + + return exportPath, exportPath != "" + }) + } + + return f.(func() (string, bool))() +} + +var pkgExts = [...]string{".a", ".o"} + +// FindPkg returns the filename and unique package id for an import +// path based on package information provided by build.Import (using +// the build.Default build.Context). A relative srcDir is interpreted +// relative to the current working directory. +// If no file was found, an empty filename is returned. +func FindPkg(path, srcDir string) (filename, id string) { + if path == "" { + return + } + + var noext string + switch { + default: + // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" + // Don't require the source files to be present. + if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 + srcDir = abs + } + bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) + if bp.PkgObj == "" { + var ok bool + if bp.Goroot && bp.Dir != "" { + filename, ok = lookupGorootExport(bp.Dir) + } + if !ok { + id = path // make sure we have an id to print in error message + return + } + } else { + noext = strings.TrimSuffix(bp.PkgObj, ".a") + id = bp.ImportPath + } + + case build.IsLocalImport(path): + // "./x" -> "/this/directory/x.ext", "/this/directory/x" + noext = filepath.Join(srcDir, path) + id = noext + + case filepath.IsAbs(path): + // for completeness only - go/build.Import + // does not support absolute imports + // "/x" -> "/x.ext", "/x" + noext = path + id = path + } + + if false { // for debugging + if path != id { + fmt.Printf("%s -> %s\n", path, id) + } + } + + if filename != "" { + if f, err := os.Stat(filename); err == nil && !f.IsDir() { + return + } + } + + // try extensions + for _, ext := range pkgExts { + filename = noext + ext + if f, err := os.Stat(filename); err == nil && !f.IsDir() { + return + } + } + + filename = "" // not found + return +} + +// Import imports a gc-generated package given its import path and srcDir, adds +// the corresponding package object to the packages map, and returns the object. +// The packages map must contain all packages already imported. +func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { + var rc io.ReadCloser + var filename, id string + if lookup != nil { + // With custom lookup specified, assume that caller has + // converted path to a canonical import path for use in the map. + if path == "unsafe" { + return types.Unsafe, nil + } + id = path + + // No need to re-import if the package was imported completely before. + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + f, err := lookup(path) + if err != nil { + return nil, err + } + rc = f + } else { + filename, id = FindPkg(path, srcDir) + if filename == "" { + if path == "unsafe" { + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %q", id) + } + + // no need to re-import if the package was imported completely before + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + if err != nil { + // add file name to error + err = fmt.Errorf("%s: %v", filename, err) + } + }() + rc = f + } + defer rc.Close() + + var hdr string + var size int64 + buf := bufio.NewReader(rc) + if hdr, size, err = FindExportData(buf); err != nil { + return + } + + switch hdr { + case "$$B\n": + var data []byte + data, err = io.ReadAll(buf) + if err != nil { + break + } + + // TODO(gri): allow clients of go/importer to provide a FileSet. + // Or, define a new standard go/types/gcexportdata package. + fset := token.NewFileSet() + + // Select appropriate importer. + if len(data) > 0 { + switch data[0] { + case 'v', 'c', 'd': // binary, till go1.10 + return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) + + case 'i': // indexed, till go1.19 + _, pkg, err := IImportData(fset, packages, data[1:], id) + return pkg, err + + case 'u': // unified, from go1.20 + _, pkg, err := UImportData(fset, packages, data[1:size], id) + return pkg, err + + default: + l := len(data) + if l > 10 { + l = 10 + } + return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), id) + } + } + + default: + err = fmt.Errorf("unknown export data header: %q", hdr) + } + + return +} + +func deref(typ types.Type) types.Type { + if p, _ := typ.(*types.Pointer); p != nil { + return p.Elem() + } + return typ +} + +type byPath []*types.Package + +func (a byPath) Len() int { return len(a) } +func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/iexport.go new file mode 100644 index 00000000000..2ee8c70164f --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/iexport.go @@ -0,0 +1,1321 @@ +// Copyright 2019 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. + +// Indexed binary package export. +// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; +// see that file for specification of the format. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "io" + "math/big" + "reflect" + "sort" + "strconv" + "strings" + + "golang.org/x/tools/go/types/objectpath" + "golang.org/x/tools/internal/tokeninternal" +) + +// IExportShallow encodes "shallow" export data for the specified package. +// +// No promises are made about the encoding other than that it can be decoded by +// the same version of IIExportShallow. If you plan to save export data in the +// file system, be sure to include a cryptographic digest of the executable in +// the key to avoid version skew. +// +// If the provided reportf func is non-nil, it will be used for reporting bugs +// encountered during export. +// TODO(rfindley): remove reportf when we are confident enough in the new +// objectpath encoding. +func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { + // In principle this operation can only fail if out.Write fails, + // but that's impossible for bytes.Buffer---and as a matter of + // fact iexportCommon doesn't even check for I/O errors. + // TODO(adonovan): handle I/O errors properly. + // TODO(adonovan): use byte slices throughout, avoiding copying. + const bundle, shallow = false, true + var out bytes.Buffer + err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) + return out.Bytes(), err +} + +// IImportShallow decodes "shallow" types.Package data encoded by +// IExportShallow in the same executable. This function cannot import data from +// cmd/compile or gcexportdata.Write. +// +// The importer calls getPackages to obtain package symbols for all +// packages mentioned in the export data, including the one being +// decoded. +// +// If the provided reportf func is non-nil, it will be used for reporting bugs +// encountered during import. +// TODO(rfindley): remove reportf when we are confident enough in the new +// objectpath encoding. +func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) { + const bundle = false + const shallow = true + pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf) + if err != nil { + return nil, err + } + return pkgs[0], nil +} + +// ReportFunc is the type of a function used to report formatted bugs. +type ReportFunc = func(string, ...interface{}) + +// Current bundled export format version. Increase with each format change. +// 0: initial implementation +const bundleVersion = 0 + +// IExportData writes indexed export data for pkg to out. +// +// If no file set is provided, position info will be missing. +// The package path of the top-level package will not be recorded, +// so that calls to IImportData can override with a provided package path. +func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { + const bundle, shallow = false, false + return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) +} + +// IExportBundle writes an indexed export bundle for pkgs to out. +func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { + const bundle, shallow = true, false + return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs) +} + +func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package) (err error) { + if !debug { + defer func() { + if e := recover(); e != nil { + if ierr, ok := e.(internalError); ok { + err = ierr + return + } + // Not an internal error; panic again. + panic(e) + } + }() + } + + p := iexporter{ + fset: fset, + version: version, + shallow: shallow, + allPkgs: map[*types.Package]bool{}, + stringIndex: map[string]uint64{}, + declIndex: map[types.Object]uint64{}, + tparamNames: map[types.Object]string{}, + typIndex: map[types.Type]uint64{}, + } + if !bundle { + p.localpkg = pkgs[0] + } + + for i, pt := range predeclared() { + p.typIndex[pt] = uint64(i) + } + if len(p.typIndex) > predeclReserved { + panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) + } + + // Initialize work queue with exported declarations. + for _, pkg := range pkgs { + scope := pkg.Scope() + for _, name := range scope.Names() { + if token.IsExported(name) { + p.pushDecl(scope.Lookup(name)) + } + } + + if bundle { + // Ensure pkg and its imports are included in the index. + p.allPkgs[pkg] = true + for _, imp := range pkg.Imports() { + p.allPkgs[imp] = true + } + } + } + + // Loop until no more work. + for !p.declTodo.empty() { + p.doDecl(p.declTodo.popHead()) + } + + // Produce index of offset of each file record in files. + var files intWriter + var fileOffset []uint64 // fileOffset[i] is offset in files of file encoded as i + if p.shallow { + fileOffset = make([]uint64, len(p.fileInfos)) + for i, info := range p.fileInfos { + fileOffset[i] = uint64(files.Len()) + p.encodeFile(&files, info.file, info.needed) + } + } + + // Append indices to data0 section. + dataLen := uint64(p.data0.Len()) + w := p.newWriter() + w.writeIndex(p.declIndex) + + if bundle { + w.uint64(uint64(len(pkgs))) + for _, pkg := range pkgs { + w.pkg(pkg) + imps := pkg.Imports() + w.uint64(uint64(len(imps))) + for _, imp := range imps { + w.pkg(imp) + } + } + } + w.flush() + + // Assemble header. + var hdr intWriter + if bundle { + hdr.uint64(bundleVersion) + } + hdr.uint64(uint64(p.version)) + hdr.uint64(uint64(p.strings.Len())) + if p.shallow { + hdr.uint64(uint64(files.Len())) + hdr.uint64(uint64(len(fileOffset))) + for _, offset := range fileOffset { + hdr.uint64(offset) + } + } + hdr.uint64(dataLen) + + // Flush output. + io.Copy(out, &hdr) + io.Copy(out, &p.strings) + if p.shallow { + io.Copy(out, &files) + } + io.Copy(out, &p.data0) + + return nil +} + +// encodeFile writes to w a representation of the file sufficient to +// faithfully restore position information about all needed offsets. +// Mutates the needed array. +func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64) { + _ = needed[0] // precondition: needed is non-empty + + w.uint64(p.stringOff(file.Name())) + + size := uint64(file.Size()) + w.uint64(size) + + // Sort the set of needed offsets. Duplicates are harmless. + sort.Slice(needed, func(i, j int) bool { return needed[i] < needed[j] }) + + lines := tokeninternal.GetLines(file) // byte offset of each line start + w.uint64(uint64(len(lines))) + + // Rather than record the entire array of line start offsets, + // we save only a sparse list of (index, offset) pairs for + // the start of each line that contains a needed position. + var sparse [][2]int // (index, offset) pairs +outer: + for i, lineStart := range lines { + lineEnd := size + if i < len(lines)-1 { + lineEnd = uint64(lines[i+1]) + } + // Does this line contains a needed offset? + if needed[0] < lineEnd { + sparse = append(sparse, [2]int{i, lineStart}) + for needed[0] < lineEnd { + needed = needed[1:] + if len(needed) == 0 { + break outer + } + } + } + } + + // Delta-encode the columns. + w.uint64(uint64(len(sparse))) + var prev [2]int + for _, pair := range sparse { + w.uint64(uint64(pair[0] - prev[0])) + w.uint64(uint64(pair[1] - prev[1])) + prev = pair + } +} + +// writeIndex writes out an object index. mainIndex indicates whether +// we're writing out the main index, which is also read by +// non-compiler tools and includes a complete package description +// (i.e., name and height). +func (w *exportWriter) writeIndex(index map[types.Object]uint64) { + type pkgObj struct { + obj types.Object + name string // qualified name; differs from obj.Name for type params + } + // Build a map from packages to objects from that package. + pkgObjs := map[*types.Package][]pkgObj{} + + // For the main index, make sure to include every package that + // we reference, even if we're not exporting (or reexporting) + // any symbols from it. + if w.p.localpkg != nil { + pkgObjs[w.p.localpkg] = nil + } + for pkg := range w.p.allPkgs { + pkgObjs[pkg] = nil + } + + for obj := range index { + name := w.p.exportName(obj) + pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], pkgObj{obj, name}) + } + + var pkgs []*types.Package + for pkg, objs := range pkgObjs { + pkgs = append(pkgs, pkg) + + sort.Slice(objs, func(i, j int) bool { + return objs[i].name < objs[j].name + }) + } + + sort.Slice(pkgs, func(i, j int) bool { + return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) + }) + + w.uint64(uint64(len(pkgs))) + for _, pkg := range pkgs { + w.string(w.exportPath(pkg)) + w.string(pkg.Name()) + w.uint64(uint64(0)) // package height is not needed for go/types + + objs := pkgObjs[pkg] + w.uint64(uint64(len(objs))) + for _, obj := range objs { + w.string(obj.name) + w.uint64(index[obj.obj]) + } + } +} + +// exportName returns the 'exported' name of an object. It differs from +// obj.Name() only for type parameters (see tparamExportName for details). +func (p *iexporter) exportName(obj types.Object) (res string) { + if name := p.tparamNames[obj]; name != "" { + return name + } + return obj.Name() +} + +type iexporter struct { + fset *token.FileSet + out *bytes.Buffer + version int + + shallow bool // don't put types from other packages in the index + objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated + localpkg *types.Package // (nil in bundle mode) + + // allPkgs tracks all packages that have been referenced by + // the export data, so we can ensure to include them in the + // main index. + allPkgs map[*types.Package]bool + + declTodo objQueue + + strings intWriter + stringIndex map[string]uint64 + + // In shallow mode, object positions are encoded as (file, offset). + // Each file is recorded as a line-number table. + // Only the lines of needed positions are saved faithfully. + fileInfo map[*token.File]uint64 // value is index in fileInfos + fileInfos []*filePositions + + data0 intWriter + declIndex map[types.Object]uint64 + tparamNames map[types.Object]string // typeparam->exported name + typIndex map[types.Type]uint64 + + indent int // for tracing support +} + +type filePositions struct { + file *token.File + needed []uint64 // unordered list of needed file offsets +} + +func (p *iexporter) trace(format string, args ...interface{}) { + if !trace { + // Call sites should also be guarded, but having this check here allows + // easily enabling/disabling debug trace statements. + return + } + fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) +} + +// objectpathEncoder returns the lazily allocated objectpath.Encoder to use +// when encoding objects in other packages during shallow export. +// +// Using a shared Encoder amortizes some of cost of objectpath search. +func (p *iexporter) objectpathEncoder() *objectpath.Encoder { + if p.objEncoder == nil { + p.objEncoder = new(objectpath.Encoder) + } + return p.objEncoder +} + +// stringOff returns the offset of s within the string section. +// If not already present, it's added to the end. +func (p *iexporter) stringOff(s string) uint64 { + off, ok := p.stringIndex[s] + if !ok { + off = uint64(p.strings.Len()) + p.stringIndex[s] = off + + p.strings.uint64(uint64(len(s))) + p.strings.WriteString(s) + } + return off +} + +// fileIndexAndOffset returns the index of the token.File and the byte offset of pos within it. +func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) { + index, ok := p.fileInfo[file] + if !ok { + index = uint64(len(p.fileInfo)) + p.fileInfos = append(p.fileInfos, &filePositions{file: file}) + if p.fileInfo == nil { + p.fileInfo = make(map[*token.File]uint64) + } + p.fileInfo[file] = index + } + // Record each needed offset. + info := p.fileInfos[index] + offset := uint64(file.Offset(pos)) + info.needed = append(info.needed, offset) + + return index, offset +} + +// pushDecl adds n to the declaration work queue, if not already present. +func (p *iexporter) pushDecl(obj types.Object) { + // Package unsafe is known to the compiler and predeclared. + // Caller should not ask us to do export it. + if obj.Pkg() == types.Unsafe { + panic("cannot export package unsafe") + } + + // Shallow export data: don't index decls from other packages. + if p.shallow && obj.Pkg() != p.localpkg { + return + } + + if _, ok := p.declIndex[obj]; ok { + return + } + + p.declIndex[obj] = ^uint64(0) // mark obj present in work queue + p.declTodo.pushTail(obj) +} + +// exportWriter handles writing out individual data section chunks. +type exportWriter struct { + p *iexporter + + data intWriter + prevFile string + prevLine int64 + prevColumn int64 +} + +func (w *exportWriter) exportPath(pkg *types.Package) string { + if pkg == w.p.localpkg { + return "" + } + return pkg.Path() +} + +func (p *iexporter) doDecl(obj types.Object) { + if trace { + p.trace("exporting decl %v (%T)", obj, obj) + p.indent++ + defer func() { + p.indent-- + p.trace("=> %s", obj) + }() + } + w := p.newWriter() + + switch obj := obj.(type) { + case *types.Var: + w.tag('V') + w.pos(obj.Pos()) + w.typ(obj.Type(), obj.Pkg()) + + case *types.Func: + sig, _ := obj.Type().(*types.Signature) + if sig.Recv() != nil { + // We shouldn't see methods in the package scope, + // but the type checker may repair "func () F() {}" + // to "func (Invalid) F()" and then treat it like "func F()", + // so allow that. See golang/go#57729. + if sig.Recv().Type() != types.Typ[types.Invalid] { + panic(internalErrorf("unexpected method: %v", sig)) + } + } + + // Function. + if sig.TypeParams().Len() == 0 { + w.tag('F') + } else { + w.tag('G') + } + w.pos(obj.Pos()) + // The tparam list of the function type is the declaration of the type + // params. So, write out the type params right now. Then those type params + // will be referenced via their type offset (via typOff) in all other + // places in the signature and function where they are used. + // + // While importing the type parameters, tparamList computes and records + // their export name, so that it can be later used when writing the index. + if tparams := sig.TypeParams(); tparams.Len() > 0 { + w.tparamList(obj.Name(), tparams, obj.Pkg()) + } + w.signature(sig) + + case *types.Const: + w.tag('C') + w.pos(obj.Pos()) + w.value(obj.Type(), obj.Val()) + + case *types.TypeName: + t := obj.Type() + + if tparam, ok := t.(*types.TypeParam); ok { + w.tag('P') + w.pos(obj.Pos()) + constraint := tparam.Constraint() + if p.version >= iexportVersionGo1_18 { + implicit := false + if iface, _ := constraint.(*types.Interface); iface != nil { + implicit = iface.IsImplicit() + } + w.bool(implicit) + } + w.typ(constraint, obj.Pkg()) + break + } + + if obj.IsAlias() { + w.tag('A') + w.pos(obj.Pos()) + w.typ(t, obj.Pkg()) + break + } + + // Defined type. + named, ok := t.(*types.Named) + if !ok { + panic(internalErrorf("%s is not a defined type", t)) + } + + if named.TypeParams().Len() == 0 { + w.tag('T') + } else { + w.tag('U') + } + w.pos(obj.Pos()) + + if named.TypeParams().Len() > 0 { + // While importing the type parameters, tparamList computes and records + // their export name, so that it can be later used when writing the index. + w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg()) + } + + underlying := obj.Type().Underlying() + w.typ(underlying, obj.Pkg()) + + if types.IsInterface(t) { + break + } + + n := named.NumMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := named.Method(i) + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + + // Receiver type parameters are type arguments of the receiver type, so + // their name must be qualified before exporting recv. + if rparams := sig.RecvTypeParams(); rparams.Len() > 0 { + prefix := obj.Name() + "." + m.Name() + for i := 0; i < rparams.Len(); i++ { + rparam := rparams.At(i) + name := tparamExportName(prefix, rparam) + w.p.tparamNames[rparam.Obj()] = name + } + } + w.param(sig.Recv()) + w.signature(sig) + } + + default: + panic(internalErrorf("unexpected object: %v", obj)) + } + + p.declIndex[obj] = w.flush() +} + +func (w *exportWriter) tag(tag byte) { + w.data.WriteByte(tag) +} + +func (w *exportWriter) pos(pos token.Pos) { + if w.p.shallow { + w.posV2(pos) + } else if w.p.version >= iexportVersionPosCol { + w.posV1(pos) + } else { + w.posV0(pos) + } +} + +// posV2 encoding (used only in shallow mode) records positions as +// (file, offset), where file is the index in the token.File table +// (which records the file name and newline offsets) and offset is a +// byte offset. It effectively ignores //line directives. +func (w *exportWriter) posV2(pos token.Pos) { + if pos == token.NoPos { + w.uint64(0) + return + } + file := w.p.fset.File(pos) // fset must be non-nil + index, offset := w.p.fileIndexAndOffset(file, pos) + w.uint64(1 + index) + w.uint64(offset) +} + +func (w *exportWriter) posV1(pos token.Pos) { + if w.p.fset == nil { + w.int64(0) + return + } + + p := w.p.fset.Position(pos) + file := p.Filename + line := int64(p.Line) + column := int64(p.Column) + + deltaColumn := (column - w.prevColumn) << 1 + deltaLine := (line - w.prevLine) << 1 + + if file != w.prevFile { + deltaLine |= 1 + } + if deltaLine != 0 { + deltaColumn |= 1 + } + + w.int64(deltaColumn) + if deltaColumn&1 != 0 { + w.int64(deltaLine) + if deltaLine&1 != 0 { + w.string(file) + } + } + + w.prevFile = file + w.prevLine = line + w.prevColumn = column +} + +func (w *exportWriter) posV0(pos token.Pos) { + if w.p.fset == nil { + w.int64(0) + return + } + + p := w.p.fset.Position(pos) + file := p.Filename + line := int64(p.Line) + + // When file is the same as the last position (common case), + // we can save a few bytes by delta encoding just the line + // number. + // + // Note: Because data objects may be read out of order (or not + // at all), we can only apply delta encoding within a single + // object. This is handled implicitly by tracking prevFile and + // prevLine as fields of exportWriter. + + if file == w.prevFile { + delta := line - w.prevLine + w.int64(delta) + if delta == deltaNewFile { + w.int64(-1) + } + } else { + w.int64(deltaNewFile) + w.int64(line) // line >= 0 + w.string(file) + w.prevFile = file + } + w.prevLine = line +} + +func (w *exportWriter) pkg(pkg *types.Package) { + // Ensure any referenced packages are declared in the main index. + w.p.allPkgs[pkg] = true + + w.string(w.exportPath(pkg)) +} + +func (w *exportWriter) qualifiedType(obj *types.TypeName) { + name := w.p.exportName(obj) + + // Ensure any referenced declarations are written out too. + w.p.pushDecl(obj) + w.string(name) + w.pkg(obj.Pkg()) +} + +// TODO(rfindley): what does 'pkg' even mean here? It would be better to pass +// it in explicitly into signatures and structs that may use it for +// constructing fields. +func (w *exportWriter) typ(t types.Type, pkg *types.Package) { + w.data.uint64(w.p.typOff(t, pkg)) +} + +func (p *iexporter) newWriter() *exportWriter { + return &exportWriter{p: p} +} + +func (w *exportWriter) flush() uint64 { + off := uint64(w.p.data0.Len()) + io.Copy(&w.p.data0, &w.data) + return off +} + +func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { + off, ok := p.typIndex[t] + if !ok { + w := p.newWriter() + w.doTyp(t, pkg) + off = predeclReserved + w.flush() + p.typIndex[t] = off + } + return off +} + +func (w *exportWriter) startType(k itag) { + w.data.uint64(uint64(k)) +} + +func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { + if trace { + w.p.trace("exporting type %s (%T)", t, t) + w.p.indent++ + defer func() { + w.p.indent-- + w.p.trace("=> %s", t) + }() + } + switch t := t.(type) { + case *types.Named: + if targs := t.TypeArgs(); targs.Len() > 0 { + w.startType(instanceType) + // TODO(rfindley): investigate if this position is correct, and if it + // matters. + w.pos(t.Obj().Pos()) + w.typeList(targs, pkg) + w.typ(t.Origin(), pkg) + return + } + w.startType(definedType) + w.qualifiedType(t.Obj()) + + case *types.TypeParam: + w.startType(typeParamType) + w.qualifiedType(t.Obj()) + + case *types.Pointer: + w.startType(pointerType) + w.typ(t.Elem(), pkg) + + case *types.Slice: + w.startType(sliceType) + w.typ(t.Elem(), pkg) + + case *types.Array: + w.startType(arrayType) + w.uint64(uint64(t.Len())) + w.typ(t.Elem(), pkg) + + case *types.Chan: + w.startType(chanType) + // 1 RecvOnly; 2 SendOnly; 3 SendRecv + var dir uint64 + switch t.Dir() { + case types.RecvOnly: + dir = 1 + case types.SendOnly: + dir = 2 + case types.SendRecv: + dir = 3 + } + w.uint64(dir) + w.typ(t.Elem(), pkg) + + case *types.Map: + w.startType(mapType) + w.typ(t.Key(), pkg) + w.typ(t.Elem(), pkg) + + case *types.Signature: + w.startType(signatureType) + w.pkg(pkg) + w.signature(t) + + case *types.Struct: + w.startType(structType) + n := t.NumFields() + // Even for struct{} we must emit some qualifying package, because that's + // what the compiler does, and thus that's what the importer expects. + fieldPkg := pkg + if n > 0 { + fieldPkg = t.Field(0).Pkg() + } + if fieldPkg == nil { + // TODO(rfindley): improve this very hacky logic. + // + // The importer expects a package to be set for all struct types, even + // those with no fields. A better encoding might be to set NumFields + // before pkg. setPkg panics with a nil package, which may be possible + // to reach with invalid packages (and perhaps valid packages, too?), so + // (arbitrarily) set the localpkg if available. + // + // Alternatively, we may be able to simply guarantee that pkg != nil, by + // reconsidering the encoding of constant values. + if w.p.shallow { + fieldPkg = w.p.localpkg + } else { + panic(internalErrorf("no package to set for empty struct")) + } + } + w.pkg(fieldPkg) + w.uint64(uint64(n)) + + for i := 0; i < n; i++ { + f := t.Field(i) + if w.p.shallow { + w.objectPath(f) + } + w.pos(f.Pos()) + w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg + w.typ(f.Type(), fieldPkg) + w.bool(f.Anonymous()) + w.string(t.Tag(i)) // note (or tag) + } + + case *types.Interface: + w.startType(interfaceType) + w.pkg(pkg) + + n := t.NumEmbeddeds() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + ft := t.EmbeddedType(i) + tPkg := pkg + if named, _ := ft.(*types.Named); named != nil { + w.pos(named.Obj().Pos()) + } else { + w.pos(token.NoPos) + } + w.typ(ft, tPkg) + } + + // See comment for struct fields. In shallow mode we change the encoding + // for interface methods that are promoted from other packages. + + n = t.NumExplicitMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := t.ExplicitMethod(i) + if w.p.shallow { + w.objectPath(m) + } + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + w.signature(sig) + } + + case *types.Union: + w.startType(unionType) + nt := t.Len() + w.uint64(uint64(nt)) + for i := 0; i < nt; i++ { + term := t.Term(i) + w.bool(term.Tilde()) + w.typ(term.Type(), pkg) + } + + default: + panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) + } +} + +// objectPath writes the package and objectPath to use to look up obj in a +// different package, when encoding in "shallow" mode. +// +// When doing a shallow import, the importer creates only the local package, +// and requests package symbols for dependencies from the client. +// However, certain types defined in the local package may hold objects defined +// (perhaps deeply) within another package. +// +// For example, consider the following: +// +// package a +// func F() chan * map[string] struct { X int } +// +// package b +// import "a" +// var B = a.F() +// +// In this example, the type of b.B holds fields defined in package a. +// In order to have the correct canonical objects for the field defined in the +// type of B, they are encoded as objectPaths and later looked up in the +// importer. The same problem applies to interface methods. +func (w *exportWriter) objectPath(obj types.Object) { + if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg { + // obj.Pkg() may be nil for the builtin error.Error. + // In this case, or if obj is declared in the local package, no need to + // encode. + w.string("") + return + } + objectPath, err := w.p.objectpathEncoder().For(obj) + if err != nil { + // Fall back to the empty string, which will cause the importer to create a + // new object, which matches earlier behavior. Creating a new object is + // sufficient for many purposes (such as type checking), but causes certain + // references algorithms to fail (golang/go#60819). However, we didn't + // notice this problem during months of gopls@v0.12.0 testing. + // + // TODO(golang/go#61674): this workaround is insufficient, as in the case + // where the field forwarded from an instantiated type that may not appear + // in the export data of the original package: + // + // // package a + // type A[P any] struct{ F P } + // + // // package b + // type B a.A[int] + // + // We need to update references algorithms not to depend on this + // de-duplication, at which point we may want to simply remove the + // workaround here. + w.string("") + return + } + w.string(string(objectPath)) + w.pkg(obj.Pkg()) +} + +func (w *exportWriter) signature(sig *types.Signature) { + w.paramList(sig.Params()) + w.paramList(sig.Results()) + if sig.Params().Len() > 0 { + w.bool(sig.Variadic()) + } +} + +func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) { + w.uint64(uint64(ts.Len())) + for i := 0; i < ts.Len(); i++ { + w.typ(ts.At(i), pkg) + } +} + +func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) { + ll := uint64(list.Len()) + w.uint64(ll) + for i := 0; i < list.Len(); i++ { + tparam := list.At(i) + // Set the type parameter exportName before exporting its type. + exportName := tparamExportName(prefix, tparam) + w.p.tparamNames[tparam.Obj()] = exportName + w.typ(list.At(i), pkg) + } +} + +const blankMarker = "$" + +// tparamExportName returns the 'exported' name of a type parameter, which +// differs from its actual object name: it is prefixed with a qualifier, and +// blank type parameter names are disambiguated by their index in the type +// parameter list. +func tparamExportName(prefix string, tparam *types.TypeParam) string { + assert(prefix != "") + name := tparam.Obj().Name() + if name == "_" { + name = blankMarker + strconv.Itoa(tparam.Index()) + } + return prefix + "." + name +} + +// tparamName returns the real name of a type parameter, after stripping its +// qualifying prefix and reverting blank-name encoding. See tparamExportName +// for details. +func tparamName(exportName string) string { + // Remove the "path" from the type param name that makes it unique. + ix := strings.LastIndex(exportName, ".") + if ix < 0 { + errorf("malformed type parameter export name %s: missing prefix", exportName) + } + name := exportName[ix+1:] + if strings.HasPrefix(name, blankMarker) { + return "_" + } + return name +} + +func (w *exportWriter) paramList(tup *types.Tuple) { + n := tup.Len() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + w.param(tup.At(i)) + } +} + +func (w *exportWriter) param(obj types.Object) { + w.pos(obj.Pos()) + w.localIdent(obj) + w.typ(obj.Type(), obj.Pkg()) +} + +func (w *exportWriter) value(typ types.Type, v constant.Value) { + w.typ(typ, nil) + if w.p.version >= iexportVersionGo1_18 { + w.int64(int64(v.Kind())) + } + + if v.Kind() == constant.Unknown { + // golang/go#60605: treat unknown constant values as if they have invalid type + // + // This loses some fidelity over the package type-checked from source, but that + // is acceptable. + // + // TODO(rfindley): we should switch on the recorded constant kind rather + // than the constant type + return + } + + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { + case types.IsBoolean: + w.bool(constant.BoolVal(v)) + case types.IsInteger: + var i big.Int + if i64, exact := constant.Int64Val(v); exact { + i.SetInt64(i64) + } else if ui64, exact := constant.Uint64Val(v); exact { + i.SetUint64(ui64) + } else { + i.SetString(v.ExactString(), 10) + } + w.mpint(&i, typ) + case types.IsFloat: + f := constantToFloat(v) + w.mpfloat(f, typ) + case types.IsComplex: + w.mpfloat(constantToFloat(constant.Real(v)), typ) + w.mpfloat(constantToFloat(constant.Imag(v)), typ) + case types.IsString: + w.string(constant.StringVal(v)) + default: + if b.Kind() == types.Invalid { + // package contains type errors + break + } + panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying())) + } +} + +// constantToFloat converts a constant.Value with kind constant.Float to a +// big.Float. +func constantToFloat(x constant.Value) *big.Float { + x = constant.ToFloat(x) + // Use the same floating-point precision (512) as cmd/compile + // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). + const mpprec = 512 + var f big.Float + f.SetPrec(mpprec) + if v, exact := constant.Float64Val(x); exact { + // float64 + f.SetFloat64(v) + } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { + // TODO(gri): add big.Rat accessor to constant.Value. + n := valueToRat(num) + d := valueToRat(denom) + f.SetRat(n.Quo(n, d)) + } else { + // Value too large to represent as a fraction => inaccessible. + // TODO(gri): add big.Float accessor to constant.Value. + _, ok := f.SetString(x.ExactString()) + assert(ok) + } + return &f +} + +func valueToRat(x constant.Value) *big.Rat { + // Convert little-endian to big-endian. + // I can't believe this is necessary. + bytes := constant.Bytes(x) + for i := 0; i < len(bytes)/2; i++ { + bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] + } + return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) +} + +// mpint exports a multi-precision integer. +// +// For unsigned types, small values are written out as a single +// byte. Larger values are written out as a length-prefixed big-endian +// byte string, where the length prefix is encoded as its complement. +// For example, bytes 0, 1, and 2 directly represent the integer +// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, +// 2-, and 3-byte big-endian string follow. +// +// Encoding for signed types use the same general approach as for +// unsigned types, except small values use zig-zag encoding and the +// bottom bit of length prefix byte for large values is reserved as a +// sign bit. +// +// The exact boundary between small and large encodings varies +// according to the maximum number of bytes needed to encode a value +// of type typ. As a special case, 8-bit types are always encoded as a +// single byte. +// +// TODO(mdempsky): Is this level of complexity really worthwhile? +func (w *exportWriter) mpint(x *big.Int, typ types.Type) { + basic, ok := typ.Underlying().(*types.Basic) + if !ok { + panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) + } + + signed, maxBytes := intSize(basic) + + negative := x.Sign() < 0 + if !signed && negative { + panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) + } + + b := x.Bytes() + if len(b) > 0 && b[0] == 0 { + panic(internalErrorf("leading zeros")) + } + if uint(len(b)) > maxBytes { + panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) + } + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + // Check if x can use small value encoding. + if len(b) <= 1 { + var ux uint + if len(b) == 1 { + ux = uint(b[0]) + } + if signed { + ux <<= 1 + if negative { + ux-- + } + } + if ux < maxSmall { + w.data.WriteByte(byte(ux)) + return + } + } + + n := 256 - uint(len(b)) + if signed { + n = 256 - 2*uint(len(b)) + if negative { + n |= 1 + } + } + if n < maxSmall || n >= 256 { + panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) + } + + w.data.WriteByte(byte(n)) + w.data.Write(b) +} + +// mpfloat exports a multi-precision floating point number. +// +// The number's value is decomposed into mantissa × 2**exponent, where +// mantissa is an integer. The value is written out as mantissa (as a +// multi-precision integer) and then the exponent, except exponent is +// omitted if mantissa is zero. +func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { + if f.IsInf() { + panic("infinite constant") + } + + // Break into f = mant × 2**exp, with 0.5 <= mant < 1. + var mant big.Float + exp := int64(f.MantExp(&mant)) + + // Scale so that mant is an integer. + prec := mant.MinPrec() + mant.SetMantExp(&mant, int(prec)) + exp -= int64(prec) + + manti, acc := mant.Int(nil) + if acc != big.Exact { + panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) + } + w.mpint(manti, typ) + if manti.Sign() != 0 { + w.int64(exp) + } +} + +func (w *exportWriter) bool(b bool) bool { + var x uint64 + if b { + x = 1 + } + w.uint64(x) + return b +} + +func (w *exportWriter) int64(x int64) { w.data.int64(x) } +func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } +func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } + +func (w *exportWriter) localIdent(obj types.Object) { + // Anonymous parameters. + if obj == nil { + w.string("") + return + } + + name := obj.Name() + if name == "_" { + w.string("_") + return + } + + w.string(name) +} + +type intWriter struct { + bytes.Buffer +} + +func (w *intWriter) int64(x int64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutVarint(buf[:], x) + w.Write(buf[:n]) +} + +func (w *intWriter) uint64(x uint64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutUvarint(buf[:], x) + w.Write(buf[:n]) +} + +func assert(cond bool) { + if !cond { + panic("internal error: assertion failed") + } +} + +// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. + +// objQueue is a FIFO queue of types.Object. The zero value of objQueue is +// a ready-to-use empty queue. +type objQueue struct { + ring []types.Object + head, tail int +} + +// empty returns true if q contains no Nodes. +func (q *objQueue) empty() bool { + return q.head == q.tail +} + +// pushTail appends n to the tail of the queue. +func (q *objQueue) pushTail(obj types.Object) { + if len(q.ring) == 0 { + q.ring = make([]types.Object, 16) + } else if q.head+len(q.ring) == q.tail { + // Grow the ring. + nring := make([]types.Object, len(q.ring)*2) + // Copy the old elements. + part := q.ring[q.head%len(q.ring):] + if q.tail-q.head <= len(part) { + part = part[:q.tail-q.head] + copy(nring, part) + } else { + pos := copy(nring, part) + copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) + } + q.ring, q.head, q.tail = nring, 0, q.tail-q.head + } + + q.ring[q.tail%len(q.ring)] = obj + q.tail++ +} + +// popHead pops a node from the head of the queue. It panics if q is empty. +func (q *objQueue) popHead() types.Object { + if q.empty() { + panic("dequeue empty") + } + obj := q.ring[q.head%len(q.ring)] + q.head++ + return obj +} + +// internalError represents an error generated inside this package. +type internalError string + +func (e internalError) Error() string { return "gcimporter: " + string(e) } + +// TODO(adonovan): make this call panic, so that it's symmetric with errorf. +// Otherwise it's easy to forget to do anything with the error. +// +// TODO(adonovan): also, consider switching the names "errorf" and +// "internalErrorf" as the former is used for bugs, whose cause is +// internal inconsistency, whereas the latter is used for ordinary +// situations like bad input, whose cause is external. +func internalErrorf(format string, args ...interface{}) error { + return internalError(fmt.Sprintf(format, args...)) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/iimport.go new file mode 100644 index 00000000000..9bde15e3bc6 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/iimport.go @@ -0,0 +1,1082 @@ +// 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. + +// Indexed package import. +// See cmd/compile/internal/gc/iexport.go for the export data format. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "io" + "math/big" + "sort" + "strings" + + "golang.org/x/tools/go/types/objectpath" +) + +type intReader struct { + *bytes.Reader + path string +} + +func (r *intReader) int64() int64 { + i, err := binary.ReadVarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +func (r *intReader) uint64() uint64 { + i, err := binary.ReadUvarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +// Keep this in sync with constants in iexport.go. +const ( + iexportVersionGo1_11 = 0 + iexportVersionPosCol = 1 + iexportVersionGo1_18 = 2 + iexportVersionGenerics = 2 + + iexportVersionCurrent = 2 +) + +type ident struct { + pkg *types.Package + name string +} + +const predeclReserved = 32 + +type itag uint64 + +const ( + // Types + definedType itag = iota + pointerType + sliceType + arrayType + chanType + mapType + signatureType + structType + interfaceType + typeParamType + instanceType + unionType +) + +// IImportData imports a package from the serialized package data +// and returns 0 and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { + pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) + if err != nil { + return 0, nil, err + } + return 0, pkgs[0], nil +} + +// IImportBundle imports a set of packages from the serialized package bundle. +func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { + return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil) +} + +// A GetPackagesFunc function obtains the non-nil symbols for a set of +// packages, creating and recursively importing them as needed. An +// implementation should store each package symbol is in the Pkg +// field of the items array. +// +// Any error causes importing to fail. This can be used to quickly read +// the import manifest of an export data file without fully decoding it. +type GetPackagesFunc = func(items []GetPackagesItem) error + +// A GetPackagesItem is a request from the importer for the package +// symbol of the specified name and path. +type GetPackagesItem struct { + Name, Path string + Pkg *types.Package // to be filled in by GetPackagesFunc call + + // private importer state + pathOffset uint64 + nameIndex map[string]uint64 +} + +// GetPackagesFromMap returns a GetPackagesFunc that retrieves +// packages from the given map of package path to package. +// +// The returned function may mutate m: each requested package that is not +// found is created with types.NewPackage and inserted into m. +func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc { + return func(items []GetPackagesItem) error { + for i, item := range items { + pkg, ok := m[item.Path] + if !ok { + pkg = types.NewPackage(item.Path, item.Name) + m[item.Path] = pkg + } + items[i].Pkg = pkg + } + return nil + } +} + +func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) { + const currentVersion = iexportVersionCurrent + version := int64(-1) + if !debug { + defer func() { + if e := recover(); e != nil { + if bundle { + err = fmt.Errorf("%v", e) + } else if version > currentVersion { + err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) + } else { + err = fmt.Errorf("internal error while importing %q (%v); please report an issue", path, e) + } + } + }() + } + + r := &intReader{bytes.NewReader(data), path} + + if bundle { + if v := r.uint64(); v != bundleVersion { + errorf("unknown bundle format version %d", v) + } + } + + version = int64(r.uint64()) + switch version { + case iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11: + default: + if version > iexportVersionGo1_18 { + errorf("unstable iexport format version %d, just rebuild compiler and std library", version) + } else { + errorf("unknown iexport format version %d", version) + } + } + + sLen := int64(r.uint64()) + var fLen int64 + var fileOffset []uint64 + if shallow { + // Shallow mode uses a different position encoding. + fLen = int64(r.uint64()) + fileOffset = make([]uint64, r.uint64()) + for i := range fileOffset { + fileOffset[i] = r.uint64() + } + } + dLen := int64(r.uint64()) + + whence, _ := r.Seek(0, io.SeekCurrent) + stringData := data[whence : whence+sLen] + fileData := data[whence+sLen : whence+sLen+fLen] + declData := data[whence+sLen+fLen : whence+sLen+fLen+dLen] + r.Seek(sLen+fLen+dLen, io.SeekCurrent) + + p := iimporter{ + version: int(version), + ipath: path, + shallow: shallow, + reportf: reportf, + + stringData: stringData, + stringCache: make(map[uint64]string), + fileOffset: fileOffset, + fileData: fileData, + fileCache: make([]*token.File, len(fileOffset)), + pkgCache: make(map[uint64]*types.Package), + + declData: declData, + pkgIndex: make(map[*types.Package]map[string]uint64), + typCache: make(map[uint64]types.Type), + // Separate map for typeparams, keyed by their package and unique + // name. + tparamIndex: make(map[ident]types.Type), + + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*fileInfo), + }, + } + defer p.fake.setLines() // set lines for files in fset + + for i, pt := range predeclared() { + p.typCache[uint64(i)] = pt + } + + // Gather the relevant packages from the manifest. + items := make([]GetPackagesItem, r.uint64()) + for i := range items { + pkgPathOff := r.uint64() + pkgPath := p.stringAt(pkgPathOff) + pkgName := p.stringAt(r.uint64()) + _ = r.uint64() // package height; unused by go/types + + if pkgPath == "" { + pkgPath = path + } + items[i].Name = pkgName + items[i].Path = pkgPath + items[i].pathOffset = pkgPathOff + + // Read index for package. + nameIndex := make(map[string]uint64) + nSyms := r.uint64() + // In shallow mode, only the current package (i=0) has an index. + assert(!(shallow && i > 0 && nSyms != 0)) + for ; nSyms > 0; nSyms-- { + name := p.stringAt(r.uint64()) + nameIndex[name] = r.uint64() + } + + items[i].nameIndex = nameIndex + } + + // Request packages all at once from the client, + // enabling a parallel implementation. + if err := getPackages(items); err != nil { + return nil, err // don't wrap this error + } + + // Check the results and complete the index. + pkgList := make([]*types.Package, len(items)) + for i, item := range items { + pkg := item.Pkg + if pkg == nil { + errorf("internal error: getPackages returned nil package for %q", item.Path) + } else if pkg.Path() != item.Path { + errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path) + } else if pkg.Name() != item.Name { + errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name) + } + p.pkgCache[item.pathOffset] = pkg + p.pkgIndex[pkg] = item.nameIndex + pkgList[i] = pkg + } + + if bundle { + pkgs = make([]*types.Package, r.uint64()) + for i := range pkgs { + pkg := p.pkgAt(r.uint64()) + imps := make([]*types.Package, r.uint64()) + for j := range imps { + imps[j] = p.pkgAt(r.uint64()) + } + pkg.SetImports(imps) + pkgs[i] = pkg + } + } else { + if len(pkgList) == 0 { + errorf("no packages found for %s", path) + panic("unreachable") + } + pkgs = pkgList[:1] + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), pkgList[1:]...) + sort.Sort(byPath(list)) + pkgs[0].SetImports(list) + } + + for _, pkg := range pkgs { + if pkg.Complete() { + continue + } + + names := make([]string, 0, len(p.pkgIndex[pkg])) + for name := range p.pkgIndex[pkg] { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + p.doDecl(pkg, name) + } + + // package was imported completely and without errors + pkg.MarkComplete() + } + + // SetConstraint can't be called if the constraint type is not yet complete. + // When type params are created in the 'P' case of (*importReader).obj(), + // the associated constraint type may not be complete due to recursion. + // Therefore, we defer calling SetConstraint there, and call it here instead + // after all types are complete. + for _, d := range p.later { + d.t.SetConstraint(d.constraint) + } + + for _, typ := range p.interfaceList { + typ.Complete() + } + + // Workaround for golang/go#61561. See the doc for instanceList for details. + for _, typ := range p.instanceList { + if iface, _ := typ.Underlying().(*types.Interface); iface != nil { + iface.Complete() + } + } + + return pkgs, nil +} + +type setConstraintArgs struct { + t *types.TypeParam + constraint types.Type +} + +type iimporter struct { + version int + ipath string + + shallow bool + reportf ReportFunc // if non-nil, used to report bugs + + stringData []byte + stringCache map[uint64]string + fileOffset []uint64 // fileOffset[i] is offset in fileData for info about file encoded as i + fileData []byte + fileCache []*token.File // memoized decoding of file encoded as i + pkgCache map[uint64]*types.Package + + declData []byte + pkgIndex map[*types.Package]map[string]uint64 + typCache map[uint64]types.Type + tparamIndex map[ident]types.Type + + fake fakeFileSet + interfaceList []*types.Interface + + // Workaround for the go/types bug golang/go#61561: instances produced during + // instantiation may contain incomplete interfaces. Here we only complete the + // underlying type of the instance, which is the most common case but doesn't + // handle parameterized interface literals defined deeper in the type. + instanceList []types.Type // instances for later completion (see golang/go#61561) + + // Arguments for calls to SetConstraint that are deferred due to recursive types + later []setConstraintArgs + + indent int // for tracing support +} + +func (p *iimporter) trace(format string, args ...interface{}) { + if !trace { + // Call sites should also be guarded, but having this check here allows + // easily enabling/disabling debug trace statements. + return + } + fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) +} + +func (p *iimporter) doDecl(pkg *types.Package, name string) { + if debug { + p.trace("import decl %s", name) + p.indent++ + defer func() { + p.indent-- + p.trace("=> %s", name) + }() + } + // See if we've already imported this declaration. + if obj := pkg.Scope().Lookup(name); obj != nil { + return + } + + off, ok := p.pkgIndex[pkg][name] + if !ok { + // In deep mode, the index should be complete. In shallow + // mode, we should have already recursively loaded necessary + // dependencies so the above Lookup succeeds. + errorf("%v.%v not in index", pkg, name) + } + + r := &importReader{p: p, currPkg: pkg} + r.declReader.Reset(p.declData[off:]) + + r.obj(name) +} + +func (p *iimporter) stringAt(off uint64) string { + if s, ok := p.stringCache[off]; ok { + return s + } + + slen, n := binary.Uvarint(p.stringData[off:]) + if n <= 0 { + errorf("varint failed") + } + spos := off + uint64(n) + s := string(p.stringData[spos : spos+slen]) + p.stringCache[off] = s + return s +} + +func (p *iimporter) fileAt(index uint64) *token.File { + file := p.fileCache[index] + if file == nil { + off := p.fileOffset[index] + file = p.decodeFile(intReader{bytes.NewReader(p.fileData[off:]), p.ipath}) + p.fileCache[index] = file + } + return file +} + +func (p *iimporter) decodeFile(rd intReader) *token.File { + filename := p.stringAt(rd.uint64()) + size := int(rd.uint64()) + file := p.fake.fset.AddFile(filename, -1, size) + + // SetLines requires a nondecreasing sequence. + // Because it is common for clients to derive the interval + // [start, start+len(name)] from a start position, and we + // want to ensure that the end offset is on the same line, + // we fill in the gaps of the sparse encoding with values + // that strictly increase by the largest possible amount. + // This allows us to avoid having to record the actual end + // offset of each needed line. + + lines := make([]int, int(rd.uint64())) + var index, offset int + for i, n := 0, int(rd.uint64()); i < n; i++ { + index += int(rd.uint64()) + offset += int(rd.uint64()) + lines[index] = offset + + // Ensure monotonicity between points. + for j := index - 1; j > 0 && lines[j] == 0; j-- { + lines[j] = lines[j+1] - 1 + } + } + + // Ensure monotonicity after last point. + for j := len(lines) - 1; j > 0 && lines[j] == 0; j-- { + size-- + lines[j] = size + } + + if !file.SetLines(lines) { + errorf("SetLines failed: %d", lines) // can't happen + } + return file +} + +func (p *iimporter) pkgAt(off uint64) *types.Package { + if pkg, ok := p.pkgCache[off]; ok { + return pkg + } + path := p.stringAt(off) + errorf("missing package %q in %q", path, p.ipath) + return nil +} + +func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { + if t, ok := p.typCache[off]; ok && canReuse(base, t) { + return t + } + + if off < predeclReserved { + errorf("predeclared type missing from cache: %v", off) + } + + r := &importReader{p: p} + r.declReader.Reset(p.declData[off-predeclReserved:]) + t := r.doType(base) + + if canReuse(base, t) { + p.typCache[off] = t + } + return t +} + +// canReuse reports whether the type rhs on the RHS of the declaration for def +// may be re-used. +// +// Specifically, if def is non-nil and rhs is an interface type with methods, it +// may not be re-used because we have a convention of setting the receiver type +// for interface methods to def. +func canReuse(def *types.Named, rhs types.Type) bool { + if def == nil { + return true + } + iface, _ := rhs.(*types.Interface) + if iface == nil { + return true + } + // Don't use iface.Empty() here as iface may not be complete. + return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0 +} + +type importReader struct { + p *iimporter + declReader bytes.Reader + currPkg *types.Package + prevFile string + prevLine int64 + prevColumn int64 +} + +func (r *importReader) obj(name string) { + tag := r.byte() + pos := r.pos() + + switch tag { + case 'A': + typ := r.typ() + + r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) + + case 'C': + typ, val := r.value() + + r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) + + case 'F', 'G': + var tparams []*types.TypeParam + if tag == 'G' { + tparams = r.tparamList() + } + sig := r.signature(nil, nil, tparams) + r.declare(types.NewFunc(pos, r.currPkg, name, sig)) + + case 'T', 'U': + // Types can be recursive. We need to setup a stub + // declaration before recursing. + obj := types.NewTypeName(pos, r.currPkg, name, nil) + named := types.NewNamed(obj, nil, nil) + // Declare obj before calling r.tparamList, so the new type name is recognized + // if used in the constraint of one of its own typeparams (see #48280). + r.declare(obj) + if tag == 'U' { + tparams := r.tparamList() + named.SetTypeParams(tparams) + } + + underlying := r.p.typAt(r.uint64(), named).Underlying() + named.SetUnderlying(underlying) + + if !isInterface(underlying) { + for n := r.uint64(); n > 0; n-- { + mpos := r.pos() + mname := r.ident() + recv := r.param() + + // If the receiver has any targs, set those as the + // rparams of the method (since those are the + // typeparams being used in the method sig/body). + base := baseType(recv.Type()) + assert(base != nil) + targs := base.TypeArgs() + var rparams []*types.TypeParam + if targs.Len() > 0 { + rparams = make([]*types.TypeParam, targs.Len()) + for i := range rparams { + rparams[i] = targs.At(i).(*types.TypeParam) + } + } + msig := r.signature(recv, rparams, nil) + + named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) + } + } + + case 'P': + // We need to "declare" a typeparam in order to have a name that + // can be referenced recursively (if needed) in the type param's + // bound. + if r.p.version < iexportVersionGenerics { + errorf("unexpected type param type") + } + name0 := tparamName(name) + tn := types.NewTypeName(pos, r.currPkg, name0, nil) + t := types.NewTypeParam(tn, nil) + + // To handle recursive references to the typeparam within its + // bound, save the partial type in tparamIndex before reading the bounds. + id := ident{r.currPkg, name} + r.p.tparamIndex[id] = t + var implicit bool + if r.p.version >= iexportVersionGo1_18 { + implicit = r.bool() + } + constraint := r.typ() + if implicit { + iface, _ := constraint.(*types.Interface) + if iface == nil { + errorf("non-interface constraint marked implicit") + } + iface.MarkImplicit() + } + // The constraint type may not be complete, if we + // are in the middle of a type recursion involving type + // constraints. So, we defer SetConstraint until we have + // completely set up all types in ImportData. + r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) + + case 'V': + typ := r.typ() + + r.declare(types.NewVar(pos, r.currPkg, name, typ)) + + default: + errorf("unexpected tag: %v", tag) + } +} + +func (r *importReader) declare(obj types.Object) { + obj.Pkg().Scope().Insert(obj) +} + +func (r *importReader) value() (typ types.Type, val constant.Value) { + typ = r.typ() + if r.p.version >= iexportVersionGo1_18 { + // TODO: add support for using the kind. + _ = constant.Kind(r.int64()) + } + + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { + case types.IsBoolean: + val = constant.MakeBool(r.bool()) + + case types.IsString: + val = constant.MakeString(r.string()) + + case types.IsInteger: + var x big.Int + r.mpint(&x, b) + val = constant.Make(&x) + + case types.IsFloat: + val = r.mpfloat(b) + + case types.IsComplex: + re := r.mpfloat(b) + im := r.mpfloat(b) + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + default: + if b.Kind() == types.Invalid { + val = constant.MakeUnknown() + return + } + errorf("unexpected type %v", typ) // panics + panic("unreachable") + } + + return +} + +func intSize(b *types.Basic) (signed bool, maxBytes uint) { + if (b.Info() & types.IsUntyped) != 0 { + return true, 64 + } + + switch b.Kind() { + case types.Float32, types.Complex64: + return true, 3 + case types.Float64, types.Complex128: + return true, 7 + } + + signed = (b.Info() & types.IsUnsigned) == 0 + switch b.Kind() { + case types.Int8, types.Uint8: + maxBytes = 1 + case types.Int16, types.Uint16: + maxBytes = 2 + case types.Int32, types.Uint32: + maxBytes = 4 + default: + maxBytes = 8 + } + + return +} + +func (r *importReader) mpint(x *big.Int, typ *types.Basic) { + signed, maxBytes := intSize(typ) + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + n, _ := r.declReader.ReadByte() + if uint(n) < maxSmall { + v := int64(n) + if signed { + v >>= 1 + if n&1 != 0 { + v = ^v + } + } + x.SetInt64(v) + return + } + + v := -n + if signed { + v = -(n &^ 1) >> 1 + } + if v < 1 || uint(v) > maxBytes { + errorf("weird decoding: %v, %v => %v", n, signed, v) + } + b := make([]byte, v) + io.ReadFull(&r.declReader, b) + x.SetBytes(b) + if signed && n&1 != 0 { + x.Neg(x) + } +} + +func (r *importReader) mpfloat(typ *types.Basic) constant.Value { + var mant big.Int + r.mpint(&mant, typ) + var f big.Float + f.SetInt(&mant) + if f.Sign() != 0 { + f.SetMantExp(&f, int(r.int64())) + } + return constant.Make(&f) +} + +func (r *importReader) ident() string { + return r.string() +} + +func (r *importReader) qualifiedIdent() (*types.Package, string) { + name := r.string() + pkg := r.pkg() + return pkg, name +} + +func (r *importReader) pos() token.Pos { + if r.p.shallow { + // precise offsets are encoded only in shallow mode + return r.posv2() + } + if r.p.version >= iexportVersionPosCol { + r.posv1() + } else { + r.posv0() + } + + if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { + return token.NoPos + } + return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) +} + +func (r *importReader) posv0() { + delta := r.int64() + if delta != deltaNewFile { + r.prevLine += delta + } else if l := r.int64(); l == -1 { + r.prevLine += deltaNewFile + } else { + r.prevFile = r.string() + r.prevLine = l + } +} + +func (r *importReader) posv1() { + delta := r.int64() + r.prevColumn += delta >> 1 + if delta&1 != 0 { + delta = r.int64() + r.prevLine += delta >> 1 + if delta&1 != 0 { + r.prevFile = r.string() + } + } +} + +func (r *importReader) posv2() token.Pos { + file := r.uint64() + if file == 0 { + return token.NoPos + } + tf := r.p.fileAt(file - 1) + return tf.Pos(int(r.uint64())) +} + +func (r *importReader) typ() types.Type { + return r.p.typAt(r.uint64(), nil) +} + +func isInterface(t types.Type) bool { + _, ok := t.(*types.Interface) + return ok +} + +func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } +func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } + +func (r *importReader) doType(base *types.Named) (res types.Type) { + k := r.kind() + if debug { + r.p.trace("importing type %d (base: %s)", k, base) + r.p.indent++ + defer func() { + r.p.indent-- + r.p.trace("=> %s", res) + }() + } + switch k { + default: + errorf("unexpected kind tag in %q: %v", r.p.ipath, k) + return nil + + case definedType: + pkg, name := r.qualifiedIdent() + r.p.doDecl(pkg, name) + return pkg.Scope().Lookup(name).(*types.TypeName).Type() + case pointerType: + return types.NewPointer(r.typ()) + case sliceType: + return types.NewSlice(r.typ()) + case arrayType: + n := r.uint64() + return types.NewArray(r.typ(), int64(n)) + case chanType: + dir := chanDir(int(r.uint64())) + return types.NewChan(dir, r.typ()) + case mapType: + return types.NewMap(r.typ(), r.typ()) + case signatureType: + r.currPkg = r.pkg() + return r.signature(nil, nil, nil) + + case structType: + r.currPkg = r.pkg() + + fields := make([]*types.Var, r.uint64()) + tags := make([]string, len(fields)) + for i := range fields { + var field *types.Var + if r.p.shallow { + field, _ = r.objectPathObject().(*types.Var) + } + + fpos := r.pos() + fname := r.ident() + ftyp := r.typ() + emb := r.bool() + tag := r.string() + + // Either this is not a shallow import, the field is local, or the + // encoded objectPath failed to produce an object (a bug). + // + // Even in this last, buggy case, fall back on creating a new field. As + // discussed in iexport.go, this is not correct, but mostly works and is + // preferable to failing (for now at least). + if field == nil { + field = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + } + + fields[i] = field + tags[i] = tag + } + return types.NewStruct(fields, tags) + + case interfaceType: + r.currPkg = r.pkg() + + embeddeds := make([]types.Type, r.uint64()) + for i := range embeddeds { + _ = r.pos() + embeddeds[i] = r.typ() + } + + methods := make([]*types.Func, r.uint64()) + for i := range methods { + var method *types.Func + if r.p.shallow { + method, _ = r.objectPathObject().(*types.Func) + } + + mpos := r.pos() + mname := r.ident() + + // TODO(mdempsky): Matches bimport.go, but I + // don't agree with this. + var recv *types.Var + if base != nil { + recv = types.NewVar(token.NoPos, r.currPkg, "", base) + } + msig := r.signature(recv, nil, nil) + + if method == nil { + method = types.NewFunc(mpos, r.currPkg, mname, msig) + } + methods[i] = method + } + + typ := newInterface(methods, embeddeds) + r.p.interfaceList = append(r.p.interfaceList, typ) + return typ + + case typeParamType: + if r.p.version < iexportVersionGenerics { + errorf("unexpected type param type") + } + pkg, name := r.qualifiedIdent() + id := ident{pkg, name} + if t, ok := r.p.tparamIndex[id]; ok { + // We're already in the process of importing this typeparam. + return t + } + // Otherwise, import the definition of the typeparam now. + r.p.doDecl(pkg, name) + return r.p.tparamIndex[id] + + case instanceType: + if r.p.version < iexportVersionGenerics { + errorf("unexpected instantiation type") + } + // pos does not matter for instances: they are positioned on the original + // type. + _ = r.pos() + len := r.uint64() + targs := make([]types.Type, len) + for i := range targs { + targs[i] = r.typ() + } + baseType := r.typ() + // The imported instantiated type doesn't include any methods, so + // we must always use the methods of the base (orig) type. + // TODO provide a non-nil *Environment + t, _ := types.Instantiate(nil, baseType, targs, false) + + // Workaround for golang/go#61561. See the doc for instanceList for details. + r.p.instanceList = append(r.p.instanceList, t) + return t + + case unionType: + if r.p.version < iexportVersionGenerics { + errorf("unexpected instantiation type") + } + terms := make([]*types.Term, r.uint64()) + for i := range terms { + terms[i] = types.NewTerm(r.bool(), r.typ()) + } + return types.NewUnion(terms) + } +} + +func (r *importReader) kind() itag { + return itag(r.uint64()) +} + +// objectPathObject is the inverse of exportWriter.objectPath. +// +// In shallow mode, certain fields and methods may need to be looked up in an +// imported package. See the doc for exportWriter.objectPath for a full +// explanation. +func (r *importReader) objectPathObject() types.Object { + objPath := objectpath.Path(r.string()) + if objPath == "" { + return nil + } + pkg := r.pkg() + obj, err := objectpath.Object(pkg, objPath) + if err != nil { + if r.p.reportf != nil { + r.p.reportf("failed to find object for objectPath %q: %v", objPath, err) + } + } + return obj +} + +func (r *importReader) signature(recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature { + params := r.paramList() + results := r.paramList() + variadic := params.Len() > 0 && r.bool() + return types.NewSignatureType(recv, rparams, tparams, params, results, variadic) +} + +func (r *importReader) tparamList() []*types.TypeParam { + n := r.uint64() + if n == 0 { + return nil + } + xs := make([]*types.TypeParam, n) + for i := range xs { + // Note: the standard library importer is tolerant of nil types here, + // though would panic in SetTypeParams. + xs[i] = r.typ().(*types.TypeParam) + } + return xs +} + +func (r *importReader) paramList() *types.Tuple { + xs := make([]*types.Var, r.uint64()) + for i := range xs { + xs[i] = r.param() + } + return types.NewTuple(xs...) +} + +func (r *importReader) param() *types.Var { + pos := r.pos() + name := r.ident() + typ := r.typ() + return types.NewParam(pos, r.currPkg, name, typ) +} + +func (r *importReader) bool() bool { + return r.uint64() != 0 +} + +func (r *importReader) int64() int64 { + n, err := binary.ReadVarint(&r.declReader) + if err != nil { + errorf("readVarint: %v", err) + } + return n +} + +func (r *importReader) uint64() uint64 { + n, err := binary.ReadUvarint(&r.declReader) + if err != nil { + errorf("readUvarint: %v", err) + } + return n +} + +func (r *importReader) byte() byte { + x, err := r.declReader.ReadByte() + if err != nil { + errorf("declReader.ReadByte: %v", err) + } + return x +} + +func baseType(typ types.Type) *types.Named { + // pointer receivers are never types.Named types + if p, _ := typ.(*types.Pointer); p != nil { + typ = p.Elem() + } + // receiver base types are always (possibly generic) types.Named types + n, _ := typ.(*types.Named) + return n +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go new file mode 100644 index 00000000000..8b163e3d058 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go @@ -0,0 +1,22 @@ +// 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 !go1.11 +// +build !go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + named := make([]*types.Named, len(embeddeds)) + for i, e := range embeddeds { + var ok bool + named[i], ok = e.(*types.Named) + if !ok { + panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") + } + } + return types.NewInterface(methods, named) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go new file mode 100644 index 00000000000..49984f40fd8 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go @@ -0,0 +1,14 @@ +// 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 go1.11 +// +build go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + return types.NewInterfaceType(methods, embeddeds) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go new file mode 100644 index 00000000000..d892273efb6 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go @@ -0,0 +1,16 @@ +// Copyright 2021 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 !go1.18 +// +build !go1.18 + +package gcimporter + +import "go/types" + +const iexportVersion = iexportVersionGo1_11 + +func additionalPredeclared() []types.Type { + return nil +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go new file mode 100644 index 00000000000..edbe6ea7041 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go @@ -0,0 +1,37 @@ +// Copyright 2021 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 go1.18 +// +build go1.18 + +package gcimporter + +import "go/types" + +const iexportVersion = iexportVersionGenerics + +// additionalPredeclared returns additional predeclared types in go.1.18. +func additionalPredeclared() []types.Type { + return []types.Type{ + // comparable + types.Universe.Lookup("comparable").Type(), + + // any + types.Universe.Lookup("any").Type(), + } +} + +// See cmd/compile/internal/types.SplitVargenSuffix. +func splitVargenSuffix(name string) (base, suffix string) { + i := len(name) + for i > 0 && name[i-1] >= '0' && name[i-1] <= '9' { + i-- + } + const dot = "·" + if i >= len(dot) && name[i-len(dot):i] == dot { + i -= len(dot) + return name[:i], name[i:] + } + return name, "" +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go new file mode 100644 index 00000000000..286bf445483 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go @@ -0,0 +1,10 @@ +// Copyright 2022 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 !(go1.18 && goexperiment.unified) +// +build !go1.18 !goexperiment.unified + +package gcimporter + +const unifiedIR = false diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go new file mode 100644 index 00000000000..b5d69ffbe68 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go @@ -0,0 +1,10 @@ +// Copyright 2022 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 go1.18 && goexperiment.unified +// +build go1.18,goexperiment.unified + +package gcimporter + +const unifiedIR = true diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go new file mode 100644 index 00000000000..8eb20729c2a --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go @@ -0,0 +1,19 @@ +// Copyright 2022 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 !go1.18 +// +build !go1.18 + +package gcimporter + +import ( + "fmt" + "go/token" + "go/types" +) + +func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + err = fmt.Errorf("go/tools compiled with a Go version earlier than 1.18 cannot read unified IR export data") + return +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go new file mode 100644 index 00000000000..b977435f626 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go @@ -0,0 +1,728 @@ +// Copyright 2021 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. + +// Derived from go/internal/gcimporter/ureader.go + +//go:build go1.18 +// +build go1.18 + +package gcimporter + +import ( + "fmt" + "go/token" + "go/types" + "sort" + "strings" + + "golang.org/x/tools/internal/pkgbits" +) + +// A pkgReader holds the shared state for reading a unified IR package +// description. +type pkgReader struct { + pkgbits.PkgDecoder + + fake fakeFileSet + + ctxt *types.Context + imports map[string]*types.Package // previously imported packages, indexed by path + + // lazily initialized arrays corresponding to the unified IR + // PosBase, Pkg, and Type sections, respectively. + posBases []string // position bases (i.e., file names) + pkgs []*types.Package + typs []types.Type + + // laterFns holds functions that need to be invoked at the end of + // import reading. + laterFns []func() + // laterFors is used in case of 'type A B' to ensure that B is processed before A. + laterFors map[types.Type]int + + // ifaces holds a list of constructed Interfaces, which need to have + // Complete called after importing is done. + ifaces []*types.Interface +} + +// later adds a function to be invoked at the end of import reading. +func (pr *pkgReader) later(fn func()) { + pr.laterFns = append(pr.laterFns, fn) +} + +// See cmd/compile/internal/noder.derivedInfo. +type derivedInfo struct { + idx pkgbits.Index + needed bool +} + +// See cmd/compile/internal/noder.typeInfo. +type typeInfo struct { + idx pkgbits.Index + derived bool +} + +func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + if !debug { + defer func() { + if x := recover(); x != nil { + err = fmt.Errorf("internal error in importing %q (%v); please report an issue", path, x) + } + }() + } + + s := string(data) + s = s[:strings.LastIndex(s, "\n$$\n")] + input := pkgbits.NewPkgDecoder(path, s) + pkg = readUnifiedPackage(fset, nil, imports, input) + return +} + +// laterFor adds a function to be invoked at the end of import reading, and records the type that function is finishing. +func (pr *pkgReader) laterFor(t types.Type, fn func()) { + if pr.laterFors == nil { + pr.laterFors = make(map[types.Type]int) + } + pr.laterFors[t] = len(pr.laterFns) + pr.laterFns = append(pr.laterFns, fn) +} + +// readUnifiedPackage reads a package description from the given +// unified IR export data decoder. +func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Package { + pr := pkgReader{ + PkgDecoder: input, + + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*fileInfo), + }, + + ctxt: ctxt, + imports: imports, + + posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)), + pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)), + typs: make([]types.Type, input.NumElems(pkgbits.RelocType)), + } + defer pr.fake.setLines() + + r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic) + pkg := r.pkg() + r.Bool() // has init + + for i, n := 0, r.Len(); i < n; i++ { + // As if r.obj(), but avoiding the Scope.Lookup call, + // to avoid eager loading of imports. + r.Sync(pkgbits.SyncObject) + assert(!r.Bool()) + r.p.objIdx(r.Reloc(pkgbits.RelocObj)) + assert(r.Len() == 0) + } + + r.Sync(pkgbits.SyncEOF) + + for _, fn := range pr.laterFns { + fn() + } + + for _, iface := range pr.ifaces { + iface.Complete() + } + + // Imports() of pkg are all of the transitive packages that were loaded. + var imps []*types.Package + for _, imp := range pr.pkgs { + if imp != nil && imp != pkg { + imps = append(imps, imp) + } + } + sort.Sort(byPath(imps)) + pkg.SetImports(imps) + + pkg.MarkComplete() + return pkg +} + +// A reader holds the state for reading a single unified IR element +// within a package. +type reader struct { + pkgbits.Decoder + + p *pkgReader + + dict *readerDict +} + +// A readerDict holds the state for type parameters that parameterize +// the current unified IR element. +type readerDict struct { + // bounds is a slice of typeInfos corresponding to the underlying + // bounds of the element's type parameters. + bounds []typeInfo + + // tparams is a slice of the constructed TypeParams for the element. + tparams []*types.TypeParam + + // devived is a slice of types derived from tparams, which may be + // instantiated while reading the current element. + derived []derivedInfo + derivedTypes []types.Type // lazily instantiated from derived +} + +func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { + return &reader{ + Decoder: pr.NewDecoder(k, idx, marker), + p: pr, + } +} + +func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { + return &reader{ + Decoder: pr.TempDecoder(k, idx, marker), + p: pr, + } +} + +func (pr *pkgReader) retireReader(r *reader) { + pr.RetireDecoder(&r.Decoder) +} + +// @@@ Positions + +func (r *reader) pos() token.Pos { + r.Sync(pkgbits.SyncPos) + if !r.Bool() { + return token.NoPos + } + + // TODO(mdempsky): Delta encoding. + posBase := r.posBase() + line := r.Uint() + col := r.Uint() + return r.p.fake.pos(posBase, int(line), int(col)) +} + +func (r *reader) posBase() string { + return r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase)) +} + +func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string { + if b := pr.posBases[idx]; b != "" { + return b + } + + var filename string + { + r := pr.tempReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase) + + // Within types2, position bases have a lot more details (e.g., + // keeping track of where //line directives appeared exactly). + // + // For go/types, we just track the file name. + + filename = r.String() + + if r.Bool() { // file base + // Was: "b = token.NewTrimmedFileBase(filename, true)" + } else { // line base + pos := r.pos() + line := r.Uint() + col := r.Uint() + + // Was: "b = token.NewLineBase(pos, filename, true, line, col)" + _, _, _ = pos, line, col + } + pr.retireReader(r) + } + b := filename + pr.posBases[idx] = b + return b +} + +// @@@ Packages + +func (r *reader) pkg() *types.Package { + r.Sync(pkgbits.SyncPkg) + return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg)) +} + +func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package { + // TODO(mdempsky): Consider using some non-nil pointer to indicate + // the universe scope, so we don't need to keep re-reading it. + if pkg := pr.pkgs[idx]; pkg != nil { + return pkg + } + + pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg() + pr.pkgs[idx] = pkg + return pkg +} + +func (r *reader) doPkg() *types.Package { + path := r.String() + switch path { + case "": + path = r.p.PkgPath() + case "builtin": + return nil // universe + case "unsafe": + return types.Unsafe + } + + if pkg := r.p.imports[path]; pkg != nil { + return pkg + } + + name := r.String() + + pkg := types.NewPackage(path, name) + r.p.imports[path] = pkg + + return pkg +} + +// @@@ Types + +func (r *reader) typ() types.Type { + return r.p.typIdx(r.typInfo(), r.dict) +} + +func (r *reader) typInfo() typeInfo { + r.Sync(pkgbits.SyncType) + if r.Bool() { + return typeInfo{idx: pkgbits.Index(r.Len()), derived: true} + } + return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false} +} + +func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type { + idx := info.idx + var where *types.Type + if info.derived { + where = &dict.derivedTypes[idx] + idx = dict.derived[idx].idx + } else { + where = &pr.typs[idx] + } + + if typ := *where; typ != nil { + return typ + } + + var typ types.Type + { + r := pr.tempReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx) + r.dict = dict + + typ = r.doTyp() + assert(typ != nil) + pr.retireReader(r) + } + // See comment in pkgReader.typIdx explaining how this happens. + if prev := *where; prev != nil { + return prev + } + + *where = typ + return typ +} + +func (r *reader) doTyp() (res types.Type) { + switch tag := pkgbits.CodeType(r.Code(pkgbits.SyncType)); tag { + default: + errorf("unhandled type tag: %v", tag) + panic("unreachable") + + case pkgbits.TypeBasic: + return types.Typ[r.Len()] + + case pkgbits.TypeNamed: + obj, targs := r.obj() + name := obj.(*types.TypeName) + if len(targs) != 0 { + t, _ := types.Instantiate(r.p.ctxt, name.Type(), targs, false) + return t + } + return name.Type() + + case pkgbits.TypeTypeParam: + return r.dict.tparams[r.Len()] + + case pkgbits.TypeArray: + len := int64(r.Uint64()) + return types.NewArray(r.typ(), len) + case pkgbits.TypeChan: + dir := types.ChanDir(r.Len()) + return types.NewChan(dir, r.typ()) + case pkgbits.TypeMap: + return types.NewMap(r.typ(), r.typ()) + case pkgbits.TypePointer: + return types.NewPointer(r.typ()) + case pkgbits.TypeSignature: + return r.signature(nil, nil, nil) + case pkgbits.TypeSlice: + return types.NewSlice(r.typ()) + case pkgbits.TypeStruct: + return r.structType() + case pkgbits.TypeInterface: + return r.interfaceType() + case pkgbits.TypeUnion: + return r.unionType() + } +} + +func (r *reader) structType() *types.Struct { + fields := make([]*types.Var, r.Len()) + var tags []string + for i := range fields { + pos := r.pos() + pkg, name := r.selector() + ftyp := r.typ() + tag := r.String() + embedded := r.Bool() + + fields[i] = types.NewField(pos, pkg, name, ftyp, embedded) + if tag != "" { + for len(tags) < i { + tags = append(tags, "") + } + tags = append(tags, tag) + } + } + return types.NewStruct(fields, tags) +} + +func (r *reader) unionType() *types.Union { + terms := make([]*types.Term, r.Len()) + for i := range terms { + terms[i] = types.NewTerm(r.Bool(), r.typ()) + } + return types.NewUnion(terms) +} + +func (r *reader) interfaceType() *types.Interface { + methods := make([]*types.Func, r.Len()) + embeddeds := make([]types.Type, r.Len()) + implicit := len(methods) == 0 && len(embeddeds) == 1 && r.Bool() + + for i := range methods { + pos := r.pos() + pkg, name := r.selector() + mtyp := r.signature(nil, nil, nil) + methods[i] = types.NewFunc(pos, pkg, name, mtyp) + } + + for i := range embeddeds { + embeddeds[i] = r.typ() + } + + iface := types.NewInterfaceType(methods, embeddeds) + if implicit { + iface.MarkImplicit() + } + + // We need to call iface.Complete(), but if there are any embedded + // defined types, then we may not have set their underlying + // interface type yet. So we need to defer calling Complete until + // after we've called SetUnderlying everywhere. + // + // TODO(mdempsky): After CL 424876 lands, it should be safe to call + // iface.Complete() immediately. + r.p.ifaces = append(r.p.ifaces, iface) + + return iface +} + +func (r *reader) signature(recv *types.Var, rtparams, tparams []*types.TypeParam) *types.Signature { + r.Sync(pkgbits.SyncSignature) + + params := r.params() + results := r.params() + variadic := r.Bool() + + return types.NewSignatureType(recv, rtparams, tparams, params, results, variadic) +} + +func (r *reader) params() *types.Tuple { + r.Sync(pkgbits.SyncParams) + + params := make([]*types.Var, r.Len()) + for i := range params { + params[i] = r.param() + } + + return types.NewTuple(params...) +} + +func (r *reader) param() *types.Var { + r.Sync(pkgbits.SyncParam) + + pos := r.pos() + pkg, name := r.localIdent() + typ := r.typ() + + return types.NewParam(pos, pkg, name, typ) +} + +// @@@ Objects + +func (r *reader) obj() (types.Object, []types.Type) { + r.Sync(pkgbits.SyncObject) + + assert(!r.Bool()) + + pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj)) + obj := pkgScope(pkg).Lookup(name) + + targs := make([]types.Type, r.Len()) + for i := range targs { + targs[i] = r.typ() + } + + return obj, targs +} + +func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { + + var objPkg *types.Package + var objName string + var tag pkgbits.CodeObj + { + rname := pr.tempReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) + + objPkg, objName = rname.qualifiedIdent() + assert(objName != "") + + tag = pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) + pr.retireReader(rname) + } + + if tag == pkgbits.ObjStub { + assert(objPkg == nil || objPkg == types.Unsafe) + return objPkg, objName + } + + // Ignore local types promoted to global scope (#55110). + if _, suffix := splitVargenSuffix(objName); suffix != "" { + return objPkg, objName + } + + if objPkg.Scope().Lookup(objName) == nil { + dict := pr.objDictIdx(idx) + + r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) + r.dict = dict + + declare := func(obj types.Object) { + objPkg.Scope().Insert(obj) + } + + switch tag { + default: + panic("weird") + + case pkgbits.ObjAlias: + pos := r.pos() + typ := r.typ() + declare(types.NewTypeName(pos, objPkg, objName, typ)) + + case pkgbits.ObjConst: + pos := r.pos() + typ := r.typ() + val := r.Value() + declare(types.NewConst(pos, objPkg, objName, typ, val)) + + case pkgbits.ObjFunc: + pos := r.pos() + tparams := r.typeParamNames() + sig := r.signature(nil, nil, tparams) + declare(types.NewFunc(pos, objPkg, objName, sig)) + + case pkgbits.ObjType: + pos := r.pos() + + obj := types.NewTypeName(pos, objPkg, objName, nil) + named := types.NewNamed(obj, nil, nil) + declare(obj) + + named.SetTypeParams(r.typeParamNames()) + + setUnderlying := func(underlying types.Type) { + // If the underlying type is an interface, we need to + // duplicate its methods so we can replace the receiver + // parameter's type (#49906). + if iface, ok := underlying.(*types.Interface); ok && iface.NumExplicitMethods() != 0 { + methods := make([]*types.Func, iface.NumExplicitMethods()) + for i := range methods { + fn := iface.ExplicitMethod(i) + sig := fn.Type().(*types.Signature) + + recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named) + methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignature(recv, sig.Params(), sig.Results(), sig.Variadic())) + } + + embeds := make([]types.Type, iface.NumEmbeddeds()) + for i := range embeds { + embeds[i] = iface.EmbeddedType(i) + } + + newIface := types.NewInterfaceType(methods, embeds) + r.p.ifaces = append(r.p.ifaces, newIface) + underlying = newIface + } + + named.SetUnderlying(underlying) + } + + // Since go.dev/cl/455279, we can assume rhs.Underlying() will + // always be non-nil. However, to temporarily support users of + // older snapshot releases, we continue to fallback to the old + // behavior for now. + // + // TODO(mdempsky): Remove fallback code and simplify after + // allowing time for snapshot users to upgrade. + rhs := r.typ() + if underlying := rhs.Underlying(); underlying != nil { + setUnderlying(underlying) + } else { + pk := r.p + pk.laterFor(named, func() { + // First be sure that the rhs is initialized, if it needs to be initialized. + delete(pk.laterFors, named) // prevent cycles + if i, ok := pk.laterFors[rhs]; ok { + f := pk.laterFns[i] + pk.laterFns[i] = func() {} // function is running now, so replace it with a no-op + f() // initialize RHS + } + setUnderlying(rhs.Underlying()) + }) + } + + for i, n := 0, r.Len(); i < n; i++ { + named.AddMethod(r.method()) + } + + case pkgbits.ObjVar: + pos := r.pos() + typ := r.typ() + declare(types.NewVar(pos, objPkg, objName, typ)) + } + } + + return objPkg, objName +} + +func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { + + var dict readerDict + + { + r := pr.tempReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1) + if implicits := r.Len(); implicits != 0 { + errorf("unexpected object with %v implicit type parameter(s)", implicits) + } + + dict.bounds = make([]typeInfo, r.Len()) + for i := range dict.bounds { + dict.bounds[i] = r.typInfo() + } + + dict.derived = make([]derivedInfo, r.Len()) + dict.derivedTypes = make([]types.Type, len(dict.derived)) + for i := range dict.derived { + dict.derived[i] = derivedInfo{r.Reloc(pkgbits.RelocType), r.Bool()} + } + + pr.retireReader(r) + } + // function references follow, but reader doesn't need those + + return &dict +} + +func (r *reader) typeParamNames() []*types.TypeParam { + r.Sync(pkgbits.SyncTypeParamNames) + + // Note: This code assumes it only processes objects without + // implement type parameters. This is currently fine, because + // reader is only used to read in exported declarations, which are + // always package scoped. + + if len(r.dict.bounds) == 0 { + return nil + } + + // Careful: Type parameter lists may have cycles. To allow for this, + // we construct the type parameter list in two passes: first we + // create all the TypeNames and TypeParams, then we construct and + // set the bound type. + + r.dict.tparams = make([]*types.TypeParam, len(r.dict.bounds)) + for i := range r.dict.bounds { + pos := r.pos() + pkg, name := r.localIdent() + + tname := types.NewTypeName(pos, pkg, name, nil) + r.dict.tparams[i] = types.NewTypeParam(tname, nil) + } + + typs := make([]types.Type, len(r.dict.bounds)) + for i, bound := range r.dict.bounds { + typs[i] = r.p.typIdx(bound, r.dict) + } + + // TODO(mdempsky): This is subtle, elaborate further. + // + // We have to save tparams outside of the closure, because + // typeParamNames() can be called multiple times with the same + // dictionary instance. + // + // Also, this needs to happen later to make sure SetUnderlying has + // been called. + // + // TODO(mdempsky): Is it safe to have a single "later" slice or do + // we need to have multiple passes? See comments on CL 386002 and + // go.dev/issue/52104. + tparams := r.dict.tparams + r.p.later(func() { + for i, typ := range typs { + tparams[i].SetConstraint(typ) + } + }) + + return r.dict.tparams +} + +func (r *reader) method() *types.Func { + r.Sync(pkgbits.SyncMethod) + pos := r.pos() + pkg, name := r.selector() + + rparams := r.typeParamNames() + sig := r.signature(r.param(), rparams, nil) + + _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. + return types.NewFunc(pos, pkg, name, sig) +} + +func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) } +func (r *reader) localIdent() (*types.Package, string) { return r.ident(pkgbits.SyncLocalIdent) } +func (r *reader) selector() (*types.Package, string) { return r.ident(pkgbits.SyncSelector) } + +func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string) { + r.Sync(marker) + return r.pkg(), r.String() +} + +// pkgScope returns pkg.Scope(). +// If pkg is nil, it returns types.Universe instead. +// +// TODO(mdempsky): Remove after x/tools can depend on Go 1.19. +func pkgScope(pkg *types.Package) *types.Scope { + if pkg != nil { + return pkg.Scope() + } + return types.Universe +} diff --git a/upstream/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/upstream/vendor/golang.org/x/tools/internal/gocommand/invoke.go index eb7a8282f9e..55312522dc2 100644 --- a/upstream/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/upstream/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -25,6 +25,7 @@ import ( "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/event/keys" "golang.org/x/tools/internal/event/label" + "golang.org/x/tools/internal/event/tag" ) // An Runner will run go command invocations and serialize @@ -54,14 +55,11 @@ func (runner *Runner) initialize() { // 1.14: go: updating go.mod: existing contents have changed since last read var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) -// event keys for go command invocations -var ( - verb = keys.NewString("verb", "go command verb") - directory = keys.NewString("directory", "") -) +// verb is an event label for the go command verb. +var verb = keys.NewString("verb", "go command verb") func invLabels(inv Invocation) []label.Label { - return []label.Label{verb.Of(inv.Verb), directory.Of(inv.WorkingDir)} + return []label.Label{verb.Of(inv.Verb), tag.Directory.Of(inv.WorkingDir)} } // Run is a convenience wrapper around RunRaw. @@ -160,15 +158,12 @@ type Invocation struct { BuildFlags []string // If ModFlag is set, the go command is invoked with -mod=ModFlag. - // TODO(rfindley): remove, in favor of Args. ModFlag string // If ModFile is set, the go command is invoked with -modfile=ModFile. - // TODO(rfindley): remove, in favor of Args. ModFile string // If Overlay is set, the go command is invoked with -overlay=Overlay. - // TODO(rfindley): remove, in favor of Args. Overlay string // If CleanEnv is set, the invocation will run only with the environment diff --git a/upstream/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/upstream/vendor/golang.org/x/tools/internal/gocommand/vendor.go index e38d1fb4888..2d3d408c0be 100644 --- a/upstream/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ b/upstream/vendor/golang.org/x/tools/internal/gocommand/vendor.go @@ -107,57 +107,3 @@ func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*Modul } return mod, lines[4] == "go1.14", nil } - -// WorkspaceVendorEnabled reports whether workspace vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func WorkspaceVendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, []*ModuleJSON, error) { - inv.Verb = "env" - inv.Args = []string{"GOWORK"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goWork := string(bytes.TrimSpace(stdout.Bytes())) - if fi, err := os.Stat(filepath.Join(filepath.Dir(goWork), "vendor")); err == nil && fi.IsDir() { - mainMods, err := getWorkspaceMainModules(ctx, inv, r) - if err != nil { - return false, nil, err - } - return true, mainMods, nil - } - return false, nil, nil -} - -// getWorkspaceMainModules gets the main modules' information. -// This is the information needed to figure out if vendoring should be enabled. -func getWorkspaceMainModules(ctx context.Context, inv Invocation, r *Runner) ([]*ModuleJSON, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, err - } - - lines := strings.Split(strings.TrimSuffix(stdout.String(), "\n"), "\n") - if len(lines) < 4 { - return nil, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mods := make([]*ModuleJSON, 0, len(lines)/4) - for i := 0; i < len(lines); i += 4 { - mods = append(mods, &ModuleJSON{ - Path: lines[i], - Dir: lines[i+1], - GoMod: lines[i+2], - GoVersion: lines[i+3], - Main: true, - }) - } - return mods, nil -} diff --git a/upstream/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/upstream/vendor/golang.org/x/tools/internal/gopathwalk/walk.go index 8361515519f..52f74e643be 100644 --- a/upstream/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ b/upstream/vendor/golang.org/x/tools/internal/gopathwalk/walk.go @@ -9,13 +9,11 @@ package gopathwalk import ( "bufio" "bytes" - "io" "io/fs" + "log" "os" "path/filepath" - "runtime" "strings" - "sync" "time" ) @@ -23,13 +21,8 @@ import ( type Options struct { // If Logf is non-nil, debug logging is enabled through this function. Logf func(format string, args ...interface{}) - // Search module caches. Also disables legacy goimports ignore rules. ModulesEnabled bool - - // Maximum number of concurrent calls to user-provided callbacks, - // or 0 for GOMAXPROCS. - Concurrency int } // RootType indicates the type of a Root. @@ -50,28 +43,19 @@ type Root struct { Type RootType } -// Walk concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// +// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. // For each package found, add will be called with the absolute // paths of the containing source directory and the package directory. -// -// Unlike filepath.WalkDir, Walk follows symbolic links -// (while guarding against cycles). func Walk(roots []Root, add func(root Root, dir string), opts Options) { WalkSkip(roots, add, func(Root, string) bool { return false }, opts) } -// WalkSkip concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to -// find packages. -// +// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. // For each package found, add will be called with the absolute // paths of the containing source directory and the package directory. // For each directory that will be scanned, skip will be called // with the absolute paths of the containing source directory and the directory. // If skip returns false on a directory it will be processed. -// -// Unlike filepath.WalkDir, WalkSkip follows symbolic links -// (while guarding against cycles). func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { for _, root := range roots { walkDir(root, add, skip, opts) @@ -80,51 +64,45 @@ func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root // walkDir creates a walker and starts fastwalk with this walker. func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { - if opts.Logf == nil { - opts.Logf = func(format string, args ...interface{}) {} - } if _, err := os.Stat(root.Path); os.IsNotExist(err) { - opts.Logf("skipping nonexistent directory: %v", root.Path) + if opts.Logf != nil { + opts.Logf("skipping nonexistent directory: %v", root.Path) + } return } start := time.Now() - opts.Logf("scanning %s", root.Path) - - concurrency := opts.Concurrency - if concurrency == 0 { - // The walk be either CPU-bound or I/O-bound, depending on what the - // caller-supplied add function does and the details of the user's platform - // and machine. Rather than trying to fine-tune the concurrency level for a - // specific environment, we default to GOMAXPROCS: it is likely to be a good - // choice for a CPU-bound add function, and if it is instead I/O-bound, then - // dealing with I/O saturation is arguably the job of the kernel and/or - // runtime. (Oversaturating I/O seems unlikely to harm performance as badly - // as failing to saturate would.) - concurrency = runtime.GOMAXPROCS(0) + if opts.Logf != nil { + opts.Logf("scanning %s", root.Path) } + w := &walker{ - root: root, - add: add, - skip: skip, - opts: opts, - sem: make(chan struct{}, concurrency), + root: root, + add: add, + skip: skip, + opts: opts, + added: make(map[string]bool), } w.init() - w.sem <- struct{}{} + // Add a trailing path separator to cause filepath.WalkDir to traverse symlinks. path := root.Path - if path == "" { - path = "." + if len(path) == 0 { + path = "." + string(filepath.Separator) + } else if !os.IsPathSeparator(path[len(path)-1]) { + path = path + string(filepath.Separator) } - if fi, err := os.Lstat(path); err == nil { - w.walk(path, nil, fs.FileInfoToDirEntry(fi)) - } else { - w.opts.Logf("scanning directory %v: %v", root.Path, err) + + if err := filepath.WalkDir(path, w.walk); err != nil { + logf := opts.Logf + if logf == nil { + logf = log.Printf + } + logf("scanning directory %v: %v", root.Path, err) } - <-w.sem - w.walking.Wait() - opts.Logf("scanned %s in %v", root.Path, time.Since(start)) + if opts.Logf != nil { + opts.Logf("scanned %s in %v", root.Path, time.Since(start)) + } } // walker is the callback for fastwalk.Walk. @@ -134,18 +112,10 @@ type walker struct { skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. opts Options // Options passed to Walk by the user. - walking sync.WaitGroup - sem chan struct{} // Channel of semaphore tokens; send to acquire, receive to release. - ignoredDirs []string + pathSymlinks []os.FileInfo + ignoredDirs []string - added sync.Map // map[string]bool -} - -// A symlinkList is a linked list of os.FileInfos for parent directories -// reached via symlinks. -type symlinkList struct { - info os.FileInfo - prev *symlinkList + added map[string]bool } // init initializes the walker based on its Options @@ -162,7 +132,9 @@ func (w *walker) init() { for _, p := range ignoredPaths { full := filepath.Join(w.root.Path, p) w.ignoredDirs = append(w.ignoredDirs, full) - w.opts.Logf("Directory added to ignore list: %s", full) + if w.opts.Logf != nil { + w.opts.Logf("Directory added to ignore list: %s", full) + } } } @@ -172,10 +144,12 @@ func (w *walker) init() { func (w *walker) getIgnoredDirs(path string) []string { file := filepath.Join(path, ".goimportsignore") slurp, err := os.ReadFile(file) - if err != nil { - w.opts.Logf("%v", err) - } else { - w.opts.Logf("Read %s", file) + if w.opts.Logf != nil { + if err != nil { + w.opts.Logf("%v", err) + } else { + w.opts.Logf("Read %s", file) + } } if err != nil { return nil @@ -209,129 +183,149 @@ func (w *walker) shouldSkipDir(dir string) bool { // walk walks through the given path. // -// Errors are logged if w.opts.Logf is non-nil, but otherwise ignored. -func (w *walker) walk(path string, pathSymlinks *symlinkList, d fs.DirEntry) { - if d.Type()&os.ModeSymlink != 0 { - // Walk the symlink's target rather than the symlink itself. - // - // (Note that os.Stat, unlike the lower-lever os.Readlink, - // follows arbitrarily many layers of symlinks, so it will eventually - // reach either a non-symlink or a nonexistent target.) - // - // TODO(bcmills): 'go list all' itself ignores symlinks within GOROOT/src - // and GOPATH/src. Do we really need to traverse them here? If so, why? - - fi, err := os.Stat(path) - if err != nil { +// Errors are logged if w.opts.Logf is non-nil, but otherwise ignored: +// walk returns only nil or fs.SkipDir. +func (w *walker) walk(path string, d fs.DirEntry, err error) error { + if err != nil { + // We have no way to report errors back through Walk or WalkSkip, + // so just log and ignore them. + if w.opts.Logf != nil { w.opts.Logf("%v", err) - return - } - - // Avoid walking symlink cycles: if we have already followed a symlink to - // this directory as a parent of itself, don't follow it again. - // - // This doesn't catch the first time through a cycle, but it also minimizes - // the number of extra stat calls we make if we *don't* encounter a cycle. - // Since we don't actually expect to encounter symlink cycles in practice, - // this seems like the right tradeoff. - for parent := pathSymlinks; parent != nil; parent = parent.prev { - if os.SameFile(fi, parent.info) { - return - } } - - pathSymlinks = &symlinkList{ - info: fi, - prev: pathSymlinks, + if d == nil { + // Nothing more to do: the error prevents us from knowing + // what path even represents. + return nil } - d = fs.FileInfoToDirEntry(fi) } if d.Type().IsRegular() { if !strings.HasSuffix(path, ".go") { - return + return nil } dir := filepath.Dir(path) if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { // Doesn't make sense to have regular files // directly in your $GOPATH/src or $GOROOT/src. - // - // TODO(bcmills): there are many levels of directory within - // RootModuleCache where this also wouldn't make sense, - // Can we generalize this to any directory without a corresponding - // import path? - return + return nil } - if _, dup := w.added.LoadOrStore(dir, true); !dup { + if !w.added[dir] { w.add(w.root, dir) + w.added[dir] = true } + return nil } - if !d.IsDir() { - return + if d.IsDir() { + base := filepath.Base(path) + if base == "" || base[0] == '.' || base[0] == '_' || + base == "testdata" || + (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || + (!w.opts.ModulesEnabled && base == "node_modules") { + return fs.SkipDir + } + if w.shouldSkipDir(path) { + return fs.SkipDir + } + return nil } - base := filepath.Base(path) - if base == "" || base[0] == '.' || base[0] == '_' || - base == "testdata" || - (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || - (!w.opts.ModulesEnabled && base == "node_modules") || - w.shouldSkipDir(path) { - return - } + if d.Type()&os.ModeSymlink != 0 { + // TODO(bcmills): 'go list all' itself ignores symlinks within GOROOT/src + // and GOPATH/src. Do we really need to traverse them here? If so, why? - // Read the directory and walk its entries. + fi, err := os.Stat(path) + if err != nil || !fi.IsDir() { + // Not a directory. Just walk the file (or broken link) and be done. + return w.walk(path, fs.FileInfoToDirEntry(fi), err) + } - f, err := os.Open(path) - if err != nil { - w.opts.Logf("%v", err) - return - } - defer f.Close() - - for { - // We impose an arbitrary limit on the number of ReadDir results per - // directory to limit the amount of memory consumed for stale or upcoming - // directory entries. The limit trades off CPU (number of syscalls to read - // the whole directory) against RAM (reachable directory entries other than - // the one currently being processed). + // Avoid walking symlink cycles: if we have already followed a symlink to + // this directory as a parent of itself, don't follow it again. // - // Since we process the directories recursively, we will end up maintaining - // a slice of entries for each level of the directory tree. - // (Compare https://go.dev/issue/36197.) - ents, err := f.ReadDir(1024) + // This doesn't catch the first time through a cycle, but it also minimizes + // the number of extra stat calls we make if we *don't* encounter a cycle. + // Since we don't actually expect to encounter symlink cycles in practice, + // this seems like the right tradeoff. + for _, parent := range w.pathSymlinks { + if os.SameFile(fi, parent) { + return nil + } + } + + w.pathSymlinks = append(w.pathSymlinks, fi) + defer func() { + w.pathSymlinks = w.pathSymlinks[:len(w.pathSymlinks)-1] + }() + + // On some platforms the OS (or the Go os package) sometimes fails to + // resolve directory symlinks before a trailing slash + // (even though POSIX requires it to do so). + // + // On macOS that failure may be caused by a known libc/kernel bug; + // see https://go.dev/issue/59586. + // + // On Windows before Go 1.21, it may be caused by a bug in + // os.Lstat (fixed in https://go.dev/cl/463177). + // + // Since we need to handle this explicitly on broken platforms anyway, + // it is simplest to just always do that and not rely on POSIX pathname + // resolution to walk the directory (such as by calling WalkDir with + // a trailing slash appended to the path). + // + // Instead, we make a sequence of walk calls — directly and through + // recursive calls to filepath.WalkDir — simulating what WalkDir would do + // if the symlink were a regular directory. + + // First we call walk on the path as a directory + // (instead of a symlink). + err = w.walk(path, fs.FileInfoToDirEntry(fi), nil) + if err == fs.SkipDir { + return nil + } else if err != nil { + // This should be impossible, but handle it anyway in case + // walk is changed to return other errors. + return err + } + + // Now read the directory and walk its entries. + ents, err := os.ReadDir(path) if err != nil { - if err != io.EOF { - w.opts.Logf("%v", err) + // Report the ReadDir error, as filepath.WalkDir would do. + err = w.walk(path, fs.FileInfoToDirEntry(fi), err) + if err == fs.SkipDir { + return nil + } else if err != nil { + return err // Again, should be impossible. } - break + // Fall through and iterate over whatever entries we did manage to get. } for _, d := range ents { nextPath := filepath.Join(path, d.Name()) if d.IsDir() { - select { - case w.sem <- struct{}{}: - // Got a new semaphore token, so we can traverse the directory concurrently. - d := d - w.walking.Add(1) - go func() { - defer func() { - <-w.sem - w.walking.Done() - }() - w.walk(nextPath, pathSymlinks, d) - }() - continue - - default: - // No tokens available, so traverse serially. + // We want to walk the whole directory tree rooted at nextPath, + // not just the single entry for the directory. + err := filepath.WalkDir(nextPath, w.walk) + if err != nil && w.opts.Logf != nil { + w.opts.Logf("%v", err) + } + } else { + err := w.walk(nextPath, d, nil) + if err == fs.SkipDir { + // Skip the rest of the entries in the parent directory of nextPath + // (that is, path itself). + break + } else if err != nil { + return err // Again, should be impossible. } } - - w.walk(nextPath, pathSymlinks, d) } + return nil } + + // Not a file, regular directory, or symlink; skip. + return nil } diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/fix.go b/upstream/vendor/golang.org/x/tools/internal/imports/fix.go index 93d49a6efd0..dd369c072e0 100644 --- a/upstream/vendor/golang.org/x/tools/internal/imports/fix.go +++ b/upstream/vendor/golang.org/x/tools/internal/imports/fix.go @@ -13,7 +13,6 @@ import ( "go/build" "go/parser" "go/token" - "go/types" "io/fs" "io/ioutil" "os" @@ -31,7 +30,6 @@ import ( "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/gopathwalk" - "golang.org/x/tools/internal/stdlib" ) // importToGroup is a list of functions which map from an import path to @@ -301,20 +299,6 @@ func (p *pass) loadPackageNames(imports []*ImportInfo) error { return nil } -// if there is a trailing major version, remove it -func withoutVersion(nm string) string { - if v := path.Base(nm); len(v) > 0 && v[0] == 'v' { - if _, err := strconv.Atoi(v[1:]); err == nil { - // this is, for instance, called with rand/v2 and returns rand - if len(v) < len(nm) { - xnm := nm[:len(nm)-len(v)-1] - return path.Base(xnm) - } - } - } - return nm -} - // importIdentifier returns the identifier that imp will introduce. It will // guess if the package name has not been loaded, e.g. because the source // is not available. @@ -324,7 +308,7 @@ func (p *pass) importIdentifier(imp *ImportInfo) string { } known := p.knownPackages[imp.ImportPath] if known != nil && known.name != "" { - return withoutVersion(known.name) + return known.name } return ImportPathToAssumedName(imp.ImportPath) } @@ -526,9 +510,9 @@ func (p *pass) assumeSiblingImportsValid() { } for left, rights := range refs { if imp, ok := importsByName[left]; ok { - if m, ok := stdlib.PackageSymbols[imp.ImportPath]; ok { + if m, ok := stdlib[imp.ImportPath]; ok { // We have the stdlib in memory; no need to guess. - rights = symbolNameSet(m) + rights = copyExports(m) } p.addCandidate(imp, &packageInfo{ // no name; we already know it. @@ -656,7 +640,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena dupCheck := map[string]struct{}{} // Start off with the standard library. - for importPath, symbols := range stdlib.PackageSymbols { + for importPath, exports := range stdlib { p := &pkg{ dir: filepath.Join(goenv["GOROOT"], "src", importPath), importPathShort: importPath, @@ -665,13 +649,6 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena } dupCheck[importPath] = struct{}{} if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { - var exports []stdlib.Symbol - for _, sym := range symbols { - switch sym.Kind { - case stdlib.Func, stdlib.Type, stdlib.Var, stdlib.Const: - exports = append(exports, sym) - } - } wrappedCallback.exportsLoaded(p, exports) } } @@ -692,7 +669,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena dupCheck[pkg.importPathShort] = struct{}{} return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) }, - exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { + exportsLoaded: func(pkg *pkg, exports []string) { // If we're an x_test, load the package under test's test variant. if strings.HasSuffix(filePkg, "_test") && pkg.dir == filepath.Dir(filename) { var err error @@ -723,21 +700,20 @@ func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map return result, nil } -func PrimeCache(ctx context.Context, resolver Resolver) error { +func PrimeCache(ctx context.Context, env *ProcessEnv) error { // Fully scan the disk for directories, but don't actually read any Go files. callback := &scanCallback{ - rootFound: func(root gopathwalk.Root) bool { - // See getCandidatePkgs: walking GOROOT is apparently expensive and - // unnecessary. - return root.Type != gopathwalk.RootGOROOT + rootFound: func(gopathwalk.Root) bool { + return true }, dirFound: func(pkg *pkg) bool { return false }, - // packageNameLoaded and exportsLoaded must never be called. + packageNameLoaded: func(pkg *pkg) bool { + return false + }, } - - return resolver.scan(ctx, callback) + return getCandidatePkgs(ctx, callback, "", "", env) } func candidateImportName(pkg *pkg) string { @@ -817,7 +793,7 @@ func GetImportPaths(ctx context.Context, wrapped func(ImportFix), searchPrefix, // A PackageExport is a package and its exports. type PackageExport struct { Fix *ImportFix - Exports []stdlib.Symbol + Exports []string } // GetPackageExports returns all known packages with name pkg and their exports. @@ -832,8 +808,8 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP packageNameLoaded: func(pkg *pkg) bool { return pkg.packageName == searchPkg }, - exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { - sortSymbols(exports) + exportsLoaded: func(pkg *pkg, exports []string) { + sort.Strings(exports) wrapped(PackageExport{ Fix: &ImportFix{ StmtInfo: ImportInfo{ @@ -851,45 +827,16 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP return getCandidatePkgs(ctx, callback, filename, filePkg, env) } -// TODO(rfindley): we should depend on GOOS and GOARCH, to provide accurate -// imports when doing cross-platform development. -var requiredGoEnvVars = []string{ - "GO111MODULE", - "GOFLAGS", - "GOINSECURE", - "GOMOD", - "GOMODCACHE", - "GONOPROXY", - "GONOSUMDB", - "GOPATH", - "GOPROXY", - "GOROOT", - "GOSUMDB", - "GOWORK", -} +var requiredGoEnvVars = []string{"GO111MODULE", "GOFLAGS", "GOINSECURE", "GOMOD", "GOMODCACHE", "GONOPROXY", "GONOSUMDB", "GOPATH", "GOPROXY", "GOROOT", "GOSUMDB", "GOWORK"} // ProcessEnv contains environment variables and settings that affect the use of // the go command, the go/build package, etc. -// -// ...a ProcessEnv *also* overwrites its Env along with derived state in the -// form of the resolver. And because it is lazily initialized, an env may just -// be broken and unusable, but there is no way for the caller to detect that: -// all queries will just fail. -// -// TODO(rfindley): refactor this package so that this type (perhaps renamed to -// just Env or Config) is an immutable configuration struct, to be exchanged -// for an initialized object via a constructor that returns an error. Perhaps -// the signature should be `func NewResolver(*Env) (*Resolver, error)`, where -// resolver is a concrete type used for resolving imports. Via this -// refactoring, we can avoid the need to call ProcessEnv.init and -// ProcessEnv.GoEnv everywhere, and implicitly fix all the places where this -// these are misused. Also, we'd delegate the caller the decision of how to -// handle a broken environment. type ProcessEnv struct { GocmdRunner *gocommand.Runner BuildFlags []string ModFlag string + ModFile string // SkipPathInScan returns true if the path should be skipped from scans of // the RootCurrentModule root type. The function argument is a clean, @@ -899,7 +846,7 @@ type ProcessEnv struct { // Env overrides the OS environment, and can be used to specify // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because // exec.Command will not honor it. - // Specifying all of requiredGoEnvVars avoids a call to `go env`. + // Specifying all of RequiredGoEnvVars avoids a call to `go env`. Env map[string]string WorkingDir string @@ -907,17 +854,9 @@ type ProcessEnv struct { // If Logf is non-nil, debug logging is enabled through this function. Logf func(format string, args ...interface{}) - // If set, ModCache holds a shared cache of directory info to use across - // multiple ProcessEnvs. - ModCache *DirInfoCache - - initialized bool // see TODO above + initialized bool - // resolver and resolverErr are lazily evaluated (see GetResolver). - // This is unclean, but see the big TODO in the docstring for ProcessEnv - // above: for now, we can't be sure that the ProcessEnv is fully initialized. - resolver Resolver - resolverErr error + resolver Resolver } func (e *ProcessEnv) goEnv() (map[string]string, error) { @@ -997,33 +936,20 @@ func (e *ProcessEnv) env() []string { } func (e *ProcessEnv) GetResolver() (Resolver, error) { + if e.resolver != nil { + return e.resolver, nil + } if err := e.init(); err != nil { return nil, err } - - if e.resolver == nil && e.resolverErr == nil { - // TODO(rfindley): we should only use a gopathResolver here if the working - // directory is actually *in* GOPATH. (I seem to recall an open gopls issue - // for this behavior, but I can't find it). - // - // For gopls, we can optionally explicitly choose a resolver type, since we - // already know the view type. - if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { - e.resolver = newGopathResolver(e) - } else if r, err := newModuleResolver(e, e.ModCache); err != nil { - e.resolverErr = err - } else { - e.resolver = Resolver(r) - } + if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { + e.resolver = newGopathResolver(e) + return e.resolver, nil } - - return e.resolver, e.resolverErr + e.resolver = newModuleResolver(e) + return e.resolver, nil } -// buildContext returns the build.Context to use for matching files. -// -// TODO(rfindley): support dynamic GOOS, GOARCH here, when doing cross-platform -// development. func (e *ProcessEnv) buildContext() (*build.Context, error) { ctx := build.Default goenv, err := e.goEnv() @@ -1073,40 +999,24 @@ func addStdlibCandidates(pass *pass, refs references) error { if err != nil { return err } - localbase := func(nm string) string { - ans := path.Base(nm) - if ans[0] == 'v' { - // this is called, for instance, with math/rand/v2 and returns rand/v2 - if _, err := strconv.Atoi(ans[1:]); err == nil { - ix := strings.LastIndex(nm, ans) - more := path.Base(nm[:ix]) - ans = path.Join(more, ans) - } - } - return ans - } add := func(pkg string) { // Prevent self-imports. if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir { return } - exports := symbolNameSet(stdlib.PackageSymbols[pkg]) + exports := copyExports(stdlib[pkg]) pass.addCandidate( &ImportInfo{ImportPath: pkg}, - &packageInfo{name: localbase(pkg), exports: exports}) + &packageInfo{name: path.Base(pkg), exports: exports}) } for left := range refs { if left == "rand" { - // Make sure we try crypto/rand before any version of math/rand as both have Int() - // and our policy is to recommend crypto + // Make sure we try crypto/rand before math/rand. add("crypto/rand") - // if the user's no later than go1.21, this should be "math/rand" - // but we have no way of figuring out what the user is using - // TODO: investigate using the toolchain version to disambiguate in the stdlib - add("math/rand/v2") + add("math/rand") continue } - for importPath := range stdlib.PackageSymbols { + for importPath := range stdlib { if path.Base(importPath) == left { add(importPath) } @@ -1119,23 +1029,15 @@ func addStdlibCandidates(pass *pass, refs references) error { type Resolver interface { // loadPackageNames loads the package names in importPaths. loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) - // scan works with callback to search for packages. See scanCallback for details. scan(ctx context.Context, callback *scanCallback) error - // loadExports returns the set of exported symbols in the package at dir. // loadExports may be called concurrently. - loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) - + loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) // scoreImportPath returns the relevance for an import path. scoreImportPath(ctx context.Context, path string) float64 - // ClearForNewScan returns a new Resolver based on the receiver that has - // cleared its internal caches of directory contents. - // - // The new resolver should be primed and then set via - // [ProcessEnv.UpdateResolver]. - ClearForNewScan() Resolver + ClearForNewScan() } // A scanCallback controls a call to scan and receives its results. @@ -1154,7 +1056,7 @@ type scanCallback struct { // If it returns true, the package's exports will be loaded. packageNameLoaded func(pkg *pkg) bool // exportsLoaded is called when a package's exports have been loaded. - exportsLoaded func(pkg *pkg, exports []stdlib.Symbol) + exportsLoaded func(pkg *pkg, exports []string) } func addExternalCandidates(ctx context.Context, pass *pass, refs references, filename string) error { @@ -1218,7 +1120,7 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil go func(pkgName string, symbols map[string]bool) { defer wg.Done() - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols) + found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) if err != nil { firstErrOnce.Do(func() { @@ -1249,17 +1151,6 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil }() for result := range results { - // Don't offer completions that would shadow predeclared - // names, such as github.com/coreos/etcd/error. - if types.Universe.Lookup(result.pkg.name) != nil { // predeclared - // Ideally we would skip this candidate only - // if the predeclared name is actually - // referenced by the file, but that's a lot - // trickier to compute and would still create - // an import that is likely to surprise the - // user before long. - continue - } pass.addCandidate(result.imp, result.pkg) } return firstErr @@ -1302,22 +1193,31 @@ func ImportPathToAssumedName(importPath string) string { type gopathResolver struct { env *ProcessEnv walked bool - cache *DirInfoCache + cache *dirInfoCache scanSema chan struct{} // scanSema prevents concurrent scans. } func newGopathResolver(env *ProcessEnv) *gopathResolver { r := &gopathResolver{ - env: env, - cache: NewDirInfoCache(), + env: env, + cache: &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + listeners: map[*int]cacheListener{}, + }, scanSema: make(chan struct{}, 1), } r.scanSema <- struct{}{} return r } -func (r *gopathResolver) ClearForNewScan() Resolver { - return newGopathResolver(r.env) +func (r *gopathResolver) ClearForNewScan() { + <-r.scanSema + r.cache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + listeners: map[*int]cacheListener{}, + } + r.walked = false + r.scanSema <- struct{}{} } func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { @@ -1335,7 +1235,7 @@ func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) ( // importPathToName finds out the actual package name, as declared in its .go files. func importPathToName(bctx *build.Context, importPath, srcDir string) string { // Fast path for standard library without going to disk. - if stdlib.HasPackage(importPath) { + if _, ok := stdlib[importPath]; ok { return path.Base(importPath) // stdlib packages always match their paths. } @@ -1533,7 +1433,7 @@ func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error } func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { - if stdlib.HasPackage(path) { + if _, ok := stdlib[path]; ok { return MaxRelevance } return MaxRelevance - 1 @@ -1550,7 +1450,7 @@ func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) [] return result } -func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { +func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { return r.cache.CacheExports(ctx, r.env, info) } @@ -1570,7 +1470,7 @@ func VendorlessPath(ipath string) string { return ipath } -func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []stdlib.Symbol, error) { +func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { // Look for non-test, buildable .go files which could provide exports. all, err := os.ReadDir(dir) if err != nil { @@ -1594,7 +1494,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl } var pkgName string - var exports []stdlib.Symbol + var exports []string fset := token.NewFileSet() for _, fi := range files { select { @@ -1621,44 +1521,24 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl continue } pkgName = f.Name.Name - for name, obj := range f.Scope.Objects { + for name := range f.Scope.Objects { if ast.IsExported(name) { - var kind stdlib.Kind - switch obj.Kind { - case ast.Con: - kind = stdlib.Const - case ast.Typ: - kind = stdlib.Type - case ast.Var: - kind = stdlib.Var - case ast.Fun: - kind = stdlib.Func - } - exports = append(exports, stdlib.Symbol{ - Name: name, - Kind: kind, - Version: 0, // unknown; be permissive - }) + exports = append(exports, name) } } } - sortSymbols(exports) if env.Logf != nil { - env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, exports) + sortedExports := append([]string(nil), exports...) + sort.Strings(sortedExports) + env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) } return pkgName, exports, nil } -func sortSymbols(syms []stdlib.Symbol) { - sort.Slice(syms, func(i, j int) bool { - return syms[i].Name < syms[j].Name - }) -} - // findImport searches for a package with the given symbols. // If no package is found, findImport returns ("", false, nil) -func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*pkg, error) { +func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { // Sort the candidates by their import package length, // assuming that shorter package names are better than long // ones. Note that this sorts by the de-vendored name, so @@ -1722,7 +1602,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa exportsMap := make(map[string]bool, len(exports)) for _, sym := range exports { - exportsMap[sym.Name] = true + exportsMap[sym] = true } // If it doesn't have the right @@ -1880,13 +1760,10 @@ func (fn visitFn) Visit(node ast.Node) ast.Visitor { return fn(node) } -func symbolNameSet(symbols []stdlib.Symbol) map[string]bool { - names := make(map[string]bool) - for _, sym := range symbols { - switch sym.Kind { - case stdlib.Const, stdlib.Var, stdlib.Type, stdlib.Func: - names[sym.Name] = true - } +func copyExports(pkg []string) map[string]bool { + m := make(map[string]bool, len(pkg)) + for _, v := range pkg { + m[v] = true } - return names + return m } diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/imports.go b/upstream/vendor/golang.org/x/tools/internal/imports/imports.go index f83465520a4..58e637b90f2 100644 --- a/upstream/vendor/golang.org/x/tools/internal/imports/imports.go +++ b/upstream/vendor/golang.org/x/tools/internal/imports/imports.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:generate go run mkstdlib.go + // Package imports implements a Go pretty-printer (like package "go/format") // that also adds or removes import statements as necessary. package imports @@ -107,7 +109,7 @@ func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, e } // formatFile formats the file syntax tree. -// It may mutate the token.FileSet and the ast.File. +// It may mutate the token.FileSet. // // If an adjust function is provided, it is called after formatting // with the original source (formatFile's src parameter) and the @@ -234,7 +236,7 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast src = src[:len(src)-len("}\n")] // Gofmt has also indented the function body one level. // Remove that indent. - src = bytes.ReplaceAll(src, []byte("\n\t"), []byte("\n")) + src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) return matchSpace(orig, src) } return file, adjust, nil diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/mod.go b/upstream/vendor/golang.org/x/tools/internal/imports/mod.go index 82fe644a189..5f4d435d3cc 100644 --- a/upstream/vendor/golang.org/x/tools/internal/imports/mod.go +++ b/upstream/vendor/golang.org/x/tools/internal/imports/mod.go @@ -21,138 +21,78 @@ import ( "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/gopathwalk" - "golang.org/x/tools/internal/stdlib" ) -// Notes(rfindley): ModuleResolver appears to be heavily optimized for scanning -// as fast as possible, which is desirable for a call to goimports from the -// command line, but it doesn't work as well for gopls, where it suffers from -// slow startup (golang/go#44863) and intermittent hanging (golang/go#59216), -// both caused by populating the cache, albeit in slightly different ways. -// -// A high level list of TODOs: -// - Optimize the scan itself, as there is some redundancy statting and -// reading go.mod files. -// - Invert the relationship between ProcessEnv and Resolver (see the -// docstring of ProcessEnv). -// - Make it easier to use an external resolver implementation. -// -// Smaller TODOs are annotated in the code below. - -// ModuleResolver implements the Resolver interface for a workspace using -// modules. -// -// A goal of the ModuleResolver is to invoke the Go command as little as -// possible. To this end, it runs the Go command only for listing module -// information (i.e. `go list -m -e -json ...`). Package scanning, the process -// of loading package information for the modules, is implemented internally -// via the scan method. -// -// It has two types of state: the state derived from the go command, which -// is populated by init, and the state derived from scans, which is populated -// via scan. A root is considered scanned if it has been walked to discover -// directories. However, if the scan did not require additional information -// from the directory (such as package name or exports), the directory -// information itself may be partially populated. It will be lazily filled in -// as needed by scans, using the scanCallback. +// ModuleResolver implements resolver for modules using the go command as little +// as feasible. type ModuleResolver struct { - env *ProcessEnv - - // Module state, populated during construction - dummyVendorMod *gocommand.ModuleJSON // if vendoring is enabled, a pseudo-module to represent the /vendor directory - moduleCacheDir string // GOMODCACHE, inferred from GOPATH if unset - roots []gopathwalk.Root // roots to scan, in approximate order of importance - mains []*gocommand.ModuleJSON // main modules - mainByDir map[string]*gocommand.ModuleJSON // module information by dir, to join with roots - modsByModPath []*gocommand.ModuleJSON // all modules, ordered by # of path components in their module path - modsByDir []*gocommand.ModuleJSON // ...or by the number of path components in their Dir. - - // Scanning state, populated by scan - - // scanSema prevents concurrent scans, and guards scannedRoots and the cache - // fields below (though the caches themselves are concurrency safe). - // Receive to acquire, send to release. - scanSema chan struct{} - scannedRoots map[gopathwalk.Root]bool // if true, root has been walked - - // Caches of directory info, populated by scans and scan callbacks - // - // moduleCacheCache stores cached information about roots in the module - // cache, which are immutable and therefore do not need to be invalidated. - // - // otherCache stores information about all other roots (even GOROOT), which - // may change. - moduleCacheCache *DirInfoCache - otherCache *DirInfoCache + env *ProcessEnv + moduleCacheDir string + dummyVendorMod *gocommand.ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. + roots []gopathwalk.Root + scanSema chan struct{} // scanSema prevents concurrent scans and guards scannedRoots. + scannedRoots map[gopathwalk.Root]bool + + initialized bool + mains []*gocommand.ModuleJSON + mainByDir map[string]*gocommand.ModuleJSON + modsByModPath []*gocommand.ModuleJSON // All modules, ordered by # of path components in module Path... + modsByDir []*gocommand.ModuleJSON // ...or number of path components in their Dir. + + // moduleCacheCache stores information about the module cache. + moduleCacheCache *dirInfoCache + otherCache *dirInfoCache } -// newModuleResolver returns a new module-aware goimports resolver. -// -// Note: use caution when modifying this constructor: changes must also be -// reflected in ModuleResolver.ClearForNewScan. -func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleResolver, error) { +func newModuleResolver(e *ProcessEnv) *ModuleResolver { r := &ModuleResolver{ env: e, scanSema: make(chan struct{}, 1), } - r.scanSema <- struct{}{} // release + r.scanSema <- struct{}{} + return r +} + +func (r *ModuleResolver) init() error { + if r.initialized { + return nil + } goenv, err := r.env.goEnv() if err != nil { - return nil, err + return err } - - // TODO(rfindley): can we refactor to share logic with r.env.invokeGo? inv := gocommand.Invocation{ BuildFlags: r.env.BuildFlags, ModFlag: r.env.ModFlag, + ModFile: r.env.ModFile, Env: r.env.env(), Logf: r.env.Logf, WorkingDir: r.env.WorkingDir, } vendorEnabled := false - var mainModVendor *gocommand.ModuleJSON // for module vendoring - var mainModsVendor []*gocommand.ModuleJSON // for workspace vendoring - - goWork := r.env.Env["GOWORK"] - if len(goWork) == 0 { - // TODO(rfindley): VendorEnabled runs the go command to get GOFLAGS, but - // they should be available from the ProcessEnv. Can we avoid the redundant - // invocation? + var mainModVendor *gocommand.ModuleJSON + + // Module vendor directories are ignored in workspace mode: + // https://go.googlesource.com/proposal/+/master/design/45713-workspace.md + if len(r.env.Env["GOWORK"]) == 0 { vendorEnabled, mainModVendor, err = gocommand.VendorEnabled(context.TODO(), inv, r.env.GocmdRunner) if err != nil { - return nil, err - } - } else { - vendorEnabled, mainModsVendor, err = gocommand.WorkspaceVendorEnabled(context.Background(), inv, r.env.GocmdRunner) - if err != nil { - return nil, err + return err } } - if vendorEnabled { - if mainModVendor != nil { - // Module vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.mains = []*gocommand.ModuleJSON{mainModVendor} - r.dummyVendorMod = &gocommand.ModuleJSON{ - Path: "", - Dir: filepath.Join(mainModVendor.Dir, "vendor"), - } - r.modsByModPath = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} - r.modsByDir = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} - } else { - // Workspace vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.mains = mainModsVendor - r.dummyVendorMod = &gocommand.ModuleJSON{ - Path: "", - Dir: filepath.Join(filepath.Dir(goWork), "vendor"), - } - r.modsByModPath = append(append([]*gocommand.ModuleJSON{}, mainModsVendor...), r.dummyVendorMod) - r.modsByDir = append(append([]*gocommand.ModuleJSON{}, mainModsVendor...), r.dummyVendorMod) + if mainModVendor != nil && vendorEnabled { + // Vendor mode is on, so all the non-Main modules are irrelevant, + // and we need to search /vendor for everything. + r.mains = []*gocommand.ModuleJSON{mainModVendor} + r.dummyVendorMod = &gocommand.ModuleJSON{ + Path: "", + Dir: filepath.Join(mainModVendor.Dir, "vendor"), } + r.modsByModPath = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} + r.modsByDir = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} } else { // Vendor mode is off, so run go list -m ... to find everything. err := r.initAllMods() @@ -160,14 +100,19 @@ func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleRe // GO111MODULE=on. Other errors are fatal. if err != nil { if errMsg := err.Error(); !strings.Contains(errMsg, "working directory is not part of a module") && !strings.Contains(errMsg, "go.mod file not found") { - return nil, err + return err } } } - r.moduleCacheDir = gomodcacheForEnv(goenv) - if r.moduleCacheDir == "" { - return nil, fmt.Errorf("cannot resolve GOMODCACHE") + if gmc := r.env.Env["GOMODCACHE"]; gmc != "" { + r.moduleCacheDir = gmc + } else { + gopaths := filepath.SplitList(goenv["GOPATH"]) + if len(gopaths) == 0 { + return fmt.Errorf("empty GOPATH") + } + r.moduleCacheDir = filepath.Join(gopaths[0], "/pkg/mod") } sort.Slice(r.modsByModPath, func(i, j int) bool { @@ -183,9 +128,8 @@ func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleRe return count(j) < count(i) // descending order }) - r.roots = []gopathwalk.Root{} - if goenv["GOROOT"] != "" { // "" happens in tests - r.roots = append(r.roots, gopathwalk.Root{Path: filepath.Join(goenv["GOROOT"], "/src"), Type: gopathwalk.RootGOROOT}) + r.roots = []gopathwalk.Root{ + {Path: filepath.Join(goenv["GOROOT"], "/src"), Type: gopathwalk.RootGOROOT}, } r.mainByDir = make(map[string]*gocommand.ModuleJSON) for _, main := range r.mains { @@ -197,11 +141,7 @@ func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleRe } else { addDep := func(mod *gocommand.ModuleJSON) { if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough - // when we encounter it in the module cache scan. - // - // Including it at a lower index in r.roots than the module cache dir - // helps prioritize matches from within existing dependencies. + // This is redundant with the cache, but we'll skip it cheaply enough. r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootModuleCache}) } else { r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootOther}) @@ -218,40 +158,24 @@ func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleRe addDep(mod) } } - // If provided, share the moduleCacheCache. - // - // TODO(rfindley): The module cache is immutable. However, the loaded - // exports do depend on GOOS and GOARCH. Fortunately, the - // ProcessEnv.buildContext does not adjust these from build.DefaultContext - // (even though it should). So for now, this is OK to share, but we need to - // add logic for handling GOOS/GOARCH. - r.moduleCacheCache = moduleCacheCache r.roots = append(r.roots, gopathwalk.Root{Path: r.moduleCacheDir, Type: gopathwalk.RootModuleCache}) } r.scannedRoots = map[gopathwalk.Root]bool{} if r.moduleCacheCache == nil { - r.moduleCacheCache = NewDirInfoCache() + r.moduleCacheCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + listeners: map[*int]cacheListener{}, + } } - r.otherCache = NewDirInfoCache() - return r, nil -} - -// gomodcacheForEnv returns the GOMODCACHE value to use based on the given env -// map, which must have GOMODCACHE and GOPATH populated. -// -// TODO(rfindley): this is defensive refactoring. -// 1. Is this even relevant anymore? Can't we just read GOMODCACHE. -// 2. Use this to separate module cache scanning from other scanning. -func gomodcacheForEnv(goenv map[string]string) string { - if gmc := goenv["GOMODCACHE"]; gmc != "" { - return gmc - } - gopaths := filepath.SplitList(goenv["GOPATH"]) - if len(gopaths) == 0 { - return "" - } - return filepath.Join(gopaths[0], "/pkg/mod") + if r.otherCache == nil { + r.otherCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + listeners: map[*int]cacheListener{}, + } + } + r.initialized = true + return nil } func (r *ModuleResolver) initAllMods() error { @@ -282,86 +206,30 @@ func (r *ModuleResolver) initAllMods() error { return nil } -// ClearForNewScan invalidates the last scan. -// -// It preserves the set of roots, but forgets about the set of directories. -// Though it forgets the set of module cache directories, it remembers their -// contents, since they are assumed to be immutable. -func (r *ModuleResolver) ClearForNewScan() Resolver { - <-r.scanSema // acquire r, to guard scannedRoots - r2 := &ModuleResolver{ - env: r.env, - dummyVendorMod: r.dummyVendorMod, - moduleCacheDir: r.moduleCacheDir, - roots: r.roots, - mains: r.mains, - mainByDir: r.mainByDir, - modsByModPath: r.modsByModPath, - - scanSema: make(chan struct{}, 1), - scannedRoots: make(map[gopathwalk.Root]bool), - otherCache: NewDirInfoCache(), - moduleCacheCache: r.moduleCacheCache, - } - r2.scanSema <- struct{}{} // r2 must start released - // Invalidate root scans. We don't need to invalidate module cache roots, - // because they are immutable. - // (We don't support a use case where GOMODCACHE is cleaned in the middle of - // e.g. a gopls session: the user must restart gopls to get accurate - // imports.) - // - // Scanning for new directories in GOMODCACHE should be handled elsewhere, - // via a call to ScanModuleCache. - for _, root := range r.roots { - if root.Type == gopathwalk.RootModuleCache && r.scannedRoots[root] { - r2.scannedRoots[root] = true - } +func (r *ModuleResolver) ClearForNewScan() { + <-r.scanSema + r.scannedRoots = map[gopathwalk.Root]bool{} + r.otherCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + listeners: map[*int]cacheListener{}, } - r.scanSema <- struct{}{} // release r - return r2 + r.scanSema <- struct{}{} } -// ClearModuleInfo invalidates resolver state that depends on go.mod file -// contents (essentially, the output of go list -m -json ...). -// -// Notably, it does not forget directory contents, which are reset -// asynchronously via ClearForNewScan. -// -// If the ProcessEnv is a GOPATH environment, ClearModuleInfo is a no op. -// -// TODO(rfindley): move this to a new env.go, consolidating ProcessEnv methods. -func (e *ProcessEnv) ClearModuleInfo() { - if r, ok := e.resolver.(*ModuleResolver); ok { - resolver, err := newModuleResolver(e, e.ModCache) - if err != nil { - e.resolver = nil - e.resolverErr = err - return - } - - <-r.scanSema // acquire (guards caches) - resolver.moduleCacheCache = r.moduleCacheCache - resolver.otherCache = r.otherCache - r.scanSema <- struct{}{} // release - - e.UpdateResolver(resolver) +func (r *ModuleResolver) ClearForNewMod() { + <-r.scanSema + *r = ModuleResolver{ + env: r.env, + moduleCacheCache: r.moduleCacheCache, + otherCache: r.otherCache, + scanSema: r.scanSema, } + r.init() + r.scanSema <- struct{}{} } -// UpdateResolver sets the resolver for the ProcessEnv to use in imports -// operations. Only for use with the result of [Resolver.ClearForNewScan]. -// -// TODO(rfindley): this awkward API is a result of the (arguably) inverted -// relationship between configuration and state described in the doc comment -// for [ProcessEnv]. -func (e *ProcessEnv) UpdateResolver(r Resolver) { - e.resolver = r - e.resolverErr = nil -} - -// findPackage returns the module and directory from within the main modules -// and their dependencies that contains the package at the given import path, -// or returns nil, "" if no module is in scope. +// findPackage returns the module and directory that contains the package at +// the given import path, or returns nil, "" if no module is in scope. func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, string) { // This can't find packages in the stdlib, but that's harmless for all // the existing code paths. @@ -427,6 +295,10 @@ func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { } } +func (r *ModuleResolver) cacheKeys() []string { + return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) +} + // cachePackageName caches the package name for a dir already in the cache. func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, error) { if info.rootType == gopathwalk.RootModuleCache { @@ -435,7 +307,7 @@ func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, er return r.otherCache.CachePackageName(info) } -func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { +func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { if info.rootType == gopathwalk.RootModuleCache { return r.moduleCacheCache.CacheExports(ctx, env, info) } @@ -495,15 +367,15 @@ func (r *ModuleResolver) dirIsNestedModule(dir string, mod *gocommand.ModuleJSON return modDir != mod.Dir } -func readModName(modFile string) string { - modBytes, err := os.ReadFile(modFile) - if err != nil { - return "" +func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { + readModName := func(modFile string) string { + modBytes, err := os.ReadFile(modFile) + if err != nil { + return "" + } + return modulePath(modBytes) } - return modulePath(modBytes) -} -func (r *ModuleResolver) modInfo(dir string) (modDir, modName string) { if r.dirInModuleCache(dir) { if matches := modCacheRegexp.FindStringSubmatch(dir); len(matches) == 3 { index := strings.Index(dir, matches[1]+"@"+matches[2]) @@ -537,9 +409,11 @@ func (r *ModuleResolver) dirInModuleCache(dir string) bool { } func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { + if err := r.init(); err != nil { + return nil, err + } names := map[string]string{} for _, path := range importPaths { - // TODO(rfindley): shouldn't this use the dirInfoCache? _, packageDir := r.findPackage(path) if packageDir == "" { continue @@ -557,6 +431,10 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error ctx, done := event.Start(ctx, "imports.ModuleResolver.scan") defer done() + if err := r.init(); err != nil { + return err + } + processDir := func(info directoryPackageInfo) { // Skip this directory if we were not able to get the package information successfully. if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { @@ -566,18 +444,18 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error if err != nil { return } + if !callback.dirFound(pkg) { return } - pkg.packageName, err = r.cachePackageName(info) if err != nil { return } + if !callback.packageNameLoaded(pkg) { return } - _, exports, err := r.loadExports(ctx, pkg, false) if err != nil { return @@ -616,6 +494,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error return packageScanned } + // Add anything new to the cache, and process it if we're still listening. add := func(root gopathwalk.Root, dir string) { r.cacheStore(r.scanDirForPackage(root, dir)) } @@ -630,9 +509,9 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error select { case <-ctx.Done(): return - case <-r.scanSema: // acquire + case <-r.scanSema: } - defer func() { r.scanSema <- struct{}{} }() // release + defer func() { r.scanSema <- struct{}{} }() // We have the lock on r.scannedRoots, and no other scans can run. for _, root := range roots { if ctx.Err() != nil { @@ -655,7 +534,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error } func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { - if stdlib.HasPackage(path) { + if _, ok := stdlib[path]; ok { return MaxRelevance } mod, _ := r.findPackage(path) @@ -733,7 +612,10 @@ func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { return res, nil } -func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { +func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { + if err := r.init(); err != nil { + return "", nil, err + } if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { return r.cacheExports(ctx, r.env, info) } diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/upstream/vendor/golang.org/x/tools/internal/imports/mod_cache.go index b1192696b28..45690abbb4f 100644 --- a/upstream/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ b/upstream/vendor/golang.org/x/tools/internal/imports/mod_cache.go @@ -7,14 +7,9 @@ package imports import ( "context" "fmt" - "path" - "path/filepath" - "strings" "sync" - "golang.org/x/mod/module" "golang.org/x/tools/internal/gopathwalk" - "golang.org/x/tools/internal/stdlib" ) // To find packages to import, the resolver needs to know about all of @@ -44,8 +39,6 @@ const ( exportsLoaded ) -// directoryPackageInfo holds (possibly incomplete) information about packages -// contained in a given directory. type directoryPackageInfo struct { // status indicates the extent to which this struct has been filled in. status directoryPackageStatus @@ -70,11 +63,8 @@ type directoryPackageInfo struct { packageName string // the package name, as declared in the source. // Set when status >= exportsLoaded. - // TODO(rfindley): it's hard to see this, but exports depend implicitly on - // the default build context GOOS and GOARCH. - // - // We can make this explicit, and key exports by GOOS, GOARCH. - exports []stdlib.Symbol + + exports []string } // reachedStatus returns true when info has a status at least target and any error associated with @@ -89,7 +79,7 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( return true, nil } -// DirInfoCache is a concurrency-safe map for storing information about +// dirInfoCache is a concurrency safe map for storing information about // directories that may contain packages. // // The information in this cache is built incrementally. Entries are initialized in scan. @@ -102,26 +92,21 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( // The information in the cache is not expected to change for the cache's // lifetime, so there is no protection against competing writes. Users should // take care not to hold the cache across changes to the underlying files. -type DirInfoCache struct { +// +// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) +type dirInfoCache struct { mu sync.Mutex // dirs stores information about packages in directories, keyed by absolute path. dirs map[string]*directoryPackageInfo listeners map[*int]cacheListener } -func NewDirInfoCache() *DirInfoCache { - return &DirInfoCache{ - dirs: make(map[string]*directoryPackageInfo), - listeners: make(map[*int]cacheListener), - } -} - type cacheListener func(directoryPackageInfo) // ScanAndListen calls listener on all the items in the cache, and on anything // newly added. The returned stop function waits for all in-flight callbacks to // finish and blocks new ones. -func (d *DirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { +func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { ctx, cancel := context.WithCancel(ctx) // Flushing out all the callbacks is tricky without knowing how many there @@ -177,10 +162,8 @@ func (d *DirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener } // Store stores the package info for dir. -func (d *DirInfoCache) Store(dir string, info directoryPackageInfo) { +func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { d.mu.Lock() - // TODO(rfindley, golang/go#59216): should we overwrite an existing entry? - // That seems incorrect as the cache should be idempotent. _, old := d.dirs[dir] d.dirs[dir] = &info var listeners []cacheListener @@ -197,7 +180,7 @@ func (d *DirInfoCache) Store(dir string, info directoryPackageInfo) { } // Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *DirInfoCache) Load(dir string) (directoryPackageInfo, bool) { +func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { d.mu.Lock() defer d.mu.Unlock() info, ok := d.dirs[dir] @@ -208,7 +191,7 @@ func (d *DirInfoCache) Load(dir string) (directoryPackageInfo, bool) { } // Keys returns the keys currently present in d. -func (d *DirInfoCache) Keys() (keys []string) { +func (d *dirInfoCache) Keys() (keys []string) { d.mu.Lock() defer d.mu.Unlock() for key := range d.dirs { @@ -217,7 +200,7 @@ func (d *DirInfoCache) Keys() (keys []string) { return keys } -func (d *DirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { +func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { if loaded, err := info.reachedStatus(nameLoaded); loaded { return info.packageName, err } @@ -230,7 +213,7 @@ func (d *DirInfoCache) CachePackageName(info directoryPackageInfo) (string, erro return info.packageName, info.err } -func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { +func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { if reached, _ := info.reachedStatus(exportsLoaded); reached { return info.packageName, info.exports, info.err } @@ -251,81 +234,3 @@ func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info d d.Store(info.dir, info) return info.packageName, info.exports, info.err } - -// ScanModuleCache walks the given directory, which must be a GOMODCACHE value, -// for directory package information, storing the results in cache. -func ScanModuleCache(dir string, cache *DirInfoCache, logf func(string, ...any)) { - // Note(rfindley): it's hard to see, but this function attempts to implement - // just the side effects on cache of calling PrimeCache with a ProcessEnv - // that has the given dir as its GOMODCACHE. - // - // Teasing out the control flow, we see that we can avoid any handling of - // vendor/ and can infer module info entirely from the path, simplifying the - // logic here. - - root := gopathwalk.Root{ - Path: filepath.Clean(dir), - Type: gopathwalk.RootModuleCache, - } - - directoryInfo := func(root gopathwalk.Root, dir string) directoryPackageInfo { - // This is a copy of ModuleResolver.scanDirForPackage, trimmed down to - // logic that applies to a module cache directory. - - subdir := "" - if dir != root.Path { - subdir = dir[len(root.Path)+len("/"):] - } - - matches := modCacheRegexp.FindStringSubmatch(subdir) - if len(matches) == 0 { - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("invalid module cache path: %v", subdir), - } - } - modPath, err := module.UnescapePath(filepath.ToSlash(matches[1])) - if err != nil { - if logf != nil { - logf("decoding module cache path %q: %v", subdir, err) - } - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), - } - } - importPath := path.Join(modPath, filepath.ToSlash(matches[3])) - index := strings.Index(dir, matches[1]+"@"+matches[2]) - modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) - modName := readModName(filepath.Join(modDir, "go.mod")) - return directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: importPath, - moduleDir: modDir, - moduleName: modName, - } - } - - add := func(root gopathwalk.Root, dir string) { - info := directoryInfo(root, dir) - cache.Store(info.dir, info) - } - - skip := func(_ gopathwalk.Root, dir string) bool { - // Skip directories that have already been scanned. - // - // Note that gopathwalk only adds "package" directories, which must contain - // a .go file, and all such package directories in the module cache are - // immutable. So if we can load a dir, it can be skipped. - info, ok := cache.Load(dir) - if !ok { - return false - } - packageScanned, _ := info.reachedStatus(directoryScanned) - return packageScanned - } - - gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: logf, ModulesEnabled: true}) -} diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/sortimports.go b/upstream/vendor/golang.org/x/tools/internal/imports/sortimports.go index da8194fd965..1a0a7ebd9e4 100644 --- a/upstream/vendor/golang.org/x/tools/internal/imports/sortimports.go +++ b/upstream/vendor/golang.org/x/tools/internal/imports/sortimports.go @@ -18,7 +18,7 @@ import ( // sortImports sorts runs of consecutive import lines in import blocks in f. // It also removes duplicate imports when it is possible to do so without data loss. // -// It may mutate the token.File and the ast.File. +// It may mutate the token.File. func sortImports(localPrefix string, tokFile *token.File, f *ast.File) { for i, d := range f.Decls { d, ok := d.(*ast.GenDecl) diff --git a/upstream/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/upstream/vendor/golang.org/x/tools/internal/imports/zstdlib.go new file mode 100644 index 00000000000..9f992c2bec8 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/imports/zstdlib.go @@ -0,0 +1,11345 @@ +// Copyright 2022 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 mkstdlib.go. DO NOT EDIT. + +package imports + +var stdlib = map[string][]string{ + "archive/tar": { + "ErrFieldTooLong", + "ErrHeader", + "ErrInsecurePath", + "ErrWriteAfterClose", + "ErrWriteTooLong", + "FileInfoHeader", + "Format", + "FormatGNU", + "FormatPAX", + "FormatUSTAR", + "FormatUnknown", + "Header", + "NewReader", + "NewWriter", + "Reader", + "TypeBlock", + "TypeChar", + "TypeCont", + "TypeDir", + "TypeFifo", + "TypeGNULongLink", + "TypeGNULongName", + "TypeGNUSparse", + "TypeLink", + "TypeReg", + "TypeRegA", + "TypeSymlink", + "TypeXGlobalHeader", + "TypeXHeader", + "Writer", + }, + "archive/zip": { + "Compressor", + "Decompressor", + "Deflate", + "ErrAlgorithm", + "ErrChecksum", + "ErrFormat", + "ErrInsecurePath", + "File", + "FileHeader", + "FileInfoHeader", + "NewReader", + "NewWriter", + "OpenReader", + "ReadCloser", + "Reader", + "RegisterCompressor", + "RegisterDecompressor", + "Store", + "Writer", + }, + "bufio": { + "ErrAdvanceTooFar", + "ErrBadReadCount", + "ErrBufferFull", + "ErrFinalToken", + "ErrInvalidUnreadByte", + "ErrInvalidUnreadRune", + "ErrNegativeAdvance", + "ErrNegativeCount", + "ErrTooLong", + "MaxScanTokenSize", + "NewReadWriter", + "NewReader", + "NewReaderSize", + "NewScanner", + "NewWriter", + "NewWriterSize", + "ReadWriter", + "Reader", + "ScanBytes", + "ScanLines", + "ScanRunes", + "ScanWords", + "Scanner", + "SplitFunc", + "Writer", + }, + "bytes": { + "Buffer", + "Clone", + "Compare", + "Contains", + "ContainsAny", + "ContainsFunc", + "ContainsRune", + "Count", + "Cut", + "CutPrefix", + "CutSuffix", + "Equal", + "EqualFold", + "ErrTooLarge", + "Fields", + "FieldsFunc", + "HasPrefix", + "HasSuffix", + "Index", + "IndexAny", + "IndexByte", + "IndexFunc", + "IndexRune", + "Join", + "LastIndex", + "LastIndexAny", + "LastIndexByte", + "LastIndexFunc", + "Map", + "MinRead", + "NewBuffer", + "NewBufferString", + "NewReader", + "Reader", + "Repeat", + "Replace", + "ReplaceAll", + "Runes", + "Split", + "SplitAfter", + "SplitAfterN", + "SplitN", + "Title", + "ToLower", + "ToLowerSpecial", + "ToTitle", + "ToTitleSpecial", + "ToUpper", + "ToUpperSpecial", + "ToValidUTF8", + "Trim", + "TrimFunc", + "TrimLeft", + "TrimLeftFunc", + "TrimPrefix", + "TrimRight", + "TrimRightFunc", + "TrimSpace", + "TrimSuffix", + }, + "cmp": { + "Compare", + "Less", + "Ordered", + }, + "compress/bzip2": { + "NewReader", + "StructuralError", + }, + "compress/flate": { + "BestCompression", + "BestSpeed", + "CorruptInputError", + "DefaultCompression", + "HuffmanOnly", + "InternalError", + "NewReader", + "NewReaderDict", + "NewWriter", + "NewWriterDict", + "NoCompression", + "ReadError", + "Reader", + "Resetter", + "WriteError", + "Writer", + }, + "compress/gzip": { + "BestCompression", + "BestSpeed", + "DefaultCompression", + "ErrChecksum", + "ErrHeader", + "Header", + "HuffmanOnly", + "NewReader", + "NewWriter", + "NewWriterLevel", + "NoCompression", + "Reader", + "Writer", + }, + "compress/lzw": { + "LSB", + "MSB", + "NewReader", + "NewWriter", + "Order", + "Reader", + "Writer", + }, + "compress/zlib": { + "BestCompression", + "BestSpeed", + "DefaultCompression", + "ErrChecksum", + "ErrDictionary", + "ErrHeader", + "HuffmanOnly", + "NewReader", + "NewReaderDict", + "NewWriter", + "NewWriterLevel", + "NewWriterLevelDict", + "NoCompression", + "Resetter", + "Writer", + }, + "container/heap": { + "Fix", + "Init", + "Interface", + "Pop", + "Push", + "Remove", + }, + "container/list": { + "Element", + "List", + "New", + }, + "container/ring": { + "New", + "Ring", + }, + "context": { + "AfterFunc", + "Background", + "CancelCauseFunc", + "CancelFunc", + "Canceled", + "Cause", + "Context", + "DeadlineExceeded", + "TODO", + "WithCancel", + "WithCancelCause", + "WithDeadline", + "WithDeadlineCause", + "WithTimeout", + "WithTimeoutCause", + "WithValue", + "WithoutCancel", + }, + "crypto": { + "BLAKE2b_256", + "BLAKE2b_384", + "BLAKE2b_512", + "BLAKE2s_256", + "Decrypter", + "DecrypterOpts", + "Hash", + "MD4", + "MD5", + "MD5SHA1", + "PrivateKey", + "PublicKey", + "RIPEMD160", + "RegisterHash", + "SHA1", + "SHA224", + "SHA256", + "SHA384", + "SHA3_224", + "SHA3_256", + "SHA3_384", + "SHA3_512", + "SHA512", + "SHA512_224", + "SHA512_256", + "Signer", + "SignerOpts", + }, + "crypto/aes": { + "BlockSize", + "KeySizeError", + "NewCipher", + }, + "crypto/cipher": { + "AEAD", + "Block", + "BlockMode", + "NewCBCDecrypter", + "NewCBCEncrypter", + "NewCFBDecrypter", + "NewCFBEncrypter", + "NewCTR", + "NewGCM", + "NewGCMWithNonceSize", + "NewGCMWithTagSize", + "NewOFB", + "Stream", + "StreamReader", + "StreamWriter", + }, + "crypto/des": { + "BlockSize", + "KeySizeError", + "NewCipher", + "NewTripleDESCipher", + }, + "crypto/dsa": { + "ErrInvalidPublicKey", + "GenerateKey", + "GenerateParameters", + "L1024N160", + "L2048N224", + "L2048N256", + "L3072N256", + "ParameterSizes", + "Parameters", + "PrivateKey", + "PublicKey", + "Sign", + "Verify", + }, + "crypto/ecdh": { + "Curve", + "P256", + "P384", + "P521", + "PrivateKey", + "PublicKey", + "X25519", + }, + "crypto/ecdsa": { + "GenerateKey", + "PrivateKey", + "PublicKey", + "Sign", + "SignASN1", + "Verify", + "VerifyASN1", + }, + "crypto/ed25519": { + "GenerateKey", + "NewKeyFromSeed", + "Options", + "PrivateKey", + "PrivateKeySize", + "PublicKey", + "PublicKeySize", + "SeedSize", + "Sign", + "SignatureSize", + "Verify", + "VerifyWithOptions", + }, + "crypto/elliptic": { + "Curve", + "CurveParams", + "GenerateKey", + "Marshal", + "MarshalCompressed", + "P224", + "P256", + "P384", + "P521", + "Unmarshal", + "UnmarshalCompressed", + }, + "crypto/hmac": { + "Equal", + "New", + }, + "crypto/md5": { + "BlockSize", + "New", + "Size", + "Sum", + }, + "crypto/rand": { + "Int", + "Prime", + "Read", + "Reader", + }, + "crypto/rc4": { + "Cipher", + "KeySizeError", + "NewCipher", + }, + "crypto/rsa": { + "CRTValue", + "DecryptOAEP", + "DecryptPKCS1v15", + "DecryptPKCS1v15SessionKey", + "EncryptOAEP", + "EncryptPKCS1v15", + "ErrDecryption", + "ErrMessageTooLong", + "ErrVerification", + "GenerateKey", + "GenerateMultiPrimeKey", + "OAEPOptions", + "PKCS1v15DecryptOptions", + "PSSOptions", + "PSSSaltLengthAuto", + "PSSSaltLengthEqualsHash", + "PrecomputedValues", + "PrivateKey", + "PublicKey", + "SignPKCS1v15", + "SignPSS", + "VerifyPKCS1v15", + "VerifyPSS", + }, + "crypto/sha1": { + "BlockSize", + "New", + "Size", + "Sum", + }, + "crypto/sha256": { + "BlockSize", + "New", + "New224", + "Size", + "Size224", + "Sum224", + "Sum256", + }, + "crypto/sha512": { + "BlockSize", + "New", + "New384", + "New512_224", + "New512_256", + "Size", + "Size224", + "Size256", + "Size384", + "Sum384", + "Sum512", + "Sum512_224", + "Sum512_256", + }, + "crypto/subtle": { + "ConstantTimeByteEq", + "ConstantTimeCompare", + "ConstantTimeCopy", + "ConstantTimeEq", + "ConstantTimeLessOrEq", + "ConstantTimeSelect", + "XORBytes", + }, + "crypto/tls": { + "AlertError", + "Certificate", + "CertificateRequestInfo", + "CertificateVerificationError", + "CipherSuite", + "CipherSuiteName", + "CipherSuites", + "Client", + "ClientAuthType", + "ClientHelloInfo", + "ClientSessionCache", + "ClientSessionState", + "Config", + "Conn", + "ConnectionState", + "CurveID", + "CurveP256", + "CurveP384", + "CurveP521", + "Dial", + "DialWithDialer", + "Dialer", + "ECDSAWithP256AndSHA256", + "ECDSAWithP384AndSHA384", + "ECDSAWithP521AndSHA512", + "ECDSAWithSHA1", + "Ed25519", + "InsecureCipherSuites", + "Listen", + "LoadX509KeyPair", + "NewLRUClientSessionCache", + "NewListener", + "NewResumptionState", + "NoClientCert", + "PKCS1WithSHA1", + "PKCS1WithSHA256", + "PKCS1WithSHA384", + "PKCS1WithSHA512", + "PSSWithSHA256", + "PSSWithSHA384", + "PSSWithSHA512", + "ParseSessionState", + "QUICClient", + "QUICConfig", + "QUICConn", + "QUICEncryptionLevel", + "QUICEncryptionLevelApplication", + "QUICEncryptionLevelEarly", + "QUICEncryptionLevelHandshake", + "QUICEncryptionLevelInitial", + "QUICEvent", + "QUICEventKind", + "QUICHandshakeDone", + "QUICNoEvent", + "QUICRejectedEarlyData", + "QUICServer", + "QUICSessionTicketOptions", + "QUICSetReadSecret", + "QUICSetWriteSecret", + "QUICTransportParameters", + "QUICTransportParametersRequired", + "QUICWriteData", + "RecordHeaderError", + "RenegotiateFreelyAsClient", + "RenegotiateNever", + "RenegotiateOnceAsClient", + "RenegotiationSupport", + "RequestClientCert", + "RequireAndVerifyClientCert", + "RequireAnyClientCert", + "Server", + "SessionState", + "SignatureScheme", + "TLS_AES_128_GCM_SHA256", + "TLS_AES_256_GCM_SHA384", + "TLS_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + "TLS_FALLBACK_SCSV", + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_RSA_WITH_RC4_128_SHA", + "VerifyClientCertIfGiven", + "VersionName", + "VersionSSL30", + "VersionTLS10", + "VersionTLS11", + "VersionTLS12", + "VersionTLS13", + "X25519", + "X509KeyPair", + }, + "crypto/x509": { + "CANotAuthorizedForExtKeyUsage", + "CANotAuthorizedForThisName", + "CertPool", + "Certificate", + "CertificateInvalidError", + "CertificateRequest", + "ConstraintViolationError", + "CreateCertificate", + "CreateCertificateRequest", + "CreateRevocationList", + "DSA", + "DSAWithSHA1", + "DSAWithSHA256", + "DecryptPEMBlock", + "ECDSA", + "ECDSAWithSHA1", + "ECDSAWithSHA256", + "ECDSAWithSHA384", + "ECDSAWithSHA512", + "Ed25519", + "EncryptPEMBlock", + "ErrUnsupportedAlgorithm", + "Expired", + "ExtKeyUsage", + "ExtKeyUsageAny", + "ExtKeyUsageClientAuth", + "ExtKeyUsageCodeSigning", + "ExtKeyUsageEmailProtection", + "ExtKeyUsageIPSECEndSystem", + "ExtKeyUsageIPSECTunnel", + "ExtKeyUsageIPSECUser", + "ExtKeyUsageMicrosoftCommercialCodeSigning", + "ExtKeyUsageMicrosoftKernelCodeSigning", + "ExtKeyUsageMicrosoftServerGatedCrypto", + "ExtKeyUsageNetscapeServerGatedCrypto", + "ExtKeyUsageOCSPSigning", + "ExtKeyUsageServerAuth", + "ExtKeyUsageTimeStamping", + "HostnameError", + "IncompatibleUsage", + "IncorrectPasswordError", + "InsecureAlgorithmError", + "InvalidReason", + "IsEncryptedPEMBlock", + "KeyUsage", + "KeyUsageCRLSign", + "KeyUsageCertSign", + "KeyUsageContentCommitment", + "KeyUsageDataEncipherment", + "KeyUsageDecipherOnly", + "KeyUsageDigitalSignature", + "KeyUsageEncipherOnly", + "KeyUsageKeyAgreement", + "KeyUsageKeyEncipherment", + "MD2WithRSA", + "MD5WithRSA", + "MarshalECPrivateKey", + "MarshalPKCS1PrivateKey", + "MarshalPKCS1PublicKey", + "MarshalPKCS8PrivateKey", + "MarshalPKIXPublicKey", + "NameConstraintsWithoutSANs", + "NameMismatch", + "NewCertPool", + "NotAuthorizedToSign", + "PEMCipher", + "PEMCipher3DES", + "PEMCipherAES128", + "PEMCipherAES192", + "PEMCipherAES256", + "PEMCipherDES", + "ParseCRL", + "ParseCertificate", + "ParseCertificateRequest", + "ParseCertificates", + "ParseDERCRL", + "ParseECPrivateKey", + "ParsePKCS1PrivateKey", + "ParsePKCS1PublicKey", + "ParsePKCS8PrivateKey", + "ParsePKIXPublicKey", + "ParseRevocationList", + "PublicKeyAlgorithm", + "PureEd25519", + "RSA", + "RevocationList", + "RevocationListEntry", + "SHA1WithRSA", + "SHA256WithRSA", + "SHA256WithRSAPSS", + "SHA384WithRSA", + "SHA384WithRSAPSS", + "SHA512WithRSA", + "SHA512WithRSAPSS", + "SetFallbackRoots", + "SignatureAlgorithm", + "SystemCertPool", + "SystemRootsError", + "TooManyConstraints", + "TooManyIntermediates", + "UnconstrainedName", + "UnhandledCriticalExtension", + "UnknownAuthorityError", + "UnknownPublicKeyAlgorithm", + "UnknownSignatureAlgorithm", + "VerifyOptions", + }, + "crypto/x509/pkix": { + "AlgorithmIdentifier", + "AttributeTypeAndValue", + "AttributeTypeAndValueSET", + "CertificateList", + "Extension", + "Name", + "RDNSequence", + "RelativeDistinguishedNameSET", + "RevokedCertificate", + "TBSCertificateList", + }, + "database/sql": { + "ColumnType", + "Conn", + "DB", + "DBStats", + "Drivers", + "ErrConnDone", + "ErrNoRows", + "ErrTxDone", + "IsolationLevel", + "LevelDefault", + "LevelLinearizable", + "LevelReadCommitted", + "LevelReadUncommitted", + "LevelRepeatableRead", + "LevelSerializable", + "LevelSnapshot", + "LevelWriteCommitted", + "Named", + "NamedArg", + "NullBool", + "NullByte", + "NullFloat64", + "NullInt16", + "NullInt32", + "NullInt64", + "NullString", + "NullTime", + "Open", + "OpenDB", + "Out", + "RawBytes", + "Register", + "Result", + "Row", + "Rows", + "Scanner", + "Stmt", + "Tx", + "TxOptions", + }, + "database/sql/driver": { + "Bool", + "ColumnConverter", + "Conn", + "ConnBeginTx", + "ConnPrepareContext", + "Connector", + "DefaultParameterConverter", + "Driver", + "DriverContext", + "ErrBadConn", + "ErrRemoveArgument", + "ErrSkip", + "Execer", + "ExecerContext", + "Int32", + "IsScanValue", + "IsValue", + "IsolationLevel", + "NamedValue", + "NamedValueChecker", + "NotNull", + "Null", + "Pinger", + "Queryer", + "QueryerContext", + "Result", + "ResultNoRows", + "Rows", + "RowsAffected", + "RowsColumnTypeDatabaseTypeName", + "RowsColumnTypeLength", + "RowsColumnTypeNullable", + "RowsColumnTypePrecisionScale", + "RowsColumnTypeScanType", + "RowsNextResultSet", + "SessionResetter", + "Stmt", + "StmtExecContext", + "StmtQueryContext", + "String", + "Tx", + "TxOptions", + "Validator", + "Value", + "ValueConverter", + "Valuer", + }, + "debug/buildinfo": { + "BuildInfo", + "Read", + "ReadFile", + }, + "debug/dwarf": { + "AddrType", + "ArrayType", + "Attr", + "AttrAbstractOrigin", + "AttrAccessibility", + "AttrAddrBase", + "AttrAddrClass", + "AttrAlignment", + "AttrAllocated", + "AttrArtificial", + "AttrAssociated", + "AttrBaseTypes", + "AttrBinaryScale", + "AttrBitOffset", + "AttrBitSize", + "AttrByteSize", + "AttrCallAllCalls", + "AttrCallAllSourceCalls", + "AttrCallAllTailCalls", + "AttrCallColumn", + "AttrCallDataLocation", + "AttrCallDataValue", + "AttrCallFile", + "AttrCallLine", + "AttrCallOrigin", + "AttrCallPC", + "AttrCallParameter", + "AttrCallReturnPC", + "AttrCallTailCall", + "AttrCallTarget", + "AttrCallTargetClobbered", + "AttrCallValue", + "AttrCalling", + "AttrCommonRef", + "AttrCompDir", + "AttrConstExpr", + "AttrConstValue", + "AttrContainingType", + "AttrCount", + "AttrDataBitOffset", + "AttrDataLocation", + "AttrDataMemberLoc", + "AttrDecimalScale", + "AttrDecimalSign", + "AttrDeclColumn", + "AttrDeclFile", + "AttrDeclLine", + "AttrDeclaration", + "AttrDefaultValue", + "AttrDefaulted", + "AttrDeleted", + "AttrDescription", + "AttrDigitCount", + "AttrDiscr", + "AttrDiscrList", + "AttrDiscrValue", + "AttrDwoName", + "AttrElemental", + "AttrEncoding", + "AttrEndianity", + "AttrEntrypc", + "AttrEnumClass", + "AttrExplicit", + "AttrExportSymbols", + "AttrExtension", + "AttrExternal", + "AttrFrameBase", + "AttrFriend", + "AttrHighpc", + "AttrIdentifierCase", + "AttrImport", + "AttrInline", + "AttrIsOptional", + "AttrLanguage", + "AttrLinkageName", + "AttrLocation", + "AttrLoclistsBase", + "AttrLowerBound", + "AttrLowpc", + "AttrMacroInfo", + "AttrMacros", + "AttrMainSubprogram", + "AttrMutable", + "AttrName", + "AttrNamelistItem", + "AttrNoreturn", + "AttrObjectPointer", + "AttrOrdering", + "AttrPictureString", + "AttrPriority", + "AttrProducer", + "AttrPrototyped", + "AttrPure", + "AttrRanges", + "AttrRank", + "AttrRecursive", + "AttrReference", + "AttrReturnAddr", + "AttrRnglistsBase", + "AttrRvalueReference", + "AttrSegment", + "AttrSibling", + "AttrSignature", + "AttrSmall", + "AttrSpecification", + "AttrStartScope", + "AttrStaticLink", + "AttrStmtList", + "AttrStrOffsetsBase", + "AttrStride", + "AttrStrideSize", + "AttrStringLength", + "AttrStringLengthBitSize", + "AttrStringLengthByteSize", + "AttrThreadsScaled", + "AttrTrampoline", + "AttrType", + "AttrUpperBound", + "AttrUseLocation", + "AttrUseUTF8", + "AttrVarParam", + "AttrVirtuality", + "AttrVisibility", + "AttrVtableElemLoc", + "BasicType", + "BoolType", + "CharType", + "Class", + "ClassAddrPtr", + "ClassAddress", + "ClassBlock", + "ClassConstant", + "ClassExprLoc", + "ClassFlag", + "ClassLinePtr", + "ClassLocList", + "ClassLocListPtr", + "ClassMacPtr", + "ClassRangeListPtr", + "ClassReference", + "ClassReferenceAlt", + "ClassReferenceSig", + "ClassRngList", + "ClassRngListsPtr", + "ClassStrOffsetsPtr", + "ClassString", + "ClassStringAlt", + "ClassUnknown", + "CommonType", + "ComplexType", + "Data", + "DecodeError", + "DotDotDotType", + "Entry", + "EnumType", + "EnumValue", + "ErrUnknownPC", + "Field", + "FloatType", + "FuncType", + "IntType", + "LineEntry", + "LineFile", + "LineReader", + "LineReaderPos", + "New", + "Offset", + "PtrType", + "QualType", + "Reader", + "StructField", + "StructType", + "Tag", + "TagAccessDeclaration", + "TagArrayType", + "TagAtomicType", + "TagBaseType", + "TagCallSite", + "TagCallSiteParameter", + "TagCatchDwarfBlock", + "TagClassType", + "TagCoarrayType", + "TagCommonDwarfBlock", + "TagCommonInclusion", + "TagCompileUnit", + "TagCondition", + "TagConstType", + "TagConstant", + "TagDwarfProcedure", + "TagDynamicType", + "TagEntryPoint", + "TagEnumerationType", + "TagEnumerator", + "TagFileType", + "TagFormalParameter", + "TagFriend", + "TagGenericSubrange", + "TagImmutableType", + "TagImportedDeclaration", + "TagImportedModule", + "TagImportedUnit", + "TagInheritance", + "TagInlinedSubroutine", + "TagInterfaceType", + "TagLabel", + "TagLexDwarfBlock", + "TagMember", + "TagModule", + "TagMutableType", + "TagNamelist", + "TagNamelistItem", + "TagNamespace", + "TagPackedType", + "TagPartialUnit", + "TagPointerType", + "TagPtrToMemberType", + "TagReferenceType", + "TagRestrictType", + "TagRvalueReferenceType", + "TagSetType", + "TagSharedType", + "TagSkeletonUnit", + "TagStringType", + "TagStructType", + "TagSubprogram", + "TagSubrangeType", + "TagSubroutineType", + "TagTemplateAlias", + "TagTemplateTypeParameter", + "TagTemplateValueParameter", + "TagThrownType", + "TagTryDwarfBlock", + "TagTypeUnit", + "TagTypedef", + "TagUnionType", + "TagUnspecifiedParameters", + "TagUnspecifiedType", + "TagVariable", + "TagVariant", + "TagVariantPart", + "TagVolatileType", + "TagWithStmt", + "Type", + "TypedefType", + "UcharType", + "UintType", + "UnspecifiedType", + "UnsupportedType", + "VoidType", + }, + "debug/elf": { + "ARM_MAGIC_TRAMP_NUMBER", + "COMPRESS_HIOS", + "COMPRESS_HIPROC", + "COMPRESS_LOOS", + "COMPRESS_LOPROC", + "COMPRESS_ZLIB", + "COMPRESS_ZSTD", + "Chdr32", + "Chdr64", + "Class", + "CompressionType", + "DF_1_CONFALT", + "DF_1_DIRECT", + "DF_1_DISPRELDNE", + "DF_1_DISPRELPND", + "DF_1_EDITED", + "DF_1_ENDFILTEE", + "DF_1_GLOBAL", + "DF_1_GLOBAUDIT", + "DF_1_GROUP", + "DF_1_IGNMULDEF", + "DF_1_INITFIRST", + "DF_1_INTERPOSE", + "DF_1_KMOD", + "DF_1_LOADFLTR", + "DF_1_NOCOMMON", + "DF_1_NODEFLIB", + "DF_1_NODELETE", + "DF_1_NODIRECT", + "DF_1_NODUMP", + "DF_1_NOHDR", + "DF_1_NOKSYMS", + "DF_1_NOOPEN", + "DF_1_NORELOC", + "DF_1_NOW", + "DF_1_ORIGIN", + "DF_1_PIE", + "DF_1_SINGLETON", + "DF_1_STUB", + "DF_1_SYMINTPOSE", + "DF_1_TRANS", + "DF_1_WEAKFILTER", + "DF_BIND_NOW", + "DF_ORIGIN", + "DF_STATIC_TLS", + "DF_SYMBOLIC", + "DF_TEXTREL", + "DT_ADDRRNGHI", + "DT_ADDRRNGLO", + "DT_AUDIT", + "DT_AUXILIARY", + "DT_BIND_NOW", + "DT_CHECKSUM", + "DT_CONFIG", + "DT_DEBUG", + "DT_DEPAUDIT", + "DT_ENCODING", + "DT_FEATURE", + "DT_FILTER", + "DT_FINI", + "DT_FINI_ARRAY", + "DT_FINI_ARRAYSZ", + "DT_FLAGS", + "DT_FLAGS_1", + "DT_GNU_CONFLICT", + "DT_GNU_CONFLICTSZ", + "DT_GNU_HASH", + "DT_GNU_LIBLIST", + "DT_GNU_LIBLISTSZ", + "DT_GNU_PRELINKED", + "DT_HASH", + "DT_HIOS", + "DT_HIPROC", + "DT_INIT", + "DT_INIT_ARRAY", + "DT_INIT_ARRAYSZ", + "DT_JMPREL", + "DT_LOOS", + "DT_LOPROC", + "DT_MIPS_AUX_DYNAMIC", + "DT_MIPS_BASE_ADDRESS", + "DT_MIPS_COMPACT_SIZE", + "DT_MIPS_CONFLICT", + "DT_MIPS_CONFLICTNO", + "DT_MIPS_CXX_FLAGS", + "DT_MIPS_DELTA_CLASS", + "DT_MIPS_DELTA_CLASSSYM", + "DT_MIPS_DELTA_CLASSSYM_NO", + "DT_MIPS_DELTA_CLASS_NO", + "DT_MIPS_DELTA_INSTANCE", + "DT_MIPS_DELTA_INSTANCE_NO", + "DT_MIPS_DELTA_RELOC", + "DT_MIPS_DELTA_RELOC_NO", + "DT_MIPS_DELTA_SYM", + "DT_MIPS_DELTA_SYM_NO", + "DT_MIPS_DYNSTR_ALIGN", + "DT_MIPS_FLAGS", + "DT_MIPS_GOTSYM", + "DT_MIPS_GP_VALUE", + "DT_MIPS_HIDDEN_GOTIDX", + "DT_MIPS_HIPAGENO", + "DT_MIPS_ICHECKSUM", + "DT_MIPS_INTERFACE", + "DT_MIPS_INTERFACE_SIZE", + "DT_MIPS_IVERSION", + "DT_MIPS_LIBLIST", + "DT_MIPS_LIBLISTNO", + "DT_MIPS_LOCALPAGE_GOTIDX", + "DT_MIPS_LOCAL_GOTIDX", + "DT_MIPS_LOCAL_GOTNO", + "DT_MIPS_MSYM", + "DT_MIPS_OPTIONS", + "DT_MIPS_PERF_SUFFIX", + "DT_MIPS_PIXIE_INIT", + "DT_MIPS_PLTGOT", + "DT_MIPS_PROTECTED_GOTIDX", + "DT_MIPS_RLD_MAP", + "DT_MIPS_RLD_MAP_REL", + "DT_MIPS_RLD_TEXT_RESOLVE_ADDR", + "DT_MIPS_RLD_VERSION", + "DT_MIPS_RWPLT", + "DT_MIPS_SYMBOL_LIB", + "DT_MIPS_SYMTABNO", + "DT_MIPS_TIME_STAMP", + "DT_MIPS_UNREFEXTNO", + "DT_MOVEENT", + "DT_MOVESZ", + "DT_MOVETAB", + "DT_NEEDED", + "DT_NULL", + "DT_PLTGOT", + "DT_PLTPAD", + "DT_PLTPADSZ", + "DT_PLTREL", + "DT_PLTRELSZ", + "DT_POSFLAG_1", + "DT_PPC64_GLINK", + "DT_PPC64_OPD", + "DT_PPC64_OPDSZ", + "DT_PPC64_OPT", + "DT_PPC_GOT", + "DT_PPC_OPT", + "DT_PREINIT_ARRAY", + "DT_PREINIT_ARRAYSZ", + "DT_REL", + "DT_RELA", + "DT_RELACOUNT", + "DT_RELAENT", + "DT_RELASZ", + "DT_RELCOUNT", + "DT_RELENT", + "DT_RELSZ", + "DT_RPATH", + "DT_RUNPATH", + "DT_SONAME", + "DT_SPARC_REGISTER", + "DT_STRSZ", + "DT_STRTAB", + "DT_SYMBOLIC", + "DT_SYMENT", + "DT_SYMINENT", + "DT_SYMINFO", + "DT_SYMINSZ", + "DT_SYMTAB", + "DT_SYMTAB_SHNDX", + "DT_TEXTREL", + "DT_TLSDESC_GOT", + "DT_TLSDESC_PLT", + "DT_USED", + "DT_VALRNGHI", + "DT_VALRNGLO", + "DT_VERDEF", + "DT_VERDEFNUM", + "DT_VERNEED", + "DT_VERNEEDNUM", + "DT_VERSYM", + "Data", + "Dyn32", + "Dyn64", + "DynFlag", + "DynFlag1", + "DynTag", + "EI_ABIVERSION", + "EI_CLASS", + "EI_DATA", + "EI_NIDENT", + "EI_OSABI", + "EI_PAD", + "EI_VERSION", + "ELFCLASS32", + "ELFCLASS64", + "ELFCLASSNONE", + "ELFDATA2LSB", + "ELFDATA2MSB", + "ELFDATANONE", + "ELFMAG", + "ELFOSABI_86OPEN", + "ELFOSABI_AIX", + "ELFOSABI_ARM", + "ELFOSABI_AROS", + "ELFOSABI_CLOUDABI", + "ELFOSABI_FENIXOS", + "ELFOSABI_FREEBSD", + "ELFOSABI_HPUX", + "ELFOSABI_HURD", + "ELFOSABI_IRIX", + "ELFOSABI_LINUX", + "ELFOSABI_MODESTO", + "ELFOSABI_NETBSD", + "ELFOSABI_NONE", + "ELFOSABI_NSK", + "ELFOSABI_OPENBSD", + "ELFOSABI_OPENVMS", + "ELFOSABI_SOLARIS", + "ELFOSABI_STANDALONE", + "ELFOSABI_TRU64", + "EM_386", + "EM_486", + "EM_56800EX", + "EM_68HC05", + "EM_68HC08", + "EM_68HC11", + "EM_68HC12", + "EM_68HC16", + "EM_68K", + "EM_78KOR", + "EM_8051", + "EM_860", + "EM_88K", + "EM_960", + "EM_AARCH64", + "EM_ALPHA", + "EM_ALPHA_STD", + "EM_ALTERA_NIOS2", + "EM_AMDGPU", + "EM_ARC", + "EM_ARCA", + "EM_ARC_COMPACT", + "EM_ARC_COMPACT2", + "EM_ARM", + "EM_AVR", + "EM_AVR32", + "EM_BA1", + "EM_BA2", + "EM_BLACKFIN", + "EM_BPF", + "EM_C166", + "EM_CDP", + "EM_CE", + "EM_CLOUDSHIELD", + "EM_COGE", + "EM_COLDFIRE", + "EM_COOL", + "EM_COREA_1ST", + "EM_COREA_2ND", + "EM_CR", + "EM_CR16", + "EM_CRAYNV2", + "EM_CRIS", + "EM_CRX", + "EM_CSR_KALIMBA", + "EM_CUDA", + "EM_CYPRESS_M8C", + "EM_D10V", + "EM_D30V", + "EM_DSP24", + "EM_DSPIC30F", + "EM_DXP", + "EM_ECOG1", + "EM_ECOG16", + "EM_ECOG1X", + "EM_ECOG2", + "EM_ETPU", + "EM_EXCESS", + "EM_F2MC16", + "EM_FIREPATH", + "EM_FR20", + "EM_FR30", + "EM_FT32", + "EM_FX66", + "EM_H8S", + "EM_H8_300", + "EM_H8_300H", + "EM_H8_500", + "EM_HUANY", + "EM_IA_64", + "EM_INTEL205", + "EM_INTEL206", + "EM_INTEL207", + "EM_INTEL208", + "EM_INTEL209", + "EM_IP2K", + "EM_JAVELIN", + "EM_K10M", + "EM_KM32", + "EM_KMX16", + "EM_KMX32", + "EM_KMX8", + "EM_KVARC", + "EM_L10M", + "EM_LANAI", + "EM_LATTICEMICO32", + "EM_LOONGARCH", + "EM_M16C", + "EM_M32", + "EM_M32C", + "EM_M32R", + "EM_MANIK", + "EM_MAX", + "EM_MAXQ30", + "EM_MCHP_PIC", + "EM_MCST_ELBRUS", + "EM_ME16", + "EM_METAG", + "EM_MICROBLAZE", + "EM_MIPS", + "EM_MIPS_RS3_LE", + "EM_MIPS_RS4_BE", + "EM_MIPS_X", + "EM_MMA", + "EM_MMDSP_PLUS", + "EM_MMIX", + "EM_MN10200", + "EM_MN10300", + "EM_MOXIE", + "EM_MSP430", + "EM_NCPU", + "EM_NDR1", + "EM_NDS32", + "EM_NONE", + "EM_NORC", + "EM_NS32K", + "EM_OPEN8", + "EM_OPENRISC", + "EM_PARISC", + "EM_PCP", + "EM_PDP10", + "EM_PDP11", + "EM_PDSP", + "EM_PJ", + "EM_PPC", + "EM_PPC64", + "EM_PRISM", + "EM_QDSP6", + "EM_R32C", + "EM_RCE", + "EM_RH32", + "EM_RISCV", + "EM_RL78", + "EM_RS08", + "EM_RX", + "EM_S370", + "EM_S390", + "EM_SCORE7", + "EM_SEP", + "EM_SE_C17", + "EM_SE_C33", + "EM_SH", + "EM_SHARC", + "EM_SLE9X", + "EM_SNP1K", + "EM_SPARC", + "EM_SPARC32PLUS", + "EM_SPARCV9", + "EM_ST100", + "EM_ST19", + "EM_ST200", + "EM_ST7", + "EM_ST9PLUS", + "EM_STARCORE", + "EM_STM8", + "EM_STXP7X", + "EM_SVX", + "EM_TILE64", + "EM_TILEGX", + "EM_TILEPRO", + "EM_TINYJ", + "EM_TI_ARP32", + "EM_TI_C2000", + "EM_TI_C5500", + "EM_TI_C6000", + "EM_TI_PRU", + "EM_TMM_GPP", + "EM_TPC", + "EM_TRICORE", + "EM_TRIMEDIA", + "EM_TSK3000", + "EM_UNICORE", + "EM_V800", + "EM_V850", + "EM_VAX", + "EM_VIDEOCORE", + "EM_VIDEOCORE3", + "EM_VIDEOCORE5", + "EM_VISIUM", + "EM_VPP500", + "EM_X86_64", + "EM_XCORE", + "EM_XGATE", + "EM_XIMO16", + "EM_XTENSA", + "EM_Z80", + "EM_ZSP", + "ET_CORE", + "ET_DYN", + "ET_EXEC", + "ET_HIOS", + "ET_HIPROC", + "ET_LOOS", + "ET_LOPROC", + "ET_NONE", + "ET_REL", + "EV_CURRENT", + "EV_NONE", + "ErrNoSymbols", + "File", + "FileHeader", + "FormatError", + "Header32", + "Header64", + "ImportedSymbol", + "Machine", + "NT_FPREGSET", + "NT_PRPSINFO", + "NT_PRSTATUS", + "NType", + "NewFile", + "OSABI", + "Open", + "PF_MASKOS", + "PF_MASKPROC", + "PF_R", + "PF_W", + "PF_X", + "PT_AARCH64_ARCHEXT", + "PT_AARCH64_UNWIND", + "PT_ARM_ARCHEXT", + "PT_ARM_EXIDX", + "PT_DYNAMIC", + "PT_GNU_EH_FRAME", + "PT_GNU_MBIND_HI", + "PT_GNU_MBIND_LO", + "PT_GNU_PROPERTY", + "PT_GNU_RELRO", + "PT_GNU_STACK", + "PT_HIOS", + "PT_HIPROC", + "PT_INTERP", + "PT_LOAD", + "PT_LOOS", + "PT_LOPROC", + "PT_MIPS_ABIFLAGS", + "PT_MIPS_OPTIONS", + "PT_MIPS_REGINFO", + "PT_MIPS_RTPROC", + "PT_NOTE", + "PT_NULL", + "PT_OPENBSD_BOOTDATA", + "PT_OPENBSD_RANDOMIZE", + "PT_OPENBSD_WXNEEDED", + "PT_PAX_FLAGS", + "PT_PHDR", + "PT_S390_PGSTE", + "PT_SHLIB", + "PT_SUNWSTACK", + "PT_SUNW_EH_FRAME", + "PT_TLS", + "Prog", + "Prog32", + "Prog64", + "ProgFlag", + "ProgHeader", + "ProgType", + "R_386", + "R_386_16", + "R_386_32", + "R_386_32PLT", + "R_386_8", + "R_386_COPY", + "R_386_GLOB_DAT", + "R_386_GOT32", + "R_386_GOT32X", + "R_386_GOTOFF", + "R_386_GOTPC", + "R_386_IRELATIVE", + "R_386_JMP_SLOT", + "R_386_NONE", + "R_386_PC16", + "R_386_PC32", + "R_386_PC8", + "R_386_PLT32", + "R_386_RELATIVE", + "R_386_SIZE32", + "R_386_TLS_DESC", + "R_386_TLS_DESC_CALL", + "R_386_TLS_DTPMOD32", + "R_386_TLS_DTPOFF32", + "R_386_TLS_GD", + "R_386_TLS_GD_32", + "R_386_TLS_GD_CALL", + "R_386_TLS_GD_POP", + "R_386_TLS_GD_PUSH", + "R_386_TLS_GOTDESC", + "R_386_TLS_GOTIE", + "R_386_TLS_IE", + "R_386_TLS_IE_32", + "R_386_TLS_LDM", + "R_386_TLS_LDM_32", + "R_386_TLS_LDM_CALL", + "R_386_TLS_LDM_POP", + "R_386_TLS_LDM_PUSH", + "R_386_TLS_LDO_32", + "R_386_TLS_LE", + "R_386_TLS_LE_32", + "R_386_TLS_TPOFF", + "R_386_TLS_TPOFF32", + "R_390", + "R_390_12", + "R_390_16", + "R_390_20", + "R_390_32", + "R_390_64", + "R_390_8", + "R_390_COPY", + "R_390_GLOB_DAT", + "R_390_GOT12", + "R_390_GOT16", + "R_390_GOT20", + "R_390_GOT32", + "R_390_GOT64", + "R_390_GOTENT", + "R_390_GOTOFF", + "R_390_GOTOFF16", + "R_390_GOTOFF64", + "R_390_GOTPC", + "R_390_GOTPCDBL", + "R_390_GOTPLT12", + "R_390_GOTPLT16", + "R_390_GOTPLT20", + "R_390_GOTPLT32", + "R_390_GOTPLT64", + "R_390_GOTPLTENT", + "R_390_GOTPLTOFF16", + "R_390_GOTPLTOFF32", + "R_390_GOTPLTOFF64", + "R_390_JMP_SLOT", + "R_390_NONE", + "R_390_PC16", + "R_390_PC16DBL", + "R_390_PC32", + "R_390_PC32DBL", + "R_390_PC64", + "R_390_PLT16DBL", + "R_390_PLT32", + "R_390_PLT32DBL", + "R_390_PLT64", + "R_390_RELATIVE", + "R_390_TLS_DTPMOD", + "R_390_TLS_DTPOFF", + "R_390_TLS_GD32", + "R_390_TLS_GD64", + "R_390_TLS_GDCALL", + "R_390_TLS_GOTIE12", + "R_390_TLS_GOTIE20", + "R_390_TLS_GOTIE32", + "R_390_TLS_GOTIE64", + "R_390_TLS_IE32", + "R_390_TLS_IE64", + "R_390_TLS_IEENT", + "R_390_TLS_LDCALL", + "R_390_TLS_LDM32", + "R_390_TLS_LDM64", + "R_390_TLS_LDO32", + "R_390_TLS_LDO64", + "R_390_TLS_LE32", + "R_390_TLS_LE64", + "R_390_TLS_LOAD", + "R_390_TLS_TPOFF", + "R_AARCH64", + "R_AARCH64_ABS16", + "R_AARCH64_ABS32", + "R_AARCH64_ABS64", + "R_AARCH64_ADD_ABS_LO12_NC", + "R_AARCH64_ADR_GOT_PAGE", + "R_AARCH64_ADR_PREL_LO21", + "R_AARCH64_ADR_PREL_PG_HI21", + "R_AARCH64_ADR_PREL_PG_HI21_NC", + "R_AARCH64_CALL26", + "R_AARCH64_CONDBR19", + "R_AARCH64_COPY", + "R_AARCH64_GLOB_DAT", + "R_AARCH64_GOT_LD_PREL19", + "R_AARCH64_IRELATIVE", + "R_AARCH64_JUMP26", + "R_AARCH64_JUMP_SLOT", + "R_AARCH64_LD64_GOTOFF_LO15", + "R_AARCH64_LD64_GOTPAGE_LO15", + "R_AARCH64_LD64_GOT_LO12_NC", + "R_AARCH64_LDST128_ABS_LO12_NC", + "R_AARCH64_LDST16_ABS_LO12_NC", + "R_AARCH64_LDST32_ABS_LO12_NC", + "R_AARCH64_LDST64_ABS_LO12_NC", + "R_AARCH64_LDST8_ABS_LO12_NC", + "R_AARCH64_LD_PREL_LO19", + "R_AARCH64_MOVW_SABS_G0", + "R_AARCH64_MOVW_SABS_G1", + "R_AARCH64_MOVW_SABS_G2", + "R_AARCH64_MOVW_UABS_G0", + "R_AARCH64_MOVW_UABS_G0_NC", + "R_AARCH64_MOVW_UABS_G1", + "R_AARCH64_MOVW_UABS_G1_NC", + "R_AARCH64_MOVW_UABS_G2", + "R_AARCH64_MOVW_UABS_G2_NC", + "R_AARCH64_MOVW_UABS_G3", + "R_AARCH64_NONE", + "R_AARCH64_NULL", + "R_AARCH64_P32_ABS16", + "R_AARCH64_P32_ABS32", + "R_AARCH64_P32_ADD_ABS_LO12_NC", + "R_AARCH64_P32_ADR_GOT_PAGE", + "R_AARCH64_P32_ADR_PREL_LO21", + "R_AARCH64_P32_ADR_PREL_PG_HI21", + "R_AARCH64_P32_CALL26", + "R_AARCH64_P32_CONDBR19", + "R_AARCH64_P32_COPY", + "R_AARCH64_P32_GLOB_DAT", + "R_AARCH64_P32_GOT_LD_PREL19", + "R_AARCH64_P32_IRELATIVE", + "R_AARCH64_P32_JUMP26", + "R_AARCH64_P32_JUMP_SLOT", + "R_AARCH64_P32_LD32_GOT_LO12_NC", + "R_AARCH64_P32_LDST128_ABS_LO12_NC", + "R_AARCH64_P32_LDST16_ABS_LO12_NC", + "R_AARCH64_P32_LDST32_ABS_LO12_NC", + "R_AARCH64_P32_LDST64_ABS_LO12_NC", + "R_AARCH64_P32_LDST8_ABS_LO12_NC", + "R_AARCH64_P32_LD_PREL_LO19", + "R_AARCH64_P32_MOVW_SABS_G0", + "R_AARCH64_P32_MOVW_UABS_G0", + "R_AARCH64_P32_MOVW_UABS_G0_NC", + "R_AARCH64_P32_MOVW_UABS_G1", + "R_AARCH64_P32_PREL16", + "R_AARCH64_P32_PREL32", + "R_AARCH64_P32_RELATIVE", + "R_AARCH64_P32_TLSDESC", + "R_AARCH64_P32_TLSDESC_ADD_LO12_NC", + "R_AARCH64_P32_TLSDESC_ADR_PAGE21", + "R_AARCH64_P32_TLSDESC_ADR_PREL21", + "R_AARCH64_P32_TLSDESC_CALL", + "R_AARCH64_P32_TLSDESC_LD32_LO12_NC", + "R_AARCH64_P32_TLSDESC_LD_PREL19", + "R_AARCH64_P32_TLSGD_ADD_LO12_NC", + "R_AARCH64_P32_TLSGD_ADR_PAGE21", + "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", + "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", + "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", + "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", + "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", + "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", + "R_AARCH64_P32_TLS_DTPMOD", + "R_AARCH64_P32_TLS_DTPREL", + "R_AARCH64_P32_TLS_TPREL", + "R_AARCH64_P32_TSTBR14", + "R_AARCH64_PREL16", + "R_AARCH64_PREL32", + "R_AARCH64_PREL64", + "R_AARCH64_RELATIVE", + "R_AARCH64_TLSDESC", + "R_AARCH64_TLSDESC_ADD", + "R_AARCH64_TLSDESC_ADD_LO12_NC", + "R_AARCH64_TLSDESC_ADR_PAGE21", + "R_AARCH64_TLSDESC_ADR_PREL21", + "R_AARCH64_TLSDESC_CALL", + "R_AARCH64_TLSDESC_LD64_LO12_NC", + "R_AARCH64_TLSDESC_LDR", + "R_AARCH64_TLSDESC_LD_PREL19", + "R_AARCH64_TLSDESC_OFF_G0_NC", + "R_AARCH64_TLSDESC_OFF_G1", + "R_AARCH64_TLSGD_ADD_LO12_NC", + "R_AARCH64_TLSGD_ADR_PAGE21", + "R_AARCH64_TLSGD_ADR_PREL21", + "R_AARCH64_TLSGD_MOVW_G0_NC", + "R_AARCH64_TLSGD_MOVW_G1", + "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", + "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", + "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", + "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", + "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", + "R_AARCH64_TLSLD_ADR_PAGE21", + "R_AARCH64_TLSLD_ADR_PREL21", + "R_AARCH64_TLSLD_LDST128_DTPREL_LO12", + "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", + "R_AARCH64_TLSLE_ADD_TPREL_HI12", + "R_AARCH64_TLSLE_ADD_TPREL_LO12", + "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", + "R_AARCH64_TLSLE_LDST128_TPREL_LO12", + "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G0", + "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G1", + "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G2", + "R_AARCH64_TLS_DTPMOD64", + "R_AARCH64_TLS_DTPREL64", + "R_AARCH64_TLS_TPREL64", + "R_AARCH64_TSTBR14", + "R_ALPHA", + "R_ALPHA_BRADDR", + "R_ALPHA_COPY", + "R_ALPHA_GLOB_DAT", + "R_ALPHA_GPDISP", + "R_ALPHA_GPREL32", + "R_ALPHA_GPRELHIGH", + "R_ALPHA_GPRELLOW", + "R_ALPHA_GPVALUE", + "R_ALPHA_HINT", + "R_ALPHA_IMMED_BR_HI32", + "R_ALPHA_IMMED_GP_16", + "R_ALPHA_IMMED_GP_HI32", + "R_ALPHA_IMMED_LO32", + "R_ALPHA_IMMED_SCN_HI32", + "R_ALPHA_JMP_SLOT", + "R_ALPHA_LITERAL", + "R_ALPHA_LITUSE", + "R_ALPHA_NONE", + "R_ALPHA_OP_PRSHIFT", + "R_ALPHA_OP_PSUB", + "R_ALPHA_OP_PUSH", + "R_ALPHA_OP_STORE", + "R_ALPHA_REFLONG", + "R_ALPHA_REFQUAD", + "R_ALPHA_RELATIVE", + "R_ALPHA_SREL16", + "R_ALPHA_SREL32", + "R_ALPHA_SREL64", + "R_ARM", + "R_ARM_ABS12", + "R_ARM_ABS16", + "R_ARM_ABS32", + "R_ARM_ABS32_NOI", + "R_ARM_ABS8", + "R_ARM_ALU_PCREL_15_8", + "R_ARM_ALU_PCREL_23_15", + "R_ARM_ALU_PCREL_7_0", + "R_ARM_ALU_PC_G0", + "R_ARM_ALU_PC_G0_NC", + "R_ARM_ALU_PC_G1", + "R_ARM_ALU_PC_G1_NC", + "R_ARM_ALU_PC_G2", + "R_ARM_ALU_SBREL_19_12_NC", + "R_ARM_ALU_SBREL_27_20_CK", + "R_ARM_ALU_SB_G0", + "R_ARM_ALU_SB_G0_NC", + "R_ARM_ALU_SB_G1", + "R_ARM_ALU_SB_G1_NC", + "R_ARM_ALU_SB_G2", + "R_ARM_AMP_VCALL9", + "R_ARM_BASE_ABS", + "R_ARM_CALL", + "R_ARM_COPY", + "R_ARM_GLOB_DAT", + "R_ARM_GNU_VTENTRY", + "R_ARM_GNU_VTINHERIT", + "R_ARM_GOT32", + "R_ARM_GOTOFF", + "R_ARM_GOTOFF12", + "R_ARM_GOTPC", + "R_ARM_GOTRELAX", + "R_ARM_GOT_ABS", + "R_ARM_GOT_BREL12", + "R_ARM_GOT_PREL", + "R_ARM_IRELATIVE", + "R_ARM_JUMP24", + "R_ARM_JUMP_SLOT", + "R_ARM_LDC_PC_G0", + "R_ARM_LDC_PC_G1", + "R_ARM_LDC_PC_G2", + "R_ARM_LDC_SB_G0", + "R_ARM_LDC_SB_G1", + "R_ARM_LDC_SB_G2", + "R_ARM_LDRS_PC_G0", + "R_ARM_LDRS_PC_G1", + "R_ARM_LDRS_PC_G2", + "R_ARM_LDRS_SB_G0", + "R_ARM_LDRS_SB_G1", + "R_ARM_LDRS_SB_G2", + "R_ARM_LDR_PC_G1", + "R_ARM_LDR_PC_G2", + "R_ARM_LDR_SBREL_11_10_NC", + "R_ARM_LDR_SB_G0", + "R_ARM_LDR_SB_G1", + "R_ARM_LDR_SB_G2", + "R_ARM_ME_TOO", + "R_ARM_MOVT_ABS", + "R_ARM_MOVT_BREL", + "R_ARM_MOVT_PREL", + "R_ARM_MOVW_ABS_NC", + "R_ARM_MOVW_BREL", + "R_ARM_MOVW_BREL_NC", + "R_ARM_MOVW_PREL_NC", + "R_ARM_NONE", + "R_ARM_PC13", + "R_ARM_PC24", + "R_ARM_PLT32", + "R_ARM_PLT32_ABS", + "R_ARM_PREL31", + "R_ARM_PRIVATE_0", + "R_ARM_PRIVATE_1", + "R_ARM_PRIVATE_10", + "R_ARM_PRIVATE_11", + "R_ARM_PRIVATE_12", + "R_ARM_PRIVATE_13", + "R_ARM_PRIVATE_14", + "R_ARM_PRIVATE_15", + "R_ARM_PRIVATE_2", + "R_ARM_PRIVATE_3", + "R_ARM_PRIVATE_4", + "R_ARM_PRIVATE_5", + "R_ARM_PRIVATE_6", + "R_ARM_PRIVATE_7", + "R_ARM_PRIVATE_8", + "R_ARM_PRIVATE_9", + "R_ARM_RABS32", + "R_ARM_RBASE", + "R_ARM_REL32", + "R_ARM_REL32_NOI", + "R_ARM_RELATIVE", + "R_ARM_RPC24", + "R_ARM_RREL32", + "R_ARM_RSBREL32", + "R_ARM_RXPC25", + "R_ARM_SBREL31", + "R_ARM_SBREL32", + "R_ARM_SWI24", + "R_ARM_TARGET1", + "R_ARM_TARGET2", + "R_ARM_THM_ABS5", + "R_ARM_THM_ALU_ABS_G0_NC", + "R_ARM_THM_ALU_ABS_G1_NC", + "R_ARM_THM_ALU_ABS_G2_NC", + "R_ARM_THM_ALU_ABS_G3", + "R_ARM_THM_ALU_PREL_11_0", + "R_ARM_THM_GOT_BREL12", + "R_ARM_THM_JUMP11", + "R_ARM_THM_JUMP19", + "R_ARM_THM_JUMP24", + "R_ARM_THM_JUMP6", + "R_ARM_THM_JUMP8", + "R_ARM_THM_MOVT_ABS", + "R_ARM_THM_MOVT_BREL", + "R_ARM_THM_MOVT_PREL", + "R_ARM_THM_MOVW_ABS_NC", + "R_ARM_THM_MOVW_BREL", + "R_ARM_THM_MOVW_BREL_NC", + "R_ARM_THM_MOVW_PREL_NC", + "R_ARM_THM_PC12", + "R_ARM_THM_PC22", + "R_ARM_THM_PC8", + "R_ARM_THM_RPC22", + "R_ARM_THM_SWI8", + "R_ARM_THM_TLS_CALL", + "R_ARM_THM_TLS_DESCSEQ16", + "R_ARM_THM_TLS_DESCSEQ32", + "R_ARM_THM_XPC22", + "R_ARM_TLS_CALL", + "R_ARM_TLS_DESCSEQ", + "R_ARM_TLS_DTPMOD32", + "R_ARM_TLS_DTPOFF32", + "R_ARM_TLS_GD32", + "R_ARM_TLS_GOTDESC", + "R_ARM_TLS_IE12GP", + "R_ARM_TLS_IE32", + "R_ARM_TLS_LDM32", + "R_ARM_TLS_LDO12", + "R_ARM_TLS_LDO32", + "R_ARM_TLS_LE12", + "R_ARM_TLS_LE32", + "R_ARM_TLS_TPOFF32", + "R_ARM_V4BX", + "R_ARM_XPC25", + "R_INFO", + "R_INFO32", + "R_LARCH", + "R_LARCH_32", + "R_LARCH_32_PCREL", + "R_LARCH_64", + "R_LARCH_ABS64_HI12", + "R_LARCH_ABS64_LO20", + "R_LARCH_ABS_HI20", + "R_LARCH_ABS_LO12", + "R_LARCH_ADD16", + "R_LARCH_ADD24", + "R_LARCH_ADD32", + "R_LARCH_ADD64", + "R_LARCH_ADD8", + "R_LARCH_B16", + "R_LARCH_B21", + "R_LARCH_B26", + "R_LARCH_COPY", + "R_LARCH_GNU_VTENTRY", + "R_LARCH_GNU_VTINHERIT", + "R_LARCH_GOT64_HI12", + "R_LARCH_GOT64_LO20", + "R_LARCH_GOT64_PC_HI12", + "R_LARCH_GOT64_PC_LO20", + "R_LARCH_GOT_HI20", + "R_LARCH_GOT_LO12", + "R_LARCH_GOT_PC_HI20", + "R_LARCH_GOT_PC_LO12", + "R_LARCH_IRELATIVE", + "R_LARCH_JUMP_SLOT", + "R_LARCH_MARK_LA", + "R_LARCH_MARK_PCREL", + "R_LARCH_NONE", + "R_LARCH_PCALA64_HI12", + "R_LARCH_PCALA64_LO20", + "R_LARCH_PCALA_HI20", + "R_LARCH_PCALA_LO12", + "R_LARCH_RELATIVE", + "R_LARCH_RELAX", + "R_LARCH_SOP_ADD", + "R_LARCH_SOP_AND", + "R_LARCH_SOP_ASSERT", + "R_LARCH_SOP_IF_ELSE", + "R_LARCH_SOP_NOT", + "R_LARCH_SOP_POP_32_S_0_10_10_16_S2", + "R_LARCH_SOP_POP_32_S_0_5_10_16_S2", + "R_LARCH_SOP_POP_32_S_10_12", + "R_LARCH_SOP_POP_32_S_10_16", + "R_LARCH_SOP_POP_32_S_10_16_S2", + "R_LARCH_SOP_POP_32_S_10_5", + "R_LARCH_SOP_POP_32_S_5_20", + "R_LARCH_SOP_POP_32_U", + "R_LARCH_SOP_POP_32_U_10_12", + "R_LARCH_SOP_PUSH_ABSOLUTE", + "R_LARCH_SOP_PUSH_DUP", + "R_LARCH_SOP_PUSH_GPREL", + "R_LARCH_SOP_PUSH_PCREL", + "R_LARCH_SOP_PUSH_PLT_PCREL", + "R_LARCH_SOP_PUSH_TLS_GD", + "R_LARCH_SOP_PUSH_TLS_GOT", + "R_LARCH_SOP_PUSH_TLS_TPREL", + "R_LARCH_SOP_SL", + "R_LARCH_SOP_SR", + "R_LARCH_SOP_SUB", + "R_LARCH_SUB16", + "R_LARCH_SUB24", + "R_LARCH_SUB32", + "R_LARCH_SUB64", + "R_LARCH_SUB8", + "R_LARCH_TLS_DTPMOD32", + "R_LARCH_TLS_DTPMOD64", + "R_LARCH_TLS_DTPREL32", + "R_LARCH_TLS_DTPREL64", + "R_LARCH_TLS_GD_HI20", + "R_LARCH_TLS_GD_PC_HI20", + "R_LARCH_TLS_IE64_HI12", + "R_LARCH_TLS_IE64_LO20", + "R_LARCH_TLS_IE64_PC_HI12", + "R_LARCH_TLS_IE64_PC_LO20", + "R_LARCH_TLS_IE_HI20", + "R_LARCH_TLS_IE_LO12", + "R_LARCH_TLS_IE_PC_HI20", + "R_LARCH_TLS_IE_PC_LO12", + "R_LARCH_TLS_LD_HI20", + "R_LARCH_TLS_LD_PC_HI20", + "R_LARCH_TLS_LE64_HI12", + "R_LARCH_TLS_LE64_LO20", + "R_LARCH_TLS_LE_HI20", + "R_LARCH_TLS_LE_LO12", + "R_LARCH_TLS_TPREL32", + "R_LARCH_TLS_TPREL64", + "R_MIPS", + "R_MIPS_16", + "R_MIPS_26", + "R_MIPS_32", + "R_MIPS_64", + "R_MIPS_ADD_IMMEDIATE", + "R_MIPS_CALL16", + "R_MIPS_CALL_HI16", + "R_MIPS_CALL_LO16", + "R_MIPS_DELETE", + "R_MIPS_GOT16", + "R_MIPS_GOT_DISP", + "R_MIPS_GOT_HI16", + "R_MIPS_GOT_LO16", + "R_MIPS_GOT_OFST", + "R_MIPS_GOT_PAGE", + "R_MIPS_GPREL16", + "R_MIPS_GPREL32", + "R_MIPS_HI16", + "R_MIPS_HIGHER", + "R_MIPS_HIGHEST", + "R_MIPS_INSERT_A", + "R_MIPS_INSERT_B", + "R_MIPS_JALR", + "R_MIPS_LITERAL", + "R_MIPS_LO16", + "R_MIPS_NONE", + "R_MIPS_PC16", + "R_MIPS_PJUMP", + "R_MIPS_REL16", + "R_MIPS_REL32", + "R_MIPS_RELGOT", + "R_MIPS_SCN_DISP", + "R_MIPS_SHIFT5", + "R_MIPS_SHIFT6", + "R_MIPS_SUB", + "R_MIPS_TLS_DTPMOD32", + "R_MIPS_TLS_DTPMOD64", + "R_MIPS_TLS_DTPREL32", + "R_MIPS_TLS_DTPREL64", + "R_MIPS_TLS_DTPREL_HI16", + "R_MIPS_TLS_DTPREL_LO16", + "R_MIPS_TLS_GD", + "R_MIPS_TLS_GOTTPREL", + "R_MIPS_TLS_LDM", + "R_MIPS_TLS_TPREL32", + "R_MIPS_TLS_TPREL64", + "R_MIPS_TLS_TPREL_HI16", + "R_MIPS_TLS_TPREL_LO16", + "R_PPC", + "R_PPC64", + "R_PPC64_ADDR14", + "R_PPC64_ADDR14_BRNTAKEN", + "R_PPC64_ADDR14_BRTAKEN", + "R_PPC64_ADDR16", + "R_PPC64_ADDR16_DS", + "R_PPC64_ADDR16_HA", + "R_PPC64_ADDR16_HI", + "R_PPC64_ADDR16_HIGH", + "R_PPC64_ADDR16_HIGHA", + "R_PPC64_ADDR16_HIGHER", + "R_PPC64_ADDR16_HIGHER34", + "R_PPC64_ADDR16_HIGHERA", + "R_PPC64_ADDR16_HIGHERA34", + "R_PPC64_ADDR16_HIGHEST", + "R_PPC64_ADDR16_HIGHEST34", + "R_PPC64_ADDR16_HIGHESTA", + "R_PPC64_ADDR16_HIGHESTA34", + "R_PPC64_ADDR16_LO", + "R_PPC64_ADDR16_LO_DS", + "R_PPC64_ADDR24", + "R_PPC64_ADDR32", + "R_PPC64_ADDR64", + "R_PPC64_ADDR64_LOCAL", + "R_PPC64_COPY", + "R_PPC64_D28", + "R_PPC64_D34", + "R_PPC64_D34_HA30", + "R_PPC64_D34_HI30", + "R_PPC64_D34_LO", + "R_PPC64_DTPMOD64", + "R_PPC64_DTPREL16", + "R_PPC64_DTPREL16_DS", + "R_PPC64_DTPREL16_HA", + "R_PPC64_DTPREL16_HI", + "R_PPC64_DTPREL16_HIGH", + "R_PPC64_DTPREL16_HIGHA", + "R_PPC64_DTPREL16_HIGHER", + "R_PPC64_DTPREL16_HIGHERA", + "R_PPC64_DTPREL16_HIGHEST", + "R_PPC64_DTPREL16_HIGHESTA", + "R_PPC64_DTPREL16_LO", + "R_PPC64_DTPREL16_LO_DS", + "R_PPC64_DTPREL34", + "R_PPC64_DTPREL64", + "R_PPC64_ENTRY", + "R_PPC64_GLOB_DAT", + "R_PPC64_GNU_VTENTRY", + "R_PPC64_GNU_VTINHERIT", + "R_PPC64_GOT16", + "R_PPC64_GOT16_DS", + "R_PPC64_GOT16_HA", + "R_PPC64_GOT16_HI", + "R_PPC64_GOT16_LO", + "R_PPC64_GOT16_LO_DS", + "R_PPC64_GOT_DTPREL16_DS", + "R_PPC64_GOT_DTPREL16_HA", + "R_PPC64_GOT_DTPREL16_HI", + "R_PPC64_GOT_DTPREL16_LO_DS", + "R_PPC64_GOT_DTPREL_PCREL34", + "R_PPC64_GOT_PCREL34", + "R_PPC64_GOT_TLSGD16", + "R_PPC64_GOT_TLSGD16_HA", + "R_PPC64_GOT_TLSGD16_HI", + "R_PPC64_GOT_TLSGD16_LO", + "R_PPC64_GOT_TLSGD_PCREL34", + "R_PPC64_GOT_TLSLD16", + "R_PPC64_GOT_TLSLD16_HA", + "R_PPC64_GOT_TLSLD16_HI", + "R_PPC64_GOT_TLSLD16_LO", + "R_PPC64_GOT_TLSLD_PCREL34", + "R_PPC64_GOT_TPREL16_DS", + "R_PPC64_GOT_TPREL16_HA", + "R_PPC64_GOT_TPREL16_HI", + "R_PPC64_GOT_TPREL16_LO_DS", + "R_PPC64_GOT_TPREL_PCREL34", + "R_PPC64_IRELATIVE", + "R_PPC64_JMP_IREL", + "R_PPC64_JMP_SLOT", + "R_PPC64_NONE", + "R_PPC64_PCREL28", + "R_PPC64_PCREL34", + "R_PPC64_PCREL_OPT", + "R_PPC64_PLT16_HA", + "R_PPC64_PLT16_HI", + "R_PPC64_PLT16_LO", + "R_PPC64_PLT16_LO_DS", + "R_PPC64_PLT32", + "R_PPC64_PLT64", + "R_PPC64_PLTCALL", + "R_PPC64_PLTCALL_NOTOC", + "R_PPC64_PLTGOT16", + "R_PPC64_PLTGOT16_DS", + "R_PPC64_PLTGOT16_HA", + "R_PPC64_PLTGOT16_HI", + "R_PPC64_PLTGOT16_LO", + "R_PPC64_PLTGOT_LO_DS", + "R_PPC64_PLTREL32", + "R_PPC64_PLTREL64", + "R_PPC64_PLTSEQ", + "R_PPC64_PLTSEQ_NOTOC", + "R_PPC64_PLT_PCREL34", + "R_PPC64_PLT_PCREL34_NOTOC", + "R_PPC64_REL14", + "R_PPC64_REL14_BRNTAKEN", + "R_PPC64_REL14_BRTAKEN", + "R_PPC64_REL16", + "R_PPC64_REL16DX_HA", + "R_PPC64_REL16_HA", + "R_PPC64_REL16_HI", + "R_PPC64_REL16_HIGH", + "R_PPC64_REL16_HIGHA", + "R_PPC64_REL16_HIGHER", + "R_PPC64_REL16_HIGHER34", + "R_PPC64_REL16_HIGHERA", + "R_PPC64_REL16_HIGHERA34", + "R_PPC64_REL16_HIGHEST", + "R_PPC64_REL16_HIGHEST34", + "R_PPC64_REL16_HIGHESTA", + "R_PPC64_REL16_HIGHESTA34", + "R_PPC64_REL16_LO", + "R_PPC64_REL24", + "R_PPC64_REL24_NOTOC", + "R_PPC64_REL24_P9NOTOC", + "R_PPC64_REL30", + "R_PPC64_REL32", + "R_PPC64_REL64", + "R_PPC64_RELATIVE", + "R_PPC64_SECTOFF", + "R_PPC64_SECTOFF_DS", + "R_PPC64_SECTOFF_HA", + "R_PPC64_SECTOFF_HI", + "R_PPC64_SECTOFF_LO", + "R_PPC64_SECTOFF_LO_DS", + "R_PPC64_TLS", + "R_PPC64_TLSGD", + "R_PPC64_TLSLD", + "R_PPC64_TOC", + "R_PPC64_TOC16", + "R_PPC64_TOC16_DS", + "R_PPC64_TOC16_HA", + "R_PPC64_TOC16_HI", + "R_PPC64_TOC16_LO", + "R_PPC64_TOC16_LO_DS", + "R_PPC64_TOCSAVE", + "R_PPC64_TPREL16", + "R_PPC64_TPREL16_DS", + "R_PPC64_TPREL16_HA", + "R_PPC64_TPREL16_HI", + "R_PPC64_TPREL16_HIGH", + "R_PPC64_TPREL16_HIGHA", + "R_PPC64_TPREL16_HIGHER", + "R_PPC64_TPREL16_HIGHERA", + "R_PPC64_TPREL16_HIGHEST", + "R_PPC64_TPREL16_HIGHESTA", + "R_PPC64_TPREL16_LO", + "R_PPC64_TPREL16_LO_DS", + "R_PPC64_TPREL34", + "R_PPC64_TPREL64", + "R_PPC64_UADDR16", + "R_PPC64_UADDR32", + "R_PPC64_UADDR64", + "R_PPC_ADDR14", + "R_PPC_ADDR14_BRNTAKEN", + "R_PPC_ADDR14_BRTAKEN", + "R_PPC_ADDR16", + "R_PPC_ADDR16_HA", + "R_PPC_ADDR16_HI", + "R_PPC_ADDR16_LO", + "R_PPC_ADDR24", + "R_PPC_ADDR32", + "R_PPC_COPY", + "R_PPC_DTPMOD32", + "R_PPC_DTPREL16", + "R_PPC_DTPREL16_HA", + "R_PPC_DTPREL16_HI", + "R_PPC_DTPREL16_LO", + "R_PPC_DTPREL32", + "R_PPC_EMB_BIT_FLD", + "R_PPC_EMB_MRKREF", + "R_PPC_EMB_NADDR16", + "R_PPC_EMB_NADDR16_HA", + "R_PPC_EMB_NADDR16_HI", + "R_PPC_EMB_NADDR16_LO", + "R_PPC_EMB_NADDR32", + "R_PPC_EMB_RELSDA", + "R_PPC_EMB_RELSEC16", + "R_PPC_EMB_RELST_HA", + "R_PPC_EMB_RELST_HI", + "R_PPC_EMB_RELST_LO", + "R_PPC_EMB_SDA21", + "R_PPC_EMB_SDA2I16", + "R_PPC_EMB_SDA2REL", + "R_PPC_EMB_SDAI16", + "R_PPC_GLOB_DAT", + "R_PPC_GOT16", + "R_PPC_GOT16_HA", + "R_PPC_GOT16_HI", + "R_PPC_GOT16_LO", + "R_PPC_GOT_TLSGD16", + "R_PPC_GOT_TLSGD16_HA", + "R_PPC_GOT_TLSGD16_HI", + "R_PPC_GOT_TLSGD16_LO", + "R_PPC_GOT_TLSLD16", + "R_PPC_GOT_TLSLD16_HA", + "R_PPC_GOT_TLSLD16_HI", + "R_PPC_GOT_TLSLD16_LO", + "R_PPC_GOT_TPREL16", + "R_PPC_GOT_TPREL16_HA", + "R_PPC_GOT_TPREL16_HI", + "R_PPC_GOT_TPREL16_LO", + "R_PPC_JMP_SLOT", + "R_PPC_LOCAL24PC", + "R_PPC_NONE", + "R_PPC_PLT16_HA", + "R_PPC_PLT16_HI", + "R_PPC_PLT16_LO", + "R_PPC_PLT32", + "R_PPC_PLTREL24", + "R_PPC_PLTREL32", + "R_PPC_REL14", + "R_PPC_REL14_BRNTAKEN", + "R_PPC_REL14_BRTAKEN", + "R_PPC_REL24", + "R_PPC_REL32", + "R_PPC_RELATIVE", + "R_PPC_SDAREL16", + "R_PPC_SECTOFF", + "R_PPC_SECTOFF_HA", + "R_PPC_SECTOFF_HI", + "R_PPC_SECTOFF_LO", + "R_PPC_TLS", + "R_PPC_TPREL16", + "R_PPC_TPREL16_HA", + "R_PPC_TPREL16_HI", + "R_PPC_TPREL16_LO", + "R_PPC_TPREL32", + "R_PPC_UADDR16", + "R_PPC_UADDR32", + "R_RISCV", + "R_RISCV_32", + "R_RISCV_32_PCREL", + "R_RISCV_64", + "R_RISCV_ADD16", + "R_RISCV_ADD32", + "R_RISCV_ADD64", + "R_RISCV_ADD8", + "R_RISCV_ALIGN", + "R_RISCV_BRANCH", + "R_RISCV_CALL", + "R_RISCV_CALL_PLT", + "R_RISCV_COPY", + "R_RISCV_GNU_VTENTRY", + "R_RISCV_GNU_VTINHERIT", + "R_RISCV_GOT_HI20", + "R_RISCV_GPREL_I", + "R_RISCV_GPREL_S", + "R_RISCV_HI20", + "R_RISCV_JAL", + "R_RISCV_JUMP_SLOT", + "R_RISCV_LO12_I", + "R_RISCV_LO12_S", + "R_RISCV_NONE", + "R_RISCV_PCREL_HI20", + "R_RISCV_PCREL_LO12_I", + "R_RISCV_PCREL_LO12_S", + "R_RISCV_RELATIVE", + "R_RISCV_RELAX", + "R_RISCV_RVC_BRANCH", + "R_RISCV_RVC_JUMP", + "R_RISCV_RVC_LUI", + "R_RISCV_SET16", + "R_RISCV_SET32", + "R_RISCV_SET6", + "R_RISCV_SET8", + "R_RISCV_SUB16", + "R_RISCV_SUB32", + "R_RISCV_SUB6", + "R_RISCV_SUB64", + "R_RISCV_SUB8", + "R_RISCV_TLS_DTPMOD32", + "R_RISCV_TLS_DTPMOD64", + "R_RISCV_TLS_DTPREL32", + "R_RISCV_TLS_DTPREL64", + "R_RISCV_TLS_GD_HI20", + "R_RISCV_TLS_GOT_HI20", + "R_RISCV_TLS_TPREL32", + "R_RISCV_TLS_TPREL64", + "R_RISCV_TPREL_ADD", + "R_RISCV_TPREL_HI20", + "R_RISCV_TPREL_I", + "R_RISCV_TPREL_LO12_I", + "R_RISCV_TPREL_LO12_S", + "R_RISCV_TPREL_S", + "R_SPARC", + "R_SPARC_10", + "R_SPARC_11", + "R_SPARC_13", + "R_SPARC_16", + "R_SPARC_22", + "R_SPARC_32", + "R_SPARC_5", + "R_SPARC_6", + "R_SPARC_64", + "R_SPARC_7", + "R_SPARC_8", + "R_SPARC_COPY", + "R_SPARC_DISP16", + "R_SPARC_DISP32", + "R_SPARC_DISP64", + "R_SPARC_DISP8", + "R_SPARC_GLOB_DAT", + "R_SPARC_GLOB_JMP", + "R_SPARC_GOT10", + "R_SPARC_GOT13", + "R_SPARC_GOT22", + "R_SPARC_H44", + "R_SPARC_HH22", + "R_SPARC_HI22", + "R_SPARC_HIPLT22", + "R_SPARC_HIX22", + "R_SPARC_HM10", + "R_SPARC_JMP_SLOT", + "R_SPARC_L44", + "R_SPARC_LM22", + "R_SPARC_LO10", + "R_SPARC_LOPLT10", + "R_SPARC_LOX10", + "R_SPARC_M44", + "R_SPARC_NONE", + "R_SPARC_OLO10", + "R_SPARC_PC10", + "R_SPARC_PC22", + "R_SPARC_PCPLT10", + "R_SPARC_PCPLT22", + "R_SPARC_PCPLT32", + "R_SPARC_PC_HH22", + "R_SPARC_PC_HM10", + "R_SPARC_PC_LM22", + "R_SPARC_PLT32", + "R_SPARC_PLT64", + "R_SPARC_REGISTER", + "R_SPARC_RELATIVE", + "R_SPARC_UA16", + "R_SPARC_UA32", + "R_SPARC_UA64", + "R_SPARC_WDISP16", + "R_SPARC_WDISP19", + "R_SPARC_WDISP22", + "R_SPARC_WDISP30", + "R_SPARC_WPLT30", + "R_SYM32", + "R_SYM64", + "R_TYPE32", + "R_TYPE64", + "R_X86_64", + "R_X86_64_16", + "R_X86_64_32", + "R_X86_64_32S", + "R_X86_64_64", + "R_X86_64_8", + "R_X86_64_COPY", + "R_X86_64_DTPMOD64", + "R_X86_64_DTPOFF32", + "R_X86_64_DTPOFF64", + "R_X86_64_GLOB_DAT", + "R_X86_64_GOT32", + "R_X86_64_GOT64", + "R_X86_64_GOTOFF64", + "R_X86_64_GOTPC32", + "R_X86_64_GOTPC32_TLSDESC", + "R_X86_64_GOTPC64", + "R_X86_64_GOTPCREL", + "R_X86_64_GOTPCREL64", + "R_X86_64_GOTPCRELX", + "R_X86_64_GOTPLT64", + "R_X86_64_GOTTPOFF", + "R_X86_64_IRELATIVE", + "R_X86_64_JMP_SLOT", + "R_X86_64_NONE", + "R_X86_64_PC16", + "R_X86_64_PC32", + "R_X86_64_PC32_BND", + "R_X86_64_PC64", + "R_X86_64_PC8", + "R_X86_64_PLT32", + "R_X86_64_PLT32_BND", + "R_X86_64_PLTOFF64", + "R_X86_64_RELATIVE", + "R_X86_64_RELATIVE64", + "R_X86_64_REX_GOTPCRELX", + "R_X86_64_SIZE32", + "R_X86_64_SIZE64", + "R_X86_64_TLSDESC", + "R_X86_64_TLSDESC_CALL", + "R_X86_64_TLSGD", + "R_X86_64_TLSLD", + "R_X86_64_TPOFF32", + "R_X86_64_TPOFF64", + "Rel32", + "Rel64", + "Rela32", + "Rela64", + "SHF_ALLOC", + "SHF_COMPRESSED", + "SHF_EXECINSTR", + "SHF_GROUP", + "SHF_INFO_LINK", + "SHF_LINK_ORDER", + "SHF_MASKOS", + "SHF_MASKPROC", + "SHF_MERGE", + "SHF_OS_NONCONFORMING", + "SHF_STRINGS", + "SHF_TLS", + "SHF_WRITE", + "SHN_ABS", + "SHN_COMMON", + "SHN_HIOS", + "SHN_HIPROC", + "SHN_HIRESERVE", + "SHN_LOOS", + "SHN_LOPROC", + "SHN_LORESERVE", + "SHN_UNDEF", + "SHN_XINDEX", + "SHT_DYNAMIC", + "SHT_DYNSYM", + "SHT_FINI_ARRAY", + "SHT_GNU_ATTRIBUTES", + "SHT_GNU_HASH", + "SHT_GNU_LIBLIST", + "SHT_GNU_VERDEF", + "SHT_GNU_VERNEED", + "SHT_GNU_VERSYM", + "SHT_GROUP", + "SHT_HASH", + "SHT_HIOS", + "SHT_HIPROC", + "SHT_HIUSER", + "SHT_INIT_ARRAY", + "SHT_LOOS", + "SHT_LOPROC", + "SHT_LOUSER", + "SHT_MIPS_ABIFLAGS", + "SHT_NOBITS", + "SHT_NOTE", + "SHT_NULL", + "SHT_PREINIT_ARRAY", + "SHT_PROGBITS", + "SHT_REL", + "SHT_RELA", + "SHT_SHLIB", + "SHT_STRTAB", + "SHT_SYMTAB", + "SHT_SYMTAB_SHNDX", + "STB_GLOBAL", + "STB_HIOS", + "STB_HIPROC", + "STB_LOCAL", + "STB_LOOS", + "STB_LOPROC", + "STB_WEAK", + "STT_COMMON", + "STT_FILE", + "STT_FUNC", + "STT_HIOS", + "STT_HIPROC", + "STT_LOOS", + "STT_LOPROC", + "STT_NOTYPE", + "STT_OBJECT", + "STT_SECTION", + "STT_TLS", + "STV_DEFAULT", + "STV_HIDDEN", + "STV_INTERNAL", + "STV_PROTECTED", + "ST_BIND", + "ST_INFO", + "ST_TYPE", + "ST_VISIBILITY", + "Section", + "Section32", + "Section64", + "SectionFlag", + "SectionHeader", + "SectionIndex", + "SectionType", + "Sym32", + "Sym32Size", + "Sym64", + "Sym64Size", + "SymBind", + "SymType", + "SymVis", + "Symbol", + "Type", + "Version", + }, + "debug/gosym": { + "DecodingError", + "Func", + "LineTable", + "NewLineTable", + "NewTable", + "Obj", + "Sym", + "Table", + "UnknownFileError", + "UnknownLineError", + }, + "debug/macho": { + "ARM64_RELOC_ADDEND", + "ARM64_RELOC_BRANCH26", + "ARM64_RELOC_GOT_LOAD_PAGE21", + "ARM64_RELOC_GOT_LOAD_PAGEOFF12", + "ARM64_RELOC_PAGE21", + "ARM64_RELOC_PAGEOFF12", + "ARM64_RELOC_POINTER_TO_GOT", + "ARM64_RELOC_SUBTRACTOR", + "ARM64_RELOC_TLVP_LOAD_PAGE21", + "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", + "ARM64_RELOC_UNSIGNED", + "ARM_RELOC_BR24", + "ARM_RELOC_HALF", + "ARM_RELOC_HALF_SECTDIFF", + "ARM_RELOC_LOCAL_SECTDIFF", + "ARM_RELOC_PAIR", + "ARM_RELOC_PB_LA_PTR", + "ARM_RELOC_SECTDIFF", + "ARM_RELOC_VANILLA", + "ARM_THUMB_32BIT_BRANCH", + "ARM_THUMB_RELOC_BR22", + "Cpu", + "Cpu386", + "CpuAmd64", + "CpuArm", + "CpuArm64", + "CpuPpc", + "CpuPpc64", + "Dylib", + "DylibCmd", + "Dysymtab", + "DysymtabCmd", + "ErrNotFat", + "FatArch", + "FatArchHeader", + "FatFile", + "File", + "FileHeader", + "FlagAllModsBound", + "FlagAllowStackExecution", + "FlagAppExtensionSafe", + "FlagBindAtLoad", + "FlagBindsToWeak", + "FlagCanonical", + "FlagDeadStrippableDylib", + "FlagDyldLink", + "FlagForceFlat", + "FlagHasTLVDescriptors", + "FlagIncrLink", + "FlagLazyInit", + "FlagNoFixPrebinding", + "FlagNoHeapExecution", + "FlagNoMultiDefs", + "FlagNoReexportedDylibs", + "FlagNoUndefs", + "FlagPIE", + "FlagPrebindable", + "FlagPrebound", + "FlagRootSafe", + "FlagSetuidSafe", + "FlagSplitSegs", + "FlagSubsectionsViaSymbols", + "FlagTwoLevel", + "FlagWeakDefines", + "FormatError", + "GENERIC_RELOC_LOCAL_SECTDIFF", + "GENERIC_RELOC_PAIR", + "GENERIC_RELOC_PB_LA_PTR", + "GENERIC_RELOC_SECTDIFF", + "GENERIC_RELOC_TLV", + "GENERIC_RELOC_VANILLA", + "Load", + "LoadBytes", + "LoadCmd", + "LoadCmdDylib", + "LoadCmdDylinker", + "LoadCmdDysymtab", + "LoadCmdRpath", + "LoadCmdSegment", + "LoadCmdSegment64", + "LoadCmdSymtab", + "LoadCmdThread", + "LoadCmdUnixThread", + "Magic32", + "Magic64", + "MagicFat", + "NewFatFile", + "NewFile", + "Nlist32", + "Nlist64", + "Open", + "OpenFat", + "Regs386", + "RegsAMD64", + "Reloc", + "RelocTypeARM", + "RelocTypeARM64", + "RelocTypeGeneric", + "RelocTypeX86_64", + "Rpath", + "RpathCmd", + "Section", + "Section32", + "Section64", + "SectionHeader", + "Segment", + "Segment32", + "Segment64", + "SegmentHeader", + "Symbol", + "Symtab", + "SymtabCmd", + "Thread", + "Type", + "TypeBundle", + "TypeDylib", + "TypeExec", + "TypeObj", + "X86_64_RELOC_BRANCH", + "X86_64_RELOC_GOT", + "X86_64_RELOC_GOT_LOAD", + "X86_64_RELOC_SIGNED", + "X86_64_RELOC_SIGNED_1", + "X86_64_RELOC_SIGNED_2", + "X86_64_RELOC_SIGNED_4", + "X86_64_RELOC_SUBTRACTOR", + "X86_64_RELOC_TLV", + "X86_64_RELOC_UNSIGNED", + }, + "debug/pe": { + "COFFSymbol", + "COFFSymbolAuxFormat5", + "COFFSymbolSize", + "DataDirectory", + "File", + "FileHeader", + "FormatError", + "IMAGE_COMDAT_SELECT_ANY", + "IMAGE_COMDAT_SELECT_ASSOCIATIVE", + "IMAGE_COMDAT_SELECT_EXACT_MATCH", + "IMAGE_COMDAT_SELECT_LARGEST", + "IMAGE_COMDAT_SELECT_NODUPLICATES", + "IMAGE_COMDAT_SELECT_SAME_SIZE", + "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", + "IMAGE_DIRECTORY_ENTRY_BASERELOC", + "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", + "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", + "IMAGE_DIRECTORY_ENTRY_DEBUG", + "IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", + "IMAGE_DIRECTORY_ENTRY_EXCEPTION", + "IMAGE_DIRECTORY_ENTRY_EXPORT", + "IMAGE_DIRECTORY_ENTRY_GLOBALPTR", + "IMAGE_DIRECTORY_ENTRY_IAT", + "IMAGE_DIRECTORY_ENTRY_IMPORT", + "IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", + "IMAGE_DIRECTORY_ENTRY_RESOURCE", + "IMAGE_DIRECTORY_ENTRY_SECURITY", + "IMAGE_DIRECTORY_ENTRY_TLS", + "IMAGE_DLLCHARACTERISTICS_APPCONTAINER", + "IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", + "IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", + "IMAGE_DLLCHARACTERISTICS_GUARD_CF", + "IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", + "IMAGE_DLLCHARACTERISTICS_NO_BIND", + "IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", + "IMAGE_DLLCHARACTERISTICS_NO_SEH", + "IMAGE_DLLCHARACTERISTICS_NX_COMPAT", + "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", + "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", + "IMAGE_FILE_32BIT_MACHINE", + "IMAGE_FILE_AGGRESIVE_WS_TRIM", + "IMAGE_FILE_BYTES_REVERSED_HI", + "IMAGE_FILE_BYTES_REVERSED_LO", + "IMAGE_FILE_DEBUG_STRIPPED", + "IMAGE_FILE_DLL", + "IMAGE_FILE_EXECUTABLE_IMAGE", + "IMAGE_FILE_LARGE_ADDRESS_AWARE", + "IMAGE_FILE_LINE_NUMS_STRIPPED", + "IMAGE_FILE_LOCAL_SYMS_STRIPPED", + "IMAGE_FILE_MACHINE_AM33", + "IMAGE_FILE_MACHINE_AMD64", + "IMAGE_FILE_MACHINE_ARM", + "IMAGE_FILE_MACHINE_ARM64", + "IMAGE_FILE_MACHINE_ARMNT", + "IMAGE_FILE_MACHINE_EBC", + "IMAGE_FILE_MACHINE_I386", + "IMAGE_FILE_MACHINE_IA64", + "IMAGE_FILE_MACHINE_LOONGARCH32", + "IMAGE_FILE_MACHINE_LOONGARCH64", + "IMAGE_FILE_MACHINE_M32R", + "IMAGE_FILE_MACHINE_MIPS16", + "IMAGE_FILE_MACHINE_MIPSFPU", + "IMAGE_FILE_MACHINE_MIPSFPU16", + "IMAGE_FILE_MACHINE_POWERPC", + "IMAGE_FILE_MACHINE_POWERPCFP", + "IMAGE_FILE_MACHINE_R4000", + "IMAGE_FILE_MACHINE_RISCV128", + "IMAGE_FILE_MACHINE_RISCV32", + "IMAGE_FILE_MACHINE_RISCV64", + "IMAGE_FILE_MACHINE_SH3", + "IMAGE_FILE_MACHINE_SH3DSP", + "IMAGE_FILE_MACHINE_SH4", + "IMAGE_FILE_MACHINE_SH5", + "IMAGE_FILE_MACHINE_THUMB", + "IMAGE_FILE_MACHINE_UNKNOWN", + "IMAGE_FILE_MACHINE_WCEMIPSV2", + "IMAGE_FILE_NET_RUN_FROM_SWAP", + "IMAGE_FILE_RELOCS_STRIPPED", + "IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", + "IMAGE_FILE_SYSTEM", + "IMAGE_FILE_UP_SYSTEM_ONLY", + "IMAGE_SCN_CNT_CODE", + "IMAGE_SCN_CNT_INITIALIZED_DATA", + "IMAGE_SCN_CNT_UNINITIALIZED_DATA", + "IMAGE_SCN_LNK_COMDAT", + "IMAGE_SCN_MEM_DISCARDABLE", + "IMAGE_SCN_MEM_EXECUTE", + "IMAGE_SCN_MEM_READ", + "IMAGE_SCN_MEM_WRITE", + "IMAGE_SUBSYSTEM_EFI_APPLICATION", + "IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", + "IMAGE_SUBSYSTEM_EFI_ROM", + "IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", + "IMAGE_SUBSYSTEM_NATIVE", + "IMAGE_SUBSYSTEM_NATIVE_WINDOWS", + "IMAGE_SUBSYSTEM_OS2_CUI", + "IMAGE_SUBSYSTEM_POSIX_CUI", + "IMAGE_SUBSYSTEM_UNKNOWN", + "IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", + "IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", + "IMAGE_SUBSYSTEM_WINDOWS_CUI", + "IMAGE_SUBSYSTEM_WINDOWS_GUI", + "IMAGE_SUBSYSTEM_XBOX", + "ImportDirectory", + "NewFile", + "Open", + "OptionalHeader32", + "OptionalHeader64", + "Reloc", + "Section", + "SectionHeader", + "SectionHeader32", + "StringTable", + "Symbol", + }, + "debug/plan9obj": { + "ErrNoSymbols", + "File", + "FileHeader", + "Magic386", + "Magic64", + "MagicAMD64", + "MagicARM", + "NewFile", + "Open", + "Section", + "SectionHeader", + "Sym", + }, + "embed": { + "FS", + }, + "encoding": { + "BinaryMarshaler", + "BinaryUnmarshaler", + "TextMarshaler", + "TextUnmarshaler", + }, + "encoding/ascii85": { + "CorruptInputError", + "Decode", + "Encode", + "MaxEncodedLen", + "NewDecoder", + "NewEncoder", + }, + "encoding/asn1": { + "BitString", + "ClassApplication", + "ClassContextSpecific", + "ClassPrivate", + "ClassUniversal", + "Enumerated", + "Flag", + "Marshal", + "MarshalWithParams", + "NullBytes", + "NullRawValue", + "ObjectIdentifier", + "RawContent", + "RawValue", + "StructuralError", + "SyntaxError", + "TagBMPString", + "TagBitString", + "TagBoolean", + "TagEnum", + "TagGeneralString", + "TagGeneralizedTime", + "TagIA5String", + "TagInteger", + "TagNull", + "TagNumericString", + "TagOID", + "TagOctetString", + "TagPrintableString", + "TagSequence", + "TagSet", + "TagT61String", + "TagUTCTime", + "TagUTF8String", + "Unmarshal", + "UnmarshalWithParams", + }, + "encoding/base32": { + "CorruptInputError", + "Encoding", + "HexEncoding", + "NewDecoder", + "NewEncoder", + "NewEncoding", + "NoPadding", + "StdEncoding", + "StdPadding", + }, + "encoding/base64": { + "CorruptInputError", + "Encoding", + "NewDecoder", + "NewEncoder", + "NewEncoding", + "NoPadding", + "RawStdEncoding", + "RawURLEncoding", + "StdEncoding", + "StdPadding", + "URLEncoding", + }, + "encoding/binary": { + "AppendByteOrder", + "AppendUvarint", + "AppendVarint", + "BigEndian", + "ByteOrder", + "LittleEndian", + "MaxVarintLen16", + "MaxVarintLen32", + "MaxVarintLen64", + "NativeEndian", + "PutUvarint", + "PutVarint", + "Read", + "ReadUvarint", + "ReadVarint", + "Size", + "Uvarint", + "Varint", + "Write", + }, + "encoding/csv": { + "ErrBareQuote", + "ErrFieldCount", + "ErrQuote", + "ErrTrailingComma", + "NewReader", + "NewWriter", + "ParseError", + "Reader", + "Writer", + }, + "encoding/gob": { + "CommonType", + "Decoder", + "Encoder", + "GobDecoder", + "GobEncoder", + "NewDecoder", + "NewEncoder", + "Register", + "RegisterName", + }, + "encoding/hex": { + "Decode", + "DecodeString", + "DecodedLen", + "Dump", + "Dumper", + "Encode", + "EncodeToString", + "EncodedLen", + "ErrLength", + "InvalidByteError", + "NewDecoder", + "NewEncoder", + }, + "encoding/json": { + "Compact", + "Decoder", + "Delim", + "Encoder", + "HTMLEscape", + "Indent", + "InvalidUTF8Error", + "InvalidUnmarshalError", + "Marshal", + "MarshalIndent", + "Marshaler", + "MarshalerError", + "NewDecoder", + "NewEncoder", + "Number", + "RawMessage", + "SyntaxError", + "Token", + "Unmarshal", + "UnmarshalFieldError", + "UnmarshalTypeError", + "Unmarshaler", + "UnsupportedTypeError", + "UnsupportedValueError", + "Valid", + }, + "encoding/pem": { + "Block", + "Decode", + "Encode", + "EncodeToMemory", + }, + "encoding/xml": { + "Attr", + "CharData", + "Comment", + "CopyToken", + "Decoder", + "Directive", + "Encoder", + "EndElement", + "Escape", + "EscapeText", + "HTMLAutoClose", + "HTMLEntity", + "Header", + "Marshal", + "MarshalIndent", + "Marshaler", + "MarshalerAttr", + "Name", + "NewDecoder", + "NewEncoder", + "NewTokenDecoder", + "ProcInst", + "StartElement", + "SyntaxError", + "TagPathError", + "Token", + "TokenReader", + "Unmarshal", + "UnmarshalError", + "Unmarshaler", + "UnmarshalerAttr", + "UnsupportedTypeError", + }, + "errors": { + "As", + "ErrUnsupported", + "Is", + "Join", + "New", + "Unwrap", + }, + "expvar": { + "Do", + "Float", + "Func", + "Get", + "Handler", + "Int", + "KeyValue", + "Map", + "NewFloat", + "NewInt", + "NewMap", + "NewString", + "Publish", + "String", + "Var", + }, + "flag": { + "Arg", + "Args", + "Bool", + "BoolFunc", + "BoolVar", + "CommandLine", + "ContinueOnError", + "Duration", + "DurationVar", + "ErrHelp", + "ErrorHandling", + "ExitOnError", + "Flag", + "FlagSet", + "Float64", + "Float64Var", + "Func", + "Getter", + "Int", + "Int64", + "Int64Var", + "IntVar", + "Lookup", + "NArg", + "NFlag", + "NewFlagSet", + "PanicOnError", + "Parse", + "Parsed", + "PrintDefaults", + "Set", + "String", + "StringVar", + "TextVar", + "Uint", + "Uint64", + "Uint64Var", + "UintVar", + "UnquoteUsage", + "Usage", + "Value", + "Var", + "Visit", + "VisitAll", + }, + "fmt": { + "Append", + "Appendf", + "Appendln", + "Errorf", + "FormatString", + "Formatter", + "Fprint", + "Fprintf", + "Fprintln", + "Fscan", + "Fscanf", + "Fscanln", + "GoStringer", + "Print", + "Printf", + "Println", + "Scan", + "ScanState", + "Scanf", + "Scanln", + "Scanner", + "Sprint", + "Sprintf", + "Sprintln", + "Sscan", + "Sscanf", + "Sscanln", + "State", + "Stringer", + }, + "go/ast": { + "ArrayType", + "AssignStmt", + "Bad", + "BadDecl", + "BadExpr", + "BadStmt", + "BasicLit", + "BinaryExpr", + "BlockStmt", + "BranchStmt", + "CallExpr", + "CaseClause", + "ChanDir", + "ChanType", + "CommClause", + "Comment", + "CommentGroup", + "CommentMap", + "CompositeLit", + "Con", + "Decl", + "DeclStmt", + "DeferStmt", + "Ellipsis", + "EmptyStmt", + "Expr", + "ExprStmt", + "Field", + "FieldFilter", + "FieldList", + "File", + "FileExports", + "Filter", + "FilterDecl", + "FilterFile", + "FilterFuncDuplicates", + "FilterImportDuplicates", + "FilterPackage", + "FilterUnassociatedComments", + "ForStmt", + "Fprint", + "Fun", + "FuncDecl", + "FuncLit", + "FuncType", + "GenDecl", + "GoStmt", + "Ident", + "IfStmt", + "ImportSpec", + "Importer", + "IncDecStmt", + "IndexExpr", + "IndexListExpr", + "Inspect", + "InterfaceType", + "IsExported", + "IsGenerated", + "KeyValueExpr", + "LabeledStmt", + "Lbl", + "MapType", + "MergeMode", + "MergePackageFiles", + "NewCommentMap", + "NewIdent", + "NewObj", + "NewPackage", + "NewScope", + "Node", + "NotNilFilter", + "ObjKind", + "Object", + "Package", + "PackageExports", + "ParenExpr", + "Pkg", + "Print", + "RECV", + "RangeStmt", + "ReturnStmt", + "SEND", + "Scope", + "SelectStmt", + "SelectorExpr", + "SendStmt", + "SliceExpr", + "SortImports", + "Spec", + "StarExpr", + "Stmt", + "StructType", + "SwitchStmt", + "Typ", + "TypeAssertExpr", + "TypeSpec", + "TypeSwitchStmt", + "UnaryExpr", + "ValueSpec", + "Var", + "Visitor", + "Walk", + }, + "go/build": { + "AllowBinary", + "ArchChar", + "Context", + "Default", + "Directive", + "FindOnly", + "IgnoreVendor", + "Import", + "ImportComment", + "ImportDir", + "ImportMode", + "IsLocalImport", + "MultiplePackageError", + "NoGoError", + "Package", + "ToolDir", + }, + "go/build/constraint": { + "AndExpr", + "Expr", + "GoVersion", + "IsGoBuild", + "IsPlusBuild", + "NotExpr", + "OrExpr", + "Parse", + "PlusBuildLines", + "SyntaxError", + "TagExpr", + }, + "go/constant": { + "BinaryOp", + "BitLen", + "Bool", + "BoolVal", + "Bytes", + "Compare", + "Complex", + "Denom", + "Float", + "Float32Val", + "Float64Val", + "Imag", + "Int", + "Int64Val", + "Kind", + "Make", + "MakeBool", + "MakeFloat64", + "MakeFromBytes", + "MakeFromLiteral", + "MakeImag", + "MakeInt64", + "MakeString", + "MakeUint64", + "MakeUnknown", + "Num", + "Real", + "Shift", + "Sign", + "String", + "StringVal", + "ToComplex", + "ToFloat", + "ToInt", + "Uint64Val", + "UnaryOp", + "Unknown", + "Val", + "Value", + }, + "go/doc": { + "AllDecls", + "AllMethods", + "Example", + "Examples", + "Filter", + "Func", + "IllegalPrefixes", + "IsPredeclared", + "Mode", + "New", + "NewFromFiles", + "Note", + "Package", + "PreserveAST", + "Synopsis", + "ToHTML", + "ToText", + "Type", + "Value", + }, + "go/doc/comment": { + "Block", + "Code", + "DefaultLookupPackage", + "Doc", + "DocLink", + "Heading", + "Italic", + "Link", + "LinkDef", + "List", + "ListItem", + "Paragraph", + "Parser", + "Plain", + "Printer", + "Text", + }, + "go/format": { + "Node", + "Source", + }, + "go/importer": { + "Default", + "For", + "ForCompiler", + "Lookup", + }, + "go/parser": { + "AllErrors", + "DeclarationErrors", + "ImportsOnly", + "Mode", + "PackageClauseOnly", + "ParseComments", + "ParseDir", + "ParseExpr", + "ParseExprFrom", + "ParseFile", + "SkipObjectResolution", + "SpuriousErrors", + "Trace", + }, + "go/printer": { + "CommentedNode", + "Config", + "Fprint", + "Mode", + "RawFormat", + "SourcePos", + "TabIndent", + "UseSpaces", + }, + "go/scanner": { + "Error", + "ErrorHandler", + "ErrorList", + "Mode", + "PrintError", + "ScanComments", + "Scanner", + }, + "go/token": { + "ADD", + "ADD_ASSIGN", + "AND", + "AND_ASSIGN", + "AND_NOT", + "AND_NOT_ASSIGN", + "ARROW", + "ASSIGN", + "BREAK", + "CASE", + "CHAN", + "CHAR", + "COLON", + "COMMA", + "COMMENT", + "CONST", + "CONTINUE", + "DEC", + "DEFAULT", + "DEFER", + "DEFINE", + "ELLIPSIS", + "ELSE", + "EOF", + "EQL", + "FALLTHROUGH", + "FLOAT", + "FOR", + "FUNC", + "File", + "FileSet", + "GEQ", + "GO", + "GOTO", + "GTR", + "HighestPrec", + "IDENT", + "IF", + "ILLEGAL", + "IMAG", + "IMPORT", + "INC", + "INT", + "INTERFACE", + "IsExported", + "IsIdentifier", + "IsKeyword", + "LAND", + "LBRACE", + "LBRACK", + "LEQ", + "LOR", + "LPAREN", + "LSS", + "Lookup", + "LowestPrec", + "MAP", + "MUL", + "MUL_ASSIGN", + "NEQ", + "NOT", + "NewFileSet", + "NoPos", + "OR", + "OR_ASSIGN", + "PACKAGE", + "PERIOD", + "Pos", + "Position", + "QUO", + "QUO_ASSIGN", + "RANGE", + "RBRACE", + "RBRACK", + "REM", + "REM_ASSIGN", + "RETURN", + "RPAREN", + "SELECT", + "SEMICOLON", + "SHL", + "SHL_ASSIGN", + "SHR", + "SHR_ASSIGN", + "STRING", + "STRUCT", + "SUB", + "SUB_ASSIGN", + "SWITCH", + "TILDE", + "TYPE", + "Token", + "UnaryPrec", + "VAR", + "XOR", + "XOR_ASSIGN", + }, + "go/types": { + "ArgumentError", + "Array", + "AssertableTo", + "AssignableTo", + "Basic", + "BasicInfo", + "BasicKind", + "Bool", + "Builtin", + "Byte", + "Chan", + "ChanDir", + "CheckExpr", + "Checker", + "Comparable", + "Complex128", + "Complex64", + "Config", + "Const", + "Context", + "ConvertibleTo", + "DefPredeclaredTestFuncs", + "Default", + "Error", + "Eval", + "ExprString", + "FieldVal", + "Float32", + "Float64", + "Func", + "Id", + "Identical", + "IdenticalIgnoreTags", + "Implements", + "ImportMode", + "Importer", + "ImporterFrom", + "Info", + "Initializer", + "Instance", + "Instantiate", + "Int", + "Int16", + "Int32", + "Int64", + "Int8", + "Interface", + "Invalid", + "IsBoolean", + "IsComplex", + "IsConstType", + "IsFloat", + "IsInteger", + "IsInterface", + "IsNumeric", + "IsOrdered", + "IsString", + "IsUnsigned", + "IsUntyped", + "Label", + "LookupFieldOrMethod", + "Map", + "MethodExpr", + "MethodSet", + "MethodVal", + "MissingMethod", + "Named", + "NewArray", + "NewChan", + "NewChecker", + "NewConst", + "NewContext", + "NewField", + "NewFunc", + "NewInterface", + "NewInterfaceType", + "NewLabel", + "NewMap", + "NewMethodSet", + "NewNamed", + "NewPackage", + "NewParam", + "NewPkgName", + "NewPointer", + "NewScope", + "NewSignature", + "NewSignatureType", + "NewSlice", + "NewStruct", + "NewTerm", + "NewTuple", + "NewTypeName", + "NewTypeParam", + "NewUnion", + "NewVar", + "Nil", + "Object", + "ObjectString", + "Package", + "PkgName", + "Pointer", + "Qualifier", + "RecvOnly", + "RelativeTo", + "Rune", + "Satisfies", + "Scope", + "Selection", + "SelectionKind", + "SelectionString", + "SendOnly", + "SendRecv", + "Signature", + "Sizes", + "SizesFor", + "Slice", + "StdSizes", + "String", + "Struct", + "Term", + "Tuple", + "Typ", + "Type", + "TypeAndValue", + "TypeList", + "TypeName", + "TypeParam", + "TypeParamList", + "TypeString", + "Uint", + "Uint16", + "Uint32", + "Uint64", + "Uint8", + "Uintptr", + "Union", + "Universe", + "Unsafe", + "UnsafePointer", + "UntypedBool", + "UntypedComplex", + "UntypedFloat", + "UntypedInt", + "UntypedNil", + "UntypedRune", + "UntypedString", + "Var", + "WriteExpr", + "WriteSignature", + "WriteType", + }, + "hash": { + "Hash", + "Hash32", + "Hash64", + }, + "hash/adler32": { + "Checksum", + "New", + "Size", + }, + "hash/crc32": { + "Castagnoli", + "Checksum", + "ChecksumIEEE", + "IEEE", + "IEEETable", + "Koopman", + "MakeTable", + "New", + "NewIEEE", + "Size", + "Table", + "Update", + }, + "hash/crc64": { + "Checksum", + "ECMA", + "ISO", + "MakeTable", + "New", + "Size", + "Table", + "Update", + }, + "hash/fnv": { + "New128", + "New128a", + "New32", + "New32a", + "New64", + "New64a", + }, + "hash/maphash": { + "Bytes", + "Hash", + "MakeSeed", + "Seed", + "String", + }, + "html": { + "EscapeString", + "UnescapeString", + }, + "html/template": { + "CSS", + "ErrAmbigContext", + "ErrBadHTML", + "ErrBranchEnd", + "ErrEndContext", + "ErrJSTemplate", + "ErrNoSuchTemplate", + "ErrOutputContext", + "ErrPartialCharset", + "ErrPartialEscape", + "ErrPredefinedEscaper", + "ErrRangeLoopReentry", + "ErrSlashAmbig", + "Error", + "ErrorCode", + "FuncMap", + "HTML", + "HTMLAttr", + "HTMLEscape", + "HTMLEscapeString", + "HTMLEscaper", + "IsTrue", + "JS", + "JSEscape", + "JSEscapeString", + "JSEscaper", + "JSStr", + "Must", + "New", + "OK", + "ParseFS", + "ParseFiles", + "ParseGlob", + "Srcset", + "Template", + "URL", + "URLQueryEscaper", + }, + "image": { + "Alpha", + "Alpha16", + "Black", + "CMYK", + "Config", + "Decode", + "DecodeConfig", + "ErrFormat", + "Gray", + "Gray16", + "Image", + "NRGBA", + "NRGBA64", + "NYCbCrA", + "NewAlpha", + "NewAlpha16", + "NewCMYK", + "NewGray", + "NewGray16", + "NewNRGBA", + "NewNRGBA64", + "NewNYCbCrA", + "NewPaletted", + "NewRGBA", + "NewRGBA64", + "NewUniform", + "NewYCbCr", + "Opaque", + "Paletted", + "PalettedImage", + "Point", + "Pt", + "RGBA", + "RGBA64", + "RGBA64Image", + "Rect", + "Rectangle", + "RegisterFormat", + "Transparent", + "Uniform", + "White", + "YCbCr", + "YCbCrSubsampleRatio", + "YCbCrSubsampleRatio410", + "YCbCrSubsampleRatio411", + "YCbCrSubsampleRatio420", + "YCbCrSubsampleRatio422", + "YCbCrSubsampleRatio440", + "YCbCrSubsampleRatio444", + "ZP", + "ZR", + }, + "image/color": { + "Alpha", + "Alpha16", + "Alpha16Model", + "AlphaModel", + "Black", + "CMYK", + "CMYKModel", + "CMYKToRGB", + "Color", + "Gray", + "Gray16", + "Gray16Model", + "GrayModel", + "Model", + "ModelFunc", + "NRGBA", + "NRGBA64", + "NRGBA64Model", + "NRGBAModel", + "NYCbCrA", + "NYCbCrAModel", + "Opaque", + "Palette", + "RGBA", + "RGBA64", + "RGBA64Model", + "RGBAModel", + "RGBToCMYK", + "RGBToYCbCr", + "Transparent", + "White", + "YCbCr", + "YCbCrModel", + "YCbCrToRGB", + }, + "image/color/palette": { + "Plan9", + "WebSafe", + }, + "image/draw": { + "Draw", + "DrawMask", + "Drawer", + "FloydSteinberg", + "Image", + "Op", + "Over", + "Quantizer", + "RGBA64Image", + "Src", + }, + "image/gif": { + "Decode", + "DecodeAll", + "DecodeConfig", + "DisposalBackground", + "DisposalNone", + "DisposalPrevious", + "Encode", + "EncodeAll", + "GIF", + "Options", + }, + "image/jpeg": { + "Decode", + "DecodeConfig", + "DefaultQuality", + "Encode", + "FormatError", + "Options", + "Reader", + "UnsupportedError", + }, + "image/png": { + "BestCompression", + "BestSpeed", + "CompressionLevel", + "Decode", + "DecodeConfig", + "DefaultCompression", + "Encode", + "Encoder", + "EncoderBuffer", + "EncoderBufferPool", + "FormatError", + "NoCompression", + "UnsupportedError", + }, + "index/suffixarray": { + "Index", + "New", + }, + "io": { + "ByteReader", + "ByteScanner", + "ByteWriter", + "Closer", + "Copy", + "CopyBuffer", + "CopyN", + "Discard", + "EOF", + "ErrClosedPipe", + "ErrNoProgress", + "ErrShortBuffer", + "ErrShortWrite", + "ErrUnexpectedEOF", + "LimitReader", + "LimitedReader", + "MultiReader", + "MultiWriter", + "NewOffsetWriter", + "NewSectionReader", + "NopCloser", + "OffsetWriter", + "Pipe", + "PipeReader", + "PipeWriter", + "ReadAll", + "ReadAtLeast", + "ReadCloser", + "ReadFull", + "ReadSeekCloser", + "ReadSeeker", + "ReadWriteCloser", + "ReadWriteSeeker", + "ReadWriter", + "Reader", + "ReaderAt", + "ReaderFrom", + "RuneReader", + "RuneScanner", + "SectionReader", + "SeekCurrent", + "SeekEnd", + "SeekStart", + "Seeker", + "StringWriter", + "TeeReader", + "WriteCloser", + "WriteSeeker", + "WriteString", + "Writer", + "WriterAt", + "WriterTo", + }, + "io/fs": { + "DirEntry", + "ErrClosed", + "ErrExist", + "ErrInvalid", + "ErrNotExist", + "ErrPermission", + "FS", + "File", + "FileInfo", + "FileInfoToDirEntry", + "FileMode", + "FormatDirEntry", + "FormatFileInfo", + "Glob", + "GlobFS", + "ModeAppend", + "ModeCharDevice", + "ModeDevice", + "ModeDir", + "ModeExclusive", + "ModeIrregular", + "ModeNamedPipe", + "ModePerm", + "ModeSetgid", + "ModeSetuid", + "ModeSocket", + "ModeSticky", + "ModeSymlink", + "ModeTemporary", + "ModeType", + "PathError", + "ReadDir", + "ReadDirFS", + "ReadDirFile", + "ReadFile", + "ReadFileFS", + "SkipAll", + "SkipDir", + "Stat", + "StatFS", + "Sub", + "SubFS", + "ValidPath", + "WalkDir", + "WalkDirFunc", + }, + "io/ioutil": { + "Discard", + "NopCloser", + "ReadAll", + "ReadDir", + "ReadFile", + "TempDir", + "TempFile", + "WriteFile", + }, + "log": { + "Default", + "Fatal", + "Fatalf", + "Fatalln", + "Flags", + "LUTC", + "Ldate", + "Llongfile", + "Lmicroseconds", + "Lmsgprefix", + "Logger", + "Lshortfile", + "LstdFlags", + "Ltime", + "New", + "Output", + "Panic", + "Panicf", + "Panicln", + "Prefix", + "Print", + "Printf", + "Println", + "SetFlags", + "SetOutput", + "SetPrefix", + "Writer", + }, + "log/slog": { + "Any", + "AnyValue", + "Attr", + "Bool", + "BoolValue", + "Debug", + "DebugContext", + "Default", + "Duration", + "DurationValue", + "Error", + "ErrorContext", + "Float64", + "Float64Value", + "Group", + "GroupValue", + "Handler", + "HandlerOptions", + "Info", + "InfoContext", + "Int", + "Int64", + "Int64Value", + "IntValue", + "JSONHandler", + "Kind", + "KindAny", + "KindBool", + "KindDuration", + "KindFloat64", + "KindGroup", + "KindInt64", + "KindLogValuer", + "KindString", + "KindTime", + "KindUint64", + "Level", + "LevelDebug", + "LevelError", + "LevelInfo", + "LevelKey", + "LevelVar", + "LevelWarn", + "Leveler", + "Log", + "LogAttrs", + "LogValuer", + "Logger", + "MessageKey", + "New", + "NewJSONHandler", + "NewLogLogger", + "NewRecord", + "NewTextHandler", + "Record", + "SetDefault", + "Source", + "SourceKey", + "String", + "StringValue", + "TextHandler", + "Time", + "TimeKey", + "TimeValue", + "Uint64", + "Uint64Value", + "Value", + "Warn", + "WarnContext", + "With", + }, + "log/syslog": { + "Dial", + "LOG_ALERT", + "LOG_AUTH", + "LOG_AUTHPRIV", + "LOG_CRIT", + "LOG_CRON", + "LOG_DAEMON", + "LOG_DEBUG", + "LOG_EMERG", + "LOG_ERR", + "LOG_FTP", + "LOG_INFO", + "LOG_KERN", + "LOG_LOCAL0", + "LOG_LOCAL1", + "LOG_LOCAL2", + "LOG_LOCAL3", + "LOG_LOCAL4", + "LOG_LOCAL5", + "LOG_LOCAL6", + "LOG_LOCAL7", + "LOG_LPR", + "LOG_MAIL", + "LOG_NEWS", + "LOG_NOTICE", + "LOG_SYSLOG", + "LOG_USER", + "LOG_UUCP", + "LOG_WARNING", + "New", + "NewLogger", + "Priority", + "Writer", + }, + "maps": { + "Clone", + "Copy", + "DeleteFunc", + "Equal", + "EqualFunc", + }, + "math": { + "Abs", + "Acos", + "Acosh", + "Asin", + "Asinh", + "Atan", + "Atan2", + "Atanh", + "Cbrt", + "Ceil", + "Copysign", + "Cos", + "Cosh", + "Dim", + "E", + "Erf", + "Erfc", + "Erfcinv", + "Erfinv", + "Exp", + "Exp2", + "Expm1", + "FMA", + "Float32bits", + "Float32frombits", + "Float64bits", + "Float64frombits", + "Floor", + "Frexp", + "Gamma", + "Hypot", + "Ilogb", + "Inf", + "IsInf", + "IsNaN", + "J0", + "J1", + "Jn", + "Ldexp", + "Lgamma", + "Ln10", + "Ln2", + "Log", + "Log10", + "Log10E", + "Log1p", + "Log2", + "Log2E", + "Logb", + "Max", + "MaxFloat32", + "MaxFloat64", + "MaxInt", + "MaxInt16", + "MaxInt32", + "MaxInt64", + "MaxInt8", + "MaxUint", + "MaxUint16", + "MaxUint32", + "MaxUint64", + "MaxUint8", + "Min", + "MinInt", + "MinInt16", + "MinInt32", + "MinInt64", + "MinInt8", + "Mod", + "Modf", + "NaN", + "Nextafter", + "Nextafter32", + "Phi", + "Pi", + "Pow", + "Pow10", + "Remainder", + "Round", + "RoundToEven", + "Signbit", + "Sin", + "Sincos", + "Sinh", + "SmallestNonzeroFloat32", + "SmallestNonzeroFloat64", + "Sqrt", + "Sqrt2", + "SqrtE", + "SqrtPhi", + "SqrtPi", + "Tan", + "Tanh", + "Trunc", + "Y0", + "Y1", + "Yn", + }, + "math/big": { + "Above", + "Accuracy", + "AwayFromZero", + "Below", + "ErrNaN", + "Exact", + "Float", + "Int", + "Jacobi", + "MaxBase", + "MaxExp", + "MaxPrec", + "MinExp", + "NewFloat", + "NewInt", + "NewRat", + "ParseFloat", + "Rat", + "RoundingMode", + "ToNearestAway", + "ToNearestEven", + "ToNegativeInf", + "ToPositiveInf", + "ToZero", + "Word", + }, + "math/bits": { + "Add", + "Add32", + "Add64", + "Div", + "Div32", + "Div64", + "LeadingZeros", + "LeadingZeros16", + "LeadingZeros32", + "LeadingZeros64", + "LeadingZeros8", + "Len", + "Len16", + "Len32", + "Len64", + "Len8", + "Mul", + "Mul32", + "Mul64", + "OnesCount", + "OnesCount16", + "OnesCount32", + "OnesCount64", + "OnesCount8", + "Rem", + "Rem32", + "Rem64", + "Reverse", + "Reverse16", + "Reverse32", + "Reverse64", + "Reverse8", + "ReverseBytes", + "ReverseBytes16", + "ReverseBytes32", + "ReverseBytes64", + "RotateLeft", + "RotateLeft16", + "RotateLeft32", + "RotateLeft64", + "RotateLeft8", + "Sub", + "Sub32", + "Sub64", + "TrailingZeros", + "TrailingZeros16", + "TrailingZeros32", + "TrailingZeros64", + "TrailingZeros8", + "UintSize", + }, + "math/cmplx": { + "Abs", + "Acos", + "Acosh", + "Asin", + "Asinh", + "Atan", + "Atanh", + "Conj", + "Cos", + "Cosh", + "Cot", + "Exp", + "Inf", + "IsInf", + "IsNaN", + "Log", + "Log10", + "NaN", + "Phase", + "Polar", + "Pow", + "Rect", + "Sin", + "Sinh", + "Sqrt", + "Tan", + "Tanh", + }, + "math/rand": { + "ExpFloat64", + "Float32", + "Float64", + "Int", + "Int31", + "Int31n", + "Int63", + "Int63n", + "Intn", + "New", + "NewSource", + "NewZipf", + "NormFloat64", + "Perm", + "Rand", + "Read", + "Seed", + "Shuffle", + "Source", + "Source64", + "Uint32", + "Uint64", + "Zipf", + }, + "mime": { + "AddExtensionType", + "BEncoding", + "ErrInvalidMediaParameter", + "ExtensionsByType", + "FormatMediaType", + "ParseMediaType", + "QEncoding", + "TypeByExtension", + "WordDecoder", + "WordEncoder", + }, + "mime/multipart": { + "ErrMessageTooLarge", + "File", + "FileHeader", + "Form", + "NewReader", + "NewWriter", + "Part", + "Reader", + "Writer", + }, + "mime/quotedprintable": { + "NewReader", + "NewWriter", + "Reader", + "Writer", + }, + "net": { + "Addr", + "AddrError", + "Buffers", + "CIDRMask", + "Conn", + "DNSConfigError", + "DNSError", + "DefaultResolver", + "Dial", + "DialIP", + "DialTCP", + "DialTimeout", + "DialUDP", + "DialUnix", + "Dialer", + "ErrClosed", + "ErrWriteToConnected", + "Error", + "FileConn", + "FileListener", + "FilePacketConn", + "FlagBroadcast", + "FlagLoopback", + "FlagMulticast", + "FlagPointToPoint", + "FlagRunning", + "FlagUp", + "Flags", + "HardwareAddr", + "IP", + "IPAddr", + "IPConn", + "IPMask", + "IPNet", + "IPv4", + "IPv4Mask", + "IPv4allrouter", + "IPv4allsys", + "IPv4bcast", + "IPv4len", + "IPv4zero", + "IPv6interfacelocalallnodes", + "IPv6len", + "IPv6linklocalallnodes", + "IPv6linklocalallrouters", + "IPv6loopback", + "IPv6unspecified", + "IPv6zero", + "Interface", + "InterfaceAddrs", + "InterfaceByIndex", + "InterfaceByName", + "Interfaces", + "InvalidAddrError", + "JoinHostPort", + "Listen", + "ListenConfig", + "ListenIP", + "ListenMulticastUDP", + "ListenPacket", + "ListenTCP", + "ListenUDP", + "ListenUnix", + "ListenUnixgram", + "Listener", + "LookupAddr", + "LookupCNAME", + "LookupHost", + "LookupIP", + "LookupMX", + "LookupNS", + "LookupPort", + "LookupSRV", + "LookupTXT", + "MX", + "NS", + "OpError", + "PacketConn", + "ParseCIDR", + "ParseError", + "ParseIP", + "ParseMAC", + "Pipe", + "ResolveIPAddr", + "ResolveTCPAddr", + "ResolveUDPAddr", + "ResolveUnixAddr", + "Resolver", + "SRV", + "SplitHostPort", + "TCPAddr", + "TCPAddrFromAddrPort", + "TCPConn", + "TCPListener", + "UDPAddr", + "UDPAddrFromAddrPort", + "UDPConn", + "UnixAddr", + "UnixConn", + "UnixListener", + "UnknownNetworkError", + }, + "net/http": { + "AllowQuerySemicolons", + "CanonicalHeaderKey", + "Client", + "CloseNotifier", + "ConnState", + "Cookie", + "CookieJar", + "DefaultClient", + "DefaultMaxHeaderBytes", + "DefaultMaxIdleConnsPerHost", + "DefaultServeMux", + "DefaultTransport", + "DetectContentType", + "Dir", + "ErrAbortHandler", + "ErrBodyNotAllowed", + "ErrBodyReadAfterClose", + "ErrContentLength", + "ErrHandlerTimeout", + "ErrHeaderTooLong", + "ErrHijacked", + "ErrLineTooLong", + "ErrMissingBoundary", + "ErrMissingContentLength", + "ErrMissingFile", + "ErrNoCookie", + "ErrNoLocation", + "ErrNotMultipart", + "ErrNotSupported", + "ErrSchemeMismatch", + "ErrServerClosed", + "ErrShortBody", + "ErrSkipAltProtocol", + "ErrUnexpectedTrailer", + "ErrUseLastResponse", + "ErrWriteAfterFlush", + "Error", + "FS", + "File", + "FileServer", + "FileSystem", + "Flusher", + "Get", + "Handle", + "HandleFunc", + "Handler", + "HandlerFunc", + "Head", + "Header", + "Hijacker", + "ListenAndServe", + "ListenAndServeTLS", + "LocalAddrContextKey", + "MaxBytesError", + "MaxBytesHandler", + "MaxBytesReader", + "MethodConnect", + "MethodDelete", + "MethodGet", + "MethodHead", + "MethodOptions", + "MethodPatch", + "MethodPost", + "MethodPut", + "MethodTrace", + "NewFileTransport", + "NewRequest", + "NewRequestWithContext", + "NewResponseController", + "NewServeMux", + "NoBody", + "NotFound", + "NotFoundHandler", + "ParseHTTPVersion", + "ParseTime", + "Post", + "PostForm", + "ProtocolError", + "ProxyFromEnvironment", + "ProxyURL", + "PushOptions", + "Pusher", + "ReadRequest", + "ReadResponse", + "Redirect", + "RedirectHandler", + "Request", + "Response", + "ResponseController", + "ResponseWriter", + "RoundTripper", + "SameSite", + "SameSiteDefaultMode", + "SameSiteLaxMode", + "SameSiteNoneMode", + "SameSiteStrictMode", + "Serve", + "ServeContent", + "ServeFile", + "ServeMux", + "ServeTLS", + "Server", + "ServerContextKey", + "SetCookie", + "StateActive", + "StateClosed", + "StateHijacked", + "StateIdle", + "StateNew", + "StatusAccepted", + "StatusAlreadyReported", + "StatusBadGateway", + "StatusBadRequest", + "StatusConflict", + "StatusContinue", + "StatusCreated", + "StatusEarlyHints", + "StatusExpectationFailed", + "StatusFailedDependency", + "StatusForbidden", + "StatusFound", + "StatusGatewayTimeout", + "StatusGone", + "StatusHTTPVersionNotSupported", + "StatusIMUsed", + "StatusInsufficientStorage", + "StatusInternalServerError", + "StatusLengthRequired", + "StatusLocked", + "StatusLoopDetected", + "StatusMethodNotAllowed", + "StatusMisdirectedRequest", + "StatusMovedPermanently", + "StatusMultiStatus", + "StatusMultipleChoices", + "StatusNetworkAuthenticationRequired", + "StatusNoContent", + "StatusNonAuthoritativeInfo", + "StatusNotAcceptable", + "StatusNotExtended", + "StatusNotFound", + "StatusNotImplemented", + "StatusNotModified", + "StatusOK", + "StatusPartialContent", + "StatusPaymentRequired", + "StatusPermanentRedirect", + "StatusPreconditionFailed", + "StatusPreconditionRequired", + "StatusProcessing", + "StatusProxyAuthRequired", + "StatusRequestEntityTooLarge", + "StatusRequestHeaderFieldsTooLarge", + "StatusRequestTimeout", + "StatusRequestURITooLong", + "StatusRequestedRangeNotSatisfiable", + "StatusResetContent", + "StatusSeeOther", + "StatusServiceUnavailable", + "StatusSwitchingProtocols", + "StatusTeapot", + "StatusTemporaryRedirect", + "StatusText", + "StatusTooEarly", + "StatusTooManyRequests", + "StatusUnauthorized", + "StatusUnavailableForLegalReasons", + "StatusUnprocessableEntity", + "StatusUnsupportedMediaType", + "StatusUpgradeRequired", + "StatusUseProxy", + "StatusVariantAlsoNegotiates", + "StripPrefix", + "TimeFormat", + "TimeoutHandler", + "TrailerPrefix", + "Transport", + }, + "net/http/cgi": { + "Handler", + "Request", + "RequestFromMap", + "Serve", + }, + "net/http/cookiejar": { + "Jar", + "New", + "Options", + "PublicSuffixList", + }, + "net/http/fcgi": { + "ErrConnClosed", + "ErrRequestAborted", + "ProcessEnv", + "Serve", + }, + "net/http/httptest": { + "DefaultRemoteAddr", + "NewRecorder", + "NewRequest", + "NewServer", + "NewTLSServer", + "NewUnstartedServer", + "ResponseRecorder", + "Server", + }, + "net/http/httptrace": { + "ClientTrace", + "ContextClientTrace", + "DNSDoneInfo", + "DNSStartInfo", + "GotConnInfo", + "WithClientTrace", + "WroteRequestInfo", + }, + "net/http/httputil": { + "BufferPool", + "ClientConn", + "DumpRequest", + "DumpRequestOut", + "DumpResponse", + "ErrClosed", + "ErrLineTooLong", + "ErrPersistEOF", + "ErrPipeline", + "NewChunkedReader", + "NewChunkedWriter", + "NewClientConn", + "NewProxyClientConn", + "NewServerConn", + "NewSingleHostReverseProxy", + "ProxyRequest", + "ReverseProxy", + "ServerConn", + }, + "net/http/pprof": { + "Cmdline", + "Handler", + "Index", + "Profile", + "Symbol", + "Trace", + }, + "net/mail": { + "Address", + "AddressParser", + "ErrHeaderNotPresent", + "Header", + "Message", + "ParseAddress", + "ParseAddressList", + "ParseDate", + "ReadMessage", + }, + "net/netip": { + "Addr", + "AddrFrom16", + "AddrFrom4", + "AddrFromSlice", + "AddrPort", + "AddrPortFrom", + "IPv4Unspecified", + "IPv6LinkLocalAllNodes", + "IPv6LinkLocalAllRouters", + "IPv6Loopback", + "IPv6Unspecified", + "MustParseAddr", + "MustParseAddrPort", + "MustParsePrefix", + "ParseAddr", + "ParseAddrPort", + "ParsePrefix", + "Prefix", + "PrefixFrom", + }, + "net/rpc": { + "Accept", + "Call", + "Client", + "ClientCodec", + "DefaultDebugPath", + "DefaultRPCPath", + "DefaultServer", + "Dial", + "DialHTTP", + "DialHTTPPath", + "ErrShutdown", + "HandleHTTP", + "NewClient", + "NewClientWithCodec", + "NewServer", + "Register", + "RegisterName", + "Request", + "Response", + "ServeCodec", + "ServeConn", + "ServeRequest", + "Server", + "ServerCodec", + "ServerError", + }, + "net/rpc/jsonrpc": { + "Dial", + "NewClient", + "NewClientCodec", + "NewServerCodec", + "ServeConn", + }, + "net/smtp": { + "Auth", + "CRAMMD5Auth", + "Client", + "Dial", + "NewClient", + "PlainAuth", + "SendMail", + "ServerInfo", + }, + "net/textproto": { + "CanonicalMIMEHeaderKey", + "Conn", + "Dial", + "Error", + "MIMEHeader", + "NewConn", + "NewReader", + "NewWriter", + "Pipeline", + "ProtocolError", + "Reader", + "TrimBytes", + "TrimString", + "Writer", + }, + "net/url": { + "Error", + "EscapeError", + "InvalidHostError", + "JoinPath", + "Parse", + "ParseQuery", + "ParseRequestURI", + "PathEscape", + "PathUnescape", + "QueryEscape", + "QueryUnescape", + "URL", + "User", + "UserPassword", + "Userinfo", + "Values", + }, + "os": { + "Args", + "Chdir", + "Chmod", + "Chown", + "Chtimes", + "Clearenv", + "Create", + "CreateTemp", + "DevNull", + "DirEntry", + "DirFS", + "Environ", + "ErrClosed", + "ErrDeadlineExceeded", + "ErrExist", + "ErrInvalid", + "ErrNoDeadline", + "ErrNotExist", + "ErrPermission", + "ErrProcessDone", + "Executable", + "Exit", + "Expand", + "ExpandEnv", + "File", + "FileInfo", + "FileMode", + "FindProcess", + "Getegid", + "Getenv", + "Geteuid", + "Getgid", + "Getgroups", + "Getpagesize", + "Getpid", + "Getppid", + "Getuid", + "Getwd", + "Hostname", + "Interrupt", + "IsExist", + "IsNotExist", + "IsPathSeparator", + "IsPermission", + "IsTimeout", + "Kill", + "Lchown", + "Link", + "LinkError", + "LookupEnv", + "Lstat", + "Mkdir", + "MkdirAll", + "MkdirTemp", + "ModeAppend", + "ModeCharDevice", + "ModeDevice", + "ModeDir", + "ModeExclusive", + "ModeIrregular", + "ModeNamedPipe", + "ModePerm", + "ModeSetgid", + "ModeSetuid", + "ModeSocket", + "ModeSticky", + "ModeSymlink", + "ModeTemporary", + "ModeType", + "NewFile", + "NewSyscallError", + "O_APPEND", + "O_CREATE", + "O_EXCL", + "O_RDONLY", + "O_RDWR", + "O_SYNC", + "O_TRUNC", + "O_WRONLY", + "Open", + "OpenFile", + "PathError", + "PathListSeparator", + "PathSeparator", + "Pipe", + "ProcAttr", + "Process", + "ProcessState", + "ReadDir", + "ReadFile", + "Readlink", + "Remove", + "RemoveAll", + "Rename", + "SEEK_CUR", + "SEEK_END", + "SEEK_SET", + "SameFile", + "Setenv", + "Signal", + "StartProcess", + "Stat", + "Stderr", + "Stdin", + "Stdout", + "Symlink", + "SyscallError", + "TempDir", + "Truncate", + "Unsetenv", + "UserCacheDir", + "UserConfigDir", + "UserHomeDir", + "WriteFile", + }, + "os/exec": { + "Cmd", + "Command", + "CommandContext", + "ErrDot", + "ErrNotFound", + "ErrWaitDelay", + "Error", + "ExitError", + "LookPath", + }, + "os/signal": { + "Ignore", + "Ignored", + "Notify", + "NotifyContext", + "Reset", + "Stop", + }, + "os/user": { + "Current", + "Group", + "Lookup", + "LookupGroup", + "LookupGroupId", + "LookupId", + "UnknownGroupError", + "UnknownGroupIdError", + "UnknownUserError", + "UnknownUserIdError", + "User", + }, + "path": { + "Base", + "Clean", + "Dir", + "ErrBadPattern", + "Ext", + "IsAbs", + "Join", + "Match", + "Split", + }, + "path/filepath": { + "Abs", + "Base", + "Clean", + "Dir", + "ErrBadPattern", + "EvalSymlinks", + "Ext", + "FromSlash", + "Glob", + "HasPrefix", + "IsAbs", + "IsLocal", + "Join", + "ListSeparator", + "Match", + "Rel", + "Separator", + "SkipAll", + "SkipDir", + "Split", + "SplitList", + "ToSlash", + "VolumeName", + "Walk", + "WalkDir", + "WalkFunc", + }, + "plugin": { + "Open", + "Plugin", + "Symbol", + }, + "reflect": { + "Append", + "AppendSlice", + "Array", + "ArrayOf", + "Bool", + "BothDir", + "Chan", + "ChanDir", + "ChanOf", + "Complex128", + "Complex64", + "Copy", + "DeepEqual", + "Float32", + "Float64", + "Func", + "FuncOf", + "Indirect", + "Int", + "Int16", + "Int32", + "Int64", + "Int8", + "Interface", + "Invalid", + "Kind", + "MakeChan", + "MakeFunc", + "MakeMap", + "MakeMapWithSize", + "MakeSlice", + "Map", + "MapIter", + "MapOf", + "Method", + "New", + "NewAt", + "Pointer", + "PointerTo", + "Ptr", + "PtrTo", + "RecvDir", + "Select", + "SelectCase", + "SelectDefault", + "SelectDir", + "SelectRecv", + "SelectSend", + "SendDir", + "Slice", + "SliceHeader", + "SliceOf", + "String", + "StringHeader", + "Struct", + "StructField", + "StructOf", + "StructTag", + "Swapper", + "Type", + "TypeOf", + "Uint", + "Uint16", + "Uint32", + "Uint64", + "Uint8", + "Uintptr", + "UnsafePointer", + "Value", + "ValueError", + "ValueOf", + "VisibleFields", + "Zero", + }, + "regexp": { + "Compile", + "CompilePOSIX", + "Match", + "MatchReader", + "MatchString", + "MustCompile", + "MustCompilePOSIX", + "QuoteMeta", + "Regexp", + }, + "regexp/syntax": { + "ClassNL", + "Compile", + "DotNL", + "EmptyBeginLine", + "EmptyBeginText", + "EmptyEndLine", + "EmptyEndText", + "EmptyNoWordBoundary", + "EmptyOp", + "EmptyOpContext", + "EmptyWordBoundary", + "ErrInternalError", + "ErrInvalidCharClass", + "ErrInvalidCharRange", + "ErrInvalidEscape", + "ErrInvalidNamedCapture", + "ErrInvalidPerlOp", + "ErrInvalidRepeatOp", + "ErrInvalidRepeatSize", + "ErrInvalidUTF8", + "ErrLarge", + "ErrMissingBracket", + "ErrMissingParen", + "ErrMissingRepeatArgument", + "ErrNestingDepth", + "ErrTrailingBackslash", + "ErrUnexpectedParen", + "Error", + "ErrorCode", + "Flags", + "FoldCase", + "Inst", + "InstAlt", + "InstAltMatch", + "InstCapture", + "InstEmptyWidth", + "InstFail", + "InstMatch", + "InstNop", + "InstOp", + "InstRune", + "InstRune1", + "InstRuneAny", + "InstRuneAnyNotNL", + "IsWordChar", + "Literal", + "MatchNL", + "NonGreedy", + "OneLine", + "Op", + "OpAlternate", + "OpAnyChar", + "OpAnyCharNotNL", + "OpBeginLine", + "OpBeginText", + "OpCapture", + "OpCharClass", + "OpConcat", + "OpEmptyMatch", + "OpEndLine", + "OpEndText", + "OpLiteral", + "OpNoMatch", + "OpNoWordBoundary", + "OpPlus", + "OpQuest", + "OpRepeat", + "OpStar", + "OpWordBoundary", + "POSIX", + "Parse", + "Perl", + "PerlX", + "Prog", + "Regexp", + "Simple", + "UnicodeGroups", + "WasDollar", + }, + "runtime": { + "BlockProfile", + "BlockProfileRecord", + "Breakpoint", + "CPUProfile", + "Caller", + "Callers", + "CallersFrames", + "Compiler", + "Error", + "Frame", + "Frames", + "Func", + "FuncForPC", + "GC", + "GOARCH", + "GOMAXPROCS", + "GOOS", + "GOROOT", + "Goexit", + "GoroutineProfile", + "Gosched", + "KeepAlive", + "LockOSThread", + "MemProfile", + "MemProfileRate", + "MemProfileRecord", + "MemStats", + "MutexProfile", + "NumCPU", + "NumCgoCall", + "NumGoroutine", + "PanicNilError", + "Pinner", + "ReadMemStats", + "ReadTrace", + "SetBlockProfileRate", + "SetCPUProfileRate", + "SetCgoTraceback", + "SetFinalizer", + "SetMutexProfileFraction", + "Stack", + "StackRecord", + "StartTrace", + "StopTrace", + "ThreadCreateProfile", + "TypeAssertionError", + "UnlockOSThread", + "Version", + }, + "runtime/cgo": { + "Handle", + "Incomplete", + "NewHandle", + }, + "runtime/coverage": { + "ClearCounters", + "WriteCounters", + "WriteCountersDir", + "WriteMeta", + "WriteMetaDir", + }, + "runtime/debug": { + "BuildInfo", + "BuildSetting", + "FreeOSMemory", + "GCStats", + "Module", + "ParseBuildInfo", + "PrintStack", + "ReadBuildInfo", + "ReadGCStats", + "SetGCPercent", + "SetMaxStack", + "SetMaxThreads", + "SetMemoryLimit", + "SetPanicOnFault", + "SetTraceback", + "Stack", + "WriteHeapDump", + }, + "runtime/metrics": { + "All", + "Description", + "Float64Histogram", + "KindBad", + "KindFloat64", + "KindFloat64Histogram", + "KindUint64", + "Read", + "Sample", + "Value", + "ValueKind", + }, + "runtime/pprof": { + "Do", + "ForLabels", + "Label", + "LabelSet", + "Labels", + "Lookup", + "NewProfile", + "Profile", + "Profiles", + "SetGoroutineLabels", + "StartCPUProfile", + "StopCPUProfile", + "WithLabels", + "WriteHeapProfile", + }, + "runtime/trace": { + "IsEnabled", + "Log", + "Logf", + "NewTask", + "Region", + "Start", + "StartRegion", + "Stop", + "Task", + "WithRegion", + }, + "slices": { + "BinarySearch", + "BinarySearchFunc", + "Clip", + "Clone", + "Compact", + "CompactFunc", + "Compare", + "CompareFunc", + "Contains", + "ContainsFunc", + "Delete", + "DeleteFunc", + "Equal", + "EqualFunc", + "Grow", + "Index", + "IndexFunc", + "Insert", + "IsSorted", + "IsSortedFunc", + "Max", + "MaxFunc", + "Min", + "MinFunc", + "Replace", + "Reverse", + "Sort", + "SortFunc", + "SortStableFunc", + }, + "sort": { + "Find", + "Float64Slice", + "Float64s", + "Float64sAreSorted", + "IntSlice", + "Interface", + "Ints", + "IntsAreSorted", + "IsSorted", + "Reverse", + "Search", + "SearchFloat64s", + "SearchInts", + "SearchStrings", + "Slice", + "SliceIsSorted", + "SliceStable", + "Sort", + "Stable", + "StringSlice", + "Strings", + "StringsAreSorted", + }, + "strconv": { + "AppendBool", + "AppendFloat", + "AppendInt", + "AppendQuote", + "AppendQuoteRune", + "AppendQuoteRuneToASCII", + "AppendQuoteRuneToGraphic", + "AppendQuoteToASCII", + "AppendQuoteToGraphic", + "AppendUint", + "Atoi", + "CanBackquote", + "ErrRange", + "ErrSyntax", + "FormatBool", + "FormatComplex", + "FormatFloat", + "FormatInt", + "FormatUint", + "IntSize", + "IsGraphic", + "IsPrint", + "Itoa", + "NumError", + "ParseBool", + "ParseComplex", + "ParseFloat", + "ParseInt", + "ParseUint", + "Quote", + "QuoteRune", + "QuoteRuneToASCII", + "QuoteRuneToGraphic", + "QuoteToASCII", + "QuoteToGraphic", + "QuotedPrefix", + "Unquote", + "UnquoteChar", + }, + "strings": { + "Builder", + "Clone", + "Compare", + "Contains", + "ContainsAny", + "ContainsFunc", + "ContainsRune", + "Count", + "Cut", + "CutPrefix", + "CutSuffix", + "EqualFold", + "Fields", + "FieldsFunc", + "HasPrefix", + "HasSuffix", + "Index", + "IndexAny", + "IndexByte", + "IndexFunc", + "IndexRune", + "Join", + "LastIndex", + "LastIndexAny", + "LastIndexByte", + "LastIndexFunc", + "Map", + "NewReader", + "NewReplacer", + "Reader", + "Repeat", + "Replace", + "ReplaceAll", + "Replacer", + "Split", + "SplitAfter", + "SplitAfterN", + "SplitN", + "Title", + "ToLower", + "ToLowerSpecial", + "ToTitle", + "ToTitleSpecial", + "ToUpper", + "ToUpperSpecial", + "ToValidUTF8", + "Trim", + "TrimFunc", + "TrimLeft", + "TrimLeftFunc", + "TrimPrefix", + "TrimRight", + "TrimRightFunc", + "TrimSpace", + "TrimSuffix", + }, + "sync": { + "Cond", + "Locker", + "Map", + "Mutex", + "NewCond", + "Once", + "OnceFunc", + "OnceValue", + "OnceValues", + "Pool", + "RWMutex", + "WaitGroup", + }, + "sync/atomic": { + "AddInt32", + "AddInt64", + "AddUint32", + "AddUint64", + "AddUintptr", + "Bool", + "CompareAndSwapInt32", + "CompareAndSwapInt64", + "CompareAndSwapPointer", + "CompareAndSwapUint32", + "CompareAndSwapUint64", + "CompareAndSwapUintptr", + "Int32", + "Int64", + "LoadInt32", + "LoadInt64", + "LoadPointer", + "LoadUint32", + "LoadUint64", + "LoadUintptr", + "Pointer", + "StoreInt32", + "StoreInt64", + "StorePointer", + "StoreUint32", + "StoreUint64", + "StoreUintptr", + "SwapInt32", + "SwapInt64", + "SwapPointer", + "SwapUint32", + "SwapUint64", + "SwapUintptr", + "Uint32", + "Uint64", + "Uintptr", + "Value", + }, + "syscall": { + "AF_ALG", + "AF_APPLETALK", + "AF_ARP", + "AF_ASH", + "AF_ATM", + "AF_ATMPVC", + "AF_ATMSVC", + "AF_AX25", + "AF_BLUETOOTH", + "AF_BRIDGE", + "AF_CAIF", + "AF_CAN", + "AF_CCITT", + "AF_CHAOS", + "AF_CNT", + "AF_COIP", + "AF_DATAKIT", + "AF_DECnet", + "AF_DLI", + "AF_E164", + "AF_ECMA", + "AF_ECONET", + "AF_ENCAP", + "AF_FILE", + "AF_HYLINK", + "AF_IEEE80211", + "AF_IEEE802154", + "AF_IMPLINK", + "AF_INET", + "AF_INET6", + "AF_INET6_SDP", + "AF_INET_SDP", + "AF_IPX", + "AF_IRDA", + "AF_ISDN", + "AF_ISO", + "AF_IUCV", + "AF_KEY", + "AF_LAT", + "AF_LINK", + "AF_LLC", + "AF_LOCAL", + "AF_MAX", + "AF_MPLS", + "AF_NATM", + "AF_NDRV", + "AF_NETBEUI", + "AF_NETBIOS", + "AF_NETGRAPH", + "AF_NETLINK", + "AF_NETROM", + "AF_NS", + "AF_OROUTE", + "AF_OSI", + "AF_PACKET", + "AF_PHONET", + "AF_PPP", + "AF_PPPOX", + "AF_PUP", + "AF_RDS", + "AF_RESERVED_36", + "AF_ROSE", + "AF_ROUTE", + "AF_RXRPC", + "AF_SCLUSTER", + "AF_SECURITY", + "AF_SIP", + "AF_SLOW", + "AF_SNA", + "AF_SYSTEM", + "AF_TIPC", + "AF_UNIX", + "AF_UNSPEC", + "AF_UTUN", + "AF_VENDOR00", + "AF_VENDOR01", + "AF_VENDOR02", + "AF_VENDOR03", + "AF_VENDOR04", + "AF_VENDOR05", + "AF_VENDOR06", + "AF_VENDOR07", + "AF_VENDOR08", + "AF_VENDOR09", + "AF_VENDOR10", + "AF_VENDOR11", + "AF_VENDOR12", + "AF_VENDOR13", + "AF_VENDOR14", + "AF_VENDOR15", + "AF_VENDOR16", + "AF_VENDOR17", + "AF_VENDOR18", + "AF_VENDOR19", + "AF_VENDOR20", + "AF_VENDOR21", + "AF_VENDOR22", + "AF_VENDOR23", + "AF_VENDOR24", + "AF_VENDOR25", + "AF_VENDOR26", + "AF_VENDOR27", + "AF_VENDOR28", + "AF_VENDOR29", + "AF_VENDOR30", + "AF_VENDOR31", + "AF_VENDOR32", + "AF_VENDOR33", + "AF_VENDOR34", + "AF_VENDOR35", + "AF_VENDOR36", + "AF_VENDOR37", + "AF_VENDOR38", + "AF_VENDOR39", + "AF_VENDOR40", + "AF_VENDOR41", + "AF_VENDOR42", + "AF_VENDOR43", + "AF_VENDOR44", + "AF_VENDOR45", + "AF_VENDOR46", + "AF_VENDOR47", + "AF_WANPIPE", + "AF_X25", + "AI_CANONNAME", + "AI_NUMERICHOST", + "AI_PASSIVE", + "APPLICATION_ERROR", + "ARPHRD_ADAPT", + "ARPHRD_APPLETLK", + "ARPHRD_ARCNET", + "ARPHRD_ASH", + "ARPHRD_ATM", + "ARPHRD_AX25", + "ARPHRD_BIF", + "ARPHRD_CHAOS", + "ARPHRD_CISCO", + "ARPHRD_CSLIP", + "ARPHRD_CSLIP6", + "ARPHRD_DDCMP", + "ARPHRD_DLCI", + "ARPHRD_ECONET", + "ARPHRD_EETHER", + "ARPHRD_ETHER", + "ARPHRD_EUI64", + "ARPHRD_FCAL", + "ARPHRD_FCFABRIC", + "ARPHRD_FCPL", + "ARPHRD_FCPP", + "ARPHRD_FDDI", + "ARPHRD_FRAD", + "ARPHRD_FRELAY", + "ARPHRD_HDLC", + "ARPHRD_HIPPI", + "ARPHRD_HWX25", + "ARPHRD_IEEE1394", + "ARPHRD_IEEE802", + "ARPHRD_IEEE80211", + "ARPHRD_IEEE80211_PRISM", + "ARPHRD_IEEE80211_RADIOTAP", + "ARPHRD_IEEE802154", + "ARPHRD_IEEE802154_PHY", + "ARPHRD_IEEE802_TR", + "ARPHRD_INFINIBAND", + "ARPHRD_IPDDP", + "ARPHRD_IPGRE", + "ARPHRD_IRDA", + "ARPHRD_LAPB", + "ARPHRD_LOCALTLK", + "ARPHRD_LOOPBACK", + "ARPHRD_METRICOM", + "ARPHRD_NETROM", + "ARPHRD_NONE", + "ARPHRD_PIMREG", + "ARPHRD_PPP", + "ARPHRD_PRONET", + "ARPHRD_RAWHDLC", + "ARPHRD_ROSE", + "ARPHRD_RSRVD", + "ARPHRD_SIT", + "ARPHRD_SKIP", + "ARPHRD_SLIP", + "ARPHRD_SLIP6", + "ARPHRD_STRIP", + "ARPHRD_TUNNEL", + "ARPHRD_TUNNEL6", + "ARPHRD_VOID", + "ARPHRD_X25", + "AUTHTYPE_CLIENT", + "AUTHTYPE_SERVER", + "Accept", + "Accept4", + "AcceptEx", + "Access", + "Acct", + "AddrinfoW", + "Adjtime", + "Adjtimex", + "AllThreadsSyscall", + "AllThreadsSyscall6", + "AttachLsf", + "B0", + "B1000000", + "B110", + "B115200", + "B1152000", + "B1200", + "B134", + "B14400", + "B150", + "B1500000", + "B1800", + "B19200", + "B200", + "B2000000", + "B230400", + "B2400", + "B2500000", + "B28800", + "B300", + "B3000000", + "B3500000", + "B38400", + "B4000000", + "B460800", + "B4800", + "B50", + "B500000", + "B57600", + "B576000", + "B600", + "B7200", + "B75", + "B76800", + "B921600", + "B9600", + "BASE_PROTOCOL", + "BIOCFEEDBACK", + "BIOCFLUSH", + "BIOCGBLEN", + "BIOCGDIRECTION", + "BIOCGDIRFILT", + "BIOCGDLT", + "BIOCGDLTLIST", + "BIOCGETBUFMODE", + "BIOCGETIF", + "BIOCGETZMAX", + "BIOCGFEEDBACK", + "BIOCGFILDROP", + "BIOCGHDRCMPLT", + "BIOCGRSIG", + "BIOCGRTIMEOUT", + "BIOCGSEESENT", + "BIOCGSTATS", + "BIOCGSTATSOLD", + "BIOCGTSTAMP", + "BIOCIMMEDIATE", + "BIOCLOCK", + "BIOCPROMISC", + "BIOCROTZBUF", + "BIOCSBLEN", + "BIOCSDIRECTION", + "BIOCSDIRFILT", + "BIOCSDLT", + "BIOCSETBUFMODE", + "BIOCSETF", + "BIOCSETFNR", + "BIOCSETIF", + "BIOCSETWF", + "BIOCSETZBUF", + "BIOCSFEEDBACK", + "BIOCSFILDROP", + "BIOCSHDRCMPLT", + "BIOCSRSIG", + "BIOCSRTIMEOUT", + "BIOCSSEESENT", + "BIOCSTCPF", + "BIOCSTSTAMP", + "BIOCSUDPF", + "BIOCVERSION", + "BPF_A", + "BPF_ABS", + "BPF_ADD", + "BPF_ALIGNMENT", + "BPF_ALIGNMENT32", + "BPF_ALU", + "BPF_AND", + "BPF_B", + "BPF_BUFMODE_BUFFER", + "BPF_BUFMODE_ZBUF", + "BPF_DFLTBUFSIZE", + "BPF_DIRECTION_IN", + "BPF_DIRECTION_OUT", + "BPF_DIV", + "BPF_H", + "BPF_IMM", + "BPF_IND", + "BPF_JA", + "BPF_JEQ", + "BPF_JGE", + "BPF_JGT", + "BPF_JMP", + "BPF_JSET", + "BPF_K", + "BPF_LD", + "BPF_LDX", + "BPF_LEN", + "BPF_LSH", + "BPF_MAJOR_VERSION", + "BPF_MAXBUFSIZE", + "BPF_MAXINSNS", + "BPF_MEM", + "BPF_MEMWORDS", + "BPF_MINBUFSIZE", + "BPF_MINOR_VERSION", + "BPF_MISC", + "BPF_MSH", + "BPF_MUL", + "BPF_NEG", + "BPF_OR", + "BPF_RELEASE", + "BPF_RET", + "BPF_RSH", + "BPF_ST", + "BPF_STX", + "BPF_SUB", + "BPF_TAX", + "BPF_TXA", + "BPF_T_BINTIME", + "BPF_T_BINTIME_FAST", + "BPF_T_BINTIME_MONOTONIC", + "BPF_T_BINTIME_MONOTONIC_FAST", + "BPF_T_FAST", + "BPF_T_FLAG_MASK", + "BPF_T_FORMAT_MASK", + "BPF_T_MICROTIME", + "BPF_T_MICROTIME_FAST", + "BPF_T_MICROTIME_MONOTONIC", + "BPF_T_MICROTIME_MONOTONIC_FAST", + "BPF_T_MONOTONIC", + "BPF_T_MONOTONIC_FAST", + "BPF_T_NANOTIME", + "BPF_T_NANOTIME_FAST", + "BPF_T_NANOTIME_MONOTONIC", + "BPF_T_NANOTIME_MONOTONIC_FAST", + "BPF_T_NONE", + "BPF_T_NORMAL", + "BPF_W", + "BPF_X", + "BRKINT", + "Bind", + "BindToDevice", + "BpfBuflen", + "BpfDatalink", + "BpfHdr", + "BpfHeadercmpl", + "BpfInsn", + "BpfInterface", + "BpfJump", + "BpfProgram", + "BpfStat", + "BpfStats", + "BpfStmt", + "BpfTimeout", + "BpfTimeval", + "BpfVersion", + "BpfZbuf", + "BpfZbufHeader", + "ByHandleFileInformation", + "BytePtrFromString", + "ByteSliceFromString", + "CCR0_FLUSH", + "CERT_CHAIN_POLICY_AUTHENTICODE", + "CERT_CHAIN_POLICY_AUTHENTICODE_TS", + "CERT_CHAIN_POLICY_BASE", + "CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", + "CERT_CHAIN_POLICY_EV", + "CERT_CHAIN_POLICY_MICROSOFT_ROOT", + "CERT_CHAIN_POLICY_NT_AUTH", + "CERT_CHAIN_POLICY_SSL", + "CERT_E_CN_NO_MATCH", + "CERT_E_EXPIRED", + "CERT_E_PURPOSE", + "CERT_E_ROLE", + "CERT_E_UNTRUSTEDROOT", + "CERT_STORE_ADD_ALWAYS", + "CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", + "CERT_STORE_PROV_MEMORY", + "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", + "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", + "CERT_TRUST_INVALID_BASIC_CONSTRAINTS", + "CERT_TRUST_INVALID_EXTENSION", + "CERT_TRUST_INVALID_NAME_CONSTRAINTS", + "CERT_TRUST_INVALID_POLICY_CONSTRAINTS", + "CERT_TRUST_IS_CYCLIC", + "CERT_TRUST_IS_EXPLICIT_DISTRUST", + "CERT_TRUST_IS_NOT_SIGNATURE_VALID", + "CERT_TRUST_IS_NOT_TIME_VALID", + "CERT_TRUST_IS_NOT_VALID_FOR_USAGE", + "CERT_TRUST_IS_OFFLINE_REVOCATION", + "CERT_TRUST_IS_REVOKED", + "CERT_TRUST_IS_UNTRUSTED_ROOT", + "CERT_TRUST_NO_ERROR", + "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", + "CERT_TRUST_REVOCATION_STATUS_UNKNOWN", + "CFLUSH", + "CLOCAL", + "CLONE_CHILD_CLEARTID", + "CLONE_CHILD_SETTID", + "CLONE_CLEAR_SIGHAND", + "CLONE_CSIGNAL", + "CLONE_DETACHED", + "CLONE_FILES", + "CLONE_FS", + "CLONE_INTO_CGROUP", + "CLONE_IO", + "CLONE_NEWCGROUP", + "CLONE_NEWIPC", + "CLONE_NEWNET", + "CLONE_NEWNS", + "CLONE_NEWPID", + "CLONE_NEWTIME", + "CLONE_NEWUSER", + "CLONE_NEWUTS", + "CLONE_PARENT", + "CLONE_PARENT_SETTID", + "CLONE_PID", + "CLONE_PIDFD", + "CLONE_PTRACE", + "CLONE_SETTLS", + "CLONE_SIGHAND", + "CLONE_SYSVSEM", + "CLONE_THREAD", + "CLONE_UNTRACED", + "CLONE_VFORK", + "CLONE_VM", + "CPUID_CFLUSH", + "CREAD", + "CREATE_ALWAYS", + "CREATE_NEW", + "CREATE_NEW_PROCESS_GROUP", + "CREATE_UNICODE_ENVIRONMENT", + "CRYPT_DEFAULT_CONTAINER_OPTIONAL", + "CRYPT_DELETEKEYSET", + "CRYPT_MACHINE_KEYSET", + "CRYPT_NEWKEYSET", + "CRYPT_SILENT", + "CRYPT_VERIFYCONTEXT", + "CS5", + "CS6", + "CS7", + "CS8", + "CSIZE", + "CSTART", + "CSTATUS", + "CSTOP", + "CSTOPB", + "CSUSP", + "CTL_MAXNAME", + "CTL_NET", + "CTL_QUERY", + "CTRL_BREAK_EVENT", + "CTRL_CLOSE_EVENT", + "CTRL_C_EVENT", + "CTRL_LOGOFF_EVENT", + "CTRL_SHUTDOWN_EVENT", + "CancelIo", + "CancelIoEx", + "CertAddCertificateContextToStore", + "CertChainContext", + "CertChainElement", + "CertChainPara", + "CertChainPolicyPara", + "CertChainPolicyStatus", + "CertCloseStore", + "CertContext", + "CertCreateCertificateContext", + "CertEnhKeyUsage", + "CertEnumCertificatesInStore", + "CertFreeCertificateChain", + "CertFreeCertificateContext", + "CertGetCertificateChain", + "CertInfo", + "CertOpenStore", + "CertOpenSystemStore", + "CertRevocationCrlInfo", + "CertRevocationInfo", + "CertSimpleChain", + "CertTrustListInfo", + "CertTrustStatus", + "CertUsageMatch", + "CertVerifyCertificateChainPolicy", + "Chdir", + "CheckBpfVersion", + "Chflags", + "Chmod", + "Chown", + "Chroot", + "Clearenv", + "Close", + "CloseHandle", + "CloseOnExec", + "Closesocket", + "CmsgLen", + "CmsgSpace", + "Cmsghdr", + "CommandLineToArgv", + "ComputerName", + "Conn", + "Connect", + "ConnectEx", + "ConvertSidToStringSid", + "ConvertStringSidToSid", + "CopySid", + "Creat", + "CreateDirectory", + "CreateFile", + "CreateFileMapping", + "CreateHardLink", + "CreateIoCompletionPort", + "CreatePipe", + "CreateProcess", + "CreateProcessAsUser", + "CreateSymbolicLink", + "CreateToolhelp32Snapshot", + "Credential", + "CryptAcquireContext", + "CryptGenRandom", + "CryptReleaseContext", + "DIOCBSFLUSH", + "DIOCOSFPFLUSH", + "DLL", + "DLLError", + "DLT_A429", + "DLT_A653_ICM", + "DLT_AIRONET_HEADER", + "DLT_AOS", + "DLT_APPLE_IP_OVER_IEEE1394", + "DLT_ARCNET", + "DLT_ARCNET_LINUX", + "DLT_ATM_CLIP", + "DLT_ATM_RFC1483", + "DLT_AURORA", + "DLT_AX25", + "DLT_AX25_KISS", + "DLT_BACNET_MS_TP", + "DLT_BLUETOOTH_HCI_H4", + "DLT_BLUETOOTH_HCI_H4_WITH_PHDR", + "DLT_CAN20B", + "DLT_CAN_SOCKETCAN", + "DLT_CHAOS", + "DLT_CHDLC", + "DLT_CISCO_IOS", + "DLT_C_HDLC", + "DLT_C_HDLC_WITH_DIR", + "DLT_DBUS", + "DLT_DECT", + "DLT_DOCSIS", + "DLT_DVB_CI", + "DLT_ECONET", + "DLT_EN10MB", + "DLT_EN3MB", + "DLT_ENC", + "DLT_ERF", + "DLT_ERF_ETH", + "DLT_ERF_POS", + "DLT_FC_2", + "DLT_FC_2_WITH_FRAME_DELIMS", + "DLT_FDDI", + "DLT_FLEXRAY", + "DLT_FRELAY", + "DLT_FRELAY_WITH_DIR", + "DLT_GCOM_SERIAL", + "DLT_GCOM_T1E1", + "DLT_GPF_F", + "DLT_GPF_T", + "DLT_GPRS_LLC", + "DLT_GSMTAP_ABIS", + "DLT_GSMTAP_UM", + "DLT_HDLC", + "DLT_HHDLC", + "DLT_HIPPI", + "DLT_IBM_SN", + "DLT_IBM_SP", + "DLT_IEEE802", + "DLT_IEEE802_11", + "DLT_IEEE802_11_RADIO", + "DLT_IEEE802_11_RADIO_AVS", + "DLT_IEEE802_15_4", + "DLT_IEEE802_15_4_LINUX", + "DLT_IEEE802_15_4_NOFCS", + "DLT_IEEE802_15_4_NONASK_PHY", + "DLT_IEEE802_16_MAC_CPS", + "DLT_IEEE802_16_MAC_CPS_RADIO", + "DLT_IPFILTER", + "DLT_IPMB", + "DLT_IPMB_LINUX", + "DLT_IPNET", + "DLT_IPOIB", + "DLT_IPV4", + "DLT_IPV6", + "DLT_IP_OVER_FC", + "DLT_JUNIPER_ATM1", + "DLT_JUNIPER_ATM2", + "DLT_JUNIPER_ATM_CEMIC", + "DLT_JUNIPER_CHDLC", + "DLT_JUNIPER_ES", + "DLT_JUNIPER_ETHER", + "DLT_JUNIPER_FIBRECHANNEL", + "DLT_JUNIPER_FRELAY", + "DLT_JUNIPER_GGSN", + "DLT_JUNIPER_ISM", + "DLT_JUNIPER_MFR", + "DLT_JUNIPER_MLFR", + "DLT_JUNIPER_MLPPP", + "DLT_JUNIPER_MONITOR", + "DLT_JUNIPER_PIC_PEER", + "DLT_JUNIPER_PPP", + "DLT_JUNIPER_PPPOE", + "DLT_JUNIPER_PPPOE_ATM", + "DLT_JUNIPER_SERVICES", + "DLT_JUNIPER_SRX_E2E", + "DLT_JUNIPER_ST", + "DLT_JUNIPER_VP", + "DLT_JUNIPER_VS", + "DLT_LAPB_WITH_DIR", + "DLT_LAPD", + "DLT_LIN", + "DLT_LINUX_EVDEV", + "DLT_LINUX_IRDA", + "DLT_LINUX_LAPD", + "DLT_LINUX_PPP_WITHDIRECTION", + "DLT_LINUX_SLL", + "DLT_LOOP", + "DLT_LTALK", + "DLT_MATCHING_MAX", + "DLT_MATCHING_MIN", + "DLT_MFR", + "DLT_MOST", + "DLT_MPEG_2_TS", + "DLT_MPLS", + "DLT_MTP2", + "DLT_MTP2_WITH_PHDR", + "DLT_MTP3", + "DLT_MUX27010", + "DLT_NETANALYZER", + "DLT_NETANALYZER_TRANSPARENT", + "DLT_NFC_LLCP", + "DLT_NFLOG", + "DLT_NG40", + "DLT_NULL", + "DLT_PCI_EXP", + "DLT_PFLOG", + "DLT_PFSYNC", + "DLT_PPI", + "DLT_PPP", + "DLT_PPP_BSDOS", + "DLT_PPP_ETHER", + "DLT_PPP_PPPD", + "DLT_PPP_SERIAL", + "DLT_PPP_WITH_DIR", + "DLT_PPP_WITH_DIRECTION", + "DLT_PRISM_HEADER", + "DLT_PRONET", + "DLT_RAIF1", + "DLT_RAW", + "DLT_RAWAF_MASK", + "DLT_RIO", + "DLT_SCCP", + "DLT_SITA", + "DLT_SLIP", + "DLT_SLIP_BSDOS", + "DLT_STANAG_5066_D_PDU", + "DLT_SUNATM", + "DLT_SYMANTEC_FIREWALL", + "DLT_TZSP", + "DLT_USB", + "DLT_USB_LINUX", + "DLT_USB_LINUX_MMAPPED", + "DLT_USER0", + "DLT_USER1", + "DLT_USER10", + "DLT_USER11", + "DLT_USER12", + "DLT_USER13", + "DLT_USER14", + "DLT_USER15", + "DLT_USER2", + "DLT_USER3", + "DLT_USER4", + "DLT_USER5", + "DLT_USER6", + "DLT_USER7", + "DLT_USER8", + "DLT_USER9", + "DLT_WIHART", + "DLT_X2E_SERIAL", + "DLT_X2E_XORAYA", + "DNSMXData", + "DNSPTRData", + "DNSRecord", + "DNSSRVData", + "DNSTXTData", + "DNS_INFO_NO_RECORDS", + "DNS_TYPE_A", + "DNS_TYPE_A6", + "DNS_TYPE_AAAA", + "DNS_TYPE_ADDRS", + "DNS_TYPE_AFSDB", + "DNS_TYPE_ALL", + "DNS_TYPE_ANY", + "DNS_TYPE_ATMA", + "DNS_TYPE_AXFR", + "DNS_TYPE_CERT", + "DNS_TYPE_CNAME", + "DNS_TYPE_DHCID", + "DNS_TYPE_DNAME", + "DNS_TYPE_DNSKEY", + "DNS_TYPE_DS", + "DNS_TYPE_EID", + "DNS_TYPE_GID", + "DNS_TYPE_GPOS", + "DNS_TYPE_HINFO", + "DNS_TYPE_ISDN", + "DNS_TYPE_IXFR", + "DNS_TYPE_KEY", + "DNS_TYPE_KX", + "DNS_TYPE_LOC", + "DNS_TYPE_MAILA", + "DNS_TYPE_MAILB", + "DNS_TYPE_MB", + "DNS_TYPE_MD", + "DNS_TYPE_MF", + "DNS_TYPE_MG", + "DNS_TYPE_MINFO", + "DNS_TYPE_MR", + "DNS_TYPE_MX", + "DNS_TYPE_NAPTR", + "DNS_TYPE_NBSTAT", + "DNS_TYPE_NIMLOC", + "DNS_TYPE_NS", + "DNS_TYPE_NSAP", + "DNS_TYPE_NSAPPTR", + "DNS_TYPE_NSEC", + "DNS_TYPE_NULL", + "DNS_TYPE_NXT", + "DNS_TYPE_OPT", + "DNS_TYPE_PTR", + "DNS_TYPE_PX", + "DNS_TYPE_RP", + "DNS_TYPE_RRSIG", + "DNS_TYPE_RT", + "DNS_TYPE_SIG", + "DNS_TYPE_SINK", + "DNS_TYPE_SOA", + "DNS_TYPE_SRV", + "DNS_TYPE_TEXT", + "DNS_TYPE_TKEY", + "DNS_TYPE_TSIG", + "DNS_TYPE_UID", + "DNS_TYPE_UINFO", + "DNS_TYPE_UNSPEC", + "DNS_TYPE_WINS", + "DNS_TYPE_WINSR", + "DNS_TYPE_WKS", + "DNS_TYPE_X25", + "DT_BLK", + "DT_CHR", + "DT_DIR", + "DT_FIFO", + "DT_LNK", + "DT_REG", + "DT_SOCK", + "DT_UNKNOWN", + "DT_WHT", + "DUPLICATE_CLOSE_SOURCE", + "DUPLICATE_SAME_ACCESS", + "DeleteFile", + "DetachLsf", + "DeviceIoControl", + "Dirent", + "DnsNameCompare", + "DnsQuery", + "DnsRecordListFree", + "DnsSectionAdditional", + "DnsSectionAnswer", + "DnsSectionAuthority", + "DnsSectionQuestion", + "Dup", + "Dup2", + "Dup3", + "DuplicateHandle", + "E2BIG", + "EACCES", + "EADDRINUSE", + "EADDRNOTAVAIL", + "EADV", + "EAFNOSUPPORT", + "EAGAIN", + "EALREADY", + "EAUTH", + "EBADARCH", + "EBADE", + "EBADEXEC", + "EBADF", + "EBADFD", + "EBADMACHO", + "EBADMSG", + "EBADR", + "EBADRPC", + "EBADRQC", + "EBADSLT", + "EBFONT", + "EBUSY", + "ECANCELED", + "ECAPMODE", + "ECHILD", + "ECHO", + "ECHOCTL", + "ECHOE", + "ECHOK", + "ECHOKE", + "ECHONL", + "ECHOPRT", + "ECHRNG", + "ECOMM", + "ECONNABORTED", + "ECONNREFUSED", + "ECONNRESET", + "EDEADLK", + "EDEADLOCK", + "EDESTADDRREQ", + "EDEVERR", + "EDOM", + "EDOOFUS", + "EDOTDOT", + "EDQUOT", + "EEXIST", + "EFAULT", + "EFBIG", + "EFER_LMA", + "EFER_LME", + "EFER_NXE", + "EFER_SCE", + "EFTYPE", + "EHOSTDOWN", + "EHOSTUNREACH", + "EHWPOISON", + "EIDRM", + "EILSEQ", + "EINPROGRESS", + "EINTR", + "EINVAL", + "EIO", + "EIPSEC", + "EISCONN", + "EISDIR", + "EISNAM", + "EKEYEXPIRED", + "EKEYREJECTED", + "EKEYREVOKED", + "EL2HLT", + "EL2NSYNC", + "EL3HLT", + "EL3RST", + "ELAST", + "ELF_NGREG", + "ELF_PRARGSZ", + "ELIBACC", + "ELIBBAD", + "ELIBEXEC", + "ELIBMAX", + "ELIBSCN", + "ELNRNG", + "ELOOP", + "EMEDIUMTYPE", + "EMFILE", + "EMLINK", + "EMSGSIZE", + "EMT_TAGOVF", + "EMULTIHOP", + "EMUL_ENABLED", + "EMUL_LINUX", + "EMUL_LINUX32", + "EMUL_MAXID", + "EMUL_NATIVE", + "ENAMETOOLONG", + "ENAVAIL", + "ENDRUNDISC", + "ENEEDAUTH", + "ENETDOWN", + "ENETRESET", + "ENETUNREACH", + "ENFILE", + "ENOANO", + "ENOATTR", + "ENOBUFS", + "ENOCSI", + "ENODATA", + "ENODEV", + "ENOENT", + "ENOEXEC", + "ENOKEY", + "ENOLCK", + "ENOLINK", + "ENOMEDIUM", + "ENOMEM", + "ENOMSG", + "ENONET", + "ENOPKG", + "ENOPOLICY", + "ENOPROTOOPT", + "ENOSPC", + "ENOSR", + "ENOSTR", + "ENOSYS", + "ENOTBLK", + "ENOTCAPABLE", + "ENOTCONN", + "ENOTDIR", + "ENOTEMPTY", + "ENOTNAM", + "ENOTRECOVERABLE", + "ENOTSOCK", + "ENOTSUP", + "ENOTTY", + "ENOTUNIQ", + "ENXIO", + "EN_SW_CTL_INF", + "EN_SW_CTL_PREC", + "EN_SW_CTL_ROUND", + "EN_SW_DATACHAIN", + "EN_SW_DENORM", + "EN_SW_INVOP", + "EN_SW_OVERFLOW", + "EN_SW_PRECLOSS", + "EN_SW_UNDERFLOW", + "EN_SW_ZERODIV", + "EOPNOTSUPP", + "EOVERFLOW", + "EOWNERDEAD", + "EPERM", + "EPFNOSUPPORT", + "EPIPE", + "EPOLLERR", + "EPOLLET", + "EPOLLHUP", + "EPOLLIN", + "EPOLLMSG", + "EPOLLONESHOT", + "EPOLLOUT", + "EPOLLPRI", + "EPOLLRDBAND", + "EPOLLRDHUP", + "EPOLLRDNORM", + "EPOLLWRBAND", + "EPOLLWRNORM", + "EPOLL_CLOEXEC", + "EPOLL_CTL_ADD", + "EPOLL_CTL_DEL", + "EPOLL_CTL_MOD", + "EPOLL_NONBLOCK", + "EPROCLIM", + "EPROCUNAVAIL", + "EPROGMISMATCH", + "EPROGUNAVAIL", + "EPROTO", + "EPROTONOSUPPORT", + "EPROTOTYPE", + "EPWROFF", + "EQFULL", + "ERANGE", + "EREMCHG", + "EREMOTE", + "EREMOTEIO", + "ERESTART", + "ERFKILL", + "EROFS", + "ERPCMISMATCH", + "ERROR_ACCESS_DENIED", + "ERROR_ALREADY_EXISTS", + "ERROR_BROKEN_PIPE", + "ERROR_BUFFER_OVERFLOW", + "ERROR_DIR_NOT_EMPTY", + "ERROR_ENVVAR_NOT_FOUND", + "ERROR_FILE_EXISTS", + "ERROR_FILE_NOT_FOUND", + "ERROR_HANDLE_EOF", + "ERROR_INSUFFICIENT_BUFFER", + "ERROR_IO_PENDING", + "ERROR_MOD_NOT_FOUND", + "ERROR_MORE_DATA", + "ERROR_NETNAME_DELETED", + "ERROR_NOT_FOUND", + "ERROR_NO_MORE_FILES", + "ERROR_OPERATION_ABORTED", + "ERROR_PATH_NOT_FOUND", + "ERROR_PRIVILEGE_NOT_HELD", + "ERROR_PROC_NOT_FOUND", + "ESHLIBVERS", + "ESHUTDOWN", + "ESOCKTNOSUPPORT", + "ESPIPE", + "ESRCH", + "ESRMNT", + "ESTALE", + "ESTRPIPE", + "ETHERCAP_JUMBO_MTU", + "ETHERCAP_VLAN_HWTAGGING", + "ETHERCAP_VLAN_MTU", + "ETHERMIN", + "ETHERMTU", + "ETHERMTU_JUMBO", + "ETHERTYPE_8023", + "ETHERTYPE_AARP", + "ETHERTYPE_ACCTON", + "ETHERTYPE_AEONIC", + "ETHERTYPE_ALPHA", + "ETHERTYPE_AMBER", + "ETHERTYPE_AMOEBA", + "ETHERTYPE_AOE", + "ETHERTYPE_APOLLO", + "ETHERTYPE_APOLLODOMAIN", + "ETHERTYPE_APPLETALK", + "ETHERTYPE_APPLITEK", + "ETHERTYPE_ARGONAUT", + "ETHERTYPE_ARP", + "ETHERTYPE_AT", + "ETHERTYPE_ATALK", + "ETHERTYPE_ATOMIC", + "ETHERTYPE_ATT", + "ETHERTYPE_ATTSTANFORD", + "ETHERTYPE_AUTOPHON", + "ETHERTYPE_AXIS", + "ETHERTYPE_BCLOOP", + "ETHERTYPE_BOFL", + "ETHERTYPE_CABLETRON", + "ETHERTYPE_CHAOS", + "ETHERTYPE_COMDESIGN", + "ETHERTYPE_COMPUGRAPHIC", + "ETHERTYPE_COUNTERPOINT", + "ETHERTYPE_CRONUS", + "ETHERTYPE_CRONUSVLN", + "ETHERTYPE_DCA", + "ETHERTYPE_DDE", + "ETHERTYPE_DEBNI", + "ETHERTYPE_DECAM", + "ETHERTYPE_DECCUST", + "ETHERTYPE_DECDIAG", + "ETHERTYPE_DECDNS", + "ETHERTYPE_DECDTS", + "ETHERTYPE_DECEXPER", + "ETHERTYPE_DECLAST", + "ETHERTYPE_DECLTM", + "ETHERTYPE_DECMUMPS", + "ETHERTYPE_DECNETBIOS", + "ETHERTYPE_DELTACON", + "ETHERTYPE_DIDDLE", + "ETHERTYPE_DLOG1", + "ETHERTYPE_DLOG2", + "ETHERTYPE_DN", + "ETHERTYPE_DOGFIGHT", + "ETHERTYPE_DSMD", + "ETHERTYPE_ECMA", + "ETHERTYPE_ENCRYPT", + "ETHERTYPE_ES", + "ETHERTYPE_EXCELAN", + "ETHERTYPE_EXPERDATA", + "ETHERTYPE_FLIP", + "ETHERTYPE_FLOWCONTROL", + "ETHERTYPE_FRARP", + "ETHERTYPE_GENDYN", + "ETHERTYPE_HAYES", + "ETHERTYPE_HIPPI_FP", + "ETHERTYPE_HITACHI", + "ETHERTYPE_HP", + "ETHERTYPE_IEEEPUP", + "ETHERTYPE_IEEEPUPAT", + "ETHERTYPE_IMLBL", + "ETHERTYPE_IMLBLDIAG", + "ETHERTYPE_IP", + "ETHERTYPE_IPAS", + "ETHERTYPE_IPV6", + "ETHERTYPE_IPX", + "ETHERTYPE_IPXNEW", + "ETHERTYPE_KALPANA", + "ETHERTYPE_LANBRIDGE", + "ETHERTYPE_LANPROBE", + "ETHERTYPE_LAT", + "ETHERTYPE_LBACK", + "ETHERTYPE_LITTLE", + "ETHERTYPE_LLDP", + "ETHERTYPE_LOGICRAFT", + "ETHERTYPE_LOOPBACK", + "ETHERTYPE_MATRA", + "ETHERTYPE_MAX", + "ETHERTYPE_MERIT", + "ETHERTYPE_MICP", + "ETHERTYPE_MOPDL", + "ETHERTYPE_MOPRC", + "ETHERTYPE_MOTOROLA", + "ETHERTYPE_MPLS", + "ETHERTYPE_MPLS_MCAST", + "ETHERTYPE_MUMPS", + "ETHERTYPE_NBPCC", + "ETHERTYPE_NBPCLAIM", + "ETHERTYPE_NBPCLREQ", + "ETHERTYPE_NBPCLRSP", + "ETHERTYPE_NBPCREQ", + "ETHERTYPE_NBPCRSP", + "ETHERTYPE_NBPDG", + "ETHERTYPE_NBPDGB", + "ETHERTYPE_NBPDLTE", + "ETHERTYPE_NBPRAR", + "ETHERTYPE_NBPRAS", + "ETHERTYPE_NBPRST", + "ETHERTYPE_NBPSCD", + "ETHERTYPE_NBPVCD", + "ETHERTYPE_NBS", + "ETHERTYPE_NCD", + "ETHERTYPE_NESTAR", + "ETHERTYPE_NETBEUI", + "ETHERTYPE_NOVELL", + "ETHERTYPE_NS", + "ETHERTYPE_NSAT", + "ETHERTYPE_NSCOMPAT", + "ETHERTYPE_NTRAILER", + "ETHERTYPE_OS9", + "ETHERTYPE_OS9NET", + "ETHERTYPE_PACER", + "ETHERTYPE_PAE", + "ETHERTYPE_PCS", + "ETHERTYPE_PLANNING", + "ETHERTYPE_PPP", + "ETHERTYPE_PPPOE", + "ETHERTYPE_PPPOEDISC", + "ETHERTYPE_PRIMENTS", + "ETHERTYPE_PUP", + "ETHERTYPE_PUPAT", + "ETHERTYPE_QINQ", + "ETHERTYPE_RACAL", + "ETHERTYPE_RATIONAL", + "ETHERTYPE_RAWFR", + "ETHERTYPE_RCL", + "ETHERTYPE_RDP", + "ETHERTYPE_RETIX", + "ETHERTYPE_REVARP", + "ETHERTYPE_SCA", + "ETHERTYPE_SECTRA", + "ETHERTYPE_SECUREDATA", + "ETHERTYPE_SGITW", + "ETHERTYPE_SG_BOUNCE", + "ETHERTYPE_SG_DIAG", + "ETHERTYPE_SG_NETGAMES", + "ETHERTYPE_SG_RESV", + "ETHERTYPE_SIMNET", + "ETHERTYPE_SLOW", + "ETHERTYPE_SLOWPROTOCOLS", + "ETHERTYPE_SNA", + "ETHERTYPE_SNMP", + "ETHERTYPE_SONIX", + "ETHERTYPE_SPIDER", + "ETHERTYPE_SPRITE", + "ETHERTYPE_STP", + "ETHERTYPE_TALARIS", + "ETHERTYPE_TALARISMC", + "ETHERTYPE_TCPCOMP", + "ETHERTYPE_TCPSM", + "ETHERTYPE_TEC", + "ETHERTYPE_TIGAN", + "ETHERTYPE_TRAIL", + "ETHERTYPE_TRANSETHER", + "ETHERTYPE_TYMSHARE", + "ETHERTYPE_UBBST", + "ETHERTYPE_UBDEBUG", + "ETHERTYPE_UBDIAGLOOP", + "ETHERTYPE_UBDL", + "ETHERTYPE_UBNIU", + "ETHERTYPE_UBNMC", + "ETHERTYPE_VALID", + "ETHERTYPE_VARIAN", + "ETHERTYPE_VAXELN", + "ETHERTYPE_VEECO", + "ETHERTYPE_VEXP", + "ETHERTYPE_VGLAB", + "ETHERTYPE_VINES", + "ETHERTYPE_VINESECHO", + "ETHERTYPE_VINESLOOP", + "ETHERTYPE_VITAL", + "ETHERTYPE_VLAN", + "ETHERTYPE_VLTLMAN", + "ETHERTYPE_VPROD", + "ETHERTYPE_VURESERVED", + "ETHERTYPE_WATERLOO", + "ETHERTYPE_WELLFLEET", + "ETHERTYPE_X25", + "ETHERTYPE_X75", + "ETHERTYPE_XNSSM", + "ETHERTYPE_XTP", + "ETHER_ADDR_LEN", + "ETHER_ALIGN", + "ETHER_CRC_LEN", + "ETHER_CRC_POLY_BE", + "ETHER_CRC_POLY_LE", + "ETHER_HDR_LEN", + "ETHER_MAX_DIX_LEN", + "ETHER_MAX_LEN", + "ETHER_MAX_LEN_JUMBO", + "ETHER_MIN_LEN", + "ETHER_PPPOE_ENCAP_LEN", + "ETHER_TYPE_LEN", + "ETHER_VLAN_ENCAP_LEN", + "ETH_P_1588", + "ETH_P_8021Q", + "ETH_P_802_2", + "ETH_P_802_3", + "ETH_P_AARP", + "ETH_P_ALL", + "ETH_P_AOE", + "ETH_P_ARCNET", + "ETH_P_ARP", + "ETH_P_ATALK", + "ETH_P_ATMFATE", + "ETH_P_ATMMPOA", + "ETH_P_AX25", + "ETH_P_BPQ", + "ETH_P_CAIF", + "ETH_P_CAN", + "ETH_P_CONTROL", + "ETH_P_CUST", + "ETH_P_DDCMP", + "ETH_P_DEC", + "ETH_P_DIAG", + "ETH_P_DNA_DL", + "ETH_P_DNA_RC", + "ETH_P_DNA_RT", + "ETH_P_DSA", + "ETH_P_ECONET", + "ETH_P_EDSA", + "ETH_P_FCOE", + "ETH_P_FIP", + "ETH_P_HDLC", + "ETH_P_IEEE802154", + "ETH_P_IEEEPUP", + "ETH_P_IEEEPUPAT", + "ETH_P_IP", + "ETH_P_IPV6", + "ETH_P_IPX", + "ETH_P_IRDA", + "ETH_P_LAT", + "ETH_P_LINK_CTL", + "ETH_P_LOCALTALK", + "ETH_P_LOOP", + "ETH_P_MOBITEX", + "ETH_P_MPLS_MC", + "ETH_P_MPLS_UC", + "ETH_P_PAE", + "ETH_P_PAUSE", + "ETH_P_PHONET", + "ETH_P_PPPTALK", + "ETH_P_PPP_DISC", + "ETH_P_PPP_MP", + "ETH_P_PPP_SES", + "ETH_P_PUP", + "ETH_P_PUPAT", + "ETH_P_RARP", + "ETH_P_SCA", + "ETH_P_SLOW", + "ETH_P_SNAP", + "ETH_P_TEB", + "ETH_P_TIPC", + "ETH_P_TRAILER", + "ETH_P_TR_802_2", + "ETH_P_WAN_PPP", + "ETH_P_WCCP", + "ETH_P_X25", + "ETIME", + "ETIMEDOUT", + "ETOOMANYREFS", + "ETXTBSY", + "EUCLEAN", + "EUNATCH", + "EUSERS", + "EVFILT_AIO", + "EVFILT_FS", + "EVFILT_LIO", + "EVFILT_MACHPORT", + "EVFILT_PROC", + "EVFILT_READ", + "EVFILT_SIGNAL", + "EVFILT_SYSCOUNT", + "EVFILT_THREADMARKER", + "EVFILT_TIMER", + "EVFILT_USER", + "EVFILT_VM", + "EVFILT_VNODE", + "EVFILT_WRITE", + "EV_ADD", + "EV_CLEAR", + "EV_DELETE", + "EV_DISABLE", + "EV_DISPATCH", + "EV_DROP", + "EV_ENABLE", + "EV_EOF", + "EV_ERROR", + "EV_FLAG0", + "EV_FLAG1", + "EV_ONESHOT", + "EV_OOBAND", + "EV_POLL", + "EV_RECEIPT", + "EV_SYSFLAGS", + "EWINDOWS", + "EWOULDBLOCK", + "EXDEV", + "EXFULL", + "EXTA", + "EXTB", + "EXTPROC", + "Environ", + "EpollCreate", + "EpollCreate1", + "EpollCtl", + "EpollEvent", + "EpollWait", + "Errno", + "EscapeArg", + "Exchangedata", + "Exec", + "Exit", + "ExitProcess", + "FD_CLOEXEC", + "FD_SETSIZE", + "FILE_ACTION_ADDED", + "FILE_ACTION_MODIFIED", + "FILE_ACTION_REMOVED", + "FILE_ACTION_RENAMED_NEW_NAME", + "FILE_ACTION_RENAMED_OLD_NAME", + "FILE_APPEND_DATA", + "FILE_ATTRIBUTE_ARCHIVE", + "FILE_ATTRIBUTE_DIRECTORY", + "FILE_ATTRIBUTE_HIDDEN", + "FILE_ATTRIBUTE_NORMAL", + "FILE_ATTRIBUTE_READONLY", + "FILE_ATTRIBUTE_REPARSE_POINT", + "FILE_ATTRIBUTE_SYSTEM", + "FILE_BEGIN", + "FILE_CURRENT", + "FILE_END", + "FILE_FLAG_BACKUP_SEMANTICS", + "FILE_FLAG_OPEN_REPARSE_POINT", + "FILE_FLAG_OVERLAPPED", + "FILE_LIST_DIRECTORY", + "FILE_MAP_COPY", + "FILE_MAP_EXECUTE", + "FILE_MAP_READ", + "FILE_MAP_WRITE", + "FILE_NOTIFY_CHANGE_ATTRIBUTES", + "FILE_NOTIFY_CHANGE_CREATION", + "FILE_NOTIFY_CHANGE_DIR_NAME", + "FILE_NOTIFY_CHANGE_FILE_NAME", + "FILE_NOTIFY_CHANGE_LAST_ACCESS", + "FILE_NOTIFY_CHANGE_LAST_WRITE", + "FILE_NOTIFY_CHANGE_SIZE", + "FILE_SHARE_DELETE", + "FILE_SHARE_READ", + "FILE_SHARE_WRITE", + "FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", + "FILE_SKIP_SET_EVENT_ON_HANDLE", + "FILE_TYPE_CHAR", + "FILE_TYPE_DISK", + "FILE_TYPE_PIPE", + "FILE_TYPE_REMOTE", + "FILE_TYPE_UNKNOWN", + "FILE_WRITE_ATTRIBUTES", + "FLUSHO", + "FORMAT_MESSAGE_ALLOCATE_BUFFER", + "FORMAT_MESSAGE_ARGUMENT_ARRAY", + "FORMAT_MESSAGE_FROM_HMODULE", + "FORMAT_MESSAGE_FROM_STRING", + "FORMAT_MESSAGE_FROM_SYSTEM", + "FORMAT_MESSAGE_IGNORE_INSERTS", + "FORMAT_MESSAGE_MAX_WIDTH_MASK", + "FSCTL_GET_REPARSE_POINT", + "F_ADDFILESIGS", + "F_ADDSIGS", + "F_ALLOCATEALL", + "F_ALLOCATECONTIG", + "F_CANCEL", + "F_CHKCLEAN", + "F_CLOSEM", + "F_DUP2FD", + "F_DUP2FD_CLOEXEC", + "F_DUPFD", + "F_DUPFD_CLOEXEC", + "F_EXLCK", + "F_FINDSIGS", + "F_FLUSH_DATA", + "F_FREEZE_FS", + "F_FSCTL", + "F_FSDIRMASK", + "F_FSIN", + "F_FSINOUT", + "F_FSOUT", + "F_FSPRIV", + "F_FSVOID", + "F_FULLFSYNC", + "F_GETCODEDIR", + "F_GETFD", + "F_GETFL", + "F_GETLEASE", + "F_GETLK", + "F_GETLK64", + "F_GETLKPID", + "F_GETNOSIGPIPE", + "F_GETOWN", + "F_GETOWN_EX", + "F_GETPATH", + "F_GETPATH_MTMINFO", + "F_GETPIPE_SZ", + "F_GETPROTECTIONCLASS", + "F_GETPROTECTIONLEVEL", + "F_GETSIG", + "F_GLOBAL_NOCACHE", + "F_LOCK", + "F_LOG2PHYS", + "F_LOG2PHYS_EXT", + "F_MARKDEPENDENCY", + "F_MAXFD", + "F_NOCACHE", + "F_NODIRECT", + "F_NOTIFY", + "F_OGETLK", + "F_OK", + "F_OSETLK", + "F_OSETLKW", + "F_PARAM_MASK", + "F_PARAM_MAX", + "F_PATHPKG_CHECK", + "F_PEOFPOSMODE", + "F_PREALLOCATE", + "F_RDADVISE", + "F_RDAHEAD", + "F_RDLCK", + "F_READAHEAD", + "F_READBOOTSTRAP", + "F_SETBACKINGSTORE", + "F_SETFD", + "F_SETFL", + "F_SETLEASE", + "F_SETLK", + "F_SETLK64", + "F_SETLKW", + "F_SETLKW64", + "F_SETLKWTIMEOUT", + "F_SETLK_REMOTE", + "F_SETNOSIGPIPE", + "F_SETOWN", + "F_SETOWN_EX", + "F_SETPIPE_SZ", + "F_SETPROTECTIONCLASS", + "F_SETSIG", + "F_SETSIZE", + "F_SHLCK", + "F_SINGLE_WRITER", + "F_TEST", + "F_THAW_FS", + "F_TLOCK", + "F_TRANSCODEKEY", + "F_ULOCK", + "F_UNLCK", + "F_UNLCKSYS", + "F_VOLPOSMODE", + "F_WRITEBOOTSTRAP", + "F_WRLCK", + "Faccessat", + "Fallocate", + "Fbootstraptransfer_t", + "Fchdir", + "Fchflags", + "Fchmod", + "Fchmodat", + "Fchown", + "Fchownat", + "FcntlFlock", + "FdSet", + "Fdatasync", + "FileNotifyInformation", + "Filetime", + "FindClose", + "FindFirstFile", + "FindNextFile", + "Flock", + "Flock_t", + "FlushBpf", + "FlushFileBuffers", + "FlushViewOfFile", + "ForkExec", + "ForkLock", + "FormatMessage", + "Fpathconf", + "FreeAddrInfoW", + "FreeEnvironmentStrings", + "FreeLibrary", + "Fsid", + "Fstat", + "Fstatat", + "Fstatfs", + "Fstore_t", + "Fsync", + "Ftruncate", + "FullPath", + "Futimes", + "Futimesat", + "GENERIC_ALL", + "GENERIC_EXECUTE", + "GENERIC_READ", + "GENERIC_WRITE", + "GUID", + "GetAcceptExSockaddrs", + "GetAdaptersInfo", + "GetAddrInfoW", + "GetCommandLine", + "GetComputerName", + "GetConsoleMode", + "GetCurrentDirectory", + "GetCurrentProcess", + "GetEnvironmentStrings", + "GetEnvironmentVariable", + "GetExitCodeProcess", + "GetFileAttributes", + "GetFileAttributesEx", + "GetFileExInfoStandard", + "GetFileExMaxInfoLevel", + "GetFileInformationByHandle", + "GetFileType", + "GetFullPathName", + "GetHostByName", + "GetIfEntry", + "GetLastError", + "GetLengthSid", + "GetLongPathName", + "GetProcAddress", + "GetProcessTimes", + "GetProtoByName", + "GetQueuedCompletionStatus", + "GetServByName", + "GetShortPathName", + "GetStartupInfo", + "GetStdHandle", + "GetSystemTimeAsFileTime", + "GetTempPath", + "GetTimeZoneInformation", + "GetTokenInformation", + "GetUserNameEx", + "GetUserProfileDirectory", + "GetVersion", + "Getcwd", + "Getdents", + "Getdirentries", + "Getdtablesize", + "Getegid", + "Getenv", + "Geteuid", + "Getfsstat", + "Getgid", + "Getgroups", + "Getpagesize", + "Getpeername", + "Getpgid", + "Getpgrp", + "Getpid", + "Getppid", + "Getpriority", + "Getrlimit", + "Getrusage", + "Getsid", + "Getsockname", + "Getsockopt", + "GetsockoptByte", + "GetsockoptICMPv6Filter", + "GetsockoptIPMreq", + "GetsockoptIPMreqn", + "GetsockoptIPv6MTUInfo", + "GetsockoptIPv6Mreq", + "GetsockoptInet4Addr", + "GetsockoptInt", + "GetsockoptUcred", + "Gettid", + "Gettimeofday", + "Getuid", + "Getwd", + "Getxattr", + "HANDLE_FLAG_INHERIT", + "HKEY_CLASSES_ROOT", + "HKEY_CURRENT_CONFIG", + "HKEY_CURRENT_USER", + "HKEY_DYN_DATA", + "HKEY_LOCAL_MACHINE", + "HKEY_PERFORMANCE_DATA", + "HKEY_USERS", + "HUPCL", + "Handle", + "Hostent", + "ICANON", + "ICMP6_FILTER", + "ICMPV6_FILTER", + "ICMPv6Filter", + "ICRNL", + "IEXTEN", + "IFAN_ARRIVAL", + "IFAN_DEPARTURE", + "IFA_ADDRESS", + "IFA_ANYCAST", + "IFA_BROADCAST", + "IFA_CACHEINFO", + "IFA_F_DADFAILED", + "IFA_F_DEPRECATED", + "IFA_F_HOMEADDRESS", + "IFA_F_NODAD", + "IFA_F_OPTIMISTIC", + "IFA_F_PERMANENT", + "IFA_F_SECONDARY", + "IFA_F_TEMPORARY", + "IFA_F_TENTATIVE", + "IFA_LABEL", + "IFA_LOCAL", + "IFA_MAX", + "IFA_MULTICAST", + "IFA_ROUTE", + "IFA_UNSPEC", + "IFF_ALLMULTI", + "IFF_ALTPHYS", + "IFF_AUTOMEDIA", + "IFF_BROADCAST", + "IFF_CANTCHANGE", + "IFF_CANTCONFIG", + "IFF_DEBUG", + "IFF_DRV_OACTIVE", + "IFF_DRV_RUNNING", + "IFF_DYING", + "IFF_DYNAMIC", + "IFF_LINK0", + "IFF_LINK1", + "IFF_LINK2", + "IFF_LOOPBACK", + "IFF_MASTER", + "IFF_MONITOR", + "IFF_MULTICAST", + "IFF_NOARP", + "IFF_NOTRAILERS", + "IFF_NO_PI", + "IFF_OACTIVE", + "IFF_ONE_QUEUE", + "IFF_POINTOPOINT", + "IFF_POINTTOPOINT", + "IFF_PORTSEL", + "IFF_PPROMISC", + "IFF_PROMISC", + "IFF_RENAMING", + "IFF_RUNNING", + "IFF_SIMPLEX", + "IFF_SLAVE", + "IFF_SMART", + "IFF_STATICARP", + "IFF_TAP", + "IFF_TUN", + "IFF_TUN_EXCL", + "IFF_UP", + "IFF_VNET_HDR", + "IFLA_ADDRESS", + "IFLA_BROADCAST", + "IFLA_COST", + "IFLA_IFALIAS", + "IFLA_IFNAME", + "IFLA_LINK", + "IFLA_LINKINFO", + "IFLA_LINKMODE", + "IFLA_MAP", + "IFLA_MASTER", + "IFLA_MAX", + "IFLA_MTU", + "IFLA_NET_NS_PID", + "IFLA_OPERSTATE", + "IFLA_PRIORITY", + "IFLA_PROTINFO", + "IFLA_QDISC", + "IFLA_STATS", + "IFLA_TXQLEN", + "IFLA_UNSPEC", + "IFLA_WEIGHT", + "IFLA_WIRELESS", + "IFNAMSIZ", + "IFT_1822", + "IFT_A12MPPSWITCH", + "IFT_AAL2", + "IFT_AAL5", + "IFT_ADSL", + "IFT_AFLANE8023", + "IFT_AFLANE8025", + "IFT_ARAP", + "IFT_ARCNET", + "IFT_ARCNETPLUS", + "IFT_ASYNC", + "IFT_ATM", + "IFT_ATMDXI", + "IFT_ATMFUNI", + "IFT_ATMIMA", + "IFT_ATMLOGICAL", + "IFT_ATMRADIO", + "IFT_ATMSUBINTERFACE", + "IFT_ATMVCIENDPT", + "IFT_ATMVIRTUAL", + "IFT_BGPPOLICYACCOUNTING", + "IFT_BLUETOOTH", + "IFT_BRIDGE", + "IFT_BSC", + "IFT_CARP", + "IFT_CCTEMUL", + "IFT_CELLULAR", + "IFT_CEPT", + "IFT_CES", + "IFT_CHANNEL", + "IFT_CNR", + "IFT_COFFEE", + "IFT_COMPOSITELINK", + "IFT_DCN", + "IFT_DIGITALPOWERLINE", + "IFT_DIGITALWRAPPEROVERHEADCHANNEL", + "IFT_DLSW", + "IFT_DOCSCABLEDOWNSTREAM", + "IFT_DOCSCABLEMACLAYER", + "IFT_DOCSCABLEUPSTREAM", + "IFT_DOCSCABLEUPSTREAMCHANNEL", + "IFT_DS0", + "IFT_DS0BUNDLE", + "IFT_DS1FDL", + "IFT_DS3", + "IFT_DTM", + "IFT_DUMMY", + "IFT_DVBASILN", + "IFT_DVBASIOUT", + "IFT_DVBRCCDOWNSTREAM", + "IFT_DVBRCCMACLAYER", + "IFT_DVBRCCUPSTREAM", + "IFT_ECONET", + "IFT_ENC", + "IFT_EON", + "IFT_EPLRS", + "IFT_ESCON", + "IFT_ETHER", + "IFT_FAITH", + "IFT_FAST", + "IFT_FASTETHER", + "IFT_FASTETHERFX", + "IFT_FDDI", + "IFT_FIBRECHANNEL", + "IFT_FRAMERELAYINTERCONNECT", + "IFT_FRAMERELAYMPI", + "IFT_FRDLCIENDPT", + "IFT_FRELAY", + "IFT_FRELAYDCE", + "IFT_FRF16MFRBUNDLE", + "IFT_FRFORWARD", + "IFT_G703AT2MB", + "IFT_G703AT64K", + "IFT_GIF", + "IFT_GIGABITETHERNET", + "IFT_GR303IDT", + "IFT_GR303RDT", + "IFT_H323GATEKEEPER", + "IFT_H323PROXY", + "IFT_HDH1822", + "IFT_HDLC", + "IFT_HDSL2", + "IFT_HIPERLAN2", + "IFT_HIPPI", + "IFT_HIPPIINTERFACE", + "IFT_HOSTPAD", + "IFT_HSSI", + "IFT_HY", + "IFT_IBM370PARCHAN", + "IFT_IDSL", + "IFT_IEEE1394", + "IFT_IEEE80211", + "IFT_IEEE80212", + "IFT_IEEE8023ADLAG", + "IFT_IFGSN", + "IFT_IMT", + "IFT_INFINIBAND", + "IFT_INTERLEAVE", + "IFT_IP", + "IFT_IPFORWARD", + "IFT_IPOVERATM", + "IFT_IPOVERCDLC", + "IFT_IPOVERCLAW", + "IFT_IPSWITCH", + "IFT_IPXIP", + "IFT_ISDN", + "IFT_ISDNBASIC", + "IFT_ISDNPRIMARY", + "IFT_ISDNS", + "IFT_ISDNU", + "IFT_ISO88022LLC", + "IFT_ISO88023", + "IFT_ISO88024", + "IFT_ISO88025", + "IFT_ISO88025CRFPINT", + "IFT_ISO88025DTR", + "IFT_ISO88025FIBER", + "IFT_ISO88026", + "IFT_ISUP", + "IFT_L2VLAN", + "IFT_L3IPVLAN", + "IFT_L3IPXVLAN", + "IFT_LAPB", + "IFT_LAPD", + "IFT_LAPF", + "IFT_LINEGROUP", + "IFT_LOCALTALK", + "IFT_LOOP", + "IFT_MEDIAMAILOVERIP", + "IFT_MFSIGLINK", + "IFT_MIOX25", + "IFT_MODEM", + "IFT_MPC", + "IFT_MPLS", + "IFT_MPLSTUNNEL", + "IFT_MSDSL", + "IFT_MVL", + "IFT_MYRINET", + "IFT_NFAS", + "IFT_NSIP", + "IFT_OPTICALCHANNEL", + "IFT_OPTICALTRANSPORT", + "IFT_OTHER", + "IFT_P10", + "IFT_P80", + "IFT_PARA", + "IFT_PDP", + "IFT_PFLOG", + "IFT_PFLOW", + "IFT_PFSYNC", + "IFT_PLC", + "IFT_PON155", + "IFT_PON622", + "IFT_POS", + "IFT_PPP", + "IFT_PPPMULTILINKBUNDLE", + "IFT_PROPATM", + "IFT_PROPBWAP2MP", + "IFT_PROPCNLS", + "IFT_PROPDOCSWIRELESSDOWNSTREAM", + "IFT_PROPDOCSWIRELESSMACLAYER", + "IFT_PROPDOCSWIRELESSUPSTREAM", + "IFT_PROPMUX", + "IFT_PROPVIRTUAL", + "IFT_PROPWIRELESSP2P", + "IFT_PTPSERIAL", + "IFT_PVC", + "IFT_Q2931", + "IFT_QLLC", + "IFT_RADIOMAC", + "IFT_RADSL", + "IFT_REACHDSL", + "IFT_RFC1483", + "IFT_RS232", + "IFT_RSRB", + "IFT_SDLC", + "IFT_SDSL", + "IFT_SHDSL", + "IFT_SIP", + "IFT_SIPSIG", + "IFT_SIPTG", + "IFT_SLIP", + "IFT_SMDSDXI", + "IFT_SMDSICIP", + "IFT_SONET", + "IFT_SONETOVERHEADCHANNEL", + "IFT_SONETPATH", + "IFT_SONETVT", + "IFT_SRP", + "IFT_SS7SIGLINK", + "IFT_STACKTOSTACK", + "IFT_STARLAN", + "IFT_STF", + "IFT_T1", + "IFT_TDLC", + "IFT_TELINK", + "IFT_TERMPAD", + "IFT_TR008", + "IFT_TRANSPHDLC", + "IFT_TUNNEL", + "IFT_ULTRA", + "IFT_USB", + "IFT_V11", + "IFT_V35", + "IFT_V36", + "IFT_V37", + "IFT_VDSL", + "IFT_VIRTUALIPADDRESS", + "IFT_VIRTUALTG", + "IFT_VOICEDID", + "IFT_VOICEEM", + "IFT_VOICEEMFGD", + "IFT_VOICEENCAP", + "IFT_VOICEFGDEANA", + "IFT_VOICEFXO", + "IFT_VOICEFXS", + "IFT_VOICEOVERATM", + "IFT_VOICEOVERCABLE", + "IFT_VOICEOVERFRAMERELAY", + "IFT_VOICEOVERIP", + "IFT_X213", + "IFT_X25", + "IFT_X25DDN", + "IFT_X25HUNTGROUP", + "IFT_X25MLP", + "IFT_X25PLE", + "IFT_XETHER", + "IGNBRK", + "IGNCR", + "IGNORE", + "IGNPAR", + "IMAXBEL", + "INFINITE", + "INLCR", + "INPCK", + "INVALID_FILE_ATTRIBUTES", + "IN_ACCESS", + "IN_ALL_EVENTS", + "IN_ATTRIB", + "IN_CLASSA_HOST", + "IN_CLASSA_MAX", + "IN_CLASSA_NET", + "IN_CLASSA_NSHIFT", + "IN_CLASSB_HOST", + "IN_CLASSB_MAX", + "IN_CLASSB_NET", + "IN_CLASSB_NSHIFT", + "IN_CLASSC_HOST", + "IN_CLASSC_NET", + "IN_CLASSC_NSHIFT", + "IN_CLASSD_HOST", + "IN_CLASSD_NET", + "IN_CLASSD_NSHIFT", + "IN_CLOEXEC", + "IN_CLOSE", + "IN_CLOSE_NOWRITE", + "IN_CLOSE_WRITE", + "IN_CREATE", + "IN_DELETE", + "IN_DELETE_SELF", + "IN_DONT_FOLLOW", + "IN_EXCL_UNLINK", + "IN_IGNORED", + "IN_ISDIR", + "IN_LINKLOCALNETNUM", + "IN_LOOPBACKNET", + "IN_MASK_ADD", + "IN_MODIFY", + "IN_MOVE", + "IN_MOVED_FROM", + "IN_MOVED_TO", + "IN_MOVE_SELF", + "IN_NONBLOCK", + "IN_ONESHOT", + "IN_ONLYDIR", + "IN_OPEN", + "IN_Q_OVERFLOW", + "IN_RFC3021_HOST", + "IN_RFC3021_MASK", + "IN_RFC3021_NET", + "IN_RFC3021_NSHIFT", + "IN_UNMOUNT", + "IOC_IN", + "IOC_INOUT", + "IOC_OUT", + "IOC_VENDOR", + "IOC_WS2", + "IO_REPARSE_TAG_SYMLINK", + "IPMreq", + "IPMreqn", + "IPPROTO_3PC", + "IPPROTO_ADFS", + "IPPROTO_AH", + "IPPROTO_AHIP", + "IPPROTO_APES", + "IPPROTO_ARGUS", + "IPPROTO_AX25", + "IPPROTO_BHA", + "IPPROTO_BLT", + "IPPROTO_BRSATMON", + "IPPROTO_CARP", + "IPPROTO_CFTP", + "IPPROTO_CHAOS", + "IPPROTO_CMTP", + "IPPROTO_COMP", + "IPPROTO_CPHB", + "IPPROTO_CPNX", + "IPPROTO_DCCP", + "IPPROTO_DDP", + "IPPROTO_DGP", + "IPPROTO_DIVERT", + "IPPROTO_DIVERT_INIT", + "IPPROTO_DIVERT_RESP", + "IPPROTO_DONE", + "IPPROTO_DSTOPTS", + "IPPROTO_EGP", + "IPPROTO_EMCON", + "IPPROTO_ENCAP", + "IPPROTO_EON", + "IPPROTO_ESP", + "IPPROTO_ETHERIP", + "IPPROTO_FRAGMENT", + "IPPROTO_GGP", + "IPPROTO_GMTP", + "IPPROTO_GRE", + "IPPROTO_HELLO", + "IPPROTO_HMP", + "IPPROTO_HOPOPTS", + "IPPROTO_ICMP", + "IPPROTO_ICMPV6", + "IPPROTO_IDP", + "IPPROTO_IDPR", + "IPPROTO_IDRP", + "IPPROTO_IGMP", + "IPPROTO_IGP", + "IPPROTO_IGRP", + "IPPROTO_IL", + "IPPROTO_INLSP", + "IPPROTO_INP", + "IPPROTO_IP", + "IPPROTO_IPCOMP", + "IPPROTO_IPCV", + "IPPROTO_IPEIP", + "IPPROTO_IPIP", + "IPPROTO_IPPC", + "IPPROTO_IPV4", + "IPPROTO_IPV6", + "IPPROTO_IPV6_ICMP", + "IPPROTO_IRTP", + "IPPROTO_KRYPTOLAN", + "IPPROTO_LARP", + "IPPROTO_LEAF1", + "IPPROTO_LEAF2", + "IPPROTO_MAX", + "IPPROTO_MAXID", + "IPPROTO_MEAS", + "IPPROTO_MH", + "IPPROTO_MHRP", + "IPPROTO_MICP", + "IPPROTO_MOBILE", + "IPPROTO_MPLS", + "IPPROTO_MTP", + "IPPROTO_MUX", + "IPPROTO_ND", + "IPPROTO_NHRP", + "IPPROTO_NONE", + "IPPROTO_NSP", + "IPPROTO_NVPII", + "IPPROTO_OLD_DIVERT", + "IPPROTO_OSPFIGP", + "IPPROTO_PFSYNC", + "IPPROTO_PGM", + "IPPROTO_PIGP", + "IPPROTO_PIM", + "IPPROTO_PRM", + "IPPROTO_PUP", + "IPPROTO_PVP", + "IPPROTO_RAW", + "IPPROTO_RCCMON", + "IPPROTO_RDP", + "IPPROTO_ROUTING", + "IPPROTO_RSVP", + "IPPROTO_RVD", + "IPPROTO_SATEXPAK", + "IPPROTO_SATMON", + "IPPROTO_SCCSP", + "IPPROTO_SCTP", + "IPPROTO_SDRP", + "IPPROTO_SEND", + "IPPROTO_SEP", + "IPPROTO_SKIP", + "IPPROTO_SPACER", + "IPPROTO_SRPC", + "IPPROTO_ST", + "IPPROTO_SVMTP", + "IPPROTO_SWIPE", + "IPPROTO_TCF", + "IPPROTO_TCP", + "IPPROTO_TLSP", + "IPPROTO_TP", + "IPPROTO_TPXX", + "IPPROTO_TRUNK1", + "IPPROTO_TRUNK2", + "IPPROTO_TTP", + "IPPROTO_UDP", + "IPPROTO_UDPLITE", + "IPPROTO_VINES", + "IPPROTO_VISA", + "IPPROTO_VMTP", + "IPPROTO_VRRP", + "IPPROTO_WBEXPAK", + "IPPROTO_WBMON", + "IPPROTO_WSN", + "IPPROTO_XNET", + "IPPROTO_XTP", + "IPV6_2292DSTOPTS", + "IPV6_2292HOPLIMIT", + "IPV6_2292HOPOPTS", + "IPV6_2292NEXTHOP", + "IPV6_2292PKTINFO", + "IPV6_2292PKTOPTIONS", + "IPV6_2292RTHDR", + "IPV6_ADDRFORM", + "IPV6_ADD_MEMBERSHIP", + "IPV6_AUTHHDR", + "IPV6_AUTH_LEVEL", + "IPV6_AUTOFLOWLABEL", + "IPV6_BINDANY", + "IPV6_BINDV6ONLY", + "IPV6_BOUND_IF", + "IPV6_CHECKSUM", + "IPV6_DEFAULT_MULTICAST_HOPS", + "IPV6_DEFAULT_MULTICAST_LOOP", + "IPV6_DEFHLIM", + "IPV6_DONTFRAG", + "IPV6_DROP_MEMBERSHIP", + "IPV6_DSTOPTS", + "IPV6_ESP_NETWORK_LEVEL", + "IPV6_ESP_TRANS_LEVEL", + "IPV6_FAITH", + "IPV6_FLOWINFO_MASK", + "IPV6_FLOWLABEL_MASK", + "IPV6_FRAGTTL", + "IPV6_FW_ADD", + "IPV6_FW_DEL", + "IPV6_FW_FLUSH", + "IPV6_FW_GET", + "IPV6_FW_ZERO", + "IPV6_HLIMDEC", + "IPV6_HOPLIMIT", + "IPV6_HOPOPTS", + "IPV6_IPCOMP_LEVEL", + "IPV6_IPSEC_POLICY", + "IPV6_JOIN_ANYCAST", + "IPV6_JOIN_GROUP", + "IPV6_LEAVE_ANYCAST", + "IPV6_LEAVE_GROUP", + "IPV6_MAXHLIM", + "IPV6_MAXOPTHDR", + "IPV6_MAXPACKET", + "IPV6_MAX_GROUP_SRC_FILTER", + "IPV6_MAX_MEMBERSHIPS", + "IPV6_MAX_SOCK_SRC_FILTER", + "IPV6_MIN_MEMBERSHIPS", + "IPV6_MMTU", + "IPV6_MSFILTER", + "IPV6_MTU", + "IPV6_MTU_DISCOVER", + "IPV6_MULTICAST_HOPS", + "IPV6_MULTICAST_IF", + "IPV6_MULTICAST_LOOP", + "IPV6_NEXTHOP", + "IPV6_OPTIONS", + "IPV6_PATHMTU", + "IPV6_PIPEX", + "IPV6_PKTINFO", + "IPV6_PMTUDISC_DO", + "IPV6_PMTUDISC_DONT", + "IPV6_PMTUDISC_PROBE", + "IPV6_PMTUDISC_WANT", + "IPV6_PORTRANGE", + "IPV6_PORTRANGE_DEFAULT", + "IPV6_PORTRANGE_HIGH", + "IPV6_PORTRANGE_LOW", + "IPV6_PREFER_TEMPADDR", + "IPV6_RECVDSTOPTS", + "IPV6_RECVDSTPORT", + "IPV6_RECVERR", + "IPV6_RECVHOPLIMIT", + "IPV6_RECVHOPOPTS", + "IPV6_RECVPATHMTU", + "IPV6_RECVPKTINFO", + "IPV6_RECVRTHDR", + "IPV6_RECVTCLASS", + "IPV6_ROUTER_ALERT", + "IPV6_RTABLE", + "IPV6_RTHDR", + "IPV6_RTHDRDSTOPTS", + "IPV6_RTHDR_LOOSE", + "IPV6_RTHDR_STRICT", + "IPV6_RTHDR_TYPE_0", + "IPV6_RXDSTOPTS", + "IPV6_RXHOPOPTS", + "IPV6_SOCKOPT_RESERVED1", + "IPV6_TCLASS", + "IPV6_UNICAST_HOPS", + "IPV6_USE_MIN_MTU", + "IPV6_V6ONLY", + "IPV6_VERSION", + "IPV6_VERSION_MASK", + "IPV6_XFRM_POLICY", + "IP_ADD_MEMBERSHIP", + "IP_ADD_SOURCE_MEMBERSHIP", + "IP_AUTH_LEVEL", + "IP_BINDANY", + "IP_BLOCK_SOURCE", + "IP_BOUND_IF", + "IP_DEFAULT_MULTICAST_LOOP", + "IP_DEFAULT_MULTICAST_TTL", + "IP_DF", + "IP_DIVERTFL", + "IP_DONTFRAG", + "IP_DROP_MEMBERSHIP", + "IP_DROP_SOURCE_MEMBERSHIP", + "IP_DUMMYNET3", + "IP_DUMMYNET_CONFIGURE", + "IP_DUMMYNET_DEL", + "IP_DUMMYNET_FLUSH", + "IP_DUMMYNET_GET", + "IP_EF", + "IP_ERRORMTU", + "IP_ESP_NETWORK_LEVEL", + "IP_ESP_TRANS_LEVEL", + "IP_FAITH", + "IP_FREEBIND", + "IP_FW3", + "IP_FW_ADD", + "IP_FW_DEL", + "IP_FW_FLUSH", + "IP_FW_GET", + "IP_FW_NAT_CFG", + "IP_FW_NAT_DEL", + "IP_FW_NAT_GET_CONFIG", + "IP_FW_NAT_GET_LOG", + "IP_FW_RESETLOG", + "IP_FW_TABLE_ADD", + "IP_FW_TABLE_DEL", + "IP_FW_TABLE_FLUSH", + "IP_FW_TABLE_GETSIZE", + "IP_FW_TABLE_LIST", + "IP_FW_ZERO", + "IP_HDRINCL", + "IP_IPCOMP_LEVEL", + "IP_IPSECFLOWINFO", + "IP_IPSEC_LOCAL_AUTH", + "IP_IPSEC_LOCAL_CRED", + "IP_IPSEC_LOCAL_ID", + "IP_IPSEC_POLICY", + "IP_IPSEC_REMOTE_AUTH", + "IP_IPSEC_REMOTE_CRED", + "IP_IPSEC_REMOTE_ID", + "IP_MAXPACKET", + "IP_MAX_GROUP_SRC_FILTER", + "IP_MAX_MEMBERSHIPS", + "IP_MAX_SOCK_MUTE_FILTER", + "IP_MAX_SOCK_SRC_FILTER", + "IP_MAX_SOURCE_FILTER", + "IP_MF", + "IP_MINFRAGSIZE", + "IP_MINTTL", + "IP_MIN_MEMBERSHIPS", + "IP_MSFILTER", + "IP_MSS", + "IP_MTU", + "IP_MTU_DISCOVER", + "IP_MULTICAST_IF", + "IP_MULTICAST_IFINDEX", + "IP_MULTICAST_LOOP", + "IP_MULTICAST_TTL", + "IP_MULTICAST_VIF", + "IP_NAT__XXX", + "IP_OFFMASK", + "IP_OLD_FW_ADD", + "IP_OLD_FW_DEL", + "IP_OLD_FW_FLUSH", + "IP_OLD_FW_GET", + "IP_OLD_FW_RESETLOG", + "IP_OLD_FW_ZERO", + "IP_ONESBCAST", + "IP_OPTIONS", + "IP_ORIGDSTADDR", + "IP_PASSSEC", + "IP_PIPEX", + "IP_PKTINFO", + "IP_PKTOPTIONS", + "IP_PMTUDISC", + "IP_PMTUDISC_DO", + "IP_PMTUDISC_DONT", + "IP_PMTUDISC_PROBE", + "IP_PMTUDISC_WANT", + "IP_PORTRANGE", + "IP_PORTRANGE_DEFAULT", + "IP_PORTRANGE_HIGH", + "IP_PORTRANGE_LOW", + "IP_RECVDSTADDR", + "IP_RECVDSTPORT", + "IP_RECVERR", + "IP_RECVIF", + "IP_RECVOPTS", + "IP_RECVORIGDSTADDR", + "IP_RECVPKTINFO", + "IP_RECVRETOPTS", + "IP_RECVRTABLE", + "IP_RECVTOS", + "IP_RECVTTL", + "IP_RETOPTS", + "IP_RF", + "IP_ROUTER_ALERT", + "IP_RSVP_OFF", + "IP_RSVP_ON", + "IP_RSVP_VIF_OFF", + "IP_RSVP_VIF_ON", + "IP_RTABLE", + "IP_SENDSRCADDR", + "IP_STRIPHDR", + "IP_TOS", + "IP_TRAFFIC_MGT_BACKGROUND", + "IP_TRANSPARENT", + "IP_TTL", + "IP_UNBLOCK_SOURCE", + "IP_XFRM_POLICY", + "IPv6MTUInfo", + "IPv6Mreq", + "ISIG", + "ISTRIP", + "IUCLC", + "IUTF8", + "IXANY", + "IXOFF", + "IXON", + "IfAddrmsg", + "IfAnnounceMsghdr", + "IfData", + "IfInfomsg", + "IfMsghdr", + "IfaMsghdr", + "IfmaMsghdr", + "IfmaMsghdr2", + "ImplementsGetwd", + "Inet4Pktinfo", + "Inet6Pktinfo", + "InotifyAddWatch", + "InotifyEvent", + "InotifyInit", + "InotifyInit1", + "InotifyRmWatch", + "InterfaceAddrMessage", + "InterfaceAnnounceMessage", + "InterfaceInfo", + "InterfaceMessage", + "InterfaceMulticastAddrMessage", + "InvalidHandle", + "Ioperm", + "Iopl", + "Iovec", + "IpAdapterInfo", + "IpAddrString", + "IpAddressString", + "IpMaskString", + "Issetugid", + "KEY_ALL_ACCESS", + "KEY_CREATE_LINK", + "KEY_CREATE_SUB_KEY", + "KEY_ENUMERATE_SUB_KEYS", + "KEY_EXECUTE", + "KEY_NOTIFY", + "KEY_QUERY_VALUE", + "KEY_READ", + "KEY_SET_VALUE", + "KEY_WOW64_32KEY", + "KEY_WOW64_64KEY", + "KEY_WRITE", + "Kevent", + "Kevent_t", + "Kill", + "Klogctl", + "Kqueue", + "LANG_ENGLISH", + "LAYERED_PROTOCOL", + "LCNT_OVERLOAD_FLUSH", + "LINUX_REBOOT_CMD_CAD_OFF", + "LINUX_REBOOT_CMD_CAD_ON", + "LINUX_REBOOT_CMD_HALT", + "LINUX_REBOOT_CMD_KEXEC", + "LINUX_REBOOT_CMD_POWER_OFF", + "LINUX_REBOOT_CMD_RESTART", + "LINUX_REBOOT_CMD_RESTART2", + "LINUX_REBOOT_CMD_SW_SUSPEND", + "LINUX_REBOOT_MAGIC1", + "LINUX_REBOOT_MAGIC2", + "LOCK_EX", + "LOCK_NB", + "LOCK_SH", + "LOCK_UN", + "LazyDLL", + "LazyProc", + "Lchown", + "Linger", + "Link", + "Listen", + "Listxattr", + "LoadCancelIoEx", + "LoadConnectEx", + "LoadCreateSymbolicLink", + "LoadDLL", + "LoadGetAddrInfo", + "LoadLibrary", + "LoadSetFileCompletionNotificationModes", + "LocalFree", + "Log2phys_t", + "LookupAccountName", + "LookupAccountSid", + "LookupSID", + "LsfJump", + "LsfSocket", + "LsfStmt", + "Lstat", + "MADV_AUTOSYNC", + "MADV_CAN_REUSE", + "MADV_CORE", + "MADV_DOFORK", + "MADV_DONTFORK", + "MADV_DONTNEED", + "MADV_FREE", + "MADV_FREE_REUSABLE", + "MADV_FREE_REUSE", + "MADV_HUGEPAGE", + "MADV_HWPOISON", + "MADV_MERGEABLE", + "MADV_NOCORE", + "MADV_NOHUGEPAGE", + "MADV_NORMAL", + "MADV_NOSYNC", + "MADV_PROTECT", + "MADV_RANDOM", + "MADV_REMOVE", + "MADV_SEQUENTIAL", + "MADV_SPACEAVAIL", + "MADV_UNMERGEABLE", + "MADV_WILLNEED", + "MADV_ZERO_WIRED_PAGES", + "MAP_32BIT", + "MAP_ALIGNED_SUPER", + "MAP_ALIGNMENT_16MB", + "MAP_ALIGNMENT_1TB", + "MAP_ALIGNMENT_256TB", + "MAP_ALIGNMENT_4GB", + "MAP_ALIGNMENT_64KB", + "MAP_ALIGNMENT_64PB", + "MAP_ALIGNMENT_MASK", + "MAP_ALIGNMENT_SHIFT", + "MAP_ANON", + "MAP_ANONYMOUS", + "MAP_COPY", + "MAP_DENYWRITE", + "MAP_EXECUTABLE", + "MAP_FILE", + "MAP_FIXED", + "MAP_FLAGMASK", + "MAP_GROWSDOWN", + "MAP_HASSEMAPHORE", + "MAP_HUGETLB", + "MAP_INHERIT", + "MAP_INHERIT_COPY", + "MAP_INHERIT_DEFAULT", + "MAP_INHERIT_DONATE_COPY", + "MAP_INHERIT_NONE", + "MAP_INHERIT_SHARE", + "MAP_JIT", + "MAP_LOCKED", + "MAP_NOCACHE", + "MAP_NOCORE", + "MAP_NOEXTEND", + "MAP_NONBLOCK", + "MAP_NORESERVE", + "MAP_NOSYNC", + "MAP_POPULATE", + "MAP_PREFAULT_READ", + "MAP_PRIVATE", + "MAP_RENAME", + "MAP_RESERVED0080", + "MAP_RESERVED0100", + "MAP_SHARED", + "MAP_STACK", + "MAP_TRYFIXED", + "MAP_TYPE", + "MAP_WIRED", + "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", + "MAXLEN_IFDESCR", + "MAXLEN_PHYSADDR", + "MAX_ADAPTER_ADDRESS_LENGTH", + "MAX_ADAPTER_DESCRIPTION_LENGTH", + "MAX_ADAPTER_NAME_LENGTH", + "MAX_COMPUTERNAME_LENGTH", + "MAX_INTERFACE_NAME_LEN", + "MAX_LONG_PATH", + "MAX_PATH", + "MAX_PROTOCOL_CHAIN", + "MCL_CURRENT", + "MCL_FUTURE", + "MNT_DETACH", + "MNT_EXPIRE", + "MNT_FORCE", + "MSG_BCAST", + "MSG_CMSG_CLOEXEC", + "MSG_COMPAT", + "MSG_CONFIRM", + "MSG_CONTROLMBUF", + "MSG_CTRUNC", + "MSG_DONTROUTE", + "MSG_DONTWAIT", + "MSG_EOF", + "MSG_EOR", + "MSG_ERRQUEUE", + "MSG_FASTOPEN", + "MSG_FIN", + "MSG_FLUSH", + "MSG_HAVEMORE", + "MSG_HOLD", + "MSG_IOVUSRSPACE", + "MSG_LENUSRSPACE", + "MSG_MCAST", + "MSG_MORE", + "MSG_NAMEMBUF", + "MSG_NBIO", + "MSG_NEEDSA", + "MSG_NOSIGNAL", + "MSG_NOTIFICATION", + "MSG_OOB", + "MSG_PEEK", + "MSG_PROXY", + "MSG_RCVMORE", + "MSG_RST", + "MSG_SEND", + "MSG_SYN", + "MSG_TRUNC", + "MSG_TRYHARD", + "MSG_USERFLAGS", + "MSG_WAITALL", + "MSG_WAITFORONE", + "MSG_WAITSTREAM", + "MS_ACTIVE", + "MS_ASYNC", + "MS_BIND", + "MS_DEACTIVATE", + "MS_DIRSYNC", + "MS_INVALIDATE", + "MS_I_VERSION", + "MS_KERNMOUNT", + "MS_KILLPAGES", + "MS_MANDLOCK", + "MS_MGC_MSK", + "MS_MGC_VAL", + "MS_MOVE", + "MS_NOATIME", + "MS_NODEV", + "MS_NODIRATIME", + "MS_NOEXEC", + "MS_NOSUID", + "MS_NOUSER", + "MS_POSIXACL", + "MS_PRIVATE", + "MS_RDONLY", + "MS_REC", + "MS_RELATIME", + "MS_REMOUNT", + "MS_RMT_MASK", + "MS_SHARED", + "MS_SILENT", + "MS_SLAVE", + "MS_STRICTATIME", + "MS_SYNC", + "MS_SYNCHRONOUS", + "MS_UNBINDABLE", + "Madvise", + "MapViewOfFile", + "MaxTokenInfoClass", + "Mclpool", + "MibIfRow", + "Mkdir", + "Mkdirat", + "Mkfifo", + "Mknod", + "Mknodat", + "Mlock", + "Mlockall", + "Mmap", + "Mount", + "MoveFile", + "Mprotect", + "Msghdr", + "Munlock", + "Munlockall", + "Munmap", + "MustLoadDLL", + "NAME_MAX", + "NETLINK_ADD_MEMBERSHIP", + "NETLINK_AUDIT", + "NETLINK_BROADCAST_ERROR", + "NETLINK_CONNECTOR", + "NETLINK_DNRTMSG", + "NETLINK_DROP_MEMBERSHIP", + "NETLINK_ECRYPTFS", + "NETLINK_FIB_LOOKUP", + "NETLINK_FIREWALL", + "NETLINK_GENERIC", + "NETLINK_INET_DIAG", + "NETLINK_IP6_FW", + "NETLINK_ISCSI", + "NETLINK_KOBJECT_UEVENT", + "NETLINK_NETFILTER", + "NETLINK_NFLOG", + "NETLINK_NO_ENOBUFS", + "NETLINK_PKTINFO", + "NETLINK_RDMA", + "NETLINK_ROUTE", + "NETLINK_SCSITRANSPORT", + "NETLINK_SELINUX", + "NETLINK_UNUSED", + "NETLINK_USERSOCK", + "NETLINK_XFRM", + "NET_RT_DUMP", + "NET_RT_DUMP2", + "NET_RT_FLAGS", + "NET_RT_IFLIST", + "NET_RT_IFLIST2", + "NET_RT_IFLISTL", + "NET_RT_IFMALIST", + "NET_RT_MAXID", + "NET_RT_OIFLIST", + "NET_RT_OOIFLIST", + "NET_RT_STAT", + "NET_RT_STATS", + "NET_RT_TABLE", + "NET_RT_TRASH", + "NLA_ALIGNTO", + "NLA_F_NESTED", + "NLA_F_NET_BYTEORDER", + "NLA_HDRLEN", + "NLMSG_ALIGNTO", + "NLMSG_DONE", + "NLMSG_ERROR", + "NLMSG_HDRLEN", + "NLMSG_MIN_TYPE", + "NLMSG_NOOP", + "NLMSG_OVERRUN", + "NLM_F_ACK", + "NLM_F_APPEND", + "NLM_F_ATOMIC", + "NLM_F_CREATE", + "NLM_F_DUMP", + "NLM_F_ECHO", + "NLM_F_EXCL", + "NLM_F_MATCH", + "NLM_F_MULTI", + "NLM_F_REPLACE", + "NLM_F_REQUEST", + "NLM_F_ROOT", + "NOFLSH", + "NOTE_ABSOLUTE", + "NOTE_ATTRIB", + "NOTE_BACKGROUND", + "NOTE_CHILD", + "NOTE_CRITICAL", + "NOTE_DELETE", + "NOTE_EOF", + "NOTE_EXEC", + "NOTE_EXIT", + "NOTE_EXITSTATUS", + "NOTE_EXIT_CSERROR", + "NOTE_EXIT_DECRYPTFAIL", + "NOTE_EXIT_DETAIL", + "NOTE_EXIT_DETAIL_MASK", + "NOTE_EXIT_MEMORY", + "NOTE_EXIT_REPARENTED", + "NOTE_EXTEND", + "NOTE_FFAND", + "NOTE_FFCOPY", + "NOTE_FFCTRLMASK", + "NOTE_FFLAGSMASK", + "NOTE_FFNOP", + "NOTE_FFOR", + "NOTE_FORK", + "NOTE_LEEWAY", + "NOTE_LINK", + "NOTE_LOWAT", + "NOTE_NONE", + "NOTE_NSECONDS", + "NOTE_PCTRLMASK", + "NOTE_PDATAMASK", + "NOTE_REAP", + "NOTE_RENAME", + "NOTE_RESOURCEEND", + "NOTE_REVOKE", + "NOTE_SECONDS", + "NOTE_SIGNAL", + "NOTE_TRACK", + "NOTE_TRACKERR", + "NOTE_TRIGGER", + "NOTE_TRUNCATE", + "NOTE_USECONDS", + "NOTE_VM_ERROR", + "NOTE_VM_PRESSURE", + "NOTE_VM_PRESSURE_SUDDEN_TERMINATE", + "NOTE_VM_PRESSURE_TERMINATE", + "NOTE_WRITE", + "NameCanonical", + "NameCanonicalEx", + "NameDisplay", + "NameDnsDomain", + "NameFullyQualifiedDN", + "NameSamCompatible", + "NameServicePrincipal", + "NameUniqueId", + "NameUnknown", + "NameUserPrincipal", + "Nanosleep", + "NetApiBufferFree", + "NetGetJoinInformation", + "NetSetupDomainName", + "NetSetupUnjoined", + "NetSetupUnknownStatus", + "NetSetupWorkgroupName", + "NetUserGetInfo", + "NetlinkMessage", + "NetlinkRIB", + "NetlinkRouteAttr", + "NetlinkRouteRequest", + "NewCallback", + "NewCallbackCDecl", + "NewLazyDLL", + "NlAttr", + "NlMsgerr", + "NlMsghdr", + "NsecToFiletime", + "NsecToTimespec", + "NsecToTimeval", + "Ntohs", + "OCRNL", + "OFDEL", + "OFILL", + "OFIOGETBMAP", + "OID_PKIX_KP_SERVER_AUTH", + "OID_SERVER_GATED_CRYPTO", + "OID_SGC_NETSCAPE", + "OLCUC", + "ONLCR", + "ONLRET", + "ONOCR", + "ONOEOT", + "OPEN_ALWAYS", + "OPEN_EXISTING", + "OPOST", + "O_ACCMODE", + "O_ALERT", + "O_ALT_IO", + "O_APPEND", + "O_ASYNC", + "O_CLOEXEC", + "O_CREAT", + "O_DIRECT", + "O_DIRECTORY", + "O_DP_GETRAWENCRYPTED", + "O_DSYNC", + "O_EVTONLY", + "O_EXCL", + "O_EXEC", + "O_EXLOCK", + "O_FSYNC", + "O_LARGEFILE", + "O_NDELAY", + "O_NOATIME", + "O_NOCTTY", + "O_NOFOLLOW", + "O_NONBLOCK", + "O_NOSIGPIPE", + "O_POPUP", + "O_RDONLY", + "O_RDWR", + "O_RSYNC", + "O_SHLOCK", + "O_SYMLINK", + "O_SYNC", + "O_TRUNC", + "O_TTY_INIT", + "O_WRONLY", + "Open", + "OpenCurrentProcessToken", + "OpenProcess", + "OpenProcessToken", + "Openat", + "Overlapped", + "PACKET_ADD_MEMBERSHIP", + "PACKET_BROADCAST", + "PACKET_DROP_MEMBERSHIP", + "PACKET_FASTROUTE", + "PACKET_HOST", + "PACKET_LOOPBACK", + "PACKET_MR_ALLMULTI", + "PACKET_MR_MULTICAST", + "PACKET_MR_PROMISC", + "PACKET_MULTICAST", + "PACKET_OTHERHOST", + "PACKET_OUTGOING", + "PACKET_RECV_OUTPUT", + "PACKET_RX_RING", + "PACKET_STATISTICS", + "PAGE_EXECUTE_READ", + "PAGE_EXECUTE_READWRITE", + "PAGE_EXECUTE_WRITECOPY", + "PAGE_READONLY", + "PAGE_READWRITE", + "PAGE_WRITECOPY", + "PARENB", + "PARMRK", + "PARODD", + "PENDIN", + "PFL_HIDDEN", + "PFL_MATCHES_PROTOCOL_ZERO", + "PFL_MULTIPLE_PROTO_ENTRIES", + "PFL_NETWORKDIRECT_PROVIDER", + "PFL_RECOMMENDED_PROTO_ENTRY", + "PF_FLUSH", + "PKCS_7_ASN_ENCODING", + "PMC5_PIPELINE_FLUSH", + "PRIO_PGRP", + "PRIO_PROCESS", + "PRIO_USER", + "PRI_IOFLUSH", + "PROCESS_QUERY_INFORMATION", + "PROCESS_TERMINATE", + "PROT_EXEC", + "PROT_GROWSDOWN", + "PROT_GROWSUP", + "PROT_NONE", + "PROT_READ", + "PROT_WRITE", + "PROV_DH_SCHANNEL", + "PROV_DSS", + "PROV_DSS_DH", + "PROV_EC_ECDSA_FULL", + "PROV_EC_ECDSA_SIG", + "PROV_EC_ECNRA_FULL", + "PROV_EC_ECNRA_SIG", + "PROV_FORTEZZA", + "PROV_INTEL_SEC", + "PROV_MS_EXCHANGE", + "PROV_REPLACE_OWF", + "PROV_RNG", + "PROV_RSA_AES", + "PROV_RSA_FULL", + "PROV_RSA_SCHANNEL", + "PROV_RSA_SIG", + "PROV_SPYRUS_LYNKS", + "PROV_SSL", + "PR_CAPBSET_DROP", + "PR_CAPBSET_READ", + "PR_CLEAR_SECCOMP_FILTER", + "PR_ENDIAN_BIG", + "PR_ENDIAN_LITTLE", + "PR_ENDIAN_PPC_LITTLE", + "PR_FPEMU_NOPRINT", + "PR_FPEMU_SIGFPE", + "PR_FP_EXC_ASYNC", + "PR_FP_EXC_DISABLED", + "PR_FP_EXC_DIV", + "PR_FP_EXC_INV", + "PR_FP_EXC_NONRECOV", + "PR_FP_EXC_OVF", + "PR_FP_EXC_PRECISE", + "PR_FP_EXC_RES", + "PR_FP_EXC_SW_ENABLE", + "PR_FP_EXC_UND", + "PR_GET_DUMPABLE", + "PR_GET_ENDIAN", + "PR_GET_FPEMU", + "PR_GET_FPEXC", + "PR_GET_KEEPCAPS", + "PR_GET_NAME", + "PR_GET_PDEATHSIG", + "PR_GET_SECCOMP", + "PR_GET_SECCOMP_FILTER", + "PR_GET_SECUREBITS", + "PR_GET_TIMERSLACK", + "PR_GET_TIMING", + "PR_GET_TSC", + "PR_GET_UNALIGN", + "PR_MCE_KILL", + "PR_MCE_KILL_CLEAR", + "PR_MCE_KILL_DEFAULT", + "PR_MCE_KILL_EARLY", + "PR_MCE_KILL_GET", + "PR_MCE_KILL_LATE", + "PR_MCE_KILL_SET", + "PR_SECCOMP_FILTER_EVENT", + "PR_SECCOMP_FILTER_SYSCALL", + "PR_SET_DUMPABLE", + "PR_SET_ENDIAN", + "PR_SET_FPEMU", + "PR_SET_FPEXC", + "PR_SET_KEEPCAPS", + "PR_SET_NAME", + "PR_SET_PDEATHSIG", + "PR_SET_PTRACER", + "PR_SET_SECCOMP", + "PR_SET_SECCOMP_FILTER", + "PR_SET_SECUREBITS", + "PR_SET_TIMERSLACK", + "PR_SET_TIMING", + "PR_SET_TSC", + "PR_SET_UNALIGN", + "PR_TASK_PERF_EVENTS_DISABLE", + "PR_TASK_PERF_EVENTS_ENABLE", + "PR_TIMING_STATISTICAL", + "PR_TIMING_TIMESTAMP", + "PR_TSC_ENABLE", + "PR_TSC_SIGSEGV", + "PR_UNALIGN_NOPRINT", + "PR_UNALIGN_SIGBUS", + "PTRACE_ARCH_PRCTL", + "PTRACE_ATTACH", + "PTRACE_CONT", + "PTRACE_DETACH", + "PTRACE_EVENT_CLONE", + "PTRACE_EVENT_EXEC", + "PTRACE_EVENT_EXIT", + "PTRACE_EVENT_FORK", + "PTRACE_EVENT_VFORK", + "PTRACE_EVENT_VFORK_DONE", + "PTRACE_GETCRUNCHREGS", + "PTRACE_GETEVENTMSG", + "PTRACE_GETFPREGS", + "PTRACE_GETFPXREGS", + "PTRACE_GETHBPREGS", + "PTRACE_GETREGS", + "PTRACE_GETREGSET", + "PTRACE_GETSIGINFO", + "PTRACE_GETVFPREGS", + "PTRACE_GETWMMXREGS", + "PTRACE_GET_THREAD_AREA", + "PTRACE_KILL", + "PTRACE_OLDSETOPTIONS", + "PTRACE_O_MASK", + "PTRACE_O_TRACECLONE", + "PTRACE_O_TRACEEXEC", + "PTRACE_O_TRACEEXIT", + "PTRACE_O_TRACEFORK", + "PTRACE_O_TRACESYSGOOD", + "PTRACE_O_TRACEVFORK", + "PTRACE_O_TRACEVFORKDONE", + "PTRACE_PEEKDATA", + "PTRACE_PEEKTEXT", + "PTRACE_PEEKUSR", + "PTRACE_POKEDATA", + "PTRACE_POKETEXT", + "PTRACE_POKEUSR", + "PTRACE_SETCRUNCHREGS", + "PTRACE_SETFPREGS", + "PTRACE_SETFPXREGS", + "PTRACE_SETHBPREGS", + "PTRACE_SETOPTIONS", + "PTRACE_SETREGS", + "PTRACE_SETREGSET", + "PTRACE_SETSIGINFO", + "PTRACE_SETVFPREGS", + "PTRACE_SETWMMXREGS", + "PTRACE_SET_SYSCALL", + "PTRACE_SET_THREAD_AREA", + "PTRACE_SINGLEBLOCK", + "PTRACE_SINGLESTEP", + "PTRACE_SYSCALL", + "PTRACE_SYSEMU", + "PTRACE_SYSEMU_SINGLESTEP", + "PTRACE_TRACEME", + "PT_ATTACH", + "PT_ATTACHEXC", + "PT_CONTINUE", + "PT_DATA_ADDR", + "PT_DENY_ATTACH", + "PT_DETACH", + "PT_FIRSTMACH", + "PT_FORCEQUOTA", + "PT_KILL", + "PT_MASK", + "PT_READ_D", + "PT_READ_I", + "PT_READ_U", + "PT_SIGEXC", + "PT_STEP", + "PT_TEXT_ADDR", + "PT_TEXT_END_ADDR", + "PT_THUPDATE", + "PT_TRACE_ME", + "PT_WRITE_D", + "PT_WRITE_I", + "PT_WRITE_U", + "ParseDirent", + "ParseNetlinkMessage", + "ParseNetlinkRouteAttr", + "ParseRoutingMessage", + "ParseRoutingSockaddr", + "ParseSocketControlMessage", + "ParseUnixCredentials", + "ParseUnixRights", + "PathMax", + "Pathconf", + "Pause", + "Pipe", + "Pipe2", + "PivotRoot", + "Pointer", + "PostQueuedCompletionStatus", + "Pread", + "Proc", + "ProcAttr", + "Process32First", + "Process32Next", + "ProcessEntry32", + "ProcessInformation", + "Protoent", + "PtraceAttach", + "PtraceCont", + "PtraceDetach", + "PtraceGetEventMsg", + "PtraceGetRegs", + "PtracePeekData", + "PtracePeekText", + "PtracePokeData", + "PtracePokeText", + "PtraceRegs", + "PtraceSetOptions", + "PtraceSetRegs", + "PtraceSingleStep", + "PtraceSyscall", + "Pwrite", + "REG_BINARY", + "REG_DWORD", + "REG_DWORD_BIG_ENDIAN", + "REG_DWORD_LITTLE_ENDIAN", + "REG_EXPAND_SZ", + "REG_FULL_RESOURCE_DESCRIPTOR", + "REG_LINK", + "REG_MULTI_SZ", + "REG_NONE", + "REG_QWORD", + "REG_QWORD_LITTLE_ENDIAN", + "REG_RESOURCE_LIST", + "REG_RESOURCE_REQUIREMENTS_LIST", + "REG_SZ", + "RLIMIT_AS", + "RLIMIT_CORE", + "RLIMIT_CPU", + "RLIMIT_CPU_USAGE_MONITOR", + "RLIMIT_DATA", + "RLIMIT_FSIZE", + "RLIMIT_NOFILE", + "RLIMIT_STACK", + "RLIM_INFINITY", + "RTAX_ADVMSS", + "RTAX_AUTHOR", + "RTAX_BRD", + "RTAX_CWND", + "RTAX_DST", + "RTAX_FEATURES", + "RTAX_FEATURE_ALLFRAG", + "RTAX_FEATURE_ECN", + "RTAX_FEATURE_SACK", + "RTAX_FEATURE_TIMESTAMP", + "RTAX_GATEWAY", + "RTAX_GENMASK", + "RTAX_HOPLIMIT", + "RTAX_IFA", + "RTAX_IFP", + "RTAX_INITCWND", + "RTAX_INITRWND", + "RTAX_LABEL", + "RTAX_LOCK", + "RTAX_MAX", + "RTAX_MTU", + "RTAX_NETMASK", + "RTAX_REORDERING", + "RTAX_RTO_MIN", + "RTAX_RTT", + "RTAX_RTTVAR", + "RTAX_SRC", + "RTAX_SRCMASK", + "RTAX_SSTHRESH", + "RTAX_TAG", + "RTAX_UNSPEC", + "RTAX_WINDOW", + "RTA_ALIGNTO", + "RTA_AUTHOR", + "RTA_BRD", + "RTA_CACHEINFO", + "RTA_DST", + "RTA_FLOW", + "RTA_GATEWAY", + "RTA_GENMASK", + "RTA_IFA", + "RTA_IFP", + "RTA_IIF", + "RTA_LABEL", + "RTA_MAX", + "RTA_METRICS", + "RTA_MULTIPATH", + "RTA_NETMASK", + "RTA_OIF", + "RTA_PREFSRC", + "RTA_PRIORITY", + "RTA_SRC", + "RTA_SRCMASK", + "RTA_TABLE", + "RTA_TAG", + "RTA_UNSPEC", + "RTCF_DIRECTSRC", + "RTCF_DOREDIRECT", + "RTCF_LOG", + "RTCF_MASQ", + "RTCF_NAT", + "RTCF_VALVE", + "RTF_ADDRCLASSMASK", + "RTF_ADDRCONF", + "RTF_ALLONLINK", + "RTF_ANNOUNCE", + "RTF_BLACKHOLE", + "RTF_BROADCAST", + "RTF_CACHE", + "RTF_CLONED", + "RTF_CLONING", + "RTF_CONDEMNED", + "RTF_DEFAULT", + "RTF_DELCLONE", + "RTF_DONE", + "RTF_DYNAMIC", + "RTF_FLOW", + "RTF_FMASK", + "RTF_GATEWAY", + "RTF_GWFLAG_COMPAT", + "RTF_HOST", + "RTF_IFREF", + "RTF_IFSCOPE", + "RTF_INTERFACE", + "RTF_IRTT", + "RTF_LINKRT", + "RTF_LLDATA", + "RTF_LLINFO", + "RTF_LOCAL", + "RTF_MASK", + "RTF_MODIFIED", + "RTF_MPATH", + "RTF_MPLS", + "RTF_MSS", + "RTF_MTU", + "RTF_MULTICAST", + "RTF_NAT", + "RTF_NOFORWARD", + "RTF_NONEXTHOP", + "RTF_NOPMTUDISC", + "RTF_PERMANENT_ARP", + "RTF_PINNED", + "RTF_POLICY", + "RTF_PRCLONING", + "RTF_PROTO1", + "RTF_PROTO2", + "RTF_PROTO3", + "RTF_PROXY", + "RTF_REINSTATE", + "RTF_REJECT", + "RTF_RNH_LOCKED", + "RTF_ROUTER", + "RTF_SOURCE", + "RTF_SRC", + "RTF_STATIC", + "RTF_STICKY", + "RTF_THROW", + "RTF_TUNNEL", + "RTF_UP", + "RTF_USETRAILERS", + "RTF_WASCLONED", + "RTF_WINDOW", + "RTF_XRESOLVE", + "RTM_ADD", + "RTM_BASE", + "RTM_CHANGE", + "RTM_CHGADDR", + "RTM_DELACTION", + "RTM_DELADDR", + "RTM_DELADDRLABEL", + "RTM_DELETE", + "RTM_DELLINK", + "RTM_DELMADDR", + "RTM_DELNEIGH", + "RTM_DELQDISC", + "RTM_DELROUTE", + "RTM_DELRULE", + "RTM_DELTCLASS", + "RTM_DELTFILTER", + "RTM_DESYNC", + "RTM_F_CLONED", + "RTM_F_EQUALIZE", + "RTM_F_NOTIFY", + "RTM_F_PREFIX", + "RTM_GET", + "RTM_GET2", + "RTM_GETACTION", + "RTM_GETADDR", + "RTM_GETADDRLABEL", + "RTM_GETANYCAST", + "RTM_GETDCB", + "RTM_GETLINK", + "RTM_GETMULTICAST", + "RTM_GETNEIGH", + "RTM_GETNEIGHTBL", + "RTM_GETQDISC", + "RTM_GETROUTE", + "RTM_GETRULE", + "RTM_GETTCLASS", + "RTM_GETTFILTER", + "RTM_IEEE80211", + "RTM_IFANNOUNCE", + "RTM_IFINFO", + "RTM_IFINFO2", + "RTM_LLINFO_UPD", + "RTM_LOCK", + "RTM_LOSING", + "RTM_MAX", + "RTM_MAXSIZE", + "RTM_MISS", + "RTM_NEWACTION", + "RTM_NEWADDR", + "RTM_NEWADDRLABEL", + "RTM_NEWLINK", + "RTM_NEWMADDR", + "RTM_NEWMADDR2", + "RTM_NEWNDUSEROPT", + "RTM_NEWNEIGH", + "RTM_NEWNEIGHTBL", + "RTM_NEWPREFIX", + "RTM_NEWQDISC", + "RTM_NEWROUTE", + "RTM_NEWRULE", + "RTM_NEWTCLASS", + "RTM_NEWTFILTER", + "RTM_NR_FAMILIES", + "RTM_NR_MSGTYPES", + "RTM_OIFINFO", + "RTM_OLDADD", + "RTM_OLDDEL", + "RTM_OOIFINFO", + "RTM_REDIRECT", + "RTM_RESOLVE", + "RTM_RTTUNIT", + "RTM_SETDCB", + "RTM_SETGATE", + "RTM_SETLINK", + "RTM_SETNEIGHTBL", + "RTM_VERSION", + "RTNH_ALIGNTO", + "RTNH_F_DEAD", + "RTNH_F_ONLINK", + "RTNH_F_PERVASIVE", + "RTNLGRP_IPV4_IFADDR", + "RTNLGRP_IPV4_MROUTE", + "RTNLGRP_IPV4_ROUTE", + "RTNLGRP_IPV4_RULE", + "RTNLGRP_IPV6_IFADDR", + "RTNLGRP_IPV6_IFINFO", + "RTNLGRP_IPV6_MROUTE", + "RTNLGRP_IPV6_PREFIX", + "RTNLGRP_IPV6_ROUTE", + "RTNLGRP_IPV6_RULE", + "RTNLGRP_LINK", + "RTNLGRP_ND_USEROPT", + "RTNLGRP_NEIGH", + "RTNLGRP_NONE", + "RTNLGRP_NOTIFY", + "RTNLGRP_TC", + "RTN_ANYCAST", + "RTN_BLACKHOLE", + "RTN_BROADCAST", + "RTN_LOCAL", + "RTN_MAX", + "RTN_MULTICAST", + "RTN_NAT", + "RTN_PROHIBIT", + "RTN_THROW", + "RTN_UNICAST", + "RTN_UNREACHABLE", + "RTN_UNSPEC", + "RTN_XRESOLVE", + "RTPROT_BIRD", + "RTPROT_BOOT", + "RTPROT_DHCP", + "RTPROT_DNROUTED", + "RTPROT_GATED", + "RTPROT_KERNEL", + "RTPROT_MRT", + "RTPROT_NTK", + "RTPROT_RA", + "RTPROT_REDIRECT", + "RTPROT_STATIC", + "RTPROT_UNSPEC", + "RTPROT_XORP", + "RTPROT_ZEBRA", + "RTV_EXPIRE", + "RTV_HOPCOUNT", + "RTV_MTU", + "RTV_RPIPE", + "RTV_RTT", + "RTV_RTTVAR", + "RTV_SPIPE", + "RTV_SSTHRESH", + "RTV_WEIGHT", + "RT_CACHING_CONTEXT", + "RT_CLASS_DEFAULT", + "RT_CLASS_LOCAL", + "RT_CLASS_MAIN", + "RT_CLASS_MAX", + "RT_CLASS_UNSPEC", + "RT_DEFAULT_FIB", + "RT_NORTREF", + "RT_SCOPE_HOST", + "RT_SCOPE_LINK", + "RT_SCOPE_NOWHERE", + "RT_SCOPE_SITE", + "RT_SCOPE_UNIVERSE", + "RT_TABLEID_MAX", + "RT_TABLE_COMPAT", + "RT_TABLE_DEFAULT", + "RT_TABLE_LOCAL", + "RT_TABLE_MAIN", + "RT_TABLE_MAX", + "RT_TABLE_UNSPEC", + "RUSAGE_CHILDREN", + "RUSAGE_SELF", + "RUSAGE_THREAD", + "Radvisory_t", + "RawConn", + "RawSockaddr", + "RawSockaddrAny", + "RawSockaddrDatalink", + "RawSockaddrInet4", + "RawSockaddrInet6", + "RawSockaddrLinklayer", + "RawSockaddrNetlink", + "RawSockaddrUnix", + "RawSyscall", + "RawSyscall6", + "Read", + "ReadConsole", + "ReadDirectoryChanges", + "ReadDirent", + "ReadFile", + "Readlink", + "Reboot", + "Recvfrom", + "Recvmsg", + "RegCloseKey", + "RegEnumKeyEx", + "RegOpenKeyEx", + "RegQueryInfoKey", + "RegQueryValueEx", + "RemoveDirectory", + "Removexattr", + "Rename", + "Renameat", + "Revoke", + "Rlimit", + "Rmdir", + "RouteMessage", + "RouteRIB", + "RoutingMessage", + "RtAttr", + "RtGenmsg", + "RtMetrics", + "RtMsg", + "RtMsghdr", + "RtNexthop", + "Rusage", + "SCM_BINTIME", + "SCM_CREDENTIALS", + "SCM_CREDS", + "SCM_RIGHTS", + "SCM_TIMESTAMP", + "SCM_TIMESTAMPING", + "SCM_TIMESTAMPNS", + "SCM_TIMESTAMP_MONOTONIC", + "SHUT_RD", + "SHUT_RDWR", + "SHUT_WR", + "SID", + "SIDAndAttributes", + "SIGABRT", + "SIGALRM", + "SIGBUS", + "SIGCHLD", + "SIGCLD", + "SIGCONT", + "SIGEMT", + "SIGFPE", + "SIGHUP", + "SIGILL", + "SIGINFO", + "SIGINT", + "SIGIO", + "SIGIOT", + "SIGKILL", + "SIGLIBRT", + "SIGLWP", + "SIGPIPE", + "SIGPOLL", + "SIGPROF", + "SIGPWR", + "SIGQUIT", + "SIGSEGV", + "SIGSTKFLT", + "SIGSTOP", + "SIGSYS", + "SIGTERM", + "SIGTHR", + "SIGTRAP", + "SIGTSTP", + "SIGTTIN", + "SIGTTOU", + "SIGUNUSED", + "SIGURG", + "SIGUSR1", + "SIGUSR2", + "SIGVTALRM", + "SIGWINCH", + "SIGXCPU", + "SIGXFSZ", + "SIOCADDDLCI", + "SIOCADDMULTI", + "SIOCADDRT", + "SIOCAIFADDR", + "SIOCAIFGROUP", + "SIOCALIFADDR", + "SIOCARPIPLL", + "SIOCATMARK", + "SIOCAUTOADDR", + "SIOCAUTONETMASK", + "SIOCBRDGADD", + "SIOCBRDGADDS", + "SIOCBRDGARL", + "SIOCBRDGDADDR", + "SIOCBRDGDEL", + "SIOCBRDGDELS", + "SIOCBRDGFLUSH", + "SIOCBRDGFRL", + "SIOCBRDGGCACHE", + "SIOCBRDGGFD", + "SIOCBRDGGHT", + "SIOCBRDGGIFFLGS", + "SIOCBRDGGMA", + "SIOCBRDGGPARAM", + "SIOCBRDGGPRI", + "SIOCBRDGGRL", + "SIOCBRDGGSIFS", + "SIOCBRDGGTO", + "SIOCBRDGIFS", + "SIOCBRDGRTS", + "SIOCBRDGSADDR", + "SIOCBRDGSCACHE", + "SIOCBRDGSFD", + "SIOCBRDGSHT", + "SIOCBRDGSIFCOST", + "SIOCBRDGSIFFLGS", + "SIOCBRDGSIFPRIO", + "SIOCBRDGSMA", + "SIOCBRDGSPRI", + "SIOCBRDGSPROTO", + "SIOCBRDGSTO", + "SIOCBRDGSTXHC", + "SIOCDARP", + "SIOCDELDLCI", + "SIOCDELMULTI", + "SIOCDELRT", + "SIOCDEVPRIVATE", + "SIOCDIFADDR", + "SIOCDIFGROUP", + "SIOCDIFPHYADDR", + "SIOCDLIFADDR", + "SIOCDRARP", + "SIOCGARP", + "SIOCGDRVSPEC", + "SIOCGETKALIVE", + "SIOCGETLABEL", + "SIOCGETPFLOW", + "SIOCGETPFSYNC", + "SIOCGETSGCNT", + "SIOCGETVIFCNT", + "SIOCGETVLAN", + "SIOCGHIWAT", + "SIOCGIFADDR", + "SIOCGIFADDRPREF", + "SIOCGIFALIAS", + "SIOCGIFALTMTU", + "SIOCGIFASYNCMAP", + "SIOCGIFBOND", + "SIOCGIFBR", + "SIOCGIFBRDADDR", + "SIOCGIFCAP", + "SIOCGIFCONF", + "SIOCGIFCOUNT", + "SIOCGIFDATA", + "SIOCGIFDESCR", + "SIOCGIFDEVMTU", + "SIOCGIFDLT", + "SIOCGIFDSTADDR", + "SIOCGIFENCAP", + "SIOCGIFFIB", + "SIOCGIFFLAGS", + "SIOCGIFGATTR", + "SIOCGIFGENERIC", + "SIOCGIFGMEMB", + "SIOCGIFGROUP", + "SIOCGIFHARDMTU", + "SIOCGIFHWADDR", + "SIOCGIFINDEX", + "SIOCGIFKPI", + "SIOCGIFMAC", + "SIOCGIFMAP", + "SIOCGIFMEDIA", + "SIOCGIFMEM", + "SIOCGIFMETRIC", + "SIOCGIFMTU", + "SIOCGIFNAME", + "SIOCGIFNETMASK", + "SIOCGIFPDSTADDR", + "SIOCGIFPFLAGS", + "SIOCGIFPHYS", + "SIOCGIFPRIORITY", + "SIOCGIFPSRCADDR", + "SIOCGIFRDOMAIN", + "SIOCGIFRTLABEL", + "SIOCGIFSLAVE", + "SIOCGIFSTATUS", + "SIOCGIFTIMESLOT", + "SIOCGIFTXQLEN", + "SIOCGIFVLAN", + "SIOCGIFWAKEFLAGS", + "SIOCGIFXFLAGS", + "SIOCGLIFADDR", + "SIOCGLIFPHYADDR", + "SIOCGLIFPHYRTABLE", + "SIOCGLIFPHYTTL", + "SIOCGLINKSTR", + "SIOCGLOWAT", + "SIOCGPGRP", + "SIOCGPRIVATE_0", + "SIOCGPRIVATE_1", + "SIOCGRARP", + "SIOCGSPPPPARAMS", + "SIOCGSTAMP", + "SIOCGSTAMPNS", + "SIOCGVH", + "SIOCGVNETID", + "SIOCIFCREATE", + "SIOCIFCREATE2", + "SIOCIFDESTROY", + "SIOCIFGCLONERS", + "SIOCINITIFADDR", + "SIOCPROTOPRIVATE", + "SIOCRSLVMULTI", + "SIOCRTMSG", + "SIOCSARP", + "SIOCSDRVSPEC", + "SIOCSETKALIVE", + "SIOCSETLABEL", + "SIOCSETPFLOW", + "SIOCSETPFSYNC", + "SIOCSETVLAN", + "SIOCSHIWAT", + "SIOCSIFADDR", + "SIOCSIFADDRPREF", + "SIOCSIFALTMTU", + "SIOCSIFASYNCMAP", + "SIOCSIFBOND", + "SIOCSIFBR", + "SIOCSIFBRDADDR", + "SIOCSIFCAP", + "SIOCSIFDESCR", + "SIOCSIFDSTADDR", + "SIOCSIFENCAP", + "SIOCSIFFIB", + "SIOCSIFFLAGS", + "SIOCSIFGATTR", + "SIOCSIFGENERIC", + "SIOCSIFHWADDR", + "SIOCSIFHWBROADCAST", + "SIOCSIFKPI", + "SIOCSIFLINK", + "SIOCSIFLLADDR", + "SIOCSIFMAC", + "SIOCSIFMAP", + "SIOCSIFMEDIA", + "SIOCSIFMEM", + "SIOCSIFMETRIC", + "SIOCSIFMTU", + "SIOCSIFNAME", + "SIOCSIFNETMASK", + "SIOCSIFPFLAGS", + "SIOCSIFPHYADDR", + "SIOCSIFPHYS", + "SIOCSIFPRIORITY", + "SIOCSIFRDOMAIN", + "SIOCSIFRTLABEL", + "SIOCSIFRVNET", + "SIOCSIFSLAVE", + "SIOCSIFTIMESLOT", + "SIOCSIFTXQLEN", + "SIOCSIFVLAN", + "SIOCSIFVNET", + "SIOCSIFXFLAGS", + "SIOCSLIFPHYADDR", + "SIOCSLIFPHYRTABLE", + "SIOCSLIFPHYTTL", + "SIOCSLINKSTR", + "SIOCSLOWAT", + "SIOCSPGRP", + "SIOCSRARP", + "SIOCSSPPPPARAMS", + "SIOCSVH", + "SIOCSVNETID", + "SIOCZIFDATA", + "SIO_GET_EXTENSION_FUNCTION_POINTER", + "SIO_GET_INTERFACE_LIST", + "SIO_KEEPALIVE_VALS", + "SIO_UDP_CONNRESET", + "SOCK_CLOEXEC", + "SOCK_DCCP", + "SOCK_DGRAM", + "SOCK_FLAGS_MASK", + "SOCK_MAXADDRLEN", + "SOCK_NONBLOCK", + "SOCK_NOSIGPIPE", + "SOCK_PACKET", + "SOCK_RAW", + "SOCK_RDM", + "SOCK_SEQPACKET", + "SOCK_STREAM", + "SOL_AAL", + "SOL_ATM", + "SOL_DECNET", + "SOL_ICMPV6", + "SOL_IP", + "SOL_IPV6", + "SOL_IRDA", + "SOL_PACKET", + "SOL_RAW", + "SOL_SOCKET", + "SOL_TCP", + "SOL_X25", + "SOMAXCONN", + "SO_ACCEPTCONN", + "SO_ACCEPTFILTER", + "SO_ATTACH_FILTER", + "SO_BINDANY", + "SO_BINDTODEVICE", + "SO_BINTIME", + "SO_BROADCAST", + "SO_BSDCOMPAT", + "SO_DEBUG", + "SO_DETACH_FILTER", + "SO_DOMAIN", + "SO_DONTROUTE", + "SO_DONTTRUNC", + "SO_ERROR", + "SO_KEEPALIVE", + "SO_LABEL", + "SO_LINGER", + "SO_LINGER_SEC", + "SO_LISTENINCQLEN", + "SO_LISTENQLEN", + "SO_LISTENQLIMIT", + "SO_MARK", + "SO_NETPROC", + "SO_NKE", + "SO_NOADDRERR", + "SO_NOHEADER", + "SO_NOSIGPIPE", + "SO_NOTIFYCONFLICT", + "SO_NO_CHECK", + "SO_NO_DDP", + "SO_NO_OFFLOAD", + "SO_NP_EXTENSIONS", + "SO_NREAD", + "SO_NUMRCVPKT", + "SO_NWRITE", + "SO_OOBINLINE", + "SO_OVERFLOWED", + "SO_PASSCRED", + "SO_PASSSEC", + "SO_PEERCRED", + "SO_PEERLABEL", + "SO_PEERNAME", + "SO_PEERSEC", + "SO_PRIORITY", + "SO_PROTOCOL", + "SO_PROTOTYPE", + "SO_RANDOMPORT", + "SO_RCVBUF", + "SO_RCVBUFFORCE", + "SO_RCVLOWAT", + "SO_RCVTIMEO", + "SO_RESTRICTIONS", + "SO_RESTRICT_DENYIN", + "SO_RESTRICT_DENYOUT", + "SO_RESTRICT_DENYSET", + "SO_REUSEADDR", + "SO_REUSEPORT", + "SO_REUSESHAREUID", + "SO_RTABLE", + "SO_RXQ_OVFL", + "SO_SECURITY_AUTHENTICATION", + "SO_SECURITY_ENCRYPTION_NETWORK", + "SO_SECURITY_ENCRYPTION_TRANSPORT", + "SO_SETFIB", + "SO_SNDBUF", + "SO_SNDBUFFORCE", + "SO_SNDLOWAT", + "SO_SNDTIMEO", + "SO_SPLICE", + "SO_TIMESTAMP", + "SO_TIMESTAMPING", + "SO_TIMESTAMPNS", + "SO_TIMESTAMP_MONOTONIC", + "SO_TYPE", + "SO_UPCALLCLOSEWAIT", + "SO_UPDATE_ACCEPT_CONTEXT", + "SO_UPDATE_CONNECT_CONTEXT", + "SO_USELOOPBACK", + "SO_USER_COOKIE", + "SO_VENDOR", + "SO_WANTMORE", + "SO_WANTOOBFLAG", + "SSLExtraCertChainPolicyPara", + "STANDARD_RIGHTS_ALL", + "STANDARD_RIGHTS_EXECUTE", + "STANDARD_RIGHTS_READ", + "STANDARD_RIGHTS_REQUIRED", + "STANDARD_RIGHTS_WRITE", + "STARTF_USESHOWWINDOW", + "STARTF_USESTDHANDLES", + "STD_ERROR_HANDLE", + "STD_INPUT_HANDLE", + "STD_OUTPUT_HANDLE", + "SUBLANG_ENGLISH_US", + "SW_FORCEMINIMIZE", + "SW_HIDE", + "SW_MAXIMIZE", + "SW_MINIMIZE", + "SW_NORMAL", + "SW_RESTORE", + "SW_SHOW", + "SW_SHOWDEFAULT", + "SW_SHOWMAXIMIZED", + "SW_SHOWMINIMIZED", + "SW_SHOWMINNOACTIVE", + "SW_SHOWNA", + "SW_SHOWNOACTIVATE", + "SW_SHOWNORMAL", + "SYMBOLIC_LINK_FLAG_DIRECTORY", + "SYNCHRONIZE", + "SYSCTL_VERSION", + "SYSCTL_VERS_0", + "SYSCTL_VERS_1", + "SYSCTL_VERS_MASK", + "SYS_ABORT2", + "SYS_ACCEPT", + "SYS_ACCEPT4", + "SYS_ACCEPT_NOCANCEL", + "SYS_ACCESS", + "SYS_ACCESS_EXTENDED", + "SYS_ACCT", + "SYS_ADD_KEY", + "SYS_ADD_PROFIL", + "SYS_ADJFREQ", + "SYS_ADJTIME", + "SYS_ADJTIMEX", + "SYS_AFS_SYSCALL", + "SYS_AIO_CANCEL", + "SYS_AIO_ERROR", + "SYS_AIO_FSYNC", + "SYS_AIO_MLOCK", + "SYS_AIO_READ", + "SYS_AIO_RETURN", + "SYS_AIO_SUSPEND", + "SYS_AIO_SUSPEND_NOCANCEL", + "SYS_AIO_WAITCOMPLETE", + "SYS_AIO_WRITE", + "SYS_ALARM", + "SYS_ARCH_PRCTL", + "SYS_ARM_FADVISE64_64", + "SYS_ARM_SYNC_FILE_RANGE", + "SYS_ATGETMSG", + "SYS_ATPGETREQ", + "SYS_ATPGETRSP", + "SYS_ATPSNDREQ", + "SYS_ATPSNDRSP", + "SYS_ATPUTMSG", + "SYS_ATSOCKET", + "SYS_AUDIT", + "SYS_AUDITCTL", + "SYS_AUDITON", + "SYS_AUDIT_SESSION_JOIN", + "SYS_AUDIT_SESSION_PORT", + "SYS_AUDIT_SESSION_SELF", + "SYS_BDFLUSH", + "SYS_BIND", + "SYS_BINDAT", + "SYS_BREAK", + "SYS_BRK", + "SYS_BSDTHREAD_CREATE", + "SYS_BSDTHREAD_REGISTER", + "SYS_BSDTHREAD_TERMINATE", + "SYS_CAPGET", + "SYS_CAPSET", + "SYS_CAP_ENTER", + "SYS_CAP_FCNTLS_GET", + "SYS_CAP_FCNTLS_LIMIT", + "SYS_CAP_GETMODE", + "SYS_CAP_GETRIGHTS", + "SYS_CAP_IOCTLS_GET", + "SYS_CAP_IOCTLS_LIMIT", + "SYS_CAP_NEW", + "SYS_CAP_RIGHTS_GET", + "SYS_CAP_RIGHTS_LIMIT", + "SYS_CHDIR", + "SYS_CHFLAGS", + "SYS_CHFLAGSAT", + "SYS_CHMOD", + "SYS_CHMOD_EXTENDED", + "SYS_CHOWN", + "SYS_CHOWN32", + "SYS_CHROOT", + "SYS_CHUD", + "SYS_CLOCK_ADJTIME", + "SYS_CLOCK_GETCPUCLOCKID2", + "SYS_CLOCK_GETRES", + "SYS_CLOCK_GETTIME", + "SYS_CLOCK_NANOSLEEP", + "SYS_CLOCK_SETTIME", + "SYS_CLONE", + "SYS_CLOSE", + "SYS_CLOSEFROM", + "SYS_CLOSE_NOCANCEL", + "SYS_CONNECT", + "SYS_CONNECTAT", + "SYS_CONNECT_NOCANCEL", + "SYS_COPYFILE", + "SYS_CPUSET", + "SYS_CPUSET_GETAFFINITY", + "SYS_CPUSET_GETID", + "SYS_CPUSET_SETAFFINITY", + "SYS_CPUSET_SETID", + "SYS_CREAT", + "SYS_CREATE_MODULE", + "SYS_CSOPS", + "SYS_CSOPS_AUDITTOKEN", + "SYS_DELETE", + "SYS_DELETE_MODULE", + "SYS_DUP", + "SYS_DUP2", + "SYS_DUP3", + "SYS_EACCESS", + "SYS_EPOLL_CREATE", + "SYS_EPOLL_CREATE1", + "SYS_EPOLL_CTL", + "SYS_EPOLL_CTL_OLD", + "SYS_EPOLL_PWAIT", + "SYS_EPOLL_WAIT", + "SYS_EPOLL_WAIT_OLD", + "SYS_EVENTFD", + "SYS_EVENTFD2", + "SYS_EXCHANGEDATA", + "SYS_EXECVE", + "SYS_EXIT", + "SYS_EXIT_GROUP", + "SYS_EXTATTRCTL", + "SYS_EXTATTR_DELETE_FD", + "SYS_EXTATTR_DELETE_FILE", + "SYS_EXTATTR_DELETE_LINK", + "SYS_EXTATTR_GET_FD", + "SYS_EXTATTR_GET_FILE", + "SYS_EXTATTR_GET_LINK", + "SYS_EXTATTR_LIST_FD", + "SYS_EXTATTR_LIST_FILE", + "SYS_EXTATTR_LIST_LINK", + "SYS_EXTATTR_SET_FD", + "SYS_EXTATTR_SET_FILE", + "SYS_EXTATTR_SET_LINK", + "SYS_FACCESSAT", + "SYS_FADVISE64", + "SYS_FADVISE64_64", + "SYS_FALLOCATE", + "SYS_FANOTIFY_INIT", + "SYS_FANOTIFY_MARK", + "SYS_FCHDIR", + "SYS_FCHFLAGS", + "SYS_FCHMOD", + "SYS_FCHMODAT", + "SYS_FCHMOD_EXTENDED", + "SYS_FCHOWN", + "SYS_FCHOWN32", + "SYS_FCHOWNAT", + "SYS_FCHROOT", + "SYS_FCNTL", + "SYS_FCNTL64", + "SYS_FCNTL_NOCANCEL", + "SYS_FDATASYNC", + "SYS_FEXECVE", + "SYS_FFCLOCK_GETCOUNTER", + "SYS_FFCLOCK_GETESTIMATE", + "SYS_FFCLOCK_SETESTIMATE", + "SYS_FFSCTL", + "SYS_FGETATTRLIST", + "SYS_FGETXATTR", + "SYS_FHOPEN", + "SYS_FHSTAT", + "SYS_FHSTATFS", + "SYS_FILEPORT_MAKEFD", + "SYS_FILEPORT_MAKEPORT", + "SYS_FKTRACE", + "SYS_FLISTXATTR", + "SYS_FLOCK", + "SYS_FORK", + "SYS_FPATHCONF", + "SYS_FREEBSD6_FTRUNCATE", + "SYS_FREEBSD6_LSEEK", + "SYS_FREEBSD6_MMAP", + "SYS_FREEBSD6_PREAD", + "SYS_FREEBSD6_PWRITE", + "SYS_FREEBSD6_TRUNCATE", + "SYS_FREMOVEXATTR", + "SYS_FSCTL", + "SYS_FSETATTRLIST", + "SYS_FSETXATTR", + "SYS_FSGETPATH", + "SYS_FSTAT", + "SYS_FSTAT64", + "SYS_FSTAT64_EXTENDED", + "SYS_FSTATAT", + "SYS_FSTATAT64", + "SYS_FSTATFS", + "SYS_FSTATFS64", + "SYS_FSTATV", + "SYS_FSTATVFS1", + "SYS_FSTAT_EXTENDED", + "SYS_FSYNC", + "SYS_FSYNC_NOCANCEL", + "SYS_FSYNC_RANGE", + "SYS_FTIME", + "SYS_FTRUNCATE", + "SYS_FTRUNCATE64", + "SYS_FUTEX", + "SYS_FUTIMENS", + "SYS_FUTIMES", + "SYS_FUTIMESAT", + "SYS_GETATTRLIST", + "SYS_GETAUDIT", + "SYS_GETAUDIT_ADDR", + "SYS_GETAUID", + "SYS_GETCONTEXT", + "SYS_GETCPU", + "SYS_GETCWD", + "SYS_GETDENTS", + "SYS_GETDENTS64", + "SYS_GETDIRENTRIES", + "SYS_GETDIRENTRIES64", + "SYS_GETDIRENTRIESATTR", + "SYS_GETDTABLECOUNT", + "SYS_GETDTABLESIZE", + "SYS_GETEGID", + "SYS_GETEGID32", + "SYS_GETEUID", + "SYS_GETEUID32", + "SYS_GETFH", + "SYS_GETFSSTAT", + "SYS_GETFSSTAT64", + "SYS_GETGID", + "SYS_GETGID32", + "SYS_GETGROUPS", + "SYS_GETGROUPS32", + "SYS_GETHOSTUUID", + "SYS_GETITIMER", + "SYS_GETLCID", + "SYS_GETLOGIN", + "SYS_GETLOGINCLASS", + "SYS_GETPEERNAME", + "SYS_GETPGID", + "SYS_GETPGRP", + "SYS_GETPID", + "SYS_GETPMSG", + "SYS_GETPPID", + "SYS_GETPRIORITY", + "SYS_GETRESGID", + "SYS_GETRESGID32", + "SYS_GETRESUID", + "SYS_GETRESUID32", + "SYS_GETRLIMIT", + "SYS_GETRTABLE", + "SYS_GETRUSAGE", + "SYS_GETSGROUPS", + "SYS_GETSID", + "SYS_GETSOCKNAME", + "SYS_GETSOCKOPT", + "SYS_GETTHRID", + "SYS_GETTID", + "SYS_GETTIMEOFDAY", + "SYS_GETUID", + "SYS_GETUID32", + "SYS_GETVFSSTAT", + "SYS_GETWGROUPS", + "SYS_GETXATTR", + "SYS_GET_KERNEL_SYMS", + "SYS_GET_MEMPOLICY", + "SYS_GET_ROBUST_LIST", + "SYS_GET_THREAD_AREA", + "SYS_GSSD_SYSCALL", + "SYS_GTTY", + "SYS_IDENTITYSVC", + "SYS_IDLE", + "SYS_INITGROUPS", + "SYS_INIT_MODULE", + "SYS_INOTIFY_ADD_WATCH", + "SYS_INOTIFY_INIT", + "SYS_INOTIFY_INIT1", + "SYS_INOTIFY_RM_WATCH", + "SYS_IOCTL", + "SYS_IOPERM", + "SYS_IOPL", + "SYS_IOPOLICYSYS", + "SYS_IOPRIO_GET", + "SYS_IOPRIO_SET", + "SYS_IO_CANCEL", + "SYS_IO_DESTROY", + "SYS_IO_GETEVENTS", + "SYS_IO_SETUP", + "SYS_IO_SUBMIT", + "SYS_IPC", + "SYS_ISSETUGID", + "SYS_JAIL", + "SYS_JAIL_ATTACH", + "SYS_JAIL_GET", + "SYS_JAIL_REMOVE", + "SYS_JAIL_SET", + "SYS_KAS_INFO", + "SYS_KDEBUG_TRACE", + "SYS_KENV", + "SYS_KEVENT", + "SYS_KEVENT64", + "SYS_KEXEC_LOAD", + "SYS_KEYCTL", + "SYS_KILL", + "SYS_KLDFIND", + "SYS_KLDFIRSTMOD", + "SYS_KLDLOAD", + "SYS_KLDNEXT", + "SYS_KLDSTAT", + "SYS_KLDSYM", + "SYS_KLDUNLOAD", + "SYS_KLDUNLOADF", + "SYS_KMQ_NOTIFY", + "SYS_KMQ_OPEN", + "SYS_KMQ_SETATTR", + "SYS_KMQ_TIMEDRECEIVE", + "SYS_KMQ_TIMEDSEND", + "SYS_KMQ_UNLINK", + "SYS_KQUEUE", + "SYS_KQUEUE1", + "SYS_KSEM_CLOSE", + "SYS_KSEM_DESTROY", + "SYS_KSEM_GETVALUE", + "SYS_KSEM_INIT", + "SYS_KSEM_OPEN", + "SYS_KSEM_POST", + "SYS_KSEM_TIMEDWAIT", + "SYS_KSEM_TRYWAIT", + "SYS_KSEM_UNLINK", + "SYS_KSEM_WAIT", + "SYS_KTIMER_CREATE", + "SYS_KTIMER_DELETE", + "SYS_KTIMER_GETOVERRUN", + "SYS_KTIMER_GETTIME", + "SYS_KTIMER_SETTIME", + "SYS_KTRACE", + "SYS_LCHFLAGS", + "SYS_LCHMOD", + "SYS_LCHOWN", + "SYS_LCHOWN32", + "SYS_LEDGER", + "SYS_LGETFH", + "SYS_LGETXATTR", + "SYS_LINK", + "SYS_LINKAT", + "SYS_LIO_LISTIO", + "SYS_LISTEN", + "SYS_LISTXATTR", + "SYS_LLISTXATTR", + "SYS_LOCK", + "SYS_LOOKUP_DCOOKIE", + "SYS_LPATHCONF", + "SYS_LREMOVEXATTR", + "SYS_LSEEK", + "SYS_LSETXATTR", + "SYS_LSTAT", + "SYS_LSTAT64", + "SYS_LSTAT64_EXTENDED", + "SYS_LSTATV", + "SYS_LSTAT_EXTENDED", + "SYS_LUTIMES", + "SYS_MAC_SYSCALL", + "SYS_MADVISE", + "SYS_MADVISE1", + "SYS_MAXSYSCALL", + "SYS_MBIND", + "SYS_MIGRATE_PAGES", + "SYS_MINCORE", + "SYS_MINHERIT", + "SYS_MKCOMPLEX", + "SYS_MKDIR", + "SYS_MKDIRAT", + "SYS_MKDIR_EXTENDED", + "SYS_MKFIFO", + "SYS_MKFIFOAT", + "SYS_MKFIFO_EXTENDED", + "SYS_MKNOD", + "SYS_MKNODAT", + "SYS_MLOCK", + "SYS_MLOCKALL", + "SYS_MMAP", + "SYS_MMAP2", + "SYS_MODCTL", + "SYS_MODFIND", + "SYS_MODFNEXT", + "SYS_MODIFY_LDT", + "SYS_MODNEXT", + "SYS_MODSTAT", + "SYS_MODWATCH", + "SYS_MOUNT", + "SYS_MOVE_PAGES", + "SYS_MPROTECT", + "SYS_MPX", + "SYS_MQUERY", + "SYS_MQ_GETSETATTR", + "SYS_MQ_NOTIFY", + "SYS_MQ_OPEN", + "SYS_MQ_TIMEDRECEIVE", + "SYS_MQ_TIMEDSEND", + "SYS_MQ_UNLINK", + "SYS_MREMAP", + "SYS_MSGCTL", + "SYS_MSGGET", + "SYS_MSGRCV", + "SYS_MSGRCV_NOCANCEL", + "SYS_MSGSND", + "SYS_MSGSND_NOCANCEL", + "SYS_MSGSYS", + "SYS_MSYNC", + "SYS_MSYNC_NOCANCEL", + "SYS_MUNLOCK", + "SYS_MUNLOCKALL", + "SYS_MUNMAP", + "SYS_NAME_TO_HANDLE_AT", + "SYS_NANOSLEEP", + "SYS_NEWFSTATAT", + "SYS_NFSCLNT", + "SYS_NFSSERVCTL", + "SYS_NFSSVC", + "SYS_NFSTAT", + "SYS_NICE", + "SYS_NLM_SYSCALL", + "SYS_NLSTAT", + "SYS_NMOUNT", + "SYS_NSTAT", + "SYS_NTP_ADJTIME", + "SYS_NTP_GETTIME", + "SYS_NUMA_GETAFFINITY", + "SYS_NUMA_SETAFFINITY", + "SYS_OABI_SYSCALL_BASE", + "SYS_OBREAK", + "SYS_OLDFSTAT", + "SYS_OLDLSTAT", + "SYS_OLDOLDUNAME", + "SYS_OLDSTAT", + "SYS_OLDUNAME", + "SYS_OPEN", + "SYS_OPENAT", + "SYS_OPENBSD_POLL", + "SYS_OPEN_BY_HANDLE_AT", + "SYS_OPEN_DPROTECTED_NP", + "SYS_OPEN_EXTENDED", + "SYS_OPEN_NOCANCEL", + "SYS_OVADVISE", + "SYS_PACCEPT", + "SYS_PATHCONF", + "SYS_PAUSE", + "SYS_PCICONFIG_IOBASE", + "SYS_PCICONFIG_READ", + "SYS_PCICONFIG_WRITE", + "SYS_PDFORK", + "SYS_PDGETPID", + "SYS_PDKILL", + "SYS_PERF_EVENT_OPEN", + "SYS_PERSONALITY", + "SYS_PID_HIBERNATE", + "SYS_PID_RESUME", + "SYS_PID_SHUTDOWN_SOCKETS", + "SYS_PID_SUSPEND", + "SYS_PIPE", + "SYS_PIPE2", + "SYS_PIVOT_ROOT", + "SYS_PMC_CONTROL", + "SYS_PMC_GET_INFO", + "SYS_POLL", + "SYS_POLLTS", + "SYS_POLL_NOCANCEL", + "SYS_POSIX_FADVISE", + "SYS_POSIX_FALLOCATE", + "SYS_POSIX_OPENPT", + "SYS_POSIX_SPAWN", + "SYS_PPOLL", + "SYS_PRCTL", + "SYS_PREAD", + "SYS_PREAD64", + "SYS_PREADV", + "SYS_PREAD_NOCANCEL", + "SYS_PRLIMIT64", + "SYS_PROCCTL", + "SYS_PROCESS_POLICY", + "SYS_PROCESS_VM_READV", + "SYS_PROCESS_VM_WRITEV", + "SYS_PROC_INFO", + "SYS_PROF", + "SYS_PROFIL", + "SYS_PSELECT", + "SYS_PSELECT6", + "SYS_PSET_ASSIGN", + "SYS_PSET_CREATE", + "SYS_PSET_DESTROY", + "SYS_PSYNCH_CVBROAD", + "SYS_PSYNCH_CVCLRPREPOST", + "SYS_PSYNCH_CVSIGNAL", + "SYS_PSYNCH_CVWAIT", + "SYS_PSYNCH_MUTEXDROP", + "SYS_PSYNCH_MUTEXWAIT", + "SYS_PSYNCH_RW_DOWNGRADE", + "SYS_PSYNCH_RW_LONGRDLOCK", + "SYS_PSYNCH_RW_RDLOCK", + "SYS_PSYNCH_RW_UNLOCK", + "SYS_PSYNCH_RW_UNLOCK2", + "SYS_PSYNCH_RW_UPGRADE", + "SYS_PSYNCH_RW_WRLOCK", + "SYS_PSYNCH_RW_YIELDWRLOCK", + "SYS_PTRACE", + "SYS_PUTPMSG", + "SYS_PWRITE", + "SYS_PWRITE64", + "SYS_PWRITEV", + "SYS_PWRITE_NOCANCEL", + "SYS_QUERY_MODULE", + "SYS_QUOTACTL", + "SYS_RASCTL", + "SYS_RCTL_ADD_RULE", + "SYS_RCTL_GET_LIMITS", + "SYS_RCTL_GET_RACCT", + "SYS_RCTL_GET_RULES", + "SYS_RCTL_REMOVE_RULE", + "SYS_READ", + "SYS_READAHEAD", + "SYS_READDIR", + "SYS_READLINK", + "SYS_READLINKAT", + "SYS_READV", + "SYS_READV_NOCANCEL", + "SYS_READ_NOCANCEL", + "SYS_REBOOT", + "SYS_RECV", + "SYS_RECVFROM", + "SYS_RECVFROM_NOCANCEL", + "SYS_RECVMMSG", + "SYS_RECVMSG", + "SYS_RECVMSG_NOCANCEL", + "SYS_REMAP_FILE_PAGES", + "SYS_REMOVEXATTR", + "SYS_RENAME", + "SYS_RENAMEAT", + "SYS_REQUEST_KEY", + "SYS_RESTART_SYSCALL", + "SYS_REVOKE", + "SYS_RFORK", + "SYS_RMDIR", + "SYS_RTPRIO", + "SYS_RTPRIO_THREAD", + "SYS_RT_SIGACTION", + "SYS_RT_SIGPENDING", + "SYS_RT_SIGPROCMASK", + "SYS_RT_SIGQUEUEINFO", + "SYS_RT_SIGRETURN", + "SYS_RT_SIGSUSPEND", + "SYS_RT_SIGTIMEDWAIT", + "SYS_RT_TGSIGQUEUEINFO", + "SYS_SBRK", + "SYS_SCHED_GETAFFINITY", + "SYS_SCHED_GETPARAM", + "SYS_SCHED_GETSCHEDULER", + "SYS_SCHED_GET_PRIORITY_MAX", + "SYS_SCHED_GET_PRIORITY_MIN", + "SYS_SCHED_RR_GET_INTERVAL", + "SYS_SCHED_SETAFFINITY", + "SYS_SCHED_SETPARAM", + "SYS_SCHED_SETSCHEDULER", + "SYS_SCHED_YIELD", + "SYS_SCTP_GENERIC_RECVMSG", + "SYS_SCTP_GENERIC_SENDMSG", + "SYS_SCTP_GENERIC_SENDMSG_IOV", + "SYS_SCTP_PEELOFF", + "SYS_SEARCHFS", + "SYS_SECURITY", + "SYS_SELECT", + "SYS_SELECT_NOCANCEL", + "SYS_SEMCONFIG", + "SYS_SEMCTL", + "SYS_SEMGET", + "SYS_SEMOP", + "SYS_SEMSYS", + "SYS_SEMTIMEDOP", + "SYS_SEM_CLOSE", + "SYS_SEM_DESTROY", + "SYS_SEM_GETVALUE", + "SYS_SEM_INIT", + "SYS_SEM_OPEN", + "SYS_SEM_POST", + "SYS_SEM_TRYWAIT", + "SYS_SEM_UNLINK", + "SYS_SEM_WAIT", + "SYS_SEM_WAIT_NOCANCEL", + "SYS_SEND", + "SYS_SENDFILE", + "SYS_SENDFILE64", + "SYS_SENDMMSG", + "SYS_SENDMSG", + "SYS_SENDMSG_NOCANCEL", + "SYS_SENDTO", + "SYS_SENDTO_NOCANCEL", + "SYS_SETATTRLIST", + "SYS_SETAUDIT", + "SYS_SETAUDIT_ADDR", + "SYS_SETAUID", + "SYS_SETCONTEXT", + "SYS_SETDOMAINNAME", + "SYS_SETEGID", + "SYS_SETEUID", + "SYS_SETFIB", + "SYS_SETFSGID", + "SYS_SETFSGID32", + "SYS_SETFSUID", + "SYS_SETFSUID32", + "SYS_SETGID", + "SYS_SETGID32", + "SYS_SETGROUPS", + "SYS_SETGROUPS32", + "SYS_SETHOSTNAME", + "SYS_SETITIMER", + "SYS_SETLCID", + "SYS_SETLOGIN", + "SYS_SETLOGINCLASS", + "SYS_SETNS", + "SYS_SETPGID", + "SYS_SETPRIORITY", + "SYS_SETPRIVEXEC", + "SYS_SETREGID", + "SYS_SETREGID32", + "SYS_SETRESGID", + "SYS_SETRESGID32", + "SYS_SETRESUID", + "SYS_SETRESUID32", + "SYS_SETREUID", + "SYS_SETREUID32", + "SYS_SETRLIMIT", + "SYS_SETRTABLE", + "SYS_SETSGROUPS", + "SYS_SETSID", + "SYS_SETSOCKOPT", + "SYS_SETTID", + "SYS_SETTID_WITH_PID", + "SYS_SETTIMEOFDAY", + "SYS_SETUID", + "SYS_SETUID32", + "SYS_SETWGROUPS", + "SYS_SETXATTR", + "SYS_SET_MEMPOLICY", + "SYS_SET_ROBUST_LIST", + "SYS_SET_THREAD_AREA", + "SYS_SET_TID_ADDRESS", + "SYS_SGETMASK", + "SYS_SHARED_REGION_CHECK_NP", + "SYS_SHARED_REGION_MAP_AND_SLIDE_NP", + "SYS_SHMAT", + "SYS_SHMCTL", + "SYS_SHMDT", + "SYS_SHMGET", + "SYS_SHMSYS", + "SYS_SHM_OPEN", + "SYS_SHM_UNLINK", + "SYS_SHUTDOWN", + "SYS_SIGACTION", + "SYS_SIGALTSTACK", + "SYS_SIGNAL", + "SYS_SIGNALFD", + "SYS_SIGNALFD4", + "SYS_SIGPENDING", + "SYS_SIGPROCMASK", + "SYS_SIGQUEUE", + "SYS_SIGQUEUEINFO", + "SYS_SIGRETURN", + "SYS_SIGSUSPEND", + "SYS_SIGSUSPEND_NOCANCEL", + "SYS_SIGTIMEDWAIT", + "SYS_SIGWAIT", + "SYS_SIGWAITINFO", + "SYS_SOCKET", + "SYS_SOCKETCALL", + "SYS_SOCKETPAIR", + "SYS_SPLICE", + "SYS_SSETMASK", + "SYS_SSTK", + "SYS_STACK_SNAPSHOT", + "SYS_STAT", + "SYS_STAT64", + "SYS_STAT64_EXTENDED", + "SYS_STATFS", + "SYS_STATFS64", + "SYS_STATV", + "SYS_STATVFS1", + "SYS_STAT_EXTENDED", + "SYS_STIME", + "SYS_STTY", + "SYS_SWAPCONTEXT", + "SYS_SWAPCTL", + "SYS_SWAPOFF", + "SYS_SWAPON", + "SYS_SYMLINK", + "SYS_SYMLINKAT", + "SYS_SYNC", + "SYS_SYNCFS", + "SYS_SYNC_FILE_RANGE", + "SYS_SYSARCH", + "SYS_SYSCALL", + "SYS_SYSCALL_BASE", + "SYS_SYSFS", + "SYS_SYSINFO", + "SYS_SYSLOG", + "SYS_TEE", + "SYS_TGKILL", + "SYS_THREAD_SELFID", + "SYS_THR_CREATE", + "SYS_THR_EXIT", + "SYS_THR_KILL", + "SYS_THR_KILL2", + "SYS_THR_NEW", + "SYS_THR_SELF", + "SYS_THR_SET_NAME", + "SYS_THR_SUSPEND", + "SYS_THR_WAKE", + "SYS_TIME", + "SYS_TIMERFD_CREATE", + "SYS_TIMERFD_GETTIME", + "SYS_TIMERFD_SETTIME", + "SYS_TIMER_CREATE", + "SYS_TIMER_DELETE", + "SYS_TIMER_GETOVERRUN", + "SYS_TIMER_GETTIME", + "SYS_TIMER_SETTIME", + "SYS_TIMES", + "SYS_TKILL", + "SYS_TRUNCATE", + "SYS_TRUNCATE64", + "SYS_TUXCALL", + "SYS_UGETRLIMIT", + "SYS_ULIMIT", + "SYS_UMASK", + "SYS_UMASK_EXTENDED", + "SYS_UMOUNT", + "SYS_UMOUNT2", + "SYS_UNAME", + "SYS_UNDELETE", + "SYS_UNLINK", + "SYS_UNLINKAT", + "SYS_UNMOUNT", + "SYS_UNSHARE", + "SYS_USELIB", + "SYS_USTAT", + "SYS_UTIME", + "SYS_UTIMENSAT", + "SYS_UTIMES", + "SYS_UTRACE", + "SYS_UUIDGEN", + "SYS_VADVISE", + "SYS_VFORK", + "SYS_VHANGUP", + "SYS_VM86", + "SYS_VM86OLD", + "SYS_VMSPLICE", + "SYS_VM_PRESSURE_MONITOR", + "SYS_VSERVER", + "SYS_WAIT4", + "SYS_WAIT4_NOCANCEL", + "SYS_WAIT6", + "SYS_WAITEVENT", + "SYS_WAITID", + "SYS_WAITID_NOCANCEL", + "SYS_WAITPID", + "SYS_WATCHEVENT", + "SYS_WORKQ_KERNRETURN", + "SYS_WORKQ_OPEN", + "SYS_WRITE", + "SYS_WRITEV", + "SYS_WRITEV_NOCANCEL", + "SYS_WRITE_NOCANCEL", + "SYS_YIELD", + "SYS__LLSEEK", + "SYS__LWP_CONTINUE", + "SYS__LWP_CREATE", + "SYS__LWP_CTL", + "SYS__LWP_DETACH", + "SYS__LWP_EXIT", + "SYS__LWP_GETNAME", + "SYS__LWP_GETPRIVATE", + "SYS__LWP_KILL", + "SYS__LWP_PARK", + "SYS__LWP_SELF", + "SYS__LWP_SETNAME", + "SYS__LWP_SETPRIVATE", + "SYS__LWP_SUSPEND", + "SYS__LWP_UNPARK", + "SYS__LWP_UNPARK_ALL", + "SYS__LWP_WAIT", + "SYS__LWP_WAKEUP", + "SYS__NEWSELECT", + "SYS__PSET_BIND", + "SYS__SCHED_GETAFFINITY", + "SYS__SCHED_GETPARAM", + "SYS__SCHED_SETAFFINITY", + "SYS__SCHED_SETPARAM", + "SYS__SYSCTL", + "SYS__UMTX_LOCK", + "SYS__UMTX_OP", + "SYS__UMTX_UNLOCK", + "SYS___ACL_ACLCHECK_FD", + "SYS___ACL_ACLCHECK_FILE", + "SYS___ACL_ACLCHECK_LINK", + "SYS___ACL_DELETE_FD", + "SYS___ACL_DELETE_FILE", + "SYS___ACL_DELETE_LINK", + "SYS___ACL_GET_FD", + "SYS___ACL_GET_FILE", + "SYS___ACL_GET_LINK", + "SYS___ACL_SET_FD", + "SYS___ACL_SET_FILE", + "SYS___ACL_SET_LINK", + "SYS___CAP_RIGHTS_GET", + "SYS___CLONE", + "SYS___DISABLE_THREADSIGNAL", + "SYS___GETCWD", + "SYS___GETLOGIN", + "SYS___GET_TCB", + "SYS___MAC_EXECVE", + "SYS___MAC_GETFSSTAT", + "SYS___MAC_GET_FD", + "SYS___MAC_GET_FILE", + "SYS___MAC_GET_LCID", + "SYS___MAC_GET_LCTX", + "SYS___MAC_GET_LINK", + "SYS___MAC_GET_MOUNT", + "SYS___MAC_GET_PID", + "SYS___MAC_GET_PROC", + "SYS___MAC_MOUNT", + "SYS___MAC_SET_FD", + "SYS___MAC_SET_FILE", + "SYS___MAC_SET_LCTX", + "SYS___MAC_SET_LINK", + "SYS___MAC_SET_PROC", + "SYS___MAC_SYSCALL", + "SYS___OLD_SEMWAIT_SIGNAL", + "SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", + "SYS___POSIX_CHOWN", + "SYS___POSIX_FCHOWN", + "SYS___POSIX_LCHOWN", + "SYS___POSIX_RENAME", + "SYS___PTHREAD_CANCELED", + "SYS___PTHREAD_CHDIR", + "SYS___PTHREAD_FCHDIR", + "SYS___PTHREAD_KILL", + "SYS___PTHREAD_MARKCANCEL", + "SYS___PTHREAD_SIGMASK", + "SYS___QUOTACTL", + "SYS___SEMCTL", + "SYS___SEMWAIT_SIGNAL", + "SYS___SEMWAIT_SIGNAL_NOCANCEL", + "SYS___SETLOGIN", + "SYS___SETUGID", + "SYS___SET_TCB", + "SYS___SIGACTION_SIGTRAMP", + "SYS___SIGTIMEDWAIT", + "SYS___SIGWAIT", + "SYS___SIGWAIT_NOCANCEL", + "SYS___SYSCTL", + "SYS___TFORK", + "SYS___THREXIT", + "SYS___THRSIGDIVERT", + "SYS___THRSLEEP", + "SYS___THRWAKEUP", + "S_ARCH1", + "S_ARCH2", + "S_BLKSIZE", + "S_IEXEC", + "S_IFBLK", + "S_IFCHR", + "S_IFDIR", + "S_IFIFO", + "S_IFLNK", + "S_IFMT", + "S_IFREG", + "S_IFSOCK", + "S_IFWHT", + "S_IREAD", + "S_IRGRP", + "S_IROTH", + "S_IRUSR", + "S_IRWXG", + "S_IRWXO", + "S_IRWXU", + "S_ISGID", + "S_ISTXT", + "S_ISUID", + "S_ISVTX", + "S_IWGRP", + "S_IWOTH", + "S_IWRITE", + "S_IWUSR", + "S_IXGRP", + "S_IXOTH", + "S_IXUSR", + "S_LOGIN_SET", + "SecurityAttributes", + "Seek", + "Select", + "Sendfile", + "Sendmsg", + "SendmsgN", + "Sendto", + "Servent", + "SetBpf", + "SetBpfBuflen", + "SetBpfDatalink", + "SetBpfHeadercmpl", + "SetBpfImmediate", + "SetBpfInterface", + "SetBpfPromisc", + "SetBpfTimeout", + "SetCurrentDirectory", + "SetEndOfFile", + "SetEnvironmentVariable", + "SetFileAttributes", + "SetFileCompletionNotificationModes", + "SetFilePointer", + "SetFileTime", + "SetHandleInformation", + "SetKevent", + "SetLsfPromisc", + "SetNonblock", + "Setdomainname", + "Setegid", + "Setenv", + "Seteuid", + "Setfsgid", + "Setfsuid", + "Setgid", + "Setgroups", + "Sethostname", + "Setlogin", + "Setpgid", + "Setpriority", + "Setprivexec", + "Setregid", + "Setresgid", + "Setresuid", + "Setreuid", + "Setrlimit", + "Setsid", + "Setsockopt", + "SetsockoptByte", + "SetsockoptICMPv6Filter", + "SetsockoptIPMreq", + "SetsockoptIPMreqn", + "SetsockoptIPv6Mreq", + "SetsockoptInet4Addr", + "SetsockoptInt", + "SetsockoptLinger", + "SetsockoptString", + "SetsockoptTimeval", + "Settimeofday", + "Setuid", + "Setxattr", + "Shutdown", + "SidTypeAlias", + "SidTypeComputer", + "SidTypeDeletedAccount", + "SidTypeDomain", + "SidTypeGroup", + "SidTypeInvalid", + "SidTypeLabel", + "SidTypeUnknown", + "SidTypeUser", + "SidTypeWellKnownGroup", + "Signal", + "SizeofBpfHdr", + "SizeofBpfInsn", + "SizeofBpfProgram", + "SizeofBpfStat", + "SizeofBpfVersion", + "SizeofBpfZbuf", + "SizeofBpfZbufHeader", + "SizeofCmsghdr", + "SizeofICMPv6Filter", + "SizeofIPMreq", + "SizeofIPMreqn", + "SizeofIPv6MTUInfo", + "SizeofIPv6Mreq", + "SizeofIfAddrmsg", + "SizeofIfAnnounceMsghdr", + "SizeofIfData", + "SizeofIfInfomsg", + "SizeofIfMsghdr", + "SizeofIfaMsghdr", + "SizeofIfmaMsghdr", + "SizeofIfmaMsghdr2", + "SizeofInet4Pktinfo", + "SizeofInet6Pktinfo", + "SizeofInotifyEvent", + "SizeofLinger", + "SizeofMsghdr", + "SizeofNlAttr", + "SizeofNlMsgerr", + "SizeofNlMsghdr", + "SizeofRtAttr", + "SizeofRtGenmsg", + "SizeofRtMetrics", + "SizeofRtMsg", + "SizeofRtMsghdr", + "SizeofRtNexthop", + "SizeofSockFilter", + "SizeofSockFprog", + "SizeofSockaddrAny", + "SizeofSockaddrDatalink", + "SizeofSockaddrInet4", + "SizeofSockaddrInet6", + "SizeofSockaddrLinklayer", + "SizeofSockaddrNetlink", + "SizeofSockaddrUnix", + "SizeofTCPInfo", + "SizeofUcred", + "SlicePtrFromStrings", + "SockFilter", + "SockFprog", + "Sockaddr", + "SockaddrDatalink", + "SockaddrGen", + "SockaddrInet4", + "SockaddrInet6", + "SockaddrLinklayer", + "SockaddrNetlink", + "SockaddrUnix", + "Socket", + "SocketControlMessage", + "SocketDisableIPv6", + "Socketpair", + "Splice", + "StartProcess", + "StartupInfo", + "Stat", + "Stat_t", + "Statfs", + "Statfs_t", + "Stderr", + "Stdin", + "Stdout", + "StringBytePtr", + "StringByteSlice", + "StringSlicePtr", + "StringToSid", + "StringToUTF16", + "StringToUTF16Ptr", + "Symlink", + "Sync", + "SyncFileRange", + "SysProcAttr", + "SysProcIDMap", + "Syscall", + "Syscall12", + "Syscall15", + "Syscall18", + "Syscall6", + "Syscall9", + "SyscallN", + "Sysctl", + "SysctlUint32", + "Sysctlnode", + "Sysinfo", + "Sysinfo_t", + "Systemtime", + "TCGETS", + "TCIFLUSH", + "TCIOFLUSH", + "TCOFLUSH", + "TCPInfo", + "TCPKeepalive", + "TCP_CA_NAME_MAX", + "TCP_CONGCTL", + "TCP_CONGESTION", + "TCP_CONNECTIONTIMEOUT", + "TCP_CORK", + "TCP_DEFER_ACCEPT", + "TCP_ENABLE_ECN", + "TCP_INFO", + "TCP_KEEPALIVE", + "TCP_KEEPCNT", + "TCP_KEEPIDLE", + "TCP_KEEPINIT", + "TCP_KEEPINTVL", + "TCP_LINGER2", + "TCP_MAXBURST", + "TCP_MAXHLEN", + "TCP_MAXOLEN", + "TCP_MAXSEG", + "TCP_MAXWIN", + "TCP_MAX_SACK", + "TCP_MAX_WINSHIFT", + "TCP_MD5SIG", + "TCP_MD5SIG_MAXKEYLEN", + "TCP_MINMSS", + "TCP_MINMSSOVERLOAD", + "TCP_MSS", + "TCP_NODELAY", + "TCP_NOOPT", + "TCP_NOPUSH", + "TCP_NOTSENT_LOWAT", + "TCP_NSTATES", + "TCP_QUICKACK", + "TCP_RXT_CONNDROPTIME", + "TCP_RXT_FINDROP", + "TCP_SACK_ENABLE", + "TCP_SENDMOREACKS", + "TCP_SYNCNT", + "TCP_VENDOR", + "TCP_WINDOW_CLAMP", + "TCSAFLUSH", + "TCSETS", + "TF_DISCONNECT", + "TF_REUSE_SOCKET", + "TF_USE_DEFAULT_WORKER", + "TF_USE_KERNEL_APC", + "TF_USE_SYSTEM_THREAD", + "TF_WRITE_BEHIND", + "TH32CS_INHERIT", + "TH32CS_SNAPALL", + "TH32CS_SNAPHEAPLIST", + "TH32CS_SNAPMODULE", + "TH32CS_SNAPMODULE32", + "TH32CS_SNAPPROCESS", + "TH32CS_SNAPTHREAD", + "TIME_ZONE_ID_DAYLIGHT", + "TIME_ZONE_ID_STANDARD", + "TIME_ZONE_ID_UNKNOWN", + "TIOCCBRK", + "TIOCCDTR", + "TIOCCONS", + "TIOCDCDTIMESTAMP", + "TIOCDRAIN", + "TIOCDSIMICROCODE", + "TIOCEXCL", + "TIOCEXT", + "TIOCFLAG_CDTRCTS", + "TIOCFLAG_CLOCAL", + "TIOCFLAG_CRTSCTS", + "TIOCFLAG_MDMBUF", + "TIOCFLAG_PPS", + "TIOCFLAG_SOFTCAR", + "TIOCFLUSH", + "TIOCGDEV", + "TIOCGDRAINWAIT", + "TIOCGETA", + "TIOCGETD", + "TIOCGFLAGS", + "TIOCGICOUNT", + "TIOCGLCKTRMIOS", + "TIOCGLINED", + "TIOCGPGRP", + "TIOCGPTN", + "TIOCGQSIZE", + "TIOCGRANTPT", + "TIOCGRS485", + "TIOCGSERIAL", + "TIOCGSID", + "TIOCGSIZE", + "TIOCGSOFTCAR", + "TIOCGTSTAMP", + "TIOCGWINSZ", + "TIOCINQ", + "TIOCIXOFF", + "TIOCIXON", + "TIOCLINUX", + "TIOCMBIC", + "TIOCMBIS", + "TIOCMGDTRWAIT", + "TIOCMGET", + "TIOCMIWAIT", + "TIOCMODG", + "TIOCMODS", + "TIOCMSDTRWAIT", + "TIOCMSET", + "TIOCM_CAR", + "TIOCM_CD", + "TIOCM_CTS", + "TIOCM_DCD", + "TIOCM_DSR", + "TIOCM_DTR", + "TIOCM_LE", + "TIOCM_RI", + "TIOCM_RNG", + "TIOCM_RTS", + "TIOCM_SR", + "TIOCM_ST", + "TIOCNOTTY", + "TIOCNXCL", + "TIOCOUTQ", + "TIOCPKT", + "TIOCPKT_DATA", + "TIOCPKT_DOSTOP", + "TIOCPKT_FLUSHREAD", + "TIOCPKT_FLUSHWRITE", + "TIOCPKT_IOCTL", + "TIOCPKT_NOSTOP", + "TIOCPKT_START", + "TIOCPKT_STOP", + "TIOCPTMASTER", + "TIOCPTMGET", + "TIOCPTSNAME", + "TIOCPTYGNAME", + "TIOCPTYGRANT", + "TIOCPTYUNLK", + "TIOCRCVFRAME", + "TIOCREMOTE", + "TIOCSBRK", + "TIOCSCONS", + "TIOCSCTTY", + "TIOCSDRAINWAIT", + "TIOCSDTR", + "TIOCSERCONFIG", + "TIOCSERGETLSR", + "TIOCSERGETMULTI", + "TIOCSERGSTRUCT", + "TIOCSERGWILD", + "TIOCSERSETMULTI", + "TIOCSERSWILD", + "TIOCSER_TEMT", + "TIOCSETA", + "TIOCSETAF", + "TIOCSETAW", + "TIOCSETD", + "TIOCSFLAGS", + "TIOCSIG", + "TIOCSLCKTRMIOS", + "TIOCSLINED", + "TIOCSPGRP", + "TIOCSPTLCK", + "TIOCSQSIZE", + "TIOCSRS485", + "TIOCSSERIAL", + "TIOCSSIZE", + "TIOCSSOFTCAR", + "TIOCSTART", + "TIOCSTAT", + "TIOCSTI", + "TIOCSTOP", + "TIOCSTSTAMP", + "TIOCSWINSZ", + "TIOCTIMESTAMP", + "TIOCUCNTL", + "TIOCVHANGUP", + "TIOCXMTFRAME", + "TOKEN_ADJUST_DEFAULT", + "TOKEN_ADJUST_GROUPS", + "TOKEN_ADJUST_PRIVILEGES", + "TOKEN_ADJUST_SESSIONID", + "TOKEN_ALL_ACCESS", + "TOKEN_ASSIGN_PRIMARY", + "TOKEN_DUPLICATE", + "TOKEN_EXECUTE", + "TOKEN_IMPERSONATE", + "TOKEN_QUERY", + "TOKEN_QUERY_SOURCE", + "TOKEN_READ", + "TOKEN_WRITE", + "TOSTOP", + "TRUNCATE_EXISTING", + "TUNATTACHFILTER", + "TUNDETACHFILTER", + "TUNGETFEATURES", + "TUNGETIFF", + "TUNGETSNDBUF", + "TUNGETVNETHDRSZ", + "TUNSETDEBUG", + "TUNSETGROUP", + "TUNSETIFF", + "TUNSETLINK", + "TUNSETNOCSUM", + "TUNSETOFFLOAD", + "TUNSETOWNER", + "TUNSETPERSIST", + "TUNSETSNDBUF", + "TUNSETTXFILTER", + "TUNSETVNETHDRSZ", + "Tee", + "TerminateProcess", + "Termios", + "Tgkill", + "Time", + "Time_t", + "Times", + "Timespec", + "TimespecToNsec", + "Timeval", + "Timeval32", + "TimevalToNsec", + "Timex", + "Timezoneinformation", + "Tms", + "Token", + "TokenAccessInformation", + "TokenAuditPolicy", + "TokenDefaultDacl", + "TokenElevation", + "TokenElevationType", + "TokenGroups", + "TokenGroupsAndPrivileges", + "TokenHasRestrictions", + "TokenImpersonationLevel", + "TokenIntegrityLevel", + "TokenLinkedToken", + "TokenLogonSid", + "TokenMandatoryPolicy", + "TokenOrigin", + "TokenOwner", + "TokenPrimaryGroup", + "TokenPrivileges", + "TokenRestrictedSids", + "TokenSandBoxInert", + "TokenSessionId", + "TokenSessionReference", + "TokenSource", + "TokenStatistics", + "TokenType", + "TokenUIAccess", + "TokenUser", + "TokenVirtualizationAllowed", + "TokenVirtualizationEnabled", + "Tokenprimarygroup", + "Tokenuser", + "TranslateAccountName", + "TranslateName", + "TransmitFile", + "TransmitFileBuffers", + "Truncate", + "UNIX_PATH_MAX", + "USAGE_MATCH_TYPE_AND", + "USAGE_MATCH_TYPE_OR", + "UTF16FromString", + "UTF16PtrFromString", + "UTF16ToString", + "Ucred", + "Umask", + "Uname", + "Undelete", + "UnixCredentials", + "UnixRights", + "Unlink", + "Unlinkat", + "UnmapViewOfFile", + "Unmount", + "Unsetenv", + "Unshare", + "UserInfo10", + "Ustat", + "Ustat_t", + "Utimbuf", + "Utime", + "Utimes", + "UtimesNano", + "Utsname", + "VDISCARD", + "VDSUSP", + "VEOF", + "VEOL", + "VEOL2", + "VERASE", + "VERASE2", + "VINTR", + "VKILL", + "VLNEXT", + "VMIN", + "VQUIT", + "VREPRINT", + "VSTART", + "VSTATUS", + "VSTOP", + "VSUSP", + "VSWTC", + "VT0", + "VT1", + "VTDLY", + "VTIME", + "VWERASE", + "VirtualLock", + "VirtualUnlock", + "WAIT_ABANDONED", + "WAIT_FAILED", + "WAIT_OBJECT_0", + "WAIT_TIMEOUT", + "WALL", + "WALLSIG", + "WALTSIG", + "WCLONE", + "WCONTINUED", + "WCOREFLAG", + "WEXITED", + "WLINUXCLONE", + "WNOHANG", + "WNOTHREAD", + "WNOWAIT", + "WNOZOMBIE", + "WOPTSCHECKED", + "WORDSIZE", + "WSABuf", + "WSACleanup", + "WSADESCRIPTION_LEN", + "WSAData", + "WSAEACCES", + "WSAECONNABORTED", + "WSAECONNRESET", + "WSAEnumProtocols", + "WSAID_CONNECTEX", + "WSAIoctl", + "WSAPROTOCOL_LEN", + "WSAProtocolChain", + "WSAProtocolInfo", + "WSARecv", + "WSARecvFrom", + "WSASYS_STATUS_LEN", + "WSASend", + "WSASendTo", + "WSASendto", + "WSAStartup", + "WSTOPPED", + "WTRAPPED", + "WUNTRACED", + "Wait4", + "WaitForSingleObject", + "WaitStatus", + "Win32FileAttributeData", + "Win32finddata", + "Write", + "WriteConsole", + "WriteFile", + "X509_ASN_ENCODING", + "XCASE", + "XP1_CONNECTIONLESS", + "XP1_CONNECT_DATA", + "XP1_DISCONNECT_DATA", + "XP1_EXPEDITED_DATA", + "XP1_GRACEFUL_CLOSE", + "XP1_GUARANTEED_DELIVERY", + "XP1_GUARANTEED_ORDER", + "XP1_IFS_HANDLES", + "XP1_MESSAGE_ORIENTED", + "XP1_MULTIPOINT_CONTROL_PLANE", + "XP1_MULTIPOINT_DATA_PLANE", + "XP1_PARTIAL_MESSAGE", + "XP1_PSEUDO_STREAM", + "XP1_QOS_SUPPORTED", + "XP1_SAN_SUPPORT_SDP", + "XP1_SUPPORT_BROADCAST", + "XP1_SUPPORT_MULTIPOINT", + "XP1_UNI_RECV", + "XP1_UNI_SEND", + }, + "syscall/js": { + "CopyBytesToGo", + "CopyBytesToJS", + "Error", + "Func", + "FuncOf", + "Global", + "Null", + "Type", + "TypeBoolean", + "TypeFunction", + "TypeNull", + "TypeNumber", + "TypeObject", + "TypeString", + "TypeSymbol", + "TypeUndefined", + "Undefined", + "Value", + "ValueError", + "ValueOf", + }, + "testing": { + "AllocsPerRun", + "B", + "Benchmark", + "BenchmarkResult", + "Cover", + "CoverBlock", + "CoverMode", + "Coverage", + "F", + "Init", + "InternalBenchmark", + "InternalExample", + "InternalFuzzTarget", + "InternalTest", + "M", + "Main", + "MainStart", + "PB", + "RegisterCover", + "RunBenchmarks", + "RunExamples", + "RunTests", + "Short", + "T", + "TB", + "Testing", + "Verbose", + }, + "testing/fstest": { + "MapFS", + "MapFile", + "TestFS", + }, + "testing/iotest": { + "DataErrReader", + "ErrReader", + "ErrTimeout", + "HalfReader", + "NewReadLogger", + "NewWriteLogger", + "OneByteReader", + "TestReader", + "TimeoutReader", + "TruncateWriter", + }, + "testing/quick": { + "Check", + "CheckEqual", + "CheckEqualError", + "CheckError", + "Config", + "Generator", + "SetupError", + "Value", + }, + "testing/slogtest": { + "TestHandler", + }, + "text/scanner": { + "Char", + "Comment", + "EOF", + "Float", + "GoTokens", + "GoWhitespace", + "Ident", + "Int", + "Position", + "RawString", + "ScanChars", + "ScanComments", + "ScanFloats", + "ScanIdents", + "ScanInts", + "ScanRawStrings", + "ScanStrings", + "Scanner", + "SkipComments", + "String", + "TokenString", + }, + "text/tabwriter": { + "AlignRight", + "Debug", + "DiscardEmptyColumns", + "Escape", + "FilterHTML", + "NewWriter", + "StripEscape", + "TabIndent", + "Writer", + }, + "text/template": { + "ExecError", + "FuncMap", + "HTMLEscape", + "HTMLEscapeString", + "HTMLEscaper", + "IsTrue", + "JSEscape", + "JSEscapeString", + "JSEscaper", + "Must", + "New", + "ParseFS", + "ParseFiles", + "ParseGlob", + "Template", + "URLQueryEscaper", + }, + "text/template/parse": { + "ActionNode", + "BoolNode", + "BranchNode", + "BreakNode", + "ChainNode", + "CommandNode", + "CommentNode", + "ContinueNode", + "DotNode", + "FieldNode", + "IdentifierNode", + "IfNode", + "IsEmptyTree", + "ListNode", + "Mode", + "New", + "NewIdentifier", + "NilNode", + "Node", + "NodeAction", + "NodeBool", + "NodeBreak", + "NodeChain", + "NodeCommand", + "NodeComment", + "NodeContinue", + "NodeDot", + "NodeField", + "NodeIdentifier", + "NodeIf", + "NodeList", + "NodeNil", + "NodeNumber", + "NodePipe", + "NodeRange", + "NodeString", + "NodeTemplate", + "NodeText", + "NodeType", + "NodeVariable", + "NodeWith", + "NumberNode", + "Parse", + "ParseComments", + "PipeNode", + "Pos", + "RangeNode", + "SkipFuncCheck", + "StringNode", + "TemplateNode", + "TextNode", + "Tree", + "VariableNode", + "WithNode", + }, + "time": { + "ANSIC", + "After", + "AfterFunc", + "April", + "August", + "Date", + "DateOnly", + "DateTime", + "December", + "Duration", + "February", + "FixedZone", + "Friday", + "Hour", + "January", + "July", + "June", + "Kitchen", + "Layout", + "LoadLocation", + "LoadLocationFromTZData", + "Local", + "Location", + "March", + "May", + "Microsecond", + "Millisecond", + "Minute", + "Monday", + "Month", + "Nanosecond", + "NewTicker", + "NewTimer", + "November", + "Now", + "October", + "Parse", + "ParseDuration", + "ParseError", + "ParseInLocation", + "RFC1123", + "RFC1123Z", + "RFC3339", + "RFC3339Nano", + "RFC822", + "RFC822Z", + "RFC850", + "RubyDate", + "Saturday", + "Second", + "September", + "Since", + "Sleep", + "Stamp", + "StampMicro", + "StampMilli", + "StampNano", + "Sunday", + "Thursday", + "Tick", + "Ticker", + "Time", + "TimeOnly", + "Timer", + "Tuesday", + "UTC", + "Unix", + "UnixDate", + "UnixMicro", + "UnixMilli", + "Until", + "Wednesday", + "Weekday", + }, + "unicode": { + "ASCII_Hex_Digit", + "Adlam", + "Ahom", + "Anatolian_Hieroglyphs", + "Arabic", + "Armenian", + "Avestan", + "AzeriCase", + "Balinese", + "Bamum", + "Bassa_Vah", + "Batak", + "Bengali", + "Bhaiksuki", + "Bidi_Control", + "Bopomofo", + "Brahmi", + "Braille", + "Buginese", + "Buhid", + "C", + "Canadian_Aboriginal", + "Carian", + "CaseRange", + "CaseRanges", + "Categories", + "Caucasian_Albanian", + "Cc", + "Cf", + "Chakma", + "Cham", + "Cherokee", + "Chorasmian", + "Co", + "Common", + "Coptic", + "Cs", + "Cuneiform", + "Cypriot", + "Cypro_Minoan", + "Cyrillic", + "Dash", + "Deprecated", + "Deseret", + "Devanagari", + "Diacritic", + "Digit", + "Dives_Akuru", + "Dogra", + "Duployan", + "Egyptian_Hieroglyphs", + "Elbasan", + "Elymaic", + "Ethiopic", + "Extender", + "FoldCategory", + "FoldScript", + "Georgian", + "Glagolitic", + "Gothic", + "Grantha", + "GraphicRanges", + "Greek", + "Gujarati", + "Gunjala_Gondi", + "Gurmukhi", + "Han", + "Hangul", + "Hanifi_Rohingya", + "Hanunoo", + "Hatran", + "Hebrew", + "Hex_Digit", + "Hiragana", + "Hyphen", + "IDS_Binary_Operator", + "IDS_Trinary_Operator", + "Ideographic", + "Imperial_Aramaic", + "In", + "Inherited", + "Inscriptional_Pahlavi", + "Inscriptional_Parthian", + "Is", + "IsControl", + "IsDigit", + "IsGraphic", + "IsLetter", + "IsLower", + "IsMark", + "IsNumber", + "IsOneOf", + "IsPrint", + "IsPunct", + "IsSpace", + "IsSymbol", + "IsTitle", + "IsUpper", + "Javanese", + "Join_Control", + "Kaithi", + "Kannada", + "Katakana", + "Kawi", + "Kayah_Li", + "Kharoshthi", + "Khitan_Small_Script", + "Khmer", + "Khojki", + "Khudawadi", + "L", + "Lao", + "Latin", + "Lepcha", + "Letter", + "Limbu", + "Linear_A", + "Linear_B", + "Lisu", + "Ll", + "Lm", + "Lo", + "Logical_Order_Exception", + "Lower", + "LowerCase", + "Lt", + "Lu", + "Lycian", + "Lydian", + "M", + "Mahajani", + "Makasar", + "Malayalam", + "Mandaic", + "Manichaean", + "Marchen", + "Mark", + "Masaram_Gondi", + "MaxASCII", + "MaxCase", + "MaxLatin1", + "MaxRune", + "Mc", + "Me", + "Medefaidrin", + "Meetei_Mayek", + "Mende_Kikakui", + "Meroitic_Cursive", + "Meroitic_Hieroglyphs", + "Miao", + "Mn", + "Modi", + "Mongolian", + "Mro", + "Multani", + "Myanmar", + "N", + "Nabataean", + "Nag_Mundari", + "Nandinagari", + "Nd", + "New_Tai_Lue", + "Newa", + "Nko", + "Nl", + "No", + "Noncharacter_Code_Point", + "Number", + "Nushu", + "Nyiakeng_Puachue_Hmong", + "Ogham", + "Ol_Chiki", + "Old_Hungarian", + "Old_Italic", + "Old_North_Arabian", + "Old_Permic", + "Old_Persian", + "Old_Sogdian", + "Old_South_Arabian", + "Old_Turkic", + "Old_Uyghur", + "Oriya", + "Osage", + "Osmanya", + "Other", + "Other_Alphabetic", + "Other_Default_Ignorable_Code_Point", + "Other_Grapheme_Extend", + "Other_ID_Continue", + "Other_ID_Start", + "Other_Lowercase", + "Other_Math", + "Other_Uppercase", + "P", + "Pahawh_Hmong", + "Palmyrene", + "Pattern_Syntax", + "Pattern_White_Space", + "Pau_Cin_Hau", + "Pc", + "Pd", + "Pe", + "Pf", + "Phags_Pa", + "Phoenician", + "Pi", + "Po", + "Prepended_Concatenation_Mark", + "PrintRanges", + "Properties", + "Ps", + "Psalter_Pahlavi", + "Punct", + "Quotation_Mark", + "Radical", + "Range16", + "Range32", + "RangeTable", + "Regional_Indicator", + "Rejang", + "ReplacementChar", + "Runic", + "S", + "STerm", + "Samaritan", + "Saurashtra", + "Sc", + "Scripts", + "Sentence_Terminal", + "Sharada", + "Shavian", + "Siddham", + "SignWriting", + "SimpleFold", + "Sinhala", + "Sk", + "Sm", + "So", + "Soft_Dotted", + "Sogdian", + "Sora_Sompeng", + "Soyombo", + "Space", + "SpecialCase", + "Sundanese", + "Syloti_Nagri", + "Symbol", + "Syriac", + "Tagalog", + "Tagbanwa", + "Tai_Le", + "Tai_Tham", + "Tai_Viet", + "Takri", + "Tamil", + "Tangsa", + "Tangut", + "Telugu", + "Terminal_Punctuation", + "Thaana", + "Thai", + "Tibetan", + "Tifinagh", + "Tirhuta", + "Title", + "TitleCase", + "To", + "ToLower", + "ToTitle", + "ToUpper", + "Toto", + "TurkishCase", + "Ugaritic", + "Unified_Ideograph", + "Upper", + "UpperCase", + "UpperLower", + "Vai", + "Variation_Selector", + "Version", + "Vithkuqi", + "Wancho", + "Warang_Citi", + "White_Space", + "Yezidi", + "Yi", + "Z", + "Zanabazar_Square", + "Zl", + "Zp", + "Zs", + }, + "unicode/utf16": { + "AppendRune", + "Decode", + "DecodeRune", + "Encode", + "EncodeRune", + "IsSurrogate", + }, + "unicode/utf8": { + "AppendRune", + "DecodeLastRune", + "DecodeLastRuneInString", + "DecodeRune", + "DecodeRuneInString", + "EncodeRune", + "FullRune", + "FullRuneInString", + "MaxRune", + "RuneCount", + "RuneCountInString", + "RuneError", + "RuneLen", + "RuneSelf", + "RuneStart", + "UTFMax", + "Valid", + "ValidRune", + "ValidString", + }, + "unsafe": { + "Add", + "Alignof", + "Offsetof", + "Pointer", + "Sizeof", + "Slice", + "SliceData", + "String", + "StringData", + }, +} diff --git a/upstream/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/upstream/vendor/golang.org/x/tools/internal/packagesinternal/packages.go new file mode 100644 index 00000000000..44719de173b --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/packagesinternal/packages.go @@ -0,0 +1,22 @@ +// 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. + +// Package packagesinternal exposes internal-only fields from go/packages. +package packagesinternal + +var GetForTest = func(p interface{}) string { return "" } +var GetDepsErrors = func(p interface{}) []*PackageError { return nil } + +type PackageError struct { + ImportStack []string // shortest path from package named on command line to this one + Pos string // position of error (if present, file:line:col) + Err string // the error itself +} + +var TypecheckCgo int +var DepsErrors int // must be set as a LoadMode to call GetDepsErrors +var ForTest int // must be set as a LoadMode to call GetForTest + +var SetModFlag = func(config interface{}, value string) {} +var SetModFile = func(config interface{}, value string) {} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/codes.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/codes.go new file mode 100644 index 00000000000..f0cabde96eb --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/codes.go @@ -0,0 +1,77 @@ +// Copyright 2021 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 pkgbits + +// A Code is an enum value that can be encoded into bitstreams. +// +// Code types are preferable for enum types, because they allow +// Decoder to detect desyncs. +type Code interface { + // Marker returns the SyncMarker for the Code's dynamic type. + Marker() SyncMarker + + // Value returns the Code's ordinal value. + Value() int +} + +// A CodeVal distinguishes among go/constant.Value encodings. +type CodeVal int + +func (c CodeVal) Marker() SyncMarker { return SyncVal } +func (c CodeVal) Value() int { return int(c) } + +// Note: These values are public and cannot be changed without +// updating the go/types importers. + +const ( + ValBool CodeVal = iota + ValString + ValInt64 + ValBigInt + ValBigRat + ValBigFloat +) + +// A CodeType distinguishes among go/types.Type encodings. +type CodeType int + +func (c CodeType) Marker() SyncMarker { return SyncType } +func (c CodeType) Value() int { return int(c) } + +// Note: These values are public and cannot be changed without +// updating the go/types importers. + +const ( + TypeBasic CodeType = iota + TypeNamed + TypePointer + TypeSlice + TypeArray + TypeChan + TypeMap + TypeSignature + TypeStruct + TypeInterface + TypeUnion + TypeTypeParam +) + +// A CodeObj distinguishes among go/types.Object encodings. +type CodeObj int + +func (c CodeObj) Marker() SyncMarker { return SyncCodeObj } +func (c CodeObj) Value() int { return int(c) } + +// Note: These values are public and cannot be changed without +// updating the go/types importers. + +const ( + ObjAlias CodeObj = iota + ObjConst + ObjType + ObjFunc + ObjVar + ObjStub +) diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/decoder.go new file mode 100644 index 00000000000..b92e8e6eb32 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/decoder.go @@ -0,0 +1,517 @@ +// Copyright 2021 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 pkgbits + +import ( + "encoding/binary" + "errors" + "fmt" + "go/constant" + "go/token" + "io" + "math/big" + "os" + "runtime" + "strings" +) + +// A PkgDecoder provides methods for decoding a package's Unified IR +// export data. +type PkgDecoder struct { + // version is the file format version. + version uint32 + + // sync indicates whether the file uses sync markers. + sync bool + + // pkgPath is the package path for the package to be decoded. + // + // TODO(mdempsky): Remove; unneeded since CL 391014. + pkgPath string + + // elemData is the full data payload of the encoded package. + // Elements are densely and contiguously packed together. + // + // The last 8 bytes of elemData are the package fingerprint. + elemData string + + // elemEnds stores the byte-offset end positions of element + // bitstreams within elemData. + // + // For example, element I's bitstream data starts at elemEnds[I-1] + // (or 0, if I==0) and ends at elemEnds[I]. + // + // Note: elemEnds is indexed by absolute indices, not + // section-relative indices. + elemEnds []uint32 + + // elemEndsEnds stores the index-offset end positions of relocation + // sections within elemEnds. + // + // For example, section K's end positions start at elemEndsEnds[K-1] + // (or 0, if K==0) and end at elemEndsEnds[K]. + elemEndsEnds [numRelocs]uint32 + + scratchRelocEnt []RelocEnt +} + +// PkgPath returns the package path for the package +// +// TODO(mdempsky): Remove; unneeded since CL 391014. +func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath } + +// SyncMarkers reports whether pr uses sync markers. +func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync } + +// NewPkgDecoder returns a PkgDecoder initialized to read the Unified +// IR export data from input. pkgPath is the package path for the +// compilation unit that produced the export data. +// +// TODO(mdempsky): Remove pkgPath parameter; unneeded since CL 391014. +func NewPkgDecoder(pkgPath, input string) PkgDecoder { + pr := PkgDecoder{ + pkgPath: pkgPath, + } + + // TODO(mdempsky): Implement direct indexing of input string to + // avoid copying the position information. + + r := strings.NewReader(input) + + assert(binary.Read(r, binary.LittleEndian, &pr.version) == nil) + + switch pr.version { + default: + panic(fmt.Errorf("unsupported version: %v", pr.version)) + case 0: + // no flags + case 1: + var flags uint32 + assert(binary.Read(r, binary.LittleEndian, &flags) == nil) + pr.sync = flags&flagSyncMarkers != 0 + } + + assert(binary.Read(r, binary.LittleEndian, pr.elemEndsEnds[:]) == nil) + + pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1]) + assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil) + + pos, err := r.Seek(0, io.SeekCurrent) + assert(err == nil) + + pr.elemData = input[pos:] + assert(len(pr.elemData)-8 == int(pr.elemEnds[len(pr.elemEnds)-1])) + + return pr +} + +// NumElems returns the number of elements in section k. +func (pr *PkgDecoder) NumElems(k RelocKind) int { + count := int(pr.elemEndsEnds[k]) + if k > 0 { + count -= int(pr.elemEndsEnds[k-1]) + } + return count +} + +// TotalElems returns the total number of elements across all sections. +func (pr *PkgDecoder) TotalElems() int { + return len(pr.elemEnds) +} + +// Fingerprint returns the package fingerprint. +func (pr *PkgDecoder) Fingerprint() [8]byte { + var fp [8]byte + copy(fp[:], pr.elemData[len(pr.elemData)-8:]) + return fp +} + +// AbsIdx returns the absolute index for the given (section, index) +// pair. +func (pr *PkgDecoder) AbsIdx(k RelocKind, idx Index) int { + absIdx := int(idx) + if k > 0 { + absIdx += int(pr.elemEndsEnds[k-1]) + } + if absIdx >= int(pr.elemEndsEnds[k]) { + errorf("%v:%v is out of bounds; %v", k, idx, pr.elemEndsEnds) + } + return absIdx +} + +// DataIdx returns the raw element bitstream for the given (section, +// index) pair. +func (pr *PkgDecoder) DataIdx(k RelocKind, idx Index) string { + absIdx := pr.AbsIdx(k, idx) + + var start uint32 + if absIdx > 0 { + start = pr.elemEnds[absIdx-1] + } + end := pr.elemEnds[absIdx] + + return pr.elemData[start:end] +} + +// StringIdx returns the string value for the given string index. +func (pr *PkgDecoder) StringIdx(idx Index) string { + return pr.DataIdx(RelocString, idx) +} + +// NewDecoder returns a Decoder for the given (section, index) pair, +// and decodes the given SyncMarker from the element bitstream. +func (pr *PkgDecoder) NewDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { + r := pr.NewDecoderRaw(k, idx) + r.Sync(marker) + return r +} + +// TempDecoder returns a Decoder for the given (section, index) pair, +// and decodes the given SyncMarker from the element bitstream. +// If possible the Decoder should be RetireDecoder'd when it is no longer +// needed, this will avoid heap allocations. +func (pr *PkgDecoder) TempDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { + r := pr.TempDecoderRaw(k, idx) + r.Sync(marker) + return r +} + +func (pr *PkgDecoder) RetireDecoder(d *Decoder) { + pr.scratchRelocEnt = d.Relocs + d.Relocs = nil +} + +// NewDecoderRaw returns a Decoder for the given (section, index) pair. +// +// Most callers should use NewDecoder instead. +func (pr *PkgDecoder) NewDecoderRaw(k RelocKind, idx Index) Decoder { + r := Decoder{ + common: pr, + k: k, + Idx: idx, + } + + // TODO(mdempsky) r.data.Reset(...) after #44505 is resolved. + r.Data = *strings.NewReader(pr.DataIdx(k, idx)) + + r.Sync(SyncRelocs) + r.Relocs = make([]RelocEnt, r.Len()) + for i := range r.Relocs { + r.Sync(SyncReloc) + r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} + } + + return r +} + +func (pr *PkgDecoder) TempDecoderRaw(k RelocKind, idx Index) Decoder { + r := Decoder{ + common: pr, + k: k, + Idx: idx, + } + + r.Data.Reset(pr.DataIdx(k, idx)) + r.Sync(SyncRelocs) + l := r.Len() + if cap(pr.scratchRelocEnt) >= l { + r.Relocs = pr.scratchRelocEnt[:l] + pr.scratchRelocEnt = nil + } else { + r.Relocs = make([]RelocEnt, l) + } + for i := range r.Relocs { + r.Sync(SyncReloc) + r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} + } + + return r +} + +// A Decoder provides methods for decoding an individual element's +// bitstream data. +type Decoder struct { + common *PkgDecoder + + Relocs []RelocEnt + Data strings.Reader + + k RelocKind + Idx Index +} + +func (r *Decoder) checkErr(err error) { + if err != nil { + errorf("unexpected decoding error: %w", err) + } +} + +func (r *Decoder) rawUvarint() uint64 { + x, err := readUvarint(&r.Data) + r.checkErr(err) + return x +} + +// readUvarint is a type-specialized copy of encoding/binary.ReadUvarint. +// This avoids the interface conversion and thus has better escape properties, +// which flows up the stack. +func readUvarint(r *strings.Reader) (uint64, error) { + var x uint64 + var s uint + for i := 0; i < binary.MaxVarintLen64; i++ { + b, err := r.ReadByte() + if err != nil { + if i > 0 && err == io.EOF { + err = io.ErrUnexpectedEOF + } + return x, err + } + if b < 0x80 { + if i == binary.MaxVarintLen64-1 && b > 1 { + return x, overflow + } + return x | uint64(b)<<s, nil + } + x |= uint64(b&0x7f) << s + s += 7 + } + return x, overflow +} + +var overflow = errors.New("pkgbits: readUvarint overflows a 64-bit integer") + +func (r *Decoder) rawVarint() int64 { + ux := r.rawUvarint() + + // Zig-zag decode. + x := int64(ux >> 1) + if ux&1 != 0 { + x = ^x + } + return x +} + +func (r *Decoder) rawReloc(k RelocKind, idx int) Index { + e := r.Relocs[idx] + assert(e.Kind == k) + return e.Idx +} + +// Sync decodes a sync marker from the element bitstream and asserts +// that it matches the expected marker. +// +// If r.common.sync is false, then Sync is a no-op. +func (r *Decoder) Sync(mWant SyncMarker) { + if !r.common.sync { + return + } + + pos, _ := r.Data.Seek(0, io.SeekCurrent) + mHave := SyncMarker(r.rawUvarint()) + writerPCs := make([]int, r.rawUvarint()) + for i := range writerPCs { + writerPCs[i] = int(r.rawUvarint()) + } + + if mHave == mWant { + return + } + + // There's some tension here between printing: + // + // (1) full file paths that tools can recognize (e.g., so emacs + // hyperlinks the "file:line" text for easy navigation), or + // + // (2) short file paths that are easier for humans to read (e.g., by + // omitting redundant or irrelevant details, so it's easier to + // focus on the useful bits that remain). + // + // The current formatting favors the former, as it seems more + // helpful in practice. But perhaps the formatting could be improved + // to better address both concerns. For example, use relative file + // paths if they would be shorter, or rewrite file paths to contain + // "$GOROOT" (like objabi.AbsFile does) if tools can be taught how + // to reliably expand that again. + + fmt.Printf("export data desync: package %q, section %v, index %v, offset %v\n", r.common.pkgPath, r.k, r.Idx, pos) + + fmt.Printf("\nfound %v, written at:\n", mHave) + if len(writerPCs) == 0 { + fmt.Printf("\t[stack trace unavailable; recompile package %q with -d=syncframes]\n", r.common.pkgPath) + } + for _, pc := range writerPCs { + fmt.Printf("\t%s\n", r.common.StringIdx(r.rawReloc(RelocString, pc))) + } + + fmt.Printf("\nexpected %v, reading at:\n", mWant) + var readerPCs [32]uintptr // TODO(mdempsky): Dynamically size? + n := runtime.Callers(2, readerPCs[:]) + for _, pc := range fmtFrames(readerPCs[:n]...) { + fmt.Printf("\t%s\n", pc) + } + + // We already printed a stack trace for the reader, so now we can + // simply exit. Printing a second one with panic or base.Fatalf + // would just be noise. + os.Exit(1) +} + +// Bool decodes and returns a bool value from the element bitstream. +func (r *Decoder) Bool() bool { + r.Sync(SyncBool) + x, err := r.Data.ReadByte() + r.checkErr(err) + assert(x < 2) + return x != 0 +} + +// Int64 decodes and returns an int64 value from the element bitstream. +func (r *Decoder) Int64() int64 { + r.Sync(SyncInt64) + return r.rawVarint() +} + +// Uint64 decodes and returns a uint64 value from the element bitstream. +func (r *Decoder) Uint64() uint64 { + r.Sync(SyncUint64) + return r.rawUvarint() +} + +// Len decodes and returns a non-negative int value from the element bitstream. +func (r *Decoder) Len() int { x := r.Uint64(); v := int(x); assert(uint64(v) == x); return v } + +// Int decodes and returns an int value from the element bitstream. +func (r *Decoder) Int() int { x := r.Int64(); v := int(x); assert(int64(v) == x); return v } + +// Uint decodes and returns a uint value from the element bitstream. +func (r *Decoder) Uint() uint { x := r.Uint64(); v := uint(x); assert(uint64(v) == x); return v } + +// Code decodes a Code value from the element bitstream and returns +// its ordinal value. It's the caller's responsibility to convert the +// result to an appropriate Code type. +// +// TODO(mdempsky): Ideally this method would have signature "Code[T +// Code] T" instead, but we don't allow generic methods and the +// compiler can't depend on generics yet anyway. +func (r *Decoder) Code(mark SyncMarker) int { + r.Sync(mark) + return r.Len() +} + +// Reloc decodes a relocation of expected section k from the element +// bitstream and returns an index to the referenced element. +func (r *Decoder) Reloc(k RelocKind) Index { + r.Sync(SyncUseReloc) + return r.rawReloc(k, r.Len()) +} + +// String decodes and returns a string value from the element +// bitstream. +func (r *Decoder) String() string { + r.Sync(SyncString) + return r.common.StringIdx(r.Reloc(RelocString)) +} + +// Strings decodes and returns a variable-length slice of strings from +// the element bitstream. +func (r *Decoder) Strings() []string { + res := make([]string, r.Len()) + for i := range res { + res[i] = r.String() + } + return res +} + +// Value decodes and returns a constant.Value from the element +// bitstream. +func (r *Decoder) Value() constant.Value { + r.Sync(SyncValue) + isComplex := r.Bool() + val := r.scalar() + if isComplex { + val = constant.BinaryOp(val, token.ADD, constant.MakeImag(r.scalar())) + } + return val +} + +func (r *Decoder) scalar() constant.Value { + switch tag := CodeVal(r.Code(SyncVal)); tag { + default: + panic(fmt.Errorf("unexpected scalar tag: %v", tag)) + + case ValBool: + return constant.MakeBool(r.Bool()) + case ValString: + return constant.MakeString(r.String()) + case ValInt64: + return constant.MakeInt64(r.Int64()) + case ValBigInt: + return constant.Make(r.bigInt()) + case ValBigRat: + num := r.bigInt() + denom := r.bigInt() + return constant.Make(new(big.Rat).SetFrac(num, denom)) + case ValBigFloat: + return constant.Make(r.bigFloat()) + } +} + +func (r *Decoder) bigInt() *big.Int { + v := new(big.Int).SetBytes([]byte(r.String())) + if r.Bool() { + v.Neg(v) + } + return v +} + +func (r *Decoder) bigFloat() *big.Float { + v := new(big.Float).SetPrec(512) + assert(v.UnmarshalText([]byte(r.String())) == nil) + return v +} + +// @@@ Helpers + +// TODO(mdempsky): These should probably be removed. I think they're a +// smell that the export data format is not yet quite right. + +// PeekPkgPath returns the package path for the specified package +// index. +func (pr *PkgDecoder) PeekPkgPath(idx Index) string { + var path string + { + r := pr.TempDecoder(RelocPkg, idx, SyncPkgDef) + path = r.String() + pr.RetireDecoder(&r) + } + if path == "" { + path = pr.pkgPath + } + return path +} + +// PeekObj returns the package path, object name, and CodeObj for the +// specified object index. +func (pr *PkgDecoder) PeekObj(idx Index) (string, string, CodeObj) { + var ridx Index + var name string + var rcode int + { + r := pr.TempDecoder(RelocName, idx, SyncObject1) + r.Sync(SyncSym) + r.Sync(SyncPkg) + ridx = r.Reloc(RelocPkg) + name = r.String() + rcode = r.Code(SyncCodeObj) + pr.RetireDecoder(&r) + } + + path := pr.PeekPkgPath(ridx) + assert(name != "") + + tag := CodeObj(rcode) + + return path, name, tag +} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/doc.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/doc.go new file mode 100644 index 00000000000..c8a2796b5e4 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/doc.go @@ -0,0 +1,32 @@ +// Copyright 2022 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 pkgbits implements low-level coding abstractions for +// Unified IR's export data format. +// +// At a low-level, a package is a collection of bitstream elements. +// Each element has a "kind" and a dense, non-negative index. +// Elements can be randomly accessed given their kind and index. +// +// Individual elements are sequences of variable-length values (e.g., +// integers, booleans, strings, go/constant values, cross-references +// to other elements). Package pkgbits provides APIs for encoding and +// decoding these low-level values, but the details of mapping +// higher-level Go constructs into elements is left to higher-level +// abstractions. +// +// Elements may cross-reference each other with "relocations." For +// example, an element representing a pointer type has a relocation +// referring to the element type. +// +// Go constructs may be composed as a constellation of multiple +// elements. For example, a declared function may have one element to +// describe the object (e.g., its name, type, position), and a +// separate element to describe its function body. This allows readers +// some flexibility in efficiently seeking or re-reading data (e.g., +// inlining requires re-reading the function body for each inlined +// call, without needing to re-read the object-level details). +// +// This is a copy of internal/pkgbits in the Go implementation. +package pkgbits diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/encoder.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/encoder.go new file mode 100644 index 00000000000..6482617a4fc --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/encoder.go @@ -0,0 +1,383 @@ +// Copyright 2021 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 pkgbits + +import ( + "bytes" + "crypto/md5" + "encoding/binary" + "go/constant" + "io" + "math/big" + "runtime" +) + +// currentVersion is the current version number. +// +// - v0: initial prototype +// +// - v1: adds the flags uint32 word +const currentVersion uint32 = 1 + +// A PkgEncoder provides methods for encoding a package's Unified IR +// export data. +type PkgEncoder struct { + // elems holds the bitstream for previously encoded elements. + elems [numRelocs][]string + + // stringsIdx maps previously encoded strings to their index within + // the RelocString section, to allow deduplication. That is, + // elems[RelocString][stringsIdx[s]] == s (if present). + stringsIdx map[string]Index + + // syncFrames is the number of frames to write at each sync + // marker. A negative value means sync markers are omitted. + syncFrames int +} + +// SyncMarkers reports whether pw uses sync markers. +func (pw *PkgEncoder) SyncMarkers() bool { return pw.syncFrames >= 0 } + +// NewPkgEncoder returns an initialized PkgEncoder. +// +// syncFrames is the number of caller frames that should be serialized +// at Sync points. Serializing additional frames results in larger +// export data files, but can help diagnosing desync errors in +// higher-level Unified IR reader/writer code. If syncFrames is +// negative, then sync markers are omitted entirely. +func NewPkgEncoder(syncFrames int) PkgEncoder { + return PkgEncoder{ + stringsIdx: make(map[string]Index), + syncFrames: syncFrames, + } +} + +// DumpTo writes the package's encoded data to out0 and returns the +// package fingerprint. +func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) { + h := md5.New() + out := io.MultiWriter(out0, h) + + writeUint32 := func(x uint32) { + assert(binary.Write(out, binary.LittleEndian, x) == nil) + } + + writeUint32(currentVersion) + + var flags uint32 + if pw.SyncMarkers() { + flags |= flagSyncMarkers + } + writeUint32(flags) + + // Write elemEndsEnds. + var sum uint32 + for _, elems := range &pw.elems { + sum += uint32(len(elems)) + writeUint32(sum) + } + + // Write elemEnds. + sum = 0 + for _, elems := range &pw.elems { + for _, elem := range elems { + sum += uint32(len(elem)) + writeUint32(sum) + } + } + + // Write elemData. + for _, elems := range &pw.elems { + for _, elem := range elems { + _, err := io.WriteString(out, elem) + assert(err == nil) + } + } + + // Write fingerprint. + copy(fingerprint[:], h.Sum(nil)) + _, err := out0.Write(fingerprint[:]) + assert(err == nil) + + return +} + +// StringIdx adds a string value to the strings section, if not +// already present, and returns its index. +func (pw *PkgEncoder) StringIdx(s string) Index { + if idx, ok := pw.stringsIdx[s]; ok { + assert(pw.elems[RelocString][idx] == s) + return idx + } + + idx := Index(len(pw.elems[RelocString])) + pw.elems[RelocString] = append(pw.elems[RelocString], s) + pw.stringsIdx[s] = idx + return idx +} + +// NewEncoder returns an Encoder for a new element within the given +// section, and encodes the given SyncMarker as the start of the +// element bitstream. +func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder { + e := pw.NewEncoderRaw(k) + e.Sync(marker) + return e +} + +// NewEncoderRaw returns an Encoder for a new element within the given +// section. +// +// Most callers should use NewEncoder instead. +func (pw *PkgEncoder) NewEncoderRaw(k RelocKind) Encoder { + idx := Index(len(pw.elems[k])) + pw.elems[k] = append(pw.elems[k], "") // placeholder + + return Encoder{ + p: pw, + k: k, + Idx: idx, + } +} + +// An Encoder provides methods for encoding an individual element's +// bitstream data. +type Encoder struct { + p *PkgEncoder + + Relocs []RelocEnt + RelocMap map[RelocEnt]uint32 + Data bytes.Buffer // accumulated element bitstream data + + encodingRelocHeader bool + + k RelocKind + Idx Index // index within relocation section +} + +// Flush finalizes the element's bitstream and returns its Index. +func (w *Encoder) Flush() Index { + var sb bytes.Buffer // TODO(mdempsky): strings.Builder after #44505 is resolved + + // Backup the data so we write the relocations at the front. + var tmp bytes.Buffer + io.Copy(&tmp, &w.Data) + + // TODO(mdempsky): Consider writing these out separately so they're + // easier to strip, along with function bodies, so that we can prune + // down to just the data that's relevant to go/types. + if w.encodingRelocHeader { + panic("encodingRelocHeader already true; recursive flush?") + } + w.encodingRelocHeader = true + w.Sync(SyncRelocs) + w.Len(len(w.Relocs)) + for _, rEnt := range w.Relocs { + w.Sync(SyncReloc) + w.Len(int(rEnt.Kind)) + w.Len(int(rEnt.Idx)) + } + + io.Copy(&sb, &w.Data) + io.Copy(&sb, &tmp) + w.p.elems[w.k][w.Idx] = sb.String() + + return w.Idx +} + +func (w *Encoder) checkErr(err error) { + if err != nil { + errorf("unexpected encoding error: %v", err) + } +} + +func (w *Encoder) rawUvarint(x uint64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutUvarint(buf[:], x) + _, err := w.Data.Write(buf[:n]) + w.checkErr(err) +} + +func (w *Encoder) rawVarint(x int64) { + // Zig-zag encode. + ux := uint64(x) << 1 + if x < 0 { + ux = ^ux + } + + w.rawUvarint(ux) +} + +func (w *Encoder) rawReloc(r RelocKind, idx Index) int { + e := RelocEnt{r, idx} + if w.RelocMap != nil { + if i, ok := w.RelocMap[e]; ok { + return int(i) + } + } else { + w.RelocMap = make(map[RelocEnt]uint32) + } + + i := len(w.Relocs) + w.RelocMap[e] = uint32(i) + w.Relocs = append(w.Relocs, e) + return i +} + +func (w *Encoder) Sync(m SyncMarker) { + if !w.p.SyncMarkers() { + return + } + + // Writing out stack frame string references requires working + // relocations, but writing out the relocations themselves involves + // sync markers. To prevent infinite recursion, we simply trim the + // stack frame for sync markers within the relocation header. + var frames []string + if !w.encodingRelocHeader && w.p.syncFrames > 0 { + pcs := make([]uintptr, w.p.syncFrames) + n := runtime.Callers(2, pcs) + frames = fmtFrames(pcs[:n]...) + } + + // TODO(mdempsky): Save space by writing out stack frames as a + // linked list so we can share common stack frames. + w.rawUvarint(uint64(m)) + w.rawUvarint(uint64(len(frames))) + for _, frame := range frames { + w.rawUvarint(uint64(w.rawReloc(RelocString, w.p.StringIdx(frame)))) + } +} + +// Bool encodes and writes a bool value into the element bitstream, +// and then returns the bool value. +// +// For simple, 2-alternative encodings, the idiomatic way to call Bool +// is something like: +// +// if w.Bool(x != 0) { +// // alternative #1 +// } else { +// // alternative #2 +// } +// +// For multi-alternative encodings, use Code instead. +func (w *Encoder) Bool(b bool) bool { + w.Sync(SyncBool) + var x byte + if b { + x = 1 + } + err := w.Data.WriteByte(x) + w.checkErr(err) + return b +} + +// Int64 encodes and writes an int64 value into the element bitstream. +func (w *Encoder) Int64(x int64) { + w.Sync(SyncInt64) + w.rawVarint(x) +} + +// Uint64 encodes and writes a uint64 value into the element bitstream. +func (w *Encoder) Uint64(x uint64) { + w.Sync(SyncUint64) + w.rawUvarint(x) +} + +// Len encodes and writes a non-negative int value into the element bitstream. +func (w *Encoder) Len(x int) { assert(x >= 0); w.Uint64(uint64(x)) } + +// Int encodes and writes an int value into the element bitstream. +func (w *Encoder) Int(x int) { w.Int64(int64(x)) } + +// Uint encodes and writes a uint value into the element bitstream. +func (w *Encoder) Uint(x uint) { w.Uint64(uint64(x)) } + +// Reloc encodes and writes a relocation for the given (section, +// index) pair into the element bitstream. +// +// Note: Only the index is formally written into the element +// bitstream, so bitstream decoders must know from context which +// section an encoded relocation refers to. +func (w *Encoder) Reloc(r RelocKind, idx Index) { + w.Sync(SyncUseReloc) + w.Len(w.rawReloc(r, idx)) +} + +// Code encodes and writes a Code value into the element bitstream. +func (w *Encoder) Code(c Code) { + w.Sync(c.Marker()) + w.Len(c.Value()) +} + +// String encodes and writes a string value into the element +// bitstream. +// +// Internally, strings are deduplicated by adding them to the strings +// section (if not already present), and then writing a relocation +// into the element bitstream. +func (w *Encoder) String(s string) { + w.Sync(SyncString) + w.Reloc(RelocString, w.p.StringIdx(s)) +} + +// Strings encodes and writes a variable-length slice of strings into +// the element bitstream. +func (w *Encoder) Strings(ss []string) { + w.Len(len(ss)) + for _, s := range ss { + w.String(s) + } +} + +// Value encodes and writes a constant.Value into the element +// bitstream. +func (w *Encoder) Value(val constant.Value) { + w.Sync(SyncValue) + if w.Bool(val.Kind() == constant.Complex) { + w.scalar(constant.Real(val)) + w.scalar(constant.Imag(val)) + } else { + w.scalar(val) + } +} + +func (w *Encoder) scalar(val constant.Value) { + switch v := constant.Val(val).(type) { + default: + errorf("unhandled %v (%v)", val, val.Kind()) + case bool: + w.Code(ValBool) + w.Bool(v) + case string: + w.Code(ValString) + w.String(v) + case int64: + w.Code(ValInt64) + w.Int64(v) + case *big.Int: + w.Code(ValBigInt) + w.bigInt(v) + case *big.Rat: + w.Code(ValBigRat) + w.bigInt(v.Num()) + w.bigInt(v.Denom()) + case *big.Float: + w.Code(ValBigFloat) + w.bigFloat(v) + } +} + +func (w *Encoder) bigInt(v *big.Int) { + b := v.Bytes() + w.String(string(b)) // TODO: More efficient encoding. + w.Bool(v.Sign() < 0) +} + +func (w *Encoder) bigFloat(v *big.Float) { + b := v.Append(nil, 'p', -1) + w.String(string(b)) // TODO: More efficient encoding. +} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/flags.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/flags.go new file mode 100644 index 00000000000..654222745fa --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/flags.go @@ -0,0 +1,9 @@ +// Copyright 2022 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 pkgbits + +const ( + flagSyncMarkers = 1 << iota // file format contains sync markers +) diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go new file mode 100644 index 00000000000..5294f6a63ed --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go @@ -0,0 +1,21 @@ +// Copyright 2021 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 !go1.7 +// +build !go1.7 + +// TODO(mdempsky): Remove after #44505 is resolved + +package pkgbits + +import "runtime" + +func walkFrames(pcs []uintptr, visit frameVisitor) { + for _, pc := range pcs { + fn := runtime.FuncForPC(pc) + file, line := fn.FileLine(pc) + + visit(file, line, fn.Name(), pc-fn.Entry()) + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go new file mode 100644 index 00000000000..2324ae7adfe --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go @@ -0,0 +1,28 @@ +// Copyright 2021 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 go1.7 +// +build go1.7 + +package pkgbits + +import "runtime" + +// walkFrames calls visit for each call frame represented by pcs. +// +// pcs should be a slice of PCs, as returned by runtime.Callers. +func walkFrames(pcs []uintptr, visit frameVisitor) { + if len(pcs) == 0 { + return + } + + frames := runtime.CallersFrames(pcs) + for { + frame, more := frames.Next() + visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry) + if !more { + return + } + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/reloc.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/reloc.go new file mode 100644 index 00000000000..fcdfb97ca99 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/reloc.go @@ -0,0 +1,42 @@ +// Copyright 2021 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 pkgbits + +// A RelocKind indicates a particular section within a unified IR export. +type RelocKind int32 + +// An Index represents a bitstream element index within a particular +// section. +type Index int32 + +// A relocEnt (relocation entry) is an entry in an element's local +// reference table. +// +// TODO(mdempsky): Rename this too. +type RelocEnt struct { + Kind RelocKind + Idx Index +} + +// Reserved indices within the meta relocation section. +const ( + PublicRootIdx Index = 0 + PrivateRootIdx Index = 1 +) + +const ( + RelocString RelocKind = iota + RelocMeta + RelocPosBase + RelocPkg + RelocName + RelocType + RelocObj + RelocObjExt + RelocObjDict + RelocBody + + numRelocs = iota +) diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/support.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/support.go new file mode 100644 index 00000000000..ad26d3b28ca --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/support.go @@ -0,0 +1,17 @@ +// Copyright 2022 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 pkgbits + +import "fmt" + +func assert(b bool) { + if !b { + panic("assertion failed") + } +} + +func errorf(format string, args ...interface{}) { + panic(fmt.Errorf(format, args...)) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/sync.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/sync.go new file mode 100644 index 00000000000..5bd51ef7170 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/sync.go @@ -0,0 +1,113 @@ +// Copyright 2021 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 pkgbits + +import ( + "fmt" + "strings" +) + +// fmtFrames formats a backtrace for reporting reader/writer desyncs. +func fmtFrames(pcs ...uintptr) []string { + res := make([]string, 0, len(pcs)) + walkFrames(pcs, func(file string, line int, name string, offset uintptr) { + // Trim package from function name. It's just redundant noise. + name = strings.TrimPrefix(name, "cmd/compile/internal/noder.") + + res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset)) + }) + return res +} + +type frameVisitor func(file string, line int, name string, offset uintptr) + +// SyncMarker is an enum type that represents markers that may be +// written to export data to ensure the reader and writer stay +// synchronized. +type SyncMarker int + +//go:generate stringer -type=SyncMarker -trimprefix=Sync + +const ( + _ SyncMarker = iota + + // Public markers (known to go/types importers). + + // Low-level coding markers. + SyncEOF + SyncBool + SyncInt64 + SyncUint64 + SyncString + SyncValue + SyncVal + SyncRelocs + SyncReloc + SyncUseReloc + + // Higher-level object and type markers. + SyncPublic + SyncPos + SyncPosBase + SyncObject + SyncObject1 + SyncPkg + SyncPkgDef + SyncMethod + SyncType + SyncTypeIdx + SyncTypeParamNames + SyncSignature + SyncParams + SyncParam + SyncCodeObj + SyncSym + SyncLocalIdent + SyncSelector + + // Private markers (only known to cmd/compile). + SyncPrivate + + SyncFuncExt + SyncVarExt + SyncTypeExt + SyncPragma + + SyncExprList + SyncExprs + SyncExpr + SyncExprType + SyncAssign + SyncOp + SyncFuncLit + SyncCompLit + + SyncDecl + SyncFuncBody + SyncOpenScope + SyncCloseScope + SyncCloseAnotherScope + SyncDeclNames + SyncDeclName + + SyncStmts + SyncBlockStmt + SyncIfStmt + SyncForStmt + SyncSwitchStmt + SyncRangeStmt + SyncCaseClause + SyncCommClause + SyncSelectStmt + SyncDecls + SyncLabeledStmt + SyncUseObjLocal + SyncAddLocal + SyncLinkname + SyncStmt1 + SyncStmtsEnd + SyncLabel + SyncOptLabel +) diff --git a/upstream/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go b/upstream/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go new file mode 100644 index 00000000000..4a5b0ca5f2f --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go @@ -0,0 +1,89 @@ +// Code generated by "stringer -type=SyncMarker -trimprefix=Sync"; DO NOT EDIT. + +package pkgbits + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[SyncEOF-1] + _ = x[SyncBool-2] + _ = x[SyncInt64-3] + _ = x[SyncUint64-4] + _ = x[SyncString-5] + _ = x[SyncValue-6] + _ = x[SyncVal-7] + _ = x[SyncRelocs-8] + _ = x[SyncReloc-9] + _ = x[SyncUseReloc-10] + _ = x[SyncPublic-11] + _ = x[SyncPos-12] + _ = x[SyncPosBase-13] + _ = x[SyncObject-14] + _ = x[SyncObject1-15] + _ = x[SyncPkg-16] + _ = x[SyncPkgDef-17] + _ = x[SyncMethod-18] + _ = x[SyncType-19] + _ = x[SyncTypeIdx-20] + _ = x[SyncTypeParamNames-21] + _ = x[SyncSignature-22] + _ = x[SyncParams-23] + _ = x[SyncParam-24] + _ = x[SyncCodeObj-25] + _ = x[SyncSym-26] + _ = x[SyncLocalIdent-27] + _ = x[SyncSelector-28] + _ = x[SyncPrivate-29] + _ = x[SyncFuncExt-30] + _ = x[SyncVarExt-31] + _ = x[SyncTypeExt-32] + _ = x[SyncPragma-33] + _ = x[SyncExprList-34] + _ = x[SyncExprs-35] + _ = x[SyncExpr-36] + _ = x[SyncExprType-37] + _ = x[SyncAssign-38] + _ = x[SyncOp-39] + _ = x[SyncFuncLit-40] + _ = x[SyncCompLit-41] + _ = x[SyncDecl-42] + _ = x[SyncFuncBody-43] + _ = x[SyncOpenScope-44] + _ = x[SyncCloseScope-45] + _ = x[SyncCloseAnotherScope-46] + _ = x[SyncDeclNames-47] + _ = x[SyncDeclName-48] + _ = x[SyncStmts-49] + _ = x[SyncBlockStmt-50] + _ = x[SyncIfStmt-51] + _ = x[SyncForStmt-52] + _ = x[SyncSwitchStmt-53] + _ = x[SyncRangeStmt-54] + _ = x[SyncCaseClause-55] + _ = x[SyncCommClause-56] + _ = x[SyncSelectStmt-57] + _ = x[SyncDecls-58] + _ = x[SyncLabeledStmt-59] + _ = x[SyncUseObjLocal-60] + _ = x[SyncAddLocal-61] + _ = x[SyncLinkname-62] + _ = x[SyncStmt1-63] + _ = x[SyncStmtsEnd-64] + _ = x[SyncLabel-65] + _ = x[SyncOptLabel-66] +} + +const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprExprTypeAssignOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabel" + +var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 226, 232, 234, 241, 248, 252, 260, 269, 279, 296, 305, 313, 318, 327, 333, 340, 350, 359, 369, 379, 389, 394, 405, 416, 424, 432, 437, 445, 450, 458} + +func (i SyncMarker) String() string { + i -= 1 + if i < 0 || i >= SyncMarker(len(_SyncMarker_index)-1) { + return "SyncMarker(" + strconv.FormatInt(int64(i+1), 10) + ")" + } + return _SyncMarker_name[_SyncMarker_index[i]:_SyncMarker_index[i+1]] +} diff --git a/upstream/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/upstream/vendor/golang.org/x/tools/internal/stdlib/manifest.go deleted file mode 100644 index fd6892075ee..00000000000 --- a/upstream/vendor/golang.org/x/tools/internal/stdlib/manifest.go +++ /dev/null @@ -1,17320 +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. - -// Code generated by generate.go. DO NOT EDIT. - -package stdlib - -var PackageSymbols = map[string][]Symbol{ - "archive/tar": { - {"(*Header).FileInfo", Method, 1}, - {"(*Reader).Next", Method, 0}, - {"(*Reader).Read", Method, 0}, - {"(*Writer).AddFS", Method, 22}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).Flush", Method, 0}, - {"(*Writer).Write", Method, 0}, - {"(*Writer).WriteHeader", Method, 0}, - {"(Format).String", Method, 10}, - {"ErrFieldTooLong", Var, 0}, - {"ErrHeader", Var, 0}, - {"ErrInsecurePath", Var, 20}, - {"ErrWriteAfterClose", Var, 0}, - {"ErrWriteTooLong", Var, 0}, - {"FileInfoHeader", Func, 1}, - {"Format", Type, 10}, - {"FormatGNU", Const, 10}, - {"FormatPAX", Const, 10}, - {"FormatUSTAR", Const, 10}, - {"FormatUnknown", Const, 10}, - {"Header", Type, 0}, - {"Header.AccessTime", Field, 0}, - {"Header.ChangeTime", Field, 0}, - {"Header.Devmajor", Field, 0}, - {"Header.Devminor", Field, 0}, - {"Header.Format", Field, 10}, - {"Header.Gid", Field, 0}, - {"Header.Gname", Field, 0}, - {"Header.Linkname", Field, 0}, - {"Header.ModTime", Field, 0}, - {"Header.Mode", Field, 0}, - {"Header.Name", Field, 0}, - {"Header.PAXRecords", Field, 10}, - {"Header.Size", Field, 0}, - {"Header.Typeflag", Field, 0}, - {"Header.Uid", Field, 0}, - {"Header.Uname", Field, 0}, - {"Header.Xattrs", Field, 3}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"Reader", Type, 0}, - {"TypeBlock", Const, 0}, - {"TypeChar", Const, 0}, - {"TypeCont", Const, 0}, - {"TypeDir", Const, 0}, - {"TypeFifo", Const, 0}, - {"TypeGNULongLink", Const, 1}, - {"TypeGNULongName", Const, 1}, - {"TypeGNUSparse", Const, 3}, - {"TypeLink", Const, 0}, - {"TypeReg", Const, 0}, - {"TypeRegA", Const, 0}, - {"TypeSymlink", Const, 0}, - {"TypeXGlobalHeader", Const, 0}, - {"TypeXHeader", Const, 0}, - {"Writer", Type, 0}, - }, - "archive/zip": { - {"(*File).DataOffset", Method, 2}, - {"(*File).FileInfo", Method, 0}, - {"(*File).ModTime", Method, 0}, - {"(*File).Mode", Method, 0}, - {"(*File).Open", Method, 0}, - {"(*File).OpenRaw", Method, 17}, - {"(*File).SetModTime", Method, 0}, - {"(*File).SetMode", Method, 0}, - {"(*FileHeader).FileInfo", Method, 0}, - {"(*FileHeader).ModTime", Method, 0}, - {"(*FileHeader).Mode", Method, 0}, - {"(*FileHeader).SetModTime", Method, 0}, - {"(*FileHeader).SetMode", Method, 0}, - {"(*ReadCloser).Close", Method, 0}, - {"(*ReadCloser).Open", Method, 16}, - {"(*ReadCloser).RegisterDecompressor", Method, 6}, - {"(*Reader).Open", Method, 16}, - {"(*Reader).RegisterDecompressor", Method, 6}, - {"(*Writer).AddFS", Method, 22}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).Copy", Method, 17}, - {"(*Writer).Create", Method, 0}, - {"(*Writer).CreateHeader", Method, 0}, - {"(*Writer).CreateRaw", Method, 17}, - {"(*Writer).Flush", Method, 4}, - {"(*Writer).RegisterCompressor", Method, 6}, - {"(*Writer).SetComment", Method, 10}, - {"(*Writer).SetOffset", Method, 5}, - {"Compressor", Type, 2}, - {"Decompressor", Type, 2}, - {"Deflate", Const, 0}, - {"ErrAlgorithm", Var, 0}, - {"ErrChecksum", Var, 0}, - {"ErrFormat", Var, 0}, - {"ErrInsecurePath", Var, 20}, - {"File", Type, 0}, - {"File.FileHeader", Field, 0}, - {"FileHeader", Type, 0}, - {"FileHeader.CRC32", Field, 0}, - {"FileHeader.Comment", Field, 0}, - {"FileHeader.CompressedSize", Field, 0}, - {"FileHeader.CompressedSize64", Field, 1}, - {"FileHeader.CreatorVersion", Field, 0}, - {"FileHeader.ExternalAttrs", Field, 0}, - {"FileHeader.Extra", Field, 0}, - {"FileHeader.Flags", Field, 0}, - {"FileHeader.Method", Field, 0}, - {"FileHeader.Modified", Field, 10}, - {"FileHeader.ModifiedDate", Field, 0}, - {"FileHeader.ModifiedTime", Field, 0}, - {"FileHeader.Name", Field, 0}, - {"FileHeader.NonUTF8", Field, 10}, - {"FileHeader.ReaderVersion", Field, 0}, - {"FileHeader.UncompressedSize", Field, 0}, - {"FileHeader.UncompressedSize64", Field, 1}, - {"FileInfoHeader", Func, 0}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"OpenReader", Func, 0}, - {"ReadCloser", Type, 0}, - {"ReadCloser.Reader", Field, 0}, - {"Reader", Type, 0}, - {"Reader.Comment", Field, 0}, - {"Reader.File", Field, 0}, - {"RegisterCompressor", Func, 2}, - {"RegisterDecompressor", Func, 2}, - {"Store", Const, 0}, - {"Writer", Type, 0}, - }, - "bufio": { - {"(*Reader).Buffered", Method, 0}, - {"(*Reader).Discard", Method, 5}, - {"(*Reader).Peek", Method, 0}, - {"(*Reader).Read", Method, 0}, - {"(*Reader).ReadByte", Method, 0}, - {"(*Reader).ReadBytes", Method, 0}, - {"(*Reader).ReadLine", Method, 0}, - {"(*Reader).ReadRune", Method, 0}, - {"(*Reader).ReadSlice", Method, 0}, - {"(*Reader).ReadString", Method, 0}, - {"(*Reader).Reset", Method, 2}, - {"(*Reader).Size", Method, 10}, - {"(*Reader).UnreadByte", Method, 0}, - {"(*Reader).UnreadRune", Method, 0}, - {"(*Reader).WriteTo", Method, 1}, - {"(*Scanner).Buffer", Method, 6}, - {"(*Scanner).Bytes", Method, 1}, - {"(*Scanner).Err", Method, 1}, - {"(*Scanner).Scan", Method, 1}, - {"(*Scanner).Split", Method, 1}, - {"(*Scanner).Text", Method, 1}, - {"(*Writer).Available", Method, 0}, - {"(*Writer).AvailableBuffer", Method, 18}, - {"(*Writer).Buffered", Method, 0}, - {"(*Writer).Flush", Method, 0}, - {"(*Writer).ReadFrom", Method, 1}, - {"(*Writer).Reset", Method, 2}, - {"(*Writer).Size", Method, 10}, - {"(*Writer).Write", Method, 0}, - {"(*Writer).WriteByte", Method, 0}, - {"(*Writer).WriteRune", Method, 0}, - {"(*Writer).WriteString", Method, 0}, - {"(ReadWriter).Available", Method, 0}, - {"(ReadWriter).AvailableBuffer", Method, 18}, - {"(ReadWriter).Discard", Method, 5}, - {"(ReadWriter).Flush", Method, 0}, - {"(ReadWriter).Peek", Method, 0}, - {"(ReadWriter).Read", Method, 0}, - {"(ReadWriter).ReadByte", Method, 0}, - {"(ReadWriter).ReadBytes", Method, 0}, - {"(ReadWriter).ReadFrom", Method, 1}, - {"(ReadWriter).ReadLine", Method, 0}, - {"(ReadWriter).ReadRune", Method, 0}, - {"(ReadWriter).ReadSlice", Method, 0}, - {"(ReadWriter).ReadString", Method, 0}, - {"(ReadWriter).UnreadByte", Method, 0}, - {"(ReadWriter).UnreadRune", Method, 0}, - {"(ReadWriter).Write", Method, 0}, - {"(ReadWriter).WriteByte", Method, 0}, - {"(ReadWriter).WriteRune", Method, 0}, - {"(ReadWriter).WriteString", Method, 0}, - {"(ReadWriter).WriteTo", Method, 1}, - {"ErrAdvanceTooFar", Var, 1}, - {"ErrBadReadCount", Var, 15}, - {"ErrBufferFull", Var, 0}, - {"ErrFinalToken", Var, 6}, - {"ErrInvalidUnreadByte", Var, 0}, - {"ErrInvalidUnreadRune", Var, 0}, - {"ErrNegativeAdvance", Var, 1}, - {"ErrNegativeCount", Var, 0}, - {"ErrTooLong", Var, 1}, - {"MaxScanTokenSize", Const, 1}, - {"NewReadWriter", Func, 0}, - {"NewReader", Func, 0}, - {"NewReaderSize", Func, 0}, - {"NewScanner", Func, 1}, - {"NewWriter", Func, 0}, - {"NewWriterSize", Func, 0}, - {"ReadWriter", Type, 0}, - {"ReadWriter.Reader", Field, 0}, - {"ReadWriter.Writer", Field, 0}, - {"Reader", Type, 0}, - {"ScanBytes", Func, 1}, - {"ScanLines", Func, 1}, - {"ScanRunes", Func, 1}, - {"ScanWords", Func, 1}, - {"Scanner", Type, 1}, - {"SplitFunc", Type, 1}, - {"Writer", Type, 0}, - }, - "bytes": { - {"(*Buffer).Available", Method, 21}, - {"(*Buffer).AvailableBuffer", Method, 21}, - {"(*Buffer).Bytes", Method, 0}, - {"(*Buffer).Cap", Method, 5}, - {"(*Buffer).Grow", Method, 1}, - {"(*Buffer).Len", Method, 0}, - {"(*Buffer).Next", Method, 0}, - {"(*Buffer).Read", Method, 0}, - {"(*Buffer).ReadByte", Method, 0}, - {"(*Buffer).ReadBytes", Method, 0}, - {"(*Buffer).ReadFrom", Method, 0}, - {"(*Buffer).ReadRune", Method, 0}, - {"(*Buffer).ReadString", Method, 0}, - {"(*Buffer).Reset", Method, 0}, - {"(*Buffer).String", Method, 0}, - {"(*Buffer).Truncate", Method, 0}, - {"(*Buffer).UnreadByte", Method, 0}, - {"(*Buffer).UnreadRune", Method, 0}, - {"(*Buffer).Write", Method, 0}, - {"(*Buffer).WriteByte", Method, 0}, - {"(*Buffer).WriteRune", Method, 0}, - {"(*Buffer).WriteString", Method, 0}, - {"(*Buffer).WriteTo", Method, 0}, - {"(*Reader).Len", Method, 0}, - {"(*Reader).Read", Method, 0}, - {"(*Reader).ReadAt", Method, 0}, - {"(*Reader).ReadByte", Method, 0}, - {"(*Reader).ReadRune", Method, 0}, - {"(*Reader).Reset", Method, 7}, - {"(*Reader).Seek", Method, 0}, - {"(*Reader).Size", Method, 5}, - {"(*Reader).UnreadByte", Method, 0}, - {"(*Reader).UnreadRune", Method, 0}, - {"(*Reader).WriteTo", Method, 1}, - {"Buffer", Type, 0}, - {"Clone", Func, 20}, - {"Compare", Func, 0}, - {"Contains", Func, 0}, - {"ContainsAny", Func, 7}, - {"ContainsFunc", Func, 21}, - {"ContainsRune", Func, 7}, - {"Count", Func, 0}, - {"Cut", Func, 18}, - {"CutPrefix", Func, 20}, - {"CutSuffix", Func, 20}, - {"Equal", Func, 0}, - {"EqualFold", Func, 0}, - {"ErrTooLarge", Var, 0}, - {"Fields", Func, 0}, - {"FieldsFunc", Func, 0}, - {"HasPrefix", Func, 0}, - {"HasSuffix", Func, 0}, - {"Index", Func, 0}, - {"IndexAny", Func, 0}, - {"IndexByte", Func, 0}, - {"IndexFunc", Func, 0}, - {"IndexRune", Func, 0}, - {"Join", Func, 0}, - {"LastIndex", Func, 0}, - {"LastIndexAny", Func, 0}, - {"LastIndexByte", Func, 5}, - {"LastIndexFunc", Func, 0}, - {"Map", Func, 0}, - {"MinRead", Const, 0}, - {"NewBuffer", Func, 0}, - {"NewBufferString", Func, 0}, - {"NewReader", Func, 0}, - {"Reader", Type, 0}, - {"Repeat", Func, 0}, - {"Replace", Func, 0}, - {"ReplaceAll", Func, 12}, - {"Runes", Func, 0}, - {"Split", Func, 0}, - {"SplitAfter", Func, 0}, - {"SplitAfterN", Func, 0}, - {"SplitN", Func, 0}, - {"Title", Func, 0}, - {"ToLower", Func, 0}, - {"ToLowerSpecial", Func, 0}, - {"ToTitle", Func, 0}, - {"ToTitleSpecial", Func, 0}, - {"ToUpper", Func, 0}, - {"ToUpperSpecial", Func, 0}, - {"ToValidUTF8", Func, 13}, - {"Trim", Func, 0}, - {"TrimFunc", Func, 0}, - {"TrimLeft", Func, 0}, - {"TrimLeftFunc", Func, 0}, - {"TrimPrefix", Func, 1}, - {"TrimRight", Func, 0}, - {"TrimRightFunc", Func, 0}, - {"TrimSpace", Func, 0}, - {"TrimSuffix", Func, 1}, - }, - "cmp": { - {"Compare", Func, 21}, - {"Less", Func, 21}, - {"Or", Func, 22}, - {"Ordered", Type, 21}, - }, - "compress/bzip2": { - {"(StructuralError).Error", Method, 0}, - {"NewReader", Func, 0}, - {"StructuralError", Type, 0}, - }, - "compress/flate": { - {"(*ReadError).Error", Method, 0}, - {"(*WriteError).Error", Method, 0}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).Flush", Method, 0}, - {"(*Writer).Reset", Method, 2}, - {"(*Writer).Write", Method, 0}, - {"(CorruptInputError).Error", Method, 0}, - {"(InternalError).Error", Method, 0}, - {"BestCompression", Const, 0}, - {"BestSpeed", Const, 0}, - {"CorruptInputError", Type, 0}, - {"DefaultCompression", Const, 0}, - {"HuffmanOnly", Const, 7}, - {"InternalError", Type, 0}, - {"NewReader", Func, 0}, - {"NewReaderDict", Func, 0}, - {"NewWriter", Func, 0}, - {"NewWriterDict", Func, 0}, - {"NoCompression", Const, 0}, - {"ReadError", Type, 0}, - {"ReadError.Err", Field, 0}, - {"ReadError.Offset", Field, 0}, - {"Reader", Type, 0}, - {"Resetter", Type, 4}, - {"WriteError", Type, 0}, - {"WriteError.Err", Field, 0}, - {"WriteError.Offset", Field, 0}, - {"Writer", Type, 0}, - }, - "compress/gzip": { - {"(*Reader).Close", Method, 0}, - {"(*Reader).Multistream", Method, 4}, - {"(*Reader).Read", Method, 0}, - {"(*Reader).Reset", Method, 3}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).Flush", Method, 1}, - {"(*Writer).Reset", Method, 2}, - {"(*Writer).Write", Method, 0}, - {"BestCompression", Const, 0}, - {"BestSpeed", Const, 0}, - {"DefaultCompression", Const, 0}, - {"ErrChecksum", Var, 0}, - {"ErrHeader", Var, 0}, - {"Header", Type, 0}, - {"Header.Comment", Field, 0}, - {"Header.Extra", Field, 0}, - {"Header.ModTime", Field, 0}, - {"Header.Name", Field, 0}, - {"Header.OS", Field, 0}, - {"HuffmanOnly", Const, 8}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"NewWriterLevel", Func, 0}, - {"NoCompression", Const, 0}, - {"Reader", Type, 0}, - {"Reader.Header", Field, 0}, - {"Writer", Type, 0}, - {"Writer.Header", Field, 0}, - }, - "compress/lzw": { - {"(*Reader).Close", Method, 17}, - {"(*Reader).Read", Method, 17}, - {"(*Reader).Reset", Method, 17}, - {"(*Writer).Close", Method, 17}, - {"(*Writer).Reset", Method, 17}, - {"(*Writer).Write", Method, 17}, - {"LSB", Const, 0}, - {"MSB", Const, 0}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"Order", Type, 0}, - {"Reader", Type, 17}, - {"Writer", Type, 17}, - }, - "compress/zlib": { - {"(*Writer).Close", Method, 0}, - {"(*Writer).Flush", Method, 0}, - {"(*Writer).Reset", Method, 2}, - {"(*Writer).Write", Method, 0}, - {"BestCompression", Const, 0}, - {"BestSpeed", Const, 0}, - {"DefaultCompression", Const, 0}, - {"ErrChecksum", Var, 0}, - {"ErrDictionary", Var, 0}, - {"ErrHeader", Var, 0}, - {"HuffmanOnly", Const, 8}, - {"NewReader", Func, 0}, - {"NewReaderDict", Func, 0}, - {"NewWriter", Func, 0}, - {"NewWriterLevel", Func, 0}, - {"NewWriterLevelDict", Func, 0}, - {"NoCompression", Const, 0}, - {"Resetter", Type, 4}, - {"Writer", Type, 0}, - }, - "container/heap": { - {"Fix", Func, 2}, - {"Init", Func, 0}, - {"Interface", Type, 0}, - {"Pop", Func, 0}, - {"Push", Func, 0}, - {"Remove", Func, 0}, - }, - "container/list": { - {"(*Element).Next", Method, 0}, - {"(*Element).Prev", Method, 0}, - {"(*List).Back", Method, 0}, - {"(*List).Front", Method, 0}, - {"(*List).Init", Method, 0}, - {"(*List).InsertAfter", Method, 0}, - {"(*List).InsertBefore", Method, 0}, - {"(*List).Len", Method, 0}, - {"(*List).MoveAfter", Method, 2}, - {"(*List).MoveBefore", Method, 2}, - {"(*List).MoveToBack", Method, 0}, - {"(*List).MoveToFront", Method, 0}, - {"(*List).PushBack", Method, 0}, - {"(*List).PushBackList", Method, 0}, - {"(*List).PushFront", Method, 0}, - {"(*List).PushFrontList", Method, 0}, - {"(*List).Remove", Method, 0}, - {"Element", Type, 0}, - {"Element.Value", Field, 0}, - {"List", Type, 0}, - {"New", Func, 0}, - }, - "container/ring": { - {"(*Ring).Do", Method, 0}, - {"(*Ring).Len", Method, 0}, - {"(*Ring).Link", Method, 0}, - {"(*Ring).Move", Method, 0}, - {"(*Ring).Next", Method, 0}, - {"(*Ring).Prev", Method, 0}, - {"(*Ring).Unlink", Method, 0}, - {"New", Func, 0}, - {"Ring", Type, 0}, - {"Ring.Value", Field, 0}, - }, - "context": { - {"AfterFunc", Func, 21}, - {"Background", Func, 7}, - {"CancelCauseFunc", Type, 20}, - {"CancelFunc", Type, 7}, - {"Canceled", Var, 7}, - {"Cause", Func, 20}, - {"Context", Type, 7}, - {"DeadlineExceeded", Var, 7}, - {"TODO", Func, 7}, - {"WithCancel", Func, 7}, - {"WithCancelCause", Func, 20}, - {"WithDeadline", Func, 7}, - {"WithDeadlineCause", Func, 21}, - {"WithTimeout", Func, 7}, - {"WithTimeoutCause", Func, 21}, - {"WithValue", Func, 7}, - {"WithoutCancel", Func, 21}, - }, - "crypto": { - {"(Hash).Available", Method, 0}, - {"(Hash).HashFunc", Method, 4}, - {"(Hash).New", Method, 0}, - {"(Hash).Size", Method, 0}, - {"(Hash).String", Method, 15}, - {"BLAKE2b_256", Const, 9}, - {"BLAKE2b_384", Const, 9}, - {"BLAKE2b_512", Const, 9}, - {"BLAKE2s_256", Const, 9}, - {"Decrypter", Type, 5}, - {"DecrypterOpts", Type, 5}, - {"Hash", Type, 0}, - {"MD4", Const, 0}, - {"MD5", Const, 0}, - {"MD5SHA1", Const, 0}, - {"PrivateKey", Type, 0}, - {"PublicKey", Type, 2}, - {"RIPEMD160", Const, 0}, - {"RegisterHash", Func, 0}, - {"SHA1", Const, 0}, - {"SHA224", Const, 0}, - {"SHA256", Const, 0}, - {"SHA384", Const, 0}, - {"SHA3_224", Const, 4}, - {"SHA3_256", Const, 4}, - {"SHA3_384", Const, 4}, - {"SHA3_512", Const, 4}, - {"SHA512", Const, 0}, - {"SHA512_224", Const, 5}, - {"SHA512_256", Const, 5}, - {"Signer", Type, 4}, - {"SignerOpts", Type, 4}, - }, - "crypto/aes": { - {"(KeySizeError).Error", Method, 0}, - {"BlockSize", Const, 0}, - {"KeySizeError", Type, 0}, - {"NewCipher", Func, 0}, - }, - "crypto/cipher": { - {"(StreamReader).Read", Method, 0}, - {"(StreamWriter).Close", Method, 0}, - {"(StreamWriter).Write", Method, 0}, - {"AEAD", Type, 2}, - {"Block", Type, 0}, - {"BlockMode", Type, 0}, - {"NewCBCDecrypter", Func, 0}, - {"NewCBCEncrypter", Func, 0}, - {"NewCFBDecrypter", Func, 0}, - {"NewCFBEncrypter", Func, 0}, - {"NewCTR", Func, 0}, - {"NewGCM", Func, 2}, - {"NewGCMWithNonceSize", Func, 5}, - {"NewGCMWithTagSize", Func, 11}, - {"NewOFB", Func, 0}, - {"Stream", Type, 0}, - {"StreamReader", Type, 0}, - {"StreamReader.R", Field, 0}, - {"StreamReader.S", Field, 0}, - {"StreamWriter", Type, 0}, - {"StreamWriter.Err", Field, 0}, - {"StreamWriter.S", Field, 0}, - {"StreamWriter.W", Field, 0}, - }, - "crypto/des": { - {"(KeySizeError).Error", Method, 0}, - {"BlockSize", Const, 0}, - {"KeySizeError", Type, 0}, - {"NewCipher", Func, 0}, - {"NewTripleDESCipher", Func, 0}, - }, - "crypto/dsa": { - {"ErrInvalidPublicKey", Var, 0}, - {"GenerateKey", Func, 0}, - {"GenerateParameters", Func, 0}, - {"L1024N160", Const, 0}, - {"L2048N224", Const, 0}, - {"L2048N256", Const, 0}, - {"L3072N256", Const, 0}, - {"ParameterSizes", Type, 0}, - {"Parameters", Type, 0}, - {"Parameters.G", Field, 0}, - {"Parameters.P", Field, 0}, - {"Parameters.Q", Field, 0}, - {"PrivateKey", Type, 0}, - {"PrivateKey.PublicKey", Field, 0}, - {"PrivateKey.X", Field, 0}, - {"PublicKey", Type, 0}, - {"PublicKey.Parameters", Field, 0}, - {"PublicKey.Y", Field, 0}, - {"Sign", Func, 0}, - {"Verify", Func, 0}, - }, - "crypto/ecdh": { - {"(*PrivateKey).Bytes", Method, 20}, - {"(*PrivateKey).Curve", Method, 20}, - {"(*PrivateKey).ECDH", Method, 20}, - {"(*PrivateKey).Equal", Method, 20}, - {"(*PrivateKey).Public", Method, 20}, - {"(*PrivateKey).PublicKey", Method, 20}, - {"(*PublicKey).Bytes", Method, 20}, - {"(*PublicKey).Curve", Method, 20}, - {"(*PublicKey).Equal", Method, 20}, - {"Curve", Type, 20}, - {"P256", Func, 20}, - {"P384", Func, 20}, - {"P521", Func, 20}, - {"PrivateKey", Type, 20}, - {"PublicKey", Type, 20}, - {"X25519", Func, 20}, - }, - "crypto/ecdsa": { - {"(*PrivateKey).ECDH", Method, 20}, - {"(*PrivateKey).Equal", Method, 15}, - {"(*PrivateKey).Public", Method, 4}, - {"(*PrivateKey).Sign", Method, 4}, - {"(*PublicKey).ECDH", Method, 20}, - {"(*PublicKey).Equal", Method, 15}, - {"(PrivateKey).Add", Method, 0}, - {"(PrivateKey).Double", Method, 0}, - {"(PrivateKey).IsOnCurve", Method, 0}, - {"(PrivateKey).Params", Method, 0}, - {"(PrivateKey).ScalarBaseMult", Method, 0}, - {"(PrivateKey).ScalarMult", Method, 0}, - {"(PublicKey).Add", Method, 0}, - {"(PublicKey).Double", Method, 0}, - {"(PublicKey).IsOnCurve", Method, 0}, - {"(PublicKey).Params", Method, 0}, - {"(PublicKey).ScalarBaseMult", Method, 0}, - {"(PublicKey).ScalarMult", Method, 0}, - {"GenerateKey", Func, 0}, - {"PrivateKey", Type, 0}, - {"PrivateKey.D", Field, 0}, - {"PrivateKey.PublicKey", Field, 0}, - {"PublicKey", Type, 0}, - {"PublicKey.Curve", Field, 0}, - {"PublicKey.X", Field, 0}, - {"PublicKey.Y", Field, 0}, - {"Sign", Func, 0}, - {"SignASN1", Func, 15}, - {"Verify", Func, 0}, - {"VerifyASN1", Func, 15}, - }, - "crypto/ed25519": { - {"(*Options).HashFunc", Method, 20}, - {"(PrivateKey).Equal", Method, 15}, - {"(PrivateKey).Public", Method, 13}, - {"(PrivateKey).Seed", Method, 13}, - {"(PrivateKey).Sign", Method, 13}, - {"(PublicKey).Equal", Method, 15}, - {"GenerateKey", Func, 13}, - {"NewKeyFromSeed", Func, 13}, - {"Options", Type, 20}, - {"Options.Context", Field, 20}, - {"Options.Hash", Field, 20}, - {"PrivateKey", Type, 13}, - {"PrivateKeySize", Const, 13}, - {"PublicKey", Type, 13}, - {"PublicKeySize", Const, 13}, - {"SeedSize", Const, 13}, - {"Sign", Func, 13}, - {"SignatureSize", Const, 13}, - {"Verify", Func, 13}, - {"VerifyWithOptions", Func, 20}, - }, - "crypto/elliptic": { - {"(*CurveParams).Add", Method, 0}, - {"(*CurveParams).Double", Method, 0}, - {"(*CurveParams).IsOnCurve", Method, 0}, - {"(*CurveParams).Params", Method, 0}, - {"(*CurveParams).ScalarBaseMult", Method, 0}, - {"(*CurveParams).ScalarMult", Method, 0}, - {"Curve", Type, 0}, - {"CurveParams", Type, 0}, - {"CurveParams.B", Field, 0}, - {"CurveParams.BitSize", Field, 0}, - {"CurveParams.Gx", Field, 0}, - {"CurveParams.Gy", Field, 0}, - {"CurveParams.N", Field, 0}, - {"CurveParams.Name", Field, 5}, - {"CurveParams.P", Field, 0}, - {"GenerateKey", Func, 0}, - {"Marshal", Func, 0}, - {"MarshalCompressed", Func, 15}, - {"P224", Func, 0}, - {"P256", Func, 0}, - {"P384", Func, 0}, - {"P521", Func, 0}, - {"Unmarshal", Func, 0}, - {"UnmarshalCompressed", Func, 15}, - }, - "crypto/hmac": { - {"Equal", Func, 1}, - {"New", Func, 0}, - }, - "crypto/md5": { - {"BlockSize", Const, 0}, - {"New", Func, 0}, - {"Size", Const, 0}, - {"Sum", Func, 2}, - }, - "crypto/rand": { - {"Int", Func, 0}, - {"Prime", Func, 0}, - {"Read", Func, 0}, - {"Reader", Var, 0}, - }, - "crypto/rc4": { - {"(*Cipher).Reset", Method, 0}, - {"(*Cipher).XORKeyStream", Method, 0}, - {"(KeySizeError).Error", Method, 0}, - {"Cipher", Type, 0}, - {"KeySizeError", Type, 0}, - {"NewCipher", Func, 0}, - }, - "crypto/rsa": { - {"(*PSSOptions).HashFunc", Method, 4}, - {"(*PrivateKey).Decrypt", Method, 5}, - {"(*PrivateKey).Equal", Method, 15}, - {"(*PrivateKey).Precompute", Method, 0}, - {"(*PrivateKey).Public", Method, 4}, - {"(*PrivateKey).Sign", Method, 4}, - {"(*PrivateKey).Size", Method, 11}, - {"(*PrivateKey).Validate", Method, 0}, - {"(*PublicKey).Equal", Method, 15}, - {"(*PublicKey).Size", Method, 11}, - {"CRTValue", Type, 0}, - {"CRTValue.Coeff", Field, 0}, - {"CRTValue.Exp", Field, 0}, - {"CRTValue.R", Field, 0}, - {"DecryptOAEP", Func, 0}, - {"DecryptPKCS1v15", Func, 0}, - {"DecryptPKCS1v15SessionKey", Func, 0}, - {"EncryptOAEP", Func, 0}, - {"EncryptPKCS1v15", Func, 0}, - {"ErrDecryption", Var, 0}, - {"ErrMessageTooLong", Var, 0}, - {"ErrVerification", Var, 0}, - {"GenerateKey", Func, 0}, - {"GenerateMultiPrimeKey", Func, 0}, - {"OAEPOptions", Type, 5}, - {"OAEPOptions.Hash", Field, 5}, - {"OAEPOptions.Label", Field, 5}, - {"OAEPOptions.MGFHash", Field, 20}, - {"PKCS1v15DecryptOptions", Type, 5}, - {"PKCS1v15DecryptOptions.SessionKeyLen", Field, 5}, - {"PSSOptions", Type, 2}, - {"PSSOptions.Hash", Field, 4}, - {"PSSOptions.SaltLength", Field, 2}, - {"PSSSaltLengthAuto", Const, 2}, - {"PSSSaltLengthEqualsHash", Const, 2}, - {"PrecomputedValues", Type, 0}, - {"PrecomputedValues.CRTValues", Field, 0}, - {"PrecomputedValues.Dp", Field, 0}, - {"PrecomputedValues.Dq", Field, 0}, - {"PrecomputedValues.Qinv", Field, 0}, - {"PrivateKey", Type, 0}, - {"PrivateKey.D", Field, 0}, - {"PrivateKey.Precomputed", Field, 0}, - {"PrivateKey.Primes", Field, 0}, - {"PrivateKey.PublicKey", Field, 0}, - {"PublicKey", Type, 0}, - {"PublicKey.E", Field, 0}, - {"PublicKey.N", Field, 0}, - {"SignPKCS1v15", Func, 0}, - {"SignPSS", Func, 2}, - {"VerifyPKCS1v15", Func, 0}, - {"VerifyPSS", Func, 2}, - }, - "crypto/sha1": { - {"BlockSize", Const, 0}, - {"New", Func, 0}, - {"Size", Const, 0}, - {"Sum", Func, 2}, - }, - "crypto/sha256": { - {"BlockSize", Const, 0}, - {"New", Func, 0}, - {"New224", Func, 0}, - {"Size", Const, 0}, - {"Size224", Const, 0}, - {"Sum224", Func, 2}, - {"Sum256", Func, 2}, - }, - "crypto/sha512": { - {"BlockSize", Const, 0}, - {"New", Func, 0}, - {"New384", Func, 0}, - {"New512_224", Func, 5}, - {"New512_256", Func, 5}, - {"Size", Const, 0}, - {"Size224", Const, 5}, - {"Size256", Const, 5}, - {"Size384", Const, 0}, - {"Sum384", Func, 2}, - {"Sum512", Func, 2}, - {"Sum512_224", Func, 5}, - {"Sum512_256", Func, 5}, - }, - "crypto/subtle": { - {"ConstantTimeByteEq", Func, 0}, - {"ConstantTimeCompare", Func, 0}, - {"ConstantTimeCopy", Func, 0}, - {"ConstantTimeEq", Func, 0}, - {"ConstantTimeLessOrEq", Func, 2}, - {"ConstantTimeSelect", Func, 0}, - {"XORBytes", Func, 20}, - }, - "crypto/tls": { - {"(*CertificateRequestInfo).Context", Method, 17}, - {"(*CertificateRequestInfo).SupportsCertificate", Method, 14}, - {"(*CertificateVerificationError).Error", Method, 20}, - {"(*CertificateVerificationError).Unwrap", Method, 20}, - {"(*ClientHelloInfo).Context", Method, 17}, - {"(*ClientHelloInfo).SupportsCertificate", Method, 14}, - {"(*ClientSessionState).ResumptionState", Method, 21}, - {"(*Config).BuildNameToCertificate", Method, 0}, - {"(*Config).Clone", Method, 8}, - {"(*Config).DecryptTicket", Method, 21}, - {"(*Config).EncryptTicket", Method, 21}, - {"(*Config).SetSessionTicketKeys", Method, 5}, - {"(*Conn).Close", Method, 0}, - {"(*Conn).CloseWrite", Method, 8}, - {"(*Conn).ConnectionState", Method, 0}, - {"(*Conn).Handshake", Method, 0}, - {"(*Conn).HandshakeContext", Method, 17}, - {"(*Conn).LocalAddr", Method, 0}, - {"(*Conn).NetConn", Method, 18}, - {"(*Conn).OCSPResponse", Method, 0}, - {"(*Conn).Read", Method, 0}, - {"(*Conn).RemoteAddr", Method, 0}, - {"(*Conn).SetDeadline", Method, 0}, - {"(*Conn).SetReadDeadline", Method, 0}, - {"(*Conn).SetWriteDeadline", Method, 0}, - {"(*Conn).VerifyHostname", Method, 0}, - {"(*Conn).Write", Method, 0}, - {"(*ConnectionState).ExportKeyingMaterial", Method, 11}, - {"(*Dialer).Dial", Method, 15}, - {"(*Dialer).DialContext", Method, 15}, - {"(*QUICConn).Close", Method, 21}, - {"(*QUICConn).ConnectionState", Method, 21}, - {"(*QUICConn).HandleData", Method, 21}, - {"(*QUICConn).NextEvent", Method, 21}, - {"(*QUICConn).SendSessionTicket", Method, 21}, - {"(*QUICConn).SetTransportParameters", Method, 21}, - {"(*QUICConn).Start", Method, 21}, - {"(*SessionState).Bytes", Method, 21}, - {"(AlertError).Error", Method, 21}, - {"(ClientAuthType).String", Method, 15}, - {"(CurveID).String", Method, 15}, - {"(QUICEncryptionLevel).String", Method, 21}, - {"(RecordHeaderError).Error", Method, 6}, - {"(SignatureScheme).String", Method, 15}, - {"AlertError", Type, 21}, - {"Certificate", Type, 0}, - {"Certificate.Certificate", Field, 0}, - {"Certificate.Leaf", Field, 0}, - {"Certificate.OCSPStaple", Field, 0}, - {"Certificate.PrivateKey", Field, 0}, - {"Certificate.SignedCertificateTimestamps", Field, 5}, - {"Certificate.SupportedSignatureAlgorithms", Field, 14}, - {"CertificateRequestInfo", Type, 8}, - {"CertificateRequestInfo.AcceptableCAs", Field, 8}, - {"CertificateRequestInfo.SignatureSchemes", Field, 8}, - {"CertificateRequestInfo.Version", Field, 14}, - {"CertificateVerificationError", Type, 20}, - {"CertificateVerificationError.Err", Field, 20}, - {"CertificateVerificationError.UnverifiedCertificates", Field, 20}, - {"CipherSuite", Type, 14}, - {"CipherSuite.ID", Field, 14}, - {"CipherSuite.Insecure", Field, 14}, - {"CipherSuite.Name", Field, 14}, - {"CipherSuite.SupportedVersions", Field, 14}, - {"CipherSuiteName", Func, 14}, - {"CipherSuites", Func, 14}, - {"Client", Func, 0}, - {"ClientAuthType", Type, 0}, - {"ClientHelloInfo", Type, 4}, - {"ClientHelloInfo.CipherSuites", Field, 4}, - {"ClientHelloInfo.Conn", Field, 8}, - {"ClientHelloInfo.ServerName", Field, 4}, - {"ClientHelloInfo.SignatureSchemes", Field, 8}, - {"ClientHelloInfo.SupportedCurves", Field, 4}, - {"ClientHelloInfo.SupportedPoints", Field, 4}, - {"ClientHelloInfo.SupportedProtos", Field, 8}, - {"ClientHelloInfo.SupportedVersions", Field, 8}, - {"ClientSessionCache", Type, 3}, - {"ClientSessionState", Type, 3}, - {"Config", Type, 0}, - {"Config.Certificates", Field, 0}, - {"Config.CipherSuites", Field, 0}, - {"Config.ClientAuth", Field, 0}, - {"Config.ClientCAs", Field, 0}, - {"Config.ClientSessionCache", Field, 3}, - {"Config.CurvePreferences", Field, 3}, - {"Config.DynamicRecordSizingDisabled", Field, 7}, - {"Config.GetCertificate", Field, 4}, - {"Config.GetClientCertificate", Field, 8}, - {"Config.GetConfigForClient", Field, 8}, - {"Config.InsecureSkipVerify", Field, 0}, - {"Config.KeyLogWriter", Field, 8}, - {"Config.MaxVersion", Field, 2}, - {"Config.MinVersion", Field, 2}, - {"Config.NameToCertificate", Field, 0}, - {"Config.NextProtos", Field, 0}, - {"Config.PreferServerCipherSuites", Field, 1}, - {"Config.Rand", Field, 0}, - {"Config.Renegotiation", Field, 7}, - {"Config.RootCAs", Field, 0}, - {"Config.ServerName", Field, 0}, - {"Config.SessionTicketKey", Field, 1}, - {"Config.SessionTicketsDisabled", Field, 1}, - {"Config.Time", Field, 0}, - {"Config.UnwrapSession", Field, 21}, - {"Config.VerifyConnection", Field, 15}, - {"Config.VerifyPeerCertificate", Field, 8}, - {"Config.WrapSession", Field, 21}, - {"Conn", Type, 0}, - {"ConnectionState", Type, 0}, - {"ConnectionState.CipherSuite", Field, 0}, - {"ConnectionState.DidResume", Field, 1}, - {"ConnectionState.HandshakeComplete", Field, 0}, - {"ConnectionState.NegotiatedProtocol", Field, 0}, - {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0}, - {"ConnectionState.OCSPResponse", Field, 5}, - {"ConnectionState.PeerCertificates", Field, 0}, - {"ConnectionState.ServerName", Field, 0}, - {"ConnectionState.SignedCertificateTimestamps", Field, 5}, - {"ConnectionState.TLSUnique", Field, 4}, - {"ConnectionState.VerifiedChains", Field, 0}, - {"ConnectionState.Version", Field, 3}, - {"CurveID", Type, 3}, - {"CurveP256", Const, 3}, - {"CurveP384", Const, 3}, - {"CurveP521", Const, 3}, - {"Dial", Func, 0}, - {"DialWithDialer", Func, 3}, - {"Dialer", Type, 15}, - {"Dialer.Config", Field, 15}, - {"Dialer.NetDialer", Field, 15}, - {"ECDSAWithP256AndSHA256", Const, 8}, - {"ECDSAWithP384AndSHA384", Const, 8}, - {"ECDSAWithP521AndSHA512", Const, 8}, - {"ECDSAWithSHA1", Const, 10}, - {"Ed25519", Const, 13}, - {"InsecureCipherSuites", Func, 14}, - {"Listen", Func, 0}, - {"LoadX509KeyPair", Func, 0}, - {"NewLRUClientSessionCache", Func, 3}, - {"NewListener", Func, 0}, - {"NewResumptionState", Func, 21}, - {"NoClientCert", Const, 0}, - {"PKCS1WithSHA1", Const, 8}, - {"PKCS1WithSHA256", Const, 8}, - {"PKCS1WithSHA384", Const, 8}, - {"PKCS1WithSHA512", Const, 8}, - {"PSSWithSHA256", Const, 8}, - {"PSSWithSHA384", Const, 8}, - {"PSSWithSHA512", Const, 8}, - {"ParseSessionState", Func, 21}, - {"QUICClient", Func, 21}, - {"QUICConfig", Type, 21}, - {"QUICConfig.TLSConfig", Field, 21}, - {"QUICConn", Type, 21}, - {"QUICEncryptionLevel", Type, 21}, - {"QUICEncryptionLevelApplication", Const, 21}, - {"QUICEncryptionLevelEarly", Const, 21}, - {"QUICEncryptionLevelHandshake", Const, 21}, - {"QUICEncryptionLevelInitial", Const, 21}, - {"QUICEvent", Type, 21}, - {"QUICEvent.Data", Field, 21}, - {"QUICEvent.Kind", Field, 21}, - {"QUICEvent.Level", Field, 21}, - {"QUICEvent.Suite", Field, 21}, - {"QUICEventKind", Type, 21}, - {"QUICHandshakeDone", Const, 21}, - {"QUICNoEvent", Const, 21}, - {"QUICRejectedEarlyData", Const, 21}, - {"QUICServer", Func, 21}, - {"QUICSessionTicketOptions", Type, 21}, - {"QUICSessionTicketOptions.EarlyData", Field, 21}, - {"QUICSetReadSecret", Const, 21}, - {"QUICSetWriteSecret", Const, 21}, - {"QUICTransportParameters", Const, 21}, - {"QUICTransportParametersRequired", Const, 21}, - {"QUICWriteData", Const, 21}, - {"RecordHeaderError", Type, 6}, - {"RecordHeaderError.Conn", Field, 12}, - {"RecordHeaderError.Msg", Field, 6}, - {"RecordHeaderError.RecordHeader", Field, 6}, - {"RenegotiateFreelyAsClient", Const, 7}, - {"RenegotiateNever", Const, 7}, - {"RenegotiateOnceAsClient", Const, 7}, - {"RenegotiationSupport", Type, 7}, - {"RequestClientCert", Const, 0}, - {"RequireAndVerifyClientCert", Const, 0}, - {"RequireAnyClientCert", Const, 0}, - {"Server", Func, 0}, - {"SessionState", Type, 21}, - {"SessionState.EarlyData", Field, 21}, - {"SessionState.Extra", Field, 21}, - {"SignatureScheme", Type, 8}, - {"TLS_AES_128_GCM_SHA256", Const, 12}, - {"TLS_AES_256_GCM_SHA384", Const, 12}, - {"TLS_CHACHA20_POLY1305_SHA256", Const, 12}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", Const, 2}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", Const, 8}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", Const, 2}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", Const, 2}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", Const, 5}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", Const, 8}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14}, - {"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", Const, 2}, - {"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", Const, 0}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", Const, 8}, - {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", Const, 2}, - {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", Const, 1}, - {"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", Const, 5}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", Const, 8}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14}, - {"TLS_ECDHE_RSA_WITH_RC4_128_SHA", Const, 0}, - {"TLS_FALLBACK_SCSV", Const, 4}, - {"TLS_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0}, - {"TLS_RSA_WITH_AES_128_CBC_SHA", Const, 0}, - {"TLS_RSA_WITH_AES_128_CBC_SHA256", Const, 8}, - {"TLS_RSA_WITH_AES_128_GCM_SHA256", Const, 6}, - {"TLS_RSA_WITH_AES_256_CBC_SHA", Const, 1}, - {"TLS_RSA_WITH_AES_256_GCM_SHA384", Const, 6}, - {"TLS_RSA_WITH_RC4_128_SHA", Const, 0}, - {"VerifyClientCertIfGiven", Const, 0}, - {"VersionName", Func, 21}, - {"VersionSSL30", Const, 2}, - {"VersionTLS10", Const, 2}, - {"VersionTLS11", Const, 2}, - {"VersionTLS12", Const, 2}, - {"VersionTLS13", Const, 12}, - {"X25519", Const, 8}, - {"X509KeyPair", Func, 0}, - }, - "crypto/x509": { - {"(*CertPool).AddCert", Method, 0}, - {"(*CertPool).AddCertWithConstraint", Method, 22}, - {"(*CertPool).AppendCertsFromPEM", Method, 0}, - {"(*CertPool).Clone", Method, 19}, - {"(*CertPool).Equal", Method, 19}, - {"(*CertPool).Subjects", Method, 0}, - {"(*Certificate).CheckCRLSignature", Method, 0}, - {"(*Certificate).CheckSignature", Method, 0}, - {"(*Certificate).CheckSignatureFrom", Method, 0}, - {"(*Certificate).CreateCRL", Method, 0}, - {"(*Certificate).Equal", Method, 0}, - {"(*Certificate).Verify", Method, 0}, - {"(*Certificate).VerifyHostname", Method, 0}, - {"(*CertificateRequest).CheckSignature", Method, 5}, - {"(*RevocationList).CheckSignatureFrom", Method, 19}, - {"(CertificateInvalidError).Error", Method, 0}, - {"(ConstraintViolationError).Error", Method, 0}, - {"(HostnameError).Error", Method, 0}, - {"(InsecureAlgorithmError).Error", Method, 6}, - {"(OID).Equal", Method, 22}, - {"(OID).EqualASN1OID", Method, 22}, - {"(OID).String", Method, 22}, - {"(PublicKeyAlgorithm).String", Method, 10}, - {"(SignatureAlgorithm).String", Method, 6}, - {"(SystemRootsError).Error", Method, 1}, - {"(SystemRootsError).Unwrap", Method, 16}, - {"(UnhandledCriticalExtension).Error", Method, 0}, - {"(UnknownAuthorityError).Error", Method, 0}, - {"CANotAuthorizedForExtKeyUsage", Const, 10}, - {"CANotAuthorizedForThisName", Const, 0}, - {"CertPool", Type, 0}, - {"Certificate", Type, 0}, - {"Certificate.AuthorityKeyId", Field, 0}, - {"Certificate.BasicConstraintsValid", Field, 0}, - {"Certificate.CRLDistributionPoints", Field, 2}, - {"Certificate.DNSNames", Field, 0}, - {"Certificate.EmailAddresses", Field, 0}, - {"Certificate.ExcludedDNSDomains", Field, 9}, - {"Certificate.ExcludedEmailAddresses", Field, 10}, - {"Certificate.ExcludedIPRanges", Field, 10}, - {"Certificate.ExcludedURIDomains", Field, 10}, - {"Certificate.ExtKeyUsage", Field, 0}, - {"Certificate.Extensions", Field, 2}, - {"Certificate.ExtraExtensions", Field, 2}, - {"Certificate.IPAddresses", Field, 1}, - {"Certificate.IsCA", Field, 0}, - {"Certificate.Issuer", Field, 0}, - {"Certificate.IssuingCertificateURL", Field, 2}, - {"Certificate.KeyUsage", Field, 0}, - {"Certificate.MaxPathLen", Field, 0}, - {"Certificate.MaxPathLenZero", Field, 4}, - {"Certificate.NotAfter", Field, 0}, - {"Certificate.NotBefore", Field, 0}, - {"Certificate.OCSPServer", Field, 2}, - {"Certificate.PermittedDNSDomains", Field, 0}, - {"Certificate.PermittedDNSDomainsCritical", Field, 0}, - {"Certificate.PermittedEmailAddresses", Field, 10}, - {"Certificate.PermittedIPRanges", Field, 10}, - {"Certificate.PermittedURIDomains", Field, 10}, - {"Certificate.Policies", Field, 22}, - {"Certificate.PolicyIdentifiers", Field, 0}, - {"Certificate.PublicKey", Field, 0}, - {"Certificate.PublicKeyAlgorithm", Field, 0}, - {"Certificate.Raw", Field, 0}, - {"Certificate.RawIssuer", Field, 0}, - {"Certificate.RawSubject", Field, 0}, - {"Certificate.RawSubjectPublicKeyInfo", Field, 0}, - {"Certificate.RawTBSCertificate", Field, 0}, - {"Certificate.SerialNumber", Field, 0}, - {"Certificate.Signature", Field, 0}, - {"Certificate.SignatureAlgorithm", Field, 0}, - {"Certificate.Subject", Field, 0}, - {"Certificate.SubjectKeyId", Field, 0}, - {"Certificate.URIs", Field, 10}, - {"Certificate.UnhandledCriticalExtensions", Field, 5}, - {"Certificate.UnknownExtKeyUsage", Field, 0}, - {"Certificate.Version", Field, 0}, - {"CertificateInvalidError", Type, 0}, - {"CertificateInvalidError.Cert", Field, 0}, - {"CertificateInvalidError.Detail", Field, 10}, - {"CertificateInvalidError.Reason", Field, 0}, - {"CertificateRequest", Type, 3}, - {"CertificateRequest.Attributes", Field, 3}, - {"CertificateRequest.DNSNames", Field, 3}, - {"CertificateRequest.EmailAddresses", Field, 3}, - {"CertificateRequest.Extensions", Field, 3}, - {"CertificateRequest.ExtraExtensions", Field, 3}, - {"CertificateRequest.IPAddresses", Field, 3}, - {"CertificateRequest.PublicKey", Field, 3}, - {"CertificateRequest.PublicKeyAlgorithm", Field, 3}, - {"CertificateRequest.Raw", Field, 3}, - {"CertificateRequest.RawSubject", Field, 3}, - {"CertificateRequest.RawSubjectPublicKeyInfo", Field, 3}, - {"CertificateRequest.RawTBSCertificateRequest", Field, 3}, - {"CertificateRequest.Signature", Field, 3}, - {"CertificateRequest.SignatureAlgorithm", Field, 3}, - {"CertificateRequest.Subject", Field, 3}, - {"CertificateRequest.URIs", Field, 10}, - {"CertificateRequest.Version", Field, 3}, - {"ConstraintViolationError", Type, 0}, - {"CreateCertificate", Func, 0}, - {"CreateCertificateRequest", Func, 3}, - {"CreateRevocationList", Func, 15}, - {"DSA", Const, 0}, - {"DSAWithSHA1", Const, 0}, - {"DSAWithSHA256", Const, 0}, - {"DecryptPEMBlock", Func, 1}, - {"ECDSA", Const, 1}, - {"ECDSAWithSHA1", Const, 1}, - {"ECDSAWithSHA256", Const, 1}, - {"ECDSAWithSHA384", Const, 1}, - {"ECDSAWithSHA512", Const, 1}, - {"Ed25519", Const, 13}, - {"EncryptPEMBlock", Func, 1}, - {"ErrUnsupportedAlgorithm", Var, 0}, - {"Expired", Const, 0}, - {"ExtKeyUsage", Type, 0}, - {"ExtKeyUsageAny", Const, 0}, - {"ExtKeyUsageClientAuth", Const, 0}, - {"ExtKeyUsageCodeSigning", Const, 0}, - {"ExtKeyUsageEmailProtection", Const, 0}, - {"ExtKeyUsageIPSECEndSystem", Const, 1}, - {"ExtKeyUsageIPSECTunnel", Const, 1}, - {"ExtKeyUsageIPSECUser", Const, 1}, - {"ExtKeyUsageMicrosoftCommercialCodeSigning", Const, 10}, - {"ExtKeyUsageMicrosoftKernelCodeSigning", Const, 10}, - {"ExtKeyUsageMicrosoftServerGatedCrypto", Const, 1}, - {"ExtKeyUsageNetscapeServerGatedCrypto", Const, 1}, - {"ExtKeyUsageOCSPSigning", Const, 0}, - {"ExtKeyUsageServerAuth", Const, 0}, - {"ExtKeyUsageTimeStamping", Const, 0}, - {"HostnameError", Type, 0}, - {"HostnameError.Certificate", Field, 0}, - {"HostnameError.Host", Field, 0}, - {"IncompatibleUsage", Const, 1}, - {"IncorrectPasswordError", Var, 1}, - {"InsecureAlgorithmError", Type, 6}, - {"InvalidReason", Type, 0}, - {"IsEncryptedPEMBlock", Func, 1}, - {"KeyUsage", Type, 0}, - {"KeyUsageCRLSign", Const, 0}, - {"KeyUsageCertSign", Const, 0}, - {"KeyUsageContentCommitment", Const, 0}, - {"KeyUsageDataEncipherment", Const, 0}, - {"KeyUsageDecipherOnly", Const, 0}, - {"KeyUsageDigitalSignature", Const, 0}, - {"KeyUsageEncipherOnly", Const, 0}, - {"KeyUsageKeyAgreement", Const, 0}, - {"KeyUsageKeyEncipherment", Const, 0}, - {"MD2WithRSA", Const, 0}, - {"MD5WithRSA", Const, 0}, - {"MarshalECPrivateKey", Func, 2}, - {"MarshalPKCS1PrivateKey", Func, 0}, - {"MarshalPKCS1PublicKey", Func, 10}, - {"MarshalPKCS8PrivateKey", Func, 10}, - {"MarshalPKIXPublicKey", Func, 0}, - {"NameConstraintsWithoutSANs", Const, 10}, - {"NameMismatch", Const, 8}, - {"NewCertPool", Func, 0}, - {"NotAuthorizedToSign", Const, 0}, - {"OID", Type, 22}, - {"OIDFromInts", Func, 22}, - {"PEMCipher", Type, 1}, - {"PEMCipher3DES", Const, 1}, - {"PEMCipherAES128", Const, 1}, - {"PEMCipherAES192", Const, 1}, - {"PEMCipherAES256", Const, 1}, - {"PEMCipherDES", Const, 1}, - {"ParseCRL", Func, 0}, - {"ParseCertificate", Func, 0}, - {"ParseCertificateRequest", Func, 3}, - {"ParseCertificates", Func, 0}, - {"ParseDERCRL", Func, 0}, - {"ParseECPrivateKey", Func, 1}, - {"ParsePKCS1PrivateKey", Func, 0}, - {"ParsePKCS1PublicKey", Func, 10}, - {"ParsePKCS8PrivateKey", Func, 0}, - {"ParsePKIXPublicKey", Func, 0}, - {"ParseRevocationList", Func, 19}, - {"PublicKeyAlgorithm", Type, 0}, - {"PureEd25519", Const, 13}, - {"RSA", Const, 0}, - {"RevocationList", Type, 15}, - {"RevocationList.AuthorityKeyId", Field, 19}, - {"RevocationList.Extensions", Field, 19}, - {"RevocationList.ExtraExtensions", Field, 15}, - {"RevocationList.Issuer", Field, 19}, - {"RevocationList.NextUpdate", Field, 15}, - {"RevocationList.Number", Field, 15}, - {"RevocationList.Raw", Field, 19}, - {"RevocationList.RawIssuer", Field, 19}, - {"RevocationList.RawTBSRevocationList", Field, 19}, - {"RevocationList.RevokedCertificateEntries", Field, 21}, - {"RevocationList.RevokedCertificates", Field, 15}, - {"RevocationList.Signature", Field, 19}, - {"RevocationList.SignatureAlgorithm", Field, 15}, - {"RevocationList.ThisUpdate", Field, 15}, - {"RevocationListEntry", Type, 21}, - {"RevocationListEntry.Extensions", Field, 21}, - {"RevocationListEntry.ExtraExtensions", Field, 21}, - {"RevocationListEntry.Raw", Field, 21}, - {"RevocationListEntry.ReasonCode", Field, 21}, - {"RevocationListEntry.RevocationTime", Field, 21}, - {"RevocationListEntry.SerialNumber", Field, 21}, - {"SHA1WithRSA", Const, 0}, - {"SHA256WithRSA", Const, 0}, - {"SHA256WithRSAPSS", Const, 8}, - {"SHA384WithRSA", Const, 0}, - {"SHA384WithRSAPSS", Const, 8}, - {"SHA512WithRSA", Const, 0}, - {"SHA512WithRSAPSS", Const, 8}, - {"SetFallbackRoots", Func, 20}, - {"SignatureAlgorithm", Type, 0}, - {"SystemCertPool", Func, 7}, - {"SystemRootsError", Type, 1}, - {"SystemRootsError.Err", Field, 7}, - {"TooManyConstraints", Const, 10}, - {"TooManyIntermediates", Const, 0}, - {"UnconstrainedName", Const, 10}, - {"UnhandledCriticalExtension", Type, 0}, - {"UnknownAuthorityError", Type, 0}, - {"UnknownAuthorityError.Cert", Field, 8}, - {"UnknownPublicKeyAlgorithm", Const, 0}, - {"UnknownSignatureAlgorithm", Const, 0}, - {"VerifyOptions", Type, 0}, - {"VerifyOptions.CurrentTime", Field, 0}, - {"VerifyOptions.DNSName", Field, 0}, - {"VerifyOptions.Intermediates", Field, 0}, - {"VerifyOptions.KeyUsages", Field, 1}, - {"VerifyOptions.MaxConstraintComparisions", Field, 10}, - {"VerifyOptions.Roots", Field, 0}, - }, - "crypto/x509/pkix": { - {"(*CertificateList).HasExpired", Method, 0}, - {"(*Name).FillFromRDNSequence", Method, 0}, - {"(Name).String", Method, 10}, - {"(Name).ToRDNSequence", Method, 0}, - {"(RDNSequence).String", Method, 10}, - {"AlgorithmIdentifier", Type, 0}, - {"AlgorithmIdentifier.Algorithm", Field, 0}, - {"AlgorithmIdentifier.Parameters", Field, 0}, - {"AttributeTypeAndValue", Type, 0}, - {"AttributeTypeAndValue.Type", Field, 0}, - {"AttributeTypeAndValue.Value", Field, 0}, - {"AttributeTypeAndValueSET", Type, 3}, - {"AttributeTypeAndValueSET.Type", Field, 3}, - {"AttributeTypeAndValueSET.Value", Field, 3}, - {"CertificateList", Type, 0}, - {"CertificateList.SignatureAlgorithm", Field, 0}, - {"CertificateList.SignatureValue", Field, 0}, - {"CertificateList.TBSCertList", Field, 0}, - {"Extension", Type, 0}, - {"Extension.Critical", Field, 0}, - {"Extension.Id", Field, 0}, - {"Extension.Value", Field, 0}, - {"Name", Type, 0}, - {"Name.CommonName", Field, 0}, - {"Name.Country", Field, 0}, - {"Name.ExtraNames", Field, 5}, - {"Name.Locality", Field, 0}, - {"Name.Names", Field, 0}, - {"Name.Organization", Field, 0}, - {"Name.OrganizationalUnit", Field, 0}, - {"Name.PostalCode", Field, 0}, - {"Name.Province", Field, 0}, - {"Name.SerialNumber", Field, 0}, - {"Name.StreetAddress", Field, 0}, - {"RDNSequence", Type, 0}, - {"RelativeDistinguishedNameSET", Type, 0}, - {"RevokedCertificate", Type, 0}, - {"RevokedCertificate.Extensions", Field, 0}, - {"RevokedCertificate.RevocationTime", Field, 0}, - {"RevokedCertificate.SerialNumber", Field, 0}, - {"TBSCertificateList", Type, 0}, - {"TBSCertificateList.Extensions", Field, 0}, - {"TBSCertificateList.Issuer", Field, 0}, - {"TBSCertificateList.NextUpdate", Field, 0}, - {"TBSCertificateList.Raw", Field, 0}, - {"TBSCertificateList.RevokedCertificates", Field, 0}, - {"TBSCertificateList.Signature", Field, 0}, - {"TBSCertificateList.ThisUpdate", Field, 0}, - {"TBSCertificateList.Version", Field, 0}, - }, - "database/sql": { - {"(*ColumnType).DatabaseTypeName", Method, 8}, - {"(*ColumnType).DecimalSize", Method, 8}, - {"(*ColumnType).Length", Method, 8}, - {"(*ColumnType).Name", Method, 8}, - {"(*ColumnType).Nullable", Method, 8}, - {"(*ColumnType).ScanType", Method, 8}, - {"(*Conn).BeginTx", Method, 9}, - {"(*Conn).Close", Method, 9}, - {"(*Conn).ExecContext", Method, 9}, - {"(*Conn).PingContext", Method, 9}, - {"(*Conn).PrepareContext", Method, 9}, - {"(*Conn).QueryContext", Method, 9}, - {"(*Conn).QueryRowContext", Method, 9}, - {"(*Conn).Raw", Method, 13}, - {"(*DB).Begin", Method, 0}, - {"(*DB).BeginTx", Method, 8}, - {"(*DB).Close", Method, 0}, - {"(*DB).Conn", Method, 9}, - {"(*DB).Driver", Method, 0}, - {"(*DB).Exec", Method, 0}, - {"(*DB).ExecContext", Method, 8}, - {"(*DB).Ping", Method, 1}, - {"(*DB).PingContext", Method, 8}, - {"(*DB).Prepare", Method, 0}, - {"(*DB).PrepareContext", Method, 8}, - {"(*DB).Query", Method, 0}, - {"(*DB).QueryContext", Method, 8}, - {"(*DB).QueryRow", Method, 0}, - {"(*DB).QueryRowContext", Method, 8}, - {"(*DB).SetConnMaxIdleTime", Method, 15}, - {"(*DB).SetConnMaxLifetime", Method, 6}, - {"(*DB).SetMaxIdleConns", Method, 1}, - {"(*DB).SetMaxOpenConns", Method, 2}, - {"(*DB).Stats", Method, 5}, - {"(*Null).Scan", Method, 22}, - {"(*NullBool).Scan", Method, 0}, - {"(*NullByte).Scan", Method, 17}, - {"(*NullFloat64).Scan", Method, 0}, - {"(*NullInt16).Scan", Method, 17}, - {"(*NullInt32).Scan", Method, 13}, - {"(*NullInt64).Scan", Method, 0}, - {"(*NullString).Scan", Method, 0}, - {"(*NullTime).Scan", Method, 13}, - {"(*Row).Err", Method, 15}, - {"(*Row).Scan", Method, 0}, - {"(*Rows).Close", Method, 0}, - {"(*Rows).ColumnTypes", Method, 8}, - {"(*Rows).Columns", Method, 0}, - {"(*Rows).Err", Method, 0}, - {"(*Rows).Next", Method, 0}, - {"(*Rows).NextResultSet", Method, 8}, - {"(*Rows).Scan", Method, 0}, - {"(*Stmt).Close", Method, 0}, - {"(*Stmt).Exec", Method, 0}, - {"(*Stmt).ExecContext", Method, 8}, - {"(*Stmt).Query", Method, 0}, - {"(*Stmt).QueryContext", Method, 8}, - {"(*Stmt).QueryRow", Method, 0}, - {"(*Stmt).QueryRowContext", Method, 8}, - {"(*Tx).Commit", Method, 0}, - {"(*Tx).Exec", Method, 0}, - {"(*Tx).ExecContext", Method, 8}, - {"(*Tx).Prepare", Method, 0}, - {"(*Tx).PrepareContext", Method, 8}, - {"(*Tx).Query", Method, 0}, - {"(*Tx).QueryContext", Method, 8}, - {"(*Tx).QueryRow", Method, 0}, - {"(*Tx).QueryRowContext", Method, 8}, - {"(*Tx).Rollback", Method, 0}, - {"(*Tx).Stmt", Method, 0}, - {"(*Tx).StmtContext", Method, 8}, - {"(IsolationLevel).String", Method, 11}, - {"(Null).Value", Method, 22}, - {"(NullBool).Value", Method, 0}, - {"(NullByte).Value", Method, 17}, - {"(NullFloat64).Value", Method, 0}, - {"(NullInt16).Value", Method, 17}, - {"(NullInt32).Value", Method, 13}, - {"(NullInt64).Value", Method, 0}, - {"(NullString).Value", Method, 0}, - {"(NullTime).Value", Method, 13}, - {"ColumnType", Type, 8}, - {"Conn", Type, 9}, - {"DB", Type, 0}, - {"DBStats", Type, 5}, - {"DBStats.Idle", Field, 11}, - {"DBStats.InUse", Field, 11}, - {"DBStats.MaxIdleClosed", Field, 11}, - {"DBStats.MaxIdleTimeClosed", Field, 15}, - {"DBStats.MaxLifetimeClosed", Field, 11}, - {"DBStats.MaxOpenConnections", Field, 11}, - {"DBStats.OpenConnections", Field, 5}, - {"DBStats.WaitCount", Field, 11}, - {"DBStats.WaitDuration", Field, 11}, - {"Drivers", Func, 4}, - {"ErrConnDone", Var, 9}, - {"ErrNoRows", Var, 0}, - {"ErrTxDone", Var, 0}, - {"IsolationLevel", Type, 8}, - {"LevelDefault", Const, 8}, - {"LevelLinearizable", Const, 8}, - {"LevelReadCommitted", Const, 8}, - {"LevelReadUncommitted", Const, 8}, - {"LevelRepeatableRead", Const, 8}, - {"LevelSerializable", Const, 8}, - {"LevelSnapshot", Const, 8}, - {"LevelWriteCommitted", Const, 8}, - {"Named", Func, 8}, - {"NamedArg", Type, 8}, - {"NamedArg.Name", Field, 8}, - {"NamedArg.Value", Field, 8}, - {"Null", Type, 22}, - {"Null.V", Field, 22}, - {"Null.Valid", Field, 22}, - {"NullBool", Type, 0}, - {"NullBool.Bool", Field, 0}, - {"NullBool.Valid", Field, 0}, - {"NullByte", Type, 17}, - {"NullByte.Byte", Field, 17}, - {"NullByte.Valid", Field, 17}, - {"NullFloat64", Type, 0}, - {"NullFloat64.Float64", Field, 0}, - {"NullFloat64.Valid", Field, 0}, - {"NullInt16", Type, 17}, - {"NullInt16.Int16", Field, 17}, - {"NullInt16.Valid", Field, 17}, - {"NullInt32", Type, 13}, - {"NullInt32.Int32", Field, 13}, - {"NullInt32.Valid", Field, 13}, - {"NullInt64", Type, 0}, - {"NullInt64.Int64", Field, 0}, - {"NullInt64.Valid", Field, 0}, - {"NullString", Type, 0}, - {"NullString.String", Field, 0}, - {"NullString.Valid", Field, 0}, - {"NullTime", Type, 13}, - {"NullTime.Time", Field, 13}, - {"NullTime.Valid", Field, 13}, - {"Open", Func, 0}, - {"OpenDB", Func, 10}, - {"Out", Type, 9}, - {"Out.Dest", Field, 9}, - {"Out.In", Field, 9}, - {"RawBytes", Type, 0}, - {"Register", Func, 0}, - {"Result", Type, 0}, - {"Row", Type, 0}, - {"Rows", Type, 0}, - {"Scanner", Type, 0}, - {"Stmt", Type, 0}, - {"Tx", Type, 0}, - {"TxOptions", Type, 8}, - {"TxOptions.Isolation", Field, 8}, - {"TxOptions.ReadOnly", Field, 8}, - }, - "database/sql/driver": { - {"(NotNull).ConvertValue", Method, 0}, - {"(Null).ConvertValue", Method, 0}, - {"(RowsAffected).LastInsertId", Method, 0}, - {"(RowsAffected).RowsAffected", Method, 0}, - {"Bool", Var, 0}, - {"ColumnConverter", Type, 0}, - {"Conn", Type, 0}, - {"ConnBeginTx", Type, 8}, - {"ConnPrepareContext", Type, 8}, - {"Connector", Type, 10}, - {"DefaultParameterConverter", Var, 0}, - {"Driver", Type, 0}, - {"DriverContext", Type, 10}, - {"ErrBadConn", Var, 0}, - {"ErrRemoveArgument", Var, 9}, - {"ErrSkip", Var, 0}, - {"Execer", Type, 0}, - {"ExecerContext", Type, 8}, - {"Int32", Var, 0}, - {"IsScanValue", Func, 0}, - {"IsValue", Func, 0}, - {"IsolationLevel", Type, 8}, - {"NamedValue", Type, 8}, - {"NamedValue.Name", Field, 8}, - {"NamedValue.Ordinal", Field, 8}, - {"NamedValue.Value", Field, 8}, - {"NamedValueChecker", Type, 9}, - {"NotNull", Type, 0}, - {"NotNull.Converter", Field, 0}, - {"Null", Type, 0}, - {"Null.Converter", Field, 0}, - {"Pinger", Type, 8}, - {"Queryer", Type, 1}, - {"QueryerContext", Type, 8}, - {"Result", Type, 0}, - {"ResultNoRows", Var, 0}, - {"Rows", Type, 0}, - {"RowsAffected", Type, 0}, - {"RowsColumnTypeDatabaseTypeName", Type, 8}, - {"RowsColumnTypeLength", Type, 8}, - {"RowsColumnTypeNullable", Type, 8}, - {"RowsColumnTypePrecisionScale", Type, 8}, - {"RowsColumnTypeScanType", Type, 8}, - {"RowsNextResultSet", Type, 8}, - {"SessionResetter", Type, 10}, - {"Stmt", Type, 0}, - {"StmtExecContext", Type, 8}, - {"StmtQueryContext", Type, 8}, - {"String", Var, 0}, - {"Tx", Type, 0}, - {"TxOptions", Type, 8}, - {"TxOptions.Isolation", Field, 8}, - {"TxOptions.ReadOnly", Field, 8}, - {"Validator", Type, 15}, - {"Value", Type, 0}, - {"ValueConverter", Type, 0}, - {"Valuer", Type, 0}, - }, - "debug/buildinfo": { - {"BuildInfo", Type, 18}, - {"Read", Func, 18}, - {"ReadFile", Func, 18}, - }, - "debug/dwarf": { - {"(*AddrType).Basic", Method, 0}, - {"(*AddrType).Common", Method, 0}, - {"(*AddrType).Size", Method, 0}, - {"(*AddrType).String", Method, 0}, - {"(*ArrayType).Common", Method, 0}, - {"(*ArrayType).Size", Method, 0}, - {"(*ArrayType).String", Method, 0}, - {"(*BasicType).Basic", Method, 0}, - {"(*BasicType).Common", Method, 0}, - {"(*BasicType).Size", Method, 0}, - {"(*BasicType).String", Method, 0}, - {"(*BoolType).Basic", Method, 0}, - {"(*BoolType).Common", Method, 0}, - {"(*BoolType).Size", Method, 0}, - {"(*BoolType).String", Method, 0}, - {"(*CharType).Basic", Method, 0}, - {"(*CharType).Common", Method, 0}, - {"(*CharType).Size", Method, 0}, - {"(*CharType).String", Method, 0}, - {"(*CommonType).Common", Method, 0}, - {"(*CommonType).Size", Method, 0}, - {"(*ComplexType).Basic", Method, 0}, - {"(*ComplexType).Common", Method, 0}, - {"(*ComplexType).Size", Method, 0}, - {"(*ComplexType).String", Method, 0}, - {"(*Data).AddSection", Method, 14}, - {"(*Data).AddTypes", Method, 3}, - {"(*Data).LineReader", Method, 5}, - {"(*Data).Ranges", Method, 7}, - {"(*Data).Reader", Method, 0}, - {"(*Data).Type", Method, 0}, - {"(*DotDotDotType).Common", Method, 0}, - {"(*DotDotDotType).Size", Method, 0}, - {"(*DotDotDotType).String", Method, 0}, - {"(*Entry).AttrField", Method, 5}, - {"(*Entry).Val", Method, 0}, - {"(*EnumType).Common", Method, 0}, - {"(*EnumType).Size", Method, 0}, - {"(*EnumType).String", Method, 0}, - {"(*FloatType).Basic", Method, 0}, - {"(*FloatType).Common", Method, 0}, - {"(*FloatType).Size", Method, 0}, - {"(*FloatType).String", Method, 0}, - {"(*FuncType).Common", Method, 0}, - {"(*FuncType).Size", Method, 0}, - {"(*FuncType).String", Method, 0}, - {"(*IntType).Basic", Method, 0}, - {"(*IntType).Common", Method, 0}, - {"(*IntType).Size", Method, 0}, - {"(*IntType).String", Method, 0}, - {"(*LineReader).Files", Method, 14}, - {"(*LineReader).Next", Method, 5}, - {"(*LineReader).Reset", Method, 5}, - {"(*LineReader).Seek", Method, 5}, - {"(*LineReader).SeekPC", Method, 5}, - {"(*LineReader).Tell", Method, 5}, - {"(*PtrType).Common", Method, 0}, - {"(*PtrType).Size", Method, 0}, - {"(*PtrType).String", Method, 0}, - {"(*QualType).Common", Method, 0}, - {"(*QualType).Size", Method, 0}, - {"(*QualType).String", Method, 0}, - {"(*Reader).AddressSize", Method, 5}, - {"(*Reader).ByteOrder", Method, 14}, - {"(*Reader).Next", Method, 0}, - {"(*Reader).Seek", Method, 0}, - {"(*Reader).SeekPC", Method, 7}, - {"(*Reader).SkipChildren", Method, 0}, - {"(*StructType).Common", Method, 0}, - {"(*StructType).Defn", Method, 0}, - {"(*StructType).Size", Method, 0}, - {"(*StructType).String", Method, 0}, - {"(*TypedefType).Common", Method, 0}, - {"(*TypedefType).Size", Method, 0}, - {"(*TypedefType).String", Method, 0}, - {"(*UcharType).Basic", Method, 0}, - {"(*UcharType).Common", Method, 0}, - {"(*UcharType).Size", Method, 0}, - {"(*UcharType).String", Method, 0}, - {"(*UintType).Basic", Method, 0}, - {"(*UintType).Common", Method, 0}, - {"(*UintType).Size", Method, 0}, - {"(*UintType).String", Method, 0}, - {"(*UnspecifiedType).Basic", Method, 4}, - {"(*UnspecifiedType).Common", Method, 4}, - {"(*UnspecifiedType).Size", Method, 4}, - {"(*UnspecifiedType).String", Method, 4}, - {"(*UnsupportedType).Common", Method, 13}, - {"(*UnsupportedType).Size", Method, 13}, - {"(*UnsupportedType).String", Method, 13}, - {"(*VoidType).Common", Method, 0}, - {"(*VoidType).Size", Method, 0}, - {"(*VoidType).String", Method, 0}, - {"(Attr).GoString", Method, 0}, - {"(Attr).String", Method, 0}, - {"(Class).GoString", Method, 5}, - {"(Class).String", Method, 5}, - {"(DecodeError).Error", Method, 0}, - {"(Tag).GoString", Method, 0}, - {"(Tag).String", Method, 0}, - {"AddrType", Type, 0}, - {"AddrType.BasicType", Field, 0}, - {"ArrayType", Type, 0}, - {"ArrayType.CommonType", Field, 0}, - {"ArrayType.Count", Field, 0}, - {"ArrayType.StrideBitSize", Field, 0}, - {"ArrayType.Type", Field, 0}, - {"Attr", Type, 0}, - {"AttrAbstractOrigin", Const, 0}, - {"AttrAccessibility", Const, 0}, - {"AttrAddrBase", Const, 14}, - {"AttrAddrClass", Const, 0}, - {"AttrAlignment", Const, 14}, - {"AttrAllocated", Const, 0}, - {"AttrArtificial", Const, 0}, - {"AttrAssociated", Const, 0}, - {"AttrBaseTypes", Const, 0}, - {"AttrBinaryScale", Const, 14}, - {"AttrBitOffset", Const, 0}, - {"AttrBitSize", Const, 0}, - {"AttrByteSize", Const, 0}, - {"AttrCallAllCalls", Const, 14}, - {"AttrCallAllSourceCalls", Const, 14}, - {"AttrCallAllTailCalls", Const, 14}, - {"AttrCallColumn", Const, 0}, - {"AttrCallDataLocation", Const, 14}, - {"AttrCallDataValue", Const, 14}, - {"AttrCallFile", Const, 0}, - {"AttrCallLine", Const, 0}, - {"AttrCallOrigin", Const, 14}, - {"AttrCallPC", Const, 14}, - {"AttrCallParameter", Const, 14}, - {"AttrCallReturnPC", Const, 14}, - {"AttrCallTailCall", Const, 14}, - {"AttrCallTarget", Const, 14}, - {"AttrCallTargetClobbered", Const, 14}, - {"AttrCallValue", Const, 14}, - {"AttrCalling", Const, 0}, - {"AttrCommonRef", Const, 0}, - {"AttrCompDir", Const, 0}, - {"AttrConstExpr", Const, 14}, - {"AttrConstValue", Const, 0}, - {"AttrContainingType", Const, 0}, - {"AttrCount", Const, 0}, - {"AttrDataBitOffset", Const, 14}, - {"AttrDataLocation", Const, 0}, - {"AttrDataMemberLoc", Const, 0}, - {"AttrDecimalScale", Const, 14}, - {"AttrDecimalSign", Const, 14}, - {"AttrDeclColumn", Const, 0}, - {"AttrDeclFile", Const, 0}, - {"AttrDeclLine", Const, 0}, - {"AttrDeclaration", Const, 0}, - {"AttrDefaultValue", Const, 0}, - {"AttrDefaulted", Const, 14}, - {"AttrDeleted", Const, 14}, - {"AttrDescription", Const, 0}, - {"AttrDigitCount", Const, 14}, - {"AttrDiscr", Const, 0}, - {"AttrDiscrList", Const, 0}, - {"AttrDiscrValue", Const, 0}, - {"AttrDwoName", Const, 14}, - {"AttrElemental", Const, 14}, - {"AttrEncoding", Const, 0}, - {"AttrEndianity", Const, 14}, - {"AttrEntrypc", Const, 0}, - {"AttrEnumClass", Const, 14}, - {"AttrExplicit", Const, 14}, - {"AttrExportSymbols", Const, 14}, - {"AttrExtension", Const, 0}, - {"AttrExternal", Const, 0}, - {"AttrFrameBase", Const, 0}, - {"AttrFriend", Const, 0}, - {"AttrHighpc", Const, 0}, - {"AttrIdentifierCase", Const, 0}, - {"AttrImport", Const, 0}, - {"AttrInline", Const, 0}, - {"AttrIsOptional", Const, 0}, - {"AttrLanguage", Const, 0}, - {"AttrLinkageName", Const, 14}, - {"AttrLocation", Const, 0}, - {"AttrLoclistsBase", Const, 14}, - {"AttrLowerBound", Const, 0}, - {"AttrLowpc", Const, 0}, - {"AttrMacroInfo", Const, 0}, - {"AttrMacros", Const, 14}, - {"AttrMainSubprogram", Const, 14}, - {"AttrMutable", Const, 14}, - {"AttrName", Const, 0}, - {"AttrNamelistItem", Const, 0}, - {"AttrNoreturn", Const, 14}, - {"AttrObjectPointer", Const, 14}, - {"AttrOrdering", Const, 0}, - {"AttrPictureString", Const, 14}, - {"AttrPriority", Const, 0}, - {"AttrProducer", Const, 0}, - {"AttrPrototyped", Const, 0}, - {"AttrPure", Const, 14}, - {"AttrRanges", Const, 0}, - {"AttrRank", Const, 14}, - {"AttrRecursive", Const, 14}, - {"AttrReference", Const, 14}, - {"AttrReturnAddr", Const, 0}, - {"AttrRnglistsBase", Const, 14}, - {"AttrRvalueReference", Const, 14}, - {"AttrSegment", Const, 0}, - {"AttrSibling", Const, 0}, - {"AttrSignature", Const, 14}, - {"AttrSmall", Const, 14}, - {"AttrSpecification", Const, 0}, - {"AttrStartScope", Const, 0}, - {"AttrStaticLink", Const, 0}, - {"AttrStmtList", Const, 0}, - {"AttrStrOffsetsBase", Const, 14}, - {"AttrStride", Const, 0}, - {"AttrStrideSize", Const, 0}, - {"AttrStringLength", Const, 0}, - {"AttrStringLengthBitSize", Const, 14}, - {"AttrStringLengthByteSize", Const, 14}, - {"AttrThreadsScaled", Const, 14}, - {"AttrTrampoline", Const, 0}, - {"AttrType", Const, 0}, - {"AttrUpperBound", Const, 0}, - {"AttrUseLocation", Const, 0}, - {"AttrUseUTF8", Const, 0}, - {"AttrVarParam", Const, 0}, - {"AttrVirtuality", Const, 0}, - {"AttrVisibility", Const, 0}, - {"AttrVtableElemLoc", Const, 0}, - {"BasicType", Type, 0}, - {"BasicType.BitOffset", Field, 0}, - {"BasicType.BitSize", Field, 0}, - {"BasicType.CommonType", Field, 0}, - {"BasicType.DataBitOffset", Field, 18}, - {"BoolType", Type, 0}, - {"BoolType.BasicType", Field, 0}, - {"CharType", Type, 0}, - {"CharType.BasicType", Field, 0}, - {"Class", Type, 5}, - {"ClassAddrPtr", Const, 14}, - {"ClassAddress", Const, 5}, - {"ClassBlock", Const, 5}, - {"ClassConstant", Const, 5}, - {"ClassExprLoc", Const, 5}, - {"ClassFlag", Const, 5}, - {"ClassLinePtr", Const, 5}, - {"ClassLocList", Const, 14}, - {"ClassLocListPtr", Const, 5}, - {"ClassMacPtr", Const, 5}, - {"ClassRangeListPtr", Const, 5}, - {"ClassReference", Const, 5}, - {"ClassReferenceAlt", Const, 5}, - {"ClassReferenceSig", Const, 5}, - {"ClassRngList", Const, 14}, - {"ClassRngListsPtr", Const, 14}, - {"ClassStrOffsetsPtr", Const, 14}, - {"ClassString", Const, 5}, - {"ClassStringAlt", Const, 5}, - {"ClassUnknown", Const, 6}, - {"CommonType", Type, 0}, - {"CommonType.ByteSize", Field, 0}, - {"CommonType.Name", Field, 0}, - {"ComplexType", Type, 0}, - {"ComplexType.BasicType", Field, 0}, - {"Data", Type, 0}, - {"DecodeError", Type, 0}, - {"DecodeError.Err", Field, 0}, - {"DecodeError.Name", Field, 0}, - {"DecodeError.Offset", Field, 0}, - {"DotDotDotType", Type, 0}, - {"DotDotDotType.CommonType", Field, 0}, - {"Entry", Type, 0}, - {"Entry.Children", Field, 0}, - {"Entry.Field", Field, 0}, - {"Entry.Offset", Field, 0}, - {"Entry.Tag", Field, 0}, - {"EnumType", Type, 0}, - {"EnumType.CommonType", Field, 0}, - {"EnumType.EnumName", Field, 0}, - {"EnumType.Val", Field, 0}, - {"EnumValue", Type, 0}, - {"EnumValue.Name", Field, 0}, - {"EnumValue.Val", Field, 0}, - {"ErrUnknownPC", Var, 5}, - {"Field", Type, 0}, - {"Field.Attr", Field, 0}, - {"Field.Class", Field, 5}, - {"Field.Val", Field, 0}, - {"FloatType", Type, 0}, - {"FloatType.BasicType", Field, 0}, - {"FuncType", Type, 0}, - {"FuncType.CommonType", Field, 0}, - {"FuncType.ParamType", Field, 0}, - {"FuncType.ReturnType", Field, 0}, - {"IntType", Type, 0}, - {"IntType.BasicType", Field, 0}, - {"LineEntry", Type, 5}, - {"LineEntry.Address", Field, 5}, - {"LineEntry.BasicBlock", Field, 5}, - {"LineEntry.Column", Field, 5}, - {"LineEntry.Discriminator", Field, 5}, - {"LineEntry.EndSequence", Field, 5}, - {"LineEntry.EpilogueBegin", Field, 5}, - {"LineEntry.File", Field, 5}, - {"LineEntry.ISA", Field, 5}, - {"LineEntry.IsStmt", Field, 5}, - {"LineEntry.Line", Field, 5}, - {"LineEntry.OpIndex", Field, 5}, - {"LineEntry.PrologueEnd", Field, 5}, - {"LineFile", Type, 5}, - {"LineFile.Length", Field, 5}, - {"LineFile.Mtime", Field, 5}, - {"LineFile.Name", Field, 5}, - {"LineReader", Type, 5}, - {"LineReaderPos", Type, 5}, - {"New", Func, 0}, - {"Offset", Type, 0}, - {"PtrType", Type, 0}, - {"PtrType.CommonType", Field, 0}, - {"PtrType.Type", Field, 0}, - {"QualType", Type, 0}, - {"QualType.CommonType", Field, 0}, - {"QualType.Qual", Field, 0}, - {"QualType.Type", Field, 0}, - {"Reader", Type, 0}, - {"StructField", Type, 0}, - {"StructField.BitOffset", Field, 0}, - {"StructField.BitSize", Field, 0}, - {"StructField.ByteOffset", Field, 0}, - {"StructField.ByteSize", Field, 0}, - {"StructField.DataBitOffset", Field, 18}, - {"StructField.Name", Field, 0}, - {"StructField.Type", Field, 0}, - {"StructType", Type, 0}, - {"StructType.CommonType", Field, 0}, - {"StructType.Field", Field, 0}, - {"StructType.Incomplete", Field, 0}, - {"StructType.Kind", Field, 0}, - {"StructType.StructName", Field, 0}, - {"Tag", Type, 0}, - {"TagAccessDeclaration", Const, 0}, - {"TagArrayType", Const, 0}, - {"TagAtomicType", Const, 14}, - {"TagBaseType", Const, 0}, - {"TagCallSite", Const, 14}, - {"TagCallSiteParameter", Const, 14}, - {"TagCatchDwarfBlock", Const, 0}, - {"TagClassType", Const, 0}, - {"TagCoarrayType", Const, 14}, - {"TagCommonDwarfBlock", Const, 0}, - {"TagCommonInclusion", Const, 0}, - {"TagCompileUnit", Const, 0}, - {"TagCondition", Const, 3}, - {"TagConstType", Const, 0}, - {"TagConstant", Const, 0}, - {"TagDwarfProcedure", Const, 0}, - {"TagDynamicType", Const, 14}, - {"TagEntryPoint", Const, 0}, - {"TagEnumerationType", Const, 0}, - {"TagEnumerator", Const, 0}, - {"TagFileType", Const, 0}, - {"TagFormalParameter", Const, 0}, - {"TagFriend", Const, 0}, - {"TagGenericSubrange", Const, 14}, - {"TagImmutableType", Const, 14}, - {"TagImportedDeclaration", Const, 0}, - {"TagImportedModule", Const, 0}, - {"TagImportedUnit", Const, 0}, - {"TagInheritance", Const, 0}, - {"TagInlinedSubroutine", Const, 0}, - {"TagInterfaceType", Const, 0}, - {"TagLabel", Const, 0}, - {"TagLexDwarfBlock", Const, 0}, - {"TagMember", Const, 0}, - {"TagModule", Const, 0}, - {"TagMutableType", Const, 0}, - {"TagNamelist", Const, 0}, - {"TagNamelistItem", Const, 0}, - {"TagNamespace", Const, 0}, - {"TagPackedType", Const, 0}, - {"TagPartialUnit", Const, 0}, - {"TagPointerType", Const, 0}, - {"TagPtrToMemberType", Const, 0}, - {"TagReferenceType", Const, 0}, - {"TagRestrictType", Const, 0}, - {"TagRvalueReferenceType", Const, 3}, - {"TagSetType", Const, 0}, - {"TagSharedType", Const, 3}, - {"TagSkeletonUnit", Const, 14}, - {"TagStringType", Const, 0}, - {"TagStructType", Const, 0}, - {"TagSubprogram", Const, 0}, - {"TagSubrangeType", Const, 0}, - {"TagSubroutineType", Const, 0}, - {"TagTemplateAlias", Const, 3}, - {"TagTemplateTypeParameter", Const, 0}, - {"TagTemplateValueParameter", Const, 0}, - {"TagThrownType", Const, 0}, - {"TagTryDwarfBlock", Const, 0}, - {"TagTypeUnit", Const, 3}, - {"TagTypedef", Const, 0}, - {"TagUnionType", Const, 0}, - {"TagUnspecifiedParameters", Const, 0}, - {"TagUnspecifiedType", Const, 0}, - {"TagVariable", Const, 0}, - {"TagVariant", Const, 0}, - {"TagVariantPart", Const, 0}, - {"TagVolatileType", Const, 0}, - {"TagWithStmt", Const, 0}, - {"Type", Type, 0}, - {"TypedefType", Type, 0}, - {"TypedefType.CommonType", Field, 0}, - {"TypedefType.Type", Field, 0}, - {"UcharType", Type, 0}, - {"UcharType.BasicType", Field, 0}, - {"UintType", Type, 0}, - {"UintType.BasicType", Field, 0}, - {"UnspecifiedType", Type, 4}, - {"UnspecifiedType.BasicType", Field, 4}, - {"UnsupportedType", Type, 13}, - {"UnsupportedType.CommonType", Field, 13}, - {"UnsupportedType.Tag", Field, 13}, - {"VoidType", Type, 0}, - {"VoidType.CommonType", Field, 0}, - }, - "debug/elf": { - {"(*File).Close", Method, 0}, - {"(*File).DWARF", Method, 0}, - {"(*File).DynString", Method, 1}, - {"(*File).DynValue", Method, 21}, - {"(*File).DynamicSymbols", Method, 4}, - {"(*File).ImportedLibraries", Method, 0}, - {"(*File).ImportedSymbols", Method, 0}, - {"(*File).Section", Method, 0}, - {"(*File).SectionByType", Method, 0}, - {"(*File).Symbols", Method, 0}, - {"(*FormatError).Error", Method, 0}, - {"(*Prog).Open", Method, 0}, - {"(*Section).Data", Method, 0}, - {"(*Section).Open", Method, 0}, - {"(Class).GoString", Method, 0}, - {"(Class).String", Method, 0}, - {"(CompressionType).GoString", Method, 6}, - {"(CompressionType).String", Method, 6}, - {"(Data).GoString", Method, 0}, - {"(Data).String", Method, 0}, - {"(DynFlag).GoString", Method, 0}, - {"(DynFlag).String", Method, 0}, - {"(DynFlag1).GoString", Method, 21}, - {"(DynFlag1).String", Method, 21}, - {"(DynTag).GoString", Method, 0}, - {"(DynTag).String", Method, 0}, - {"(Machine).GoString", Method, 0}, - {"(Machine).String", Method, 0}, - {"(NType).GoString", Method, 0}, - {"(NType).String", Method, 0}, - {"(OSABI).GoString", Method, 0}, - {"(OSABI).String", Method, 0}, - {"(Prog).ReadAt", Method, 0}, - {"(ProgFlag).GoString", Method, 0}, - {"(ProgFlag).String", Method, 0}, - {"(ProgType).GoString", Method, 0}, - {"(ProgType).String", Method, 0}, - {"(R_386).GoString", Method, 0}, - {"(R_386).String", Method, 0}, - {"(R_390).GoString", Method, 7}, - {"(R_390).String", Method, 7}, - {"(R_AARCH64).GoString", Method, 4}, - {"(R_AARCH64).String", Method, 4}, - {"(R_ALPHA).GoString", Method, 0}, - {"(R_ALPHA).String", Method, 0}, - {"(R_ARM).GoString", Method, 0}, - {"(R_ARM).String", Method, 0}, - {"(R_LARCH).GoString", Method, 19}, - {"(R_LARCH).String", Method, 19}, - {"(R_MIPS).GoString", Method, 6}, - {"(R_MIPS).String", Method, 6}, - {"(R_PPC).GoString", Method, 0}, - {"(R_PPC).String", Method, 0}, - {"(R_PPC64).GoString", Method, 5}, - {"(R_PPC64).String", Method, 5}, - {"(R_RISCV).GoString", Method, 11}, - {"(R_RISCV).String", Method, 11}, - {"(R_SPARC).GoString", Method, 0}, - {"(R_SPARC).String", Method, 0}, - {"(R_X86_64).GoString", Method, 0}, - {"(R_X86_64).String", Method, 0}, - {"(Section).ReadAt", Method, 0}, - {"(SectionFlag).GoString", Method, 0}, - {"(SectionFlag).String", Method, 0}, - {"(SectionIndex).GoString", Method, 0}, - {"(SectionIndex).String", Method, 0}, - {"(SectionType).GoString", Method, 0}, - {"(SectionType).String", Method, 0}, - {"(SymBind).GoString", Method, 0}, - {"(SymBind).String", Method, 0}, - {"(SymType).GoString", Method, 0}, - {"(SymType).String", Method, 0}, - {"(SymVis).GoString", Method, 0}, - {"(SymVis).String", Method, 0}, - {"(Type).GoString", Method, 0}, - {"(Type).String", Method, 0}, - {"(Version).GoString", Method, 0}, - {"(Version).String", Method, 0}, - {"ARM_MAGIC_TRAMP_NUMBER", Const, 0}, - {"COMPRESS_HIOS", Const, 6}, - {"COMPRESS_HIPROC", Const, 6}, - {"COMPRESS_LOOS", Const, 6}, - {"COMPRESS_LOPROC", Const, 6}, - {"COMPRESS_ZLIB", Const, 6}, - {"COMPRESS_ZSTD", Const, 21}, - {"Chdr32", Type, 6}, - {"Chdr32.Addralign", Field, 6}, - {"Chdr32.Size", Field, 6}, - {"Chdr32.Type", Field, 6}, - {"Chdr64", Type, 6}, - {"Chdr64.Addralign", Field, 6}, - {"Chdr64.Size", Field, 6}, - {"Chdr64.Type", Field, 6}, - {"Class", Type, 0}, - {"CompressionType", Type, 6}, - {"DF_1_CONFALT", Const, 21}, - {"DF_1_DIRECT", Const, 21}, - {"DF_1_DISPRELDNE", Const, 21}, - {"DF_1_DISPRELPND", Const, 21}, - {"DF_1_EDITED", Const, 21}, - {"DF_1_ENDFILTEE", Const, 21}, - {"DF_1_GLOBAL", Const, 21}, - {"DF_1_GLOBAUDIT", Const, 21}, - {"DF_1_GROUP", Const, 21}, - {"DF_1_IGNMULDEF", Const, 21}, - {"DF_1_INITFIRST", Const, 21}, - {"DF_1_INTERPOSE", Const, 21}, - {"DF_1_KMOD", Const, 21}, - {"DF_1_LOADFLTR", Const, 21}, - {"DF_1_NOCOMMON", Const, 21}, - {"DF_1_NODEFLIB", Const, 21}, - {"DF_1_NODELETE", Const, 21}, - {"DF_1_NODIRECT", Const, 21}, - {"DF_1_NODUMP", Const, 21}, - {"DF_1_NOHDR", Const, 21}, - {"DF_1_NOKSYMS", Const, 21}, - {"DF_1_NOOPEN", Const, 21}, - {"DF_1_NORELOC", Const, 21}, - {"DF_1_NOW", Const, 21}, - {"DF_1_ORIGIN", Const, 21}, - {"DF_1_PIE", Const, 21}, - {"DF_1_SINGLETON", Const, 21}, - {"DF_1_STUB", Const, 21}, - {"DF_1_SYMINTPOSE", Const, 21}, - {"DF_1_TRANS", Const, 21}, - {"DF_1_WEAKFILTER", Const, 21}, - {"DF_BIND_NOW", Const, 0}, - {"DF_ORIGIN", Const, 0}, - {"DF_STATIC_TLS", Const, 0}, - {"DF_SYMBOLIC", Const, 0}, - {"DF_TEXTREL", Const, 0}, - {"DT_ADDRRNGHI", Const, 16}, - {"DT_ADDRRNGLO", Const, 16}, - {"DT_AUDIT", Const, 16}, - {"DT_AUXILIARY", Const, 16}, - {"DT_BIND_NOW", Const, 0}, - {"DT_CHECKSUM", Const, 16}, - {"DT_CONFIG", Const, 16}, - {"DT_DEBUG", Const, 0}, - {"DT_DEPAUDIT", Const, 16}, - {"DT_ENCODING", Const, 0}, - {"DT_FEATURE", Const, 16}, - {"DT_FILTER", Const, 16}, - {"DT_FINI", Const, 0}, - {"DT_FINI_ARRAY", Const, 0}, - {"DT_FINI_ARRAYSZ", Const, 0}, - {"DT_FLAGS", Const, 0}, - {"DT_FLAGS_1", Const, 16}, - {"DT_GNU_CONFLICT", Const, 16}, - {"DT_GNU_CONFLICTSZ", Const, 16}, - {"DT_GNU_HASH", Const, 16}, - {"DT_GNU_LIBLIST", Const, 16}, - {"DT_GNU_LIBLISTSZ", Const, 16}, - {"DT_GNU_PRELINKED", Const, 16}, - {"DT_HASH", Const, 0}, - {"DT_HIOS", Const, 0}, - {"DT_HIPROC", Const, 0}, - {"DT_INIT", Const, 0}, - {"DT_INIT_ARRAY", Const, 0}, - {"DT_INIT_ARRAYSZ", Const, 0}, - {"DT_JMPREL", Const, 0}, - {"DT_LOOS", Const, 0}, - {"DT_LOPROC", Const, 0}, - {"DT_MIPS_AUX_DYNAMIC", Const, 16}, - {"DT_MIPS_BASE_ADDRESS", Const, 16}, - {"DT_MIPS_COMPACT_SIZE", Const, 16}, - {"DT_MIPS_CONFLICT", Const, 16}, - {"DT_MIPS_CONFLICTNO", Const, 16}, - {"DT_MIPS_CXX_FLAGS", Const, 16}, - {"DT_MIPS_DELTA_CLASS", Const, 16}, - {"DT_MIPS_DELTA_CLASSSYM", Const, 16}, - {"DT_MIPS_DELTA_CLASSSYM_NO", Const, 16}, - {"DT_MIPS_DELTA_CLASS_NO", Const, 16}, - {"DT_MIPS_DELTA_INSTANCE", Const, 16}, - {"DT_MIPS_DELTA_INSTANCE_NO", Const, 16}, - {"DT_MIPS_DELTA_RELOC", Const, 16}, - {"DT_MIPS_DELTA_RELOC_NO", Const, 16}, - {"DT_MIPS_DELTA_SYM", Const, 16}, - {"DT_MIPS_DELTA_SYM_NO", Const, 16}, - {"DT_MIPS_DYNSTR_ALIGN", Const, 16}, - {"DT_MIPS_FLAGS", Const, 16}, - {"DT_MIPS_GOTSYM", Const, 16}, - {"DT_MIPS_GP_VALUE", Const, 16}, - {"DT_MIPS_HIDDEN_GOTIDX", Const, 16}, - {"DT_MIPS_HIPAGENO", Const, 16}, - {"DT_MIPS_ICHECKSUM", Const, 16}, - {"DT_MIPS_INTERFACE", Const, 16}, - {"DT_MIPS_INTERFACE_SIZE", Const, 16}, - {"DT_MIPS_IVERSION", Const, 16}, - {"DT_MIPS_LIBLIST", Const, 16}, - {"DT_MIPS_LIBLISTNO", Const, 16}, - {"DT_MIPS_LOCALPAGE_GOTIDX", Const, 16}, - {"DT_MIPS_LOCAL_GOTIDX", Const, 16}, - {"DT_MIPS_LOCAL_GOTNO", Const, 16}, - {"DT_MIPS_MSYM", Const, 16}, - {"DT_MIPS_OPTIONS", Const, 16}, - {"DT_MIPS_PERF_SUFFIX", Const, 16}, - {"DT_MIPS_PIXIE_INIT", Const, 16}, - {"DT_MIPS_PLTGOT", Const, 16}, - {"DT_MIPS_PROTECTED_GOTIDX", Const, 16}, - {"DT_MIPS_RLD_MAP", Const, 16}, - {"DT_MIPS_RLD_MAP_REL", Const, 16}, - {"DT_MIPS_RLD_TEXT_RESOLVE_ADDR", Const, 16}, - {"DT_MIPS_RLD_VERSION", Const, 16}, - {"DT_MIPS_RWPLT", Const, 16}, - {"DT_MIPS_SYMBOL_LIB", Const, 16}, - {"DT_MIPS_SYMTABNO", Const, 16}, - {"DT_MIPS_TIME_STAMP", Const, 16}, - {"DT_MIPS_UNREFEXTNO", Const, 16}, - {"DT_MOVEENT", Const, 16}, - {"DT_MOVESZ", Const, 16}, - {"DT_MOVETAB", Const, 16}, - {"DT_NEEDED", Const, 0}, - {"DT_NULL", Const, 0}, - {"DT_PLTGOT", Const, 0}, - {"DT_PLTPAD", Const, 16}, - {"DT_PLTPADSZ", Const, 16}, - {"DT_PLTREL", Const, 0}, - {"DT_PLTRELSZ", Const, 0}, - {"DT_POSFLAG_1", Const, 16}, - {"DT_PPC64_GLINK", Const, 16}, - {"DT_PPC64_OPD", Const, 16}, - {"DT_PPC64_OPDSZ", Const, 16}, - {"DT_PPC64_OPT", Const, 16}, - {"DT_PPC_GOT", Const, 16}, - {"DT_PPC_OPT", Const, 16}, - {"DT_PREINIT_ARRAY", Const, 0}, - {"DT_PREINIT_ARRAYSZ", Const, 0}, - {"DT_REL", Const, 0}, - {"DT_RELA", Const, 0}, - {"DT_RELACOUNT", Const, 16}, - {"DT_RELAENT", Const, 0}, - {"DT_RELASZ", Const, 0}, - {"DT_RELCOUNT", Const, 16}, - {"DT_RELENT", Const, 0}, - {"DT_RELSZ", Const, 0}, - {"DT_RPATH", Const, 0}, - {"DT_RUNPATH", Const, 0}, - {"DT_SONAME", Const, 0}, - {"DT_SPARC_REGISTER", Const, 16}, - {"DT_STRSZ", Const, 0}, - {"DT_STRTAB", Const, 0}, - {"DT_SYMBOLIC", Const, 0}, - {"DT_SYMENT", Const, 0}, - {"DT_SYMINENT", Const, 16}, - {"DT_SYMINFO", Const, 16}, - {"DT_SYMINSZ", Const, 16}, - {"DT_SYMTAB", Const, 0}, - {"DT_SYMTAB_SHNDX", Const, 16}, - {"DT_TEXTREL", Const, 0}, - {"DT_TLSDESC_GOT", Const, 16}, - {"DT_TLSDESC_PLT", Const, 16}, - {"DT_USED", Const, 16}, - {"DT_VALRNGHI", Const, 16}, - {"DT_VALRNGLO", Const, 16}, - {"DT_VERDEF", Const, 16}, - {"DT_VERDEFNUM", Const, 16}, - {"DT_VERNEED", Const, 0}, - {"DT_VERNEEDNUM", Const, 0}, - {"DT_VERSYM", Const, 0}, - {"Data", Type, 0}, - {"Dyn32", Type, 0}, - {"Dyn32.Tag", Field, 0}, - {"Dyn32.Val", Field, 0}, - {"Dyn64", Type, 0}, - {"Dyn64.Tag", Field, 0}, - {"Dyn64.Val", Field, 0}, - {"DynFlag", Type, 0}, - {"DynFlag1", Type, 21}, - {"DynTag", Type, 0}, - {"EI_ABIVERSION", Const, 0}, - {"EI_CLASS", Const, 0}, - {"EI_DATA", Const, 0}, - {"EI_NIDENT", Const, 0}, - {"EI_OSABI", Const, 0}, - {"EI_PAD", Const, 0}, - {"EI_VERSION", Const, 0}, - {"ELFCLASS32", Const, 0}, - {"ELFCLASS64", Const, 0}, - {"ELFCLASSNONE", Const, 0}, - {"ELFDATA2LSB", Const, 0}, - {"ELFDATA2MSB", Const, 0}, - {"ELFDATANONE", Const, 0}, - {"ELFMAG", Const, 0}, - {"ELFOSABI_86OPEN", Const, 0}, - {"ELFOSABI_AIX", Const, 0}, - {"ELFOSABI_ARM", Const, 0}, - {"ELFOSABI_AROS", Const, 11}, - {"ELFOSABI_CLOUDABI", Const, 11}, - {"ELFOSABI_FENIXOS", Const, 11}, - {"ELFOSABI_FREEBSD", Const, 0}, - {"ELFOSABI_HPUX", Const, 0}, - {"ELFOSABI_HURD", Const, 0}, - {"ELFOSABI_IRIX", Const, 0}, - {"ELFOSABI_LINUX", Const, 0}, - {"ELFOSABI_MODESTO", Const, 0}, - {"ELFOSABI_NETBSD", Const, 0}, - {"ELFOSABI_NONE", Const, 0}, - {"ELFOSABI_NSK", Const, 0}, - {"ELFOSABI_OPENBSD", Const, 0}, - {"ELFOSABI_OPENVMS", Const, 0}, - {"ELFOSABI_SOLARIS", Const, 0}, - {"ELFOSABI_STANDALONE", Const, 0}, - {"ELFOSABI_TRU64", Const, 0}, - {"EM_386", Const, 0}, - {"EM_486", Const, 0}, - {"EM_56800EX", Const, 11}, - {"EM_68HC05", Const, 11}, - {"EM_68HC08", Const, 11}, - {"EM_68HC11", Const, 11}, - {"EM_68HC12", Const, 0}, - {"EM_68HC16", Const, 11}, - {"EM_68K", Const, 0}, - {"EM_78KOR", Const, 11}, - {"EM_8051", Const, 11}, - {"EM_860", Const, 0}, - {"EM_88K", Const, 0}, - {"EM_960", Const, 0}, - {"EM_AARCH64", Const, 4}, - {"EM_ALPHA", Const, 0}, - {"EM_ALPHA_STD", Const, 0}, - {"EM_ALTERA_NIOS2", Const, 11}, - {"EM_AMDGPU", Const, 11}, - {"EM_ARC", Const, 0}, - {"EM_ARCA", Const, 11}, - {"EM_ARC_COMPACT", Const, 11}, - {"EM_ARC_COMPACT2", Const, 11}, - {"EM_ARM", Const, 0}, - {"EM_AVR", Const, 11}, - {"EM_AVR32", Const, 11}, - {"EM_BA1", Const, 11}, - {"EM_BA2", Const, 11}, - {"EM_BLACKFIN", Const, 11}, - {"EM_BPF", Const, 11}, - {"EM_C166", Const, 11}, - {"EM_CDP", Const, 11}, - {"EM_CE", Const, 11}, - {"EM_CLOUDSHIELD", Const, 11}, - {"EM_COGE", Const, 11}, - {"EM_COLDFIRE", Const, 0}, - {"EM_COOL", Const, 11}, - {"EM_COREA_1ST", Const, 11}, - {"EM_COREA_2ND", Const, 11}, - {"EM_CR", Const, 11}, - {"EM_CR16", Const, 11}, - {"EM_CRAYNV2", Const, 11}, - {"EM_CRIS", Const, 11}, - {"EM_CRX", Const, 11}, - {"EM_CSR_KALIMBA", Const, 11}, - {"EM_CUDA", Const, 11}, - {"EM_CYPRESS_M8C", Const, 11}, - {"EM_D10V", Const, 11}, - {"EM_D30V", Const, 11}, - {"EM_DSP24", Const, 11}, - {"EM_DSPIC30F", Const, 11}, - {"EM_DXP", Const, 11}, - {"EM_ECOG1", Const, 11}, - {"EM_ECOG16", Const, 11}, - {"EM_ECOG1X", Const, 11}, - {"EM_ECOG2", Const, 11}, - {"EM_ETPU", Const, 11}, - {"EM_EXCESS", Const, 11}, - {"EM_F2MC16", Const, 11}, - {"EM_FIREPATH", Const, 11}, - {"EM_FR20", Const, 0}, - {"EM_FR30", Const, 11}, - {"EM_FT32", Const, 11}, - {"EM_FX66", Const, 11}, - {"EM_H8S", Const, 0}, - {"EM_H8_300", Const, 0}, - {"EM_H8_300H", Const, 0}, - {"EM_H8_500", Const, 0}, - {"EM_HUANY", Const, 11}, - {"EM_IA_64", Const, 0}, - {"EM_INTEL205", Const, 11}, - {"EM_INTEL206", Const, 11}, - {"EM_INTEL207", Const, 11}, - {"EM_INTEL208", Const, 11}, - {"EM_INTEL209", Const, 11}, - {"EM_IP2K", Const, 11}, - {"EM_JAVELIN", Const, 11}, - {"EM_K10M", Const, 11}, - {"EM_KM32", Const, 11}, - {"EM_KMX16", Const, 11}, - {"EM_KMX32", Const, 11}, - {"EM_KMX8", Const, 11}, - {"EM_KVARC", Const, 11}, - {"EM_L10M", Const, 11}, - {"EM_LANAI", Const, 11}, - {"EM_LATTICEMICO32", Const, 11}, - {"EM_LOONGARCH", Const, 19}, - {"EM_M16C", Const, 11}, - {"EM_M32", Const, 0}, - {"EM_M32C", Const, 11}, - {"EM_M32R", Const, 11}, - {"EM_MANIK", Const, 11}, - {"EM_MAX", Const, 11}, - {"EM_MAXQ30", Const, 11}, - {"EM_MCHP_PIC", Const, 11}, - {"EM_MCST_ELBRUS", Const, 11}, - {"EM_ME16", Const, 0}, - {"EM_METAG", Const, 11}, - {"EM_MICROBLAZE", Const, 11}, - {"EM_MIPS", Const, 0}, - {"EM_MIPS_RS3_LE", Const, 0}, - {"EM_MIPS_RS4_BE", Const, 0}, - {"EM_MIPS_X", Const, 0}, - {"EM_MMA", Const, 0}, - {"EM_MMDSP_PLUS", Const, 11}, - {"EM_MMIX", Const, 11}, - {"EM_MN10200", Const, 11}, - {"EM_MN10300", Const, 11}, - {"EM_MOXIE", Const, 11}, - {"EM_MSP430", Const, 11}, - {"EM_NCPU", Const, 0}, - {"EM_NDR1", Const, 0}, - {"EM_NDS32", Const, 11}, - {"EM_NONE", Const, 0}, - {"EM_NORC", Const, 11}, - {"EM_NS32K", Const, 11}, - {"EM_OPEN8", Const, 11}, - {"EM_OPENRISC", Const, 11}, - {"EM_PARISC", Const, 0}, - {"EM_PCP", Const, 0}, - {"EM_PDP10", Const, 11}, - {"EM_PDP11", Const, 11}, - {"EM_PDSP", Const, 11}, - {"EM_PJ", Const, 11}, - {"EM_PPC", Const, 0}, - {"EM_PPC64", Const, 0}, - {"EM_PRISM", Const, 11}, - {"EM_QDSP6", Const, 11}, - {"EM_R32C", Const, 11}, - {"EM_RCE", Const, 0}, - {"EM_RH32", Const, 0}, - {"EM_RISCV", Const, 11}, - {"EM_RL78", Const, 11}, - {"EM_RS08", Const, 11}, - {"EM_RX", Const, 11}, - {"EM_S370", Const, 0}, - {"EM_S390", Const, 0}, - {"EM_SCORE7", Const, 11}, - {"EM_SEP", Const, 11}, - {"EM_SE_C17", Const, 11}, - {"EM_SE_C33", Const, 11}, - {"EM_SH", Const, 0}, - {"EM_SHARC", Const, 11}, - {"EM_SLE9X", Const, 11}, - {"EM_SNP1K", Const, 11}, - {"EM_SPARC", Const, 0}, - {"EM_SPARC32PLUS", Const, 0}, - {"EM_SPARCV9", Const, 0}, - {"EM_ST100", Const, 0}, - {"EM_ST19", Const, 11}, - {"EM_ST200", Const, 11}, - {"EM_ST7", Const, 11}, - {"EM_ST9PLUS", Const, 11}, - {"EM_STARCORE", Const, 0}, - {"EM_STM8", Const, 11}, - {"EM_STXP7X", Const, 11}, - {"EM_SVX", Const, 11}, - {"EM_TILE64", Const, 11}, - {"EM_TILEGX", Const, 11}, - {"EM_TILEPRO", Const, 11}, - {"EM_TINYJ", Const, 0}, - {"EM_TI_ARP32", Const, 11}, - {"EM_TI_C2000", Const, 11}, - {"EM_TI_C5500", Const, 11}, - {"EM_TI_C6000", Const, 11}, - {"EM_TI_PRU", Const, 11}, - {"EM_TMM_GPP", Const, 11}, - {"EM_TPC", Const, 11}, - {"EM_TRICORE", Const, 0}, - {"EM_TRIMEDIA", Const, 11}, - {"EM_TSK3000", Const, 11}, - {"EM_UNICORE", Const, 11}, - {"EM_V800", Const, 0}, - {"EM_V850", Const, 11}, - {"EM_VAX", Const, 11}, - {"EM_VIDEOCORE", Const, 11}, - {"EM_VIDEOCORE3", Const, 11}, - {"EM_VIDEOCORE5", Const, 11}, - {"EM_VISIUM", Const, 11}, - {"EM_VPP500", Const, 0}, - {"EM_X86_64", Const, 0}, - {"EM_XCORE", Const, 11}, - {"EM_XGATE", Const, 11}, - {"EM_XIMO16", Const, 11}, - {"EM_XTENSA", Const, 11}, - {"EM_Z80", Const, 11}, - {"EM_ZSP", Const, 11}, - {"ET_CORE", Const, 0}, - {"ET_DYN", Const, 0}, - {"ET_EXEC", Const, 0}, - {"ET_HIOS", Const, 0}, - {"ET_HIPROC", Const, 0}, - {"ET_LOOS", Const, 0}, - {"ET_LOPROC", Const, 0}, - {"ET_NONE", Const, 0}, - {"ET_REL", Const, 0}, - {"EV_CURRENT", Const, 0}, - {"EV_NONE", Const, 0}, - {"ErrNoSymbols", Var, 4}, - {"File", Type, 0}, - {"File.FileHeader", Field, 0}, - {"File.Progs", Field, 0}, - {"File.Sections", Field, 0}, - {"FileHeader", Type, 0}, - {"FileHeader.ABIVersion", Field, 0}, - {"FileHeader.ByteOrder", Field, 0}, - {"FileHeader.Class", Field, 0}, - {"FileHeader.Data", Field, 0}, - {"FileHeader.Entry", Field, 1}, - {"FileHeader.Machine", Field, 0}, - {"FileHeader.OSABI", Field, 0}, - {"FileHeader.Type", Field, 0}, - {"FileHeader.Version", Field, 0}, - {"FormatError", Type, 0}, - {"Header32", Type, 0}, - {"Header32.Ehsize", Field, 0}, - {"Header32.Entry", Field, 0}, - {"Header32.Flags", Field, 0}, - {"Header32.Ident", Field, 0}, - {"Header32.Machine", Field, 0}, - {"Header32.Phentsize", Field, 0}, - {"Header32.Phnum", Field, 0}, - {"Header32.Phoff", Field, 0}, - {"Header32.Shentsize", Field, 0}, - {"Header32.Shnum", Field, 0}, - {"Header32.Shoff", Field, 0}, - {"Header32.Shstrndx", Field, 0}, - {"Header32.Type", Field, 0}, - {"Header32.Version", Field, 0}, - {"Header64", Type, 0}, - {"Header64.Ehsize", Field, 0}, - {"Header64.Entry", Field, 0}, - {"Header64.Flags", Field, 0}, - {"Header64.Ident", Field, 0}, - {"Header64.Machine", Field, 0}, - {"Header64.Phentsize", Field, 0}, - {"Header64.Phnum", Field, 0}, - {"Header64.Phoff", Field, 0}, - {"Header64.Shentsize", Field, 0}, - {"Header64.Shnum", Field, 0}, - {"Header64.Shoff", Field, 0}, - {"Header64.Shstrndx", Field, 0}, - {"Header64.Type", Field, 0}, - {"Header64.Version", Field, 0}, - {"ImportedSymbol", Type, 0}, - {"ImportedSymbol.Library", Field, 0}, - {"ImportedSymbol.Name", Field, 0}, - {"ImportedSymbol.Version", Field, 0}, - {"Machine", Type, 0}, - {"NT_FPREGSET", Const, 0}, - {"NT_PRPSINFO", Const, 0}, - {"NT_PRSTATUS", Const, 0}, - {"NType", Type, 0}, - {"NewFile", Func, 0}, - {"OSABI", Type, 0}, - {"Open", Func, 0}, - {"PF_MASKOS", Const, 0}, - {"PF_MASKPROC", Const, 0}, - {"PF_R", Const, 0}, - {"PF_W", Const, 0}, - {"PF_X", Const, 0}, - {"PT_AARCH64_ARCHEXT", Const, 16}, - {"PT_AARCH64_UNWIND", Const, 16}, - {"PT_ARM_ARCHEXT", Const, 16}, - {"PT_ARM_EXIDX", Const, 16}, - {"PT_DYNAMIC", Const, 0}, - {"PT_GNU_EH_FRAME", Const, 16}, - {"PT_GNU_MBIND_HI", Const, 16}, - {"PT_GNU_MBIND_LO", Const, 16}, - {"PT_GNU_PROPERTY", Const, 16}, - {"PT_GNU_RELRO", Const, 16}, - {"PT_GNU_STACK", Const, 16}, - {"PT_HIOS", Const, 0}, - {"PT_HIPROC", Const, 0}, - {"PT_INTERP", Const, 0}, - {"PT_LOAD", Const, 0}, - {"PT_LOOS", Const, 0}, - {"PT_LOPROC", Const, 0}, - {"PT_MIPS_ABIFLAGS", Const, 16}, - {"PT_MIPS_OPTIONS", Const, 16}, - {"PT_MIPS_REGINFO", Const, 16}, - {"PT_MIPS_RTPROC", Const, 16}, - {"PT_NOTE", Const, 0}, - {"PT_NULL", Const, 0}, - {"PT_OPENBSD_BOOTDATA", Const, 16}, - {"PT_OPENBSD_RANDOMIZE", Const, 16}, - {"PT_OPENBSD_WXNEEDED", Const, 16}, - {"PT_PAX_FLAGS", Const, 16}, - {"PT_PHDR", Const, 0}, - {"PT_S390_PGSTE", Const, 16}, - {"PT_SHLIB", Const, 0}, - {"PT_SUNWSTACK", Const, 16}, - {"PT_SUNW_EH_FRAME", Const, 16}, - {"PT_TLS", Const, 0}, - {"Prog", Type, 0}, - {"Prog.ProgHeader", Field, 0}, - {"Prog.ReaderAt", Field, 0}, - {"Prog32", Type, 0}, - {"Prog32.Align", Field, 0}, - {"Prog32.Filesz", Field, 0}, - {"Prog32.Flags", Field, 0}, - {"Prog32.Memsz", Field, 0}, - {"Prog32.Off", Field, 0}, - {"Prog32.Paddr", Field, 0}, - {"Prog32.Type", Field, 0}, - {"Prog32.Vaddr", Field, 0}, - {"Prog64", Type, 0}, - {"Prog64.Align", Field, 0}, - {"Prog64.Filesz", Field, 0}, - {"Prog64.Flags", Field, 0}, - {"Prog64.Memsz", Field, 0}, - {"Prog64.Off", Field, 0}, - {"Prog64.Paddr", Field, 0}, - {"Prog64.Type", Field, 0}, - {"Prog64.Vaddr", Field, 0}, - {"ProgFlag", Type, 0}, - {"ProgHeader", Type, 0}, - {"ProgHeader.Align", Field, 0}, - {"ProgHeader.Filesz", Field, 0}, - {"ProgHeader.Flags", Field, 0}, - {"ProgHeader.Memsz", Field, 0}, - {"ProgHeader.Off", Field, 0}, - {"ProgHeader.Paddr", Field, 0}, - {"ProgHeader.Type", Field, 0}, - {"ProgHeader.Vaddr", Field, 0}, - {"ProgType", Type, 0}, - {"R_386", Type, 0}, - {"R_386_16", Const, 10}, - {"R_386_32", Const, 0}, - {"R_386_32PLT", Const, 10}, - {"R_386_8", Const, 10}, - {"R_386_COPY", Const, 0}, - {"R_386_GLOB_DAT", Const, 0}, - {"R_386_GOT32", Const, 0}, - {"R_386_GOT32X", Const, 10}, - {"R_386_GOTOFF", Const, 0}, - {"R_386_GOTPC", Const, 0}, - {"R_386_IRELATIVE", Const, 10}, - {"R_386_JMP_SLOT", Const, 0}, - {"R_386_NONE", Const, 0}, - {"R_386_PC16", Const, 10}, - {"R_386_PC32", Const, 0}, - {"R_386_PC8", Const, 10}, - {"R_386_PLT32", Const, 0}, - {"R_386_RELATIVE", Const, 0}, - {"R_386_SIZE32", Const, 10}, - {"R_386_TLS_DESC", Const, 10}, - {"R_386_TLS_DESC_CALL", Const, 10}, - {"R_386_TLS_DTPMOD32", Const, 0}, - {"R_386_TLS_DTPOFF32", Const, 0}, - {"R_386_TLS_GD", Const, 0}, - {"R_386_TLS_GD_32", Const, 0}, - {"R_386_TLS_GD_CALL", Const, 0}, - {"R_386_TLS_GD_POP", Const, 0}, - {"R_386_TLS_GD_PUSH", Const, 0}, - {"R_386_TLS_GOTDESC", Const, 10}, - {"R_386_TLS_GOTIE", Const, 0}, - {"R_386_TLS_IE", Const, 0}, - {"R_386_TLS_IE_32", Const, 0}, - {"R_386_TLS_LDM", Const, 0}, - {"R_386_TLS_LDM_32", Const, 0}, - {"R_386_TLS_LDM_CALL", Const, 0}, - {"R_386_TLS_LDM_POP", Const, 0}, - {"R_386_TLS_LDM_PUSH", Const, 0}, - {"R_386_TLS_LDO_32", Const, 0}, - {"R_386_TLS_LE", Const, 0}, - {"R_386_TLS_LE_32", Const, 0}, - {"R_386_TLS_TPOFF", Const, 0}, - {"R_386_TLS_TPOFF32", Const, 0}, - {"R_390", Type, 7}, - {"R_390_12", Const, 7}, - {"R_390_16", Const, 7}, - {"R_390_20", Const, 7}, - {"R_390_32", Const, 7}, - {"R_390_64", Const, 7}, - {"R_390_8", Const, 7}, - {"R_390_COPY", Const, 7}, - {"R_390_GLOB_DAT", Const, 7}, - {"R_390_GOT12", Const, 7}, - {"R_390_GOT16", Const, 7}, - {"R_390_GOT20", Const, 7}, - {"R_390_GOT32", Const, 7}, - {"R_390_GOT64", Const, 7}, - {"R_390_GOTENT", Const, 7}, - {"R_390_GOTOFF", Const, 7}, - {"R_390_GOTOFF16", Const, 7}, - {"R_390_GOTOFF64", Const, 7}, - {"R_390_GOTPC", Const, 7}, - {"R_390_GOTPCDBL", Const, 7}, - {"R_390_GOTPLT12", Const, 7}, - {"R_390_GOTPLT16", Const, 7}, - {"R_390_GOTPLT20", Const, 7}, - {"R_390_GOTPLT32", Const, 7}, - {"R_390_GOTPLT64", Const, 7}, - {"R_390_GOTPLTENT", Const, 7}, - {"R_390_GOTPLTOFF16", Const, 7}, - {"R_390_GOTPLTOFF32", Const, 7}, - {"R_390_GOTPLTOFF64", Const, 7}, - {"R_390_JMP_SLOT", Const, 7}, - {"R_390_NONE", Const, 7}, - {"R_390_PC16", Const, 7}, - {"R_390_PC16DBL", Const, 7}, - {"R_390_PC32", Const, 7}, - {"R_390_PC32DBL", Const, 7}, - {"R_390_PC64", Const, 7}, - {"R_390_PLT16DBL", Const, 7}, - {"R_390_PLT32", Const, 7}, - {"R_390_PLT32DBL", Const, 7}, - {"R_390_PLT64", Const, 7}, - {"R_390_RELATIVE", Const, 7}, - {"R_390_TLS_DTPMOD", Const, 7}, - {"R_390_TLS_DTPOFF", Const, 7}, - {"R_390_TLS_GD32", Const, 7}, - {"R_390_TLS_GD64", Const, 7}, - {"R_390_TLS_GDCALL", Const, 7}, - {"R_390_TLS_GOTIE12", Const, 7}, - {"R_390_TLS_GOTIE20", Const, 7}, - {"R_390_TLS_GOTIE32", Const, 7}, - {"R_390_TLS_GOTIE64", Const, 7}, - {"R_390_TLS_IE32", Const, 7}, - {"R_390_TLS_IE64", Const, 7}, - {"R_390_TLS_IEENT", Const, 7}, - {"R_390_TLS_LDCALL", Const, 7}, - {"R_390_TLS_LDM32", Const, 7}, - {"R_390_TLS_LDM64", Const, 7}, - {"R_390_TLS_LDO32", Const, 7}, - {"R_390_TLS_LDO64", Const, 7}, - {"R_390_TLS_LE32", Const, 7}, - {"R_390_TLS_LE64", Const, 7}, - {"R_390_TLS_LOAD", Const, 7}, - {"R_390_TLS_TPOFF", Const, 7}, - {"R_AARCH64", Type, 4}, - {"R_AARCH64_ABS16", Const, 4}, - {"R_AARCH64_ABS32", Const, 4}, - {"R_AARCH64_ABS64", Const, 4}, - {"R_AARCH64_ADD_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_ADR_GOT_PAGE", Const, 4}, - {"R_AARCH64_ADR_PREL_LO21", Const, 4}, - {"R_AARCH64_ADR_PREL_PG_HI21", Const, 4}, - {"R_AARCH64_ADR_PREL_PG_HI21_NC", Const, 4}, - {"R_AARCH64_CALL26", Const, 4}, - {"R_AARCH64_CONDBR19", Const, 4}, - {"R_AARCH64_COPY", Const, 4}, - {"R_AARCH64_GLOB_DAT", Const, 4}, - {"R_AARCH64_GOT_LD_PREL19", Const, 4}, - {"R_AARCH64_IRELATIVE", Const, 4}, - {"R_AARCH64_JUMP26", Const, 4}, - {"R_AARCH64_JUMP_SLOT", Const, 4}, - {"R_AARCH64_LD64_GOTOFF_LO15", Const, 10}, - {"R_AARCH64_LD64_GOTPAGE_LO15", Const, 10}, - {"R_AARCH64_LD64_GOT_LO12_NC", Const, 4}, - {"R_AARCH64_LDST128_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_LDST16_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_LDST32_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_LDST64_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_LDST8_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_LD_PREL_LO19", Const, 4}, - {"R_AARCH64_MOVW_SABS_G0", Const, 4}, - {"R_AARCH64_MOVW_SABS_G1", Const, 4}, - {"R_AARCH64_MOVW_SABS_G2", Const, 4}, - {"R_AARCH64_MOVW_UABS_G0", Const, 4}, - {"R_AARCH64_MOVW_UABS_G0_NC", Const, 4}, - {"R_AARCH64_MOVW_UABS_G1", Const, 4}, - {"R_AARCH64_MOVW_UABS_G1_NC", Const, 4}, - {"R_AARCH64_MOVW_UABS_G2", Const, 4}, - {"R_AARCH64_MOVW_UABS_G2_NC", Const, 4}, - {"R_AARCH64_MOVW_UABS_G3", Const, 4}, - {"R_AARCH64_NONE", Const, 4}, - {"R_AARCH64_NULL", Const, 4}, - {"R_AARCH64_P32_ABS16", Const, 4}, - {"R_AARCH64_P32_ABS32", Const, 4}, - {"R_AARCH64_P32_ADD_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_ADR_GOT_PAGE", Const, 4}, - {"R_AARCH64_P32_ADR_PREL_LO21", Const, 4}, - {"R_AARCH64_P32_ADR_PREL_PG_HI21", Const, 4}, - {"R_AARCH64_P32_CALL26", Const, 4}, - {"R_AARCH64_P32_CONDBR19", Const, 4}, - {"R_AARCH64_P32_COPY", Const, 4}, - {"R_AARCH64_P32_GLOB_DAT", Const, 4}, - {"R_AARCH64_P32_GOT_LD_PREL19", Const, 4}, - {"R_AARCH64_P32_IRELATIVE", Const, 4}, - {"R_AARCH64_P32_JUMP26", Const, 4}, - {"R_AARCH64_P32_JUMP_SLOT", Const, 4}, - {"R_AARCH64_P32_LD32_GOT_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LDST128_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LDST16_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LDST32_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LDST64_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LDST8_ABS_LO12_NC", Const, 4}, - {"R_AARCH64_P32_LD_PREL_LO19", Const, 4}, - {"R_AARCH64_P32_MOVW_SABS_G0", Const, 4}, - {"R_AARCH64_P32_MOVW_UABS_G0", Const, 4}, - {"R_AARCH64_P32_MOVW_UABS_G0_NC", Const, 4}, - {"R_AARCH64_P32_MOVW_UABS_G1", Const, 4}, - {"R_AARCH64_P32_PREL16", Const, 4}, - {"R_AARCH64_P32_PREL32", Const, 4}, - {"R_AARCH64_P32_RELATIVE", Const, 4}, - {"R_AARCH64_P32_TLSDESC", Const, 4}, - {"R_AARCH64_P32_TLSDESC_ADD_LO12_NC", Const, 4}, - {"R_AARCH64_P32_TLSDESC_ADR_PAGE21", Const, 4}, - {"R_AARCH64_P32_TLSDESC_ADR_PREL21", Const, 4}, - {"R_AARCH64_P32_TLSDESC_CALL", Const, 4}, - {"R_AARCH64_P32_TLSDESC_LD32_LO12_NC", Const, 4}, - {"R_AARCH64_P32_TLSDESC_LD_PREL19", Const, 4}, - {"R_AARCH64_P32_TLSGD_ADD_LO12_NC", Const, 4}, - {"R_AARCH64_P32_TLSGD_ADR_PAGE21", Const, 4}, - {"R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4}, - {"R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", Const, 4}, - {"R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", Const, 4}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", Const, 4}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", Const, 4}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", Const, 4}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", Const, 4}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", Const, 4}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", Const, 4}, - {"R_AARCH64_P32_TLS_DTPMOD", Const, 4}, - {"R_AARCH64_P32_TLS_DTPREL", Const, 4}, - {"R_AARCH64_P32_TLS_TPREL", Const, 4}, - {"R_AARCH64_P32_TSTBR14", Const, 4}, - {"R_AARCH64_PREL16", Const, 4}, - {"R_AARCH64_PREL32", Const, 4}, - {"R_AARCH64_PREL64", Const, 4}, - {"R_AARCH64_RELATIVE", Const, 4}, - {"R_AARCH64_TLSDESC", Const, 4}, - {"R_AARCH64_TLSDESC_ADD", Const, 4}, - {"R_AARCH64_TLSDESC_ADD_LO12_NC", Const, 4}, - {"R_AARCH64_TLSDESC_ADR_PAGE21", Const, 4}, - {"R_AARCH64_TLSDESC_ADR_PREL21", Const, 4}, - {"R_AARCH64_TLSDESC_CALL", Const, 4}, - {"R_AARCH64_TLSDESC_LD64_LO12_NC", Const, 4}, - {"R_AARCH64_TLSDESC_LDR", Const, 4}, - {"R_AARCH64_TLSDESC_LD_PREL19", Const, 4}, - {"R_AARCH64_TLSDESC_OFF_G0_NC", Const, 4}, - {"R_AARCH64_TLSDESC_OFF_G1", Const, 4}, - {"R_AARCH64_TLSGD_ADD_LO12_NC", Const, 4}, - {"R_AARCH64_TLSGD_ADR_PAGE21", Const, 4}, - {"R_AARCH64_TLSGD_ADR_PREL21", Const, 10}, - {"R_AARCH64_TLSGD_MOVW_G0_NC", Const, 10}, - {"R_AARCH64_TLSGD_MOVW_G1", Const, 10}, - {"R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4}, - {"R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", Const, 4}, - {"R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", Const, 4}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", Const, 4}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", Const, 4}, - {"R_AARCH64_TLSLD_ADR_PAGE21", Const, 10}, - {"R_AARCH64_TLSLD_ADR_PREL21", Const, 10}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12", Const, 10}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", Const, 10}, - {"R_AARCH64_TLSLE_ADD_TPREL_HI12", Const, 4}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12", Const, 4}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", Const, 4}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12", Const, 10}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", Const, 10}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0", Const, 4}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", Const, 4}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1", Const, 4}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", Const, 4}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G2", Const, 4}, - {"R_AARCH64_TLS_DTPMOD64", Const, 4}, - {"R_AARCH64_TLS_DTPREL64", Const, 4}, - {"R_AARCH64_TLS_TPREL64", Const, 4}, - {"R_AARCH64_TSTBR14", Const, 4}, - {"R_ALPHA", Type, 0}, - {"R_ALPHA_BRADDR", Const, 0}, - {"R_ALPHA_COPY", Const, 0}, - {"R_ALPHA_GLOB_DAT", Const, 0}, - {"R_ALPHA_GPDISP", Const, 0}, - {"R_ALPHA_GPREL32", Const, 0}, - {"R_ALPHA_GPRELHIGH", Const, 0}, - {"R_ALPHA_GPRELLOW", Const, 0}, - {"R_ALPHA_GPVALUE", Const, 0}, - {"R_ALPHA_HINT", Const, 0}, - {"R_ALPHA_IMMED_BR_HI32", Const, 0}, - {"R_ALPHA_IMMED_GP_16", Const, 0}, - {"R_ALPHA_IMMED_GP_HI32", Const, 0}, - {"R_ALPHA_IMMED_LO32", Const, 0}, - {"R_ALPHA_IMMED_SCN_HI32", Const, 0}, - {"R_ALPHA_JMP_SLOT", Const, 0}, - {"R_ALPHA_LITERAL", Const, 0}, - {"R_ALPHA_LITUSE", Const, 0}, - {"R_ALPHA_NONE", Const, 0}, - {"R_ALPHA_OP_PRSHIFT", Const, 0}, - {"R_ALPHA_OP_PSUB", Const, 0}, - {"R_ALPHA_OP_PUSH", Const, 0}, - {"R_ALPHA_OP_STORE", Const, 0}, - {"R_ALPHA_REFLONG", Const, 0}, - {"R_ALPHA_REFQUAD", Const, 0}, - {"R_ALPHA_RELATIVE", Const, 0}, - {"R_ALPHA_SREL16", Const, 0}, - {"R_ALPHA_SREL32", Const, 0}, - {"R_ALPHA_SREL64", Const, 0}, - {"R_ARM", Type, 0}, - {"R_ARM_ABS12", Const, 0}, - {"R_ARM_ABS16", Const, 0}, - {"R_ARM_ABS32", Const, 0}, - {"R_ARM_ABS32_NOI", Const, 10}, - {"R_ARM_ABS8", Const, 0}, - {"R_ARM_ALU_PCREL_15_8", Const, 10}, - {"R_ARM_ALU_PCREL_23_15", Const, 10}, - {"R_ARM_ALU_PCREL_7_0", Const, 10}, - {"R_ARM_ALU_PC_G0", Const, 10}, - {"R_ARM_ALU_PC_G0_NC", Const, 10}, - {"R_ARM_ALU_PC_G1", Const, 10}, - {"R_ARM_ALU_PC_G1_NC", Const, 10}, - {"R_ARM_ALU_PC_G2", Const, 10}, - {"R_ARM_ALU_SBREL_19_12_NC", Const, 10}, - {"R_ARM_ALU_SBREL_27_20_CK", Const, 10}, - {"R_ARM_ALU_SB_G0", Const, 10}, - {"R_ARM_ALU_SB_G0_NC", Const, 10}, - {"R_ARM_ALU_SB_G1", Const, 10}, - {"R_ARM_ALU_SB_G1_NC", Const, 10}, - {"R_ARM_ALU_SB_G2", Const, 10}, - {"R_ARM_AMP_VCALL9", Const, 0}, - {"R_ARM_BASE_ABS", Const, 10}, - {"R_ARM_CALL", Const, 10}, - {"R_ARM_COPY", Const, 0}, - {"R_ARM_GLOB_DAT", Const, 0}, - {"R_ARM_GNU_VTENTRY", Const, 0}, - {"R_ARM_GNU_VTINHERIT", Const, 0}, - {"R_ARM_GOT32", Const, 0}, - {"R_ARM_GOTOFF", Const, 0}, - {"R_ARM_GOTOFF12", Const, 10}, - {"R_ARM_GOTPC", Const, 0}, - {"R_ARM_GOTRELAX", Const, 10}, - {"R_ARM_GOT_ABS", Const, 10}, - {"R_ARM_GOT_BREL12", Const, 10}, - {"R_ARM_GOT_PREL", Const, 10}, - {"R_ARM_IRELATIVE", Const, 10}, - {"R_ARM_JUMP24", Const, 10}, - {"R_ARM_JUMP_SLOT", Const, 0}, - {"R_ARM_LDC_PC_G0", Const, 10}, - {"R_ARM_LDC_PC_G1", Const, 10}, - {"R_ARM_LDC_PC_G2", Const, 10}, - {"R_ARM_LDC_SB_G0", Const, 10}, - {"R_ARM_LDC_SB_G1", Const, 10}, - {"R_ARM_LDC_SB_G2", Const, 10}, - {"R_ARM_LDRS_PC_G0", Const, 10}, - {"R_ARM_LDRS_PC_G1", Const, 10}, - {"R_ARM_LDRS_PC_G2", Const, 10}, - {"R_ARM_LDRS_SB_G0", Const, 10}, - {"R_ARM_LDRS_SB_G1", Const, 10}, - {"R_ARM_LDRS_SB_G2", Const, 10}, - {"R_ARM_LDR_PC_G1", Const, 10}, - {"R_ARM_LDR_PC_G2", Const, 10}, - {"R_ARM_LDR_SBREL_11_10_NC", Const, 10}, - {"R_ARM_LDR_SB_G0", Const, 10}, - {"R_ARM_LDR_SB_G1", Const, 10}, - {"R_ARM_LDR_SB_G2", Const, 10}, - {"R_ARM_ME_TOO", Const, 10}, - {"R_ARM_MOVT_ABS", Const, 10}, - {"R_ARM_MOVT_BREL", Const, 10}, - {"R_ARM_MOVT_PREL", Const, 10}, - {"R_ARM_MOVW_ABS_NC", Const, 10}, - {"R_ARM_MOVW_BREL", Const, 10}, - {"R_ARM_MOVW_BREL_NC", Const, 10}, - {"R_ARM_MOVW_PREL_NC", Const, 10}, - {"R_ARM_NONE", Const, 0}, - {"R_ARM_PC13", Const, 0}, - {"R_ARM_PC24", Const, 0}, - {"R_ARM_PLT32", Const, 0}, - {"R_ARM_PLT32_ABS", Const, 10}, - {"R_ARM_PREL31", Const, 10}, - {"R_ARM_PRIVATE_0", Const, 10}, - {"R_ARM_PRIVATE_1", Const, 10}, - {"R_ARM_PRIVATE_10", Const, 10}, - {"R_ARM_PRIVATE_11", Const, 10}, - {"R_ARM_PRIVATE_12", Const, 10}, - {"R_ARM_PRIVATE_13", Const, 10}, - {"R_ARM_PRIVATE_14", Const, 10}, - {"R_ARM_PRIVATE_15", Const, 10}, - {"R_ARM_PRIVATE_2", Const, 10}, - {"R_ARM_PRIVATE_3", Const, 10}, - {"R_ARM_PRIVATE_4", Const, 10}, - {"R_ARM_PRIVATE_5", Const, 10}, - {"R_ARM_PRIVATE_6", Const, 10}, - {"R_ARM_PRIVATE_7", Const, 10}, - {"R_ARM_PRIVATE_8", Const, 10}, - {"R_ARM_PRIVATE_9", Const, 10}, - {"R_ARM_RABS32", Const, 0}, - {"R_ARM_RBASE", Const, 0}, - {"R_ARM_REL32", Const, 0}, - {"R_ARM_REL32_NOI", Const, 10}, - {"R_ARM_RELATIVE", Const, 0}, - {"R_ARM_RPC24", Const, 0}, - {"R_ARM_RREL32", Const, 0}, - {"R_ARM_RSBREL32", Const, 0}, - {"R_ARM_RXPC25", Const, 10}, - {"R_ARM_SBREL31", Const, 10}, - {"R_ARM_SBREL32", Const, 0}, - {"R_ARM_SWI24", Const, 0}, - {"R_ARM_TARGET1", Const, 10}, - {"R_ARM_TARGET2", Const, 10}, - {"R_ARM_THM_ABS5", Const, 0}, - {"R_ARM_THM_ALU_ABS_G0_NC", Const, 10}, - {"R_ARM_THM_ALU_ABS_G1_NC", Const, 10}, - {"R_ARM_THM_ALU_ABS_G2_NC", Const, 10}, - {"R_ARM_THM_ALU_ABS_G3", Const, 10}, - {"R_ARM_THM_ALU_PREL_11_0", Const, 10}, - {"R_ARM_THM_GOT_BREL12", Const, 10}, - {"R_ARM_THM_JUMP11", Const, 10}, - {"R_ARM_THM_JUMP19", Const, 10}, - {"R_ARM_THM_JUMP24", Const, 10}, - {"R_ARM_THM_JUMP6", Const, 10}, - {"R_ARM_THM_JUMP8", Const, 10}, - {"R_ARM_THM_MOVT_ABS", Const, 10}, - {"R_ARM_THM_MOVT_BREL", Const, 10}, - {"R_ARM_THM_MOVT_PREL", Const, 10}, - {"R_ARM_THM_MOVW_ABS_NC", Const, 10}, - {"R_ARM_THM_MOVW_BREL", Const, 10}, - {"R_ARM_THM_MOVW_BREL_NC", Const, 10}, - {"R_ARM_THM_MOVW_PREL_NC", Const, 10}, - {"R_ARM_THM_PC12", Const, 10}, - {"R_ARM_THM_PC22", Const, 0}, - {"R_ARM_THM_PC8", Const, 0}, - {"R_ARM_THM_RPC22", Const, 0}, - {"R_ARM_THM_SWI8", Const, 0}, - {"R_ARM_THM_TLS_CALL", Const, 10}, - {"R_ARM_THM_TLS_DESCSEQ16", Const, 10}, - {"R_ARM_THM_TLS_DESCSEQ32", Const, 10}, - {"R_ARM_THM_XPC22", Const, 0}, - {"R_ARM_TLS_CALL", Const, 10}, - {"R_ARM_TLS_DESCSEQ", Const, 10}, - {"R_ARM_TLS_DTPMOD32", Const, 10}, - {"R_ARM_TLS_DTPOFF32", Const, 10}, - {"R_ARM_TLS_GD32", Const, 10}, - {"R_ARM_TLS_GOTDESC", Const, 10}, - {"R_ARM_TLS_IE12GP", Const, 10}, - {"R_ARM_TLS_IE32", Const, 10}, - {"R_ARM_TLS_LDM32", Const, 10}, - {"R_ARM_TLS_LDO12", Const, 10}, - {"R_ARM_TLS_LDO32", Const, 10}, - {"R_ARM_TLS_LE12", Const, 10}, - {"R_ARM_TLS_LE32", Const, 10}, - {"R_ARM_TLS_TPOFF32", Const, 10}, - {"R_ARM_V4BX", Const, 10}, - {"R_ARM_XPC25", Const, 0}, - {"R_INFO", Func, 0}, - {"R_INFO32", Func, 0}, - {"R_LARCH", Type, 19}, - {"R_LARCH_32", Const, 19}, - {"R_LARCH_32_PCREL", Const, 20}, - {"R_LARCH_64", Const, 19}, - {"R_LARCH_64_PCREL", Const, 22}, - {"R_LARCH_ABS64_HI12", Const, 20}, - {"R_LARCH_ABS64_LO20", Const, 20}, - {"R_LARCH_ABS_HI20", Const, 20}, - {"R_LARCH_ABS_LO12", Const, 20}, - {"R_LARCH_ADD16", Const, 19}, - {"R_LARCH_ADD24", Const, 19}, - {"R_LARCH_ADD32", Const, 19}, - {"R_LARCH_ADD6", Const, 22}, - {"R_LARCH_ADD64", Const, 19}, - {"R_LARCH_ADD8", Const, 19}, - {"R_LARCH_ADD_ULEB128", Const, 22}, - {"R_LARCH_ALIGN", Const, 22}, - {"R_LARCH_B16", Const, 20}, - {"R_LARCH_B21", Const, 20}, - {"R_LARCH_B26", Const, 20}, - {"R_LARCH_CFA", Const, 22}, - {"R_LARCH_COPY", Const, 19}, - {"R_LARCH_DELETE", Const, 22}, - {"R_LARCH_GNU_VTENTRY", Const, 20}, - {"R_LARCH_GNU_VTINHERIT", Const, 20}, - {"R_LARCH_GOT64_HI12", Const, 20}, - {"R_LARCH_GOT64_LO20", Const, 20}, - {"R_LARCH_GOT64_PC_HI12", Const, 20}, - {"R_LARCH_GOT64_PC_LO20", Const, 20}, - {"R_LARCH_GOT_HI20", Const, 20}, - {"R_LARCH_GOT_LO12", Const, 20}, - {"R_LARCH_GOT_PC_HI20", Const, 20}, - {"R_LARCH_GOT_PC_LO12", Const, 20}, - {"R_LARCH_IRELATIVE", Const, 19}, - {"R_LARCH_JUMP_SLOT", Const, 19}, - {"R_LARCH_MARK_LA", Const, 19}, - {"R_LARCH_MARK_PCREL", Const, 19}, - {"R_LARCH_NONE", Const, 19}, - {"R_LARCH_PCALA64_HI12", Const, 20}, - {"R_LARCH_PCALA64_LO20", Const, 20}, - {"R_LARCH_PCALA_HI20", Const, 20}, - {"R_LARCH_PCALA_LO12", Const, 20}, - {"R_LARCH_PCREL20_S2", Const, 22}, - {"R_LARCH_RELATIVE", Const, 19}, - {"R_LARCH_RELAX", Const, 20}, - {"R_LARCH_SOP_ADD", Const, 19}, - {"R_LARCH_SOP_AND", Const, 19}, - {"R_LARCH_SOP_ASSERT", Const, 19}, - {"R_LARCH_SOP_IF_ELSE", Const, 19}, - {"R_LARCH_SOP_NOT", Const, 19}, - {"R_LARCH_SOP_POP_32_S_0_10_10_16_S2", Const, 19}, - {"R_LARCH_SOP_POP_32_S_0_5_10_16_S2", Const, 19}, - {"R_LARCH_SOP_POP_32_S_10_12", Const, 19}, - {"R_LARCH_SOP_POP_32_S_10_16", Const, 19}, - {"R_LARCH_SOP_POP_32_S_10_16_S2", Const, 19}, - {"R_LARCH_SOP_POP_32_S_10_5", Const, 19}, - {"R_LARCH_SOP_POP_32_S_5_20", Const, 19}, - {"R_LARCH_SOP_POP_32_U", Const, 19}, - {"R_LARCH_SOP_POP_32_U_10_12", Const, 19}, - {"R_LARCH_SOP_PUSH_ABSOLUTE", Const, 19}, - {"R_LARCH_SOP_PUSH_DUP", Const, 19}, - {"R_LARCH_SOP_PUSH_GPREL", Const, 19}, - {"R_LARCH_SOP_PUSH_PCREL", Const, 19}, - {"R_LARCH_SOP_PUSH_PLT_PCREL", Const, 19}, - {"R_LARCH_SOP_PUSH_TLS_GD", Const, 19}, - {"R_LARCH_SOP_PUSH_TLS_GOT", Const, 19}, - {"R_LARCH_SOP_PUSH_TLS_TPREL", Const, 19}, - {"R_LARCH_SOP_SL", Const, 19}, - {"R_LARCH_SOP_SR", Const, 19}, - {"R_LARCH_SOP_SUB", Const, 19}, - {"R_LARCH_SUB16", Const, 19}, - {"R_LARCH_SUB24", Const, 19}, - {"R_LARCH_SUB32", Const, 19}, - {"R_LARCH_SUB6", Const, 22}, - {"R_LARCH_SUB64", Const, 19}, - {"R_LARCH_SUB8", Const, 19}, - {"R_LARCH_SUB_ULEB128", Const, 22}, - {"R_LARCH_TLS_DTPMOD32", Const, 19}, - {"R_LARCH_TLS_DTPMOD64", Const, 19}, - {"R_LARCH_TLS_DTPREL32", Const, 19}, - {"R_LARCH_TLS_DTPREL64", Const, 19}, - {"R_LARCH_TLS_GD_HI20", Const, 20}, - {"R_LARCH_TLS_GD_PC_HI20", Const, 20}, - {"R_LARCH_TLS_IE64_HI12", Const, 20}, - {"R_LARCH_TLS_IE64_LO20", Const, 20}, - {"R_LARCH_TLS_IE64_PC_HI12", Const, 20}, - {"R_LARCH_TLS_IE64_PC_LO20", Const, 20}, - {"R_LARCH_TLS_IE_HI20", Const, 20}, - {"R_LARCH_TLS_IE_LO12", Const, 20}, - {"R_LARCH_TLS_IE_PC_HI20", Const, 20}, - {"R_LARCH_TLS_IE_PC_LO12", Const, 20}, - {"R_LARCH_TLS_LD_HI20", Const, 20}, - {"R_LARCH_TLS_LD_PC_HI20", Const, 20}, - {"R_LARCH_TLS_LE64_HI12", Const, 20}, - {"R_LARCH_TLS_LE64_LO20", Const, 20}, - {"R_LARCH_TLS_LE_HI20", Const, 20}, - {"R_LARCH_TLS_LE_LO12", Const, 20}, - {"R_LARCH_TLS_TPREL32", Const, 19}, - {"R_LARCH_TLS_TPREL64", Const, 19}, - {"R_MIPS", Type, 6}, - {"R_MIPS_16", Const, 6}, - {"R_MIPS_26", Const, 6}, - {"R_MIPS_32", Const, 6}, - {"R_MIPS_64", Const, 6}, - {"R_MIPS_ADD_IMMEDIATE", Const, 6}, - {"R_MIPS_CALL16", Const, 6}, - {"R_MIPS_CALL_HI16", Const, 6}, - {"R_MIPS_CALL_LO16", Const, 6}, - {"R_MIPS_DELETE", Const, 6}, - {"R_MIPS_GOT16", Const, 6}, - {"R_MIPS_GOT_DISP", Const, 6}, - {"R_MIPS_GOT_HI16", Const, 6}, - {"R_MIPS_GOT_LO16", Const, 6}, - {"R_MIPS_GOT_OFST", Const, 6}, - {"R_MIPS_GOT_PAGE", Const, 6}, - {"R_MIPS_GPREL16", Const, 6}, - {"R_MIPS_GPREL32", Const, 6}, - {"R_MIPS_HI16", Const, 6}, - {"R_MIPS_HIGHER", Const, 6}, - {"R_MIPS_HIGHEST", Const, 6}, - {"R_MIPS_INSERT_A", Const, 6}, - {"R_MIPS_INSERT_B", Const, 6}, - {"R_MIPS_JALR", Const, 6}, - {"R_MIPS_LITERAL", Const, 6}, - {"R_MIPS_LO16", Const, 6}, - {"R_MIPS_NONE", Const, 6}, - {"R_MIPS_PC16", Const, 6}, - {"R_MIPS_PC32", Const, 22}, - {"R_MIPS_PJUMP", Const, 6}, - {"R_MIPS_REL16", Const, 6}, - {"R_MIPS_REL32", Const, 6}, - {"R_MIPS_RELGOT", Const, 6}, - {"R_MIPS_SCN_DISP", Const, 6}, - {"R_MIPS_SHIFT5", Const, 6}, - {"R_MIPS_SHIFT6", Const, 6}, - {"R_MIPS_SUB", Const, 6}, - {"R_MIPS_TLS_DTPMOD32", Const, 6}, - {"R_MIPS_TLS_DTPMOD64", Const, 6}, - {"R_MIPS_TLS_DTPREL32", Const, 6}, - {"R_MIPS_TLS_DTPREL64", Const, 6}, - {"R_MIPS_TLS_DTPREL_HI16", Const, 6}, - {"R_MIPS_TLS_DTPREL_LO16", Const, 6}, - {"R_MIPS_TLS_GD", Const, 6}, - {"R_MIPS_TLS_GOTTPREL", Const, 6}, - {"R_MIPS_TLS_LDM", Const, 6}, - {"R_MIPS_TLS_TPREL32", Const, 6}, - {"R_MIPS_TLS_TPREL64", Const, 6}, - {"R_MIPS_TLS_TPREL_HI16", Const, 6}, - {"R_MIPS_TLS_TPREL_LO16", Const, 6}, - {"R_PPC", Type, 0}, - {"R_PPC64", Type, 5}, - {"R_PPC64_ADDR14", Const, 5}, - {"R_PPC64_ADDR14_BRNTAKEN", Const, 5}, - {"R_PPC64_ADDR14_BRTAKEN", Const, 5}, - {"R_PPC64_ADDR16", Const, 5}, - {"R_PPC64_ADDR16_DS", Const, 5}, - {"R_PPC64_ADDR16_HA", Const, 5}, - {"R_PPC64_ADDR16_HI", Const, 5}, - {"R_PPC64_ADDR16_HIGH", Const, 10}, - {"R_PPC64_ADDR16_HIGHA", Const, 10}, - {"R_PPC64_ADDR16_HIGHER", Const, 5}, - {"R_PPC64_ADDR16_HIGHER34", Const, 20}, - {"R_PPC64_ADDR16_HIGHERA", Const, 5}, - {"R_PPC64_ADDR16_HIGHERA34", Const, 20}, - {"R_PPC64_ADDR16_HIGHEST", Const, 5}, - {"R_PPC64_ADDR16_HIGHEST34", Const, 20}, - {"R_PPC64_ADDR16_HIGHESTA", Const, 5}, - {"R_PPC64_ADDR16_HIGHESTA34", Const, 20}, - {"R_PPC64_ADDR16_LO", Const, 5}, - {"R_PPC64_ADDR16_LO_DS", Const, 5}, - {"R_PPC64_ADDR24", Const, 5}, - {"R_PPC64_ADDR32", Const, 5}, - {"R_PPC64_ADDR64", Const, 5}, - {"R_PPC64_ADDR64_LOCAL", Const, 10}, - {"R_PPC64_COPY", Const, 20}, - {"R_PPC64_D28", Const, 20}, - {"R_PPC64_D34", Const, 20}, - {"R_PPC64_D34_HA30", Const, 20}, - {"R_PPC64_D34_HI30", Const, 20}, - {"R_PPC64_D34_LO", Const, 20}, - {"R_PPC64_DTPMOD64", Const, 5}, - {"R_PPC64_DTPREL16", Const, 5}, - {"R_PPC64_DTPREL16_DS", Const, 5}, - {"R_PPC64_DTPREL16_HA", Const, 5}, - {"R_PPC64_DTPREL16_HI", Const, 5}, - {"R_PPC64_DTPREL16_HIGH", Const, 10}, - {"R_PPC64_DTPREL16_HIGHA", Const, 10}, - {"R_PPC64_DTPREL16_HIGHER", Const, 5}, - {"R_PPC64_DTPREL16_HIGHERA", Const, 5}, - {"R_PPC64_DTPREL16_HIGHEST", Const, 5}, - {"R_PPC64_DTPREL16_HIGHESTA", Const, 5}, - {"R_PPC64_DTPREL16_LO", Const, 5}, - {"R_PPC64_DTPREL16_LO_DS", Const, 5}, - {"R_PPC64_DTPREL34", Const, 20}, - {"R_PPC64_DTPREL64", Const, 5}, - {"R_PPC64_ENTRY", Const, 10}, - {"R_PPC64_GLOB_DAT", Const, 20}, - {"R_PPC64_GNU_VTENTRY", Const, 20}, - {"R_PPC64_GNU_VTINHERIT", Const, 20}, - {"R_PPC64_GOT16", Const, 5}, - {"R_PPC64_GOT16_DS", Const, 5}, - {"R_PPC64_GOT16_HA", Const, 5}, - {"R_PPC64_GOT16_HI", Const, 5}, - {"R_PPC64_GOT16_LO", Const, 5}, - {"R_PPC64_GOT16_LO_DS", Const, 5}, - {"R_PPC64_GOT_DTPREL16_DS", Const, 5}, - {"R_PPC64_GOT_DTPREL16_HA", Const, 5}, - {"R_PPC64_GOT_DTPREL16_HI", Const, 5}, - {"R_PPC64_GOT_DTPREL16_LO_DS", Const, 5}, - {"R_PPC64_GOT_DTPREL_PCREL34", Const, 20}, - {"R_PPC64_GOT_PCREL34", Const, 20}, - {"R_PPC64_GOT_TLSGD16", Const, 5}, - {"R_PPC64_GOT_TLSGD16_HA", Const, 5}, - {"R_PPC64_GOT_TLSGD16_HI", Const, 5}, - {"R_PPC64_GOT_TLSGD16_LO", Const, 5}, - {"R_PPC64_GOT_TLSGD_PCREL34", Const, 20}, - {"R_PPC64_GOT_TLSLD16", Const, 5}, - {"R_PPC64_GOT_TLSLD16_HA", Const, 5}, - {"R_PPC64_GOT_TLSLD16_HI", Const, 5}, - {"R_PPC64_GOT_TLSLD16_LO", Const, 5}, - {"R_PPC64_GOT_TLSLD_PCREL34", Const, 20}, - {"R_PPC64_GOT_TPREL16_DS", Const, 5}, - {"R_PPC64_GOT_TPREL16_HA", Const, 5}, - {"R_PPC64_GOT_TPREL16_HI", Const, 5}, - {"R_PPC64_GOT_TPREL16_LO_DS", Const, 5}, - {"R_PPC64_GOT_TPREL_PCREL34", Const, 20}, - {"R_PPC64_IRELATIVE", Const, 10}, - {"R_PPC64_JMP_IREL", Const, 10}, - {"R_PPC64_JMP_SLOT", Const, 5}, - {"R_PPC64_NONE", Const, 5}, - {"R_PPC64_PCREL28", Const, 20}, - {"R_PPC64_PCREL34", Const, 20}, - {"R_PPC64_PCREL_OPT", Const, 20}, - {"R_PPC64_PLT16_HA", Const, 20}, - {"R_PPC64_PLT16_HI", Const, 20}, - {"R_PPC64_PLT16_LO", Const, 20}, - {"R_PPC64_PLT16_LO_DS", Const, 10}, - {"R_PPC64_PLT32", Const, 20}, - {"R_PPC64_PLT64", Const, 20}, - {"R_PPC64_PLTCALL", Const, 20}, - {"R_PPC64_PLTCALL_NOTOC", Const, 20}, - {"R_PPC64_PLTGOT16", Const, 10}, - {"R_PPC64_PLTGOT16_DS", Const, 10}, - {"R_PPC64_PLTGOT16_HA", Const, 10}, - {"R_PPC64_PLTGOT16_HI", Const, 10}, - {"R_PPC64_PLTGOT16_LO", Const, 10}, - {"R_PPC64_PLTGOT_LO_DS", Const, 10}, - {"R_PPC64_PLTREL32", Const, 20}, - {"R_PPC64_PLTREL64", Const, 20}, - {"R_PPC64_PLTSEQ", Const, 20}, - {"R_PPC64_PLTSEQ_NOTOC", Const, 20}, - {"R_PPC64_PLT_PCREL34", Const, 20}, - {"R_PPC64_PLT_PCREL34_NOTOC", Const, 20}, - {"R_PPC64_REL14", Const, 5}, - {"R_PPC64_REL14_BRNTAKEN", Const, 5}, - {"R_PPC64_REL14_BRTAKEN", Const, 5}, - {"R_PPC64_REL16", Const, 5}, - {"R_PPC64_REL16DX_HA", Const, 10}, - {"R_PPC64_REL16_HA", Const, 5}, - {"R_PPC64_REL16_HI", Const, 5}, - {"R_PPC64_REL16_HIGH", Const, 20}, - {"R_PPC64_REL16_HIGHA", Const, 20}, - {"R_PPC64_REL16_HIGHER", Const, 20}, - {"R_PPC64_REL16_HIGHER34", Const, 20}, - {"R_PPC64_REL16_HIGHERA", Const, 20}, - {"R_PPC64_REL16_HIGHERA34", Const, 20}, - {"R_PPC64_REL16_HIGHEST", Const, 20}, - {"R_PPC64_REL16_HIGHEST34", Const, 20}, - {"R_PPC64_REL16_HIGHESTA", Const, 20}, - {"R_PPC64_REL16_HIGHESTA34", Const, 20}, - {"R_PPC64_REL16_LO", Const, 5}, - {"R_PPC64_REL24", Const, 5}, - {"R_PPC64_REL24_NOTOC", Const, 10}, - {"R_PPC64_REL24_P9NOTOC", Const, 21}, - {"R_PPC64_REL30", Const, 20}, - {"R_PPC64_REL32", Const, 5}, - {"R_PPC64_REL64", Const, 5}, - {"R_PPC64_RELATIVE", Const, 18}, - {"R_PPC64_SECTOFF", Const, 20}, - {"R_PPC64_SECTOFF_DS", Const, 10}, - {"R_PPC64_SECTOFF_HA", Const, 20}, - {"R_PPC64_SECTOFF_HI", Const, 20}, - {"R_PPC64_SECTOFF_LO", Const, 20}, - {"R_PPC64_SECTOFF_LO_DS", Const, 10}, - {"R_PPC64_TLS", Const, 5}, - {"R_PPC64_TLSGD", Const, 5}, - {"R_PPC64_TLSLD", Const, 5}, - {"R_PPC64_TOC", Const, 5}, - {"R_PPC64_TOC16", Const, 5}, - {"R_PPC64_TOC16_DS", Const, 5}, - {"R_PPC64_TOC16_HA", Const, 5}, - {"R_PPC64_TOC16_HI", Const, 5}, - {"R_PPC64_TOC16_LO", Const, 5}, - {"R_PPC64_TOC16_LO_DS", Const, 5}, - {"R_PPC64_TOCSAVE", Const, 10}, - {"R_PPC64_TPREL16", Const, 5}, - {"R_PPC64_TPREL16_DS", Const, 5}, - {"R_PPC64_TPREL16_HA", Const, 5}, - {"R_PPC64_TPREL16_HI", Const, 5}, - {"R_PPC64_TPREL16_HIGH", Const, 10}, - {"R_PPC64_TPREL16_HIGHA", Const, 10}, - {"R_PPC64_TPREL16_HIGHER", Const, 5}, - {"R_PPC64_TPREL16_HIGHERA", Const, 5}, - {"R_PPC64_TPREL16_HIGHEST", Const, 5}, - {"R_PPC64_TPREL16_HIGHESTA", Const, 5}, - {"R_PPC64_TPREL16_LO", Const, 5}, - {"R_PPC64_TPREL16_LO_DS", Const, 5}, - {"R_PPC64_TPREL34", Const, 20}, - {"R_PPC64_TPREL64", Const, 5}, - {"R_PPC64_UADDR16", Const, 20}, - {"R_PPC64_UADDR32", Const, 20}, - {"R_PPC64_UADDR64", Const, 20}, - {"R_PPC_ADDR14", Const, 0}, - {"R_PPC_ADDR14_BRNTAKEN", Const, 0}, - {"R_PPC_ADDR14_BRTAKEN", Const, 0}, - {"R_PPC_ADDR16", Const, 0}, - {"R_PPC_ADDR16_HA", Const, 0}, - {"R_PPC_ADDR16_HI", Const, 0}, - {"R_PPC_ADDR16_LO", Const, 0}, - {"R_PPC_ADDR24", Const, 0}, - {"R_PPC_ADDR32", Const, 0}, - {"R_PPC_COPY", Const, 0}, - {"R_PPC_DTPMOD32", Const, 0}, - {"R_PPC_DTPREL16", Const, 0}, - {"R_PPC_DTPREL16_HA", Const, 0}, - {"R_PPC_DTPREL16_HI", Const, 0}, - {"R_PPC_DTPREL16_LO", Const, 0}, - {"R_PPC_DTPREL32", Const, 0}, - {"R_PPC_EMB_BIT_FLD", Const, 0}, - {"R_PPC_EMB_MRKREF", Const, 0}, - {"R_PPC_EMB_NADDR16", Const, 0}, - {"R_PPC_EMB_NADDR16_HA", Const, 0}, - {"R_PPC_EMB_NADDR16_HI", Const, 0}, - {"R_PPC_EMB_NADDR16_LO", Const, 0}, - {"R_PPC_EMB_NADDR32", Const, 0}, - {"R_PPC_EMB_RELSDA", Const, 0}, - {"R_PPC_EMB_RELSEC16", Const, 0}, - {"R_PPC_EMB_RELST_HA", Const, 0}, - {"R_PPC_EMB_RELST_HI", Const, 0}, - {"R_PPC_EMB_RELST_LO", Const, 0}, - {"R_PPC_EMB_SDA21", Const, 0}, - {"R_PPC_EMB_SDA2I16", Const, 0}, - {"R_PPC_EMB_SDA2REL", Const, 0}, - {"R_PPC_EMB_SDAI16", Const, 0}, - {"R_PPC_GLOB_DAT", Const, 0}, - {"R_PPC_GOT16", Const, 0}, - {"R_PPC_GOT16_HA", Const, 0}, - {"R_PPC_GOT16_HI", Const, 0}, - {"R_PPC_GOT16_LO", Const, 0}, - {"R_PPC_GOT_TLSGD16", Const, 0}, - {"R_PPC_GOT_TLSGD16_HA", Const, 0}, - {"R_PPC_GOT_TLSGD16_HI", Const, 0}, - {"R_PPC_GOT_TLSGD16_LO", Const, 0}, - {"R_PPC_GOT_TLSLD16", Const, 0}, - {"R_PPC_GOT_TLSLD16_HA", Const, 0}, - {"R_PPC_GOT_TLSLD16_HI", Const, 0}, - {"R_PPC_GOT_TLSLD16_LO", Const, 0}, - {"R_PPC_GOT_TPREL16", Const, 0}, - {"R_PPC_GOT_TPREL16_HA", Const, 0}, - {"R_PPC_GOT_TPREL16_HI", Const, 0}, - {"R_PPC_GOT_TPREL16_LO", Const, 0}, - {"R_PPC_JMP_SLOT", Const, 0}, - {"R_PPC_LOCAL24PC", Const, 0}, - {"R_PPC_NONE", Const, 0}, - {"R_PPC_PLT16_HA", Const, 0}, - {"R_PPC_PLT16_HI", Const, 0}, - {"R_PPC_PLT16_LO", Const, 0}, - {"R_PPC_PLT32", Const, 0}, - {"R_PPC_PLTREL24", Const, 0}, - {"R_PPC_PLTREL32", Const, 0}, - {"R_PPC_REL14", Const, 0}, - {"R_PPC_REL14_BRNTAKEN", Const, 0}, - {"R_PPC_REL14_BRTAKEN", Const, 0}, - {"R_PPC_REL24", Const, 0}, - {"R_PPC_REL32", Const, 0}, - {"R_PPC_RELATIVE", Const, 0}, - {"R_PPC_SDAREL16", Const, 0}, - {"R_PPC_SECTOFF", Const, 0}, - {"R_PPC_SECTOFF_HA", Const, 0}, - {"R_PPC_SECTOFF_HI", Const, 0}, - {"R_PPC_SECTOFF_LO", Const, 0}, - {"R_PPC_TLS", Const, 0}, - {"R_PPC_TPREL16", Const, 0}, - {"R_PPC_TPREL16_HA", Const, 0}, - {"R_PPC_TPREL16_HI", Const, 0}, - {"R_PPC_TPREL16_LO", Const, 0}, - {"R_PPC_TPREL32", Const, 0}, - {"R_PPC_UADDR16", Const, 0}, - {"R_PPC_UADDR32", Const, 0}, - {"R_RISCV", Type, 11}, - {"R_RISCV_32", Const, 11}, - {"R_RISCV_32_PCREL", Const, 12}, - {"R_RISCV_64", Const, 11}, - {"R_RISCV_ADD16", Const, 11}, - {"R_RISCV_ADD32", Const, 11}, - {"R_RISCV_ADD64", Const, 11}, - {"R_RISCV_ADD8", Const, 11}, - {"R_RISCV_ALIGN", Const, 11}, - {"R_RISCV_BRANCH", Const, 11}, - {"R_RISCV_CALL", Const, 11}, - {"R_RISCV_CALL_PLT", Const, 11}, - {"R_RISCV_COPY", Const, 11}, - {"R_RISCV_GNU_VTENTRY", Const, 11}, - {"R_RISCV_GNU_VTINHERIT", Const, 11}, - {"R_RISCV_GOT_HI20", Const, 11}, - {"R_RISCV_GPREL_I", Const, 11}, - {"R_RISCV_GPREL_S", Const, 11}, - {"R_RISCV_HI20", Const, 11}, - {"R_RISCV_JAL", Const, 11}, - {"R_RISCV_JUMP_SLOT", Const, 11}, - {"R_RISCV_LO12_I", Const, 11}, - {"R_RISCV_LO12_S", Const, 11}, - {"R_RISCV_NONE", Const, 11}, - {"R_RISCV_PCREL_HI20", Const, 11}, - {"R_RISCV_PCREL_LO12_I", Const, 11}, - {"R_RISCV_PCREL_LO12_S", Const, 11}, - {"R_RISCV_RELATIVE", Const, 11}, - {"R_RISCV_RELAX", Const, 11}, - {"R_RISCV_RVC_BRANCH", Const, 11}, - {"R_RISCV_RVC_JUMP", Const, 11}, - {"R_RISCV_RVC_LUI", Const, 11}, - {"R_RISCV_SET16", Const, 11}, - {"R_RISCV_SET32", Const, 11}, - {"R_RISCV_SET6", Const, 11}, - {"R_RISCV_SET8", Const, 11}, - {"R_RISCV_SUB16", Const, 11}, - {"R_RISCV_SUB32", Const, 11}, - {"R_RISCV_SUB6", Const, 11}, - {"R_RISCV_SUB64", Const, 11}, - {"R_RISCV_SUB8", Const, 11}, - {"R_RISCV_TLS_DTPMOD32", Const, 11}, - {"R_RISCV_TLS_DTPMOD64", Const, 11}, - {"R_RISCV_TLS_DTPREL32", Const, 11}, - {"R_RISCV_TLS_DTPREL64", Const, 11}, - {"R_RISCV_TLS_GD_HI20", Const, 11}, - {"R_RISCV_TLS_GOT_HI20", Const, 11}, - {"R_RISCV_TLS_TPREL32", Const, 11}, - {"R_RISCV_TLS_TPREL64", Const, 11}, - {"R_RISCV_TPREL_ADD", Const, 11}, - {"R_RISCV_TPREL_HI20", Const, 11}, - {"R_RISCV_TPREL_I", Const, 11}, - {"R_RISCV_TPREL_LO12_I", Const, 11}, - {"R_RISCV_TPREL_LO12_S", Const, 11}, - {"R_RISCV_TPREL_S", Const, 11}, - {"R_SPARC", Type, 0}, - {"R_SPARC_10", Const, 0}, - {"R_SPARC_11", Const, 0}, - {"R_SPARC_13", Const, 0}, - {"R_SPARC_16", Const, 0}, - {"R_SPARC_22", Const, 0}, - {"R_SPARC_32", Const, 0}, - {"R_SPARC_5", Const, 0}, - {"R_SPARC_6", Const, 0}, - {"R_SPARC_64", Const, 0}, - {"R_SPARC_7", Const, 0}, - {"R_SPARC_8", Const, 0}, - {"R_SPARC_COPY", Const, 0}, - {"R_SPARC_DISP16", Const, 0}, - {"R_SPARC_DISP32", Const, 0}, - {"R_SPARC_DISP64", Const, 0}, - {"R_SPARC_DISP8", Const, 0}, - {"R_SPARC_GLOB_DAT", Const, 0}, - {"R_SPARC_GLOB_JMP", Const, 0}, - {"R_SPARC_GOT10", Const, 0}, - {"R_SPARC_GOT13", Const, 0}, - {"R_SPARC_GOT22", Const, 0}, - {"R_SPARC_H44", Const, 0}, - {"R_SPARC_HH22", Const, 0}, - {"R_SPARC_HI22", Const, 0}, - {"R_SPARC_HIPLT22", Const, 0}, - {"R_SPARC_HIX22", Const, 0}, - {"R_SPARC_HM10", Const, 0}, - {"R_SPARC_JMP_SLOT", Const, 0}, - {"R_SPARC_L44", Const, 0}, - {"R_SPARC_LM22", Const, 0}, - {"R_SPARC_LO10", Const, 0}, - {"R_SPARC_LOPLT10", Const, 0}, - {"R_SPARC_LOX10", Const, 0}, - {"R_SPARC_M44", Const, 0}, - {"R_SPARC_NONE", Const, 0}, - {"R_SPARC_OLO10", Const, 0}, - {"R_SPARC_PC10", Const, 0}, - {"R_SPARC_PC22", Const, 0}, - {"R_SPARC_PCPLT10", Const, 0}, - {"R_SPARC_PCPLT22", Const, 0}, - {"R_SPARC_PCPLT32", Const, 0}, - {"R_SPARC_PC_HH22", Const, 0}, - {"R_SPARC_PC_HM10", Const, 0}, - {"R_SPARC_PC_LM22", Const, 0}, - {"R_SPARC_PLT32", Const, 0}, - {"R_SPARC_PLT64", Const, 0}, - {"R_SPARC_REGISTER", Const, 0}, - {"R_SPARC_RELATIVE", Const, 0}, - {"R_SPARC_UA16", Const, 0}, - {"R_SPARC_UA32", Const, 0}, - {"R_SPARC_UA64", Const, 0}, - {"R_SPARC_WDISP16", Const, 0}, - {"R_SPARC_WDISP19", Const, 0}, - {"R_SPARC_WDISP22", Const, 0}, - {"R_SPARC_WDISP30", Const, 0}, - {"R_SPARC_WPLT30", Const, 0}, - {"R_SYM32", Func, 0}, - {"R_SYM64", Func, 0}, - {"R_TYPE32", Func, 0}, - {"R_TYPE64", Func, 0}, - {"R_X86_64", Type, 0}, - {"R_X86_64_16", Const, 0}, - {"R_X86_64_32", Const, 0}, - {"R_X86_64_32S", Const, 0}, - {"R_X86_64_64", Const, 0}, - {"R_X86_64_8", Const, 0}, - {"R_X86_64_COPY", Const, 0}, - {"R_X86_64_DTPMOD64", Const, 0}, - {"R_X86_64_DTPOFF32", Const, 0}, - {"R_X86_64_DTPOFF64", Const, 0}, - {"R_X86_64_GLOB_DAT", Const, 0}, - {"R_X86_64_GOT32", Const, 0}, - {"R_X86_64_GOT64", Const, 10}, - {"R_X86_64_GOTOFF64", Const, 10}, - {"R_X86_64_GOTPC32", Const, 10}, - {"R_X86_64_GOTPC32_TLSDESC", Const, 10}, - {"R_X86_64_GOTPC64", Const, 10}, - {"R_X86_64_GOTPCREL", Const, 0}, - {"R_X86_64_GOTPCREL64", Const, 10}, - {"R_X86_64_GOTPCRELX", Const, 10}, - {"R_X86_64_GOTPLT64", Const, 10}, - {"R_X86_64_GOTTPOFF", Const, 0}, - {"R_X86_64_IRELATIVE", Const, 10}, - {"R_X86_64_JMP_SLOT", Const, 0}, - {"R_X86_64_NONE", Const, 0}, - {"R_X86_64_PC16", Const, 0}, - {"R_X86_64_PC32", Const, 0}, - {"R_X86_64_PC32_BND", Const, 10}, - {"R_X86_64_PC64", Const, 10}, - {"R_X86_64_PC8", Const, 0}, - {"R_X86_64_PLT32", Const, 0}, - {"R_X86_64_PLT32_BND", Const, 10}, - {"R_X86_64_PLTOFF64", Const, 10}, - {"R_X86_64_RELATIVE", Const, 0}, - {"R_X86_64_RELATIVE64", Const, 10}, - {"R_X86_64_REX_GOTPCRELX", Const, 10}, - {"R_X86_64_SIZE32", Const, 10}, - {"R_X86_64_SIZE64", Const, 10}, - {"R_X86_64_TLSDESC", Const, 10}, - {"R_X86_64_TLSDESC_CALL", Const, 10}, - {"R_X86_64_TLSGD", Const, 0}, - {"R_X86_64_TLSLD", Const, 0}, - {"R_X86_64_TPOFF32", Const, 0}, - {"R_X86_64_TPOFF64", Const, 0}, - {"Rel32", Type, 0}, - {"Rel32.Info", Field, 0}, - {"Rel32.Off", Field, 0}, - {"Rel64", Type, 0}, - {"Rel64.Info", Field, 0}, - {"Rel64.Off", Field, 0}, - {"Rela32", Type, 0}, - {"Rela32.Addend", Field, 0}, - {"Rela32.Info", Field, 0}, - {"Rela32.Off", Field, 0}, - {"Rela64", Type, 0}, - {"Rela64.Addend", Field, 0}, - {"Rela64.Info", Field, 0}, - {"Rela64.Off", Field, 0}, - {"SHF_ALLOC", Const, 0}, - {"SHF_COMPRESSED", Const, 6}, - {"SHF_EXECINSTR", Const, 0}, - {"SHF_GROUP", Const, 0}, - {"SHF_INFO_LINK", Const, 0}, - {"SHF_LINK_ORDER", Const, 0}, - {"SHF_MASKOS", Const, 0}, - {"SHF_MASKPROC", Const, 0}, - {"SHF_MERGE", Const, 0}, - {"SHF_OS_NONCONFORMING", Const, 0}, - {"SHF_STRINGS", Const, 0}, - {"SHF_TLS", Const, 0}, - {"SHF_WRITE", Const, 0}, - {"SHN_ABS", Const, 0}, - {"SHN_COMMON", Const, 0}, - {"SHN_HIOS", Const, 0}, - {"SHN_HIPROC", Const, 0}, - {"SHN_HIRESERVE", Const, 0}, - {"SHN_LOOS", Const, 0}, - {"SHN_LOPROC", Const, 0}, - {"SHN_LORESERVE", Const, 0}, - {"SHN_UNDEF", Const, 0}, - {"SHN_XINDEX", Const, 0}, - {"SHT_DYNAMIC", Const, 0}, - {"SHT_DYNSYM", Const, 0}, - {"SHT_FINI_ARRAY", Const, 0}, - {"SHT_GNU_ATTRIBUTES", Const, 0}, - {"SHT_GNU_HASH", Const, 0}, - {"SHT_GNU_LIBLIST", Const, 0}, - {"SHT_GNU_VERDEF", Const, 0}, - {"SHT_GNU_VERNEED", Const, 0}, - {"SHT_GNU_VERSYM", Const, 0}, - {"SHT_GROUP", Const, 0}, - {"SHT_HASH", Const, 0}, - {"SHT_HIOS", Const, 0}, - {"SHT_HIPROC", Const, 0}, - {"SHT_HIUSER", Const, 0}, - {"SHT_INIT_ARRAY", Const, 0}, - {"SHT_LOOS", Const, 0}, - {"SHT_LOPROC", Const, 0}, - {"SHT_LOUSER", Const, 0}, - {"SHT_MIPS_ABIFLAGS", Const, 17}, - {"SHT_NOBITS", Const, 0}, - {"SHT_NOTE", Const, 0}, - {"SHT_NULL", Const, 0}, - {"SHT_PREINIT_ARRAY", Const, 0}, - {"SHT_PROGBITS", Const, 0}, - {"SHT_REL", Const, 0}, - {"SHT_RELA", Const, 0}, - {"SHT_SHLIB", Const, 0}, - {"SHT_STRTAB", Const, 0}, - {"SHT_SYMTAB", Const, 0}, - {"SHT_SYMTAB_SHNDX", Const, 0}, - {"STB_GLOBAL", Const, 0}, - {"STB_HIOS", Const, 0}, - {"STB_HIPROC", Const, 0}, - {"STB_LOCAL", Const, 0}, - {"STB_LOOS", Const, 0}, - {"STB_LOPROC", Const, 0}, - {"STB_WEAK", Const, 0}, - {"STT_COMMON", Const, 0}, - {"STT_FILE", Const, 0}, - {"STT_FUNC", Const, 0}, - {"STT_HIOS", Const, 0}, - {"STT_HIPROC", Const, 0}, - {"STT_LOOS", Const, 0}, - {"STT_LOPROC", Const, 0}, - {"STT_NOTYPE", Const, 0}, - {"STT_OBJECT", Const, 0}, - {"STT_SECTION", Const, 0}, - {"STT_TLS", Const, 0}, - {"STV_DEFAULT", Const, 0}, - {"STV_HIDDEN", Const, 0}, - {"STV_INTERNAL", Const, 0}, - {"STV_PROTECTED", Const, 0}, - {"ST_BIND", Func, 0}, - {"ST_INFO", Func, 0}, - {"ST_TYPE", Func, 0}, - {"ST_VISIBILITY", Func, 0}, - {"Section", Type, 0}, - {"Section.ReaderAt", Field, 0}, - {"Section.SectionHeader", Field, 0}, - {"Section32", Type, 0}, - {"Section32.Addr", Field, 0}, - {"Section32.Addralign", Field, 0}, - {"Section32.Entsize", Field, 0}, - {"Section32.Flags", Field, 0}, - {"Section32.Info", Field, 0}, - {"Section32.Link", Field, 0}, - {"Section32.Name", Field, 0}, - {"Section32.Off", Field, 0}, - {"Section32.Size", Field, 0}, - {"Section32.Type", Field, 0}, - {"Section64", Type, 0}, - {"Section64.Addr", Field, 0}, - {"Section64.Addralign", Field, 0}, - {"Section64.Entsize", Field, 0}, - {"Section64.Flags", Field, 0}, - {"Section64.Info", Field, 0}, - {"Section64.Link", Field, 0}, - {"Section64.Name", Field, 0}, - {"Section64.Off", Field, 0}, - {"Section64.Size", Field, 0}, - {"Section64.Type", Field, 0}, - {"SectionFlag", Type, 0}, - {"SectionHeader", Type, 0}, - {"SectionHeader.Addr", Field, 0}, - {"SectionHeader.Addralign", Field, 0}, - {"SectionHeader.Entsize", Field, 0}, - {"SectionHeader.FileSize", Field, 6}, - {"SectionHeader.Flags", Field, 0}, - {"SectionHeader.Info", Field, 0}, - {"SectionHeader.Link", Field, 0}, - {"SectionHeader.Name", Field, 0}, - {"SectionHeader.Offset", Field, 0}, - {"SectionHeader.Size", Field, 0}, - {"SectionHeader.Type", Field, 0}, - {"SectionIndex", Type, 0}, - {"SectionType", Type, 0}, - {"Sym32", Type, 0}, - {"Sym32.Info", Field, 0}, - {"Sym32.Name", Field, 0}, - {"Sym32.Other", Field, 0}, - {"Sym32.Shndx", Field, 0}, - {"Sym32.Size", Field, 0}, - {"Sym32.Value", Field, 0}, - {"Sym32Size", Const, 0}, - {"Sym64", Type, 0}, - {"Sym64.Info", Field, 0}, - {"Sym64.Name", Field, 0}, - {"Sym64.Other", Field, 0}, - {"Sym64.Shndx", Field, 0}, - {"Sym64.Size", Field, 0}, - {"Sym64.Value", Field, 0}, - {"Sym64Size", Const, 0}, - {"SymBind", Type, 0}, - {"SymType", Type, 0}, - {"SymVis", Type, 0}, - {"Symbol", Type, 0}, - {"Symbol.Info", Field, 0}, - {"Symbol.Library", Field, 13}, - {"Symbol.Name", Field, 0}, - {"Symbol.Other", Field, 0}, - {"Symbol.Section", Field, 0}, - {"Symbol.Size", Field, 0}, - {"Symbol.Value", Field, 0}, - {"Symbol.Version", Field, 13}, - {"Type", Type, 0}, - {"Version", Type, 0}, - }, - "debug/gosym": { - {"(*DecodingError).Error", Method, 0}, - {"(*LineTable).LineToPC", Method, 0}, - {"(*LineTable).PCToLine", Method, 0}, - {"(*Sym).BaseName", Method, 0}, - {"(*Sym).PackageName", Method, 0}, - {"(*Sym).ReceiverName", Method, 0}, - {"(*Sym).Static", Method, 0}, - {"(*Table).LineToPC", Method, 0}, - {"(*Table).LookupFunc", Method, 0}, - {"(*Table).LookupSym", Method, 0}, - {"(*Table).PCToFunc", Method, 0}, - {"(*Table).PCToLine", Method, 0}, - {"(*Table).SymByAddr", Method, 0}, - {"(*UnknownLineError).Error", Method, 0}, - {"(Func).BaseName", Method, 0}, - {"(Func).PackageName", Method, 0}, - {"(Func).ReceiverName", Method, 0}, - {"(Func).Static", Method, 0}, - {"(UnknownFileError).Error", Method, 0}, - {"DecodingError", Type, 0}, - {"Func", Type, 0}, - {"Func.End", Field, 0}, - {"Func.Entry", Field, 0}, - {"Func.FrameSize", Field, 0}, - {"Func.LineTable", Field, 0}, - {"Func.Locals", Field, 0}, - {"Func.Obj", Field, 0}, - {"Func.Params", Field, 0}, - {"Func.Sym", Field, 0}, - {"LineTable", Type, 0}, - {"LineTable.Data", Field, 0}, - {"LineTable.Line", Field, 0}, - {"LineTable.PC", Field, 0}, - {"NewLineTable", Func, 0}, - {"NewTable", Func, 0}, - {"Obj", Type, 0}, - {"Obj.Funcs", Field, 0}, - {"Obj.Paths", Field, 0}, - {"Sym", Type, 0}, - {"Sym.Func", Field, 0}, - {"Sym.GoType", Field, 0}, - {"Sym.Name", Field, 0}, - {"Sym.Type", Field, 0}, - {"Sym.Value", Field, 0}, - {"Table", Type, 0}, - {"Table.Files", Field, 0}, - {"Table.Funcs", Field, 0}, - {"Table.Objs", Field, 0}, - {"Table.Syms", Field, 0}, - {"UnknownFileError", Type, 0}, - {"UnknownLineError", Type, 0}, - {"UnknownLineError.File", Field, 0}, - {"UnknownLineError.Line", Field, 0}, - }, - "debug/macho": { - {"(*FatFile).Close", Method, 3}, - {"(*File).Close", Method, 0}, - {"(*File).DWARF", Method, 0}, - {"(*File).ImportedLibraries", Method, 0}, - {"(*File).ImportedSymbols", Method, 0}, - {"(*File).Section", Method, 0}, - {"(*File).Segment", Method, 0}, - {"(*FormatError).Error", Method, 0}, - {"(*Section).Data", Method, 0}, - {"(*Section).Open", Method, 0}, - {"(*Segment).Data", Method, 0}, - {"(*Segment).Open", Method, 0}, - {"(Cpu).GoString", Method, 0}, - {"(Cpu).String", Method, 0}, - {"(Dylib).Raw", Method, 0}, - {"(Dysymtab).Raw", Method, 0}, - {"(FatArch).Close", Method, 3}, - {"(FatArch).DWARF", Method, 3}, - {"(FatArch).ImportedLibraries", Method, 3}, - {"(FatArch).ImportedSymbols", Method, 3}, - {"(FatArch).Section", Method, 3}, - {"(FatArch).Segment", Method, 3}, - {"(LoadBytes).Raw", Method, 0}, - {"(LoadCmd).GoString", Method, 0}, - {"(LoadCmd).String", Method, 0}, - {"(RelocTypeARM).GoString", Method, 10}, - {"(RelocTypeARM).String", Method, 10}, - {"(RelocTypeARM64).GoString", Method, 10}, - {"(RelocTypeARM64).String", Method, 10}, - {"(RelocTypeGeneric).GoString", Method, 10}, - {"(RelocTypeGeneric).String", Method, 10}, - {"(RelocTypeX86_64).GoString", Method, 10}, - {"(RelocTypeX86_64).String", Method, 10}, - {"(Rpath).Raw", Method, 10}, - {"(Section).ReadAt", Method, 0}, - {"(Segment).Raw", Method, 0}, - {"(Segment).ReadAt", Method, 0}, - {"(Symtab).Raw", Method, 0}, - {"(Type).GoString", Method, 10}, - {"(Type).String", Method, 10}, - {"ARM64_RELOC_ADDEND", Const, 10}, - {"ARM64_RELOC_BRANCH26", Const, 10}, - {"ARM64_RELOC_GOT_LOAD_PAGE21", Const, 10}, - {"ARM64_RELOC_GOT_LOAD_PAGEOFF12", Const, 10}, - {"ARM64_RELOC_PAGE21", Const, 10}, - {"ARM64_RELOC_PAGEOFF12", Const, 10}, - {"ARM64_RELOC_POINTER_TO_GOT", Const, 10}, - {"ARM64_RELOC_SUBTRACTOR", Const, 10}, - {"ARM64_RELOC_TLVP_LOAD_PAGE21", Const, 10}, - {"ARM64_RELOC_TLVP_LOAD_PAGEOFF12", Const, 10}, - {"ARM64_RELOC_UNSIGNED", Const, 10}, - {"ARM_RELOC_BR24", Const, 10}, - {"ARM_RELOC_HALF", Const, 10}, - {"ARM_RELOC_HALF_SECTDIFF", Const, 10}, - {"ARM_RELOC_LOCAL_SECTDIFF", Const, 10}, - {"ARM_RELOC_PAIR", Const, 10}, - {"ARM_RELOC_PB_LA_PTR", Const, 10}, - {"ARM_RELOC_SECTDIFF", Const, 10}, - {"ARM_RELOC_VANILLA", Const, 10}, - {"ARM_THUMB_32BIT_BRANCH", Const, 10}, - {"ARM_THUMB_RELOC_BR22", Const, 10}, - {"Cpu", Type, 0}, - {"Cpu386", Const, 0}, - {"CpuAmd64", Const, 0}, - {"CpuArm", Const, 3}, - {"CpuArm64", Const, 11}, - {"CpuPpc", Const, 3}, - {"CpuPpc64", Const, 3}, - {"Dylib", Type, 0}, - {"Dylib.CompatVersion", Field, 0}, - {"Dylib.CurrentVersion", Field, 0}, - {"Dylib.LoadBytes", Field, 0}, - {"Dylib.Name", Field, 0}, - {"Dylib.Time", Field, 0}, - {"DylibCmd", Type, 0}, - {"DylibCmd.Cmd", Field, 0}, - {"DylibCmd.CompatVersion", Field, 0}, - {"DylibCmd.CurrentVersion", Field, 0}, - {"DylibCmd.Len", Field, 0}, - {"DylibCmd.Name", Field, 0}, - {"DylibCmd.Time", Field, 0}, - {"Dysymtab", Type, 0}, - {"Dysymtab.DysymtabCmd", Field, 0}, - {"Dysymtab.IndirectSyms", Field, 0}, - {"Dysymtab.LoadBytes", Field, 0}, - {"DysymtabCmd", Type, 0}, - {"DysymtabCmd.Cmd", Field, 0}, - {"DysymtabCmd.Extrefsymoff", Field, 0}, - {"DysymtabCmd.Extreloff", Field, 0}, - {"DysymtabCmd.Iextdefsym", Field, 0}, - {"DysymtabCmd.Ilocalsym", Field, 0}, - {"DysymtabCmd.Indirectsymoff", Field, 0}, - {"DysymtabCmd.Iundefsym", Field, 0}, - {"DysymtabCmd.Len", Field, 0}, - {"DysymtabCmd.Locreloff", Field, 0}, - {"DysymtabCmd.Modtaboff", Field, 0}, - {"DysymtabCmd.Nextdefsym", Field, 0}, - {"DysymtabCmd.Nextrefsyms", Field, 0}, - {"DysymtabCmd.Nextrel", Field, 0}, - {"DysymtabCmd.Nindirectsyms", Field, 0}, - {"DysymtabCmd.Nlocalsym", Field, 0}, - {"DysymtabCmd.Nlocrel", Field, 0}, - {"DysymtabCmd.Nmodtab", Field, 0}, - {"DysymtabCmd.Ntoc", Field, 0}, - {"DysymtabCmd.Nundefsym", Field, 0}, - {"DysymtabCmd.Tocoffset", Field, 0}, - {"ErrNotFat", Var, 3}, - {"FatArch", Type, 3}, - {"FatArch.FatArchHeader", Field, 3}, - {"FatArch.File", Field, 3}, - {"FatArchHeader", Type, 3}, - {"FatArchHeader.Align", Field, 3}, - {"FatArchHeader.Cpu", Field, 3}, - {"FatArchHeader.Offset", Field, 3}, - {"FatArchHeader.Size", Field, 3}, - {"FatArchHeader.SubCpu", Field, 3}, - {"FatFile", Type, 3}, - {"FatFile.Arches", Field, 3}, - {"FatFile.Magic", Field, 3}, - {"File", Type, 0}, - {"File.ByteOrder", Field, 0}, - {"File.Dysymtab", Field, 0}, - {"File.FileHeader", Field, 0}, - {"File.Loads", Field, 0}, - {"File.Sections", Field, 0}, - {"File.Symtab", Field, 0}, - {"FileHeader", Type, 0}, - {"FileHeader.Cmdsz", Field, 0}, - {"FileHeader.Cpu", Field, 0}, - {"FileHeader.Flags", Field, 0}, - {"FileHeader.Magic", Field, 0}, - {"FileHeader.Ncmd", Field, 0}, - {"FileHeader.SubCpu", Field, 0}, - {"FileHeader.Type", Field, 0}, - {"FlagAllModsBound", Const, 10}, - {"FlagAllowStackExecution", Const, 10}, - {"FlagAppExtensionSafe", Const, 10}, - {"FlagBindAtLoad", Const, 10}, - {"FlagBindsToWeak", Const, 10}, - {"FlagCanonical", Const, 10}, - {"FlagDeadStrippableDylib", Const, 10}, - {"FlagDyldLink", Const, 10}, - {"FlagForceFlat", Const, 10}, - {"FlagHasTLVDescriptors", Const, 10}, - {"FlagIncrLink", Const, 10}, - {"FlagLazyInit", Const, 10}, - {"FlagNoFixPrebinding", Const, 10}, - {"FlagNoHeapExecution", Const, 10}, - {"FlagNoMultiDefs", Const, 10}, - {"FlagNoReexportedDylibs", Const, 10}, - {"FlagNoUndefs", Const, 10}, - {"FlagPIE", Const, 10}, - {"FlagPrebindable", Const, 10}, - {"FlagPrebound", Const, 10}, - {"FlagRootSafe", Const, 10}, - {"FlagSetuidSafe", Const, 10}, - {"FlagSplitSegs", Const, 10}, - {"FlagSubsectionsViaSymbols", Const, 10}, - {"FlagTwoLevel", Const, 10}, - {"FlagWeakDefines", Const, 10}, - {"FormatError", Type, 0}, - {"GENERIC_RELOC_LOCAL_SECTDIFF", Const, 10}, - {"GENERIC_RELOC_PAIR", Const, 10}, - {"GENERIC_RELOC_PB_LA_PTR", Const, 10}, - {"GENERIC_RELOC_SECTDIFF", Const, 10}, - {"GENERIC_RELOC_TLV", Const, 10}, - {"GENERIC_RELOC_VANILLA", Const, 10}, - {"Load", Type, 0}, - {"LoadBytes", Type, 0}, - {"LoadCmd", Type, 0}, - {"LoadCmdDylib", Const, 0}, - {"LoadCmdDylinker", Const, 0}, - {"LoadCmdDysymtab", Const, 0}, - {"LoadCmdRpath", Const, 10}, - {"LoadCmdSegment", Const, 0}, - {"LoadCmdSegment64", Const, 0}, - {"LoadCmdSymtab", Const, 0}, - {"LoadCmdThread", Const, 0}, - {"LoadCmdUnixThread", Const, 0}, - {"Magic32", Const, 0}, - {"Magic64", Const, 0}, - {"MagicFat", Const, 3}, - {"NewFatFile", Func, 3}, - {"NewFile", Func, 0}, - {"Nlist32", Type, 0}, - {"Nlist32.Desc", Field, 0}, - {"Nlist32.Name", Field, 0}, - {"Nlist32.Sect", Field, 0}, - {"Nlist32.Type", Field, 0}, - {"Nlist32.Value", Field, 0}, - {"Nlist64", Type, 0}, - {"Nlist64.Desc", Field, 0}, - {"Nlist64.Name", Field, 0}, - {"Nlist64.Sect", Field, 0}, - {"Nlist64.Type", Field, 0}, - {"Nlist64.Value", Field, 0}, - {"Open", Func, 0}, - {"OpenFat", Func, 3}, - {"Regs386", Type, 0}, - {"Regs386.AX", Field, 0}, - {"Regs386.BP", Field, 0}, - {"Regs386.BX", Field, 0}, - {"Regs386.CS", Field, 0}, - {"Regs386.CX", Field, 0}, - {"Regs386.DI", Field, 0}, - {"Regs386.DS", Field, 0}, - {"Regs386.DX", Field, 0}, - {"Regs386.ES", Field, 0}, - {"Regs386.FLAGS", Field, 0}, - {"Regs386.FS", Field, 0}, - {"Regs386.GS", Field, 0}, - {"Regs386.IP", Field, 0}, - {"Regs386.SI", Field, 0}, - {"Regs386.SP", Field, 0}, - {"Regs386.SS", Field, 0}, - {"RegsAMD64", Type, 0}, - {"RegsAMD64.AX", Field, 0}, - {"RegsAMD64.BP", Field, 0}, - {"RegsAMD64.BX", Field, 0}, - {"RegsAMD64.CS", Field, 0}, - {"RegsAMD64.CX", Field, 0}, - {"RegsAMD64.DI", Field, 0}, - {"RegsAMD64.DX", Field, 0}, - {"RegsAMD64.FLAGS", Field, 0}, - {"RegsAMD64.FS", Field, 0}, - {"RegsAMD64.GS", Field, 0}, - {"RegsAMD64.IP", Field, 0}, - {"RegsAMD64.R10", Field, 0}, - {"RegsAMD64.R11", Field, 0}, - {"RegsAMD64.R12", Field, 0}, - {"RegsAMD64.R13", Field, 0}, - {"RegsAMD64.R14", Field, 0}, - {"RegsAMD64.R15", Field, 0}, - {"RegsAMD64.R8", Field, 0}, - {"RegsAMD64.R9", Field, 0}, - {"RegsAMD64.SI", Field, 0}, - {"RegsAMD64.SP", Field, 0}, - {"Reloc", Type, 10}, - {"Reloc.Addr", Field, 10}, - {"Reloc.Extern", Field, 10}, - {"Reloc.Len", Field, 10}, - {"Reloc.Pcrel", Field, 10}, - {"Reloc.Scattered", Field, 10}, - {"Reloc.Type", Field, 10}, - {"Reloc.Value", Field, 10}, - {"RelocTypeARM", Type, 10}, - {"RelocTypeARM64", Type, 10}, - {"RelocTypeGeneric", Type, 10}, - {"RelocTypeX86_64", Type, 10}, - {"Rpath", Type, 10}, - {"Rpath.LoadBytes", Field, 10}, - {"Rpath.Path", Field, 10}, - {"RpathCmd", Type, 10}, - {"RpathCmd.Cmd", Field, 10}, - {"RpathCmd.Len", Field, 10}, - {"RpathCmd.Path", Field, 10}, - {"Section", Type, 0}, - {"Section.ReaderAt", Field, 0}, - {"Section.Relocs", Field, 10}, - {"Section.SectionHeader", Field, 0}, - {"Section32", Type, 0}, - {"Section32.Addr", Field, 0}, - {"Section32.Align", Field, 0}, - {"Section32.Flags", Field, 0}, - {"Section32.Name", Field, 0}, - {"Section32.Nreloc", Field, 0}, - {"Section32.Offset", Field, 0}, - {"Section32.Reloff", Field, 0}, - {"Section32.Reserve1", Field, 0}, - {"Section32.Reserve2", Field, 0}, - {"Section32.Seg", Field, 0}, - {"Section32.Size", Field, 0}, - {"Section64", Type, 0}, - {"Section64.Addr", Field, 0}, - {"Section64.Align", Field, 0}, - {"Section64.Flags", Field, 0}, - {"Section64.Name", Field, 0}, - {"Section64.Nreloc", Field, 0}, - {"Section64.Offset", Field, 0}, - {"Section64.Reloff", Field, 0}, - {"Section64.Reserve1", Field, 0}, - {"Section64.Reserve2", Field, 0}, - {"Section64.Reserve3", Field, 0}, - {"Section64.Seg", Field, 0}, - {"Section64.Size", Field, 0}, - {"SectionHeader", Type, 0}, - {"SectionHeader.Addr", Field, 0}, - {"SectionHeader.Align", Field, 0}, - {"SectionHeader.Flags", Field, 0}, - {"SectionHeader.Name", Field, 0}, - {"SectionHeader.Nreloc", Field, 0}, - {"SectionHeader.Offset", Field, 0}, - {"SectionHeader.Reloff", Field, 0}, - {"SectionHeader.Seg", Field, 0}, - {"SectionHeader.Size", Field, 0}, - {"Segment", Type, 0}, - {"Segment.LoadBytes", Field, 0}, - {"Segment.ReaderAt", Field, 0}, - {"Segment.SegmentHeader", Field, 0}, - {"Segment32", Type, 0}, - {"Segment32.Addr", Field, 0}, - {"Segment32.Cmd", Field, 0}, - {"Segment32.Filesz", Field, 0}, - {"Segment32.Flag", Field, 0}, - {"Segment32.Len", Field, 0}, - {"Segment32.Maxprot", Field, 0}, - {"Segment32.Memsz", Field, 0}, - {"Segment32.Name", Field, 0}, - {"Segment32.Nsect", Field, 0}, - {"Segment32.Offset", Field, 0}, - {"Segment32.Prot", Field, 0}, - {"Segment64", Type, 0}, - {"Segment64.Addr", Field, 0}, - {"Segment64.Cmd", Field, 0}, - {"Segment64.Filesz", Field, 0}, - {"Segment64.Flag", Field, 0}, - {"Segment64.Len", Field, 0}, - {"Segment64.Maxprot", Field, 0}, - {"Segment64.Memsz", Field, 0}, - {"Segment64.Name", Field, 0}, - {"Segment64.Nsect", Field, 0}, - {"Segment64.Offset", Field, 0}, - {"Segment64.Prot", Field, 0}, - {"SegmentHeader", Type, 0}, - {"SegmentHeader.Addr", Field, 0}, - {"SegmentHeader.Cmd", Field, 0}, - {"SegmentHeader.Filesz", Field, 0}, - {"SegmentHeader.Flag", Field, 0}, - {"SegmentHeader.Len", Field, 0}, - {"SegmentHeader.Maxprot", Field, 0}, - {"SegmentHeader.Memsz", Field, 0}, - {"SegmentHeader.Name", Field, 0}, - {"SegmentHeader.Nsect", Field, 0}, - {"SegmentHeader.Offset", Field, 0}, - {"SegmentHeader.Prot", Field, 0}, - {"Symbol", Type, 0}, - {"Symbol.Desc", Field, 0}, - {"Symbol.Name", Field, 0}, - {"Symbol.Sect", Field, 0}, - {"Symbol.Type", Field, 0}, - {"Symbol.Value", Field, 0}, - {"Symtab", Type, 0}, - {"Symtab.LoadBytes", Field, 0}, - {"Symtab.Syms", Field, 0}, - {"Symtab.SymtabCmd", Field, 0}, - {"SymtabCmd", Type, 0}, - {"SymtabCmd.Cmd", Field, 0}, - {"SymtabCmd.Len", Field, 0}, - {"SymtabCmd.Nsyms", Field, 0}, - {"SymtabCmd.Stroff", Field, 0}, - {"SymtabCmd.Strsize", Field, 0}, - {"SymtabCmd.Symoff", Field, 0}, - {"Thread", Type, 0}, - {"Thread.Cmd", Field, 0}, - {"Thread.Data", Field, 0}, - {"Thread.Len", Field, 0}, - {"Thread.Type", Field, 0}, - {"Type", Type, 0}, - {"TypeBundle", Const, 3}, - {"TypeDylib", Const, 3}, - {"TypeExec", Const, 0}, - {"TypeObj", Const, 0}, - {"X86_64_RELOC_BRANCH", Const, 10}, - {"X86_64_RELOC_GOT", Const, 10}, - {"X86_64_RELOC_GOT_LOAD", Const, 10}, - {"X86_64_RELOC_SIGNED", Const, 10}, - {"X86_64_RELOC_SIGNED_1", Const, 10}, - {"X86_64_RELOC_SIGNED_2", Const, 10}, - {"X86_64_RELOC_SIGNED_4", Const, 10}, - {"X86_64_RELOC_SUBTRACTOR", Const, 10}, - {"X86_64_RELOC_TLV", Const, 10}, - {"X86_64_RELOC_UNSIGNED", Const, 10}, - }, - "debug/pe": { - {"(*COFFSymbol).FullName", Method, 8}, - {"(*File).COFFSymbolReadSectionDefAux", Method, 19}, - {"(*File).Close", Method, 0}, - {"(*File).DWARF", Method, 0}, - {"(*File).ImportedLibraries", Method, 0}, - {"(*File).ImportedSymbols", Method, 0}, - {"(*File).Section", Method, 0}, - {"(*FormatError).Error", Method, 0}, - {"(*Section).Data", Method, 0}, - {"(*Section).Open", Method, 0}, - {"(Section).ReadAt", Method, 0}, - {"(StringTable).String", Method, 8}, - {"COFFSymbol", Type, 1}, - {"COFFSymbol.Name", Field, 1}, - {"COFFSymbol.NumberOfAuxSymbols", Field, 1}, - {"COFFSymbol.SectionNumber", Field, 1}, - {"COFFSymbol.StorageClass", Field, 1}, - {"COFFSymbol.Type", Field, 1}, - {"COFFSymbol.Value", Field, 1}, - {"COFFSymbolAuxFormat5", Type, 19}, - {"COFFSymbolAuxFormat5.Checksum", Field, 19}, - {"COFFSymbolAuxFormat5.NumLineNumbers", Field, 19}, - {"COFFSymbolAuxFormat5.NumRelocs", Field, 19}, - {"COFFSymbolAuxFormat5.SecNum", Field, 19}, - {"COFFSymbolAuxFormat5.Selection", Field, 19}, - {"COFFSymbolAuxFormat5.Size", Field, 19}, - {"COFFSymbolSize", Const, 1}, - {"DataDirectory", Type, 3}, - {"DataDirectory.Size", Field, 3}, - {"DataDirectory.VirtualAddress", Field, 3}, - {"File", Type, 0}, - {"File.COFFSymbols", Field, 8}, - {"File.FileHeader", Field, 0}, - {"File.OptionalHeader", Field, 3}, - {"File.Sections", Field, 0}, - {"File.StringTable", Field, 8}, - {"File.Symbols", Field, 1}, - {"FileHeader", Type, 0}, - {"FileHeader.Characteristics", Field, 0}, - {"FileHeader.Machine", Field, 0}, - {"FileHeader.NumberOfSections", Field, 0}, - {"FileHeader.NumberOfSymbols", Field, 0}, - {"FileHeader.PointerToSymbolTable", Field, 0}, - {"FileHeader.SizeOfOptionalHeader", Field, 0}, - {"FileHeader.TimeDateStamp", Field, 0}, - {"FormatError", Type, 0}, - {"IMAGE_COMDAT_SELECT_ANY", Const, 19}, - {"IMAGE_COMDAT_SELECT_ASSOCIATIVE", Const, 19}, - {"IMAGE_COMDAT_SELECT_EXACT_MATCH", Const, 19}, - {"IMAGE_COMDAT_SELECT_LARGEST", Const, 19}, - {"IMAGE_COMDAT_SELECT_NODUPLICATES", Const, 19}, - {"IMAGE_COMDAT_SELECT_SAME_SIZE", Const, 19}, - {"IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_BASERELOC", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_DEBUG", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_EXCEPTION", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_EXPORT", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_GLOBALPTR", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_IAT", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_IMPORT", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_RESOURCE", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_SECURITY", Const, 11}, - {"IMAGE_DIRECTORY_ENTRY_TLS", Const, 11}, - {"IMAGE_DLLCHARACTERISTICS_APPCONTAINER", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_GUARD_CF", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_NO_BIND", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_NO_SEH", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_NX_COMPAT", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", Const, 15}, - {"IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", Const, 15}, - {"IMAGE_FILE_32BIT_MACHINE", Const, 15}, - {"IMAGE_FILE_AGGRESIVE_WS_TRIM", Const, 15}, - {"IMAGE_FILE_BYTES_REVERSED_HI", Const, 15}, - {"IMAGE_FILE_BYTES_REVERSED_LO", Const, 15}, - {"IMAGE_FILE_DEBUG_STRIPPED", Const, 15}, - {"IMAGE_FILE_DLL", Const, 15}, - {"IMAGE_FILE_EXECUTABLE_IMAGE", Const, 15}, - {"IMAGE_FILE_LARGE_ADDRESS_AWARE", Const, 15}, - {"IMAGE_FILE_LINE_NUMS_STRIPPED", Const, 15}, - {"IMAGE_FILE_LOCAL_SYMS_STRIPPED", Const, 15}, - {"IMAGE_FILE_MACHINE_AM33", Const, 0}, - {"IMAGE_FILE_MACHINE_AMD64", Const, 0}, - {"IMAGE_FILE_MACHINE_ARM", Const, 0}, - {"IMAGE_FILE_MACHINE_ARM64", Const, 11}, - {"IMAGE_FILE_MACHINE_ARMNT", Const, 12}, - {"IMAGE_FILE_MACHINE_EBC", Const, 0}, - {"IMAGE_FILE_MACHINE_I386", Const, 0}, - {"IMAGE_FILE_MACHINE_IA64", Const, 0}, - {"IMAGE_FILE_MACHINE_LOONGARCH32", Const, 19}, - {"IMAGE_FILE_MACHINE_LOONGARCH64", Const, 19}, - {"IMAGE_FILE_MACHINE_M32R", Const, 0}, - {"IMAGE_FILE_MACHINE_MIPS16", Const, 0}, - {"IMAGE_FILE_MACHINE_MIPSFPU", Const, 0}, - {"IMAGE_FILE_MACHINE_MIPSFPU16", Const, 0}, - {"IMAGE_FILE_MACHINE_POWERPC", Const, 0}, - {"IMAGE_FILE_MACHINE_POWERPCFP", Const, 0}, - {"IMAGE_FILE_MACHINE_R4000", Const, 0}, - {"IMAGE_FILE_MACHINE_RISCV128", Const, 20}, - {"IMAGE_FILE_MACHINE_RISCV32", Const, 20}, - {"IMAGE_FILE_MACHINE_RISCV64", Const, 20}, - {"IMAGE_FILE_MACHINE_SH3", Const, 0}, - {"IMAGE_FILE_MACHINE_SH3DSP", Const, 0}, - {"IMAGE_FILE_MACHINE_SH4", Const, 0}, - {"IMAGE_FILE_MACHINE_SH5", Const, 0}, - {"IMAGE_FILE_MACHINE_THUMB", Const, 0}, - {"IMAGE_FILE_MACHINE_UNKNOWN", Const, 0}, - {"IMAGE_FILE_MACHINE_WCEMIPSV2", Const, 0}, - {"IMAGE_FILE_NET_RUN_FROM_SWAP", Const, 15}, - {"IMAGE_FILE_RELOCS_STRIPPED", Const, 15}, - {"IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", Const, 15}, - {"IMAGE_FILE_SYSTEM", Const, 15}, - {"IMAGE_FILE_UP_SYSTEM_ONLY", Const, 15}, - {"IMAGE_SCN_CNT_CODE", Const, 19}, - {"IMAGE_SCN_CNT_INITIALIZED_DATA", Const, 19}, - {"IMAGE_SCN_CNT_UNINITIALIZED_DATA", Const, 19}, - {"IMAGE_SCN_LNK_COMDAT", Const, 19}, - {"IMAGE_SCN_MEM_DISCARDABLE", Const, 19}, - {"IMAGE_SCN_MEM_EXECUTE", Const, 19}, - {"IMAGE_SCN_MEM_READ", Const, 19}, - {"IMAGE_SCN_MEM_WRITE", Const, 19}, - {"IMAGE_SUBSYSTEM_EFI_APPLICATION", Const, 15}, - {"IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", Const, 15}, - {"IMAGE_SUBSYSTEM_EFI_ROM", Const, 15}, - {"IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", Const, 15}, - {"IMAGE_SUBSYSTEM_NATIVE", Const, 15}, - {"IMAGE_SUBSYSTEM_NATIVE_WINDOWS", Const, 15}, - {"IMAGE_SUBSYSTEM_OS2_CUI", Const, 15}, - {"IMAGE_SUBSYSTEM_POSIX_CUI", Const, 15}, - {"IMAGE_SUBSYSTEM_UNKNOWN", Const, 15}, - {"IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", Const, 15}, - {"IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", Const, 15}, - {"IMAGE_SUBSYSTEM_WINDOWS_CUI", Const, 15}, - {"IMAGE_SUBSYSTEM_WINDOWS_GUI", Const, 15}, - {"IMAGE_SUBSYSTEM_XBOX", Const, 15}, - {"ImportDirectory", Type, 0}, - {"ImportDirectory.FirstThunk", Field, 0}, - {"ImportDirectory.ForwarderChain", Field, 0}, - {"ImportDirectory.Name", Field, 0}, - {"ImportDirectory.OriginalFirstThunk", Field, 0}, - {"ImportDirectory.TimeDateStamp", Field, 0}, - {"NewFile", Func, 0}, - {"Open", Func, 0}, - {"OptionalHeader32", Type, 3}, - {"OptionalHeader32.AddressOfEntryPoint", Field, 3}, - {"OptionalHeader32.BaseOfCode", Field, 3}, - {"OptionalHeader32.BaseOfData", Field, 3}, - {"OptionalHeader32.CheckSum", Field, 3}, - {"OptionalHeader32.DataDirectory", Field, 3}, - {"OptionalHeader32.DllCharacteristics", Field, 3}, - {"OptionalHeader32.FileAlignment", Field, 3}, - {"OptionalHeader32.ImageBase", Field, 3}, - {"OptionalHeader32.LoaderFlags", Field, 3}, - {"OptionalHeader32.Magic", Field, 3}, - {"OptionalHeader32.MajorImageVersion", Field, 3}, - {"OptionalHeader32.MajorLinkerVersion", Field, 3}, - {"OptionalHeader32.MajorOperatingSystemVersion", Field, 3}, - {"OptionalHeader32.MajorSubsystemVersion", Field, 3}, - {"OptionalHeader32.MinorImageVersion", Field, 3}, - {"OptionalHeader32.MinorLinkerVersion", Field, 3}, - {"OptionalHeader32.MinorOperatingSystemVersion", Field, 3}, - {"OptionalHeader32.MinorSubsystemVersion", Field, 3}, - {"OptionalHeader32.NumberOfRvaAndSizes", Field, 3}, - {"OptionalHeader32.SectionAlignment", Field, 3}, - {"OptionalHeader32.SizeOfCode", Field, 3}, - {"OptionalHeader32.SizeOfHeaders", Field, 3}, - {"OptionalHeader32.SizeOfHeapCommit", Field, 3}, - {"OptionalHeader32.SizeOfHeapReserve", Field, 3}, - {"OptionalHeader32.SizeOfImage", Field, 3}, - {"OptionalHeader32.SizeOfInitializedData", Field, 3}, - {"OptionalHeader32.SizeOfStackCommit", Field, 3}, - {"OptionalHeader32.SizeOfStackReserve", Field, 3}, - {"OptionalHeader32.SizeOfUninitializedData", Field, 3}, - {"OptionalHeader32.Subsystem", Field, 3}, - {"OptionalHeader32.Win32VersionValue", Field, 3}, - {"OptionalHeader64", Type, 3}, - {"OptionalHeader64.AddressOfEntryPoint", Field, 3}, - {"OptionalHeader64.BaseOfCode", Field, 3}, - {"OptionalHeader64.CheckSum", Field, 3}, - {"OptionalHeader64.DataDirectory", Field, 3}, - {"OptionalHeader64.DllCharacteristics", Field, 3}, - {"OptionalHeader64.FileAlignment", Field, 3}, - {"OptionalHeader64.ImageBase", Field, 3}, - {"OptionalHeader64.LoaderFlags", Field, 3}, - {"OptionalHeader64.Magic", Field, 3}, - {"OptionalHeader64.MajorImageVersion", Field, 3}, - {"OptionalHeader64.MajorLinkerVersion", Field, 3}, - {"OptionalHeader64.MajorOperatingSystemVersion", Field, 3}, - {"OptionalHeader64.MajorSubsystemVersion", Field, 3}, - {"OptionalHeader64.MinorImageVersion", Field, 3}, - {"OptionalHeader64.MinorLinkerVersion", Field, 3}, - {"OptionalHeader64.MinorOperatingSystemVersion", Field, 3}, - {"OptionalHeader64.MinorSubsystemVersion", Field, 3}, - {"OptionalHeader64.NumberOfRvaAndSizes", Field, 3}, - {"OptionalHeader64.SectionAlignment", Field, 3}, - {"OptionalHeader64.SizeOfCode", Field, 3}, - {"OptionalHeader64.SizeOfHeaders", Field, 3}, - {"OptionalHeader64.SizeOfHeapCommit", Field, 3}, - {"OptionalHeader64.SizeOfHeapReserve", Field, 3}, - {"OptionalHeader64.SizeOfImage", Field, 3}, - {"OptionalHeader64.SizeOfInitializedData", Field, 3}, - {"OptionalHeader64.SizeOfStackCommit", Field, 3}, - {"OptionalHeader64.SizeOfStackReserve", Field, 3}, - {"OptionalHeader64.SizeOfUninitializedData", Field, 3}, - {"OptionalHeader64.Subsystem", Field, 3}, - {"OptionalHeader64.Win32VersionValue", Field, 3}, - {"Reloc", Type, 8}, - {"Reloc.SymbolTableIndex", Field, 8}, - {"Reloc.Type", Field, 8}, - {"Reloc.VirtualAddress", Field, 8}, - {"Section", Type, 0}, - {"Section.ReaderAt", Field, 0}, - {"Section.Relocs", Field, 8}, - {"Section.SectionHeader", Field, 0}, - {"SectionHeader", Type, 0}, - {"SectionHeader.Characteristics", Field, 0}, - {"SectionHeader.Name", Field, 0}, - {"SectionHeader.NumberOfLineNumbers", Field, 0}, - {"SectionHeader.NumberOfRelocations", Field, 0}, - {"SectionHeader.Offset", Field, 0}, - {"SectionHeader.PointerToLineNumbers", Field, 0}, - {"SectionHeader.PointerToRelocations", Field, 0}, - {"SectionHeader.Size", Field, 0}, - {"SectionHeader.VirtualAddress", Field, 0}, - {"SectionHeader.VirtualSize", Field, 0}, - {"SectionHeader32", Type, 0}, - {"SectionHeader32.Characteristics", Field, 0}, - {"SectionHeader32.Name", Field, 0}, - {"SectionHeader32.NumberOfLineNumbers", Field, 0}, - {"SectionHeader32.NumberOfRelocations", Field, 0}, - {"SectionHeader32.PointerToLineNumbers", Field, 0}, - {"SectionHeader32.PointerToRawData", Field, 0}, - {"SectionHeader32.PointerToRelocations", Field, 0}, - {"SectionHeader32.SizeOfRawData", Field, 0}, - {"SectionHeader32.VirtualAddress", Field, 0}, - {"SectionHeader32.VirtualSize", Field, 0}, - {"StringTable", Type, 8}, - {"Symbol", Type, 1}, - {"Symbol.Name", Field, 1}, - {"Symbol.SectionNumber", Field, 1}, - {"Symbol.StorageClass", Field, 1}, - {"Symbol.Type", Field, 1}, - {"Symbol.Value", Field, 1}, - }, - "debug/plan9obj": { - {"(*File).Close", Method, 3}, - {"(*File).Section", Method, 3}, - {"(*File).Symbols", Method, 3}, - {"(*Section).Data", Method, 3}, - {"(*Section).Open", Method, 3}, - {"(Section).ReadAt", Method, 3}, - {"ErrNoSymbols", Var, 18}, - {"File", Type, 3}, - {"File.FileHeader", Field, 3}, - {"File.Sections", Field, 3}, - {"FileHeader", Type, 3}, - {"FileHeader.Bss", Field, 3}, - {"FileHeader.Entry", Field, 3}, - {"FileHeader.HdrSize", Field, 4}, - {"FileHeader.LoadAddress", Field, 4}, - {"FileHeader.Magic", Field, 3}, - {"FileHeader.PtrSize", Field, 3}, - {"Magic386", Const, 3}, - {"Magic64", Const, 3}, - {"MagicAMD64", Const, 3}, - {"MagicARM", Const, 3}, - {"NewFile", Func, 3}, - {"Open", Func, 3}, - {"Section", Type, 3}, - {"Section.ReaderAt", Field, 3}, - {"Section.SectionHeader", Field, 3}, - {"SectionHeader", Type, 3}, - {"SectionHeader.Name", Field, 3}, - {"SectionHeader.Offset", Field, 3}, - {"SectionHeader.Size", Field, 3}, - {"Sym", Type, 3}, - {"Sym.Name", Field, 3}, - {"Sym.Type", Field, 3}, - {"Sym.Value", Field, 3}, - }, - "embed": { - {"(FS).Open", Method, 16}, - {"(FS).ReadDir", Method, 16}, - {"(FS).ReadFile", Method, 16}, - {"FS", Type, 16}, - }, - "encoding": { - {"BinaryMarshaler", Type, 2}, - {"BinaryUnmarshaler", Type, 2}, - {"TextMarshaler", Type, 2}, - {"TextUnmarshaler", Type, 2}, - }, - "encoding/ascii85": { - {"(CorruptInputError).Error", Method, 0}, - {"CorruptInputError", Type, 0}, - {"Decode", Func, 0}, - {"Encode", Func, 0}, - {"MaxEncodedLen", Func, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - }, - "encoding/asn1": { - {"(BitString).At", Method, 0}, - {"(BitString).RightAlign", Method, 0}, - {"(ObjectIdentifier).Equal", Method, 0}, - {"(ObjectIdentifier).String", Method, 3}, - {"(StructuralError).Error", Method, 0}, - {"(SyntaxError).Error", Method, 0}, - {"BitString", Type, 0}, - {"BitString.BitLength", Field, 0}, - {"BitString.Bytes", Field, 0}, - {"ClassApplication", Const, 6}, - {"ClassContextSpecific", Const, 6}, - {"ClassPrivate", Const, 6}, - {"ClassUniversal", Const, 6}, - {"Enumerated", Type, 0}, - {"Flag", Type, 0}, - {"Marshal", Func, 0}, - {"MarshalWithParams", Func, 10}, - {"NullBytes", Var, 9}, - {"NullRawValue", Var, 9}, - {"ObjectIdentifier", Type, 0}, - {"RawContent", Type, 0}, - {"RawValue", Type, 0}, - {"RawValue.Bytes", Field, 0}, - {"RawValue.Class", Field, 0}, - {"RawValue.FullBytes", Field, 0}, - {"RawValue.IsCompound", Field, 0}, - {"RawValue.Tag", Field, 0}, - {"StructuralError", Type, 0}, - {"StructuralError.Msg", Field, 0}, - {"SyntaxError", Type, 0}, - {"SyntaxError.Msg", Field, 0}, - {"TagBMPString", Const, 14}, - {"TagBitString", Const, 6}, - {"TagBoolean", Const, 6}, - {"TagEnum", Const, 6}, - {"TagGeneralString", Const, 6}, - {"TagGeneralizedTime", Const, 6}, - {"TagIA5String", Const, 6}, - {"TagInteger", Const, 6}, - {"TagNull", Const, 9}, - {"TagNumericString", Const, 10}, - {"TagOID", Const, 6}, - {"TagOctetString", Const, 6}, - {"TagPrintableString", Const, 6}, - {"TagSequence", Const, 6}, - {"TagSet", Const, 6}, - {"TagT61String", Const, 6}, - {"TagUTCTime", Const, 6}, - {"TagUTF8String", Const, 6}, - {"Unmarshal", Func, 0}, - {"UnmarshalWithParams", Func, 0}, - }, - "encoding/base32": { - {"(*Encoding).AppendDecode", Method, 22}, - {"(*Encoding).AppendEncode", Method, 22}, - {"(*Encoding).Decode", Method, 0}, - {"(*Encoding).DecodeString", Method, 0}, - {"(*Encoding).DecodedLen", Method, 0}, - {"(*Encoding).Encode", Method, 0}, - {"(*Encoding).EncodeToString", Method, 0}, - {"(*Encoding).EncodedLen", Method, 0}, - {"(CorruptInputError).Error", Method, 0}, - {"(Encoding).WithPadding", Method, 9}, - {"CorruptInputError", Type, 0}, - {"Encoding", Type, 0}, - {"HexEncoding", Var, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - {"NewEncoding", Func, 0}, - {"NoPadding", Const, 9}, - {"StdEncoding", Var, 0}, - {"StdPadding", Const, 9}, - }, - "encoding/base64": { - {"(*Encoding).AppendDecode", Method, 22}, - {"(*Encoding).AppendEncode", Method, 22}, - {"(*Encoding).Decode", Method, 0}, - {"(*Encoding).DecodeString", Method, 0}, - {"(*Encoding).DecodedLen", Method, 0}, - {"(*Encoding).Encode", Method, 0}, - {"(*Encoding).EncodeToString", Method, 0}, - {"(*Encoding).EncodedLen", Method, 0}, - {"(CorruptInputError).Error", Method, 0}, - {"(Encoding).Strict", Method, 8}, - {"(Encoding).WithPadding", Method, 5}, - {"CorruptInputError", Type, 0}, - {"Encoding", Type, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - {"NewEncoding", Func, 0}, - {"NoPadding", Const, 5}, - {"RawStdEncoding", Var, 5}, - {"RawURLEncoding", Var, 5}, - {"StdEncoding", Var, 0}, - {"StdPadding", Const, 5}, - {"URLEncoding", Var, 0}, - }, - "encoding/binary": { - {"AppendByteOrder", Type, 19}, - {"AppendUvarint", Func, 19}, - {"AppendVarint", Func, 19}, - {"BigEndian", Var, 0}, - {"ByteOrder", Type, 0}, - {"LittleEndian", Var, 0}, - {"MaxVarintLen16", Const, 0}, - {"MaxVarintLen32", Const, 0}, - {"MaxVarintLen64", Const, 0}, - {"NativeEndian", Var, 21}, - {"PutUvarint", Func, 0}, - {"PutVarint", Func, 0}, - {"Read", Func, 0}, - {"ReadUvarint", Func, 0}, - {"ReadVarint", Func, 0}, - {"Size", Func, 0}, - {"Uvarint", Func, 0}, - {"Varint", Func, 0}, - {"Write", Func, 0}, - }, - "encoding/csv": { - {"(*ParseError).Error", Method, 0}, - {"(*ParseError).Unwrap", Method, 13}, - {"(*Reader).FieldPos", Method, 17}, - {"(*Reader).InputOffset", Method, 19}, - {"(*Reader).Read", Method, 0}, - {"(*Reader).ReadAll", Method, 0}, - {"(*Writer).Error", Method, 1}, - {"(*Writer).Flush", Method, 0}, - {"(*Writer).Write", Method, 0}, - {"(*Writer).WriteAll", Method, 0}, - {"ErrBareQuote", Var, 0}, - {"ErrFieldCount", Var, 0}, - {"ErrQuote", Var, 0}, - {"ErrTrailingComma", Var, 0}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"ParseError", Type, 0}, - {"ParseError.Column", Field, 0}, - {"ParseError.Err", Field, 0}, - {"ParseError.Line", Field, 0}, - {"ParseError.StartLine", Field, 10}, - {"Reader", Type, 0}, - {"Reader.Comma", Field, 0}, - {"Reader.Comment", Field, 0}, - {"Reader.FieldsPerRecord", Field, 0}, - {"Reader.LazyQuotes", Field, 0}, - {"Reader.ReuseRecord", Field, 9}, - {"Reader.TrailingComma", Field, 0}, - {"Reader.TrimLeadingSpace", Field, 0}, - {"Writer", Type, 0}, - {"Writer.Comma", Field, 0}, - {"Writer.UseCRLF", Field, 0}, - }, - "encoding/gob": { - {"(*Decoder).Decode", Method, 0}, - {"(*Decoder).DecodeValue", Method, 0}, - {"(*Encoder).Encode", Method, 0}, - {"(*Encoder).EncodeValue", Method, 0}, - {"CommonType", Type, 0}, - {"CommonType.Id", Field, 0}, - {"CommonType.Name", Field, 0}, - {"Decoder", Type, 0}, - {"Encoder", Type, 0}, - {"GobDecoder", Type, 0}, - {"GobEncoder", Type, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - {"Register", Func, 0}, - {"RegisterName", Func, 0}, - }, - "encoding/hex": { - {"(InvalidByteError).Error", Method, 0}, - {"AppendDecode", Func, 22}, - {"AppendEncode", Func, 22}, - {"Decode", Func, 0}, - {"DecodeString", Func, 0}, - {"DecodedLen", Func, 0}, - {"Dump", Func, 0}, - {"Dumper", Func, 0}, - {"Encode", Func, 0}, - {"EncodeToString", Func, 0}, - {"EncodedLen", Func, 0}, - {"ErrLength", Var, 0}, - {"InvalidByteError", Type, 0}, - {"NewDecoder", Func, 10}, - {"NewEncoder", Func, 10}, - }, - "encoding/json": { - {"(*Decoder).Buffered", Method, 1}, - {"(*Decoder).Decode", Method, 0}, - {"(*Decoder).DisallowUnknownFields", Method, 10}, - {"(*Decoder).InputOffset", Method, 14}, - {"(*Decoder).More", Method, 5}, - {"(*Decoder).Token", Method, 5}, - {"(*Decoder).UseNumber", Method, 1}, - {"(*Encoder).Encode", Method, 0}, - {"(*Encoder).SetEscapeHTML", Method, 7}, - {"(*Encoder).SetIndent", Method, 7}, - {"(*InvalidUTF8Error).Error", Method, 0}, - {"(*InvalidUnmarshalError).Error", Method, 0}, - {"(*MarshalerError).Error", Method, 0}, - {"(*MarshalerError).Unwrap", Method, 13}, - {"(*RawMessage).MarshalJSON", Method, 0}, - {"(*RawMessage).UnmarshalJSON", Method, 0}, - {"(*SyntaxError).Error", Method, 0}, - {"(*UnmarshalFieldError).Error", Method, 0}, - {"(*UnmarshalTypeError).Error", Method, 0}, - {"(*UnsupportedTypeError).Error", Method, 0}, - {"(*UnsupportedValueError).Error", Method, 0}, - {"(Delim).String", Method, 5}, - {"(Number).Float64", Method, 1}, - {"(Number).Int64", Method, 1}, - {"(Number).String", Method, 1}, - {"(RawMessage).MarshalJSON", Method, 8}, - {"Compact", Func, 0}, - {"Decoder", Type, 0}, - {"Delim", Type, 5}, - {"Encoder", Type, 0}, - {"HTMLEscape", Func, 0}, - {"Indent", Func, 0}, - {"InvalidUTF8Error", Type, 0}, - {"InvalidUTF8Error.S", Field, 0}, - {"InvalidUnmarshalError", Type, 0}, - {"InvalidUnmarshalError.Type", Field, 0}, - {"Marshal", Func, 0}, - {"MarshalIndent", Func, 0}, - {"Marshaler", Type, 0}, - {"MarshalerError", Type, 0}, - {"MarshalerError.Err", Field, 0}, - {"MarshalerError.Type", Field, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - {"Number", Type, 1}, - {"RawMessage", Type, 0}, - {"SyntaxError", Type, 0}, - {"SyntaxError.Offset", Field, 0}, - {"Token", Type, 5}, - {"Unmarshal", Func, 0}, - {"UnmarshalFieldError", Type, 0}, - {"UnmarshalFieldError.Field", Field, 0}, - {"UnmarshalFieldError.Key", Field, 0}, - {"UnmarshalFieldError.Type", Field, 0}, - {"UnmarshalTypeError", Type, 0}, - {"UnmarshalTypeError.Field", Field, 8}, - {"UnmarshalTypeError.Offset", Field, 5}, - {"UnmarshalTypeError.Struct", Field, 8}, - {"UnmarshalTypeError.Type", Field, 0}, - {"UnmarshalTypeError.Value", Field, 0}, - {"Unmarshaler", Type, 0}, - {"UnsupportedTypeError", Type, 0}, - {"UnsupportedTypeError.Type", Field, 0}, - {"UnsupportedValueError", Type, 0}, - {"UnsupportedValueError.Str", Field, 0}, - {"UnsupportedValueError.Value", Field, 0}, - {"Valid", Func, 9}, - }, - "encoding/pem": { - {"Block", Type, 0}, - {"Block.Bytes", Field, 0}, - {"Block.Headers", Field, 0}, - {"Block.Type", Field, 0}, - {"Decode", Func, 0}, - {"Encode", Func, 0}, - {"EncodeToMemory", Func, 0}, - }, - "encoding/xml": { - {"(*Decoder).Decode", Method, 0}, - {"(*Decoder).DecodeElement", Method, 0}, - {"(*Decoder).InputOffset", Method, 4}, - {"(*Decoder).InputPos", Method, 19}, - {"(*Decoder).RawToken", Method, 0}, - {"(*Decoder).Skip", Method, 0}, - {"(*Decoder).Token", Method, 0}, - {"(*Encoder).Close", Method, 20}, - {"(*Encoder).Encode", Method, 0}, - {"(*Encoder).EncodeElement", Method, 2}, - {"(*Encoder).EncodeToken", Method, 2}, - {"(*Encoder).Flush", Method, 2}, - {"(*Encoder).Indent", Method, 1}, - {"(*SyntaxError).Error", Method, 0}, - {"(*TagPathError).Error", Method, 0}, - {"(*UnsupportedTypeError).Error", Method, 0}, - {"(CharData).Copy", Method, 0}, - {"(Comment).Copy", Method, 0}, - {"(Directive).Copy", Method, 0}, - {"(ProcInst).Copy", Method, 0}, - {"(StartElement).Copy", Method, 0}, - {"(StartElement).End", Method, 2}, - {"(UnmarshalError).Error", Method, 0}, - {"Attr", Type, 0}, - {"Attr.Name", Field, 0}, - {"Attr.Value", Field, 0}, - {"CharData", Type, 0}, - {"Comment", Type, 0}, - {"CopyToken", Func, 0}, - {"Decoder", Type, 0}, - {"Decoder.AutoClose", Field, 0}, - {"Decoder.CharsetReader", Field, 0}, - {"Decoder.DefaultSpace", Field, 1}, - {"Decoder.Entity", Field, 0}, - {"Decoder.Strict", Field, 0}, - {"Directive", Type, 0}, - {"Encoder", Type, 0}, - {"EndElement", Type, 0}, - {"EndElement.Name", Field, 0}, - {"Escape", Func, 0}, - {"EscapeText", Func, 1}, - {"HTMLAutoClose", Var, 0}, - {"HTMLEntity", Var, 0}, - {"Header", Const, 0}, - {"Marshal", Func, 0}, - {"MarshalIndent", Func, 0}, - {"Marshaler", Type, 2}, - {"MarshalerAttr", Type, 2}, - {"Name", Type, 0}, - {"Name.Local", Field, 0}, - {"Name.Space", Field, 0}, - {"NewDecoder", Func, 0}, - {"NewEncoder", Func, 0}, - {"NewTokenDecoder", Func, 10}, - {"ProcInst", Type, 0}, - {"ProcInst.Inst", Field, 0}, - {"ProcInst.Target", Field, 0}, - {"StartElement", Type, 0}, - {"StartElement.Attr", Field, 0}, - {"StartElement.Name", Field, 0}, - {"SyntaxError", Type, 0}, - {"SyntaxError.Line", Field, 0}, - {"SyntaxError.Msg", Field, 0}, - {"TagPathError", Type, 0}, - {"TagPathError.Field1", Field, 0}, - {"TagPathError.Field2", Field, 0}, - {"TagPathError.Struct", Field, 0}, - {"TagPathError.Tag1", Field, 0}, - {"TagPathError.Tag2", Field, 0}, - {"Token", Type, 0}, - {"TokenReader", Type, 10}, - {"Unmarshal", Func, 0}, - {"UnmarshalError", Type, 0}, - {"Unmarshaler", Type, 2}, - {"UnmarshalerAttr", Type, 2}, - {"UnsupportedTypeError", Type, 0}, - {"UnsupportedTypeError.Type", Field, 0}, - }, - "errors": { - {"As", Func, 13}, - {"ErrUnsupported", Var, 21}, - {"Is", Func, 13}, - {"Join", Func, 20}, - {"New", Func, 0}, - {"Unwrap", Func, 13}, - }, - "expvar": { - {"(*Float).Add", Method, 0}, - {"(*Float).Set", Method, 0}, - {"(*Float).String", Method, 0}, - {"(*Float).Value", Method, 8}, - {"(*Int).Add", Method, 0}, - {"(*Int).Set", Method, 0}, - {"(*Int).String", Method, 0}, - {"(*Int).Value", Method, 8}, - {"(*Map).Add", Method, 0}, - {"(*Map).AddFloat", Method, 0}, - {"(*Map).Delete", Method, 12}, - {"(*Map).Do", Method, 0}, - {"(*Map).Get", Method, 0}, - {"(*Map).Init", Method, 0}, - {"(*Map).Set", Method, 0}, - {"(*Map).String", Method, 0}, - {"(*String).Set", Method, 0}, - {"(*String).String", Method, 0}, - {"(*String).Value", Method, 8}, - {"(Func).String", Method, 0}, - {"(Func).Value", Method, 8}, - {"Do", Func, 0}, - {"Float", Type, 0}, - {"Func", Type, 0}, - {"Get", Func, 0}, - {"Handler", Func, 8}, - {"Int", Type, 0}, - {"KeyValue", Type, 0}, - {"KeyValue.Key", Field, 0}, - {"KeyValue.Value", Field, 0}, - {"Map", Type, 0}, - {"NewFloat", Func, 0}, - {"NewInt", Func, 0}, - {"NewMap", Func, 0}, - {"NewString", Func, 0}, - {"Publish", Func, 0}, - {"String", Type, 0}, - {"Var", Type, 0}, - }, - "flag": { - {"(*FlagSet).Arg", Method, 0}, - {"(*FlagSet).Args", Method, 0}, - {"(*FlagSet).Bool", Method, 0}, - {"(*FlagSet).BoolFunc", Method, 21}, - {"(*FlagSet).BoolVar", Method, 0}, - {"(*FlagSet).Duration", Method, 0}, - {"(*FlagSet).DurationVar", Method, 0}, - {"(*FlagSet).ErrorHandling", Method, 10}, - {"(*FlagSet).Float64", Method, 0}, - {"(*FlagSet).Float64Var", Method, 0}, - {"(*FlagSet).Func", Method, 16}, - {"(*FlagSet).Init", Method, 0}, - {"(*FlagSet).Int", Method, 0}, - {"(*FlagSet).Int64", Method, 0}, - {"(*FlagSet).Int64Var", Method, 0}, - {"(*FlagSet).IntVar", Method, 0}, - {"(*FlagSet).Lookup", Method, 0}, - {"(*FlagSet).NArg", Method, 0}, - {"(*FlagSet).NFlag", Method, 0}, - {"(*FlagSet).Name", Method, 10}, - {"(*FlagSet).Output", Method, 10}, - {"(*FlagSet).Parse", Method, 0}, - {"(*FlagSet).Parsed", Method, 0}, - {"(*FlagSet).PrintDefaults", Method, 0}, - {"(*FlagSet).Set", Method, 0}, - {"(*FlagSet).SetOutput", Method, 0}, - {"(*FlagSet).String", Method, 0}, - {"(*FlagSet).StringVar", Method, 0}, - {"(*FlagSet).TextVar", Method, 19}, - {"(*FlagSet).Uint", Method, 0}, - {"(*FlagSet).Uint64", Method, 0}, - {"(*FlagSet).Uint64Var", Method, 0}, - {"(*FlagSet).UintVar", Method, 0}, - {"(*FlagSet).Var", Method, 0}, - {"(*FlagSet).Visit", Method, 0}, - {"(*FlagSet).VisitAll", Method, 0}, - {"Arg", Func, 0}, - {"Args", Func, 0}, - {"Bool", Func, 0}, - {"BoolFunc", Func, 21}, - {"BoolVar", Func, 0}, - {"CommandLine", Var, 2}, - {"ContinueOnError", Const, 0}, - {"Duration", Func, 0}, - {"DurationVar", Func, 0}, - {"ErrHelp", Var, 0}, - {"ErrorHandling", Type, 0}, - {"ExitOnError", Const, 0}, - {"Flag", Type, 0}, - {"Flag.DefValue", Field, 0}, - {"Flag.Name", Field, 0}, - {"Flag.Usage", Field, 0}, - {"Flag.Value", Field, 0}, - {"FlagSet", Type, 0}, - {"FlagSet.Usage", Field, 0}, - {"Float64", Func, 0}, - {"Float64Var", Func, 0}, - {"Func", Func, 16}, - {"Getter", Type, 2}, - {"Int", Func, 0}, - {"Int64", Func, 0}, - {"Int64Var", Func, 0}, - {"IntVar", Func, 0}, - {"Lookup", Func, 0}, - {"NArg", Func, 0}, - {"NFlag", Func, 0}, - {"NewFlagSet", Func, 0}, - {"PanicOnError", Const, 0}, - {"Parse", Func, 0}, - {"Parsed", Func, 0}, - {"PrintDefaults", Func, 0}, - {"Set", Func, 0}, - {"String", Func, 0}, - {"StringVar", Func, 0}, - {"TextVar", Func, 19}, - {"Uint", Func, 0}, - {"Uint64", Func, 0}, - {"Uint64Var", Func, 0}, - {"UintVar", Func, 0}, - {"UnquoteUsage", Func, 5}, - {"Usage", Var, 0}, - {"Value", Type, 0}, - {"Var", Func, 0}, - {"Visit", Func, 0}, - {"VisitAll", Func, 0}, - }, - "fmt": { - {"Append", Func, 19}, - {"Appendf", Func, 19}, - {"Appendln", Func, 19}, - {"Errorf", Func, 0}, - {"FormatString", Func, 20}, - {"Formatter", Type, 0}, - {"Fprint", Func, 0}, - {"Fprintf", Func, 0}, - {"Fprintln", Func, 0}, - {"Fscan", Func, 0}, - {"Fscanf", Func, 0}, - {"Fscanln", Func, 0}, - {"GoStringer", Type, 0}, - {"Print", Func, 0}, - {"Printf", Func, 0}, - {"Println", Func, 0}, - {"Scan", Func, 0}, - {"ScanState", Type, 0}, - {"Scanf", Func, 0}, - {"Scanln", Func, 0}, - {"Scanner", Type, 0}, - {"Sprint", Func, 0}, - {"Sprintf", Func, 0}, - {"Sprintln", Func, 0}, - {"Sscan", Func, 0}, - {"Sscanf", Func, 0}, - {"Sscanln", Func, 0}, - {"State", Type, 0}, - {"Stringer", Type, 0}, - }, - "go/ast": { - {"(*ArrayType).End", Method, 0}, - {"(*ArrayType).Pos", Method, 0}, - {"(*AssignStmt).End", Method, 0}, - {"(*AssignStmt).Pos", Method, 0}, - {"(*BadDecl).End", Method, 0}, - {"(*BadDecl).Pos", Method, 0}, - {"(*BadExpr).End", Method, 0}, - {"(*BadExpr).Pos", Method, 0}, - {"(*BadStmt).End", Method, 0}, - {"(*BadStmt).Pos", Method, 0}, - {"(*BasicLit).End", Method, 0}, - {"(*BasicLit).Pos", Method, 0}, - {"(*BinaryExpr).End", Method, 0}, - {"(*BinaryExpr).Pos", Method, 0}, - {"(*BlockStmt).End", Method, 0}, - {"(*BlockStmt).Pos", Method, 0}, - {"(*BranchStmt).End", Method, 0}, - {"(*BranchStmt).Pos", Method, 0}, - {"(*CallExpr).End", Method, 0}, - {"(*CallExpr).Pos", Method, 0}, - {"(*CaseClause).End", Method, 0}, - {"(*CaseClause).Pos", Method, 0}, - {"(*ChanType).End", Method, 0}, - {"(*ChanType).Pos", Method, 0}, - {"(*CommClause).End", Method, 0}, - {"(*CommClause).Pos", Method, 0}, - {"(*Comment).End", Method, 0}, - {"(*Comment).Pos", Method, 0}, - {"(*CommentGroup).End", Method, 0}, - {"(*CommentGroup).Pos", Method, 0}, - {"(*CommentGroup).Text", Method, 0}, - {"(*CompositeLit).End", Method, 0}, - {"(*CompositeLit).Pos", Method, 0}, - {"(*DeclStmt).End", Method, 0}, - {"(*DeclStmt).Pos", Method, 0}, - {"(*DeferStmt).End", Method, 0}, - {"(*DeferStmt).Pos", Method, 0}, - {"(*Ellipsis).End", Method, 0}, - {"(*Ellipsis).Pos", Method, 0}, - {"(*EmptyStmt).End", Method, 0}, - {"(*EmptyStmt).Pos", Method, 0}, - {"(*ExprStmt).End", Method, 0}, - {"(*ExprStmt).Pos", Method, 0}, - {"(*Field).End", Method, 0}, - {"(*Field).Pos", Method, 0}, - {"(*FieldList).End", Method, 0}, - {"(*FieldList).NumFields", Method, 0}, - {"(*FieldList).Pos", Method, 0}, - {"(*File).End", Method, 0}, - {"(*File).Pos", Method, 0}, - {"(*ForStmt).End", Method, 0}, - {"(*ForStmt).Pos", Method, 0}, - {"(*FuncDecl).End", Method, 0}, - {"(*FuncDecl).Pos", Method, 0}, - {"(*FuncLit).End", Method, 0}, - {"(*FuncLit).Pos", Method, 0}, - {"(*FuncType).End", Method, 0}, - {"(*FuncType).Pos", Method, 0}, - {"(*GenDecl).End", Method, 0}, - {"(*GenDecl).Pos", Method, 0}, - {"(*GoStmt).End", Method, 0}, - {"(*GoStmt).Pos", Method, 0}, - {"(*Ident).End", Method, 0}, - {"(*Ident).IsExported", Method, 0}, - {"(*Ident).Pos", Method, 0}, - {"(*Ident).String", Method, 0}, - {"(*IfStmt).End", Method, 0}, - {"(*IfStmt).Pos", Method, 0}, - {"(*ImportSpec).End", Method, 0}, - {"(*ImportSpec).Pos", Method, 0}, - {"(*IncDecStmt).End", Method, 0}, - {"(*IncDecStmt).Pos", Method, 0}, - {"(*IndexExpr).End", Method, 0}, - {"(*IndexExpr).Pos", Method, 0}, - {"(*IndexListExpr).End", Method, 18}, - {"(*IndexListExpr).Pos", Method, 18}, - {"(*InterfaceType).End", Method, 0}, - {"(*InterfaceType).Pos", Method, 0}, - {"(*KeyValueExpr).End", Method, 0}, - {"(*KeyValueExpr).Pos", Method, 0}, - {"(*LabeledStmt).End", Method, 0}, - {"(*LabeledStmt).Pos", Method, 0}, - {"(*MapType).End", Method, 0}, - {"(*MapType).Pos", Method, 0}, - {"(*Object).Pos", Method, 0}, - {"(*Package).End", Method, 0}, - {"(*Package).Pos", Method, 0}, - {"(*ParenExpr).End", Method, 0}, - {"(*ParenExpr).Pos", Method, 0}, - {"(*RangeStmt).End", Method, 0}, - {"(*RangeStmt).Pos", Method, 0}, - {"(*ReturnStmt).End", Method, 0}, - {"(*ReturnStmt).Pos", Method, 0}, - {"(*Scope).Insert", Method, 0}, - {"(*Scope).Lookup", Method, 0}, - {"(*Scope).String", Method, 0}, - {"(*SelectStmt).End", Method, 0}, - {"(*SelectStmt).Pos", Method, 0}, - {"(*SelectorExpr).End", Method, 0}, - {"(*SelectorExpr).Pos", Method, 0}, - {"(*SendStmt).End", Method, 0}, - {"(*SendStmt).Pos", Method, 0}, - {"(*SliceExpr).End", Method, 0}, - {"(*SliceExpr).Pos", Method, 0}, - {"(*StarExpr).End", Method, 0}, - {"(*StarExpr).Pos", Method, 0}, - {"(*StructType).End", Method, 0}, - {"(*StructType).Pos", Method, 0}, - {"(*SwitchStmt).End", Method, 0}, - {"(*SwitchStmt).Pos", Method, 0}, - {"(*TypeAssertExpr).End", Method, 0}, - {"(*TypeAssertExpr).Pos", Method, 0}, - {"(*TypeSpec).End", Method, 0}, - {"(*TypeSpec).Pos", Method, 0}, - {"(*TypeSwitchStmt).End", Method, 0}, - {"(*TypeSwitchStmt).Pos", Method, 0}, - {"(*UnaryExpr).End", Method, 0}, - {"(*UnaryExpr).Pos", Method, 0}, - {"(*ValueSpec).End", Method, 0}, - {"(*ValueSpec).Pos", Method, 0}, - {"(CommentMap).Comments", Method, 1}, - {"(CommentMap).Filter", Method, 1}, - {"(CommentMap).String", Method, 1}, - {"(CommentMap).Update", Method, 1}, - {"(ObjKind).String", Method, 0}, - {"ArrayType", Type, 0}, - {"ArrayType.Elt", Field, 0}, - {"ArrayType.Lbrack", Field, 0}, - {"ArrayType.Len", Field, 0}, - {"AssignStmt", Type, 0}, - {"AssignStmt.Lhs", Field, 0}, - {"AssignStmt.Rhs", Field, 0}, - {"AssignStmt.Tok", Field, 0}, - {"AssignStmt.TokPos", Field, 0}, - {"Bad", Const, 0}, - {"BadDecl", Type, 0}, - {"BadDecl.From", Field, 0}, - {"BadDecl.To", Field, 0}, - {"BadExpr", Type, 0}, - {"BadExpr.From", Field, 0}, - {"BadExpr.To", Field, 0}, - {"BadStmt", Type, 0}, - {"BadStmt.From", Field, 0}, - {"BadStmt.To", Field, 0}, - {"BasicLit", Type, 0}, - {"BasicLit.Kind", Field, 0}, - {"BasicLit.Value", Field, 0}, - {"BasicLit.ValuePos", Field, 0}, - {"BinaryExpr", Type, 0}, - {"BinaryExpr.Op", Field, 0}, - {"BinaryExpr.OpPos", Field, 0}, - {"BinaryExpr.X", Field, 0}, - {"BinaryExpr.Y", Field, 0}, - {"BlockStmt", Type, 0}, - {"BlockStmt.Lbrace", Field, 0}, - {"BlockStmt.List", Field, 0}, - {"BlockStmt.Rbrace", Field, 0}, - {"BranchStmt", Type, 0}, - {"BranchStmt.Label", Field, 0}, - {"BranchStmt.Tok", Field, 0}, - {"BranchStmt.TokPos", Field, 0}, - {"CallExpr", Type, 0}, - {"CallExpr.Args", Field, 0}, - {"CallExpr.Ellipsis", Field, 0}, - {"CallExpr.Fun", Field, 0}, - {"CallExpr.Lparen", Field, 0}, - {"CallExpr.Rparen", Field, 0}, - {"CaseClause", Type, 0}, - {"CaseClause.Body", Field, 0}, - {"CaseClause.Case", Field, 0}, - {"CaseClause.Colon", Field, 0}, - {"CaseClause.List", Field, 0}, - {"ChanDir", Type, 0}, - {"ChanType", Type, 0}, - {"ChanType.Arrow", Field, 1}, - {"ChanType.Begin", Field, 0}, - {"ChanType.Dir", Field, 0}, - {"ChanType.Value", Field, 0}, - {"CommClause", Type, 0}, - {"CommClause.Body", Field, 0}, - {"CommClause.Case", Field, 0}, - {"CommClause.Colon", Field, 0}, - {"CommClause.Comm", Field, 0}, - {"Comment", Type, 0}, - {"Comment.Slash", Field, 0}, - {"Comment.Text", Field, 0}, - {"CommentGroup", Type, 0}, - {"CommentGroup.List", Field, 0}, - {"CommentMap", Type, 1}, - {"CompositeLit", Type, 0}, - {"CompositeLit.Elts", Field, 0}, - {"CompositeLit.Incomplete", Field, 11}, - {"CompositeLit.Lbrace", Field, 0}, - {"CompositeLit.Rbrace", Field, 0}, - {"CompositeLit.Type", Field, 0}, - {"Con", Const, 0}, - {"Decl", Type, 0}, - {"DeclStmt", Type, 0}, - {"DeclStmt.Decl", Field, 0}, - {"DeferStmt", Type, 0}, - {"DeferStmt.Call", Field, 0}, - {"DeferStmt.Defer", Field, 0}, - {"Ellipsis", Type, 0}, - {"Ellipsis.Ellipsis", Field, 0}, - {"Ellipsis.Elt", Field, 0}, - {"EmptyStmt", Type, 0}, - {"EmptyStmt.Implicit", Field, 5}, - {"EmptyStmt.Semicolon", Field, 0}, - {"Expr", Type, 0}, - {"ExprStmt", Type, 0}, - {"ExprStmt.X", Field, 0}, - {"Field", Type, 0}, - {"Field.Comment", Field, 0}, - {"Field.Doc", Field, 0}, - {"Field.Names", Field, 0}, - {"Field.Tag", Field, 0}, - {"Field.Type", Field, 0}, - {"FieldFilter", Type, 0}, - {"FieldList", Type, 0}, - {"FieldList.Closing", Field, 0}, - {"FieldList.List", Field, 0}, - {"FieldList.Opening", Field, 0}, - {"File", Type, 0}, - {"File.Comments", Field, 0}, - {"File.Decls", Field, 0}, - {"File.Doc", Field, 0}, - {"File.FileEnd", Field, 20}, - {"File.FileStart", Field, 20}, - {"File.GoVersion", Field, 21}, - {"File.Imports", Field, 0}, - {"File.Name", Field, 0}, - {"File.Package", Field, 0}, - {"File.Scope", Field, 0}, - {"File.Unresolved", Field, 0}, - {"FileExports", Func, 0}, - {"Filter", Type, 0}, - {"FilterDecl", Func, 0}, - {"FilterFile", Func, 0}, - {"FilterFuncDuplicates", Const, 0}, - {"FilterImportDuplicates", Const, 0}, - {"FilterPackage", Func, 0}, - {"FilterUnassociatedComments", Const, 0}, - {"ForStmt", Type, 0}, - {"ForStmt.Body", Field, 0}, - {"ForStmt.Cond", Field, 0}, - {"ForStmt.For", Field, 0}, - {"ForStmt.Init", Field, 0}, - {"ForStmt.Post", Field, 0}, - {"Fprint", Func, 0}, - {"Fun", Const, 0}, - {"FuncDecl", Type, 0}, - {"FuncDecl.Body", Field, 0}, - {"FuncDecl.Doc", Field, 0}, - {"FuncDecl.Name", Field, 0}, - {"FuncDecl.Recv", Field, 0}, - {"FuncDecl.Type", Field, 0}, - {"FuncLit", Type, 0}, - {"FuncLit.Body", Field, 0}, - {"FuncLit.Type", Field, 0}, - {"FuncType", Type, 0}, - {"FuncType.Func", Field, 0}, - {"FuncType.Params", Field, 0}, - {"FuncType.Results", Field, 0}, - {"FuncType.TypeParams", Field, 18}, - {"GenDecl", Type, 0}, - {"GenDecl.Doc", Field, 0}, - {"GenDecl.Lparen", Field, 0}, - {"GenDecl.Rparen", Field, 0}, - {"GenDecl.Specs", Field, 0}, - {"GenDecl.Tok", Field, 0}, - {"GenDecl.TokPos", Field, 0}, - {"GoStmt", Type, 0}, - {"GoStmt.Call", Field, 0}, - {"GoStmt.Go", Field, 0}, - {"Ident", Type, 0}, - {"Ident.Name", Field, 0}, - {"Ident.NamePos", Field, 0}, - {"Ident.Obj", Field, 0}, - {"IfStmt", Type, 0}, - {"IfStmt.Body", Field, 0}, - {"IfStmt.Cond", Field, 0}, - {"IfStmt.Else", Field, 0}, - {"IfStmt.If", Field, 0}, - {"IfStmt.Init", Field, 0}, - {"ImportSpec", Type, 0}, - {"ImportSpec.Comment", Field, 0}, - {"ImportSpec.Doc", Field, 0}, - {"ImportSpec.EndPos", Field, 0}, - {"ImportSpec.Name", Field, 0}, - {"ImportSpec.Path", Field, 0}, - {"Importer", Type, 0}, - {"IncDecStmt", Type, 0}, - {"IncDecStmt.Tok", Field, 0}, - {"IncDecStmt.TokPos", Field, 0}, - {"IncDecStmt.X", Field, 0}, - {"IndexExpr", Type, 0}, - {"IndexExpr.Index", Field, 0}, - {"IndexExpr.Lbrack", Field, 0}, - {"IndexExpr.Rbrack", Field, 0}, - {"IndexExpr.X", Field, 0}, - {"IndexListExpr", Type, 18}, - {"IndexListExpr.Indices", Field, 18}, - {"IndexListExpr.Lbrack", Field, 18}, - {"IndexListExpr.Rbrack", Field, 18}, - {"IndexListExpr.X", Field, 18}, - {"Inspect", Func, 0}, - {"InterfaceType", Type, 0}, - {"InterfaceType.Incomplete", Field, 0}, - {"InterfaceType.Interface", Field, 0}, - {"InterfaceType.Methods", Field, 0}, - {"IsExported", Func, 0}, - {"IsGenerated", Func, 21}, - {"KeyValueExpr", Type, 0}, - {"KeyValueExpr.Colon", Field, 0}, - {"KeyValueExpr.Key", Field, 0}, - {"KeyValueExpr.Value", Field, 0}, - {"LabeledStmt", Type, 0}, - {"LabeledStmt.Colon", Field, 0}, - {"LabeledStmt.Label", Field, 0}, - {"LabeledStmt.Stmt", Field, 0}, - {"Lbl", Const, 0}, - {"MapType", Type, 0}, - {"MapType.Key", Field, 0}, - {"MapType.Map", Field, 0}, - {"MapType.Value", Field, 0}, - {"MergeMode", Type, 0}, - {"MergePackageFiles", Func, 0}, - {"NewCommentMap", Func, 1}, - {"NewIdent", Func, 0}, - {"NewObj", Func, 0}, - {"NewPackage", Func, 0}, - {"NewScope", Func, 0}, - {"Node", Type, 0}, - {"NotNilFilter", Func, 0}, - {"ObjKind", Type, 0}, - {"Object", Type, 0}, - {"Object.Data", Field, 0}, - {"Object.Decl", Field, 0}, - {"Object.Kind", Field, 0}, - {"Object.Name", Field, 0}, - {"Object.Type", Field, 0}, - {"Package", Type, 0}, - {"Package.Files", Field, 0}, - {"Package.Imports", Field, 0}, - {"Package.Name", Field, 0}, - {"Package.Scope", Field, 0}, - {"PackageExports", Func, 0}, - {"ParenExpr", Type, 0}, - {"ParenExpr.Lparen", Field, 0}, - {"ParenExpr.Rparen", Field, 0}, - {"ParenExpr.X", Field, 0}, - {"Pkg", Const, 0}, - {"Print", Func, 0}, - {"RECV", Const, 0}, - {"RangeStmt", Type, 0}, - {"RangeStmt.Body", Field, 0}, - {"RangeStmt.For", Field, 0}, - {"RangeStmt.Key", Field, 0}, - {"RangeStmt.Range", Field, 20}, - {"RangeStmt.Tok", Field, 0}, - {"RangeStmt.TokPos", Field, 0}, - {"RangeStmt.Value", Field, 0}, - {"RangeStmt.X", Field, 0}, - {"ReturnStmt", Type, 0}, - {"ReturnStmt.Results", Field, 0}, - {"ReturnStmt.Return", Field, 0}, - {"SEND", Const, 0}, - {"Scope", Type, 0}, - {"Scope.Objects", Field, 0}, - {"Scope.Outer", Field, 0}, - {"SelectStmt", Type, 0}, - {"SelectStmt.Body", Field, 0}, - {"SelectStmt.Select", Field, 0}, - {"SelectorExpr", Type, 0}, - {"SelectorExpr.Sel", Field, 0}, - {"SelectorExpr.X", Field, 0}, - {"SendStmt", Type, 0}, - {"SendStmt.Arrow", Field, 0}, - {"SendStmt.Chan", Field, 0}, - {"SendStmt.Value", Field, 0}, - {"SliceExpr", Type, 0}, - {"SliceExpr.High", Field, 0}, - {"SliceExpr.Lbrack", Field, 0}, - {"SliceExpr.Low", Field, 0}, - {"SliceExpr.Max", Field, 2}, - {"SliceExpr.Rbrack", Field, 0}, - {"SliceExpr.Slice3", Field, 2}, - {"SliceExpr.X", Field, 0}, - {"SortImports", Func, 0}, - {"Spec", Type, 0}, - {"StarExpr", Type, 0}, - {"StarExpr.Star", Field, 0}, - {"StarExpr.X", Field, 0}, - {"Stmt", Type, 0}, - {"StructType", Type, 0}, - {"StructType.Fields", Field, 0}, - {"StructType.Incomplete", Field, 0}, - {"StructType.Struct", Field, 0}, - {"SwitchStmt", Type, 0}, - {"SwitchStmt.Body", Field, 0}, - {"SwitchStmt.Init", Field, 0}, - {"SwitchStmt.Switch", Field, 0}, - {"SwitchStmt.Tag", Field, 0}, - {"Typ", Const, 0}, - {"TypeAssertExpr", Type, 0}, - {"TypeAssertExpr.Lparen", Field, 2}, - {"TypeAssertExpr.Rparen", Field, 2}, - {"TypeAssertExpr.Type", Field, 0}, - {"TypeAssertExpr.X", Field, 0}, - {"TypeSpec", Type, 0}, - {"TypeSpec.Assign", Field, 9}, - {"TypeSpec.Comment", Field, 0}, - {"TypeSpec.Doc", Field, 0}, - {"TypeSpec.Name", Field, 0}, - {"TypeSpec.Type", Field, 0}, - {"TypeSpec.TypeParams", Field, 18}, - {"TypeSwitchStmt", Type, 0}, - {"TypeSwitchStmt.Assign", Field, 0}, - {"TypeSwitchStmt.Body", Field, 0}, - {"TypeSwitchStmt.Init", Field, 0}, - {"TypeSwitchStmt.Switch", Field, 0}, - {"UnaryExpr", Type, 0}, - {"UnaryExpr.Op", Field, 0}, - {"UnaryExpr.OpPos", Field, 0}, - {"UnaryExpr.X", Field, 0}, - {"Unparen", Func, 22}, - {"ValueSpec", Type, 0}, - {"ValueSpec.Comment", Field, 0}, - {"ValueSpec.Doc", Field, 0}, - {"ValueSpec.Names", Field, 0}, - {"ValueSpec.Type", Field, 0}, - {"ValueSpec.Values", Field, 0}, - {"Var", Const, 0}, - {"Visitor", Type, 0}, - {"Walk", Func, 0}, - }, - "go/build": { - {"(*Context).Import", Method, 0}, - {"(*Context).ImportDir", Method, 0}, - {"(*Context).MatchFile", Method, 2}, - {"(*Context).SrcDirs", Method, 0}, - {"(*MultiplePackageError).Error", Method, 4}, - {"(*NoGoError).Error", Method, 0}, - {"(*Package).IsCommand", Method, 0}, - {"AllowBinary", Const, 0}, - {"ArchChar", Func, 0}, - {"Context", Type, 0}, - {"Context.BuildTags", Field, 0}, - {"Context.CgoEnabled", Field, 0}, - {"Context.Compiler", Field, 0}, - {"Context.Dir", Field, 14}, - {"Context.GOARCH", Field, 0}, - {"Context.GOOS", Field, 0}, - {"Context.GOPATH", Field, 0}, - {"Context.GOROOT", Field, 0}, - {"Context.HasSubdir", Field, 0}, - {"Context.InstallSuffix", Field, 1}, - {"Context.IsAbsPath", Field, 0}, - {"Context.IsDir", Field, 0}, - {"Context.JoinPath", Field, 0}, - {"Context.OpenFile", Field, 0}, - {"Context.ReadDir", Field, 0}, - {"Context.ReleaseTags", Field, 1}, - {"Context.SplitPathList", Field, 0}, - {"Context.ToolTags", Field, 17}, - {"Context.UseAllFiles", Field, 0}, - {"Default", Var, 0}, - {"Directive", Type, 21}, - {"Directive.Pos", Field, 21}, - {"Directive.Text", Field, 21}, - {"FindOnly", Const, 0}, - {"IgnoreVendor", Const, 6}, - {"Import", Func, 0}, - {"ImportComment", Const, 4}, - {"ImportDir", Func, 0}, - {"ImportMode", Type, 0}, - {"IsLocalImport", Func, 0}, - {"MultiplePackageError", Type, 4}, - {"MultiplePackageError.Dir", Field, 4}, - {"MultiplePackageError.Files", Field, 4}, - {"MultiplePackageError.Packages", Field, 4}, - {"NoGoError", Type, 0}, - {"NoGoError.Dir", Field, 0}, - {"Package", Type, 0}, - {"Package.AllTags", Field, 2}, - {"Package.BinDir", Field, 0}, - {"Package.BinaryOnly", Field, 7}, - {"Package.CFiles", Field, 0}, - {"Package.CXXFiles", Field, 2}, - {"Package.CgoCFLAGS", Field, 0}, - {"Package.CgoCPPFLAGS", Field, 2}, - {"Package.CgoCXXFLAGS", Field, 2}, - {"Package.CgoFFLAGS", Field, 7}, - {"Package.CgoFiles", Field, 0}, - {"Package.CgoLDFLAGS", Field, 0}, - {"Package.CgoPkgConfig", Field, 0}, - {"Package.ConflictDir", Field, 2}, - {"Package.Dir", Field, 0}, - {"Package.Directives", Field, 21}, - {"Package.Doc", Field, 0}, - {"Package.EmbedPatternPos", Field, 16}, - {"Package.EmbedPatterns", Field, 16}, - {"Package.FFiles", Field, 7}, - {"Package.GoFiles", Field, 0}, - {"Package.Goroot", Field, 0}, - {"Package.HFiles", Field, 0}, - {"Package.IgnoredGoFiles", Field, 1}, - {"Package.IgnoredOtherFiles", Field, 16}, - {"Package.ImportComment", Field, 4}, - {"Package.ImportPath", Field, 0}, - {"Package.ImportPos", Field, 0}, - {"Package.Imports", Field, 0}, - {"Package.InvalidGoFiles", Field, 6}, - {"Package.MFiles", Field, 3}, - {"Package.Name", Field, 0}, - {"Package.PkgObj", Field, 0}, - {"Package.PkgRoot", Field, 0}, - {"Package.PkgTargetRoot", Field, 5}, - {"Package.Root", Field, 0}, - {"Package.SFiles", Field, 0}, - {"Package.SrcRoot", Field, 0}, - {"Package.SwigCXXFiles", Field, 1}, - {"Package.SwigFiles", Field, 1}, - {"Package.SysoFiles", Field, 0}, - {"Package.TestDirectives", Field, 21}, - {"Package.TestEmbedPatternPos", Field, 16}, - {"Package.TestEmbedPatterns", Field, 16}, - {"Package.TestGoFiles", Field, 0}, - {"Package.TestImportPos", Field, 0}, - {"Package.TestImports", Field, 0}, - {"Package.XTestDirectives", Field, 21}, - {"Package.XTestEmbedPatternPos", Field, 16}, - {"Package.XTestEmbedPatterns", Field, 16}, - {"Package.XTestGoFiles", Field, 0}, - {"Package.XTestImportPos", Field, 0}, - {"Package.XTestImports", Field, 0}, - {"ToolDir", Var, 0}, - }, - "go/build/constraint": { - {"(*AndExpr).Eval", Method, 16}, - {"(*AndExpr).String", Method, 16}, - {"(*NotExpr).Eval", Method, 16}, - {"(*NotExpr).String", Method, 16}, - {"(*OrExpr).Eval", Method, 16}, - {"(*OrExpr).String", Method, 16}, - {"(*SyntaxError).Error", Method, 16}, - {"(*TagExpr).Eval", Method, 16}, - {"(*TagExpr).String", Method, 16}, - {"AndExpr", Type, 16}, - {"AndExpr.X", Field, 16}, - {"AndExpr.Y", Field, 16}, - {"Expr", Type, 16}, - {"GoVersion", Func, 21}, - {"IsGoBuild", Func, 16}, - {"IsPlusBuild", Func, 16}, - {"NotExpr", Type, 16}, - {"NotExpr.X", Field, 16}, - {"OrExpr", Type, 16}, - {"OrExpr.X", Field, 16}, - {"OrExpr.Y", Field, 16}, - {"Parse", Func, 16}, - {"PlusBuildLines", Func, 16}, - {"SyntaxError", Type, 16}, - {"SyntaxError.Err", Field, 16}, - {"SyntaxError.Offset", Field, 16}, - {"TagExpr", Type, 16}, - {"TagExpr.Tag", Field, 16}, - }, - "go/constant": { - {"(Kind).String", Method, 18}, - {"BinaryOp", Func, 5}, - {"BitLen", Func, 5}, - {"Bool", Const, 5}, - {"BoolVal", Func, 5}, - {"Bytes", Func, 5}, - {"Compare", Func, 5}, - {"Complex", Const, 5}, - {"Denom", Func, 5}, - {"Float", Const, 5}, - {"Float32Val", Func, 5}, - {"Float64Val", Func, 5}, - {"Imag", Func, 5}, - {"Int", Const, 5}, - {"Int64Val", Func, 5}, - {"Kind", Type, 5}, - {"Make", Func, 13}, - {"MakeBool", Func, 5}, - {"MakeFloat64", Func, 5}, - {"MakeFromBytes", Func, 5}, - {"MakeFromLiteral", Func, 5}, - {"MakeImag", Func, 5}, - {"MakeInt64", Func, 5}, - {"MakeString", Func, 5}, - {"MakeUint64", Func, 5}, - {"MakeUnknown", Func, 5}, - {"Num", Func, 5}, - {"Real", Func, 5}, - {"Shift", Func, 5}, - {"Sign", Func, 5}, - {"String", Const, 5}, - {"StringVal", Func, 5}, - {"ToComplex", Func, 6}, - {"ToFloat", Func, 6}, - {"ToInt", Func, 6}, - {"Uint64Val", Func, 5}, - {"UnaryOp", Func, 5}, - {"Unknown", Const, 5}, - {"Val", Func, 13}, - {"Value", Type, 5}, - }, - "go/doc": { - {"(*Package).Filter", Method, 0}, - {"(*Package).HTML", Method, 19}, - {"(*Package).Markdown", Method, 19}, - {"(*Package).Parser", Method, 19}, - {"(*Package).Printer", Method, 19}, - {"(*Package).Synopsis", Method, 19}, - {"(*Package).Text", Method, 19}, - {"AllDecls", Const, 0}, - {"AllMethods", Const, 0}, - {"Example", Type, 0}, - {"Example.Code", Field, 0}, - {"Example.Comments", Field, 0}, - {"Example.Doc", Field, 0}, - {"Example.EmptyOutput", Field, 1}, - {"Example.Name", Field, 0}, - {"Example.Order", Field, 1}, - {"Example.Output", Field, 0}, - {"Example.Play", Field, 1}, - {"Example.Suffix", Field, 14}, - {"Example.Unordered", Field, 7}, - {"Examples", Func, 0}, - {"Filter", Type, 0}, - {"Func", Type, 0}, - {"Func.Decl", Field, 0}, - {"Func.Doc", Field, 0}, - {"Func.Examples", Field, 14}, - {"Func.Level", Field, 0}, - {"Func.Name", Field, 0}, - {"Func.Orig", Field, 0}, - {"Func.Recv", Field, 0}, - {"IllegalPrefixes", Var, 1}, - {"IsPredeclared", Func, 8}, - {"Mode", Type, 0}, - {"New", Func, 0}, - {"NewFromFiles", Func, 14}, - {"Note", Type, 1}, - {"Note.Body", Field, 1}, - {"Note.End", Field, 1}, - {"Note.Pos", Field, 1}, - {"Note.UID", Field, 1}, - {"Package", Type, 0}, - {"Package.Bugs", Field, 0}, - {"Package.Consts", Field, 0}, - {"Package.Doc", Field, 0}, - {"Package.Examples", Field, 14}, - {"Package.Filenames", Field, 0}, - {"Package.Funcs", Field, 0}, - {"Package.ImportPath", Field, 0}, - {"Package.Imports", Field, 0}, - {"Package.Name", Field, 0}, - {"Package.Notes", Field, 1}, - {"Package.Types", Field, 0}, - {"Package.Vars", Field, 0}, - {"PreserveAST", Const, 12}, - {"Synopsis", Func, 0}, - {"ToHTML", Func, 0}, - {"ToText", Func, 0}, - {"Type", Type, 0}, - {"Type.Consts", Field, 0}, - {"Type.Decl", Field, 0}, - {"Type.Doc", Field, 0}, - {"Type.Examples", Field, 14}, - {"Type.Funcs", Field, 0}, - {"Type.Methods", Field, 0}, - {"Type.Name", Field, 0}, - {"Type.Vars", Field, 0}, - {"Value", Type, 0}, - {"Value.Decl", Field, 0}, - {"Value.Doc", Field, 0}, - {"Value.Names", Field, 0}, - }, - "go/doc/comment": { - {"(*DocLink).DefaultURL", Method, 19}, - {"(*Heading).DefaultID", Method, 19}, - {"(*List).BlankBefore", Method, 19}, - {"(*List).BlankBetween", Method, 19}, - {"(*Parser).Parse", Method, 19}, - {"(*Printer).Comment", Method, 19}, - {"(*Printer).HTML", Method, 19}, - {"(*Printer).Markdown", Method, 19}, - {"(*Printer).Text", Method, 19}, - {"Block", Type, 19}, - {"Code", Type, 19}, - {"Code.Text", Field, 19}, - {"DefaultLookupPackage", Func, 19}, - {"Doc", Type, 19}, - {"Doc.Content", Field, 19}, - {"Doc.Links", Field, 19}, - {"DocLink", Type, 19}, - {"DocLink.ImportPath", Field, 19}, - {"DocLink.Name", Field, 19}, - {"DocLink.Recv", Field, 19}, - {"DocLink.Text", Field, 19}, - {"Heading", Type, 19}, - {"Heading.Text", Field, 19}, - {"Italic", Type, 19}, - {"Link", Type, 19}, - {"Link.Auto", Field, 19}, - {"Link.Text", Field, 19}, - {"Link.URL", Field, 19}, - {"LinkDef", Type, 19}, - {"LinkDef.Text", Field, 19}, - {"LinkDef.URL", Field, 19}, - {"LinkDef.Used", Field, 19}, - {"List", Type, 19}, - {"List.ForceBlankBefore", Field, 19}, - {"List.ForceBlankBetween", Field, 19}, - {"List.Items", Field, 19}, - {"ListItem", Type, 19}, - {"ListItem.Content", Field, 19}, - {"ListItem.Number", Field, 19}, - {"Paragraph", Type, 19}, - {"Paragraph.Text", Field, 19}, - {"Parser", Type, 19}, - {"Parser.LookupPackage", Field, 19}, - {"Parser.LookupSym", Field, 19}, - {"Parser.Words", Field, 19}, - {"Plain", Type, 19}, - {"Printer", Type, 19}, - {"Printer.DocLinkBaseURL", Field, 19}, - {"Printer.DocLinkURL", Field, 19}, - {"Printer.HeadingID", Field, 19}, - {"Printer.HeadingLevel", Field, 19}, - {"Printer.TextCodePrefix", Field, 19}, - {"Printer.TextPrefix", Field, 19}, - {"Printer.TextWidth", Field, 19}, - {"Text", Type, 19}, - }, - "go/format": { - {"Node", Func, 1}, - {"Source", Func, 1}, - }, - "go/importer": { - {"Default", Func, 5}, - {"For", Func, 5}, - {"ForCompiler", Func, 12}, - {"Lookup", Type, 5}, - }, - "go/parser": { - {"AllErrors", Const, 1}, - {"DeclarationErrors", Const, 0}, - {"ImportsOnly", Const, 0}, - {"Mode", Type, 0}, - {"PackageClauseOnly", Const, 0}, - {"ParseComments", Const, 0}, - {"ParseDir", Func, 0}, - {"ParseExpr", Func, 0}, - {"ParseExprFrom", Func, 5}, - {"ParseFile", Func, 0}, - {"SkipObjectResolution", Const, 17}, - {"SpuriousErrors", Const, 0}, - {"Trace", Const, 0}, - }, - "go/printer": { - {"(*Config).Fprint", Method, 0}, - {"CommentedNode", Type, 0}, - {"CommentedNode.Comments", Field, 0}, - {"CommentedNode.Node", Field, 0}, - {"Config", Type, 0}, - {"Config.Indent", Field, 1}, - {"Config.Mode", Field, 0}, - {"Config.Tabwidth", Field, 0}, - {"Fprint", Func, 0}, - {"Mode", Type, 0}, - {"RawFormat", Const, 0}, - {"SourcePos", Const, 0}, - {"TabIndent", Const, 0}, - {"UseSpaces", Const, 0}, - }, - "go/scanner": { - {"(*ErrorList).Add", Method, 0}, - {"(*ErrorList).RemoveMultiples", Method, 0}, - {"(*ErrorList).Reset", Method, 0}, - {"(*Scanner).Init", Method, 0}, - {"(*Scanner).Scan", Method, 0}, - {"(Error).Error", Method, 0}, - {"(ErrorList).Err", Method, 0}, - {"(ErrorList).Error", Method, 0}, - {"(ErrorList).Len", Method, 0}, - {"(ErrorList).Less", Method, 0}, - {"(ErrorList).Sort", Method, 0}, - {"(ErrorList).Swap", Method, 0}, - {"Error", Type, 0}, - {"Error.Msg", Field, 0}, - {"Error.Pos", Field, 0}, - {"ErrorHandler", Type, 0}, - {"ErrorList", Type, 0}, - {"Mode", Type, 0}, - {"PrintError", Func, 0}, - {"ScanComments", Const, 0}, - {"Scanner", Type, 0}, - {"Scanner.ErrorCount", Field, 0}, - }, - "go/token": { - {"(*File).AddLine", Method, 0}, - {"(*File).AddLineColumnInfo", Method, 11}, - {"(*File).AddLineInfo", Method, 0}, - {"(*File).Base", Method, 0}, - {"(*File).Line", Method, 0}, - {"(*File).LineCount", Method, 0}, - {"(*File).LineStart", Method, 12}, - {"(*File).Lines", Method, 21}, - {"(*File).MergeLine", Method, 2}, - {"(*File).Name", Method, 0}, - {"(*File).Offset", Method, 0}, - {"(*File).Pos", Method, 0}, - {"(*File).Position", Method, 0}, - {"(*File).PositionFor", Method, 4}, - {"(*File).SetLines", Method, 0}, - {"(*File).SetLinesForContent", Method, 0}, - {"(*File).Size", Method, 0}, - {"(*FileSet).AddFile", Method, 0}, - {"(*FileSet).Base", Method, 0}, - {"(*FileSet).File", Method, 0}, - {"(*FileSet).Iterate", Method, 0}, - {"(*FileSet).Position", Method, 0}, - {"(*FileSet).PositionFor", Method, 4}, - {"(*FileSet).Read", Method, 0}, - {"(*FileSet).RemoveFile", Method, 20}, - {"(*FileSet).Write", Method, 0}, - {"(*Position).IsValid", Method, 0}, - {"(Pos).IsValid", Method, 0}, - {"(Position).String", Method, 0}, - {"(Token).IsKeyword", Method, 0}, - {"(Token).IsLiteral", Method, 0}, - {"(Token).IsOperator", Method, 0}, - {"(Token).Precedence", Method, 0}, - {"(Token).String", Method, 0}, - {"ADD", Const, 0}, - {"ADD_ASSIGN", Const, 0}, - {"AND", Const, 0}, - {"AND_ASSIGN", Const, 0}, - {"AND_NOT", Const, 0}, - {"AND_NOT_ASSIGN", Const, 0}, - {"ARROW", Const, 0}, - {"ASSIGN", Const, 0}, - {"BREAK", Const, 0}, - {"CASE", Const, 0}, - {"CHAN", Const, 0}, - {"CHAR", Const, 0}, - {"COLON", Const, 0}, - {"COMMA", Const, 0}, - {"COMMENT", Const, 0}, - {"CONST", Const, 0}, - {"CONTINUE", Const, 0}, - {"DEC", Const, 0}, - {"DEFAULT", Const, 0}, - {"DEFER", Const, 0}, - {"DEFINE", Const, 0}, - {"ELLIPSIS", Const, 0}, - {"ELSE", Const, 0}, - {"EOF", Const, 0}, - {"EQL", Const, 0}, - {"FALLTHROUGH", Const, 0}, - {"FLOAT", Const, 0}, - {"FOR", Const, 0}, - {"FUNC", Const, 0}, - {"File", Type, 0}, - {"FileSet", Type, 0}, - {"GEQ", Const, 0}, - {"GO", Const, 0}, - {"GOTO", Const, 0}, - {"GTR", Const, 0}, - {"HighestPrec", Const, 0}, - {"IDENT", Const, 0}, - {"IF", Const, 0}, - {"ILLEGAL", Const, 0}, - {"IMAG", Const, 0}, - {"IMPORT", Const, 0}, - {"INC", Const, 0}, - {"INT", Const, 0}, - {"INTERFACE", Const, 0}, - {"IsExported", Func, 13}, - {"IsIdentifier", Func, 13}, - {"IsKeyword", Func, 13}, - {"LAND", Const, 0}, - {"LBRACE", Const, 0}, - {"LBRACK", Const, 0}, - {"LEQ", Const, 0}, - {"LOR", Const, 0}, - {"LPAREN", Const, 0}, - {"LSS", Const, 0}, - {"Lookup", Func, 0}, - {"LowestPrec", Const, 0}, - {"MAP", Const, 0}, - {"MUL", Const, 0}, - {"MUL_ASSIGN", Const, 0}, - {"NEQ", Const, 0}, - {"NOT", Const, 0}, - {"NewFileSet", Func, 0}, - {"NoPos", Const, 0}, - {"OR", Const, 0}, - {"OR_ASSIGN", Const, 0}, - {"PACKAGE", Const, 0}, - {"PERIOD", Const, 0}, - {"Pos", Type, 0}, - {"Position", Type, 0}, - {"Position.Column", Field, 0}, - {"Position.Filename", Field, 0}, - {"Position.Line", Field, 0}, - {"Position.Offset", Field, 0}, - {"QUO", Const, 0}, - {"QUO_ASSIGN", Const, 0}, - {"RANGE", Const, 0}, - {"RBRACE", Const, 0}, - {"RBRACK", Const, 0}, - {"REM", Const, 0}, - {"REM_ASSIGN", Const, 0}, - {"RETURN", Const, 0}, - {"RPAREN", Const, 0}, - {"SELECT", Const, 0}, - {"SEMICOLON", Const, 0}, - {"SHL", Const, 0}, - {"SHL_ASSIGN", Const, 0}, - {"SHR", Const, 0}, - {"SHR_ASSIGN", Const, 0}, - {"STRING", Const, 0}, - {"STRUCT", Const, 0}, - {"SUB", Const, 0}, - {"SUB_ASSIGN", Const, 0}, - {"SWITCH", Const, 0}, - {"TILDE", Const, 18}, - {"TYPE", Const, 0}, - {"Token", Type, 0}, - {"UnaryPrec", Const, 0}, - {"VAR", Const, 0}, - {"XOR", Const, 0}, - {"XOR_ASSIGN", Const, 0}, - }, - "go/types": { - {"(*Alias).Obj", Method, 22}, - {"(*Alias).String", Method, 22}, - {"(*Alias).Underlying", Method, 22}, - {"(*ArgumentError).Error", Method, 18}, - {"(*ArgumentError).Unwrap", Method, 18}, - {"(*Array).Elem", Method, 5}, - {"(*Array).Len", Method, 5}, - {"(*Array).String", Method, 5}, - {"(*Array).Underlying", Method, 5}, - {"(*Basic).Info", Method, 5}, - {"(*Basic).Kind", Method, 5}, - {"(*Basic).Name", Method, 5}, - {"(*Basic).String", Method, 5}, - {"(*Basic).Underlying", Method, 5}, - {"(*Builtin).Exported", Method, 5}, - {"(*Builtin).Id", Method, 5}, - {"(*Builtin).Name", Method, 5}, - {"(*Builtin).Parent", Method, 5}, - {"(*Builtin).Pkg", Method, 5}, - {"(*Builtin).Pos", Method, 5}, - {"(*Builtin).String", Method, 5}, - {"(*Builtin).Type", Method, 5}, - {"(*Chan).Dir", Method, 5}, - {"(*Chan).Elem", Method, 5}, - {"(*Chan).String", Method, 5}, - {"(*Chan).Underlying", Method, 5}, - {"(*Checker).Files", Method, 5}, - {"(*Config).Check", Method, 5}, - {"(*Const).Exported", Method, 5}, - {"(*Const).Id", Method, 5}, - {"(*Const).Name", Method, 5}, - {"(*Const).Parent", Method, 5}, - {"(*Const).Pkg", Method, 5}, - {"(*Const).Pos", Method, 5}, - {"(*Const).String", Method, 5}, - {"(*Const).Type", Method, 5}, - {"(*Const).Val", Method, 5}, - {"(*Func).Exported", Method, 5}, - {"(*Func).FullName", Method, 5}, - {"(*Func).Id", Method, 5}, - {"(*Func).Name", Method, 5}, - {"(*Func).Origin", Method, 19}, - {"(*Func).Parent", Method, 5}, - {"(*Func).Pkg", Method, 5}, - {"(*Func).Pos", Method, 5}, - {"(*Func).Scope", Method, 5}, - {"(*Func).String", Method, 5}, - {"(*Func).Type", Method, 5}, - {"(*Info).ObjectOf", Method, 5}, - {"(*Info).PkgNameOf", Method, 22}, - {"(*Info).TypeOf", Method, 5}, - {"(*Initializer).String", Method, 5}, - {"(*Interface).Complete", Method, 5}, - {"(*Interface).Embedded", Method, 5}, - {"(*Interface).EmbeddedType", Method, 11}, - {"(*Interface).Empty", Method, 5}, - {"(*Interface).ExplicitMethod", Method, 5}, - {"(*Interface).IsComparable", Method, 18}, - {"(*Interface).IsImplicit", Method, 18}, - {"(*Interface).IsMethodSet", Method, 18}, - {"(*Interface).MarkImplicit", Method, 18}, - {"(*Interface).Method", Method, 5}, - {"(*Interface).NumEmbeddeds", Method, 5}, - {"(*Interface).NumExplicitMethods", Method, 5}, - {"(*Interface).NumMethods", Method, 5}, - {"(*Interface).String", Method, 5}, - {"(*Interface).Underlying", Method, 5}, - {"(*Label).Exported", Method, 5}, - {"(*Label).Id", Method, 5}, - {"(*Label).Name", Method, 5}, - {"(*Label).Parent", Method, 5}, - {"(*Label).Pkg", Method, 5}, - {"(*Label).Pos", Method, 5}, - {"(*Label).String", Method, 5}, - {"(*Label).Type", Method, 5}, - {"(*Map).Elem", Method, 5}, - {"(*Map).Key", Method, 5}, - {"(*Map).String", Method, 5}, - {"(*Map).Underlying", Method, 5}, - {"(*MethodSet).At", Method, 5}, - {"(*MethodSet).Len", Method, 5}, - {"(*MethodSet).Lookup", Method, 5}, - {"(*MethodSet).String", Method, 5}, - {"(*Named).AddMethod", Method, 5}, - {"(*Named).Method", Method, 5}, - {"(*Named).NumMethods", Method, 5}, - {"(*Named).Obj", Method, 5}, - {"(*Named).Origin", Method, 18}, - {"(*Named).SetTypeParams", Method, 18}, - {"(*Named).SetUnderlying", Method, 5}, - {"(*Named).String", Method, 5}, - {"(*Named).TypeArgs", Method, 18}, - {"(*Named).TypeParams", Method, 18}, - {"(*Named).Underlying", Method, 5}, - {"(*Nil).Exported", Method, 5}, - {"(*Nil).Id", Method, 5}, - {"(*Nil).Name", Method, 5}, - {"(*Nil).Parent", Method, 5}, - {"(*Nil).Pkg", Method, 5}, - {"(*Nil).Pos", Method, 5}, - {"(*Nil).String", Method, 5}, - {"(*Nil).Type", Method, 5}, - {"(*Package).Complete", Method, 5}, - {"(*Package).GoVersion", Method, 21}, - {"(*Package).Imports", Method, 5}, - {"(*Package).MarkComplete", Method, 5}, - {"(*Package).Name", Method, 5}, - {"(*Package).Path", Method, 5}, - {"(*Package).Scope", Method, 5}, - {"(*Package).SetImports", Method, 5}, - {"(*Package).SetName", Method, 6}, - {"(*Package).String", Method, 5}, - {"(*PkgName).Exported", Method, 5}, - {"(*PkgName).Id", Method, 5}, - {"(*PkgName).Imported", Method, 5}, - {"(*PkgName).Name", Method, 5}, - {"(*PkgName).Parent", Method, 5}, - {"(*PkgName).Pkg", Method, 5}, - {"(*PkgName).Pos", Method, 5}, - {"(*PkgName).String", Method, 5}, - {"(*PkgName).Type", Method, 5}, - {"(*Pointer).Elem", Method, 5}, - {"(*Pointer).String", Method, 5}, - {"(*Pointer).Underlying", Method, 5}, - {"(*Scope).Child", Method, 5}, - {"(*Scope).Contains", Method, 5}, - {"(*Scope).End", Method, 5}, - {"(*Scope).Innermost", Method, 5}, - {"(*Scope).Insert", Method, 5}, - {"(*Scope).Len", Method, 5}, - {"(*Scope).Lookup", Method, 5}, - {"(*Scope).LookupParent", Method, 5}, - {"(*Scope).Names", Method, 5}, - {"(*Scope).NumChildren", Method, 5}, - {"(*Scope).Parent", Method, 5}, - {"(*Scope).Pos", Method, 5}, - {"(*Scope).String", Method, 5}, - {"(*Scope).WriteTo", Method, 5}, - {"(*Selection).Index", Method, 5}, - {"(*Selection).Indirect", Method, 5}, - {"(*Selection).Kind", Method, 5}, - {"(*Selection).Obj", Method, 5}, - {"(*Selection).Recv", Method, 5}, - {"(*Selection).String", Method, 5}, - {"(*Selection).Type", Method, 5}, - {"(*Signature).Params", Method, 5}, - {"(*Signature).Recv", Method, 5}, - {"(*Signature).RecvTypeParams", Method, 18}, - {"(*Signature).Results", Method, 5}, - {"(*Signature).String", Method, 5}, - {"(*Signature).TypeParams", Method, 18}, - {"(*Signature).Underlying", Method, 5}, - {"(*Signature).Variadic", Method, 5}, - {"(*Slice).Elem", Method, 5}, - {"(*Slice).String", Method, 5}, - {"(*Slice).Underlying", Method, 5}, - {"(*StdSizes).Alignof", Method, 5}, - {"(*StdSizes).Offsetsof", Method, 5}, - {"(*StdSizes).Sizeof", Method, 5}, - {"(*Struct).Field", Method, 5}, - {"(*Struct).NumFields", Method, 5}, - {"(*Struct).String", Method, 5}, - {"(*Struct).Tag", Method, 5}, - {"(*Struct).Underlying", Method, 5}, - {"(*Term).String", Method, 18}, - {"(*Term).Tilde", Method, 18}, - {"(*Term).Type", Method, 18}, - {"(*Tuple).At", Method, 5}, - {"(*Tuple).Len", Method, 5}, - {"(*Tuple).String", Method, 5}, - {"(*Tuple).Underlying", Method, 5}, - {"(*TypeList).At", Method, 18}, - {"(*TypeList).Len", Method, 18}, - {"(*TypeName).Exported", Method, 5}, - {"(*TypeName).Id", Method, 5}, - {"(*TypeName).IsAlias", Method, 9}, - {"(*TypeName).Name", Method, 5}, - {"(*TypeName).Parent", Method, 5}, - {"(*TypeName).Pkg", Method, 5}, - {"(*TypeName).Pos", Method, 5}, - {"(*TypeName).String", Method, 5}, - {"(*TypeName).Type", Method, 5}, - {"(*TypeParam).Constraint", Method, 18}, - {"(*TypeParam).Index", Method, 18}, - {"(*TypeParam).Obj", Method, 18}, - {"(*TypeParam).SetConstraint", Method, 18}, - {"(*TypeParam).String", Method, 18}, - {"(*TypeParam).Underlying", Method, 18}, - {"(*TypeParamList).At", Method, 18}, - {"(*TypeParamList).Len", Method, 18}, - {"(*Union).Len", Method, 18}, - {"(*Union).String", Method, 18}, - {"(*Union).Term", Method, 18}, - {"(*Union).Underlying", Method, 18}, - {"(*Var).Anonymous", Method, 5}, - {"(*Var).Embedded", Method, 11}, - {"(*Var).Exported", Method, 5}, - {"(*Var).Id", Method, 5}, - {"(*Var).IsField", Method, 5}, - {"(*Var).Name", Method, 5}, - {"(*Var).Origin", Method, 19}, - {"(*Var).Parent", Method, 5}, - {"(*Var).Pkg", Method, 5}, - {"(*Var).Pos", Method, 5}, - {"(*Var).String", Method, 5}, - {"(*Var).Type", Method, 5}, - {"(Checker).ObjectOf", Method, 5}, - {"(Checker).PkgNameOf", Method, 22}, - {"(Checker).TypeOf", Method, 5}, - {"(Error).Error", Method, 5}, - {"(TypeAndValue).Addressable", Method, 5}, - {"(TypeAndValue).Assignable", Method, 5}, - {"(TypeAndValue).HasOk", Method, 5}, - {"(TypeAndValue).IsBuiltin", Method, 5}, - {"(TypeAndValue).IsNil", Method, 5}, - {"(TypeAndValue).IsType", Method, 5}, - {"(TypeAndValue).IsValue", Method, 5}, - {"(TypeAndValue).IsVoid", Method, 5}, - {"Alias", Type, 22}, - {"ArgumentError", Type, 18}, - {"ArgumentError.Err", Field, 18}, - {"ArgumentError.Index", Field, 18}, - {"Array", Type, 5}, - {"AssertableTo", Func, 5}, - {"AssignableTo", Func, 5}, - {"Basic", Type, 5}, - {"BasicInfo", Type, 5}, - {"BasicKind", Type, 5}, - {"Bool", Const, 5}, - {"Builtin", Type, 5}, - {"Byte", Const, 5}, - {"Chan", Type, 5}, - {"ChanDir", Type, 5}, - {"CheckExpr", Func, 13}, - {"Checker", Type, 5}, - {"Checker.Info", Field, 5}, - {"Comparable", Func, 5}, - {"Complex128", Const, 5}, - {"Complex64", Const, 5}, - {"Config", Type, 5}, - {"Config.Context", Field, 18}, - {"Config.DisableUnusedImportCheck", Field, 5}, - {"Config.Error", Field, 5}, - {"Config.FakeImportC", Field, 5}, - {"Config.GoVersion", Field, 18}, - {"Config.IgnoreFuncBodies", Field, 5}, - {"Config.Importer", Field, 5}, - {"Config.Sizes", Field, 5}, - {"Const", Type, 5}, - {"Context", Type, 18}, - {"ConvertibleTo", Func, 5}, - {"DefPredeclaredTestFuncs", Func, 5}, - {"Default", Func, 8}, - {"Error", Type, 5}, - {"Error.Fset", Field, 5}, - {"Error.Msg", Field, 5}, - {"Error.Pos", Field, 5}, - {"Error.Soft", Field, 5}, - {"Eval", Func, 5}, - {"ExprString", Func, 5}, - {"FieldVal", Const, 5}, - {"Float32", Const, 5}, - {"Float64", Const, 5}, - {"Func", Type, 5}, - {"Id", Func, 5}, - {"Identical", Func, 5}, - {"IdenticalIgnoreTags", Func, 8}, - {"Implements", Func, 5}, - {"ImportMode", Type, 6}, - {"Importer", Type, 5}, - {"ImporterFrom", Type, 6}, - {"Info", Type, 5}, - {"Info.Defs", Field, 5}, - {"Info.FileVersions", Field, 22}, - {"Info.Implicits", Field, 5}, - {"Info.InitOrder", Field, 5}, - {"Info.Instances", Field, 18}, - {"Info.Scopes", Field, 5}, - {"Info.Selections", Field, 5}, - {"Info.Types", Field, 5}, - {"Info.Uses", Field, 5}, - {"Initializer", Type, 5}, - {"Initializer.Lhs", Field, 5}, - {"Initializer.Rhs", Field, 5}, - {"Instance", Type, 18}, - {"Instance.Type", Field, 18}, - {"Instance.TypeArgs", Field, 18}, - {"Instantiate", Func, 18}, - {"Int", Const, 5}, - {"Int16", Const, 5}, - {"Int32", Const, 5}, - {"Int64", Const, 5}, - {"Int8", Const, 5}, - {"Interface", Type, 5}, - {"Invalid", Const, 5}, - {"IsBoolean", Const, 5}, - {"IsComplex", Const, 5}, - {"IsConstType", Const, 5}, - {"IsFloat", Const, 5}, - {"IsInteger", Const, 5}, - {"IsInterface", Func, 5}, - {"IsNumeric", Const, 5}, - {"IsOrdered", Const, 5}, - {"IsString", Const, 5}, - {"IsUnsigned", Const, 5}, - {"IsUntyped", Const, 5}, - {"Label", Type, 5}, - {"LookupFieldOrMethod", Func, 5}, - {"Map", Type, 5}, - {"MethodExpr", Const, 5}, - {"MethodSet", Type, 5}, - {"MethodVal", Const, 5}, - {"MissingMethod", Func, 5}, - {"Named", Type, 5}, - {"NewAlias", Func, 22}, - {"NewArray", Func, 5}, - {"NewChan", Func, 5}, - {"NewChecker", Func, 5}, - {"NewConst", Func, 5}, - {"NewContext", Func, 18}, - {"NewField", Func, 5}, - {"NewFunc", Func, 5}, - {"NewInterface", Func, 5}, - {"NewInterfaceType", Func, 11}, - {"NewLabel", Func, 5}, - {"NewMap", Func, 5}, - {"NewMethodSet", Func, 5}, - {"NewNamed", Func, 5}, - {"NewPackage", Func, 5}, - {"NewParam", Func, 5}, - {"NewPkgName", Func, 5}, - {"NewPointer", Func, 5}, - {"NewScope", Func, 5}, - {"NewSignature", Func, 5}, - {"NewSignatureType", Func, 18}, - {"NewSlice", Func, 5}, - {"NewStruct", Func, 5}, - {"NewTerm", Func, 18}, - {"NewTuple", Func, 5}, - {"NewTypeName", Func, 5}, - {"NewTypeParam", Func, 18}, - {"NewUnion", Func, 18}, - {"NewVar", Func, 5}, - {"Nil", Type, 5}, - {"Object", Type, 5}, - {"ObjectString", Func, 5}, - {"Package", Type, 5}, - {"PkgName", Type, 5}, - {"Pointer", Type, 5}, - {"Qualifier", Type, 5}, - {"RecvOnly", Const, 5}, - {"RelativeTo", Func, 5}, - {"Rune", Const, 5}, - {"Satisfies", Func, 20}, - {"Scope", Type, 5}, - {"Selection", Type, 5}, - {"SelectionKind", Type, 5}, - {"SelectionString", Func, 5}, - {"SendOnly", Const, 5}, - {"SendRecv", Const, 5}, - {"Signature", Type, 5}, - {"Sizes", Type, 5}, - {"SizesFor", Func, 9}, - {"Slice", Type, 5}, - {"StdSizes", Type, 5}, - {"StdSizes.MaxAlign", Field, 5}, - {"StdSizes.WordSize", Field, 5}, - {"String", Const, 5}, - {"Struct", Type, 5}, - {"Term", Type, 18}, - {"Tuple", Type, 5}, - {"Typ", Var, 5}, - {"Type", Type, 5}, - {"TypeAndValue", Type, 5}, - {"TypeAndValue.Type", Field, 5}, - {"TypeAndValue.Value", Field, 5}, - {"TypeList", Type, 18}, - {"TypeName", Type, 5}, - {"TypeParam", Type, 18}, - {"TypeParamList", Type, 18}, - {"TypeString", Func, 5}, - {"Uint", Const, 5}, - {"Uint16", Const, 5}, - {"Uint32", Const, 5}, - {"Uint64", Const, 5}, - {"Uint8", Const, 5}, - {"Uintptr", Const, 5}, - {"Unalias", Func, 22}, - {"Union", Type, 18}, - {"Universe", Var, 5}, - {"Unsafe", Var, 5}, - {"UnsafePointer", Const, 5}, - {"UntypedBool", Const, 5}, - {"UntypedComplex", Const, 5}, - {"UntypedFloat", Const, 5}, - {"UntypedInt", Const, 5}, - {"UntypedNil", Const, 5}, - {"UntypedRune", Const, 5}, - {"UntypedString", Const, 5}, - {"Var", Type, 5}, - {"WriteExpr", Func, 5}, - {"WriteSignature", Func, 5}, - {"WriteType", Func, 5}, - }, - "go/version": { - {"Compare", Func, 22}, - {"IsValid", Func, 22}, - {"Lang", Func, 22}, - }, - "hash": { - {"Hash", Type, 0}, - {"Hash32", Type, 0}, - {"Hash64", Type, 0}, - }, - "hash/adler32": { - {"Checksum", Func, 0}, - {"New", Func, 0}, - {"Size", Const, 0}, - }, - "hash/crc32": { - {"Castagnoli", Const, 0}, - {"Checksum", Func, 0}, - {"ChecksumIEEE", Func, 0}, - {"IEEE", Const, 0}, - {"IEEETable", Var, 0}, - {"Koopman", Const, 0}, - {"MakeTable", Func, 0}, - {"New", Func, 0}, - {"NewIEEE", Func, 0}, - {"Size", Const, 0}, - {"Table", Type, 0}, - {"Update", Func, 0}, - }, - "hash/crc64": { - {"Checksum", Func, 0}, - {"ECMA", Const, 0}, - {"ISO", Const, 0}, - {"MakeTable", Func, 0}, - {"New", Func, 0}, - {"Size", Const, 0}, - {"Table", Type, 0}, - {"Update", Func, 0}, - }, - "hash/fnv": { - {"New128", Func, 9}, - {"New128a", Func, 9}, - {"New32", Func, 0}, - {"New32a", Func, 0}, - {"New64", Func, 0}, - {"New64a", Func, 0}, - }, - "hash/maphash": { - {"(*Hash).BlockSize", Method, 14}, - {"(*Hash).Reset", Method, 14}, - {"(*Hash).Seed", Method, 14}, - {"(*Hash).SetSeed", Method, 14}, - {"(*Hash).Size", Method, 14}, - {"(*Hash).Sum", Method, 14}, - {"(*Hash).Sum64", Method, 14}, - {"(*Hash).Write", Method, 14}, - {"(*Hash).WriteByte", Method, 14}, - {"(*Hash).WriteString", Method, 14}, - {"Bytes", Func, 19}, - {"Hash", Type, 14}, - {"MakeSeed", Func, 14}, - {"Seed", Type, 14}, - {"String", Func, 19}, - }, - "html": { - {"EscapeString", Func, 0}, - {"UnescapeString", Func, 0}, - }, - "html/template": { - {"(*Error).Error", Method, 0}, - {"(*Template).AddParseTree", Method, 0}, - {"(*Template).Clone", Method, 0}, - {"(*Template).DefinedTemplates", Method, 6}, - {"(*Template).Delims", Method, 0}, - {"(*Template).Execute", Method, 0}, - {"(*Template).ExecuteTemplate", Method, 0}, - {"(*Template).Funcs", Method, 0}, - {"(*Template).Lookup", Method, 0}, - {"(*Template).Name", Method, 0}, - {"(*Template).New", Method, 0}, - {"(*Template).Option", Method, 5}, - {"(*Template).Parse", Method, 0}, - {"(*Template).ParseFS", Method, 16}, - {"(*Template).ParseFiles", Method, 0}, - {"(*Template).ParseGlob", Method, 0}, - {"(*Template).Templates", Method, 0}, - {"CSS", Type, 0}, - {"ErrAmbigContext", Const, 0}, - {"ErrBadHTML", Const, 0}, - {"ErrBranchEnd", Const, 0}, - {"ErrEndContext", Const, 0}, - {"ErrJSTemplate", Const, 21}, - {"ErrNoSuchTemplate", Const, 0}, - {"ErrOutputContext", Const, 0}, - {"ErrPartialCharset", Const, 0}, - {"ErrPartialEscape", Const, 0}, - {"ErrPredefinedEscaper", Const, 9}, - {"ErrRangeLoopReentry", Const, 0}, - {"ErrSlashAmbig", Const, 0}, - {"Error", Type, 0}, - {"Error.Description", Field, 0}, - {"Error.ErrorCode", Field, 0}, - {"Error.Line", Field, 0}, - {"Error.Name", Field, 0}, - {"Error.Node", Field, 4}, - {"ErrorCode", Type, 0}, - {"FuncMap", Type, 0}, - {"HTML", Type, 0}, - {"HTMLAttr", Type, 0}, - {"HTMLEscape", Func, 0}, - {"HTMLEscapeString", Func, 0}, - {"HTMLEscaper", Func, 0}, - {"IsTrue", Func, 6}, - {"JS", Type, 0}, - {"JSEscape", Func, 0}, - {"JSEscapeString", Func, 0}, - {"JSEscaper", Func, 0}, - {"JSStr", Type, 0}, - {"Must", Func, 0}, - {"New", Func, 0}, - {"OK", Const, 0}, - {"ParseFS", Func, 16}, - {"ParseFiles", Func, 0}, - {"ParseGlob", Func, 0}, - {"Srcset", Type, 10}, - {"Template", Type, 0}, - {"Template.Tree", Field, 2}, - {"URL", Type, 0}, - {"URLQueryEscaper", Func, 0}, - }, - "image": { - {"(*Alpha).AlphaAt", Method, 4}, - {"(*Alpha).At", Method, 0}, - {"(*Alpha).Bounds", Method, 0}, - {"(*Alpha).ColorModel", Method, 0}, - {"(*Alpha).Opaque", Method, 0}, - {"(*Alpha).PixOffset", Method, 0}, - {"(*Alpha).RGBA64At", Method, 17}, - {"(*Alpha).Set", Method, 0}, - {"(*Alpha).SetAlpha", Method, 0}, - {"(*Alpha).SetRGBA64", Method, 17}, - {"(*Alpha).SubImage", Method, 0}, - {"(*Alpha16).Alpha16At", Method, 4}, - {"(*Alpha16).At", Method, 0}, - {"(*Alpha16).Bounds", Method, 0}, - {"(*Alpha16).ColorModel", Method, 0}, - {"(*Alpha16).Opaque", Method, 0}, - {"(*Alpha16).PixOffset", Method, 0}, - {"(*Alpha16).RGBA64At", Method, 17}, - {"(*Alpha16).Set", Method, 0}, - {"(*Alpha16).SetAlpha16", Method, 0}, - {"(*Alpha16).SetRGBA64", Method, 17}, - {"(*Alpha16).SubImage", Method, 0}, - {"(*CMYK).At", Method, 5}, - {"(*CMYK).Bounds", Method, 5}, - {"(*CMYK).CMYKAt", Method, 5}, - {"(*CMYK).ColorModel", Method, 5}, - {"(*CMYK).Opaque", Method, 5}, - {"(*CMYK).PixOffset", Method, 5}, - {"(*CMYK).RGBA64At", Method, 17}, - {"(*CMYK).Set", Method, 5}, - {"(*CMYK).SetCMYK", Method, 5}, - {"(*CMYK).SetRGBA64", Method, 17}, - {"(*CMYK).SubImage", Method, 5}, - {"(*Gray).At", Method, 0}, - {"(*Gray).Bounds", Method, 0}, - {"(*Gray).ColorModel", Method, 0}, - {"(*Gray).GrayAt", Method, 4}, - {"(*Gray).Opaque", Method, 0}, - {"(*Gray).PixOffset", Method, 0}, - {"(*Gray).RGBA64At", Method, 17}, - {"(*Gray).Set", Method, 0}, - {"(*Gray).SetGray", Method, 0}, - {"(*Gray).SetRGBA64", Method, 17}, - {"(*Gray).SubImage", Method, 0}, - {"(*Gray16).At", Method, 0}, - {"(*Gray16).Bounds", Method, 0}, - {"(*Gray16).ColorModel", Method, 0}, - {"(*Gray16).Gray16At", Method, 4}, - {"(*Gray16).Opaque", Method, 0}, - {"(*Gray16).PixOffset", Method, 0}, - {"(*Gray16).RGBA64At", Method, 17}, - {"(*Gray16).Set", Method, 0}, - {"(*Gray16).SetGray16", Method, 0}, - {"(*Gray16).SetRGBA64", Method, 17}, - {"(*Gray16).SubImage", Method, 0}, - {"(*NRGBA).At", Method, 0}, - {"(*NRGBA).Bounds", Method, 0}, - {"(*NRGBA).ColorModel", Method, 0}, - {"(*NRGBA).NRGBAAt", Method, 4}, - {"(*NRGBA).Opaque", Method, 0}, - {"(*NRGBA).PixOffset", Method, 0}, - {"(*NRGBA).RGBA64At", Method, 17}, - {"(*NRGBA).Set", Method, 0}, - {"(*NRGBA).SetNRGBA", Method, 0}, - {"(*NRGBA).SetRGBA64", Method, 17}, - {"(*NRGBA).SubImage", Method, 0}, - {"(*NRGBA64).At", Method, 0}, - {"(*NRGBA64).Bounds", Method, 0}, - {"(*NRGBA64).ColorModel", Method, 0}, - {"(*NRGBA64).NRGBA64At", Method, 4}, - {"(*NRGBA64).Opaque", Method, 0}, - {"(*NRGBA64).PixOffset", Method, 0}, - {"(*NRGBA64).RGBA64At", Method, 17}, - {"(*NRGBA64).Set", Method, 0}, - {"(*NRGBA64).SetNRGBA64", Method, 0}, - {"(*NRGBA64).SetRGBA64", Method, 17}, - {"(*NRGBA64).SubImage", Method, 0}, - {"(*NYCbCrA).AOffset", Method, 6}, - {"(*NYCbCrA).At", Method, 6}, - {"(*NYCbCrA).Bounds", Method, 6}, - {"(*NYCbCrA).COffset", Method, 6}, - {"(*NYCbCrA).ColorModel", Method, 6}, - {"(*NYCbCrA).NYCbCrAAt", Method, 6}, - {"(*NYCbCrA).Opaque", Method, 6}, - {"(*NYCbCrA).RGBA64At", Method, 17}, - {"(*NYCbCrA).SubImage", Method, 6}, - {"(*NYCbCrA).YCbCrAt", Method, 6}, - {"(*NYCbCrA).YOffset", Method, 6}, - {"(*Paletted).At", Method, 0}, - {"(*Paletted).Bounds", Method, 0}, - {"(*Paletted).ColorIndexAt", Method, 0}, - {"(*Paletted).ColorModel", Method, 0}, - {"(*Paletted).Opaque", Method, 0}, - {"(*Paletted).PixOffset", Method, 0}, - {"(*Paletted).RGBA64At", Method, 17}, - {"(*Paletted).Set", Method, 0}, - {"(*Paletted).SetColorIndex", Method, 0}, - {"(*Paletted).SetRGBA64", Method, 17}, - {"(*Paletted).SubImage", Method, 0}, - {"(*RGBA).At", Method, 0}, - {"(*RGBA).Bounds", Method, 0}, - {"(*RGBA).ColorModel", Method, 0}, - {"(*RGBA).Opaque", Method, 0}, - {"(*RGBA).PixOffset", Method, 0}, - {"(*RGBA).RGBA64At", Method, 17}, - {"(*RGBA).RGBAAt", Method, 4}, - {"(*RGBA).Set", Method, 0}, - {"(*RGBA).SetRGBA", Method, 0}, - {"(*RGBA).SetRGBA64", Method, 17}, - {"(*RGBA).SubImage", Method, 0}, - {"(*RGBA64).At", Method, 0}, - {"(*RGBA64).Bounds", Method, 0}, - {"(*RGBA64).ColorModel", Method, 0}, - {"(*RGBA64).Opaque", Method, 0}, - {"(*RGBA64).PixOffset", Method, 0}, - {"(*RGBA64).RGBA64At", Method, 4}, - {"(*RGBA64).Set", Method, 0}, - {"(*RGBA64).SetRGBA64", Method, 0}, - {"(*RGBA64).SubImage", Method, 0}, - {"(*Uniform).At", Method, 0}, - {"(*Uniform).Bounds", Method, 0}, - {"(*Uniform).ColorModel", Method, 0}, - {"(*Uniform).Convert", Method, 0}, - {"(*Uniform).Opaque", Method, 0}, - {"(*Uniform).RGBA", Method, 0}, - {"(*Uniform).RGBA64At", Method, 17}, - {"(*YCbCr).At", Method, 0}, - {"(*YCbCr).Bounds", Method, 0}, - {"(*YCbCr).COffset", Method, 0}, - {"(*YCbCr).ColorModel", Method, 0}, - {"(*YCbCr).Opaque", Method, 0}, - {"(*YCbCr).RGBA64At", Method, 17}, - {"(*YCbCr).SubImage", Method, 0}, - {"(*YCbCr).YCbCrAt", Method, 4}, - {"(*YCbCr).YOffset", Method, 0}, - {"(Point).Add", Method, 0}, - {"(Point).Div", Method, 0}, - {"(Point).Eq", Method, 0}, - {"(Point).In", Method, 0}, - {"(Point).Mod", Method, 0}, - {"(Point).Mul", Method, 0}, - {"(Point).String", Method, 0}, - {"(Point).Sub", Method, 0}, - {"(Rectangle).Add", Method, 0}, - {"(Rectangle).At", Method, 5}, - {"(Rectangle).Bounds", Method, 5}, - {"(Rectangle).Canon", Method, 0}, - {"(Rectangle).ColorModel", Method, 5}, - {"(Rectangle).Dx", Method, 0}, - {"(Rectangle).Dy", Method, 0}, - {"(Rectangle).Empty", Method, 0}, - {"(Rectangle).Eq", Method, 0}, - {"(Rectangle).In", Method, 0}, - {"(Rectangle).Inset", Method, 0}, - {"(Rectangle).Intersect", Method, 0}, - {"(Rectangle).Overlaps", Method, 0}, - {"(Rectangle).RGBA64At", Method, 17}, - {"(Rectangle).Size", Method, 0}, - {"(Rectangle).String", Method, 0}, - {"(Rectangle).Sub", Method, 0}, - {"(Rectangle).Union", Method, 0}, - {"(YCbCrSubsampleRatio).String", Method, 0}, - {"Alpha", Type, 0}, - {"Alpha.Pix", Field, 0}, - {"Alpha.Rect", Field, 0}, - {"Alpha.Stride", Field, 0}, - {"Alpha16", Type, 0}, - {"Alpha16.Pix", Field, 0}, - {"Alpha16.Rect", Field, 0}, - {"Alpha16.Stride", Field, 0}, - {"Black", Var, 0}, - {"CMYK", Type, 5}, - {"CMYK.Pix", Field, 5}, - {"CMYK.Rect", Field, 5}, - {"CMYK.Stride", Field, 5}, - {"Config", Type, 0}, - {"Config.ColorModel", Field, 0}, - {"Config.Height", Field, 0}, - {"Config.Width", Field, 0}, - {"Decode", Func, 0}, - {"DecodeConfig", Func, 0}, - {"ErrFormat", Var, 0}, - {"Gray", Type, 0}, - {"Gray.Pix", Field, 0}, - {"Gray.Rect", Field, 0}, - {"Gray.Stride", Field, 0}, - {"Gray16", Type, 0}, - {"Gray16.Pix", Field, 0}, - {"Gray16.Rect", Field, 0}, - {"Gray16.Stride", Field, 0}, - {"Image", Type, 0}, - {"NRGBA", Type, 0}, - {"NRGBA.Pix", Field, 0}, - {"NRGBA.Rect", Field, 0}, - {"NRGBA.Stride", Field, 0}, - {"NRGBA64", Type, 0}, - {"NRGBA64.Pix", Field, 0}, - {"NRGBA64.Rect", Field, 0}, - {"NRGBA64.Stride", Field, 0}, - {"NYCbCrA", Type, 6}, - {"NYCbCrA.A", Field, 6}, - {"NYCbCrA.AStride", Field, 6}, - {"NYCbCrA.YCbCr", Field, 6}, - {"NewAlpha", Func, 0}, - {"NewAlpha16", Func, 0}, - {"NewCMYK", Func, 5}, - {"NewGray", Func, 0}, - {"NewGray16", Func, 0}, - {"NewNRGBA", Func, 0}, - {"NewNRGBA64", Func, 0}, - {"NewNYCbCrA", Func, 6}, - {"NewPaletted", Func, 0}, - {"NewRGBA", Func, 0}, - {"NewRGBA64", Func, 0}, - {"NewUniform", Func, 0}, - {"NewYCbCr", Func, 0}, - {"Opaque", Var, 0}, - {"Paletted", Type, 0}, - {"Paletted.Palette", Field, 0}, - {"Paletted.Pix", Field, 0}, - {"Paletted.Rect", Field, 0}, - {"Paletted.Stride", Field, 0}, - {"PalettedImage", Type, 0}, - {"Point", Type, 0}, - {"Point.X", Field, 0}, - {"Point.Y", Field, 0}, - {"Pt", Func, 0}, - {"RGBA", Type, 0}, - {"RGBA.Pix", Field, 0}, - {"RGBA.Rect", Field, 0}, - {"RGBA.Stride", Field, 0}, - {"RGBA64", Type, 0}, - {"RGBA64.Pix", Field, 0}, - {"RGBA64.Rect", Field, 0}, - {"RGBA64.Stride", Field, 0}, - {"RGBA64Image", Type, 17}, - {"Rect", Func, 0}, - {"Rectangle", Type, 0}, - {"Rectangle.Max", Field, 0}, - {"Rectangle.Min", Field, 0}, - {"RegisterFormat", Func, 0}, - {"Transparent", Var, 0}, - {"Uniform", Type, 0}, - {"Uniform.C", Field, 0}, - {"White", Var, 0}, - {"YCbCr", Type, 0}, - {"YCbCr.CStride", Field, 0}, - {"YCbCr.Cb", Field, 0}, - {"YCbCr.Cr", Field, 0}, - {"YCbCr.Rect", Field, 0}, - {"YCbCr.SubsampleRatio", Field, 0}, - {"YCbCr.Y", Field, 0}, - {"YCbCr.YStride", Field, 0}, - {"YCbCrSubsampleRatio", Type, 0}, - {"YCbCrSubsampleRatio410", Const, 5}, - {"YCbCrSubsampleRatio411", Const, 5}, - {"YCbCrSubsampleRatio420", Const, 0}, - {"YCbCrSubsampleRatio422", Const, 0}, - {"YCbCrSubsampleRatio440", Const, 1}, - {"YCbCrSubsampleRatio444", Const, 0}, - {"ZP", Var, 0}, - {"ZR", Var, 0}, - }, - "image/color": { - {"(Alpha).RGBA", Method, 0}, - {"(Alpha16).RGBA", Method, 0}, - {"(CMYK).RGBA", Method, 5}, - {"(Gray).RGBA", Method, 0}, - {"(Gray16).RGBA", Method, 0}, - {"(NRGBA).RGBA", Method, 0}, - {"(NRGBA64).RGBA", Method, 0}, - {"(NYCbCrA).RGBA", Method, 6}, - {"(Palette).Convert", Method, 0}, - {"(Palette).Index", Method, 0}, - {"(RGBA).RGBA", Method, 0}, - {"(RGBA64).RGBA", Method, 0}, - {"(YCbCr).RGBA", Method, 0}, - {"Alpha", Type, 0}, - {"Alpha.A", Field, 0}, - {"Alpha16", Type, 0}, - {"Alpha16.A", Field, 0}, - {"Alpha16Model", Var, 0}, - {"AlphaModel", Var, 0}, - {"Black", Var, 0}, - {"CMYK", Type, 5}, - {"CMYK.C", Field, 5}, - {"CMYK.K", Field, 5}, - {"CMYK.M", Field, 5}, - {"CMYK.Y", Field, 5}, - {"CMYKModel", Var, 5}, - {"CMYKToRGB", Func, 5}, - {"Color", Type, 0}, - {"Gray", Type, 0}, - {"Gray.Y", Field, 0}, - {"Gray16", Type, 0}, - {"Gray16.Y", Field, 0}, - {"Gray16Model", Var, 0}, - {"GrayModel", Var, 0}, - {"Model", Type, 0}, - {"ModelFunc", Func, 0}, - {"NRGBA", Type, 0}, - {"NRGBA.A", Field, 0}, - {"NRGBA.B", Field, 0}, - {"NRGBA.G", Field, 0}, - {"NRGBA.R", Field, 0}, - {"NRGBA64", Type, 0}, - {"NRGBA64.A", Field, 0}, - {"NRGBA64.B", Field, 0}, - {"NRGBA64.G", Field, 0}, - {"NRGBA64.R", Field, 0}, - {"NRGBA64Model", Var, 0}, - {"NRGBAModel", Var, 0}, - {"NYCbCrA", Type, 6}, - {"NYCbCrA.A", Field, 6}, - {"NYCbCrA.YCbCr", Field, 6}, - {"NYCbCrAModel", Var, 6}, - {"Opaque", Var, 0}, - {"Palette", Type, 0}, - {"RGBA", Type, 0}, - {"RGBA.A", Field, 0}, - {"RGBA.B", Field, 0}, - {"RGBA.G", Field, 0}, - {"RGBA.R", Field, 0}, - {"RGBA64", Type, 0}, - {"RGBA64.A", Field, 0}, - {"RGBA64.B", Field, 0}, - {"RGBA64.G", Field, 0}, - {"RGBA64.R", Field, 0}, - {"RGBA64Model", Var, 0}, - {"RGBAModel", Var, 0}, - {"RGBToCMYK", Func, 5}, - {"RGBToYCbCr", Func, 0}, - {"Transparent", Var, 0}, - {"White", Var, 0}, - {"YCbCr", Type, 0}, - {"YCbCr.Cb", Field, 0}, - {"YCbCr.Cr", Field, 0}, - {"YCbCr.Y", Field, 0}, - {"YCbCrModel", Var, 0}, - {"YCbCrToRGB", Func, 0}, - }, - "image/color/palette": { - {"Plan9", Var, 2}, - {"WebSafe", Var, 2}, - }, - "image/draw": { - {"(Op).Draw", Method, 2}, - {"Draw", Func, 0}, - {"DrawMask", Func, 0}, - {"Drawer", Type, 2}, - {"FloydSteinberg", Var, 2}, - {"Image", Type, 0}, - {"Op", Type, 0}, - {"Over", Const, 0}, - {"Quantizer", Type, 2}, - {"RGBA64Image", Type, 17}, - {"Src", Const, 0}, - }, - "image/gif": { - {"Decode", Func, 0}, - {"DecodeAll", Func, 0}, - {"DecodeConfig", Func, 0}, - {"DisposalBackground", Const, 5}, - {"DisposalNone", Const, 5}, - {"DisposalPrevious", Const, 5}, - {"Encode", Func, 2}, - {"EncodeAll", Func, 2}, - {"GIF", Type, 0}, - {"GIF.BackgroundIndex", Field, 5}, - {"GIF.Config", Field, 5}, - {"GIF.Delay", Field, 0}, - {"GIF.Disposal", Field, 5}, - {"GIF.Image", Field, 0}, - {"GIF.LoopCount", Field, 0}, - {"Options", Type, 2}, - {"Options.Drawer", Field, 2}, - {"Options.NumColors", Field, 2}, - {"Options.Quantizer", Field, 2}, - }, - "image/jpeg": { - {"(FormatError).Error", Method, 0}, - {"(UnsupportedError).Error", Method, 0}, - {"Decode", Func, 0}, - {"DecodeConfig", Func, 0}, - {"DefaultQuality", Const, 0}, - {"Encode", Func, 0}, - {"FormatError", Type, 0}, - {"Options", Type, 0}, - {"Options.Quality", Field, 0}, - {"Reader", Type, 0}, - {"UnsupportedError", Type, 0}, - }, - "image/png": { - {"(*Encoder).Encode", Method, 4}, - {"(FormatError).Error", Method, 0}, - {"(UnsupportedError).Error", Method, 0}, - {"BestCompression", Const, 4}, - {"BestSpeed", Const, 4}, - {"CompressionLevel", Type, 4}, - {"Decode", Func, 0}, - {"DecodeConfig", Func, 0}, - {"DefaultCompression", Const, 4}, - {"Encode", Func, 0}, - {"Encoder", Type, 4}, - {"Encoder.BufferPool", Field, 9}, - {"Encoder.CompressionLevel", Field, 4}, - {"EncoderBuffer", Type, 9}, - {"EncoderBufferPool", Type, 9}, - {"FormatError", Type, 0}, - {"NoCompression", Const, 4}, - {"UnsupportedError", Type, 0}, - }, - "index/suffixarray": { - {"(*Index).Bytes", Method, 0}, - {"(*Index).FindAllIndex", Method, 0}, - {"(*Index).Lookup", Method, 0}, - {"(*Index).Read", Method, 0}, - {"(*Index).Write", Method, 0}, - {"Index", Type, 0}, - {"New", Func, 0}, - }, - "io": { - {"(*LimitedReader).Read", Method, 0}, - {"(*OffsetWriter).Seek", Method, 20}, - {"(*OffsetWriter).Write", Method, 20}, - {"(*OffsetWriter).WriteAt", Method, 20}, - {"(*PipeReader).Close", Method, 0}, - {"(*PipeReader).CloseWithError", Method, 0}, - {"(*PipeReader).Read", Method, 0}, - {"(*PipeWriter).Close", Method, 0}, - {"(*PipeWriter).CloseWithError", Method, 0}, - {"(*PipeWriter).Write", Method, 0}, - {"(*SectionReader).Outer", Method, 22}, - {"(*SectionReader).Read", Method, 0}, - {"(*SectionReader).ReadAt", Method, 0}, - {"(*SectionReader).Seek", Method, 0}, - {"(*SectionReader).Size", Method, 0}, - {"ByteReader", Type, 0}, - {"ByteScanner", Type, 0}, - {"ByteWriter", Type, 1}, - {"Closer", Type, 0}, - {"Copy", Func, 0}, - {"CopyBuffer", Func, 5}, - {"CopyN", Func, 0}, - {"Discard", Var, 16}, - {"EOF", Var, 0}, - {"ErrClosedPipe", Var, 0}, - {"ErrNoProgress", Var, 1}, - {"ErrShortBuffer", Var, 0}, - {"ErrShortWrite", Var, 0}, - {"ErrUnexpectedEOF", Var, 0}, - {"LimitReader", Func, 0}, - {"LimitedReader", Type, 0}, - {"LimitedReader.N", Field, 0}, - {"LimitedReader.R", Field, 0}, - {"MultiReader", Func, 0}, - {"MultiWriter", Func, 0}, - {"NewOffsetWriter", Func, 20}, - {"NewSectionReader", Func, 0}, - {"NopCloser", Func, 16}, - {"OffsetWriter", Type, 20}, - {"Pipe", Func, 0}, - {"PipeReader", Type, 0}, - {"PipeWriter", Type, 0}, - {"ReadAll", Func, 16}, - {"ReadAtLeast", Func, 0}, - {"ReadCloser", Type, 0}, - {"ReadFull", Func, 0}, - {"ReadSeekCloser", Type, 16}, - {"ReadSeeker", Type, 0}, - {"ReadWriteCloser", Type, 0}, - {"ReadWriteSeeker", Type, 0}, - {"ReadWriter", Type, 0}, - {"Reader", Type, 0}, - {"ReaderAt", Type, 0}, - {"ReaderFrom", Type, 0}, - {"RuneReader", Type, 0}, - {"RuneScanner", Type, 0}, - {"SectionReader", Type, 0}, - {"SeekCurrent", Const, 7}, - {"SeekEnd", Const, 7}, - {"SeekStart", Const, 7}, - {"Seeker", Type, 0}, - {"StringWriter", Type, 12}, - {"TeeReader", Func, 0}, - {"WriteCloser", Type, 0}, - {"WriteSeeker", Type, 0}, - {"WriteString", Func, 0}, - {"Writer", Type, 0}, - {"WriterAt", Type, 0}, - {"WriterTo", Type, 0}, - }, - "io/fs": { - {"(*PathError).Error", Method, 16}, - {"(*PathError).Timeout", Method, 16}, - {"(*PathError).Unwrap", Method, 16}, - {"(FileMode).IsDir", Method, 16}, - {"(FileMode).IsRegular", Method, 16}, - {"(FileMode).Perm", Method, 16}, - {"(FileMode).String", Method, 16}, - {"(FileMode).Type", Method, 16}, - {"DirEntry", Type, 16}, - {"ErrClosed", Var, 16}, - {"ErrExist", Var, 16}, - {"ErrInvalid", Var, 16}, - {"ErrNotExist", Var, 16}, - {"ErrPermission", Var, 16}, - {"FS", Type, 16}, - {"File", Type, 16}, - {"FileInfo", Type, 16}, - {"FileInfoToDirEntry", Func, 17}, - {"FileMode", Type, 16}, - {"FormatDirEntry", Func, 21}, - {"FormatFileInfo", Func, 21}, - {"Glob", Func, 16}, - {"GlobFS", Type, 16}, - {"ModeAppend", Const, 16}, - {"ModeCharDevice", Const, 16}, - {"ModeDevice", Const, 16}, - {"ModeDir", Const, 16}, - {"ModeExclusive", Const, 16}, - {"ModeIrregular", Const, 16}, - {"ModeNamedPipe", Const, 16}, - {"ModePerm", Const, 16}, - {"ModeSetgid", Const, 16}, - {"ModeSetuid", Const, 16}, - {"ModeSocket", Const, 16}, - {"ModeSticky", Const, 16}, - {"ModeSymlink", Const, 16}, - {"ModeTemporary", Const, 16}, - {"ModeType", Const, 16}, - {"PathError", Type, 16}, - {"PathError.Err", Field, 16}, - {"PathError.Op", Field, 16}, - {"PathError.Path", Field, 16}, - {"ReadDir", Func, 16}, - {"ReadDirFS", Type, 16}, - {"ReadDirFile", Type, 16}, - {"ReadFile", Func, 16}, - {"ReadFileFS", Type, 16}, - {"SkipAll", Var, 20}, - {"SkipDir", Var, 16}, - {"Stat", Func, 16}, - {"StatFS", Type, 16}, - {"Sub", Func, 16}, - {"SubFS", Type, 16}, - {"ValidPath", Func, 16}, - {"WalkDir", Func, 16}, - {"WalkDirFunc", Type, 16}, - }, - "io/ioutil": { - {"Discard", Var, 0}, - {"NopCloser", Func, 0}, - {"ReadAll", Func, 0}, - {"ReadDir", Func, 0}, - {"ReadFile", Func, 0}, - {"TempDir", Func, 0}, - {"TempFile", Func, 0}, - {"WriteFile", Func, 0}, - }, - "log": { - {"(*Logger).Fatal", Method, 0}, - {"(*Logger).Fatalf", Method, 0}, - {"(*Logger).Fatalln", Method, 0}, - {"(*Logger).Flags", Method, 0}, - {"(*Logger).Output", Method, 0}, - {"(*Logger).Panic", Method, 0}, - {"(*Logger).Panicf", Method, 0}, - {"(*Logger).Panicln", Method, 0}, - {"(*Logger).Prefix", Method, 0}, - {"(*Logger).Print", Method, 0}, - {"(*Logger).Printf", Method, 0}, - {"(*Logger).Println", Method, 0}, - {"(*Logger).SetFlags", Method, 0}, - {"(*Logger).SetOutput", Method, 5}, - {"(*Logger).SetPrefix", Method, 0}, - {"(*Logger).Writer", Method, 12}, - {"Default", Func, 16}, - {"Fatal", Func, 0}, - {"Fatalf", Func, 0}, - {"Fatalln", Func, 0}, - {"Flags", Func, 0}, - {"LUTC", Const, 5}, - {"Ldate", Const, 0}, - {"Llongfile", Const, 0}, - {"Lmicroseconds", Const, 0}, - {"Lmsgprefix", Const, 14}, - {"Logger", Type, 0}, - {"Lshortfile", Const, 0}, - {"LstdFlags", Const, 0}, - {"Ltime", Const, 0}, - {"New", Func, 0}, - {"Output", Func, 5}, - {"Panic", Func, 0}, - {"Panicf", Func, 0}, - {"Panicln", Func, 0}, - {"Prefix", Func, 0}, - {"Print", Func, 0}, - {"Printf", Func, 0}, - {"Println", Func, 0}, - {"SetFlags", Func, 0}, - {"SetOutput", Func, 0}, - {"SetPrefix", Func, 0}, - {"Writer", Func, 13}, - }, - "log/slog": { - {"(*JSONHandler).Enabled", Method, 21}, - {"(*JSONHandler).Handle", Method, 21}, - {"(*JSONHandler).WithAttrs", Method, 21}, - {"(*JSONHandler).WithGroup", Method, 21}, - {"(*Level).UnmarshalJSON", Method, 21}, - {"(*Level).UnmarshalText", Method, 21}, - {"(*LevelVar).Level", Method, 21}, - {"(*LevelVar).MarshalText", Method, 21}, - {"(*LevelVar).Set", Method, 21}, - {"(*LevelVar).String", Method, 21}, - {"(*LevelVar).UnmarshalText", Method, 21}, - {"(*Logger).Debug", Method, 21}, - {"(*Logger).DebugContext", Method, 21}, - {"(*Logger).Enabled", Method, 21}, - {"(*Logger).Error", Method, 21}, - {"(*Logger).ErrorContext", Method, 21}, - {"(*Logger).Handler", Method, 21}, - {"(*Logger).Info", Method, 21}, - {"(*Logger).InfoContext", Method, 21}, - {"(*Logger).Log", Method, 21}, - {"(*Logger).LogAttrs", Method, 21}, - {"(*Logger).Warn", Method, 21}, - {"(*Logger).WarnContext", Method, 21}, - {"(*Logger).With", Method, 21}, - {"(*Logger).WithGroup", Method, 21}, - {"(*Record).Add", Method, 21}, - {"(*Record).AddAttrs", Method, 21}, - {"(*TextHandler).Enabled", Method, 21}, - {"(*TextHandler).Handle", Method, 21}, - {"(*TextHandler).WithAttrs", Method, 21}, - {"(*TextHandler).WithGroup", Method, 21}, - {"(Attr).Equal", Method, 21}, - {"(Attr).String", Method, 21}, - {"(Kind).String", Method, 21}, - {"(Level).Level", Method, 21}, - {"(Level).MarshalJSON", Method, 21}, - {"(Level).MarshalText", Method, 21}, - {"(Level).String", Method, 21}, - {"(Record).Attrs", Method, 21}, - {"(Record).Clone", Method, 21}, - {"(Record).NumAttrs", Method, 21}, - {"(Value).Any", Method, 21}, - {"(Value).Bool", Method, 21}, - {"(Value).Duration", Method, 21}, - {"(Value).Equal", Method, 21}, - {"(Value).Float64", Method, 21}, - {"(Value).Group", Method, 21}, - {"(Value).Int64", Method, 21}, - {"(Value).Kind", Method, 21}, - {"(Value).LogValuer", Method, 21}, - {"(Value).Resolve", Method, 21}, - {"(Value).String", Method, 21}, - {"(Value).Time", Method, 21}, - {"(Value).Uint64", Method, 21}, - {"Any", Func, 21}, - {"AnyValue", Func, 21}, - {"Attr", Type, 21}, - {"Attr.Key", Field, 21}, - {"Attr.Value", Field, 21}, - {"Bool", Func, 21}, - {"BoolValue", Func, 21}, - {"Debug", Func, 21}, - {"DebugContext", Func, 21}, - {"Default", Func, 21}, - {"Duration", Func, 21}, - {"DurationValue", Func, 21}, - {"Error", Func, 21}, - {"ErrorContext", Func, 21}, - {"Float64", Func, 21}, - {"Float64Value", Func, 21}, - {"Group", Func, 21}, - {"GroupValue", Func, 21}, - {"Handler", Type, 21}, - {"HandlerOptions", Type, 21}, - {"HandlerOptions.AddSource", Field, 21}, - {"HandlerOptions.Level", Field, 21}, - {"HandlerOptions.ReplaceAttr", Field, 21}, - {"Info", Func, 21}, - {"InfoContext", Func, 21}, - {"Int", Func, 21}, - {"Int64", Func, 21}, - {"Int64Value", Func, 21}, - {"IntValue", Func, 21}, - {"JSONHandler", Type, 21}, - {"Kind", Type, 21}, - {"KindAny", Const, 21}, - {"KindBool", Const, 21}, - {"KindDuration", Const, 21}, - {"KindFloat64", Const, 21}, - {"KindGroup", Const, 21}, - {"KindInt64", Const, 21}, - {"KindLogValuer", Const, 21}, - {"KindString", Const, 21}, - {"KindTime", Const, 21}, - {"KindUint64", Const, 21}, - {"Level", Type, 21}, - {"LevelDebug", Const, 21}, - {"LevelError", Const, 21}, - {"LevelInfo", Const, 21}, - {"LevelKey", Const, 21}, - {"LevelVar", Type, 21}, - {"LevelWarn", Const, 21}, - {"Leveler", Type, 21}, - {"Log", Func, 21}, - {"LogAttrs", Func, 21}, - {"LogValuer", Type, 21}, - {"Logger", Type, 21}, - {"MessageKey", Const, 21}, - {"New", Func, 21}, - {"NewJSONHandler", Func, 21}, - {"NewLogLogger", Func, 21}, - {"NewRecord", Func, 21}, - {"NewTextHandler", Func, 21}, - {"Record", Type, 21}, - {"Record.Level", Field, 21}, - {"Record.Message", Field, 21}, - {"Record.PC", Field, 21}, - {"Record.Time", Field, 21}, - {"SetDefault", Func, 21}, - {"SetLogLoggerLevel", Func, 22}, - {"Source", Type, 21}, - {"Source.File", Field, 21}, - {"Source.Function", Field, 21}, - {"Source.Line", Field, 21}, - {"SourceKey", Const, 21}, - {"String", Func, 21}, - {"StringValue", Func, 21}, - {"TextHandler", Type, 21}, - {"Time", Func, 21}, - {"TimeKey", Const, 21}, - {"TimeValue", Func, 21}, - {"Uint64", Func, 21}, - {"Uint64Value", Func, 21}, - {"Value", Type, 21}, - {"Warn", Func, 21}, - {"WarnContext", Func, 21}, - {"With", Func, 21}, - }, - "log/syslog": { - {"(*Writer).Alert", Method, 0}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).Crit", Method, 0}, - {"(*Writer).Debug", Method, 0}, - {"(*Writer).Emerg", Method, 0}, - {"(*Writer).Err", Method, 0}, - {"(*Writer).Info", Method, 0}, - {"(*Writer).Notice", Method, 0}, - {"(*Writer).Warning", Method, 0}, - {"(*Writer).Write", Method, 0}, - {"Dial", Func, 0}, - {"LOG_ALERT", Const, 0}, - {"LOG_AUTH", Const, 1}, - {"LOG_AUTHPRIV", Const, 1}, - {"LOG_CRIT", Const, 0}, - {"LOG_CRON", Const, 1}, - {"LOG_DAEMON", Const, 1}, - {"LOG_DEBUG", Const, 0}, - {"LOG_EMERG", Const, 0}, - {"LOG_ERR", Const, 0}, - {"LOG_FTP", Const, 1}, - {"LOG_INFO", Const, 0}, - {"LOG_KERN", Const, 1}, - {"LOG_LOCAL0", Const, 1}, - {"LOG_LOCAL1", Const, 1}, - {"LOG_LOCAL2", Const, 1}, - {"LOG_LOCAL3", Const, 1}, - {"LOG_LOCAL4", Const, 1}, - {"LOG_LOCAL5", Const, 1}, - {"LOG_LOCAL6", Const, 1}, - {"LOG_LOCAL7", Const, 1}, - {"LOG_LPR", Const, 1}, - {"LOG_MAIL", Const, 1}, - {"LOG_NEWS", Const, 1}, - {"LOG_NOTICE", Const, 0}, - {"LOG_SYSLOG", Const, 1}, - {"LOG_USER", Const, 1}, - {"LOG_UUCP", Const, 1}, - {"LOG_WARNING", Const, 0}, - {"New", Func, 0}, - {"NewLogger", Func, 0}, - {"Priority", Type, 0}, - {"Writer", Type, 0}, - }, - "maps": { - {"Clone", Func, 21}, - {"Copy", Func, 21}, - {"DeleteFunc", Func, 21}, - {"Equal", Func, 21}, - {"EqualFunc", Func, 21}, - }, - "math": { - {"Abs", Func, 0}, - {"Acos", Func, 0}, - {"Acosh", Func, 0}, - {"Asin", Func, 0}, - {"Asinh", Func, 0}, - {"Atan", Func, 0}, - {"Atan2", Func, 0}, - {"Atanh", Func, 0}, - {"Cbrt", Func, 0}, - {"Ceil", Func, 0}, - {"Copysign", Func, 0}, - {"Cos", Func, 0}, - {"Cosh", Func, 0}, - {"Dim", Func, 0}, - {"E", Const, 0}, - {"Erf", Func, 0}, - {"Erfc", Func, 0}, - {"Erfcinv", Func, 10}, - {"Erfinv", Func, 10}, - {"Exp", Func, 0}, - {"Exp2", Func, 0}, - {"Expm1", Func, 0}, - {"FMA", Func, 14}, - {"Float32bits", Func, 0}, - {"Float32frombits", Func, 0}, - {"Float64bits", Func, 0}, - {"Float64frombits", Func, 0}, - {"Floor", Func, 0}, - {"Frexp", Func, 0}, - {"Gamma", Func, 0}, - {"Hypot", Func, 0}, - {"Ilogb", Func, 0}, - {"Inf", Func, 0}, - {"IsInf", Func, 0}, - {"IsNaN", Func, 0}, - {"J0", Func, 0}, - {"J1", Func, 0}, - {"Jn", Func, 0}, - {"Ldexp", Func, 0}, - {"Lgamma", Func, 0}, - {"Ln10", Const, 0}, - {"Ln2", Const, 0}, - {"Log", Func, 0}, - {"Log10", Func, 0}, - {"Log10E", Const, 0}, - {"Log1p", Func, 0}, - {"Log2", Func, 0}, - {"Log2E", Const, 0}, - {"Logb", Func, 0}, - {"Max", Func, 0}, - {"MaxFloat32", Const, 0}, - {"MaxFloat64", Const, 0}, - {"MaxInt", Const, 17}, - {"MaxInt16", Const, 0}, - {"MaxInt32", Const, 0}, - {"MaxInt64", Const, 0}, - {"MaxInt8", Const, 0}, - {"MaxUint", Const, 17}, - {"MaxUint16", Const, 0}, - {"MaxUint32", Const, 0}, - {"MaxUint64", Const, 0}, - {"MaxUint8", Const, 0}, - {"Min", Func, 0}, - {"MinInt", Const, 17}, - {"MinInt16", Const, 0}, - {"MinInt32", Const, 0}, - {"MinInt64", Const, 0}, - {"MinInt8", Const, 0}, - {"Mod", Func, 0}, - {"Modf", Func, 0}, - {"NaN", Func, 0}, - {"Nextafter", Func, 0}, - {"Nextafter32", Func, 4}, - {"Phi", Const, 0}, - {"Pi", Const, 0}, - {"Pow", Func, 0}, - {"Pow10", Func, 0}, - {"Remainder", Func, 0}, - {"Round", Func, 10}, - {"RoundToEven", Func, 10}, - {"Signbit", Func, 0}, - {"Sin", Func, 0}, - {"Sincos", Func, 0}, - {"Sinh", Func, 0}, - {"SmallestNonzeroFloat32", Const, 0}, - {"SmallestNonzeroFloat64", Const, 0}, - {"Sqrt", Func, 0}, - {"Sqrt2", Const, 0}, - {"SqrtE", Const, 0}, - {"SqrtPhi", Const, 0}, - {"SqrtPi", Const, 0}, - {"Tan", Func, 0}, - {"Tanh", Func, 0}, - {"Trunc", Func, 0}, - {"Y0", Func, 0}, - {"Y1", Func, 0}, - {"Yn", Func, 0}, - }, - "math/big": { - {"(*Float).Abs", Method, 5}, - {"(*Float).Acc", Method, 5}, - {"(*Float).Add", Method, 5}, - {"(*Float).Append", Method, 5}, - {"(*Float).Cmp", Method, 5}, - {"(*Float).Copy", Method, 5}, - {"(*Float).Float32", Method, 5}, - {"(*Float).Float64", Method, 5}, - {"(*Float).Format", Method, 5}, - {"(*Float).GobDecode", Method, 7}, - {"(*Float).GobEncode", Method, 7}, - {"(*Float).Int", Method, 5}, - {"(*Float).Int64", Method, 5}, - {"(*Float).IsInf", Method, 5}, - {"(*Float).IsInt", Method, 5}, - {"(*Float).MantExp", Method, 5}, - {"(*Float).MarshalText", Method, 6}, - {"(*Float).MinPrec", Method, 5}, - {"(*Float).Mode", Method, 5}, - {"(*Float).Mul", Method, 5}, - {"(*Float).Neg", Method, 5}, - {"(*Float).Parse", Method, 5}, - {"(*Float).Prec", Method, 5}, - {"(*Float).Quo", Method, 5}, - {"(*Float).Rat", Method, 5}, - {"(*Float).Scan", Method, 8}, - {"(*Float).Set", Method, 5}, - {"(*Float).SetFloat64", Method, 5}, - {"(*Float).SetInf", Method, 5}, - {"(*Float).SetInt", Method, 5}, - {"(*Float).SetInt64", Method, 5}, - {"(*Float).SetMantExp", Method, 5}, - {"(*Float).SetMode", Method, 5}, - {"(*Float).SetPrec", Method, 5}, - {"(*Float).SetRat", Method, 5}, - {"(*Float).SetString", Method, 5}, - {"(*Float).SetUint64", Method, 5}, - {"(*Float).Sign", Method, 5}, - {"(*Float).Signbit", Method, 5}, - {"(*Float).Sqrt", Method, 10}, - {"(*Float).String", Method, 5}, - {"(*Float).Sub", Method, 5}, - {"(*Float).Text", Method, 5}, - {"(*Float).Uint64", Method, 5}, - {"(*Float).UnmarshalText", Method, 6}, - {"(*Int).Abs", Method, 0}, - {"(*Int).Add", Method, 0}, - {"(*Int).And", Method, 0}, - {"(*Int).AndNot", Method, 0}, - {"(*Int).Append", Method, 6}, - {"(*Int).Binomial", Method, 0}, - {"(*Int).Bit", Method, 0}, - {"(*Int).BitLen", Method, 0}, - {"(*Int).Bits", Method, 0}, - {"(*Int).Bytes", Method, 0}, - {"(*Int).Cmp", Method, 0}, - {"(*Int).CmpAbs", Method, 10}, - {"(*Int).Div", Method, 0}, - {"(*Int).DivMod", Method, 0}, - {"(*Int).Exp", Method, 0}, - {"(*Int).FillBytes", Method, 15}, - {"(*Int).Float64", Method, 21}, - {"(*Int).Format", Method, 0}, - {"(*Int).GCD", Method, 0}, - {"(*Int).GobDecode", Method, 0}, - {"(*Int).GobEncode", Method, 0}, - {"(*Int).Int64", Method, 0}, - {"(*Int).IsInt64", Method, 9}, - {"(*Int).IsUint64", Method, 9}, - {"(*Int).Lsh", Method, 0}, - {"(*Int).MarshalJSON", Method, 1}, - {"(*Int).MarshalText", Method, 3}, - {"(*Int).Mod", Method, 0}, - {"(*Int).ModInverse", Method, 0}, - {"(*Int).ModSqrt", Method, 5}, - {"(*Int).Mul", Method, 0}, - {"(*Int).MulRange", Method, 0}, - {"(*Int).Neg", Method, 0}, - {"(*Int).Not", Method, 0}, - {"(*Int).Or", Method, 0}, - {"(*Int).ProbablyPrime", Method, 0}, - {"(*Int).Quo", Method, 0}, - {"(*Int).QuoRem", Method, 0}, - {"(*Int).Rand", Method, 0}, - {"(*Int).Rem", Method, 0}, - {"(*Int).Rsh", Method, 0}, - {"(*Int).Scan", Method, 0}, - {"(*Int).Set", Method, 0}, - {"(*Int).SetBit", Method, 0}, - {"(*Int).SetBits", Method, 0}, - {"(*Int).SetBytes", Method, 0}, - {"(*Int).SetInt64", Method, 0}, - {"(*Int).SetString", Method, 0}, - {"(*Int).SetUint64", Method, 1}, - {"(*Int).Sign", Method, 0}, - {"(*Int).Sqrt", Method, 8}, - {"(*Int).String", Method, 0}, - {"(*Int).Sub", Method, 0}, - {"(*Int).Text", Method, 6}, - {"(*Int).TrailingZeroBits", Method, 13}, - {"(*Int).Uint64", Method, 1}, - {"(*Int).UnmarshalJSON", Method, 1}, - {"(*Int).UnmarshalText", Method, 3}, - {"(*Int).Xor", Method, 0}, - {"(*Rat).Abs", Method, 0}, - {"(*Rat).Add", Method, 0}, - {"(*Rat).Cmp", Method, 0}, - {"(*Rat).Denom", Method, 0}, - {"(*Rat).Float32", Method, 4}, - {"(*Rat).Float64", Method, 1}, - {"(*Rat).FloatPrec", Method, 22}, - {"(*Rat).FloatString", Method, 0}, - {"(*Rat).GobDecode", Method, 0}, - {"(*Rat).GobEncode", Method, 0}, - {"(*Rat).Inv", Method, 0}, - {"(*Rat).IsInt", Method, 0}, - {"(*Rat).MarshalText", Method, 3}, - {"(*Rat).Mul", Method, 0}, - {"(*Rat).Neg", Method, 0}, - {"(*Rat).Num", Method, 0}, - {"(*Rat).Quo", Method, 0}, - {"(*Rat).RatString", Method, 0}, - {"(*Rat).Scan", Method, 0}, - {"(*Rat).Set", Method, 0}, - {"(*Rat).SetFloat64", Method, 1}, - {"(*Rat).SetFrac", Method, 0}, - {"(*Rat).SetFrac64", Method, 0}, - {"(*Rat).SetInt", Method, 0}, - {"(*Rat).SetInt64", Method, 0}, - {"(*Rat).SetString", Method, 0}, - {"(*Rat).SetUint64", Method, 13}, - {"(*Rat).Sign", Method, 0}, - {"(*Rat).String", Method, 0}, - {"(*Rat).Sub", Method, 0}, - {"(*Rat).UnmarshalText", Method, 3}, - {"(Accuracy).String", Method, 5}, - {"(ErrNaN).Error", Method, 5}, - {"(RoundingMode).String", Method, 5}, - {"Above", Const, 5}, - {"Accuracy", Type, 5}, - {"AwayFromZero", Const, 5}, - {"Below", Const, 5}, - {"ErrNaN", Type, 5}, - {"Exact", Const, 5}, - {"Float", Type, 5}, - {"Int", Type, 0}, - {"Jacobi", Func, 5}, - {"MaxBase", Const, 0}, - {"MaxExp", Const, 5}, - {"MaxPrec", Const, 5}, - {"MinExp", Const, 5}, - {"NewFloat", Func, 5}, - {"NewInt", Func, 0}, - {"NewRat", Func, 0}, - {"ParseFloat", Func, 5}, - {"Rat", Type, 0}, - {"RoundingMode", Type, 5}, - {"ToNearestAway", Const, 5}, - {"ToNearestEven", Const, 5}, - {"ToNegativeInf", Const, 5}, - {"ToPositiveInf", Const, 5}, - {"ToZero", Const, 5}, - {"Word", Type, 0}, - }, - "math/bits": { - {"Add", Func, 12}, - {"Add32", Func, 12}, - {"Add64", Func, 12}, - {"Div", Func, 12}, - {"Div32", Func, 12}, - {"Div64", Func, 12}, - {"LeadingZeros", Func, 9}, - {"LeadingZeros16", Func, 9}, - {"LeadingZeros32", Func, 9}, - {"LeadingZeros64", Func, 9}, - {"LeadingZeros8", Func, 9}, - {"Len", Func, 9}, - {"Len16", Func, 9}, - {"Len32", Func, 9}, - {"Len64", Func, 9}, - {"Len8", Func, 9}, - {"Mul", Func, 12}, - {"Mul32", Func, 12}, - {"Mul64", Func, 12}, - {"OnesCount", Func, 9}, - {"OnesCount16", Func, 9}, - {"OnesCount32", Func, 9}, - {"OnesCount64", Func, 9}, - {"OnesCount8", Func, 9}, - {"Rem", Func, 14}, - {"Rem32", Func, 14}, - {"Rem64", Func, 14}, - {"Reverse", Func, 9}, - {"Reverse16", Func, 9}, - {"Reverse32", Func, 9}, - {"Reverse64", Func, 9}, - {"Reverse8", Func, 9}, - {"ReverseBytes", Func, 9}, - {"ReverseBytes16", Func, 9}, - {"ReverseBytes32", Func, 9}, - {"ReverseBytes64", Func, 9}, - {"RotateLeft", Func, 9}, - {"RotateLeft16", Func, 9}, - {"RotateLeft32", Func, 9}, - {"RotateLeft64", Func, 9}, - {"RotateLeft8", Func, 9}, - {"Sub", Func, 12}, - {"Sub32", Func, 12}, - {"Sub64", Func, 12}, - {"TrailingZeros", Func, 9}, - {"TrailingZeros16", Func, 9}, - {"TrailingZeros32", Func, 9}, - {"TrailingZeros64", Func, 9}, - {"TrailingZeros8", Func, 9}, - {"UintSize", Const, 9}, - }, - "math/cmplx": { - {"Abs", Func, 0}, - {"Acos", Func, 0}, - {"Acosh", Func, 0}, - {"Asin", Func, 0}, - {"Asinh", Func, 0}, - {"Atan", Func, 0}, - {"Atanh", Func, 0}, - {"Conj", Func, 0}, - {"Cos", Func, 0}, - {"Cosh", Func, 0}, - {"Cot", Func, 0}, - {"Exp", Func, 0}, - {"Inf", Func, 0}, - {"IsInf", Func, 0}, - {"IsNaN", Func, 0}, - {"Log", Func, 0}, - {"Log10", Func, 0}, - {"NaN", Func, 0}, - {"Phase", Func, 0}, - {"Polar", Func, 0}, - {"Pow", Func, 0}, - {"Rect", Func, 0}, - {"Sin", Func, 0}, - {"Sinh", Func, 0}, - {"Sqrt", Func, 0}, - {"Tan", Func, 0}, - {"Tanh", Func, 0}, - }, - "math/rand": { - {"(*Rand).ExpFloat64", Method, 0}, - {"(*Rand).Float32", Method, 0}, - {"(*Rand).Float64", Method, 0}, - {"(*Rand).Int", Method, 0}, - {"(*Rand).Int31", Method, 0}, - {"(*Rand).Int31n", Method, 0}, - {"(*Rand).Int63", Method, 0}, - {"(*Rand).Int63n", Method, 0}, - {"(*Rand).Intn", Method, 0}, - {"(*Rand).NormFloat64", Method, 0}, - {"(*Rand).Perm", Method, 0}, - {"(*Rand).Read", Method, 6}, - {"(*Rand).Seed", Method, 0}, - {"(*Rand).Shuffle", Method, 10}, - {"(*Rand).Uint32", Method, 0}, - {"(*Rand).Uint64", Method, 8}, - {"(*Zipf).Uint64", Method, 0}, - {"ExpFloat64", Func, 0}, - {"Float32", Func, 0}, - {"Float64", Func, 0}, - {"Int", Func, 0}, - {"Int31", Func, 0}, - {"Int31n", Func, 0}, - {"Int63", Func, 0}, - {"Int63n", Func, 0}, - {"Intn", Func, 0}, - {"New", Func, 0}, - {"NewSource", Func, 0}, - {"NewZipf", Func, 0}, - {"NormFloat64", Func, 0}, - {"Perm", Func, 0}, - {"Rand", Type, 0}, - {"Read", Func, 6}, - {"Seed", Func, 0}, - {"Shuffle", Func, 10}, - {"Source", Type, 0}, - {"Source64", Type, 8}, - {"Uint32", Func, 0}, - {"Uint64", Func, 8}, - {"Zipf", Type, 0}, - }, - "math/rand/v2": { - {"(*ChaCha8).MarshalBinary", Method, 22}, - {"(*ChaCha8).Seed", Method, 22}, - {"(*ChaCha8).Uint64", Method, 22}, - {"(*ChaCha8).UnmarshalBinary", Method, 22}, - {"(*PCG).MarshalBinary", Method, 22}, - {"(*PCG).Seed", Method, 22}, - {"(*PCG).Uint64", Method, 22}, - {"(*PCG).UnmarshalBinary", Method, 22}, - {"(*Rand).ExpFloat64", Method, 22}, - {"(*Rand).Float32", Method, 22}, - {"(*Rand).Float64", Method, 22}, - {"(*Rand).Int", Method, 22}, - {"(*Rand).Int32", Method, 22}, - {"(*Rand).Int32N", Method, 22}, - {"(*Rand).Int64", Method, 22}, - {"(*Rand).Int64N", Method, 22}, - {"(*Rand).IntN", Method, 22}, - {"(*Rand).NormFloat64", Method, 22}, - {"(*Rand).Perm", Method, 22}, - {"(*Rand).Shuffle", Method, 22}, - {"(*Rand).Uint32", Method, 22}, - {"(*Rand).Uint32N", Method, 22}, - {"(*Rand).Uint64", Method, 22}, - {"(*Rand).Uint64N", Method, 22}, - {"(*Rand).UintN", Method, 22}, - {"(*Zipf).Uint64", Method, 22}, - {"ChaCha8", Type, 22}, - {"ExpFloat64", Func, 22}, - {"Float32", Func, 22}, - {"Float64", Func, 22}, - {"Int", Func, 22}, - {"Int32", Func, 22}, - {"Int32N", Func, 22}, - {"Int64", Func, 22}, - {"Int64N", Func, 22}, - {"IntN", Func, 22}, - {"N", Func, 22}, - {"New", Func, 22}, - {"NewChaCha8", Func, 22}, - {"NewPCG", Func, 22}, - {"NewZipf", Func, 22}, - {"NormFloat64", Func, 22}, - {"PCG", Type, 22}, - {"Perm", Func, 22}, - {"Rand", Type, 22}, - {"Shuffle", Func, 22}, - {"Source", Type, 22}, - {"Uint32", Func, 22}, - {"Uint32N", Func, 22}, - {"Uint64", Func, 22}, - {"Uint64N", Func, 22}, - {"UintN", Func, 22}, - {"Zipf", Type, 22}, - }, - "mime": { - {"(*WordDecoder).Decode", Method, 5}, - {"(*WordDecoder).DecodeHeader", Method, 5}, - {"(WordEncoder).Encode", Method, 5}, - {"AddExtensionType", Func, 0}, - {"BEncoding", Const, 5}, - {"ErrInvalidMediaParameter", Var, 9}, - {"ExtensionsByType", Func, 5}, - {"FormatMediaType", Func, 0}, - {"ParseMediaType", Func, 0}, - {"QEncoding", Const, 5}, - {"TypeByExtension", Func, 0}, - {"WordDecoder", Type, 5}, - {"WordDecoder.CharsetReader", Field, 5}, - {"WordEncoder", Type, 5}, - }, - "mime/multipart": { - {"(*FileHeader).Open", Method, 0}, - {"(*Form).RemoveAll", Method, 0}, - {"(*Part).Close", Method, 0}, - {"(*Part).FileName", Method, 0}, - {"(*Part).FormName", Method, 0}, - {"(*Part).Read", Method, 0}, - {"(*Reader).NextPart", Method, 0}, - {"(*Reader).NextRawPart", Method, 14}, - {"(*Reader).ReadForm", Method, 0}, - {"(*Writer).Boundary", Method, 0}, - {"(*Writer).Close", Method, 0}, - {"(*Writer).CreateFormField", Method, 0}, - {"(*Writer).CreateFormFile", Method, 0}, - {"(*Writer).CreatePart", Method, 0}, - {"(*Writer).FormDataContentType", Method, 0}, - {"(*Writer).SetBoundary", Method, 1}, - {"(*Writer).WriteField", Method, 0}, - {"ErrMessageTooLarge", Var, 9}, - {"File", Type, 0}, - {"FileHeader", Type, 0}, - {"FileHeader.Filename", Field, 0}, - {"FileHeader.Header", Field, 0}, - {"FileHeader.Size", Field, 9}, - {"Form", Type, 0}, - {"Form.File", Field, 0}, - {"Form.Value", Field, 0}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"Part", Type, 0}, - {"Part.Header", Field, 0}, - {"Reader", Type, 0}, - {"Writer", Type, 0}, - }, - "mime/quotedprintable": { - {"(*Reader).Read", Method, 5}, - {"(*Writer).Close", Method, 5}, - {"(*Writer).Write", Method, 5}, - {"NewReader", Func, 5}, - {"NewWriter", Func, 5}, - {"Reader", Type, 5}, - {"Writer", Type, 5}, - {"Writer.Binary", Field, 5}, - }, - "net": { - {"(*AddrError).Error", Method, 0}, - {"(*AddrError).Temporary", Method, 0}, - {"(*AddrError).Timeout", Method, 0}, - {"(*Buffers).Read", Method, 8}, - {"(*Buffers).WriteTo", Method, 8}, - {"(*DNSConfigError).Error", Method, 0}, - {"(*DNSConfigError).Temporary", Method, 0}, - {"(*DNSConfigError).Timeout", Method, 0}, - {"(*DNSConfigError).Unwrap", Method, 13}, - {"(*DNSError).Error", Method, 0}, - {"(*DNSError).Temporary", Method, 0}, - {"(*DNSError).Timeout", Method, 0}, - {"(*Dialer).Dial", Method, 1}, - {"(*Dialer).DialContext", Method, 7}, - {"(*Dialer).MultipathTCP", Method, 21}, - {"(*Dialer).SetMultipathTCP", Method, 21}, - {"(*IP).UnmarshalText", Method, 2}, - {"(*IPAddr).Network", Method, 0}, - {"(*IPAddr).String", Method, 0}, - {"(*IPConn).Close", Method, 0}, - {"(*IPConn).File", Method, 0}, - {"(*IPConn).LocalAddr", Method, 0}, - {"(*IPConn).Read", Method, 0}, - {"(*IPConn).ReadFrom", Method, 0}, - {"(*IPConn).ReadFromIP", Method, 0}, - {"(*IPConn).ReadMsgIP", Method, 1}, - {"(*IPConn).RemoteAddr", Method, 0}, - {"(*IPConn).SetDeadline", Method, 0}, - {"(*IPConn).SetReadBuffer", Method, 0}, - {"(*IPConn).SetReadDeadline", Method, 0}, - {"(*IPConn).SetWriteBuffer", Method, 0}, - {"(*IPConn).SetWriteDeadline", Method, 0}, - {"(*IPConn).SyscallConn", Method, 9}, - {"(*IPConn).Write", Method, 0}, - {"(*IPConn).WriteMsgIP", Method, 1}, - {"(*IPConn).WriteTo", Method, 0}, - {"(*IPConn).WriteToIP", Method, 0}, - {"(*IPNet).Contains", Method, 0}, - {"(*IPNet).Network", Method, 0}, - {"(*IPNet).String", Method, 0}, - {"(*Interface).Addrs", Method, 0}, - {"(*Interface).MulticastAddrs", Method, 0}, - {"(*ListenConfig).Listen", Method, 11}, - {"(*ListenConfig).ListenPacket", Method, 11}, - {"(*ListenConfig).MultipathTCP", Method, 21}, - {"(*ListenConfig).SetMultipathTCP", Method, 21}, - {"(*OpError).Error", Method, 0}, - {"(*OpError).Temporary", Method, 0}, - {"(*OpError).Timeout", Method, 0}, - {"(*OpError).Unwrap", Method, 13}, - {"(*ParseError).Error", Method, 0}, - {"(*ParseError).Temporary", Method, 17}, - {"(*ParseError).Timeout", Method, 17}, - {"(*Resolver).LookupAddr", Method, 8}, - {"(*Resolver).LookupCNAME", Method, 8}, - {"(*Resolver).LookupHost", Method, 8}, - {"(*Resolver).LookupIP", Method, 15}, - {"(*Resolver).LookupIPAddr", Method, 8}, - {"(*Resolver).LookupMX", Method, 8}, - {"(*Resolver).LookupNS", Method, 8}, - {"(*Resolver).LookupNetIP", Method, 18}, - {"(*Resolver).LookupPort", Method, 8}, - {"(*Resolver).LookupSRV", Method, 8}, - {"(*Resolver).LookupTXT", Method, 8}, - {"(*TCPAddr).AddrPort", Method, 18}, - {"(*TCPAddr).Network", Method, 0}, - {"(*TCPAddr).String", Method, 0}, - {"(*TCPConn).Close", Method, 0}, - {"(*TCPConn).CloseRead", Method, 0}, - {"(*TCPConn).CloseWrite", Method, 0}, - {"(*TCPConn).File", Method, 0}, - {"(*TCPConn).LocalAddr", Method, 0}, - {"(*TCPConn).MultipathTCP", Method, 21}, - {"(*TCPConn).Read", Method, 0}, - {"(*TCPConn).ReadFrom", Method, 0}, - {"(*TCPConn).RemoteAddr", Method, 0}, - {"(*TCPConn).SetDeadline", Method, 0}, - {"(*TCPConn).SetKeepAlive", Method, 0}, - {"(*TCPConn).SetKeepAlivePeriod", Method, 2}, - {"(*TCPConn).SetLinger", Method, 0}, - {"(*TCPConn).SetNoDelay", Method, 0}, - {"(*TCPConn).SetReadBuffer", Method, 0}, - {"(*TCPConn).SetReadDeadline", Method, 0}, - {"(*TCPConn).SetWriteBuffer", Method, 0}, - {"(*TCPConn).SetWriteDeadline", Method, 0}, - {"(*TCPConn).SyscallConn", Method, 9}, - {"(*TCPConn).Write", Method, 0}, - {"(*TCPConn).WriteTo", Method, 22}, - {"(*TCPListener).Accept", Method, 0}, - {"(*TCPListener).AcceptTCP", Method, 0}, - {"(*TCPListener).Addr", Method, 0}, - {"(*TCPListener).Close", Method, 0}, - {"(*TCPListener).File", Method, 0}, - {"(*TCPListener).SetDeadline", Method, 0}, - {"(*TCPListener).SyscallConn", Method, 10}, - {"(*UDPAddr).AddrPort", Method, 18}, - {"(*UDPAddr).Network", Method, 0}, - {"(*UDPAddr).String", Method, 0}, - {"(*UDPConn).Close", Method, 0}, - {"(*UDPConn).File", Method, 0}, - {"(*UDPConn).LocalAddr", Method, 0}, - {"(*UDPConn).Read", Method, 0}, - {"(*UDPConn).ReadFrom", Method, 0}, - {"(*UDPConn).ReadFromUDP", Method, 0}, - {"(*UDPConn).ReadFromUDPAddrPort", Method, 18}, - {"(*UDPConn).ReadMsgUDP", Method, 1}, - {"(*UDPConn).ReadMsgUDPAddrPort", Method, 18}, - {"(*UDPConn).RemoteAddr", Method, 0}, - {"(*UDPConn).SetDeadline", Method, 0}, - {"(*UDPConn).SetReadBuffer", Method, 0}, - {"(*UDPConn).SetReadDeadline", Method, 0}, - {"(*UDPConn).SetWriteBuffer", Method, 0}, - {"(*UDPConn).SetWriteDeadline", Method, 0}, - {"(*UDPConn).SyscallConn", Method, 9}, - {"(*UDPConn).Write", Method, 0}, - {"(*UDPConn).WriteMsgUDP", Method, 1}, - {"(*UDPConn).WriteMsgUDPAddrPort", Method, 18}, - {"(*UDPConn).WriteTo", Method, 0}, - {"(*UDPConn).WriteToUDP", Method, 0}, - {"(*UDPConn).WriteToUDPAddrPort", Method, 18}, - {"(*UnixAddr).Network", Method, 0}, - {"(*UnixAddr).String", Method, 0}, - {"(*UnixConn).Close", Method, 0}, - {"(*UnixConn).CloseRead", Method, 1}, - {"(*UnixConn).CloseWrite", Method, 1}, - {"(*UnixConn).File", Method, 0}, - {"(*UnixConn).LocalAddr", Method, 0}, - {"(*UnixConn).Read", Method, 0}, - {"(*UnixConn).ReadFrom", Method, 0}, - {"(*UnixConn).ReadFromUnix", Method, 0}, - {"(*UnixConn).ReadMsgUnix", Method, 0}, - {"(*UnixConn).RemoteAddr", Method, 0}, - {"(*UnixConn).SetDeadline", Method, 0}, - {"(*UnixConn).SetReadBuffer", Method, 0}, - {"(*UnixConn).SetReadDeadline", Method, 0}, - {"(*UnixConn).SetWriteBuffer", Method, 0}, - {"(*UnixConn).SetWriteDeadline", Method, 0}, - {"(*UnixConn).SyscallConn", Method, 9}, - {"(*UnixConn).Write", Method, 0}, - {"(*UnixConn).WriteMsgUnix", Method, 0}, - {"(*UnixConn).WriteTo", Method, 0}, - {"(*UnixConn).WriteToUnix", Method, 0}, - {"(*UnixListener).Accept", Method, 0}, - {"(*UnixListener).AcceptUnix", Method, 0}, - {"(*UnixListener).Addr", Method, 0}, - {"(*UnixListener).Close", Method, 0}, - {"(*UnixListener).File", Method, 0}, - {"(*UnixListener).SetDeadline", Method, 0}, - {"(*UnixListener).SetUnlinkOnClose", Method, 8}, - {"(*UnixListener).SyscallConn", Method, 10}, - {"(Flags).String", Method, 0}, - {"(HardwareAddr).String", Method, 0}, - {"(IP).DefaultMask", Method, 0}, - {"(IP).Equal", Method, 0}, - {"(IP).IsGlobalUnicast", Method, 0}, - {"(IP).IsInterfaceLocalMulticast", Method, 0}, - {"(IP).IsLinkLocalMulticast", Method, 0}, - {"(IP).IsLinkLocalUnicast", Method, 0}, - {"(IP).IsLoopback", Method, 0}, - {"(IP).IsMulticast", Method, 0}, - {"(IP).IsPrivate", Method, 17}, - {"(IP).IsUnspecified", Method, 0}, - {"(IP).MarshalText", Method, 2}, - {"(IP).Mask", Method, 0}, - {"(IP).String", Method, 0}, - {"(IP).To16", Method, 0}, - {"(IP).To4", Method, 0}, - {"(IPMask).Size", Method, 0}, - {"(IPMask).String", Method, 0}, - {"(InvalidAddrError).Error", Method, 0}, - {"(InvalidAddrError).Temporary", Method, 0}, - {"(InvalidAddrError).Timeout", Method, 0}, - {"(UnknownNetworkError).Error", Method, 0}, - {"(UnknownNetworkError).Temporary", Method, 0}, - {"(UnknownNetworkError).Timeout", Method, 0}, - {"Addr", Type, 0}, - {"AddrError", Type, 0}, - {"AddrError.Addr", Field, 0}, - {"AddrError.Err", Field, 0}, - {"Buffers", Type, 8}, - {"CIDRMask", Func, 0}, - {"Conn", Type, 0}, - {"DNSConfigError", Type, 0}, - {"DNSConfigError.Err", Field, 0}, - {"DNSError", Type, 0}, - {"DNSError.Err", Field, 0}, - {"DNSError.IsNotFound", Field, 13}, - {"DNSError.IsTemporary", Field, 6}, - {"DNSError.IsTimeout", Field, 0}, - {"DNSError.Name", Field, 0}, - {"DNSError.Server", Field, 0}, - {"DefaultResolver", Var, 8}, - {"Dial", Func, 0}, - {"DialIP", Func, 0}, - {"DialTCP", Func, 0}, - {"DialTimeout", Func, 0}, - {"DialUDP", Func, 0}, - {"DialUnix", Func, 0}, - {"Dialer", Type, 1}, - {"Dialer.Cancel", Field, 6}, - {"Dialer.Control", Field, 11}, - {"Dialer.ControlContext", Field, 20}, - {"Dialer.Deadline", Field, 1}, - {"Dialer.DualStack", Field, 2}, - {"Dialer.FallbackDelay", Field, 5}, - {"Dialer.KeepAlive", Field, 3}, - {"Dialer.LocalAddr", Field, 1}, - {"Dialer.Resolver", Field, 8}, - {"Dialer.Timeout", Field, 1}, - {"ErrClosed", Var, 16}, - {"ErrWriteToConnected", Var, 0}, - {"Error", Type, 0}, - {"FileConn", Func, 0}, - {"FileListener", Func, 0}, - {"FilePacketConn", Func, 0}, - {"FlagBroadcast", Const, 0}, - {"FlagLoopback", Const, 0}, - {"FlagMulticast", Const, 0}, - {"FlagPointToPoint", Const, 0}, - {"FlagRunning", Const, 20}, - {"FlagUp", Const, 0}, - {"Flags", Type, 0}, - {"HardwareAddr", Type, 0}, - {"IP", Type, 0}, - {"IPAddr", Type, 0}, - {"IPAddr.IP", Field, 0}, - {"IPAddr.Zone", Field, 1}, - {"IPConn", Type, 0}, - {"IPMask", Type, 0}, - {"IPNet", Type, 0}, - {"IPNet.IP", Field, 0}, - {"IPNet.Mask", Field, 0}, - {"IPv4", Func, 0}, - {"IPv4Mask", Func, 0}, - {"IPv4allrouter", Var, 0}, - {"IPv4allsys", Var, 0}, - {"IPv4bcast", Var, 0}, - {"IPv4len", Const, 0}, - {"IPv4zero", Var, 0}, - {"IPv6interfacelocalallnodes", Var, 0}, - {"IPv6len", Const, 0}, - {"IPv6linklocalallnodes", Var, 0}, - {"IPv6linklocalallrouters", Var, 0}, - {"IPv6loopback", Var, 0}, - {"IPv6unspecified", Var, 0}, - {"IPv6zero", Var, 0}, - {"Interface", Type, 0}, - {"Interface.Flags", Field, 0}, - {"Interface.HardwareAddr", Field, 0}, - {"Interface.Index", Field, 0}, - {"Interface.MTU", Field, 0}, - {"Interface.Name", Field, 0}, - {"InterfaceAddrs", Func, 0}, - {"InterfaceByIndex", Func, 0}, - {"InterfaceByName", Func, 0}, - {"Interfaces", Func, 0}, - {"InvalidAddrError", Type, 0}, - {"JoinHostPort", Func, 0}, - {"Listen", Func, 0}, - {"ListenConfig", Type, 11}, - {"ListenConfig.Control", Field, 11}, - {"ListenConfig.KeepAlive", Field, 13}, - {"ListenIP", Func, 0}, - {"ListenMulticastUDP", Func, 0}, - {"ListenPacket", Func, 0}, - {"ListenTCP", Func, 0}, - {"ListenUDP", Func, 0}, - {"ListenUnix", Func, 0}, - {"ListenUnixgram", Func, 0}, - {"Listener", Type, 0}, - {"LookupAddr", Func, 0}, - {"LookupCNAME", Func, 0}, - {"LookupHost", Func, 0}, - {"LookupIP", Func, 0}, - {"LookupMX", Func, 0}, - {"LookupNS", Func, 1}, - {"LookupPort", Func, 0}, - {"LookupSRV", Func, 0}, - {"LookupTXT", Func, 0}, - {"MX", Type, 0}, - {"MX.Host", Field, 0}, - {"MX.Pref", Field, 0}, - {"NS", Type, 1}, - {"NS.Host", Field, 1}, - {"OpError", Type, 0}, - {"OpError.Addr", Field, 0}, - {"OpError.Err", Field, 0}, - {"OpError.Net", Field, 0}, - {"OpError.Op", Field, 0}, - {"OpError.Source", Field, 5}, - {"PacketConn", Type, 0}, - {"ParseCIDR", Func, 0}, - {"ParseError", Type, 0}, - {"ParseError.Text", Field, 0}, - {"ParseError.Type", Field, 0}, - {"ParseIP", Func, 0}, - {"ParseMAC", Func, 0}, - {"Pipe", Func, 0}, - {"ResolveIPAddr", Func, 0}, - {"ResolveTCPAddr", Func, 0}, - {"ResolveUDPAddr", Func, 0}, - {"ResolveUnixAddr", Func, 0}, - {"Resolver", Type, 8}, - {"Resolver.Dial", Field, 9}, - {"Resolver.PreferGo", Field, 8}, - {"Resolver.StrictErrors", Field, 9}, - {"SRV", Type, 0}, - {"SRV.Port", Field, 0}, - {"SRV.Priority", Field, 0}, - {"SRV.Target", Field, 0}, - {"SRV.Weight", Field, 0}, - {"SplitHostPort", Func, 0}, - {"TCPAddr", Type, 0}, - {"TCPAddr.IP", Field, 0}, - {"TCPAddr.Port", Field, 0}, - {"TCPAddr.Zone", Field, 1}, - {"TCPAddrFromAddrPort", Func, 18}, - {"TCPConn", Type, 0}, - {"TCPListener", Type, 0}, - {"UDPAddr", Type, 0}, - {"UDPAddr.IP", Field, 0}, - {"UDPAddr.Port", Field, 0}, - {"UDPAddr.Zone", Field, 1}, - {"UDPAddrFromAddrPort", Func, 18}, - {"UDPConn", Type, 0}, - {"UnixAddr", Type, 0}, - {"UnixAddr.Name", Field, 0}, - {"UnixAddr.Net", Field, 0}, - {"UnixConn", Type, 0}, - {"UnixListener", Type, 0}, - {"UnknownNetworkError", Type, 0}, - }, - "net/http": { - {"(*Client).CloseIdleConnections", Method, 12}, - {"(*Client).Do", Method, 0}, - {"(*Client).Get", Method, 0}, - {"(*Client).Head", Method, 0}, - {"(*Client).Post", Method, 0}, - {"(*Client).PostForm", Method, 0}, - {"(*Cookie).String", Method, 0}, - {"(*Cookie).Valid", Method, 18}, - {"(*MaxBytesError).Error", Method, 19}, - {"(*ProtocolError).Error", Method, 0}, - {"(*ProtocolError).Is", Method, 21}, - {"(*Request).AddCookie", Method, 0}, - {"(*Request).BasicAuth", Method, 4}, - {"(*Request).Clone", Method, 13}, - {"(*Request).Context", Method, 7}, - {"(*Request).Cookie", Method, 0}, - {"(*Request).Cookies", Method, 0}, - {"(*Request).FormFile", Method, 0}, - {"(*Request).FormValue", Method, 0}, - {"(*Request).MultipartReader", Method, 0}, - {"(*Request).ParseForm", Method, 0}, - {"(*Request).ParseMultipartForm", Method, 0}, - {"(*Request).PathValue", Method, 22}, - {"(*Request).PostFormValue", Method, 1}, - {"(*Request).ProtoAtLeast", Method, 0}, - {"(*Request).Referer", Method, 0}, - {"(*Request).SetBasicAuth", Method, 0}, - {"(*Request).SetPathValue", Method, 22}, - {"(*Request).UserAgent", Method, 0}, - {"(*Request).WithContext", Method, 7}, - {"(*Request).Write", Method, 0}, - {"(*Request).WriteProxy", Method, 0}, - {"(*Response).Cookies", Method, 0}, - {"(*Response).Location", Method, 0}, - {"(*Response).ProtoAtLeast", Method, 0}, - {"(*Response).Write", Method, 0}, - {"(*ResponseController).EnableFullDuplex", Method, 21}, - {"(*ResponseController).Flush", Method, 20}, - {"(*ResponseController).Hijack", Method, 20}, - {"(*ResponseController).SetReadDeadline", Method, 20}, - {"(*ResponseController).SetWriteDeadline", Method, 20}, - {"(*ServeMux).Handle", Method, 0}, - {"(*ServeMux).HandleFunc", Method, 0}, - {"(*ServeMux).Handler", Method, 1}, - {"(*ServeMux).ServeHTTP", Method, 0}, - {"(*Server).Close", Method, 8}, - {"(*Server).ListenAndServe", Method, 0}, - {"(*Server).ListenAndServeTLS", Method, 0}, - {"(*Server).RegisterOnShutdown", Method, 9}, - {"(*Server).Serve", Method, 0}, - {"(*Server).ServeTLS", Method, 9}, - {"(*Server).SetKeepAlivesEnabled", Method, 3}, - {"(*Server).Shutdown", Method, 8}, - {"(*Transport).CancelRequest", Method, 1}, - {"(*Transport).Clone", Method, 13}, - {"(*Transport).CloseIdleConnections", Method, 0}, - {"(*Transport).RegisterProtocol", Method, 0}, - {"(*Transport).RoundTrip", Method, 0}, - {"(ConnState).String", Method, 3}, - {"(Dir).Open", Method, 0}, - {"(HandlerFunc).ServeHTTP", Method, 0}, - {"(Header).Add", Method, 0}, - {"(Header).Clone", Method, 13}, - {"(Header).Del", Method, 0}, - {"(Header).Get", Method, 0}, - {"(Header).Set", Method, 0}, - {"(Header).Values", Method, 14}, - {"(Header).Write", Method, 0}, - {"(Header).WriteSubset", Method, 0}, - {"AllowQuerySemicolons", Func, 17}, - {"CanonicalHeaderKey", Func, 0}, - {"Client", Type, 0}, - {"Client.CheckRedirect", Field, 0}, - {"Client.Jar", Field, 0}, - {"Client.Timeout", Field, 3}, - {"Client.Transport", Field, 0}, - {"CloseNotifier", Type, 1}, - {"ConnState", Type, 3}, - {"Cookie", Type, 0}, - {"Cookie.Domain", Field, 0}, - {"Cookie.Expires", Field, 0}, - {"Cookie.HttpOnly", Field, 0}, - {"Cookie.MaxAge", Field, 0}, - {"Cookie.Name", Field, 0}, - {"Cookie.Path", Field, 0}, - {"Cookie.Raw", Field, 0}, - {"Cookie.RawExpires", Field, 0}, - {"Cookie.SameSite", Field, 11}, - {"Cookie.Secure", Field, 0}, - {"Cookie.Unparsed", Field, 0}, - {"Cookie.Value", Field, 0}, - {"CookieJar", Type, 0}, - {"DefaultClient", Var, 0}, - {"DefaultMaxHeaderBytes", Const, 0}, - {"DefaultMaxIdleConnsPerHost", Const, 0}, - {"DefaultServeMux", Var, 0}, - {"DefaultTransport", Var, 0}, - {"DetectContentType", Func, 0}, - {"Dir", Type, 0}, - {"ErrAbortHandler", Var, 8}, - {"ErrBodyNotAllowed", Var, 0}, - {"ErrBodyReadAfterClose", Var, 0}, - {"ErrContentLength", Var, 0}, - {"ErrHandlerTimeout", Var, 0}, - {"ErrHeaderTooLong", Var, 0}, - {"ErrHijacked", Var, 0}, - {"ErrLineTooLong", Var, 0}, - {"ErrMissingBoundary", Var, 0}, - {"ErrMissingContentLength", Var, 0}, - {"ErrMissingFile", Var, 0}, - {"ErrNoCookie", Var, 0}, - {"ErrNoLocation", Var, 0}, - {"ErrNotMultipart", Var, 0}, - {"ErrNotSupported", Var, 0}, - {"ErrSchemeMismatch", Var, 21}, - {"ErrServerClosed", Var, 8}, - {"ErrShortBody", Var, 0}, - {"ErrSkipAltProtocol", Var, 6}, - {"ErrUnexpectedTrailer", Var, 0}, - {"ErrUseLastResponse", Var, 7}, - {"ErrWriteAfterFlush", Var, 0}, - {"Error", Func, 0}, - {"FS", Func, 16}, - {"File", Type, 0}, - {"FileServer", Func, 0}, - {"FileServerFS", Func, 22}, - {"FileSystem", Type, 0}, - {"Flusher", Type, 0}, - {"Get", Func, 0}, - {"Handle", Func, 0}, - {"HandleFunc", Func, 0}, - {"Handler", Type, 0}, - {"HandlerFunc", Type, 0}, - {"Head", Func, 0}, - {"Header", Type, 0}, - {"Hijacker", Type, 0}, - {"ListenAndServe", Func, 0}, - {"ListenAndServeTLS", Func, 0}, - {"LocalAddrContextKey", Var, 7}, - {"MaxBytesError", Type, 19}, - {"MaxBytesError.Limit", Field, 19}, - {"MaxBytesHandler", Func, 18}, - {"MaxBytesReader", Func, 0}, - {"MethodConnect", Const, 6}, - {"MethodDelete", Const, 6}, - {"MethodGet", Const, 6}, - {"MethodHead", Const, 6}, - {"MethodOptions", Const, 6}, - {"MethodPatch", Const, 6}, - {"MethodPost", Const, 6}, - {"MethodPut", Const, 6}, - {"MethodTrace", Const, 6}, - {"NewFileTransport", Func, 0}, - {"NewFileTransportFS", Func, 22}, - {"NewRequest", Func, 0}, - {"NewRequestWithContext", Func, 13}, - {"NewResponseController", Func, 20}, - {"NewServeMux", Func, 0}, - {"NoBody", Var, 8}, - {"NotFound", Func, 0}, - {"NotFoundHandler", Func, 0}, - {"ParseHTTPVersion", Func, 0}, - {"ParseTime", Func, 1}, - {"Post", Func, 0}, - {"PostForm", Func, 0}, - {"ProtocolError", Type, 0}, - {"ProtocolError.ErrorString", Field, 0}, - {"ProxyFromEnvironment", Func, 0}, - {"ProxyURL", Func, 0}, - {"PushOptions", Type, 8}, - {"PushOptions.Header", Field, 8}, - {"PushOptions.Method", Field, 8}, - {"Pusher", Type, 8}, - {"ReadRequest", Func, 0}, - {"ReadResponse", Func, 0}, - {"Redirect", Func, 0}, - {"RedirectHandler", Func, 0}, - {"Request", Type, 0}, - {"Request.Body", Field, 0}, - {"Request.Cancel", Field, 5}, - {"Request.Close", Field, 0}, - {"Request.ContentLength", Field, 0}, - {"Request.Form", Field, 0}, - {"Request.GetBody", Field, 8}, - {"Request.Header", Field, 0}, - {"Request.Host", Field, 0}, - {"Request.Method", Field, 0}, - {"Request.MultipartForm", Field, 0}, - {"Request.PostForm", Field, 1}, - {"Request.Proto", Field, 0}, - {"Request.ProtoMajor", Field, 0}, - {"Request.ProtoMinor", Field, 0}, - {"Request.RemoteAddr", Field, 0}, - {"Request.RequestURI", Field, 0}, - {"Request.Response", Field, 7}, - {"Request.TLS", Field, 0}, - {"Request.Trailer", Field, 0}, - {"Request.TransferEncoding", Field, 0}, - {"Request.URL", Field, 0}, - {"Response", Type, 0}, - {"Response.Body", Field, 0}, - {"Response.Close", Field, 0}, - {"Response.ContentLength", Field, 0}, - {"Response.Header", Field, 0}, - {"Response.Proto", Field, 0}, - {"Response.ProtoMajor", Field, 0}, - {"Response.ProtoMinor", Field, 0}, - {"Response.Request", Field, 0}, - {"Response.Status", Field, 0}, - {"Response.StatusCode", Field, 0}, - {"Response.TLS", Field, 3}, - {"Response.Trailer", Field, 0}, - {"Response.TransferEncoding", Field, 0}, - {"Response.Uncompressed", Field, 7}, - {"ResponseController", Type, 20}, - {"ResponseWriter", Type, 0}, - {"RoundTripper", Type, 0}, - {"SameSite", Type, 11}, - {"SameSiteDefaultMode", Const, 11}, - {"SameSiteLaxMode", Const, 11}, - {"SameSiteNoneMode", Const, 13}, - {"SameSiteStrictMode", Const, 11}, - {"Serve", Func, 0}, - {"ServeContent", Func, 0}, - {"ServeFile", Func, 0}, - {"ServeFileFS", Func, 22}, - {"ServeMux", Type, 0}, - {"ServeTLS", Func, 9}, - {"Server", Type, 0}, - {"Server.Addr", Field, 0}, - {"Server.BaseContext", Field, 13}, - {"Server.ConnContext", Field, 13}, - {"Server.ConnState", Field, 3}, - {"Server.DisableGeneralOptionsHandler", Field, 20}, - {"Server.ErrorLog", Field, 3}, - {"Server.Handler", Field, 0}, - {"Server.IdleTimeout", Field, 8}, - {"Server.MaxHeaderBytes", Field, 0}, - {"Server.ReadHeaderTimeout", Field, 8}, - {"Server.ReadTimeout", Field, 0}, - {"Server.TLSConfig", Field, 0}, - {"Server.TLSNextProto", Field, 1}, - {"Server.WriteTimeout", Field, 0}, - {"ServerContextKey", Var, 7}, - {"SetCookie", Func, 0}, - {"StateActive", Const, 3}, - {"StateClosed", Const, 3}, - {"StateHijacked", Const, 3}, - {"StateIdle", Const, 3}, - {"StateNew", Const, 3}, - {"StatusAccepted", Const, 0}, - {"StatusAlreadyReported", Const, 7}, - {"StatusBadGateway", Const, 0}, - {"StatusBadRequest", Const, 0}, - {"StatusConflict", Const, 0}, - {"StatusContinue", Const, 0}, - {"StatusCreated", Const, 0}, - {"StatusEarlyHints", Const, 13}, - {"StatusExpectationFailed", Const, 0}, - {"StatusFailedDependency", Const, 7}, - {"StatusForbidden", Const, 0}, - {"StatusFound", Const, 0}, - {"StatusGatewayTimeout", Const, 0}, - {"StatusGone", Const, 0}, - {"StatusHTTPVersionNotSupported", Const, 0}, - {"StatusIMUsed", Const, 7}, - {"StatusInsufficientStorage", Const, 7}, - {"StatusInternalServerError", Const, 0}, - {"StatusLengthRequired", Const, 0}, - {"StatusLocked", Const, 7}, - {"StatusLoopDetected", Const, 7}, - {"StatusMethodNotAllowed", Const, 0}, - {"StatusMisdirectedRequest", Const, 11}, - {"StatusMovedPermanently", Const, 0}, - {"StatusMultiStatus", Const, 7}, - {"StatusMultipleChoices", Const, 0}, - {"StatusNetworkAuthenticationRequired", Const, 6}, - {"StatusNoContent", Const, 0}, - {"StatusNonAuthoritativeInfo", Const, 0}, - {"StatusNotAcceptable", Const, 0}, - {"StatusNotExtended", Const, 7}, - {"StatusNotFound", Const, 0}, - {"StatusNotImplemented", Const, 0}, - {"StatusNotModified", Const, 0}, - {"StatusOK", Const, 0}, - {"StatusPartialContent", Const, 0}, - {"StatusPaymentRequired", Const, 0}, - {"StatusPermanentRedirect", Const, 7}, - {"StatusPreconditionFailed", Const, 0}, - {"StatusPreconditionRequired", Const, 6}, - {"StatusProcessing", Const, 7}, - {"StatusProxyAuthRequired", Const, 0}, - {"StatusRequestEntityTooLarge", Const, 0}, - {"StatusRequestHeaderFieldsTooLarge", Const, 6}, - {"StatusRequestTimeout", Const, 0}, - {"StatusRequestURITooLong", Const, 0}, - {"StatusRequestedRangeNotSatisfiable", Const, 0}, - {"StatusResetContent", Const, 0}, - {"StatusSeeOther", Const, 0}, - {"StatusServiceUnavailable", Const, 0}, - {"StatusSwitchingProtocols", Const, 0}, - {"StatusTeapot", Const, 0}, - {"StatusTemporaryRedirect", Const, 0}, - {"StatusText", Func, 0}, - {"StatusTooEarly", Const, 12}, - {"StatusTooManyRequests", Const, 6}, - {"StatusUnauthorized", Const, 0}, - {"StatusUnavailableForLegalReasons", Const, 6}, - {"StatusUnprocessableEntity", Const, 7}, - {"StatusUnsupportedMediaType", Const, 0}, - {"StatusUpgradeRequired", Const, 7}, - {"StatusUseProxy", Const, 0}, - {"StatusVariantAlsoNegotiates", Const, 7}, - {"StripPrefix", Func, 0}, - {"TimeFormat", Const, 0}, - {"TimeoutHandler", Func, 0}, - {"TrailerPrefix", Const, 8}, - {"Transport", Type, 0}, - {"Transport.Dial", Field, 0}, - {"Transport.DialContext", Field, 7}, - {"Transport.DialTLS", Field, 4}, - {"Transport.DialTLSContext", Field, 14}, - {"Transport.DisableCompression", Field, 0}, - {"Transport.DisableKeepAlives", Field, 0}, - {"Transport.ExpectContinueTimeout", Field, 6}, - {"Transport.ForceAttemptHTTP2", Field, 13}, - {"Transport.GetProxyConnectHeader", Field, 16}, - {"Transport.IdleConnTimeout", Field, 7}, - {"Transport.MaxConnsPerHost", Field, 11}, - {"Transport.MaxIdleConns", Field, 7}, - {"Transport.MaxIdleConnsPerHost", Field, 0}, - {"Transport.MaxResponseHeaderBytes", Field, 7}, - {"Transport.OnProxyConnectResponse", Field, 20}, - {"Transport.Proxy", Field, 0}, - {"Transport.ProxyConnectHeader", Field, 8}, - {"Transport.ReadBufferSize", Field, 13}, - {"Transport.ResponseHeaderTimeout", Field, 1}, - {"Transport.TLSClientConfig", Field, 0}, - {"Transport.TLSHandshakeTimeout", Field, 3}, - {"Transport.TLSNextProto", Field, 6}, - {"Transport.WriteBufferSize", Field, 13}, - }, - "net/http/cgi": { - {"(*Handler).ServeHTTP", Method, 0}, - {"Handler", Type, 0}, - {"Handler.Args", Field, 0}, - {"Handler.Dir", Field, 0}, - {"Handler.Env", Field, 0}, - {"Handler.InheritEnv", Field, 0}, - {"Handler.Logger", Field, 0}, - {"Handler.Path", Field, 0}, - {"Handler.PathLocationHandler", Field, 0}, - {"Handler.Root", Field, 0}, - {"Handler.Stderr", Field, 7}, - {"Request", Func, 0}, - {"RequestFromMap", Func, 0}, - {"Serve", Func, 0}, - }, - "net/http/cookiejar": { - {"(*Jar).Cookies", Method, 1}, - {"(*Jar).SetCookies", Method, 1}, - {"Jar", Type, 1}, - {"New", Func, 1}, - {"Options", Type, 1}, - {"Options.PublicSuffixList", Field, 1}, - {"PublicSuffixList", Type, 1}, - }, - "net/http/fcgi": { - {"ErrConnClosed", Var, 5}, - {"ErrRequestAborted", Var, 5}, - {"ProcessEnv", Func, 9}, - {"Serve", Func, 0}, - }, - "net/http/httptest": { - {"(*ResponseRecorder).Flush", Method, 0}, - {"(*ResponseRecorder).Header", Method, 0}, - {"(*ResponseRecorder).Result", Method, 7}, - {"(*ResponseRecorder).Write", Method, 0}, - {"(*ResponseRecorder).WriteHeader", Method, 0}, - {"(*ResponseRecorder).WriteString", Method, 6}, - {"(*Server).Certificate", Method, 9}, - {"(*Server).Client", Method, 9}, - {"(*Server).Close", Method, 0}, - {"(*Server).CloseClientConnections", Method, 0}, - {"(*Server).Start", Method, 0}, - {"(*Server).StartTLS", Method, 0}, - {"DefaultRemoteAddr", Const, 0}, - {"NewRecorder", Func, 0}, - {"NewRequest", Func, 7}, - {"NewServer", Func, 0}, - {"NewTLSServer", Func, 0}, - {"NewUnstartedServer", Func, 0}, - {"ResponseRecorder", Type, 0}, - {"ResponseRecorder.Body", Field, 0}, - {"ResponseRecorder.Code", Field, 0}, - {"ResponseRecorder.Flushed", Field, 0}, - {"ResponseRecorder.HeaderMap", Field, 0}, - {"Server", Type, 0}, - {"Server.Config", Field, 0}, - {"Server.EnableHTTP2", Field, 14}, - {"Server.Listener", Field, 0}, - {"Server.TLS", Field, 0}, - {"Server.URL", Field, 0}, - }, - "net/http/httptrace": { - {"ClientTrace", Type, 7}, - {"ClientTrace.ConnectDone", Field, 7}, - {"ClientTrace.ConnectStart", Field, 7}, - {"ClientTrace.DNSDone", Field, 7}, - {"ClientTrace.DNSStart", Field, 7}, - {"ClientTrace.GetConn", Field, 7}, - {"ClientTrace.Got100Continue", Field, 7}, - {"ClientTrace.Got1xxResponse", Field, 11}, - {"ClientTrace.GotConn", Field, 7}, - {"ClientTrace.GotFirstResponseByte", Field, 7}, - {"ClientTrace.PutIdleConn", Field, 7}, - {"ClientTrace.TLSHandshakeDone", Field, 8}, - {"ClientTrace.TLSHandshakeStart", Field, 8}, - {"ClientTrace.Wait100Continue", Field, 7}, - {"ClientTrace.WroteHeaderField", Field, 11}, - {"ClientTrace.WroteHeaders", Field, 7}, - {"ClientTrace.WroteRequest", Field, 7}, - {"ContextClientTrace", Func, 7}, - {"DNSDoneInfo", Type, 7}, - {"DNSDoneInfo.Addrs", Field, 7}, - {"DNSDoneInfo.Coalesced", Field, 7}, - {"DNSDoneInfo.Err", Field, 7}, - {"DNSStartInfo", Type, 7}, - {"DNSStartInfo.Host", Field, 7}, - {"GotConnInfo", Type, 7}, - {"GotConnInfo.Conn", Field, 7}, - {"GotConnInfo.IdleTime", Field, 7}, - {"GotConnInfo.Reused", Field, 7}, - {"GotConnInfo.WasIdle", Field, 7}, - {"WithClientTrace", Func, 7}, - {"WroteRequestInfo", Type, 7}, - {"WroteRequestInfo.Err", Field, 7}, - }, - "net/http/httputil": { - {"(*ClientConn).Close", Method, 0}, - {"(*ClientConn).Do", Method, 0}, - {"(*ClientConn).Hijack", Method, 0}, - {"(*ClientConn).Pending", Method, 0}, - {"(*ClientConn).Read", Method, 0}, - {"(*ClientConn).Write", Method, 0}, - {"(*ProxyRequest).SetURL", Method, 20}, - {"(*ProxyRequest).SetXForwarded", Method, 20}, - {"(*ReverseProxy).ServeHTTP", Method, 0}, - {"(*ServerConn).Close", Method, 0}, - {"(*ServerConn).Hijack", Method, 0}, - {"(*ServerConn).Pending", Method, 0}, - {"(*ServerConn).Read", Method, 0}, - {"(*ServerConn).Write", Method, 0}, - {"BufferPool", Type, 6}, - {"ClientConn", Type, 0}, - {"DumpRequest", Func, 0}, - {"DumpRequestOut", Func, 0}, - {"DumpResponse", Func, 0}, - {"ErrClosed", Var, 0}, - {"ErrLineTooLong", Var, 0}, - {"ErrPersistEOF", Var, 0}, - {"ErrPipeline", Var, 0}, - {"NewChunkedReader", Func, 0}, - {"NewChunkedWriter", Func, 0}, - {"NewClientConn", Func, 0}, - {"NewProxyClientConn", Func, 0}, - {"NewServerConn", Func, 0}, - {"NewSingleHostReverseProxy", Func, 0}, - {"ProxyRequest", Type, 20}, - {"ProxyRequest.In", Field, 20}, - {"ProxyRequest.Out", Field, 20}, - {"ReverseProxy", Type, 0}, - {"ReverseProxy.BufferPool", Field, 6}, - {"ReverseProxy.Director", Field, 0}, - {"ReverseProxy.ErrorHandler", Field, 11}, - {"ReverseProxy.ErrorLog", Field, 4}, - {"ReverseProxy.FlushInterval", Field, 0}, - {"ReverseProxy.ModifyResponse", Field, 8}, - {"ReverseProxy.Rewrite", Field, 20}, - {"ReverseProxy.Transport", Field, 0}, - {"ServerConn", Type, 0}, - }, - "net/http/pprof": { - {"Cmdline", Func, 0}, - {"Handler", Func, 0}, - {"Index", Func, 0}, - {"Profile", Func, 0}, - {"Symbol", Func, 0}, - {"Trace", Func, 5}, - }, - "net/mail": { - {"(*Address).String", Method, 0}, - {"(*AddressParser).Parse", Method, 5}, - {"(*AddressParser).ParseList", Method, 5}, - {"(Header).AddressList", Method, 0}, - {"(Header).Date", Method, 0}, - {"(Header).Get", Method, 0}, - {"Address", Type, 0}, - {"Address.Address", Field, 0}, - {"Address.Name", Field, 0}, - {"AddressParser", Type, 5}, - {"AddressParser.WordDecoder", Field, 5}, - {"ErrHeaderNotPresent", Var, 0}, - {"Header", Type, 0}, - {"Message", Type, 0}, - {"Message.Body", Field, 0}, - {"Message.Header", Field, 0}, - {"ParseAddress", Func, 1}, - {"ParseAddressList", Func, 1}, - {"ParseDate", Func, 8}, - {"ReadMessage", Func, 0}, - }, - "net/netip": { - {"(*Addr).UnmarshalBinary", Method, 18}, - {"(*Addr).UnmarshalText", Method, 18}, - {"(*AddrPort).UnmarshalBinary", Method, 18}, - {"(*AddrPort).UnmarshalText", Method, 18}, - {"(*Prefix).UnmarshalBinary", Method, 18}, - {"(*Prefix).UnmarshalText", Method, 18}, - {"(Addr).AppendTo", Method, 18}, - {"(Addr).As16", Method, 18}, - {"(Addr).As4", Method, 18}, - {"(Addr).AsSlice", Method, 18}, - {"(Addr).BitLen", Method, 18}, - {"(Addr).Compare", Method, 18}, - {"(Addr).Is4", Method, 18}, - {"(Addr).Is4In6", Method, 18}, - {"(Addr).Is6", Method, 18}, - {"(Addr).IsGlobalUnicast", Method, 18}, - {"(Addr).IsInterfaceLocalMulticast", Method, 18}, - {"(Addr).IsLinkLocalMulticast", Method, 18}, - {"(Addr).IsLinkLocalUnicast", Method, 18}, - {"(Addr).IsLoopback", Method, 18}, - {"(Addr).IsMulticast", Method, 18}, - {"(Addr).IsPrivate", Method, 18}, - {"(Addr).IsUnspecified", Method, 18}, - {"(Addr).IsValid", Method, 18}, - {"(Addr).Less", Method, 18}, - {"(Addr).MarshalBinary", Method, 18}, - {"(Addr).MarshalText", Method, 18}, - {"(Addr).Next", Method, 18}, - {"(Addr).Prefix", Method, 18}, - {"(Addr).Prev", Method, 18}, - {"(Addr).String", Method, 18}, - {"(Addr).StringExpanded", Method, 18}, - {"(Addr).Unmap", Method, 18}, - {"(Addr).WithZone", Method, 18}, - {"(Addr).Zone", Method, 18}, - {"(AddrPort).Addr", Method, 18}, - {"(AddrPort).AppendTo", Method, 18}, - {"(AddrPort).Compare", Method, 22}, - {"(AddrPort).IsValid", Method, 18}, - {"(AddrPort).MarshalBinary", Method, 18}, - {"(AddrPort).MarshalText", Method, 18}, - {"(AddrPort).Port", Method, 18}, - {"(AddrPort).String", Method, 18}, - {"(Prefix).Addr", Method, 18}, - {"(Prefix).AppendTo", Method, 18}, - {"(Prefix).Bits", Method, 18}, - {"(Prefix).Contains", Method, 18}, - {"(Prefix).IsSingleIP", Method, 18}, - {"(Prefix).IsValid", Method, 18}, - {"(Prefix).MarshalBinary", Method, 18}, - {"(Prefix).MarshalText", Method, 18}, - {"(Prefix).Masked", Method, 18}, - {"(Prefix).Overlaps", Method, 18}, - {"(Prefix).String", Method, 18}, - {"Addr", Type, 18}, - {"AddrFrom16", Func, 18}, - {"AddrFrom4", Func, 18}, - {"AddrFromSlice", Func, 18}, - {"AddrPort", Type, 18}, - {"AddrPortFrom", Func, 18}, - {"IPv4Unspecified", Func, 18}, - {"IPv6LinkLocalAllNodes", Func, 18}, - {"IPv6LinkLocalAllRouters", Func, 20}, - {"IPv6Loopback", Func, 20}, - {"IPv6Unspecified", Func, 18}, - {"MustParseAddr", Func, 18}, - {"MustParseAddrPort", Func, 18}, - {"MustParsePrefix", Func, 18}, - {"ParseAddr", Func, 18}, - {"ParseAddrPort", Func, 18}, - {"ParsePrefix", Func, 18}, - {"Prefix", Type, 18}, - {"PrefixFrom", Func, 18}, - }, - "net/rpc": { - {"(*Client).Call", Method, 0}, - {"(*Client).Close", Method, 0}, - {"(*Client).Go", Method, 0}, - {"(*Server).Accept", Method, 0}, - {"(*Server).HandleHTTP", Method, 0}, - {"(*Server).Register", Method, 0}, - {"(*Server).RegisterName", Method, 0}, - {"(*Server).ServeCodec", Method, 0}, - {"(*Server).ServeConn", Method, 0}, - {"(*Server).ServeHTTP", Method, 0}, - {"(*Server).ServeRequest", Method, 0}, - {"(ServerError).Error", Method, 0}, - {"Accept", Func, 0}, - {"Call", Type, 0}, - {"Call.Args", Field, 0}, - {"Call.Done", Field, 0}, - {"Call.Error", Field, 0}, - {"Call.Reply", Field, 0}, - {"Call.ServiceMethod", Field, 0}, - {"Client", Type, 0}, - {"ClientCodec", Type, 0}, - {"DefaultDebugPath", Const, 0}, - {"DefaultRPCPath", Const, 0}, - {"DefaultServer", Var, 0}, - {"Dial", Func, 0}, - {"DialHTTP", Func, 0}, - {"DialHTTPPath", Func, 0}, - {"ErrShutdown", Var, 0}, - {"HandleHTTP", Func, 0}, - {"NewClient", Func, 0}, - {"NewClientWithCodec", Func, 0}, - {"NewServer", Func, 0}, - {"Register", Func, 0}, - {"RegisterName", Func, 0}, - {"Request", Type, 0}, - {"Request.Seq", Field, 0}, - {"Request.ServiceMethod", Field, 0}, - {"Response", Type, 0}, - {"Response.Error", Field, 0}, - {"Response.Seq", Field, 0}, - {"Response.ServiceMethod", Field, 0}, - {"ServeCodec", Func, 0}, - {"ServeConn", Func, 0}, - {"ServeRequest", Func, 0}, - {"Server", Type, 0}, - {"ServerCodec", Type, 0}, - {"ServerError", Type, 0}, - }, - "net/rpc/jsonrpc": { - {"Dial", Func, 0}, - {"NewClient", Func, 0}, - {"NewClientCodec", Func, 0}, - {"NewServerCodec", Func, 0}, - {"ServeConn", Func, 0}, - }, - "net/smtp": { - {"(*Client).Auth", Method, 0}, - {"(*Client).Close", Method, 2}, - {"(*Client).Data", Method, 0}, - {"(*Client).Extension", Method, 0}, - {"(*Client).Hello", Method, 1}, - {"(*Client).Mail", Method, 0}, - {"(*Client).Noop", Method, 10}, - {"(*Client).Quit", Method, 0}, - {"(*Client).Rcpt", Method, 0}, - {"(*Client).Reset", Method, 0}, - {"(*Client).StartTLS", Method, 0}, - {"(*Client).TLSConnectionState", Method, 5}, - {"(*Client).Verify", Method, 0}, - {"Auth", Type, 0}, - {"CRAMMD5Auth", Func, 0}, - {"Client", Type, 0}, - {"Client.Text", Field, 0}, - {"Dial", Func, 0}, - {"NewClient", Func, 0}, - {"PlainAuth", Func, 0}, - {"SendMail", Func, 0}, - {"ServerInfo", Type, 0}, - {"ServerInfo.Auth", Field, 0}, - {"ServerInfo.Name", Field, 0}, - {"ServerInfo.TLS", Field, 0}, - }, - "net/textproto": { - {"(*Conn).Close", Method, 0}, - {"(*Conn).Cmd", Method, 0}, - {"(*Conn).DotReader", Method, 0}, - {"(*Conn).DotWriter", Method, 0}, - {"(*Conn).EndRequest", Method, 0}, - {"(*Conn).EndResponse", Method, 0}, - {"(*Conn).Next", Method, 0}, - {"(*Conn).PrintfLine", Method, 0}, - {"(*Conn).ReadCodeLine", Method, 0}, - {"(*Conn).ReadContinuedLine", Method, 0}, - {"(*Conn).ReadContinuedLineBytes", Method, 0}, - {"(*Conn).ReadDotBytes", Method, 0}, - {"(*Conn).ReadDotLines", Method, 0}, - {"(*Conn).ReadLine", Method, 0}, - {"(*Conn).ReadLineBytes", Method, 0}, - {"(*Conn).ReadMIMEHeader", Method, 0}, - {"(*Conn).ReadResponse", Method, 0}, - {"(*Conn).StartRequest", Method, 0}, - {"(*Conn).StartResponse", Method, 0}, - {"(*Error).Error", Method, 0}, - {"(*Pipeline).EndRequest", Method, 0}, - {"(*Pipeline).EndResponse", Method, 0}, - {"(*Pipeline).Next", Method, 0}, - {"(*Pipeline).StartRequest", Method, 0}, - {"(*Pipeline).StartResponse", Method, 0}, - {"(*Reader).DotReader", Method, 0}, - {"(*Reader).ReadCodeLine", Method, 0}, - {"(*Reader).ReadContinuedLine", Method, 0}, - {"(*Reader).ReadContinuedLineBytes", Method, 0}, - {"(*Reader).ReadDotBytes", Method, 0}, - {"(*Reader).ReadDotLines", Method, 0}, - {"(*Reader).ReadLine", Method, 0}, - {"(*Reader).ReadLineBytes", Method, 0}, - {"(*Reader).ReadMIMEHeader", Method, 0}, - {"(*Reader).ReadResponse", Method, 0}, - {"(*Writer).DotWriter", Method, 0}, - {"(*Writer).PrintfLine", Method, 0}, - {"(MIMEHeader).Add", Method, 0}, - {"(MIMEHeader).Del", Method, 0}, - {"(MIMEHeader).Get", Method, 0}, - {"(MIMEHeader).Set", Method, 0}, - {"(MIMEHeader).Values", Method, 14}, - {"(ProtocolError).Error", Method, 0}, - {"CanonicalMIMEHeaderKey", Func, 0}, - {"Conn", Type, 0}, - {"Conn.Pipeline", Field, 0}, - {"Conn.Reader", Field, 0}, - {"Conn.Writer", Field, 0}, - {"Dial", Func, 0}, - {"Error", Type, 0}, - {"Error.Code", Field, 0}, - {"Error.Msg", Field, 0}, - {"MIMEHeader", Type, 0}, - {"NewConn", Func, 0}, - {"NewReader", Func, 0}, - {"NewWriter", Func, 0}, - {"Pipeline", Type, 0}, - {"ProtocolError", Type, 0}, - {"Reader", Type, 0}, - {"Reader.R", Field, 0}, - {"TrimBytes", Func, 1}, - {"TrimString", Func, 1}, - {"Writer", Type, 0}, - {"Writer.W", Field, 0}, - }, - "net/url": { - {"(*Error).Error", Method, 0}, - {"(*Error).Temporary", Method, 6}, - {"(*Error).Timeout", Method, 6}, - {"(*Error).Unwrap", Method, 13}, - {"(*URL).EscapedFragment", Method, 15}, - {"(*URL).EscapedPath", Method, 5}, - {"(*URL).Hostname", Method, 8}, - {"(*URL).IsAbs", Method, 0}, - {"(*URL).JoinPath", Method, 19}, - {"(*URL).MarshalBinary", Method, 8}, - {"(*URL).Parse", Method, 0}, - {"(*URL).Port", Method, 8}, - {"(*URL).Query", Method, 0}, - {"(*URL).Redacted", Method, 15}, - {"(*URL).RequestURI", Method, 0}, - {"(*URL).ResolveReference", Method, 0}, - {"(*URL).String", Method, 0}, - {"(*URL).UnmarshalBinary", Method, 8}, - {"(*Userinfo).Password", Method, 0}, - {"(*Userinfo).String", Method, 0}, - {"(*Userinfo).Username", Method, 0}, - {"(EscapeError).Error", Method, 0}, - {"(InvalidHostError).Error", Method, 6}, - {"(Values).Add", Method, 0}, - {"(Values).Del", Method, 0}, - {"(Values).Encode", Method, 0}, - {"(Values).Get", Method, 0}, - {"(Values).Has", Method, 17}, - {"(Values).Set", Method, 0}, - {"Error", Type, 0}, - {"Error.Err", Field, 0}, - {"Error.Op", Field, 0}, - {"Error.URL", Field, 0}, - {"EscapeError", Type, 0}, - {"InvalidHostError", Type, 6}, - {"JoinPath", Func, 19}, - {"Parse", Func, 0}, - {"ParseQuery", Func, 0}, - {"ParseRequestURI", Func, 0}, - {"PathEscape", Func, 8}, - {"PathUnescape", Func, 8}, - {"QueryEscape", Func, 0}, - {"QueryUnescape", Func, 0}, - {"URL", Type, 0}, - {"URL.ForceQuery", Field, 7}, - {"URL.Fragment", Field, 0}, - {"URL.Host", Field, 0}, - {"URL.OmitHost", Field, 19}, - {"URL.Opaque", Field, 0}, - {"URL.Path", Field, 0}, - {"URL.RawFragment", Field, 15}, - {"URL.RawPath", Field, 5}, - {"URL.RawQuery", Field, 0}, - {"URL.Scheme", Field, 0}, - {"URL.User", Field, 0}, - {"User", Func, 0}, - {"UserPassword", Func, 0}, - {"Userinfo", Type, 0}, - {"Values", Type, 0}, - }, - "os": { - {"(*File).Chdir", Method, 0}, - {"(*File).Chmod", Method, 0}, - {"(*File).Chown", Method, 0}, - {"(*File).Close", Method, 0}, - {"(*File).Fd", Method, 0}, - {"(*File).Name", Method, 0}, - {"(*File).Read", Method, 0}, - {"(*File).ReadAt", Method, 0}, - {"(*File).ReadDir", Method, 16}, - {"(*File).ReadFrom", Method, 15}, - {"(*File).Readdir", Method, 0}, - {"(*File).Readdirnames", Method, 0}, - {"(*File).Seek", Method, 0}, - {"(*File).SetDeadline", Method, 10}, - {"(*File).SetReadDeadline", Method, 10}, - {"(*File).SetWriteDeadline", Method, 10}, - {"(*File).Stat", Method, 0}, - {"(*File).Sync", Method, 0}, - {"(*File).SyscallConn", Method, 12}, - {"(*File).Truncate", Method, 0}, - {"(*File).Write", Method, 0}, - {"(*File).WriteAt", Method, 0}, - {"(*File).WriteString", Method, 0}, - {"(*File).WriteTo", Method, 22}, - {"(*LinkError).Error", Method, 0}, - {"(*LinkError).Unwrap", Method, 13}, - {"(*PathError).Error", Method, 0}, - {"(*PathError).Timeout", Method, 10}, - {"(*PathError).Unwrap", Method, 13}, - {"(*Process).Kill", Method, 0}, - {"(*Process).Release", Method, 0}, - {"(*Process).Signal", Method, 0}, - {"(*Process).Wait", Method, 0}, - {"(*ProcessState).ExitCode", Method, 12}, - {"(*ProcessState).Exited", Method, 0}, - {"(*ProcessState).Pid", Method, 0}, - {"(*ProcessState).String", Method, 0}, - {"(*ProcessState).Success", Method, 0}, - {"(*ProcessState).Sys", Method, 0}, - {"(*ProcessState).SysUsage", Method, 0}, - {"(*ProcessState).SystemTime", Method, 0}, - {"(*ProcessState).UserTime", Method, 0}, - {"(*SyscallError).Error", Method, 0}, - {"(*SyscallError).Timeout", Method, 10}, - {"(*SyscallError).Unwrap", Method, 13}, - {"(FileMode).IsDir", Method, 0}, - {"(FileMode).IsRegular", Method, 1}, - {"(FileMode).Perm", Method, 0}, - {"(FileMode).String", Method, 0}, - {"Args", Var, 0}, - {"Chdir", Func, 0}, - {"Chmod", Func, 0}, - {"Chown", Func, 0}, - {"Chtimes", Func, 0}, - {"Clearenv", Func, 0}, - {"Create", Func, 0}, - {"CreateTemp", Func, 16}, - {"DevNull", Const, 0}, - {"DirEntry", Type, 16}, - {"DirFS", Func, 16}, - {"Environ", Func, 0}, - {"ErrClosed", Var, 8}, - {"ErrDeadlineExceeded", Var, 15}, - {"ErrExist", Var, 0}, - {"ErrInvalid", Var, 0}, - {"ErrNoDeadline", Var, 10}, - {"ErrNotExist", Var, 0}, - {"ErrPermission", Var, 0}, - {"ErrProcessDone", Var, 16}, - {"Executable", Func, 8}, - {"Exit", Func, 0}, - {"Expand", Func, 0}, - {"ExpandEnv", Func, 0}, - {"File", Type, 0}, - {"FileInfo", Type, 0}, - {"FileMode", Type, 0}, - {"FindProcess", Func, 0}, - {"Getegid", Func, 0}, - {"Getenv", Func, 0}, - {"Geteuid", Func, 0}, - {"Getgid", Func, 0}, - {"Getgroups", Func, 0}, - {"Getpagesize", Func, 0}, - {"Getpid", Func, 0}, - {"Getppid", Func, 0}, - {"Getuid", Func, 0}, - {"Getwd", Func, 0}, - {"Hostname", Func, 0}, - {"Interrupt", Var, 0}, - {"IsExist", Func, 0}, - {"IsNotExist", Func, 0}, - {"IsPathSeparator", Func, 0}, - {"IsPermission", Func, 0}, - {"IsTimeout", Func, 10}, - {"Kill", Var, 0}, - {"Lchown", Func, 0}, - {"Link", Func, 0}, - {"LinkError", Type, 0}, - {"LinkError.Err", Field, 0}, - {"LinkError.New", Field, 0}, - {"LinkError.Old", Field, 0}, - {"LinkError.Op", Field, 0}, - {"LookupEnv", Func, 5}, - {"Lstat", Func, 0}, - {"Mkdir", Func, 0}, - {"MkdirAll", Func, 0}, - {"MkdirTemp", Func, 16}, - {"ModeAppend", Const, 0}, - {"ModeCharDevice", Const, 0}, - {"ModeDevice", Const, 0}, - {"ModeDir", Const, 0}, - {"ModeExclusive", Const, 0}, - {"ModeIrregular", Const, 11}, - {"ModeNamedPipe", Const, 0}, - {"ModePerm", Const, 0}, - {"ModeSetgid", Const, 0}, - {"ModeSetuid", Const, 0}, - {"ModeSocket", Const, 0}, - {"ModeSticky", Const, 0}, - {"ModeSymlink", Const, 0}, - {"ModeTemporary", Const, 0}, - {"ModeType", Const, 0}, - {"NewFile", Func, 0}, - {"NewSyscallError", Func, 0}, - {"O_APPEND", Const, 0}, - {"O_CREATE", Const, 0}, - {"O_EXCL", Const, 0}, - {"O_RDONLY", Const, 0}, - {"O_RDWR", Const, 0}, - {"O_SYNC", Const, 0}, - {"O_TRUNC", Const, 0}, - {"O_WRONLY", Const, 0}, - {"Open", Func, 0}, - {"OpenFile", Func, 0}, - {"PathError", Type, 0}, - {"PathError.Err", Field, 0}, - {"PathError.Op", Field, 0}, - {"PathError.Path", Field, 0}, - {"PathListSeparator", Const, 0}, - {"PathSeparator", Const, 0}, - {"Pipe", Func, 0}, - {"ProcAttr", Type, 0}, - {"ProcAttr.Dir", Field, 0}, - {"ProcAttr.Env", Field, 0}, - {"ProcAttr.Files", Field, 0}, - {"ProcAttr.Sys", Field, 0}, - {"Process", Type, 0}, - {"Process.Pid", Field, 0}, - {"ProcessState", Type, 0}, - {"ReadDir", Func, 16}, - {"ReadFile", Func, 16}, - {"Readlink", Func, 0}, - {"Remove", Func, 0}, - {"RemoveAll", Func, 0}, - {"Rename", Func, 0}, - {"SEEK_CUR", Const, 0}, - {"SEEK_END", Const, 0}, - {"SEEK_SET", Const, 0}, - {"SameFile", Func, 0}, - {"Setenv", Func, 0}, - {"Signal", Type, 0}, - {"StartProcess", Func, 0}, - {"Stat", Func, 0}, - {"Stderr", Var, 0}, - {"Stdin", Var, 0}, - {"Stdout", Var, 0}, - {"Symlink", Func, 0}, - {"SyscallError", Type, 0}, - {"SyscallError.Err", Field, 0}, - {"SyscallError.Syscall", Field, 0}, - {"TempDir", Func, 0}, - {"Truncate", Func, 0}, - {"Unsetenv", Func, 4}, - {"UserCacheDir", Func, 11}, - {"UserConfigDir", Func, 13}, - {"UserHomeDir", Func, 12}, - {"WriteFile", Func, 16}, - }, - "os/exec": { - {"(*Cmd).CombinedOutput", Method, 0}, - {"(*Cmd).Environ", Method, 19}, - {"(*Cmd).Output", Method, 0}, - {"(*Cmd).Run", Method, 0}, - {"(*Cmd).Start", Method, 0}, - {"(*Cmd).StderrPipe", Method, 0}, - {"(*Cmd).StdinPipe", Method, 0}, - {"(*Cmd).StdoutPipe", Method, 0}, - {"(*Cmd).String", Method, 13}, - {"(*Cmd).Wait", Method, 0}, - {"(*Error).Error", Method, 0}, - {"(*Error).Unwrap", Method, 13}, - {"(*ExitError).Error", Method, 0}, - {"(ExitError).ExitCode", Method, 12}, - {"(ExitError).Exited", Method, 0}, - {"(ExitError).Pid", Method, 0}, - {"(ExitError).String", Method, 0}, - {"(ExitError).Success", Method, 0}, - {"(ExitError).Sys", Method, 0}, - {"(ExitError).SysUsage", Method, 0}, - {"(ExitError).SystemTime", Method, 0}, - {"(ExitError).UserTime", Method, 0}, - {"Cmd", Type, 0}, - {"Cmd.Args", Field, 0}, - {"Cmd.Cancel", Field, 20}, - {"Cmd.Dir", Field, 0}, - {"Cmd.Env", Field, 0}, - {"Cmd.Err", Field, 19}, - {"Cmd.ExtraFiles", Field, 0}, - {"Cmd.Path", Field, 0}, - {"Cmd.Process", Field, 0}, - {"Cmd.ProcessState", Field, 0}, - {"Cmd.Stderr", Field, 0}, - {"Cmd.Stdin", Field, 0}, - {"Cmd.Stdout", Field, 0}, - {"Cmd.SysProcAttr", Field, 0}, - {"Cmd.WaitDelay", Field, 20}, - {"Command", Func, 0}, - {"CommandContext", Func, 7}, - {"ErrDot", Var, 19}, - {"ErrNotFound", Var, 0}, - {"ErrWaitDelay", Var, 20}, - {"Error", Type, 0}, - {"Error.Err", Field, 0}, - {"Error.Name", Field, 0}, - {"ExitError", Type, 0}, - {"ExitError.ProcessState", Field, 0}, - {"ExitError.Stderr", Field, 6}, - {"LookPath", Func, 0}, - }, - "os/signal": { - {"Ignore", Func, 5}, - {"Ignored", Func, 11}, - {"Notify", Func, 0}, - {"NotifyContext", Func, 16}, - {"Reset", Func, 5}, - {"Stop", Func, 1}, - }, - "os/user": { - {"(*User).GroupIds", Method, 7}, - {"(UnknownGroupError).Error", Method, 7}, - {"(UnknownGroupIdError).Error", Method, 7}, - {"(UnknownUserError).Error", Method, 0}, - {"(UnknownUserIdError).Error", Method, 0}, - {"Current", Func, 0}, - {"Group", Type, 7}, - {"Group.Gid", Field, 7}, - {"Group.Name", Field, 7}, - {"Lookup", Func, 0}, - {"LookupGroup", Func, 7}, - {"LookupGroupId", Func, 7}, - {"LookupId", Func, 0}, - {"UnknownGroupError", Type, 7}, - {"UnknownGroupIdError", Type, 7}, - {"UnknownUserError", Type, 0}, - {"UnknownUserIdError", Type, 0}, - {"User", Type, 0}, - {"User.Gid", Field, 0}, - {"User.HomeDir", Field, 0}, - {"User.Name", Field, 0}, - {"User.Uid", Field, 0}, - {"User.Username", Field, 0}, - }, - "path": { - {"Base", Func, 0}, - {"Clean", Func, 0}, - {"Dir", Func, 0}, - {"ErrBadPattern", Var, 0}, - {"Ext", Func, 0}, - {"IsAbs", Func, 0}, - {"Join", Func, 0}, - {"Match", Func, 0}, - {"Split", Func, 0}, - }, - "path/filepath": { - {"Abs", Func, 0}, - {"Base", Func, 0}, - {"Clean", Func, 0}, - {"Dir", Func, 0}, - {"ErrBadPattern", Var, 0}, - {"EvalSymlinks", Func, 0}, - {"Ext", Func, 0}, - {"FromSlash", Func, 0}, - {"Glob", Func, 0}, - {"HasPrefix", Func, 0}, - {"IsAbs", Func, 0}, - {"IsLocal", Func, 20}, - {"Join", Func, 0}, - {"ListSeparator", Const, 0}, - {"Match", Func, 0}, - {"Rel", Func, 0}, - {"Separator", Const, 0}, - {"SkipAll", Var, 20}, - {"SkipDir", Var, 0}, - {"Split", Func, 0}, - {"SplitList", Func, 0}, - {"ToSlash", Func, 0}, - {"VolumeName", Func, 0}, - {"Walk", Func, 0}, - {"WalkDir", Func, 16}, - {"WalkFunc", Type, 0}, - }, - "plugin": { - {"(*Plugin).Lookup", Method, 8}, - {"Open", Func, 8}, - {"Plugin", Type, 8}, - {"Symbol", Type, 8}, - }, - "reflect": { - {"(*MapIter).Key", Method, 12}, - {"(*MapIter).Next", Method, 12}, - {"(*MapIter).Reset", Method, 18}, - {"(*MapIter).Value", Method, 12}, - {"(*ValueError).Error", Method, 0}, - {"(ChanDir).String", Method, 0}, - {"(Kind).String", Method, 0}, - {"(Method).IsExported", Method, 17}, - {"(StructField).IsExported", Method, 17}, - {"(StructTag).Get", Method, 0}, - {"(StructTag).Lookup", Method, 7}, - {"(Value).Addr", Method, 0}, - {"(Value).Bool", Method, 0}, - {"(Value).Bytes", Method, 0}, - {"(Value).Call", Method, 0}, - {"(Value).CallSlice", Method, 0}, - {"(Value).CanAddr", Method, 0}, - {"(Value).CanComplex", Method, 18}, - {"(Value).CanConvert", Method, 17}, - {"(Value).CanFloat", Method, 18}, - {"(Value).CanInt", Method, 18}, - {"(Value).CanInterface", Method, 0}, - {"(Value).CanSet", Method, 0}, - {"(Value).CanUint", Method, 18}, - {"(Value).Cap", Method, 0}, - {"(Value).Clear", Method, 21}, - {"(Value).Close", Method, 0}, - {"(Value).Comparable", Method, 20}, - {"(Value).Complex", Method, 0}, - {"(Value).Convert", Method, 1}, - {"(Value).Elem", Method, 0}, - {"(Value).Equal", Method, 20}, - {"(Value).Field", Method, 0}, - {"(Value).FieldByIndex", Method, 0}, - {"(Value).FieldByIndexErr", Method, 18}, - {"(Value).FieldByName", Method, 0}, - {"(Value).FieldByNameFunc", Method, 0}, - {"(Value).Float", Method, 0}, - {"(Value).Grow", Method, 20}, - {"(Value).Index", Method, 0}, - {"(Value).Int", Method, 0}, - {"(Value).Interface", Method, 0}, - {"(Value).InterfaceData", Method, 0}, - {"(Value).IsNil", Method, 0}, - {"(Value).IsValid", Method, 0}, - {"(Value).IsZero", Method, 13}, - {"(Value).Kind", Method, 0}, - {"(Value).Len", Method, 0}, - {"(Value).MapIndex", Method, 0}, - {"(Value).MapKeys", Method, 0}, - {"(Value).MapRange", Method, 12}, - {"(Value).Method", Method, 0}, - {"(Value).MethodByName", Method, 0}, - {"(Value).NumField", Method, 0}, - {"(Value).NumMethod", Method, 0}, - {"(Value).OverflowComplex", Method, 0}, - {"(Value).OverflowFloat", Method, 0}, - {"(Value).OverflowInt", Method, 0}, - {"(Value).OverflowUint", Method, 0}, - {"(Value).Pointer", Method, 0}, - {"(Value).Recv", Method, 0}, - {"(Value).Send", Method, 0}, - {"(Value).Set", Method, 0}, - {"(Value).SetBool", Method, 0}, - {"(Value).SetBytes", Method, 0}, - {"(Value).SetCap", Method, 2}, - {"(Value).SetComplex", Method, 0}, - {"(Value).SetFloat", Method, 0}, - {"(Value).SetInt", Method, 0}, - {"(Value).SetIterKey", Method, 18}, - {"(Value).SetIterValue", Method, 18}, - {"(Value).SetLen", Method, 0}, - {"(Value).SetMapIndex", Method, 0}, - {"(Value).SetPointer", Method, 0}, - {"(Value).SetString", Method, 0}, - {"(Value).SetUint", Method, 0}, - {"(Value).SetZero", Method, 20}, - {"(Value).Slice", Method, 0}, - {"(Value).Slice3", Method, 2}, - {"(Value).String", Method, 0}, - {"(Value).TryRecv", Method, 0}, - {"(Value).TrySend", Method, 0}, - {"(Value).Type", Method, 0}, - {"(Value).Uint", Method, 0}, - {"(Value).UnsafeAddr", Method, 0}, - {"(Value).UnsafePointer", Method, 18}, - {"Append", Func, 0}, - {"AppendSlice", Func, 0}, - {"Array", Const, 0}, - {"ArrayOf", Func, 5}, - {"Bool", Const, 0}, - {"BothDir", Const, 0}, - {"Chan", Const, 0}, - {"ChanDir", Type, 0}, - {"ChanOf", Func, 1}, - {"Complex128", Const, 0}, - {"Complex64", Const, 0}, - {"Copy", Func, 0}, - {"DeepEqual", Func, 0}, - {"Float32", Const, 0}, - {"Float64", Const, 0}, - {"Func", Const, 0}, - {"FuncOf", Func, 5}, - {"Indirect", Func, 0}, - {"Int", Const, 0}, - {"Int16", Const, 0}, - {"Int32", Const, 0}, - {"Int64", Const, 0}, - {"Int8", Const, 0}, - {"Interface", Const, 0}, - {"Invalid", Const, 0}, - {"Kind", Type, 0}, - {"MakeChan", Func, 0}, - {"MakeFunc", Func, 1}, - {"MakeMap", Func, 0}, - {"MakeMapWithSize", Func, 9}, - {"MakeSlice", Func, 0}, - {"Map", Const, 0}, - {"MapIter", Type, 12}, - {"MapOf", Func, 1}, - {"Method", Type, 0}, - {"Method.Func", Field, 0}, - {"Method.Index", Field, 0}, - {"Method.Name", Field, 0}, - {"Method.PkgPath", Field, 0}, - {"Method.Type", Field, 0}, - {"New", Func, 0}, - {"NewAt", Func, 0}, - {"Pointer", Const, 18}, - {"PointerTo", Func, 18}, - {"Ptr", Const, 0}, - {"PtrTo", Func, 0}, - {"RecvDir", Const, 0}, - {"Select", Func, 1}, - {"SelectCase", Type, 1}, - {"SelectCase.Chan", Field, 1}, - {"SelectCase.Dir", Field, 1}, - {"SelectCase.Send", Field, 1}, - {"SelectDefault", Const, 1}, - {"SelectDir", Type, 1}, - {"SelectRecv", Const, 1}, - {"SelectSend", Const, 1}, - {"SendDir", Const, 0}, - {"Slice", Const, 0}, - {"SliceHeader", Type, 0}, - {"SliceHeader.Cap", Field, 0}, - {"SliceHeader.Data", Field, 0}, - {"SliceHeader.Len", Field, 0}, - {"SliceOf", Func, 1}, - {"String", Const, 0}, - {"StringHeader", Type, 0}, - {"StringHeader.Data", Field, 0}, - {"StringHeader.Len", Field, 0}, - {"Struct", Const, 0}, - {"StructField", Type, 0}, - {"StructField.Anonymous", Field, 0}, - {"StructField.Index", Field, 0}, - {"StructField.Name", Field, 0}, - {"StructField.Offset", Field, 0}, - {"StructField.PkgPath", Field, 0}, - {"StructField.Tag", Field, 0}, - {"StructField.Type", Field, 0}, - {"StructOf", Func, 7}, - {"StructTag", Type, 0}, - {"Swapper", Func, 8}, - {"Type", Type, 0}, - {"TypeFor", Func, 22}, - {"TypeOf", Func, 0}, - {"Uint", Const, 0}, - {"Uint16", Const, 0}, - {"Uint32", Const, 0}, - {"Uint64", Const, 0}, - {"Uint8", Const, 0}, - {"Uintptr", Const, 0}, - {"UnsafePointer", Const, 0}, - {"Value", Type, 0}, - {"ValueError", Type, 0}, - {"ValueError.Kind", Field, 0}, - {"ValueError.Method", Field, 0}, - {"ValueOf", Func, 0}, - {"VisibleFields", Func, 17}, - {"Zero", Func, 0}, - }, - "regexp": { - {"(*Regexp).Copy", Method, 6}, - {"(*Regexp).Expand", Method, 0}, - {"(*Regexp).ExpandString", Method, 0}, - {"(*Regexp).Find", Method, 0}, - {"(*Regexp).FindAll", Method, 0}, - {"(*Regexp).FindAllIndex", Method, 0}, - {"(*Regexp).FindAllString", Method, 0}, - {"(*Regexp).FindAllStringIndex", Method, 0}, - {"(*Regexp).FindAllStringSubmatch", Method, 0}, - {"(*Regexp).FindAllStringSubmatchIndex", Method, 0}, - {"(*Regexp).FindAllSubmatch", Method, 0}, - {"(*Regexp).FindAllSubmatchIndex", Method, 0}, - {"(*Regexp).FindIndex", Method, 0}, - {"(*Regexp).FindReaderIndex", Method, 0}, - {"(*Regexp).FindReaderSubmatchIndex", Method, 0}, - {"(*Regexp).FindString", Method, 0}, - {"(*Regexp).FindStringIndex", Method, 0}, - {"(*Regexp).FindStringSubmatch", Method, 0}, - {"(*Regexp).FindStringSubmatchIndex", Method, 0}, - {"(*Regexp).FindSubmatch", Method, 0}, - {"(*Regexp).FindSubmatchIndex", Method, 0}, - {"(*Regexp).LiteralPrefix", Method, 0}, - {"(*Regexp).Longest", Method, 1}, - {"(*Regexp).MarshalText", Method, 21}, - {"(*Regexp).Match", Method, 0}, - {"(*Regexp).MatchReader", Method, 0}, - {"(*Regexp).MatchString", Method, 0}, - {"(*Regexp).NumSubexp", Method, 0}, - {"(*Regexp).ReplaceAll", Method, 0}, - {"(*Regexp).ReplaceAllFunc", Method, 0}, - {"(*Regexp).ReplaceAllLiteral", Method, 0}, - {"(*Regexp).ReplaceAllLiteralString", Method, 0}, - {"(*Regexp).ReplaceAllString", Method, 0}, - {"(*Regexp).ReplaceAllStringFunc", Method, 0}, - {"(*Regexp).Split", Method, 1}, - {"(*Regexp).String", Method, 0}, - {"(*Regexp).SubexpIndex", Method, 15}, - {"(*Regexp).SubexpNames", Method, 0}, - {"(*Regexp).UnmarshalText", Method, 21}, - {"Compile", Func, 0}, - {"CompilePOSIX", Func, 0}, - {"Match", Func, 0}, - {"MatchReader", Func, 0}, - {"MatchString", Func, 0}, - {"MustCompile", Func, 0}, - {"MustCompilePOSIX", Func, 0}, - {"QuoteMeta", Func, 0}, - {"Regexp", Type, 0}, - }, - "regexp/syntax": { - {"(*Error).Error", Method, 0}, - {"(*Inst).MatchEmptyWidth", Method, 0}, - {"(*Inst).MatchRune", Method, 0}, - {"(*Inst).MatchRunePos", Method, 3}, - {"(*Inst).String", Method, 0}, - {"(*Prog).Prefix", Method, 0}, - {"(*Prog).StartCond", Method, 0}, - {"(*Prog).String", Method, 0}, - {"(*Regexp).CapNames", Method, 0}, - {"(*Regexp).Equal", Method, 0}, - {"(*Regexp).MaxCap", Method, 0}, - {"(*Regexp).Simplify", Method, 0}, - {"(*Regexp).String", Method, 0}, - {"(ErrorCode).String", Method, 0}, - {"(InstOp).String", Method, 3}, - {"(Op).String", Method, 11}, - {"ClassNL", Const, 0}, - {"Compile", Func, 0}, - {"DotNL", Const, 0}, - {"EmptyBeginLine", Const, 0}, - {"EmptyBeginText", Const, 0}, - {"EmptyEndLine", Const, 0}, - {"EmptyEndText", Const, 0}, - {"EmptyNoWordBoundary", Const, 0}, - {"EmptyOp", Type, 0}, - {"EmptyOpContext", Func, 0}, - {"EmptyWordBoundary", Const, 0}, - {"ErrInternalError", Const, 0}, - {"ErrInvalidCharClass", Const, 0}, - {"ErrInvalidCharRange", Const, 0}, - {"ErrInvalidEscape", Const, 0}, - {"ErrInvalidNamedCapture", Const, 0}, - {"ErrInvalidPerlOp", Const, 0}, - {"ErrInvalidRepeatOp", Const, 0}, - {"ErrInvalidRepeatSize", Const, 0}, - {"ErrInvalidUTF8", Const, 0}, - {"ErrLarge", Const, 20}, - {"ErrMissingBracket", Const, 0}, - {"ErrMissingParen", Const, 0}, - {"ErrMissingRepeatArgument", Const, 0}, - {"ErrNestingDepth", Const, 19}, - {"ErrTrailingBackslash", Const, 0}, - {"ErrUnexpectedParen", Const, 1}, - {"Error", Type, 0}, - {"Error.Code", Field, 0}, - {"Error.Expr", Field, 0}, - {"ErrorCode", Type, 0}, - {"Flags", Type, 0}, - {"FoldCase", Const, 0}, - {"Inst", Type, 0}, - {"Inst.Arg", Field, 0}, - {"Inst.Op", Field, 0}, - {"Inst.Out", Field, 0}, - {"Inst.Rune", Field, 0}, - {"InstAlt", Const, 0}, - {"InstAltMatch", Const, 0}, - {"InstCapture", Const, 0}, - {"InstEmptyWidth", Const, 0}, - {"InstFail", Const, 0}, - {"InstMatch", Const, 0}, - {"InstNop", Const, 0}, - {"InstOp", Type, 0}, - {"InstRune", Const, 0}, - {"InstRune1", Const, 0}, - {"InstRuneAny", Const, 0}, - {"InstRuneAnyNotNL", Const, 0}, - {"IsWordChar", Func, 0}, - {"Literal", Const, 0}, - {"MatchNL", Const, 0}, - {"NonGreedy", Const, 0}, - {"OneLine", Const, 0}, - {"Op", Type, 0}, - {"OpAlternate", Const, 0}, - {"OpAnyChar", Const, 0}, - {"OpAnyCharNotNL", Const, 0}, - {"OpBeginLine", Const, 0}, - {"OpBeginText", Const, 0}, - {"OpCapture", Const, 0}, - {"OpCharClass", Const, 0}, - {"OpConcat", Const, 0}, - {"OpEmptyMatch", Const, 0}, - {"OpEndLine", Const, 0}, - {"OpEndText", Const, 0}, - {"OpLiteral", Const, 0}, - {"OpNoMatch", Const, 0}, - {"OpNoWordBoundary", Const, 0}, - {"OpPlus", Const, 0}, - {"OpQuest", Const, 0}, - {"OpRepeat", Const, 0}, - {"OpStar", Const, 0}, - {"OpWordBoundary", Const, 0}, - {"POSIX", Const, 0}, - {"Parse", Func, 0}, - {"Perl", Const, 0}, - {"PerlX", Const, 0}, - {"Prog", Type, 0}, - {"Prog.Inst", Field, 0}, - {"Prog.NumCap", Field, 0}, - {"Prog.Start", Field, 0}, - {"Regexp", Type, 0}, - {"Regexp.Cap", Field, 0}, - {"Regexp.Flags", Field, 0}, - {"Regexp.Max", Field, 0}, - {"Regexp.Min", Field, 0}, - {"Regexp.Name", Field, 0}, - {"Regexp.Op", Field, 0}, - {"Regexp.Rune", Field, 0}, - {"Regexp.Rune0", Field, 0}, - {"Regexp.Sub", Field, 0}, - {"Regexp.Sub0", Field, 0}, - {"Simple", Const, 0}, - {"UnicodeGroups", Const, 0}, - {"WasDollar", Const, 0}, - }, - "runtime": { - {"(*BlockProfileRecord).Stack", Method, 1}, - {"(*Frames).Next", Method, 7}, - {"(*Func).Entry", Method, 0}, - {"(*Func).FileLine", Method, 0}, - {"(*Func).Name", Method, 0}, - {"(*MemProfileRecord).InUseBytes", Method, 0}, - {"(*MemProfileRecord).InUseObjects", Method, 0}, - {"(*MemProfileRecord).Stack", Method, 0}, - {"(*PanicNilError).Error", Method, 21}, - {"(*PanicNilError).RuntimeError", Method, 21}, - {"(*Pinner).Pin", Method, 21}, - {"(*Pinner).Unpin", Method, 21}, - {"(*StackRecord).Stack", Method, 0}, - {"(*TypeAssertionError).Error", Method, 0}, - {"(*TypeAssertionError).RuntimeError", Method, 0}, - {"BlockProfile", Func, 1}, - {"BlockProfileRecord", Type, 1}, - {"BlockProfileRecord.Count", Field, 1}, - {"BlockProfileRecord.Cycles", Field, 1}, - {"BlockProfileRecord.StackRecord", Field, 1}, - {"Breakpoint", Func, 0}, - {"CPUProfile", Func, 0}, - {"Caller", Func, 0}, - {"Callers", Func, 0}, - {"CallersFrames", Func, 7}, - {"Compiler", Const, 0}, - {"Error", Type, 0}, - {"Frame", Type, 7}, - {"Frame.Entry", Field, 7}, - {"Frame.File", Field, 7}, - {"Frame.Func", Field, 7}, - {"Frame.Function", Field, 7}, - {"Frame.Line", Field, 7}, - {"Frame.PC", Field, 7}, - {"Frames", Type, 7}, - {"Func", Type, 0}, - {"FuncForPC", Func, 0}, - {"GC", Func, 0}, - {"GOARCH", Const, 0}, - {"GOMAXPROCS", Func, 0}, - {"GOOS", Const, 0}, - {"GOROOT", Func, 0}, - {"Goexit", Func, 0}, - {"GoroutineProfile", Func, 0}, - {"Gosched", Func, 0}, - {"KeepAlive", Func, 7}, - {"LockOSThread", Func, 0}, - {"MemProfile", Func, 0}, - {"MemProfileRate", Var, 0}, - {"MemProfileRecord", Type, 0}, - {"MemProfileRecord.AllocBytes", Field, 0}, - {"MemProfileRecord.AllocObjects", Field, 0}, - {"MemProfileRecord.FreeBytes", Field, 0}, - {"MemProfileRecord.FreeObjects", Field, 0}, - {"MemProfileRecord.Stack0", Field, 0}, - {"MemStats", Type, 0}, - {"MemStats.Alloc", Field, 0}, - {"MemStats.BuckHashSys", Field, 0}, - {"MemStats.BySize", Field, 0}, - {"MemStats.DebugGC", Field, 0}, - {"MemStats.EnableGC", Field, 0}, - {"MemStats.Frees", Field, 0}, - {"MemStats.GCCPUFraction", Field, 5}, - {"MemStats.GCSys", Field, 2}, - {"MemStats.HeapAlloc", Field, 0}, - {"MemStats.HeapIdle", Field, 0}, - {"MemStats.HeapInuse", Field, 0}, - {"MemStats.HeapObjects", Field, 0}, - {"MemStats.HeapReleased", Field, 0}, - {"MemStats.HeapSys", Field, 0}, - {"MemStats.LastGC", Field, 0}, - {"MemStats.Lookups", Field, 0}, - {"MemStats.MCacheInuse", Field, 0}, - {"MemStats.MCacheSys", Field, 0}, - {"MemStats.MSpanInuse", Field, 0}, - {"MemStats.MSpanSys", Field, 0}, - {"MemStats.Mallocs", Field, 0}, - {"MemStats.NextGC", Field, 0}, - {"MemStats.NumForcedGC", Field, 8}, - {"MemStats.NumGC", Field, 0}, - {"MemStats.OtherSys", Field, 2}, - {"MemStats.PauseEnd", Field, 4}, - {"MemStats.PauseNs", Field, 0}, - {"MemStats.PauseTotalNs", Field, 0}, - {"MemStats.StackInuse", Field, 0}, - {"MemStats.StackSys", Field, 0}, - {"MemStats.Sys", Field, 0}, - {"MemStats.TotalAlloc", Field, 0}, - {"MutexProfile", Func, 8}, - {"NumCPU", Func, 0}, - {"NumCgoCall", Func, 0}, - {"NumGoroutine", Func, 0}, - {"PanicNilError", Type, 21}, - {"Pinner", Type, 21}, - {"ReadMemStats", Func, 0}, - {"ReadTrace", Func, 5}, - {"SetBlockProfileRate", Func, 1}, - {"SetCPUProfileRate", Func, 0}, - {"SetCgoTraceback", Func, 7}, - {"SetFinalizer", Func, 0}, - {"SetMutexProfileFraction", Func, 8}, - {"Stack", Func, 0}, - {"StackRecord", Type, 0}, - {"StackRecord.Stack0", Field, 0}, - {"StartTrace", Func, 5}, - {"StopTrace", Func, 5}, - {"ThreadCreateProfile", Func, 0}, - {"TypeAssertionError", Type, 0}, - {"UnlockOSThread", Func, 0}, - {"Version", Func, 0}, - }, - "runtime/cgo": { - {"(Handle).Delete", Method, 17}, - {"(Handle).Value", Method, 17}, - {"Handle", Type, 17}, - {"Incomplete", Type, 20}, - {"NewHandle", Func, 17}, - }, - "runtime/coverage": { - {"ClearCounters", Func, 20}, - {"WriteCounters", Func, 20}, - {"WriteCountersDir", Func, 20}, - {"WriteMeta", Func, 20}, - {"WriteMetaDir", Func, 20}, - }, - "runtime/debug": { - {"(*BuildInfo).String", Method, 18}, - {"BuildInfo", Type, 12}, - {"BuildInfo.Deps", Field, 12}, - {"BuildInfo.GoVersion", Field, 18}, - {"BuildInfo.Main", Field, 12}, - {"BuildInfo.Path", Field, 12}, - {"BuildInfo.Settings", Field, 18}, - {"BuildSetting", Type, 18}, - {"BuildSetting.Key", Field, 18}, - {"BuildSetting.Value", Field, 18}, - {"FreeOSMemory", Func, 1}, - {"GCStats", Type, 1}, - {"GCStats.LastGC", Field, 1}, - {"GCStats.NumGC", Field, 1}, - {"GCStats.Pause", Field, 1}, - {"GCStats.PauseEnd", Field, 4}, - {"GCStats.PauseQuantiles", Field, 1}, - {"GCStats.PauseTotal", Field, 1}, - {"Module", Type, 12}, - {"Module.Path", Field, 12}, - {"Module.Replace", Field, 12}, - {"Module.Sum", Field, 12}, - {"Module.Version", Field, 12}, - {"ParseBuildInfo", Func, 18}, - {"PrintStack", Func, 0}, - {"ReadBuildInfo", Func, 12}, - {"ReadGCStats", Func, 1}, - {"SetGCPercent", Func, 1}, - {"SetMaxStack", Func, 2}, - {"SetMaxThreads", Func, 2}, - {"SetMemoryLimit", Func, 19}, - {"SetPanicOnFault", Func, 3}, - {"SetTraceback", Func, 6}, - {"Stack", Func, 0}, - {"WriteHeapDump", Func, 3}, - }, - "runtime/metrics": { - {"(Value).Float64", Method, 16}, - {"(Value).Float64Histogram", Method, 16}, - {"(Value).Kind", Method, 16}, - {"(Value).Uint64", Method, 16}, - {"All", Func, 16}, - {"Description", Type, 16}, - {"Description.Cumulative", Field, 16}, - {"Description.Description", Field, 16}, - {"Description.Kind", Field, 16}, - {"Description.Name", Field, 16}, - {"Float64Histogram", Type, 16}, - {"Float64Histogram.Buckets", Field, 16}, - {"Float64Histogram.Counts", Field, 16}, - {"KindBad", Const, 16}, - {"KindFloat64", Const, 16}, - {"KindFloat64Histogram", Const, 16}, - {"KindUint64", Const, 16}, - {"Read", Func, 16}, - {"Sample", Type, 16}, - {"Sample.Name", Field, 16}, - {"Sample.Value", Field, 16}, - {"Value", Type, 16}, - {"ValueKind", Type, 16}, - }, - "runtime/pprof": { - {"(*Profile).Add", Method, 0}, - {"(*Profile).Count", Method, 0}, - {"(*Profile).Name", Method, 0}, - {"(*Profile).Remove", Method, 0}, - {"(*Profile).WriteTo", Method, 0}, - {"Do", Func, 9}, - {"ForLabels", Func, 9}, - {"Label", Func, 9}, - {"LabelSet", Type, 9}, - {"Labels", Func, 9}, - {"Lookup", Func, 0}, - {"NewProfile", Func, 0}, - {"Profile", Type, 0}, - {"Profiles", Func, 0}, - {"SetGoroutineLabels", Func, 9}, - {"StartCPUProfile", Func, 0}, - {"StopCPUProfile", Func, 0}, - {"WithLabels", Func, 9}, - {"WriteHeapProfile", Func, 0}, - }, - "runtime/trace": { - {"(*Region).End", Method, 11}, - {"(*Task).End", Method, 11}, - {"IsEnabled", Func, 11}, - {"Log", Func, 11}, - {"Logf", Func, 11}, - {"NewTask", Func, 11}, - {"Region", Type, 11}, - {"Start", Func, 5}, - {"StartRegion", Func, 11}, - {"Stop", Func, 5}, - {"Task", Type, 11}, - {"WithRegion", Func, 11}, - }, - "slices": { - {"BinarySearch", Func, 21}, - {"BinarySearchFunc", Func, 21}, - {"Clip", Func, 21}, - {"Clone", Func, 21}, - {"Compact", Func, 21}, - {"CompactFunc", Func, 21}, - {"Compare", Func, 21}, - {"CompareFunc", Func, 21}, - {"Concat", Func, 22}, - {"Contains", Func, 21}, - {"ContainsFunc", Func, 21}, - {"Delete", Func, 21}, - {"DeleteFunc", Func, 21}, - {"Equal", Func, 21}, - {"EqualFunc", Func, 21}, - {"Grow", Func, 21}, - {"Index", Func, 21}, - {"IndexFunc", Func, 21}, - {"Insert", Func, 21}, - {"IsSorted", Func, 21}, - {"IsSortedFunc", Func, 21}, - {"Max", Func, 21}, - {"MaxFunc", Func, 21}, - {"Min", Func, 21}, - {"MinFunc", Func, 21}, - {"Replace", Func, 21}, - {"Reverse", Func, 21}, - {"Sort", Func, 21}, - {"SortFunc", Func, 21}, - {"SortStableFunc", Func, 21}, - }, - "sort": { - {"(Float64Slice).Len", Method, 0}, - {"(Float64Slice).Less", Method, 0}, - {"(Float64Slice).Search", Method, 0}, - {"(Float64Slice).Sort", Method, 0}, - {"(Float64Slice).Swap", Method, 0}, - {"(IntSlice).Len", Method, 0}, - {"(IntSlice).Less", Method, 0}, - {"(IntSlice).Search", Method, 0}, - {"(IntSlice).Sort", Method, 0}, - {"(IntSlice).Swap", Method, 0}, - {"(StringSlice).Len", Method, 0}, - {"(StringSlice).Less", Method, 0}, - {"(StringSlice).Search", Method, 0}, - {"(StringSlice).Sort", Method, 0}, - {"(StringSlice).Swap", Method, 0}, - {"Find", Func, 19}, - {"Float64Slice", Type, 0}, - {"Float64s", Func, 0}, - {"Float64sAreSorted", Func, 0}, - {"IntSlice", Type, 0}, - {"Interface", Type, 0}, - {"Ints", Func, 0}, - {"IntsAreSorted", Func, 0}, - {"IsSorted", Func, 0}, - {"Reverse", Func, 1}, - {"Search", Func, 0}, - {"SearchFloat64s", Func, 0}, - {"SearchInts", Func, 0}, - {"SearchStrings", Func, 0}, - {"Slice", Func, 8}, - {"SliceIsSorted", Func, 8}, - {"SliceStable", Func, 8}, - {"Sort", Func, 0}, - {"Stable", Func, 2}, - {"StringSlice", Type, 0}, - {"Strings", Func, 0}, - {"StringsAreSorted", Func, 0}, - }, - "strconv": { - {"(*NumError).Error", Method, 0}, - {"(*NumError).Unwrap", Method, 14}, - {"AppendBool", Func, 0}, - {"AppendFloat", Func, 0}, - {"AppendInt", Func, 0}, - {"AppendQuote", Func, 0}, - {"AppendQuoteRune", Func, 0}, - {"AppendQuoteRuneToASCII", Func, 0}, - {"AppendQuoteRuneToGraphic", Func, 6}, - {"AppendQuoteToASCII", Func, 0}, - {"AppendQuoteToGraphic", Func, 6}, - {"AppendUint", Func, 0}, - {"Atoi", Func, 0}, - {"CanBackquote", Func, 0}, - {"ErrRange", Var, 0}, - {"ErrSyntax", Var, 0}, - {"FormatBool", Func, 0}, - {"FormatComplex", Func, 15}, - {"FormatFloat", Func, 0}, - {"FormatInt", Func, 0}, - {"FormatUint", Func, 0}, - {"IntSize", Const, 0}, - {"IsGraphic", Func, 6}, - {"IsPrint", Func, 0}, - {"Itoa", Func, 0}, - {"NumError", Type, 0}, - {"NumError.Err", Field, 0}, - {"NumError.Func", Field, 0}, - {"NumError.Num", Field, 0}, - {"ParseBool", Func, 0}, - {"ParseComplex", Func, 15}, - {"ParseFloat", Func, 0}, - {"ParseInt", Func, 0}, - {"ParseUint", Func, 0}, - {"Quote", Func, 0}, - {"QuoteRune", Func, 0}, - {"QuoteRuneToASCII", Func, 0}, - {"QuoteRuneToGraphic", Func, 6}, - {"QuoteToASCII", Func, 0}, - {"QuoteToGraphic", Func, 6}, - {"QuotedPrefix", Func, 17}, - {"Unquote", Func, 0}, - {"UnquoteChar", Func, 0}, - }, - "strings": { - {"(*Builder).Cap", Method, 12}, - {"(*Builder).Grow", Method, 10}, - {"(*Builder).Len", Method, 10}, - {"(*Builder).Reset", Method, 10}, - {"(*Builder).String", Method, 10}, - {"(*Builder).Write", Method, 10}, - {"(*Builder).WriteByte", Method, 10}, - {"(*Builder).WriteRune", Method, 10}, - {"(*Builder).WriteString", Method, 10}, - {"(*Reader).Len", Method, 0}, - {"(*Reader).Read", Method, 0}, - {"(*Reader).ReadAt", Method, 0}, - {"(*Reader).ReadByte", Method, 0}, - {"(*Reader).ReadRune", Method, 0}, - {"(*Reader).Reset", Method, 7}, - {"(*Reader).Seek", Method, 0}, - {"(*Reader).Size", Method, 5}, - {"(*Reader).UnreadByte", Method, 0}, - {"(*Reader).UnreadRune", Method, 0}, - {"(*Reader).WriteTo", Method, 1}, - {"(*Replacer).Replace", Method, 0}, - {"(*Replacer).WriteString", Method, 0}, - {"Builder", Type, 10}, - {"Clone", Func, 18}, - {"Compare", Func, 5}, - {"Contains", Func, 0}, - {"ContainsAny", Func, 0}, - {"ContainsFunc", Func, 21}, - {"ContainsRune", Func, 0}, - {"Count", Func, 0}, - {"Cut", Func, 18}, - {"CutPrefix", Func, 20}, - {"CutSuffix", Func, 20}, - {"EqualFold", Func, 0}, - {"Fields", Func, 0}, - {"FieldsFunc", Func, 0}, - {"HasPrefix", Func, 0}, - {"HasSuffix", Func, 0}, - {"Index", Func, 0}, - {"IndexAny", Func, 0}, - {"IndexByte", Func, 2}, - {"IndexFunc", Func, 0}, - {"IndexRune", Func, 0}, - {"Join", Func, 0}, - {"LastIndex", Func, 0}, - {"LastIndexAny", Func, 0}, - {"LastIndexByte", Func, 5}, - {"LastIndexFunc", Func, 0}, - {"Map", Func, 0}, - {"NewReader", Func, 0}, - {"NewReplacer", Func, 0}, - {"Reader", Type, 0}, - {"Repeat", Func, 0}, - {"Replace", Func, 0}, - {"ReplaceAll", Func, 12}, - {"Replacer", Type, 0}, - {"Split", Func, 0}, - {"SplitAfter", Func, 0}, - {"SplitAfterN", Func, 0}, - {"SplitN", Func, 0}, - {"Title", Func, 0}, - {"ToLower", Func, 0}, - {"ToLowerSpecial", Func, 0}, - {"ToTitle", Func, 0}, - {"ToTitleSpecial", Func, 0}, - {"ToUpper", Func, 0}, - {"ToUpperSpecial", Func, 0}, - {"ToValidUTF8", Func, 13}, - {"Trim", Func, 0}, - {"TrimFunc", Func, 0}, - {"TrimLeft", Func, 0}, - {"TrimLeftFunc", Func, 0}, - {"TrimPrefix", Func, 1}, - {"TrimRight", Func, 0}, - {"TrimRightFunc", Func, 0}, - {"TrimSpace", Func, 0}, - {"TrimSuffix", Func, 1}, - }, - "sync": { - {"(*Cond).Broadcast", Method, 0}, - {"(*Cond).Signal", Method, 0}, - {"(*Cond).Wait", Method, 0}, - {"(*Map).CompareAndDelete", Method, 20}, - {"(*Map).CompareAndSwap", Method, 20}, - {"(*Map).Delete", Method, 9}, - {"(*Map).Load", Method, 9}, - {"(*Map).LoadAndDelete", Method, 15}, - {"(*Map).LoadOrStore", Method, 9}, - {"(*Map).Range", Method, 9}, - {"(*Map).Store", Method, 9}, - {"(*Map).Swap", Method, 20}, - {"(*Mutex).Lock", Method, 0}, - {"(*Mutex).TryLock", Method, 18}, - {"(*Mutex).Unlock", Method, 0}, - {"(*Once).Do", Method, 0}, - {"(*Pool).Get", Method, 3}, - {"(*Pool).Put", Method, 3}, - {"(*RWMutex).Lock", Method, 0}, - {"(*RWMutex).RLock", Method, 0}, - {"(*RWMutex).RLocker", Method, 0}, - {"(*RWMutex).RUnlock", Method, 0}, - {"(*RWMutex).TryLock", Method, 18}, - {"(*RWMutex).TryRLock", Method, 18}, - {"(*RWMutex).Unlock", Method, 0}, - {"(*WaitGroup).Add", Method, 0}, - {"(*WaitGroup).Done", Method, 0}, - {"(*WaitGroup).Wait", Method, 0}, - {"Cond", Type, 0}, - {"Cond.L", Field, 0}, - {"Locker", Type, 0}, - {"Map", Type, 9}, - {"Mutex", Type, 0}, - {"NewCond", Func, 0}, - {"Once", Type, 0}, - {"OnceFunc", Func, 21}, - {"OnceValue", Func, 21}, - {"OnceValues", Func, 21}, - {"Pool", Type, 3}, - {"Pool.New", Field, 3}, - {"RWMutex", Type, 0}, - {"WaitGroup", Type, 0}, - }, - "sync/atomic": { - {"(*Bool).CompareAndSwap", Method, 19}, - {"(*Bool).Load", Method, 19}, - {"(*Bool).Store", Method, 19}, - {"(*Bool).Swap", Method, 19}, - {"(*Int32).Add", Method, 19}, - {"(*Int32).CompareAndSwap", Method, 19}, - {"(*Int32).Load", Method, 19}, - {"(*Int32).Store", Method, 19}, - {"(*Int32).Swap", Method, 19}, - {"(*Int64).Add", Method, 19}, - {"(*Int64).CompareAndSwap", Method, 19}, - {"(*Int64).Load", Method, 19}, - {"(*Int64).Store", Method, 19}, - {"(*Int64).Swap", Method, 19}, - {"(*Pointer).CompareAndSwap", Method, 19}, - {"(*Pointer).Load", Method, 19}, - {"(*Pointer).Store", Method, 19}, - {"(*Pointer).Swap", Method, 19}, - {"(*Uint32).Add", Method, 19}, - {"(*Uint32).CompareAndSwap", Method, 19}, - {"(*Uint32).Load", Method, 19}, - {"(*Uint32).Store", Method, 19}, - {"(*Uint32).Swap", Method, 19}, - {"(*Uint64).Add", Method, 19}, - {"(*Uint64).CompareAndSwap", Method, 19}, - {"(*Uint64).Load", Method, 19}, - {"(*Uint64).Store", Method, 19}, - {"(*Uint64).Swap", Method, 19}, - {"(*Uintptr).Add", Method, 19}, - {"(*Uintptr).CompareAndSwap", Method, 19}, - {"(*Uintptr).Load", Method, 19}, - {"(*Uintptr).Store", Method, 19}, - {"(*Uintptr).Swap", Method, 19}, - {"(*Value).CompareAndSwap", Method, 17}, - {"(*Value).Load", Method, 4}, - {"(*Value).Store", Method, 4}, - {"(*Value).Swap", Method, 17}, - {"AddInt32", Func, 0}, - {"AddInt64", Func, 0}, - {"AddUint32", Func, 0}, - {"AddUint64", Func, 0}, - {"AddUintptr", Func, 0}, - {"Bool", Type, 19}, - {"CompareAndSwapInt32", Func, 0}, - {"CompareAndSwapInt64", Func, 0}, - {"CompareAndSwapPointer", Func, 0}, - {"CompareAndSwapUint32", Func, 0}, - {"CompareAndSwapUint64", Func, 0}, - {"CompareAndSwapUintptr", Func, 0}, - {"Int32", Type, 19}, - {"Int64", Type, 19}, - {"LoadInt32", Func, 0}, - {"LoadInt64", Func, 0}, - {"LoadPointer", Func, 0}, - {"LoadUint32", Func, 0}, - {"LoadUint64", Func, 0}, - {"LoadUintptr", Func, 0}, - {"Pointer", Type, 19}, - {"StoreInt32", Func, 0}, - {"StoreInt64", Func, 0}, - {"StorePointer", Func, 0}, - {"StoreUint32", Func, 0}, - {"StoreUint64", Func, 0}, - {"StoreUintptr", Func, 0}, - {"SwapInt32", Func, 2}, - {"SwapInt64", Func, 2}, - {"SwapPointer", Func, 2}, - {"SwapUint32", Func, 2}, - {"SwapUint64", Func, 2}, - {"SwapUintptr", Func, 2}, - {"Uint32", Type, 19}, - {"Uint64", Type, 19}, - {"Uintptr", Type, 19}, - {"Value", Type, 4}, - }, - "syscall": { - {"(*Cmsghdr).SetLen", Method, 0}, - {"(*DLL).FindProc", Method, 0}, - {"(*DLL).MustFindProc", Method, 0}, - {"(*DLL).Release", Method, 0}, - {"(*DLLError).Error", Method, 0}, - {"(*DLLError).Unwrap", Method, 16}, - {"(*Filetime).Nanoseconds", Method, 0}, - {"(*Iovec).SetLen", Method, 0}, - {"(*LazyDLL).Handle", Method, 0}, - {"(*LazyDLL).Load", Method, 0}, - {"(*LazyDLL).NewProc", Method, 0}, - {"(*LazyProc).Addr", Method, 0}, - {"(*LazyProc).Call", Method, 0}, - {"(*LazyProc).Find", Method, 0}, - {"(*Msghdr).SetControllen", Method, 0}, - {"(*Proc).Addr", Method, 0}, - {"(*Proc).Call", Method, 0}, - {"(*PtraceRegs).PC", Method, 0}, - {"(*PtraceRegs).SetPC", Method, 0}, - {"(*RawSockaddrAny).Sockaddr", Method, 0}, - {"(*SID).Copy", Method, 0}, - {"(*SID).Len", Method, 0}, - {"(*SID).LookupAccount", Method, 0}, - {"(*SID).String", Method, 0}, - {"(*Timespec).Nano", Method, 0}, - {"(*Timespec).Unix", Method, 0}, - {"(*Timeval).Nano", Method, 0}, - {"(*Timeval).Nanoseconds", Method, 0}, - {"(*Timeval).Unix", Method, 0}, - {"(Errno).Error", Method, 0}, - {"(Errno).Is", Method, 13}, - {"(Errno).Temporary", Method, 0}, - {"(Errno).Timeout", Method, 0}, - {"(Signal).Signal", Method, 0}, - {"(Signal).String", Method, 0}, - {"(Token).Close", Method, 0}, - {"(Token).GetTokenPrimaryGroup", Method, 0}, - {"(Token).GetTokenUser", Method, 0}, - {"(Token).GetUserProfileDirectory", Method, 0}, - {"(WaitStatus).Continued", Method, 0}, - {"(WaitStatus).CoreDump", Method, 0}, - {"(WaitStatus).ExitStatus", Method, 0}, - {"(WaitStatus).Exited", Method, 0}, - {"(WaitStatus).Signal", Method, 0}, - {"(WaitStatus).Signaled", Method, 0}, - {"(WaitStatus).StopSignal", Method, 0}, - {"(WaitStatus).Stopped", Method, 0}, - {"(WaitStatus).TrapCause", Method, 0}, - {"AF_ALG", Const, 0}, - {"AF_APPLETALK", Const, 0}, - {"AF_ARP", Const, 0}, - {"AF_ASH", Const, 0}, - {"AF_ATM", Const, 0}, - {"AF_ATMPVC", Const, 0}, - {"AF_ATMSVC", Const, 0}, - {"AF_AX25", Const, 0}, - {"AF_BLUETOOTH", Const, 0}, - {"AF_BRIDGE", Const, 0}, - {"AF_CAIF", Const, 0}, - {"AF_CAN", Const, 0}, - {"AF_CCITT", Const, 0}, - {"AF_CHAOS", Const, 0}, - {"AF_CNT", Const, 0}, - {"AF_COIP", Const, 0}, - {"AF_DATAKIT", Const, 0}, - {"AF_DECnet", Const, 0}, - {"AF_DLI", Const, 0}, - {"AF_E164", Const, 0}, - {"AF_ECMA", Const, 0}, - {"AF_ECONET", Const, 0}, - {"AF_ENCAP", Const, 1}, - {"AF_FILE", Const, 0}, - {"AF_HYLINK", Const, 0}, - {"AF_IEEE80211", Const, 0}, - {"AF_IEEE802154", Const, 0}, - {"AF_IMPLINK", Const, 0}, - {"AF_INET", Const, 0}, - {"AF_INET6", Const, 0}, - {"AF_INET6_SDP", Const, 3}, - {"AF_INET_SDP", Const, 3}, - {"AF_IPX", Const, 0}, - {"AF_IRDA", Const, 0}, - {"AF_ISDN", Const, 0}, - {"AF_ISO", Const, 0}, - {"AF_IUCV", Const, 0}, - {"AF_KEY", Const, 0}, - {"AF_LAT", Const, 0}, - {"AF_LINK", Const, 0}, - {"AF_LLC", Const, 0}, - {"AF_LOCAL", Const, 0}, - {"AF_MAX", Const, 0}, - {"AF_MPLS", Const, 1}, - {"AF_NATM", Const, 0}, - {"AF_NDRV", Const, 0}, - {"AF_NETBEUI", Const, 0}, - {"AF_NETBIOS", Const, 0}, - {"AF_NETGRAPH", Const, 0}, - {"AF_NETLINK", Const, 0}, - {"AF_NETROM", Const, 0}, - {"AF_NS", Const, 0}, - {"AF_OROUTE", Const, 1}, - {"AF_OSI", Const, 0}, - {"AF_PACKET", Const, 0}, - {"AF_PHONET", Const, 0}, - {"AF_PPP", Const, 0}, - {"AF_PPPOX", Const, 0}, - {"AF_PUP", Const, 0}, - {"AF_RDS", Const, 0}, - {"AF_RESERVED_36", Const, 0}, - {"AF_ROSE", Const, 0}, - {"AF_ROUTE", Const, 0}, - {"AF_RXRPC", Const, 0}, - {"AF_SCLUSTER", Const, 0}, - {"AF_SECURITY", Const, 0}, - {"AF_SIP", Const, 0}, - {"AF_SLOW", Const, 0}, - {"AF_SNA", Const, 0}, - {"AF_SYSTEM", Const, 0}, - {"AF_TIPC", Const, 0}, - {"AF_UNIX", Const, 0}, - {"AF_UNSPEC", Const, 0}, - {"AF_UTUN", Const, 16}, - {"AF_VENDOR00", Const, 0}, - {"AF_VENDOR01", Const, 0}, - {"AF_VENDOR02", Const, 0}, - {"AF_VENDOR03", Const, 0}, - {"AF_VENDOR04", Const, 0}, - {"AF_VENDOR05", Const, 0}, - {"AF_VENDOR06", Const, 0}, - {"AF_VENDOR07", Const, 0}, - {"AF_VENDOR08", Const, 0}, - {"AF_VENDOR09", Const, 0}, - {"AF_VENDOR10", Const, 0}, - {"AF_VENDOR11", Const, 0}, - {"AF_VENDOR12", Const, 0}, - {"AF_VENDOR13", Const, 0}, - {"AF_VENDOR14", Const, 0}, - {"AF_VENDOR15", Const, 0}, - {"AF_VENDOR16", Const, 0}, - {"AF_VENDOR17", Const, 0}, - {"AF_VENDOR18", Const, 0}, - {"AF_VENDOR19", Const, 0}, - {"AF_VENDOR20", Const, 0}, - {"AF_VENDOR21", Const, 0}, - {"AF_VENDOR22", Const, 0}, - {"AF_VENDOR23", Const, 0}, - {"AF_VENDOR24", Const, 0}, - {"AF_VENDOR25", Const, 0}, - {"AF_VENDOR26", Const, 0}, - {"AF_VENDOR27", Const, 0}, - {"AF_VENDOR28", Const, 0}, - {"AF_VENDOR29", Const, 0}, - {"AF_VENDOR30", Const, 0}, - {"AF_VENDOR31", Const, 0}, - {"AF_VENDOR32", Const, 0}, - {"AF_VENDOR33", Const, 0}, - {"AF_VENDOR34", Const, 0}, - {"AF_VENDOR35", Const, 0}, - {"AF_VENDOR36", Const, 0}, - {"AF_VENDOR37", Const, 0}, - {"AF_VENDOR38", Const, 0}, - {"AF_VENDOR39", Const, 0}, - {"AF_VENDOR40", Const, 0}, - {"AF_VENDOR41", Const, 0}, - {"AF_VENDOR42", Const, 0}, - {"AF_VENDOR43", Const, 0}, - {"AF_VENDOR44", Const, 0}, - {"AF_VENDOR45", Const, 0}, - {"AF_VENDOR46", Const, 0}, - {"AF_VENDOR47", Const, 0}, - {"AF_WANPIPE", Const, 0}, - {"AF_X25", Const, 0}, - {"AI_CANONNAME", Const, 1}, - {"AI_NUMERICHOST", Const, 1}, - {"AI_PASSIVE", Const, 1}, - {"APPLICATION_ERROR", Const, 0}, - {"ARPHRD_ADAPT", Const, 0}, - {"ARPHRD_APPLETLK", Const, 0}, - {"ARPHRD_ARCNET", Const, 0}, - {"ARPHRD_ASH", Const, 0}, - {"ARPHRD_ATM", Const, 0}, - {"ARPHRD_AX25", Const, 0}, - {"ARPHRD_BIF", Const, 0}, - {"ARPHRD_CHAOS", Const, 0}, - {"ARPHRD_CISCO", Const, 0}, - {"ARPHRD_CSLIP", Const, 0}, - {"ARPHRD_CSLIP6", Const, 0}, - {"ARPHRD_DDCMP", Const, 0}, - {"ARPHRD_DLCI", Const, 0}, - {"ARPHRD_ECONET", Const, 0}, - {"ARPHRD_EETHER", Const, 0}, - {"ARPHRD_ETHER", Const, 0}, - {"ARPHRD_EUI64", Const, 0}, - {"ARPHRD_FCAL", Const, 0}, - {"ARPHRD_FCFABRIC", Const, 0}, - {"ARPHRD_FCPL", Const, 0}, - {"ARPHRD_FCPP", Const, 0}, - {"ARPHRD_FDDI", Const, 0}, - {"ARPHRD_FRAD", Const, 0}, - {"ARPHRD_FRELAY", Const, 1}, - {"ARPHRD_HDLC", Const, 0}, - {"ARPHRD_HIPPI", Const, 0}, - {"ARPHRD_HWX25", Const, 0}, - {"ARPHRD_IEEE1394", Const, 0}, - {"ARPHRD_IEEE802", Const, 0}, - {"ARPHRD_IEEE80211", Const, 0}, - {"ARPHRD_IEEE80211_PRISM", Const, 0}, - {"ARPHRD_IEEE80211_RADIOTAP", Const, 0}, - {"ARPHRD_IEEE802154", Const, 0}, - {"ARPHRD_IEEE802154_PHY", Const, 0}, - {"ARPHRD_IEEE802_TR", Const, 0}, - {"ARPHRD_INFINIBAND", Const, 0}, - {"ARPHRD_IPDDP", Const, 0}, - {"ARPHRD_IPGRE", Const, 0}, - {"ARPHRD_IRDA", Const, 0}, - {"ARPHRD_LAPB", Const, 0}, - {"ARPHRD_LOCALTLK", Const, 0}, - {"ARPHRD_LOOPBACK", Const, 0}, - {"ARPHRD_METRICOM", Const, 0}, - {"ARPHRD_NETROM", Const, 0}, - {"ARPHRD_NONE", Const, 0}, - {"ARPHRD_PIMREG", Const, 0}, - {"ARPHRD_PPP", Const, 0}, - {"ARPHRD_PRONET", Const, 0}, - {"ARPHRD_RAWHDLC", Const, 0}, - {"ARPHRD_ROSE", Const, 0}, - {"ARPHRD_RSRVD", Const, 0}, - {"ARPHRD_SIT", Const, 0}, - {"ARPHRD_SKIP", Const, 0}, - {"ARPHRD_SLIP", Const, 0}, - {"ARPHRD_SLIP6", Const, 0}, - {"ARPHRD_STRIP", Const, 1}, - {"ARPHRD_TUNNEL", Const, 0}, - {"ARPHRD_TUNNEL6", Const, 0}, - {"ARPHRD_VOID", Const, 0}, - {"ARPHRD_X25", Const, 0}, - {"AUTHTYPE_CLIENT", Const, 0}, - {"AUTHTYPE_SERVER", Const, 0}, - {"Accept", Func, 0}, - {"Accept4", Func, 1}, - {"AcceptEx", Func, 0}, - {"Access", Func, 0}, - {"Acct", Func, 0}, - {"AddrinfoW", Type, 1}, - {"AddrinfoW.Addr", Field, 1}, - {"AddrinfoW.Addrlen", Field, 1}, - {"AddrinfoW.Canonname", Field, 1}, - {"AddrinfoW.Family", Field, 1}, - {"AddrinfoW.Flags", Field, 1}, - {"AddrinfoW.Next", Field, 1}, - {"AddrinfoW.Protocol", Field, 1}, - {"AddrinfoW.Socktype", Field, 1}, - {"Adjtime", Func, 0}, - {"Adjtimex", Func, 0}, - {"AllThreadsSyscall", Func, 16}, - {"AllThreadsSyscall6", Func, 16}, - {"AttachLsf", Func, 0}, - {"B0", Const, 0}, - {"B1000000", Const, 0}, - {"B110", Const, 0}, - {"B115200", Const, 0}, - {"B1152000", Const, 0}, - {"B1200", Const, 0}, - {"B134", Const, 0}, - {"B14400", Const, 1}, - {"B150", Const, 0}, - {"B1500000", Const, 0}, - {"B1800", Const, 0}, - {"B19200", Const, 0}, - {"B200", Const, 0}, - {"B2000000", Const, 0}, - {"B230400", Const, 0}, - {"B2400", Const, 0}, - {"B2500000", Const, 0}, - {"B28800", Const, 1}, - {"B300", Const, 0}, - {"B3000000", Const, 0}, - {"B3500000", Const, 0}, - {"B38400", Const, 0}, - {"B4000000", Const, 0}, - {"B460800", Const, 0}, - {"B4800", Const, 0}, - {"B50", Const, 0}, - {"B500000", Const, 0}, - {"B57600", Const, 0}, - {"B576000", Const, 0}, - {"B600", Const, 0}, - {"B7200", Const, 1}, - {"B75", Const, 0}, - {"B76800", Const, 1}, - {"B921600", Const, 0}, - {"B9600", Const, 0}, - {"BASE_PROTOCOL", Const, 2}, - {"BIOCFEEDBACK", Const, 0}, - {"BIOCFLUSH", Const, 0}, - {"BIOCGBLEN", Const, 0}, - {"BIOCGDIRECTION", Const, 0}, - {"BIOCGDIRFILT", Const, 1}, - {"BIOCGDLT", Const, 0}, - {"BIOCGDLTLIST", Const, 0}, - {"BIOCGETBUFMODE", Const, 0}, - {"BIOCGETIF", Const, 0}, - {"BIOCGETZMAX", Const, 0}, - {"BIOCGFEEDBACK", Const, 1}, - {"BIOCGFILDROP", Const, 1}, - {"BIOCGHDRCMPLT", Const, 0}, - {"BIOCGRSIG", Const, 0}, - {"BIOCGRTIMEOUT", Const, 0}, - {"BIOCGSEESENT", Const, 0}, - {"BIOCGSTATS", Const, 0}, - {"BIOCGSTATSOLD", Const, 1}, - {"BIOCGTSTAMP", Const, 1}, - {"BIOCIMMEDIATE", Const, 0}, - {"BIOCLOCK", Const, 0}, - {"BIOCPROMISC", Const, 0}, - {"BIOCROTZBUF", Const, 0}, - {"BIOCSBLEN", Const, 0}, - {"BIOCSDIRECTION", Const, 0}, - {"BIOCSDIRFILT", Const, 1}, - {"BIOCSDLT", Const, 0}, - {"BIOCSETBUFMODE", Const, 0}, - {"BIOCSETF", Const, 0}, - {"BIOCSETFNR", Const, 0}, - {"BIOCSETIF", Const, 0}, - {"BIOCSETWF", Const, 0}, - {"BIOCSETZBUF", Const, 0}, - {"BIOCSFEEDBACK", Const, 1}, - {"BIOCSFILDROP", Const, 1}, - {"BIOCSHDRCMPLT", Const, 0}, - {"BIOCSRSIG", Const, 0}, - {"BIOCSRTIMEOUT", Const, 0}, - {"BIOCSSEESENT", Const, 0}, - {"BIOCSTCPF", Const, 1}, - {"BIOCSTSTAMP", Const, 1}, - {"BIOCSUDPF", Const, 1}, - {"BIOCVERSION", Const, 0}, - {"BPF_A", Const, 0}, - {"BPF_ABS", Const, 0}, - {"BPF_ADD", Const, 0}, - {"BPF_ALIGNMENT", Const, 0}, - {"BPF_ALIGNMENT32", Const, 1}, - {"BPF_ALU", Const, 0}, - {"BPF_AND", Const, 0}, - {"BPF_B", Const, 0}, - {"BPF_BUFMODE_BUFFER", Const, 0}, - {"BPF_BUFMODE_ZBUF", Const, 0}, - {"BPF_DFLTBUFSIZE", Const, 1}, - {"BPF_DIRECTION_IN", Const, 1}, - {"BPF_DIRECTION_OUT", Const, 1}, - {"BPF_DIV", Const, 0}, - {"BPF_H", Const, 0}, - {"BPF_IMM", Const, 0}, - {"BPF_IND", Const, 0}, - {"BPF_JA", Const, 0}, - {"BPF_JEQ", Const, 0}, - {"BPF_JGE", Const, 0}, - {"BPF_JGT", Const, 0}, - {"BPF_JMP", Const, 0}, - {"BPF_JSET", Const, 0}, - {"BPF_K", Const, 0}, - {"BPF_LD", Const, 0}, - {"BPF_LDX", Const, 0}, - {"BPF_LEN", Const, 0}, - {"BPF_LSH", Const, 0}, - {"BPF_MAJOR_VERSION", Const, 0}, - {"BPF_MAXBUFSIZE", Const, 0}, - {"BPF_MAXINSNS", Const, 0}, - {"BPF_MEM", Const, 0}, - {"BPF_MEMWORDS", Const, 0}, - {"BPF_MINBUFSIZE", Const, 0}, - {"BPF_MINOR_VERSION", Const, 0}, - {"BPF_MISC", Const, 0}, - {"BPF_MSH", Const, 0}, - {"BPF_MUL", Const, 0}, - {"BPF_NEG", Const, 0}, - {"BPF_OR", Const, 0}, - {"BPF_RELEASE", Const, 0}, - {"BPF_RET", Const, 0}, - {"BPF_RSH", Const, 0}, - {"BPF_ST", Const, 0}, - {"BPF_STX", Const, 0}, - {"BPF_SUB", Const, 0}, - {"BPF_TAX", Const, 0}, - {"BPF_TXA", Const, 0}, - {"BPF_T_BINTIME", Const, 1}, - {"BPF_T_BINTIME_FAST", Const, 1}, - {"BPF_T_BINTIME_MONOTONIC", Const, 1}, - {"BPF_T_BINTIME_MONOTONIC_FAST", Const, 1}, - {"BPF_T_FAST", Const, 1}, - {"BPF_T_FLAG_MASK", Const, 1}, - {"BPF_T_FORMAT_MASK", Const, 1}, - {"BPF_T_MICROTIME", Const, 1}, - {"BPF_T_MICROTIME_FAST", Const, 1}, - {"BPF_T_MICROTIME_MONOTONIC", Const, 1}, - {"BPF_T_MICROTIME_MONOTONIC_FAST", Const, 1}, - {"BPF_T_MONOTONIC", Const, 1}, - {"BPF_T_MONOTONIC_FAST", Const, 1}, - {"BPF_T_NANOTIME", Const, 1}, - {"BPF_T_NANOTIME_FAST", Const, 1}, - {"BPF_T_NANOTIME_MONOTONIC", Const, 1}, - {"BPF_T_NANOTIME_MONOTONIC_FAST", Const, 1}, - {"BPF_T_NONE", Const, 1}, - {"BPF_T_NORMAL", Const, 1}, - {"BPF_W", Const, 0}, - {"BPF_X", Const, 0}, - {"BRKINT", Const, 0}, - {"Bind", Func, 0}, - {"BindToDevice", Func, 0}, - {"BpfBuflen", Func, 0}, - {"BpfDatalink", Func, 0}, - {"BpfHdr", Type, 0}, - {"BpfHdr.Caplen", Field, 0}, - {"BpfHdr.Datalen", Field, 0}, - {"BpfHdr.Hdrlen", Field, 0}, - {"BpfHdr.Pad_cgo_0", Field, 0}, - {"BpfHdr.Tstamp", Field, 0}, - {"BpfHeadercmpl", Func, 0}, - {"BpfInsn", Type, 0}, - {"BpfInsn.Code", Field, 0}, - {"BpfInsn.Jf", Field, 0}, - {"BpfInsn.Jt", Field, 0}, - {"BpfInsn.K", Field, 0}, - {"BpfInterface", Func, 0}, - {"BpfJump", Func, 0}, - {"BpfProgram", Type, 0}, - {"BpfProgram.Insns", Field, 0}, - {"BpfProgram.Len", Field, 0}, - {"BpfProgram.Pad_cgo_0", Field, 0}, - {"BpfStat", Type, 0}, - {"BpfStat.Capt", Field, 2}, - {"BpfStat.Drop", Field, 0}, - {"BpfStat.Padding", Field, 2}, - {"BpfStat.Recv", Field, 0}, - {"BpfStats", Func, 0}, - {"BpfStmt", Func, 0}, - {"BpfTimeout", Func, 0}, - {"BpfTimeval", Type, 2}, - {"BpfTimeval.Sec", Field, 2}, - {"BpfTimeval.Usec", Field, 2}, - {"BpfVersion", Type, 0}, - {"BpfVersion.Major", Field, 0}, - {"BpfVersion.Minor", Field, 0}, - {"BpfZbuf", Type, 0}, - {"BpfZbuf.Bufa", Field, 0}, - {"BpfZbuf.Bufb", Field, 0}, - {"BpfZbuf.Buflen", Field, 0}, - {"BpfZbufHeader", Type, 0}, - {"BpfZbufHeader.Kernel_gen", Field, 0}, - {"BpfZbufHeader.Kernel_len", Field, 0}, - {"BpfZbufHeader.User_gen", Field, 0}, - {"BpfZbufHeader.X_bzh_pad", Field, 0}, - {"ByHandleFileInformation", Type, 0}, - {"ByHandleFileInformation.CreationTime", Field, 0}, - {"ByHandleFileInformation.FileAttributes", Field, 0}, - {"ByHandleFileInformation.FileIndexHigh", Field, 0}, - {"ByHandleFileInformation.FileIndexLow", Field, 0}, - {"ByHandleFileInformation.FileSizeHigh", Field, 0}, - {"ByHandleFileInformation.FileSizeLow", Field, 0}, - {"ByHandleFileInformation.LastAccessTime", Field, 0}, - {"ByHandleFileInformation.LastWriteTime", Field, 0}, - {"ByHandleFileInformation.NumberOfLinks", Field, 0}, - {"ByHandleFileInformation.VolumeSerialNumber", Field, 0}, - {"BytePtrFromString", Func, 1}, - {"ByteSliceFromString", Func, 1}, - {"CCR0_FLUSH", Const, 1}, - {"CERT_CHAIN_POLICY_AUTHENTICODE", Const, 0}, - {"CERT_CHAIN_POLICY_AUTHENTICODE_TS", Const, 0}, - {"CERT_CHAIN_POLICY_BASE", Const, 0}, - {"CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", Const, 0}, - {"CERT_CHAIN_POLICY_EV", Const, 0}, - {"CERT_CHAIN_POLICY_MICROSOFT_ROOT", Const, 0}, - {"CERT_CHAIN_POLICY_NT_AUTH", Const, 0}, - {"CERT_CHAIN_POLICY_SSL", Const, 0}, - {"CERT_E_CN_NO_MATCH", Const, 0}, - {"CERT_E_EXPIRED", Const, 0}, - {"CERT_E_PURPOSE", Const, 0}, - {"CERT_E_ROLE", Const, 0}, - {"CERT_E_UNTRUSTEDROOT", Const, 0}, - {"CERT_STORE_ADD_ALWAYS", Const, 0}, - {"CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", Const, 0}, - {"CERT_STORE_PROV_MEMORY", Const, 0}, - {"CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", Const, 0}, - {"CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", Const, 0}, - {"CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", Const, 0}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", Const, 0}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", Const, 0}, - {"CERT_TRUST_INVALID_BASIC_CONSTRAINTS", Const, 0}, - {"CERT_TRUST_INVALID_EXTENSION", Const, 0}, - {"CERT_TRUST_INVALID_NAME_CONSTRAINTS", Const, 0}, - {"CERT_TRUST_INVALID_POLICY_CONSTRAINTS", Const, 0}, - {"CERT_TRUST_IS_CYCLIC", Const, 0}, - {"CERT_TRUST_IS_EXPLICIT_DISTRUST", Const, 0}, - {"CERT_TRUST_IS_NOT_SIGNATURE_VALID", Const, 0}, - {"CERT_TRUST_IS_NOT_TIME_VALID", Const, 0}, - {"CERT_TRUST_IS_NOT_VALID_FOR_USAGE", Const, 0}, - {"CERT_TRUST_IS_OFFLINE_REVOCATION", Const, 0}, - {"CERT_TRUST_IS_REVOKED", Const, 0}, - {"CERT_TRUST_IS_UNTRUSTED_ROOT", Const, 0}, - {"CERT_TRUST_NO_ERROR", Const, 0}, - {"CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", Const, 0}, - {"CERT_TRUST_REVOCATION_STATUS_UNKNOWN", Const, 0}, - {"CFLUSH", Const, 1}, - {"CLOCAL", Const, 0}, - {"CLONE_CHILD_CLEARTID", Const, 2}, - {"CLONE_CHILD_SETTID", Const, 2}, - {"CLONE_CLEAR_SIGHAND", Const, 20}, - {"CLONE_CSIGNAL", Const, 3}, - {"CLONE_DETACHED", Const, 2}, - {"CLONE_FILES", Const, 2}, - {"CLONE_FS", Const, 2}, - {"CLONE_INTO_CGROUP", Const, 20}, - {"CLONE_IO", Const, 2}, - {"CLONE_NEWCGROUP", Const, 20}, - {"CLONE_NEWIPC", Const, 2}, - {"CLONE_NEWNET", Const, 2}, - {"CLONE_NEWNS", Const, 2}, - {"CLONE_NEWPID", Const, 2}, - {"CLONE_NEWTIME", Const, 20}, - {"CLONE_NEWUSER", Const, 2}, - {"CLONE_NEWUTS", Const, 2}, - {"CLONE_PARENT", Const, 2}, - {"CLONE_PARENT_SETTID", Const, 2}, - {"CLONE_PID", Const, 3}, - {"CLONE_PIDFD", Const, 20}, - {"CLONE_PTRACE", Const, 2}, - {"CLONE_SETTLS", Const, 2}, - {"CLONE_SIGHAND", Const, 2}, - {"CLONE_SYSVSEM", Const, 2}, - {"CLONE_THREAD", Const, 2}, - {"CLONE_UNTRACED", Const, 2}, - {"CLONE_VFORK", Const, 2}, - {"CLONE_VM", Const, 2}, - {"CPUID_CFLUSH", Const, 1}, - {"CREAD", Const, 0}, - {"CREATE_ALWAYS", Const, 0}, - {"CREATE_NEW", Const, 0}, - {"CREATE_NEW_PROCESS_GROUP", Const, 1}, - {"CREATE_UNICODE_ENVIRONMENT", Const, 0}, - {"CRYPT_DEFAULT_CONTAINER_OPTIONAL", Const, 0}, - {"CRYPT_DELETEKEYSET", Const, 0}, - {"CRYPT_MACHINE_KEYSET", Const, 0}, - {"CRYPT_NEWKEYSET", Const, 0}, - {"CRYPT_SILENT", Const, 0}, - {"CRYPT_VERIFYCONTEXT", Const, 0}, - {"CS5", Const, 0}, - {"CS6", Const, 0}, - {"CS7", Const, 0}, - {"CS8", Const, 0}, - {"CSIZE", Const, 0}, - {"CSTART", Const, 1}, - {"CSTATUS", Const, 1}, - {"CSTOP", Const, 1}, - {"CSTOPB", Const, 0}, - {"CSUSP", Const, 1}, - {"CTL_MAXNAME", Const, 0}, - {"CTL_NET", Const, 0}, - {"CTL_QUERY", Const, 1}, - {"CTRL_BREAK_EVENT", Const, 1}, - {"CTRL_CLOSE_EVENT", Const, 14}, - {"CTRL_C_EVENT", Const, 1}, - {"CTRL_LOGOFF_EVENT", Const, 14}, - {"CTRL_SHUTDOWN_EVENT", Const, 14}, - {"CancelIo", Func, 0}, - {"CancelIoEx", Func, 1}, - {"CertAddCertificateContextToStore", Func, 0}, - {"CertChainContext", Type, 0}, - {"CertChainContext.ChainCount", Field, 0}, - {"CertChainContext.Chains", Field, 0}, - {"CertChainContext.HasRevocationFreshnessTime", Field, 0}, - {"CertChainContext.LowerQualityChainCount", Field, 0}, - {"CertChainContext.LowerQualityChains", Field, 0}, - {"CertChainContext.RevocationFreshnessTime", Field, 0}, - {"CertChainContext.Size", Field, 0}, - {"CertChainContext.TrustStatus", Field, 0}, - {"CertChainElement", Type, 0}, - {"CertChainElement.ApplicationUsage", Field, 0}, - {"CertChainElement.CertContext", Field, 0}, - {"CertChainElement.ExtendedErrorInfo", Field, 0}, - {"CertChainElement.IssuanceUsage", Field, 0}, - {"CertChainElement.RevocationInfo", Field, 0}, - {"CertChainElement.Size", Field, 0}, - {"CertChainElement.TrustStatus", Field, 0}, - {"CertChainPara", Type, 0}, - {"CertChainPara.CacheResync", Field, 0}, - {"CertChainPara.CheckRevocationFreshnessTime", Field, 0}, - {"CertChainPara.RequestedUsage", Field, 0}, - {"CertChainPara.RequstedIssuancePolicy", Field, 0}, - {"CertChainPara.RevocationFreshnessTime", Field, 0}, - {"CertChainPara.Size", Field, 0}, - {"CertChainPara.URLRetrievalTimeout", Field, 0}, - {"CertChainPolicyPara", Type, 0}, - {"CertChainPolicyPara.ExtraPolicyPara", Field, 0}, - {"CertChainPolicyPara.Flags", Field, 0}, - {"CertChainPolicyPara.Size", Field, 0}, - {"CertChainPolicyStatus", Type, 0}, - {"CertChainPolicyStatus.ChainIndex", Field, 0}, - {"CertChainPolicyStatus.ElementIndex", Field, 0}, - {"CertChainPolicyStatus.Error", Field, 0}, - {"CertChainPolicyStatus.ExtraPolicyStatus", Field, 0}, - {"CertChainPolicyStatus.Size", Field, 0}, - {"CertCloseStore", Func, 0}, - {"CertContext", Type, 0}, - {"CertContext.CertInfo", Field, 0}, - {"CertContext.EncodedCert", Field, 0}, - {"CertContext.EncodingType", Field, 0}, - {"CertContext.Length", Field, 0}, - {"CertContext.Store", Field, 0}, - {"CertCreateCertificateContext", Func, 0}, - {"CertEnhKeyUsage", Type, 0}, - {"CertEnhKeyUsage.Length", Field, 0}, - {"CertEnhKeyUsage.UsageIdentifiers", Field, 0}, - {"CertEnumCertificatesInStore", Func, 0}, - {"CertFreeCertificateChain", Func, 0}, - {"CertFreeCertificateContext", Func, 0}, - {"CertGetCertificateChain", Func, 0}, - {"CertInfo", Type, 11}, - {"CertOpenStore", Func, 0}, - {"CertOpenSystemStore", Func, 0}, - {"CertRevocationCrlInfo", Type, 11}, - {"CertRevocationInfo", Type, 0}, - {"CertRevocationInfo.CrlInfo", Field, 0}, - {"CertRevocationInfo.FreshnessTime", Field, 0}, - {"CertRevocationInfo.HasFreshnessTime", Field, 0}, - {"CertRevocationInfo.OidSpecificInfo", Field, 0}, - {"CertRevocationInfo.RevocationOid", Field, 0}, - {"CertRevocationInfo.RevocationResult", Field, 0}, - {"CertRevocationInfo.Size", Field, 0}, - {"CertSimpleChain", Type, 0}, - {"CertSimpleChain.Elements", Field, 0}, - {"CertSimpleChain.HasRevocationFreshnessTime", Field, 0}, - {"CertSimpleChain.NumElements", Field, 0}, - {"CertSimpleChain.RevocationFreshnessTime", Field, 0}, - {"CertSimpleChain.Size", Field, 0}, - {"CertSimpleChain.TrustListInfo", Field, 0}, - {"CertSimpleChain.TrustStatus", Field, 0}, - {"CertTrustListInfo", Type, 11}, - {"CertTrustStatus", Type, 0}, - {"CertTrustStatus.ErrorStatus", Field, 0}, - {"CertTrustStatus.InfoStatus", Field, 0}, - {"CertUsageMatch", Type, 0}, - {"CertUsageMatch.Type", Field, 0}, - {"CertUsageMatch.Usage", Field, 0}, - {"CertVerifyCertificateChainPolicy", Func, 0}, - {"Chdir", Func, 0}, - {"CheckBpfVersion", Func, 0}, - {"Chflags", Func, 0}, - {"Chmod", Func, 0}, - {"Chown", Func, 0}, - {"Chroot", Func, 0}, - {"Clearenv", Func, 0}, - {"Close", Func, 0}, - {"CloseHandle", Func, 0}, - {"CloseOnExec", Func, 0}, - {"Closesocket", Func, 0}, - {"CmsgLen", Func, 0}, - {"CmsgSpace", Func, 0}, - {"Cmsghdr", Type, 0}, - {"Cmsghdr.Len", Field, 0}, - {"Cmsghdr.Level", Field, 0}, - {"Cmsghdr.Type", Field, 0}, - {"Cmsghdr.X__cmsg_data", Field, 0}, - {"CommandLineToArgv", Func, 0}, - {"ComputerName", Func, 0}, - {"Conn", Type, 9}, - {"Connect", Func, 0}, - {"ConnectEx", Func, 1}, - {"ConvertSidToStringSid", Func, 0}, - {"ConvertStringSidToSid", Func, 0}, - {"CopySid", Func, 0}, - {"Creat", Func, 0}, - {"CreateDirectory", Func, 0}, - {"CreateFile", Func, 0}, - {"CreateFileMapping", Func, 0}, - {"CreateHardLink", Func, 4}, - {"CreateIoCompletionPort", Func, 0}, - {"CreatePipe", Func, 0}, - {"CreateProcess", Func, 0}, - {"CreateProcessAsUser", Func, 10}, - {"CreateSymbolicLink", Func, 4}, - {"CreateToolhelp32Snapshot", Func, 4}, - {"Credential", Type, 0}, - {"Credential.Gid", Field, 0}, - {"Credential.Groups", Field, 0}, - {"Credential.NoSetGroups", Field, 9}, - {"Credential.Uid", Field, 0}, - {"CryptAcquireContext", Func, 0}, - {"CryptGenRandom", Func, 0}, - {"CryptReleaseContext", Func, 0}, - {"DIOCBSFLUSH", Const, 1}, - {"DIOCOSFPFLUSH", Const, 1}, - {"DLL", Type, 0}, - {"DLL.Handle", Field, 0}, - {"DLL.Name", Field, 0}, - {"DLLError", Type, 0}, - {"DLLError.Err", Field, 0}, - {"DLLError.Msg", Field, 0}, - {"DLLError.ObjName", Field, 0}, - {"DLT_A429", Const, 0}, - {"DLT_A653_ICM", Const, 0}, - {"DLT_AIRONET_HEADER", Const, 0}, - {"DLT_AOS", Const, 1}, - {"DLT_APPLE_IP_OVER_IEEE1394", Const, 0}, - {"DLT_ARCNET", Const, 0}, - {"DLT_ARCNET_LINUX", Const, 0}, - {"DLT_ATM_CLIP", Const, 0}, - {"DLT_ATM_RFC1483", Const, 0}, - {"DLT_AURORA", Const, 0}, - {"DLT_AX25", Const, 0}, - {"DLT_AX25_KISS", Const, 0}, - {"DLT_BACNET_MS_TP", Const, 0}, - {"DLT_BLUETOOTH_HCI_H4", Const, 0}, - {"DLT_BLUETOOTH_HCI_H4_WITH_PHDR", Const, 0}, - {"DLT_CAN20B", Const, 0}, - {"DLT_CAN_SOCKETCAN", Const, 1}, - {"DLT_CHAOS", Const, 0}, - {"DLT_CHDLC", Const, 0}, - {"DLT_CISCO_IOS", Const, 0}, - {"DLT_C_HDLC", Const, 0}, - {"DLT_C_HDLC_WITH_DIR", Const, 0}, - {"DLT_DBUS", Const, 1}, - {"DLT_DECT", Const, 1}, - {"DLT_DOCSIS", Const, 0}, - {"DLT_DVB_CI", Const, 1}, - {"DLT_ECONET", Const, 0}, - {"DLT_EN10MB", Const, 0}, - {"DLT_EN3MB", Const, 0}, - {"DLT_ENC", Const, 0}, - {"DLT_ERF", Const, 0}, - {"DLT_ERF_ETH", Const, 0}, - {"DLT_ERF_POS", Const, 0}, - {"DLT_FC_2", Const, 1}, - {"DLT_FC_2_WITH_FRAME_DELIMS", Const, 1}, - {"DLT_FDDI", Const, 0}, - {"DLT_FLEXRAY", Const, 0}, - {"DLT_FRELAY", Const, 0}, - {"DLT_FRELAY_WITH_DIR", Const, 0}, - {"DLT_GCOM_SERIAL", Const, 0}, - {"DLT_GCOM_T1E1", Const, 0}, - {"DLT_GPF_F", Const, 0}, - {"DLT_GPF_T", Const, 0}, - {"DLT_GPRS_LLC", Const, 0}, - {"DLT_GSMTAP_ABIS", Const, 1}, - {"DLT_GSMTAP_UM", Const, 1}, - {"DLT_HDLC", Const, 1}, - {"DLT_HHDLC", Const, 0}, - {"DLT_HIPPI", Const, 1}, - {"DLT_IBM_SN", Const, 0}, - {"DLT_IBM_SP", Const, 0}, - {"DLT_IEEE802", Const, 0}, - {"DLT_IEEE802_11", Const, 0}, - {"DLT_IEEE802_11_RADIO", Const, 0}, - {"DLT_IEEE802_11_RADIO_AVS", Const, 0}, - {"DLT_IEEE802_15_4", Const, 0}, - {"DLT_IEEE802_15_4_LINUX", Const, 0}, - {"DLT_IEEE802_15_4_NOFCS", Const, 1}, - {"DLT_IEEE802_15_4_NONASK_PHY", Const, 0}, - {"DLT_IEEE802_16_MAC_CPS", Const, 0}, - {"DLT_IEEE802_16_MAC_CPS_RADIO", Const, 0}, - {"DLT_IPFILTER", Const, 0}, - {"DLT_IPMB", Const, 0}, - {"DLT_IPMB_LINUX", Const, 0}, - {"DLT_IPNET", Const, 1}, - {"DLT_IPOIB", Const, 1}, - {"DLT_IPV4", Const, 1}, - {"DLT_IPV6", Const, 1}, - {"DLT_IP_OVER_FC", Const, 0}, - {"DLT_JUNIPER_ATM1", Const, 0}, - {"DLT_JUNIPER_ATM2", Const, 0}, - {"DLT_JUNIPER_ATM_CEMIC", Const, 1}, - {"DLT_JUNIPER_CHDLC", Const, 0}, - {"DLT_JUNIPER_ES", Const, 0}, - {"DLT_JUNIPER_ETHER", Const, 0}, - {"DLT_JUNIPER_FIBRECHANNEL", Const, 1}, - {"DLT_JUNIPER_FRELAY", Const, 0}, - {"DLT_JUNIPER_GGSN", Const, 0}, - {"DLT_JUNIPER_ISM", Const, 0}, - {"DLT_JUNIPER_MFR", Const, 0}, - {"DLT_JUNIPER_MLFR", Const, 0}, - {"DLT_JUNIPER_MLPPP", Const, 0}, - {"DLT_JUNIPER_MONITOR", Const, 0}, - {"DLT_JUNIPER_PIC_PEER", Const, 0}, - {"DLT_JUNIPER_PPP", Const, 0}, - {"DLT_JUNIPER_PPPOE", Const, 0}, - {"DLT_JUNIPER_PPPOE_ATM", Const, 0}, - {"DLT_JUNIPER_SERVICES", Const, 0}, - {"DLT_JUNIPER_SRX_E2E", Const, 1}, - {"DLT_JUNIPER_ST", Const, 0}, - {"DLT_JUNIPER_VP", Const, 0}, - {"DLT_JUNIPER_VS", Const, 1}, - {"DLT_LAPB_WITH_DIR", Const, 0}, - {"DLT_LAPD", Const, 0}, - {"DLT_LIN", Const, 0}, - {"DLT_LINUX_EVDEV", Const, 1}, - {"DLT_LINUX_IRDA", Const, 0}, - {"DLT_LINUX_LAPD", Const, 0}, - {"DLT_LINUX_PPP_WITHDIRECTION", Const, 0}, - {"DLT_LINUX_SLL", Const, 0}, - {"DLT_LOOP", Const, 0}, - {"DLT_LTALK", Const, 0}, - {"DLT_MATCHING_MAX", Const, 1}, - {"DLT_MATCHING_MIN", Const, 1}, - {"DLT_MFR", Const, 0}, - {"DLT_MOST", Const, 0}, - {"DLT_MPEG_2_TS", Const, 1}, - {"DLT_MPLS", Const, 1}, - {"DLT_MTP2", Const, 0}, - {"DLT_MTP2_WITH_PHDR", Const, 0}, - {"DLT_MTP3", Const, 0}, - {"DLT_MUX27010", Const, 1}, - {"DLT_NETANALYZER", Const, 1}, - {"DLT_NETANALYZER_TRANSPARENT", Const, 1}, - {"DLT_NFC_LLCP", Const, 1}, - {"DLT_NFLOG", Const, 1}, - {"DLT_NG40", Const, 1}, - {"DLT_NULL", Const, 0}, - {"DLT_PCI_EXP", Const, 0}, - {"DLT_PFLOG", Const, 0}, - {"DLT_PFSYNC", Const, 0}, - {"DLT_PPI", Const, 0}, - {"DLT_PPP", Const, 0}, - {"DLT_PPP_BSDOS", Const, 0}, - {"DLT_PPP_ETHER", Const, 0}, - {"DLT_PPP_PPPD", Const, 0}, - {"DLT_PPP_SERIAL", Const, 0}, - {"DLT_PPP_WITH_DIR", Const, 0}, - {"DLT_PPP_WITH_DIRECTION", Const, 0}, - {"DLT_PRISM_HEADER", Const, 0}, - {"DLT_PRONET", Const, 0}, - {"DLT_RAIF1", Const, 0}, - {"DLT_RAW", Const, 0}, - {"DLT_RAWAF_MASK", Const, 1}, - {"DLT_RIO", Const, 0}, - {"DLT_SCCP", Const, 0}, - {"DLT_SITA", Const, 0}, - {"DLT_SLIP", Const, 0}, - {"DLT_SLIP_BSDOS", Const, 0}, - {"DLT_STANAG_5066_D_PDU", Const, 1}, - {"DLT_SUNATM", Const, 0}, - {"DLT_SYMANTEC_FIREWALL", Const, 0}, - {"DLT_TZSP", Const, 0}, - {"DLT_USB", Const, 0}, - {"DLT_USB_LINUX", Const, 0}, - {"DLT_USB_LINUX_MMAPPED", Const, 1}, - {"DLT_USER0", Const, 0}, - {"DLT_USER1", Const, 0}, - {"DLT_USER10", Const, 0}, - {"DLT_USER11", Const, 0}, - {"DLT_USER12", Const, 0}, - {"DLT_USER13", Const, 0}, - {"DLT_USER14", Const, 0}, - {"DLT_USER15", Const, 0}, - {"DLT_USER2", Const, 0}, - {"DLT_USER3", Const, 0}, - {"DLT_USER4", Const, 0}, - {"DLT_USER5", Const, 0}, - {"DLT_USER6", Const, 0}, - {"DLT_USER7", Const, 0}, - {"DLT_USER8", Const, 0}, - {"DLT_USER9", Const, 0}, - {"DLT_WIHART", Const, 1}, - {"DLT_X2E_SERIAL", Const, 0}, - {"DLT_X2E_XORAYA", Const, 0}, - {"DNSMXData", Type, 0}, - {"DNSMXData.NameExchange", Field, 0}, - {"DNSMXData.Pad", Field, 0}, - {"DNSMXData.Preference", Field, 0}, - {"DNSPTRData", Type, 0}, - {"DNSPTRData.Host", Field, 0}, - {"DNSRecord", Type, 0}, - {"DNSRecord.Data", Field, 0}, - {"DNSRecord.Dw", Field, 0}, - {"DNSRecord.Length", Field, 0}, - {"DNSRecord.Name", Field, 0}, - {"DNSRecord.Next", Field, 0}, - {"DNSRecord.Reserved", Field, 0}, - {"DNSRecord.Ttl", Field, 0}, - {"DNSRecord.Type", Field, 0}, - {"DNSSRVData", Type, 0}, - {"DNSSRVData.Pad", Field, 0}, - {"DNSSRVData.Port", Field, 0}, - {"DNSSRVData.Priority", Field, 0}, - {"DNSSRVData.Target", Field, 0}, - {"DNSSRVData.Weight", Field, 0}, - {"DNSTXTData", Type, 0}, - {"DNSTXTData.StringArray", Field, 0}, - {"DNSTXTData.StringCount", Field, 0}, - {"DNS_INFO_NO_RECORDS", Const, 4}, - {"DNS_TYPE_A", Const, 0}, - {"DNS_TYPE_A6", Const, 0}, - {"DNS_TYPE_AAAA", Const, 0}, - {"DNS_TYPE_ADDRS", Const, 0}, - {"DNS_TYPE_AFSDB", Const, 0}, - {"DNS_TYPE_ALL", Const, 0}, - {"DNS_TYPE_ANY", Const, 0}, - {"DNS_TYPE_ATMA", Const, 0}, - {"DNS_TYPE_AXFR", Const, 0}, - {"DNS_TYPE_CERT", Const, 0}, - {"DNS_TYPE_CNAME", Const, 0}, - {"DNS_TYPE_DHCID", Const, 0}, - {"DNS_TYPE_DNAME", Const, 0}, - {"DNS_TYPE_DNSKEY", Const, 0}, - {"DNS_TYPE_DS", Const, 0}, - {"DNS_TYPE_EID", Const, 0}, - {"DNS_TYPE_GID", Const, 0}, - {"DNS_TYPE_GPOS", Const, 0}, - {"DNS_TYPE_HINFO", Const, 0}, - {"DNS_TYPE_ISDN", Const, 0}, - {"DNS_TYPE_IXFR", Const, 0}, - {"DNS_TYPE_KEY", Const, 0}, - {"DNS_TYPE_KX", Const, 0}, - {"DNS_TYPE_LOC", Const, 0}, - {"DNS_TYPE_MAILA", Const, 0}, - {"DNS_TYPE_MAILB", Const, 0}, - {"DNS_TYPE_MB", Const, 0}, - {"DNS_TYPE_MD", Const, 0}, - {"DNS_TYPE_MF", Const, 0}, - {"DNS_TYPE_MG", Const, 0}, - {"DNS_TYPE_MINFO", Const, 0}, - {"DNS_TYPE_MR", Const, 0}, - {"DNS_TYPE_MX", Const, 0}, - {"DNS_TYPE_NAPTR", Const, 0}, - {"DNS_TYPE_NBSTAT", Const, 0}, - {"DNS_TYPE_NIMLOC", Const, 0}, - {"DNS_TYPE_NS", Const, 0}, - {"DNS_TYPE_NSAP", Const, 0}, - {"DNS_TYPE_NSAPPTR", Const, 0}, - {"DNS_TYPE_NSEC", Const, 0}, - {"DNS_TYPE_NULL", Const, 0}, - {"DNS_TYPE_NXT", Const, 0}, - {"DNS_TYPE_OPT", Const, 0}, - {"DNS_TYPE_PTR", Const, 0}, - {"DNS_TYPE_PX", Const, 0}, - {"DNS_TYPE_RP", Const, 0}, - {"DNS_TYPE_RRSIG", Const, 0}, - {"DNS_TYPE_RT", Const, 0}, - {"DNS_TYPE_SIG", Const, 0}, - {"DNS_TYPE_SINK", Const, 0}, - {"DNS_TYPE_SOA", Const, 0}, - {"DNS_TYPE_SRV", Const, 0}, - {"DNS_TYPE_TEXT", Const, 0}, - {"DNS_TYPE_TKEY", Const, 0}, - {"DNS_TYPE_TSIG", Const, 0}, - {"DNS_TYPE_UID", Const, 0}, - {"DNS_TYPE_UINFO", Const, 0}, - {"DNS_TYPE_UNSPEC", Const, 0}, - {"DNS_TYPE_WINS", Const, 0}, - {"DNS_TYPE_WINSR", Const, 0}, - {"DNS_TYPE_WKS", Const, 0}, - {"DNS_TYPE_X25", Const, 0}, - {"DT_BLK", Const, 0}, - {"DT_CHR", Const, 0}, - {"DT_DIR", Const, 0}, - {"DT_FIFO", Const, 0}, - {"DT_LNK", Const, 0}, - {"DT_REG", Const, 0}, - {"DT_SOCK", Const, 0}, - {"DT_UNKNOWN", Const, 0}, - {"DT_WHT", Const, 0}, - {"DUPLICATE_CLOSE_SOURCE", Const, 0}, - {"DUPLICATE_SAME_ACCESS", Const, 0}, - {"DeleteFile", Func, 0}, - {"DetachLsf", Func, 0}, - {"DeviceIoControl", Func, 4}, - {"Dirent", Type, 0}, - {"Dirent.Fileno", Field, 0}, - {"Dirent.Ino", Field, 0}, - {"Dirent.Name", Field, 0}, - {"Dirent.Namlen", Field, 0}, - {"Dirent.Off", Field, 0}, - {"Dirent.Pad0", Field, 12}, - {"Dirent.Pad1", Field, 12}, - {"Dirent.Pad_cgo_0", Field, 0}, - {"Dirent.Reclen", Field, 0}, - {"Dirent.Seekoff", Field, 0}, - {"Dirent.Type", Field, 0}, - {"Dirent.X__d_padding", Field, 3}, - {"DnsNameCompare", Func, 4}, - {"DnsQuery", Func, 0}, - {"DnsRecordListFree", Func, 0}, - {"DnsSectionAdditional", Const, 4}, - {"DnsSectionAnswer", Const, 4}, - {"DnsSectionAuthority", Const, 4}, - {"DnsSectionQuestion", Const, 4}, - {"Dup", Func, 0}, - {"Dup2", Func, 0}, - {"Dup3", Func, 2}, - {"DuplicateHandle", Func, 0}, - {"E2BIG", Const, 0}, - {"EACCES", Const, 0}, - {"EADDRINUSE", Const, 0}, - {"EADDRNOTAVAIL", Const, 0}, - {"EADV", Const, 0}, - {"EAFNOSUPPORT", Const, 0}, - {"EAGAIN", Const, 0}, - {"EALREADY", Const, 0}, - {"EAUTH", Const, 0}, - {"EBADARCH", Const, 0}, - {"EBADE", Const, 0}, - {"EBADEXEC", Const, 0}, - {"EBADF", Const, 0}, - {"EBADFD", Const, 0}, - {"EBADMACHO", Const, 0}, - {"EBADMSG", Const, 0}, - {"EBADR", Const, 0}, - {"EBADRPC", Const, 0}, - {"EBADRQC", Const, 0}, - {"EBADSLT", Const, 0}, - {"EBFONT", Const, 0}, - {"EBUSY", Const, 0}, - {"ECANCELED", Const, 0}, - {"ECAPMODE", Const, 1}, - {"ECHILD", Const, 0}, - {"ECHO", Const, 0}, - {"ECHOCTL", Const, 0}, - {"ECHOE", Const, 0}, - {"ECHOK", Const, 0}, - {"ECHOKE", Const, 0}, - {"ECHONL", Const, 0}, - {"ECHOPRT", Const, 0}, - {"ECHRNG", Const, 0}, - {"ECOMM", Const, 0}, - {"ECONNABORTED", Const, 0}, - {"ECONNREFUSED", Const, 0}, - {"ECONNRESET", Const, 0}, - {"EDEADLK", Const, 0}, - {"EDEADLOCK", Const, 0}, - {"EDESTADDRREQ", Const, 0}, - {"EDEVERR", Const, 0}, - {"EDOM", Const, 0}, - {"EDOOFUS", Const, 0}, - {"EDOTDOT", Const, 0}, - {"EDQUOT", Const, 0}, - {"EEXIST", Const, 0}, - {"EFAULT", Const, 0}, - {"EFBIG", Const, 0}, - {"EFER_LMA", Const, 1}, - {"EFER_LME", Const, 1}, - {"EFER_NXE", Const, 1}, - {"EFER_SCE", Const, 1}, - {"EFTYPE", Const, 0}, - {"EHOSTDOWN", Const, 0}, - {"EHOSTUNREACH", Const, 0}, - {"EHWPOISON", Const, 0}, - {"EIDRM", Const, 0}, - {"EILSEQ", Const, 0}, - {"EINPROGRESS", Const, 0}, - {"EINTR", Const, 0}, - {"EINVAL", Const, 0}, - {"EIO", Const, 0}, - {"EIPSEC", Const, 1}, - {"EISCONN", Const, 0}, - {"EISDIR", Const, 0}, - {"EISNAM", Const, 0}, - {"EKEYEXPIRED", Const, 0}, - {"EKEYREJECTED", Const, 0}, - {"EKEYREVOKED", Const, 0}, - {"EL2HLT", Const, 0}, - {"EL2NSYNC", Const, 0}, - {"EL3HLT", Const, 0}, - {"EL3RST", Const, 0}, - {"ELAST", Const, 0}, - {"ELF_NGREG", Const, 0}, - {"ELF_PRARGSZ", Const, 0}, - {"ELIBACC", Const, 0}, - {"ELIBBAD", Const, 0}, - {"ELIBEXEC", Const, 0}, - {"ELIBMAX", Const, 0}, - {"ELIBSCN", Const, 0}, - {"ELNRNG", Const, 0}, - {"ELOOP", Const, 0}, - {"EMEDIUMTYPE", Const, 0}, - {"EMFILE", Const, 0}, - {"EMLINK", Const, 0}, - {"EMSGSIZE", Const, 0}, - {"EMT_TAGOVF", Const, 1}, - {"EMULTIHOP", Const, 0}, - {"EMUL_ENABLED", Const, 1}, - {"EMUL_LINUX", Const, 1}, - {"EMUL_LINUX32", Const, 1}, - {"EMUL_MAXID", Const, 1}, - {"EMUL_NATIVE", Const, 1}, - {"ENAMETOOLONG", Const, 0}, - {"ENAVAIL", Const, 0}, - {"ENDRUNDISC", Const, 1}, - {"ENEEDAUTH", Const, 0}, - {"ENETDOWN", Const, 0}, - {"ENETRESET", Const, 0}, - {"ENETUNREACH", Const, 0}, - {"ENFILE", Const, 0}, - {"ENOANO", Const, 0}, - {"ENOATTR", Const, 0}, - {"ENOBUFS", Const, 0}, - {"ENOCSI", Const, 0}, - {"ENODATA", Const, 0}, - {"ENODEV", Const, 0}, - {"ENOENT", Const, 0}, - {"ENOEXEC", Const, 0}, - {"ENOKEY", Const, 0}, - {"ENOLCK", Const, 0}, - {"ENOLINK", Const, 0}, - {"ENOMEDIUM", Const, 0}, - {"ENOMEM", Const, 0}, - {"ENOMSG", Const, 0}, - {"ENONET", Const, 0}, - {"ENOPKG", Const, 0}, - {"ENOPOLICY", Const, 0}, - {"ENOPROTOOPT", Const, 0}, - {"ENOSPC", Const, 0}, - {"ENOSR", Const, 0}, - {"ENOSTR", Const, 0}, - {"ENOSYS", Const, 0}, - {"ENOTBLK", Const, 0}, - {"ENOTCAPABLE", Const, 0}, - {"ENOTCONN", Const, 0}, - {"ENOTDIR", Const, 0}, - {"ENOTEMPTY", Const, 0}, - {"ENOTNAM", Const, 0}, - {"ENOTRECOVERABLE", Const, 0}, - {"ENOTSOCK", Const, 0}, - {"ENOTSUP", Const, 0}, - {"ENOTTY", Const, 0}, - {"ENOTUNIQ", Const, 0}, - {"ENXIO", Const, 0}, - {"EN_SW_CTL_INF", Const, 1}, - {"EN_SW_CTL_PREC", Const, 1}, - {"EN_SW_CTL_ROUND", Const, 1}, - {"EN_SW_DATACHAIN", Const, 1}, - {"EN_SW_DENORM", Const, 1}, - {"EN_SW_INVOP", Const, 1}, - {"EN_SW_OVERFLOW", Const, 1}, - {"EN_SW_PRECLOSS", Const, 1}, - {"EN_SW_UNDERFLOW", Const, 1}, - {"EN_SW_ZERODIV", Const, 1}, - {"EOPNOTSUPP", Const, 0}, - {"EOVERFLOW", Const, 0}, - {"EOWNERDEAD", Const, 0}, - {"EPERM", Const, 0}, - {"EPFNOSUPPORT", Const, 0}, - {"EPIPE", Const, 0}, - {"EPOLLERR", Const, 0}, - {"EPOLLET", Const, 0}, - {"EPOLLHUP", Const, 0}, - {"EPOLLIN", Const, 0}, - {"EPOLLMSG", Const, 0}, - {"EPOLLONESHOT", Const, 0}, - {"EPOLLOUT", Const, 0}, - {"EPOLLPRI", Const, 0}, - {"EPOLLRDBAND", Const, 0}, - {"EPOLLRDHUP", Const, 0}, - {"EPOLLRDNORM", Const, 0}, - {"EPOLLWRBAND", Const, 0}, - {"EPOLLWRNORM", Const, 0}, - {"EPOLL_CLOEXEC", Const, 0}, - {"EPOLL_CTL_ADD", Const, 0}, - {"EPOLL_CTL_DEL", Const, 0}, - {"EPOLL_CTL_MOD", Const, 0}, - {"EPOLL_NONBLOCK", Const, 0}, - {"EPROCLIM", Const, 0}, - {"EPROCUNAVAIL", Const, 0}, - {"EPROGMISMATCH", Const, 0}, - {"EPROGUNAVAIL", Const, 0}, - {"EPROTO", Const, 0}, - {"EPROTONOSUPPORT", Const, 0}, - {"EPROTOTYPE", Const, 0}, - {"EPWROFF", Const, 0}, - {"EQFULL", Const, 16}, - {"ERANGE", Const, 0}, - {"EREMCHG", Const, 0}, - {"EREMOTE", Const, 0}, - {"EREMOTEIO", Const, 0}, - {"ERESTART", Const, 0}, - {"ERFKILL", Const, 0}, - {"EROFS", Const, 0}, - {"ERPCMISMATCH", Const, 0}, - {"ERROR_ACCESS_DENIED", Const, 0}, - {"ERROR_ALREADY_EXISTS", Const, 0}, - {"ERROR_BROKEN_PIPE", Const, 0}, - {"ERROR_BUFFER_OVERFLOW", Const, 0}, - {"ERROR_DIR_NOT_EMPTY", Const, 8}, - {"ERROR_ENVVAR_NOT_FOUND", Const, 0}, - {"ERROR_FILE_EXISTS", Const, 0}, - {"ERROR_FILE_NOT_FOUND", Const, 0}, - {"ERROR_HANDLE_EOF", Const, 2}, - {"ERROR_INSUFFICIENT_BUFFER", Const, 0}, - {"ERROR_IO_PENDING", Const, 0}, - {"ERROR_MOD_NOT_FOUND", Const, 0}, - {"ERROR_MORE_DATA", Const, 3}, - {"ERROR_NETNAME_DELETED", Const, 3}, - {"ERROR_NOT_FOUND", Const, 1}, - {"ERROR_NO_MORE_FILES", Const, 0}, - {"ERROR_OPERATION_ABORTED", Const, 0}, - {"ERROR_PATH_NOT_FOUND", Const, 0}, - {"ERROR_PRIVILEGE_NOT_HELD", Const, 4}, - {"ERROR_PROC_NOT_FOUND", Const, 0}, - {"ESHLIBVERS", Const, 0}, - {"ESHUTDOWN", Const, 0}, - {"ESOCKTNOSUPPORT", Const, 0}, - {"ESPIPE", Const, 0}, - {"ESRCH", Const, 0}, - {"ESRMNT", Const, 0}, - {"ESTALE", Const, 0}, - {"ESTRPIPE", Const, 0}, - {"ETHERCAP_JUMBO_MTU", Const, 1}, - {"ETHERCAP_VLAN_HWTAGGING", Const, 1}, - {"ETHERCAP_VLAN_MTU", Const, 1}, - {"ETHERMIN", Const, 1}, - {"ETHERMTU", Const, 1}, - {"ETHERMTU_JUMBO", Const, 1}, - {"ETHERTYPE_8023", Const, 1}, - {"ETHERTYPE_AARP", Const, 1}, - {"ETHERTYPE_ACCTON", Const, 1}, - {"ETHERTYPE_AEONIC", Const, 1}, - {"ETHERTYPE_ALPHA", Const, 1}, - {"ETHERTYPE_AMBER", Const, 1}, - {"ETHERTYPE_AMOEBA", Const, 1}, - {"ETHERTYPE_AOE", Const, 1}, - {"ETHERTYPE_APOLLO", Const, 1}, - {"ETHERTYPE_APOLLODOMAIN", Const, 1}, - {"ETHERTYPE_APPLETALK", Const, 1}, - {"ETHERTYPE_APPLITEK", Const, 1}, - {"ETHERTYPE_ARGONAUT", Const, 1}, - {"ETHERTYPE_ARP", Const, 1}, - {"ETHERTYPE_AT", Const, 1}, - {"ETHERTYPE_ATALK", Const, 1}, - {"ETHERTYPE_ATOMIC", Const, 1}, - {"ETHERTYPE_ATT", Const, 1}, - {"ETHERTYPE_ATTSTANFORD", Const, 1}, - {"ETHERTYPE_AUTOPHON", Const, 1}, - {"ETHERTYPE_AXIS", Const, 1}, - {"ETHERTYPE_BCLOOP", Const, 1}, - {"ETHERTYPE_BOFL", Const, 1}, - {"ETHERTYPE_CABLETRON", Const, 1}, - {"ETHERTYPE_CHAOS", Const, 1}, - {"ETHERTYPE_COMDESIGN", Const, 1}, - {"ETHERTYPE_COMPUGRAPHIC", Const, 1}, - {"ETHERTYPE_COUNTERPOINT", Const, 1}, - {"ETHERTYPE_CRONUS", Const, 1}, - {"ETHERTYPE_CRONUSVLN", Const, 1}, - {"ETHERTYPE_DCA", Const, 1}, - {"ETHERTYPE_DDE", Const, 1}, - {"ETHERTYPE_DEBNI", Const, 1}, - {"ETHERTYPE_DECAM", Const, 1}, - {"ETHERTYPE_DECCUST", Const, 1}, - {"ETHERTYPE_DECDIAG", Const, 1}, - {"ETHERTYPE_DECDNS", Const, 1}, - {"ETHERTYPE_DECDTS", Const, 1}, - {"ETHERTYPE_DECEXPER", Const, 1}, - {"ETHERTYPE_DECLAST", Const, 1}, - {"ETHERTYPE_DECLTM", Const, 1}, - {"ETHERTYPE_DECMUMPS", Const, 1}, - {"ETHERTYPE_DECNETBIOS", Const, 1}, - {"ETHERTYPE_DELTACON", Const, 1}, - {"ETHERTYPE_DIDDLE", Const, 1}, - {"ETHERTYPE_DLOG1", Const, 1}, - {"ETHERTYPE_DLOG2", Const, 1}, - {"ETHERTYPE_DN", Const, 1}, - {"ETHERTYPE_DOGFIGHT", Const, 1}, - {"ETHERTYPE_DSMD", Const, 1}, - {"ETHERTYPE_ECMA", Const, 1}, - {"ETHERTYPE_ENCRYPT", Const, 1}, - {"ETHERTYPE_ES", Const, 1}, - {"ETHERTYPE_EXCELAN", Const, 1}, - {"ETHERTYPE_EXPERDATA", Const, 1}, - {"ETHERTYPE_FLIP", Const, 1}, - {"ETHERTYPE_FLOWCONTROL", Const, 1}, - {"ETHERTYPE_FRARP", Const, 1}, - {"ETHERTYPE_GENDYN", Const, 1}, - {"ETHERTYPE_HAYES", Const, 1}, - {"ETHERTYPE_HIPPI_FP", Const, 1}, - {"ETHERTYPE_HITACHI", Const, 1}, - {"ETHERTYPE_HP", Const, 1}, - {"ETHERTYPE_IEEEPUP", Const, 1}, - {"ETHERTYPE_IEEEPUPAT", Const, 1}, - {"ETHERTYPE_IMLBL", Const, 1}, - {"ETHERTYPE_IMLBLDIAG", Const, 1}, - {"ETHERTYPE_IP", Const, 1}, - {"ETHERTYPE_IPAS", Const, 1}, - {"ETHERTYPE_IPV6", Const, 1}, - {"ETHERTYPE_IPX", Const, 1}, - {"ETHERTYPE_IPXNEW", Const, 1}, - {"ETHERTYPE_KALPANA", Const, 1}, - {"ETHERTYPE_LANBRIDGE", Const, 1}, - {"ETHERTYPE_LANPROBE", Const, 1}, - {"ETHERTYPE_LAT", Const, 1}, - {"ETHERTYPE_LBACK", Const, 1}, - {"ETHERTYPE_LITTLE", Const, 1}, - {"ETHERTYPE_LLDP", Const, 1}, - {"ETHERTYPE_LOGICRAFT", Const, 1}, - {"ETHERTYPE_LOOPBACK", Const, 1}, - {"ETHERTYPE_MATRA", Const, 1}, - {"ETHERTYPE_MAX", Const, 1}, - {"ETHERTYPE_MERIT", Const, 1}, - {"ETHERTYPE_MICP", Const, 1}, - {"ETHERTYPE_MOPDL", Const, 1}, - {"ETHERTYPE_MOPRC", Const, 1}, - {"ETHERTYPE_MOTOROLA", Const, 1}, - {"ETHERTYPE_MPLS", Const, 1}, - {"ETHERTYPE_MPLS_MCAST", Const, 1}, - {"ETHERTYPE_MUMPS", Const, 1}, - {"ETHERTYPE_NBPCC", Const, 1}, - {"ETHERTYPE_NBPCLAIM", Const, 1}, - {"ETHERTYPE_NBPCLREQ", Const, 1}, - {"ETHERTYPE_NBPCLRSP", Const, 1}, - {"ETHERTYPE_NBPCREQ", Const, 1}, - {"ETHERTYPE_NBPCRSP", Const, 1}, - {"ETHERTYPE_NBPDG", Const, 1}, - {"ETHERTYPE_NBPDGB", Const, 1}, - {"ETHERTYPE_NBPDLTE", Const, 1}, - {"ETHERTYPE_NBPRAR", Const, 1}, - {"ETHERTYPE_NBPRAS", Const, 1}, - {"ETHERTYPE_NBPRST", Const, 1}, - {"ETHERTYPE_NBPSCD", Const, 1}, - {"ETHERTYPE_NBPVCD", Const, 1}, - {"ETHERTYPE_NBS", Const, 1}, - {"ETHERTYPE_NCD", Const, 1}, - {"ETHERTYPE_NESTAR", Const, 1}, - {"ETHERTYPE_NETBEUI", Const, 1}, - {"ETHERTYPE_NOVELL", Const, 1}, - {"ETHERTYPE_NS", Const, 1}, - {"ETHERTYPE_NSAT", Const, 1}, - {"ETHERTYPE_NSCOMPAT", Const, 1}, - {"ETHERTYPE_NTRAILER", Const, 1}, - {"ETHERTYPE_OS9", Const, 1}, - {"ETHERTYPE_OS9NET", Const, 1}, - {"ETHERTYPE_PACER", Const, 1}, - {"ETHERTYPE_PAE", Const, 1}, - {"ETHERTYPE_PCS", Const, 1}, - {"ETHERTYPE_PLANNING", Const, 1}, - {"ETHERTYPE_PPP", Const, 1}, - {"ETHERTYPE_PPPOE", Const, 1}, - {"ETHERTYPE_PPPOEDISC", Const, 1}, - {"ETHERTYPE_PRIMENTS", Const, 1}, - {"ETHERTYPE_PUP", Const, 1}, - {"ETHERTYPE_PUPAT", Const, 1}, - {"ETHERTYPE_QINQ", Const, 1}, - {"ETHERTYPE_RACAL", Const, 1}, - {"ETHERTYPE_RATIONAL", Const, 1}, - {"ETHERTYPE_RAWFR", Const, 1}, - {"ETHERTYPE_RCL", Const, 1}, - {"ETHERTYPE_RDP", Const, 1}, - {"ETHERTYPE_RETIX", Const, 1}, - {"ETHERTYPE_REVARP", Const, 1}, - {"ETHERTYPE_SCA", Const, 1}, - {"ETHERTYPE_SECTRA", Const, 1}, - {"ETHERTYPE_SECUREDATA", Const, 1}, - {"ETHERTYPE_SGITW", Const, 1}, - {"ETHERTYPE_SG_BOUNCE", Const, 1}, - {"ETHERTYPE_SG_DIAG", Const, 1}, - {"ETHERTYPE_SG_NETGAMES", Const, 1}, - {"ETHERTYPE_SG_RESV", Const, 1}, - {"ETHERTYPE_SIMNET", Const, 1}, - {"ETHERTYPE_SLOW", Const, 1}, - {"ETHERTYPE_SLOWPROTOCOLS", Const, 1}, - {"ETHERTYPE_SNA", Const, 1}, - {"ETHERTYPE_SNMP", Const, 1}, - {"ETHERTYPE_SONIX", Const, 1}, - {"ETHERTYPE_SPIDER", Const, 1}, - {"ETHERTYPE_SPRITE", Const, 1}, - {"ETHERTYPE_STP", Const, 1}, - {"ETHERTYPE_TALARIS", Const, 1}, - {"ETHERTYPE_TALARISMC", Const, 1}, - {"ETHERTYPE_TCPCOMP", Const, 1}, - {"ETHERTYPE_TCPSM", Const, 1}, - {"ETHERTYPE_TEC", Const, 1}, - {"ETHERTYPE_TIGAN", Const, 1}, - {"ETHERTYPE_TRAIL", Const, 1}, - {"ETHERTYPE_TRANSETHER", Const, 1}, - {"ETHERTYPE_TYMSHARE", Const, 1}, - {"ETHERTYPE_UBBST", Const, 1}, - {"ETHERTYPE_UBDEBUG", Const, 1}, - {"ETHERTYPE_UBDIAGLOOP", Const, 1}, - {"ETHERTYPE_UBDL", Const, 1}, - {"ETHERTYPE_UBNIU", Const, 1}, - {"ETHERTYPE_UBNMC", Const, 1}, - {"ETHERTYPE_VALID", Const, 1}, - {"ETHERTYPE_VARIAN", Const, 1}, - {"ETHERTYPE_VAXELN", Const, 1}, - {"ETHERTYPE_VEECO", Const, 1}, - {"ETHERTYPE_VEXP", Const, 1}, - {"ETHERTYPE_VGLAB", Const, 1}, - {"ETHERTYPE_VINES", Const, 1}, - {"ETHERTYPE_VINESECHO", Const, 1}, - {"ETHERTYPE_VINESLOOP", Const, 1}, - {"ETHERTYPE_VITAL", Const, 1}, - {"ETHERTYPE_VLAN", Const, 1}, - {"ETHERTYPE_VLTLMAN", Const, 1}, - {"ETHERTYPE_VPROD", Const, 1}, - {"ETHERTYPE_VURESERVED", Const, 1}, - {"ETHERTYPE_WATERLOO", Const, 1}, - {"ETHERTYPE_WELLFLEET", Const, 1}, - {"ETHERTYPE_X25", Const, 1}, - {"ETHERTYPE_X75", Const, 1}, - {"ETHERTYPE_XNSSM", Const, 1}, - {"ETHERTYPE_XTP", Const, 1}, - {"ETHER_ADDR_LEN", Const, 1}, - {"ETHER_ALIGN", Const, 1}, - {"ETHER_CRC_LEN", Const, 1}, - {"ETHER_CRC_POLY_BE", Const, 1}, - {"ETHER_CRC_POLY_LE", Const, 1}, - {"ETHER_HDR_LEN", Const, 1}, - {"ETHER_MAX_DIX_LEN", Const, 1}, - {"ETHER_MAX_LEN", Const, 1}, - {"ETHER_MAX_LEN_JUMBO", Const, 1}, - {"ETHER_MIN_LEN", Const, 1}, - {"ETHER_PPPOE_ENCAP_LEN", Const, 1}, - {"ETHER_TYPE_LEN", Const, 1}, - {"ETHER_VLAN_ENCAP_LEN", Const, 1}, - {"ETH_P_1588", Const, 0}, - {"ETH_P_8021Q", Const, 0}, - {"ETH_P_802_2", Const, 0}, - {"ETH_P_802_3", Const, 0}, - {"ETH_P_AARP", Const, 0}, - {"ETH_P_ALL", Const, 0}, - {"ETH_P_AOE", Const, 0}, - {"ETH_P_ARCNET", Const, 0}, - {"ETH_P_ARP", Const, 0}, - {"ETH_P_ATALK", Const, 0}, - {"ETH_P_ATMFATE", Const, 0}, - {"ETH_P_ATMMPOA", Const, 0}, - {"ETH_P_AX25", Const, 0}, - {"ETH_P_BPQ", Const, 0}, - {"ETH_P_CAIF", Const, 0}, - {"ETH_P_CAN", Const, 0}, - {"ETH_P_CONTROL", Const, 0}, - {"ETH_P_CUST", Const, 0}, - {"ETH_P_DDCMP", Const, 0}, - {"ETH_P_DEC", Const, 0}, - {"ETH_P_DIAG", Const, 0}, - {"ETH_P_DNA_DL", Const, 0}, - {"ETH_P_DNA_RC", Const, 0}, - {"ETH_P_DNA_RT", Const, 0}, - {"ETH_P_DSA", Const, 0}, - {"ETH_P_ECONET", Const, 0}, - {"ETH_P_EDSA", Const, 0}, - {"ETH_P_FCOE", Const, 0}, - {"ETH_P_FIP", Const, 0}, - {"ETH_P_HDLC", Const, 0}, - {"ETH_P_IEEE802154", Const, 0}, - {"ETH_P_IEEEPUP", Const, 0}, - {"ETH_P_IEEEPUPAT", Const, 0}, - {"ETH_P_IP", Const, 0}, - {"ETH_P_IPV6", Const, 0}, - {"ETH_P_IPX", Const, 0}, - {"ETH_P_IRDA", Const, 0}, - {"ETH_P_LAT", Const, 0}, - {"ETH_P_LINK_CTL", Const, 0}, - {"ETH_P_LOCALTALK", Const, 0}, - {"ETH_P_LOOP", Const, 0}, - {"ETH_P_MOBITEX", Const, 0}, - {"ETH_P_MPLS_MC", Const, 0}, - {"ETH_P_MPLS_UC", Const, 0}, - {"ETH_P_PAE", Const, 0}, - {"ETH_P_PAUSE", Const, 0}, - {"ETH_P_PHONET", Const, 0}, - {"ETH_P_PPPTALK", Const, 0}, - {"ETH_P_PPP_DISC", Const, 0}, - {"ETH_P_PPP_MP", Const, 0}, - {"ETH_P_PPP_SES", Const, 0}, - {"ETH_P_PUP", Const, 0}, - {"ETH_P_PUPAT", Const, 0}, - {"ETH_P_RARP", Const, 0}, - {"ETH_P_SCA", Const, 0}, - {"ETH_P_SLOW", Const, 0}, - {"ETH_P_SNAP", Const, 0}, - {"ETH_P_TEB", Const, 0}, - {"ETH_P_TIPC", Const, 0}, - {"ETH_P_TRAILER", Const, 0}, - {"ETH_P_TR_802_2", Const, 0}, - {"ETH_P_WAN_PPP", Const, 0}, - {"ETH_P_WCCP", Const, 0}, - {"ETH_P_X25", Const, 0}, - {"ETIME", Const, 0}, - {"ETIMEDOUT", Const, 0}, - {"ETOOMANYREFS", Const, 0}, - {"ETXTBSY", Const, 0}, - {"EUCLEAN", Const, 0}, - {"EUNATCH", Const, 0}, - {"EUSERS", Const, 0}, - {"EVFILT_AIO", Const, 0}, - {"EVFILT_FS", Const, 0}, - {"EVFILT_LIO", Const, 0}, - {"EVFILT_MACHPORT", Const, 0}, - {"EVFILT_PROC", Const, 0}, - {"EVFILT_READ", Const, 0}, - {"EVFILT_SIGNAL", Const, 0}, - {"EVFILT_SYSCOUNT", Const, 0}, - {"EVFILT_THREADMARKER", Const, 0}, - {"EVFILT_TIMER", Const, 0}, - {"EVFILT_USER", Const, 0}, - {"EVFILT_VM", Const, 0}, - {"EVFILT_VNODE", Const, 0}, - {"EVFILT_WRITE", Const, 0}, - {"EV_ADD", Const, 0}, - {"EV_CLEAR", Const, 0}, - {"EV_DELETE", Const, 0}, - {"EV_DISABLE", Const, 0}, - {"EV_DISPATCH", Const, 0}, - {"EV_DROP", Const, 3}, - {"EV_ENABLE", Const, 0}, - {"EV_EOF", Const, 0}, - {"EV_ERROR", Const, 0}, - {"EV_FLAG0", Const, 0}, - {"EV_FLAG1", Const, 0}, - {"EV_ONESHOT", Const, 0}, - {"EV_OOBAND", Const, 0}, - {"EV_POLL", Const, 0}, - {"EV_RECEIPT", Const, 0}, - {"EV_SYSFLAGS", Const, 0}, - {"EWINDOWS", Const, 0}, - {"EWOULDBLOCK", Const, 0}, - {"EXDEV", Const, 0}, - {"EXFULL", Const, 0}, - {"EXTA", Const, 0}, - {"EXTB", Const, 0}, - {"EXTPROC", Const, 0}, - {"Environ", Func, 0}, - {"EpollCreate", Func, 0}, - {"EpollCreate1", Func, 0}, - {"EpollCtl", Func, 0}, - {"EpollEvent", Type, 0}, - {"EpollEvent.Events", Field, 0}, - {"EpollEvent.Fd", Field, 0}, - {"EpollEvent.Pad", Field, 0}, - {"EpollEvent.PadFd", Field, 0}, - {"EpollWait", Func, 0}, - {"Errno", Type, 0}, - {"EscapeArg", Func, 0}, - {"Exchangedata", Func, 0}, - {"Exec", Func, 0}, - {"Exit", Func, 0}, - {"ExitProcess", Func, 0}, - {"FD_CLOEXEC", Const, 0}, - {"FD_SETSIZE", Const, 0}, - {"FILE_ACTION_ADDED", Const, 0}, - {"FILE_ACTION_MODIFIED", Const, 0}, - {"FILE_ACTION_REMOVED", Const, 0}, - {"FILE_ACTION_RENAMED_NEW_NAME", Const, 0}, - {"FILE_ACTION_RENAMED_OLD_NAME", Const, 0}, - {"FILE_APPEND_DATA", Const, 0}, - {"FILE_ATTRIBUTE_ARCHIVE", Const, 0}, - {"FILE_ATTRIBUTE_DIRECTORY", Const, 0}, - {"FILE_ATTRIBUTE_HIDDEN", Const, 0}, - {"FILE_ATTRIBUTE_NORMAL", Const, 0}, - {"FILE_ATTRIBUTE_READONLY", Const, 0}, - {"FILE_ATTRIBUTE_REPARSE_POINT", Const, 4}, - {"FILE_ATTRIBUTE_SYSTEM", Const, 0}, - {"FILE_BEGIN", Const, 0}, - {"FILE_CURRENT", Const, 0}, - {"FILE_END", Const, 0}, - {"FILE_FLAG_BACKUP_SEMANTICS", Const, 0}, - {"FILE_FLAG_OPEN_REPARSE_POINT", Const, 4}, - {"FILE_FLAG_OVERLAPPED", Const, 0}, - {"FILE_LIST_DIRECTORY", Const, 0}, - {"FILE_MAP_COPY", Const, 0}, - {"FILE_MAP_EXECUTE", Const, 0}, - {"FILE_MAP_READ", Const, 0}, - {"FILE_MAP_WRITE", Const, 0}, - {"FILE_NOTIFY_CHANGE_ATTRIBUTES", Const, 0}, - {"FILE_NOTIFY_CHANGE_CREATION", Const, 0}, - {"FILE_NOTIFY_CHANGE_DIR_NAME", Const, 0}, - {"FILE_NOTIFY_CHANGE_FILE_NAME", Const, 0}, - {"FILE_NOTIFY_CHANGE_LAST_ACCESS", Const, 0}, - {"FILE_NOTIFY_CHANGE_LAST_WRITE", Const, 0}, - {"FILE_NOTIFY_CHANGE_SIZE", Const, 0}, - {"FILE_SHARE_DELETE", Const, 0}, - {"FILE_SHARE_READ", Const, 0}, - {"FILE_SHARE_WRITE", Const, 0}, - {"FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", Const, 2}, - {"FILE_SKIP_SET_EVENT_ON_HANDLE", Const, 2}, - {"FILE_TYPE_CHAR", Const, 0}, - {"FILE_TYPE_DISK", Const, 0}, - {"FILE_TYPE_PIPE", Const, 0}, - {"FILE_TYPE_REMOTE", Const, 0}, - {"FILE_TYPE_UNKNOWN", Const, 0}, - {"FILE_WRITE_ATTRIBUTES", Const, 0}, - {"FLUSHO", Const, 0}, - {"FORMAT_MESSAGE_ALLOCATE_BUFFER", Const, 0}, - {"FORMAT_MESSAGE_ARGUMENT_ARRAY", Const, 0}, - {"FORMAT_MESSAGE_FROM_HMODULE", Const, 0}, - {"FORMAT_MESSAGE_FROM_STRING", Const, 0}, - {"FORMAT_MESSAGE_FROM_SYSTEM", Const, 0}, - {"FORMAT_MESSAGE_IGNORE_INSERTS", Const, 0}, - {"FORMAT_MESSAGE_MAX_WIDTH_MASK", Const, 0}, - {"FSCTL_GET_REPARSE_POINT", Const, 4}, - {"F_ADDFILESIGS", Const, 0}, - {"F_ADDSIGS", Const, 0}, - {"F_ALLOCATEALL", Const, 0}, - {"F_ALLOCATECONTIG", Const, 0}, - {"F_CANCEL", Const, 0}, - {"F_CHKCLEAN", Const, 0}, - {"F_CLOSEM", Const, 1}, - {"F_DUP2FD", Const, 0}, - {"F_DUP2FD_CLOEXEC", Const, 1}, - {"F_DUPFD", Const, 0}, - {"F_DUPFD_CLOEXEC", Const, 0}, - {"F_EXLCK", Const, 0}, - {"F_FINDSIGS", Const, 16}, - {"F_FLUSH_DATA", Const, 0}, - {"F_FREEZE_FS", Const, 0}, - {"F_FSCTL", Const, 1}, - {"F_FSDIRMASK", Const, 1}, - {"F_FSIN", Const, 1}, - {"F_FSINOUT", Const, 1}, - {"F_FSOUT", Const, 1}, - {"F_FSPRIV", Const, 1}, - {"F_FSVOID", Const, 1}, - {"F_FULLFSYNC", Const, 0}, - {"F_GETCODEDIR", Const, 16}, - {"F_GETFD", Const, 0}, - {"F_GETFL", Const, 0}, - {"F_GETLEASE", Const, 0}, - {"F_GETLK", Const, 0}, - {"F_GETLK64", Const, 0}, - {"F_GETLKPID", Const, 0}, - {"F_GETNOSIGPIPE", Const, 0}, - {"F_GETOWN", Const, 0}, - {"F_GETOWN_EX", Const, 0}, - {"F_GETPATH", Const, 0}, - {"F_GETPATH_MTMINFO", Const, 0}, - {"F_GETPIPE_SZ", Const, 0}, - {"F_GETPROTECTIONCLASS", Const, 0}, - {"F_GETPROTECTIONLEVEL", Const, 16}, - {"F_GETSIG", Const, 0}, - {"F_GLOBAL_NOCACHE", Const, 0}, - {"F_LOCK", Const, 0}, - {"F_LOG2PHYS", Const, 0}, - {"F_LOG2PHYS_EXT", Const, 0}, - {"F_MARKDEPENDENCY", Const, 0}, - {"F_MAXFD", Const, 1}, - {"F_NOCACHE", Const, 0}, - {"F_NODIRECT", Const, 0}, - {"F_NOTIFY", Const, 0}, - {"F_OGETLK", Const, 0}, - {"F_OK", Const, 0}, - {"F_OSETLK", Const, 0}, - {"F_OSETLKW", Const, 0}, - {"F_PARAM_MASK", Const, 1}, - {"F_PARAM_MAX", Const, 1}, - {"F_PATHPKG_CHECK", Const, 0}, - {"F_PEOFPOSMODE", Const, 0}, - {"F_PREALLOCATE", Const, 0}, - {"F_RDADVISE", Const, 0}, - {"F_RDAHEAD", Const, 0}, - {"F_RDLCK", Const, 0}, - {"F_READAHEAD", Const, 0}, - {"F_READBOOTSTRAP", Const, 0}, - {"F_SETBACKINGSTORE", Const, 0}, - {"F_SETFD", Const, 0}, - {"F_SETFL", Const, 0}, - {"F_SETLEASE", Const, 0}, - {"F_SETLK", Const, 0}, - {"F_SETLK64", Const, 0}, - {"F_SETLKW", Const, 0}, - {"F_SETLKW64", Const, 0}, - {"F_SETLKWTIMEOUT", Const, 16}, - {"F_SETLK_REMOTE", Const, 0}, - {"F_SETNOSIGPIPE", Const, 0}, - {"F_SETOWN", Const, 0}, - {"F_SETOWN_EX", Const, 0}, - {"F_SETPIPE_SZ", Const, 0}, - {"F_SETPROTECTIONCLASS", Const, 0}, - {"F_SETSIG", Const, 0}, - {"F_SETSIZE", Const, 0}, - {"F_SHLCK", Const, 0}, - {"F_SINGLE_WRITER", Const, 16}, - {"F_TEST", Const, 0}, - {"F_THAW_FS", Const, 0}, - {"F_TLOCK", Const, 0}, - {"F_TRANSCODEKEY", Const, 16}, - {"F_ULOCK", Const, 0}, - {"F_UNLCK", Const, 0}, - {"F_UNLCKSYS", Const, 0}, - {"F_VOLPOSMODE", Const, 0}, - {"F_WRITEBOOTSTRAP", Const, 0}, - {"F_WRLCK", Const, 0}, - {"Faccessat", Func, 0}, - {"Fallocate", Func, 0}, - {"Fbootstraptransfer_t", Type, 0}, - {"Fbootstraptransfer_t.Buffer", Field, 0}, - {"Fbootstraptransfer_t.Length", Field, 0}, - {"Fbootstraptransfer_t.Offset", Field, 0}, - {"Fchdir", Func, 0}, - {"Fchflags", Func, 0}, - {"Fchmod", Func, 0}, - {"Fchmodat", Func, 0}, - {"Fchown", Func, 0}, - {"Fchownat", Func, 0}, - {"FcntlFlock", Func, 3}, - {"FdSet", Type, 0}, - {"FdSet.Bits", Field, 0}, - {"FdSet.X__fds_bits", Field, 0}, - {"Fdatasync", Func, 0}, - {"FileNotifyInformation", Type, 0}, - {"FileNotifyInformation.Action", Field, 0}, - {"FileNotifyInformation.FileName", Field, 0}, - {"FileNotifyInformation.FileNameLength", Field, 0}, - {"FileNotifyInformation.NextEntryOffset", Field, 0}, - {"Filetime", Type, 0}, - {"Filetime.HighDateTime", Field, 0}, - {"Filetime.LowDateTime", Field, 0}, - {"FindClose", Func, 0}, - {"FindFirstFile", Func, 0}, - {"FindNextFile", Func, 0}, - {"Flock", Func, 0}, - {"Flock_t", Type, 0}, - {"Flock_t.Len", Field, 0}, - {"Flock_t.Pad_cgo_0", Field, 0}, - {"Flock_t.Pad_cgo_1", Field, 3}, - {"Flock_t.Pid", Field, 0}, - {"Flock_t.Start", Field, 0}, - {"Flock_t.Sysid", Field, 0}, - {"Flock_t.Type", Field, 0}, - {"Flock_t.Whence", Field, 0}, - {"FlushBpf", Func, 0}, - {"FlushFileBuffers", Func, 0}, - {"FlushViewOfFile", Func, 0}, - {"ForkExec", Func, 0}, - {"ForkLock", Var, 0}, - {"FormatMessage", Func, 0}, - {"Fpathconf", Func, 0}, - {"FreeAddrInfoW", Func, 1}, - {"FreeEnvironmentStrings", Func, 0}, - {"FreeLibrary", Func, 0}, - {"Fsid", Type, 0}, - {"Fsid.Val", Field, 0}, - {"Fsid.X__fsid_val", Field, 2}, - {"Fsid.X__val", Field, 0}, - {"Fstat", Func, 0}, - {"Fstatat", Func, 12}, - {"Fstatfs", Func, 0}, - {"Fstore_t", Type, 0}, - {"Fstore_t.Bytesalloc", Field, 0}, - {"Fstore_t.Flags", Field, 0}, - {"Fstore_t.Length", Field, 0}, - {"Fstore_t.Offset", Field, 0}, - {"Fstore_t.Posmode", Field, 0}, - {"Fsync", Func, 0}, - {"Ftruncate", Func, 0}, - {"FullPath", Func, 4}, - {"Futimes", Func, 0}, - {"Futimesat", Func, 0}, - {"GENERIC_ALL", Const, 0}, - {"GENERIC_EXECUTE", Const, 0}, - {"GENERIC_READ", Const, 0}, - {"GENERIC_WRITE", Const, 0}, - {"GUID", Type, 1}, - {"GUID.Data1", Field, 1}, - {"GUID.Data2", Field, 1}, - {"GUID.Data3", Field, 1}, - {"GUID.Data4", Field, 1}, - {"GetAcceptExSockaddrs", Func, 0}, - {"GetAdaptersInfo", Func, 0}, - {"GetAddrInfoW", Func, 1}, - {"GetCommandLine", Func, 0}, - {"GetComputerName", Func, 0}, - {"GetConsoleMode", Func, 1}, - {"GetCurrentDirectory", Func, 0}, - {"GetCurrentProcess", Func, 0}, - {"GetEnvironmentStrings", Func, 0}, - {"GetEnvironmentVariable", Func, 0}, - {"GetExitCodeProcess", Func, 0}, - {"GetFileAttributes", Func, 0}, - {"GetFileAttributesEx", Func, 0}, - {"GetFileExInfoStandard", Const, 0}, - {"GetFileExMaxInfoLevel", Const, 0}, - {"GetFileInformationByHandle", Func, 0}, - {"GetFileType", Func, 0}, - {"GetFullPathName", Func, 0}, - {"GetHostByName", Func, 0}, - {"GetIfEntry", Func, 0}, - {"GetLastError", Func, 0}, - {"GetLengthSid", Func, 0}, - {"GetLongPathName", Func, 0}, - {"GetProcAddress", Func, 0}, - {"GetProcessTimes", Func, 0}, - {"GetProtoByName", Func, 0}, - {"GetQueuedCompletionStatus", Func, 0}, - {"GetServByName", Func, 0}, - {"GetShortPathName", Func, 0}, - {"GetStartupInfo", Func, 0}, - {"GetStdHandle", Func, 0}, - {"GetSystemTimeAsFileTime", Func, 0}, - {"GetTempPath", Func, 0}, - {"GetTimeZoneInformation", Func, 0}, - {"GetTokenInformation", Func, 0}, - {"GetUserNameEx", Func, 0}, - {"GetUserProfileDirectory", Func, 0}, - {"GetVersion", Func, 0}, - {"Getcwd", Func, 0}, - {"Getdents", Func, 0}, - {"Getdirentries", Func, 0}, - {"Getdtablesize", Func, 0}, - {"Getegid", Func, 0}, - {"Getenv", Func, 0}, - {"Geteuid", Func, 0}, - {"Getfsstat", Func, 0}, - {"Getgid", Func, 0}, - {"Getgroups", Func, 0}, - {"Getpagesize", Func, 0}, - {"Getpeername", Func, 0}, - {"Getpgid", Func, 0}, - {"Getpgrp", Func, 0}, - {"Getpid", Func, 0}, - {"Getppid", Func, 0}, - {"Getpriority", Func, 0}, - {"Getrlimit", Func, 0}, - {"Getrusage", Func, 0}, - {"Getsid", Func, 0}, - {"Getsockname", Func, 0}, - {"Getsockopt", Func, 1}, - {"GetsockoptByte", Func, 0}, - {"GetsockoptICMPv6Filter", Func, 2}, - {"GetsockoptIPMreq", Func, 0}, - {"GetsockoptIPMreqn", Func, 0}, - {"GetsockoptIPv6MTUInfo", Func, 2}, - {"GetsockoptIPv6Mreq", Func, 0}, - {"GetsockoptInet4Addr", Func, 0}, - {"GetsockoptInt", Func, 0}, - {"GetsockoptUcred", Func, 1}, - {"Gettid", Func, 0}, - {"Gettimeofday", Func, 0}, - {"Getuid", Func, 0}, - {"Getwd", Func, 0}, - {"Getxattr", Func, 1}, - {"HANDLE_FLAG_INHERIT", Const, 0}, - {"HKEY_CLASSES_ROOT", Const, 0}, - {"HKEY_CURRENT_CONFIG", Const, 0}, - {"HKEY_CURRENT_USER", Const, 0}, - {"HKEY_DYN_DATA", Const, 0}, - {"HKEY_LOCAL_MACHINE", Const, 0}, - {"HKEY_PERFORMANCE_DATA", Const, 0}, - {"HKEY_USERS", Const, 0}, - {"HUPCL", Const, 0}, - {"Handle", Type, 0}, - {"Hostent", Type, 0}, - {"Hostent.AddrList", Field, 0}, - {"Hostent.AddrType", Field, 0}, - {"Hostent.Aliases", Field, 0}, - {"Hostent.Length", Field, 0}, - {"Hostent.Name", Field, 0}, - {"ICANON", Const, 0}, - {"ICMP6_FILTER", Const, 2}, - {"ICMPV6_FILTER", Const, 2}, - {"ICMPv6Filter", Type, 2}, - {"ICMPv6Filter.Data", Field, 2}, - {"ICMPv6Filter.Filt", Field, 2}, - {"ICRNL", Const, 0}, - {"IEXTEN", Const, 0}, - {"IFAN_ARRIVAL", Const, 1}, - {"IFAN_DEPARTURE", Const, 1}, - {"IFA_ADDRESS", Const, 0}, - {"IFA_ANYCAST", Const, 0}, - {"IFA_BROADCAST", Const, 0}, - {"IFA_CACHEINFO", Const, 0}, - {"IFA_F_DADFAILED", Const, 0}, - {"IFA_F_DEPRECATED", Const, 0}, - {"IFA_F_HOMEADDRESS", Const, 0}, - {"IFA_F_NODAD", Const, 0}, - {"IFA_F_OPTIMISTIC", Const, 0}, - {"IFA_F_PERMANENT", Const, 0}, - {"IFA_F_SECONDARY", Const, 0}, - {"IFA_F_TEMPORARY", Const, 0}, - {"IFA_F_TENTATIVE", Const, 0}, - {"IFA_LABEL", Const, 0}, - {"IFA_LOCAL", Const, 0}, - {"IFA_MAX", Const, 0}, - {"IFA_MULTICAST", Const, 0}, - {"IFA_ROUTE", Const, 1}, - {"IFA_UNSPEC", Const, 0}, - {"IFF_ALLMULTI", Const, 0}, - {"IFF_ALTPHYS", Const, 0}, - {"IFF_AUTOMEDIA", Const, 0}, - {"IFF_BROADCAST", Const, 0}, - {"IFF_CANTCHANGE", Const, 0}, - {"IFF_CANTCONFIG", Const, 1}, - {"IFF_DEBUG", Const, 0}, - {"IFF_DRV_OACTIVE", Const, 0}, - {"IFF_DRV_RUNNING", Const, 0}, - {"IFF_DYING", Const, 0}, - {"IFF_DYNAMIC", Const, 0}, - {"IFF_LINK0", Const, 0}, - {"IFF_LINK1", Const, 0}, - {"IFF_LINK2", Const, 0}, - {"IFF_LOOPBACK", Const, 0}, - {"IFF_MASTER", Const, 0}, - {"IFF_MONITOR", Const, 0}, - {"IFF_MULTICAST", Const, 0}, - {"IFF_NOARP", Const, 0}, - {"IFF_NOTRAILERS", Const, 0}, - {"IFF_NO_PI", Const, 0}, - {"IFF_OACTIVE", Const, 0}, - {"IFF_ONE_QUEUE", Const, 0}, - {"IFF_POINTOPOINT", Const, 0}, - {"IFF_POINTTOPOINT", Const, 0}, - {"IFF_PORTSEL", Const, 0}, - {"IFF_PPROMISC", Const, 0}, - {"IFF_PROMISC", Const, 0}, - {"IFF_RENAMING", Const, 0}, - {"IFF_RUNNING", Const, 0}, - {"IFF_SIMPLEX", Const, 0}, - {"IFF_SLAVE", Const, 0}, - {"IFF_SMART", Const, 0}, - {"IFF_STATICARP", Const, 0}, - {"IFF_TAP", Const, 0}, - {"IFF_TUN", Const, 0}, - {"IFF_TUN_EXCL", Const, 0}, - {"IFF_UP", Const, 0}, - {"IFF_VNET_HDR", Const, 0}, - {"IFLA_ADDRESS", Const, 0}, - {"IFLA_BROADCAST", Const, 0}, - {"IFLA_COST", Const, 0}, - {"IFLA_IFALIAS", Const, 0}, - {"IFLA_IFNAME", Const, 0}, - {"IFLA_LINK", Const, 0}, - {"IFLA_LINKINFO", Const, 0}, - {"IFLA_LINKMODE", Const, 0}, - {"IFLA_MAP", Const, 0}, - {"IFLA_MASTER", Const, 0}, - {"IFLA_MAX", Const, 0}, - {"IFLA_MTU", Const, 0}, - {"IFLA_NET_NS_PID", Const, 0}, - {"IFLA_OPERSTATE", Const, 0}, - {"IFLA_PRIORITY", Const, 0}, - {"IFLA_PROTINFO", Const, 0}, - {"IFLA_QDISC", Const, 0}, - {"IFLA_STATS", Const, 0}, - {"IFLA_TXQLEN", Const, 0}, - {"IFLA_UNSPEC", Const, 0}, - {"IFLA_WEIGHT", Const, 0}, - {"IFLA_WIRELESS", Const, 0}, - {"IFNAMSIZ", Const, 0}, - {"IFT_1822", Const, 0}, - {"IFT_A12MPPSWITCH", Const, 0}, - {"IFT_AAL2", Const, 0}, - {"IFT_AAL5", Const, 0}, - {"IFT_ADSL", Const, 0}, - {"IFT_AFLANE8023", Const, 0}, - {"IFT_AFLANE8025", Const, 0}, - {"IFT_ARAP", Const, 0}, - {"IFT_ARCNET", Const, 0}, - {"IFT_ARCNETPLUS", Const, 0}, - {"IFT_ASYNC", Const, 0}, - {"IFT_ATM", Const, 0}, - {"IFT_ATMDXI", Const, 0}, - {"IFT_ATMFUNI", Const, 0}, - {"IFT_ATMIMA", Const, 0}, - {"IFT_ATMLOGICAL", Const, 0}, - {"IFT_ATMRADIO", Const, 0}, - {"IFT_ATMSUBINTERFACE", Const, 0}, - {"IFT_ATMVCIENDPT", Const, 0}, - {"IFT_ATMVIRTUAL", Const, 0}, - {"IFT_BGPPOLICYACCOUNTING", Const, 0}, - {"IFT_BLUETOOTH", Const, 1}, - {"IFT_BRIDGE", Const, 0}, - {"IFT_BSC", Const, 0}, - {"IFT_CARP", Const, 0}, - {"IFT_CCTEMUL", Const, 0}, - {"IFT_CELLULAR", Const, 0}, - {"IFT_CEPT", Const, 0}, - {"IFT_CES", Const, 0}, - {"IFT_CHANNEL", Const, 0}, - {"IFT_CNR", Const, 0}, - {"IFT_COFFEE", Const, 0}, - {"IFT_COMPOSITELINK", Const, 0}, - {"IFT_DCN", Const, 0}, - {"IFT_DIGITALPOWERLINE", Const, 0}, - {"IFT_DIGITALWRAPPEROVERHEADCHANNEL", Const, 0}, - {"IFT_DLSW", Const, 0}, - {"IFT_DOCSCABLEDOWNSTREAM", Const, 0}, - {"IFT_DOCSCABLEMACLAYER", Const, 0}, - {"IFT_DOCSCABLEUPSTREAM", Const, 0}, - {"IFT_DOCSCABLEUPSTREAMCHANNEL", Const, 1}, - {"IFT_DS0", Const, 0}, - {"IFT_DS0BUNDLE", Const, 0}, - {"IFT_DS1FDL", Const, 0}, - {"IFT_DS3", Const, 0}, - {"IFT_DTM", Const, 0}, - {"IFT_DUMMY", Const, 1}, - {"IFT_DVBASILN", Const, 0}, - {"IFT_DVBASIOUT", Const, 0}, - {"IFT_DVBRCCDOWNSTREAM", Const, 0}, - {"IFT_DVBRCCMACLAYER", Const, 0}, - {"IFT_DVBRCCUPSTREAM", Const, 0}, - {"IFT_ECONET", Const, 1}, - {"IFT_ENC", Const, 0}, - {"IFT_EON", Const, 0}, - {"IFT_EPLRS", Const, 0}, - {"IFT_ESCON", Const, 0}, - {"IFT_ETHER", Const, 0}, - {"IFT_FAITH", Const, 0}, - {"IFT_FAST", Const, 0}, - {"IFT_FASTETHER", Const, 0}, - {"IFT_FASTETHERFX", Const, 0}, - {"IFT_FDDI", Const, 0}, - {"IFT_FIBRECHANNEL", Const, 0}, - {"IFT_FRAMERELAYINTERCONNECT", Const, 0}, - {"IFT_FRAMERELAYMPI", Const, 0}, - {"IFT_FRDLCIENDPT", Const, 0}, - {"IFT_FRELAY", Const, 0}, - {"IFT_FRELAYDCE", Const, 0}, - {"IFT_FRF16MFRBUNDLE", Const, 0}, - {"IFT_FRFORWARD", Const, 0}, - {"IFT_G703AT2MB", Const, 0}, - {"IFT_G703AT64K", Const, 0}, - {"IFT_GIF", Const, 0}, - {"IFT_GIGABITETHERNET", Const, 0}, - {"IFT_GR303IDT", Const, 0}, - {"IFT_GR303RDT", Const, 0}, - {"IFT_H323GATEKEEPER", Const, 0}, - {"IFT_H323PROXY", Const, 0}, - {"IFT_HDH1822", Const, 0}, - {"IFT_HDLC", Const, 0}, - {"IFT_HDSL2", Const, 0}, - {"IFT_HIPERLAN2", Const, 0}, - {"IFT_HIPPI", Const, 0}, - {"IFT_HIPPIINTERFACE", Const, 0}, - {"IFT_HOSTPAD", Const, 0}, - {"IFT_HSSI", Const, 0}, - {"IFT_HY", Const, 0}, - {"IFT_IBM370PARCHAN", Const, 0}, - {"IFT_IDSL", Const, 0}, - {"IFT_IEEE1394", Const, 0}, - {"IFT_IEEE80211", Const, 0}, - {"IFT_IEEE80212", Const, 0}, - {"IFT_IEEE8023ADLAG", Const, 0}, - {"IFT_IFGSN", Const, 0}, - {"IFT_IMT", Const, 0}, - {"IFT_INFINIBAND", Const, 1}, - {"IFT_INTERLEAVE", Const, 0}, - {"IFT_IP", Const, 0}, - {"IFT_IPFORWARD", Const, 0}, - {"IFT_IPOVERATM", Const, 0}, - {"IFT_IPOVERCDLC", Const, 0}, - {"IFT_IPOVERCLAW", Const, 0}, - {"IFT_IPSWITCH", Const, 0}, - {"IFT_IPXIP", Const, 0}, - {"IFT_ISDN", Const, 0}, - {"IFT_ISDNBASIC", Const, 0}, - {"IFT_ISDNPRIMARY", Const, 0}, - {"IFT_ISDNS", Const, 0}, - {"IFT_ISDNU", Const, 0}, - {"IFT_ISO88022LLC", Const, 0}, - {"IFT_ISO88023", Const, 0}, - {"IFT_ISO88024", Const, 0}, - {"IFT_ISO88025", Const, 0}, - {"IFT_ISO88025CRFPINT", Const, 0}, - {"IFT_ISO88025DTR", Const, 0}, - {"IFT_ISO88025FIBER", Const, 0}, - {"IFT_ISO88026", Const, 0}, - {"IFT_ISUP", Const, 0}, - {"IFT_L2VLAN", Const, 0}, - {"IFT_L3IPVLAN", Const, 0}, - {"IFT_L3IPXVLAN", Const, 0}, - {"IFT_LAPB", Const, 0}, - {"IFT_LAPD", Const, 0}, - {"IFT_LAPF", Const, 0}, - {"IFT_LINEGROUP", Const, 1}, - {"IFT_LOCALTALK", Const, 0}, - {"IFT_LOOP", Const, 0}, - {"IFT_MEDIAMAILOVERIP", Const, 0}, - {"IFT_MFSIGLINK", Const, 0}, - {"IFT_MIOX25", Const, 0}, - {"IFT_MODEM", Const, 0}, - {"IFT_MPC", Const, 0}, - {"IFT_MPLS", Const, 0}, - {"IFT_MPLSTUNNEL", Const, 0}, - {"IFT_MSDSL", Const, 0}, - {"IFT_MVL", Const, 0}, - {"IFT_MYRINET", Const, 0}, - {"IFT_NFAS", Const, 0}, - {"IFT_NSIP", Const, 0}, - {"IFT_OPTICALCHANNEL", Const, 0}, - {"IFT_OPTICALTRANSPORT", Const, 0}, - {"IFT_OTHER", Const, 0}, - {"IFT_P10", Const, 0}, - {"IFT_P80", Const, 0}, - {"IFT_PARA", Const, 0}, - {"IFT_PDP", Const, 0}, - {"IFT_PFLOG", Const, 0}, - {"IFT_PFLOW", Const, 1}, - {"IFT_PFSYNC", Const, 0}, - {"IFT_PLC", Const, 0}, - {"IFT_PON155", Const, 1}, - {"IFT_PON622", Const, 1}, - {"IFT_POS", Const, 0}, - {"IFT_PPP", Const, 0}, - {"IFT_PPPMULTILINKBUNDLE", Const, 0}, - {"IFT_PROPATM", Const, 1}, - {"IFT_PROPBWAP2MP", Const, 0}, - {"IFT_PROPCNLS", Const, 0}, - {"IFT_PROPDOCSWIRELESSDOWNSTREAM", Const, 0}, - {"IFT_PROPDOCSWIRELESSMACLAYER", Const, 0}, - {"IFT_PROPDOCSWIRELESSUPSTREAM", Const, 0}, - {"IFT_PROPMUX", Const, 0}, - {"IFT_PROPVIRTUAL", Const, 0}, - {"IFT_PROPWIRELESSP2P", Const, 0}, - {"IFT_PTPSERIAL", Const, 0}, - {"IFT_PVC", Const, 0}, - {"IFT_Q2931", Const, 1}, - {"IFT_QLLC", Const, 0}, - {"IFT_RADIOMAC", Const, 0}, - {"IFT_RADSL", Const, 0}, - {"IFT_REACHDSL", Const, 0}, - {"IFT_RFC1483", Const, 0}, - {"IFT_RS232", Const, 0}, - {"IFT_RSRB", Const, 0}, - {"IFT_SDLC", Const, 0}, - {"IFT_SDSL", Const, 0}, - {"IFT_SHDSL", Const, 0}, - {"IFT_SIP", Const, 0}, - {"IFT_SIPSIG", Const, 1}, - {"IFT_SIPTG", Const, 1}, - {"IFT_SLIP", Const, 0}, - {"IFT_SMDSDXI", Const, 0}, - {"IFT_SMDSICIP", Const, 0}, - {"IFT_SONET", Const, 0}, - {"IFT_SONETOVERHEADCHANNEL", Const, 0}, - {"IFT_SONETPATH", Const, 0}, - {"IFT_SONETVT", Const, 0}, - {"IFT_SRP", Const, 0}, - {"IFT_SS7SIGLINK", Const, 0}, - {"IFT_STACKTOSTACK", Const, 0}, - {"IFT_STARLAN", Const, 0}, - {"IFT_STF", Const, 0}, - {"IFT_T1", Const, 0}, - {"IFT_TDLC", Const, 0}, - {"IFT_TELINK", Const, 1}, - {"IFT_TERMPAD", Const, 0}, - {"IFT_TR008", Const, 0}, - {"IFT_TRANSPHDLC", Const, 0}, - {"IFT_TUNNEL", Const, 0}, - {"IFT_ULTRA", Const, 0}, - {"IFT_USB", Const, 0}, - {"IFT_V11", Const, 0}, - {"IFT_V35", Const, 0}, - {"IFT_V36", Const, 0}, - {"IFT_V37", Const, 0}, - {"IFT_VDSL", Const, 0}, - {"IFT_VIRTUALIPADDRESS", Const, 0}, - {"IFT_VIRTUALTG", Const, 1}, - {"IFT_VOICEDID", Const, 1}, - {"IFT_VOICEEM", Const, 0}, - {"IFT_VOICEEMFGD", Const, 1}, - {"IFT_VOICEENCAP", Const, 0}, - {"IFT_VOICEFGDEANA", Const, 1}, - {"IFT_VOICEFXO", Const, 0}, - {"IFT_VOICEFXS", Const, 0}, - {"IFT_VOICEOVERATM", Const, 0}, - {"IFT_VOICEOVERCABLE", Const, 1}, - {"IFT_VOICEOVERFRAMERELAY", Const, 0}, - {"IFT_VOICEOVERIP", Const, 0}, - {"IFT_X213", Const, 0}, - {"IFT_X25", Const, 0}, - {"IFT_X25DDN", Const, 0}, - {"IFT_X25HUNTGROUP", Const, 0}, - {"IFT_X25MLP", Const, 0}, - {"IFT_X25PLE", Const, 0}, - {"IFT_XETHER", Const, 0}, - {"IGNBRK", Const, 0}, - {"IGNCR", Const, 0}, - {"IGNORE", Const, 0}, - {"IGNPAR", Const, 0}, - {"IMAXBEL", Const, 0}, - {"INFINITE", Const, 0}, - {"INLCR", Const, 0}, - {"INPCK", Const, 0}, - {"INVALID_FILE_ATTRIBUTES", Const, 0}, - {"IN_ACCESS", Const, 0}, - {"IN_ALL_EVENTS", Const, 0}, - {"IN_ATTRIB", Const, 0}, - {"IN_CLASSA_HOST", Const, 0}, - {"IN_CLASSA_MAX", Const, 0}, - {"IN_CLASSA_NET", Const, 0}, - {"IN_CLASSA_NSHIFT", Const, 0}, - {"IN_CLASSB_HOST", Const, 0}, - {"IN_CLASSB_MAX", Const, 0}, - {"IN_CLASSB_NET", Const, 0}, - {"IN_CLASSB_NSHIFT", Const, 0}, - {"IN_CLASSC_HOST", Const, 0}, - {"IN_CLASSC_NET", Const, 0}, - {"IN_CLASSC_NSHIFT", Const, 0}, - {"IN_CLASSD_HOST", Const, 0}, - {"IN_CLASSD_NET", Const, 0}, - {"IN_CLASSD_NSHIFT", Const, 0}, - {"IN_CLOEXEC", Const, 0}, - {"IN_CLOSE", Const, 0}, - {"IN_CLOSE_NOWRITE", Const, 0}, - {"IN_CLOSE_WRITE", Const, 0}, - {"IN_CREATE", Const, 0}, - {"IN_DELETE", Const, 0}, - {"IN_DELETE_SELF", Const, 0}, - {"IN_DONT_FOLLOW", Const, 0}, - {"IN_EXCL_UNLINK", Const, 0}, - {"IN_IGNORED", Const, 0}, - {"IN_ISDIR", Const, 0}, - {"IN_LINKLOCALNETNUM", Const, 0}, - {"IN_LOOPBACKNET", Const, 0}, - {"IN_MASK_ADD", Const, 0}, - {"IN_MODIFY", Const, 0}, - {"IN_MOVE", Const, 0}, - {"IN_MOVED_FROM", Const, 0}, - {"IN_MOVED_TO", Const, 0}, - {"IN_MOVE_SELF", Const, 0}, - {"IN_NONBLOCK", Const, 0}, - {"IN_ONESHOT", Const, 0}, - {"IN_ONLYDIR", Const, 0}, - {"IN_OPEN", Const, 0}, - {"IN_Q_OVERFLOW", Const, 0}, - {"IN_RFC3021_HOST", Const, 1}, - {"IN_RFC3021_MASK", Const, 1}, - {"IN_RFC3021_NET", Const, 1}, - {"IN_RFC3021_NSHIFT", Const, 1}, - {"IN_UNMOUNT", Const, 0}, - {"IOC_IN", Const, 1}, - {"IOC_INOUT", Const, 1}, - {"IOC_OUT", Const, 1}, - {"IOC_VENDOR", Const, 3}, - {"IOC_WS2", Const, 1}, - {"IO_REPARSE_TAG_SYMLINK", Const, 4}, - {"IPMreq", Type, 0}, - {"IPMreq.Interface", Field, 0}, - {"IPMreq.Multiaddr", Field, 0}, - {"IPMreqn", Type, 0}, - {"IPMreqn.Address", Field, 0}, - {"IPMreqn.Ifindex", Field, 0}, - {"IPMreqn.Multiaddr", Field, 0}, - {"IPPROTO_3PC", Const, 0}, - {"IPPROTO_ADFS", Const, 0}, - {"IPPROTO_AH", Const, 0}, - {"IPPROTO_AHIP", Const, 0}, - {"IPPROTO_APES", Const, 0}, - {"IPPROTO_ARGUS", Const, 0}, - {"IPPROTO_AX25", Const, 0}, - {"IPPROTO_BHA", Const, 0}, - {"IPPROTO_BLT", Const, 0}, - {"IPPROTO_BRSATMON", Const, 0}, - {"IPPROTO_CARP", Const, 0}, - {"IPPROTO_CFTP", Const, 0}, - {"IPPROTO_CHAOS", Const, 0}, - {"IPPROTO_CMTP", Const, 0}, - {"IPPROTO_COMP", Const, 0}, - {"IPPROTO_CPHB", Const, 0}, - {"IPPROTO_CPNX", Const, 0}, - {"IPPROTO_DCCP", Const, 0}, - {"IPPROTO_DDP", Const, 0}, - {"IPPROTO_DGP", Const, 0}, - {"IPPROTO_DIVERT", Const, 0}, - {"IPPROTO_DIVERT_INIT", Const, 3}, - {"IPPROTO_DIVERT_RESP", Const, 3}, - {"IPPROTO_DONE", Const, 0}, - {"IPPROTO_DSTOPTS", Const, 0}, - {"IPPROTO_EGP", Const, 0}, - {"IPPROTO_EMCON", Const, 0}, - {"IPPROTO_ENCAP", Const, 0}, - {"IPPROTO_EON", Const, 0}, - {"IPPROTO_ESP", Const, 0}, - {"IPPROTO_ETHERIP", Const, 0}, - {"IPPROTO_FRAGMENT", Const, 0}, - {"IPPROTO_GGP", Const, 0}, - {"IPPROTO_GMTP", Const, 0}, - {"IPPROTO_GRE", Const, 0}, - {"IPPROTO_HELLO", Const, 0}, - {"IPPROTO_HMP", Const, 0}, - {"IPPROTO_HOPOPTS", Const, 0}, - {"IPPROTO_ICMP", Const, 0}, - {"IPPROTO_ICMPV6", Const, 0}, - {"IPPROTO_IDP", Const, 0}, - {"IPPROTO_IDPR", Const, 0}, - {"IPPROTO_IDRP", Const, 0}, - {"IPPROTO_IGMP", Const, 0}, - {"IPPROTO_IGP", Const, 0}, - {"IPPROTO_IGRP", Const, 0}, - {"IPPROTO_IL", Const, 0}, - {"IPPROTO_INLSP", Const, 0}, - {"IPPROTO_INP", Const, 0}, - {"IPPROTO_IP", Const, 0}, - {"IPPROTO_IPCOMP", Const, 0}, - {"IPPROTO_IPCV", Const, 0}, - {"IPPROTO_IPEIP", Const, 0}, - {"IPPROTO_IPIP", Const, 0}, - {"IPPROTO_IPPC", Const, 0}, - {"IPPROTO_IPV4", Const, 0}, - {"IPPROTO_IPV6", Const, 0}, - {"IPPROTO_IPV6_ICMP", Const, 1}, - {"IPPROTO_IRTP", Const, 0}, - {"IPPROTO_KRYPTOLAN", Const, 0}, - {"IPPROTO_LARP", Const, 0}, - {"IPPROTO_LEAF1", Const, 0}, - {"IPPROTO_LEAF2", Const, 0}, - {"IPPROTO_MAX", Const, 0}, - {"IPPROTO_MAXID", Const, 0}, - {"IPPROTO_MEAS", Const, 0}, - {"IPPROTO_MH", Const, 1}, - {"IPPROTO_MHRP", Const, 0}, - {"IPPROTO_MICP", Const, 0}, - {"IPPROTO_MOBILE", Const, 0}, - {"IPPROTO_MPLS", Const, 1}, - {"IPPROTO_MTP", Const, 0}, - {"IPPROTO_MUX", Const, 0}, - {"IPPROTO_ND", Const, 0}, - {"IPPROTO_NHRP", Const, 0}, - {"IPPROTO_NONE", Const, 0}, - {"IPPROTO_NSP", Const, 0}, - {"IPPROTO_NVPII", Const, 0}, - {"IPPROTO_OLD_DIVERT", Const, 0}, - {"IPPROTO_OSPFIGP", Const, 0}, - {"IPPROTO_PFSYNC", Const, 0}, - {"IPPROTO_PGM", Const, 0}, - {"IPPROTO_PIGP", Const, 0}, - {"IPPROTO_PIM", Const, 0}, - {"IPPROTO_PRM", Const, 0}, - {"IPPROTO_PUP", Const, 0}, - {"IPPROTO_PVP", Const, 0}, - {"IPPROTO_RAW", Const, 0}, - {"IPPROTO_RCCMON", Const, 0}, - {"IPPROTO_RDP", Const, 0}, - {"IPPROTO_ROUTING", Const, 0}, - {"IPPROTO_RSVP", Const, 0}, - {"IPPROTO_RVD", Const, 0}, - {"IPPROTO_SATEXPAK", Const, 0}, - {"IPPROTO_SATMON", Const, 0}, - {"IPPROTO_SCCSP", Const, 0}, - {"IPPROTO_SCTP", Const, 0}, - {"IPPROTO_SDRP", Const, 0}, - {"IPPROTO_SEND", Const, 1}, - {"IPPROTO_SEP", Const, 0}, - {"IPPROTO_SKIP", Const, 0}, - {"IPPROTO_SPACER", Const, 0}, - {"IPPROTO_SRPC", Const, 0}, - {"IPPROTO_ST", Const, 0}, - {"IPPROTO_SVMTP", Const, 0}, - {"IPPROTO_SWIPE", Const, 0}, - {"IPPROTO_TCF", Const, 0}, - {"IPPROTO_TCP", Const, 0}, - {"IPPROTO_TLSP", Const, 0}, - {"IPPROTO_TP", Const, 0}, - {"IPPROTO_TPXX", Const, 0}, - {"IPPROTO_TRUNK1", Const, 0}, - {"IPPROTO_TRUNK2", Const, 0}, - {"IPPROTO_TTP", Const, 0}, - {"IPPROTO_UDP", Const, 0}, - {"IPPROTO_UDPLITE", Const, 0}, - {"IPPROTO_VINES", Const, 0}, - {"IPPROTO_VISA", Const, 0}, - {"IPPROTO_VMTP", Const, 0}, - {"IPPROTO_VRRP", Const, 1}, - {"IPPROTO_WBEXPAK", Const, 0}, - {"IPPROTO_WBMON", Const, 0}, - {"IPPROTO_WSN", Const, 0}, - {"IPPROTO_XNET", Const, 0}, - {"IPPROTO_XTP", Const, 0}, - {"IPV6_2292DSTOPTS", Const, 0}, - {"IPV6_2292HOPLIMIT", Const, 0}, - {"IPV6_2292HOPOPTS", Const, 0}, - {"IPV6_2292NEXTHOP", Const, 0}, - {"IPV6_2292PKTINFO", Const, 0}, - {"IPV6_2292PKTOPTIONS", Const, 0}, - {"IPV6_2292RTHDR", Const, 0}, - {"IPV6_ADDRFORM", Const, 0}, - {"IPV6_ADD_MEMBERSHIP", Const, 0}, - {"IPV6_AUTHHDR", Const, 0}, - {"IPV6_AUTH_LEVEL", Const, 1}, - {"IPV6_AUTOFLOWLABEL", Const, 0}, - {"IPV6_BINDANY", Const, 0}, - {"IPV6_BINDV6ONLY", Const, 0}, - {"IPV6_BOUND_IF", Const, 0}, - {"IPV6_CHECKSUM", Const, 0}, - {"IPV6_DEFAULT_MULTICAST_HOPS", Const, 0}, - {"IPV6_DEFAULT_MULTICAST_LOOP", Const, 0}, - {"IPV6_DEFHLIM", Const, 0}, - {"IPV6_DONTFRAG", Const, 0}, - {"IPV6_DROP_MEMBERSHIP", Const, 0}, - {"IPV6_DSTOPTS", Const, 0}, - {"IPV6_ESP_NETWORK_LEVEL", Const, 1}, - {"IPV6_ESP_TRANS_LEVEL", Const, 1}, - {"IPV6_FAITH", Const, 0}, - {"IPV6_FLOWINFO_MASK", Const, 0}, - {"IPV6_FLOWLABEL_MASK", Const, 0}, - {"IPV6_FRAGTTL", Const, 0}, - {"IPV6_FW_ADD", Const, 0}, - {"IPV6_FW_DEL", Const, 0}, - {"IPV6_FW_FLUSH", Const, 0}, - {"IPV6_FW_GET", Const, 0}, - {"IPV6_FW_ZERO", Const, 0}, - {"IPV6_HLIMDEC", Const, 0}, - {"IPV6_HOPLIMIT", Const, 0}, - {"IPV6_HOPOPTS", Const, 0}, - {"IPV6_IPCOMP_LEVEL", Const, 1}, - {"IPV6_IPSEC_POLICY", Const, 0}, - {"IPV6_JOIN_ANYCAST", Const, 0}, - {"IPV6_JOIN_GROUP", Const, 0}, - {"IPV6_LEAVE_ANYCAST", Const, 0}, - {"IPV6_LEAVE_GROUP", Const, 0}, - {"IPV6_MAXHLIM", Const, 0}, - {"IPV6_MAXOPTHDR", Const, 0}, - {"IPV6_MAXPACKET", Const, 0}, - {"IPV6_MAX_GROUP_SRC_FILTER", Const, 0}, - {"IPV6_MAX_MEMBERSHIPS", Const, 0}, - {"IPV6_MAX_SOCK_SRC_FILTER", Const, 0}, - {"IPV6_MIN_MEMBERSHIPS", Const, 0}, - {"IPV6_MMTU", Const, 0}, - {"IPV6_MSFILTER", Const, 0}, - {"IPV6_MTU", Const, 0}, - {"IPV6_MTU_DISCOVER", Const, 0}, - {"IPV6_MULTICAST_HOPS", Const, 0}, - {"IPV6_MULTICAST_IF", Const, 0}, - {"IPV6_MULTICAST_LOOP", Const, 0}, - {"IPV6_NEXTHOP", Const, 0}, - {"IPV6_OPTIONS", Const, 1}, - {"IPV6_PATHMTU", Const, 0}, - {"IPV6_PIPEX", Const, 1}, - {"IPV6_PKTINFO", Const, 0}, - {"IPV6_PMTUDISC_DO", Const, 0}, - {"IPV6_PMTUDISC_DONT", Const, 0}, - {"IPV6_PMTUDISC_PROBE", Const, 0}, - {"IPV6_PMTUDISC_WANT", Const, 0}, - {"IPV6_PORTRANGE", Const, 0}, - {"IPV6_PORTRANGE_DEFAULT", Const, 0}, - {"IPV6_PORTRANGE_HIGH", Const, 0}, - {"IPV6_PORTRANGE_LOW", Const, 0}, - {"IPV6_PREFER_TEMPADDR", Const, 0}, - {"IPV6_RECVDSTOPTS", Const, 0}, - {"IPV6_RECVDSTPORT", Const, 3}, - {"IPV6_RECVERR", Const, 0}, - {"IPV6_RECVHOPLIMIT", Const, 0}, - {"IPV6_RECVHOPOPTS", Const, 0}, - {"IPV6_RECVPATHMTU", Const, 0}, - {"IPV6_RECVPKTINFO", Const, 0}, - {"IPV6_RECVRTHDR", Const, 0}, - {"IPV6_RECVTCLASS", Const, 0}, - {"IPV6_ROUTER_ALERT", Const, 0}, - {"IPV6_RTABLE", Const, 1}, - {"IPV6_RTHDR", Const, 0}, - {"IPV6_RTHDRDSTOPTS", Const, 0}, - {"IPV6_RTHDR_LOOSE", Const, 0}, - {"IPV6_RTHDR_STRICT", Const, 0}, - {"IPV6_RTHDR_TYPE_0", Const, 0}, - {"IPV6_RXDSTOPTS", Const, 0}, - {"IPV6_RXHOPOPTS", Const, 0}, - {"IPV6_SOCKOPT_RESERVED1", Const, 0}, - {"IPV6_TCLASS", Const, 0}, - {"IPV6_UNICAST_HOPS", Const, 0}, - {"IPV6_USE_MIN_MTU", Const, 0}, - {"IPV6_V6ONLY", Const, 0}, - {"IPV6_VERSION", Const, 0}, - {"IPV6_VERSION_MASK", Const, 0}, - {"IPV6_XFRM_POLICY", Const, 0}, - {"IP_ADD_MEMBERSHIP", Const, 0}, - {"IP_ADD_SOURCE_MEMBERSHIP", Const, 0}, - {"IP_AUTH_LEVEL", Const, 1}, - {"IP_BINDANY", Const, 0}, - {"IP_BLOCK_SOURCE", Const, 0}, - {"IP_BOUND_IF", Const, 0}, - {"IP_DEFAULT_MULTICAST_LOOP", Const, 0}, - {"IP_DEFAULT_MULTICAST_TTL", Const, 0}, - {"IP_DF", Const, 0}, - {"IP_DIVERTFL", Const, 3}, - {"IP_DONTFRAG", Const, 0}, - {"IP_DROP_MEMBERSHIP", Const, 0}, - {"IP_DROP_SOURCE_MEMBERSHIP", Const, 0}, - {"IP_DUMMYNET3", Const, 0}, - {"IP_DUMMYNET_CONFIGURE", Const, 0}, - {"IP_DUMMYNET_DEL", Const, 0}, - {"IP_DUMMYNET_FLUSH", Const, 0}, - {"IP_DUMMYNET_GET", Const, 0}, - {"IP_EF", Const, 1}, - {"IP_ERRORMTU", Const, 1}, - {"IP_ESP_NETWORK_LEVEL", Const, 1}, - {"IP_ESP_TRANS_LEVEL", Const, 1}, - {"IP_FAITH", Const, 0}, - {"IP_FREEBIND", Const, 0}, - {"IP_FW3", Const, 0}, - {"IP_FW_ADD", Const, 0}, - {"IP_FW_DEL", Const, 0}, - {"IP_FW_FLUSH", Const, 0}, - {"IP_FW_GET", Const, 0}, - {"IP_FW_NAT_CFG", Const, 0}, - {"IP_FW_NAT_DEL", Const, 0}, - {"IP_FW_NAT_GET_CONFIG", Const, 0}, - {"IP_FW_NAT_GET_LOG", Const, 0}, - {"IP_FW_RESETLOG", Const, 0}, - {"IP_FW_TABLE_ADD", Const, 0}, - {"IP_FW_TABLE_DEL", Const, 0}, - {"IP_FW_TABLE_FLUSH", Const, 0}, - {"IP_FW_TABLE_GETSIZE", Const, 0}, - {"IP_FW_TABLE_LIST", Const, 0}, - {"IP_FW_ZERO", Const, 0}, - {"IP_HDRINCL", Const, 0}, - {"IP_IPCOMP_LEVEL", Const, 1}, - {"IP_IPSECFLOWINFO", Const, 1}, - {"IP_IPSEC_LOCAL_AUTH", Const, 1}, - {"IP_IPSEC_LOCAL_CRED", Const, 1}, - {"IP_IPSEC_LOCAL_ID", Const, 1}, - {"IP_IPSEC_POLICY", Const, 0}, - {"IP_IPSEC_REMOTE_AUTH", Const, 1}, - {"IP_IPSEC_REMOTE_CRED", Const, 1}, - {"IP_IPSEC_REMOTE_ID", Const, 1}, - {"IP_MAXPACKET", Const, 0}, - {"IP_MAX_GROUP_SRC_FILTER", Const, 0}, - {"IP_MAX_MEMBERSHIPS", Const, 0}, - {"IP_MAX_SOCK_MUTE_FILTER", Const, 0}, - {"IP_MAX_SOCK_SRC_FILTER", Const, 0}, - {"IP_MAX_SOURCE_FILTER", Const, 0}, - {"IP_MF", Const, 0}, - {"IP_MINFRAGSIZE", Const, 1}, - {"IP_MINTTL", Const, 0}, - {"IP_MIN_MEMBERSHIPS", Const, 0}, - {"IP_MSFILTER", Const, 0}, - {"IP_MSS", Const, 0}, - {"IP_MTU", Const, 0}, - {"IP_MTU_DISCOVER", Const, 0}, - {"IP_MULTICAST_IF", Const, 0}, - {"IP_MULTICAST_IFINDEX", Const, 0}, - {"IP_MULTICAST_LOOP", Const, 0}, - {"IP_MULTICAST_TTL", Const, 0}, - {"IP_MULTICAST_VIF", Const, 0}, - {"IP_NAT__XXX", Const, 0}, - {"IP_OFFMASK", Const, 0}, - {"IP_OLD_FW_ADD", Const, 0}, - {"IP_OLD_FW_DEL", Const, 0}, - {"IP_OLD_FW_FLUSH", Const, 0}, - {"IP_OLD_FW_GET", Const, 0}, - {"IP_OLD_FW_RESETLOG", Const, 0}, - {"IP_OLD_FW_ZERO", Const, 0}, - {"IP_ONESBCAST", Const, 0}, - {"IP_OPTIONS", Const, 0}, - {"IP_ORIGDSTADDR", Const, 0}, - {"IP_PASSSEC", Const, 0}, - {"IP_PIPEX", Const, 1}, - {"IP_PKTINFO", Const, 0}, - {"IP_PKTOPTIONS", Const, 0}, - {"IP_PMTUDISC", Const, 0}, - {"IP_PMTUDISC_DO", Const, 0}, - {"IP_PMTUDISC_DONT", Const, 0}, - {"IP_PMTUDISC_PROBE", Const, 0}, - {"IP_PMTUDISC_WANT", Const, 0}, - {"IP_PORTRANGE", Const, 0}, - {"IP_PORTRANGE_DEFAULT", Const, 0}, - {"IP_PORTRANGE_HIGH", Const, 0}, - {"IP_PORTRANGE_LOW", Const, 0}, - {"IP_RECVDSTADDR", Const, 0}, - {"IP_RECVDSTPORT", Const, 1}, - {"IP_RECVERR", Const, 0}, - {"IP_RECVIF", Const, 0}, - {"IP_RECVOPTS", Const, 0}, - {"IP_RECVORIGDSTADDR", Const, 0}, - {"IP_RECVPKTINFO", Const, 0}, - {"IP_RECVRETOPTS", Const, 0}, - {"IP_RECVRTABLE", Const, 1}, - {"IP_RECVTOS", Const, 0}, - {"IP_RECVTTL", Const, 0}, - {"IP_RETOPTS", Const, 0}, - {"IP_RF", Const, 0}, - {"IP_ROUTER_ALERT", Const, 0}, - {"IP_RSVP_OFF", Const, 0}, - {"IP_RSVP_ON", Const, 0}, - {"IP_RSVP_VIF_OFF", Const, 0}, - {"IP_RSVP_VIF_ON", Const, 0}, - {"IP_RTABLE", Const, 1}, - {"IP_SENDSRCADDR", Const, 0}, - {"IP_STRIPHDR", Const, 0}, - {"IP_TOS", Const, 0}, - {"IP_TRAFFIC_MGT_BACKGROUND", Const, 0}, - {"IP_TRANSPARENT", Const, 0}, - {"IP_TTL", Const, 0}, - {"IP_UNBLOCK_SOURCE", Const, 0}, - {"IP_XFRM_POLICY", Const, 0}, - {"IPv6MTUInfo", Type, 2}, - {"IPv6MTUInfo.Addr", Field, 2}, - {"IPv6MTUInfo.Mtu", Field, 2}, - {"IPv6Mreq", Type, 0}, - {"IPv6Mreq.Interface", Field, 0}, - {"IPv6Mreq.Multiaddr", Field, 0}, - {"ISIG", Const, 0}, - {"ISTRIP", Const, 0}, - {"IUCLC", Const, 0}, - {"IUTF8", Const, 0}, - {"IXANY", Const, 0}, - {"IXOFF", Const, 0}, - {"IXON", Const, 0}, - {"IfAddrmsg", Type, 0}, - {"IfAddrmsg.Family", Field, 0}, - {"IfAddrmsg.Flags", Field, 0}, - {"IfAddrmsg.Index", Field, 0}, - {"IfAddrmsg.Prefixlen", Field, 0}, - {"IfAddrmsg.Scope", Field, 0}, - {"IfAnnounceMsghdr", Type, 1}, - {"IfAnnounceMsghdr.Hdrlen", Field, 2}, - {"IfAnnounceMsghdr.Index", Field, 1}, - {"IfAnnounceMsghdr.Msglen", Field, 1}, - {"IfAnnounceMsghdr.Name", Field, 1}, - {"IfAnnounceMsghdr.Type", Field, 1}, - {"IfAnnounceMsghdr.Version", Field, 1}, - {"IfAnnounceMsghdr.What", Field, 1}, - {"IfData", Type, 0}, - {"IfData.Addrlen", Field, 0}, - {"IfData.Baudrate", Field, 0}, - {"IfData.Capabilities", Field, 2}, - {"IfData.Collisions", Field, 0}, - {"IfData.Datalen", Field, 0}, - {"IfData.Epoch", Field, 0}, - {"IfData.Hdrlen", Field, 0}, - {"IfData.Hwassist", Field, 0}, - {"IfData.Ibytes", Field, 0}, - {"IfData.Ierrors", Field, 0}, - {"IfData.Imcasts", Field, 0}, - {"IfData.Ipackets", Field, 0}, - {"IfData.Iqdrops", Field, 0}, - {"IfData.Lastchange", Field, 0}, - {"IfData.Link_state", Field, 0}, - {"IfData.Mclpool", Field, 2}, - {"IfData.Metric", Field, 0}, - {"IfData.Mtu", Field, 0}, - {"IfData.Noproto", Field, 0}, - {"IfData.Obytes", Field, 0}, - {"IfData.Oerrors", Field, 0}, - {"IfData.Omcasts", Field, 0}, - {"IfData.Opackets", Field, 0}, - {"IfData.Pad", Field, 2}, - {"IfData.Pad_cgo_0", Field, 2}, - {"IfData.Pad_cgo_1", Field, 2}, - {"IfData.Physical", Field, 0}, - {"IfData.Recvquota", Field, 0}, - {"IfData.Recvtiming", Field, 0}, - {"IfData.Reserved1", Field, 0}, - {"IfData.Reserved2", Field, 0}, - {"IfData.Spare_char1", Field, 0}, - {"IfData.Spare_char2", Field, 0}, - {"IfData.Type", Field, 0}, - {"IfData.Typelen", Field, 0}, - {"IfData.Unused1", Field, 0}, - {"IfData.Unused2", Field, 0}, - {"IfData.Xmitquota", Field, 0}, - {"IfData.Xmittiming", Field, 0}, - {"IfInfomsg", Type, 0}, - {"IfInfomsg.Change", Field, 0}, - {"IfInfomsg.Family", Field, 0}, - {"IfInfomsg.Flags", Field, 0}, - {"IfInfomsg.Index", Field, 0}, - {"IfInfomsg.Type", Field, 0}, - {"IfInfomsg.X__ifi_pad", Field, 0}, - {"IfMsghdr", Type, 0}, - {"IfMsghdr.Addrs", Field, 0}, - {"IfMsghdr.Data", Field, 0}, - {"IfMsghdr.Flags", Field, 0}, - {"IfMsghdr.Hdrlen", Field, 2}, - {"IfMsghdr.Index", Field, 0}, - {"IfMsghdr.Msglen", Field, 0}, - {"IfMsghdr.Pad1", Field, 2}, - {"IfMsghdr.Pad2", Field, 2}, - {"IfMsghdr.Pad_cgo_0", Field, 0}, - {"IfMsghdr.Pad_cgo_1", Field, 2}, - {"IfMsghdr.Tableid", Field, 2}, - {"IfMsghdr.Type", Field, 0}, - {"IfMsghdr.Version", Field, 0}, - {"IfMsghdr.Xflags", Field, 2}, - {"IfaMsghdr", Type, 0}, - {"IfaMsghdr.Addrs", Field, 0}, - {"IfaMsghdr.Flags", Field, 0}, - {"IfaMsghdr.Hdrlen", Field, 2}, - {"IfaMsghdr.Index", Field, 0}, - {"IfaMsghdr.Metric", Field, 0}, - {"IfaMsghdr.Msglen", Field, 0}, - {"IfaMsghdr.Pad1", Field, 2}, - {"IfaMsghdr.Pad2", Field, 2}, - {"IfaMsghdr.Pad_cgo_0", Field, 0}, - {"IfaMsghdr.Tableid", Field, 2}, - {"IfaMsghdr.Type", Field, 0}, - {"IfaMsghdr.Version", Field, 0}, - {"IfmaMsghdr", Type, 0}, - {"IfmaMsghdr.Addrs", Field, 0}, - {"IfmaMsghdr.Flags", Field, 0}, - {"IfmaMsghdr.Index", Field, 0}, - {"IfmaMsghdr.Msglen", Field, 0}, - {"IfmaMsghdr.Pad_cgo_0", Field, 0}, - {"IfmaMsghdr.Type", Field, 0}, - {"IfmaMsghdr.Version", Field, 0}, - {"IfmaMsghdr2", Type, 0}, - {"IfmaMsghdr2.Addrs", Field, 0}, - {"IfmaMsghdr2.Flags", Field, 0}, - {"IfmaMsghdr2.Index", Field, 0}, - {"IfmaMsghdr2.Msglen", Field, 0}, - {"IfmaMsghdr2.Pad_cgo_0", Field, 0}, - {"IfmaMsghdr2.Refcount", Field, 0}, - {"IfmaMsghdr2.Type", Field, 0}, - {"IfmaMsghdr2.Version", Field, 0}, - {"ImplementsGetwd", Const, 0}, - {"Inet4Pktinfo", Type, 0}, - {"Inet4Pktinfo.Addr", Field, 0}, - {"Inet4Pktinfo.Ifindex", Field, 0}, - {"Inet4Pktinfo.Spec_dst", Field, 0}, - {"Inet6Pktinfo", Type, 0}, - {"Inet6Pktinfo.Addr", Field, 0}, - {"Inet6Pktinfo.Ifindex", Field, 0}, - {"InotifyAddWatch", Func, 0}, - {"InotifyEvent", Type, 0}, - {"InotifyEvent.Cookie", Field, 0}, - {"InotifyEvent.Len", Field, 0}, - {"InotifyEvent.Mask", Field, 0}, - {"InotifyEvent.Name", Field, 0}, - {"InotifyEvent.Wd", Field, 0}, - {"InotifyInit", Func, 0}, - {"InotifyInit1", Func, 0}, - {"InotifyRmWatch", Func, 0}, - {"InterfaceAddrMessage", Type, 0}, - {"InterfaceAddrMessage.Data", Field, 0}, - {"InterfaceAddrMessage.Header", Field, 0}, - {"InterfaceAnnounceMessage", Type, 1}, - {"InterfaceAnnounceMessage.Header", Field, 1}, - {"InterfaceInfo", Type, 0}, - {"InterfaceInfo.Address", Field, 0}, - {"InterfaceInfo.BroadcastAddress", Field, 0}, - {"InterfaceInfo.Flags", Field, 0}, - {"InterfaceInfo.Netmask", Field, 0}, - {"InterfaceMessage", Type, 0}, - {"InterfaceMessage.Data", Field, 0}, - {"InterfaceMessage.Header", Field, 0}, - {"InterfaceMulticastAddrMessage", Type, 0}, - {"InterfaceMulticastAddrMessage.Data", Field, 0}, - {"InterfaceMulticastAddrMessage.Header", Field, 0}, - {"InvalidHandle", Const, 0}, - {"Ioperm", Func, 0}, - {"Iopl", Func, 0}, - {"Iovec", Type, 0}, - {"Iovec.Base", Field, 0}, - {"Iovec.Len", Field, 0}, - {"IpAdapterInfo", Type, 0}, - {"IpAdapterInfo.AdapterName", Field, 0}, - {"IpAdapterInfo.Address", Field, 0}, - {"IpAdapterInfo.AddressLength", Field, 0}, - {"IpAdapterInfo.ComboIndex", Field, 0}, - {"IpAdapterInfo.CurrentIpAddress", Field, 0}, - {"IpAdapterInfo.Description", Field, 0}, - {"IpAdapterInfo.DhcpEnabled", Field, 0}, - {"IpAdapterInfo.DhcpServer", Field, 0}, - {"IpAdapterInfo.GatewayList", Field, 0}, - {"IpAdapterInfo.HaveWins", Field, 0}, - {"IpAdapterInfo.Index", Field, 0}, - {"IpAdapterInfo.IpAddressList", Field, 0}, - {"IpAdapterInfo.LeaseExpires", Field, 0}, - {"IpAdapterInfo.LeaseObtained", Field, 0}, - {"IpAdapterInfo.Next", Field, 0}, - {"IpAdapterInfo.PrimaryWinsServer", Field, 0}, - {"IpAdapterInfo.SecondaryWinsServer", Field, 0}, - {"IpAdapterInfo.Type", Field, 0}, - {"IpAddrString", Type, 0}, - {"IpAddrString.Context", Field, 0}, - {"IpAddrString.IpAddress", Field, 0}, - {"IpAddrString.IpMask", Field, 0}, - {"IpAddrString.Next", Field, 0}, - {"IpAddressString", Type, 0}, - {"IpAddressString.String", Field, 0}, - {"IpMaskString", Type, 0}, - {"IpMaskString.String", Field, 2}, - {"Issetugid", Func, 0}, - {"KEY_ALL_ACCESS", Const, 0}, - {"KEY_CREATE_LINK", Const, 0}, - {"KEY_CREATE_SUB_KEY", Const, 0}, - {"KEY_ENUMERATE_SUB_KEYS", Const, 0}, - {"KEY_EXECUTE", Const, 0}, - {"KEY_NOTIFY", Const, 0}, - {"KEY_QUERY_VALUE", Const, 0}, - {"KEY_READ", Const, 0}, - {"KEY_SET_VALUE", Const, 0}, - {"KEY_WOW64_32KEY", Const, 0}, - {"KEY_WOW64_64KEY", Const, 0}, - {"KEY_WRITE", Const, 0}, - {"Kevent", Func, 0}, - {"Kevent_t", Type, 0}, - {"Kevent_t.Data", Field, 0}, - {"Kevent_t.Fflags", Field, 0}, - {"Kevent_t.Filter", Field, 0}, - {"Kevent_t.Flags", Field, 0}, - {"Kevent_t.Ident", Field, 0}, - {"Kevent_t.Pad_cgo_0", Field, 2}, - {"Kevent_t.Udata", Field, 0}, - {"Kill", Func, 0}, - {"Klogctl", Func, 0}, - {"Kqueue", Func, 0}, - {"LANG_ENGLISH", Const, 0}, - {"LAYERED_PROTOCOL", Const, 2}, - {"LCNT_OVERLOAD_FLUSH", Const, 1}, - {"LINUX_REBOOT_CMD_CAD_OFF", Const, 0}, - {"LINUX_REBOOT_CMD_CAD_ON", Const, 0}, - {"LINUX_REBOOT_CMD_HALT", Const, 0}, - {"LINUX_REBOOT_CMD_KEXEC", Const, 0}, - {"LINUX_REBOOT_CMD_POWER_OFF", Const, 0}, - {"LINUX_REBOOT_CMD_RESTART", Const, 0}, - {"LINUX_REBOOT_CMD_RESTART2", Const, 0}, - {"LINUX_REBOOT_CMD_SW_SUSPEND", Const, 0}, - {"LINUX_REBOOT_MAGIC1", Const, 0}, - {"LINUX_REBOOT_MAGIC2", Const, 0}, - {"LOCK_EX", Const, 0}, - {"LOCK_NB", Const, 0}, - {"LOCK_SH", Const, 0}, - {"LOCK_UN", Const, 0}, - {"LazyDLL", Type, 0}, - {"LazyDLL.Name", Field, 0}, - {"LazyProc", Type, 0}, - {"LazyProc.Name", Field, 0}, - {"Lchown", Func, 0}, - {"Linger", Type, 0}, - {"Linger.Linger", Field, 0}, - {"Linger.Onoff", Field, 0}, - {"Link", Func, 0}, - {"Listen", Func, 0}, - {"Listxattr", Func, 1}, - {"LoadCancelIoEx", Func, 1}, - {"LoadConnectEx", Func, 1}, - {"LoadCreateSymbolicLink", Func, 4}, - {"LoadDLL", Func, 0}, - {"LoadGetAddrInfo", Func, 1}, - {"LoadLibrary", Func, 0}, - {"LoadSetFileCompletionNotificationModes", Func, 2}, - {"LocalFree", Func, 0}, - {"Log2phys_t", Type, 0}, - {"Log2phys_t.Contigbytes", Field, 0}, - {"Log2phys_t.Devoffset", Field, 0}, - {"Log2phys_t.Flags", Field, 0}, - {"LookupAccountName", Func, 0}, - {"LookupAccountSid", Func, 0}, - {"LookupSID", Func, 0}, - {"LsfJump", Func, 0}, - {"LsfSocket", Func, 0}, - {"LsfStmt", Func, 0}, - {"Lstat", Func, 0}, - {"MADV_AUTOSYNC", Const, 1}, - {"MADV_CAN_REUSE", Const, 0}, - {"MADV_CORE", Const, 1}, - {"MADV_DOFORK", Const, 0}, - {"MADV_DONTFORK", Const, 0}, - {"MADV_DONTNEED", Const, 0}, - {"MADV_FREE", Const, 0}, - {"MADV_FREE_REUSABLE", Const, 0}, - {"MADV_FREE_REUSE", Const, 0}, - {"MADV_HUGEPAGE", Const, 0}, - {"MADV_HWPOISON", Const, 0}, - {"MADV_MERGEABLE", Const, 0}, - {"MADV_NOCORE", Const, 1}, - {"MADV_NOHUGEPAGE", Const, 0}, - {"MADV_NORMAL", Const, 0}, - {"MADV_NOSYNC", Const, 1}, - {"MADV_PROTECT", Const, 1}, - {"MADV_RANDOM", Const, 0}, - {"MADV_REMOVE", Const, 0}, - {"MADV_SEQUENTIAL", Const, 0}, - {"MADV_SPACEAVAIL", Const, 3}, - {"MADV_UNMERGEABLE", Const, 0}, - {"MADV_WILLNEED", Const, 0}, - {"MADV_ZERO_WIRED_PAGES", Const, 0}, - {"MAP_32BIT", Const, 0}, - {"MAP_ALIGNED_SUPER", Const, 3}, - {"MAP_ALIGNMENT_16MB", Const, 3}, - {"MAP_ALIGNMENT_1TB", Const, 3}, - {"MAP_ALIGNMENT_256TB", Const, 3}, - {"MAP_ALIGNMENT_4GB", Const, 3}, - {"MAP_ALIGNMENT_64KB", Const, 3}, - {"MAP_ALIGNMENT_64PB", Const, 3}, - {"MAP_ALIGNMENT_MASK", Const, 3}, - {"MAP_ALIGNMENT_SHIFT", Const, 3}, - {"MAP_ANON", Const, 0}, - {"MAP_ANONYMOUS", Const, 0}, - {"MAP_COPY", Const, 0}, - {"MAP_DENYWRITE", Const, 0}, - {"MAP_EXECUTABLE", Const, 0}, - {"MAP_FILE", Const, 0}, - {"MAP_FIXED", Const, 0}, - {"MAP_FLAGMASK", Const, 3}, - {"MAP_GROWSDOWN", Const, 0}, - {"MAP_HASSEMAPHORE", Const, 0}, - {"MAP_HUGETLB", Const, 0}, - {"MAP_INHERIT", Const, 3}, - {"MAP_INHERIT_COPY", Const, 3}, - {"MAP_INHERIT_DEFAULT", Const, 3}, - {"MAP_INHERIT_DONATE_COPY", Const, 3}, - {"MAP_INHERIT_NONE", Const, 3}, - {"MAP_INHERIT_SHARE", Const, 3}, - {"MAP_JIT", Const, 0}, - {"MAP_LOCKED", Const, 0}, - {"MAP_NOCACHE", Const, 0}, - {"MAP_NOCORE", Const, 1}, - {"MAP_NOEXTEND", Const, 0}, - {"MAP_NONBLOCK", Const, 0}, - {"MAP_NORESERVE", Const, 0}, - {"MAP_NOSYNC", Const, 1}, - {"MAP_POPULATE", Const, 0}, - {"MAP_PREFAULT_READ", Const, 1}, - {"MAP_PRIVATE", Const, 0}, - {"MAP_RENAME", Const, 0}, - {"MAP_RESERVED0080", Const, 0}, - {"MAP_RESERVED0100", Const, 1}, - {"MAP_SHARED", Const, 0}, - {"MAP_STACK", Const, 0}, - {"MAP_TRYFIXED", Const, 3}, - {"MAP_TYPE", Const, 0}, - {"MAP_WIRED", Const, 3}, - {"MAXIMUM_REPARSE_DATA_BUFFER_SIZE", Const, 4}, - {"MAXLEN_IFDESCR", Const, 0}, - {"MAXLEN_PHYSADDR", Const, 0}, - {"MAX_ADAPTER_ADDRESS_LENGTH", Const, 0}, - {"MAX_ADAPTER_DESCRIPTION_LENGTH", Const, 0}, - {"MAX_ADAPTER_NAME_LENGTH", Const, 0}, - {"MAX_COMPUTERNAME_LENGTH", Const, 0}, - {"MAX_INTERFACE_NAME_LEN", Const, 0}, - {"MAX_LONG_PATH", Const, 0}, - {"MAX_PATH", Const, 0}, - {"MAX_PROTOCOL_CHAIN", Const, 2}, - {"MCL_CURRENT", Const, 0}, - {"MCL_FUTURE", Const, 0}, - {"MNT_DETACH", Const, 0}, - {"MNT_EXPIRE", Const, 0}, - {"MNT_FORCE", Const, 0}, - {"MSG_BCAST", Const, 1}, - {"MSG_CMSG_CLOEXEC", Const, 0}, - {"MSG_COMPAT", Const, 0}, - {"MSG_CONFIRM", Const, 0}, - {"MSG_CONTROLMBUF", Const, 1}, - {"MSG_CTRUNC", Const, 0}, - {"MSG_DONTROUTE", Const, 0}, - {"MSG_DONTWAIT", Const, 0}, - {"MSG_EOF", Const, 0}, - {"MSG_EOR", Const, 0}, - {"MSG_ERRQUEUE", Const, 0}, - {"MSG_FASTOPEN", Const, 1}, - {"MSG_FIN", Const, 0}, - {"MSG_FLUSH", Const, 0}, - {"MSG_HAVEMORE", Const, 0}, - {"MSG_HOLD", Const, 0}, - {"MSG_IOVUSRSPACE", Const, 1}, - {"MSG_LENUSRSPACE", Const, 1}, - {"MSG_MCAST", Const, 1}, - {"MSG_MORE", Const, 0}, - {"MSG_NAMEMBUF", Const, 1}, - {"MSG_NBIO", Const, 0}, - {"MSG_NEEDSA", Const, 0}, - {"MSG_NOSIGNAL", Const, 0}, - {"MSG_NOTIFICATION", Const, 0}, - {"MSG_OOB", Const, 0}, - {"MSG_PEEK", Const, 0}, - {"MSG_PROXY", Const, 0}, - {"MSG_RCVMORE", Const, 0}, - {"MSG_RST", Const, 0}, - {"MSG_SEND", Const, 0}, - {"MSG_SYN", Const, 0}, - {"MSG_TRUNC", Const, 0}, - {"MSG_TRYHARD", Const, 0}, - {"MSG_USERFLAGS", Const, 1}, - {"MSG_WAITALL", Const, 0}, - {"MSG_WAITFORONE", Const, 0}, - {"MSG_WAITSTREAM", Const, 0}, - {"MS_ACTIVE", Const, 0}, - {"MS_ASYNC", Const, 0}, - {"MS_BIND", Const, 0}, - {"MS_DEACTIVATE", Const, 0}, - {"MS_DIRSYNC", Const, 0}, - {"MS_INVALIDATE", Const, 0}, - {"MS_I_VERSION", Const, 0}, - {"MS_KERNMOUNT", Const, 0}, - {"MS_KILLPAGES", Const, 0}, - {"MS_MANDLOCK", Const, 0}, - {"MS_MGC_MSK", Const, 0}, - {"MS_MGC_VAL", Const, 0}, - {"MS_MOVE", Const, 0}, - {"MS_NOATIME", Const, 0}, - {"MS_NODEV", Const, 0}, - {"MS_NODIRATIME", Const, 0}, - {"MS_NOEXEC", Const, 0}, - {"MS_NOSUID", Const, 0}, - {"MS_NOUSER", Const, 0}, - {"MS_POSIXACL", Const, 0}, - {"MS_PRIVATE", Const, 0}, - {"MS_RDONLY", Const, 0}, - {"MS_REC", Const, 0}, - {"MS_RELATIME", Const, 0}, - {"MS_REMOUNT", Const, 0}, - {"MS_RMT_MASK", Const, 0}, - {"MS_SHARED", Const, 0}, - {"MS_SILENT", Const, 0}, - {"MS_SLAVE", Const, 0}, - {"MS_STRICTATIME", Const, 0}, - {"MS_SYNC", Const, 0}, - {"MS_SYNCHRONOUS", Const, 0}, - {"MS_UNBINDABLE", Const, 0}, - {"Madvise", Func, 0}, - {"MapViewOfFile", Func, 0}, - {"MaxTokenInfoClass", Const, 0}, - {"Mclpool", Type, 2}, - {"Mclpool.Alive", Field, 2}, - {"Mclpool.Cwm", Field, 2}, - {"Mclpool.Grown", Field, 2}, - {"Mclpool.Hwm", Field, 2}, - {"Mclpool.Lwm", Field, 2}, - {"MibIfRow", Type, 0}, - {"MibIfRow.AdminStatus", Field, 0}, - {"MibIfRow.Descr", Field, 0}, - {"MibIfRow.DescrLen", Field, 0}, - {"MibIfRow.InDiscards", Field, 0}, - {"MibIfRow.InErrors", Field, 0}, - {"MibIfRow.InNUcastPkts", Field, 0}, - {"MibIfRow.InOctets", Field, 0}, - {"MibIfRow.InUcastPkts", Field, 0}, - {"MibIfRow.InUnknownProtos", Field, 0}, - {"MibIfRow.Index", Field, 0}, - {"MibIfRow.LastChange", Field, 0}, - {"MibIfRow.Mtu", Field, 0}, - {"MibIfRow.Name", Field, 0}, - {"MibIfRow.OperStatus", Field, 0}, - {"MibIfRow.OutDiscards", Field, 0}, - {"MibIfRow.OutErrors", Field, 0}, - {"MibIfRow.OutNUcastPkts", Field, 0}, - {"MibIfRow.OutOctets", Field, 0}, - {"MibIfRow.OutQLen", Field, 0}, - {"MibIfRow.OutUcastPkts", Field, 0}, - {"MibIfRow.PhysAddr", Field, 0}, - {"MibIfRow.PhysAddrLen", Field, 0}, - {"MibIfRow.Speed", Field, 0}, - {"MibIfRow.Type", Field, 0}, - {"Mkdir", Func, 0}, - {"Mkdirat", Func, 0}, - {"Mkfifo", Func, 0}, - {"Mknod", Func, 0}, - {"Mknodat", Func, 0}, - {"Mlock", Func, 0}, - {"Mlockall", Func, 0}, - {"Mmap", Func, 0}, - {"Mount", Func, 0}, - {"MoveFile", Func, 0}, - {"Mprotect", Func, 0}, - {"Msghdr", Type, 0}, - {"Msghdr.Control", Field, 0}, - {"Msghdr.Controllen", Field, 0}, - {"Msghdr.Flags", Field, 0}, - {"Msghdr.Iov", Field, 0}, - {"Msghdr.Iovlen", Field, 0}, - {"Msghdr.Name", Field, 0}, - {"Msghdr.Namelen", Field, 0}, - {"Msghdr.Pad_cgo_0", Field, 0}, - {"Msghdr.Pad_cgo_1", Field, 0}, - {"Munlock", Func, 0}, - {"Munlockall", Func, 0}, - {"Munmap", Func, 0}, - {"MustLoadDLL", Func, 0}, - {"NAME_MAX", Const, 0}, - {"NETLINK_ADD_MEMBERSHIP", Const, 0}, - {"NETLINK_AUDIT", Const, 0}, - {"NETLINK_BROADCAST_ERROR", Const, 0}, - {"NETLINK_CONNECTOR", Const, 0}, - {"NETLINK_DNRTMSG", Const, 0}, - {"NETLINK_DROP_MEMBERSHIP", Const, 0}, - {"NETLINK_ECRYPTFS", Const, 0}, - {"NETLINK_FIB_LOOKUP", Const, 0}, - {"NETLINK_FIREWALL", Const, 0}, - {"NETLINK_GENERIC", Const, 0}, - {"NETLINK_INET_DIAG", Const, 0}, - {"NETLINK_IP6_FW", Const, 0}, - {"NETLINK_ISCSI", Const, 0}, - {"NETLINK_KOBJECT_UEVENT", Const, 0}, - {"NETLINK_NETFILTER", Const, 0}, - {"NETLINK_NFLOG", Const, 0}, - {"NETLINK_NO_ENOBUFS", Const, 0}, - {"NETLINK_PKTINFO", Const, 0}, - {"NETLINK_RDMA", Const, 0}, - {"NETLINK_ROUTE", Const, 0}, - {"NETLINK_SCSITRANSPORT", Const, 0}, - {"NETLINK_SELINUX", Const, 0}, - {"NETLINK_UNUSED", Const, 0}, - {"NETLINK_USERSOCK", Const, 0}, - {"NETLINK_XFRM", Const, 0}, - {"NET_RT_DUMP", Const, 0}, - {"NET_RT_DUMP2", Const, 0}, - {"NET_RT_FLAGS", Const, 0}, - {"NET_RT_IFLIST", Const, 0}, - {"NET_RT_IFLIST2", Const, 0}, - {"NET_RT_IFLISTL", Const, 1}, - {"NET_RT_IFMALIST", Const, 0}, - {"NET_RT_MAXID", Const, 0}, - {"NET_RT_OIFLIST", Const, 1}, - {"NET_RT_OOIFLIST", Const, 1}, - {"NET_RT_STAT", Const, 0}, - {"NET_RT_STATS", Const, 1}, - {"NET_RT_TABLE", Const, 1}, - {"NET_RT_TRASH", Const, 0}, - {"NLA_ALIGNTO", Const, 0}, - {"NLA_F_NESTED", Const, 0}, - {"NLA_F_NET_BYTEORDER", Const, 0}, - {"NLA_HDRLEN", Const, 0}, - {"NLMSG_ALIGNTO", Const, 0}, - {"NLMSG_DONE", Const, 0}, - {"NLMSG_ERROR", Const, 0}, - {"NLMSG_HDRLEN", Const, 0}, - {"NLMSG_MIN_TYPE", Const, 0}, - {"NLMSG_NOOP", Const, 0}, - {"NLMSG_OVERRUN", Const, 0}, - {"NLM_F_ACK", Const, 0}, - {"NLM_F_APPEND", Const, 0}, - {"NLM_F_ATOMIC", Const, 0}, - {"NLM_F_CREATE", Const, 0}, - {"NLM_F_DUMP", Const, 0}, - {"NLM_F_ECHO", Const, 0}, - {"NLM_F_EXCL", Const, 0}, - {"NLM_F_MATCH", Const, 0}, - {"NLM_F_MULTI", Const, 0}, - {"NLM_F_REPLACE", Const, 0}, - {"NLM_F_REQUEST", Const, 0}, - {"NLM_F_ROOT", Const, 0}, - {"NOFLSH", Const, 0}, - {"NOTE_ABSOLUTE", Const, 0}, - {"NOTE_ATTRIB", Const, 0}, - {"NOTE_BACKGROUND", Const, 16}, - {"NOTE_CHILD", Const, 0}, - {"NOTE_CRITICAL", Const, 16}, - {"NOTE_DELETE", Const, 0}, - {"NOTE_EOF", Const, 1}, - {"NOTE_EXEC", Const, 0}, - {"NOTE_EXIT", Const, 0}, - {"NOTE_EXITSTATUS", Const, 0}, - {"NOTE_EXIT_CSERROR", Const, 16}, - {"NOTE_EXIT_DECRYPTFAIL", Const, 16}, - {"NOTE_EXIT_DETAIL", Const, 16}, - {"NOTE_EXIT_DETAIL_MASK", Const, 16}, - {"NOTE_EXIT_MEMORY", Const, 16}, - {"NOTE_EXIT_REPARENTED", Const, 16}, - {"NOTE_EXTEND", Const, 0}, - {"NOTE_FFAND", Const, 0}, - {"NOTE_FFCOPY", Const, 0}, - {"NOTE_FFCTRLMASK", Const, 0}, - {"NOTE_FFLAGSMASK", Const, 0}, - {"NOTE_FFNOP", Const, 0}, - {"NOTE_FFOR", Const, 0}, - {"NOTE_FORK", Const, 0}, - {"NOTE_LEEWAY", Const, 16}, - {"NOTE_LINK", Const, 0}, - {"NOTE_LOWAT", Const, 0}, - {"NOTE_NONE", Const, 0}, - {"NOTE_NSECONDS", Const, 0}, - {"NOTE_PCTRLMASK", Const, 0}, - {"NOTE_PDATAMASK", Const, 0}, - {"NOTE_REAP", Const, 0}, - {"NOTE_RENAME", Const, 0}, - {"NOTE_RESOURCEEND", Const, 0}, - {"NOTE_REVOKE", Const, 0}, - {"NOTE_SECONDS", Const, 0}, - {"NOTE_SIGNAL", Const, 0}, - {"NOTE_TRACK", Const, 0}, - {"NOTE_TRACKERR", Const, 0}, - {"NOTE_TRIGGER", Const, 0}, - {"NOTE_TRUNCATE", Const, 1}, - {"NOTE_USECONDS", Const, 0}, - {"NOTE_VM_ERROR", Const, 0}, - {"NOTE_VM_PRESSURE", Const, 0}, - {"NOTE_VM_PRESSURE_SUDDEN_TERMINATE", Const, 0}, - {"NOTE_VM_PRESSURE_TERMINATE", Const, 0}, - {"NOTE_WRITE", Const, 0}, - {"NameCanonical", Const, 0}, - {"NameCanonicalEx", Const, 0}, - {"NameDisplay", Const, 0}, - {"NameDnsDomain", Const, 0}, - {"NameFullyQualifiedDN", Const, 0}, - {"NameSamCompatible", Const, 0}, - {"NameServicePrincipal", Const, 0}, - {"NameUniqueId", Const, 0}, - {"NameUnknown", Const, 0}, - {"NameUserPrincipal", Const, 0}, - {"Nanosleep", Func, 0}, - {"NetApiBufferFree", Func, 0}, - {"NetGetJoinInformation", Func, 2}, - {"NetSetupDomainName", Const, 2}, - {"NetSetupUnjoined", Const, 2}, - {"NetSetupUnknownStatus", Const, 2}, - {"NetSetupWorkgroupName", Const, 2}, - {"NetUserGetInfo", Func, 0}, - {"NetlinkMessage", Type, 0}, - {"NetlinkMessage.Data", Field, 0}, - {"NetlinkMessage.Header", Field, 0}, - {"NetlinkRIB", Func, 0}, - {"NetlinkRouteAttr", Type, 0}, - {"NetlinkRouteAttr.Attr", Field, 0}, - {"NetlinkRouteAttr.Value", Field, 0}, - {"NetlinkRouteRequest", Type, 0}, - {"NetlinkRouteRequest.Data", Field, 0}, - {"NetlinkRouteRequest.Header", Field, 0}, - {"NewCallback", Func, 0}, - {"NewCallbackCDecl", Func, 3}, - {"NewLazyDLL", Func, 0}, - {"NlAttr", Type, 0}, - {"NlAttr.Len", Field, 0}, - {"NlAttr.Type", Field, 0}, - {"NlMsgerr", Type, 0}, - {"NlMsgerr.Error", Field, 0}, - {"NlMsgerr.Msg", Field, 0}, - {"NlMsghdr", Type, 0}, - {"NlMsghdr.Flags", Field, 0}, - {"NlMsghdr.Len", Field, 0}, - {"NlMsghdr.Pid", Field, 0}, - {"NlMsghdr.Seq", Field, 0}, - {"NlMsghdr.Type", Field, 0}, - {"NsecToFiletime", Func, 0}, - {"NsecToTimespec", Func, 0}, - {"NsecToTimeval", Func, 0}, - {"Ntohs", Func, 0}, - {"OCRNL", Const, 0}, - {"OFDEL", Const, 0}, - {"OFILL", Const, 0}, - {"OFIOGETBMAP", Const, 1}, - {"OID_PKIX_KP_SERVER_AUTH", Var, 0}, - {"OID_SERVER_GATED_CRYPTO", Var, 0}, - {"OID_SGC_NETSCAPE", Var, 0}, - {"OLCUC", Const, 0}, - {"ONLCR", Const, 0}, - {"ONLRET", Const, 0}, - {"ONOCR", Const, 0}, - {"ONOEOT", Const, 1}, - {"OPEN_ALWAYS", Const, 0}, - {"OPEN_EXISTING", Const, 0}, - {"OPOST", Const, 0}, - {"O_ACCMODE", Const, 0}, - {"O_ALERT", Const, 0}, - {"O_ALT_IO", Const, 1}, - {"O_APPEND", Const, 0}, - {"O_ASYNC", Const, 0}, - {"O_CLOEXEC", Const, 0}, - {"O_CREAT", Const, 0}, - {"O_DIRECT", Const, 0}, - {"O_DIRECTORY", Const, 0}, - {"O_DP_GETRAWENCRYPTED", Const, 16}, - {"O_DSYNC", Const, 0}, - {"O_EVTONLY", Const, 0}, - {"O_EXCL", Const, 0}, - {"O_EXEC", Const, 0}, - {"O_EXLOCK", Const, 0}, - {"O_FSYNC", Const, 0}, - {"O_LARGEFILE", Const, 0}, - {"O_NDELAY", Const, 0}, - {"O_NOATIME", Const, 0}, - {"O_NOCTTY", Const, 0}, - {"O_NOFOLLOW", Const, 0}, - {"O_NONBLOCK", Const, 0}, - {"O_NOSIGPIPE", Const, 1}, - {"O_POPUP", Const, 0}, - {"O_RDONLY", Const, 0}, - {"O_RDWR", Const, 0}, - {"O_RSYNC", Const, 0}, - {"O_SHLOCK", Const, 0}, - {"O_SYMLINK", Const, 0}, - {"O_SYNC", Const, 0}, - {"O_TRUNC", Const, 0}, - {"O_TTY_INIT", Const, 0}, - {"O_WRONLY", Const, 0}, - {"Open", Func, 0}, - {"OpenCurrentProcessToken", Func, 0}, - {"OpenProcess", Func, 0}, - {"OpenProcessToken", Func, 0}, - {"Openat", Func, 0}, - {"Overlapped", Type, 0}, - {"Overlapped.HEvent", Field, 0}, - {"Overlapped.Internal", Field, 0}, - {"Overlapped.InternalHigh", Field, 0}, - {"Overlapped.Offset", Field, 0}, - {"Overlapped.OffsetHigh", Field, 0}, - {"PACKET_ADD_MEMBERSHIP", Const, 0}, - {"PACKET_BROADCAST", Const, 0}, - {"PACKET_DROP_MEMBERSHIP", Const, 0}, - {"PACKET_FASTROUTE", Const, 0}, - {"PACKET_HOST", Const, 0}, - {"PACKET_LOOPBACK", Const, 0}, - {"PACKET_MR_ALLMULTI", Const, 0}, - {"PACKET_MR_MULTICAST", Const, 0}, - {"PACKET_MR_PROMISC", Const, 0}, - {"PACKET_MULTICAST", Const, 0}, - {"PACKET_OTHERHOST", Const, 0}, - {"PACKET_OUTGOING", Const, 0}, - {"PACKET_RECV_OUTPUT", Const, 0}, - {"PACKET_RX_RING", Const, 0}, - {"PACKET_STATISTICS", Const, 0}, - {"PAGE_EXECUTE_READ", Const, 0}, - {"PAGE_EXECUTE_READWRITE", Const, 0}, - {"PAGE_EXECUTE_WRITECOPY", Const, 0}, - {"PAGE_READONLY", Const, 0}, - {"PAGE_READWRITE", Const, 0}, - {"PAGE_WRITECOPY", Const, 0}, - {"PARENB", Const, 0}, - {"PARMRK", Const, 0}, - {"PARODD", Const, 0}, - {"PENDIN", Const, 0}, - {"PFL_HIDDEN", Const, 2}, - {"PFL_MATCHES_PROTOCOL_ZERO", Const, 2}, - {"PFL_MULTIPLE_PROTO_ENTRIES", Const, 2}, - {"PFL_NETWORKDIRECT_PROVIDER", Const, 2}, - {"PFL_RECOMMENDED_PROTO_ENTRY", Const, 2}, - {"PF_FLUSH", Const, 1}, - {"PKCS_7_ASN_ENCODING", Const, 0}, - {"PMC5_PIPELINE_FLUSH", Const, 1}, - {"PRIO_PGRP", Const, 2}, - {"PRIO_PROCESS", Const, 2}, - {"PRIO_USER", Const, 2}, - {"PRI_IOFLUSH", Const, 1}, - {"PROCESS_QUERY_INFORMATION", Const, 0}, - {"PROCESS_TERMINATE", Const, 2}, - {"PROT_EXEC", Const, 0}, - {"PROT_GROWSDOWN", Const, 0}, - {"PROT_GROWSUP", Const, 0}, - {"PROT_NONE", Const, 0}, - {"PROT_READ", Const, 0}, - {"PROT_WRITE", Const, 0}, - {"PROV_DH_SCHANNEL", Const, 0}, - {"PROV_DSS", Const, 0}, - {"PROV_DSS_DH", Const, 0}, - {"PROV_EC_ECDSA_FULL", Const, 0}, - {"PROV_EC_ECDSA_SIG", Const, 0}, - {"PROV_EC_ECNRA_FULL", Const, 0}, - {"PROV_EC_ECNRA_SIG", Const, 0}, - {"PROV_FORTEZZA", Const, 0}, - {"PROV_INTEL_SEC", Const, 0}, - {"PROV_MS_EXCHANGE", Const, 0}, - {"PROV_REPLACE_OWF", Const, 0}, - {"PROV_RNG", Const, 0}, - {"PROV_RSA_AES", Const, 0}, - {"PROV_RSA_FULL", Const, 0}, - {"PROV_RSA_SCHANNEL", Const, 0}, - {"PROV_RSA_SIG", Const, 0}, - {"PROV_SPYRUS_LYNKS", Const, 0}, - {"PROV_SSL", Const, 0}, - {"PR_CAPBSET_DROP", Const, 0}, - {"PR_CAPBSET_READ", Const, 0}, - {"PR_CLEAR_SECCOMP_FILTER", Const, 0}, - {"PR_ENDIAN_BIG", Const, 0}, - {"PR_ENDIAN_LITTLE", Const, 0}, - {"PR_ENDIAN_PPC_LITTLE", Const, 0}, - {"PR_FPEMU_NOPRINT", Const, 0}, - {"PR_FPEMU_SIGFPE", Const, 0}, - {"PR_FP_EXC_ASYNC", Const, 0}, - {"PR_FP_EXC_DISABLED", Const, 0}, - {"PR_FP_EXC_DIV", Const, 0}, - {"PR_FP_EXC_INV", Const, 0}, - {"PR_FP_EXC_NONRECOV", Const, 0}, - {"PR_FP_EXC_OVF", Const, 0}, - {"PR_FP_EXC_PRECISE", Const, 0}, - {"PR_FP_EXC_RES", Const, 0}, - {"PR_FP_EXC_SW_ENABLE", Const, 0}, - {"PR_FP_EXC_UND", Const, 0}, - {"PR_GET_DUMPABLE", Const, 0}, - {"PR_GET_ENDIAN", Const, 0}, - {"PR_GET_FPEMU", Const, 0}, - {"PR_GET_FPEXC", Const, 0}, - {"PR_GET_KEEPCAPS", Const, 0}, - {"PR_GET_NAME", Const, 0}, - {"PR_GET_PDEATHSIG", Const, 0}, - {"PR_GET_SECCOMP", Const, 0}, - {"PR_GET_SECCOMP_FILTER", Const, 0}, - {"PR_GET_SECUREBITS", Const, 0}, - {"PR_GET_TIMERSLACK", Const, 0}, - {"PR_GET_TIMING", Const, 0}, - {"PR_GET_TSC", Const, 0}, - {"PR_GET_UNALIGN", Const, 0}, - {"PR_MCE_KILL", Const, 0}, - {"PR_MCE_KILL_CLEAR", Const, 0}, - {"PR_MCE_KILL_DEFAULT", Const, 0}, - {"PR_MCE_KILL_EARLY", Const, 0}, - {"PR_MCE_KILL_GET", Const, 0}, - {"PR_MCE_KILL_LATE", Const, 0}, - {"PR_MCE_KILL_SET", Const, 0}, - {"PR_SECCOMP_FILTER_EVENT", Const, 0}, - {"PR_SECCOMP_FILTER_SYSCALL", Const, 0}, - {"PR_SET_DUMPABLE", Const, 0}, - {"PR_SET_ENDIAN", Const, 0}, - {"PR_SET_FPEMU", Const, 0}, - {"PR_SET_FPEXC", Const, 0}, - {"PR_SET_KEEPCAPS", Const, 0}, - {"PR_SET_NAME", Const, 0}, - {"PR_SET_PDEATHSIG", Const, 0}, - {"PR_SET_PTRACER", Const, 0}, - {"PR_SET_SECCOMP", Const, 0}, - {"PR_SET_SECCOMP_FILTER", Const, 0}, - {"PR_SET_SECUREBITS", Const, 0}, - {"PR_SET_TIMERSLACK", Const, 0}, - {"PR_SET_TIMING", Const, 0}, - {"PR_SET_TSC", Const, 0}, - {"PR_SET_UNALIGN", Const, 0}, - {"PR_TASK_PERF_EVENTS_DISABLE", Const, 0}, - {"PR_TASK_PERF_EVENTS_ENABLE", Const, 0}, - {"PR_TIMING_STATISTICAL", Const, 0}, - {"PR_TIMING_TIMESTAMP", Const, 0}, - {"PR_TSC_ENABLE", Const, 0}, - {"PR_TSC_SIGSEGV", Const, 0}, - {"PR_UNALIGN_NOPRINT", Const, 0}, - {"PR_UNALIGN_SIGBUS", Const, 0}, - {"PTRACE_ARCH_PRCTL", Const, 0}, - {"PTRACE_ATTACH", Const, 0}, - {"PTRACE_CONT", Const, 0}, - {"PTRACE_DETACH", Const, 0}, - {"PTRACE_EVENT_CLONE", Const, 0}, - {"PTRACE_EVENT_EXEC", Const, 0}, - {"PTRACE_EVENT_EXIT", Const, 0}, - {"PTRACE_EVENT_FORK", Const, 0}, - {"PTRACE_EVENT_VFORK", Const, 0}, - {"PTRACE_EVENT_VFORK_DONE", Const, 0}, - {"PTRACE_GETCRUNCHREGS", Const, 0}, - {"PTRACE_GETEVENTMSG", Const, 0}, - {"PTRACE_GETFPREGS", Const, 0}, - {"PTRACE_GETFPXREGS", Const, 0}, - {"PTRACE_GETHBPREGS", Const, 0}, - {"PTRACE_GETREGS", Const, 0}, - {"PTRACE_GETREGSET", Const, 0}, - {"PTRACE_GETSIGINFO", Const, 0}, - {"PTRACE_GETVFPREGS", Const, 0}, - {"PTRACE_GETWMMXREGS", Const, 0}, - {"PTRACE_GET_THREAD_AREA", Const, 0}, - {"PTRACE_KILL", Const, 0}, - {"PTRACE_OLDSETOPTIONS", Const, 0}, - {"PTRACE_O_MASK", Const, 0}, - {"PTRACE_O_TRACECLONE", Const, 0}, - {"PTRACE_O_TRACEEXEC", Const, 0}, - {"PTRACE_O_TRACEEXIT", Const, 0}, - {"PTRACE_O_TRACEFORK", Const, 0}, - {"PTRACE_O_TRACESYSGOOD", Const, 0}, - {"PTRACE_O_TRACEVFORK", Const, 0}, - {"PTRACE_O_TRACEVFORKDONE", Const, 0}, - {"PTRACE_PEEKDATA", Const, 0}, - {"PTRACE_PEEKTEXT", Const, 0}, - {"PTRACE_PEEKUSR", Const, 0}, - {"PTRACE_POKEDATA", Const, 0}, - {"PTRACE_POKETEXT", Const, 0}, - {"PTRACE_POKEUSR", Const, 0}, - {"PTRACE_SETCRUNCHREGS", Const, 0}, - {"PTRACE_SETFPREGS", Const, 0}, - {"PTRACE_SETFPXREGS", Const, 0}, - {"PTRACE_SETHBPREGS", Const, 0}, - {"PTRACE_SETOPTIONS", Const, 0}, - {"PTRACE_SETREGS", Const, 0}, - {"PTRACE_SETREGSET", Const, 0}, - {"PTRACE_SETSIGINFO", Const, 0}, - {"PTRACE_SETVFPREGS", Const, 0}, - {"PTRACE_SETWMMXREGS", Const, 0}, - {"PTRACE_SET_SYSCALL", Const, 0}, - {"PTRACE_SET_THREAD_AREA", Const, 0}, - {"PTRACE_SINGLEBLOCK", Const, 0}, - {"PTRACE_SINGLESTEP", Const, 0}, - {"PTRACE_SYSCALL", Const, 0}, - {"PTRACE_SYSEMU", Const, 0}, - {"PTRACE_SYSEMU_SINGLESTEP", Const, 0}, - {"PTRACE_TRACEME", Const, 0}, - {"PT_ATTACH", Const, 0}, - {"PT_ATTACHEXC", Const, 0}, - {"PT_CONTINUE", Const, 0}, - {"PT_DATA_ADDR", Const, 0}, - {"PT_DENY_ATTACH", Const, 0}, - {"PT_DETACH", Const, 0}, - {"PT_FIRSTMACH", Const, 0}, - {"PT_FORCEQUOTA", Const, 0}, - {"PT_KILL", Const, 0}, - {"PT_MASK", Const, 1}, - {"PT_READ_D", Const, 0}, - {"PT_READ_I", Const, 0}, - {"PT_READ_U", Const, 0}, - {"PT_SIGEXC", Const, 0}, - {"PT_STEP", Const, 0}, - {"PT_TEXT_ADDR", Const, 0}, - {"PT_TEXT_END_ADDR", Const, 0}, - {"PT_THUPDATE", Const, 0}, - {"PT_TRACE_ME", Const, 0}, - {"PT_WRITE_D", Const, 0}, - {"PT_WRITE_I", Const, 0}, - {"PT_WRITE_U", Const, 0}, - {"ParseDirent", Func, 0}, - {"ParseNetlinkMessage", Func, 0}, - {"ParseNetlinkRouteAttr", Func, 0}, - {"ParseRoutingMessage", Func, 0}, - {"ParseRoutingSockaddr", Func, 0}, - {"ParseSocketControlMessage", Func, 0}, - {"ParseUnixCredentials", Func, 0}, - {"ParseUnixRights", Func, 0}, - {"PathMax", Const, 0}, - {"Pathconf", Func, 0}, - {"Pause", Func, 0}, - {"Pipe", Func, 0}, - {"Pipe2", Func, 1}, - {"PivotRoot", Func, 0}, - {"Pointer", Type, 11}, - {"PostQueuedCompletionStatus", Func, 0}, - {"Pread", Func, 0}, - {"Proc", Type, 0}, - {"Proc.Dll", Field, 0}, - {"Proc.Name", Field, 0}, - {"ProcAttr", Type, 0}, - {"ProcAttr.Dir", Field, 0}, - {"ProcAttr.Env", Field, 0}, - {"ProcAttr.Files", Field, 0}, - {"ProcAttr.Sys", Field, 0}, - {"Process32First", Func, 4}, - {"Process32Next", Func, 4}, - {"ProcessEntry32", Type, 4}, - {"ProcessEntry32.DefaultHeapID", Field, 4}, - {"ProcessEntry32.ExeFile", Field, 4}, - {"ProcessEntry32.Flags", Field, 4}, - {"ProcessEntry32.ModuleID", Field, 4}, - {"ProcessEntry32.ParentProcessID", Field, 4}, - {"ProcessEntry32.PriClassBase", Field, 4}, - {"ProcessEntry32.ProcessID", Field, 4}, - {"ProcessEntry32.Size", Field, 4}, - {"ProcessEntry32.Threads", Field, 4}, - {"ProcessEntry32.Usage", Field, 4}, - {"ProcessInformation", Type, 0}, - {"ProcessInformation.Process", Field, 0}, - {"ProcessInformation.ProcessId", Field, 0}, - {"ProcessInformation.Thread", Field, 0}, - {"ProcessInformation.ThreadId", Field, 0}, - {"Protoent", Type, 0}, - {"Protoent.Aliases", Field, 0}, - {"Protoent.Name", Field, 0}, - {"Protoent.Proto", Field, 0}, - {"PtraceAttach", Func, 0}, - {"PtraceCont", Func, 0}, - {"PtraceDetach", Func, 0}, - {"PtraceGetEventMsg", Func, 0}, - {"PtraceGetRegs", Func, 0}, - {"PtracePeekData", Func, 0}, - {"PtracePeekText", Func, 0}, - {"PtracePokeData", Func, 0}, - {"PtracePokeText", Func, 0}, - {"PtraceRegs", Type, 0}, - {"PtraceRegs.Cs", Field, 0}, - {"PtraceRegs.Ds", Field, 0}, - {"PtraceRegs.Eax", Field, 0}, - {"PtraceRegs.Ebp", Field, 0}, - {"PtraceRegs.Ebx", Field, 0}, - {"PtraceRegs.Ecx", Field, 0}, - {"PtraceRegs.Edi", Field, 0}, - {"PtraceRegs.Edx", Field, 0}, - {"PtraceRegs.Eflags", Field, 0}, - {"PtraceRegs.Eip", Field, 0}, - {"PtraceRegs.Es", Field, 0}, - {"PtraceRegs.Esi", Field, 0}, - {"PtraceRegs.Esp", Field, 0}, - {"PtraceRegs.Fs", Field, 0}, - {"PtraceRegs.Fs_base", Field, 0}, - {"PtraceRegs.Gs", Field, 0}, - {"PtraceRegs.Gs_base", Field, 0}, - {"PtraceRegs.Orig_eax", Field, 0}, - {"PtraceRegs.Orig_rax", Field, 0}, - {"PtraceRegs.R10", Field, 0}, - {"PtraceRegs.R11", Field, 0}, - {"PtraceRegs.R12", Field, 0}, - {"PtraceRegs.R13", Field, 0}, - {"PtraceRegs.R14", Field, 0}, - {"PtraceRegs.R15", Field, 0}, - {"PtraceRegs.R8", Field, 0}, - {"PtraceRegs.R9", Field, 0}, - {"PtraceRegs.Rax", Field, 0}, - {"PtraceRegs.Rbp", Field, 0}, - {"PtraceRegs.Rbx", Field, 0}, - {"PtraceRegs.Rcx", Field, 0}, - {"PtraceRegs.Rdi", Field, 0}, - {"PtraceRegs.Rdx", Field, 0}, - {"PtraceRegs.Rip", Field, 0}, - {"PtraceRegs.Rsi", Field, 0}, - {"PtraceRegs.Rsp", Field, 0}, - {"PtraceRegs.Ss", Field, 0}, - {"PtraceRegs.Uregs", Field, 0}, - {"PtraceRegs.Xcs", Field, 0}, - {"PtraceRegs.Xds", Field, 0}, - {"PtraceRegs.Xes", Field, 0}, - {"PtraceRegs.Xfs", Field, 0}, - {"PtraceRegs.Xgs", Field, 0}, - {"PtraceRegs.Xss", Field, 0}, - {"PtraceSetOptions", Func, 0}, - {"PtraceSetRegs", Func, 0}, - {"PtraceSingleStep", Func, 0}, - {"PtraceSyscall", Func, 1}, - {"Pwrite", Func, 0}, - {"REG_BINARY", Const, 0}, - {"REG_DWORD", Const, 0}, - {"REG_DWORD_BIG_ENDIAN", Const, 0}, - {"REG_DWORD_LITTLE_ENDIAN", Const, 0}, - {"REG_EXPAND_SZ", Const, 0}, - {"REG_FULL_RESOURCE_DESCRIPTOR", Const, 0}, - {"REG_LINK", Const, 0}, - {"REG_MULTI_SZ", Const, 0}, - {"REG_NONE", Const, 0}, - {"REG_QWORD", Const, 0}, - {"REG_QWORD_LITTLE_ENDIAN", Const, 0}, - {"REG_RESOURCE_LIST", Const, 0}, - {"REG_RESOURCE_REQUIREMENTS_LIST", Const, 0}, - {"REG_SZ", Const, 0}, - {"RLIMIT_AS", Const, 0}, - {"RLIMIT_CORE", Const, 0}, - {"RLIMIT_CPU", Const, 0}, - {"RLIMIT_CPU_USAGE_MONITOR", Const, 16}, - {"RLIMIT_DATA", Const, 0}, - {"RLIMIT_FSIZE", Const, 0}, - {"RLIMIT_NOFILE", Const, 0}, - {"RLIMIT_STACK", Const, 0}, - {"RLIM_INFINITY", Const, 0}, - {"RTAX_ADVMSS", Const, 0}, - {"RTAX_AUTHOR", Const, 0}, - {"RTAX_BRD", Const, 0}, - {"RTAX_CWND", Const, 0}, - {"RTAX_DST", Const, 0}, - {"RTAX_FEATURES", Const, 0}, - {"RTAX_FEATURE_ALLFRAG", Const, 0}, - {"RTAX_FEATURE_ECN", Const, 0}, - {"RTAX_FEATURE_SACK", Const, 0}, - {"RTAX_FEATURE_TIMESTAMP", Const, 0}, - {"RTAX_GATEWAY", Const, 0}, - {"RTAX_GENMASK", Const, 0}, - {"RTAX_HOPLIMIT", Const, 0}, - {"RTAX_IFA", Const, 0}, - {"RTAX_IFP", Const, 0}, - {"RTAX_INITCWND", Const, 0}, - {"RTAX_INITRWND", Const, 0}, - {"RTAX_LABEL", Const, 1}, - {"RTAX_LOCK", Const, 0}, - {"RTAX_MAX", Const, 0}, - {"RTAX_MTU", Const, 0}, - {"RTAX_NETMASK", Const, 0}, - {"RTAX_REORDERING", Const, 0}, - {"RTAX_RTO_MIN", Const, 0}, - {"RTAX_RTT", Const, 0}, - {"RTAX_RTTVAR", Const, 0}, - {"RTAX_SRC", Const, 1}, - {"RTAX_SRCMASK", Const, 1}, - {"RTAX_SSTHRESH", Const, 0}, - {"RTAX_TAG", Const, 1}, - {"RTAX_UNSPEC", Const, 0}, - {"RTAX_WINDOW", Const, 0}, - {"RTA_ALIGNTO", Const, 0}, - {"RTA_AUTHOR", Const, 0}, - {"RTA_BRD", Const, 0}, - {"RTA_CACHEINFO", Const, 0}, - {"RTA_DST", Const, 0}, - {"RTA_FLOW", Const, 0}, - {"RTA_GATEWAY", Const, 0}, - {"RTA_GENMASK", Const, 0}, - {"RTA_IFA", Const, 0}, - {"RTA_IFP", Const, 0}, - {"RTA_IIF", Const, 0}, - {"RTA_LABEL", Const, 1}, - {"RTA_MAX", Const, 0}, - {"RTA_METRICS", Const, 0}, - {"RTA_MULTIPATH", Const, 0}, - {"RTA_NETMASK", Const, 0}, - {"RTA_OIF", Const, 0}, - {"RTA_PREFSRC", Const, 0}, - {"RTA_PRIORITY", Const, 0}, - {"RTA_SRC", Const, 0}, - {"RTA_SRCMASK", Const, 1}, - {"RTA_TABLE", Const, 0}, - {"RTA_TAG", Const, 1}, - {"RTA_UNSPEC", Const, 0}, - {"RTCF_DIRECTSRC", Const, 0}, - {"RTCF_DOREDIRECT", Const, 0}, - {"RTCF_LOG", Const, 0}, - {"RTCF_MASQ", Const, 0}, - {"RTCF_NAT", Const, 0}, - {"RTCF_VALVE", Const, 0}, - {"RTF_ADDRCLASSMASK", Const, 0}, - {"RTF_ADDRCONF", Const, 0}, - {"RTF_ALLONLINK", Const, 0}, - {"RTF_ANNOUNCE", Const, 1}, - {"RTF_BLACKHOLE", Const, 0}, - {"RTF_BROADCAST", Const, 0}, - {"RTF_CACHE", Const, 0}, - {"RTF_CLONED", Const, 1}, - {"RTF_CLONING", Const, 0}, - {"RTF_CONDEMNED", Const, 0}, - {"RTF_DEFAULT", Const, 0}, - {"RTF_DELCLONE", Const, 0}, - {"RTF_DONE", Const, 0}, - {"RTF_DYNAMIC", Const, 0}, - {"RTF_FLOW", Const, 0}, - {"RTF_FMASK", Const, 0}, - {"RTF_GATEWAY", Const, 0}, - {"RTF_GWFLAG_COMPAT", Const, 3}, - {"RTF_HOST", Const, 0}, - {"RTF_IFREF", Const, 0}, - {"RTF_IFSCOPE", Const, 0}, - {"RTF_INTERFACE", Const, 0}, - {"RTF_IRTT", Const, 0}, - {"RTF_LINKRT", Const, 0}, - {"RTF_LLDATA", Const, 0}, - {"RTF_LLINFO", Const, 0}, - {"RTF_LOCAL", Const, 0}, - {"RTF_MASK", Const, 1}, - {"RTF_MODIFIED", Const, 0}, - {"RTF_MPATH", Const, 1}, - {"RTF_MPLS", Const, 1}, - {"RTF_MSS", Const, 0}, - {"RTF_MTU", Const, 0}, - {"RTF_MULTICAST", Const, 0}, - {"RTF_NAT", Const, 0}, - {"RTF_NOFORWARD", Const, 0}, - {"RTF_NONEXTHOP", Const, 0}, - {"RTF_NOPMTUDISC", Const, 0}, - {"RTF_PERMANENT_ARP", Const, 1}, - {"RTF_PINNED", Const, 0}, - {"RTF_POLICY", Const, 0}, - {"RTF_PRCLONING", Const, 0}, - {"RTF_PROTO1", Const, 0}, - {"RTF_PROTO2", Const, 0}, - {"RTF_PROTO3", Const, 0}, - {"RTF_PROXY", Const, 16}, - {"RTF_REINSTATE", Const, 0}, - {"RTF_REJECT", Const, 0}, - {"RTF_RNH_LOCKED", Const, 0}, - {"RTF_ROUTER", Const, 16}, - {"RTF_SOURCE", Const, 1}, - {"RTF_SRC", Const, 1}, - {"RTF_STATIC", Const, 0}, - {"RTF_STICKY", Const, 0}, - {"RTF_THROW", Const, 0}, - {"RTF_TUNNEL", Const, 1}, - {"RTF_UP", Const, 0}, - {"RTF_USETRAILERS", Const, 1}, - {"RTF_WASCLONED", Const, 0}, - {"RTF_WINDOW", Const, 0}, - {"RTF_XRESOLVE", Const, 0}, - {"RTM_ADD", Const, 0}, - {"RTM_BASE", Const, 0}, - {"RTM_CHANGE", Const, 0}, - {"RTM_CHGADDR", Const, 1}, - {"RTM_DELACTION", Const, 0}, - {"RTM_DELADDR", Const, 0}, - {"RTM_DELADDRLABEL", Const, 0}, - {"RTM_DELETE", Const, 0}, - {"RTM_DELLINK", Const, 0}, - {"RTM_DELMADDR", Const, 0}, - {"RTM_DELNEIGH", Const, 0}, - {"RTM_DELQDISC", Const, 0}, - {"RTM_DELROUTE", Const, 0}, - {"RTM_DELRULE", Const, 0}, - {"RTM_DELTCLASS", Const, 0}, - {"RTM_DELTFILTER", Const, 0}, - {"RTM_DESYNC", Const, 1}, - {"RTM_F_CLONED", Const, 0}, - {"RTM_F_EQUALIZE", Const, 0}, - {"RTM_F_NOTIFY", Const, 0}, - {"RTM_F_PREFIX", Const, 0}, - {"RTM_GET", Const, 0}, - {"RTM_GET2", Const, 0}, - {"RTM_GETACTION", Const, 0}, - {"RTM_GETADDR", Const, 0}, - {"RTM_GETADDRLABEL", Const, 0}, - {"RTM_GETANYCAST", Const, 0}, - {"RTM_GETDCB", Const, 0}, - {"RTM_GETLINK", Const, 0}, - {"RTM_GETMULTICAST", Const, 0}, - {"RTM_GETNEIGH", Const, 0}, - {"RTM_GETNEIGHTBL", Const, 0}, - {"RTM_GETQDISC", Const, 0}, - {"RTM_GETROUTE", Const, 0}, - {"RTM_GETRULE", Const, 0}, - {"RTM_GETTCLASS", Const, 0}, - {"RTM_GETTFILTER", Const, 0}, - {"RTM_IEEE80211", Const, 0}, - {"RTM_IFANNOUNCE", Const, 0}, - {"RTM_IFINFO", Const, 0}, - {"RTM_IFINFO2", Const, 0}, - {"RTM_LLINFO_UPD", Const, 1}, - {"RTM_LOCK", Const, 0}, - {"RTM_LOSING", Const, 0}, - {"RTM_MAX", Const, 0}, - {"RTM_MAXSIZE", Const, 1}, - {"RTM_MISS", Const, 0}, - {"RTM_NEWACTION", Const, 0}, - {"RTM_NEWADDR", Const, 0}, - {"RTM_NEWADDRLABEL", Const, 0}, - {"RTM_NEWLINK", Const, 0}, - {"RTM_NEWMADDR", Const, 0}, - {"RTM_NEWMADDR2", Const, 0}, - {"RTM_NEWNDUSEROPT", Const, 0}, - {"RTM_NEWNEIGH", Const, 0}, - {"RTM_NEWNEIGHTBL", Const, 0}, - {"RTM_NEWPREFIX", Const, 0}, - {"RTM_NEWQDISC", Const, 0}, - {"RTM_NEWROUTE", Const, 0}, - {"RTM_NEWRULE", Const, 0}, - {"RTM_NEWTCLASS", Const, 0}, - {"RTM_NEWTFILTER", Const, 0}, - {"RTM_NR_FAMILIES", Const, 0}, - {"RTM_NR_MSGTYPES", Const, 0}, - {"RTM_OIFINFO", Const, 1}, - {"RTM_OLDADD", Const, 0}, - {"RTM_OLDDEL", Const, 0}, - {"RTM_OOIFINFO", Const, 1}, - {"RTM_REDIRECT", Const, 0}, - {"RTM_RESOLVE", Const, 0}, - {"RTM_RTTUNIT", Const, 0}, - {"RTM_SETDCB", Const, 0}, - {"RTM_SETGATE", Const, 1}, - {"RTM_SETLINK", Const, 0}, - {"RTM_SETNEIGHTBL", Const, 0}, - {"RTM_VERSION", Const, 0}, - {"RTNH_ALIGNTO", Const, 0}, - {"RTNH_F_DEAD", Const, 0}, - {"RTNH_F_ONLINK", Const, 0}, - {"RTNH_F_PERVASIVE", Const, 0}, - {"RTNLGRP_IPV4_IFADDR", Const, 1}, - {"RTNLGRP_IPV4_MROUTE", Const, 1}, - {"RTNLGRP_IPV4_ROUTE", Const, 1}, - {"RTNLGRP_IPV4_RULE", Const, 1}, - {"RTNLGRP_IPV6_IFADDR", Const, 1}, - {"RTNLGRP_IPV6_IFINFO", Const, 1}, - {"RTNLGRP_IPV6_MROUTE", Const, 1}, - {"RTNLGRP_IPV6_PREFIX", Const, 1}, - {"RTNLGRP_IPV6_ROUTE", Const, 1}, - {"RTNLGRP_IPV6_RULE", Const, 1}, - {"RTNLGRP_LINK", Const, 1}, - {"RTNLGRP_ND_USEROPT", Const, 1}, - {"RTNLGRP_NEIGH", Const, 1}, - {"RTNLGRP_NONE", Const, 1}, - {"RTNLGRP_NOTIFY", Const, 1}, - {"RTNLGRP_TC", Const, 1}, - {"RTN_ANYCAST", Const, 0}, - {"RTN_BLACKHOLE", Const, 0}, - {"RTN_BROADCAST", Const, 0}, - {"RTN_LOCAL", Const, 0}, - {"RTN_MAX", Const, 0}, - {"RTN_MULTICAST", Const, 0}, - {"RTN_NAT", Const, 0}, - {"RTN_PROHIBIT", Const, 0}, - {"RTN_THROW", Const, 0}, - {"RTN_UNICAST", Const, 0}, - {"RTN_UNREACHABLE", Const, 0}, - {"RTN_UNSPEC", Const, 0}, - {"RTN_XRESOLVE", Const, 0}, - {"RTPROT_BIRD", Const, 0}, - {"RTPROT_BOOT", Const, 0}, - {"RTPROT_DHCP", Const, 0}, - {"RTPROT_DNROUTED", Const, 0}, - {"RTPROT_GATED", Const, 0}, - {"RTPROT_KERNEL", Const, 0}, - {"RTPROT_MRT", Const, 0}, - {"RTPROT_NTK", Const, 0}, - {"RTPROT_RA", Const, 0}, - {"RTPROT_REDIRECT", Const, 0}, - {"RTPROT_STATIC", Const, 0}, - {"RTPROT_UNSPEC", Const, 0}, - {"RTPROT_XORP", Const, 0}, - {"RTPROT_ZEBRA", Const, 0}, - {"RTV_EXPIRE", Const, 0}, - {"RTV_HOPCOUNT", Const, 0}, - {"RTV_MTU", Const, 0}, - {"RTV_RPIPE", Const, 0}, - {"RTV_RTT", Const, 0}, - {"RTV_RTTVAR", Const, 0}, - {"RTV_SPIPE", Const, 0}, - {"RTV_SSTHRESH", Const, 0}, - {"RTV_WEIGHT", Const, 0}, - {"RT_CACHING_CONTEXT", Const, 1}, - {"RT_CLASS_DEFAULT", Const, 0}, - {"RT_CLASS_LOCAL", Const, 0}, - {"RT_CLASS_MAIN", Const, 0}, - {"RT_CLASS_MAX", Const, 0}, - {"RT_CLASS_UNSPEC", Const, 0}, - {"RT_DEFAULT_FIB", Const, 1}, - {"RT_NORTREF", Const, 1}, - {"RT_SCOPE_HOST", Const, 0}, - {"RT_SCOPE_LINK", Const, 0}, - {"RT_SCOPE_NOWHERE", Const, 0}, - {"RT_SCOPE_SITE", Const, 0}, - {"RT_SCOPE_UNIVERSE", Const, 0}, - {"RT_TABLEID_MAX", Const, 1}, - {"RT_TABLE_COMPAT", Const, 0}, - {"RT_TABLE_DEFAULT", Const, 0}, - {"RT_TABLE_LOCAL", Const, 0}, - {"RT_TABLE_MAIN", Const, 0}, - {"RT_TABLE_MAX", Const, 0}, - {"RT_TABLE_UNSPEC", Const, 0}, - {"RUSAGE_CHILDREN", Const, 0}, - {"RUSAGE_SELF", Const, 0}, - {"RUSAGE_THREAD", Const, 0}, - {"Radvisory_t", Type, 0}, - {"Radvisory_t.Count", Field, 0}, - {"Radvisory_t.Offset", Field, 0}, - {"Radvisory_t.Pad_cgo_0", Field, 0}, - {"RawConn", Type, 9}, - {"RawSockaddr", Type, 0}, - {"RawSockaddr.Data", Field, 0}, - {"RawSockaddr.Family", Field, 0}, - {"RawSockaddr.Len", Field, 0}, - {"RawSockaddrAny", Type, 0}, - {"RawSockaddrAny.Addr", Field, 0}, - {"RawSockaddrAny.Pad", Field, 0}, - {"RawSockaddrDatalink", Type, 0}, - {"RawSockaddrDatalink.Alen", Field, 0}, - {"RawSockaddrDatalink.Data", Field, 0}, - {"RawSockaddrDatalink.Family", Field, 0}, - {"RawSockaddrDatalink.Index", Field, 0}, - {"RawSockaddrDatalink.Len", Field, 0}, - {"RawSockaddrDatalink.Nlen", Field, 0}, - {"RawSockaddrDatalink.Pad_cgo_0", Field, 2}, - {"RawSockaddrDatalink.Slen", Field, 0}, - {"RawSockaddrDatalink.Type", Field, 0}, - {"RawSockaddrInet4", Type, 0}, - {"RawSockaddrInet4.Addr", Field, 0}, - {"RawSockaddrInet4.Family", Field, 0}, - {"RawSockaddrInet4.Len", Field, 0}, - {"RawSockaddrInet4.Port", Field, 0}, - {"RawSockaddrInet4.Zero", Field, 0}, - {"RawSockaddrInet6", Type, 0}, - {"RawSockaddrInet6.Addr", Field, 0}, - {"RawSockaddrInet6.Family", Field, 0}, - {"RawSockaddrInet6.Flowinfo", Field, 0}, - {"RawSockaddrInet6.Len", Field, 0}, - {"RawSockaddrInet6.Port", Field, 0}, - {"RawSockaddrInet6.Scope_id", Field, 0}, - {"RawSockaddrLinklayer", Type, 0}, - {"RawSockaddrLinklayer.Addr", Field, 0}, - {"RawSockaddrLinklayer.Family", Field, 0}, - {"RawSockaddrLinklayer.Halen", Field, 0}, - {"RawSockaddrLinklayer.Hatype", Field, 0}, - {"RawSockaddrLinklayer.Ifindex", Field, 0}, - {"RawSockaddrLinklayer.Pkttype", Field, 0}, - {"RawSockaddrLinklayer.Protocol", Field, 0}, - {"RawSockaddrNetlink", Type, 0}, - {"RawSockaddrNetlink.Family", Field, 0}, - {"RawSockaddrNetlink.Groups", Field, 0}, - {"RawSockaddrNetlink.Pad", Field, 0}, - {"RawSockaddrNetlink.Pid", Field, 0}, - {"RawSockaddrUnix", Type, 0}, - {"RawSockaddrUnix.Family", Field, 0}, - {"RawSockaddrUnix.Len", Field, 0}, - {"RawSockaddrUnix.Pad_cgo_0", Field, 2}, - {"RawSockaddrUnix.Path", Field, 0}, - {"RawSyscall", Func, 0}, - {"RawSyscall6", Func, 0}, - {"Read", Func, 0}, - {"ReadConsole", Func, 1}, - {"ReadDirectoryChanges", Func, 0}, - {"ReadDirent", Func, 0}, - {"ReadFile", Func, 0}, - {"Readlink", Func, 0}, - {"Reboot", Func, 0}, - {"Recvfrom", Func, 0}, - {"Recvmsg", Func, 0}, - {"RegCloseKey", Func, 0}, - {"RegEnumKeyEx", Func, 0}, - {"RegOpenKeyEx", Func, 0}, - {"RegQueryInfoKey", Func, 0}, - {"RegQueryValueEx", Func, 0}, - {"RemoveDirectory", Func, 0}, - {"Removexattr", Func, 1}, - {"Rename", Func, 0}, - {"Renameat", Func, 0}, - {"Revoke", Func, 0}, - {"Rlimit", Type, 0}, - {"Rlimit.Cur", Field, 0}, - {"Rlimit.Max", Field, 0}, - {"Rmdir", Func, 0}, - {"RouteMessage", Type, 0}, - {"RouteMessage.Data", Field, 0}, - {"RouteMessage.Header", Field, 0}, - {"RouteRIB", Func, 0}, - {"RoutingMessage", Type, 0}, - {"RtAttr", Type, 0}, - {"RtAttr.Len", Field, 0}, - {"RtAttr.Type", Field, 0}, - {"RtGenmsg", Type, 0}, - {"RtGenmsg.Family", Field, 0}, - {"RtMetrics", Type, 0}, - {"RtMetrics.Expire", Field, 0}, - {"RtMetrics.Filler", Field, 0}, - {"RtMetrics.Hopcount", Field, 0}, - {"RtMetrics.Locks", Field, 0}, - {"RtMetrics.Mtu", Field, 0}, - {"RtMetrics.Pad", Field, 3}, - {"RtMetrics.Pksent", Field, 0}, - {"RtMetrics.Recvpipe", Field, 0}, - {"RtMetrics.Refcnt", Field, 2}, - {"RtMetrics.Rtt", Field, 0}, - {"RtMetrics.Rttvar", Field, 0}, - {"RtMetrics.Sendpipe", Field, 0}, - {"RtMetrics.Ssthresh", Field, 0}, - {"RtMetrics.Weight", Field, 0}, - {"RtMsg", Type, 0}, - {"RtMsg.Dst_len", Field, 0}, - {"RtMsg.Family", Field, 0}, - {"RtMsg.Flags", Field, 0}, - {"RtMsg.Protocol", Field, 0}, - {"RtMsg.Scope", Field, 0}, - {"RtMsg.Src_len", Field, 0}, - {"RtMsg.Table", Field, 0}, - {"RtMsg.Tos", Field, 0}, - {"RtMsg.Type", Field, 0}, - {"RtMsghdr", Type, 0}, - {"RtMsghdr.Addrs", Field, 0}, - {"RtMsghdr.Errno", Field, 0}, - {"RtMsghdr.Flags", Field, 0}, - {"RtMsghdr.Fmask", Field, 0}, - {"RtMsghdr.Hdrlen", Field, 2}, - {"RtMsghdr.Index", Field, 0}, - {"RtMsghdr.Inits", Field, 0}, - {"RtMsghdr.Mpls", Field, 2}, - {"RtMsghdr.Msglen", Field, 0}, - {"RtMsghdr.Pad_cgo_0", Field, 0}, - {"RtMsghdr.Pad_cgo_1", Field, 2}, - {"RtMsghdr.Pid", Field, 0}, - {"RtMsghdr.Priority", Field, 2}, - {"RtMsghdr.Rmx", Field, 0}, - {"RtMsghdr.Seq", Field, 0}, - {"RtMsghdr.Tableid", Field, 2}, - {"RtMsghdr.Type", Field, 0}, - {"RtMsghdr.Use", Field, 0}, - {"RtMsghdr.Version", Field, 0}, - {"RtNexthop", Type, 0}, - {"RtNexthop.Flags", Field, 0}, - {"RtNexthop.Hops", Field, 0}, - {"RtNexthop.Ifindex", Field, 0}, - {"RtNexthop.Len", Field, 0}, - {"Rusage", Type, 0}, - {"Rusage.CreationTime", Field, 0}, - {"Rusage.ExitTime", Field, 0}, - {"Rusage.Idrss", Field, 0}, - {"Rusage.Inblock", Field, 0}, - {"Rusage.Isrss", Field, 0}, - {"Rusage.Ixrss", Field, 0}, - {"Rusage.KernelTime", Field, 0}, - {"Rusage.Majflt", Field, 0}, - {"Rusage.Maxrss", Field, 0}, - {"Rusage.Minflt", Field, 0}, - {"Rusage.Msgrcv", Field, 0}, - {"Rusage.Msgsnd", Field, 0}, - {"Rusage.Nivcsw", Field, 0}, - {"Rusage.Nsignals", Field, 0}, - {"Rusage.Nswap", Field, 0}, - {"Rusage.Nvcsw", Field, 0}, - {"Rusage.Oublock", Field, 0}, - {"Rusage.Stime", Field, 0}, - {"Rusage.UserTime", Field, 0}, - {"Rusage.Utime", Field, 0}, - {"SCM_BINTIME", Const, 0}, - {"SCM_CREDENTIALS", Const, 0}, - {"SCM_CREDS", Const, 0}, - {"SCM_RIGHTS", Const, 0}, - {"SCM_TIMESTAMP", Const, 0}, - {"SCM_TIMESTAMPING", Const, 0}, - {"SCM_TIMESTAMPNS", Const, 0}, - {"SCM_TIMESTAMP_MONOTONIC", Const, 0}, - {"SHUT_RD", Const, 0}, - {"SHUT_RDWR", Const, 0}, - {"SHUT_WR", Const, 0}, - {"SID", Type, 0}, - {"SIDAndAttributes", Type, 0}, - {"SIDAndAttributes.Attributes", Field, 0}, - {"SIDAndAttributes.Sid", Field, 0}, - {"SIGABRT", Const, 0}, - {"SIGALRM", Const, 0}, - {"SIGBUS", Const, 0}, - {"SIGCHLD", Const, 0}, - {"SIGCLD", Const, 0}, - {"SIGCONT", Const, 0}, - {"SIGEMT", Const, 0}, - {"SIGFPE", Const, 0}, - {"SIGHUP", Const, 0}, - {"SIGILL", Const, 0}, - {"SIGINFO", Const, 0}, - {"SIGINT", Const, 0}, - {"SIGIO", Const, 0}, - {"SIGIOT", Const, 0}, - {"SIGKILL", Const, 0}, - {"SIGLIBRT", Const, 1}, - {"SIGLWP", Const, 0}, - {"SIGPIPE", Const, 0}, - {"SIGPOLL", Const, 0}, - {"SIGPROF", Const, 0}, - {"SIGPWR", Const, 0}, - {"SIGQUIT", Const, 0}, - {"SIGSEGV", Const, 0}, - {"SIGSTKFLT", Const, 0}, - {"SIGSTOP", Const, 0}, - {"SIGSYS", Const, 0}, - {"SIGTERM", Const, 0}, - {"SIGTHR", Const, 0}, - {"SIGTRAP", Const, 0}, - {"SIGTSTP", Const, 0}, - {"SIGTTIN", Const, 0}, - {"SIGTTOU", Const, 0}, - {"SIGUNUSED", Const, 0}, - {"SIGURG", Const, 0}, - {"SIGUSR1", Const, 0}, - {"SIGUSR2", Const, 0}, - {"SIGVTALRM", Const, 0}, - {"SIGWINCH", Const, 0}, - {"SIGXCPU", Const, 0}, - {"SIGXFSZ", Const, 0}, - {"SIOCADDDLCI", Const, 0}, - {"SIOCADDMULTI", Const, 0}, - {"SIOCADDRT", Const, 0}, - {"SIOCAIFADDR", Const, 0}, - {"SIOCAIFGROUP", Const, 0}, - {"SIOCALIFADDR", Const, 0}, - {"SIOCARPIPLL", Const, 0}, - {"SIOCATMARK", Const, 0}, - {"SIOCAUTOADDR", Const, 0}, - {"SIOCAUTONETMASK", Const, 0}, - {"SIOCBRDGADD", Const, 1}, - {"SIOCBRDGADDS", Const, 1}, - {"SIOCBRDGARL", Const, 1}, - {"SIOCBRDGDADDR", Const, 1}, - {"SIOCBRDGDEL", Const, 1}, - {"SIOCBRDGDELS", Const, 1}, - {"SIOCBRDGFLUSH", Const, 1}, - {"SIOCBRDGFRL", Const, 1}, - {"SIOCBRDGGCACHE", Const, 1}, - {"SIOCBRDGGFD", Const, 1}, - {"SIOCBRDGGHT", Const, 1}, - {"SIOCBRDGGIFFLGS", Const, 1}, - {"SIOCBRDGGMA", Const, 1}, - {"SIOCBRDGGPARAM", Const, 1}, - {"SIOCBRDGGPRI", Const, 1}, - {"SIOCBRDGGRL", Const, 1}, - {"SIOCBRDGGSIFS", Const, 1}, - {"SIOCBRDGGTO", Const, 1}, - {"SIOCBRDGIFS", Const, 1}, - {"SIOCBRDGRTS", Const, 1}, - {"SIOCBRDGSADDR", Const, 1}, - {"SIOCBRDGSCACHE", Const, 1}, - {"SIOCBRDGSFD", Const, 1}, - {"SIOCBRDGSHT", Const, 1}, - {"SIOCBRDGSIFCOST", Const, 1}, - {"SIOCBRDGSIFFLGS", Const, 1}, - {"SIOCBRDGSIFPRIO", Const, 1}, - {"SIOCBRDGSMA", Const, 1}, - {"SIOCBRDGSPRI", Const, 1}, - {"SIOCBRDGSPROTO", Const, 1}, - {"SIOCBRDGSTO", Const, 1}, - {"SIOCBRDGSTXHC", Const, 1}, - {"SIOCDARP", Const, 0}, - {"SIOCDELDLCI", Const, 0}, - {"SIOCDELMULTI", Const, 0}, - {"SIOCDELRT", Const, 0}, - {"SIOCDEVPRIVATE", Const, 0}, - {"SIOCDIFADDR", Const, 0}, - {"SIOCDIFGROUP", Const, 0}, - {"SIOCDIFPHYADDR", Const, 0}, - {"SIOCDLIFADDR", Const, 0}, - {"SIOCDRARP", Const, 0}, - {"SIOCGARP", Const, 0}, - {"SIOCGDRVSPEC", Const, 0}, - {"SIOCGETKALIVE", Const, 1}, - {"SIOCGETLABEL", Const, 1}, - {"SIOCGETPFLOW", Const, 1}, - {"SIOCGETPFSYNC", Const, 1}, - {"SIOCGETSGCNT", Const, 0}, - {"SIOCGETVIFCNT", Const, 0}, - {"SIOCGETVLAN", Const, 0}, - {"SIOCGHIWAT", Const, 0}, - {"SIOCGIFADDR", Const, 0}, - {"SIOCGIFADDRPREF", Const, 1}, - {"SIOCGIFALIAS", Const, 1}, - {"SIOCGIFALTMTU", Const, 0}, - {"SIOCGIFASYNCMAP", Const, 0}, - {"SIOCGIFBOND", Const, 0}, - {"SIOCGIFBR", Const, 0}, - {"SIOCGIFBRDADDR", Const, 0}, - {"SIOCGIFCAP", Const, 0}, - {"SIOCGIFCONF", Const, 0}, - {"SIOCGIFCOUNT", Const, 0}, - {"SIOCGIFDATA", Const, 1}, - {"SIOCGIFDESCR", Const, 0}, - {"SIOCGIFDEVMTU", Const, 0}, - {"SIOCGIFDLT", Const, 1}, - {"SIOCGIFDSTADDR", Const, 0}, - {"SIOCGIFENCAP", Const, 0}, - {"SIOCGIFFIB", Const, 1}, - {"SIOCGIFFLAGS", Const, 0}, - {"SIOCGIFGATTR", Const, 1}, - {"SIOCGIFGENERIC", Const, 0}, - {"SIOCGIFGMEMB", Const, 0}, - {"SIOCGIFGROUP", Const, 0}, - {"SIOCGIFHARDMTU", Const, 3}, - {"SIOCGIFHWADDR", Const, 0}, - {"SIOCGIFINDEX", Const, 0}, - {"SIOCGIFKPI", Const, 0}, - {"SIOCGIFMAC", Const, 0}, - {"SIOCGIFMAP", Const, 0}, - {"SIOCGIFMEDIA", Const, 0}, - {"SIOCGIFMEM", Const, 0}, - {"SIOCGIFMETRIC", Const, 0}, - {"SIOCGIFMTU", Const, 0}, - {"SIOCGIFNAME", Const, 0}, - {"SIOCGIFNETMASK", Const, 0}, - {"SIOCGIFPDSTADDR", Const, 0}, - {"SIOCGIFPFLAGS", Const, 0}, - {"SIOCGIFPHYS", Const, 0}, - {"SIOCGIFPRIORITY", Const, 1}, - {"SIOCGIFPSRCADDR", Const, 0}, - {"SIOCGIFRDOMAIN", Const, 1}, - {"SIOCGIFRTLABEL", Const, 1}, - {"SIOCGIFSLAVE", Const, 0}, - {"SIOCGIFSTATUS", Const, 0}, - {"SIOCGIFTIMESLOT", Const, 1}, - {"SIOCGIFTXQLEN", Const, 0}, - {"SIOCGIFVLAN", Const, 0}, - {"SIOCGIFWAKEFLAGS", Const, 0}, - {"SIOCGIFXFLAGS", Const, 1}, - {"SIOCGLIFADDR", Const, 0}, - {"SIOCGLIFPHYADDR", Const, 0}, - {"SIOCGLIFPHYRTABLE", Const, 1}, - {"SIOCGLIFPHYTTL", Const, 3}, - {"SIOCGLINKSTR", Const, 1}, - {"SIOCGLOWAT", Const, 0}, - {"SIOCGPGRP", Const, 0}, - {"SIOCGPRIVATE_0", Const, 0}, - {"SIOCGPRIVATE_1", Const, 0}, - {"SIOCGRARP", Const, 0}, - {"SIOCGSPPPPARAMS", Const, 3}, - {"SIOCGSTAMP", Const, 0}, - {"SIOCGSTAMPNS", Const, 0}, - {"SIOCGVH", Const, 1}, - {"SIOCGVNETID", Const, 3}, - {"SIOCIFCREATE", Const, 0}, - {"SIOCIFCREATE2", Const, 0}, - {"SIOCIFDESTROY", Const, 0}, - {"SIOCIFGCLONERS", Const, 0}, - {"SIOCINITIFADDR", Const, 1}, - {"SIOCPROTOPRIVATE", Const, 0}, - {"SIOCRSLVMULTI", Const, 0}, - {"SIOCRTMSG", Const, 0}, - {"SIOCSARP", Const, 0}, - {"SIOCSDRVSPEC", Const, 0}, - {"SIOCSETKALIVE", Const, 1}, - {"SIOCSETLABEL", Const, 1}, - {"SIOCSETPFLOW", Const, 1}, - {"SIOCSETPFSYNC", Const, 1}, - {"SIOCSETVLAN", Const, 0}, - {"SIOCSHIWAT", Const, 0}, - {"SIOCSIFADDR", Const, 0}, - {"SIOCSIFADDRPREF", Const, 1}, - {"SIOCSIFALTMTU", Const, 0}, - {"SIOCSIFASYNCMAP", Const, 0}, - {"SIOCSIFBOND", Const, 0}, - {"SIOCSIFBR", Const, 0}, - {"SIOCSIFBRDADDR", Const, 0}, - {"SIOCSIFCAP", Const, 0}, - {"SIOCSIFDESCR", Const, 0}, - {"SIOCSIFDSTADDR", Const, 0}, - {"SIOCSIFENCAP", Const, 0}, - {"SIOCSIFFIB", Const, 1}, - {"SIOCSIFFLAGS", Const, 0}, - {"SIOCSIFGATTR", Const, 1}, - {"SIOCSIFGENERIC", Const, 0}, - {"SIOCSIFHWADDR", Const, 0}, - {"SIOCSIFHWBROADCAST", Const, 0}, - {"SIOCSIFKPI", Const, 0}, - {"SIOCSIFLINK", Const, 0}, - {"SIOCSIFLLADDR", Const, 0}, - {"SIOCSIFMAC", Const, 0}, - {"SIOCSIFMAP", Const, 0}, - {"SIOCSIFMEDIA", Const, 0}, - {"SIOCSIFMEM", Const, 0}, - {"SIOCSIFMETRIC", Const, 0}, - {"SIOCSIFMTU", Const, 0}, - {"SIOCSIFNAME", Const, 0}, - {"SIOCSIFNETMASK", Const, 0}, - {"SIOCSIFPFLAGS", Const, 0}, - {"SIOCSIFPHYADDR", Const, 0}, - {"SIOCSIFPHYS", Const, 0}, - {"SIOCSIFPRIORITY", Const, 1}, - {"SIOCSIFRDOMAIN", Const, 1}, - {"SIOCSIFRTLABEL", Const, 1}, - {"SIOCSIFRVNET", Const, 0}, - {"SIOCSIFSLAVE", Const, 0}, - {"SIOCSIFTIMESLOT", Const, 1}, - {"SIOCSIFTXQLEN", Const, 0}, - {"SIOCSIFVLAN", Const, 0}, - {"SIOCSIFVNET", Const, 0}, - {"SIOCSIFXFLAGS", Const, 1}, - {"SIOCSLIFPHYADDR", Const, 0}, - {"SIOCSLIFPHYRTABLE", Const, 1}, - {"SIOCSLIFPHYTTL", Const, 3}, - {"SIOCSLINKSTR", Const, 1}, - {"SIOCSLOWAT", Const, 0}, - {"SIOCSPGRP", Const, 0}, - {"SIOCSRARP", Const, 0}, - {"SIOCSSPPPPARAMS", Const, 3}, - {"SIOCSVH", Const, 1}, - {"SIOCSVNETID", Const, 3}, - {"SIOCZIFDATA", Const, 1}, - {"SIO_GET_EXTENSION_FUNCTION_POINTER", Const, 1}, - {"SIO_GET_INTERFACE_LIST", Const, 0}, - {"SIO_KEEPALIVE_VALS", Const, 3}, - {"SIO_UDP_CONNRESET", Const, 4}, - {"SOCK_CLOEXEC", Const, 0}, - {"SOCK_DCCP", Const, 0}, - {"SOCK_DGRAM", Const, 0}, - {"SOCK_FLAGS_MASK", Const, 1}, - {"SOCK_MAXADDRLEN", Const, 0}, - {"SOCK_NONBLOCK", Const, 0}, - {"SOCK_NOSIGPIPE", Const, 1}, - {"SOCK_PACKET", Const, 0}, - {"SOCK_RAW", Const, 0}, - {"SOCK_RDM", Const, 0}, - {"SOCK_SEQPACKET", Const, 0}, - {"SOCK_STREAM", Const, 0}, - {"SOL_AAL", Const, 0}, - {"SOL_ATM", Const, 0}, - {"SOL_DECNET", Const, 0}, - {"SOL_ICMPV6", Const, 0}, - {"SOL_IP", Const, 0}, - {"SOL_IPV6", Const, 0}, - {"SOL_IRDA", Const, 0}, - {"SOL_PACKET", Const, 0}, - {"SOL_RAW", Const, 0}, - {"SOL_SOCKET", Const, 0}, - {"SOL_TCP", Const, 0}, - {"SOL_X25", Const, 0}, - {"SOMAXCONN", Const, 0}, - {"SO_ACCEPTCONN", Const, 0}, - {"SO_ACCEPTFILTER", Const, 0}, - {"SO_ATTACH_FILTER", Const, 0}, - {"SO_BINDANY", Const, 1}, - {"SO_BINDTODEVICE", Const, 0}, - {"SO_BINTIME", Const, 0}, - {"SO_BROADCAST", Const, 0}, - {"SO_BSDCOMPAT", Const, 0}, - {"SO_DEBUG", Const, 0}, - {"SO_DETACH_FILTER", Const, 0}, - {"SO_DOMAIN", Const, 0}, - {"SO_DONTROUTE", Const, 0}, - {"SO_DONTTRUNC", Const, 0}, - {"SO_ERROR", Const, 0}, - {"SO_KEEPALIVE", Const, 0}, - {"SO_LABEL", Const, 0}, - {"SO_LINGER", Const, 0}, - {"SO_LINGER_SEC", Const, 0}, - {"SO_LISTENINCQLEN", Const, 0}, - {"SO_LISTENQLEN", Const, 0}, - {"SO_LISTENQLIMIT", Const, 0}, - {"SO_MARK", Const, 0}, - {"SO_NETPROC", Const, 1}, - {"SO_NKE", Const, 0}, - {"SO_NOADDRERR", Const, 0}, - {"SO_NOHEADER", Const, 1}, - {"SO_NOSIGPIPE", Const, 0}, - {"SO_NOTIFYCONFLICT", Const, 0}, - {"SO_NO_CHECK", Const, 0}, - {"SO_NO_DDP", Const, 0}, - {"SO_NO_OFFLOAD", Const, 0}, - {"SO_NP_EXTENSIONS", Const, 0}, - {"SO_NREAD", Const, 0}, - {"SO_NUMRCVPKT", Const, 16}, - {"SO_NWRITE", Const, 0}, - {"SO_OOBINLINE", Const, 0}, - {"SO_OVERFLOWED", Const, 1}, - {"SO_PASSCRED", Const, 0}, - {"SO_PASSSEC", Const, 0}, - {"SO_PEERCRED", Const, 0}, - {"SO_PEERLABEL", Const, 0}, - {"SO_PEERNAME", Const, 0}, - {"SO_PEERSEC", Const, 0}, - {"SO_PRIORITY", Const, 0}, - {"SO_PROTOCOL", Const, 0}, - {"SO_PROTOTYPE", Const, 1}, - {"SO_RANDOMPORT", Const, 0}, - {"SO_RCVBUF", Const, 0}, - {"SO_RCVBUFFORCE", Const, 0}, - {"SO_RCVLOWAT", Const, 0}, - {"SO_RCVTIMEO", Const, 0}, - {"SO_RESTRICTIONS", Const, 0}, - {"SO_RESTRICT_DENYIN", Const, 0}, - {"SO_RESTRICT_DENYOUT", Const, 0}, - {"SO_RESTRICT_DENYSET", Const, 0}, - {"SO_REUSEADDR", Const, 0}, - {"SO_REUSEPORT", Const, 0}, - {"SO_REUSESHAREUID", Const, 0}, - {"SO_RTABLE", Const, 1}, - {"SO_RXQ_OVFL", Const, 0}, - {"SO_SECURITY_AUTHENTICATION", Const, 0}, - {"SO_SECURITY_ENCRYPTION_NETWORK", Const, 0}, - {"SO_SECURITY_ENCRYPTION_TRANSPORT", Const, 0}, - {"SO_SETFIB", Const, 0}, - {"SO_SNDBUF", Const, 0}, - {"SO_SNDBUFFORCE", Const, 0}, - {"SO_SNDLOWAT", Const, 0}, - {"SO_SNDTIMEO", Const, 0}, - {"SO_SPLICE", Const, 1}, - {"SO_TIMESTAMP", Const, 0}, - {"SO_TIMESTAMPING", Const, 0}, - {"SO_TIMESTAMPNS", Const, 0}, - {"SO_TIMESTAMP_MONOTONIC", Const, 0}, - {"SO_TYPE", Const, 0}, - {"SO_UPCALLCLOSEWAIT", Const, 0}, - {"SO_UPDATE_ACCEPT_CONTEXT", Const, 0}, - {"SO_UPDATE_CONNECT_CONTEXT", Const, 1}, - {"SO_USELOOPBACK", Const, 0}, - {"SO_USER_COOKIE", Const, 1}, - {"SO_VENDOR", Const, 3}, - {"SO_WANTMORE", Const, 0}, - {"SO_WANTOOBFLAG", Const, 0}, - {"SSLExtraCertChainPolicyPara", Type, 0}, - {"SSLExtraCertChainPolicyPara.AuthType", Field, 0}, - {"SSLExtraCertChainPolicyPara.Checks", Field, 0}, - {"SSLExtraCertChainPolicyPara.ServerName", Field, 0}, - {"SSLExtraCertChainPolicyPara.Size", Field, 0}, - {"STANDARD_RIGHTS_ALL", Const, 0}, - {"STANDARD_RIGHTS_EXECUTE", Const, 0}, - {"STANDARD_RIGHTS_READ", Const, 0}, - {"STANDARD_RIGHTS_REQUIRED", Const, 0}, - {"STANDARD_RIGHTS_WRITE", Const, 0}, - {"STARTF_USESHOWWINDOW", Const, 0}, - {"STARTF_USESTDHANDLES", Const, 0}, - {"STD_ERROR_HANDLE", Const, 0}, - {"STD_INPUT_HANDLE", Const, 0}, - {"STD_OUTPUT_HANDLE", Const, 0}, - {"SUBLANG_ENGLISH_US", Const, 0}, - {"SW_FORCEMINIMIZE", Const, 0}, - {"SW_HIDE", Const, 0}, - {"SW_MAXIMIZE", Const, 0}, - {"SW_MINIMIZE", Const, 0}, - {"SW_NORMAL", Const, 0}, - {"SW_RESTORE", Const, 0}, - {"SW_SHOW", Const, 0}, - {"SW_SHOWDEFAULT", Const, 0}, - {"SW_SHOWMAXIMIZED", Const, 0}, - {"SW_SHOWMINIMIZED", Const, 0}, - {"SW_SHOWMINNOACTIVE", Const, 0}, - {"SW_SHOWNA", Const, 0}, - {"SW_SHOWNOACTIVATE", Const, 0}, - {"SW_SHOWNORMAL", Const, 0}, - {"SYMBOLIC_LINK_FLAG_DIRECTORY", Const, 4}, - {"SYNCHRONIZE", Const, 0}, - {"SYSCTL_VERSION", Const, 1}, - {"SYSCTL_VERS_0", Const, 1}, - {"SYSCTL_VERS_1", Const, 1}, - {"SYSCTL_VERS_MASK", Const, 1}, - {"SYS_ABORT2", Const, 0}, - {"SYS_ACCEPT", Const, 0}, - {"SYS_ACCEPT4", Const, 0}, - {"SYS_ACCEPT_NOCANCEL", Const, 0}, - {"SYS_ACCESS", Const, 0}, - {"SYS_ACCESS_EXTENDED", Const, 0}, - {"SYS_ACCT", Const, 0}, - {"SYS_ADD_KEY", Const, 0}, - {"SYS_ADD_PROFIL", Const, 0}, - {"SYS_ADJFREQ", Const, 1}, - {"SYS_ADJTIME", Const, 0}, - {"SYS_ADJTIMEX", Const, 0}, - {"SYS_AFS_SYSCALL", Const, 0}, - {"SYS_AIO_CANCEL", Const, 0}, - {"SYS_AIO_ERROR", Const, 0}, - {"SYS_AIO_FSYNC", Const, 0}, - {"SYS_AIO_MLOCK", Const, 14}, - {"SYS_AIO_READ", Const, 0}, - {"SYS_AIO_RETURN", Const, 0}, - {"SYS_AIO_SUSPEND", Const, 0}, - {"SYS_AIO_SUSPEND_NOCANCEL", Const, 0}, - {"SYS_AIO_WAITCOMPLETE", Const, 14}, - {"SYS_AIO_WRITE", Const, 0}, - {"SYS_ALARM", Const, 0}, - {"SYS_ARCH_PRCTL", Const, 0}, - {"SYS_ARM_FADVISE64_64", Const, 0}, - {"SYS_ARM_SYNC_FILE_RANGE", Const, 0}, - {"SYS_ATGETMSG", Const, 0}, - {"SYS_ATPGETREQ", Const, 0}, - {"SYS_ATPGETRSP", Const, 0}, - {"SYS_ATPSNDREQ", Const, 0}, - {"SYS_ATPSNDRSP", Const, 0}, - {"SYS_ATPUTMSG", Const, 0}, - {"SYS_ATSOCKET", Const, 0}, - {"SYS_AUDIT", Const, 0}, - {"SYS_AUDITCTL", Const, 0}, - {"SYS_AUDITON", Const, 0}, - {"SYS_AUDIT_SESSION_JOIN", Const, 0}, - {"SYS_AUDIT_SESSION_PORT", Const, 0}, - {"SYS_AUDIT_SESSION_SELF", Const, 0}, - {"SYS_BDFLUSH", Const, 0}, - {"SYS_BIND", Const, 0}, - {"SYS_BINDAT", Const, 3}, - {"SYS_BREAK", Const, 0}, - {"SYS_BRK", Const, 0}, - {"SYS_BSDTHREAD_CREATE", Const, 0}, - {"SYS_BSDTHREAD_REGISTER", Const, 0}, - {"SYS_BSDTHREAD_TERMINATE", Const, 0}, - {"SYS_CAPGET", Const, 0}, - {"SYS_CAPSET", Const, 0}, - {"SYS_CAP_ENTER", Const, 0}, - {"SYS_CAP_FCNTLS_GET", Const, 1}, - {"SYS_CAP_FCNTLS_LIMIT", Const, 1}, - {"SYS_CAP_GETMODE", Const, 0}, - {"SYS_CAP_GETRIGHTS", Const, 0}, - {"SYS_CAP_IOCTLS_GET", Const, 1}, - {"SYS_CAP_IOCTLS_LIMIT", Const, 1}, - {"SYS_CAP_NEW", Const, 0}, - {"SYS_CAP_RIGHTS_GET", Const, 1}, - {"SYS_CAP_RIGHTS_LIMIT", Const, 1}, - {"SYS_CHDIR", Const, 0}, - {"SYS_CHFLAGS", Const, 0}, - {"SYS_CHFLAGSAT", Const, 3}, - {"SYS_CHMOD", Const, 0}, - {"SYS_CHMOD_EXTENDED", Const, 0}, - {"SYS_CHOWN", Const, 0}, - {"SYS_CHOWN32", Const, 0}, - {"SYS_CHROOT", Const, 0}, - {"SYS_CHUD", Const, 0}, - {"SYS_CLOCK_ADJTIME", Const, 0}, - {"SYS_CLOCK_GETCPUCLOCKID2", Const, 1}, - {"SYS_CLOCK_GETRES", Const, 0}, - {"SYS_CLOCK_GETTIME", Const, 0}, - {"SYS_CLOCK_NANOSLEEP", Const, 0}, - {"SYS_CLOCK_SETTIME", Const, 0}, - {"SYS_CLONE", Const, 0}, - {"SYS_CLOSE", Const, 0}, - {"SYS_CLOSEFROM", Const, 0}, - {"SYS_CLOSE_NOCANCEL", Const, 0}, - {"SYS_CONNECT", Const, 0}, - {"SYS_CONNECTAT", Const, 3}, - {"SYS_CONNECT_NOCANCEL", Const, 0}, - {"SYS_COPYFILE", Const, 0}, - {"SYS_CPUSET", Const, 0}, - {"SYS_CPUSET_GETAFFINITY", Const, 0}, - {"SYS_CPUSET_GETID", Const, 0}, - {"SYS_CPUSET_SETAFFINITY", Const, 0}, - {"SYS_CPUSET_SETID", Const, 0}, - {"SYS_CREAT", Const, 0}, - {"SYS_CREATE_MODULE", Const, 0}, - {"SYS_CSOPS", Const, 0}, - {"SYS_CSOPS_AUDITTOKEN", Const, 16}, - {"SYS_DELETE", Const, 0}, - {"SYS_DELETE_MODULE", Const, 0}, - {"SYS_DUP", Const, 0}, - {"SYS_DUP2", Const, 0}, - {"SYS_DUP3", Const, 0}, - {"SYS_EACCESS", Const, 0}, - {"SYS_EPOLL_CREATE", Const, 0}, - {"SYS_EPOLL_CREATE1", Const, 0}, - {"SYS_EPOLL_CTL", Const, 0}, - {"SYS_EPOLL_CTL_OLD", Const, 0}, - {"SYS_EPOLL_PWAIT", Const, 0}, - {"SYS_EPOLL_WAIT", Const, 0}, - {"SYS_EPOLL_WAIT_OLD", Const, 0}, - {"SYS_EVENTFD", Const, 0}, - {"SYS_EVENTFD2", Const, 0}, - {"SYS_EXCHANGEDATA", Const, 0}, - {"SYS_EXECVE", Const, 0}, - {"SYS_EXIT", Const, 0}, - {"SYS_EXIT_GROUP", Const, 0}, - {"SYS_EXTATTRCTL", Const, 0}, - {"SYS_EXTATTR_DELETE_FD", Const, 0}, - {"SYS_EXTATTR_DELETE_FILE", Const, 0}, - {"SYS_EXTATTR_DELETE_LINK", Const, 0}, - {"SYS_EXTATTR_GET_FD", Const, 0}, - {"SYS_EXTATTR_GET_FILE", Const, 0}, - {"SYS_EXTATTR_GET_LINK", Const, 0}, - {"SYS_EXTATTR_LIST_FD", Const, 0}, - {"SYS_EXTATTR_LIST_FILE", Const, 0}, - {"SYS_EXTATTR_LIST_LINK", Const, 0}, - {"SYS_EXTATTR_SET_FD", Const, 0}, - {"SYS_EXTATTR_SET_FILE", Const, 0}, - {"SYS_EXTATTR_SET_LINK", Const, 0}, - {"SYS_FACCESSAT", Const, 0}, - {"SYS_FADVISE64", Const, 0}, - {"SYS_FADVISE64_64", Const, 0}, - {"SYS_FALLOCATE", Const, 0}, - {"SYS_FANOTIFY_INIT", Const, 0}, - {"SYS_FANOTIFY_MARK", Const, 0}, - {"SYS_FCHDIR", Const, 0}, - {"SYS_FCHFLAGS", Const, 0}, - {"SYS_FCHMOD", Const, 0}, - {"SYS_FCHMODAT", Const, 0}, - {"SYS_FCHMOD_EXTENDED", Const, 0}, - {"SYS_FCHOWN", Const, 0}, - {"SYS_FCHOWN32", Const, 0}, - {"SYS_FCHOWNAT", Const, 0}, - {"SYS_FCHROOT", Const, 1}, - {"SYS_FCNTL", Const, 0}, - {"SYS_FCNTL64", Const, 0}, - {"SYS_FCNTL_NOCANCEL", Const, 0}, - {"SYS_FDATASYNC", Const, 0}, - {"SYS_FEXECVE", Const, 0}, - {"SYS_FFCLOCK_GETCOUNTER", Const, 0}, - {"SYS_FFCLOCK_GETESTIMATE", Const, 0}, - {"SYS_FFCLOCK_SETESTIMATE", Const, 0}, - {"SYS_FFSCTL", Const, 0}, - {"SYS_FGETATTRLIST", Const, 0}, - {"SYS_FGETXATTR", Const, 0}, - {"SYS_FHOPEN", Const, 0}, - {"SYS_FHSTAT", Const, 0}, - {"SYS_FHSTATFS", Const, 0}, - {"SYS_FILEPORT_MAKEFD", Const, 0}, - {"SYS_FILEPORT_MAKEPORT", Const, 0}, - {"SYS_FKTRACE", Const, 1}, - {"SYS_FLISTXATTR", Const, 0}, - {"SYS_FLOCK", Const, 0}, - {"SYS_FORK", Const, 0}, - {"SYS_FPATHCONF", Const, 0}, - {"SYS_FREEBSD6_FTRUNCATE", Const, 0}, - {"SYS_FREEBSD6_LSEEK", Const, 0}, - {"SYS_FREEBSD6_MMAP", Const, 0}, - {"SYS_FREEBSD6_PREAD", Const, 0}, - {"SYS_FREEBSD6_PWRITE", Const, 0}, - {"SYS_FREEBSD6_TRUNCATE", Const, 0}, - {"SYS_FREMOVEXATTR", Const, 0}, - {"SYS_FSCTL", Const, 0}, - {"SYS_FSETATTRLIST", Const, 0}, - {"SYS_FSETXATTR", Const, 0}, - {"SYS_FSGETPATH", Const, 0}, - {"SYS_FSTAT", Const, 0}, - {"SYS_FSTAT64", Const, 0}, - {"SYS_FSTAT64_EXTENDED", Const, 0}, - {"SYS_FSTATAT", Const, 0}, - {"SYS_FSTATAT64", Const, 0}, - {"SYS_FSTATFS", Const, 0}, - {"SYS_FSTATFS64", Const, 0}, - {"SYS_FSTATV", Const, 0}, - {"SYS_FSTATVFS1", Const, 1}, - {"SYS_FSTAT_EXTENDED", Const, 0}, - {"SYS_FSYNC", Const, 0}, - {"SYS_FSYNC_NOCANCEL", Const, 0}, - {"SYS_FSYNC_RANGE", Const, 1}, - {"SYS_FTIME", Const, 0}, - {"SYS_FTRUNCATE", Const, 0}, - {"SYS_FTRUNCATE64", Const, 0}, - {"SYS_FUTEX", Const, 0}, - {"SYS_FUTIMENS", Const, 1}, - {"SYS_FUTIMES", Const, 0}, - {"SYS_FUTIMESAT", Const, 0}, - {"SYS_GETATTRLIST", Const, 0}, - {"SYS_GETAUDIT", Const, 0}, - {"SYS_GETAUDIT_ADDR", Const, 0}, - {"SYS_GETAUID", Const, 0}, - {"SYS_GETCONTEXT", Const, 0}, - {"SYS_GETCPU", Const, 0}, - {"SYS_GETCWD", Const, 0}, - {"SYS_GETDENTS", Const, 0}, - {"SYS_GETDENTS64", Const, 0}, - {"SYS_GETDIRENTRIES", Const, 0}, - {"SYS_GETDIRENTRIES64", Const, 0}, - {"SYS_GETDIRENTRIESATTR", Const, 0}, - {"SYS_GETDTABLECOUNT", Const, 1}, - {"SYS_GETDTABLESIZE", Const, 0}, - {"SYS_GETEGID", Const, 0}, - {"SYS_GETEGID32", Const, 0}, - {"SYS_GETEUID", Const, 0}, - {"SYS_GETEUID32", Const, 0}, - {"SYS_GETFH", Const, 0}, - {"SYS_GETFSSTAT", Const, 0}, - {"SYS_GETFSSTAT64", Const, 0}, - {"SYS_GETGID", Const, 0}, - {"SYS_GETGID32", Const, 0}, - {"SYS_GETGROUPS", Const, 0}, - {"SYS_GETGROUPS32", Const, 0}, - {"SYS_GETHOSTUUID", Const, 0}, - {"SYS_GETITIMER", Const, 0}, - {"SYS_GETLCID", Const, 0}, - {"SYS_GETLOGIN", Const, 0}, - {"SYS_GETLOGINCLASS", Const, 0}, - {"SYS_GETPEERNAME", Const, 0}, - {"SYS_GETPGID", Const, 0}, - {"SYS_GETPGRP", Const, 0}, - {"SYS_GETPID", Const, 0}, - {"SYS_GETPMSG", Const, 0}, - {"SYS_GETPPID", Const, 0}, - {"SYS_GETPRIORITY", Const, 0}, - {"SYS_GETRESGID", Const, 0}, - {"SYS_GETRESGID32", Const, 0}, - {"SYS_GETRESUID", Const, 0}, - {"SYS_GETRESUID32", Const, 0}, - {"SYS_GETRLIMIT", Const, 0}, - {"SYS_GETRTABLE", Const, 1}, - {"SYS_GETRUSAGE", Const, 0}, - {"SYS_GETSGROUPS", Const, 0}, - {"SYS_GETSID", Const, 0}, - {"SYS_GETSOCKNAME", Const, 0}, - {"SYS_GETSOCKOPT", Const, 0}, - {"SYS_GETTHRID", Const, 1}, - {"SYS_GETTID", Const, 0}, - {"SYS_GETTIMEOFDAY", Const, 0}, - {"SYS_GETUID", Const, 0}, - {"SYS_GETUID32", Const, 0}, - {"SYS_GETVFSSTAT", Const, 1}, - {"SYS_GETWGROUPS", Const, 0}, - {"SYS_GETXATTR", Const, 0}, - {"SYS_GET_KERNEL_SYMS", Const, 0}, - {"SYS_GET_MEMPOLICY", Const, 0}, - {"SYS_GET_ROBUST_LIST", Const, 0}, - {"SYS_GET_THREAD_AREA", Const, 0}, - {"SYS_GSSD_SYSCALL", Const, 14}, - {"SYS_GTTY", Const, 0}, - {"SYS_IDENTITYSVC", Const, 0}, - {"SYS_IDLE", Const, 0}, - {"SYS_INITGROUPS", Const, 0}, - {"SYS_INIT_MODULE", Const, 0}, - {"SYS_INOTIFY_ADD_WATCH", Const, 0}, - {"SYS_INOTIFY_INIT", Const, 0}, - {"SYS_INOTIFY_INIT1", Const, 0}, - {"SYS_INOTIFY_RM_WATCH", Const, 0}, - {"SYS_IOCTL", Const, 0}, - {"SYS_IOPERM", Const, 0}, - {"SYS_IOPL", Const, 0}, - {"SYS_IOPOLICYSYS", Const, 0}, - {"SYS_IOPRIO_GET", Const, 0}, - {"SYS_IOPRIO_SET", Const, 0}, - {"SYS_IO_CANCEL", Const, 0}, - {"SYS_IO_DESTROY", Const, 0}, - {"SYS_IO_GETEVENTS", Const, 0}, - {"SYS_IO_SETUP", Const, 0}, - {"SYS_IO_SUBMIT", Const, 0}, - {"SYS_IPC", Const, 0}, - {"SYS_ISSETUGID", Const, 0}, - {"SYS_JAIL", Const, 0}, - {"SYS_JAIL_ATTACH", Const, 0}, - {"SYS_JAIL_GET", Const, 0}, - {"SYS_JAIL_REMOVE", Const, 0}, - {"SYS_JAIL_SET", Const, 0}, - {"SYS_KAS_INFO", Const, 16}, - {"SYS_KDEBUG_TRACE", Const, 0}, - {"SYS_KENV", Const, 0}, - {"SYS_KEVENT", Const, 0}, - {"SYS_KEVENT64", Const, 0}, - {"SYS_KEXEC_LOAD", Const, 0}, - {"SYS_KEYCTL", Const, 0}, - {"SYS_KILL", Const, 0}, - {"SYS_KLDFIND", Const, 0}, - {"SYS_KLDFIRSTMOD", Const, 0}, - {"SYS_KLDLOAD", Const, 0}, - {"SYS_KLDNEXT", Const, 0}, - {"SYS_KLDSTAT", Const, 0}, - {"SYS_KLDSYM", Const, 0}, - {"SYS_KLDUNLOAD", Const, 0}, - {"SYS_KLDUNLOADF", Const, 0}, - {"SYS_KMQ_NOTIFY", Const, 14}, - {"SYS_KMQ_OPEN", Const, 14}, - {"SYS_KMQ_SETATTR", Const, 14}, - {"SYS_KMQ_TIMEDRECEIVE", Const, 14}, - {"SYS_KMQ_TIMEDSEND", Const, 14}, - {"SYS_KMQ_UNLINK", Const, 14}, - {"SYS_KQUEUE", Const, 0}, - {"SYS_KQUEUE1", Const, 1}, - {"SYS_KSEM_CLOSE", Const, 14}, - {"SYS_KSEM_DESTROY", Const, 14}, - {"SYS_KSEM_GETVALUE", Const, 14}, - {"SYS_KSEM_INIT", Const, 14}, - {"SYS_KSEM_OPEN", Const, 14}, - {"SYS_KSEM_POST", Const, 14}, - {"SYS_KSEM_TIMEDWAIT", Const, 14}, - {"SYS_KSEM_TRYWAIT", Const, 14}, - {"SYS_KSEM_UNLINK", Const, 14}, - {"SYS_KSEM_WAIT", Const, 14}, - {"SYS_KTIMER_CREATE", Const, 0}, - {"SYS_KTIMER_DELETE", Const, 0}, - {"SYS_KTIMER_GETOVERRUN", Const, 0}, - {"SYS_KTIMER_GETTIME", Const, 0}, - {"SYS_KTIMER_SETTIME", Const, 0}, - {"SYS_KTRACE", Const, 0}, - {"SYS_LCHFLAGS", Const, 0}, - {"SYS_LCHMOD", Const, 0}, - {"SYS_LCHOWN", Const, 0}, - {"SYS_LCHOWN32", Const, 0}, - {"SYS_LEDGER", Const, 16}, - {"SYS_LGETFH", Const, 0}, - {"SYS_LGETXATTR", Const, 0}, - {"SYS_LINK", Const, 0}, - {"SYS_LINKAT", Const, 0}, - {"SYS_LIO_LISTIO", Const, 0}, - {"SYS_LISTEN", Const, 0}, - {"SYS_LISTXATTR", Const, 0}, - {"SYS_LLISTXATTR", Const, 0}, - {"SYS_LOCK", Const, 0}, - {"SYS_LOOKUP_DCOOKIE", Const, 0}, - {"SYS_LPATHCONF", Const, 0}, - {"SYS_LREMOVEXATTR", Const, 0}, - {"SYS_LSEEK", Const, 0}, - {"SYS_LSETXATTR", Const, 0}, - {"SYS_LSTAT", Const, 0}, - {"SYS_LSTAT64", Const, 0}, - {"SYS_LSTAT64_EXTENDED", Const, 0}, - {"SYS_LSTATV", Const, 0}, - {"SYS_LSTAT_EXTENDED", Const, 0}, - {"SYS_LUTIMES", Const, 0}, - {"SYS_MAC_SYSCALL", Const, 0}, - {"SYS_MADVISE", Const, 0}, - {"SYS_MADVISE1", Const, 0}, - {"SYS_MAXSYSCALL", Const, 0}, - {"SYS_MBIND", Const, 0}, - {"SYS_MIGRATE_PAGES", Const, 0}, - {"SYS_MINCORE", Const, 0}, - {"SYS_MINHERIT", Const, 0}, - {"SYS_MKCOMPLEX", Const, 0}, - {"SYS_MKDIR", Const, 0}, - {"SYS_MKDIRAT", Const, 0}, - {"SYS_MKDIR_EXTENDED", Const, 0}, - {"SYS_MKFIFO", Const, 0}, - {"SYS_MKFIFOAT", Const, 0}, - {"SYS_MKFIFO_EXTENDED", Const, 0}, - {"SYS_MKNOD", Const, 0}, - {"SYS_MKNODAT", Const, 0}, - {"SYS_MLOCK", Const, 0}, - {"SYS_MLOCKALL", Const, 0}, - {"SYS_MMAP", Const, 0}, - {"SYS_MMAP2", Const, 0}, - {"SYS_MODCTL", Const, 1}, - {"SYS_MODFIND", Const, 0}, - {"SYS_MODFNEXT", Const, 0}, - {"SYS_MODIFY_LDT", Const, 0}, - {"SYS_MODNEXT", Const, 0}, - {"SYS_MODSTAT", Const, 0}, - {"SYS_MODWATCH", Const, 0}, - {"SYS_MOUNT", Const, 0}, - {"SYS_MOVE_PAGES", Const, 0}, - {"SYS_MPROTECT", Const, 0}, - {"SYS_MPX", Const, 0}, - {"SYS_MQUERY", Const, 1}, - {"SYS_MQ_GETSETATTR", Const, 0}, - {"SYS_MQ_NOTIFY", Const, 0}, - {"SYS_MQ_OPEN", Const, 0}, - {"SYS_MQ_TIMEDRECEIVE", Const, 0}, - {"SYS_MQ_TIMEDSEND", Const, 0}, - {"SYS_MQ_UNLINK", Const, 0}, - {"SYS_MREMAP", Const, 0}, - {"SYS_MSGCTL", Const, 0}, - {"SYS_MSGGET", Const, 0}, - {"SYS_MSGRCV", Const, 0}, - {"SYS_MSGRCV_NOCANCEL", Const, 0}, - {"SYS_MSGSND", Const, 0}, - {"SYS_MSGSND_NOCANCEL", Const, 0}, - {"SYS_MSGSYS", Const, 0}, - {"SYS_MSYNC", Const, 0}, - {"SYS_MSYNC_NOCANCEL", Const, 0}, - {"SYS_MUNLOCK", Const, 0}, - {"SYS_MUNLOCKALL", Const, 0}, - {"SYS_MUNMAP", Const, 0}, - {"SYS_NAME_TO_HANDLE_AT", Const, 0}, - {"SYS_NANOSLEEP", Const, 0}, - {"SYS_NEWFSTATAT", Const, 0}, - {"SYS_NFSCLNT", Const, 0}, - {"SYS_NFSSERVCTL", Const, 0}, - {"SYS_NFSSVC", Const, 0}, - {"SYS_NFSTAT", Const, 0}, - {"SYS_NICE", Const, 0}, - {"SYS_NLM_SYSCALL", Const, 14}, - {"SYS_NLSTAT", Const, 0}, - {"SYS_NMOUNT", Const, 0}, - {"SYS_NSTAT", Const, 0}, - {"SYS_NTP_ADJTIME", Const, 0}, - {"SYS_NTP_GETTIME", Const, 0}, - {"SYS_NUMA_GETAFFINITY", Const, 14}, - {"SYS_NUMA_SETAFFINITY", Const, 14}, - {"SYS_OABI_SYSCALL_BASE", Const, 0}, - {"SYS_OBREAK", Const, 0}, - {"SYS_OLDFSTAT", Const, 0}, - {"SYS_OLDLSTAT", Const, 0}, - {"SYS_OLDOLDUNAME", Const, 0}, - {"SYS_OLDSTAT", Const, 0}, - {"SYS_OLDUNAME", Const, 0}, - {"SYS_OPEN", Const, 0}, - {"SYS_OPENAT", Const, 0}, - {"SYS_OPENBSD_POLL", Const, 0}, - {"SYS_OPEN_BY_HANDLE_AT", Const, 0}, - {"SYS_OPEN_DPROTECTED_NP", Const, 16}, - {"SYS_OPEN_EXTENDED", Const, 0}, - {"SYS_OPEN_NOCANCEL", Const, 0}, - {"SYS_OVADVISE", Const, 0}, - {"SYS_PACCEPT", Const, 1}, - {"SYS_PATHCONF", Const, 0}, - {"SYS_PAUSE", Const, 0}, - {"SYS_PCICONFIG_IOBASE", Const, 0}, - {"SYS_PCICONFIG_READ", Const, 0}, - {"SYS_PCICONFIG_WRITE", Const, 0}, - {"SYS_PDFORK", Const, 0}, - {"SYS_PDGETPID", Const, 0}, - {"SYS_PDKILL", Const, 0}, - {"SYS_PERF_EVENT_OPEN", Const, 0}, - {"SYS_PERSONALITY", Const, 0}, - {"SYS_PID_HIBERNATE", Const, 0}, - {"SYS_PID_RESUME", Const, 0}, - {"SYS_PID_SHUTDOWN_SOCKETS", Const, 0}, - {"SYS_PID_SUSPEND", Const, 0}, - {"SYS_PIPE", Const, 0}, - {"SYS_PIPE2", Const, 0}, - {"SYS_PIVOT_ROOT", Const, 0}, - {"SYS_PMC_CONTROL", Const, 1}, - {"SYS_PMC_GET_INFO", Const, 1}, - {"SYS_POLL", Const, 0}, - {"SYS_POLLTS", Const, 1}, - {"SYS_POLL_NOCANCEL", Const, 0}, - {"SYS_POSIX_FADVISE", Const, 0}, - {"SYS_POSIX_FALLOCATE", Const, 0}, - {"SYS_POSIX_OPENPT", Const, 0}, - {"SYS_POSIX_SPAWN", Const, 0}, - {"SYS_PPOLL", Const, 0}, - {"SYS_PRCTL", Const, 0}, - {"SYS_PREAD", Const, 0}, - {"SYS_PREAD64", Const, 0}, - {"SYS_PREADV", Const, 0}, - {"SYS_PREAD_NOCANCEL", Const, 0}, - {"SYS_PRLIMIT64", Const, 0}, - {"SYS_PROCCTL", Const, 3}, - {"SYS_PROCESS_POLICY", Const, 0}, - {"SYS_PROCESS_VM_READV", Const, 0}, - {"SYS_PROCESS_VM_WRITEV", Const, 0}, - {"SYS_PROC_INFO", Const, 0}, - {"SYS_PROF", Const, 0}, - {"SYS_PROFIL", Const, 0}, - {"SYS_PSELECT", Const, 0}, - {"SYS_PSELECT6", Const, 0}, - {"SYS_PSET_ASSIGN", Const, 1}, - {"SYS_PSET_CREATE", Const, 1}, - {"SYS_PSET_DESTROY", Const, 1}, - {"SYS_PSYNCH_CVBROAD", Const, 0}, - {"SYS_PSYNCH_CVCLRPREPOST", Const, 0}, - {"SYS_PSYNCH_CVSIGNAL", Const, 0}, - {"SYS_PSYNCH_CVWAIT", Const, 0}, - {"SYS_PSYNCH_MUTEXDROP", Const, 0}, - {"SYS_PSYNCH_MUTEXWAIT", Const, 0}, - {"SYS_PSYNCH_RW_DOWNGRADE", Const, 0}, - {"SYS_PSYNCH_RW_LONGRDLOCK", Const, 0}, - {"SYS_PSYNCH_RW_RDLOCK", Const, 0}, - {"SYS_PSYNCH_RW_UNLOCK", Const, 0}, - {"SYS_PSYNCH_RW_UNLOCK2", Const, 0}, - {"SYS_PSYNCH_RW_UPGRADE", Const, 0}, - {"SYS_PSYNCH_RW_WRLOCK", Const, 0}, - {"SYS_PSYNCH_RW_YIELDWRLOCK", Const, 0}, - {"SYS_PTRACE", Const, 0}, - {"SYS_PUTPMSG", Const, 0}, - {"SYS_PWRITE", Const, 0}, - {"SYS_PWRITE64", Const, 0}, - {"SYS_PWRITEV", Const, 0}, - {"SYS_PWRITE_NOCANCEL", Const, 0}, - {"SYS_QUERY_MODULE", Const, 0}, - {"SYS_QUOTACTL", Const, 0}, - {"SYS_RASCTL", Const, 1}, - {"SYS_RCTL_ADD_RULE", Const, 0}, - {"SYS_RCTL_GET_LIMITS", Const, 0}, - {"SYS_RCTL_GET_RACCT", Const, 0}, - {"SYS_RCTL_GET_RULES", Const, 0}, - {"SYS_RCTL_REMOVE_RULE", Const, 0}, - {"SYS_READ", Const, 0}, - {"SYS_READAHEAD", Const, 0}, - {"SYS_READDIR", Const, 0}, - {"SYS_READLINK", Const, 0}, - {"SYS_READLINKAT", Const, 0}, - {"SYS_READV", Const, 0}, - {"SYS_READV_NOCANCEL", Const, 0}, - {"SYS_READ_NOCANCEL", Const, 0}, - {"SYS_REBOOT", Const, 0}, - {"SYS_RECV", Const, 0}, - {"SYS_RECVFROM", Const, 0}, - {"SYS_RECVFROM_NOCANCEL", Const, 0}, - {"SYS_RECVMMSG", Const, 0}, - {"SYS_RECVMSG", Const, 0}, - {"SYS_RECVMSG_NOCANCEL", Const, 0}, - {"SYS_REMAP_FILE_PAGES", Const, 0}, - {"SYS_REMOVEXATTR", Const, 0}, - {"SYS_RENAME", Const, 0}, - {"SYS_RENAMEAT", Const, 0}, - {"SYS_REQUEST_KEY", Const, 0}, - {"SYS_RESTART_SYSCALL", Const, 0}, - {"SYS_REVOKE", Const, 0}, - {"SYS_RFORK", Const, 0}, - {"SYS_RMDIR", Const, 0}, - {"SYS_RTPRIO", Const, 0}, - {"SYS_RTPRIO_THREAD", Const, 0}, - {"SYS_RT_SIGACTION", Const, 0}, - {"SYS_RT_SIGPENDING", Const, 0}, - {"SYS_RT_SIGPROCMASK", Const, 0}, - {"SYS_RT_SIGQUEUEINFO", Const, 0}, - {"SYS_RT_SIGRETURN", Const, 0}, - {"SYS_RT_SIGSUSPEND", Const, 0}, - {"SYS_RT_SIGTIMEDWAIT", Const, 0}, - {"SYS_RT_TGSIGQUEUEINFO", Const, 0}, - {"SYS_SBRK", Const, 0}, - {"SYS_SCHED_GETAFFINITY", Const, 0}, - {"SYS_SCHED_GETPARAM", Const, 0}, - {"SYS_SCHED_GETSCHEDULER", Const, 0}, - {"SYS_SCHED_GET_PRIORITY_MAX", Const, 0}, - {"SYS_SCHED_GET_PRIORITY_MIN", Const, 0}, - {"SYS_SCHED_RR_GET_INTERVAL", Const, 0}, - {"SYS_SCHED_SETAFFINITY", Const, 0}, - {"SYS_SCHED_SETPARAM", Const, 0}, - {"SYS_SCHED_SETSCHEDULER", Const, 0}, - {"SYS_SCHED_YIELD", Const, 0}, - {"SYS_SCTP_GENERIC_RECVMSG", Const, 0}, - {"SYS_SCTP_GENERIC_SENDMSG", Const, 0}, - {"SYS_SCTP_GENERIC_SENDMSG_IOV", Const, 0}, - {"SYS_SCTP_PEELOFF", Const, 0}, - {"SYS_SEARCHFS", Const, 0}, - {"SYS_SECURITY", Const, 0}, - {"SYS_SELECT", Const, 0}, - {"SYS_SELECT_NOCANCEL", Const, 0}, - {"SYS_SEMCONFIG", Const, 1}, - {"SYS_SEMCTL", Const, 0}, - {"SYS_SEMGET", Const, 0}, - {"SYS_SEMOP", Const, 0}, - {"SYS_SEMSYS", Const, 0}, - {"SYS_SEMTIMEDOP", Const, 0}, - {"SYS_SEM_CLOSE", Const, 0}, - {"SYS_SEM_DESTROY", Const, 0}, - {"SYS_SEM_GETVALUE", Const, 0}, - {"SYS_SEM_INIT", Const, 0}, - {"SYS_SEM_OPEN", Const, 0}, - {"SYS_SEM_POST", Const, 0}, - {"SYS_SEM_TRYWAIT", Const, 0}, - {"SYS_SEM_UNLINK", Const, 0}, - {"SYS_SEM_WAIT", Const, 0}, - {"SYS_SEM_WAIT_NOCANCEL", Const, 0}, - {"SYS_SEND", Const, 0}, - {"SYS_SENDFILE", Const, 0}, - {"SYS_SENDFILE64", Const, 0}, - {"SYS_SENDMMSG", Const, 0}, - {"SYS_SENDMSG", Const, 0}, - {"SYS_SENDMSG_NOCANCEL", Const, 0}, - {"SYS_SENDTO", Const, 0}, - {"SYS_SENDTO_NOCANCEL", Const, 0}, - {"SYS_SETATTRLIST", Const, 0}, - {"SYS_SETAUDIT", Const, 0}, - {"SYS_SETAUDIT_ADDR", Const, 0}, - {"SYS_SETAUID", Const, 0}, - {"SYS_SETCONTEXT", Const, 0}, - {"SYS_SETDOMAINNAME", Const, 0}, - {"SYS_SETEGID", Const, 0}, - {"SYS_SETEUID", Const, 0}, - {"SYS_SETFIB", Const, 0}, - {"SYS_SETFSGID", Const, 0}, - {"SYS_SETFSGID32", Const, 0}, - {"SYS_SETFSUID", Const, 0}, - {"SYS_SETFSUID32", Const, 0}, - {"SYS_SETGID", Const, 0}, - {"SYS_SETGID32", Const, 0}, - {"SYS_SETGROUPS", Const, 0}, - {"SYS_SETGROUPS32", Const, 0}, - {"SYS_SETHOSTNAME", Const, 0}, - {"SYS_SETITIMER", Const, 0}, - {"SYS_SETLCID", Const, 0}, - {"SYS_SETLOGIN", Const, 0}, - {"SYS_SETLOGINCLASS", Const, 0}, - {"SYS_SETNS", Const, 0}, - {"SYS_SETPGID", Const, 0}, - {"SYS_SETPRIORITY", Const, 0}, - {"SYS_SETPRIVEXEC", Const, 0}, - {"SYS_SETREGID", Const, 0}, - {"SYS_SETREGID32", Const, 0}, - {"SYS_SETRESGID", Const, 0}, - {"SYS_SETRESGID32", Const, 0}, - {"SYS_SETRESUID", Const, 0}, - {"SYS_SETRESUID32", Const, 0}, - {"SYS_SETREUID", Const, 0}, - {"SYS_SETREUID32", Const, 0}, - {"SYS_SETRLIMIT", Const, 0}, - {"SYS_SETRTABLE", Const, 1}, - {"SYS_SETSGROUPS", Const, 0}, - {"SYS_SETSID", Const, 0}, - {"SYS_SETSOCKOPT", Const, 0}, - {"SYS_SETTID", Const, 0}, - {"SYS_SETTID_WITH_PID", Const, 0}, - {"SYS_SETTIMEOFDAY", Const, 0}, - {"SYS_SETUID", Const, 0}, - {"SYS_SETUID32", Const, 0}, - {"SYS_SETWGROUPS", Const, 0}, - {"SYS_SETXATTR", Const, 0}, - {"SYS_SET_MEMPOLICY", Const, 0}, - {"SYS_SET_ROBUST_LIST", Const, 0}, - {"SYS_SET_THREAD_AREA", Const, 0}, - {"SYS_SET_TID_ADDRESS", Const, 0}, - {"SYS_SGETMASK", Const, 0}, - {"SYS_SHARED_REGION_CHECK_NP", Const, 0}, - {"SYS_SHARED_REGION_MAP_AND_SLIDE_NP", Const, 0}, - {"SYS_SHMAT", Const, 0}, - {"SYS_SHMCTL", Const, 0}, - {"SYS_SHMDT", Const, 0}, - {"SYS_SHMGET", Const, 0}, - {"SYS_SHMSYS", Const, 0}, - {"SYS_SHM_OPEN", Const, 0}, - {"SYS_SHM_UNLINK", Const, 0}, - {"SYS_SHUTDOWN", Const, 0}, - {"SYS_SIGACTION", Const, 0}, - {"SYS_SIGALTSTACK", Const, 0}, - {"SYS_SIGNAL", Const, 0}, - {"SYS_SIGNALFD", Const, 0}, - {"SYS_SIGNALFD4", Const, 0}, - {"SYS_SIGPENDING", Const, 0}, - {"SYS_SIGPROCMASK", Const, 0}, - {"SYS_SIGQUEUE", Const, 0}, - {"SYS_SIGQUEUEINFO", Const, 1}, - {"SYS_SIGRETURN", Const, 0}, - {"SYS_SIGSUSPEND", Const, 0}, - {"SYS_SIGSUSPEND_NOCANCEL", Const, 0}, - {"SYS_SIGTIMEDWAIT", Const, 0}, - {"SYS_SIGWAIT", Const, 0}, - {"SYS_SIGWAITINFO", Const, 0}, - {"SYS_SOCKET", Const, 0}, - {"SYS_SOCKETCALL", Const, 0}, - {"SYS_SOCKETPAIR", Const, 0}, - {"SYS_SPLICE", Const, 0}, - {"SYS_SSETMASK", Const, 0}, - {"SYS_SSTK", Const, 0}, - {"SYS_STACK_SNAPSHOT", Const, 0}, - {"SYS_STAT", Const, 0}, - {"SYS_STAT64", Const, 0}, - {"SYS_STAT64_EXTENDED", Const, 0}, - {"SYS_STATFS", Const, 0}, - {"SYS_STATFS64", Const, 0}, - {"SYS_STATV", Const, 0}, - {"SYS_STATVFS1", Const, 1}, - {"SYS_STAT_EXTENDED", Const, 0}, - {"SYS_STIME", Const, 0}, - {"SYS_STTY", Const, 0}, - {"SYS_SWAPCONTEXT", Const, 0}, - {"SYS_SWAPCTL", Const, 1}, - {"SYS_SWAPOFF", Const, 0}, - {"SYS_SWAPON", Const, 0}, - {"SYS_SYMLINK", Const, 0}, - {"SYS_SYMLINKAT", Const, 0}, - {"SYS_SYNC", Const, 0}, - {"SYS_SYNCFS", Const, 0}, - {"SYS_SYNC_FILE_RANGE", Const, 0}, - {"SYS_SYSARCH", Const, 0}, - {"SYS_SYSCALL", Const, 0}, - {"SYS_SYSCALL_BASE", Const, 0}, - {"SYS_SYSFS", Const, 0}, - {"SYS_SYSINFO", Const, 0}, - {"SYS_SYSLOG", Const, 0}, - {"SYS_TEE", Const, 0}, - {"SYS_TGKILL", Const, 0}, - {"SYS_THREAD_SELFID", Const, 0}, - {"SYS_THR_CREATE", Const, 0}, - {"SYS_THR_EXIT", Const, 0}, - {"SYS_THR_KILL", Const, 0}, - {"SYS_THR_KILL2", Const, 0}, - {"SYS_THR_NEW", Const, 0}, - {"SYS_THR_SELF", Const, 0}, - {"SYS_THR_SET_NAME", Const, 0}, - {"SYS_THR_SUSPEND", Const, 0}, - {"SYS_THR_WAKE", Const, 0}, - {"SYS_TIME", Const, 0}, - {"SYS_TIMERFD_CREATE", Const, 0}, - {"SYS_TIMERFD_GETTIME", Const, 0}, - {"SYS_TIMERFD_SETTIME", Const, 0}, - {"SYS_TIMER_CREATE", Const, 0}, - {"SYS_TIMER_DELETE", Const, 0}, - {"SYS_TIMER_GETOVERRUN", Const, 0}, - {"SYS_TIMER_GETTIME", Const, 0}, - {"SYS_TIMER_SETTIME", Const, 0}, - {"SYS_TIMES", Const, 0}, - {"SYS_TKILL", Const, 0}, - {"SYS_TRUNCATE", Const, 0}, - {"SYS_TRUNCATE64", Const, 0}, - {"SYS_TUXCALL", Const, 0}, - {"SYS_UGETRLIMIT", Const, 0}, - {"SYS_ULIMIT", Const, 0}, - {"SYS_UMASK", Const, 0}, - {"SYS_UMASK_EXTENDED", Const, 0}, - {"SYS_UMOUNT", Const, 0}, - {"SYS_UMOUNT2", Const, 0}, - {"SYS_UNAME", Const, 0}, - {"SYS_UNDELETE", Const, 0}, - {"SYS_UNLINK", Const, 0}, - {"SYS_UNLINKAT", Const, 0}, - {"SYS_UNMOUNT", Const, 0}, - {"SYS_UNSHARE", Const, 0}, - {"SYS_USELIB", Const, 0}, - {"SYS_USTAT", Const, 0}, - {"SYS_UTIME", Const, 0}, - {"SYS_UTIMENSAT", Const, 0}, - {"SYS_UTIMES", Const, 0}, - {"SYS_UTRACE", Const, 0}, - {"SYS_UUIDGEN", Const, 0}, - {"SYS_VADVISE", Const, 1}, - {"SYS_VFORK", Const, 0}, - {"SYS_VHANGUP", Const, 0}, - {"SYS_VM86", Const, 0}, - {"SYS_VM86OLD", Const, 0}, - {"SYS_VMSPLICE", Const, 0}, - {"SYS_VM_PRESSURE_MONITOR", Const, 0}, - {"SYS_VSERVER", Const, 0}, - {"SYS_WAIT4", Const, 0}, - {"SYS_WAIT4_NOCANCEL", Const, 0}, - {"SYS_WAIT6", Const, 1}, - {"SYS_WAITEVENT", Const, 0}, - {"SYS_WAITID", Const, 0}, - {"SYS_WAITID_NOCANCEL", Const, 0}, - {"SYS_WAITPID", Const, 0}, - {"SYS_WATCHEVENT", Const, 0}, - {"SYS_WORKQ_KERNRETURN", Const, 0}, - {"SYS_WORKQ_OPEN", Const, 0}, - {"SYS_WRITE", Const, 0}, - {"SYS_WRITEV", Const, 0}, - {"SYS_WRITEV_NOCANCEL", Const, 0}, - {"SYS_WRITE_NOCANCEL", Const, 0}, - {"SYS_YIELD", Const, 0}, - {"SYS__LLSEEK", Const, 0}, - {"SYS__LWP_CONTINUE", Const, 1}, - {"SYS__LWP_CREATE", Const, 1}, - {"SYS__LWP_CTL", Const, 1}, - {"SYS__LWP_DETACH", Const, 1}, - {"SYS__LWP_EXIT", Const, 1}, - {"SYS__LWP_GETNAME", Const, 1}, - {"SYS__LWP_GETPRIVATE", Const, 1}, - {"SYS__LWP_KILL", Const, 1}, - {"SYS__LWP_PARK", Const, 1}, - {"SYS__LWP_SELF", Const, 1}, - {"SYS__LWP_SETNAME", Const, 1}, - {"SYS__LWP_SETPRIVATE", Const, 1}, - {"SYS__LWP_SUSPEND", Const, 1}, - {"SYS__LWP_UNPARK", Const, 1}, - {"SYS__LWP_UNPARK_ALL", Const, 1}, - {"SYS__LWP_WAIT", Const, 1}, - {"SYS__LWP_WAKEUP", Const, 1}, - {"SYS__NEWSELECT", Const, 0}, - {"SYS__PSET_BIND", Const, 1}, - {"SYS__SCHED_GETAFFINITY", Const, 1}, - {"SYS__SCHED_GETPARAM", Const, 1}, - {"SYS__SCHED_SETAFFINITY", Const, 1}, - {"SYS__SCHED_SETPARAM", Const, 1}, - {"SYS__SYSCTL", Const, 0}, - {"SYS__UMTX_LOCK", Const, 0}, - {"SYS__UMTX_OP", Const, 0}, - {"SYS__UMTX_UNLOCK", Const, 0}, - {"SYS___ACL_ACLCHECK_FD", Const, 0}, - {"SYS___ACL_ACLCHECK_FILE", Const, 0}, - {"SYS___ACL_ACLCHECK_LINK", Const, 0}, - {"SYS___ACL_DELETE_FD", Const, 0}, - {"SYS___ACL_DELETE_FILE", Const, 0}, - {"SYS___ACL_DELETE_LINK", Const, 0}, - {"SYS___ACL_GET_FD", Const, 0}, - {"SYS___ACL_GET_FILE", Const, 0}, - {"SYS___ACL_GET_LINK", Const, 0}, - {"SYS___ACL_SET_FD", Const, 0}, - {"SYS___ACL_SET_FILE", Const, 0}, - {"SYS___ACL_SET_LINK", Const, 0}, - {"SYS___CAP_RIGHTS_GET", Const, 14}, - {"SYS___CLONE", Const, 1}, - {"SYS___DISABLE_THREADSIGNAL", Const, 0}, - {"SYS___GETCWD", Const, 0}, - {"SYS___GETLOGIN", Const, 1}, - {"SYS___GET_TCB", Const, 1}, - {"SYS___MAC_EXECVE", Const, 0}, - {"SYS___MAC_GETFSSTAT", Const, 0}, - {"SYS___MAC_GET_FD", Const, 0}, - {"SYS___MAC_GET_FILE", Const, 0}, - {"SYS___MAC_GET_LCID", Const, 0}, - {"SYS___MAC_GET_LCTX", Const, 0}, - {"SYS___MAC_GET_LINK", Const, 0}, - {"SYS___MAC_GET_MOUNT", Const, 0}, - {"SYS___MAC_GET_PID", Const, 0}, - {"SYS___MAC_GET_PROC", Const, 0}, - {"SYS___MAC_MOUNT", Const, 0}, - {"SYS___MAC_SET_FD", Const, 0}, - {"SYS___MAC_SET_FILE", Const, 0}, - {"SYS___MAC_SET_LCTX", Const, 0}, - {"SYS___MAC_SET_LINK", Const, 0}, - {"SYS___MAC_SET_PROC", Const, 0}, - {"SYS___MAC_SYSCALL", Const, 0}, - {"SYS___OLD_SEMWAIT_SIGNAL", Const, 0}, - {"SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", Const, 0}, - {"SYS___POSIX_CHOWN", Const, 1}, - {"SYS___POSIX_FCHOWN", Const, 1}, - {"SYS___POSIX_LCHOWN", Const, 1}, - {"SYS___POSIX_RENAME", Const, 1}, - {"SYS___PTHREAD_CANCELED", Const, 0}, - {"SYS___PTHREAD_CHDIR", Const, 0}, - {"SYS___PTHREAD_FCHDIR", Const, 0}, - {"SYS___PTHREAD_KILL", Const, 0}, - {"SYS___PTHREAD_MARKCANCEL", Const, 0}, - {"SYS___PTHREAD_SIGMASK", Const, 0}, - {"SYS___QUOTACTL", Const, 1}, - {"SYS___SEMCTL", Const, 1}, - {"SYS___SEMWAIT_SIGNAL", Const, 0}, - {"SYS___SEMWAIT_SIGNAL_NOCANCEL", Const, 0}, - {"SYS___SETLOGIN", Const, 1}, - {"SYS___SETUGID", Const, 0}, - {"SYS___SET_TCB", Const, 1}, - {"SYS___SIGACTION_SIGTRAMP", Const, 1}, - {"SYS___SIGTIMEDWAIT", Const, 1}, - {"SYS___SIGWAIT", Const, 0}, - {"SYS___SIGWAIT_NOCANCEL", Const, 0}, - {"SYS___SYSCTL", Const, 0}, - {"SYS___TFORK", Const, 1}, - {"SYS___THREXIT", Const, 1}, - {"SYS___THRSIGDIVERT", Const, 1}, - {"SYS___THRSLEEP", Const, 1}, - {"SYS___THRWAKEUP", Const, 1}, - {"S_ARCH1", Const, 1}, - {"S_ARCH2", Const, 1}, - {"S_BLKSIZE", Const, 0}, - {"S_IEXEC", Const, 0}, - {"S_IFBLK", Const, 0}, - {"S_IFCHR", Const, 0}, - {"S_IFDIR", Const, 0}, - {"S_IFIFO", Const, 0}, - {"S_IFLNK", Const, 0}, - {"S_IFMT", Const, 0}, - {"S_IFREG", Const, 0}, - {"S_IFSOCK", Const, 0}, - {"S_IFWHT", Const, 0}, - {"S_IREAD", Const, 0}, - {"S_IRGRP", Const, 0}, - {"S_IROTH", Const, 0}, - {"S_IRUSR", Const, 0}, - {"S_IRWXG", Const, 0}, - {"S_IRWXO", Const, 0}, - {"S_IRWXU", Const, 0}, - {"S_ISGID", Const, 0}, - {"S_ISTXT", Const, 0}, - {"S_ISUID", Const, 0}, - {"S_ISVTX", Const, 0}, - {"S_IWGRP", Const, 0}, - {"S_IWOTH", Const, 0}, - {"S_IWRITE", Const, 0}, - {"S_IWUSR", Const, 0}, - {"S_IXGRP", Const, 0}, - {"S_IXOTH", Const, 0}, - {"S_IXUSR", Const, 0}, - {"S_LOGIN_SET", Const, 1}, - {"SecurityAttributes", Type, 0}, - {"SecurityAttributes.InheritHandle", Field, 0}, - {"SecurityAttributes.Length", Field, 0}, - {"SecurityAttributes.SecurityDescriptor", Field, 0}, - {"Seek", Func, 0}, - {"Select", Func, 0}, - {"Sendfile", Func, 0}, - {"Sendmsg", Func, 0}, - {"SendmsgN", Func, 3}, - {"Sendto", Func, 0}, - {"Servent", Type, 0}, - {"Servent.Aliases", Field, 0}, - {"Servent.Name", Field, 0}, - {"Servent.Port", Field, 0}, - {"Servent.Proto", Field, 0}, - {"SetBpf", Func, 0}, - {"SetBpfBuflen", Func, 0}, - {"SetBpfDatalink", Func, 0}, - {"SetBpfHeadercmpl", Func, 0}, - {"SetBpfImmediate", Func, 0}, - {"SetBpfInterface", Func, 0}, - {"SetBpfPromisc", Func, 0}, - {"SetBpfTimeout", Func, 0}, - {"SetCurrentDirectory", Func, 0}, - {"SetEndOfFile", Func, 0}, - {"SetEnvironmentVariable", Func, 0}, - {"SetFileAttributes", Func, 0}, - {"SetFileCompletionNotificationModes", Func, 2}, - {"SetFilePointer", Func, 0}, - {"SetFileTime", Func, 0}, - {"SetHandleInformation", Func, 0}, - {"SetKevent", Func, 0}, - {"SetLsfPromisc", Func, 0}, - {"SetNonblock", Func, 0}, - {"Setdomainname", Func, 0}, - {"Setegid", Func, 0}, - {"Setenv", Func, 0}, - {"Seteuid", Func, 0}, - {"Setfsgid", Func, 0}, - {"Setfsuid", Func, 0}, - {"Setgid", Func, 0}, - {"Setgroups", Func, 0}, - {"Sethostname", Func, 0}, - {"Setlogin", Func, 0}, - {"Setpgid", Func, 0}, - {"Setpriority", Func, 0}, - {"Setprivexec", Func, 0}, - {"Setregid", Func, 0}, - {"Setresgid", Func, 0}, - {"Setresuid", Func, 0}, - {"Setreuid", Func, 0}, - {"Setrlimit", Func, 0}, - {"Setsid", Func, 0}, - {"Setsockopt", Func, 0}, - {"SetsockoptByte", Func, 0}, - {"SetsockoptICMPv6Filter", Func, 2}, - {"SetsockoptIPMreq", Func, 0}, - {"SetsockoptIPMreqn", Func, 0}, - {"SetsockoptIPv6Mreq", Func, 0}, - {"SetsockoptInet4Addr", Func, 0}, - {"SetsockoptInt", Func, 0}, - {"SetsockoptLinger", Func, 0}, - {"SetsockoptString", Func, 0}, - {"SetsockoptTimeval", Func, 0}, - {"Settimeofday", Func, 0}, - {"Setuid", Func, 0}, - {"Setxattr", Func, 1}, - {"Shutdown", Func, 0}, - {"SidTypeAlias", Const, 0}, - {"SidTypeComputer", Const, 0}, - {"SidTypeDeletedAccount", Const, 0}, - {"SidTypeDomain", Const, 0}, - {"SidTypeGroup", Const, 0}, - {"SidTypeInvalid", Const, 0}, - {"SidTypeLabel", Const, 0}, - {"SidTypeUnknown", Const, 0}, - {"SidTypeUser", Const, 0}, - {"SidTypeWellKnownGroup", Const, 0}, - {"Signal", Type, 0}, - {"SizeofBpfHdr", Const, 0}, - {"SizeofBpfInsn", Const, 0}, - {"SizeofBpfProgram", Const, 0}, - {"SizeofBpfStat", Const, 0}, - {"SizeofBpfVersion", Const, 0}, - {"SizeofBpfZbuf", Const, 0}, - {"SizeofBpfZbufHeader", Const, 0}, - {"SizeofCmsghdr", Const, 0}, - {"SizeofICMPv6Filter", Const, 2}, - {"SizeofIPMreq", Const, 0}, - {"SizeofIPMreqn", Const, 0}, - {"SizeofIPv6MTUInfo", Const, 2}, - {"SizeofIPv6Mreq", Const, 0}, - {"SizeofIfAddrmsg", Const, 0}, - {"SizeofIfAnnounceMsghdr", Const, 1}, - {"SizeofIfData", Const, 0}, - {"SizeofIfInfomsg", Const, 0}, - {"SizeofIfMsghdr", Const, 0}, - {"SizeofIfaMsghdr", Const, 0}, - {"SizeofIfmaMsghdr", Const, 0}, - {"SizeofIfmaMsghdr2", Const, 0}, - {"SizeofInet4Pktinfo", Const, 0}, - {"SizeofInet6Pktinfo", Const, 0}, - {"SizeofInotifyEvent", Const, 0}, - {"SizeofLinger", Const, 0}, - {"SizeofMsghdr", Const, 0}, - {"SizeofNlAttr", Const, 0}, - {"SizeofNlMsgerr", Const, 0}, - {"SizeofNlMsghdr", Const, 0}, - {"SizeofRtAttr", Const, 0}, - {"SizeofRtGenmsg", Const, 0}, - {"SizeofRtMetrics", Const, 0}, - {"SizeofRtMsg", Const, 0}, - {"SizeofRtMsghdr", Const, 0}, - {"SizeofRtNexthop", Const, 0}, - {"SizeofSockFilter", Const, 0}, - {"SizeofSockFprog", Const, 0}, - {"SizeofSockaddrAny", Const, 0}, - {"SizeofSockaddrDatalink", Const, 0}, - {"SizeofSockaddrInet4", Const, 0}, - {"SizeofSockaddrInet6", Const, 0}, - {"SizeofSockaddrLinklayer", Const, 0}, - {"SizeofSockaddrNetlink", Const, 0}, - {"SizeofSockaddrUnix", Const, 0}, - {"SizeofTCPInfo", Const, 1}, - {"SizeofUcred", Const, 0}, - {"SlicePtrFromStrings", Func, 1}, - {"SockFilter", Type, 0}, - {"SockFilter.Code", Field, 0}, - {"SockFilter.Jf", Field, 0}, - {"SockFilter.Jt", Field, 0}, - {"SockFilter.K", Field, 0}, - {"SockFprog", Type, 0}, - {"SockFprog.Filter", Field, 0}, - {"SockFprog.Len", Field, 0}, - {"SockFprog.Pad_cgo_0", Field, 0}, - {"Sockaddr", Type, 0}, - {"SockaddrDatalink", Type, 0}, - {"SockaddrDatalink.Alen", Field, 0}, - {"SockaddrDatalink.Data", Field, 0}, - {"SockaddrDatalink.Family", Field, 0}, - {"SockaddrDatalink.Index", Field, 0}, - {"SockaddrDatalink.Len", Field, 0}, - {"SockaddrDatalink.Nlen", Field, 0}, - {"SockaddrDatalink.Slen", Field, 0}, - {"SockaddrDatalink.Type", Field, 0}, - {"SockaddrGen", Type, 0}, - {"SockaddrInet4", Type, 0}, - {"SockaddrInet4.Addr", Field, 0}, - {"SockaddrInet4.Port", Field, 0}, - {"SockaddrInet6", Type, 0}, - {"SockaddrInet6.Addr", Field, 0}, - {"SockaddrInet6.Port", Field, 0}, - {"SockaddrInet6.ZoneId", Field, 0}, - {"SockaddrLinklayer", Type, 0}, - {"SockaddrLinklayer.Addr", Field, 0}, - {"SockaddrLinklayer.Halen", Field, 0}, - {"SockaddrLinklayer.Hatype", Field, 0}, - {"SockaddrLinklayer.Ifindex", Field, 0}, - {"SockaddrLinklayer.Pkttype", Field, 0}, - {"SockaddrLinklayer.Protocol", Field, 0}, - {"SockaddrNetlink", Type, 0}, - {"SockaddrNetlink.Family", Field, 0}, - {"SockaddrNetlink.Groups", Field, 0}, - {"SockaddrNetlink.Pad", Field, 0}, - {"SockaddrNetlink.Pid", Field, 0}, - {"SockaddrUnix", Type, 0}, - {"SockaddrUnix.Name", Field, 0}, - {"Socket", Func, 0}, - {"SocketControlMessage", Type, 0}, - {"SocketControlMessage.Data", Field, 0}, - {"SocketControlMessage.Header", Field, 0}, - {"SocketDisableIPv6", Var, 0}, - {"Socketpair", Func, 0}, - {"Splice", Func, 0}, - {"StartProcess", Func, 0}, - {"StartupInfo", Type, 0}, - {"StartupInfo.Cb", Field, 0}, - {"StartupInfo.Desktop", Field, 0}, - {"StartupInfo.FillAttribute", Field, 0}, - {"StartupInfo.Flags", Field, 0}, - {"StartupInfo.ShowWindow", Field, 0}, - {"StartupInfo.StdErr", Field, 0}, - {"StartupInfo.StdInput", Field, 0}, - {"StartupInfo.StdOutput", Field, 0}, - {"StartupInfo.Title", Field, 0}, - {"StartupInfo.X", Field, 0}, - {"StartupInfo.XCountChars", Field, 0}, - {"StartupInfo.XSize", Field, 0}, - {"StartupInfo.Y", Field, 0}, - {"StartupInfo.YCountChars", Field, 0}, - {"StartupInfo.YSize", Field, 0}, - {"Stat", Func, 0}, - {"Stat_t", Type, 0}, - {"Stat_t.Atim", Field, 0}, - {"Stat_t.Atim_ext", Field, 12}, - {"Stat_t.Atimespec", Field, 0}, - {"Stat_t.Birthtimespec", Field, 0}, - {"Stat_t.Blksize", Field, 0}, - {"Stat_t.Blocks", Field, 0}, - {"Stat_t.Btim_ext", Field, 12}, - {"Stat_t.Ctim", Field, 0}, - {"Stat_t.Ctim_ext", Field, 12}, - {"Stat_t.Ctimespec", Field, 0}, - {"Stat_t.Dev", Field, 0}, - {"Stat_t.Flags", Field, 0}, - {"Stat_t.Gen", Field, 0}, - {"Stat_t.Gid", Field, 0}, - {"Stat_t.Ino", Field, 0}, - {"Stat_t.Lspare", Field, 0}, - {"Stat_t.Lspare0", Field, 2}, - {"Stat_t.Lspare1", Field, 2}, - {"Stat_t.Mode", Field, 0}, - {"Stat_t.Mtim", Field, 0}, - {"Stat_t.Mtim_ext", Field, 12}, - {"Stat_t.Mtimespec", Field, 0}, - {"Stat_t.Nlink", Field, 0}, - {"Stat_t.Pad_cgo_0", Field, 0}, - {"Stat_t.Pad_cgo_1", Field, 0}, - {"Stat_t.Pad_cgo_2", Field, 0}, - {"Stat_t.Padding0", Field, 12}, - {"Stat_t.Padding1", Field, 12}, - {"Stat_t.Qspare", Field, 0}, - {"Stat_t.Rdev", Field, 0}, - {"Stat_t.Size", Field, 0}, - {"Stat_t.Spare", Field, 2}, - {"Stat_t.Uid", Field, 0}, - {"Stat_t.X__pad0", Field, 0}, - {"Stat_t.X__pad1", Field, 0}, - {"Stat_t.X__pad2", Field, 0}, - {"Stat_t.X__st_birthtim", Field, 2}, - {"Stat_t.X__st_ino", Field, 0}, - {"Stat_t.X__unused", Field, 0}, - {"Statfs", Func, 0}, - {"Statfs_t", Type, 0}, - {"Statfs_t.Asyncreads", Field, 0}, - {"Statfs_t.Asyncwrites", Field, 0}, - {"Statfs_t.Bavail", Field, 0}, - {"Statfs_t.Bfree", Field, 0}, - {"Statfs_t.Blocks", Field, 0}, - {"Statfs_t.Bsize", Field, 0}, - {"Statfs_t.Charspare", Field, 0}, - {"Statfs_t.F_asyncreads", Field, 2}, - {"Statfs_t.F_asyncwrites", Field, 2}, - {"Statfs_t.F_bavail", Field, 2}, - {"Statfs_t.F_bfree", Field, 2}, - {"Statfs_t.F_blocks", Field, 2}, - {"Statfs_t.F_bsize", Field, 2}, - {"Statfs_t.F_ctime", Field, 2}, - {"Statfs_t.F_favail", Field, 2}, - {"Statfs_t.F_ffree", Field, 2}, - {"Statfs_t.F_files", Field, 2}, - {"Statfs_t.F_flags", Field, 2}, - {"Statfs_t.F_fsid", Field, 2}, - {"Statfs_t.F_fstypename", Field, 2}, - {"Statfs_t.F_iosize", Field, 2}, - {"Statfs_t.F_mntfromname", Field, 2}, - {"Statfs_t.F_mntfromspec", Field, 3}, - {"Statfs_t.F_mntonname", Field, 2}, - {"Statfs_t.F_namemax", Field, 2}, - {"Statfs_t.F_owner", Field, 2}, - {"Statfs_t.F_spare", Field, 2}, - {"Statfs_t.F_syncreads", Field, 2}, - {"Statfs_t.F_syncwrites", Field, 2}, - {"Statfs_t.Ffree", Field, 0}, - {"Statfs_t.Files", Field, 0}, - {"Statfs_t.Flags", Field, 0}, - {"Statfs_t.Frsize", Field, 0}, - {"Statfs_t.Fsid", Field, 0}, - {"Statfs_t.Fssubtype", Field, 0}, - {"Statfs_t.Fstypename", Field, 0}, - {"Statfs_t.Iosize", Field, 0}, - {"Statfs_t.Mntfromname", Field, 0}, - {"Statfs_t.Mntonname", Field, 0}, - {"Statfs_t.Mount_info", Field, 2}, - {"Statfs_t.Namelen", Field, 0}, - {"Statfs_t.Namemax", Field, 0}, - {"Statfs_t.Owner", Field, 0}, - {"Statfs_t.Pad_cgo_0", Field, 0}, - {"Statfs_t.Pad_cgo_1", Field, 2}, - {"Statfs_t.Reserved", Field, 0}, - {"Statfs_t.Spare", Field, 0}, - {"Statfs_t.Syncreads", Field, 0}, - {"Statfs_t.Syncwrites", Field, 0}, - {"Statfs_t.Type", Field, 0}, - {"Statfs_t.Version", Field, 0}, - {"Stderr", Var, 0}, - {"Stdin", Var, 0}, - {"Stdout", Var, 0}, - {"StringBytePtr", Func, 0}, - {"StringByteSlice", Func, 0}, - {"StringSlicePtr", Func, 0}, - {"StringToSid", Func, 0}, - {"StringToUTF16", Func, 0}, - {"StringToUTF16Ptr", Func, 0}, - {"Symlink", Func, 0}, - {"Sync", Func, 0}, - {"SyncFileRange", Func, 0}, - {"SysProcAttr", Type, 0}, - {"SysProcAttr.AdditionalInheritedHandles", Field, 17}, - {"SysProcAttr.AmbientCaps", Field, 9}, - {"SysProcAttr.CgroupFD", Field, 20}, - {"SysProcAttr.Chroot", Field, 0}, - {"SysProcAttr.Cloneflags", Field, 2}, - {"SysProcAttr.CmdLine", Field, 0}, - {"SysProcAttr.CreationFlags", Field, 1}, - {"SysProcAttr.Credential", Field, 0}, - {"SysProcAttr.Ctty", Field, 1}, - {"SysProcAttr.Foreground", Field, 5}, - {"SysProcAttr.GidMappings", Field, 4}, - {"SysProcAttr.GidMappingsEnableSetgroups", Field, 5}, - {"SysProcAttr.HideWindow", Field, 0}, - {"SysProcAttr.Jail", Field, 21}, - {"SysProcAttr.NoInheritHandles", Field, 16}, - {"SysProcAttr.Noctty", Field, 0}, - {"SysProcAttr.ParentProcess", Field, 17}, - {"SysProcAttr.Pdeathsig", Field, 0}, - {"SysProcAttr.Pgid", Field, 5}, - {"SysProcAttr.PidFD", Field, 22}, - {"SysProcAttr.ProcessAttributes", Field, 13}, - {"SysProcAttr.Ptrace", Field, 0}, - {"SysProcAttr.Setctty", Field, 0}, - {"SysProcAttr.Setpgid", Field, 0}, - {"SysProcAttr.Setsid", Field, 0}, - {"SysProcAttr.ThreadAttributes", Field, 13}, - {"SysProcAttr.Token", Field, 10}, - {"SysProcAttr.UidMappings", Field, 4}, - {"SysProcAttr.Unshareflags", Field, 7}, - {"SysProcAttr.UseCgroupFD", Field, 20}, - {"SysProcIDMap", Type, 4}, - {"SysProcIDMap.ContainerID", Field, 4}, - {"SysProcIDMap.HostID", Field, 4}, - {"SysProcIDMap.Size", Field, 4}, - {"Syscall", Func, 0}, - {"Syscall12", Func, 0}, - {"Syscall15", Func, 0}, - {"Syscall18", Func, 12}, - {"Syscall6", Func, 0}, - {"Syscall9", Func, 0}, - {"SyscallN", Func, 18}, - {"Sysctl", Func, 0}, - {"SysctlUint32", Func, 0}, - {"Sysctlnode", Type, 2}, - {"Sysctlnode.Flags", Field, 2}, - {"Sysctlnode.Name", Field, 2}, - {"Sysctlnode.Num", Field, 2}, - {"Sysctlnode.Un", Field, 2}, - {"Sysctlnode.Ver", Field, 2}, - {"Sysctlnode.X__rsvd", Field, 2}, - {"Sysctlnode.X_sysctl_desc", Field, 2}, - {"Sysctlnode.X_sysctl_func", Field, 2}, - {"Sysctlnode.X_sysctl_parent", Field, 2}, - {"Sysctlnode.X_sysctl_size", Field, 2}, - {"Sysinfo", Func, 0}, - {"Sysinfo_t", Type, 0}, - {"Sysinfo_t.Bufferram", Field, 0}, - {"Sysinfo_t.Freehigh", Field, 0}, - {"Sysinfo_t.Freeram", Field, 0}, - {"Sysinfo_t.Freeswap", Field, 0}, - {"Sysinfo_t.Loads", Field, 0}, - {"Sysinfo_t.Pad", Field, 0}, - {"Sysinfo_t.Pad_cgo_0", Field, 0}, - {"Sysinfo_t.Pad_cgo_1", Field, 0}, - {"Sysinfo_t.Procs", Field, 0}, - {"Sysinfo_t.Sharedram", Field, 0}, - {"Sysinfo_t.Totalhigh", Field, 0}, - {"Sysinfo_t.Totalram", Field, 0}, - {"Sysinfo_t.Totalswap", Field, 0}, - {"Sysinfo_t.Unit", Field, 0}, - {"Sysinfo_t.Uptime", Field, 0}, - {"Sysinfo_t.X_f", Field, 0}, - {"Systemtime", Type, 0}, - {"Systemtime.Day", Field, 0}, - {"Systemtime.DayOfWeek", Field, 0}, - {"Systemtime.Hour", Field, 0}, - {"Systemtime.Milliseconds", Field, 0}, - {"Systemtime.Minute", Field, 0}, - {"Systemtime.Month", Field, 0}, - {"Systemtime.Second", Field, 0}, - {"Systemtime.Year", Field, 0}, - {"TCGETS", Const, 0}, - {"TCIFLUSH", Const, 1}, - {"TCIOFLUSH", Const, 1}, - {"TCOFLUSH", Const, 1}, - {"TCPInfo", Type, 1}, - {"TCPInfo.Advmss", Field, 1}, - {"TCPInfo.Ato", Field, 1}, - {"TCPInfo.Backoff", Field, 1}, - {"TCPInfo.Ca_state", Field, 1}, - {"TCPInfo.Fackets", Field, 1}, - {"TCPInfo.Last_ack_recv", Field, 1}, - {"TCPInfo.Last_ack_sent", Field, 1}, - {"TCPInfo.Last_data_recv", Field, 1}, - {"TCPInfo.Last_data_sent", Field, 1}, - {"TCPInfo.Lost", Field, 1}, - {"TCPInfo.Options", Field, 1}, - {"TCPInfo.Pad_cgo_0", Field, 1}, - {"TCPInfo.Pmtu", Field, 1}, - {"TCPInfo.Probes", Field, 1}, - {"TCPInfo.Rcv_mss", Field, 1}, - {"TCPInfo.Rcv_rtt", Field, 1}, - {"TCPInfo.Rcv_space", Field, 1}, - {"TCPInfo.Rcv_ssthresh", Field, 1}, - {"TCPInfo.Reordering", Field, 1}, - {"TCPInfo.Retrans", Field, 1}, - {"TCPInfo.Retransmits", Field, 1}, - {"TCPInfo.Rto", Field, 1}, - {"TCPInfo.Rtt", Field, 1}, - {"TCPInfo.Rttvar", Field, 1}, - {"TCPInfo.Sacked", Field, 1}, - {"TCPInfo.Snd_cwnd", Field, 1}, - {"TCPInfo.Snd_mss", Field, 1}, - {"TCPInfo.Snd_ssthresh", Field, 1}, - {"TCPInfo.State", Field, 1}, - {"TCPInfo.Total_retrans", Field, 1}, - {"TCPInfo.Unacked", Field, 1}, - {"TCPKeepalive", Type, 3}, - {"TCPKeepalive.Interval", Field, 3}, - {"TCPKeepalive.OnOff", Field, 3}, - {"TCPKeepalive.Time", Field, 3}, - {"TCP_CA_NAME_MAX", Const, 0}, - {"TCP_CONGCTL", Const, 1}, - {"TCP_CONGESTION", Const, 0}, - {"TCP_CONNECTIONTIMEOUT", Const, 0}, - {"TCP_CORK", Const, 0}, - {"TCP_DEFER_ACCEPT", Const, 0}, - {"TCP_ENABLE_ECN", Const, 16}, - {"TCP_INFO", Const, 0}, - {"TCP_KEEPALIVE", Const, 0}, - {"TCP_KEEPCNT", Const, 0}, - {"TCP_KEEPIDLE", Const, 0}, - {"TCP_KEEPINIT", Const, 1}, - {"TCP_KEEPINTVL", Const, 0}, - {"TCP_LINGER2", Const, 0}, - {"TCP_MAXBURST", Const, 0}, - {"TCP_MAXHLEN", Const, 0}, - {"TCP_MAXOLEN", Const, 0}, - {"TCP_MAXSEG", Const, 0}, - {"TCP_MAXWIN", Const, 0}, - {"TCP_MAX_SACK", Const, 0}, - {"TCP_MAX_WINSHIFT", Const, 0}, - {"TCP_MD5SIG", Const, 0}, - {"TCP_MD5SIG_MAXKEYLEN", Const, 0}, - {"TCP_MINMSS", Const, 0}, - {"TCP_MINMSSOVERLOAD", Const, 0}, - {"TCP_MSS", Const, 0}, - {"TCP_NODELAY", Const, 0}, - {"TCP_NOOPT", Const, 0}, - {"TCP_NOPUSH", Const, 0}, - {"TCP_NOTSENT_LOWAT", Const, 16}, - {"TCP_NSTATES", Const, 1}, - {"TCP_QUICKACK", Const, 0}, - {"TCP_RXT_CONNDROPTIME", Const, 0}, - {"TCP_RXT_FINDROP", Const, 0}, - {"TCP_SACK_ENABLE", Const, 1}, - {"TCP_SENDMOREACKS", Const, 16}, - {"TCP_SYNCNT", Const, 0}, - {"TCP_VENDOR", Const, 3}, - {"TCP_WINDOW_CLAMP", Const, 0}, - {"TCSAFLUSH", Const, 1}, - {"TCSETS", Const, 0}, - {"TF_DISCONNECT", Const, 0}, - {"TF_REUSE_SOCKET", Const, 0}, - {"TF_USE_DEFAULT_WORKER", Const, 0}, - {"TF_USE_KERNEL_APC", Const, 0}, - {"TF_USE_SYSTEM_THREAD", Const, 0}, - {"TF_WRITE_BEHIND", Const, 0}, - {"TH32CS_INHERIT", Const, 4}, - {"TH32CS_SNAPALL", Const, 4}, - {"TH32CS_SNAPHEAPLIST", Const, 4}, - {"TH32CS_SNAPMODULE", Const, 4}, - {"TH32CS_SNAPMODULE32", Const, 4}, - {"TH32CS_SNAPPROCESS", Const, 4}, - {"TH32CS_SNAPTHREAD", Const, 4}, - {"TIME_ZONE_ID_DAYLIGHT", Const, 0}, - {"TIME_ZONE_ID_STANDARD", Const, 0}, - {"TIME_ZONE_ID_UNKNOWN", Const, 0}, - {"TIOCCBRK", Const, 0}, - {"TIOCCDTR", Const, 0}, - {"TIOCCONS", Const, 0}, - {"TIOCDCDTIMESTAMP", Const, 0}, - {"TIOCDRAIN", Const, 0}, - {"TIOCDSIMICROCODE", Const, 0}, - {"TIOCEXCL", Const, 0}, - {"TIOCEXT", Const, 0}, - {"TIOCFLAG_CDTRCTS", Const, 1}, - {"TIOCFLAG_CLOCAL", Const, 1}, - {"TIOCFLAG_CRTSCTS", Const, 1}, - {"TIOCFLAG_MDMBUF", Const, 1}, - {"TIOCFLAG_PPS", Const, 1}, - {"TIOCFLAG_SOFTCAR", Const, 1}, - {"TIOCFLUSH", Const, 0}, - {"TIOCGDEV", Const, 0}, - {"TIOCGDRAINWAIT", Const, 0}, - {"TIOCGETA", Const, 0}, - {"TIOCGETD", Const, 0}, - {"TIOCGFLAGS", Const, 1}, - {"TIOCGICOUNT", Const, 0}, - {"TIOCGLCKTRMIOS", Const, 0}, - {"TIOCGLINED", Const, 1}, - {"TIOCGPGRP", Const, 0}, - {"TIOCGPTN", Const, 0}, - {"TIOCGQSIZE", Const, 1}, - {"TIOCGRANTPT", Const, 1}, - {"TIOCGRS485", Const, 0}, - {"TIOCGSERIAL", Const, 0}, - {"TIOCGSID", Const, 0}, - {"TIOCGSIZE", Const, 1}, - {"TIOCGSOFTCAR", Const, 0}, - {"TIOCGTSTAMP", Const, 1}, - {"TIOCGWINSZ", Const, 0}, - {"TIOCINQ", Const, 0}, - {"TIOCIXOFF", Const, 0}, - {"TIOCIXON", Const, 0}, - {"TIOCLINUX", Const, 0}, - {"TIOCMBIC", Const, 0}, - {"TIOCMBIS", Const, 0}, - {"TIOCMGDTRWAIT", Const, 0}, - {"TIOCMGET", Const, 0}, - {"TIOCMIWAIT", Const, 0}, - {"TIOCMODG", Const, 0}, - {"TIOCMODS", Const, 0}, - {"TIOCMSDTRWAIT", Const, 0}, - {"TIOCMSET", Const, 0}, - {"TIOCM_CAR", Const, 0}, - {"TIOCM_CD", Const, 0}, - {"TIOCM_CTS", Const, 0}, - {"TIOCM_DCD", Const, 0}, - {"TIOCM_DSR", Const, 0}, - {"TIOCM_DTR", Const, 0}, - {"TIOCM_LE", Const, 0}, - {"TIOCM_RI", Const, 0}, - {"TIOCM_RNG", Const, 0}, - {"TIOCM_RTS", Const, 0}, - {"TIOCM_SR", Const, 0}, - {"TIOCM_ST", Const, 0}, - {"TIOCNOTTY", Const, 0}, - {"TIOCNXCL", Const, 0}, - {"TIOCOUTQ", Const, 0}, - {"TIOCPKT", Const, 0}, - {"TIOCPKT_DATA", Const, 0}, - {"TIOCPKT_DOSTOP", Const, 0}, - {"TIOCPKT_FLUSHREAD", Const, 0}, - {"TIOCPKT_FLUSHWRITE", Const, 0}, - {"TIOCPKT_IOCTL", Const, 0}, - {"TIOCPKT_NOSTOP", Const, 0}, - {"TIOCPKT_START", Const, 0}, - {"TIOCPKT_STOP", Const, 0}, - {"TIOCPTMASTER", Const, 0}, - {"TIOCPTMGET", Const, 1}, - {"TIOCPTSNAME", Const, 1}, - {"TIOCPTYGNAME", Const, 0}, - {"TIOCPTYGRANT", Const, 0}, - {"TIOCPTYUNLK", Const, 0}, - {"TIOCRCVFRAME", Const, 1}, - {"TIOCREMOTE", Const, 0}, - {"TIOCSBRK", Const, 0}, - {"TIOCSCONS", Const, 0}, - {"TIOCSCTTY", Const, 0}, - {"TIOCSDRAINWAIT", Const, 0}, - {"TIOCSDTR", Const, 0}, - {"TIOCSERCONFIG", Const, 0}, - {"TIOCSERGETLSR", Const, 0}, - {"TIOCSERGETMULTI", Const, 0}, - {"TIOCSERGSTRUCT", Const, 0}, - {"TIOCSERGWILD", Const, 0}, - {"TIOCSERSETMULTI", Const, 0}, - {"TIOCSERSWILD", Const, 0}, - {"TIOCSER_TEMT", Const, 0}, - {"TIOCSETA", Const, 0}, - {"TIOCSETAF", Const, 0}, - {"TIOCSETAW", Const, 0}, - {"TIOCSETD", Const, 0}, - {"TIOCSFLAGS", Const, 1}, - {"TIOCSIG", Const, 0}, - {"TIOCSLCKTRMIOS", Const, 0}, - {"TIOCSLINED", Const, 1}, - {"TIOCSPGRP", Const, 0}, - {"TIOCSPTLCK", Const, 0}, - {"TIOCSQSIZE", Const, 1}, - {"TIOCSRS485", Const, 0}, - {"TIOCSSERIAL", Const, 0}, - {"TIOCSSIZE", Const, 1}, - {"TIOCSSOFTCAR", Const, 0}, - {"TIOCSTART", Const, 0}, - {"TIOCSTAT", Const, 0}, - {"TIOCSTI", Const, 0}, - {"TIOCSTOP", Const, 0}, - {"TIOCSTSTAMP", Const, 1}, - {"TIOCSWINSZ", Const, 0}, - {"TIOCTIMESTAMP", Const, 0}, - {"TIOCUCNTL", Const, 0}, - {"TIOCVHANGUP", Const, 0}, - {"TIOCXMTFRAME", Const, 1}, - {"TOKEN_ADJUST_DEFAULT", Const, 0}, - {"TOKEN_ADJUST_GROUPS", Const, 0}, - {"TOKEN_ADJUST_PRIVILEGES", Const, 0}, - {"TOKEN_ADJUST_SESSIONID", Const, 11}, - {"TOKEN_ALL_ACCESS", Const, 0}, - {"TOKEN_ASSIGN_PRIMARY", Const, 0}, - {"TOKEN_DUPLICATE", Const, 0}, - {"TOKEN_EXECUTE", Const, 0}, - {"TOKEN_IMPERSONATE", Const, 0}, - {"TOKEN_QUERY", Const, 0}, - {"TOKEN_QUERY_SOURCE", Const, 0}, - {"TOKEN_READ", Const, 0}, - {"TOKEN_WRITE", Const, 0}, - {"TOSTOP", Const, 0}, - {"TRUNCATE_EXISTING", Const, 0}, - {"TUNATTACHFILTER", Const, 0}, - {"TUNDETACHFILTER", Const, 0}, - {"TUNGETFEATURES", Const, 0}, - {"TUNGETIFF", Const, 0}, - {"TUNGETSNDBUF", Const, 0}, - {"TUNGETVNETHDRSZ", Const, 0}, - {"TUNSETDEBUG", Const, 0}, - {"TUNSETGROUP", Const, 0}, - {"TUNSETIFF", Const, 0}, - {"TUNSETLINK", Const, 0}, - {"TUNSETNOCSUM", Const, 0}, - {"TUNSETOFFLOAD", Const, 0}, - {"TUNSETOWNER", Const, 0}, - {"TUNSETPERSIST", Const, 0}, - {"TUNSETSNDBUF", Const, 0}, - {"TUNSETTXFILTER", Const, 0}, - {"TUNSETVNETHDRSZ", Const, 0}, - {"Tee", Func, 0}, - {"TerminateProcess", Func, 0}, - {"Termios", Type, 0}, - {"Termios.Cc", Field, 0}, - {"Termios.Cflag", Field, 0}, - {"Termios.Iflag", Field, 0}, - {"Termios.Ispeed", Field, 0}, - {"Termios.Lflag", Field, 0}, - {"Termios.Line", Field, 0}, - {"Termios.Oflag", Field, 0}, - {"Termios.Ospeed", Field, 0}, - {"Termios.Pad_cgo_0", Field, 0}, - {"Tgkill", Func, 0}, - {"Time", Func, 0}, - {"Time_t", Type, 0}, - {"Times", Func, 0}, - {"Timespec", Type, 0}, - {"Timespec.Nsec", Field, 0}, - {"Timespec.Pad_cgo_0", Field, 2}, - {"Timespec.Sec", Field, 0}, - {"TimespecToNsec", Func, 0}, - {"Timeval", Type, 0}, - {"Timeval.Pad_cgo_0", Field, 0}, - {"Timeval.Sec", Field, 0}, - {"Timeval.Usec", Field, 0}, - {"Timeval32", Type, 0}, - {"Timeval32.Sec", Field, 0}, - {"Timeval32.Usec", Field, 0}, - {"TimevalToNsec", Func, 0}, - {"Timex", Type, 0}, - {"Timex.Calcnt", Field, 0}, - {"Timex.Constant", Field, 0}, - {"Timex.Errcnt", Field, 0}, - {"Timex.Esterror", Field, 0}, - {"Timex.Freq", Field, 0}, - {"Timex.Jitcnt", Field, 0}, - {"Timex.Jitter", Field, 0}, - {"Timex.Maxerror", Field, 0}, - {"Timex.Modes", Field, 0}, - {"Timex.Offset", Field, 0}, - {"Timex.Pad_cgo_0", Field, 0}, - {"Timex.Pad_cgo_1", Field, 0}, - {"Timex.Pad_cgo_2", Field, 0}, - {"Timex.Pad_cgo_3", Field, 0}, - {"Timex.Ppsfreq", Field, 0}, - {"Timex.Precision", Field, 0}, - {"Timex.Shift", Field, 0}, - {"Timex.Stabil", Field, 0}, - {"Timex.Status", Field, 0}, - {"Timex.Stbcnt", Field, 0}, - {"Timex.Tai", Field, 0}, - {"Timex.Tick", Field, 0}, - {"Timex.Time", Field, 0}, - {"Timex.Tolerance", Field, 0}, - {"Timezoneinformation", Type, 0}, - {"Timezoneinformation.Bias", Field, 0}, - {"Timezoneinformation.DaylightBias", Field, 0}, - {"Timezoneinformation.DaylightDate", Field, 0}, - {"Timezoneinformation.DaylightName", Field, 0}, - {"Timezoneinformation.StandardBias", Field, 0}, - {"Timezoneinformation.StandardDate", Field, 0}, - {"Timezoneinformation.StandardName", Field, 0}, - {"Tms", Type, 0}, - {"Tms.Cstime", Field, 0}, - {"Tms.Cutime", Field, 0}, - {"Tms.Stime", Field, 0}, - {"Tms.Utime", Field, 0}, - {"Token", Type, 0}, - {"TokenAccessInformation", Const, 0}, - {"TokenAuditPolicy", Const, 0}, - {"TokenDefaultDacl", Const, 0}, - {"TokenElevation", Const, 0}, - {"TokenElevationType", Const, 0}, - {"TokenGroups", Const, 0}, - {"TokenGroupsAndPrivileges", Const, 0}, - {"TokenHasRestrictions", Const, 0}, - {"TokenImpersonationLevel", Const, 0}, - {"TokenIntegrityLevel", Const, 0}, - {"TokenLinkedToken", Const, 0}, - {"TokenLogonSid", Const, 0}, - {"TokenMandatoryPolicy", Const, 0}, - {"TokenOrigin", Const, 0}, - {"TokenOwner", Const, 0}, - {"TokenPrimaryGroup", Const, 0}, - {"TokenPrivileges", Const, 0}, - {"TokenRestrictedSids", Const, 0}, - {"TokenSandBoxInert", Const, 0}, - {"TokenSessionId", Const, 0}, - {"TokenSessionReference", Const, 0}, - {"TokenSource", Const, 0}, - {"TokenStatistics", Const, 0}, - {"TokenType", Const, 0}, - {"TokenUIAccess", Const, 0}, - {"TokenUser", Const, 0}, - {"TokenVirtualizationAllowed", Const, 0}, - {"TokenVirtualizationEnabled", Const, 0}, - {"Tokenprimarygroup", Type, 0}, - {"Tokenprimarygroup.PrimaryGroup", Field, 0}, - {"Tokenuser", Type, 0}, - {"Tokenuser.User", Field, 0}, - {"TranslateAccountName", Func, 0}, - {"TranslateName", Func, 0}, - {"TransmitFile", Func, 0}, - {"TransmitFileBuffers", Type, 0}, - {"TransmitFileBuffers.Head", Field, 0}, - {"TransmitFileBuffers.HeadLength", Field, 0}, - {"TransmitFileBuffers.Tail", Field, 0}, - {"TransmitFileBuffers.TailLength", Field, 0}, - {"Truncate", Func, 0}, - {"UNIX_PATH_MAX", Const, 12}, - {"USAGE_MATCH_TYPE_AND", Const, 0}, - {"USAGE_MATCH_TYPE_OR", Const, 0}, - {"UTF16FromString", Func, 1}, - {"UTF16PtrFromString", Func, 1}, - {"UTF16ToString", Func, 0}, - {"Ucred", Type, 0}, - {"Ucred.Gid", Field, 0}, - {"Ucred.Pid", Field, 0}, - {"Ucred.Uid", Field, 0}, - {"Umask", Func, 0}, - {"Uname", Func, 0}, - {"Undelete", Func, 0}, - {"UnixCredentials", Func, 0}, - {"UnixRights", Func, 0}, - {"Unlink", Func, 0}, - {"Unlinkat", Func, 0}, - {"UnmapViewOfFile", Func, 0}, - {"Unmount", Func, 0}, - {"Unsetenv", Func, 4}, - {"Unshare", Func, 0}, - {"UserInfo10", Type, 0}, - {"UserInfo10.Comment", Field, 0}, - {"UserInfo10.FullName", Field, 0}, - {"UserInfo10.Name", Field, 0}, - {"UserInfo10.UsrComment", Field, 0}, - {"Ustat", Func, 0}, - {"Ustat_t", Type, 0}, - {"Ustat_t.Fname", Field, 0}, - {"Ustat_t.Fpack", Field, 0}, - {"Ustat_t.Pad_cgo_0", Field, 0}, - {"Ustat_t.Pad_cgo_1", Field, 0}, - {"Ustat_t.Tfree", Field, 0}, - {"Ustat_t.Tinode", Field, 0}, - {"Utimbuf", Type, 0}, - {"Utimbuf.Actime", Field, 0}, - {"Utimbuf.Modtime", Field, 0}, - {"Utime", Func, 0}, - {"Utimes", Func, 0}, - {"UtimesNano", Func, 1}, - {"Utsname", Type, 0}, - {"Utsname.Domainname", Field, 0}, - {"Utsname.Machine", Field, 0}, - {"Utsname.Nodename", Field, 0}, - {"Utsname.Release", Field, 0}, - {"Utsname.Sysname", Field, 0}, - {"Utsname.Version", Field, 0}, - {"VDISCARD", Const, 0}, - {"VDSUSP", Const, 1}, - {"VEOF", Const, 0}, - {"VEOL", Const, 0}, - {"VEOL2", Const, 0}, - {"VERASE", Const, 0}, - {"VERASE2", Const, 1}, - {"VINTR", Const, 0}, - {"VKILL", Const, 0}, - {"VLNEXT", Const, 0}, - {"VMIN", Const, 0}, - {"VQUIT", Const, 0}, - {"VREPRINT", Const, 0}, - {"VSTART", Const, 0}, - {"VSTATUS", Const, 1}, - {"VSTOP", Const, 0}, - {"VSUSP", Const, 0}, - {"VSWTC", Const, 0}, - {"VT0", Const, 1}, - {"VT1", Const, 1}, - {"VTDLY", Const, 1}, - {"VTIME", Const, 0}, - {"VWERASE", Const, 0}, - {"VirtualLock", Func, 0}, - {"VirtualUnlock", Func, 0}, - {"WAIT_ABANDONED", Const, 0}, - {"WAIT_FAILED", Const, 0}, - {"WAIT_OBJECT_0", Const, 0}, - {"WAIT_TIMEOUT", Const, 0}, - {"WALL", Const, 0}, - {"WALLSIG", Const, 1}, - {"WALTSIG", Const, 1}, - {"WCLONE", Const, 0}, - {"WCONTINUED", Const, 0}, - {"WCOREFLAG", Const, 0}, - {"WEXITED", Const, 0}, - {"WLINUXCLONE", Const, 0}, - {"WNOHANG", Const, 0}, - {"WNOTHREAD", Const, 0}, - {"WNOWAIT", Const, 0}, - {"WNOZOMBIE", Const, 1}, - {"WOPTSCHECKED", Const, 1}, - {"WORDSIZE", Const, 0}, - {"WSABuf", Type, 0}, - {"WSABuf.Buf", Field, 0}, - {"WSABuf.Len", Field, 0}, - {"WSACleanup", Func, 0}, - {"WSADESCRIPTION_LEN", Const, 0}, - {"WSAData", Type, 0}, - {"WSAData.Description", Field, 0}, - {"WSAData.HighVersion", Field, 0}, - {"WSAData.MaxSockets", Field, 0}, - {"WSAData.MaxUdpDg", Field, 0}, - {"WSAData.SystemStatus", Field, 0}, - {"WSAData.VendorInfo", Field, 0}, - {"WSAData.Version", Field, 0}, - {"WSAEACCES", Const, 2}, - {"WSAECONNABORTED", Const, 9}, - {"WSAECONNRESET", Const, 3}, - {"WSAEnumProtocols", Func, 2}, - {"WSAID_CONNECTEX", Var, 1}, - {"WSAIoctl", Func, 0}, - {"WSAPROTOCOL_LEN", Const, 2}, - {"WSAProtocolChain", Type, 2}, - {"WSAProtocolChain.ChainEntries", Field, 2}, - {"WSAProtocolChain.ChainLen", Field, 2}, - {"WSAProtocolInfo", Type, 2}, - {"WSAProtocolInfo.AddressFamily", Field, 2}, - {"WSAProtocolInfo.CatalogEntryId", Field, 2}, - {"WSAProtocolInfo.MaxSockAddr", Field, 2}, - {"WSAProtocolInfo.MessageSize", Field, 2}, - {"WSAProtocolInfo.MinSockAddr", Field, 2}, - {"WSAProtocolInfo.NetworkByteOrder", Field, 2}, - {"WSAProtocolInfo.Protocol", Field, 2}, - {"WSAProtocolInfo.ProtocolChain", Field, 2}, - {"WSAProtocolInfo.ProtocolMaxOffset", Field, 2}, - {"WSAProtocolInfo.ProtocolName", Field, 2}, - {"WSAProtocolInfo.ProviderFlags", Field, 2}, - {"WSAProtocolInfo.ProviderId", Field, 2}, - {"WSAProtocolInfo.ProviderReserved", Field, 2}, - {"WSAProtocolInfo.SecurityScheme", Field, 2}, - {"WSAProtocolInfo.ServiceFlags1", Field, 2}, - {"WSAProtocolInfo.ServiceFlags2", Field, 2}, - {"WSAProtocolInfo.ServiceFlags3", Field, 2}, - {"WSAProtocolInfo.ServiceFlags4", Field, 2}, - {"WSAProtocolInfo.SocketType", Field, 2}, - {"WSAProtocolInfo.Version", Field, 2}, - {"WSARecv", Func, 0}, - {"WSARecvFrom", Func, 0}, - {"WSASYS_STATUS_LEN", Const, 0}, - {"WSASend", Func, 0}, - {"WSASendTo", Func, 0}, - {"WSASendto", Func, 0}, - {"WSAStartup", Func, 0}, - {"WSTOPPED", Const, 0}, - {"WTRAPPED", Const, 1}, - {"WUNTRACED", Const, 0}, - {"Wait4", Func, 0}, - {"WaitForSingleObject", Func, 0}, - {"WaitStatus", Type, 0}, - {"WaitStatus.ExitCode", Field, 0}, - {"Win32FileAttributeData", Type, 0}, - {"Win32FileAttributeData.CreationTime", Field, 0}, - {"Win32FileAttributeData.FileAttributes", Field, 0}, - {"Win32FileAttributeData.FileSizeHigh", Field, 0}, - {"Win32FileAttributeData.FileSizeLow", Field, 0}, - {"Win32FileAttributeData.LastAccessTime", Field, 0}, - {"Win32FileAttributeData.LastWriteTime", Field, 0}, - {"Win32finddata", Type, 0}, - {"Win32finddata.AlternateFileName", Field, 0}, - {"Win32finddata.CreationTime", Field, 0}, - {"Win32finddata.FileAttributes", Field, 0}, - {"Win32finddata.FileName", Field, 0}, - {"Win32finddata.FileSizeHigh", Field, 0}, - {"Win32finddata.FileSizeLow", Field, 0}, - {"Win32finddata.LastAccessTime", Field, 0}, - {"Win32finddata.LastWriteTime", Field, 0}, - {"Win32finddata.Reserved0", Field, 0}, - {"Win32finddata.Reserved1", Field, 0}, - {"Write", Func, 0}, - {"WriteConsole", Func, 1}, - {"WriteFile", Func, 0}, - {"X509_ASN_ENCODING", Const, 0}, - {"XCASE", Const, 0}, - {"XP1_CONNECTIONLESS", Const, 2}, - {"XP1_CONNECT_DATA", Const, 2}, - {"XP1_DISCONNECT_DATA", Const, 2}, - {"XP1_EXPEDITED_DATA", Const, 2}, - {"XP1_GRACEFUL_CLOSE", Const, 2}, - {"XP1_GUARANTEED_DELIVERY", Const, 2}, - {"XP1_GUARANTEED_ORDER", Const, 2}, - {"XP1_IFS_HANDLES", Const, 2}, - {"XP1_MESSAGE_ORIENTED", Const, 2}, - {"XP1_MULTIPOINT_CONTROL_PLANE", Const, 2}, - {"XP1_MULTIPOINT_DATA_PLANE", Const, 2}, - {"XP1_PARTIAL_MESSAGE", Const, 2}, - {"XP1_PSEUDO_STREAM", Const, 2}, - {"XP1_QOS_SUPPORTED", Const, 2}, - {"XP1_SAN_SUPPORT_SDP", Const, 2}, - {"XP1_SUPPORT_BROADCAST", Const, 2}, - {"XP1_SUPPORT_MULTIPOINT", Const, 2}, - {"XP1_UNI_RECV", Const, 2}, - {"XP1_UNI_SEND", Const, 2}, - }, - "syscall/js": { - {"CopyBytesToGo", Func, 0}, - {"CopyBytesToJS", Func, 0}, - {"Error", Type, 0}, - {"Func", Type, 0}, - {"FuncOf", Func, 0}, - {"Global", Func, 0}, - {"Null", Func, 0}, - {"Type", Type, 0}, - {"TypeBoolean", Const, 0}, - {"TypeFunction", Const, 0}, - {"TypeNull", Const, 0}, - {"TypeNumber", Const, 0}, - {"TypeObject", Const, 0}, - {"TypeString", Const, 0}, - {"TypeSymbol", Const, 0}, - {"TypeUndefined", Const, 0}, - {"Undefined", Func, 0}, - {"Value", Type, 0}, - {"ValueError", Type, 0}, - {"ValueOf", Func, 0}, - }, - "testing": { - {"(*B).Cleanup", Method, 14}, - {"(*B).Elapsed", Method, 20}, - {"(*B).Error", Method, 0}, - {"(*B).Errorf", Method, 0}, - {"(*B).Fail", Method, 0}, - {"(*B).FailNow", Method, 0}, - {"(*B).Failed", Method, 0}, - {"(*B).Fatal", Method, 0}, - {"(*B).Fatalf", Method, 0}, - {"(*B).Helper", Method, 9}, - {"(*B).Log", Method, 0}, - {"(*B).Logf", Method, 0}, - {"(*B).Name", Method, 8}, - {"(*B).ReportAllocs", Method, 1}, - {"(*B).ReportMetric", Method, 13}, - {"(*B).ResetTimer", Method, 0}, - {"(*B).Run", Method, 7}, - {"(*B).RunParallel", Method, 3}, - {"(*B).SetBytes", Method, 0}, - {"(*B).SetParallelism", Method, 3}, - {"(*B).Setenv", Method, 17}, - {"(*B).Skip", Method, 1}, - {"(*B).SkipNow", Method, 1}, - {"(*B).Skipf", Method, 1}, - {"(*B).Skipped", Method, 1}, - {"(*B).StartTimer", Method, 0}, - {"(*B).StopTimer", Method, 0}, - {"(*B).TempDir", Method, 15}, - {"(*F).Add", Method, 18}, - {"(*F).Cleanup", Method, 18}, - {"(*F).Error", Method, 18}, - {"(*F).Errorf", Method, 18}, - {"(*F).Fail", Method, 18}, - {"(*F).FailNow", Method, 18}, - {"(*F).Failed", Method, 18}, - {"(*F).Fatal", Method, 18}, - {"(*F).Fatalf", Method, 18}, - {"(*F).Fuzz", Method, 18}, - {"(*F).Helper", Method, 18}, - {"(*F).Log", Method, 18}, - {"(*F).Logf", Method, 18}, - {"(*F).Name", Method, 18}, - {"(*F).Setenv", Method, 18}, - {"(*F).Skip", Method, 18}, - {"(*F).SkipNow", Method, 18}, - {"(*F).Skipf", Method, 18}, - {"(*F).Skipped", Method, 18}, - {"(*F).TempDir", Method, 18}, - {"(*M).Run", Method, 4}, - {"(*PB).Next", Method, 3}, - {"(*T).Cleanup", Method, 14}, - {"(*T).Deadline", Method, 15}, - {"(*T).Error", Method, 0}, - {"(*T).Errorf", Method, 0}, - {"(*T).Fail", Method, 0}, - {"(*T).FailNow", Method, 0}, - {"(*T).Failed", Method, 0}, - {"(*T).Fatal", Method, 0}, - {"(*T).Fatalf", Method, 0}, - {"(*T).Helper", Method, 9}, - {"(*T).Log", Method, 0}, - {"(*T).Logf", Method, 0}, - {"(*T).Name", Method, 8}, - {"(*T).Parallel", Method, 0}, - {"(*T).Run", Method, 7}, - {"(*T).Setenv", Method, 17}, - {"(*T).Skip", Method, 1}, - {"(*T).SkipNow", Method, 1}, - {"(*T).Skipf", Method, 1}, - {"(*T).Skipped", Method, 1}, - {"(*T).TempDir", Method, 15}, - {"(BenchmarkResult).AllocedBytesPerOp", Method, 1}, - {"(BenchmarkResult).AllocsPerOp", Method, 1}, - {"(BenchmarkResult).MemString", Method, 1}, - {"(BenchmarkResult).NsPerOp", Method, 0}, - {"(BenchmarkResult).String", Method, 0}, - {"AllocsPerRun", Func, 1}, - {"B", Type, 0}, - {"B.N", Field, 0}, - {"Benchmark", Func, 0}, - {"BenchmarkResult", Type, 0}, - {"BenchmarkResult.Bytes", Field, 0}, - {"BenchmarkResult.Extra", Field, 13}, - {"BenchmarkResult.MemAllocs", Field, 1}, - {"BenchmarkResult.MemBytes", Field, 1}, - {"BenchmarkResult.N", Field, 0}, - {"BenchmarkResult.T", Field, 0}, - {"Cover", Type, 2}, - {"Cover.Blocks", Field, 2}, - {"Cover.Counters", Field, 2}, - {"Cover.CoveredPackages", Field, 2}, - {"Cover.Mode", Field, 2}, - {"CoverBlock", Type, 2}, - {"CoverBlock.Col0", Field, 2}, - {"CoverBlock.Col1", Field, 2}, - {"CoverBlock.Line0", Field, 2}, - {"CoverBlock.Line1", Field, 2}, - {"CoverBlock.Stmts", Field, 2}, - {"CoverMode", Func, 8}, - {"Coverage", Func, 4}, - {"F", Type, 18}, - {"Init", Func, 13}, - {"InternalBenchmark", Type, 0}, - {"InternalBenchmark.F", Field, 0}, - {"InternalBenchmark.Name", Field, 0}, - {"InternalExample", Type, 0}, - {"InternalExample.F", Field, 0}, - {"InternalExample.Name", Field, 0}, - {"InternalExample.Output", Field, 0}, - {"InternalExample.Unordered", Field, 7}, - {"InternalFuzzTarget", Type, 18}, - {"InternalFuzzTarget.Fn", Field, 18}, - {"InternalFuzzTarget.Name", Field, 18}, - {"InternalTest", Type, 0}, - {"InternalTest.F", Field, 0}, - {"InternalTest.Name", Field, 0}, - {"M", Type, 4}, - {"Main", Func, 0}, - {"MainStart", Func, 4}, - {"PB", Type, 3}, - {"RegisterCover", Func, 2}, - {"RunBenchmarks", Func, 0}, - {"RunExamples", Func, 0}, - {"RunTests", Func, 0}, - {"Short", Func, 0}, - {"T", Type, 0}, - {"TB", Type, 2}, - {"Testing", Func, 21}, - {"Verbose", Func, 1}, - }, - "testing/fstest": { - {"(MapFS).Glob", Method, 16}, - {"(MapFS).Open", Method, 16}, - {"(MapFS).ReadDir", Method, 16}, - {"(MapFS).ReadFile", Method, 16}, - {"(MapFS).Stat", Method, 16}, - {"(MapFS).Sub", Method, 16}, - {"MapFS", Type, 16}, - {"MapFile", Type, 16}, - {"MapFile.Data", Field, 16}, - {"MapFile.ModTime", Field, 16}, - {"MapFile.Mode", Field, 16}, - {"MapFile.Sys", Field, 16}, - {"TestFS", Func, 16}, - }, - "testing/iotest": { - {"DataErrReader", Func, 0}, - {"ErrReader", Func, 16}, - {"ErrTimeout", Var, 0}, - {"HalfReader", Func, 0}, - {"NewReadLogger", Func, 0}, - {"NewWriteLogger", Func, 0}, - {"OneByteReader", Func, 0}, - {"TestReader", Func, 16}, - {"TimeoutReader", Func, 0}, - {"TruncateWriter", Func, 0}, - }, - "testing/quick": { - {"(*CheckEqualError).Error", Method, 0}, - {"(*CheckError).Error", Method, 0}, - {"(SetupError).Error", Method, 0}, - {"Check", Func, 0}, - {"CheckEqual", Func, 0}, - {"CheckEqualError", Type, 0}, - {"CheckEqualError.CheckError", Field, 0}, - {"CheckEqualError.Out1", Field, 0}, - {"CheckEqualError.Out2", Field, 0}, - {"CheckError", Type, 0}, - {"CheckError.Count", Field, 0}, - {"CheckError.In", Field, 0}, - {"Config", Type, 0}, - {"Config.MaxCount", Field, 0}, - {"Config.MaxCountScale", Field, 0}, - {"Config.Rand", Field, 0}, - {"Config.Values", Field, 0}, - {"Generator", Type, 0}, - {"SetupError", Type, 0}, - {"Value", Func, 0}, - }, - "testing/slogtest": { - {"Run", Func, 22}, - {"TestHandler", Func, 21}, - }, - "text/scanner": { - {"(*Position).IsValid", Method, 0}, - {"(*Scanner).Init", Method, 0}, - {"(*Scanner).IsValid", Method, 0}, - {"(*Scanner).Next", Method, 0}, - {"(*Scanner).Peek", Method, 0}, - {"(*Scanner).Pos", Method, 0}, - {"(*Scanner).Scan", Method, 0}, - {"(*Scanner).TokenText", Method, 0}, - {"(Position).String", Method, 0}, - {"(Scanner).String", Method, 0}, - {"Char", Const, 0}, - {"Comment", Const, 0}, - {"EOF", Const, 0}, - {"Float", Const, 0}, - {"GoTokens", Const, 0}, - {"GoWhitespace", Const, 0}, - {"Ident", Const, 0}, - {"Int", Const, 0}, - {"Position", Type, 0}, - {"Position.Column", Field, 0}, - {"Position.Filename", Field, 0}, - {"Position.Line", Field, 0}, - {"Position.Offset", Field, 0}, - {"RawString", Const, 0}, - {"ScanChars", Const, 0}, - {"ScanComments", Const, 0}, - {"ScanFloats", Const, 0}, - {"ScanIdents", Const, 0}, - {"ScanInts", Const, 0}, - {"ScanRawStrings", Const, 0}, - {"ScanStrings", Const, 0}, - {"Scanner", Type, 0}, - {"Scanner.Error", Field, 0}, - {"Scanner.ErrorCount", Field, 0}, - {"Scanner.IsIdentRune", Field, 4}, - {"Scanner.Mode", Field, 0}, - {"Scanner.Position", Field, 0}, - {"Scanner.Whitespace", Field, 0}, - {"SkipComments", Const, 0}, - {"String", Const, 0}, - {"TokenString", Func, 0}, - }, - "text/tabwriter": { - {"(*Writer).Flush", Method, 0}, - {"(*Writer).Init", Method, 0}, - {"(*Writer).Write", Method, 0}, - {"AlignRight", Const, 0}, - {"Debug", Const, 0}, - {"DiscardEmptyColumns", Const, 0}, - {"Escape", Const, 0}, - {"FilterHTML", Const, 0}, - {"NewWriter", Func, 0}, - {"StripEscape", Const, 0}, - {"TabIndent", Const, 0}, - {"Writer", Type, 0}, - }, - "text/template": { - {"(*Template).AddParseTree", Method, 0}, - {"(*Template).Clone", Method, 0}, - {"(*Template).DefinedTemplates", Method, 5}, - {"(*Template).Delims", Method, 0}, - {"(*Template).Execute", Method, 0}, - {"(*Template).ExecuteTemplate", Method, 0}, - {"(*Template).Funcs", Method, 0}, - {"(*Template).Lookup", Method, 0}, - {"(*Template).Name", Method, 0}, - {"(*Template).New", Method, 0}, - {"(*Template).Option", Method, 5}, - {"(*Template).Parse", Method, 0}, - {"(*Template).ParseFS", Method, 16}, - {"(*Template).ParseFiles", Method, 0}, - {"(*Template).ParseGlob", Method, 0}, - {"(*Template).Templates", Method, 0}, - {"(ExecError).Error", Method, 6}, - {"(ExecError).Unwrap", Method, 13}, - {"(Template).Copy", Method, 2}, - {"(Template).ErrorContext", Method, 1}, - {"ExecError", Type, 6}, - {"ExecError.Err", Field, 6}, - {"ExecError.Name", Field, 6}, - {"FuncMap", Type, 0}, - {"HTMLEscape", Func, 0}, - {"HTMLEscapeString", Func, 0}, - {"HTMLEscaper", Func, 0}, - {"IsTrue", Func, 6}, - {"JSEscape", Func, 0}, - {"JSEscapeString", Func, 0}, - {"JSEscaper", Func, 0}, - {"Must", Func, 0}, - {"New", Func, 0}, - {"ParseFS", Func, 16}, - {"ParseFiles", Func, 0}, - {"ParseGlob", Func, 0}, - {"Template", Type, 0}, - {"Template.Tree", Field, 0}, - {"URLQueryEscaper", Func, 0}, - }, - "text/template/parse": { - {"(*ActionNode).Copy", Method, 0}, - {"(*ActionNode).String", Method, 0}, - {"(*BoolNode).Copy", Method, 0}, - {"(*BoolNode).String", Method, 0}, - {"(*BranchNode).Copy", Method, 4}, - {"(*BranchNode).String", Method, 0}, - {"(*BreakNode).Copy", Method, 18}, - {"(*BreakNode).String", Method, 18}, - {"(*ChainNode).Add", Method, 1}, - {"(*ChainNode).Copy", Method, 1}, - {"(*ChainNode).String", Method, 1}, - {"(*CommandNode).Copy", Method, 0}, - {"(*CommandNode).String", Method, 0}, - {"(*CommentNode).Copy", Method, 16}, - {"(*CommentNode).String", Method, 16}, - {"(*ContinueNode).Copy", Method, 18}, - {"(*ContinueNode).String", Method, 18}, - {"(*DotNode).Copy", Method, 0}, - {"(*DotNode).String", Method, 0}, - {"(*DotNode).Type", Method, 0}, - {"(*FieldNode).Copy", Method, 0}, - {"(*FieldNode).String", Method, 0}, - {"(*IdentifierNode).Copy", Method, 0}, - {"(*IdentifierNode).SetPos", Method, 1}, - {"(*IdentifierNode).SetTree", Method, 4}, - {"(*IdentifierNode).String", Method, 0}, - {"(*IfNode).Copy", Method, 0}, - {"(*IfNode).String", Method, 0}, - {"(*ListNode).Copy", Method, 0}, - {"(*ListNode).CopyList", Method, 0}, - {"(*ListNode).String", Method, 0}, - {"(*NilNode).Copy", Method, 1}, - {"(*NilNode).String", Method, 1}, - {"(*NilNode).Type", Method, 1}, - {"(*NumberNode).Copy", Method, 0}, - {"(*NumberNode).String", Method, 0}, - {"(*PipeNode).Copy", Method, 0}, - {"(*PipeNode).CopyPipe", Method, 0}, - {"(*PipeNode).String", Method, 0}, - {"(*RangeNode).Copy", Method, 0}, - {"(*RangeNode).String", Method, 0}, - {"(*StringNode).Copy", Method, 0}, - {"(*StringNode).String", Method, 0}, - {"(*TemplateNode).Copy", Method, 0}, - {"(*TemplateNode).String", Method, 0}, - {"(*TextNode).Copy", Method, 0}, - {"(*TextNode).String", Method, 0}, - {"(*Tree).Copy", Method, 2}, - {"(*Tree).ErrorContext", Method, 1}, - {"(*Tree).Parse", Method, 0}, - {"(*VariableNode).Copy", Method, 0}, - {"(*VariableNode).String", Method, 0}, - {"(*WithNode).Copy", Method, 0}, - {"(*WithNode).String", Method, 0}, - {"(ActionNode).Position", Method, 1}, - {"(ActionNode).Type", Method, 0}, - {"(BoolNode).Position", Method, 1}, - {"(BoolNode).Type", Method, 0}, - {"(BranchNode).Position", Method, 1}, - {"(BranchNode).Type", Method, 0}, - {"(BreakNode).Position", Method, 18}, - {"(BreakNode).Type", Method, 18}, - {"(ChainNode).Position", Method, 1}, - {"(ChainNode).Type", Method, 1}, - {"(CommandNode).Position", Method, 1}, - {"(CommandNode).Type", Method, 0}, - {"(CommentNode).Position", Method, 16}, - {"(CommentNode).Type", Method, 16}, - {"(ContinueNode).Position", Method, 18}, - {"(ContinueNode).Type", Method, 18}, - {"(DotNode).Position", Method, 1}, - {"(FieldNode).Position", Method, 1}, - {"(FieldNode).Type", Method, 0}, - {"(IdentifierNode).Position", Method, 1}, - {"(IdentifierNode).Type", Method, 0}, - {"(IfNode).Position", Method, 1}, - {"(IfNode).Type", Method, 0}, - {"(ListNode).Position", Method, 1}, - {"(ListNode).Type", Method, 0}, - {"(NilNode).Position", Method, 1}, - {"(NodeType).Type", Method, 0}, - {"(NumberNode).Position", Method, 1}, - {"(NumberNode).Type", Method, 0}, - {"(PipeNode).Position", Method, 1}, - {"(PipeNode).Type", Method, 0}, - {"(Pos).Position", Method, 1}, - {"(RangeNode).Position", Method, 1}, - {"(RangeNode).Type", Method, 0}, - {"(StringNode).Position", Method, 1}, - {"(StringNode).Type", Method, 0}, - {"(TemplateNode).Position", Method, 1}, - {"(TemplateNode).Type", Method, 0}, - {"(TextNode).Position", Method, 1}, - {"(TextNode).Type", Method, 0}, - {"(VariableNode).Position", Method, 1}, - {"(VariableNode).Type", Method, 0}, - {"(WithNode).Position", Method, 1}, - {"(WithNode).Type", Method, 0}, - {"ActionNode", Type, 0}, - {"ActionNode.Line", Field, 0}, - {"ActionNode.NodeType", Field, 0}, - {"ActionNode.Pipe", Field, 0}, - {"ActionNode.Pos", Field, 1}, - {"BoolNode", Type, 0}, - {"BoolNode.NodeType", Field, 0}, - {"BoolNode.Pos", Field, 1}, - {"BoolNode.True", Field, 0}, - {"BranchNode", Type, 0}, - {"BranchNode.ElseList", Field, 0}, - {"BranchNode.Line", Field, 0}, - {"BranchNode.List", Field, 0}, - {"BranchNode.NodeType", Field, 0}, - {"BranchNode.Pipe", Field, 0}, - {"BranchNode.Pos", Field, 1}, - {"BreakNode", Type, 18}, - {"BreakNode.Line", Field, 18}, - {"BreakNode.NodeType", Field, 18}, - {"BreakNode.Pos", Field, 18}, - {"ChainNode", Type, 1}, - {"ChainNode.Field", Field, 1}, - {"ChainNode.Node", Field, 1}, - {"ChainNode.NodeType", Field, 1}, - {"ChainNode.Pos", Field, 1}, - {"CommandNode", Type, 0}, - {"CommandNode.Args", Field, 0}, - {"CommandNode.NodeType", Field, 0}, - {"CommandNode.Pos", Field, 1}, - {"CommentNode", Type, 16}, - {"CommentNode.NodeType", Field, 16}, - {"CommentNode.Pos", Field, 16}, - {"CommentNode.Text", Field, 16}, - {"ContinueNode", Type, 18}, - {"ContinueNode.Line", Field, 18}, - {"ContinueNode.NodeType", Field, 18}, - {"ContinueNode.Pos", Field, 18}, - {"DotNode", Type, 0}, - {"DotNode.NodeType", Field, 4}, - {"DotNode.Pos", Field, 1}, - {"FieldNode", Type, 0}, - {"FieldNode.Ident", Field, 0}, - {"FieldNode.NodeType", Field, 0}, - {"FieldNode.Pos", Field, 1}, - {"IdentifierNode", Type, 0}, - {"IdentifierNode.Ident", Field, 0}, - {"IdentifierNode.NodeType", Field, 0}, - {"IdentifierNode.Pos", Field, 1}, - {"IfNode", Type, 0}, - {"IfNode.BranchNode", Field, 0}, - {"IsEmptyTree", Func, 0}, - {"ListNode", Type, 0}, - {"ListNode.NodeType", Field, 0}, - {"ListNode.Nodes", Field, 0}, - {"ListNode.Pos", Field, 1}, - {"Mode", Type, 16}, - {"New", Func, 0}, - {"NewIdentifier", Func, 0}, - {"NilNode", Type, 1}, - {"NilNode.NodeType", Field, 4}, - {"NilNode.Pos", Field, 1}, - {"Node", Type, 0}, - {"NodeAction", Const, 0}, - {"NodeBool", Const, 0}, - {"NodeBreak", Const, 18}, - {"NodeChain", Const, 1}, - {"NodeCommand", Const, 0}, - {"NodeComment", Const, 16}, - {"NodeContinue", Const, 18}, - {"NodeDot", Const, 0}, - {"NodeField", Const, 0}, - {"NodeIdentifier", Const, 0}, - {"NodeIf", Const, 0}, - {"NodeList", Const, 0}, - {"NodeNil", Const, 1}, - {"NodeNumber", Const, 0}, - {"NodePipe", Const, 0}, - {"NodeRange", Const, 0}, - {"NodeString", Const, 0}, - {"NodeTemplate", Const, 0}, - {"NodeText", Const, 0}, - {"NodeType", Type, 0}, - {"NodeVariable", Const, 0}, - {"NodeWith", Const, 0}, - {"NumberNode", Type, 0}, - {"NumberNode.Complex128", Field, 0}, - {"NumberNode.Float64", Field, 0}, - {"NumberNode.Int64", Field, 0}, - {"NumberNode.IsComplex", Field, 0}, - {"NumberNode.IsFloat", Field, 0}, - {"NumberNode.IsInt", Field, 0}, - {"NumberNode.IsUint", Field, 0}, - {"NumberNode.NodeType", Field, 0}, - {"NumberNode.Pos", Field, 1}, - {"NumberNode.Text", Field, 0}, - {"NumberNode.Uint64", Field, 0}, - {"Parse", Func, 0}, - {"ParseComments", Const, 16}, - {"PipeNode", Type, 0}, - {"PipeNode.Cmds", Field, 0}, - {"PipeNode.Decl", Field, 0}, - {"PipeNode.IsAssign", Field, 11}, - {"PipeNode.Line", Field, 0}, - {"PipeNode.NodeType", Field, 0}, - {"PipeNode.Pos", Field, 1}, - {"Pos", Type, 1}, - {"RangeNode", Type, 0}, - {"RangeNode.BranchNode", Field, 0}, - {"SkipFuncCheck", Const, 17}, - {"StringNode", Type, 0}, - {"StringNode.NodeType", Field, 0}, - {"StringNode.Pos", Field, 1}, - {"StringNode.Quoted", Field, 0}, - {"StringNode.Text", Field, 0}, - {"TemplateNode", Type, 0}, - {"TemplateNode.Line", Field, 0}, - {"TemplateNode.Name", Field, 0}, - {"TemplateNode.NodeType", Field, 0}, - {"TemplateNode.Pipe", Field, 0}, - {"TemplateNode.Pos", Field, 1}, - {"TextNode", Type, 0}, - {"TextNode.NodeType", Field, 0}, - {"TextNode.Pos", Field, 1}, - {"TextNode.Text", Field, 0}, - {"Tree", Type, 0}, - {"Tree.Mode", Field, 16}, - {"Tree.Name", Field, 0}, - {"Tree.ParseName", Field, 1}, - {"Tree.Root", Field, 0}, - {"VariableNode", Type, 0}, - {"VariableNode.Ident", Field, 0}, - {"VariableNode.NodeType", Field, 0}, - {"VariableNode.Pos", Field, 1}, - {"WithNode", Type, 0}, - {"WithNode.BranchNode", Field, 0}, - }, - "time": { - {"(*Location).String", Method, 0}, - {"(*ParseError).Error", Method, 0}, - {"(*Ticker).Reset", Method, 15}, - {"(*Ticker).Stop", Method, 0}, - {"(*Time).GobDecode", Method, 0}, - {"(*Time).UnmarshalBinary", Method, 2}, - {"(*Time).UnmarshalJSON", Method, 0}, - {"(*Time).UnmarshalText", Method, 2}, - {"(*Timer).Reset", Method, 1}, - {"(*Timer).Stop", Method, 0}, - {"(Duration).Abs", Method, 19}, - {"(Duration).Hours", Method, 0}, - {"(Duration).Microseconds", Method, 13}, - {"(Duration).Milliseconds", Method, 13}, - {"(Duration).Minutes", Method, 0}, - {"(Duration).Nanoseconds", Method, 0}, - {"(Duration).Round", Method, 9}, - {"(Duration).Seconds", Method, 0}, - {"(Duration).String", Method, 0}, - {"(Duration).Truncate", Method, 9}, - {"(Month).String", Method, 0}, - {"(Time).Add", Method, 0}, - {"(Time).AddDate", Method, 0}, - {"(Time).After", Method, 0}, - {"(Time).AppendFormat", Method, 5}, - {"(Time).Before", Method, 0}, - {"(Time).Clock", Method, 0}, - {"(Time).Compare", Method, 20}, - {"(Time).Date", Method, 0}, - {"(Time).Day", Method, 0}, - {"(Time).Equal", Method, 0}, - {"(Time).Format", Method, 0}, - {"(Time).GoString", Method, 17}, - {"(Time).GobEncode", Method, 0}, - {"(Time).Hour", Method, 0}, - {"(Time).ISOWeek", Method, 0}, - {"(Time).In", Method, 0}, - {"(Time).IsDST", Method, 17}, - {"(Time).IsZero", Method, 0}, - {"(Time).Local", Method, 0}, - {"(Time).Location", Method, 0}, - {"(Time).MarshalBinary", Method, 2}, - {"(Time).MarshalJSON", Method, 0}, - {"(Time).MarshalText", Method, 2}, - {"(Time).Minute", Method, 0}, - {"(Time).Month", Method, 0}, - {"(Time).Nanosecond", Method, 0}, - {"(Time).Round", Method, 1}, - {"(Time).Second", Method, 0}, - {"(Time).String", Method, 0}, - {"(Time).Sub", Method, 0}, - {"(Time).Truncate", Method, 1}, - {"(Time).UTC", Method, 0}, - {"(Time).Unix", Method, 0}, - {"(Time).UnixMicro", Method, 17}, - {"(Time).UnixMilli", Method, 17}, - {"(Time).UnixNano", Method, 0}, - {"(Time).Weekday", Method, 0}, - {"(Time).Year", Method, 0}, - {"(Time).YearDay", Method, 1}, - {"(Time).Zone", Method, 0}, - {"(Time).ZoneBounds", Method, 19}, - {"(Weekday).String", Method, 0}, - {"ANSIC", Const, 0}, - {"After", Func, 0}, - {"AfterFunc", Func, 0}, - {"April", Const, 0}, - {"August", Const, 0}, - {"Date", Func, 0}, - {"DateOnly", Const, 20}, - {"DateTime", Const, 20}, - {"December", Const, 0}, - {"Duration", Type, 0}, - {"February", Const, 0}, - {"FixedZone", Func, 0}, - {"Friday", Const, 0}, - {"Hour", Const, 0}, - {"January", Const, 0}, - {"July", Const, 0}, - {"June", Const, 0}, - {"Kitchen", Const, 0}, - {"Layout", Const, 17}, - {"LoadLocation", Func, 0}, - {"LoadLocationFromTZData", Func, 10}, - {"Local", Var, 0}, - {"Location", Type, 0}, - {"March", Const, 0}, - {"May", Const, 0}, - {"Microsecond", Const, 0}, - {"Millisecond", Const, 0}, - {"Minute", Const, 0}, - {"Monday", Const, 0}, - {"Month", Type, 0}, - {"Nanosecond", Const, 0}, - {"NewTicker", Func, 0}, - {"NewTimer", Func, 0}, - {"November", Const, 0}, - {"Now", Func, 0}, - {"October", Const, 0}, - {"Parse", Func, 0}, - {"ParseDuration", Func, 0}, - {"ParseError", Type, 0}, - {"ParseError.Layout", Field, 0}, - {"ParseError.LayoutElem", Field, 0}, - {"ParseError.Message", Field, 0}, - {"ParseError.Value", Field, 0}, - {"ParseError.ValueElem", Field, 0}, - {"ParseInLocation", Func, 1}, - {"RFC1123", Const, 0}, - {"RFC1123Z", Const, 0}, - {"RFC3339", Const, 0}, - {"RFC3339Nano", Const, 0}, - {"RFC822", Const, 0}, - {"RFC822Z", Const, 0}, - {"RFC850", Const, 0}, - {"RubyDate", Const, 0}, - {"Saturday", Const, 0}, - {"Second", Const, 0}, - {"September", Const, 0}, - {"Since", Func, 0}, - {"Sleep", Func, 0}, - {"Stamp", Const, 0}, - {"StampMicro", Const, 0}, - {"StampMilli", Const, 0}, - {"StampNano", Const, 0}, - {"Sunday", Const, 0}, - {"Thursday", Const, 0}, - {"Tick", Func, 0}, - {"Ticker", Type, 0}, - {"Ticker.C", Field, 0}, - {"Time", Type, 0}, - {"TimeOnly", Const, 20}, - {"Timer", Type, 0}, - {"Timer.C", Field, 0}, - {"Tuesday", Const, 0}, - {"UTC", Var, 0}, - {"Unix", Func, 0}, - {"UnixDate", Const, 0}, - {"UnixMicro", Func, 17}, - {"UnixMilli", Func, 17}, - {"Until", Func, 8}, - {"Wednesday", Const, 0}, - {"Weekday", Type, 0}, - }, - "unicode": { - {"(SpecialCase).ToLower", Method, 0}, - {"(SpecialCase).ToTitle", Method, 0}, - {"(SpecialCase).ToUpper", Method, 0}, - {"ASCII_Hex_Digit", Var, 0}, - {"Adlam", Var, 7}, - {"Ahom", Var, 5}, - {"Anatolian_Hieroglyphs", Var, 5}, - {"Arabic", Var, 0}, - {"Armenian", Var, 0}, - {"Avestan", Var, 0}, - {"AzeriCase", Var, 0}, - {"Balinese", Var, 0}, - {"Bamum", Var, 0}, - {"Bassa_Vah", Var, 4}, - {"Batak", Var, 0}, - {"Bengali", Var, 0}, - {"Bhaiksuki", Var, 7}, - {"Bidi_Control", Var, 0}, - {"Bopomofo", Var, 0}, - {"Brahmi", Var, 0}, - {"Braille", Var, 0}, - {"Buginese", Var, 0}, - {"Buhid", Var, 0}, - {"C", Var, 0}, - {"Canadian_Aboriginal", Var, 0}, - {"Carian", Var, 0}, - {"CaseRange", Type, 0}, - {"CaseRange.Delta", Field, 0}, - {"CaseRange.Hi", Field, 0}, - {"CaseRange.Lo", Field, 0}, - {"CaseRanges", Var, 0}, - {"Categories", Var, 0}, - {"Caucasian_Albanian", Var, 4}, - {"Cc", Var, 0}, - {"Cf", Var, 0}, - {"Chakma", Var, 1}, - {"Cham", Var, 0}, - {"Cherokee", Var, 0}, - {"Chorasmian", Var, 16}, - {"Co", Var, 0}, - {"Common", Var, 0}, - {"Coptic", Var, 0}, - {"Cs", Var, 0}, - {"Cuneiform", Var, 0}, - {"Cypriot", Var, 0}, - {"Cypro_Minoan", Var, 21}, - {"Cyrillic", Var, 0}, - {"Dash", Var, 0}, - {"Deprecated", Var, 0}, - {"Deseret", Var, 0}, - {"Devanagari", Var, 0}, - {"Diacritic", Var, 0}, - {"Digit", Var, 0}, - {"Dives_Akuru", Var, 16}, - {"Dogra", Var, 13}, - {"Duployan", Var, 4}, - {"Egyptian_Hieroglyphs", Var, 0}, - {"Elbasan", Var, 4}, - {"Elymaic", Var, 14}, - {"Ethiopic", Var, 0}, - {"Extender", Var, 0}, - {"FoldCategory", Var, 0}, - {"FoldScript", Var, 0}, - {"Georgian", Var, 0}, - {"Glagolitic", Var, 0}, - {"Gothic", Var, 0}, - {"Grantha", Var, 4}, - {"GraphicRanges", Var, 0}, - {"Greek", Var, 0}, - {"Gujarati", Var, 0}, - {"Gunjala_Gondi", Var, 13}, - {"Gurmukhi", Var, 0}, - {"Han", Var, 0}, - {"Hangul", Var, 0}, - {"Hanifi_Rohingya", Var, 13}, - {"Hanunoo", Var, 0}, - {"Hatran", Var, 5}, - {"Hebrew", Var, 0}, - {"Hex_Digit", Var, 0}, - {"Hiragana", Var, 0}, - {"Hyphen", Var, 0}, - {"IDS_Binary_Operator", Var, 0}, - {"IDS_Trinary_Operator", Var, 0}, - {"Ideographic", Var, 0}, - {"Imperial_Aramaic", Var, 0}, - {"In", Func, 2}, - {"Inherited", Var, 0}, - {"Inscriptional_Pahlavi", Var, 0}, - {"Inscriptional_Parthian", Var, 0}, - {"Is", Func, 0}, - {"IsControl", Func, 0}, - {"IsDigit", Func, 0}, - {"IsGraphic", Func, 0}, - {"IsLetter", Func, 0}, - {"IsLower", Func, 0}, - {"IsMark", Func, 0}, - {"IsNumber", Func, 0}, - {"IsOneOf", Func, 0}, - {"IsPrint", Func, 0}, - {"IsPunct", Func, 0}, - {"IsSpace", Func, 0}, - {"IsSymbol", Func, 0}, - {"IsTitle", Func, 0}, - {"IsUpper", Func, 0}, - {"Javanese", Var, 0}, - {"Join_Control", Var, 0}, - {"Kaithi", Var, 0}, - {"Kannada", Var, 0}, - {"Katakana", Var, 0}, - {"Kawi", Var, 21}, - {"Kayah_Li", Var, 0}, - {"Kharoshthi", Var, 0}, - {"Khitan_Small_Script", Var, 16}, - {"Khmer", Var, 0}, - {"Khojki", Var, 4}, - {"Khudawadi", Var, 4}, - {"L", Var, 0}, - {"Lao", Var, 0}, - {"Latin", Var, 0}, - {"Lepcha", Var, 0}, - {"Letter", Var, 0}, - {"Limbu", Var, 0}, - {"Linear_A", Var, 4}, - {"Linear_B", Var, 0}, - {"Lisu", Var, 0}, - {"Ll", Var, 0}, - {"Lm", Var, 0}, - {"Lo", Var, 0}, - {"Logical_Order_Exception", Var, 0}, - {"Lower", Var, 0}, - {"LowerCase", Const, 0}, - {"Lt", Var, 0}, - {"Lu", Var, 0}, - {"Lycian", Var, 0}, - {"Lydian", Var, 0}, - {"M", Var, 0}, - {"Mahajani", Var, 4}, - {"Makasar", Var, 13}, - {"Malayalam", Var, 0}, - {"Mandaic", Var, 0}, - {"Manichaean", Var, 4}, - {"Marchen", Var, 7}, - {"Mark", Var, 0}, - {"Masaram_Gondi", Var, 10}, - {"MaxASCII", Const, 0}, - {"MaxCase", Const, 0}, - {"MaxLatin1", Const, 0}, - {"MaxRune", Const, 0}, - {"Mc", Var, 0}, - {"Me", Var, 0}, - {"Medefaidrin", Var, 13}, - {"Meetei_Mayek", Var, 0}, - {"Mende_Kikakui", Var, 4}, - {"Meroitic_Cursive", Var, 1}, - {"Meroitic_Hieroglyphs", Var, 1}, - {"Miao", Var, 1}, - {"Mn", Var, 0}, - {"Modi", Var, 4}, - {"Mongolian", Var, 0}, - {"Mro", Var, 4}, - {"Multani", Var, 5}, - {"Myanmar", Var, 0}, - {"N", Var, 0}, - {"Nabataean", Var, 4}, - {"Nag_Mundari", Var, 21}, - {"Nandinagari", Var, 14}, - {"Nd", Var, 0}, - {"New_Tai_Lue", Var, 0}, - {"Newa", Var, 7}, - {"Nko", Var, 0}, - {"Nl", Var, 0}, - {"No", Var, 0}, - {"Noncharacter_Code_Point", Var, 0}, - {"Number", Var, 0}, - {"Nushu", Var, 10}, - {"Nyiakeng_Puachue_Hmong", Var, 14}, - {"Ogham", Var, 0}, - {"Ol_Chiki", Var, 0}, - {"Old_Hungarian", Var, 5}, - {"Old_Italic", Var, 0}, - {"Old_North_Arabian", Var, 4}, - {"Old_Permic", Var, 4}, - {"Old_Persian", Var, 0}, - {"Old_Sogdian", Var, 13}, - {"Old_South_Arabian", Var, 0}, - {"Old_Turkic", Var, 0}, - {"Old_Uyghur", Var, 21}, - {"Oriya", Var, 0}, - {"Osage", Var, 7}, - {"Osmanya", Var, 0}, - {"Other", Var, 0}, - {"Other_Alphabetic", Var, 0}, - {"Other_Default_Ignorable_Code_Point", Var, 0}, - {"Other_Grapheme_Extend", Var, 0}, - {"Other_ID_Continue", Var, 0}, - {"Other_ID_Start", Var, 0}, - {"Other_Lowercase", Var, 0}, - {"Other_Math", Var, 0}, - {"Other_Uppercase", Var, 0}, - {"P", Var, 0}, - {"Pahawh_Hmong", Var, 4}, - {"Palmyrene", Var, 4}, - {"Pattern_Syntax", Var, 0}, - {"Pattern_White_Space", Var, 0}, - {"Pau_Cin_Hau", Var, 4}, - {"Pc", Var, 0}, - {"Pd", Var, 0}, - {"Pe", Var, 0}, - {"Pf", Var, 0}, - {"Phags_Pa", Var, 0}, - {"Phoenician", Var, 0}, - {"Pi", Var, 0}, - {"Po", Var, 0}, - {"Prepended_Concatenation_Mark", Var, 7}, - {"PrintRanges", Var, 0}, - {"Properties", Var, 0}, - {"Ps", Var, 0}, - {"Psalter_Pahlavi", Var, 4}, - {"Punct", Var, 0}, - {"Quotation_Mark", Var, 0}, - {"Radical", Var, 0}, - {"Range16", Type, 0}, - {"Range16.Hi", Field, 0}, - {"Range16.Lo", Field, 0}, - {"Range16.Stride", Field, 0}, - {"Range32", Type, 0}, - {"Range32.Hi", Field, 0}, - {"Range32.Lo", Field, 0}, - {"Range32.Stride", Field, 0}, - {"RangeTable", Type, 0}, - {"RangeTable.LatinOffset", Field, 1}, - {"RangeTable.R16", Field, 0}, - {"RangeTable.R32", Field, 0}, - {"Regional_Indicator", Var, 10}, - {"Rejang", Var, 0}, - {"ReplacementChar", Const, 0}, - {"Runic", Var, 0}, - {"S", Var, 0}, - {"STerm", Var, 0}, - {"Samaritan", Var, 0}, - {"Saurashtra", Var, 0}, - {"Sc", Var, 0}, - {"Scripts", Var, 0}, - {"Sentence_Terminal", Var, 7}, - {"Sharada", Var, 1}, - {"Shavian", Var, 0}, - {"Siddham", Var, 4}, - {"SignWriting", Var, 5}, - {"SimpleFold", Func, 0}, - {"Sinhala", Var, 0}, - {"Sk", Var, 0}, - {"Sm", Var, 0}, - {"So", Var, 0}, - {"Soft_Dotted", Var, 0}, - {"Sogdian", Var, 13}, - {"Sora_Sompeng", Var, 1}, - {"Soyombo", Var, 10}, - {"Space", Var, 0}, - {"SpecialCase", Type, 0}, - {"Sundanese", Var, 0}, - {"Syloti_Nagri", Var, 0}, - {"Symbol", Var, 0}, - {"Syriac", Var, 0}, - {"Tagalog", Var, 0}, - {"Tagbanwa", Var, 0}, - {"Tai_Le", Var, 0}, - {"Tai_Tham", Var, 0}, - {"Tai_Viet", Var, 0}, - {"Takri", Var, 1}, - {"Tamil", Var, 0}, - {"Tangsa", Var, 21}, - {"Tangut", Var, 7}, - {"Telugu", Var, 0}, - {"Terminal_Punctuation", Var, 0}, - {"Thaana", Var, 0}, - {"Thai", Var, 0}, - {"Tibetan", Var, 0}, - {"Tifinagh", Var, 0}, - {"Tirhuta", Var, 4}, - {"Title", Var, 0}, - {"TitleCase", Const, 0}, - {"To", Func, 0}, - {"ToLower", Func, 0}, - {"ToTitle", Func, 0}, - {"ToUpper", Func, 0}, - {"Toto", Var, 21}, - {"TurkishCase", Var, 0}, - {"Ugaritic", Var, 0}, - {"Unified_Ideograph", Var, 0}, - {"Upper", Var, 0}, - {"UpperCase", Const, 0}, - {"UpperLower", Const, 0}, - {"Vai", Var, 0}, - {"Variation_Selector", Var, 0}, - {"Version", Const, 0}, - {"Vithkuqi", Var, 21}, - {"Wancho", Var, 14}, - {"Warang_Citi", Var, 4}, - {"White_Space", Var, 0}, - {"Yezidi", Var, 16}, - {"Yi", Var, 0}, - {"Z", Var, 0}, - {"Zanabazar_Square", Var, 10}, - {"Zl", Var, 0}, - {"Zp", Var, 0}, - {"Zs", Var, 0}, - }, - "unicode/utf16": { - {"AppendRune", Func, 20}, - {"Decode", Func, 0}, - {"DecodeRune", Func, 0}, - {"Encode", Func, 0}, - {"EncodeRune", Func, 0}, - {"IsSurrogate", Func, 0}, - }, - "unicode/utf8": { - {"AppendRune", Func, 18}, - {"DecodeLastRune", Func, 0}, - {"DecodeLastRuneInString", Func, 0}, - {"DecodeRune", Func, 0}, - {"DecodeRuneInString", Func, 0}, - {"EncodeRune", Func, 0}, - {"FullRune", Func, 0}, - {"FullRuneInString", Func, 0}, - {"MaxRune", Const, 0}, - {"RuneCount", Func, 0}, - {"RuneCountInString", Func, 0}, - {"RuneError", Const, 0}, - {"RuneLen", Func, 0}, - {"RuneSelf", Const, 0}, - {"RuneStart", Func, 0}, - {"UTFMax", Const, 0}, - {"Valid", Func, 0}, - {"ValidRune", Func, 1}, - {"ValidString", Func, 0}, - }, - "unsafe": { - {"Add", Func, 0}, - {"Alignof", Func, 0}, - {"Offsetof", Func, 0}, - {"Pointer", Type, 0}, - {"Sizeof", Func, 0}, - {"Slice", Func, 0}, - {"SliceData", Func, 0}, - {"String", Func, 0}, - {"StringData", Func, 0}, - }, -} diff --git a/upstream/vendor/golang.org/x/tools/internal/stdlib/stdlib.go b/upstream/vendor/golang.org/x/tools/internal/stdlib/stdlib.go deleted file mode 100644 index 98904017f2c..00000000000 --- a/upstream/vendor/golang.org/x/tools/internal/stdlib/stdlib.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run generate.go - -// Package stdlib provides a table of all exported symbols in the -// standard library, along with the version at which they first -// appeared. -package stdlib - -import ( - "fmt" - "strings" -) - -type Symbol struct { - Name string - Kind Kind - Version Version // Go version that first included the symbol -} - -// A Kind indicates the kind of a symbol: -// function, variable, constant, type, and so on. -type Kind int8 - -const ( - Invalid Kind = iota // Example name: - Type // "Buffer" - Func // "Println" - Var // "EOF" - Const // "Pi" - Field // "Point.X" - Method // "(*Buffer).Grow" -) - -func (kind Kind) String() string { - return [...]string{ - Invalid: "invalid", - Type: "type", - Func: "func", - Var: "var", - Const: "const", - Field: "field", - Method: "method", - }[kind] -} - -// A Version represents a version of Go of the form "go1.%d". -type Version int8 - -// String returns a version string of the form "go1.23", without allocating. -func (v Version) String() string { return versions[v] } - -var versions [30]string // (increase constant as needed) - -func init() { - for i := range versions { - versions[i] = fmt.Sprintf("go1.%d", i) - } -} - -// HasPackage reports whether the specified package path is part of -// the standard library's public API. -func HasPackage(path string) bool { - _, ok := PackageSymbols[path] - return ok -} - -// SplitField splits the field symbol name into type and field -// components. It must be called only on Field symbols. -// -// Example: "File.Package" -> ("File", "Package") -func (sym *Symbol) SplitField() (typename, name string) { - if sym.Kind != Field { - panic("not a field") - } - typename, name, _ = strings.Cut(sym.Name, ".") - return -} - -// SplitMethod splits the method symbol name into pointer, receiver, -// and method components. It must be called only on Method symbols. -// -// Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow") -func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) { - if sym.Kind != Method { - panic("not a method") - } - recv, name, _ = strings.Cut(sym.Name, ".") - recv = recv[len("(") : len(recv)-len(")")] - ptr = recv[0] == '*' - if ptr { - recv = recv[len("*"):] - } - return -} diff --git a/upstream/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go b/upstream/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go new file mode 100644 index 00000000000..7e638ec24fc --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go @@ -0,0 +1,151 @@ +// 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 tokeninternal provides access to some internal features of the token +// package. +package tokeninternal + +import ( + "fmt" + "go/token" + "sort" + "sync" + "unsafe" +) + +// GetLines returns the table of line-start offsets from a token.File. +func GetLines(file *token.File) []int { + // token.File has a Lines method on Go 1.21 and later. + if file, ok := (interface{})(file).(interface{ Lines() []int }); ok { + return file.Lines() + } + + // This declaration must match that of token.File. + // This creates a risk of dependency skew. + // For now we check that the size of the two + // declarations is the same, on the (fragile) assumption + // that future changes would add fields. + type tokenFile119 struct { + _ string + _ int + _ int + mu sync.Mutex // we're not complete monsters + lines []int + _ []struct{} + } + type tokenFile118 struct { + _ *token.FileSet // deleted in go1.19 + tokenFile119 + } + + type uP = unsafe.Pointer + switch unsafe.Sizeof(*file) { + case unsafe.Sizeof(tokenFile118{}): + var ptr *tokenFile118 + *(*uP)(uP(&ptr)) = uP(file) + ptr.mu.Lock() + defer ptr.mu.Unlock() + return ptr.lines + + case unsafe.Sizeof(tokenFile119{}): + var ptr *tokenFile119 + *(*uP)(uP(&ptr)) = uP(file) + ptr.mu.Lock() + defer ptr.mu.Unlock() + return ptr.lines + + default: + panic("unexpected token.File size") + } +} + +// AddExistingFiles adds the specified files to the FileSet if they +// are not already present. It panics if any pair of files in the +// resulting FileSet would overlap. +func AddExistingFiles(fset *token.FileSet, files []*token.File) { + // Punch through the FileSet encapsulation. + type tokenFileSet struct { + // This type remained essentially consistent from go1.16 to go1.21. + mutex sync.RWMutex + base int + files []*token.File + _ *token.File // changed to atomic.Pointer[token.File] in go1.19 + } + + // If the size of token.FileSet changes, this will fail to compile. + const delta = int64(unsafe.Sizeof(tokenFileSet{})) - int64(unsafe.Sizeof(token.FileSet{})) + var _ [-delta * delta]int + + type uP = unsafe.Pointer + var ptr *tokenFileSet + *(*uP)(uP(&ptr)) = uP(fset) + ptr.mutex.Lock() + defer ptr.mutex.Unlock() + + // Merge and sort. + newFiles := append(ptr.files, files...) + sort.Slice(newFiles, func(i, j int) bool { + return newFiles[i].Base() < newFiles[j].Base() + }) + + // Reject overlapping files. + // Discard adjacent identical files. + out := newFiles[:0] + for i, file := range newFiles { + if i > 0 { + prev := newFiles[i-1] + if file == prev { + continue + } + if prev.Base()+prev.Size()+1 > file.Base() { + panic(fmt.Sprintf("file %s (%d-%d) overlaps with file %s (%d-%d)", + prev.Name(), prev.Base(), prev.Base()+prev.Size(), + file.Name(), file.Base(), file.Base()+file.Size())) + } + } + out = append(out, file) + } + newFiles = out + + ptr.files = newFiles + + // Advance FileSet.Base(). + if len(newFiles) > 0 { + last := newFiles[len(newFiles)-1] + newBase := last.Base() + last.Size() + 1 + if ptr.base < newBase { + ptr.base = newBase + } + } +} + +// FileSetFor returns a new FileSet containing a sequence of new Files with +// the same base, size, and line as the input files, for use in APIs that +// require a FileSet. +// +// Precondition: the input files must be non-overlapping, and sorted in order +// of their Base. +func FileSetFor(files ...*token.File) *token.FileSet { + fset := token.NewFileSet() + for _, f := range files { + f2 := fset.AddFile(f.Name(), f.Base(), f.Size()) + lines := GetLines(f) + f2.SetLines(lines) + } + return fset +} + +// CloneFileSet creates a new FileSet holding all files in fset. It does not +// create copies of the token.Files in fset: they are added to the resulting +// FileSet unmodified. +func CloneFileSet(fset *token.FileSet) *token.FileSet { + var files []*token.File + fset.Iterate(func(f *token.File) bool { + files = append(files, f) + return true + }) + newFileSet := token.NewFileSet() + AddExistingFiles(newFileSet, files) + return newFileSet +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typeparams/common.go b/upstream/vendor/golang.org/x/tools/internal/typeparams/common.go new file mode 100644 index 00000000000..cdab9885314 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typeparams/common.go @@ -0,0 +1,204 @@ +// Copyright 2021 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 typeparams contains common utilities for writing tools that interact +// with generic Go code, as introduced with Go 1.18. +// +// Many of the types and functions in this package are proxies for the new APIs +// introduced in the standard library with Go 1.18. For example, the +// typeparams.Union type is an alias for go/types.Union, and the ForTypeSpec +// function returns the value of the go/ast.TypeSpec.TypeParams field. At Go +// versions older than 1.18 these helpers are implemented as stubs, allowing +// users of this package to write code that handles generic constructs inline, +// even if the Go version being used to compile does not support generics. +// +// Additionally, this package contains common utilities for working with the +// new generic constructs, to supplement the standard library APIs. Notably, +// the StructuralTerms API computes a minimal representation of the structural +// restrictions on a type parameter. +// +// An external version of these APIs is available in the +// golang.org/x/exp/typeparams module. +package typeparams + +import ( + "fmt" + "go/ast" + "go/token" + "go/types" +) + +// UnpackIndexExpr extracts data from AST nodes that represent index +// expressions. +// +// For an ast.IndexExpr, the resulting indices slice will contain exactly one +// index expression. For an ast.IndexListExpr (go1.18+), it may have a variable +// number of index expressions. +// +// For nodes that don't represent index expressions, the first return value of +// UnpackIndexExpr will be nil. +func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) { + switch e := n.(type) { + case *ast.IndexExpr: + return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack + case *ast.IndexListExpr: + return e.X, e.Lbrack, e.Indices, e.Rbrack + } + return nil, token.NoPos, nil, token.NoPos +} + +// PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on +// the cardinality of indices. Calling PackIndexExpr with len(indices) == 0 +// will panic. +func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) ast.Expr { + switch len(indices) { + case 0: + panic("empty indices") + case 1: + return &ast.IndexExpr{ + X: x, + Lbrack: lbrack, + Index: indices[0], + Rbrack: rbrack, + } + default: + return &ast.IndexListExpr{ + X: x, + Lbrack: lbrack, + Indices: indices, + Rbrack: rbrack, + } + } +} + +// IsTypeParam reports whether t is a type parameter. +func IsTypeParam(t types.Type) bool { + _, ok := t.(*types.TypeParam) + return ok +} + +// OriginMethod returns the origin method associated with the method fn. +// For methods on a non-generic receiver base type, this is just +// fn. However, for methods with a generic receiver, OriginMethod returns the +// corresponding method in the method set of the origin type. +// +// As a special case, if fn is not a method (has no receiver), OriginMethod +// returns fn. +func OriginMethod(fn *types.Func) *types.Func { + recv := fn.Type().(*types.Signature).Recv() + if recv == nil { + return fn + } + base := recv.Type() + p, isPtr := base.(*types.Pointer) + if isPtr { + base = p.Elem() + } + named, isNamed := base.(*types.Named) + if !isNamed { + // Receiver is a *types.Interface. + return fn + } + if named.TypeParams().Len() == 0 { + // Receiver base has no type parameters, so we can avoid the lookup below. + return fn + } + orig := named.Origin() + gfn, _, _ := types.LookupFieldOrMethod(orig, true, fn.Pkg(), fn.Name()) + + // This is a fix for a gopls crash (#60628) due to a go/types bug (#60634). In: + // package p + // type T *int + // func (*T) f() {} + // LookupFieldOrMethod(T, true, p, f)=nil, but NewMethodSet(*T)={(*T).f}. + // Here we make them consistent by force. + // (The go/types bug is general, but this workaround is reached only + // for generic T thanks to the early return above.) + if gfn == nil { + mset := types.NewMethodSet(types.NewPointer(orig)) + for i := 0; i < mset.Len(); i++ { + m := mset.At(i) + if m.Obj().Id() == fn.Id() { + gfn = m.Obj() + break + } + } + } + + // In golang/go#61196, we observe another crash, this time inexplicable. + if gfn == nil { + panic(fmt.Sprintf("missing origin method for %s.%s; named == origin: %t, named.NumMethods(): %d, origin.NumMethods(): %d", named, fn, named == orig, named.NumMethods(), orig.NumMethods())) + } + + return gfn.(*types.Func) +} + +// GenericAssignableTo is a generalization of types.AssignableTo that +// implements the following rule for uninstantiated generic types: +// +// If V and T are generic named types, then V is considered assignable to T if, +// for every possible instantation of V[A_1, ..., A_N], the instantiation +// T[A_1, ..., A_N] is valid and V[A_1, ..., A_N] implements T[A_1, ..., A_N]. +// +// If T has structural constraints, they must be satisfied by V. +// +// For example, consider the following type declarations: +// +// type Interface[T any] interface { +// Accept(T) +// } +// +// type Container[T any] struct { +// Element T +// } +// +// func (c Container[T]) Accept(t T) { c.Element = t } +// +// In this case, GenericAssignableTo reports that instantiations of Container +// are assignable to the corresponding instantiation of Interface. +func GenericAssignableTo(ctxt *types.Context, V, T types.Type) bool { + // If V and T are not both named, or do not have matching non-empty type + // parameter lists, fall back on types.AssignableTo. + + VN, Vnamed := V.(*types.Named) + TN, Tnamed := T.(*types.Named) + if !Vnamed || !Tnamed { + return types.AssignableTo(V, T) + } + + vtparams := VN.TypeParams() + ttparams := TN.TypeParams() + if vtparams.Len() == 0 || vtparams.Len() != ttparams.Len() || VN.TypeArgs().Len() != 0 || TN.TypeArgs().Len() != 0 { + return types.AssignableTo(V, T) + } + + // V and T have the same (non-zero) number of type params. Instantiate both + // with the type parameters of V. This must always succeed for V, and will + // succeed for T if and only if the type set of each type parameter of V is a + // subset of the type set of the corresponding type parameter of T, meaning + // that every instantiation of V corresponds to a valid instantiation of T. + + // Minor optimization: ensure we share a context across the two + // instantiations below. + if ctxt == nil { + ctxt = types.NewContext() + } + + var targs []types.Type + for i := 0; i < vtparams.Len(); i++ { + targs = append(targs, vtparams.At(i)) + } + + vinst, err := types.Instantiate(ctxt, V, targs, true) + if err != nil { + panic("type parameters should satisfy their own constraints") + } + + tinst, err := types.Instantiate(ctxt, T, targs, true) + if err != nil { + return false + } + + return types.AssignableTo(vinst, tinst) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/upstream/vendor/golang.org/x/tools/internal/typeparams/coretype.go new file mode 100644 index 00000000000..7ea8840eab7 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typeparams/coretype.go @@ -0,0 +1,122 @@ +// Copyright 2022 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 typeparams + +import ( + "go/types" +) + +// CoreType returns the core type of T or nil if T does not have a core type. +// +// See https://go.dev/ref/spec#Core_types for the definition of a core type. +func CoreType(T types.Type) types.Type { + U := T.Underlying() + if _, ok := U.(*types.Interface); !ok { + return U // for non-interface types, + } + + terms, err := _NormalTerms(U) + if len(terms) == 0 || err != nil { + // len(terms) -> empty type set of interface. + // err != nil => U is invalid, exceeds complexity bounds, or has an empty type set. + return nil // no core type. + } + + U = terms[0].Type().Underlying() + var identical int // i in [0,identical) => Identical(U, terms[i].Type().Underlying()) + for identical = 1; identical < len(terms); identical++ { + if !types.Identical(U, terms[identical].Type().Underlying()) { + break + } + } + + if identical == len(terms) { + // https://go.dev/ref/spec#Core_types + // "There is a single type U which is the underlying type of all types in the type set of T" + return U + } + ch, ok := U.(*types.Chan) + if !ok { + return nil // no core type as identical < len(terms) and U is not a channel. + } + // https://go.dev/ref/spec#Core_types + // "the type chan E if T contains only bidirectional channels, or the type chan<- E or + // <-chan E depending on the direction of the directional channels present." + for chans := identical; chans < len(terms); chans++ { + curr, ok := terms[chans].Type().Underlying().(*types.Chan) + if !ok { + return nil + } + if !types.Identical(ch.Elem(), curr.Elem()) { + return nil // channel elements are not identical. + } + if ch.Dir() == types.SendRecv { + // ch is bidirectional. We can safely always use curr's direction. + ch = curr + } else if curr.Dir() != types.SendRecv && ch.Dir() != curr.Dir() { + // ch and curr are not bidirectional and not the same direction. + return nil + } + } + return ch +} + +// _NormalTerms returns a slice of terms representing the normalized structural +// type restrictions of a type, if any. +// +// For all types other than *types.TypeParam, *types.Interface, and +// *types.Union, this is just a single term with Tilde() == false and +// Type() == typ. For *types.TypeParam, *types.Interface, and *types.Union, see +// below. +// +// Structural type restrictions of a type parameter are created via +// non-interface types embedded in its constraint interface (directly, or via a +// chain of interface embeddings). For example, in the declaration type +// T[P interface{~int; m()}] int the structural restriction of the type +// parameter P is ~int. +// +// With interface embedding and unions, the specification of structural type +// restrictions may be arbitrarily complex. For example, consider the +// following: +// +// type A interface{ ~string|~[]byte } +// +// type B interface{ int|string } +// +// type C interface { ~string|~int } +// +// type T[P interface{ A|B; C }] int +// +// In this example, the structural type restriction of P is ~string|int: A|B +// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, +// which when intersected with C (~string|~int) yields ~string|int. +// +// _NormalTerms computes these expansions and reductions, producing a +// "normalized" form of the embeddings. A structural restriction is normalized +// if it is a single union containing no interface terms, and is minimal in the +// sense that removing any term changes the set of types satisfying the +// constraint. It is left as a proof for the reader that, modulo sorting, there +// is exactly one such normalized form. +// +// Because the minimal representation always takes this form, _NormalTerms +// returns a slice of tilde terms corresponding to the terms of the union in +// the normalized structural restriction. An error is returned if the type is +// invalid, exceeds complexity bounds, or has an empty type set. In the latter +// case, _NormalTerms returns ErrEmptyTypeSet. +// +// _NormalTerms makes no guarantees about the order of terms, except that it +// is deterministic. +func _NormalTerms(typ types.Type) ([]*types.Term, error) { + switch typ := typ.(type) { + case *types.TypeParam: + return StructuralTerms(typ) + case *types.Union: + return UnionTermSet(typ) + case *types.Interface: + return InterfaceTermSet(typ) + default: + return []*types.Term{types.NewTerm(false, typ)}, nil + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typeparams/normalize.go b/upstream/vendor/golang.org/x/tools/internal/typeparams/normalize.go new file mode 100644 index 00000000000..93c80fdc96c --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typeparams/normalize.go @@ -0,0 +1,218 @@ +// Copyright 2021 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 typeparams + +import ( + "errors" + "fmt" + "go/types" + "os" + "strings" +) + +//go:generate go run copytermlist.go + +const debug = false + +var ErrEmptyTypeSet = errors.New("empty type set") + +// StructuralTerms returns a slice of terms representing the normalized +// structural type restrictions of a type parameter, if any. +// +// Structural type restrictions of a type parameter are created via +// non-interface types embedded in its constraint interface (directly, or via a +// chain of interface embeddings). For example, in the declaration +// +// type T[P interface{~int; m()}] int +// +// the structural restriction of the type parameter P is ~int. +// +// With interface embedding and unions, the specification of structural type +// restrictions may be arbitrarily complex. For example, consider the +// following: +// +// type A interface{ ~string|~[]byte } +// +// type B interface{ int|string } +// +// type C interface { ~string|~int } +// +// type T[P interface{ A|B; C }] int +// +// In this example, the structural type restriction of P is ~string|int: A|B +// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, +// which when intersected with C (~string|~int) yields ~string|int. +// +// StructuralTerms computes these expansions and reductions, producing a +// "normalized" form of the embeddings. A structural restriction is normalized +// if it is a single union containing no interface terms, and is minimal in the +// sense that removing any term changes the set of types satisfying the +// constraint. It is left as a proof for the reader that, modulo sorting, there +// is exactly one such normalized form. +// +// Because the minimal representation always takes this form, StructuralTerms +// returns a slice of tilde terms corresponding to the terms of the union in +// the normalized structural restriction. An error is returned if the +// constraint interface is invalid, exceeds complexity bounds, or has an empty +// type set. In the latter case, StructuralTerms returns ErrEmptyTypeSet. +// +// StructuralTerms makes no guarantees about the order of terms, except that it +// is deterministic. +func StructuralTerms(tparam *types.TypeParam) ([]*types.Term, error) { + constraint := tparam.Constraint() + if constraint == nil { + return nil, fmt.Errorf("%s has nil constraint", tparam) + } + iface, _ := constraint.Underlying().(*types.Interface) + if iface == nil { + return nil, fmt.Errorf("constraint is %T, not *types.Interface", constraint.Underlying()) + } + return InterfaceTermSet(iface) +} + +// InterfaceTermSet computes the normalized terms for a constraint interface, +// returning an error if the term set cannot be computed or is empty. In the +// latter case, the error will be ErrEmptyTypeSet. +// +// See the documentation of StructuralTerms for more information on +// normalization. +func InterfaceTermSet(iface *types.Interface) ([]*types.Term, error) { + return computeTermSet(iface) +} + +// UnionTermSet computes the normalized terms for a union, returning an error +// if the term set cannot be computed or is empty. In the latter case, the +// error will be ErrEmptyTypeSet. +// +// See the documentation of StructuralTerms for more information on +// normalization. +func UnionTermSet(union *types.Union) ([]*types.Term, error) { + return computeTermSet(union) +} + +func computeTermSet(typ types.Type) ([]*types.Term, error) { + tset, err := computeTermSetInternal(typ, make(map[types.Type]*termSet), 0) + if err != nil { + return nil, err + } + if tset.terms.isEmpty() { + return nil, ErrEmptyTypeSet + } + if tset.terms.isAll() { + return nil, nil + } + var terms []*types.Term + for _, term := range tset.terms { + terms = append(terms, types.NewTerm(term.tilde, term.typ)) + } + return terms, nil +} + +// A termSet holds the normalized set of terms for a given type. +// +// The name termSet is intentionally distinct from 'type set': a type set is +// all types that implement a type (and includes method restrictions), whereas +// a term set just represents the structural restrictions on a type. +type termSet struct { + complete bool + terms termlist +} + +func indentf(depth int, format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, strings.Repeat(".", depth)+format+"\n", args...) +} + +func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth int) (res *termSet, err error) { + if t == nil { + panic("nil type") + } + + if debug { + indentf(depth, "%s", t.String()) + defer func() { + if err != nil { + indentf(depth, "=> %s", err) + } else { + indentf(depth, "=> %s", res.terms.String()) + } + }() + } + + const maxTermCount = 100 + if tset, ok := seen[t]; ok { + if !tset.complete { + return nil, fmt.Errorf("cycle detected in the declaration of %s", t) + } + return tset, nil + } + + // Mark the current type as seen to avoid infinite recursion. + tset := new(termSet) + defer func() { + tset.complete = true + }() + seen[t] = tset + + switch u := t.Underlying().(type) { + case *types.Interface: + // The term set of an interface is the intersection of the term sets of its + // embedded types. + tset.terms = allTermlist + for i := 0; i < u.NumEmbeddeds(); i++ { + embedded := u.EmbeddedType(i) + if _, ok := embedded.Underlying().(*types.TypeParam); ok { + return nil, fmt.Errorf("invalid embedded type %T", embedded) + } + tset2, err := computeTermSetInternal(embedded, seen, depth+1) + if err != nil { + return nil, err + } + tset.terms = tset.terms.intersect(tset2.terms) + } + case *types.Union: + // The term set of a union is the union of term sets of its terms. + tset.terms = nil + for i := 0; i < u.Len(); i++ { + t := u.Term(i) + var terms termlist + switch t.Type().Underlying().(type) { + case *types.Interface: + tset2, err := computeTermSetInternal(t.Type(), seen, depth+1) + if err != nil { + return nil, err + } + terms = tset2.terms + case *types.TypeParam, *types.Union: + // A stand-alone type parameter or union is not permitted as union + // term. + return nil, fmt.Errorf("invalid union term %T", t) + default: + if t.Type() == types.Typ[types.Invalid] { + continue + } + terms = termlist{{t.Tilde(), t.Type()}} + } + tset.terms = tset.terms.union(terms) + if len(tset.terms) > maxTermCount { + return nil, fmt.Errorf("exceeded max term count %d", maxTermCount) + } + } + case *types.TypeParam: + panic("unreachable") + default: + // For all other types, the term set is just a single non-tilde term + // holding the type itself. + if u != types.Typ[types.Invalid] { + tset.terms = termlist{{false, t}} + } + } + return tset, nil +} + +// under is a facade for the go/types internal function of the same name. It is +// used by typeterm.go. +func under(t types.Type) types.Type { + return t.Underlying() +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typeparams/termlist.go b/upstream/vendor/golang.org/x/tools/internal/typeparams/termlist.go new file mode 100644 index 00000000000..cbd12f80131 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typeparams/termlist.go @@ -0,0 +1,163 @@ +// Copyright 2021 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 copytermlist.go DO NOT EDIT. + +package typeparams + +import ( + "bytes" + "go/types" +) + +// A termlist represents the type set represented by the union +// t1 ∪ y2 ∪ ... tn of the type sets of the terms t1 to tn. +// A termlist is in normal form if all terms are disjoint. +// termlist operations don't require the operands to be in +// normal form. +type termlist []*term + +// allTermlist represents the set of all types. +// It is in normal form. +var allTermlist = termlist{new(term)} + +// String prints the termlist exactly (without normalization). +func (xl termlist) String() string { + if len(xl) == 0 { + return "∅" + } + var buf bytes.Buffer + for i, x := range xl { + if i > 0 { + buf.WriteString(" | ") + } + buf.WriteString(x.String()) + } + return buf.String() +} + +// isEmpty reports whether the termlist xl represents the empty set of types. +func (xl termlist) isEmpty() bool { + // If there's a non-nil term, the entire list is not empty. + // If the termlist is in normal form, this requires at most + // one iteration. + for _, x := range xl { + if x != nil { + return false + } + } + return true +} + +// isAll reports whether the termlist xl represents the set of all types. +func (xl termlist) isAll() bool { + // If there's a 𝓤 term, the entire list is 𝓤. + // If the termlist is in normal form, this requires at most + // one iteration. + for _, x := range xl { + if x != nil && x.typ == nil { + return true + } + } + return false +} + +// norm returns the normal form of xl. +func (xl termlist) norm() termlist { + // Quadratic algorithm, but good enough for now. + // TODO(gri) fix asymptotic performance + used := make([]bool, len(xl)) + var rl termlist + for i, xi := range xl { + if xi == nil || used[i] { + continue + } + for j := i + 1; j < len(xl); j++ { + xj := xl[j] + if xj == nil || used[j] { + continue + } + if u1, u2 := xi.union(xj); u2 == nil { + // If we encounter a 𝓤 term, the entire list is 𝓤. + // Exit early. + // (Note that this is not just an optimization; + // if we continue, we may end up with a 𝓤 term + // and other terms and the result would not be + // in normal form.) + if u1.typ == nil { + return allTermlist + } + xi = u1 + used[j] = true // xj is now unioned into xi - ignore it in future iterations + } + } + rl = append(rl, xi) + } + return rl +} + +// union returns the union xl ∪ yl. +func (xl termlist) union(yl termlist) termlist { + return append(xl, yl...).norm() +} + +// intersect returns the intersection xl ∩ yl. +func (xl termlist) intersect(yl termlist) termlist { + if xl.isEmpty() || yl.isEmpty() { + return nil + } + + // Quadratic algorithm, but good enough for now. + // TODO(gri) fix asymptotic performance + var rl termlist + for _, x := range xl { + for _, y := range yl { + if r := x.intersect(y); r != nil { + rl = append(rl, r) + } + } + } + return rl.norm() +} + +// equal reports whether xl and yl represent the same type set. +func (xl termlist) equal(yl termlist) bool { + // TODO(gri) this should be more efficient + return xl.subsetOf(yl) && yl.subsetOf(xl) +} + +// includes reports whether t ∈ xl. +func (xl termlist) includes(t types.Type) bool { + for _, x := range xl { + if x.includes(t) { + return true + } + } + return false +} + +// supersetOf reports whether y ⊆ xl. +func (xl termlist) supersetOf(y *term) bool { + for _, x := range xl { + if y.subsetOf(x) { + return true + } + } + return false +} + +// subsetOf reports whether xl ⊆ yl. +func (xl termlist) subsetOf(yl termlist) bool { + if yl.isEmpty() { + return xl.isEmpty() + } + + // each term x of xl must be a subset of yl + for _, x := range xl { + if !yl.supersetOf(x) { + return false // x is not a subset yl + } + } + return true +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typeparams/typeterm.go b/upstream/vendor/golang.org/x/tools/internal/typeparams/typeterm.go new file mode 100644 index 00000000000..7350bb702a1 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typeparams/typeterm.go @@ -0,0 +1,169 @@ +// Copyright 2021 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 copytermlist.go DO NOT EDIT. + +package typeparams + +import "go/types" + +// A term describes elementary type sets: +// +// ∅: (*term)(nil) == ∅ // set of no types (empty set) +// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse) +// T: &term{false, T} == {T} // set of type T +// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t +type term struct { + tilde bool // valid if typ != nil + typ types.Type +} + +func (x *term) String() string { + switch { + case x == nil: + return "∅" + case x.typ == nil: + return "𝓤" + case x.tilde: + return "~" + x.typ.String() + default: + return x.typ.String() + } +} + +// equal reports whether x and y represent the same type set. +func (x *term) equal(y *term) bool { + // easy cases + switch { + case x == nil || y == nil: + return x == y + case x.typ == nil || y.typ == nil: + return x.typ == y.typ + } + // ∅ ⊂ x, y ⊂ 𝓤 + + return x.tilde == y.tilde && types.Identical(x.typ, y.typ) +} + +// union returns the union x ∪ y: zero, one, or two non-nil terms. +func (x *term) union(y *term) (_, _ *term) { + // easy cases + switch { + case x == nil && y == nil: + return nil, nil // ∅ ∪ ∅ == ∅ + case x == nil: + return y, nil // ∅ ∪ y == y + case y == nil: + return x, nil // x ∪ ∅ == x + case x.typ == nil: + return x, nil // 𝓤 ∪ y == 𝓤 + case y.typ == nil: + return y, nil // x ∪ 𝓤 == 𝓤 + } + // ∅ ⊂ x, y ⊂ 𝓤 + + if x.disjoint(y) { + return x, y // x ∪ y == (x, y) if x ∩ y == ∅ + } + // x.typ == y.typ + + // ~t ∪ ~t == ~t + // ~t ∪ T == ~t + // T ∪ ~t == ~t + // T ∪ T == T + if x.tilde || !y.tilde { + return x, nil + } + return y, nil +} + +// intersect returns the intersection x ∩ y. +func (x *term) intersect(y *term) *term { + // easy cases + switch { + case x == nil || y == nil: + return nil // ∅ ∩ y == ∅ and ∩ ∅ == ∅ + case x.typ == nil: + return y // 𝓤 ∩ y == y + case y.typ == nil: + return x // x ∩ 𝓤 == x + } + // ∅ ⊂ x, y ⊂ 𝓤 + + if x.disjoint(y) { + return nil // x ∩ y == ∅ if x ∩ y == ∅ + } + // x.typ == y.typ + + // ~t ∩ ~t == ~t + // ~t ∩ T == T + // T ∩ ~t == T + // T ∩ T == T + if !x.tilde || y.tilde { + return x + } + return y +} + +// includes reports whether t ∈ x. +func (x *term) includes(t types.Type) bool { + // easy cases + switch { + case x == nil: + return false // t ∈ ∅ == false + case x.typ == nil: + return true // t ∈ 𝓤 == true + } + // ∅ ⊂ x ⊂ 𝓤 + + u := t + if x.tilde { + u = under(u) + } + return types.Identical(x.typ, u) +} + +// subsetOf reports whether x ⊆ y. +func (x *term) subsetOf(y *term) bool { + // easy cases + switch { + case x == nil: + return true // ∅ ⊆ y == true + case y == nil: + return false // x ⊆ ∅ == false since x != ∅ + case y.typ == nil: + return true // x ⊆ 𝓤 == true + case x.typ == nil: + return false // 𝓤 ⊆ y == false since y != 𝓤 + } + // ∅ ⊂ x, y ⊂ 𝓤 + + if x.disjoint(y) { + return false // x ⊆ y == false if x ∩ y == ∅ + } + // x.typ == y.typ + + // ~t ⊆ ~t == true + // ~t ⊆ T == false + // T ⊆ ~t == true + // T ⊆ T == true + return !x.tilde || y.tilde +} + +// disjoint reports whether x ∩ y == ∅. +// x.typ and y.typ must not be nil. +func (x *term) disjoint(y *term) bool { + if debug && (x.typ == nil || y.typ == nil) { + panic("invalid argument(s)") + } + ux := x.typ + if y.tilde { + ux = under(ux) + } + uy := y.typ + if x.tilde { + uy = under(uy) + } + return !types.Identical(ux, uy) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go new file mode 100644 index 00000000000..07484073a57 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go @@ -0,0 +1,1560 @@ +// 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. + +package typesinternal + +//go:generate stringer -type=ErrorCode + +type ErrorCode int + +// This file defines the error codes that can be produced during type-checking. +// Collectively, these codes provide an identifier that may be used to +// implement special handling for certain types of errors. +// +// Error codes should be fine-grained enough that the exact nature of the error +// can be easily determined, but coarse enough that they are not an +// implementation detail of the type checking algorithm. As a rule-of-thumb, +// errors should be considered equivalent if there is a theoretical refactoring +// of the type checker in which they are emitted in exactly one place. For +// example, the type checker emits different error messages for "too many +// arguments" and "too few arguments", but one can imagine an alternative type +// checker where this check instead just emits a single "wrong number of +// arguments", so these errors should have the same code. +// +// Error code names should be as brief as possible while retaining accuracy and +// distinctiveness. In most cases names should start with an adjective +// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), +// and end with a noun identifying the relevant language object. For example, +// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the +// convention that "bad" implies a problem with syntax, and "invalid" implies a +// problem with types. + +const ( + // InvalidSyntaxTree occurs if an invalid syntax tree is provided + // to the type checker. It should never happen. + InvalidSyntaxTree ErrorCode = -1 +) + +const ( + _ ErrorCode = iota + + // Test is reserved for errors that only apply while in self-test mode. + Test + + /* package names */ + + // BlankPkgName occurs when a package name is the blank identifier "_". + // + // Per the spec: + // "The PackageName must not be the blank identifier." + BlankPkgName + + // MismatchedPkgName occurs when a file's package name doesn't match the + // package name already established by other files. + MismatchedPkgName + + // InvalidPkgUse occurs when a package identifier is used outside of a + // selector expression. + // + // Example: + // import "fmt" + // + // var _ = fmt + InvalidPkgUse + + /* imports */ + + // BadImportPath occurs when an import path is not valid. + BadImportPath + + // BrokenImport occurs when importing a package fails. + // + // Example: + // import "amissingpackage" + BrokenImport + + // ImportCRenamed occurs when the special import "C" is renamed. "C" is a + // pseudo-package, and must not be renamed. + // + // Example: + // import _ "C" + ImportCRenamed + + // UnusedImport occurs when an import is unused. + // + // Example: + // import "fmt" + // + // func main() {} + UnusedImport + + /* initialization */ + + // InvalidInitCycle occurs when an invalid cycle is detected within the + // initialization graph. + // + // Example: + // var x int = f() + // + // func f() int { return x } + InvalidInitCycle + + /* decls */ + + // DuplicateDecl occurs when an identifier is declared multiple times. + // + // Example: + // var x = 1 + // var x = 2 + DuplicateDecl + + // InvalidDeclCycle occurs when a declaration cycle is not valid. + // + // Example: + // import "unsafe" + // + // type T struct { + // a [n]int + // } + // + // var n = unsafe.Sizeof(T{}) + InvalidDeclCycle + + // InvalidTypeCycle occurs when a cycle in type definitions results in a + // type that is not well-defined. + // + // Example: + // import "unsafe" + // + // type T [unsafe.Sizeof(T{})]int + InvalidTypeCycle + + /* decls > const */ + + // InvalidConstInit occurs when a const declaration has a non-constant + // initializer. + // + // Example: + // var x int + // const _ = x + InvalidConstInit + + // InvalidConstVal occurs when a const value cannot be converted to its + // target type. + // + // TODO(findleyr): this error code and example are not very clear. Consider + // removing it. + // + // Example: + // const _ = 1 << "hello" + InvalidConstVal + + // InvalidConstType occurs when the underlying type in a const declaration + // is not a valid constant type. + // + // Example: + // const c *int = 4 + InvalidConstType + + /* decls > var (+ other variable assignment codes) */ + + // UntypedNilUse occurs when the predeclared (untyped) value nil is used to + // initialize a variable declared without an explicit type. + // + // Example: + // var x = nil + UntypedNilUse + + // WrongAssignCount occurs when the number of values on the right-hand side + // of an assignment or or initialization expression does not match the number + // of variables on the left-hand side. + // + // Example: + // var x = 1, 2 + WrongAssignCount + + // UnassignableOperand occurs when the left-hand side of an assignment is + // not assignable. + // + // Example: + // func f() { + // const c = 1 + // c = 2 + // } + UnassignableOperand + + // NoNewVar occurs when a short variable declaration (':=') does not declare + // new variables. + // + // Example: + // func f() { + // x := 1 + // x := 2 + // } + NoNewVar + + // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does + // not have single-valued left-hand or right-hand side. + // + // Per the spec: + // "In assignment operations, both the left- and right-hand expression lists + // must contain exactly one single-valued expression" + // + // Example: + // func f() int { + // x, y := 1, 2 + // x, y += 1 + // return x + y + // } + MultiValAssignOp + + // InvalidIfaceAssign occurs when a value of type T is used as an + // interface, but T does not implement a method of the expected interface. + // + // Example: + // type I interface { + // f() + // } + // + // type T int + // + // var x I = T(1) + InvalidIfaceAssign + + // InvalidChanAssign occurs when a chan assignment is invalid. + // + // Per the spec, a value x is assignable to a channel type T if: + // "x is a bidirectional channel value, T is a channel type, x's type V and + // T have identical element types, and at least one of V or T is not a + // defined type." + // + // Example: + // type T1 chan int + // type T2 chan int + // + // var x T1 + // // Invalid assignment because both types are named + // var _ T2 = x + InvalidChanAssign + + // IncompatibleAssign occurs when the type of the right-hand side expression + // in an assignment cannot be assigned to the type of the variable being + // assigned. + // + // Example: + // var x []int + // var _ int = x + IncompatibleAssign + + // UnaddressableFieldAssign occurs when trying to assign to a struct field + // in a map value. + // + // Example: + // func f() { + // m := make(map[string]struct{i int}) + // m["foo"].i = 42 + // } + UnaddressableFieldAssign + + /* decls > type (+ other type expression codes) */ + + // NotAType occurs when the identifier used as the underlying type in a type + // declaration or the right-hand side of a type alias does not denote a type. + // + // Example: + // var S = 2 + // + // type T S + NotAType + + // InvalidArrayLen occurs when an array length is not a constant value. + // + // Example: + // var n = 3 + // var _ = [n]int{} + InvalidArrayLen + + // BlankIfaceMethod occurs when a method name is '_'. + // + // Per the spec: + // "The name of each explicitly specified method must be unique and not + // blank." + // + // Example: + // type T interface { + // _(int) + // } + BlankIfaceMethod + + // IncomparableMapKey occurs when a map key type does not support the == and + // != operators. + // + // Per the spec: + // "The comparison operators == and != must be fully defined for operands of + // the key type; thus the key type must not be a function, map, or slice." + // + // Example: + // var x map[T]int + // + // type T []int + IncomparableMapKey + + // InvalidIfaceEmbed occurs when a non-interface type is embedded in an + // interface. + // + // Example: + // type T struct {} + // + // func (T) m() + // + // type I interface { + // T + // } + InvalidIfaceEmbed + + // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, + // and T itself is itself a pointer, an unsafe.Pointer, or an interface. + // + // Per the spec: + // "An embedded field must be specified as a type name T or as a pointer to + // a non-interface type name *T, and T itself may not be a pointer type." + // + // Example: + // type T *int + // + // type S struct { + // *T + // } + InvalidPtrEmbed + + /* decls > func and method */ + + // BadRecv occurs when a method declaration does not have exactly one + // receiver parameter. + // + // Example: + // func () _() {} + BadRecv + + // InvalidRecv occurs when a receiver type expression is not of the form T + // or *T, or T is a pointer type. + // + // Example: + // type T struct {} + // + // func (**T) m() {} + InvalidRecv + + // DuplicateFieldAndMethod occurs when an identifier appears as both a field + // and method name. + // + // Example: + // type T struct { + // m int + // } + // + // func (T) m() {} + DuplicateFieldAndMethod + + // DuplicateMethod occurs when two methods on the same receiver type have + // the same name. + // + // Example: + // type T struct {} + // func (T) m() {} + // func (T) m(i int) int { return i } + DuplicateMethod + + /* decls > special */ + + // InvalidBlank occurs when a blank identifier is used as a value or type. + // + // Per the spec: + // "The blank identifier may appear as an operand only on the left-hand side + // of an assignment." + // + // Example: + // var x = _ + InvalidBlank + + // InvalidIota occurs when the predeclared identifier iota is used outside + // of a constant declaration. + // + // Example: + // var x = iota + InvalidIota + + // MissingInitBody occurs when an init function is missing its body. + // + // Example: + // func init() + MissingInitBody + + // InvalidInitSig occurs when an init function declares parameters or + // results. + // + // Example: + // func init() int { return 1 } + InvalidInitSig + + // InvalidInitDecl occurs when init is declared as anything other than a + // function. + // + // Example: + // var init = 1 + InvalidInitDecl + + // InvalidMainDecl occurs when main is declared as anything other than a + // function, in a main package. + InvalidMainDecl + + /* exprs */ + + // TooManyValues occurs when a function returns too many values for the + // expression context in which it is used. + // + // Example: + // func ReturnTwo() (int, int) { + // return 1, 2 + // } + // + // var x = ReturnTwo() + TooManyValues + + // NotAnExpr occurs when a type expression is used where a value expression + // is expected. + // + // Example: + // type T struct {} + // + // func f() { + // T + // } + NotAnExpr + + /* exprs > const */ + + // TruncatedFloat occurs when a float constant is truncated to an integer + // value. + // + // Example: + // var _ int = 98.6 + TruncatedFloat + + // NumericOverflow occurs when a numeric constant overflows its target type. + // + // Example: + // var x int8 = 1000 + NumericOverflow + + /* exprs > operation */ + + // UndefinedOp occurs when an operator is not defined for the type(s) used + // in an operation. + // + // Example: + // var c = "a" - "b" + UndefinedOp + + // MismatchedTypes occurs when operand types are incompatible in a binary + // operation. + // + // Example: + // var a = "hello" + // var b = 1 + // var c = a - b + MismatchedTypes + + // DivByZero occurs when a division operation is provable at compile + // time to be a division by zero. + // + // Example: + // const divisor = 0 + // var x int = 1/divisor + DivByZero + + // NonNumericIncDec occurs when an increment or decrement operator is + // applied to a non-numeric value. + // + // Example: + // func f() { + // var c = "c" + // c++ + // } + NonNumericIncDec + + /* exprs > ptr */ + + // UnaddressableOperand occurs when the & operator is applied to an + // unaddressable expression. + // + // Example: + // var x = &1 + UnaddressableOperand + + // InvalidIndirection occurs when a non-pointer value is indirected via the + // '*' operator. + // + // Example: + // var x int + // var y = *x + InvalidIndirection + + /* exprs > [] */ + + // NonIndexableOperand occurs when an index operation is applied to a value + // that cannot be indexed. + // + // Example: + // var x = 1 + // var y = x[1] + NonIndexableOperand + + // InvalidIndex occurs when an index argument is not of integer type, + // negative, or out-of-bounds. + // + // Example: + // var s = [...]int{1,2,3} + // var x = s[5] + // + // Example: + // var s = []int{1,2,3} + // var _ = s[-1] + // + // Example: + // var s = []int{1,2,3} + // var i string + // var _ = s[i] + InvalidIndex + + // SwappedSliceIndices occurs when constant indices in a slice expression + // are decreasing in value. + // + // Example: + // var _ = []int{1,2,3}[2:1] + SwappedSliceIndices + + /* operators > slice */ + + // NonSliceableOperand occurs when a slice operation is applied to a value + // whose type is not sliceable, or is unaddressable. + // + // Example: + // var x = [...]int{1, 2, 3}[:1] + // + // Example: + // var x = 1 + // var y = 1[:1] + NonSliceableOperand + + // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is + // applied to a string. + // + // Example: + // var s = "hello" + // var x = s[1:2:3] + InvalidSliceExpr + + /* exprs > shift */ + + // InvalidShiftCount occurs when the right-hand side of a shift operation is + // either non-integer, negative, or too large. + // + // Example: + // var ( + // x string + // y int = 1 << x + // ) + InvalidShiftCount + + // InvalidShiftOperand occurs when the shifted operand is not an integer. + // + // Example: + // var s = "hello" + // var x = s << 2 + InvalidShiftOperand + + /* exprs > chan */ + + // InvalidReceive occurs when there is a channel receive from a value that + // is either not a channel, or is a send-only channel. + // + // Example: + // func f() { + // var x = 1 + // <-x + // } + InvalidReceive + + // InvalidSend occurs when there is a channel send to a value that is not a + // channel, or is a receive-only channel. + // + // Example: + // func f() { + // var x = 1 + // x <- "hello!" + // } + InvalidSend + + /* exprs > literal */ + + // DuplicateLitKey occurs when an index is duplicated in a slice, array, or + // map literal. + // + // Example: + // var _ = []int{0:1, 0:2} + // + // Example: + // var _ = map[string]int{"a": 1, "a": 2} + DuplicateLitKey + + // MissingLitKey occurs when a map literal is missing a key expression. + // + // Example: + // var _ = map[string]int{1} + MissingLitKey + + // InvalidLitIndex occurs when the key in a key-value element of a slice or + // array literal is not an integer constant. + // + // Example: + // var i = 0 + // var x = []string{i: "world"} + InvalidLitIndex + + // OversizeArrayLit occurs when an array literal exceeds its length. + // + // Example: + // var _ = [2]int{1,2,3} + OversizeArrayLit + + // MixedStructLit occurs when a struct literal contains a mix of positional + // and named elements. + // + // Example: + // var _ = struct{i, j int}{i: 1, 2} + MixedStructLit + + // InvalidStructLit occurs when a positional struct literal has an incorrect + // number of values. + // + // Example: + // var _ = struct{i, j int}{1,2,3} + InvalidStructLit + + // MissingLitField occurs when a struct literal refers to a field that does + // not exist on the struct type. + // + // Example: + // var _ = struct{i int}{j: 2} + MissingLitField + + // DuplicateLitField occurs when a struct literal contains duplicated + // fields. + // + // Example: + // var _ = struct{i int}{i: 1, i: 2} + DuplicateLitField + + // UnexportedLitField occurs when a positional struct literal implicitly + // assigns an unexported field of an imported type. + UnexportedLitField + + // InvalidLitField occurs when a field name is not a valid identifier. + // + // Example: + // var _ = struct{i int}{1: 1} + InvalidLitField + + // UntypedLit occurs when a composite literal omits a required type + // identifier. + // + // Example: + // type outer struct{ + // inner struct { i int } + // } + // + // var _ = outer{inner: {1}} + UntypedLit + + // InvalidLit occurs when a composite literal expression does not match its + // type. + // + // Example: + // type P *struct{ + // x int + // } + // var _ = P {} + InvalidLit + + /* exprs > selector */ + + // AmbiguousSelector occurs when a selector is ambiguous. + // + // Example: + // type E1 struct { i int } + // type E2 struct { i int } + // type T struct { E1; E2 } + // + // var x T + // var _ = x.i + AmbiguousSelector + + // UndeclaredImportedName occurs when a package-qualified identifier is + // undeclared by the imported package. + // + // Example: + // import "go/types" + // + // var _ = types.NotAnActualIdentifier + UndeclaredImportedName + + // UnexportedName occurs when a selector refers to an unexported identifier + // of an imported package. + // + // Example: + // import "reflect" + // + // type _ reflect.flag + UnexportedName + + // UndeclaredName occurs when an identifier is not declared in the current + // scope. + // + // Example: + // var x T + UndeclaredName + + // MissingFieldOrMethod occurs when a selector references a field or method + // that does not exist. + // + // Example: + // type T struct {} + // + // var x = T{}.f + MissingFieldOrMethod + + /* exprs > ... */ + + // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is + // not valid. + // + // Example: + // var _ = map[int][...]int{0: {}} + BadDotDotDotSyntax + + // NonVariadicDotDotDot occurs when a "..." is used on the final argument to + // a non-variadic function. + // + // Example: + // func printArgs(s []string) { + // for _, a := range s { + // println(a) + // } + // } + // + // func f() { + // s := []string{"a", "b", "c"} + // printArgs(s...) + // } + NonVariadicDotDotDot + + // MisplacedDotDotDot occurs when a "..." is used somewhere other than the + // final argument to a function call. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := []int{1,2,3} + // printArgs(0, a...) + // } + MisplacedDotDotDot + + // InvalidDotDotDotOperand occurs when a "..." operator is applied to a + // single-valued operand. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := 1 + // printArgs(a...) + // } + // + // Example: + // func args() (int, int) { + // return 1, 2 + // } + // + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func g() { + // printArgs(args()...) + // } + InvalidDotDotDotOperand + + // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in + // function. + // + // Example: + // var s = []int{1, 2, 3} + // var l = len(s...) + InvalidDotDotDot + + /* exprs > built-in */ + + // UncalledBuiltin occurs when a built-in function is used as a + // function-valued expression, instead of being called. + // + // Per the spec: + // "The built-in functions do not have standard Go types, so they can only + // appear in call expressions; they cannot be used as function values." + // + // Example: + // var _ = copy + UncalledBuiltin + + // InvalidAppend occurs when append is called with a first argument that is + // not a slice. + // + // Example: + // var _ = append(1, 2) + InvalidAppend + + // InvalidCap occurs when an argument to the cap built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = cap(s) + InvalidCap + + // InvalidClose occurs when close(...) is called with an argument that is + // not of channel type, or that is a receive-only channel. + // + // Example: + // func f() { + // var x int + // close(x) + // } + InvalidClose + + // InvalidCopy occurs when the arguments are not of slice type or do not + // have compatible type. + // + // See https://golang.org/ref/spec#Appendingand_copying_slices for more + // information on the type requirements for the copy built-in. + // + // Example: + // func f() { + // var x []int + // y := []int64{1,2,3} + // copy(x, y) + // } + InvalidCopy + + // InvalidComplex occurs when the complex built-in function is called with + // arguments with incompatible types. + // + // Example: + // var _ = complex(float32(1), float64(2)) + InvalidComplex + + // InvalidDelete occurs when the delete built-in function is called with a + // first argument that is not a map. + // + // Example: + // func f() { + // m := "hello" + // delete(m, "e") + // } + InvalidDelete + + // InvalidImag occurs when the imag built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = imag(int(1)) + InvalidImag + + // InvalidLen occurs when an argument to the len built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = len(s) + InvalidLen + + // SwappedMakeArgs occurs when make is called with three arguments, and its + // length argument is larger than its capacity argument. + // + // Example: + // var x = make([]int, 3, 2) + SwappedMakeArgs + + // InvalidMake occurs when make is called with an unsupported type argument. + // + // See https://golang.org/ref/spec#Makingslices_maps_and_channels for + // information on the types that may be created using make. + // + // Example: + // var x = make(int) + InvalidMake + + // InvalidReal occurs when the real built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = real(int(1)) + InvalidReal + + /* exprs > assertion */ + + // InvalidAssert occurs when a type assertion is applied to a + // value that is not of interface type. + // + // Example: + // var x = 1 + // var _ = x.(float64) + InvalidAssert + + // ImpossibleAssert occurs for a type assertion x.(T) when the value x of + // interface cannot have dynamic type T, due to a missing or mismatching + // method on T. + // + // Example: + // type T int + // + // func (t *T) m() int { return int(*t) } + // + // type I interface { m() int } + // + // var x I + // var _ = x.(T) + ImpossibleAssert + + /* exprs > conversion */ + + // InvalidConversion occurs when the argument type cannot be converted to the + // target. + // + // See https://golang.org/ref/spec#Conversions for the rules of + // convertibility. + // + // Example: + // var x float64 + // var _ = string(x) + InvalidConversion + + // InvalidUntypedConversion occurs when an there is no valid implicit + // conversion from an untyped value satisfying the type constraints of the + // context in which it is used. + // + // Example: + // var _ = 1 + "" + InvalidUntypedConversion + + /* offsetof */ + + // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument + // that is not a selector expression. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Offsetof(x) + BadOffsetofSyntax + + // InvalidOffsetof occurs when unsafe.Offsetof is called with a method + // selector, rather than a field selector, or when the field is embedded via + // a pointer. + // + // Per the spec: + // + // "If f is an embedded field, it must be reachable without pointer + // indirections through fields of the struct. " + // + // Example: + // import "unsafe" + // + // type T struct { f int } + // type S struct { *T } + // var s S + // var _ = unsafe.Offsetof(s.f) + // + // Example: + // import "unsafe" + // + // type S struct{} + // + // func (S) m() {} + // + // var s S + // var _ = unsafe.Offsetof(s.m) + InvalidOffsetof + + /* control flow > scope */ + + // UnusedExpr occurs when a side-effect free expression is used as a + // statement. Such a statement has no effect. + // + // Example: + // func f(i int) { + // i*i + // } + UnusedExpr + + // UnusedVar occurs when a variable is declared but unused. + // + // Example: + // func f() { + // x := 1 + // } + UnusedVar + + // MissingReturn occurs when a function with results is missing a return + // statement. + // + // Example: + // func f() int {} + MissingReturn + + // WrongResultCount occurs when a return statement returns an incorrect + // number of values. + // + // Example: + // func ReturnOne() int { + // return 1, 2 + // } + WrongResultCount + + // OutOfScopeResult occurs when the name of a value implicitly returned by + // an empty return statement is shadowed in a nested scope. + // + // Example: + // func factor(n int) (i int) { + // for i := 2; i < n; i++ { + // if n%i == 0 { + // return + // } + // } + // return 0 + // } + OutOfScopeResult + + /* control flow > if */ + + // InvalidCond occurs when an if condition is not a boolean expression. + // + // Example: + // func checkReturn(i int) { + // if i { + // panic("non-zero return") + // } + // } + InvalidCond + + /* control flow > for */ + + // InvalidPostDecl occurs when there is a declaration in a for-loop post + // statement. + // + // Example: + // func f() { + // for i := 0; i < 10; j := 0 {} + // } + InvalidPostDecl + + // InvalidChanRange occurs when a send-only channel used in a range + // expression. + // + // Example: + // func sum(c chan<- int) { + // s := 0 + // for i := range c { + // s += i + // } + // } + InvalidChanRange + + // InvalidIterVar occurs when two iteration variables are used while ranging + // over a channel. + // + // Example: + // func f(c chan int) { + // for k, v := range c { + // println(k, v) + // } + // } + InvalidIterVar + + // InvalidRangeExpr occurs when the type of a range expression is not array, + // slice, string, map, or channel. + // + // Example: + // func f(i int) { + // for j := range i { + // println(j) + // } + // } + InvalidRangeExpr + + /* control flow > switch */ + + // MisplacedBreak occurs when a break statement is not within a for, switch, + // or select statement of the innermost function definition. + // + // Example: + // func f() { + // break + // } + MisplacedBreak + + // MisplacedContinue occurs when a continue statement is not within a for + // loop of the innermost function definition. + // + // Example: + // func sumeven(n int) int { + // proceed := func() { + // continue + // } + // sum := 0 + // for i := 1; i <= n; i++ { + // if i % 2 != 0 { + // proceed() + // } + // sum += i + // } + // return sum + // } + MisplacedContinue + + // MisplacedFallthrough occurs when a fallthrough statement is not within an + // expression switch. + // + // Example: + // func typename(i interface{}) string { + // switch i.(type) { + // case int64: + // fallthrough + // case int: + // return "int" + // } + // return "unsupported" + // } + MisplacedFallthrough + + // DuplicateCase occurs when a type or expression switch has duplicate + // cases. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // case 1: + // println("One") + // } + // } + DuplicateCase + + // DuplicateDefault occurs when a type or expression switch has multiple + // default clauses. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // default: + // println("One") + // default: + // println("1") + // } + // } + DuplicateDefault + + // BadTypeKeyword occurs when a .(type) expression is used anywhere other + // than a type switch. + // + // Example: + // type I interface { + // m() + // } + // var t I + // var _ = t.(type) + BadTypeKeyword + + // InvalidTypeSwitch occurs when .(type) is used on an expression that is + // not of interface type. + // + // Example: + // func f(i int) { + // switch x := i.(type) {} + // } + InvalidTypeSwitch + + // InvalidExprSwitch occurs when a switch expression is not comparable. + // + // Example: + // func _() { + // var a struct{ _ func() } + // switch a /* ERROR cannot switch on a */ { + // } + // } + InvalidExprSwitch + + /* control flow > select */ + + // InvalidSelectCase occurs when a select case is not a channel send or + // receive. + // + // Example: + // func checkChan(c <-chan int) bool { + // select { + // case c: + // return true + // default: + // return false + // } + // } + InvalidSelectCase + + /* control flow > labels and jumps */ + + // UndeclaredLabel occurs when an undeclared label is jumped to. + // + // Example: + // func f() { + // goto L + // } + UndeclaredLabel + + // DuplicateLabel occurs when a label is declared more than once. + // + // Example: + // func f() int { + // L: + // L: + // return 1 + // } + DuplicateLabel + + // MisplacedLabel occurs when a break or continue label is not on a for, + // switch, or select statement. + // + // Example: + // func f() { + // L: + // a := []int{1,2,3} + // for _, e := range a { + // if e > 10 { + // break L + // } + // println(a) + // } + // } + MisplacedLabel + + // UnusedLabel occurs when a label is declared but not used. + // + // Example: + // func f() { + // L: + // } + UnusedLabel + + // JumpOverDecl occurs when a label jumps over a variable declaration. + // + // Example: + // func f() int { + // goto L + // x := 2 + // L: + // x++ + // return x + // } + JumpOverDecl + + // JumpIntoBlock occurs when a forward jump goes to a label inside a nested + // block. + // + // Example: + // func f(x int) { + // goto L + // if x > 0 { + // L: + // print("inside block") + // } + // } + JumpIntoBlock + + /* control flow > calls */ + + // InvalidMethodExpr occurs when a pointer method is called but the argument + // is not addressable. + // + // Example: + // type T struct {} + // + // func (*T) m() int { return 1 } + // + // var _ = T.m(T{}) + InvalidMethodExpr + + // WrongArgCount occurs when too few or too many arguments are passed by a + // function call. + // + // Example: + // func f(i int) {} + // var x = f() + WrongArgCount + + // InvalidCall occurs when an expression is called that is not of function + // type. + // + // Example: + // var x = "x" + // var y = x() + InvalidCall + + /* control flow > suspended */ + + // UnusedResults occurs when a restricted expression-only built-in function + // is suspended via go or defer. Such a suspension discards the results of + // these side-effect free built-in functions, and therefore is ineffectual. + // + // Example: + // func f(a []int) int { + // defer len(a) + // return i + // } + UnusedResults + + // InvalidDefer occurs when a deferred expression is not a function call, + // for example if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // defer int32(i) + // return i + // } + InvalidDefer + + // InvalidGo occurs when a go expression is not a function call, for example + // if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // go int32(i) + // return i + // } + InvalidGo + + // All codes below were added in Go 1.17. + + /* decl */ + + // BadDecl occurs when a declaration has invalid syntax. + BadDecl + + // RepeatedDecl occurs when an identifier occurs more than once on the left + // hand side of a short variable declaration. + // + // Example: + // func _() { + // x, y, y := 1, 2, 3 + // } + RepeatedDecl + + /* unsafe */ + + // InvalidUnsafeAdd occurs when unsafe.Add is called with a + // length argument that is not of integer type. + // + // Example: + // import "unsafe" + // + // var p unsafe.Pointer + // var _ = unsafe.Add(p, float64(1)) + InvalidUnsafeAdd + + // InvalidUnsafeSlice occurs when unsafe.Slice is called with a + // pointer argument that is not of pointer type or a length argument + // that is not of integer type, negative, or out of bounds. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(x, 1) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, float64(1)) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, -1) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, uint64(1) << 63) + InvalidUnsafeSlice + + // All codes below were added in Go 1.18. + + /* features */ + + // UnsupportedFeature occurs when a language feature is used that is not + // supported at this Go version. + UnsupportedFeature + + /* type params */ + + // NotAGenericType occurs when a non-generic type is used where a generic + // type is expected: in type or function instantiation. + // + // Example: + // type T int + // + // var _ T[int] + NotAGenericType + + // WrongTypeArgCount occurs when a type or function is instantiated with an + // incorrent number of type arguments, including when a generic type or + // function is used without instantiation. + // + // Errors inolving failed type inference are assigned other error codes. + // + // Example: + // type T[p any] int + // + // var _ T[int, string] + // + // Example: + // func f[T any]() {} + // + // var x = f + WrongTypeArgCount + + // CannotInferTypeArgs occurs when type or function type argument inference + // fails to infer all type arguments. + // + // Example: + // func f[T any]() {} + // + // func _() { + // f() + // } + // + // Example: + // type N[P, Q any] struct{} + // + // var _ N[int] + CannotInferTypeArgs + + // InvalidTypeArg occurs when a type argument does not satisfy its + // corresponding type parameter constraints. + // + // Example: + // type T[P ~int] struct{} + // + // var _ T[string] + InvalidTypeArg // arguments? InferenceFailed + + // InvalidInstanceCycle occurs when an invalid cycle is detected + // within the instantiation graph. + // + // Example: + // func f[T any]() { f[*T]() } + InvalidInstanceCycle + + // InvalidUnion occurs when an embedded union or approximation element is + // not valid. + // + // Example: + // type _ interface { + // ~int | interface{ m() } + // } + InvalidUnion + + // MisplacedConstraintIface occurs when a constraint-type interface is used + // outside of constraint position. + // + // Example: + // type I interface { ~int } + // + // var _ I + MisplacedConstraintIface + + // InvalidMethodTypeParams occurs when methods have type parameters. + // + // It cannot be encountered with an AST parsed using go/parser. + InvalidMethodTypeParams + + // MisplacedTypeParam occurs when a type parameter is used in a place where + // it is not permitted. + // + // Example: + // type T[P any] P + // + // Example: + // type T[P any] struct{ *P } + MisplacedTypeParam + + // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with + // an argument that is not of slice type. It also occurs if it is used + // in a package compiled for a language version before go1.20. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.SliceData(x) + InvalidUnsafeSliceData + + // InvalidUnsafeString occurs when unsafe.String is called with + // a length argument that is not of integer type, negative, or + // out of bounds. It also occurs if it is used in a package + // compiled for a language version before go1.20. + // + // Example: + // import "unsafe" + // + // var b [10]byte + // var _ = unsafe.String(&b[0], -1) + InvalidUnsafeString + + // InvalidUnsafeStringData occurs if it is used in a package + // compiled for a language version before go1.20. + _ // not used anymore + +) diff --git a/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go new file mode 100644 index 00000000000..15ecf7c5ded --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go @@ -0,0 +1,179 @@ +// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. + +package typesinternal + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[InvalidSyntaxTree - -1] + _ = x[Test-1] + _ = x[BlankPkgName-2] + _ = x[MismatchedPkgName-3] + _ = x[InvalidPkgUse-4] + _ = x[BadImportPath-5] + _ = x[BrokenImport-6] + _ = x[ImportCRenamed-7] + _ = x[UnusedImport-8] + _ = x[InvalidInitCycle-9] + _ = x[DuplicateDecl-10] + _ = x[InvalidDeclCycle-11] + _ = x[InvalidTypeCycle-12] + _ = x[InvalidConstInit-13] + _ = x[InvalidConstVal-14] + _ = x[InvalidConstType-15] + _ = x[UntypedNilUse-16] + _ = x[WrongAssignCount-17] + _ = x[UnassignableOperand-18] + _ = x[NoNewVar-19] + _ = x[MultiValAssignOp-20] + _ = x[InvalidIfaceAssign-21] + _ = x[InvalidChanAssign-22] + _ = x[IncompatibleAssign-23] + _ = x[UnaddressableFieldAssign-24] + _ = x[NotAType-25] + _ = x[InvalidArrayLen-26] + _ = x[BlankIfaceMethod-27] + _ = x[IncomparableMapKey-28] + _ = x[InvalidIfaceEmbed-29] + _ = x[InvalidPtrEmbed-30] + _ = x[BadRecv-31] + _ = x[InvalidRecv-32] + _ = x[DuplicateFieldAndMethod-33] + _ = x[DuplicateMethod-34] + _ = x[InvalidBlank-35] + _ = x[InvalidIota-36] + _ = x[MissingInitBody-37] + _ = x[InvalidInitSig-38] + _ = x[InvalidInitDecl-39] + _ = x[InvalidMainDecl-40] + _ = x[TooManyValues-41] + _ = x[NotAnExpr-42] + _ = x[TruncatedFloat-43] + _ = x[NumericOverflow-44] + _ = x[UndefinedOp-45] + _ = x[MismatchedTypes-46] + _ = x[DivByZero-47] + _ = x[NonNumericIncDec-48] + _ = x[UnaddressableOperand-49] + _ = x[InvalidIndirection-50] + _ = x[NonIndexableOperand-51] + _ = x[InvalidIndex-52] + _ = x[SwappedSliceIndices-53] + _ = x[NonSliceableOperand-54] + _ = x[InvalidSliceExpr-55] + _ = x[InvalidShiftCount-56] + _ = x[InvalidShiftOperand-57] + _ = x[InvalidReceive-58] + _ = x[InvalidSend-59] + _ = x[DuplicateLitKey-60] + _ = x[MissingLitKey-61] + _ = x[InvalidLitIndex-62] + _ = x[OversizeArrayLit-63] + _ = x[MixedStructLit-64] + _ = x[InvalidStructLit-65] + _ = x[MissingLitField-66] + _ = x[DuplicateLitField-67] + _ = x[UnexportedLitField-68] + _ = x[InvalidLitField-69] + _ = x[UntypedLit-70] + _ = x[InvalidLit-71] + _ = x[AmbiguousSelector-72] + _ = x[UndeclaredImportedName-73] + _ = x[UnexportedName-74] + _ = x[UndeclaredName-75] + _ = x[MissingFieldOrMethod-76] + _ = x[BadDotDotDotSyntax-77] + _ = x[NonVariadicDotDotDot-78] + _ = x[MisplacedDotDotDot-79] + _ = x[InvalidDotDotDotOperand-80] + _ = x[InvalidDotDotDot-81] + _ = x[UncalledBuiltin-82] + _ = x[InvalidAppend-83] + _ = x[InvalidCap-84] + _ = x[InvalidClose-85] + _ = x[InvalidCopy-86] + _ = x[InvalidComplex-87] + _ = x[InvalidDelete-88] + _ = x[InvalidImag-89] + _ = x[InvalidLen-90] + _ = x[SwappedMakeArgs-91] + _ = x[InvalidMake-92] + _ = x[InvalidReal-93] + _ = x[InvalidAssert-94] + _ = x[ImpossibleAssert-95] + _ = x[InvalidConversion-96] + _ = x[InvalidUntypedConversion-97] + _ = x[BadOffsetofSyntax-98] + _ = x[InvalidOffsetof-99] + _ = x[UnusedExpr-100] + _ = x[UnusedVar-101] + _ = x[MissingReturn-102] + _ = x[WrongResultCount-103] + _ = x[OutOfScopeResult-104] + _ = x[InvalidCond-105] + _ = x[InvalidPostDecl-106] + _ = x[InvalidChanRange-107] + _ = x[InvalidIterVar-108] + _ = x[InvalidRangeExpr-109] + _ = x[MisplacedBreak-110] + _ = x[MisplacedContinue-111] + _ = x[MisplacedFallthrough-112] + _ = x[DuplicateCase-113] + _ = x[DuplicateDefault-114] + _ = x[BadTypeKeyword-115] + _ = x[InvalidTypeSwitch-116] + _ = x[InvalidExprSwitch-117] + _ = x[InvalidSelectCase-118] + _ = x[UndeclaredLabel-119] + _ = x[DuplicateLabel-120] + _ = x[MisplacedLabel-121] + _ = x[UnusedLabel-122] + _ = x[JumpOverDecl-123] + _ = x[JumpIntoBlock-124] + _ = x[InvalidMethodExpr-125] + _ = x[WrongArgCount-126] + _ = x[InvalidCall-127] + _ = x[UnusedResults-128] + _ = x[InvalidDefer-129] + _ = x[InvalidGo-130] + _ = x[BadDecl-131] + _ = x[RepeatedDecl-132] + _ = x[InvalidUnsafeAdd-133] + _ = x[InvalidUnsafeSlice-134] + _ = x[UnsupportedFeature-135] + _ = x[NotAGenericType-136] + _ = x[WrongTypeArgCount-137] + _ = x[CannotInferTypeArgs-138] + _ = x[InvalidTypeArg-139] + _ = x[InvalidInstanceCycle-140] + _ = x[InvalidUnion-141] + _ = x[MisplacedConstraintIface-142] + _ = x[InvalidMethodTypeParams-143] + _ = x[MisplacedTypeParam-144] + _ = x[InvalidUnsafeSliceData-145] + _ = x[InvalidUnsafeString-146] +} + +const ( + _ErrorCode_name_0 = "InvalidSyntaxTree" + _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString" +) + +var ( + _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180} +) + +func (i ErrorCode) String() string { + switch { + case i == -1: + return _ErrorCode_name_0 + case 1 <= i && i <= 146: + i -= 1 + return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] + default: + return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/typesinternal/types.go b/upstream/vendor/golang.org/x/tools/internal/typesinternal/types.go new file mode 100644 index 00000000000..ce7d4351b22 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -0,0 +1,52 @@ +// 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. + +// Package typesinternal provides access to internal go/types APIs that are not +// yet exported. +package typesinternal + +import ( + "go/token" + "go/types" + "reflect" + "unsafe" +) + +func SetUsesCgo(conf *types.Config) bool { + v := reflect.ValueOf(conf).Elem() + + f := v.FieldByName("go115UsesCgo") + if !f.IsValid() { + f = v.FieldByName("UsesCgo") + if !f.IsValid() { + return false + } + } + + addr := unsafe.Pointer(f.UnsafeAddr()) + *(*bool)(addr) = true + + return true +} + +// ReadGo116ErrorData extracts additional information from types.Error values +// generated by Go version 1.16 and later: the error code, start position, and +// end position. If all positions are valid, start <= err.Pos <= end. +// +// If the data could not be read, the final result parameter will be false. +func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) { + var data [3]int + // By coincidence all of these fields are ints, which simplifies things. + v := reflect.ValueOf(err) + for i, name := range []string{"go116code", "go116start", "go116end"} { + f := v.FieldByName(name) + if !f.IsValid() { + return 0, 0, 0, false + } + data[i] = int(f.Int()) + } + return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true +} + +var SetGoVersion = func(conf *types.Config, version string) bool { return false } diff --git a/upstream/vendor/golang.org/x/tools/internal/typesinternal/types_118.go b/upstream/vendor/golang.org/x/tools/internal/typesinternal/types_118.go new file mode 100644 index 00000000000..a42b072a67d --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/typesinternal/types_118.go @@ -0,0 +1,19 @@ +// Copyright 2021 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 go1.18 +// +build go1.18 + +package typesinternal + +import ( + "go/types" +) + +func init() { + SetGoVersion = func(conf *types.Config, version string) bool { + conf.GoVersion = version + return true + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/versions/gover.go b/upstream/vendor/golang.org/x/tools/internal/versions/gover.go new file mode 100644 index 00000000000..bbabcd22e94 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/versions/gover.go @@ -0,0 +1,172 @@ +// 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. + +// This is a fork of internal/gover for use by x/tools until +// go1.21 and earlier are no longer supported by x/tools. + +package versions + +import "strings" + +// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]] +// The numbers are the original decimal strings to avoid integer overflows +// and since there is very little actual math. (Probably overflow doesn't matter in practice, +// but at the time this code was written, there was an existing test that used +// go1.99999999999, which does not fit in an int on 32-bit platforms. +// The "big decimal" representation avoids the problem entirely.) +type gover struct { + major string // decimal + minor string // decimal or "" + patch string // decimal or "" + kind string // "", "alpha", "beta", "rc" + pre string // decimal or "" +} + +// compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as toolchain versions. +// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". +// Malformed versions compare less than well-formed versions and equal to each other. +// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". +func compare(x, y string) int { + vx := parse(x) + vy := parse(y) + + if c := cmpInt(vx.major, vy.major); c != 0 { + return c + } + if c := cmpInt(vx.minor, vy.minor); c != 0 { + return c + } + if c := cmpInt(vx.patch, vy.patch); c != 0 { + return c + } + if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc + return c + } + if c := cmpInt(vx.pre, vy.pre); c != 0 { + return c + } + return 0 +} + +// lang returns the Go language version. For example, lang("1.2.3") == "1.2". +func lang(x string) string { + v := parse(x) + if v.minor == "" || v.major == "1" && v.minor == "0" { + return v.major + } + return v.major + "." + v.minor +} + +// isValid reports whether the version x is valid. +func isValid(x string) bool { + return parse(x) != gover{} +} + +// parse parses the Go version string x into a version. +// It returns the zero version if x is malformed. +func parse(x string) gover { + var v gover + + // Parse major version. + var ok bool + v.major, x, ok = cutInt(x) + if !ok { + return gover{} + } + if x == "" { + // Interpret "1" as "1.0.0". + v.minor = "0" + v.patch = "0" + return v + } + + // Parse . before minor version. + if x[0] != '.' { + return gover{} + } + + // Parse minor version. + v.minor, x, ok = cutInt(x[1:]) + if !ok { + return gover{} + } + if x == "" { + // Patch missing is same as "0" for older versions. + // Starting in Go 1.21, patch missing is different from explicit .0. + if cmpInt(v.minor, "21") < 0 { + v.patch = "0" + } + return v + } + + // Parse patch if present. + if x[0] == '.' { + v.patch, x, ok = cutInt(x[1:]) + if !ok || x != "" { + // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != ""). + // Allowing them would be a bit confusing because we already have: + // 1.21 < 1.21rc1 + // But a prerelease of a patch would have the opposite effect: + // 1.21.3rc1 < 1.21.3 + // We've never needed them before, so let's not start now. + return gover{} + } + return v + } + + // Parse prerelease. + i := 0 + for i < len(x) && (x[i] < '0' || '9' < x[i]) { + if x[i] < 'a' || 'z' < x[i] { + return gover{} + } + i++ + } + if i == 0 { + return gover{} + } + v.kind, x = x[:i], x[i:] + if x == "" { + return v + } + v.pre, x, ok = cutInt(x) + if !ok || x != "" { + return gover{} + } + + return v +} + +// cutInt scans the leading decimal number at the start of x to an integer +// and returns that value and the rest of the string. +func cutInt(x string) (n, rest string, ok bool) { + i := 0 + for i < len(x) && '0' <= x[i] && x[i] <= '9' { + i++ + } + if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero + return "", "", false + } + return x[:i], x[i:], true +} + +// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. +// (Copied from golang.org/x/mod/semver's compareInt.) +func cmpInt(x, y string) int { + if x == y { + return 0 + } + if len(x) < len(y) { + return -1 + } + if len(x) > len(y) { + return +1 + } + if x < y { + return -1 + } else { + return +1 + } +} diff --git a/upstream/vendor/golang.org/x/tools/internal/versions/types.go b/upstream/vendor/golang.org/x/tools/internal/versions/types.go new file mode 100644 index 00000000000..562eef21fa2 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/versions/types.go @@ -0,0 +1,19 @@ +// 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 versions + +import ( + "go/types" +) + +// GoVersion returns the Go version of the type package. +// It returns zero if no version can be determined. +func GoVersion(pkg *types.Package) string { + // TODO(taking): x/tools can call GoVersion() [from 1.21] after 1.25. + if pkg, ok := any(pkg).(interface{ GoVersion() string }); ok { + return pkg.GoVersion() + } + return "" +} diff --git a/upstream/vendor/golang.org/x/tools/internal/versions/types_go121.go b/upstream/vendor/golang.org/x/tools/internal/versions/types_go121.go new file mode 100644 index 00000000000..a7b79207aee --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/versions/types_go121.go @@ -0,0 +1,20 @@ +// 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. + +//go:build !go1.22 +// +build !go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersions always reports the a file's Go version as the +// zero version at this Go version. +func FileVersions(info *types.Info, file *ast.File) string { return "" } + +// InitFileVersions is a noop at this Go version. +func InitFileVersions(*types.Info) {} diff --git a/upstream/vendor/golang.org/x/tools/internal/versions/types_go122.go b/upstream/vendor/golang.org/x/tools/internal/versions/types_go122.go new file mode 100644 index 00000000000..7b9ba89a822 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/versions/types_go122.go @@ -0,0 +1,24 @@ +// 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. + +//go:build go1.22 +// +build go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersions maps a file to the file's semantic Go version. +// The reported version is the zero version if a version cannot be determined. +func FileVersions(info *types.Info, file *ast.File) string { + return info.FileVersions[file] +} + +// InitFileVersions initializes info to record Go versions for Go files. +func InitFileVersions(info *types.Info) { + info.FileVersions = make(map[*ast.File]string) +} diff --git a/upstream/vendor/golang.org/x/tools/internal/versions/versions.go b/upstream/vendor/golang.org/x/tools/internal/versions/versions.go new file mode 100644 index 00000000000..e16f6c33a52 --- /dev/null +++ b/upstream/vendor/golang.org/x/tools/internal/versions/versions.go @@ -0,0 +1,52 @@ +// 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 versions + +// Note: If we use build tags to use go/versions when go >=1.22, +// we run into go.dev/issue/53737. Under some operations users would see an +// import of "go/versions" even if they would not compile the file. +// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include +// For this reason, this library just a clone of go/versions for the moment. + +// Lang returns the Go language version for version x. +// If x is not a valid version, Lang returns the empty string. +// For example: +// +// Lang("go1.21rc2") = "go1.21" +// Lang("go1.21.2") = "go1.21" +// Lang("go1.21") = "go1.21" +// Lang("go1") = "go1" +// Lang("bad") = "" +// Lang("1.21") = "" +func Lang(x string) string { + v := lang(stripGo(x)) + if v == "" { + return "" + } + return x[:2+len(v)] // "go"+v without allocation +} + +// Compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as Go versions. +// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". +// Invalid versions, including the empty string, compare less than +// valid versions and equal to each other. +// The language version "go1.21" compares less than the +// release candidate and eventual releases "go1.21rc1" and "go1.21.0". +// Custom toolchain suffixes are ignored during comparison: +// "go1.21.0" and "go1.21.0-bigcorp" are equal. +func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) } + +// IsValid reports whether the version x is valid. +func IsValid(x string) bool { return isValid(stripGo(x)) } + +// stripGo converts from a "go1.21" version to a "1.21" version. +// If v does not start with "go", stripGo returns the empty string (a known invalid version). +func stripGo(v string) string { + if len(v) < 2 || v[:2] != "go" { + return "" + } + return v[2:] +} diff --git a/upstream/vendor/google.golang.org/api/internal/creds.go b/upstream/vendor/google.golang.org/api/internal/creds.go index b6dbace4c97..b6489309851 100644 --- a/upstream/vendor/google.golang.org/api/internal/creds.go +++ b/upstream/vendor/google.golang.org/api/internal/creds.go @@ -15,8 +15,6 @@ import ( "os" "time" - "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/oauth2adapt" "golang.org/x/oauth2" "google.golang.org/api/internal/cert" "google.golang.org/api/internal/impersonate" @@ -29,9 +27,6 @@ const quotaProjectEnvVar = "GOOGLE_CLOUD_QUOTA_PROJECT" // Creds returns credential information obtained from DialSettings, or if none, then // it returns default credential information. func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { - if ds.IsNewAuthLibraryEnabled() { - return credsNewAuth(ctx, ds) - } creds, err := baseCreds(ctx, ds) if err != nil { return nil, err @@ -42,59 +37,6 @@ func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { return creds, nil } -func credsNewAuth(ctx context.Context, settings *DialSettings) (*google.Credentials, error) { - // Preserve old options behavior - if settings.InternalCredentials != nil { - return settings.InternalCredentials, nil - } else if settings.Credentials != nil { - return settings.Credentials, nil - } else if settings.TokenSource != nil { - return &google.Credentials{TokenSource: settings.TokenSource}, nil - } - - if settings.AuthCredentials != nil { - return oauth2adapt.Oauth2CredentialsFromAuthCredentials(settings.AuthCredentials), nil - } - - var useSelfSignedJWT bool - var aud string - var scopes []string - // If scoped JWTs are enabled user provided an aud, allow self-signed JWT. - if settings.EnableJwtWithScope || len(settings.Audiences) > 0 { - useSelfSignedJWT = true - } - - if len(settings.Scopes) > 0 { - scopes = make([]string, len(settings.Scopes)) - copy(scopes, settings.Scopes) - } - if len(settings.Audiences) > 0 { - aud = settings.Audiences[0] - } - // Only default scopes if user did not also set an audience. - if len(settings.Scopes) == 0 && aud == "" && len(settings.DefaultScopes) > 0 { - scopes = make([]string, len(settings.DefaultScopes)) - copy(scopes, settings.DefaultScopes) - } - if len(scopes) == 0 && aud == "" { - aud = settings.DefaultAudience - } - - creds, err := credentials.DetectDefault(&credentials.DetectOptions{ - Scopes: scopes, - Audience: aud, - CredentialsFile: settings.CredentialsFile, - CredentialsJSON: settings.CredentialsJSON, - UseSelfSignedJWT: useSelfSignedJWT, - Client: oauth2.NewClient(ctx, nil), - }) - if err != nil { - return nil, err - } - - return oauth2adapt.Oauth2CredentialsFromAuthCredentials(creds), nil -} - func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { if ds.InternalCredentials != nil { return ds.InternalCredentials, nil diff --git a/upstream/vendor/google.golang.org/api/internal/settings.go b/upstream/vendor/google.golang.org/api/internal/settings.go index 6d0c18e5a87..af4a038d3e2 100644 --- a/upstream/vendor/google.golang.org/api/internal/settings.go +++ b/upstream/vendor/google.golang.org/api/internal/settings.go @@ -13,7 +13,6 @@ import ( "strconv" "time" - "cloud.google.com/go/auth" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/internal/impersonate" @@ -21,10 +20,8 @@ import ( ) const ( - newAuthLibEnvVar = "GOOGLE_API_GO_EXPERIMENTAL_ENABLE_NEW_AUTH_LIB" - newAuthLibDisabledEnVar = "GOOGLE_API_GO_EXPERIMENTAL_DISABLE_NEW_AUTH_LIB" - universeDomainEnvVar = "GOOGLE_CLOUD_UNIVERSE_DOMAIN" - defaultUniverseDomain = "googleapis.com" + newAuthLibEnVar = "GOOGLE_API_GO_EXPERIMENTAL_USE_NEW_AUTH_LIB" + universeDomainDefault = "googleapis.com" ) // DialSettings holds information needed to establish a connection with a @@ -59,17 +56,15 @@ type DialSettings struct { ImpersonationConfig *impersonate.Config EnableDirectPath bool EnableDirectPathXds bool + EnableNewAuthLibrary bool AllowNonDefaultServiceAccount bool - DefaultUniverseDomain string UniverseDomain string + DefaultUniverseDomain string + // Google API system parameters. For more information please read: // https://cloud.google.com/apis/docs/system-parameters QuotaProject string RequestReason string - - // New Auth library Options - AuthCredentials *auth.Credentials - EnableNewAuthLibrary bool } // GetScopes returns the user-provided scopes, if set, or else falls back to the @@ -96,15 +91,10 @@ func (ds *DialSettings) HasCustomAudience() bool { // IsNewAuthLibraryEnabled returns true if the new auth library should be used. func (ds *DialSettings) IsNewAuthLibraryEnabled() bool { - // Disabled env is for future rollouts to make sure there is a way to easily - // disable this behaviour once we switch in on by default. - if b, err := strconv.ParseBool(os.Getenv(newAuthLibDisabledEnVar)); err == nil && b { - return false - } if ds.EnableNewAuthLibrary { return true } - if b, err := strconv.ParseBool(os.Getenv(newAuthLibEnvVar)); err == nil { + if b, err := strconv.ParseBool(os.Getenv(newAuthLibEnVar)); err == nil { return b } return false @@ -175,32 +165,31 @@ func (ds *DialSettings) Validate() error { return nil } -// GetDefaultUniverseDomain returns the Google default universe domain -// ("googleapis.com"). +// GetDefaultUniverseDomain returns the default service domain for a given Cloud +// universe, as configured with internaloption.WithDefaultUniverseDomain. +// The default value is "googleapis.com". func (ds *DialSettings) GetDefaultUniverseDomain() string { - return defaultUniverseDomain + if ds.DefaultUniverseDomain == "" { + return universeDomainDefault + } + return ds.DefaultUniverseDomain } // GetUniverseDomain returns the default service domain for a given Cloud -// universe, with the following precedence: -// -// 1. A non-empty option.WithUniverseDomain. -// 2. A non-empty environment variable GOOGLE_CLOUD_UNIVERSE_DOMAIN. -// 3. The default value "googleapis.com". +// universe, as configured with option.WithUniverseDomain. +// The default value is the value of GetDefaultUniverseDomain, as configured +// with internaloption.WithDefaultUniverseDomain. func (ds *DialSettings) GetUniverseDomain() string { - if ds.UniverseDomain != "" { - return ds.UniverseDomain - } - if envUD := os.Getenv(universeDomainEnvVar); envUD != "" { - return envUD + if ds.UniverseDomain == "" { + return ds.GetDefaultUniverseDomain() } - return defaultUniverseDomain + return ds.UniverseDomain } // IsUniverseDomainGDU returns true if the universe domain is the default Google -// universe ("googleapis.com"). +// universe. func (ds *DialSettings) IsUniverseDomainGDU() bool { - return ds.GetUniverseDomain() == defaultUniverseDomain + return ds.GetUniverseDomain() == ds.GetDefaultUniverseDomain() } // GetUniverseDomain returns the default service domain for a given Cloud @@ -226,7 +215,7 @@ func GetUniverseDomain(creds *google.Credentials) (string, error) { case <-errors: // An error that is returned before the timer expires is likely to be // connection refused. Temporarily (2024-03-21) return the GDU domain. - return defaultUniverseDomain, nil + return universeDomainDefault, nil case res := <-results: return res, nil case <-timer.C: // Timer is expired. @@ -238,6 +227,6 @@ func GetUniverseDomain(creds *google.Credentials) (string, error) { // calls to creds.GetUniverseDomain() in grpc/dial.go and http/dial.go // and remove this method to close // https://github.com/googleapis/google-api-go-client/issues/2399. - return defaultUniverseDomain, nil + return universeDomainDefault, nil } } diff --git a/upstream/vendor/google.golang.org/api/internal/version.go b/upstream/vendor/google.golang.org/api/internal/version.go index 28c324a6476..eedb1faa7ba 100644 --- a/upstream/vendor/google.golang.org/api/internal/version.go +++ b/upstream/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.181.0" +const Version = "0.171.0" diff --git a/upstream/vendor/google.golang.org/api/option/option.go b/upstream/vendor/google.golang.org/api/option/option.go index 23aba01b628..c882c1eb482 100644 --- a/upstream/vendor/google.golang.org/api/option/option.go +++ b/upstream/vendor/google.golang.org/api/option/option.go @@ -9,7 +9,6 @@ import ( "crypto/tls" "net/http" - "cloud.google.com/go/auth" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/internal" @@ -345,19 +344,6 @@ func WithCredentials(creds *google.Credentials) ClientOption { return (*withCreds)(creds) } -// WithAuthCredentials returns a ClientOption that specifies an -// [cloud.google.com/go/auth.Credentials] to be used as the basis for -// authentication. -func WithAuthCredentials(creds *auth.Credentials) ClientOption { - return withAuthCredentials{creds} -} - -type withAuthCredentials struct{ creds *auth.Credentials } - -func (w withAuthCredentials) Apply(o *internal.DialSettings) { - o.AuthCredentials = w.creds -} - // WithUniverseDomain returns a ClientOption that sets the universe domain. // // This is an EXPERIMENTAL API and may be changed or removed in the future. diff --git a/upstream/vendor/google.golang.org/api/transport/grpc/dial.go b/upstream/vendor/google.golang.org/api/transport/grpc/dial.go index 2e66d02b378..bfc55594efb 100644 --- a/upstream/vendor/google.golang.org/api/transport/grpc/dial.go +++ b/upstream/vendor/google.golang.org/api/transport/grpc/dial.go @@ -17,10 +17,6 @@ import ( "sync" "time" - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/grpctransport" - "cloud.google.com/go/auth/oauth2adapt" "cloud.google.com/go/compute/metadata" "go.opencensus.io/plugin/ocgrpc" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" @@ -83,13 +79,6 @@ func Dial(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, e if o.GRPCConnPool != nil { return o.GRPCConnPool.Conn(), nil } - if o.IsNewAuthLibraryEnabled() { - pool, err := dialPoolNewAuth(ctx, true, 1, o) - if err != nil { - return nil, err - } - return pool.Connection(), nil - } // NOTE(cbro): We removed support for option.WithGRPCConnPool (GRPCConnPoolSize) // on 2020-02-12 because RoundRobin and WithBalancer are deprecated and we need to remove usages of it. // @@ -105,13 +94,6 @@ func DialInsecure(ctx context.Context, opts ...option.ClientOption) (*grpc.Clien if err != nil { return nil, err } - if o.IsNewAuthLibraryEnabled() { - pool, err := dialPoolNewAuth(ctx, false, 1, o) - if err != nil { - return nil, err - } - return pool.Connection(), nil - } return dial(ctx, true, o) } @@ -130,18 +112,6 @@ func DialPool(ctx context.Context, opts ...option.ClientOption) (ConnPool, error if o.GRPCConnPool != nil { return o.GRPCConnPool, nil } - - if o.IsNewAuthLibraryEnabled() { - if o.GRPCConn != nil { - return &singleConnPool{o.GRPCConn}, nil - } - pool, err := dialPoolNewAuth(ctx, true, o.GRPCConnPoolSize, o) - if err != nil { - return nil, err - } - return &poolAdapter{pool}, nil - } - poolSize := o.GRPCConnPoolSize if o.GRPCConn != nil { // WithGRPCConn is technically incompatible with WithGRPCConnectionPool. @@ -171,83 +141,6 @@ func DialPool(ctx context.Context, opts ...option.ClientOption) (ConnPool, error return pool, nil } -// dialPoolNewAuth is an adapter to call new auth library. -func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *internal.DialSettings) (grpctransport.GRPCClientConnPool, error) { - // honor options if set - var creds *auth.Credentials - if ds.InternalCredentials != nil { - creds = oauth2adapt.AuthCredentialsFromOauth2Credentials(ds.InternalCredentials) - } else if ds.Credentials != nil { - creds = oauth2adapt.AuthCredentialsFromOauth2Credentials(ds.Credentials) - } else if ds.AuthCredentials != nil { - creds = ds.AuthCredentials - } else if ds.TokenSource != nil { - credOpts := &auth.CredentialsOptions{ - TokenProvider: oauth2adapt.TokenProviderFromTokenSource(ds.TokenSource), - } - if ds.QuotaProject != "" { - credOpts.QuotaProjectIDProvider = auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) { - return ds.QuotaProject, nil - }) - } - creds = auth.NewCredentials(credOpts) - } - - var skipValidation bool - // If our clients explicitly setup the credential skip validation as it is - // assumed correct - if ds.SkipValidation || ds.InternalCredentials != nil { - skipValidation = true - } - - var aud string - if len(ds.Audiences) > 0 { - aud = ds.Audiences[0] - } - metadata := map[string]string{} - if ds.QuotaProject != "" { - metadata["X-goog-user-project"] = ds.QuotaProject - } - if ds.RequestReason != "" { - metadata["X-goog-request-reason"] = ds.RequestReason - } - - // Defaults for older clients that don't set this value yet - defaultEndpointTemplate := ds.DefaultEndpointTemplate - if defaultEndpointTemplate == "" { - defaultEndpointTemplate = ds.DefaultEndpoint - } - - pool, err := grpctransport.Dial(ctx, secure, &grpctransport.Options{ - DisableTelemetry: ds.TelemetryDisabled, - DisableAuthentication: ds.NoAuth, - Endpoint: ds.Endpoint, - Metadata: metadata, - GRPCDialOpts: ds.GRPCDialOpts, - PoolSize: poolSize, - Credentials: creds, - DetectOpts: &credentials.DetectOptions{ - Scopes: ds.Scopes, - Audience: aud, - CredentialsFile: ds.CredentialsFile, - CredentialsJSON: ds.CredentialsJSON, - Client: oauth2.NewClient(ctx, nil), - }, - InternalOptions: &grpctransport.InternalOptions{ - EnableNonDefaultSAForDirectPath: ds.AllowNonDefaultServiceAccount, - EnableDirectPath: ds.EnableDirectPath, - EnableDirectPathXds: ds.EnableDirectPathXds, - EnableJWTWithScope: ds.EnableJwtWithScope, - DefaultAudience: ds.DefaultAudience, - DefaultEndpointTemplate: defaultEndpointTemplate, - DefaultMTLSEndpoint: ds.DefaultMTLSEndpoint, - DefaultScopes: ds.DefaultScopes, - SkipValidation: skipValidation, - }, - }) - return pool, err -} - func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.ClientConn, error) { if o.HTTPClient != nil { return nil, errors.New("unsupported HTTP client specified") diff --git a/upstream/vendor/google.golang.org/api/transport/grpc/pool.go b/upstream/vendor/google.golang.org/api/transport/grpc/pool.go index c731293d849..4cf94a2771e 100644 --- a/upstream/vendor/google.golang.org/api/transport/grpc/pool.go +++ b/upstream/vendor/google.golang.org/api/transport/grpc/pool.go @@ -9,7 +9,6 @@ import ( "fmt" "sync/atomic" - "cloud.google.com/go/auth/grpctransport" "google.golang.org/api/internal" "google.golang.org/grpc" ) @@ -91,27 +90,3 @@ func (m multiError) Error() string { } return fmt.Sprintf("%s (and %d other errors)", s, n-1) } - -type poolAdapter struct { - pool grpctransport.GRPCClientConnPool -} - -func (p *poolAdapter) Conn() *grpc.ClientConn { - return p.pool.Connection() -} - -func (p *poolAdapter) Num() int { - return p.pool.Len() -} - -func (p *poolAdapter) Close() error { - return p.pool.Close() -} - -func (p *poolAdapter) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error { - return p.pool.Invoke(ctx, method, args, reply, opts...) -} - -func (p *poolAdapter) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { - return p.pool.NewStream(ctx, desc, method, opts...) -} diff --git a/upstream/vendor/google.golang.org/api/transport/http/dial.go b/upstream/vendor/google.golang.org/api/transport/http/dial.go index d1cd83b62d9..c4f5e0b1380 100644 --- a/upstream/vendor/google.golang.org/api/transport/http/dial.go +++ b/upstream/vendor/google.golang.org/api/transport/http/dial.go @@ -15,10 +15,6 @@ import ( "net/http" "time" - "cloud.google.com/go/auth" - "cloud.google.com/go/auth/credentials" - "cloud.google.com/go/auth/httptransport" - "cloud.google.com/go/auth/oauth2adapt" "go.opencensus.io/plugin/ochttp" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "golang.org/x/net/http2" @@ -47,13 +43,6 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, return settings.HTTPClient, endpoint, nil } - if settings.IsNewAuthLibraryEnabled() { - client, err := newClientNewAuth(ctx, nil, settings) - if err != nil { - return nil, "", err - } - return client, endpoint, nil - } trans, err := newTransport(ctx, defaultBaseTransport(ctx, clientCertSource, dialTLSContext), settings) if err != nil { return nil, "", err @@ -61,83 +50,6 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, return &http.Client{Transport: trans}, endpoint, nil } -// newClientNewAuth is an adapter to call new auth library. -func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.DialSettings) (*http.Client, error) { - // honor options if set - var creds *auth.Credentials - if ds.InternalCredentials != nil { - creds = oauth2adapt.AuthCredentialsFromOauth2Credentials(ds.InternalCredentials) - } else if ds.Credentials != nil { - creds = oauth2adapt.AuthCredentialsFromOauth2Credentials(ds.Credentials) - } else if ds.AuthCredentials != nil { - creds = ds.AuthCredentials - } else if ds.TokenSource != nil { - credOpts := &auth.CredentialsOptions{ - TokenProvider: oauth2adapt.TokenProviderFromTokenSource(ds.TokenSource), - } - if ds.QuotaProject != "" { - credOpts.QuotaProjectIDProvider = auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) { - return ds.QuotaProject, nil - }) - } - creds = auth.NewCredentials(credOpts) - } - - var skipValidation bool - // If our clients explicitly setup the credential skip validation as it is - // assumed correct - if ds.SkipValidation || ds.InternalCredentials != nil { - skipValidation = true - } - - // Defaults for older clients that don't set this value yet - defaultEndpointTemplate := ds.DefaultEndpointTemplate - if defaultEndpointTemplate == "" { - defaultEndpointTemplate = ds.DefaultEndpoint - } - - var aud string - if len(ds.Audiences) > 0 { - aud = ds.Audiences[0] - } - headers := http.Header{} - if ds.QuotaProject != "" { - headers.Set("X-goog-user-project", ds.QuotaProject) - } - if ds.RequestReason != "" { - headers.Set("X-goog-request-reason", ds.RequestReason) - } - client, err := httptransport.NewClient(&httptransport.Options{ - DisableTelemetry: ds.TelemetryDisabled, - DisableAuthentication: ds.NoAuth, - Headers: headers, - Endpoint: ds.Endpoint, - APIKey: ds.APIKey, - Credentials: creds, - ClientCertProvider: ds.ClientCertSource, - BaseRoundTripper: base, - DetectOpts: &credentials.DetectOptions{ - Scopes: ds.Scopes, - Audience: aud, - CredentialsFile: ds.CredentialsFile, - CredentialsJSON: ds.CredentialsJSON, - Client: oauth2.NewClient(ctx, nil), - }, - InternalOptions: &httptransport.InternalOptions{ - EnableJWTWithScope: ds.EnableJwtWithScope, - DefaultAudience: ds.DefaultAudience, - DefaultEndpointTemplate: defaultEndpointTemplate, - DefaultMTLSEndpoint: ds.DefaultMTLSEndpoint, - DefaultScopes: ds.DefaultScopes, - SkipValidation: skipValidation, - }, - }) - if err != nil { - return nil, err - } - return client, nil -} - // NewTransport creates an http.RoundTripper for use communicating with a Google // cloud service, configured with the given ClientOptions. Its RoundTrip method delegates to base. func NewTransport(ctx context.Context, base http.RoundTripper, opts ...option.ClientOption) (http.RoundTripper, error) { @@ -148,13 +60,6 @@ func NewTransport(ctx context.Context, base http.RoundTripper, opts ...option.Cl if settings.HTTPClient != nil { return nil, errors.New("transport/http: WithHTTPClient passed to NewTransport") } - if settings.IsNewAuthLibraryEnabled() { - client, err := newClientNewAuth(ctx, base, settings) - if err != nil { - return nil, err - } - return client.Transport, nil - } return newTransport(ctx, base, settings) } diff --git a/upstream/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md b/upstream/vendor/google.golang.org/appengine/CONTRIBUTING.md similarity index 55% rename from upstream/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md rename to upstream/vendor/google.golang.org/appengine/CONTRIBUTING.md index 8fd1bc9c22b..289693613cc 100644 --- a/upstream/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md +++ b/upstream/vendor/google.golang.org/appengine/CONTRIBUTING.md @@ -1,4 +1,46 @@ -# Contributor Code of Conduct +# Contributing + +1. Sign one of the contributor license agreements below. +1. Get the package: + + `go get -d google.golang.org/appengine` +1. Change into the checked out source: + + `cd $GOPATH/src/google.golang.org/appengine` +1. Fork the repo. +1. Set your fork as a remote: + + `git remote add fork git@github.com:GITHUB_USERNAME/appengine.git` +1. Make changes, commit to your fork. +1. Send a pull request with your changes. + The first line of your commit message is conventionally a one-line summary of the change, prefixed by the primary affected package, and is used as the title of your pull request. + +# Testing + +## Running system tests + +Set the `APPENGINE_DEV_APPSERVER` environment variable to `/path/to/go_appengine/dev_appserver.py`. + +Run tests with `go test`: + +``` +go test -v google.golang.org/appengine/... +``` + +## Contributor License Agreements + +Before we can accept your pull requests you'll need to sign a Contributor +License Agreement (CLA): + +- **If you are an individual writing original source code** and **you own the +intellectual property**, then you'll need to sign an [individual CLA][indvcla]. +- **If you work for a company that wants to allow you to contribute your work**, +then you'll need to sign a [corporate CLA][corpcla]. + +You can sign these electronically (just scroll to the bottom). After that, +we'll be able to accept your pull requests. + +## Contributor Code of Conduct As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, @@ -42,3 +84,5 @@ or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +[indvcla]: https://developers.google.com/open-source/cla/individual +[corpcla]: https://developers.google.com/open-source/cla/corporate diff --git a/upstream/vendor/cloud.google.com/go/auth/LICENSE b/upstream/vendor/google.golang.org/appengine/LICENSE similarity index 100% rename from upstream/vendor/cloud.google.com/go/auth/LICENSE rename to upstream/vendor/google.golang.org/appengine/LICENSE diff --git a/upstream/vendor/google.golang.org/appengine/README.md b/upstream/vendor/google.golang.org/appengine/README.md new file mode 100644 index 00000000000..5ccddd9990d --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/README.md @@ -0,0 +1,100 @@ +# Go App Engine packages + +[![CI Status](https://github.com/golang/appengine/actions/workflows/ci.yml/badge.svg)](https://github.com/golang/appengine/actions/workflows/ci.yml) + +This repository supports the Go runtime on *App Engine standard*. +It provides APIs for interacting with App Engine services. +Its canonical import path is `google.golang.org/appengine`. + +See https://cloud.google.com/appengine/docs/go/ +for more information. + +File issue reports and feature requests on the [GitHub's issue +tracker](https://github.com/golang/appengine/issues). + +## Upgrading an App Engine app to the flexible environment + +This package does not work on *App Engine flexible*. + +There are many differences between the App Engine standard environment and +the flexible environment. + +See the [documentation on upgrading to the flexible environment](https://cloud.google.com/appengine/docs/flexible/go/upgrading). + +## Directory structure + +The top level directory of this repository is the `appengine` package. It +contains the +basic APIs (e.g. `appengine.NewContext`) that apply across APIs. Specific API +packages are in subdirectories (e.g. `datastore`). + +There is an `internal` subdirectory that contains service protocol buffers, +plus packages required for connectivity to make API calls. App Engine apps +should not directly import any package under `internal`. + +## Updating from legacy (`import "appengine"`) packages + +If you're currently using the bare `appengine` packages +(that is, not these ones, imported via `google.golang.org/appengine`), +then you can use the `aefix` tool to help automate an upgrade to these packages. + +Run `go get google.golang.org/appengine/cmd/aefix` to install it. + +### 1. Update import paths + +The import paths for App Engine packages are now fully qualified, based at `google.golang.org/appengine`. +You will need to update your code to use import paths starting with that; for instance, +code importing `appengine/datastore` will now need to import `google.golang.org/appengine/datastore`. + +### 2. Update code using deprecated, removed or modified APIs + +Most App Engine services are available with exactly the same API. +A few APIs were cleaned up, and there are some differences: + +* `appengine.Context` has been replaced with the `Context` type from `context`. +* Logging methods that were on `appengine.Context` are now functions in `google.golang.org/appengine/log`. +* `appengine.Timeout` has been removed. Use `context.WithTimeout` instead. +* `appengine.Datacenter` now takes a `context.Context` argument. +* `datastore.PropertyLoadSaver` has been simplified to use slices in place of channels. +* `delay.Call` now returns an error. +* `search.FieldLoadSaver` now handles document metadata. +* `urlfetch.Transport` no longer has a Deadline field; set a deadline on the + `context.Context` instead. +* `aetest` no longer declares its own Context type, and uses the standard one instead. +* `taskqueue.QueueStats` no longer takes a maxTasks argument. That argument has been + deprecated and unused for a long time. +* `appengine.BackendHostname` and `appengine.BackendInstance` were for the deprecated backends feature. + Use `appengine.ModuleHostname`and `appengine.ModuleName` instead. +* Most of `appengine/file` and parts of `appengine/blobstore` are deprecated. + Use [Google Cloud Storage](https://godoc.org/cloud.google.com/go/storage) if the + feature you require is not present in the new + [blobstore package](https://google.golang.org/appengine/blobstore). +* `appengine/socket` is not required on App Engine flexible environment / Managed VMs. + Use the standard `net` package instead. + +## Key Encode/Decode compatibility to help with datastore library migrations + +Key compatibility updates have been added to help customers transition from google.golang.org/appengine/datastore to cloud.google.com/go/datastore. +The `EnableKeyConversion` enables automatic conversion from a key encoded with cloud.google.com/go/datastore to google.golang.org/appengine/datastore key type. + +### Enabling key conversion + +Enable key conversion by calling `EnableKeyConversion(ctx)` in the `/_ah/start` handler for basic and manual scaling or any handler in automatic scaling. + +#### 1. Basic or manual scaling + +This start handler will enable key conversion for all handlers in the service. + +``` +http.HandleFunc("/_ah/start", func(w http.ResponseWriter, r *http.Request) { + datastore.EnableKeyConversion(appengine.NewContext(r)) +}) +``` + +#### 2. Automatic scaling + +`/_ah/start` is not supported for automatic scaling and `/_ah/warmup` is not guaranteed to run, so you must call `datastore.EnableKeyConversion(appengine.NewContext(r))` +before you use code that needs key conversion. + +You may want to add this to each of your handlers, or introduce middleware where it's called. +`EnableKeyConversion` is safe for concurrent use. Any call to it after the first is ignored. \ No newline at end of file diff --git a/upstream/vendor/google.golang.org/appengine/appengine.go b/upstream/vendor/google.golang.org/appengine/appengine.go new file mode 100644 index 00000000000..35ba9c89676 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/appengine.go @@ -0,0 +1,138 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +// Package appengine provides basic functionality for Google App Engine. +// +// For more information on how to write Go apps for Google App Engine, see: +// https://cloud.google.com/appengine/docs/go/ +package appengine // import "google.golang.org/appengine" + +import ( + "context" + "net/http" + + "github.com/golang/protobuf/proto" + + "google.golang.org/appengine/internal" +) + +// The gophers party all night; the rabbits provide the beats. + +// Main is the principal entry point for an app running in App Engine. +// +// On App Engine Flexible it installs a trivial health checker if one isn't +// already registered, and starts listening on port 8080 (overridden by the +// $PORT environment variable). +// +// See https://cloud.google.com/appengine/docs/flexible/custom-runtimes#health_check_requests +// for details on how to do your own health checking. +// +// On App Engine Standard it ensures the server has started and is prepared to +// receive requests. +// +// Main never returns. +// +// Main is designed so that the app's main package looks like this: +// +// package main +// +// import ( +// "google.golang.org/appengine" +// +// _ "myapp/package0" +// _ "myapp/package1" +// ) +// +// func main() { +// appengine.Main() +// } +// +// The "myapp/packageX" packages are expected to register HTTP handlers +// in their init functions. +func Main() { + internal.Main() +} + +// Middleware wraps an http handler so that it can make GAE API calls +var Middleware func(http.Handler) http.Handler = internal.Middleware + +// IsDevAppServer reports whether the App Engine app is running in the +// development App Server. +func IsDevAppServer() bool { + return internal.IsDevAppServer() +} + +// IsStandard reports whether the App Engine app is running in the standard +// environment. This includes both the first generation runtimes (<= Go 1.9) +// and the second generation runtimes (>= Go 1.11). +func IsStandard() bool { + return internal.IsStandard() +} + +// IsFlex reports whether the App Engine app is running in the flexible environment. +func IsFlex() bool { + return internal.IsFlex() +} + +// IsAppEngine reports whether the App Engine app is running on App Engine, in either +// the standard or flexible environment. +func IsAppEngine() bool { + return internal.IsAppEngine() +} + +// IsSecondGen reports whether the App Engine app is running on the second generation +// runtimes (>= Go 1.11). +func IsSecondGen() bool { + return internal.IsSecondGen() +} + +// NewContext returns a context for an in-flight HTTP request. +// This function is cheap. +func NewContext(req *http.Request) context.Context { + return internal.ReqContext(req) +} + +// WithContext returns a copy of the parent context +// and associates it with an in-flight HTTP request. +// This function is cheap. +func WithContext(parent context.Context, req *http.Request) context.Context { + return internal.WithContext(parent, req) +} + +// BlobKey is a key for a blobstore blob. +// +// Conceptually, this type belongs in the blobstore package, but it lives in +// the appengine package to avoid a circular dependency: blobstore depends on +// datastore, and datastore needs to refer to the BlobKey type. +type BlobKey string + +// GeoPoint represents a location as latitude/longitude in degrees. +type GeoPoint struct { + Lat, Lng float64 +} + +// Valid returns whether a GeoPoint is within [-90, 90] latitude and [-180, 180] longitude. +func (g GeoPoint) Valid() bool { + return -90 <= g.Lat && g.Lat <= 90 && -180 <= g.Lng && g.Lng <= 180 +} + +// APICallFunc defines a function type for handling an API call. +// See WithCallOverride. +type APICallFunc func(ctx context.Context, service, method string, in, out proto.Message) error + +// WithAPICallFunc returns a copy of the parent context +// that will cause API calls to invoke f instead of their normal operation. +// +// This is intended for advanced users only. +func WithAPICallFunc(ctx context.Context, f APICallFunc) context.Context { + return internal.WithCallOverride(ctx, internal.CallOverrideFunc(f)) +} + +// APICall performs an API call. +// +// This is not intended for general use; it is exported for use in conjunction +// with WithAPICallFunc. +func APICall(ctx context.Context, service, method string, in, out proto.Message) error { + return internal.Call(ctx, service, method, in, out) +} diff --git a/upstream/vendor/google.golang.org/appengine/appengine_vm.go b/upstream/vendor/google.golang.org/appengine/appengine_vm.go new file mode 100644 index 00000000000..6e1d041cd95 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/appengine_vm.go @@ -0,0 +1,20 @@ +// Copyright 2015 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build !appengine +// +build !appengine + +package appengine + +import ( + "context" +) + +// BackgroundContext returns a context not associated with a request. +// +// Deprecated: App Engine no longer has a special background context. +// Just use context.Background(). +func BackgroundContext() context.Context { + return context.Background() +} diff --git a/upstream/vendor/google.golang.org/appengine/errors.go b/upstream/vendor/google.golang.org/appengine/errors.go new file mode 100644 index 00000000000..16d0772e2a4 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/errors.go @@ -0,0 +1,46 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +// This file provides error functions for common API failure modes. + +package appengine + +import ( + "fmt" + + "google.golang.org/appengine/internal" +) + +// IsOverQuota reports whether err represents an API call failure +// due to insufficient available quota. +func IsOverQuota(err error) bool { + callErr, ok := err.(*internal.CallError) + return ok && callErr.Code == 4 +} + +// MultiError is returned by batch operations when there are errors with +// particular elements. Errors will be in a one-to-one correspondence with +// the input elements; successful elements will have a nil entry. +type MultiError []error + +func (m MultiError) Error() string { + s, n := "", 0 + for _, e := range m { + if e != nil { + if n == 0 { + s = e.Error() + } + n++ + } + } + switch n { + case 0: + return "(0 errors)" + case 1: + return s + case 2: + return s + " (and 1 other error)" + } + return fmt.Sprintf("%s (and %d other errors)", s, n-1) +} diff --git a/upstream/vendor/google.golang.org/appengine/identity.go b/upstream/vendor/google.golang.org/appengine/identity.go new file mode 100644 index 00000000000..1202fc1a531 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/identity.go @@ -0,0 +1,141 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package appengine + +import ( + "context" + "time" + + "google.golang.org/appengine/internal" + pb "google.golang.org/appengine/internal/app_identity" + modpb "google.golang.org/appengine/internal/modules" +) + +// AppID returns the application ID for the current application. +// The string will be a plain application ID (e.g. "appid"), with a +// domain prefix for custom domain deployments (e.g. "example.com:appid"). +func AppID(c context.Context) string { return internal.AppID(c) } + +// DefaultVersionHostname returns the standard hostname of the default version +// of the current application (e.g. "my-app.appspot.com"). This is suitable for +// use in constructing URLs. +func DefaultVersionHostname(c context.Context) string { + return internal.DefaultVersionHostname(c) +} + +// ModuleName returns the module name of the current instance. +func ModuleName(c context.Context) string { + return internal.ModuleName(c) +} + +// ModuleHostname returns a hostname of a module instance. +// If module is the empty string, it refers to the module of the current instance. +// If version is empty, it refers to the version of the current instance if valid, +// or the default version of the module of the current instance. +// If instance is empty, ModuleHostname returns the load-balancing hostname. +func ModuleHostname(c context.Context, module, version, instance string) (string, error) { + req := &modpb.GetHostnameRequest{} + if module != "" { + req.Module = &module + } + if version != "" { + req.Version = &version + } + if instance != "" { + req.Instance = &instance + } + res := &modpb.GetHostnameResponse{} + if err := internal.Call(c, "modules", "GetHostname", req, res); err != nil { + return "", err + } + return *res.Hostname, nil +} + +// VersionID returns the version ID for the current application. +// It will be of the form "X.Y", where X is specified in app.yaml, +// and Y is a number generated when each version of the app is uploaded. +// It does not include a module name. +func VersionID(c context.Context) string { return internal.VersionID(c) } + +// InstanceID returns a mostly-unique identifier for this instance. +func InstanceID() string { return internal.InstanceID() } + +// Datacenter returns an identifier for the datacenter that the instance is running in. +func Datacenter(c context.Context) string { return internal.Datacenter(c) } + +// ServerSoftware returns the App Engine release version. +// In production, it looks like "Google App Engine/X.Y.Z". +// In the development appserver, it looks like "Development/X.Y". +func ServerSoftware() string { return internal.ServerSoftware() } + +// RequestID returns a string that uniquely identifies the request. +func RequestID(c context.Context) string { return internal.RequestID(c) } + +// AccessToken generates an OAuth2 access token for the specified scopes on +// behalf of service account of this application. This token will expire after +// the returned time. +func AccessToken(c context.Context, scopes ...string) (token string, expiry time.Time, err error) { + req := &pb.GetAccessTokenRequest{Scope: scopes} + res := &pb.GetAccessTokenResponse{} + + err = internal.Call(c, "app_identity_service", "GetAccessToken", req, res) + if err != nil { + return "", time.Time{}, err + } + return res.GetAccessToken(), time.Unix(res.GetExpirationTime(), 0), nil +} + +// Certificate represents a public certificate for the app. +type Certificate struct { + KeyName string + Data []byte // PEM-encoded X.509 certificate +} + +// PublicCertificates retrieves the public certificates for the app. +// They can be used to verify a signature returned by SignBytes. +func PublicCertificates(c context.Context) ([]Certificate, error) { + req := &pb.GetPublicCertificateForAppRequest{} + res := &pb.GetPublicCertificateForAppResponse{} + if err := internal.Call(c, "app_identity_service", "GetPublicCertificatesForApp", req, res); err != nil { + return nil, err + } + var cs []Certificate + for _, pc := range res.PublicCertificateList { + cs = append(cs, Certificate{ + KeyName: pc.GetKeyName(), + Data: []byte(pc.GetX509CertificatePem()), + }) + } + return cs, nil +} + +// ServiceAccount returns a string representing the service account name, in +// the form of an email address (typically app_id@appspot.gserviceaccount.com). +func ServiceAccount(c context.Context) (string, error) { + req := &pb.GetServiceAccountNameRequest{} + res := &pb.GetServiceAccountNameResponse{} + + err := internal.Call(c, "app_identity_service", "GetServiceAccountName", req, res) + if err != nil { + return "", err + } + return res.GetServiceAccountName(), err +} + +// SignBytes signs bytes using a private key unique to your application. +func SignBytes(c context.Context, bytes []byte) (keyName string, signature []byte, err error) { + req := &pb.SignForAppRequest{BytesToSign: bytes} + res := &pb.SignForAppResponse{} + + if err := internal.Call(c, "app_identity_service", "SignForApp", req, res); err != nil { + return "", nil, err + } + return res.GetKeyName(), res.GetSignatureBytes(), nil +} + +func init() { + internal.RegisterErrorCodeMap("app_identity_service", pb.AppIdentityServiceError_ErrorCode_name) + internal.RegisterErrorCodeMap("modules", modpb.ModulesServiceError_ErrorCode_name) +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/api.go b/upstream/vendor/google.golang.org/appengine/internal/api.go new file mode 100644 index 00000000000..0569f5dd43e --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/api.go @@ -0,0 +1,653 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build !appengine +// +build !appengine + +package internal + +import ( + "bytes" + "context" + "errors" + "fmt" + "io/ioutil" + "log" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" + + "github.com/golang/protobuf/proto" + + basepb "google.golang.org/appengine/internal/base" + logpb "google.golang.org/appengine/internal/log" + remotepb "google.golang.org/appengine/internal/remote_api" +) + +const ( + apiPath = "/rpc_http" +) + +var ( + // Incoming headers. + ticketHeader = http.CanonicalHeaderKey("X-AppEngine-API-Ticket") + dapperHeader = http.CanonicalHeaderKey("X-Google-DapperTraceInfo") + traceHeader = http.CanonicalHeaderKey("X-Cloud-Trace-Context") + curNamespaceHeader = http.CanonicalHeaderKey("X-AppEngine-Current-Namespace") + userIPHeader = http.CanonicalHeaderKey("X-AppEngine-User-IP") + remoteAddrHeader = http.CanonicalHeaderKey("X-AppEngine-Remote-Addr") + devRequestIdHeader = http.CanonicalHeaderKey("X-Appengine-Dev-Request-Id") + + // Outgoing headers. + apiEndpointHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Endpoint") + apiEndpointHeaderValue = []string{"app-engine-apis"} + apiMethodHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Method") + apiMethodHeaderValue = []string{"/VMRemoteAPI.CallRemoteAPI"} + apiDeadlineHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Deadline") + apiContentType = http.CanonicalHeaderKey("Content-Type") + apiContentTypeValue = []string{"application/octet-stream"} + logFlushHeader = http.CanonicalHeaderKey("X-AppEngine-Log-Flush-Count") + + apiHTTPClient = &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: limitDial, + MaxIdleConns: 1000, + MaxIdleConnsPerHost: 10000, + IdleConnTimeout: 90 * time.Second, + }, + } +) + +func apiURL(ctx context.Context) *url.URL { + host, port := "appengine.googleapis.internal", "10001" + if h := os.Getenv("API_HOST"); h != "" { + host = h + } + if hostOverride := ctx.Value(apiHostOverrideKey); hostOverride != nil { + host = hostOverride.(string) + } + if p := os.Getenv("API_PORT"); p != "" { + port = p + } + if portOverride := ctx.Value(apiPortOverrideKey); portOverride != nil { + port = portOverride.(string) + } + return &url.URL{ + Scheme: "http", + Host: host + ":" + port, + Path: apiPath, + } +} + +// Middleware wraps an http handler so that it can make GAE API calls +func Middleware(next http.Handler) http.Handler { + return handleHTTPMiddleware(executeRequestSafelyMiddleware(next)) +} + +func handleHTTPMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + c := &aeContext{ + req: r, + outHeader: w.Header(), + } + r = r.WithContext(withContext(r.Context(), c)) + c.req = r + + stopFlushing := make(chan int) + + // Patch up RemoteAddr so it looks reasonable. + if addr := r.Header.Get(userIPHeader); addr != "" { + r.RemoteAddr = addr + } else if addr = r.Header.Get(remoteAddrHeader); addr != "" { + r.RemoteAddr = addr + } else { + // Should not normally reach here, but pick a sensible default anyway. + r.RemoteAddr = "127.0.0.1" + } + // The address in the headers will most likely be of these forms: + // 123.123.123.123 + // 2001:db8::1 + // net/http.Request.RemoteAddr is specified to be in "IP:port" form. + if _, _, err := net.SplitHostPort(r.RemoteAddr); err != nil { + // Assume the remote address is only a host; add a default port. + r.RemoteAddr = net.JoinHostPort(r.RemoteAddr, "80") + } + + if logToLogservice() { + // Start goroutine responsible for flushing app logs. + // This is done after adding c to ctx.m (and stopped before removing it) + // because flushing logs requires making an API call. + go c.logFlusher(stopFlushing) + } + + next.ServeHTTP(c, r) + c.outHeader = nil // make sure header changes aren't respected any more + + flushed := make(chan struct{}) + if logToLogservice() { + stopFlushing <- 1 // any logging beyond this point will be dropped + + // Flush any pending logs asynchronously. + c.pendingLogs.Lock() + flushes := c.pendingLogs.flushes + if len(c.pendingLogs.lines) > 0 { + flushes++ + } + c.pendingLogs.Unlock() + go func() { + defer close(flushed) + // Force a log flush, because with very short requests we + // may not ever flush logs. + c.flushLog(true) + }() + w.Header().Set(logFlushHeader, strconv.Itoa(flushes)) + } + + // Avoid nil Write call if c.Write is never called. + if c.outCode != 0 { + w.WriteHeader(c.outCode) + } + if c.outBody != nil { + w.Write(c.outBody) + } + if logToLogservice() { + // Wait for the last flush to complete before returning, + // otherwise the security ticket will not be valid. + <-flushed + } + }) +} + +func executeRequestSafelyMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + defer func() { + if x := recover(); x != nil { + c := w.(*aeContext) + logf(c, 4, "%s", renderPanic(x)) // 4 == critical + c.outCode = 500 + } + }() + + next.ServeHTTP(w, r) + }) +} + +func renderPanic(x interface{}) string { + buf := make([]byte, 16<<10) // 16 KB should be plenty + buf = buf[:runtime.Stack(buf, false)] + + // Remove the first few stack frames: + // this func + // the recover closure in the caller + // That will root the stack trace at the site of the panic. + const ( + skipStart = "internal.renderPanic" + skipFrames = 2 + ) + start := bytes.Index(buf, []byte(skipStart)) + p := start + for i := 0; i < skipFrames*2 && p+1 < len(buf); i++ { + p = bytes.IndexByte(buf[p+1:], '\n') + p + 1 + if p < 0 { + break + } + } + if p >= 0 { + // buf[start:p+1] is the block to remove. + // Copy buf[p+1:] over buf[start:] and shrink buf. + copy(buf[start:], buf[p+1:]) + buf = buf[:len(buf)-(p+1-start)] + } + + // Add panic heading. + head := fmt.Sprintf("panic: %v\n\n", x) + if len(head) > len(buf) { + // Extremely unlikely to happen. + return head + } + copy(buf[len(head):], buf) + copy(buf, head) + + return string(buf) +} + +// aeContext represents the aeContext of an in-flight HTTP request. +// It implements the appengine.Context and http.ResponseWriter interfaces. +type aeContext struct { + req *http.Request + + outCode int + outHeader http.Header + outBody []byte + + pendingLogs struct { + sync.Mutex + lines []*logpb.UserAppLogLine + flushes int + } +} + +var contextKey = "holds a *context" + +// jointContext joins two contexts in a superficial way. +// It takes values and timeouts from a base context, and only values from another context. +type jointContext struct { + base context.Context + valuesOnly context.Context +} + +func (c jointContext) Deadline() (time.Time, bool) { + return c.base.Deadline() +} + +func (c jointContext) Done() <-chan struct{} { + return c.base.Done() +} + +func (c jointContext) Err() error { + return c.base.Err() +} + +func (c jointContext) Value(key interface{}) interface{} { + if val := c.base.Value(key); val != nil { + return val + } + return c.valuesOnly.Value(key) +} + +// fromContext returns the App Engine context or nil if ctx is not +// derived from an App Engine context. +func fromContext(ctx context.Context) *aeContext { + c, _ := ctx.Value(&contextKey).(*aeContext) + return c +} + +func withContext(parent context.Context, c *aeContext) context.Context { + ctx := context.WithValue(parent, &contextKey, c) + if ns := c.req.Header.Get(curNamespaceHeader); ns != "" { + ctx = withNamespace(ctx, ns) + } + return ctx +} + +func toContext(c *aeContext) context.Context { + return withContext(context.Background(), c) +} + +func IncomingHeaders(ctx context.Context) http.Header { + if c := fromContext(ctx); c != nil { + return c.req.Header + } + return nil +} + +func ReqContext(req *http.Request) context.Context { + return req.Context() +} + +func WithContext(parent context.Context, req *http.Request) context.Context { + return jointContext{ + base: parent, + valuesOnly: req.Context(), + } +} + +// RegisterTestRequest registers the HTTP request req for testing, such that +// any API calls are sent to the provided URL. +// It should only be used by aetest package. +func RegisterTestRequest(req *http.Request, apiURL *url.URL, appID string) *http.Request { + ctx := req.Context() + ctx = withAPIHostOverride(ctx, apiURL.Hostname()) + ctx = withAPIPortOverride(ctx, apiURL.Port()) + ctx = WithAppIDOverride(ctx, appID) + + // use the unregistered request as a placeholder so that withContext can read the headers + c := &aeContext{req: req} + c.req = req.WithContext(withContext(ctx, c)) + return c.req +} + +var errTimeout = &CallError{ + Detail: "Deadline exceeded", + Code: int32(remotepb.RpcError_CANCELLED), + Timeout: true, +} + +func (c *aeContext) Header() http.Header { return c.outHeader } + +// Copied from $GOROOT/src/pkg/net/http/transfer.go. Some response status +// codes do not permit a response body (nor response entity headers such as +// Content-Length, Content-Type, etc). +func bodyAllowedForStatus(status int) bool { + switch { + case status >= 100 && status <= 199: + return false + case status == 204: + return false + case status == 304: + return false + } + return true +} + +func (c *aeContext) Write(b []byte) (int, error) { + if c.outCode == 0 { + c.WriteHeader(http.StatusOK) + } + if len(b) > 0 && !bodyAllowedForStatus(c.outCode) { + return 0, http.ErrBodyNotAllowed + } + c.outBody = append(c.outBody, b...) + return len(b), nil +} + +func (c *aeContext) WriteHeader(code int) { + if c.outCode != 0 { + logf(c, 3, "WriteHeader called multiple times on request.") // error level + return + } + c.outCode = code +} + +func post(ctx context.Context, body []byte, timeout time.Duration) (b []byte, err error) { + apiURL := apiURL(ctx) + hreq := &http.Request{ + Method: "POST", + URL: apiURL, + Header: http.Header{ + apiEndpointHeader: apiEndpointHeaderValue, + apiMethodHeader: apiMethodHeaderValue, + apiContentType: apiContentTypeValue, + apiDeadlineHeader: []string{strconv.FormatFloat(timeout.Seconds(), 'f', -1, 64)}, + }, + Body: ioutil.NopCloser(bytes.NewReader(body)), + ContentLength: int64(len(body)), + Host: apiURL.Host, + } + c := fromContext(ctx) + if c != nil { + if info := c.req.Header.Get(dapperHeader); info != "" { + hreq.Header.Set(dapperHeader, info) + } + if info := c.req.Header.Get(traceHeader); info != "" { + hreq.Header.Set(traceHeader, info) + } + } + + tr := apiHTTPClient.Transport.(*http.Transport) + + var timedOut int32 // atomic; set to 1 if timed out + t := time.AfterFunc(timeout, func() { + atomic.StoreInt32(&timedOut, 1) + tr.CancelRequest(hreq) + }) + defer t.Stop() + defer func() { + // Check if timeout was exceeded. + if atomic.LoadInt32(&timedOut) != 0 { + err = errTimeout + } + }() + + hresp, err := apiHTTPClient.Do(hreq) + if err != nil { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge HTTP failed: %v", err), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + defer hresp.Body.Close() + hrespBody, err := ioutil.ReadAll(hresp.Body) + if hresp.StatusCode != 200 { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge returned HTTP %d (%q)", hresp.StatusCode, hrespBody), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + if err != nil { + return nil, &CallError{ + Detail: fmt.Sprintf("service bridge response bad: %v", err), + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + return hrespBody, nil +} + +func Call(ctx context.Context, service, method string, in, out proto.Message) error { + if ns := NamespaceFromContext(ctx); ns != "" { + if fn, ok := NamespaceMods[service]; ok { + fn(in, ns) + } + } + + if f, ctx, ok := callOverrideFromContext(ctx); ok { + return f(ctx, service, method, in, out) + } + + // Handle already-done contexts quickly. + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + c := fromContext(ctx) + + // Apply transaction modifications if we're in a transaction. + if t := transactionFromContext(ctx); t != nil { + if t.finished { + return errors.New("transaction aeContext has expired") + } + applyTransaction(in, &t.transaction) + } + + // Default RPC timeout is 60s. + timeout := 60 * time.Second + if deadline, ok := ctx.Deadline(); ok { + timeout = deadline.Sub(time.Now()) + } + + data, err := proto.Marshal(in) + if err != nil { + return err + } + + ticket := "" + if c != nil { + ticket = c.req.Header.Get(ticketHeader) + if dri := c.req.Header.Get(devRequestIdHeader); IsDevAppServer() && dri != "" { + ticket = dri + } + } + req := &remotepb.Request{ + ServiceName: &service, + Method: &method, + Request: data, + RequestId: &ticket, + } + hreqBody, err := proto.Marshal(req) + if err != nil { + return err + } + + hrespBody, err := post(ctx, hreqBody, timeout) + if err != nil { + return err + } + + res := &remotepb.Response{} + if err := proto.Unmarshal(hrespBody, res); err != nil { + return err + } + if res.RpcError != nil { + ce := &CallError{ + Detail: res.RpcError.GetDetail(), + Code: *res.RpcError.Code, + } + switch remotepb.RpcError_ErrorCode(ce.Code) { + case remotepb.RpcError_CANCELLED, remotepb.RpcError_DEADLINE_EXCEEDED: + ce.Timeout = true + } + return ce + } + if res.ApplicationError != nil { + return &APIError{ + Service: *req.ServiceName, + Detail: res.ApplicationError.GetDetail(), + Code: *res.ApplicationError.Code, + } + } + if res.Exception != nil || res.JavaException != nil { + // This shouldn't happen, but let's be defensive. + return &CallError{ + Detail: "service bridge returned exception", + Code: int32(remotepb.RpcError_UNKNOWN), + } + } + return proto.Unmarshal(res.Response, out) +} + +func (c *aeContext) Request() *http.Request { + return c.req +} + +func (c *aeContext) addLogLine(ll *logpb.UserAppLogLine) { + // Truncate long log lines. + // TODO(dsymonds): Check if this is still necessary. + const lim = 8 << 10 + if len(*ll.Message) > lim { + suffix := fmt.Sprintf("...(length %d)", len(*ll.Message)) + ll.Message = proto.String((*ll.Message)[:lim-len(suffix)] + suffix) + } + + c.pendingLogs.Lock() + c.pendingLogs.lines = append(c.pendingLogs.lines, ll) + c.pendingLogs.Unlock() +} + +var logLevelName = map[int64]string{ + 0: "DEBUG", + 1: "INFO", + 2: "WARNING", + 3: "ERROR", + 4: "CRITICAL", +} + +func logf(c *aeContext, level int64, format string, args ...interface{}) { + if c == nil { + panic("not an App Engine aeContext") + } + s := fmt.Sprintf(format, args...) + s = strings.TrimRight(s, "\n") // Remove any trailing newline characters. + if logToLogservice() { + c.addLogLine(&logpb.UserAppLogLine{ + TimestampUsec: proto.Int64(time.Now().UnixNano() / 1e3), + Level: &level, + Message: &s, + }) + } + // Log to stdout if not deployed + if !IsSecondGen() { + log.Print(logLevelName[level] + ": " + s) + } +} + +// flushLog attempts to flush any pending logs to the appserver. +// It should not be called concurrently. +func (c *aeContext) flushLog(force bool) (flushed bool) { + c.pendingLogs.Lock() + // Grab up to 30 MB. We can get away with up to 32 MB, but let's be cautious. + n, rem := 0, 30<<20 + for ; n < len(c.pendingLogs.lines); n++ { + ll := c.pendingLogs.lines[n] + // Each log line will require about 3 bytes of overhead. + nb := proto.Size(ll) + 3 + if nb > rem { + break + } + rem -= nb + } + lines := c.pendingLogs.lines[:n] + c.pendingLogs.lines = c.pendingLogs.lines[n:] + c.pendingLogs.Unlock() + + if len(lines) == 0 && !force { + // Nothing to flush. + return false + } + + rescueLogs := false + defer func() { + if rescueLogs { + c.pendingLogs.Lock() + c.pendingLogs.lines = append(lines, c.pendingLogs.lines...) + c.pendingLogs.Unlock() + } + }() + + buf, err := proto.Marshal(&logpb.UserAppLogGroup{ + LogLine: lines, + }) + if err != nil { + log.Printf("internal.flushLog: marshaling UserAppLogGroup: %v", err) + rescueLogs = true + return false + } + + req := &logpb.FlushRequest{ + Logs: buf, + } + res := &basepb.VoidProto{} + c.pendingLogs.Lock() + c.pendingLogs.flushes++ + c.pendingLogs.Unlock() + if err := Call(toContext(c), "logservice", "Flush", req, res); err != nil { + log.Printf("internal.flushLog: Flush RPC: %v", err) + rescueLogs = true + return false + } + return true +} + +const ( + // Log flushing parameters. + flushInterval = 1 * time.Second + forceFlushInterval = 60 * time.Second +) + +func (c *aeContext) logFlusher(stop <-chan int) { + lastFlush := time.Now() + tick := time.NewTicker(flushInterval) + for { + select { + case <-stop: + // Request finished. + tick.Stop() + return + case <-tick.C: + force := time.Now().Sub(lastFlush) > forceFlushInterval + if c.flushLog(force) { + lastFlush = time.Now() + } + } + } +} + +func ContextForTesting(req *http.Request) context.Context { + return toContext(&aeContext{req: req}) +} + +func logToLogservice() bool { + // TODO: replace logservice with json structured logs to $LOG_DIR/app.log.json + // where $LOG_DIR is /var/log in prod and some tmpdir in dev + return os.Getenv("LOG_TO_LOGSERVICE") != "0" +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/api_classic.go b/upstream/vendor/google.golang.org/appengine/internal/api_classic.go new file mode 100644 index 00000000000..87c33c798e8 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/api_classic.go @@ -0,0 +1,170 @@ +// Copyright 2015 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build appengine +// +build appengine + +package internal + +import ( + "context" + "errors" + "fmt" + "net/http" + "time" + + "appengine" + "appengine_internal" + basepb "appengine_internal/base" + + "github.com/golang/protobuf/proto" +) + +var contextKey = "holds an appengine.Context" + +// fromContext returns the App Engine context or nil if ctx is not +// derived from an App Engine context. +func fromContext(ctx context.Context) appengine.Context { + c, _ := ctx.Value(&contextKey).(appengine.Context) + return c +} + +// This is only for classic App Engine adapters. +func ClassicContextFromContext(ctx context.Context) (appengine.Context, error) { + c := fromContext(ctx) + if c == nil { + return nil, errNotAppEngineContext + } + return c, nil +} + +func withContext(parent context.Context, c appengine.Context) context.Context { + ctx := context.WithValue(parent, &contextKey, c) + + s := &basepb.StringProto{} + c.Call("__go__", "GetNamespace", &basepb.VoidProto{}, s, nil) + if ns := s.GetValue(); ns != "" { + ctx = NamespacedContext(ctx, ns) + } + + return ctx +} + +func IncomingHeaders(ctx context.Context) http.Header { + if c := fromContext(ctx); c != nil { + if req, ok := c.Request().(*http.Request); ok { + return req.Header + } + } + return nil +} + +func ReqContext(req *http.Request) context.Context { + return WithContext(context.Background(), req) +} + +func WithContext(parent context.Context, req *http.Request) context.Context { + c := appengine.NewContext(req) + return withContext(parent, c) +} + +type testingContext struct { + appengine.Context + + req *http.Request +} + +func (t *testingContext) FullyQualifiedAppID() string { return "dev~testcontext" } +func (t *testingContext) Call(service, method string, _, _ appengine_internal.ProtoMessage, _ *appengine_internal.CallOptions) error { + if service == "__go__" && method == "GetNamespace" { + return nil + } + return fmt.Errorf("testingContext: unsupported Call") +} +func (t *testingContext) Request() interface{} { return t.req } + +func ContextForTesting(req *http.Request) context.Context { + return withContext(context.Background(), &testingContext{req: req}) +} + +func Call(ctx context.Context, service, method string, in, out proto.Message) error { + if ns := NamespaceFromContext(ctx); ns != "" { + if fn, ok := NamespaceMods[service]; ok { + fn(in, ns) + } + } + + if f, ctx, ok := callOverrideFromContext(ctx); ok { + return f(ctx, service, method, in, out) + } + + // Handle already-done contexts quickly. + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + c := fromContext(ctx) + if c == nil { + // Give a good error message rather than a panic lower down. + return errNotAppEngineContext + } + + // Apply transaction modifications if we're in a transaction. + if t := transactionFromContext(ctx); t != nil { + if t.finished { + return errors.New("transaction context has expired") + } + applyTransaction(in, &t.transaction) + } + + var opts *appengine_internal.CallOptions + if d, ok := ctx.Deadline(); ok { + opts = &appengine_internal.CallOptions{ + Timeout: d.Sub(time.Now()), + } + } + + err := c.Call(service, method, in, out, opts) + switch v := err.(type) { + case *appengine_internal.APIError: + return &APIError{ + Service: v.Service, + Detail: v.Detail, + Code: v.Code, + } + case *appengine_internal.CallError: + return &CallError{ + Detail: v.Detail, + Code: v.Code, + Timeout: v.Timeout, + } + } + return err +} + +func Middleware(next http.Handler) http.Handler { + panic("Middleware called; this should be impossible") +} + +func logf(c appengine.Context, level int64, format string, args ...interface{}) { + var fn func(format string, args ...interface{}) + switch level { + case 0: + fn = c.Debugf + case 1: + fn = c.Infof + case 2: + fn = c.Warningf + case 3: + fn = c.Errorf + case 4: + fn = c.Criticalf + default: + // This shouldn't happen. + fn = c.Criticalf + } + fn(format, args...) +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/api_common.go b/upstream/vendor/google.golang.org/appengine/internal/api_common.go new file mode 100644 index 00000000000..5b95c13d926 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/api_common.go @@ -0,0 +1,141 @@ +// Copyright 2015 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +import ( + "context" + "errors" + "os" + + "github.com/golang/protobuf/proto" +) + +type ctxKey string + +func (c ctxKey) String() string { + return "appengine context key: " + string(c) +} + +var errNotAppEngineContext = errors.New("not an App Engine context") + +type CallOverrideFunc func(ctx context.Context, service, method string, in, out proto.Message) error + +var callOverrideKey = "holds []CallOverrideFunc" + +func WithCallOverride(ctx context.Context, f CallOverrideFunc) context.Context { + // We avoid appending to any existing call override + // so we don't risk overwriting a popped stack below. + var cofs []CallOverrideFunc + if uf, ok := ctx.Value(&callOverrideKey).([]CallOverrideFunc); ok { + cofs = append(cofs, uf...) + } + cofs = append(cofs, f) + return context.WithValue(ctx, &callOverrideKey, cofs) +} + +func callOverrideFromContext(ctx context.Context) (CallOverrideFunc, context.Context, bool) { + cofs, _ := ctx.Value(&callOverrideKey).([]CallOverrideFunc) + if len(cofs) == 0 { + return nil, nil, false + } + // We found a list of overrides; grab the last, and reconstitute a + // context that will hide it. + f := cofs[len(cofs)-1] + ctx = context.WithValue(ctx, &callOverrideKey, cofs[:len(cofs)-1]) + return f, ctx, true +} + +type logOverrideFunc func(level int64, format string, args ...interface{}) + +var logOverrideKey = "holds a logOverrideFunc" + +func WithLogOverride(ctx context.Context, f logOverrideFunc) context.Context { + return context.WithValue(ctx, &logOverrideKey, f) +} + +var appIDOverrideKey = "holds a string, being the full app ID" + +func WithAppIDOverride(ctx context.Context, appID string) context.Context { + return context.WithValue(ctx, &appIDOverrideKey, appID) +} + +var apiHostOverrideKey = ctxKey("holds a string, being the alternate API_HOST") + +func withAPIHostOverride(ctx context.Context, apiHost string) context.Context { + return context.WithValue(ctx, apiHostOverrideKey, apiHost) +} + +var apiPortOverrideKey = ctxKey("holds a string, being the alternate API_PORT") + +func withAPIPortOverride(ctx context.Context, apiPort string) context.Context { + return context.WithValue(ctx, apiPortOverrideKey, apiPort) +} + +var namespaceKey = "holds the namespace string" + +func withNamespace(ctx context.Context, ns string) context.Context { + return context.WithValue(ctx, &namespaceKey, ns) +} + +func NamespaceFromContext(ctx context.Context) string { + // If there's no namespace, return the empty string. + ns, _ := ctx.Value(&namespaceKey).(string) + return ns +} + +// FullyQualifiedAppID returns the fully-qualified application ID. +// This may contain a partition prefix (e.g. "s~" for High Replication apps), +// or a domain prefix (e.g. "example.com:"). +func FullyQualifiedAppID(ctx context.Context) string { + if id, ok := ctx.Value(&appIDOverrideKey).(string); ok { + return id + } + return fullyQualifiedAppID(ctx) +} + +func Logf(ctx context.Context, level int64, format string, args ...interface{}) { + if f, ok := ctx.Value(&logOverrideKey).(logOverrideFunc); ok { + f(level, format, args...) + return + } + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + logf(c, level, format, args...) +} + +// NamespacedContext wraps a Context to support namespaces. +func NamespacedContext(ctx context.Context, namespace string) context.Context { + return withNamespace(ctx, namespace) +} + +// SetTestEnv sets the env variables for testing background ticket in Flex. +func SetTestEnv() func() { + var environ = []struct { + key, value string + }{ + {"GAE_LONG_APP_ID", "my-app-id"}, + {"GAE_MINOR_VERSION", "067924799508853122"}, + {"GAE_MODULE_INSTANCE", "0"}, + {"GAE_MODULE_NAME", "default"}, + {"GAE_MODULE_VERSION", "20150612t184001"}, + } + + for _, v := range environ { + old := os.Getenv(v.key) + os.Setenv(v.key, v.value) + v.value = old + } + return func() { // Restore old environment after the test completes. + for _, v := range environ { + if v.value == "" { + os.Unsetenv(v.key) + continue + } + os.Setenv(v.key, v.value) + } + } +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/app_id.go b/upstream/vendor/google.golang.org/appengine/internal/app_id.go new file mode 100644 index 00000000000..11df8c07b53 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/app_id.go @@ -0,0 +1,28 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +import ( + "strings" +) + +func parseFullAppID(appid string) (partition, domain, displayID string) { + if i := strings.Index(appid, "~"); i != -1 { + partition, appid = appid[:i], appid[i+1:] + } + if i := strings.Index(appid, ":"); i != -1 { + domain, appid = appid[:i], appid[i+1:] + } + return partition, domain, appid +} + +// appID returns "appid" or "domain.com:appid". +func appID(fullAppID string) string { + _, dom, dis := parseFullAppID(fullAppID) + if dom != "" { + return dom + ":" + dis + } + return dis +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go b/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go new file mode 100644 index 00000000000..9a2ff77ab5d --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go @@ -0,0 +1,611 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/app_identity/app_identity_service.proto + +package app_identity + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type AppIdentityServiceError_ErrorCode int32 + +const ( + AppIdentityServiceError_SUCCESS AppIdentityServiceError_ErrorCode = 0 + AppIdentityServiceError_UNKNOWN_SCOPE AppIdentityServiceError_ErrorCode = 9 + AppIdentityServiceError_BLOB_TOO_LARGE AppIdentityServiceError_ErrorCode = 1000 + AppIdentityServiceError_DEADLINE_EXCEEDED AppIdentityServiceError_ErrorCode = 1001 + AppIdentityServiceError_NOT_A_VALID_APP AppIdentityServiceError_ErrorCode = 1002 + AppIdentityServiceError_UNKNOWN_ERROR AppIdentityServiceError_ErrorCode = 1003 + AppIdentityServiceError_NOT_ALLOWED AppIdentityServiceError_ErrorCode = 1005 + AppIdentityServiceError_NOT_IMPLEMENTED AppIdentityServiceError_ErrorCode = 1006 +) + +var AppIdentityServiceError_ErrorCode_name = map[int32]string{ + 0: "SUCCESS", + 9: "UNKNOWN_SCOPE", + 1000: "BLOB_TOO_LARGE", + 1001: "DEADLINE_EXCEEDED", + 1002: "NOT_A_VALID_APP", + 1003: "UNKNOWN_ERROR", + 1005: "NOT_ALLOWED", + 1006: "NOT_IMPLEMENTED", +} +var AppIdentityServiceError_ErrorCode_value = map[string]int32{ + "SUCCESS": 0, + "UNKNOWN_SCOPE": 9, + "BLOB_TOO_LARGE": 1000, + "DEADLINE_EXCEEDED": 1001, + "NOT_A_VALID_APP": 1002, + "UNKNOWN_ERROR": 1003, + "NOT_ALLOWED": 1005, + "NOT_IMPLEMENTED": 1006, +} + +func (x AppIdentityServiceError_ErrorCode) Enum() *AppIdentityServiceError_ErrorCode { + p := new(AppIdentityServiceError_ErrorCode) + *p = x + return p +} +func (x AppIdentityServiceError_ErrorCode) String() string { + return proto.EnumName(AppIdentityServiceError_ErrorCode_name, int32(x)) +} +func (x *AppIdentityServiceError_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(AppIdentityServiceError_ErrorCode_value, data, "AppIdentityServiceError_ErrorCode") + if err != nil { + return err + } + *x = AppIdentityServiceError_ErrorCode(value) + return nil +} +func (AppIdentityServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0, 0} +} + +type AppIdentityServiceError struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AppIdentityServiceError) Reset() { *m = AppIdentityServiceError{} } +func (m *AppIdentityServiceError) String() string { return proto.CompactTextString(m) } +func (*AppIdentityServiceError) ProtoMessage() {} +func (*AppIdentityServiceError) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0} +} +func (m *AppIdentityServiceError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AppIdentityServiceError.Unmarshal(m, b) +} +func (m *AppIdentityServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AppIdentityServiceError.Marshal(b, m, deterministic) +} +func (dst *AppIdentityServiceError) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppIdentityServiceError.Merge(dst, src) +} +func (m *AppIdentityServiceError) XXX_Size() int { + return xxx_messageInfo_AppIdentityServiceError.Size(m) +} +func (m *AppIdentityServiceError) XXX_DiscardUnknown() { + xxx_messageInfo_AppIdentityServiceError.DiscardUnknown(m) +} + +var xxx_messageInfo_AppIdentityServiceError proto.InternalMessageInfo + +type SignForAppRequest struct { + BytesToSign []byte `protobuf:"bytes,1,opt,name=bytes_to_sign,json=bytesToSign" json:"bytes_to_sign,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignForAppRequest) Reset() { *m = SignForAppRequest{} } +func (m *SignForAppRequest) String() string { return proto.CompactTextString(m) } +func (*SignForAppRequest) ProtoMessage() {} +func (*SignForAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{1} +} +func (m *SignForAppRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignForAppRequest.Unmarshal(m, b) +} +func (m *SignForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignForAppRequest.Marshal(b, m, deterministic) +} +func (dst *SignForAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignForAppRequest.Merge(dst, src) +} +func (m *SignForAppRequest) XXX_Size() int { + return xxx_messageInfo_SignForAppRequest.Size(m) +} +func (m *SignForAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SignForAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SignForAppRequest proto.InternalMessageInfo + +func (m *SignForAppRequest) GetBytesToSign() []byte { + if m != nil { + return m.BytesToSign + } + return nil +} + +type SignForAppResponse struct { + KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"` + SignatureBytes []byte `protobuf:"bytes,2,opt,name=signature_bytes,json=signatureBytes" json:"signature_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignForAppResponse) Reset() { *m = SignForAppResponse{} } +func (m *SignForAppResponse) String() string { return proto.CompactTextString(m) } +func (*SignForAppResponse) ProtoMessage() {} +func (*SignForAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{2} +} +func (m *SignForAppResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignForAppResponse.Unmarshal(m, b) +} +func (m *SignForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignForAppResponse.Marshal(b, m, deterministic) +} +func (dst *SignForAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignForAppResponse.Merge(dst, src) +} +func (m *SignForAppResponse) XXX_Size() int { + return xxx_messageInfo_SignForAppResponse.Size(m) +} +func (m *SignForAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SignForAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SignForAppResponse proto.InternalMessageInfo + +func (m *SignForAppResponse) GetKeyName() string { + if m != nil && m.KeyName != nil { + return *m.KeyName + } + return "" +} + +func (m *SignForAppResponse) GetSignatureBytes() []byte { + if m != nil { + return m.SignatureBytes + } + return nil +} + +type GetPublicCertificateForAppRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPublicCertificateForAppRequest) Reset() { *m = GetPublicCertificateForAppRequest{} } +func (m *GetPublicCertificateForAppRequest) String() string { return proto.CompactTextString(m) } +func (*GetPublicCertificateForAppRequest) ProtoMessage() {} +func (*GetPublicCertificateForAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{3} +} +func (m *GetPublicCertificateForAppRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPublicCertificateForAppRequest.Unmarshal(m, b) +} +func (m *GetPublicCertificateForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPublicCertificateForAppRequest.Marshal(b, m, deterministic) +} +func (dst *GetPublicCertificateForAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPublicCertificateForAppRequest.Merge(dst, src) +} +func (m *GetPublicCertificateForAppRequest) XXX_Size() int { + return xxx_messageInfo_GetPublicCertificateForAppRequest.Size(m) +} +func (m *GetPublicCertificateForAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPublicCertificateForAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPublicCertificateForAppRequest proto.InternalMessageInfo + +type PublicCertificate struct { + KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"` + X509CertificatePem *string `protobuf:"bytes,2,opt,name=x509_certificate_pem,json=x509CertificatePem" json:"x509_certificate_pem,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PublicCertificate) Reset() { *m = PublicCertificate{} } +func (m *PublicCertificate) String() string { return proto.CompactTextString(m) } +func (*PublicCertificate) ProtoMessage() {} +func (*PublicCertificate) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{4} +} +func (m *PublicCertificate) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PublicCertificate.Unmarshal(m, b) +} +func (m *PublicCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PublicCertificate.Marshal(b, m, deterministic) +} +func (dst *PublicCertificate) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublicCertificate.Merge(dst, src) +} +func (m *PublicCertificate) XXX_Size() int { + return xxx_messageInfo_PublicCertificate.Size(m) +} +func (m *PublicCertificate) XXX_DiscardUnknown() { + xxx_messageInfo_PublicCertificate.DiscardUnknown(m) +} + +var xxx_messageInfo_PublicCertificate proto.InternalMessageInfo + +func (m *PublicCertificate) GetKeyName() string { + if m != nil && m.KeyName != nil { + return *m.KeyName + } + return "" +} + +func (m *PublicCertificate) GetX509CertificatePem() string { + if m != nil && m.X509CertificatePem != nil { + return *m.X509CertificatePem + } + return "" +} + +type GetPublicCertificateForAppResponse struct { + PublicCertificateList []*PublicCertificate `protobuf:"bytes,1,rep,name=public_certificate_list,json=publicCertificateList" json:"public_certificate_list,omitempty"` + MaxClientCacheTimeInSecond *int64 `protobuf:"varint,2,opt,name=max_client_cache_time_in_second,json=maxClientCacheTimeInSecond" json:"max_client_cache_time_in_second,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPublicCertificateForAppResponse) Reset() { *m = GetPublicCertificateForAppResponse{} } +func (m *GetPublicCertificateForAppResponse) String() string { return proto.CompactTextString(m) } +func (*GetPublicCertificateForAppResponse) ProtoMessage() {} +func (*GetPublicCertificateForAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{5} +} +func (m *GetPublicCertificateForAppResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPublicCertificateForAppResponse.Unmarshal(m, b) +} +func (m *GetPublicCertificateForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPublicCertificateForAppResponse.Marshal(b, m, deterministic) +} +func (dst *GetPublicCertificateForAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPublicCertificateForAppResponse.Merge(dst, src) +} +func (m *GetPublicCertificateForAppResponse) XXX_Size() int { + return xxx_messageInfo_GetPublicCertificateForAppResponse.Size(m) +} +func (m *GetPublicCertificateForAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetPublicCertificateForAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPublicCertificateForAppResponse proto.InternalMessageInfo + +func (m *GetPublicCertificateForAppResponse) GetPublicCertificateList() []*PublicCertificate { + if m != nil { + return m.PublicCertificateList + } + return nil +} + +func (m *GetPublicCertificateForAppResponse) GetMaxClientCacheTimeInSecond() int64 { + if m != nil && m.MaxClientCacheTimeInSecond != nil { + return *m.MaxClientCacheTimeInSecond + } + return 0 +} + +type GetServiceAccountNameRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetServiceAccountNameRequest) Reset() { *m = GetServiceAccountNameRequest{} } +func (m *GetServiceAccountNameRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceAccountNameRequest) ProtoMessage() {} +func (*GetServiceAccountNameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{6} +} +func (m *GetServiceAccountNameRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetServiceAccountNameRequest.Unmarshal(m, b) +} +func (m *GetServiceAccountNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetServiceAccountNameRequest.Marshal(b, m, deterministic) +} +func (dst *GetServiceAccountNameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetServiceAccountNameRequest.Merge(dst, src) +} +func (m *GetServiceAccountNameRequest) XXX_Size() int { + return xxx_messageInfo_GetServiceAccountNameRequest.Size(m) +} +func (m *GetServiceAccountNameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetServiceAccountNameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetServiceAccountNameRequest proto.InternalMessageInfo + +type GetServiceAccountNameResponse struct { + ServiceAccountName *string `protobuf:"bytes,1,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetServiceAccountNameResponse) Reset() { *m = GetServiceAccountNameResponse{} } +func (m *GetServiceAccountNameResponse) String() string { return proto.CompactTextString(m) } +func (*GetServiceAccountNameResponse) ProtoMessage() {} +func (*GetServiceAccountNameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{7} +} +func (m *GetServiceAccountNameResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetServiceAccountNameResponse.Unmarshal(m, b) +} +func (m *GetServiceAccountNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetServiceAccountNameResponse.Marshal(b, m, deterministic) +} +func (dst *GetServiceAccountNameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetServiceAccountNameResponse.Merge(dst, src) +} +func (m *GetServiceAccountNameResponse) XXX_Size() int { + return xxx_messageInfo_GetServiceAccountNameResponse.Size(m) +} +func (m *GetServiceAccountNameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetServiceAccountNameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetServiceAccountNameResponse proto.InternalMessageInfo + +func (m *GetServiceAccountNameResponse) GetServiceAccountName() string { + if m != nil && m.ServiceAccountName != nil { + return *m.ServiceAccountName + } + return "" +} + +type GetAccessTokenRequest struct { + Scope []string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty"` + ServiceAccountId *int64 `protobuf:"varint,2,opt,name=service_account_id,json=serviceAccountId" json:"service_account_id,omitempty"` + ServiceAccountName *string `protobuf:"bytes,3,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAccessTokenRequest) Reset() { *m = GetAccessTokenRequest{} } +func (m *GetAccessTokenRequest) String() string { return proto.CompactTextString(m) } +func (*GetAccessTokenRequest) ProtoMessage() {} +func (*GetAccessTokenRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{8} +} +func (m *GetAccessTokenRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAccessTokenRequest.Unmarshal(m, b) +} +func (m *GetAccessTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAccessTokenRequest.Marshal(b, m, deterministic) +} +func (dst *GetAccessTokenRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAccessTokenRequest.Merge(dst, src) +} +func (m *GetAccessTokenRequest) XXX_Size() int { + return xxx_messageInfo_GetAccessTokenRequest.Size(m) +} +func (m *GetAccessTokenRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAccessTokenRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAccessTokenRequest proto.InternalMessageInfo + +func (m *GetAccessTokenRequest) GetScope() []string { + if m != nil { + return m.Scope + } + return nil +} + +func (m *GetAccessTokenRequest) GetServiceAccountId() int64 { + if m != nil && m.ServiceAccountId != nil { + return *m.ServiceAccountId + } + return 0 +} + +func (m *GetAccessTokenRequest) GetServiceAccountName() string { + if m != nil && m.ServiceAccountName != nil { + return *m.ServiceAccountName + } + return "" +} + +type GetAccessTokenResponse struct { + AccessToken *string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` + ExpirationTime *int64 `protobuf:"varint,2,opt,name=expiration_time,json=expirationTime" json:"expiration_time,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAccessTokenResponse) Reset() { *m = GetAccessTokenResponse{} } +func (m *GetAccessTokenResponse) String() string { return proto.CompactTextString(m) } +func (*GetAccessTokenResponse) ProtoMessage() {} +func (*GetAccessTokenResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{9} +} +func (m *GetAccessTokenResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAccessTokenResponse.Unmarshal(m, b) +} +func (m *GetAccessTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAccessTokenResponse.Marshal(b, m, deterministic) +} +func (dst *GetAccessTokenResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAccessTokenResponse.Merge(dst, src) +} +func (m *GetAccessTokenResponse) XXX_Size() int { + return xxx_messageInfo_GetAccessTokenResponse.Size(m) +} +func (m *GetAccessTokenResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetAccessTokenResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAccessTokenResponse proto.InternalMessageInfo + +func (m *GetAccessTokenResponse) GetAccessToken() string { + if m != nil && m.AccessToken != nil { + return *m.AccessToken + } + return "" +} + +func (m *GetAccessTokenResponse) GetExpirationTime() int64 { + if m != nil && m.ExpirationTime != nil { + return *m.ExpirationTime + } + return 0 +} + +type GetDefaultGcsBucketNameRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDefaultGcsBucketNameRequest) Reset() { *m = GetDefaultGcsBucketNameRequest{} } +func (m *GetDefaultGcsBucketNameRequest) String() string { return proto.CompactTextString(m) } +func (*GetDefaultGcsBucketNameRequest) ProtoMessage() {} +func (*GetDefaultGcsBucketNameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{10} +} +func (m *GetDefaultGcsBucketNameRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Unmarshal(m, b) +} +func (m *GetDefaultGcsBucketNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Marshal(b, m, deterministic) +} +func (dst *GetDefaultGcsBucketNameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDefaultGcsBucketNameRequest.Merge(dst, src) +} +func (m *GetDefaultGcsBucketNameRequest) XXX_Size() int { + return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Size(m) +} +func (m *GetDefaultGcsBucketNameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDefaultGcsBucketNameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDefaultGcsBucketNameRequest proto.InternalMessageInfo + +type GetDefaultGcsBucketNameResponse struct { + DefaultGcsBucketName *string `protobuf:"bytes,1,opt,name=default_gcs_bucket_name,json=defaultGcsBucketName" json:"default_gcs_bucket_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDefaultGcsBucketNameResponse) Reset() { *m = GetDefaultGcsBucketNameResponse{} } +func (m *GetDefaultGcsBucketNameResponse) String() string { return proto.CompactTextString(m) } +func (*GetDefaultGcsBucketNameResponse) ProtoMessage() {} +func (*GetDefaultGcsBucketNameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{11} +} +func (m *GetDefaultGcsBucketNameResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Unmarshal(m, b) +} +func (m *GetDefaultGcsBucketNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Marshal(b, m, deterministic) +} +func (dst *GetDefaultGcsBucketNameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDefaultGcsBucketNameResponse.Merge(dst, src) +} +func (m *GetDefaultGcsBucketNameResponse) XXX_Size() int { + return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Size(m) +} +func (m *GetDefaultGcsBucketNameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetDefaultGcsBucketNameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDefaultGcsBucketNameResponse proto.InternalMessageInfo + +func (m *GetDefaultGcsBucketNameResponse) GetDefaultGcsBucketName() string { + if m != nil && m.DefaultGcsBucketName != nil { + return *m.DefaultGcsBucketName + } + return "" +} + +func init() { + proto.RegisterType((*AppIdentityServiceError)(nil), "appengine.AppIdentityServiceError") + proto.RegisterType((*SignForAppRequest)(nil), "appengine.SignForAppRequest") + proto.RegisterType((*SignForAppResponse)(nil), "appengine.SignForAppResponse") + proto.RegisterType((*GetPublicCertificateForAppRequest)(nil), "appengine.GetPublicCertificateForAppRequest") + proto.RegisterType((*PublicCertificate)(nil), "appengine.PublicCertificate") + proto.RegisterType((*GetPublicCertificateForAppResponse)(nil), "appengine.GetPublicCertificateForAppResponse") + proto.RegisterType((*GetServiceAccountNameRequest)(nil), "appengine.GetServiceAccountNameRequest") + proto.RegisterType((*GetServiceAccountNameResponse)(nil), "appengine.GetServiceAccountNameResponse") + proto.RegisterType((*GetAccessTokenRequest)(nil), "appengine.GetAccessTokenRequest") + proto.RegisterType((*GetAccessTokenResponse)(nil), "appengine.GetAccessTokenResponse") + proto.RegisterType((*GetDefaultGcsBucketNameRequest)(nil), "appengine.GetDefaultGcsBucketNameRequest") + proto.RegisterType((*GetDefaultGcsBucketNameResponse)(nil), "appengine.GetDefaultGcsBucketNameResponse") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/app_identity/app_identity_service.proto", fileDescriptor_app_identity_service_08a6e3f74b04cfa4) +} + +var fileDescriptor_app_identity_service_08a6e3f74b04cfa4 = []byte{ + // 676 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xdb, 0x6e, 0xda, 0x58, + 0x14, 0x1d, 0x26, 0x1a, 0x31, 0x6c, 0x12, 0x62, 0xce, 0x90, 0xcb, 0x8c, 0x32, 0xb9, 0x78, 0x1e, + 0x26, 0x0f, 0x15, 0x89, 0x2a, 0x45, 0x55, 0x1f, 0x8d, 0xed, 0x22, 0x54, 0x07, 0x53, 0x43, 0x9a, + 0xa8, 0x2f, 0xa7, 0xce, 0x61, 0xc7, 0x3d, 0x02, 0x9f, 0xe3, 0xda, 0x87, 0x0a, 0x3e, 0xa2, 0x3f, + 0xd2, 0x9f, 0xe8, 0x5b, 0xbf, 0xa5, 0x17, 0xb5, 0xdf, 0x50, 0xd9, 0x38, 0x5c, 0x92, 0x92, 0x37, + 0xbc, 0xf6, 0x5a, 0xcb, 0x6b, 0x2f, 0x6d, 0x0c, 0x4e, 0x20, 0x65, 0x30, 0xc4, 0x7a, 0x20, 0x87, + 0xbe, 0x08, 0xea, 0x32, 0x0e, 0x4e, 0xfc, 0x28, 0x42, 0x11, 0x70, 0x81, 0x27, 0x5c, 0x28, 0x8c, + 0x85, 0x3f, 0x4c, 0x21, 0xca, 0xfb, 0x28, 0x14, 0x57, 0x93, 0xa5, 0x07, 0x9a, 0x60, 0xfc, 0x8e, + 0x33, 0xac, 0x47, 0xb1, 0x54, 0x92, 0x94, 0x66, 0x5a, 0xfd, 0x53, 0x01, 0x76, 0x8c, 0x28, 0x6a, + 0xe5, 0xc4, 0xee, 0x94, 0x67, 0xc7, 0xb1, 0x8c, 0xf5, 0x0f, 0x05, 0x28, 0x65, 0xbf, 0x4c, 0xd9, + 0x47, 0x52, 0x86, 0x62, 0xf7, 0xc2, 0x34, 0xed, 0x6e, 0x57, 0xfb, 0x8d, 0x54, 0x61, 0xe3, 0xa2, + 0xfd, 0xbc, 0xed, 0x5e, 0xb6, 0x69, 0xd7, 0x74, 0x3b, 0xb6, 0x56, 0x22, 0x7f, 0x41, 0xa5, 0xe1, + 0xb8, 0x0d, 0xda, 0x73, 0x5d, 0xea, 0x18, 0x5e, 0xd3, 0xd6, 0x3e, 0x17, 0xc9, 0x36, 0x54, 0x2d, + 0xdb, 0xb0, 0x9c, 0x56, 0xdb, 0xa6, 0xf6, 0x95, 0x69, 0xdb, 0x96, 0x6d, 0x69, 0x5f, 0x8a, 0xa4, + 0x06, 0x9b, 0x6d, 0xb7, 0x47, 0x0d, 0xfa, 0xd2, 0x70, 0x5a, 0x16, 0x35, 0x3a, 0x1d, 0xed, 0x6b, + 0x91, 0x90, 0xb9, 0xab, 0xed, 0x79, 0xae, 0xa7, 0x7d, 0x2b, 0x12, 0x0d, 0xca, 0x19, 0xd3, 0x71, + 0xdc, 0x4b, 0xdb, 0xd2, 0xbe, 0xcf, 0xb4, 0xad, 0xf3, 0x8e, 0x63, 0x9f, 0xdb, 0xed, 0x9e, 0x6d, + 0x69, 0x3f, 0x8a, 0xfa, 0x13, 0xa8, 0x76, 0x79, 0x20, 0x9e, 0xc9, 0xd8, 0x88, 0x22, 0x0f, 0xdf, + 0x8e, 0x30, 0x51, 0x44, 0x87, 0x8d, 0xeb, 0x89, 0xc2, 0x84, 0x2a, 0x49, 0x13, 0x1e, 0x88, 0xdd, + 0xc2, 0x61, 0xe1, 0x78, 0xdd, 0x2b, 0x67, 0x60, 0x4f, 0xa6, 0x02, 0xfd, 0x0a, 0xc8, 0xa2, 0x30, + 0x89, 0xa4, 0x48, 0x90, 0xfc, 0x0d, 0x7f, 0x0e, 0x70, 0x42, 0x85, 0x1f, 0x62, 0x26, 0x2a, 0x79, + 0xc5, 0x01, 0x4e, 0xda, 0x7e, 0x88, 0xe4, 0x7f, 0xd8, 0x4c, 0xbd, 0x7c, 0x35, 0x8a, 0x91, 0x66, + 0x4e, 0xbb, 0xbf, 0x67, 0xb6, 0x95, 0x19, 0xdc, 0x48, 0x51, 0xfd, 0x3f, 0x38, 0x6a, 0xa2, 0xea, + 0x8c, 0xae, 0x87, 0x9c, 0x99, 0x18, 0x2b, 0x7e, 0xc3, 0x99, 0xaf, 0x70, 0x29, 0xa2, 0xfe, 0x1a, + 0xaa, 0xf7, 0x18, 0x0f, 0xbd, 0xfd, 0x14, 0x6a, 0xe3, 0xb3, 0xd3, 0xa7, 0x94, 0xcd, 0xe9, 0x34, + 0xc2, 0x30, 0x8b, 0x50, 0xf2, 0x48, 0x3a, 0x5b, 0x70, 0xea, 0x60, 0xa8, 0x7f, 0x2c, 0x80, 0xfe, + 0x50, 0x8e, 0x7c, 0xe3, 0x1e, 0xec, 0x44, 0x19, 0x65, 0xc9, 0x7a, 0xc8, 0x13, 0xb5, 0x5b, 0x38, + 0x5c, 0x3b, 0x2e, 0x3f, 0xde, 0xab, 0xcf, 0xce, 0xa6, 0x7e, 0xcf, 0xcc, 0xdb, 0x8a, 0xee, 0x42, + 0x0e, 0x4f, 0x14, 0x31, 0xe1, 0x20, 0xf4, 0xc7, 0x94, 0x0d, 0x39, 0x0a, 0x45, 0x99, 0xcf, 0xde, + 0x20, 0x55, 0x3c, 0x44, 0xca, 0x05, 0x4d, 0x90, 0x49, 0xd1, 0xcf, 0x92, 0xaf, 0x79, 0xff, 0x84, + 0xfe, 0xd8, 0xcc, 0x58, 0x66, 0x4a, 0xea, 0xf1, 0x10, 0x5b, 0xa2, 0x9b, 0x31, 0xf4, 0x7d, 0xd8, + 0x6b, 0xa2, 0xca, 0x6f, 0xd3, 0x60, 0x4c, 0x8e, 0x84, 0x4a, 0xcb, 0xb8, 0xed, 0xf0, 0x05, 0xfc, + 0xbb, 0x62, 0x9e, 0xef, 0x76, 0x0a, 0xb5, 0xfc, 0x1f, 0x40, 0xfd, 0xe9, 0x78, 0xb1, 0x5b, 0x92, + 0xdc, 0x53, 0xea, 0xef, 0x0b, 0xb0, 0xd5, 0x44, 0x65, 0x30, 0x86, 0x49, 0xd2, 0x93, 0x03, 0x14, + 0xb7, 0x37, 0x55, 0x83, 0x3f, 0x12, 0x26, 0x23, 0xcc, 0x5a, 0x29, 0x79, 0xd3, 0x07, 0xf2, 0x08, + 0xc8, 0xdd, 0x37, 0xf0, 0xdb, 0xd5, 0xb4, 0x65, 0xff, 0x56, 0x7f, 0x65, 0x9e, 0xb5, 0x95, 0x79, + 0xfa, 0xb0, 0x7d, 0x37, 0x4e, 0xbe, 0xdb, 0x11, 0xac, 0xfb, 0x19, 0x4c, 0x55, 0x8a, 0xe7, 0x3b, + 0x95, 0xfd, 0x39, 0x35, 0xbd, 0x58, 0x1c, 0x47, 0x3c, 0xf6, 0x15, 0x97, 0x22, 0xab, 0x3f, 0x4f, + 0x56, 0x99, 0xc3, 0x69, 0xe1, 0xfa, 0x21, 0xec, 0x37, 0x51, 0x59, 0x78, 0xe3, 0x8f, 0x86, 0xaa, + 0xc9, 0x92, 0xc6, 0x88, 0x0d, 0x70, 0xa9, 0xea, 0x2b, 0x38, 0x58, 0xc9, 0xc8, 0x03, 0x9d, 0xc1, + 0x4e, 0x7f, 0x3a, 0xa7, 0x01, 0x4b, 0xe8, 0x75, 0xc6, 0x58, 0xec, 0xbb, 0xd6, 0xff, 0x85, 0xbc, + 0x51, 0x79, 0xb5, 0xbe, 0xf8, 0xc9, 0xfa, 0x19, 0x00, 0x00, 0xff, 0xff, 0x37, 0x4c, 0x56, 0x38, + 0xf3, 0x04, 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto b/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto new file mode 100644 index 00000000000..19610ca5b75 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto @@ -0,0 +1,64 @@ +syntax = "proto2"; +option go_package = "app_identity"; + +package appengine; + +message AppIdentityServiceError { + enum ErrorCode { + SUCCESS = 0; + UNKNOWN_SCOPE = 9; + BLOB_TOO_LARGE = 1000; + DEADLINE_EXCEEDED = 1001; + NOT_A_VALID_APP = 1002; + UNKNOWN_ERROR = 1003; + NOT_ALLOWED = 1005; + NOT_IMPLEMENTED = 1006; + } +} + +message SignForAppRequest { + optional bytes bytes_to_sign = 1; +} + +message SignForAppResponse { + optional string key_name = 1; + optional bytes signature_bytes = 2; +} + +message GetPublicCertificateForAppRequest { +} + +message PublicCertificate { + optional string key_name = 1; + optional string x509_certificate_pem = 2; +} + +message GetPublicCertificateForAppResponse { + repeated PublicCertificate public_certificate_list = 1; + optional int64 max_client_cache_time_in_second = 2; +} + +message GetServiceAccountNameRequest { +} + +message GetServiceAccountNameResponse { + optional string service_account_name = 1; +} + +message GetAccessTokenRequest { + repeated string scope = 1; + optional int64 service_account_id = 2; + optional string service_account_name = 3; +} + +message GetAccessTokenResponse { + optional string access_token = 1; + optional int64 expiration_time = 2; +} + +message GetDefaultGcsBucketNameRequest { +} + +message GetDefaultGcsBucketNameResponse { + optional string default_gcs_bucket_name = 1; +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/base/api_base.pb.go b/upstream/vendor/google.golang.org/appengine/internal/base/api_base.pb.go new file mode 100644 index 00000000000..db4777e68e5 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/base/api_base.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/base/api_base.proto + +package base + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type StringProto struct { + Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StringProto) Reset() { *m = StringProto{} } +func (m *StringProto) String() string { return proto.CompactTextString(m) } +func (*StringProto) ProtoMessage() {} +func (*StringProto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{0} +} +func (m *StringProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StringProto.Unmarshal(m, b) +} +func (m *StringProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StringProto.Marshal(b, m, deterministic) +} +func (dst *StringProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringProto.Merge(dst, src) +} +func (m *StringProto) XXX_Size() int { + return xxx_messageInfo_StringProto.Size(m) +} +func (m *StringProto) XXX_DiscardUnknown() { + xxx_messageInfo_StringProto.DiscardUnknown(m) +} + +var xxx_messageInfo_StringProto proto.InternalMessageInfo + +func (m *StringProto) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +type Integer32Proto struct { + Value *int32 `protobuf:"varint,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Integer32Proto) Reset() { *m = Integer32Proto{} } +func (m *Integer32Proto) String() string { return proto.CompactTextString(m) } +func (*Integer32Proto) ProtoMessage() {} +func (*Integer32Proto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{1} +} +func (m *Integer32Proto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Integer32Proto.Unmarshal(m, b) +} +func (m *Integer32Proto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Integer32Proto.Marshal(b, m, deterministic) +} +func (dst *Integer32Proto) XXX_Merge(src proto.Message) { + xxx_messageInfo_Integer32Proto.Merge(dst, src) +} +func (m *Integer32Proto) XXX_Size() int { + return xxx_messageInfo_Integer32Proto.Size(m) +} +func (m *Integer32Proto) XXX_DiscardUnknown() { + xxx_messageInfo_Integer32Proto.DiscardUnknown(m) +} + +var xxx_messageInfo_Integer32Proto proto.InternalMessageInfo + +func (m *Integer32Proto) GetValue() int32 { + if m != nil && m.Value != nil { + return *m.Value + } + return 0 +} + +type Integer64Proto struct { + Value *int64 `protobuf:"varint,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Integer64Proto) Reset() { *m = Integer64Proto{} } +func (m *Integer64Proto) String() string { return proto.CompactTextString(m) } +func (*Integer64Proto) ProtoMessage() {} +func (*Integer64Proto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{2} +} +func (m *Integer64Proto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Integer64Proto.Unmarshal(m, b) +} +func (m *Integer64Proto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Integer64Proto.Marshal(b, m, deterministic) +} +func (dst *Integer64Proto) XXX_Merge(src proto.Message) { + xxx_messageInfo_Integer64Proto.Merge(dst, src) +} +func (m *Integer64Proto) XXX_Size() int { + return xxx_messageInfo_Integer64Proto.Size(m) +} +func (m *Integer64Proto) XXX_DiscardUnknown() { + xxx_messageInfo_Integer64Proto.DiscardUnknown(m) +} + +var xxx_messageInfo_Integer64Proto proto.InternalMessageInfo + +func (m *Integer64Proto) GetValue() int64 { + if m != nil && m.Value != nil { + return *m.Value + } + return 0 +} + +type BoolProto struct { + Value *bool `protobuf:"varint,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BoolProto) Reset() { *m = BoolProto{} } +func (m *BoolProto) String() string { return proto.CompactTextString(m) } +func (*BoolProto) ProtoMessage() {} +func (*BoolProto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{3} +} +func (m *BoolProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BoolProto.Unmarshal(m, b) +} +func (m *BoolProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BoolProto.Marshal(b, m, deterministic) +} +func (dst *BoolProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_BoolProto.Merge(dst, src) +} +func (m *BoolProto) XXX_Size() int { + return xxx_messageInfo_BoolProto.Size(m) +} +func (m *BoolProto) XXX_DiscardUnknown() { + xxx_messageInfo_BoolProto.DiscardUnknown(m) +} + +var xxx_messageInfo_BoolProto proto.InternalMessageInfo + +func (m *BoolProto) GetValue() bool { + if m != nil && m.Value != nil { + return *m.Value + } + return false +} + +type DoubleProto struct { + Value *float64 `protobuf:"fixed64,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleProto) Reset() { *m = DoubleProto{} } +func (m *DoubleProto) String() string { return proto.CompactTextString(m) } +func (*DoubleProto) ProtoMessage() {} +func (*DoubleProto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{4} +} +func (m *DoubleProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DoubleProto.Unmarshal(m, b) +} +func (m *DoubleProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DoubleProto.Marshal(b, m, deterministic) +} +func (dst *DoubleProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleProto.Merge(dst, src) +} +func (m *DoubleProto) XXX_Size() int { + return xxx_messageInfo_DoubleProto.Size(m) +} +func (m *DoubleProto) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleProto.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleProto proto.InternalMessageInfo + +func (m *DoubleProto) GetValue() float64 { + if m != nil && m.Value != nil { + return *m.Value + } + return 0 +} + +type BytesProto struct { + Value []byte `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BytesProto) Reset() { *m = BytesProto{} } +func (m *BytesProto) String() string { return proto.CompactTextString(m) } +func (*BytesProto) ProtoMessage() {} +func (*BytesProto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{5} +} +func (m *BytesProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BytesProto.Unmarshal(m, b) +} +func (m *BytesProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BytesProto.Marshal(b, m, deterministic) +} +func (dst *BytesProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_BytesProto.Merge(dst, src) +} +func (m *BytesProto) XXX_Size() int { + return xxx_messageInfo_BytesProto.Size(m) +} +func (m *BytesProto) XXX_DiscardUnknown() { + xxx_messageInfo_BytesProto.DiscardUnknown(m) +} + +var xxx_messageInfo_BytesProto proto.InternalMessageInfo + +func (m *BytesProto) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type VoidProto struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VoidProto) Reset() { *m = VoidProto{} } +func (m *VoidProto) String() string { return proto.CompactTextString(m) } +func (*VoidProto) ProtoMessage() {} +func (*VoidProto) Descriptor() ([]byte, []int) { + return fileDescriptor_api_base_9d49f8792e0c1140, []int{6} +} +func (m *VoidProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VoidProto.Unmarshal(m, b) +} +func (m *VoidProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VoidProto.Marshal(b, m, deterministic) +} +func (dst *VoidProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_VoidProto.Merge(dst, src) +} +func (m *VoidProto) XXX_Size() int { + return xxx_messageInfo_VoidProto.Size(m) +} +func (m *VoidProto) XXX_DiscardUnknown() { + xxx_messageInfo_VoidProto.DiscardUnknown(m) +} + +var xxx_messageInfo_VoidProto proto.InternalMessageInfo + +func init() { + proto.RegisterType((*StringProto)(nil), "appengine.base.StringProto") + proto.RegisterType((*Integer32Proto)(nil), "appengine.base.Integer32Proto") + proto.RegisterType((*Integer64Proto)(nil), "appengine.base.Integer64Proto") + proto.RegisterType((*BoolProto)(nil), "appengine.base.BoolProto") + proto.RegisterType((*DoubleProto)(nil), "appengine.base.DoubleProto") + proto.RegisterType((*BytesProto)(nil), "appengine.base.BytesProto") + proto.RegisterType((*VoidProto)(nil), "appengine.base.VoidProto") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/base/api_base.proto", fileDescriptor_api_base_9d49f8792e0c1140) +} + +var fileDescriptor_api_base_9d49f8792e0c1140 = []byte{ + // 199 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xcf, 0x3f, 0x4b, 0xc6, 0x30, + 0x10, 0x06, 0x70, 0x5a, 0xad, 0xb4, 0x57, 0xe9, 0x20, 0x0e, 0x1d, 0xb5, 0x05, 0x71, 0x4a, 0x40, + 0x45, 0x9c, 0x83, 0x8b, 0x9b, 0x28, 0x38, 0xb8, 0x48, 0x8a, 0xc7, 0x11, 0x08, 0xb9, 0x90, 0xa6, + 0x82, 0xdf, 0x5e, 0xda, 0xd2, 0xfa, 0xc2, 0x9b, 0xed, 0xfe, 0xfc, 0xe0, 0xe1, 0x81, 0x27, 0x62, + 0x26, 0x8b, 0x82, 0xd8, 0x6a, 0x47, 0x82, 0x03, 0x49, 0xed, 0x3d, 0x3a, 0x32, 0x0e, 0xa5, 0x71, + 0x11, 0x83, 0xd3, 0x56, 0x0e, 0x7a, 0x44, 0xa9, 0xbd, 0xf9, 0x9a, 0x07, 0xe1, 0x03, 0x47, 0xbe, + 0x68, 0x76, 0x27, 0xe6, 0x6b, 0xd7, 0x43, 0xfd, 0x1e, 0x83, 0x71, 0xf4, 0xba, 0xbc, 0x2f, 0xa1, + 0xf8, 0xd1, 0x76, 0xc2, 0x36, 0xbb, 0xca, 0x6f, 0xab, 0xb7, 0x75, 0xe9, 0x6e, 0xa0, 0x79, 0x71, + 0x11, 0x09, 0xc3, 0xfd, 0x5d, 0xc2, 0x15, 0xc7, 0xee, 0xf1, 0x21, 0xe1, 0x4e, 0x36, 0x77, 0x0d, + 0x95, 0x62, 0xb6, 0x09, 0x52, 0x6e, 0xa4, 0x87, 0xfa, 0x99, 0xa7, 0xc1, 0x62, 0x02, 0x65, 0xff, + 0x79, 0xa0, 0x7e, 0x23, 0x8e, 0xab, 0x69, 0x0f, 0xcd, 0xb9, 0xca, 0xcb, 0xdd, 0xd5, 0x50, 0x7d, + 0xb0, 0xf9, 0x5e, 0x98, 0x3a, 0xfb, 0x3c, 0x9d, 0x9b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xba, + 0x37, 0x25, 0xea, 0x44, 0x01, 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/base/api_base.proto b/upstream/vendor/google.golang.org/appengine/internal/base/api_base.proto new file mode 100644 index 00000000000..56cd7a3cad0 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/base/api_base.proto @@ -0,0 +1,33 @@ +// Built-in base types for API calls. Primarily useful as return types. + +syntax = "proto2"; +option go_package = "base"; + +package appengine.base; + +message StringProto { + required string value = 1; +} + +message Integer32Proto { + required int32 value = 1; +} + +message Integer64Proto { + required int64 value = 1; +} + +message BoolProto { + required bool value = 1; +} + +message DoubleProto { + required double value = 1; +} + +message BytesProto { + required bytes value = 1 [ctype=CORD]; +} + +message VoidProto { +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go b/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go new file mode 100644 index 00000000000..2fb74828969 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go @@ -0,0 +1,4367 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/datastore/datastore_v3.proto + +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type Property_Meaning int32 + +const ( + Property_NO_MEANING Property_Meaning = 0 + Property_BLOB Property_Meaning = 14 + Property_TEXT Property_Meaning = 15 + Property_BYTESTRING Property_Meaning = 16 + Property_ATOM_CATEGORY Property_Meaning = 1 + Property_ATOM_LINK Property_Meaning = 2 + Property_ATOM_TITLE Property_Meaning = 3 + Property_ATOM_CONTENT Property_Meaning = 4 + Property_ATOM_SUMMARY Property_Meaning = 5 + Property_ATOM_AUTHOR Property_Meaning = 6 + Property_GD_WHEN Property_Meaning = 7 + Property_GD_EMAIL Property_Meaning = 8 + Property_GEORSS_POINT Property_Meaning = 9 + Property_GD_IM Property_Meaning = 10 + Property_GD_PHONENUMBER Property_Meaning = 11 + Property_GD_POSTALADDRESS Property_Meaning = 12 + Property_GD_RATING Property_Meaning = 13 + Property_BLOBKEY Property_Meaning = 17 + Property_ENTITY_PROTO Property_Meaning = 19 + Property_INDEX_VALUE Property_Meaning = 18 +) + +var Property_Meaning_name = map[int32]string{ + 0: "NO_MEANING", + 14: "BLOB", + 15: "TEXT", + 16: "BYTESTRING", + 1: "ATOM_CATEGORY", + 2: "ATOM_LINK", + 3: "ATOM_TITLE", + 4: "ATOM_CONTENT", + 5: "ATOM_SUMMARY", + 6: "ATOM_AUTHOR", + 7: "GD_WHEN", + 8: "GD_EMAIL", + 9: "GEORSS_POINT", + 10: "GD_IM", + 11: "GD_PHONENUMBER", + 12: "GD_POSTALADDRESS", + 13: "GD_RATING", + 17: "BLOBKEY", + 19: "ENTITY_PROTO", + 18: "INDEX_VALUE", +} +var Property_Meaning_value = map[string]int32{ + "NO_MEANING": 0, + "BLOB": 14, + "TEXT": 15, + "BYTESTRING": 16, + "ATOM_CATEGORY": 1, + "ATOM_LINK": 2, + "ATOM_TITLE": 3, + "ATOM_CONTENT": 4, + "ATOM_SUMMARY": 5, + "ATOM_AUTHOR": 6, + "GD_WHEN": 7, + "GD_EMAIL": 8, + "GEORSS_POINT": 9, + "GD_IM": 10, + "GD_PHONENUMBER": 11, + "GD_POSTALADDRESS": 12, + "GD_RATING": 13, + "BLOBKEY": 17, + "ENTITY_PROTO": 19, + "INDEX_VALUE": 18, +} + +func (x Property_Meaning) Enum() *Property_Meaning { + p := new(Property_Meaning) + *p = x + return p +} +func (x Property_Meaning) String() string { + return proto.EnumName(Property_Meaning_name, int32(x)) +} +func (x *Property_Meaning) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Property_Meaning_value, data, "Property_Meaning") + if err != nil { + return err + } + *x = Property_Meaning(value) + return nil +} +func (Property_Meaning) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{2, 0} +} + +type Property_FtsTokenizationOption int32 + +const ( + Property_HTML Property_FtsTokenizationOption = 1 + Property_ATOM Property_FtsTokenizationOption = 2 +) + +var Property_FtsTokenizationOption_name = map[int32]string{ + 1: "HTML", + 2: "ATOM", +} +var Property_FtsTokenizationOption_value = map[string]int32{ + "HTML": 1, + "ATOM": 2, +} + +func (x Property_FtsTokenizationOption) Enum() *Property_FtsTokenizationOption { + p := new(Property_FtsTokenizationOption) + *p = x + return p +} +func (x Property_FtsTokenizationOption) String() string { + return proto.EnumName(Property_FtsTokenizationOption_name, int32(x)) +} +func (x *Property_FtsTokenizationOption) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Property_FtsTokenizationOption_value, data, "Property_FtsTokenizationOption") + if err != nil { + return err + } + *x = Property_FtsTokenizationOption(value) + return nil +} +func (Property_FtsTokenizationOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{2, 1} +} + +type EntityProto_Kind int32 + +const ( + EntityProto_GD_CONTACT EntityProto_Kind = 1 + EntityProto_GD_EVENT EntityProto_Kind = 2 + EntityProto_GD_MESSAGE EntityProto_Kind = 3 +) + +var EntityProto_Kind_name = map[int32]string{ + 1: "GD_CONTACT", + 2: "GD_EVENT", + 3: "GD_MESSAGE", +} +var EntityProto_Kind_value = map[string]int32{ + "GD_CONTACT": 1, + "GD_EVENT": 2, + "GD_MESSAGE": 3, +} + +func (x EntityProto_Kind) Enum() *EntityProto_Kind { + p := new(EntityProto_Kind) + *p = x + return p +} +func (x EntityProto_Kind) String() string { + return proto.EnumName(EntityProto_Kind_name, int32(x)) +} +func (x *EntityProto_Kind) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(EntityProto_Kind_value, data, "EntityProto_Kind") + if err != nil { + return err + } + *x = EntityProto_Kind(value) + return nil +} +func (EntityProto_Kind) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{6, 0} +} + +type Index_Property_Direction int32 + +const ( + Index_Property_ASCENDING Index_Property_Direction = 1 + Index_Property_DESCENDING Index_Property_Direction = 2 +) + +var Index_Property_Direction_name = map[int32]string{ + 1: "ASCENDING", + 2: "DESCENDING", +} +var Index_Property_Direction_value = map[string]int32{ + "ASCENDING": 1, + "DESCENDING": 2, +} + +func (x Index_Property_Direction) Enum() *Index_Property_Direction { + p := new(Index_Property_Direction) + *p = x + return p +} +func (x Index_Property_Direction) String() string { + return proto.EnumName(Index_Property_Direction_name, int32(x)) +} +func (x *Index_Property_Direction) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Index_Property_Direction_value, data, "Index_Property_Direction") + if err != nil { + return err + } + *x = Index_Property_Direction(value) + return nil +} +func (Index_Property_Direction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{8, 0, 0} +} + +type CompositeIndex_State int32 + +const ( + CompositeIndex_WRITE_ONLY CompositeIndex_State = 1 + CompositeIndex_READ_WRITE CompositeIndex_State = 2 + CompositeIndex_DELETED CompositeIndex_State = 3 + CompositeIndex_ERROR CompositeIndex_State = 4 +) + +var CompositeIndex_State_name = map[int32]string{ + 1: "WRITE_ONLY", + 2: "READ_WRITE", + 3: "DELETED", + 4: "ERROR", +} +var CompositeIndex_State_value = map[string]int32{ + "WRITE_ONLY": 1, + "READ_WRITE": 2, + "DELETED": 3, + "ERROR": 4, +} + +func (x CompositeIndex_State) Enum() *CompositeIndex_State { + p := new(CompositeIndex_State) + *p = x + return p +} +func (x CompositeIndex_State) String() string { + return proto.EnumName(CompositeIndex_State_name, int32(x)) +} +func (x *CompositeIndex_State) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(CompositeIndex_State_value, data, "CompositeIndex_State") + if err != nil { + return err + } + *x = CompositeIndex_State(value) + return nil +} +func (CompositeIndex_State) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{9, 0} +} + +type Snapshot_Status int32 + +const ( + Snapshot_INACTIVE Snapshot_Status = 0 + Snapshot_ACTIVE Snapshot_Status = 1 +) + +var Snapshot_Status_name = map[int32]string{ + 0: "INACTIVE", + 1: "ACTIVE", +} +var Snapshot_Status_value = map[string]int32{ + "INACTIVE": 0, + "ACTIVE": 1, +} + +func (x Snapshot_Status) Enum() *Snapshot_Status { + p := new(Snapshot_Status) + *p = x + return p +} +func (x Snapshot_Status) String() string { + return proto.EnumName(Snapshot_Status_name, int32(x)) +} +func (x *Snapshot_Status) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Snapshot_Status_value, data, "Snapshot_Status") + if err != nil { + return err + } + *x = Snapshot_Status(value) + return nil +} +func (Snapshot_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{12, 0} +} + +type Query_Hint int32 + +const ( + Query_ORDER_FIRST Query_Hint = 1 + Query_ANCESTOR_FIRST Query_Hint = 2 + Query_FILTER_FIRST Query_Hint = 3 +) + +var Query_Hint_name = map[int32]string{ + 1: "ORDER_FIRST", + 2: "ANCESTOR_FIRST", + 3: "FILTER_FIRST", +} +var Query_Hint_value = map[string]int32{ + "ORDER_FIRST": 1, + "ANCESTOR_FIRST": 2, + "FILTER_FIRST": 3, +} + +func (x Query_Hint) Enum() *Query_Hint { + p := new(Query_Hint) + *p = x + return p +} +func (x Query_Hint) String() string { + return proto.EnumName(Query_Hint_name, int32(x)) +} +func (x *Query_Hint) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Query_Hint_value, data, "Query_Hint") + if err != nil { + return err + } + *x = Query_Hint(value) + return nil +} +func (Query_Hint) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15, 0} +} + +type Query_Filter_Operator int32 + +const ( + Query_Filter_LESS_THAN Query_Filter_Operator = 1 + Query_Filter_LESS_THAN_OR_EQUAL Query_Filter_Operator = 2 + Query_Filter_GREATER_THAN Query_Filter_Operator = 3 + Query_Filter_GREATER_THAN_OR_EQUAL Query_Filter_Operator = 4 + Query_Filter_EQUAL Query_Filter_Operator = 5 + Query_Filter_IN Query_Filter_Operator = 6 + Query_Filter_EXISTS Query_Filter_Operator = 7 +) + +var Query_Filter_Operator_name = map[int32]string{ + 1: "LESS_THAN", + 2: "LESS_THAN_OR_EQUAL", + 3: "GREATER_THAN", + 4: "GREATER_THAN_OR_EQUAL", + 5: "EQUAL", + 6: "IN", + 7: "EXISTS", +} +var Query_Filter_Operator_value = map[string]int32{ + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, + "IN": 6, + "EXISTS": 7, +} + +func (x Query_Filter_Operator) Enum() *Query_Filter_Operator { + p := new(Query_Filter_Operator) + *p = x + return p +} +func (x Query_Filter_Operator) String() string { + return proto.EnumName(Query_Filter_Operator_name, int32(x)) +} +func (x *Query_Filter_Operator) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Query_Filter_Operator_value, data, "Query_Filter_Operator") + if err != nil { + return err + } + *x = Query_Filter_Operator(value) + return nil +} +func (Query_Filter_Operator) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15, 0, 0} +} + +type Query_Order_Direction int32 + +const ( + Query_Order_ASCENDING Query_Order_Direction = 1 + Query_Order_DESCENDING Query_Order_Direction = 2 +) + +var Query_Order_Direction_name = map[int32]string{ + 1: "ASCENDING", + 2: "DESCENDING", +} +var Query_Order_Direction_value = map[string]int32{ + "ASCENDING": 1, + "DESCENDING": 2, +} + +func (x Query_Order_Direction) Enum() *Query_Order_Direction { + p := new(Query_Order_Direction) + *p = x + return p +} +func (x Query_Order_Direction) String() string { + return proto.EnumName(Query_Order_Direction_name, int32(x)) +} +func (x *Query_Order_Direction) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Query_Order_Direction_value, data, "Query_Order_Direction") + if err != nil { + return err + } + *x = Query_Order_Direction(value) + return nil +} +func (Query_Order_Direction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15, 1, 0} +} + +type Error_ErrorCode int32 + +const ( + Error_BAD_REQUEST Error_ErrorCode = 1 + Error_CONCURRENT_TRANSACTION Error_ErrorCode = 2 + Error_INTERNAL_ERROR Error_ErrorCode = 3 + Error_NEED_INDEX Error_ErrorCode = 4 + Error_TIMEOUT Error_ErrorCode = 5 + Error_PERMISSION_DENIED Error_ErrorCode = 6 + Error_BIGTABLE_ERROR Error_ErrorCode = 7 + Error_COMMITTED_BUT_STILL_APPLYING Error_ErrorCode = 8 + Error_CAPABILITY_DISABLED Error_ErrorCode = 9 + Error_TRY_ALTERNATE_BACKEND Error_ErrorCode = 10 + Error_SAFE_TIME_TOO_OLD Error_ErrorCode = 11 +) + +var Error_ErrorCode_name = map[int32]string{ + 1: "BAD_REQUEST", + 2: "CONCURRENT_TRANSACTION", + 3: "INTERNAL_ERROR", + 4: "NEED_INDEX", + 5: "TIMEOUT", + 6: "PERMISSION_DENIED", + 7: "BIGTABLE_ERROR", + 8: "COMMITTED_BUT_STILL_APPLYING", + 9: "CAPABILITY_DISABLED", + 10: "TRY_ALTERNATE_BACKEND", + 11: "SAFE_TIME_TOO_OLD", +} +var Error_ErrorCode_value = map[string]int32{ + "BAD_REQUEST": 1, + "CONCURRENT_TRANSACTION": 2, + "INTERNAL_ERROR": 3, + "NEED_INDEX": 4, + "TIMEOUT": 5, + "PERMISSION_DENIED": 6, + "BIGTABLE_ERROR": 7, + "COMMITTED_BUT_STILL_APPLYING": 8, + "CAPABILITY_DISABLED": 9, + "TRY_ALTERNATE_BACKEND": 10, + "SAFE_TIME_TOO_OLD": 11, +} + +func (x Error_ErrorCode) Enum() *Error_ErrorCode { + p := new(Error_ErrorCode) + *p = x + return p +} +func (x Error_ErrorCode) String() string { + return proto.EnumName(Error_ErrorCode_name, int32(x)) +} +func (x *Error_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Error_ErrorCode_value, data, "Error_ErrorCode") + if err != nil { + return err + } + *x = Error_ErrorCode(value) + return nil +} +func (Error_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{19, 0} +} + +type PutRequest_AutoIdPolicy int32 + +const ( + PutRequest_CURRENT PutRequest_AutoIdPolicy = 0 + PutRequest_SEQUENTIAL PutRequest_AutoIdPolicy = 1 +) + +var PutRequest_AutoIdPolicy_name = map[int32]string{ + 0: "CURRENT", + 1: "SEQUENTIAL", +} +var PutRequest_AutoIdPolicy_value = map[string]int32{ + "CURRENT": 0, + "SEQUENTIAL": 1, +} + +func (x PutRequest_AutoIdPolicy) Enum() *PutRequest_AutoIdPolicy { + p := new(PutRequest_AutoIdPolicy) + *p = x + return p +} +func (x PutRequest_AutoIdPolicy) String() string { + return proto.EnumName(PutRequest_AutoIdPolicy_name, int32(x)) +} +func (x *PutRequest_AutoIdPolicy) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(PutRequest_AutoIdPolicy_value, data, "PutRequest_AutoIdPolicy") + if err != nil { + return err + } + *x = PutRequest_AutoIdPolicy(value) + return nil +} +func (PutRequest_AutoIdPolicy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{23, 0} +} + +type BeginTransactionRequest_TransactionMode int32 + +const ( + BeginTransactionRequest_UNKNOWN BeginTransactionRequest_TransactionMode = 0 + BeginTransactionRequest_READ_ONLY BeginTransactionRequest_TransactionMode = 1 + BeginTransactionRequest_READ_WRITE BeginTransactionRequest_TransactionMode = 2 +) + +var BeginTransactionRequest_TransactionMode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "READ_ONLY", + 2: "READ_WRITE", +} +var BeginTransactionRequest_TransactionMode_value = map[string]int32{ + "UNKNOWN": 0, + "READ_ONLY": 1, + "READ_WRITE": 2, +} + +func (x BeginTransactionRequest_TransactionMode) Enum() *BeginTransactionRequest_TransactionMode { + p := new(BeginTransactionRequest_TransactionMode) + *p = x + return p +} +func (x BeginTransactionRequest_TransactionMode) String() string { + return proto.EnumName(BeginTransactionRequest_TransactionMode_name, int32(x)) +} +func (x *BeginTransactionRequest_TransactionMode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(BeginTransactionRequest_TransactionMode_value, data, "BeginTransactionRequest_TransactionMode") + if err != nil { + return err + } + *x = BeginTransactionRequest_TransactionMode(value) + return nil +} +func (BeginTransactionRequest_TransactionMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{36, 0} +} + +type Action struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Action) Reset() { *m = Action{} } +func (m *Action) String() string { return proto.CompactTextString(m) } +func (*Action) ProtoMessage() {} +func (*Action) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{0} +} +func (m *Action) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Action.Unmarshal(m, b) +} +func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Action.Marshal(b, m, deterministic) +} +func (dst *Action) XXX_Merge(src proto.Message) { + xxx_messageInfo_Action.Merge(dst, src) +} +func (m *Action) XXX_Size() int { + return xxx_messageInfo_Action.Size(m) +} +func (m *Action) XXX_DiscardUnknown() { + xxx_messageInfo_Action.DiscardUnknown(m) +} + +var xxx_messageInfo_Action proto.InternalMessageInfo + +type PropertyValue struct { + Int64Value *int64 `protobuf:"varint,1,opt,name=int64Value" json:"int64Value,omitempty"` + BooleanValue *bool `protobuf:"varint,2,opt,name=booleanValue" json:"booleanValue,omitempty"` + StringValue *string `protobuf:"bytes,3,opt,name=stringValue" json:"stringValue,omitempty"` + DoubleValue *float64 `protobuf:"fixed64,4,opt,name=doubleValue" json:"doubleValue,omitempty"` + Pointvalue *PropertyValue_PointValue `protobuf:"group,5,opt,name=PointValue,json=pointvalue" json:"pointvalue,omitempty"` + Uservalue *PropertyValue_UserValue `protobuf:"group,8,opt,name=UserValue,json=uservalue" json:"uservalue,omitempty"` + Referencevalue *PropertyValue_ReferenceValue `protobuf:"group,12,opt,name=ReferenceValue,json=referencevalue" json:"referencevalue,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PropertyValue) Reset() { *m = PropertyValue{} } +func (m *PropertyValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue) ProtoMessage() {} +func (*PropertyValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{1} +} +func (m *PropertyValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PropertyValue.Unmarshal(m, b) +} +func (m *PropertyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PropertyValue.Marshal(b, m, deterministic) +} +func (dst *PropertyValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_PropertyValue.Merge(dst, src) +} +func (m *PropertyValue) XXX_Size() int { + return xxx_messageInfo_PropertyValue.Size(m) +} +func (m *PropertyValue) XXX_DiscardUnknown() { + xxx_messageInfo_PropertyValue.DiscardUnknown(m) +} + +var xxx_messageInfo_PropertyValue proto.InternalMessageInfo + +func (m *PropertyValue) GetInt64Value() int64 { + if m != nil && m.Int64Value != nil { + return *m.Int64Value + } + return 0 +} + +func (m *PropertyValue) GetBooleanValue() bool { + if m != nil && m.BooleanValue != nil { + return *m.BooleanValue + } + return false +} + +func (m *PropertyValue) GetStringValue() string { + if m != nil && m.StringValue != nil { + return *m.StringValue + } + return "" +} + +func (m *PropertyValue) GetDoubleValue() float64 { + if m != nil && m.DoubleValue != nil { + return *m.DoubleValue + } + return 0 +} + +func (m *PropertyValue) GetPointvalue() *PropertyValue_PointValue { + if m != nil { + return m.Pointvalue + } + return nil +} + +func (m *PropertyValue) GetUservalue() *PropertyValue_UserValue { + if m != nil { + return m.Uservalue + } + return nil +} + +func (m *PropertyValue) GetReferencevalue() *PropertyValue_ReferenceValue { + if m != nil { + return m.Referencevalue + } + return nil +} + +type PropertyValue_PointValue struct { + X *float64 `protobuf:"fixed64,6,req,name=x" json:"x,omitempty"` + Y *float64 `protobuf:"fixed64,7,req,name=y" json:"y,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PropertyValue_PointValue) Reset() { *m = PropertyValue_PointValue{} } +func (m *PropertyValue_PointValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_PointValue) ProtoMessage() {} +func (*PropertyValue_PointValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{1, 0} +} +func (m *PropertyValue_PointValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PropertyValue_PointValue.Unmarshal(m, b) +} +func (m *PropertyValue_PointValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PropertyValue_PointValue.Marshal(b, m, deterministic) +} +func (dst *PropertyValue_PointValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_PropertyValue_PointValue.Merge(dst, src) +} +func (m *PropertyValue_PointValue) XXX_Size() int { + return xxx_messageInfo_PropertyValue_PointValue.Size(m) +} +func (m *PropertyValue_PointValue) XXX_DiscardUnknown() { + xxx_messageInfo_PropertyValue_PointValue.DiscardUnknown(m) +} + +var xxx_messageInfo_PropertyValue_PointValue proto.InternalMessageInfo + +func (m *PropertyValue_PointValue) GetX() float64 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +func (m *PropertyValue_PointValue) GetY() float64 { + if m != nil && m.Y != nil { + return *m.Y + } + return 0 +} + +type PropertyValue_UserValue struct { + Email *string `protobuf:"bytes,9,req,name=email" json:"email,omitempty"` + AuthDomain *string `protobuf:"bytes,10,req,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"` + Nickname *string `protobuf:"bytes,11,opt,name=nickname" json:"nickname,omitempty"` + FederatedIdentity *string `protobuf:"bytes,21,opt,name=federated_identity,json=federatedIdentity" json:"federated_identity,omitempty"` + FederatedProvider *string `protobuf:"bytes,22,opt,name=federated_provider,json=federatedProvider" json:"federated_provider,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PropertyValue_UserValue) Reset() { *m = PropertyValue_UserValue{} } +func (m *PropertyValue_UserValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_UserValue) ProtoMessage() {} +func (*PropertyValue_UserValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{1, 1} +} +func (m *PropertyValue_UserValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PropertyValue_UserValue.Unmarshal(m, b) +} +func (m *PropertyValue_UserValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PropertyValue_UserValue.Marshal(b, m, deterministic) +} +func (dst *PropertyValue_UserValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_PropertyValue_UserValue.Merge(dst, src) +} +func (m *PropertyValue_UserValue) XXX_Size() int { + return xxx_messageInfo_PropertyValue_UserValue.Size(m) +} +func (m *PropertyValue_UserValue) XXX_DiscardUnknown() { + xxx_messageInfo_PropertyValue_UserValue.DiscardUnknown(m) +} + +var xxx_messageInfo_PropertyValue_UserValue proto.InternalMessageInfo + +func (m *PropertyValue_UserValue) GetEmail() string { + if m != nil && m.Email != nil { + return *m.Email + } + return "" +} + +func (m *PropertyValue_UserValue) GetAuthDomain() string { + if m != nil && m.AuthDomain != nil { + return *m.AuthDomain + } + return "" +} + +func (m *PropertyValue_UserValue) GetNickname() string { + if m != nil && m.Nickname != nil { + return *m.Nickname + } + return "" +} + +func (m *PropertyValue_UserValue) GetFederatedIdentity() string { + if m != nil && m.FederatedIdentity != nil { + return *m.FederatedIdentity + } + return "" +} + +func (m *PropertyValue_UserValue) GetFederatedProvider() string { + if m != nil && m.FederatedProvider != nil { + return *m.FederatedProvider + } + return "" +} + +type PropertyValue_ReferenceValue struct { + App *string `protobuf:"bytes,13,req,name=app" json:"app,omitempty"` + NameSpace *string `protobuf:"bytes,20,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` + Pathelement []*PropertyValue_ReferenceValue_PathElement `protobuf:"group,14,rep,name=PathElement,json=pathelement" json:"pathelement,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PropertyValue_ReferenceValue) Reset() { *m = PropertyValue_ReferenceValue{} } +func (m *PropertyValue_ReferenceValue) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_ReferenceValue) ProtoMessage() {} +func (*PropertyValue_ReferenceValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{1, 2} +} +func (m *PropertyValue_ReferenceValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PropertyValue_ReferenceValue.Unmarshal(m, b) +} +func (m *PropertyValue_ReferenceValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PropertyValue_ReferenceValue.Marshal(b, m, deterministic) +} +func (dst *PropertyValue_ReferenceValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_PropertyValue_ReferenceValue.Merge(dst, src) +} +func (m *PropertyValue_ReferenceValue) XXX_Size() int { + return xxx_messageInfo_PropertyValue_ReferenceValue.Size(m) +} +func (m *PropertyValue_ReferenceValue) XXX_DiscardUnknown() { + xxx_messageInfo_PropertyValue_ReferenceValue.DiscardUnknown(m) +} + +var xxx_messageInfo_PropertyValue_ReferenceValue proto.InternalMessageInfo + +func (m *PropertyValue_ReferenceValue) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +func (m *PropertyValue_ReferenceValue) GetNameSpace() string { + if m != nil && m.NameSpace != nil { + return *m.NameSpace + } + return "" +} + +func (m *PropertyValue_ReferenceValue) GetPathelement() []*PropertyValue_ReferenceValue_PathElement { + if m != nil { + return m.Pathelement + } + return nil +} + +type PropertyValue_ReferenceValue_PathElement struct { + Type *string `protobuf:"bytes,15,req,name=type" json:"type,omitempty"` + Id *int64 `protobuf:"varint,16,opt,name=id" json:"id,omitempty"` + Name *string `protobuf:"bytes,17,opt,name=name" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PropertyValue_ReferenceValue_PathElement) Reset() { + *m = PropertyValue_ReferenceValue_PathElement{} +} +func (m *PropertyValue_ReferenceValue_PathElement) String() string { return proto.CompactTextString(m) } +func (*PropertyValue_ReferenceValue_PathElement) ProtoMessage() {} +func (*PropertyValue_ReferenceValue_PathElement) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{1, 2, 0} +} +func (m *PropertyValue_ReferenceValue_PathElement) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PropertyValue_ReferenceValue_PathElement.Unmarshal(m, b) +} +func (m *PropertyValue_ReferenceValue_PathElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PropertyValue_ReferenceValue_PathElement.Marshal(b, m, deterministic) +} +func (dst *PropertyValue_ReferenceValue_PathElement) XXX_Merge(src proto.Message) { + xxx_messageInfo_PropertyValue_ReferenceValue_PathElement.Merge(dst, src) +} +func (m *PropertyValue_ReferenceValue_PathElement) XXX_Size() int { + return xxx_messageInfo_PropertyValue_ReferenceValue_PathElement.Size(m) +} +func (m *PropertyValue_ReferenceValue_PathElement) XXX_DiscardUnknown() { + xxx_messageInfo_PropertyValue_ReferenceValue_PathElement.DiscardUnknown(m) +} + +var xxx_messageInfo_PropertyValue_ReferenceValue_PathElement proto.InternalMessageInfo + +func (m *PropertyValue_ReferenceValue_PathElement) GetType() string { + if m != nil && m.Type != nil { + return *m.Type + } + return "" +} + +func (m *PropertyValue_ReferenceValue_PathElement) GetId() int64 { + if m != nil && m.Id != nil { + return *m.Id + } + return 0 +} + +func (m *PropertyValue_ReferenceValue_PathElement) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type Property struct { + Meaning *Property_Meaning `protobuf:"varint,1,opt,name=meaning,enum=appengine.Property_Meaning,def=0" json:"meaning,omitempty"` + MeaningUri *string `protobuf:"bytes,2,opt,name=meaning_uri,json=meaningUri" json:"meaning_uri,omitempty"` + Name *string `protobuf:"bytes,3,req,name=name" json:"name,omitempty"` + Value *PropertyValue `protobuf:"bytes,5,req,name=value" json:"value,omitempty"` + Multiple *bool `protobuf:"varint,4,req,name=multiple" json:"multiple,omitempty"` + Searchable *bool `protobuf:"varint,6,opt,name=searchable,def=0" json:"searchable,omitempty"` + FtsTokenizationOption *Property_FtsTokenizationOption `protobuf:"varint,8,opt,name=fts_tokenization_option,json=ftsTokenizationOption,enum=appengine.Property_FtsTokenizationOption" json:"fts_tokenization_option,omitempty"` + Locale *string `protobuf:"bytes,9,opt,name=locale,def=en" json:"locale,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Property) Reset() { *m = Property{} } +func (m *Property) String() string { return proto.CompactTextString(m) } +func (*Property) ProtoMessage() {} +func (*Property) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{2} +} +func (m *Property) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Property.Unmarshal(m, b) +} +func (m *Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Property.Marshal(b, m, deterministic) +} +func (dst *Property) XXX_Merge(src proto.Message) { + xxx_messageInfo_Property.Merge(dst, src) +} +func (m *Property) XXX_Size() int { + return xxx_messageInfo_Property.Size(m) +} +func (m *Property) XXX_DiscardUnknown() { + xxx_messageInfo_Property.DiscardUnknown(m) +} + +var xxx_messageInfo_Property proto.InternalMessageInfo + +const Default_Property_Meaning Property_Meaning = Property_NO_MEANING +const Default_Property_Searchable bool = false +const Default_Property_Locale string = "en" + +func (m *Property) GetMeaning() Property_Meaning { + if m != nil && m.Meaning != nil { + return *m.Meaning + } + return Default_Property_Meaning +} + +func (m *Property) GetMeaningUri() string { + if m != nil && m.MeaningUri != nil { + return *m.MeaningUri + } + return "" +} + +func (m *Property) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *Property) GetValue() *PropertyValue { + if m != nil { + return m.Value + } + return nil +} + +func (m *Property) GetMultiple() bool { + if m != nil && m.Multiple != nil { + return *m.Multiple + } + return false +} + +func (m *Property) GetSearchable() bool { + if m != nil && m.Searchable != nil { + return *m.Searchable + } + return Default_Property_Searchable +} + +func (m *Property) GetFtsTokenizationOption() Property_FtsTokenizationOption { + if m != nil && m.FtsTokenizationOption != nil { + return *m.FtsTokenizationOption + } + return Property_HTML +} + +func (m *Property) GetLocale() string { + if m != nil && m.Locale != nil { + return *m.Locale + } + return Default_Property_Locale +} + +type Path struct { + Element []*Path_Element `protobuf:"group,1,rep,name=Element,json=element" json:"element,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Path) Reset() { *m = Path{} } +func (m *Path) String() string { return proto.CompactTextString(m) } +func (*Path) ProtoMessage() {} +func (*Path) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{3} +} +func (m *Path) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Path.Unmarshal(m, b) +} +func (m *Path) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Path.Marshal(b, m, deterministic) +} +func (dst *Path) XXX_Merge(src proto.Message) { + xxx_messageInfo_Path.Merge(dst, src) +} +func (m *Path) XXX_Size() int { + return xxx_messageInfo_Path.Size(m) +} +func (m *Path) XXX_DiscardUnknown() { + xxx_messageInfo_Path.DiscardUnknown(m) +} + +var xxx_messageInfo_Path proto.InternalMessageInfo + +func (m *Path) GetElement() []*Path_Element { + if m != nil { + return m.Element + } + return nil +} + +type Path_Element struct { + Type *string `protobuf:"bytes,2,req,name=type" json:"type,omitempty"` + Id *int64 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"` + Name *string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Path_Element) Reset() { *m = Path_Element{} } +func (m *Path_Element) String() string { return proto.CompactTextString(m) } +func (*Path_Element) ProtoMessage() {} +func (*Path_Element) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{3, 0} +} +func (m *Path_Element) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Path_Element.Unmarshal(m, b) +} +func (m *Path_Element) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Path_Element.Marshal(b, m, deterministic) +} +func (dst *Path_Element) XXX_Merge(src proto.Message) { + xxx_messageInfo_Path_Element.Merge(dst, src) +} +func (m *Path_Element) XXX_Size() int { + return xxx_messageInfo_Path_Element.Size(m) +} +func (m *Path_Element) XXX_DiscardUnknown() { + xxx_messageInfo_Path_Element.DiscardUnknown(m) +} + +var xxx_messageInfo_Path_Element proto.InternalMessageInfo + +func (m *Path_Element) GetType() string { + if m != nil && m.Type != nil { + return *m.Type + } + return "" +} + +func (m *Path_Element) GetId() int64 { + if m != nil && m.Id != nil { + return *m.Id + } + return 0 +} + +func (m *Path_Element) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type Reference struct { + App *string `protobuf:"bytes,13,req,name=app" json:"app,omitempty"` + NameSpace *string `protobuf:"bytes,20,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` + Path *Path `protobuf:"bytes,14,req,name=path" json:"path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Reference) Reset() { *m = Reference{} } +func (m *Reference) String() string { return proto.CompactTextString(m) } +func (*Reference) ProtoMessage() {} +func (*Reference) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{4} +} +func (m *Reference) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Reference.Unmarshal(m, b) +} +func (m *Reference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Reference.Marshal(b, m, deterministic) +} +func (dst *Reference) XXX_Merge(src proto.Message) { + xxx_messageInfo_Reference.Merge(dst, src) +} +func (m *Reference) XXX_Size() int { + return xxx_messageInfo_Reference.Size(m) +} +func (m *Reference) XXX_DiscardUnknown() { + xxx_messageInfo_Reference.DiscardUnknown(m) +} + +var xxx_messageInfo_Reference proto.InternalMessageInfo + +func (m *Reference) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +func (m *Reference) GetNameSpace() string { + if m != nil && m.NameSpace != nil { + return *m.NameSpace + } + return "" +} + +func (m *Reference) GetPath() *Path { + if m != nil { + return m.Path + } + return nil +} + +type User struct { + Email *string `protobuf:"bytes,1,req,name=email" json:"email,omitempty"` + AuthDomain *string `protobuf:"bytes,2,req,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"` + Nickname *string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"` + FederatedIdentity *string `protobuf:"bytes,6,opt,name=federated_identity,json=federatedIdentity" json:"federated_identity,omitempty"` + FederatedProvider *string `protobuf:"bytes,7,opt,name=federated_provider,json=federatedProvider" json:"federated_provider,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{5} +} +func (m *User) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_User.Unmarshal(m, b) +} +func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_User.Marshal(b, m, deterministic) +} +func (dst *User) XXX_Merge(src proto.Message) { + xxx_messageInfo_User.Merge(dst, src) +} +func (m *User) XXX_Size() int { + return xxx_messageInfo_User.Size(m) +} +func (m *User) XXX_DiscardUnknown() { + xxx_messageInfo_User.DiscardUnknown(m) +} + +var xxx_messageInfo_User proto.InternalMessageInfo + +func (m *User) GetEmail() string { + if m != nil && m.Email != nil { + return *m.Email + } + return "" +} + +func (m *User) GetAuthDomain() string { + if m != nil && m.AuthDomain != nil { + return *m.AuthDomain + } + return "" +} + +func (m *User) GetNickname() string { + if m != nil && m.Nickname != nil { + return *m.Nickname + } + return "" +} + +func (m *User) GetFederatedIdentity() string { + if m != nil && m.FederatedIdentity != nil { + return *m.FederatedIdentity + } + return "" +} + +func (m *User) GetFederatedProvider() string { + if m != nil && m.FederatedProvider != nil { + return *m.FederatedProvider + } + return "" +} + +type EntityProto struct { + Key *Reference `protobuf:"bytes,13,req,name=key" json:"key,omitempty"` + EntityGroup *Path `protobuf:"bytes,16,req,name=entity_group,json=entityGroup" json:"entity_group,omitempty"` + Owner *User `protobuf:"bytes,17,opt,name=owner" json:"owner,omitempty"` + Kind *EntityProto_Kind `protobuf:"varint,4,opt,name=kind,enum=appengine.EntityProto_Kind" json:"kind,omitempty"` + KindUri *string `protobuf:"bytes,5,opt,name=kind_uri,json=kindUri" json:"kind_uri,omitempty"` + Property []*Property `protobuf:"bytes,14,rep,name=property" json:"property,omitempty"` + RawProperty []*Property `protobuf:"bytes,15,rep,name=raw_property,json=rawProperty" json:"raw_property,omitempty"` + Rank *int32 `protobuf:"varint,18,opt,name=rank" json:"rank,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EntityProto) Reset() { *m = EntityProto{} } +func (m *EntityProto) String() string { return proto.CompactTextString(m) } +func (*EntityProto) ProtoMessage() {} +func (*EntityProto) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{6} +} +func (m *EntityProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EntityProto.Unmarshal(m, b) +} +func (m *EntityProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EntityProto.Marshal(b, m, deterministic) +} +func (dst *EntityProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_EntityProto.Merge(dst, src) +} +func (m *EntityProto) XXX_Size() int { + return xxx_messageInfo_EntityProto.Size(m) +} +func (m *EntityProto) XXX_DiscardUnknown() { + xxx_messageInfo_EntityProto.DiscardUnknown(m) +} + +var xxx_messageInfo_EntityProto proto.InternalMessageInfo + +func (m *EntityProto) GetKey() *Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *EntityProto) GetEntityGroup() *Path { + if m != nil { + return m.EntityGroup + } + return nil +} + +func (m *EntityProto) GetOwner() *User { + if m != nil { + return m.Owner + } + return nil +} + +func (m *EntityProto) GetKind() EntityProto_Kind { + if m != nil && m.Kind != nil { + return *m.Kind + } + return EntityProto_GD_CONTACT +} + +func (m *EntityProto) GetKindUri() string { + if m != nil && m.KindUri != nil { + return *m.KindUri + } + return "" +} + +func (m *EntityProto) GetProperty() []*Property { + if m != nil { + return m.Property + } + return nil +} + +func (m *EntityProto) GetRawProperty() []*Property { + if m != nil { + return m.RawProperty + } + return nil +} + +func (m *EntityProto) GetRank() int32 { + if m != nil && m.Rank != nil { + return *m.Rank + } + return 0 +} + +type CompositeProperty struct { + IndexId *int64 `protobuf:"varint,1,req,name=index_id,json=indexId" json:"index_id,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompositeProperty) Reset() { *m = CompositeProperty{} } +func (m *CompositeProperty) String() string { return proto.CompactTextString(m) } +func (*CompositeProperty) ProtoMessage() {} +func (*CompositeProperty) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{7} +} +func (m *CompositeProperty) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompositeProperty.Unmarshal(m, b) +} +func (m *CompositeProperty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompositeProperty.Marshal(b, m, deterministic) +} +func (dst *CompositeProperty) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompositeProperty.Merge(dst, src) +} +func (m *CompositeProperty) XXX_Size() int { + return xxx_messageInfo_CompositeProperty.Size(m) +} +func (m *CompositeProperty) XXX_DiscardUnknown() { + xxx_messageInfo_CompositeProperty.DiscardUnknown(m) +} + +var xxx_messageInfo_CompositeProperty proto.InternalMessageInfo + +func (m *CompositeProperty) GetIndexId() int64 { + if m != nil && m.IndexId != nil { + return *m.IndexId + } + return 0 +} + +func (m *CompositeProperty) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + +type Index struct { + EntityType *string `protobuf:"bytes,1,req,name=entity_type,json=entityType" json:"entity_type,omitempty"` + Ancestor *bool `protobuf:"varint,5,req,name=ancestor" json:"ancestor,omitempty"` + Property []*Index_Property `protobuf:"group,2,rep,name=Property,json=property" json:"property,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Index) Reset() { *m = Index{} } +func (m *Index) String() string { return proto.CompactTextString(m) } +func (*Index) ProtoMessage() {} +func (*Index) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{8} +} +func (m *Index) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Index.Unmarshal(m, b) +} +func (m *Index) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Index.Marshal(b, m, deterministic) +} +func (dst *Index) XXX_Merge(src proto.Message) { + xxx_messageInfo_Index.Merge(dst, src) +} +func (m *Index) XXX_Size() int { + return xxx_messageInfo_Index.Size(m) +} +func (m *Index) XXX_DiscardUnknown() { + xxx_messageInfo_Index.DiscardUnknown(m) +} + +var xxx_messageInfo_Index proto.InternalMessageInfo + +func (m *Index) GetEntityType() string { + if m != nil && m.EntityType != nil { + return *m.EntityType + } + return "" +} + +func (m *Index) GetAncestor() bool { + if m != nil && m.Ancestor != nil { + return *m.Ancestor + } + return false +} + +func (m *Index) GetProperty() []*Index_Property { + if m != nil { + return m.Property + } + return nil +} + +type Index_Property struct { + Name *string `protobuf:"bytes,3,req,name=name" json:"name,omitempty"` + Direction *Index_Property_Direction `protobuf:"varint,4,opt,name=direction,enum=appengine.Index_Property_Direction,def=1" json:"direction,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Index_Property) Reset() { *m = Index_Property{} } +func (m *Index_Property) String() string { return proto.CompactTextString(m) } +func (*Index_Property) ProtoMessage() {} +func (*Index_Property) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{8, 0} +} +func (m *Index_Property) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Index_Property.Unmarshal(m, b) +} +func (m *Index_Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Index_Property.Marshal(b, m, deterministic) +} +func (dst *Index_Property) XXX_Merge(src proto.Message) { + xxx_messageInfo_Index_Property.Merge(dst, src) +} +func (m *Index_Property) XXX_Size() int { + return xxx_messageInfo_Index_Property.Size(m) +} +func (m *Index_Property) XXX_DiscardUnknown() { + xxx_messageInfo_Index_Property.DiscardUnknown(m) +} + +var xxx_messageInfo_Index_Property proto.InternalMessageInfo + +const Default_Index_Property_Direction Index_Property_Direction = Index_Property_ASCENDING + +func (m *Index_Property) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *Index_Property) GetDirection() Index_Property_Direction { + if m != nil && m.Direction != nil { + return *m.Direction + } + return Default_Index_Property_Direction +} + +type CompositeIndex struct { + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + Id *int64 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` + Definition *Index `protobuf:"bytes,3,req,name=definition" json:"definition,omitempty"` + State *CompositeIndex_State `protobuf:"varint,4,req,name=state,enum=appengine.CompositeIndex_State" json:"state,omitempty"` + OnlyUseIfRequired *bool `protobuf:"varint,6,opt,name=only_use_if_required,json=onlyUseIfRequired,def=0" json:"only_use_if_required,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompositeIndex) Reset() { *m = CompositeIndex{} } +func (m *CompositeIndex) String() string { return proto.CompactTextString(m) } +func (*CompositeIndex) ProtoMessage() {} +func (*CompositeIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{9} +} +func (m *CompositeIndex) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompositeIndex.Unmarshal(m, b) +} +func (m *CompositeIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompositeIndex.Marshal(b, m, deterministic) +} +func (dst *CompositeIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompositeIndex.Merge(dst, src) +} +func (m *CompositeIndex) XXX_Size() int { + return xxx_messageInfo_CompositeIndex.Size(m) +} +func (m *CompositeIndex) XXX_DiscardUnknown() { + xxx_messageInfo_CompositeIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_CompositeIndex proto.InternalMessageInfo + +const Default_CompositeIndex_OnlyUseIfRequired bool = false + +func (m *CompositeIndex) GetAppId() string { + if m != nil && m.AppId != nil { + return *m.AppId + } + return "" +} + +func (m *CompositeIndex) GetId() int64 { + if m != nil && m.Id != nil { + return *m.Id + } + return 0 +} + +func (m *CompositeIndex) GetDefinition() *Index { + if m != nil { + return m.Definition + } + return nil +} + +func (m *CompositeIndex) GetState() CompositeIndex_State { + if m != nil && m.State != nil { + return *m.State + } + return CompositeIndex_WRITE_ONLY +} + +func (m *CompositeIndex) GetOnlyUseIfRequired() bool { + if m != nil && m.OnlyUseIfRequired != nil { + return *m.OnlyUseIfRequired + } + return Default_CompositeIndex_OnlyUseIfRequired +} + +type IndexPostfix struct { + IndexValue []*IndexPostfix_IndexValue `protobuf:"bytes,1,rep,name=index_value,json=indexValue" json:"index_value,omitempty"` + Key *Reference `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + Before *bool `protobuf:"varint,3,opt,name=before,def=1" json:"before,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IndexPostfix) Reset() { *m = IndexPostfix{} } +func (m *IndexPostfix) String() string { return proto.CompactTextString(m) } +func (*IndexPostfix) ProtoMessage() {} +func (*IndexPostfix) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{10} +} +func (m *IndexPostfix) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IndexPostfix.Unmarshal(m, b) +} +func (m *IndexPostfix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IndexPostfix.Marshal(b, m, deterministic) +} +func (dst *IndexPostfix) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexPostfix.Merge(dst, src) +} +func (m *IndexPostfix) XXX_Size() int { + return xxx_messageInfo_IndexPostfix.Size(m) +} +func (m *IndexPostfix) XXX_DiscardUnknown() { + xxx_messageInfo_IndexPostfix.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexPostfix proto.InternalMessageInfo + +const Default_IndexPostfix_Before bool = true + +func (m *IndexPostfix) GetIndexValue() []*IndexPostfix_IndexValue { + if m != nil { + return m.IndexValue + } + return nil +} + +func (m *IndexPostfix) GetKey() *Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *IndexPostfix) GetBefore() bool { + if m != nil && m.Before != nil { + return *m.Before + } + return Default_IndexPostfix_Before +} + +type IndexPostfix_IndexValue struct { + PropertyName *string `protobuf:"bytes,1,req,name=property_name,json=propertyName" json:"property_name,omitempty"` + Value *PropertyValue `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IndexPostfix_IndexValue) Reset() { *m = IndexPostfix_IndexValue{} } +func (m *IndexPostfix_IndexValue) String() string { return proto.CompactTextString(m) } +func (*IndexPostfix_IndexValue) ProtoMessage() {} +func (*IndexPostfix_IndexValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{10, 0} +} +func (m *IndexPostfix_IndexValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IndexPostfix_IndexValue.Unmarshal(m, b) +} +func (m *IndexPostfix_IndexValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IndexPostfix_IndexValue.Marshal(b, m, deterministic) +} +func (dst *IndexPostfix_IndexValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexPostfix_IndexValue.Merge(dst, src) +} +func (m *IndexPostfix_IndexValue) XXX_Size() int { + return xxx_messageInfo_IndexPostfix_IndexValue.Size(m) +} +func (m *IndexPostfix_IndexValue) XXX_DiscardUnknown() { + xxx_messageInfo_IndexPostfix_IndexValue.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexPostfix_IndexValue proto.InternalMessageInfo + +func (m *IndexPostfix_IndexValue) GetPropertyName() string { + if m != nil && m.PropertyName != nil { + return *m.PropertyName + } + return "" +} + +func (m *IndexPostfix_IndexValue) GetValue() *PropertyValue { + if m != nil { + return m.Value + } + return nil +} + +type IndexPosition struct { + Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Before *bool `protobuf:"varint,2,opt,name=before,def=1" json:"before,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IndexPosition) Reset() { *m = IndexPosition{} } +func (m *IndexPosition) String() string { return proto.CompactTextString(m) } +func (*IndexPosition) ProtoMessage() {} +func (*IndexPosition) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{11} +} +func (m *IndexPosition) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IndexPosition.Unmarshal(m, b) +} +func (m *IndexPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IndexPosition.Marshal(b, m, deterministic) +} +func (dst *IndexPosition) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexPosition.Merge(dst, src) +} +func (m *IndexPosition) XXX_Size() int { + return xxx_messageInfo_IndexPosition.Size(m) +} +func (m *IndexPosition) XXX_DiscardUnknown() { + xxx_messageInfo_IndexPosition.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexPosition proto.InternalMessageInfo + +const Default_IndexPosition_Before bool = true + +func (m *IndexPosition) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key + } + return "" +} + +func (m *IndexPosition) GetBefore() bool { + if m != nil && m.Before != nil { + return *m.Before + } + return Default_IndexPosition_Before +} + +type Snapshot struct { + Ts *int64 `protobuf:"varint,1,req,name=ts" json:"ts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Snapshot) Reset() { *m = Snapshot{} } +func (m *Snapshot) String() string { return proto.CompactTextString(m) } +func (*Snapshot) ProtoMessage() {} +func (*Snapshot) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{12} +} +func (m *Snapshot) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Snapshot.Unmarshal(m, b) +} +func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) +} +func (dst *Snapshot) XXX_Merge(src proto.Message) { + xxx_messageInfo_Snapshot.Merge(dst, src) +} +func (m *Snapshot) XXX_Size() int { + return xxx_messageInfo_Snapshot.Size(m) +} +func (m *Snapshot) XXX_DiscardUnknown() { + xxx_messageInfo_Snapshot.DiscardUnknown(m) +} + +var xxx_messageInfo_Snapshot proto.InternalMessageInfo + +func (m *Snapshot) GetTs() int64 { + if m != nil && m.Ts != nil { + return *m.Ts + } + return 0 +} + +type InternalHeader struct { + Qos *string `protobuf:"bytes,1,opt,name=qos" json:"qos,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InternalHeader) Reset() { *m = InternalHeader{} } +func (m *InternalHeader) String() string { return proto.CompactTextString(m) } +func (*InternalHeader) ProtoMessage() {} +func (*InternalHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{13} +} +func (m *InternalHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InternalHeader.Unmarshal(m, b) +} +func (m *InternalHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InternalHeader.Marshal(b, m, deterministic) +} +func (dst *InternalHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_InternalHeader.Merge(dst, src) +} +func (m *InternalHeader) XXX_Size() int { + return xxx_messageInfo_InternalHeader.Size(m) +} +func (m *InternalHeader) XXX_DiscardUnknown() { + xxx_messageInfo_InternalHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_InternalHeader proto.InternalMessageInfo + +func (m *InternalHeader) GetQos() string { + if m != nil && m.Qos != nil { + return *m.Qos + } + return "" +} + +type Transaction struct { + Header *InternalHeader `protobuf:"bytes,4,opt,name=header" json:"header,omitempty"` + Handle *uint64 `protobuf:"fixed64,1,req,name=handle" json:"handle,omitempty"` + App *string `protobuf:"bytes,2,req,name=app" json:"app,omitempty"` + MarkChanges *bool `protobuf:"varint,3,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{14} +} +func (m *Transaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Transaction.Unmarshal(m, b) +} +func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) +} +func (dst *Transaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Transaction.Merge(dst, src) +} +func (m *Transaction) XXX_Size() int { + return xxx_messageInfo_Transaction.Size(m) +} +func (m *Transaction) XXX_DiscardUnknown() { + xxx_messageInfo_Transaction.DiscardUnknown(m) +} + +var xxx_messageInfo_Transaction proto.InternalMessageInfo + +const Default_Transaction_MarkChanges bool = false + +func (m *Transaction) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *Transaction) GetHandle() uint64 { + if m != nil && m.Handle != nil { + return *m.Handle + } + return 0 +} + +func (m *Transaction) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +func (m *Transaction) GetMarkChanges() bool { + if m != nil && m.MarkChanges != nil { + return *m.MarkChanges + } + return Default_Transaction_MarkChanges +} + +type Query struct { + Header *InternalHeader `protobuf:"bytes,39,opt,name=header" json:"header,omitempty"` + App *string `protobuf:"bytes,1,req,name=app" json:"app,omitempty"` + NameSpace *string `protobuf:"bytes,29,opt,name=name_space,json=nameSpace" json:"name_space,omitempty"` + Kind *string `protobuf:"bytes,3,opt,name=kind" json:"kind,omitempty"` + Ancestor *Reference `protobuf:"bytes,17,opt,name=ancestor" json:"ancestor,omitempty"` + Filter []*Query_Filter `protobuf:"group,4,rep,name=Filter,json=filter" json:"filter,omitempty"` + SearchQuery *string `protobuf:"bytes,8,opt,name=search_query,json=searchQuery" json:"search_query,omitempty"` + Order []*Query_Order `protobuf:"group,9,rep,name=Order,json=order" json:"order,omitempty"` + Hint *Query_Hint `protobuf:"varint,18,opt,name=hint,enum=appengine.Query_Hint" json:"hint,omitempty"` + Count *int32 `protobuf:"varint,23,opt,name=count" json:"count,omitempty"` + Offset *int32 `protobuf:"varint,12,opt,name=offset,def=0" json:"offset,omitempty"` + Limit *int32 `protobuf:"varint,16,opt,name=limit" json:"limit,omitempty"` + CompiledCursor *CompiledCursor `protobuf:"bytes,30,opt,name=compiled_cursor,json=compiledCursor" json:"compiled_cursor,omitempty"` + EndCompiledCursor *CompiledCursor `protobuf:"bytes,31,opt,name=end_compiled_cursor,json=endCompiledCursor" json:"end_compiled_cursor,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,19,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` + RequirePerfectPlan *bool `protobuf:"varint,20,opt,name=require_perfect_plan,json=requirePerfectPlan,def=0" json:"require_perfect_plan,omitempty"` + KeysOnly *bool `protobuf:"varint,21,opt,name=keys_only,json=keysOnly,def=0" json:"keys_only,omitempty"` + Transaction *Transaction `protobuf:"bytes,22,opt,name=transaction" json:"transaction,omitempty"` + Compile *bool `protobuf:"varint,25,opt,name=compile,def=0" json:"compile,omitempty"` + FailoverMs *int64 `protobuf:"varint,26,opt,name=failover_ms,json=failoverMs" json:"failover_ms,omitempty"` + Strong *bool `protobuf:"varint,32,opt,name=strong" json:"strong,omitempty"` + PropertyName []string `protobuf:"bytes,33,rep,name=property_name,json=propertyName" json:"property_name,omitempty"` + GroupByPropertyName []string `protobuf:"bytes,34,rep,name=group_by_property_name,json=groupByPropertyName" json:"group_by_property_name,omitempty"` + Distinct *bool `protobuf:"varint,24,opt,name=distinct" json:"distinct,omitempty"` + MinSafeTimeSeconds *int64 `protobuf:"varint,35,opt,name=min_safe_time_seconds,json=minSafeTimeSeconds" json:"min_safe_time_seconds,omitempty"` + SafeReplicaName []string `protobuf:"bytes,36,rep,name=safe_replica_name,json=safeReplicaName" json:"safe_replica_name,omitempty"` + PersistOffset *bool `protobuf:"varint,37,opt,name=persist_offset,json=persistOffset,def=0" json:"persist_offset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto.CompactTextString(m) } +func (*Query) ProtoMessage() {} +func (*Query) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15} +} +func (m *Query) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Query.Unmarshal(m, b) +} +func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Query.Marshal(b, m, deterministic) +} +func (dst *Query) XXX_Merge(src proto.Message) { + xxx_messageInfo_Query.Merge(dst, src) +} +func (m *Query) XXX_Size() int { + return xxx_messageInfo_Query.Size(m) +} +func (m *Query) XXX_DiscardUnknown() { + xxx_messageInfo_Query.DiscardUnknown(m) +} + +var xxx_messageInfo_Query proto.InternalMessageInfo + +const Default_Query_Offset int32 = 0 +const Default_Query_RequirePerfectPlan bool = false +const Default_Query_KeysOnly bool = false +const Default_Query_Compile bool = false +const Default_Query_PersistOffset bool = false + +func (m *Query) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *Query) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +func (m *Query) GetNameSpace() string { + if m != nil && m.NameSpace != nil { + return *m.NameSpace + } + return "" +} + +func (m *Query) GetKind() string { + if m != nil && m.Kind != nil { + return *m.Kind + } + return "" +} + +func (m *Query) GetAncestor() *Reference { + if m != nil { + return m.Ancestor + } + return nil +} + +func (m *Query) GetFilter() []*Query_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *Query) GetSearchQuery() string { + if m != nil && m.SearchQuery != nil { + return *m.SearchQuery + } + return "" +} + +func (m *Query) GetOrder() []*Query_Order { + if m != nil { + return m.Order + } + return nil +} + +func (m *Query) GetHint() Query_Hint { + if m != nil && m.Hint != nil { + return *m.Hint + } + return Query_ORDER_FIRST +} + +func (m *Query) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *Query) GetOffset() int32 { + if m != nil && m.Offset != nil { + return *m.Offset + } + return Default_Query_Offset +} + +func (m *Query) GetLimit() int32 { + if m != nil && m.Limit != nil { + return *m.Limit + } + return 0 +} + +func (m *Query) GetCompiledCursor() *CompiledCursor { + if m != nil { + return m.CompiledCursor + } + return nil +} + +func (m *Query) GetEndCompiledCursor() *CompiledCursor { + if m != nil { + return m.EndCompiledCursor + } + return nil +} + +func (m *Query) GetCompositeIndex() []*CompositeIndex { + if m != nil { + return m.CompositeIndex + } + return nil +} + +func (m *Query) GetRequirePerfectPlan() bool { + if m != nil && m.RequirePerfectPlan != nil { + return *m.RequirePerfectPlan + } + return Default_Query_RequirePerfectPlan +} + +func (m *Query) GetKeysOnly() bool { + if m != nil && m.KeysOnly != nil { + return *m.KeysOnly + } + return Default_Query_KeysOnly +} + +func (m *Query) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *Query) GetCompile() bool { + if m != nil && m.Compile != nil { + return *m.Compile + } + return Default_Query_Compile +} + +func (m *Query) GetFailoverMs() int64 { + if m != nil && m.FailoverMs != nil { + return *m.FailoverMs + } + return 0 +} + +func (m *Query) GetStrong() bool { + if m != nil && m.Strong != nil { + return *m.Strong + } + return false +} + +func (m *Query) GetPropertyName() []string { + if m != nil { + return m.PropertyName + } + return nil +} + +func (m *Query) GetGroupByPropertyName() []string { + if m != nil { + return m.GroupByPropertyName + } + return nil +} + +func (m *Query) GetDistinct() bool { + if m != nil && m.Distinct != nil { + return *m.Distinct + } + return false +} + +func (m *Query) GetMinSafeTimeSeconds() int64 { + if m != nil && m.MinSafeTimeSeconds != nil { + return *m.MinSafeTimeSeconds + } + return 0 +} + +func (m *Query) GetSafeReplicaName() []string { + if m != nil { + return m.SafeReplicaName + } + return nil +} + +func (m *Query) GetPersistOffset() bool { + if m != nil && m.PersistOffset != nil { + return *m.PersistOffset + } + return Default_Query_PersistOffset +} + +type Query_Filter struct { + Op *Query_Filter_Operator `protobuf:"varint,6,req,name=op,enum=appengine.Query_Filter_Operator" json:"op,omitempty"` + Property []*Property `protobuf:"bytes,14,rep,name=property" json:"property,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Query_Filter) Reset() { *m = Query_Filter{} } +func (m *Query_Filter) String() string { return proto.CompactTextString(m) } +func (*Query_Filter) ProtoMessage() {} +func (*Query_Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15, 0} +} +func (m *Query_Filter) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Query_Filter.Unmarshal(m, b) +} +func (m *Query_Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Query_Filter.Marshal(b, m, deterministic) +} +func (dst *Query_Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Query_Filter.Merge(dst, src) +} +func (m *Query_Filter) XXX_Size() int { + return xxx_messageInfo_Query_Filter.Size(m) +} +func (m *Query_Filter) XXX_DiscardUnknown() { + xxx_messageInfo_Query_Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_Query_Filter proto.InternalMessageInfo + +func (m *Query_Filter) GetOp() Query_Filter_Operator { + if m != nil && m.Op != nil { + return *m.Op + } + return Query_Filter_LESS_THAN +} + +func (m *Query_Filter) GetProperty() []*Property { + if m != nil { + return m.Property + } + return nil +} + +type Query_Order struct { + Property *string `protobuf:"bytes,10,req,name=property" json:"property,omitempty"` + Direction *Query_Order_Direction `protobuf:"varint,11,opt,name=direction,enum=appengine.Query_Order_Direction,def=1" json:"direction,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Query_Order) Reset() { *m = Query_Order{} } +func (m *Query_Order) String() string { return proto.CompactTextString(m) } +func (*Query_Order) ProtoMessage() {} +func (*Query_Order) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{15, 1} +} +func (m *Query_Order) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Query_Order.Unmarshal(m, b) +} +func (m *Query_Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Query_Order.Marshal(b, m, deterministic) +} +func (dst *Query_Order) XXX_Merge(src proto.Message) { + xxx_messageInfo_Query_Order.Merge(dst, src) +} +func (m *Query_Order) XXX_Size() int { + return xxx_messageInfo_Query_Order.Size(m) +} +func (m *Query_Order) XXX_DiscardUnknown() { + xxx_messageInfo_Query_Order.DiscardUnknown(m) +} + +var xxx_messageInfo_Query_Order proto.InternalMessageInfo + +const Default_Query_Order_Direction Query_Order_Direction = Query_Order_ASCENDING + +func (m *Query_Order) GetProperty() string { + if m != nil && m.Property != nil { + return *m.Property + } + return "" +} + +func (m *Query_Order) GetDirection() Query_Order_Direction { + if m != nil && m.Direction != nil { + return *m.Direction + } + return Default_Query_Order_Direction +} + +type CompiledQuery struct { + Primaryscan *CompiledQuery_PrimaryScan `protobuf:"group,1,req,name=PrimaryScan,json=primaryscan" json:"primaryscan,omitempty"` + Mergejoinscan []*CompiledQuery_MergeJoinScan `protobuf:"group,7,rep,name=MergeJoinScan,json=mergejoinscan" json:"mergejoinscan,omitempty"` + IndexDef *Index `protobuf:"bytes,21,opt,name=index_def,json=indexDef" json:"index_def,omitempty"` + Offset *int32 `protobuf:"varint,10,opt,name=offset,def=0" json:"offset,omitempty"` + Limit *int32 `protobuf:"varint,11,opt,name=limit" json:"limit,omitempty"` + KeysOnly *bool `protobuf:"varint,12,req,name=keys_only,json=keysOnly" json:"keys_only,omitempty"` + PropertyName []string `protobuf:"bytes,24,rep,name=property_name,json=propertyName" json:"property_name,omitempty"` + DistinctInfixSize *int32 `protobuf:"varint,25,opt,name=distinct_infix_size,json=distinctInfixSize" json:"distinct_infix_size,omitempty"` + Entityfilter *CompiledQuery_EntityFilter `protobuf:"group,13,opt,name=EntityFilter,json=entityfilter" json:"entityfilter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledQuery) Reset() { *m = CompiledQuery{} } +func (m *CompiledQuery) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery) ProtoMessage() {} +func (*CompiledQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{16} +} +func (m *CompiledQuery) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledQuery.Unmarshal(m, b) +} +func (m *CompiledQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledQuery.Marshal(b, m, deterministic) +} +func (dst *CompiledQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledQuery.Merge(dst, src) +} +func (m *CompiledQuery) XXX_Size() int { + return xxx_messageInfo_CompiledQuery.Size(m) +} +func (m *CompiledQuery) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledQuery proto.InternalMessageInfo + +const Default_CompiledQuery_Offset int32 = 0 + +func (m *CompiledQuery) GetPrimaryscan() *CompiledQuery_PrimaryScan { + if m != nil { + return m.Primaryscan + } + return nil +} + +func (m *CompiledQuery) GetMergejoinscan() []*CompiledQuery_MergeJoinScan { + if m != nil { + return m.Mergejoinscan + } + return nil +} + +func (m *CompiledQuery) GetIndexDef() *Index { + if m != nil { + return m.IndexDef + } + return nil +} + +func (m *CompiledQuery) GetOffset() int32 { + if m != nil && m.Offset != nil { + return *m.Offset + } + return Default_CompiledQuery_Offset +} + +func (m *CompiledQuery) GetLimit() int32 { + if m != nil && m.Limit != nil { + return *m.Limit + } + return 0 +} + +func (m *CompiledQuery) GetKeysOnly() bool { + if m != nil && m.KeysOnly != nil { + return *m.KeysOnly + } + return false +} + +func (m *CompiledQuery) GetPropertyName() []string { + if m != nil { + return m.PropertyName + } + return nil +} + +func (m *CompiledQuery) GetDistinctInfixSize() int32 { + if m != nil && m.DistinctInfixSize != nil { + return *m.DistinctInfixSize + } + return 0 +} + +func (m *CompiledQuery) GetEntityfilter() *CompiledQuery_EntityFilter { + if m != nil { + return m.Entityfilter + } + return nil +} + +type CompiledQuery_PrimaryScan struct { + IndexName *string `protobuf:"bytes,2,opt,name=index_name,json=indexName" json:"index_name,omitempty"` + StartKey *string `protobuf:"bytes,3,opt,name=start_key,json=startKey" json:"start_key,omitempty"` + StartInclusive *bool `protobuf:"varint,4,opt,name=start_inclusive,json=startInclusive" json:"start_inclusive,omitempty"` + EndKey *string `protobuf:"bytes,5,opt,name=end_key,json=endKey" json:"end_key,omitempty"` + EndInclusive *bool `protobuf:"varint,6,opt,name=end_inclusive,json=endInclusive" json:"end_inclusive,omitempty"` + StartPostfixValue []string `protobuf:"bytes,22,rep,name=start_postfix_value,json=startPostfixValue" json:"start_postfix_value,omitempty"` + EndPostfixValue []string `protobuf:"bytes,23,rep,name=end_postfix_value,json=endPostfixValue" json:"end_postfix_value,omitempty"` + EndUnappliedLogTimestampUs *int64 `protobuf:"varint,19,opt,name=end_unapplied_log_timestamp_us,json=endUnappliedLogTimestampUs" json:"end_unapplied_log_timestamp_us,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledQuery_PrimaryScan) Reset() { *m = CompiledQuery_PrimaryScan{} } +func (m *CompiledQuery_PrimaryScan) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_PrimaryScan) ProtoMessage() {} +func (*CompiledQuery_PrimaryScan) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{16, 0} +} +func (m *CompiledQuery_PrimaryScan) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledQuery_PrimaryScan.Unmarshal(m, b) +} +func (m *CompiledQuery_PrimaryScan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledQuery_PrimaryScan.Marshal(b, m, deterministic) +} +func (dst *CompiledQuery_PrimaryScan) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledQuery_PrimaryScan.Merge(dst, src) +} +func (m *CompiledQuery_PrimaryScan) XXX_Size() int { + return xxx_messageInfo_CompiledQuery_PrimaryScan.Size(m) +} +func (m *CompiledQuery_PrimaryScan) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledQuery_PrimaryScan.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledQuery_PrimaryScan proto.InternalMessageInfo + +func (m *CompiledQuery_PrimaryScan) GetIndexName() string { + if m != nil && m.IndexName != nil { + return *m.IndexName + } + return "" +} + +func (m *CompiledQuery_PrimaryScan) GetStartKey() string { + if m != nil && m.StartKey != nil { + return *m.StartKey + } + return "" +} + +func (m *CompiledQuery_PrimaryScan) GetStartInclusive() bool { + if m != nil && m.StartInclusive != nil { + return *m.StartInclusive + } + return false +} + +func (m *CompiledQuery_PrimaryScan) GetEndKey() string { + if m != nil && m.EndKey != nil { + return *m.EndKey + } + return "" +} + +func (m *CompiledQuery_PrimaryScan) GetEndInclusive() bool { + if m != nil && m.EndInclusive != nil { + return *m.EndInclusive + } + return false +} + +func (m *CompiledQuery_PrimaryScan) GetStartPostfixValue() []string { + if m != nil { + return m.StartPostfixValue + } + return nil +} + +func (m *CompiledQuery_PrimaryScan) GetEndPostfixValue() []string { + if m != nil { + return m.EndPostfixValue + } + return nil +} + +func (m *CompiledQuery_PrimaryScan) GetEndUnappliedLogTimestampUs() int64 { + if m != nil && m.EndUnappliedLogTimestampUs != nil { + return *m.EndUnappliedLogTimestampUs + } + return 0 +} + +type CompiledQuery_MergeJoinScan struct { + IndexName *string `protobuf:"bytes,8,req,name=index_name,json=indexName" json:"index_name,omitempty"` + PrefixValue []string `protobuf:"bytes,9,rep,name=prefix_value,json=prefixValue" json:"prefix_value,omitempty"` + ValuePrefix *bool `protobuf:"varint,20,opt,name=value_prefix,json=valuePrefix,def=0" json:"value_prefix,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledQuery_MergeJoinScan) Reset() { *m = CompiledQuery_MergeJoinScan{} } +func (m *CompiledQuery_MergeJoinScan) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_MergeJoinScan) ProtoMessage() {} +func (*CompiledQuery_MergeJoinScan) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{16, 1} +} +func (m *CompiledQuery_MergeJoinScan) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledQuery_MergeJoinScan.Unmarshal(m, b) +} +func (m *CompiledQuery_MergeJoinScan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledQuery_MergeJoinScan.Marshal(b, m, deterministic) +} +func (dst *CompiledQuery_MergeJoinScan) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledQuery_MergeJoinScan.Merge(dst, src) +} +func (m *CompiledQuery_MergeJoinScan) XXX_Size() int { + return xxx_messageInfo_CompiledQuery_MergeJoinScan.Size(m) +} +func (m *CompiledQuery_MergeJoinScan) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledQuery_MergeJoinScan.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledQuery_MergeJoinScan proto.InternalMessageInfo + +const Default_CompiledQuery_MergeJoinScan_ValuePrefix bool = false + +func (m *CompiledQuery_MergeJoinScan) GetIndexName() string { + if m != nil && m.IndexName != nil { + return *m.IndexName + } + return "" +} + +func (m *CompiledQuery_MergeJoinScan) GetPrefixValue() []string { + if m != nil { + return m.PrefixValue + } + return nil +} + +func (m *CompiledQuery_MergeJoinScan) GetValuePrefix() bool { + if m != nil && m.ValuePrefix != nil { + return *m.ValuePrefix + } + return Default_CompiledQuery_MergeJoinScan_ValuePrefix +} + +type CompiledQuery_EntityFilter struct { + Distinct *bool `protobuf:"varint,14,opt,name=distinct,def=0" json:"distinct,omitempty"` + Kind *string `protobuf:"bytes,17,opt,name=kind" json:"kind,omitempty"` + Ancestor *Reference `protobuf:"bytes,18,opt,name=ancestor" json:"ancestor,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledQuery_EntityFilter) Reset() { *m = CompiledQuery_EntityFilter{} } +func (m *CompiledQuery_EntityFilter) String() string { return proto.CompactTextString(m) } +func (*CompiledQuery_EntityFilter) ProtoMessage() {} +func (*CompiledQuery_EntityFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{16, 2} +} +func (m *CompiledQuery_EntityFilter) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledQuery_EntityFilter.Unmarshal(m, b) +} +func (m *CompiledQuery_EntityFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledQuery_EntityFilter.Marshal(b, m, deterministic) +} +func (dst *CompiledQuery_EntityFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledQuery_EntityFilter.Merge(dst, src) +} +func (m *CompiledQuery_EntityFilter) XXX_Size() int { + return xxx_messageInfo_CompiledQuery_EntityFilter.Size(m) +} +func (m *CompiledQuery_EntityFilter) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledQuery_EntityFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledQuery_EntityFilter proto.InternalMessageInfo + +const Default_CompiledQuery_EntityFilter_Distinct bool = false + +func (m *CompiledQuery_EntityFilter) GetDistinct() bool { + if m != nil && m.Distinct != nil { + return *m.Distinct + } + return Default_CompiledQuery_EntityFilter_Distinct +} + +func (m *CompiledQuery_EntityFilter) GetKind() string { + if m != nil && m.Kind != nil { + return *m.Kind + } + return "" +} + +func (m *CompiledQuery_EntityFilter) GetAncestor() *Reference { + if m != nil { + return m.Ancestor + } + return nil +} + +type CompiledCursor struct { + Position *CompiledCursor_Position `protobuf:"group,2,opt,name=Position,json=position" json:"position,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledCursor) Reset() { *m = CompiledCursor{} } +func (m *CompiledCursor) String() string { return proto.CompactTextString(m) } +func (*CompiledCursor) ProtoMessage() {} +func (*CompiledCursor) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{17} +} +func (m *CompiledCursor) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledCursor.Unmarshal(m, b) +} +func (m *CompiledCursor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledCursor.Marshal(b, m, deterministic) +} +func (dst *CompiledCursor) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledCursor.Merge(dst, src) +} +func (m *CompiledCursor) XXX_Size() int { + return xxx_messageInfo_CompiledCursor.Size(m) +} +func (m *CompiledCursor) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledCursor.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledCursor proto.InternalMessageInfo + +func (m *CompiledCursor) GetPosition() *CompiledCursor_Position { + if m != nil { + return m.Position + } + return nil +} + +type CompiledCursor_Position struct { + StartKey *string `protobuf:"bytes,27,opt,name=start_key,json=startKey" json:"start_key,omitempty"` + Indexvalue []*CompiledCursor_Position_IndexValue `protobuf:"group,29,rep,name=IndexValue,json=indexvalue" json:"indexvalue,omitempty"` + Key *Reference `protobuf:"bytes,32,opt,name=key" json:"key,omitempty"` + StartInclusive *bool `protobuf:"varint,28,opt,name=start_inclusive,json=startInclusive,def=1" json:"start_inclusive,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledCursor_Position) Reset() { *m = CompiledCursor_Position{} } +func (m *CompiledCursor_Position) String() string { return proto.CompactTextString(m) } +func (*CompiledCursor_Position) ProtoMessage() {} +func (*CompiledCursor_Position) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{17, 0} +} +func (m *CompiledCursor_Position) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledCursor_Position.Unmarshal(m, b) +} +func (m *CompiledCursor_Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledCursor_Position.Marshal(b, m, deterministic) +} +func (dst *CompiledCursor_Position) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledCursor_Position.Merge(dst, src) +} +func (m *CompiledCursor_Position) XXX_Size() int { + return xxx_messageInfo_CompiledCursor_Position.Size(m) +} +func (m *CompiledCursor_Position) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledCursor_Position.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledCursor_Position proto.InternalMessageInfo + +const Default_CompiledCursor_Position_StartInclusive bool = true + +func (m *CompiledCursor_Position) GetStartKey() string { + if m != nil && m.StartKey != nil { + return *m.StartKey + } + return "" +} + +func (m *CompiledCursor_Position) GetIndexvalue() []*CompiledCursor_Position_IndexValue { + if m != nil { + return m.Indexvalue + } + return nil +} + +func (m *CompiledCursor_Position) GetKey() *Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *CompiledCursor_Position) GetStartInclusive() bool { + if m != nil && m.StartInclusive != nil { + return *m.StartInclusive + } + return Default_CompiledCursor_Position_StartInclusive +} + +type CompiledCursor_Position_IndexValue struct { + Property *string `protobuf:"bytes,30,opt,name=property" json:"property,omitempty"` + Value *PropertyValue `protobuf:"bytes,31,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompiledCursor_Position_IndexValue) Reset() { *m = CompiledCursor_Position_IndexValue{} } +func (m *CompiledCursor_Position_IndexValue) String() string { return proto.CompactTextString(m) } +func (*CompiledCursor_Position_IndexValue) ProtoMessage() {} +func (*CompiledCursor_Position_IndexValue) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{17, 0, 0} +} +func (m *CompiledCursor_Position_IndexValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompiledCursor_Position_IndexValue.Unmarshal(m, b) +} +func (m *CompiledCursor_Position_IndexValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompiledCursor_Position_IndexValue.Marshal(b, m, deterministic) +} +func (dst *CompiledCursor_Position_IndexValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompiledCursor_Position_IndexValue.Merge(dst, src) +} +func (m *CompiledCursor_Position_IndexValue) XXX_Size() int { + return xxx_messageInfo_CompiledCursor_Position_IndexValue.Size(m) +} +func (m *CompiledCursor_Position_IndexValue) XXX_DiscardUnknown() { + xxx_messageInfo_CompiledCursor_Position_IndexValue.DiscardUnknown(m) +} + +var xxx_messageInfo_CompiledCursor_Position_IndexValue proto.InternalMessageInfo + +func (m *CompiledCursor_Position_IndexValue) GetProperty() string { + if m != nil && m.Property != nil { + return *m.Property + } + return "" +} + +func (m *CompiledCursor_Position_IndexValue) GetValue() *PropertyValue { + if m != nil { + return m.Value + } + return nil +} + +type Cursor struct { + Cursor *uint64 `protobuf:"fixed64,1,req,name=cursor" json:"cursor,omitempty"` + App *string `protobuf:"bytes,2,opt,name=app" json:"app,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Cursor) Reset() { *m = Cursor{} } +func (m *Cursor) String() string { return proto.CompactTextString(m) } +func (*Cursor) ProtoMessage() {} +func (*Cursor) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{18} +} +func (m *Cursor) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Cursor.Unmarshal(m, b) +} +func (m *Cursor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Cursor.Marshal(b, m, deterministic) +} +func (dst *Cursor) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cursor.Merge(dst, src) +} +func (m *Cursor) XXX_Size() int { + return xxx_messageInfo_Cursor.Size(m) +} +func (m *Cursor) XXX_DiscardUnknown() { + xxx_messageInfo_Cursor.DiscardUnknown(m) +} + +var xxx_messageInfo_Cursor proto.InternalMessageInfo + +func (m *Cursor) GetCursor() uint64 { + if m != nil && m.Cursor != nil { + return *m.Cursor + } + return 0 +} + +func (m *Cursor) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +type Error struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Error) Reset() { *m = Error{} } +func (m *Error) String() string { return proto.CompactTextString(m) } +func (*Error) ProtoMessage() {} +func (*Error) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{19} +} +func (m *Error) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Error.Unmarshal(m, b) +} +func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Error.Marshal(b, m, deterministic) +} +func (dst *Error) XXX_Merge(src proto.Message) { + xxx_messageInfo_Error.Merge(dst, src) +} +func (m *Error) XXX_Size() int { + return xxx_messageInfo_Error.Size(m) +} +func (m *Error) XXX_DiscardUnknown() { + xxx_messageInfo_Error.DiscardUnknown(m) +} + +var xxx_messageInfo_Error proto.InternalMessageInfo + +type Cost struct { + IndexWrites *int32 `protobuf:"varint,1,opt,name=index_writes,json=indexWrites" json:"index_writes,omitempty"` + IndexWriteBytes *int32 `protobuf:"varint,2,opt,name=index_write_bytes,json=indexWriteBytes" json:"index_write_bytes,omitempty"` + EntityWrites *int32 `protobuf:"varint,3,opt,name=entity_writes,json=entityWrites" json:"entity_writes,omitempty"` + EntityWriteBytes *int32 `protobuf:"varint,4,opt,name=entity_write_bytes,json=entityWriteBytes" json:"entity_write_bytes,omitempty"` + Commitcost *Cost_CommitCost `protobuf:"group,5,opt,name=CommitCost,json=commitcost" json:"commitcost,omitempty"` + ApproximateStorageDelta *int32 `protobuf:"varint,8,opt,name=approximate_storage_delta,json=approximateStorageDelta" json:"approximate_storage_delta,omitempty"` + IdSequenceUpdates *int32 `protobuf:"varint,9,opt,name=id_sequence_updates,json=idSequenceUpdates" json:"id_sequence_updates,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Cost) Reset() { *m = Cost{} } +func (m *Cost) String() string { return proto.CompactTextString(m) } +func (*Cost) ProtoMessage() {} +func (*Cost) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{20} +} +func (m *Cost) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Cost.Unmarshal(m, b) +} +func (m *Cost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Cost.Marshal(b, m, deterministic) +} +func (dst *Cost) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cost.Merge(dst, src) +} +func (m *Cost) XXX_Size() int { + return xxx_messageInfo_Cost.Size(m) +} +func (m *Cost) XXX_DiscardUnknown() { + xxx_messageInfo_Cost.DiscardUnknown(m) +} + +var xxx_messageInfo_Cost proto.InternalMessageInfo + +func (m *Cost) GetIndexWrites() int32 { + if m != nil && m.IndexWrites != nil { + return *m.IndexWrites + } + return 0 +} + +func (m *Cost) GetIndexWriteBytes() int32 { + if m != nil && m.IndexWriteBytes != nil { + return *m.IndexWriteBytes + } + return 0 +} + +func (m *Cost) GetEntityWrites() int32 { + if m != nil && m.EntityWrites != nil { + return *m.EntityWrites + } + return 0 +} + +func (m *Cost) GetEntityWriteBytes() int32 { + if m != nil && m.EntityWriteBytes != nil { + return *m.EntityWriteBytes + } + return 0 +} + +func (m *Cost) GetCommitcost() *Cost_CommitCost { + if m != nil { + return m.Commitcost + } + return nil +} + +func (m *Cost) GetApproximateStorageDelta() int32 { + if m != nil && m.ApproximateStorageDelta != nil { + return *m.ApproximateStorageDelta + } + return 0 +} + +func (m *Cost) GetIdSequenceUpdates() int32 { + if m != nil && m.IdSequenceUpdates != nil { + return *m.IdSequenceUpdates + } + return 0 +} + +type Cost_CommitCost struct { + RequestedEntityPuts *int32 `protobuf:"varint,6,opt,name=requested_entity_puts,json=requestedEntityPuts" json:"requested_entity_puts,omitempty"` + RequestedEntityDeletes *int32 `protobuf:"varint,7,opt,name=requested_entity_deletes,json=requestedEntityDeletes" json:"requested_entity_deletes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Cost_CommitCost) Reset() { *m = Cost_CommitCost{} } +func (m *Cost_CommitCost) String() string { return proto.CompactTextString(m) } +func (*Cost_CommitCost) ProtoMessage() {} +func (*Cost_CommitCost) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{20, 0} +} +func (m *Cost_CommitCost) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Cost_CommitCost.Unmarshal(m, b) +} +func (m *Cost_CommitCost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Cost_CommitCost.Marshal(b, m, deterministic) +} +func (dst *Cost_CommitCost) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cost_CommitCost.Merge(dst, src) +} +func (m *Cost_CommitCost) XXX_Size() int { + return xxx_messageInfo_Cost_CommitCost.Size(m) +} +func (m *Cost_CommitCost) XXX_DiscardUnknown() { + xxx_messageInfo_Cost_CommitCost.DiscardUnknown(m) +} + +var xxx_messageInfo_Cost_CommitCost proto.InternalMessageInfo + +func (m *Cost_CommitCost) GetRequestedEntityPuts() int32 { + if m != nil && m.RequestedEntityPuts != nil { + return *m.RequestedEntityPuts + } + return 0 +} + +func (m *Cost_CommitCost) GetRequestedEntityDeletes() int32 { + if m != nil && m.RequestedEntityDeletes != nil { + return *m.RequestedEntityDeletes + } + return 0 +} + +type GetRequest struct { + Header *InternalHeader `protobuf:"bytes,6,opt,name=header" json:"header,omitempty"` + Key []*Reference `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` + Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` + FailoverMs *int64 `protobuf:"varint,3,opt,name=failover_ms,json=failoverMs" json:"failover_ms,omitempty"` + Strong *bool `protobuf:"varint,4,opt,name=strong" json:"strong,omitempty"` + AllowDeferred *bool `protobuf:"varint,5,opt,name=allow_deferred,json=allowDeferred,def=0" json:"allow_deferred,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{21} +} +func (m *GetRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetRequest.Unmarshal(m, b) +} +func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) +} +func (dst *GetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRequest.Merge(dst, src) +} +func (m *GetRequest) XXX_Size() int { + return xxx_messageInfo_GetRequest.Size(m) +} +func (m *GetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetRequest proto.InternalMessageInfo + +const Default_GetRequest_AllowDeferred bool = false + +func (m *GetRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *GetRequest) GetKey() []*Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *GetRequest) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *GetRequest) GetFailoverMs() int64 { + if m != nil && m.FailoverMs != nil { + return *m.FailoverMs + } + return 0 +} + +func (m *GetRequest) GetStrong() bool { + if m != nil && m.Strong != nil { + return *m.Strong + } + return false +} + +func (m *GetRequest) GetAllowDeferred() bool { + if m != nil && m.AllowDeferred != nil { + return *m.AllowDeferred + } + return Default_GetRequest_AllowDeferred +} + +type GetResponse struct { + Entity []*GetResponse_Entity `protobuf:"group,1,rep,name=Entity,json=entity" json:"entity,omitempty"` + Deferred []*Reference `protobuf:"bytes,5,rep,name=deferred" json:"deferred,omitempty"` + InOrder *bool `protobuf:"varint,6,opt,name=in_order,json=inOrder,def=1" json:"in_order,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetResponse) Reset() { *m = GetResponse{} } +func (m *GetResponse) String() string { return proto.CompactTextString(m) } +func (*GetResponse) ProtoMessage() {} +func (*GetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{22} +} +func (m *GetResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetResponse.Unmarshal(m, b) +} +func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetResponse.Marshal(b, m, deterministic) +} +func (dst *GetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetResponse.Merge(dst, src) +} +func (m *GetResponse) XXX_Size() int { + return xxx_messageInfo_GetResponse.Size(m) +} +func (m *GetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetResponse proto.InternalMessageInfo + +const Default_GetResponse_InOrder bool = true + +func (m *GetResponse) GetEntity() []*GetResponse_Entity { + if m != nil { + return m.Entity + } + return nil +} + +func (m *GetResponse) GetDeferred() []*Reference { + if m != nil { + return m.Deferred + } + return nil +} + +func (m *GetResponse) GetInOrder() bool { + if m != nil && m.InOrder != nil { + return *m.InOrder + } + return Default_GetResponse_InOrder +} + +type GetResponse_Entity struct { + Entity *EntityProto `protobuf:"bytes,2,opt,name=entity" json:"entity,omitempty"` + Key *Reference `protobuf:"bytes,4,opt,name=key" json:"key,omitempty"` + Version *int64 `protobuf:"varint,3,opt,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetResponse_Entity) Reset() { *m = GetResponse_Entity{} } +func (m *GetResponse_Entity) String() string { return proto.CompactTextString(m) } +func (*GetResponse_Entity) ProtoMessage() {} +func (*GetResponse_Entity) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{22, 0} +} +func (m *GetResponse_Entity) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetResponse_Entity.Unmarshal(m, b) +} +func (m *GetResponse_Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetResponse_Entity.Marshal(b, m, deterministic) +} +func (dst *GetResponse_Entity) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetResponse_Entity.Merge(dst, src) +} +func (m *GetResponse_Entity) XXX_Size() int { + return xxx_messageInfo_GetResponse_Entity.Size(m) +} +func (m *GetResponse_Entity) XXX_DiscardUnknown() { + xxx_messageInfo_GetResponse_Entity.DiscardUnknown(m) +} + +var xxx_messageInfo_GetResponse_Entity proto.InternalMessageInfo + +func (m *GetResponse_Entity) GetEntity() *EntityProto { + if m != nil { + return m.Entity + } + return nil +} + +func (m *GetResponse_Entity) GetKey() *Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *GetResponse_Entity) GetVersion() int64 { + if m != nil && m.Version != nil { + return *m.Version + } + return 0 +} + +type PutRequest struct { + Header *InternalHeader `protobuf:"bytes,11,opt,name=header" json:"header,omitempty"` + Entity []*EntityProto `protobuf:"bytes,1,rep,name=entity" json:"entity,omitempty"` + Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,3,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` + Trusted *bool `protobuf:"varint,4,opt,name=trusted,def=0" json:"trusted,omitempty"` + Force *bool `protobuf:"varint,7,opt,name=force,def=0" json:"force,omitempty"` + MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` + Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` + AutoIdPolicy *PutRequest_AutoIdPolicy `protobuf:"varint,10,opt,name=auto_id_policy,json=autoIdPolicy,enum=appengine.PutRequest_AutoIdPolicy,def=0" json:"auto_id_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PutRequest) Reset() { *m = PutRequest{} } +func (m *PutRequest) String() string { return proto.CompactTextString(m) } +func (*PutRequest) ProtoMessage() {} +func (*PutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{23} +} +func (m *PutRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PutRequest.Unmarshal(m, b) +} +func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PutRequest.Marshal(b, m, deterministic) +} +func (dst *PutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutRequest.Merge(dst, src) +} +func (m *PutRequest) XXX_Size() int { + return xxx_messageInfo_PutRequest.Size(m) +} +func (m *PutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PutRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PutRequest proto.InternalMessageInfo + +const Default_PutRequest_Trusted bool = false +const Default_PutRequest_Force bool = false +const Default_PutRequest_MarkChanges bool = false +const Default_PutRequest_AutoIdPolicy PutRequest_AutoIdPolicy = PutRequest_CURRENT + +func (m *PutRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *PutRequest) GetEntity() []*EntityProto { + if m != nil { + return m.Entity + } + return nil +} + +func (m *PutRequest) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *PutRequest) GetCompositeIndex() []*CompositeIndex { + if m != nil { + return m.CompositeIndex + } + return nil +} + +func (m *PutRequest) GetTrusted() bool { + if m != nil && m.Trusted != nil { + return *m.Trusted + } + return Default_PutRequest_Trusted +} + +func (m *PutRequest) GetForce() bool { + if m != nil && m.Force != nil { + return *m.Force + } + return Default_PutRequest_Force +} + +func (m *PutRequest) GetMarkChanges() bool { + if m != nil && m.MarkChanges != nil { + return *m.MarkChanges + } + return Default_PutRequest_MarkChanges +} + +func (m *PutRequest) GetSnapshot() []*Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +func (m *PutRequest) GetAutoIdPolicy() PutRequest_AutoIdPolicy { + if m != nil && m.AutoIdPolicy != nil { + return *m.AutoIdPolicy + } + return Default_PutRequest_AutoIdPolicy +} + +type PutResponse struct { + Key []*Reference `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` + Cost *Cost `protobuf:"bytes,2,opt,name=cost" json:"cost,omitempty"` + Version []int64 `protobuf:"varint,3,rep,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PutResponse) Reset() { *m = PutResponse{} } +func (m *PutResponse) String() string { return proto.CompactTextString(m) } +func (*PutResponse) ProtoMessage() {} +func (*PutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{24} +} +func (m *PutResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PutResponse.Unmarshal(m, b) +} +func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PutResponse.Marshal(b, m, deterministic) +} +func (dst *PutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutResponse.Merge(dst, src) +} +func (m *PutResponse) XXX_Size() int { + return xxx_messageInfo_PutResponse.Size(m) +} +func (m *PutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PutResponse proto.InternalMessageInfo + +func (m *PutResponse) GetKey() []*Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *PutResponse) GetCost() *Cost { + if m != nil { + return m.Cost + } + return nil +} + +func (m *PutResponse) GetVersion() []int64 { + if m != nil { + return m.Version + } + return nil +} + +type TouchRequest struct { + Header *InternalHeader `protobuf:"bytes,10,opt,name=header" json:"header,omitempty"` + Key []*Reference `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` + CompositeIndex []*CompositeIndex `protobuf:"bytes,2,rep,name=composite_index,json=compositeIndex" json:"composite_index,omitempty"` + Force *bool `protobuf:"varint,3,opt,name=force,def=0" json:"force,omitempty"` + Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TouchRequest) Reset() { *m = TouchRequest{} } +func (m *TouchRequest) String() string { return proto.CompactTextString(m) } +func (*TouchRequest) ProtoMessage() {} +func (*TouchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{25} +} +func (m *TouchRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TouchRequest.Unmarshal(m, b) +} +func (m *TouchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TouchRequest.Marshal(b, m, deterministic) +} +func (dst *TouchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TouchRequest.Merge(dst, src) +} +func (m *TouchRequest) XXX_Size() int { + return xxx_messageInfo_TouchRequest.Size(m) +} +func (m *TouchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TouchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TouchRequest proto.InternalMessageInfo + +const Default_TouchRequest_Force bool = false + +func (m *TouchRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *TouchRequest) GetKey() []*Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *TouchRequest) GetCompositeIndex() []*CompositeIndex { + if m != nil { + return m.CompositeIndex + } + return nil +} + +func (m *TouchRequest) GetForce() bool { + if m != nil && m.Force != nil { + return *m.Force + } + return Default_TouchRequest_Force +} + +func (m *TouchRequest) GetSnapshot() []*Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +type TouchResponse struct { + Cost *Cost `protobuf:"bytes,1,opt,name=cost" json:"cost,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TouchResponse) Reset() { *m = TouchResponse{} } +func (m *TouchResponse) String() string { return proto.CompactTextString(m) } +func (*TouchResponse) ProtoMessage() {} +func (*TouchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{26} +} +func (m *TouchResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TouchResponse.Unmarshal(m, b) +} +func (m *TouchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TouchResponse.Marshal(b, m, deterministic) +} +func (dst *TouchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TouchResponse.Merge(dst, src) +} +func (m *TouchResponse) XXX_Size() int { + return xxx_messageInfo_TouchResponse.Size(m) +} +func (m *TouchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TouchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TouchResponse proto.InternalMessageInfo + +func (m *TouchResponse) GetCost() *Cost { + if m != nil { + return m.Cost + } + return nil +} + +type DeleteRequest struct { + Header *InternalHeader `protobuf:"bytes,10,opt,name=header" json:"header,omitempty"` + Key []*Reference `protobuf:"bytes,6,rep,name=key" json:"key,omitempty"` + Transaction *Transaction `protobuf:"bytes,5,opt,name=transaction" json:"transaction,omitempty"` + Trusted *bool `protobuf:"varint,4,opt,name=trusted,def=0" json:"trusted,omitempty"` + Force *bool `protobuf:"varint,7,opt,name=force,def=0" json:"force,omitempty"` + MarkChanges *bool `protobuf:"varint,8,opt,name=mark_changes,json=markChanges,def=0" json:"mark_changes,omitempty"` + Snapshot []*Snapshot `protobuf:"bytes,9,rep,name=snapshot" json:"snapshot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } +func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRequest) ProtoMessage() {} +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{27} +} +func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteRequest.Unmarshal(m, b) +} +func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteRequest.Merge(dst, src) +} +func (m *DeleteRequest) XXX_Size() int { + return xxx_messageInfo_DeleteRequest.Size(m) +} +func (m *DeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo + +const Default_DeleteRequest_Trusted bool = false +const Default_DeleteRequest_Force bool = false +const Default_DeleteRequest_MarkChanges bool = false + +func (m *DeleteRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *DeleteRequest) GetKey() []*Reference { + if m != nil { + return m.Key + } + return nil +} + +func (m *DeleteRequest) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *DeleteRequest) GetTrusted() bool { + if m != nil && m.Trusted != nil { + return *m.Trusted + } + return Default_DeleteRequest_Trusted +} + +func (m *DeleteRequest) GetForce() bool { + if m != nil && m.Force != nil { + return *m.Force + } + return Default_DeleteRequest_Force +} + +func (m *DeleteRequest) GetMarkChanges() bool { + if m != nil && m.MarkChanges != nil { + return *m.MarkChanges + } + return Default_DeleteRequest_MarkChanges +} + +func (m *DeleteRequest) GetSnapshot() []*Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +type DeleteResponse struct { + Cost *Cost `protobuf:"bytes,1,opt,name=cost" json:"cost,omitempty"` + Version []int64 `protobuf:"varint,3,rep,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } +func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteResponse) ProtoMessage() {} +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{28} +} +func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteResponse.Unmarshal(m, b) +} +func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic) +} +func (dst *DeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteResponse.Merge(dst, src) +} +func (m *DeleteResponse) XXX_Size() int { + return xxx_messageInfo_DeleteResponse.Size(m) +} +func (m *DeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo + +func (m *DeleteResponse) GetCost() *Cost { + if m != nil { + return m.Cost + } + return nil +} + +func (m *DeleteResponse) GetVersion() []int64 { + if m != nil { + return m.Version + } + return nil +} + +type NextRequest struct { + Header *InternalHeader `protobuf:"bytes,5,opt,name=header" json:"header,omitempty"` + Cursor *Cursor `protobuf:"bytes,1,req,name=cursor" json:"cursor,omitempty"` + Count *int32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` + Offset *int32 `protobuf:"varint,4,opt,name=offset,def=0" json:"offset,omitempty"` + Compile *bool `protobuf:"varint,3,opt,name=compile,def=0" json:"compile,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NextRequest) Reset() { *m = NextRequest{} } +func (m *NextRequest) String() string { return proto.CompactTextString(m) } +func (*NextRequest) ProtoMessage() {} +func (*NextRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{29} +} +func (m *NextRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NextRequest.Unmarshal(m, b) +} +func (m *NextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NextRequest.Marshal(b, m, deterministic) +} +func (dst *NextRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NextRequest.Merge(dst, src) +} +func (m *NextRequest) XXX_Size() int { + return xxx_messageInfo_NextRequest.Size(m) +} +func (m *NextRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NextRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NextRequest proto.InternalMessageInfo + +const Default_NextRequest_Offset int32 = 0 +const Default_NextRequest_Compile bool = false + +func (m *NextRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *NextRequest) GetCursor() *Cursor { + if m != nil { + return m.Cursor + } + return nil +} + +func (m *NextRequest) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *NextRequest) GetOffset() int32 { + if m != nil && m.Offset != nil { + return *m.Offset + } + return Default_NextRequest_Offset +} + +func (m *NextRequest) GetCompile() bool { + if m != nil && m.Compile != nil { + return *m.Compile + } + return Default_NextRequest_Compile +} + +type QueryResult struct { + Cursor *Cursor `protobuf:"bytes,1,opt,name=cursor" json:"cursor,omitempty"` + Result []*EntityProto `protobuf:"bytes,2,rep,name=result" json:"result,omitempty"` + SkippedResults *int32 `protobuf:"varint,7,opt,name=skipped_results,json=skippedResults" json:"skipped_results,omitempty"` + MoreResults *bool `protobuf:"varint,3,req,name=more_results,json=moreResults" json:"more_results,omitempty"` + KeysOnly *bool `protobuf:"varint,4,opt,name=keys_only,json=keysOnly" json:"keys_only,omitempty"` + IndexOnly *bool `protobuf:"varint,9,opt,name=index_only,json=indexOnly" json:"index_only,omitempty"` + SmallOps *bool `protobuf:"varint,10,opt,name=small_ops,json=smallOps" json:"small_ops,omitempty"` + CompiledQuery *CompiledQuery `protobuf:"bytes,5,opt,name=compiled_query,json=compiledQuery" json:"compiled_query,omitempty"` + CompiledCursor *CompiledCursor `protobuf:"bytes,6,opt,name=compiled_cursor,json=compiledCursor" json:"compiled_cursor,omitempty"` + Index []*CompositeIndex `protobuf:"bytes,8,rep,name=index" json:"index,omitempty"` + Version []int64 `protobuf:"varint,11,rep,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryResult) Reset() { *m = QueryResult{} } +func (m *QueryResult) String() string { return proto.CompactTextString(m) } +func (*QueryResult) ProtoMessage() {} +func (*QueryResult) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{30} +} +func (m *QueryResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryResult.Unmarshal(m, b) +} +func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) +} +func (dst *QueryResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResult.Merge(dst, src) +} +func (m *QueryResult) XXX_Size() int { + return xxx_messageInfo_QueryResult.Size(m) +} +func (m *QueryResult) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResult.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResult proto.InternalMessageInfo + +func (m *QueryResult) GetCursor() *Cursor { + if m != nil { + return m.Cursor + } + return nil +} + +func (m *QueryResult) GetResult() []*EntityProto { + if m != nil { + return m.Result + } + return nil +} + +func (m *QueryResult) GetSkippedResults() int32 { + if m != nil && m.SkippedResults != nil { + return *m.SkippedResults + } + return 0 +} + +func (m *QueryResult) GetMoreResults() bool { + if m != nil && m.MoreResults != nil { + return *m.MoreResults + } + return false +} + +func (m *QueryResult) GetKeysOnly() bool { + if m != nil && m.KeysOnly != nil { + return *m.KeysOnly + } + return false +} + +func (m *QueryResult) GetIndexOnly() bool { + if m != nil && m.IndexOnly != nil { + return *m.IndexOnly + } + return false +} + +func (m *QueryResult) GetSmallOps() bool { + if m != nil && m.SmallOps != nil { + return *m.SmallOps + } + return false +} + +func (m *QueryResult) GetCompiledQuery() *CompiledQuery { + if m != nil { + return m.CompiledQuery + } + return nil +} + +func (m *QueryResult) GetCompiledCursor() *CompiledCursor { + if m != nil { + return m.CompiledCursor + } + return nil +} + +func (m *QueryResult) GetIndex() []*CompositeIndex { + if m != nil { + return m.Index + } + return nil +} + +func (m *QueryResult) GetVersion() []int64 { + if m != nil { + return m.Version + } + return nil +} + +type AllocateIdsRequest struct { + Header *InternalHeader `protobuf:"bytes,4,opt,name=header" json:"header,omitempty"` + ModelKey *Reference `protobuf:"bytes,1,opt,name=model_key,json=modelKey" json:"model_key,omitempty"` + Size *int64 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"` + Max *int64 `protobuf:"varint,3,opt,name=max" json:"max,omitempty"` + Reserve []*Reference `protobuf:"bytes,5,rep,name=reserve" json:"reserve,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } +func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsRequest) ProtoMessage() {} +func (*AllocateIdsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{31} +} +func (m *AllocateIdsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AllocateIdsRequest.Unmarshal(m, b) +} +func (m *AllocateIdsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AllocateIdsRequest.Marshal(b, m, deterministic) +} +func (dst *AllocateIdsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllocateIdsRequest.Merge(dst, src) +} +func (m *AllocateIdsRequest) XXX_Size() int { + return xxx_messageInfo_AllocateIdsRequest.Size(m) +} +func (m *AllocateIdsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AllocateIdsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AllocateIdsRequest proto.InternalMessageInfo + +func (m *AllocateIdsRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *AllocateIdsRequest) GetModelKey() *Reference { + if m != nil { + return m.ModelKey + } + return nil +} + +func (m *AllocateIdsRequest) GetSize() int64 { + if m != nil && m.Size != nil { + return *m.Size + } + return 0 +} + +func (m *AllocateIdsRequest) GetMax() int64 { + if m != nil && m.Max != nil { + return *m.Max + } + return 0 +} + +func (m *AllocateIdsRequest) GetReserve() []*Reference { + if m != nil { + return m.Reserve + } + return nil +} + +type AllocateIdsResponse struct { + Start *int64 `protobuf:"varint,1,req,name=start" json:"start,omitempty"` + End *int64 `protobuf:"varint,2,req,name=end" json:"end,omitempty"` + Cost *Cost `protobuf:"bytes,3,opt,name=cost" json:"cost,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } +func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsResponse) ProtoMessage() {} +func (*AllocateIdsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{32} +} +func (m *AllocateIdsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AllocateIdsResponse.Unmarshal(m, b) +} +func (m *AllocateIdsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AllocateIdsResponse.Marshal(b, m, deterministic) +} +func (dst *AllocateIdsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllocateIdsResponse.Merge(dst, src) +} +func (m *AllocateIdsResponse) XXX_Size() int { + return xxx_messageInfo_AllocateIdsResponse.Size(m) +} +func (m *AllocateIdsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AllocateIdsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AllocateIdsResponse proto.InternalMessageInfo + +func (m *AllocateIdsResponse) GetStart() int64 { + if m != nil && m.Start != nil { + return *m.Start + } + return 0 +} + +func (m *AllocateIdsResponse) GetEnd() int64 { + if m != nil && m.End != nil { + return *m.End + } + return 0 +} + +func (m *AllocateIdsResponse) GetCost() *Cost { + if m != nil { + return m.Cost + } + return nil +} + +type CompositeIndices struct { + Index []*CompositeIndex `protobuf:"bytes,1,rep,name=index" json:"index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompositeIndices) Reset() { *m = CompositeIndices{} } +func (m *CompositeIndices) String() string { return proto.CompactTextString(m) } +func (*CompositeIndices) ProtoMessage() {} +func (*CompositeIndices) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{33} +} +func (m *CompositeIndices) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CompositeIndices.Unmarshal(m, b) +} +func (m *CompositeIndices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CompositeIndices.Marshal(b, m, deterministic) +} +func (dst *CompositeIndices) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompositeIndices.Merge(dst, src) +} +func (m *CompositeIndices) XXX_Size() int { + return xxx_messageInfo_CompositeIndices.Size(m) +} +func (m *CompositeIndices) XXX_DiscardUnknown() { + xxx_messageInfo_CompositeIndices.DiscardUnknown(m) +} + +var xxx_messageInfo_CompositeIndices proto.InternalMessageInfo + +func (m *CompositeIndices) GetIndex() []*CompositeIndex { + if m != nil { + return m.Index + } + return nil +} + +type AddActionsRequest struct { + Header *InternalHeader `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + Transaction *Transaction `protobuf:"bytes,1,req,name=transaction" json:"transaction,omitempty"` + Action []*Action `protobuf:"bytes,2,rep,name=action" json:"action,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddActionsRequest) Reset() { *m = AddActionsRequest{} } +func (m *AddActionsRequest) String() string { return proto.CompactTextString(m) } +func (*AddActionsRequest) ProtoMessage() {} +func (*AddActionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{34} +} +func (m *AddActionsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddActionsRequest.Unmarshal(m, b) +} +func (m *AddActionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddActionsRequest.Marshal(b, m, deterministic) +} +func (dst *AddActionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddActionsRequest.Merge(dst, src) +} +func (m *AddActionsRequest) XXX_Size() int { + return xxx_messageInfo_AddActionsRequest.Size(m) +} +func (m *AddActionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddActionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddActionsRequest proto.InternalMessageInfo + +func (m *AddActionsRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *AddActionsRequest) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *AddActionsRequest) GetAction() []*Action { + if m != nil { + return m.Action + } + return nil +} + +type AddActionsResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddActionsResponse) Reset() { *m = AddActionsResponse{} } +func (m *AddActionsResponse) String() string { return proto.CompactTextString(m) } +func (*AddActionsResponse) ProtoMessage() {} +func (*AddActionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{35} +} +func (m *AddActionsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddActionsResponse.Unmarshal(m, b) +} +func (m *AddActionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddActionsResponse.Marshal(b, m, deterministic) +} +func (dst *AddActionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddActionsResponse.Merge(dst, src) +} +func (m *AddActionsResponse) XXX_Size() int { + return xxx_messageInfo_AddActionsResponse.Size(m) +} +func (m *AddActionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddActionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddActionsResponse proto.InternalMessageInfo + +type BeginTransactionRequest struct { + Header *InternalHeader `protobuf:"bytes,3,opt,name=header" json:"header,omitempty"` + App *string `protobuf:"bytes,1,req,name=app" json:"app,omitempty"` + AllowMultipleEg *bool `protobuf:"varint,2,opt,name=allow_multiple_eg,json=allowMultipleEg,def=0" json:"allow_multiple_eg,omitempty"` + DatabaseId *string `protobuf:"bytes,4,opt,name=database_id,json=databaseId" json:"database_id,omitempty"` + Mode *BeginTransactionRequest_TransactionMode `protobuf:"varint,5,opt,name=mode,enum=appengine.BeginTransactionRequest_TransactionMode,def=0" json:"mode,omitempty"` + PreviousTransaction *Transaction `protobuf:"bytes,7,opt,name=previous_transaction,json=previousTransaction" json:"previous_transaction,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{36} +} +func (m *BeginTransactionRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BeginTransactionRequest.Unmarshal(m, b) +} +func (m *BeginTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BeginTransactionRequest.Marshal(b, m, deterministic) +} +func (dst *BeginTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BeginTransactionRequest.Merge(dst, src) +} +func (m *BeginTransactionRequest) XXX_Size() int { + return xxx_messageInfo_BeginTransactionRequest.Size(m) +} +func (m *BeginTransactionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BeginTransactionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BeginTransactionRequest proto.InternalMessageInfo + +const Default_BeginTransactionRequest_AllowMultipleEg bool = false +const Default_BeginTransactionRequest_Mode BeginTransactionRequest_TransactionMode = BeginTransactionRequest_UNKNOWN + +func (m *BeginTransactionRequest) GetHeader() *InternalHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *BeginTransactionRequest) GetApp() string { + if m != nil && m.App != nil { + return *m.App + } + return "" +} + +func (m *BeginTransactionRequest) GetAllowMultipleEg() bool { + if m != nil && m.AllowMultipleEg != nil { + return *m.AllowMultipleEg + } + return Default_BeginTransactionRequest_AllowMultipleEg +} + +func (m *BeginTransactionRequest) GetDatabaseId() string { + if m != nil && m.DatabaseId != nil { + return *m.DatabaseId + } + return "" +} + +func (m *BeginTransactionRequest) GetMode() BeginTransactionRequest_TransactionMode { + if m != nil && m.Mode != nil { + return *m.Mode + } + return Default_BeginTransactionRequest_Mode +} + +func (m *BeginTransactionRequest) GetPreviousTransaction() *Transaction { + if m != nil { + return m.PreviousTransaction + } + return nil +} + +type CommitResponse struct { + Cost *Cost `protobuf:"bytes,1,opt,name=cost" json:"cost,omitempty"` + Version []*CommitResponse_Version `protobuf:"group,3,rep,name=Version,json=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{37} +} +func (m *CommitResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommitResponse.Unmarshal(m, b) +} +func (m *CommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommitResponse.Marshal(b, m, deterministic) +} +func (dst *CommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitResponse.Merge(dst, src) +} +func (m *CommitResponse) XXX_Size() int { + return xxx_messageInfo_CommitResponse.Size(m) +} +func (m *CommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CommitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitResponse proto.InternalMessageInfo + +func (m *CommitResponse) GetCost() *Cost { + if m != nil { + return m.Cost + } + return nil +} + +func (m *CommitResponse) GetVersion() []*CommitResponse_Version { + if m != nil { + return m.Version + } + return nil +} + +type CommitResponse_Version struct { + RootEntityKey *Reference `protobuf:"bytes,4,req,name=root_entity_key,json=rootEntityKey" json:"root_entity_key,omitempty"` + Version *int64 `protobuf:"varint,5,req,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommitResponse_Version) Reset() { *m = CommitResponse_Version{} } +func (m *CommitResponse_Version) String() string { return proto.CompactTextString(m) } +func (*CommitResponse_Version) ProtoMessage() {} +func (*CommitResponse_Version) Descriptor() ([]byte, []int) { + return fileDescriptor_datastore_v3_83b17b80c34f6179, []int{37, 0} +} +func (m *CommitResponse_Version) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommitResponse_Version.Unmarshal(m, b) +} +func (m *CommitResponse_Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommitResponse_Version.Marshal(b, m, deterministic) +} +func (dst *CommitResponse_Version) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitResponse_Version.Merge(dst, src) +} +func (m *CommitResponse_Version) XXX_Size() int { + return xxx_messageInfo_CommitResponse_Version.Size(m) +} +func (m *CommitResponse_Version) XXX_DiscardUnknown() { + xxx_messageInfo_CommitResponse_Version.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitResponse_Version proto.InternalMessageInfo + +func (m *CommitResponse_Version) GetRootEntityKey() *Reference { + if m != nil { + return m.RootEntityKey + } + return nil +} + +func (m *CommitResponse_Version) GetVersion() int64 { + if m != nil && m.Version != nil { + return *m.Version + } + return 0 +} + +func init() { + proto.RegisterType((*Action)(nil), "appengine.Action") + proto.RegisterType((*PropertyValue)(nil), "appengine.PropertyValue") + proto.RegisterType((*PropertyValue_PointValue)(nil), "appengine.PropertyValue.PointValue") + proto.RegisterType((*PropertyValue_UserValue)(nil), "appengine.PropertyValue.UserValue") + proto.RegisterType((*PropertyValue_ReferenceValue)(nil), "appengine.PropertyValue.ReferenceValue") + proto.RegisterType((*PropertyValue_ReferenceValue_PathElement)(nil), "appengine.PropertyValue.ReferenceValue.PathElement") + proto.RegisterType((*Property)(nil), "appengine.Property") + proto.RegisterType((*Path)(nil), "appengine.Path") + proto.RegisterType((*Path_Element)(nil), "appengine.Path.Element") + proto.RegisterType((*Reference)(nil), "appengine.Reference") + proto.RegisterType((*User)(nil), "appengine.User") + proto.RegisterType((*EntityProto)(nil), "appengine.EntityProto") + proto.RegisterType((*CompositeProperty)(nil), "appengine.CompositeProperty") + proto.RegisterType((*Index)(nil), "appengine.Index") + proto.RegisterType((*Index_Property)(nil), "appengine.Index.Property") + proto.RegisterType((*CompositeIndex)(nil), "appengine.CompositeIndex") + proto.RegisterType((*IndexPostfix)(nil), "appengine.IndexPostfix") + proto.RegisterType((*IndexPostfix_IndexValue)(nil), "appengine.IndexPostfix.IndexValue") + proto.RegisterType((*IndexPosition)(nil), "appengine.IndexPosition") + proto.RegisterType((*Snapshot)(nil), "appengine.Snapshot") + proto.RegisterType((*InternalHeader)(nil), "appengine.InternalHeader") + proto.RegisterType((*Transaction)(nil), "appengine.Transaction") + proto.RegisterType((*Query)(nil), "appengine.Query") + proto.RegisterType((*Query_Filter)(nil), "appengine.Query.Filter") + proto.RegisterType((*Query_Order)(nil), "appengine.Query.Order") + proto.RegisterType((*CompiledQuery)(nil), "appengine.CompiledQuery") + proto.RegisterType((*CompiledQuery_PrimaryScan)(nil), "appengine.CompiledQuery.PrimaryScan") + proto.RegisterType((*CompiledQuery_MergeJoinScan)(nil), "appengine.CompiledQuery.MergeJoinScan") + proto.RegisterType((*CompiledQuery_EntityFilter)(nil), "appengine.CompiledQuery.EntityFilter") + proto.RegisterType((*CompiledCursor)(nil), "appengine.CompiledCursor") + proto.RegisterType((*CompiledCursor_Position)(nil), "appengine.CompiledCursor.Position") + proto.RegisterType((*CompiledCursor_Position_IndexValue)(nil), "appengine.CompiledCursor.Position.IndexValue") + proto.RegisterType((*Cursor)(nil), "appengine.Cursor") + proto.RegisterType((*Error)(nil), "appengine.Error") + proto.RegisterType((*Cost)(nil), "appengine.Cost") + proto.RegisterType((*Cost_CommitCost)(nil), "appengine.Cost.CommitCost") + proto.RegisterType((*GetRequest)(nil), "appengine.GetRequest") + proto.RegisterType((*GetResponse)(nil), "appengine.GetResponse") + proto.RegisterType((*GetResponse_Entity)(nil), "appengine.GetResponse.Entity") + proto.RegisterType((*PutRequest)(nil), "appengine.PutRequest") + proto.RegisterType((*PutResponse)(nil), "appengine.PutResponse") + proto.RegisterType((*TouchRequest)(nil), "appengine.TouchRequest") + proto.RegisterType((*TouchResponse)(nil), "appengine.TouchResponse") + proto.RegisterType((*DeleteRequest)(nil), "appengine.DeleteRequest") + proto.RegisterType((*DeleteResponse)(nil), "appengine.DeleteResponse") + proto.RegisterType((*NextRequest)(nil), "appengine.NextRequest") + proto.RegisterType((*QueryResult)(nil), "appengine.QueryResult") + proto.RegisterType((*AllocateIdsRequest)(nil), "appengine.AllocateIdsRequest") + proto.RegisterType((*AllocateIdsResponse)(nil), "appengine.AllocateIdsResponse") + proto.RegisterType((*CompositeIndices)(nil), "appengine.CompositeIndices") + proto.RegisterType((*AddActionsRequest)(nil), "appengine.AddActionsRequest") + proto.RegisterType((*AddActionsResponse)(nil), "appengine.AddActionsResponse") + proto.RegisterType((*BeginTransactionRequest)(nil), "appengine.BeginTransactionRequest") + proto.RegisterType((*CommitResponse)(nil), "appengine.CommitResponse") + proto.RegisterType((*CommitResponse_Version)(nil), "appengine.CommitResponse.Version") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/datastore/datastore_v3.proto", fileDescriptor_datastore_v3_83b17b80c34f6179) +} + +var fileDescriptor_datastore_v3_83b17b80c34f6179 = []byte{ + // 4156 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcd, 0x73, 0xe3, 0x46, + 0x76, 0x37, 0xc1, 0xef, 0x47, 0x89, 0x82, 0x5a, 0xf3, 0xc1, 0xa1, 0x3f, 0x46, 0xc6, 0xac, 0x6d, + 0xd9, 0x6b, 0x73, 0x6c, 0xf9, 0x23, 0x5b, 0x4a, 0x76, 0x1d, 0x4a, 0xc4, 0x68, 0x90, 0xa1, 0x48, + 0xb9, 0x09, 0xd9, 0x9e, 0x5c, 0x50, 0x18, 0xa2, 0x29, 0x21, 0x43, 0x02, 0x30, 0x00, 0x6a, 0x46, + 0x93, 0xe4, 0x90, 0x4b, 0x2a, 0x55, 0x5b, 0xa9, 0x1c, 0x92, 0x4a, 0x25, 0xf9, 0x07, 0x72, 0xc8, + 0x39, 0x95, 0xaa, 0x54, 0xf6, 0x98, 0x5b, 0x0e, 0x7b, 0xc9, 0x31, 0x95, 0x73, 0xf2, 0x27, 0x24, + 0x39, 0xa4, 0xfa, 0x75, 0x03, 0x02, 0x28, 0x4a, 0x23, 0x6d, 0xf6, 0x90, 0x13, 0xd1, 0xef, 0xfd, + 0xba, 0xf1, 0xfa, 0xf5, 0xfb, 0x6c, 0x10, 0xba, 0xc7, 0xbe, 0x7f, 0x3c, 0x65, 0x9d, 0x63, 0x7f, + 0x6a, 0x7b, 0xc7, 0x1d, 0x3f, 0x3c, 0x7e, 0x68, 0x07, 0x01, 0xf3, 0x8e, 0x5d, 0x8f, 0x3d, 0x74, + 0xbd, 0x98, 0x85, 0x9e, 0x3d, 0x7d, 0xe8, 0xd8, 0xb1, 0x1d, 0xc5, 0x7e, 0xc8, 0xce, 0x9f, 0xac, + 0xd3, 0xcf, 0x3b, 0x41, 0xe8, 0xc7, 0x3e, 0xa9, 0xa7, 0x13, 0xb4, 0x1a, 0x54, 0xba, 0xe3, 0xd8, + 0xf5, 0x3d, 0xed, 0x1f, 0x2b, 0xb0, 0x7a, 0x18, 0xfa, 0x01, 0x0b, 0xe3, 0xb3, 0x6f, 0xed, 0xe9, + 0x9c, 0x91, 0x77, 0x00, 0x5c, 0x2f, 0xfe, 0xea, 0x0b, 0x1c, 0xb5, 0x0a, 0x9b, 0x85, 0xad, 0x22, + 0xcd, 0x50, 0x88, 0x06, 0x2b, 0xcf, 0x7c, 0x7f, 0xca, 0x6c, 0x4f, 0x20, 0x94, 0xcd, 0xc2, 0x56, + 0x8d, 0xe6, 0x68, 0x64, 0x13, 0x1a, 0x51, 0x1c, 0xba, 0xde, 0xb1, 0x80, 0x14, 0x37, 0x0b, 0x5b, + 0x75, 0x9a, 0x25, 0x71, 0x84, 0xe3, 0xcf, 0x9f, 0x4d, 0x99, 0x40, 0x94, 0x36, 0x0b, 0x5b, 0x05, + 0x9a, 0x25, 0x91, 0x3d, 0x80, 0xc0, 0x77, 0xbd, 0xf8, 0x14, 0x01, 0xe5, 0xcd, 0xc2, 0x16, 0x6c, + 0x3f, 0xe8, 0xa4, 0x7b, 0xe8, 0xe4, 0xa4, 0xee, 0x1c, 0x72, 0x28, 0x3e, 0xd2, 0xcc, 0x34, 0xf2, + 0xdb, 0x50, 0x9f, 0x47, 0x2c, 0x14, 0x6b, 0xd4, 0x70, 0x0d, 0xed, 0xd2, 0x35, 0x8e, 0x22, 0x16, + 0x8a, 0x25, 0xce, 0x27, 0x91, 0x21, 0x34, 0x43, 0x36, 0x61, 0x21, 0xf3, 0xc6, 0x4c, 0x2c, 0xb3, + 0x82, 0xcb, 0x7c, 0x70, 0xe9, 0x32, 0x34, 0x81, 0x8b, 0xb5, 0x16, 0xa6, 0xb7, 0xb7, 0x00, 0xce, + 0x85, 0x25, 0x2b, 0x50, 0x78, 0xd9, 0xaa, 0x6c, 0x2a, 0x5b, 0x05, 0x5a, 0x78, 0xc9, 0x47, 0x67, + 0xad, 0xaa, 0x18, 0x9d, 0xb5, 0xff, 0xa9, 0x00, 0xf5, 0x54, 0x26, 0x72, 0x0b, 0xca, 0x6c, 0x66, + 0xbb, 0xd3, 0x56, 0x7d, 0x53, 0xd9, 0xaa, 0x53, 0x31, 0x20, 0xf7, 0xa1, 0x61, 0xcf, 0xe3, 0x13, + 0xcb, 0xf1, 0x67, 0xb6, 0xeb, 0xb5, 0x00, 0x79, 0xc0, 0x49, 0x3d, 0xa4, 0x90, 0x36, 0xd4, 0x3c, + 0x77, 0xfc, 0xdc, 0xb3, 0x67, 0xac, 0xd5, 0xc0, 0x73, 0x48, 0xc7, 0xe4, 0x13, 0x20, 0x13, 0xe6, + 0xb0, 0xd0, 0x8e, 0x99, 0x63, 0xb9, 0x0e, 0xf3, 0x62, 0x37, 0x3e, 0x6b, 0xdd, 0x46, 0xd4, 0x7a, + 0xca, 0x31, 0x24, 0x23, 0x0f, 0x0f, 0x42, 0xff, 0xd4, 0x75, 0x58, 0xd8, 0xba, 0xb3, 0x00, 0x3f, + 0x94, 0x8c, 0xf6, 0xbf, 0x17, 0xa0, 0x99, 0xd7, 0x05, 0x51, 0xa1, 0x68, 0x07, 0x41, 0x6b, 0x15, + 0xa5, 0xe4, 0x8f, 0xe4, 0x6d, 0x00, 0x2e, 0x8a, 0x15, 0x05, 0xf6, 0x98, 0xb5, 0x6e, 0xe1, 0x5a, + 0x75, 0x4e, 0x19, 0x71, 0x02, 0x39, 0x82, 0x46, 0x60, 0xc7, 0x27, 0x6c, 0xca, 0x66, 0xcc, 0x8b, + 0x5b, 0xcd, 0xcd, 0xe2, 0x16, 0x6c, 0x7f, 0x7e, 0x4d, 0xd5, 0x77, 0x0e, 0xed, 0xf8, 0x44, 0x17, + 0x53, 0x69, 0x76, 0x9d, 0xb6, 0x0e, 0x8d, 0x0c, 0x8f, 0x10, 0x28, 0xc5, 0x67, 0x01, 0x6b, 0xad, + 0xa1, 0x5c, 0xf8, 0x4c, 0x9a, 0xa0, 0xb8, 0x4e, 0x4b, 0x45, 0xf3, 0x57, 0x5c, 0x87, 0x63, 0x50, + 0x87, 0xeb, 0x28, 0x22, 0x3e, 0x6b, 0xff, 0x51, 0x86, 0x5a, 0x22, 0x00, 0xe9, 0x42, 0x75, 0xc6, + 0x6c, 0xcf, 0xf5, 0x8e, 0xd1, 0x69, 0x9a, 0xdb, 0x6f, 0x2e, 0x11, 0xb3, 0x73, 0x20, 0x20, 0x3b, + 0x30, 0x18, 0x5a, 0x07, 0x7a, 0x77, 0x60, 0x0c, 0xf6, 0x69, 0x32, 0x8f, 0x1f, 0xa6, 0x7c, 0xb4, + 0xe6, 0xa1, 0x8b, 0x9e, 0x55, 0xa7, 0x20, 0x49, 0x47, 0xa1, 0x9b, 0x0a, 0x51, 0x14, 0x82, 0xe2, + 0x21, 0x76, 0xa0, 0x9c, 0xb8, 0x88, 0xb2, 0xd5, 0xd8, 0x6e, 0x5d, 0xa6, 0x1c, 0x2a, 0x60, 0xdc, + 0x20, 0x66, 0xf3, 0x69, 0xec, 0x06, 0x53, 0xee, 0x76, 0xca, 0x56, 0x8d, 0xa6, 0x63, 0xf2, 0x1e, + 0x40, 0xc4, 0xec, 0x70, 0x7c, 0x62, 0x3f, 0x9b, 0xb2, 0x56, 0x85, 0x7b, 0xf6, 0x4e, 0x79, 0x62, + 0x4f, 0x23, 0x46, 0x33, 0x0c, 0x62, 0xc3, 0xdd, 0x49, 0x1c, 0x59, 0xb1, 0xff, 0x9c, 0x79, 0xee, + 0x2b, 0x9b, 0x07, 0x12, 0xcb, 0x0f, 0xf8, 0x0f, 0xfa, 0x58, 0x73, 0xfb, 0xc3, 0x65, 0x5b, 0x7f, + 0x14, 0x47, 0x66, 0x66, 0xc6, 0x10, 0x27, 0xd0, 0xdb, 0x93, 0x65, 0x64, 0xd2, 0x86, 0xca, 0xd4, + 0x1f, 0xdb, 0x53, 0xd6, 0xaa, 0x73, 0x2d, 0xec, 0x28, 0xcc, 0xa3, 0x92, 0xa2, 0xfd, 0xb3, 0x02, + 0x55, 0xa9, 0x47, 0xd2, 0x84, 0x8c, 0x26, 0xd5, 0x37, 0x48, 0x0d, 0x4a, 0xbb, 0xfd, 0xe1, 0xae, + 0xda, 0xe4, 0x4f, 0xa6, 0xfe, 0xbd, 0xa9, 0xae, 0x71, 0xcc, 0xee, 0x53, 0x53, 0x1f, 0x99, 0x94, + 0x63, 0x54, 0xb2, 0x0e, 0xab, 0x5d, 0x73, 0x78, 0x60, 0xed, 0x75, 0x4d, 0x7d, 0x7f, 0x48, 0x9f, + 0xaa, 0x05, 0xb2, 0x0a, 0x75, 0x24, 0xf5, 0x8d, 0xc1, 0x13, 0x55, 0xe1, 0x33, 0x70, 0x68, 0x1a, + 0x66, 0x5f, 0x57, 0x8b, 0x44, 0x85, 0x15, 0x31, 0x63, 0x38, 0x30, 0xf5, 0x81, 0xa9, 0x96, 0x52, + 0xca, 0xe8, 0xe8, 0xe0, 0xa0, 0x4b, 0x9f, 0xaa, 0x65, 0xb2, 0x06, 0x0d, 0xa4, 0x74, 0x8f, 0xcc, + 0xc7, 0x43, 0xaa, 0x56, 0x48, 0x03, 0xaa, 0xfb, 0x3d, 0xeb, 0xbb, 0xc7, 0xfa, 0x40, 0xad, 0x92, + 0x15, 0xa8, 0xed, 0xf7, 0x2c, 0xfd, 0xa0, 0x6b, 0xf4, 0xd5, 0x1a, 0x9f, 0xbd, 0xaf, 0x0f, 0xe9, + 0x68, 0x64, 0x1d, 0x0e, 0x8d, 0x81, 0xa9, 0xd6, 0x49, 0x1d, 0xca, 0xfb, 0x3d, 0xcb, 0x38, 0x50, + 0x81, 0x10, 0x68, 0xee, 0xf7, 0xac, 0xc3, 0xc7, 0xc3, 0x81, 0x3e, 0x38, 0x3a, 0xd8, 0xd5, 0xa9, + 0xda, 0x20, 0xb7, 0x40, 0xe5, 0xb4, 0xe1, 0xc8, 0xec, 0xf6, 0xbb, 0xbd, 0x1e, 0xd5, 0x47, 0x23, + 0x75, 0x85, 0x4b, 0xbd, 0xdf, 0xb3, 0x68, 0xd7, 0xe4, 0xfb, 0x5a, 0xe5, 0x2f, 0xe4, 0x7b, 0x7f, + 0xa2, 0x3f, 0x55, 0xd7, 0xf9, 0x2b, 0xf4, 0x81, 0x69, 0x98, 0x4f, 0xad, 0x43, 0x3a, 0x34, 0x87, + 0xea, 0x06, 0x17, 0xd0, 0x18, 0xf4, 0xf4, 0xef, 0xad, 0x6f, 0xbb, 0xfd, 0x23, 0x5d, 0x25, 0xda, + 0x8f, 0xe1, 0xf6, 0xd2, 0x33, 0xe1, 0xaa, 0x7b, 0x6c, 0x1e, 0xf4, 0xd5, 0x02, 0x7f, 0xe2, 0x9b, + 0x52, 0x15, 0xed, 0x0f, 0xa0, 0xc4, 0x5d, 0x86, 0x7c, 0x06, 0xd5, 0xc4, 0x1b, 0x0b, 0xe8, 0x8d, + 0x77, 0xb3, 0x67, 0x6d, 0xc7, 0x27, 0x9d, 0xc4, 0xe3, 0x12, 0x5c, 0xbb, 0x0b, 0xd5, 0x45, 0x4f, + 0x53, 0x2e, 0x78, 0x5a, 0xf1, 0x82, 0xa7, 0x95, 0x32, 0x9e, 0x66, 0x43, 0x3d, 0xf5, 0xed, 0x9b, + 0x47, 0x91, 0x07, 0x50, 0xe2, 0xde, 0xdf, 0x6a, 0xa2, 0x87, 0xac, 0x2d, 0x08, 0x4c, 0x91, 0xa9, + 0xfd, 0x43, 0x01, 0x4a, 0x3c, 0xda, 0x9e, 0x07, 0xda, 0xc2, 0x15, 0x81, 0x56, 0xb9, 0x32, 0xd0, + 0x16, 0xaf, 0x15, 0x68, 0x2b, 0x37, 0x0b, 0xb4, 0xd5, 0x4b, 0x02, 0xad, 0xf6, 0x67, 0x45, 0x68, + 0xe8, 0x38, 0xf3, 0x10, 0x13, 0xfd, 0xfb, 0x50, 0x7c, 0xce, 0xce, 0x50, 0x3f, 0x8d, 0xed, 0x5b, + 0x99, 0xdd, 0xa6, 0x2a, 0xa4, 0x1c, 0x40, 0xb6, 0x61, 0x45, 0xbc, 0xd0, 0x3a, 0x0e, 0xfd, 0x79, + 0xd0, 0x52, 0x97, 0xab, 0xa7, 0x21, 0x40, 0xfb, 0x1c, 0x43, 0xde, 0x83, 0xb2, 0xff, 0xc2, 0x63, + 0x21, 0xc6, 0xc1, 0x3c, 0x98, 0x2b, 0x8f, 0x0a, 0x2e, 0x79, 0x08, 0xa5, 0xe7, 0xae, 0xe7, 0xe0, + 0x19, 0xe6, 0x23, 0x61, 0x46, 0xd0, 0xce, 0x13, 0xd7, 0x73, 0x28, 0x02, 0xc9, 0x3d, 0xa8, 0xf1, + 0x5f, 0x8c, 0x7b, 0x65, 0xdc, 0x68, 0x95, 0x8f, 0x79, 0xd0, 0x7b, 0x08, 0xb5, 0x40, 0xc6, 0x10, + 0x4c, 0x00, 0x8d, 0xed, 0x8d, 0x25, 0xe1, 0x85, 0xa6, 0x20, 0xf2, 0x15, 0xac, 0x84, 0xf6, 0x0b, + 0x2b, 0x9d, 0xb4, 0x76, 0xf9, 0xa4, 0x46, 0x68, 0xbf, 0x48, 0x23, 0x38, 0x81, 0x52, 0x68, 0x7b, + 0xcf, 0x5b, 0x64, 0xb3, 0xb0, 0x55, 0xa6, 0xf8, 0xac, 0x7d, 0x01, 0x25, 0x2e, 0x25, 0x8f, 0x08, + 0xfb, 0x3d, 0xf4, 0xff, 0xee, 0x9e, 0xa9, 0x16, 0x12, 0x7f, 0xfe, 0x96, 0x47, 0x03, 0x45, 0x72, + 0x0f, 0xf4, 0xd1, 0xa8, 0xbb, 0xaf, 0xab, 0x45, 0xad, 0x07, 0xeb, 0x7b, 0xfe, 0x2c, 0xf0, 0x23, + 0x37, 0x66, 0xe9, 0xf2, 0xf7, 0xa0, 0xe6, 0x7a, 0x0e, 0x7b, 0x69, 0xb9, 0x0e, 0x9a, 0x56, 0x91, + 0x56, 0x71, 0x6c, 0x38, 0xdc, 0xe4, 0x4e, 0x65, 0x31, 0x55, 0xe4, 0x26, 0x87, 0x03, 0xed, 0x2f, + 0x15, 0x28, 0x1b, 0x1c, 0xc1, 0x8d, 0x4f, 0x9e, 0x14, 0x7a, 0x8f, 0x30, 0x4c, 0x10, 0x24, 0x93, + 0xfb, 0x50, 0x1b, 0x6a, 0xb6, 0x37, 0x66, 0xbc, 0xe2, 0xc3, 0x3c, 0x50, 0xa3, 0xe9, 0x98, 0x7c, + 0x99, 0xd1, 0x9f, 0x82, 0x2e, 0x7b, 0x2f, 0xa3, 0x0a, 0x7c, 0xc1, 0x12, 0x2d, 0xb6, 0xff, 0xaa, + 0x90, 0x49, 0x6e, 0xcb, 0x12, 0x4f, 0x1f, 0xea, 0x8e, 0x1b, 0x32, 0xac, 0x23, 0xe5, 0x41, 0x3f, + 0xb8, 0x74, 0xe1, 0x4e, 0x2f, 0x81, 0xee, 0xd4, 0xbb, 0xa3, 0x3d, 0x7d, 0xd0, 0xe3, 0x99, 0xef, + 0x7c, 0x01, 0xed, 0x23, 0xa8, 0xa7, 0x10, 0x0c, 0xc7, 0x09, 0x48, 0x2d, 0x70, 0xf5, 0xf6, 0xf4, + 0x74, 0xac, 0x68, 0x7f, 0xad, 0x40, 0x33, 0xd5, 0xaf, 0xd0, 0xd0, 0x6d, 0xa8, 0xd8, 0x41, 0x90, + 0xa8, 0xb6, 0x4e, 0xcb, 0x76, 0x10, 0x18, 0x8e, 0x8c, 0x2d, 0x0a, 0x6a, 0x9b, 0xc7, 0x96, 0x4f, + 0x01, 0x1c, 0x36, 0x71, 0x3d, 0x17, 0x85, 0x2e, 0xa2, 0xc1, 0xab, 0x8b, 0x42, 0xd3, 0x0c, 0x86, + 0x7c, 0x09, 0xe5, 0x28, 0xb6, 0x63, 0x91, 0x2b, 0x9b, 0xdb, 0xf7, 0x33, 0xe0, 0xbc, 0x08, 0x9d, + 0x11, 0x87, 0x51, 0x81, 0x26, 0x5f, 0xc1, 0x2d, 0xdf, 0x9b, 0x9e, 0x59, 0xf3, 0x88, 0x59, 0xee, + 0xc4, 0x0a, 0xd9, 0x0f, 0x73, 0x37, 0x64, 0x4e, 0x3e, 0xa7, 0xae, 0x73, 0xc8, 0x51, 0xc4, 0x8c, + 0x09, 0x95, 0x7c, 0xed, 0x6b, 0x28, 0xe3, 0x3a, 0x7c, 0xcf, 0xdf, 0x51, 0xc3, 0xd4, 0xad, 0xe1, + 0xa0, 0xff, 0x54, 0xe8, 0x80, 0xea, 0xdd, 0x9e, 0x85, 0x44, 0x55, 0xe1, 0xc1, 0xbe, 0xa7, 0xf7, + 0x75, 0x53, 0xef, 0xa9, 0x45, 0x9e, 0x3d, 0x74, 0x4a, 0x87, 0x54, 0x2d, 0x69, 0xff, 0x53, 0x80, + 0x15, 0x94, 0xe7, 0xd0, 0x8f, 0xe2, 0x89, 0xfb, 0x92, 0xec, 0x41, 0x43, 0x98, 0xdd, 0xa9, 0x2c, + 0xe8, 0xb9, 0x33, 0x68, 0x8b, 0x7b, 0x96, 0x68, 0x31, 0x90, 0x75, 0xb4, 0x9b, 0x3e, 0x27, 0x21, + 0x45, 0x41, 0xa7, 0xbf, 0x22, 0xa4, 0xbc, 0x05, 0x95, 0x67, 0x6c, 0xe2, 0x87, 0x22, 0x04, 0xd6, + 0x76, 0x4a, 0x71, 0x38, 0x67, 0x54, 0xd2, 0xda, 0x36, 0xc0, 0xf9, 0xfa, 0xe4, 0x01, 0xac, 0x26, + 0xc6, 0x66, 0xa1, 0x71, 0x89, 0x93, 0x5b, 0x49, 0x88, 0x83, 0x5c, 0x75, 0xa3, 0x5c, 0xab, 0xba, + 0xd1, 0xbe, 0x86, 0xd5, 0x64, 0x3f, 0xe2, 0xfc, 0x54, 0x21, 0x79, 0x01, 0x63, 0xca, 0x82, 0x8c, + 0xca, 0x45, 0x19, 0xb5, 0x9f, 0x41, 0x6d, 0xe4, 0xd9, 0x41, 0x74, 0xe2, 0xc7, 0xdc, 0x7a, 0xe2, + 0x48, 0xfa, 0xaa, 0x12, 0x47, 0x9a, 0x06, 0x15, 0x7e, 0x38, 0xf3, 0x88, 0xbb, 0xbf, 0x31, 0xe8, + 0xee, 0x99, 0xc6, 0xb7, 0xba, 0xfa, 0x06, 0x01, 0xa8, 0xc8, 0xe7, 0x82, 0xa6, 0x41, 0xd3, 0x90, + 0xed, 0xd8, 0x63, 0x66, 0x3b, 0x2c, 0xe4, 0x12, 0xfc, 0xe0, 0x47, 0x89, 0x04, 0x3f, 0xf8, 0x91, + 0xf6, 0x17, 0x05, 0x68, 0x98, 0xa1, 0xed, 0x45, 0xb6, 0x30, 0xf7, 0xcf, 0xa0, 0x72, 0x82, 0x58, + 0x74, 0xa3, 0xc6, 0x82, 0x7f, 0x66, 0x17, 0xa3, 0x12, 0x48, 0xee, 0x40, 0xe5, 0xc4, 0xf6, 0x9c, + 0xa9, 0xd0, 0x5a, 0x85, 0xca, 0x51, 0x92, 0x1b, 0x95, 0xf3, 0xdc, 0xb8, 0x05, 0x2b, 0x33, 0x3b, + 0x7c, 0x6e, 0x8d, 0x4f, 0x6c, 0xef, 0x98, 0x45, 0xf2, 0x60, 0xa4, 0x05, 0x36, 0x38, 0x6b, 0x4f, + 0x70, 0xb4, 0xbf, 0x5f, 0x81, 0xf2, 0x37, 0x73, 0x16, 0x9e, 0x65, 0x04, 0xfa, 0xe0, 0xba, 0x02, + 0xc9, 0x17, 0x17, 0x2e, 0x4b, 0xca, 0x6f, 0x2f, 0x26, 0x65, 0x22, 0x53, 0x84, 0xc8, 0x95, 0x22, + 0x0b, 0x7c, 0x9a, 0x09, 0x63, 0xeb, 0x57, 0xd8, 0xda, 0x79, 0x70, 0x7b, 0x08, 0x95, 0x89, 0x3b, + 0x8d, 0x51, 0x75, 0x8b, 0xd5, 0x08, 0xee, 0xa5, 0xf3, 0x08, 0xd9, 0x54, 0xc2, 0xc8, 0xbb, 0xb0, + 0x22, 0x2a, 0x59, 0xeb, 0x07, 0xce, 0xc6, 0x82, 0x95, 0xf7, 0xa6, 0x48, 0x13, 0xbb, 0xff, 0x18, + 0xca, 0x7e, 0xc8, 0x37, 0x5f, 0xc7, 0x25, 0xef, 0x5c, 0x58, 0x72, 0xc8, 0xb9, 0x54, 0x80, 0xc8, + 0x87, 0x50, 0x3a, 0x71, 0xbd, 0x18, 0xb3, 0x46, 0x73, 0xfb, 0xf6, 0x05, 0xf0, 0x63, 0xd7, 0x8b, + 0x29, 0x42, 0x78, 0x98, 0x1f, 0xfb, 0x73, 0x2f, 0x6e, 0xdd, 0xc5, 0x0c, 0x23, 0x06, 0xe4, 0x1e, + 0x54, 0xfc, 0xc9, 0x24, 0x62, 0x31, 0x76, 0x96, 0xe5, 0x9d, 0xc2, 0xa7, 0x54, 0x12, 0xf8, 0x84, + 0xa9, 0x3b, 0x73, 0x63, 0xec, 0x43, 0xca, 0x54, 0x0c, 0xc8, 0x2e, 0xac, 0x8d, 0xfd, 0x59, 0xe0, + 0x4e, 0x99, 0x63, 0x8d, 0xe7, 0x61, 0xe4, 0x87, 0xad, 0x77, 0x2e, 0x1c, 0xd3, 0x9e, 0x44, 0xec, + 0x21, 0x80, 0x36, 0xc7, 0xb9, 0x31, 0x31, 0x60, 0x83, 0x79, 0x8e, 0xb5, 0xb8, 0xce, 0xfd, 0xd7, + 0xad, 0xb3, 0xce, 0x3c, 0x27, 0x4f, 0x4a, 0xc4, 0xc1, 0x48, 0x68, 0x61, 0xcc, 0x68, 0x6d, 0x60, + 0x90, 0xb9, 0x77, 0x69, 0xac, 0x14, 0xe2, 0x64, 0xc2, 0xf7, 0x6f, 0xc0, 0x2d, 0x19, 0x22, 0xad, + 0x80, 0x85, 0x13, 0x36, 0x8e, 0xad, 0x60, 0x6a, 0x7b, 0x58, 0xca, 0xa5, 0xc6, 0x4a, 0x24, 0xe4, + 0x50, 0x20, 0x0e, 0xa7, 0xb6, 0x47, 0x34, 0xa8, 0x3f, 0x67, 0x67, 0x91, 0xc5, 0x23, 0x29, 0x76, + 0xae, 0x29, 0xba, 0xc6, 0xe9, 0x43, 0x6f, 0x7a, 0x46, 0x7e, 0x02, 0x8d, 0xf8, 0xdc, 0xdb, 0xb0, + 0x61, 0x6d, 0xe4, 0x4e, 0x35, 0xe3, 0x8b, 0x34, 0x0b, 0x25, 0xf7, 0xa1, 0x2a, 0x35, 0xd4, 0xba, + 0x97, 0x5d, 0x3b, 0xa1, 0xf2, 0xc4, 0x3c, 0xb1, 0xdd, 0xa9, 0x7f, 0xca, 0x42, 0x6b, 0x16, 0xb5, + 0xda, 0xe2, 0xb6, 0x24, 0x21, 0x1d, 0x44, 0xdc, 0x4f, 0xa3, 0x38, 0xf4, 0xbd, 0xe3, 0xd6, 0x26, + 0xde, 0x93, 0xc8, 0xd1, 0xc5, 0xe0, 0xf7, 0x2e, 0x66, 0xfe, 0x7c, 0xf0, 0xfb, 0x1c, 0xee, 0x60, + 0x65, 0x66, 0x3d, 0x3b, 0xb3, 0xf2, 0x68, 0x0d, 0xd1, 0x1b, 0xc8, 0xdd, 0x3d, 0x3b, 0xcc, 0x4e, + 0x6a, 0x43, 0xcd, 0x71, 0xa3, 0xd8, 0xf5, 0xc6, 0x71, 0xab, 0x85, 0xef, 0x4c, 0xc7, 0xe4, 0x33, + 0xb8, 0x3d, 0x73, 0x3d, 0x2b, 0xb2, 0x27, 0xcc, 0x8a, 0x5d, 0xee, 0x9b, 0x6c, 0xec, 0x7b, 0x4e, + 0xd4, 0x7a, 0x80, 0x82, 0x93, 0x99, 0xeb, 0x8d, 0xec, 0x09, 0x33, 0xdd, 0x19, 0x1b, 0x09, 0x0e, + 0xf9, 0x08, 0xd6, 0x11, 0x1e, 0xb2, 0x60, 0xea, 0x8e, 0x6d, 0xf1, 0xfa, 0x1f, 0xe1, 0xeb, 0xd7, + 0x38, 0x83, 0x0a, 0x3a, 0xbe, 0xfa, 0x63, 0x68, 0x06, 0x2c, 0x8c, 0xdc, 0x28, 0xb6, 0xa4, 0x45, + 0xbf, 0x97, 0xd5, 0xda, 0xaa, 0x64, 0x0e, 0x91, 0xd7, 0xfe, 0xcf, 0x02, 0x54, 0x84, 0x73, 0x92, + 0x4f, 0x41, 0xf1, 0x03, 0xbc, 0x06, 0x69, 0x6e, 0x6f, 0x5e, 0xe2, 0xc1, 0x9d, 0x61, 0xc0, 0xeb, + 0x5e, 0x3f, 0xa4, 0x8a, 0x1f, 0xdc, 0xb8, 0x28, 0xd4, 0xfe, 0x10, 0x6a, 0xc9, 0x02, 0xbc, 0xbc, + 0xe8, 0xeb, 0xa3, 0x91, 0x65, 0x3e, 0xee, 0x0e, 0xd4, 0x02, 0xb9, 0x03, 0x24, 0x1d, 0x5a, 0x43, + 0x6a, 0xe9, 0xdf, 0x1c, 0x75, 0xfb, 0xaa, 0x82, 0x5d, 0x1a, 0xd5, 0xbb, 0xa6, 0x4e, 0x05, 0xb2, + 0x48, 0xee, 0xc1, 0xed, 0x2c, 0xe5, 0x1c, 0x5c, 0xc2, 0x14, 0x8c, 0x8f, 0x65, 0x52, 0x01, 0xc5, + 0x18, 0xa8, 0x15, 0x9e, 0x16, 0xf4, 0xef, 0x8d, 0x91, 0x39, 0x52, 0xab, 0xed, 0xbf, 0x29, 0x40, + 0x19, 0xc3, 0x06, 0x3f, 0x9f, 0x54, 0x72, 0x71, 0x5d, 0x73, 0x5e, 0xb9, 0x1a, 0xd9, 0x92, 0xaa, + 0x81, 0x01, 0x65, 0x73, 0x79, 0xf4, 0xf9, 0xb5, 0xd6, 0x53, 0x3f, 0x85, 0x12, 0x8f, 0x52, 0xbc, + 0x43, 0x1c, 0xd2, 0x9e, 0x4e, 0xad, 0x47, 0x06, 0x1d, 0xf1, 0x2a, 0x97, 0x40, 0xb3, 0x3b, 0xd8, + 0xd3, 0x47, 0xe6, 0x30, 0xa1, 0xa1, 0x56, 0x1e, 0x19, 0x7d, 0x33, 0x45, 0x15, 0xb5, 0x9f, 0xd7, + 0x60, 0x35, 0x89, 0x09, 0x22, 0x82, 0x3e, 0x82, 0x46, 0x10, 0xba, 0x33, 0x3b, 0x3c, 0x8b, 0xc6, + 0xb6, 0x87, 0x49, 0x01, 0xb6, 0x7f, 0xb4, 0x24, 0xaa, 0x88, 0x1d, 0x1d, 0x0a, 0xec, 0x68, 0x6c, + 0x7b, 0x34, 0x3b, 0x91, 0xf4, 0x61, 0x75, 0xc6, 0xc2, 0x63, 0xf6, 0x7b, 0xbe, 0xeb, 0xe1, 0x4a, + 0x55, 0x8c, 0xc8, 0xef, 0x5f, 0xba, 0xd2, 0x01, 0x47, 0xff, 0x8e, 0xef, 0x7a, 0xb8, 0x56, 0x7e, + 0x32, 0xf9, 0x04, 0xea, 0xa2, 0x12, 0x72, 0xd8, 0x04, 0x63, 0xc5, 0xb2, 0xda, 0x4f, 0xd4, 0xe8, + 0x3d, 0x36, 0xc9, 0xc4, 0x65, 0xb8, 0x34, 0x2e, 0x37, 0xb2, 0x71, 0xf9, 0xcd, 0x6c, 0x2c, 0x5a, + 0x11, 0x55, 0x78, 0x1a, 0x84, 0x2e, 0x38, 0x7c, 0x6b, 0x89, 0xc3, 0x77, 0x60, 0x23, 0xf1, 0x55, + 0xcb, 0xf5, 0x26, 0xee, 0x4b, 0x2b, 0x72, 0x5f, 0x89, 0xd8, 0x53, 0xa6, 0xeb, 0x09, 0xcb, 0xe0, + 0x9c, 0x91, 0xfb, 0x8a, 0x11, 0x23, 0xe9, 0xe0, 0x64, 0x0e, 0x5c, 0xc5, 0xab, 0xc9, 0xf7, 0x2e, + 0x55, 0x8f, 0x68, 0xbe, 0x64, 0x46, 0xcc, 0x4d, 0x6d, 0xff, 0x52, 0x81, 0x46, 0xe6, 0x1c, 0x78, + 0xf6, 0x16, 0xca, 0x42, 0x61, 0xc5, 0x55, 0x94, 0x50, 0x1f, 0x4a, 0xfa, 0x26, 0xd4, 0xa3, 0xd8, + 0x0e, 0x63, 0x8b, 0x17, 0x57, 0xb2, 0xdd, 0x45, 0xc2, 0x13, 0x76, 0x46, 0x3e, 0x80, 0x35, 0xc1, + 0x74, 0xbd, 0xf1, 0x74, 0x1e, 0xb9, 0xa7, 0xa2, 0x99, 0xaf, 0xd1, 0x26, 0x92, 0x8d, 0x84, 0x4a, + 0xee, 0x42, 0x95, 0x67, 0x21, 0xbe, 0x86, 0x68, 0xfa, 0x2a, 0xcc, 0x73, 0xf8, 0x0a, 0x0f, 0x60, + 0x95, 0x33, 0xce, 0xe7, 0x57, 0xc4, 0x2d, 0x33, 0xf3, 0x9c, 0xf3, 0xd9, 0x1d, 0xd8, 0x10, 0xaf, + 0x09, 0x44, 0xf1, 0x2a, 0x2b, 0xdc, 0x3b, 0xa8, 0xd8, 0x75, 0x64, 0xc9, 0xb2, 0x56, 0x14, 0x9c, + 0x1f, 0x01, 0xcf, 0x5e, 0x0b, 0xe8, 0xbb, 0x22, 0x94, 0x31, 0xcf, 0xc9, 0x61, 0x77, 0xe1, 0x1d, + 0x8e, 0x9d, 0x7b, 0x76, 0x10, 0x4c, 0x5d, 0xe6, 0x58, 0x53, 0xff, 0x18, 0x43, 0x66, 0x14, 0xdb, + 0xb3, 0xc0, 0x9a, 0x47, 0xad, 0x0d, 0x0c, 0x99, 0x6d, 0xe6, 0x39, 0x47, 0x09, 0xa8, 0xef, 0x1f, + 0x9b, 0x09, 0xe4, 0x28, 0x6a, 0xff, 0x3e, 0xac, 0xe6, 0xec, 0x71, 0x41, 0xa7, 0x35, 0x74, 0xfe, + 0x8c, 0x4e, 0xdf, 0x85, 0x95, 0x20, 0x64, 0xe7, 0xa2, 0xd5, 0x51, 0xb4, 0x86, 0xa0, 0x09, 0xb1, + 0xb6, 0x60, 0x05, 0x79, 0x96, 0x20, 0xe6, 0xf3, 0x63, 0x03, 0x59, 0x87, 0xc8, 0x69, 0xbf, 0x80, + 0x95, 0xec, 0x69, 0x93, 0x77, 0x33, 0x69, 0xa1, 0x99, 0xcb, 0x93, 0x69, 0x76, 0x48, 0x2a, 0xb2, + 0xf5, 0x4b, 0x2a, 0x32, 0x72, 0x9d, 0x8a, 0x4c, 0xfb, 0x2f, 0xd9, 0x9c, 0x65, 0x2a, 0x84, 0x9f, + 0x41, 0x2d, 0x90, 0xf5, 0x38, 0x5a, 0x52, 0xfe, 0x12, 0x3e, 0x0f, 0xee, 0x24, 0x95, 0x3b, 0x4d, + 0xe7, 0xb4, 0xff, 0x56, 0x81, 0x5a, 0x5a, 0xd0, 0xe7, 0x2c, 0xef, 0xcd, 0x05, 0xcb, 0x3b, 0x90, + 0x1a, 0x16, 0x0a, 0x7c, 0x1b, 0xa3, 0xc5, 0x27, 0xaf, 0x7f, 0xd7, 0xc5, 0xb6, 0xe7, 0x34, 0xdb, + 0xf6, 0x6c, 0xbe, 0xae, 0xed, 0xf9, 0xe4, 0xa2, 0xc1, 0xbf, 0x95, 0xe9, 0x2d, 0x16, 0xcc, 0xbe, + 0xfd, 0x7d, 0xae, 0x0f, 0xca, 0x26, 0x84, 0x77, 0xc4, 0x7e, 0xd2, 0x84, 0x90, 0xb6, 0x3f, 0xf7, + 0xaf, 0xd7, 0xfe, 0x6c, 0x43, 0x45, 0xea, 0xfc, 0x0e, 0x54, 0x64, 0x4d, 0x27, 0x1b, 0x04, 0x31, + 0x3a, 0x6f, 0x10, 0x0a, 0xb2, 0x4e, 0xd7, 0x7e, 0xae, 0x40, 0x59, 0x0f, 0x43, 0x3f, 0xd4, 0xfe, + 0x48, 0x81, 0x3a, 0x3e, 0xed, 0xf9, 0x0e, 0xe3, 0xd9, 0x60, 0xb7, 0xdb, 0xb3, 0xa8, 0xfe, 0xcd, + 0x91, 0x8e, 0xd9, 0xa0, 0x0d, 0x77, 0xf6, 0x86, 0x83, 0xbd, 0x23, 0x4a, 0xf5, 0x81, 0x69, 0x99, + 0xb4, 0x3b, 0x18, 0xf1, 0xb6, 0x67, 0x38, 0x50, 0x15, 0x9e, 0x29, 0x8c, 0x81, 0xa9, 0xd3, 0x41, + 0xb7, 0x6f, 0x89, 0x56, 0xb4, 0x88, 0x77, 0xb3, 0xba, 0xde, 0xb3, 0xf0, 0xd6, 0x51, 0x2d, 0xf1, + 0x96, 0xd5, 0x34, 0x0e, 0xf4, 0xe1, 0x91, 0xa9, 0x96, 0xc9, 0x6d, 0x58, 0x3f, 0xd4, 0xe9, 0x81, + 0x31, 0x1a, 0x19, 0xc3, 0x81, 0xd5, 0xd3, 0x07, 0x86, 0xde, 0x53, 0x2b, 0x7c, 0x9d, 0x5d, 0x63, + 0xdf, 0xec, 0xee, 0xf6, 0x75, 0xb9, 0x4e, 0x95, 0x6c, 0xc2, 0x5b, 0x7b, 0xc3, 0x83, 0x03, 0xc3, + 0x34, 0xf5, 0x9e, 0xb5, 0x7b, 0x64, 0x5a, 0x23, 0xd3, 0xe8, 0xf7, 0xad, 0xee, 0xe1, 0x61, 0xff, + 0x29, 0x4f, 0x60, 0x35, 0x72, 0x17, 0x36, 0xf6, 0xba, 0x87, 0xdd, 0x5d, 0xa3, 0x6f, 0x98, 0x4f, + 0xad, 0x9e, 0x31, 0xe2, 0xf3, 0x7b, 0x6a, 0x9d, 0x27, 0x6c, 0x93, 0x3e, 0xb5, 0xba, 0x7d, 0x14, + 0xcd, 0xd4, 0xad, 0xdd, 0xee, 0xde, 0x13, 0x7d, 0xd0, 0x53, 0x81, 0x0b, 0x30, 0xea, 0x3e, 0xd2, + 0x2d, 0x2e, 0x92, 0x65, 0x0e, 0x87, 0xd6, 0xb0, 0xdf, 0x53, 0x1b, 0xda, 0xbf, 0x14, 0xa1, 0xb4, + 0xe7, 0x47, 0x31, 0xf7, 0x46, 0xe1, 0xac, 0x2f, 0x42, 0x37, 0x66, 0xa2, 0x7f, 0x2b, 0x53, 0xd1, + 0x4b, 0x7f, 0x87, 0x24, 0x1e, 0x50, 0x32, 0x10, 0xeb, 0xd9, 0x19, 0xc7, 0x29, 0x88, 0x5b, 0x3b, + 0xc7, 0xed, 0x72, 0xb2, 0x88, 0x68, 0x78, 0x85, 0x23, 0xd7, 0x2b, 0x22, 0x4e, 0x06, 0x61, 0xb9, + 0xe0, 0xc7, 0x40, 0xb2, 0x20, 0xb9, 0x62, 0x09, 0x91, 0x6a, 0x06, 0x29, 0x96, 0xdc, 0x01, 0x18, + 0xfb, 0xb3, 0x99, 0x1b, 0x8f, 0xfd, 0x28, 0x96, 0x5f, 0xc8, 0xda, 0x39, 0x63, 0x8f, 0x62, 0x6e, + 0xf1, 0x33, 0x37, 0xe6, 0x8f, 0x34, 0x83, 0x26, 0x3b, 0x70, 0xcf, 0x0e, 0x82, 0xd0, 0x7f, 0xe9, + 0xce, 0xec, 0x98, 0x59, 0xdc, 0x73, 0xed, 0x63, 0x66, 0x39, 0x6c, 0x1a, 0xdb, 0xd8, 0x13, 0x95, + 0xe9, 0xdd, 0x0c, 0x60, 0x24, 0xf8, 0x3d, 0xce, 0xe6, 0x71, 0xd7, 0x75, 0xac, 0x88, 0xfd, 0x30, + 0xe7, 0x1e, 0x60, 0xcd, 0x03, 0xc7, 0xe6, 0x62, 0xd6, 0x45, 0x96, 0x72, 0x9d, 0x91, 0xe4, 0x1c, + 0x09, 0x46, 0xfb, 0x15, 0xc0, 0xb9, 0x14, 0x64, 0x1b, 0x6e, 0xf3, 0x3a, 0x9e, 0x45, 0x31, 0x73, + 0x2c, 0xb9, 0xdb, 0x60, 0x1e, 0x47, 0x18, 0xe2, 0xcb, 0x74, 0x23, 0x65, 0xca, 0x9b, 0xc2, 0x79, + 0x1c, 0x91, 0x9f, 0x40, 0xeb, 0xc2, 0x1c, 0x87, 0x4d, 0x19, 0x7f, 0x6d, 0x15, 0xa7, 0xdd, 0x59, + 0x98, 0xd6, 0x13, 0x5c, 0xed, 0x4f, 0x14, 0x80, 0x7d, 0x16, 0x53, 0xc1, 0xcd, 0x34, 0xb6, 0x95, + 0xeb, 0x36, 0xb6, 0xef, 0x27, 0x17, 0x08, 0xc5, 0xab, 0x63, 0xc0, 0x42, 0x97, 0xa1, 0xdc, 0xa4, + 0xcb, 0xc8, 0x35, 0x11, 0xc5, 0x2b, 0x9a, 0x88, 0x52, 0xae, 0x89, 0xf8, 0x18, 0x9a, 0xf6, 0x74, + 0xea, 0xbf, 0xe0, 0x05, 0x0d, 0x0b, 0x43, 0xe6, 0xa0, 0x11, 0x9c, 0xd7, 0xdb, 0xc8, 0xec, 0x49, + 0x9e, 0xf6, 0xe7, 0x0a, 0x34, 0x50, 0x15, 0x51, 0xe0, 0x7b, 0x11, 0x23, 0x5f, 0x42, 0x45, 0x5e, + 0x44, 0x8b, 0x8b, 0xfc, 0xb7, 0x33, 0xb2, 0x66, 0x70, 0xb2, 0x68, 0xa0, 0x12, 0xcc, 0x33, 0x42, + 0xe6, 0x75, 0x97, 0x2b, 0x25, 0x45, 0x91, 0xfb, 0x50, 0x73, 0x3d, 0x4b, 0xb4, 0xd4, 0x95, 0x4c, + 0x58, 0xac, 0xba, 0x1e, 0xd6, 0xb2, 0xed, 0x57, 0x50, 0x11, 0x2f, 0x21, 0x9d, 0x54, 0xa6, 0x8b, + 0xfa, 0xcb, 0xdc, 0x1c, 0xa7, 0xc2, 0xc8, 0xc3, 0x29, 0xbd, 0x2e, 0x40, 0xb7, 0xa0, 0x7a, 0xca, + 0x9b, 0x0f, 0xbc, 0xf4, 0xe3, 0xea, 0x4d, 0x86, 0xda, 0x1f, 0x97, 0x00, 0x0e, 0xe7, 0x4b, 0x0c, + 0xa4, 0x71, 0x5d, 0x03, 0xe9, 0xe4, 0xf4, 0xf8, 0x7a, 0x99, 0x7f, 0x75, 0x43, 0x59, 0xd2, 0x69, + 0x17, 0x6f, 0xda, 0x69, 0xdf, 0x87, 0x6a, 0x1c, 0xce, 0xb9, 0xa3, 0x08, 0x63, 0x4a, 0x5b, 0x5a, + 0x49, 0x25, 0x6f, 0x42, 0x79, 0xe2, 0x87, 0x63, 0x86, 0x8e, 0x95, 0xb2, 0x05, 0xed, 0xc2, 0x65, + 0x52, 0xed, 0xb2, 0xcb, 0x24, 0xde, 0xa0, 0x45, 0xf2, 0x1e, 0x0d, 0x0b, 0x99, 0x7c, 0x83, 0x96, + 0x5c, 0xb1, 0xd1, 0x14, 0x44, 0xbe, 0x81, 0xa6, 0x3d, 0x8f, 0x7d, 0xcb, 0xe5, 0x15, 0xda, 0xd4, + 0x1d, 0x9f, 0x61, 0xd9, 0xdd, 0xcc, 0x7f, 0xaf, 0x4f, 0x0f, 0xaa, 0xd3, 0x9d, 0xc7, 0xbe, 0xe1, + 0x1c, 0x22, 0x72, 0xa7, 0x2a, 0x93, 0x12, 0x5d, 0xb1, 0x33, 0x64, 0xed, 0xc7, 0xb0, 0x92, 0x85, + 0xf1, 0x04, 0x24, 0x81, 0xea, 0x1b, 0x3c, 0x3b, 0x8d, 0x78, 0x6a, 0x1b, 0x98, 0x46, 0xb7, 0xaf, + 0x16, 0xb4, 0x18, 0x1a, 0xb8, 0xbc, 0xf4, 0x8e, 0xeb, 0xba, 0xfd, 0x03, 0x28, 0x61, 0xf8, 0x55, + 0x2e, 0x7c, 0x0f, 0xc1, 0x98, 0x8b, 0xcc, 0xbc, 0xf9, 0x15, 0xb3, 0xe6, 0xf7, 0xdf, 0x05, 0x58, + 0x31, 0xfd, 0xf9, 0xf8, 0xe4, 0xa2, 0x01, 0xc2, 0xaf, 0x3b, 0x42, 0x2d, 0x31, 0x1f, 0xe5, 0xa6, + 0xe6, 0x93, 0x5a, 0x47, 0x71, 0x89, 0x75, 0xdc, 0xf4, 0xcc, 0xb5, 0x2f, 0x60, 0x55, 0x6e, 0x5e, + 0x6a, 0x3d, 0xd1, 0x66, 0xe1, 0x0a, 0x6d, 0x6a, 0xbf, 0x50, 0x60, 0x55, 0xc4, 0xf7, 0xff, 0xbb, + 0xd2, 0x2a, 0x37, 0x0c, 0xeb, 0xe5, 0x1b, 0x5d, 0x1e, 0xfd, 0xbf, 0xf4, 0x34, 0x6d, 0x08, 0xcd, + 0x44, 0x7d, 0x37, 0x50, 0xfb, 0x15, 0x46, 0xfc, 0x8b, 0x02, 0x34, 0x06, 0xec, 0xe5, 0x92, 0x20, + 0x5a, 0xbe, 0xee, 0x71, 0x7c, 0x98, 0x2b, 0x57, 0x1b, 0xdb, 0xeb, 0x59, 0x19, 0xc4, 0xd5, 0x63, + 0x52, 0xc1, 0xa6, 0xb7, 0xa8, 0xca, 0xf2, 0x5b, 0xd4, 0xd2, 0x62, 0xb7, 0x9e, 0xb9, 0xc5, 0x2b, + 0x2e, 0xbb, 0xc5, 0xd3, 0xfe, 0xad, 0x08, 0x0d, 0x6c, 0x90, 0x29, 0x8b, 0xe6, 0xd3, 0x38, 0x27, + 0x4c, 0xe1, 0x6a, 0x61, 0x3a, 0x50, 0x09, 0x71, 0x92, 0x74, 0xa5, 0x4b, 0x83, 0xbf, 0x40, 0x61, + 0x6b, 0xfc, 0xdc, 0x0d, 0x02, 0xe6, 0x58, 0x82, 0x92, 0x14, 0x30, 0x4d, 0x49, 0x16, 0x22, 0x44, + 0xbc, 0xfc, 0x9c, 0xf9, 0x21, 0x4b, 0x51, 0x45, 0xbc, 0x4f, 0x68, 0x70, 0x5a, 0x02, 0xc9, 0xdd, + 0x37, 0x88, 0xca, 0xe0, 0xfc, 0xbe, 0x21, 0xed, 0x35, 0x91, 0x5b, 0x47, 0xae, 0xe8, 0x35, 0x91, + 0xcd, 0xbb, 0xa8, 0x99, 0x3d, 0x9d, 0x5a, 0x7e, 0x10, 0xa1, 0xd3, 0xd4, 0x68, 0x0d, 0x09, 0xc3, + 0x20, 0x22, 0x5f, 0x43, 0x7a, 0x5d, 0x2c, 0x6f, 0xc9, 0xc5, 0x39, 0xb6, 0x2e, 0xbb, 0x58, 0xa0, + 0xab, 0xe3, 0xdc, 0xfd, 0xcf, 0x92, 0x1b, 0xea, 0xca, 0x4d, 0x6f, 0xa8, 0x1f, 0x42, 0x59, 0xc4, + 0xa8, 0xda, 0xeb, 0x62, 0x94, 0xc0, 0x65, 0xed, 0xb3, 0x91, 0xb7, 0xcf, 0x5f, 0x16, 0x80, 0x74, + 0xa7, 0x53, 0x7f, 0x6c, 0xc7, 0xcc, 0x70, 0xa2, 0x8b, 0x66, 0x7a, 0xed, 0xcf, 0x2e, 0x9f, 0x41, + 0x7d, 0xe6, 0x3b, 0x6c, 0x6a, 0x25, 0xdf, 0x94, 0x2e, 0xad, 0x7e, 0x10, 0xc6, 0x5b, 0x52, 0x02, + 0x25, 0xbc, 0xc4, 0x51, 0xb0, 0xee, 0xc0, 0x67, 0xde, 0x84, 0xcd, 0xec, 0x97, 0xb2, 0x14, 0xe1, + 0x8f, 0xa4, 0x03, 0xd5, 0x90, 0x45, 0x2c, 0x3c, 0x65, 0x57, 0x16, 0x55, 0x09, 0x48, 0x7b, 0x06, + 0x1b, 0xb9, 0x1d, 0x49, 0x47, 0xbe, 0x85, 0x5f, 0x2b, 0xc3, 0x58, 0x7e, 0xb4, 0x12, 0x03, 0xfe, + 0x3a, 0xe6, 0x25, 0x9f, 0x41, 0xf9, 0x63, 0xea, 0xf0, 0xc5, 0xab, 0xe2, 0xec, 0x1e, 0xa8, 0x59, + 0x4d, 0xbb, 0x63, 0x0c, 0x36, 0xf2, 0x54, 0x0a, 0xd7, 0x3b, 0x15, 0xed, 0xef, 0x0a, 0xb0, 0xde, + 0x75, 0x1c, 0xf1, 0x77, 0xc3, 0x25, 0xaa, 0x2f, 0x5e, 0x57, 0xf5, 0x0b, 0x81, 0x58, 0x84, 0x89, + 0x6b, 0x05, 0xe2, 0x0f, 0xa1, 0x92, 0xd6, 0x5a, 0xc5, 0x05, 0x77, 0x16, 0x72, 0x51, 0x09, 0xd0, + 0x6e, 0x01, 0xc9, 0x0a, 0x2b, 0xb4, 0xaa, 0xfd, 0x69, 0x11, 0xee, 0xee, 0xb2, 0x63, 0xd7, 0xcb, + 0xbe, 0xe2, 0x57, 0xdf, 0xc9, 0xc5, 0x4f, 0x65, 0x9f, 0xc1, 0xba, 0x28, 0xe4, 0x93, 0x7f, 0x62, + 0x59, 0xec, 0x58, 0x7e, 0x9d, 0x94, 0xb1, 0x6a, 0x0d, 0xf9, 0x07, 0x92, 0xad, 0xe3, 0x7f, 0xc5, + 0x1c, 0x3b, 0xb6, 0x9f, 0xd9, 0x11, 0xb3, 0x5c, 0x47, 0xfe, 0x59, 0x06, 0x12, 0x92, 0xe1, 0x90, + 0x21, 0x94, 0xb8, 0x0d, 0xa2, 0xeb, 0x36, 0xb7, 0xb7, 0x33, 0x62, 0x5d, 0xb2, 0x95, 0xac, 0x02, + 0x0f, 0x7c, 0x87, 0xed, 0x54, 0x8f, 0x06, 0x4f, 0x06, 0xc3, 0xef, 0x06, 0x14, 0x17, 0x22, 0x06, + 0xdc, 0x0a, 0x42, 0x76, 0xea, 0xfa, 0xf3, 0xc8, 0xca, 0x9e, 0x44, 0xf5, 0xca, 0x94, 0xb8, 0x91, + 0xcc, 0xc9, 0x10, 0xb5, 0x9f, 0xc2, 0xda, 0xc2, 0xcb, 0x78, 0x6d, 0x26, 0x5f, 0xa7, 0xbe, 0x41, + 0x56, 0xa1, 0x8e, 0x1f, 0xbb, 0x97, 0x7f, 0xfb, 0xd6, 0xfe, 0xb5, 0x80, 0x57, 0x4c, 0x33, 0x37, + 0xbe, 0x59, 0x06, 0xfb, 0xcd, 0x7c, 0x06, 0x83, 0xed, 0x77, 0xf3, 0xe6, 0x9b, 0x59, 0xb0, 0xf3, + 0xad, 0x00, 0xa6, 0x41, 0xa4, 0x6d, 0x43, 0x55, 0xd2, 0xc8, 0x6f, 0xc1, 0x5a, 0xe8, 0xfb, 0x71, + 0xd2, 0x89, 0x8a, 0x0e, 0xe4, 0xf2, 0x3f, 0xdb, 0xac, 0x72, 0xb0, 0x48, 0x06, 0x4f, 0xf2, 0xbd, + 0x48, 0x59, 0xfc, 0x0d, 0x44, 0x0e, 0x77, 0x1b, 0xbf, 0x5b, 0x4f, 0xff, 0xb7, 0xfb, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x35, 0x9f, 0x30, 0x98, 0xf2, 0x2b, 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto b/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto new file mode 100644 index 00000000000..497b4d9a9af --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto @@ -0,0 +1,551 @@ +syntax = "proto2"; +option go_package = "datastore"; + +package appengine; + +message Action{} + +message PropertyValue { + optional int64 int64Value = 1; + optional bool booleanValue = 2; + optional string stringValue = 3; + optional double doubleValue = 4; + + optional group PointValue = 5 { + required double x = 6; + required double y = 7; + } + + optional group UserValue = 8 { + required string email = 9; + required string auth_domain = 10; + optional string nickname = 11; + optional string federated_identity = 21; + optional string federated_provider = 22; + } + + optional group ReferenceValue = 12 { + required string app = 13; + optional string name_space = 20; + repeated group PathElement = 14 { + required string type = 15; + optional int64 id = 16; + optional string name = 17; + } + } +} + +message Property { + enum Meaning { + NO_MEANING = 0; + BLOB = 14; + TEXT = 15; + BYTESTRING = 16; + + ATOM_CATEGORY = 1; + ATOM_LINK = 2; + ATOM_TITLE = 3; + ATOM_CONTENT = 4; + ATOM_SUMMARY = 5; + ATOM_AUTHOR = 6; + + GD_WHEN = 7; + GD_EMAIL = 8; + GEORSS_POINT = 9; + GD_IM = 10; + + GD_PHONENUMBER = 11; + GD_POSTALADDRESS = 12; + + GD_RATING = 13; + + BLOBKEY = 17; + ENTITY_PROTO = 19; + + INDEX_VALUE = 18; + }; + + optional Meaning meaning = 1 [default = NO_MEANING]; + optional string meaning_uri = 2; + + required string name = 3; + + required PropertyValue value = 5; + + required bool multiple = 4; + + optional bool searchable = 6 [default=false]; + + enum FtsTokenizationOption { + HTML = 1; + ATOM = 2; + } + + optional FtsTokenizationOption fts_tokenization_option = 8; + + optional string locale = 9 [default = "en"]; +} + +message Path { + repeated group Element = 1 { + required string type = 2; + optional int64 id = 3; + optional string name = 4; + } +} + +message Reference { + required string app = 13; + optional string name_space = 20; + required Path path = 14; +} + +message User { + required string email = 1; + required string auth_domain = 2; + optional string nickname = 3; + optional string federated_identity = 6; + optional string federated_provider = 7; +} + +message EntityProto { + required Reference key = 13; + required Path entity_group = 16; + optional User owner = 17; + + enum Kind { + GD_CONTACT = 1; + GD_EVENT = 2; + GD_MESSAGE = 3; + } + optional Kind kind = 4; + optional string kind_uri = 5; + + repeated Property property = 14; + repeated Property raw_property = 15; + + optional int32 rank = 18; +} + +message CompositeProperty { + required int64 index_id = 1; + repeated string value = 2; +} + +message Index { + required string entity_type = 1; + required bool ancestor = 5; + repeated group Property = 2 { + required string name = 3; + enum Direction { + ASCENDING = 1; + DESCENDING = 2; + } + optional Direction direction = 4 [default = ASCENDING]; + } +} + +message CompositeIndex { + required string app_id = 1; + required int64 id = 2; + required Index definition = 3; + + enum State { + WRITE_ONLY = 1; + READ_WRITE = 2; + DELETED = 3; + ERROR = 4; + } + required State state = 4; + + optional bool only_use_if_required = 6 [default = false]; +} + +message IndexPostfix { + message IndexValue { + required string property_name = 1; + required PropertyValue value = 2; + } + + repeated IndexValue index_value = 1; + + optional Reference key = 2; + + optional bool before = 3 [default=true]; +} + +message IndexPosition { + optional string key = 1; + + optional bool before = 2 [default=true]; +} + +message Snapshot { + enum Status { + INACTIVE = 0; + ACTIVE = 1; + } + + required int64 ts = 1; +} + +message InternalHeader { + optional string qos = 1; +} + +message Transaction { + optional InternalHeader header = 4; + required fixed64 handle = 1; + required string app = 2; + optional bool mark_changes = 3 [default = false]; +} + +message Query { + optional InternalHeader header = 39; + + required string app = 1; + optional string name_space = 29; + + optional string kind = 3; + optional Reference ancestor = 17; + + repeated group Filter = 4 { + enum Operator { + LESS_THAN = 1; + LESS_THAN_OR_EQUAL = 2; + GREATER_THAN = 3; + GREATER_THAN_OR_EQUAL = 4; + EQUAL = 5; + IN = 6; + EXISTS = 7; + } + + required Operator op = 6; + repeated Property property = 14; + } + + optional string search_query = 8; + + repeated group Order = 9 { + enum Direction { + ASCENDING = 1; + DESCENDING = 2; + } + + required string property = 10; + optional Direction direction = 11 [default = ASCENDING]; + } + + enum Hint { + ORDER_FIRST = 1; + ANCESTOR_FIRST = 2; + FILTER_FIRST = 3; + } + optional Hint hint = 18; + + optional int32 count = 23; + + optional int32 offset = 12 [default = 0]; + + optional int32 limit = 16; + + optional CompiledCursor compiled_cursor = 30; + optional CompiledCursor end_compiled_cursor = 31; + + repeated CompositeIndex composite_index = 19; + + optional bool require_perfect_plan = 20 [default = false]; + + optional bool keys_only = 21 [default = false]; + + optional Transaction transaction = 22; + + optional bool compile = 25 [default = false]; + + optional int64 failover_ms = 26; + + optional bool strong = 32; + + repeated string property_name = 33; + + repeated string group_by_property_name = 34; + + optional bool distinct = 24; + + optional int64 min_safe_time_seconds = 35; + + repeated string safe_replica_name = 36; + + optional bool persist_offset = 37 [default=false]; +} + +message CompiledQuery { + required group PrimaryScan = 1 { + optional string index_name = 2; + + optional string start_key = 3; + optional bool start_inclusive = 4; + optional string end_key = 5; + optional bool end_inclusive = 6; + + repeated string start_postfix_value = 22; + repeated string end_postfix_value = 23; + + optional int64 end_unapplied_log_timestamp_us = 19; + } + + repeated group MergeJoinScan = 7 { + required string index_name = 8; + + repeated string prefix_value = 9; + + optional bool value_prefix = 20 [default=false]; + } + + optional Index index_def = 21; + + optional int32 offset = 10 [default = 0]; + + optional int32 limit = 11; + + required bool keys_only = 12; + + repeated string property_name = 24; + + optional int32 distinct_infix_size = 25; + + optional group EntityFilter = 13 { + optional bool distinct = 14 [default=false]; + + optional string kind = 17; + optional Reference ancestor = 18; + } +} + +message CompiledCursor { + optional group Position = 2 { + optional string start_key = 27; + + repeated group IndexValue = 29 { + optional string property = 30; + required PropertyValue value = 31; + } + + optional Reference key = 32; + + optional bool start_inclusive = 28 [default=true]; + } +} + +message Cursor { + required fixed64 cursor = 1; + + optional string app = 2; +} + +message Error { + enum ErrorCode { + BAD_REQUEST = 1; + CONCURRENT_TRANSACTION = 2; + INTERNAL_ERROR = 3; + NEED_INDEX = 4; + TIMEOUT = 5; + PERMISSION_DENIED = 6; + BIGTABLE_ERROR = 7; + COMMITTED_BUT_STILL_APPLYING = 8; + CAPABILITY_DISABLED = 9; + TRY_ALTERNATE_BACKEND = 10; + SAFE_TIME_TOO_OLD = 11; + } +} + +message Cost { + optional int32 index_writes = 1; + optional int32 index_write_bytes = 2; + optional int32 entity_writes = 3; + optional int32 entity_write_bytes = 4; + optional group CommitCost = 5 { + optional int32 requested_entity_puts = 6; + optional int32 requested_entity_deletes = 7; + }; + optional int32 approximate_storage_delta = 8; + optional int32 id_sequence_updates = 9; +} + +message GetRequest { + optional InternalHeader header = 6; + + repeated Reference key = 1; + optional Transaction transaction = 2; + + optional int64 failover_ms = 3; + + optional bool strong = 4; + + optional bool allow_deferred = 5 [default=false]; +} + +message GetResponse { + repeated group Entity = 1 { + optional EntityProto entity = 2; + optional Reference key = 4; + + optional int64 version = 3; + } + + repeated Reference deferred = 5; + + optional bool in_order = 6 [default=true]; +} + +message PutRequest { + optional InternalHeader header = 11; + + repeated EntityProto entity = 1; + optional Transaction transaction = 2; + repeated CompositeIndex composite_index = 3; + + optional bool trusted = 4 [default = false]; + + optional bool force = 7 [default = false]; + + optional bool mark_changes = 8 [default = false]; + repeated Snapshot snapshot = 9; + + enum AutoIdPolicy { + CURRENT = 0; + SEQUENTIAL = 1; + } + optional AutoIdPolicy auto_id_policy = 10 [default = CURRENT]; +} + +message PutResponse { + repeated Reference key = 1; + optional Cost cost = 2; + repeated int64 version = 3; +} + +message TouchRequest { + optional InternalHeader header = 10; + + repeated Reference key = 1; + repeated CompositeIndex composite_index = 2; + optional bool force = 3 [default = false]; + repeated Snapshot snapshot = 9; +} + +message TouchResponse { + optional Cost cost = 1; +} + +message DeleteRequest { + optional InternalHeader header = 10; + + repeated Reference key = 6; + optional Transaction transaction = 5; + + optional bool trusted = 4 [default = false]; + + optional bool force = 7 [default = false]; + + optional bool mark_changes = 8 [default = false]; + repeated Snapshot snapshot = 9; +} + +message DeleteResponse { + optional Cost cost = 1; + repeated int64 version = 3; +} + +message NextRequest { + optional InternalHeader header = 5; + + required Cursor cursor = 1; + optional int32 count = 2; + + optional int32 offset = 4 [default = 0]; + + optional bool compile = 3 [default = false]; +} + +message QueryResult { + optional Cursor cursor = 1; + + repeated EntityProto result = 2; + + optional int32 skipped_results = 7; + + required bool more_results = 3; + + optional bool keys_only = 4; + + optional bool index_only = 9; + + optional bool small_ops = 10; + + optional CompiledQuery compiled_query = 5; + + optional CompiledCursor compiled_cursor = 6; + + repeated CompositeIndex index = 8; + + repeated int64 version = 11; +} + +message AllocateIdsRequest { + optional InternalHeader header = 4; + + optional Reference model_key = 1; + + optional int64 size = 2; + + optional int64 max = 3; + + repeated Reference reserve = 5; +} + +message AllocateIdsResponse { + required int64 start = 1; + required int64 end = 2; + optional Cost cost = 3; +} + +message CompositeIndices { + repeated CompositeIndex index = 1; +} + +message AddActionsRequest { + optional InternalHeader header = 3; + + required Transaction transaction = 1; + repeated Action action = 2; +} + +message AddActionsResponse { +} + +message BeginTransactionRequest { + optional InternalHeader header = 3; + + required string app = 1; + optional bool allow_multiple_eg = 2 [default = false]; + optional string database_id = 4; + + enum TransactionMode { + UNKNOWN = 0; + READ_ONLY = 1; + READ_WRITE = 2; + } + optional TransactionMode mode = 5 [default = UNKNOWN]; + + optional Transaction previous_transaction = 7; +} + +message CommitResponse { + optional Cost cost = 1; + + repeated group Version = 3 { + required Reference root_entity_key = 4; + required int64 version = 5; + } +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/identity.go b/upstream/vendor/google.golang.org/appengine/internal/identity.go new file mode 100644 index 00000000000..0f95aa91d5b --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/identity.go @@ -0,0 +1,54 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +import ( + "context" + "os" +) + +var ( + // This is set to true in identity_classic.go, which is behind the appengine build tag. + // The appengine build tag is set for the first generation runtimes (<= Go 1.9) but not + // the second generation runtimes (>= Go 1.11), so this indicates whether we're on a + // first-gen runtime. See IsStandard below for the second-gen check. + appengineStandard bool + + // This is set to true in identity_flex.go, which is behind the appenginevm build tag. + appengineFlex bool +) + +// AppID is the implementation of the wrapper function of the same name in +// ../identity.go. See that file for commentary. +func AppID(c context.Context) string { + return appID(FullyQualifiedAppID(c)) +} + +// IsStandard is the implementation of the wrapper function of the same name in +// ../appengine.go. See that file for commentary. +func IsStandard() bool { + // appengineStandard will be true for first-gen runtimes (<= Go 1.9) but not + // second-gen (>= Go 1.11). + return appengineStandard || IsSecondGen() +} + +// IsSecondGen is the implementation of the wrapper function of the same name in +// ../appengine.go. See that file for commentary. +func IsSecondGen() bool { + // Second-gen runtimes set $GAE_ENV so we use that to check if we're on a second-gen runtime. + return os.Getenv("GAE_ENV") == "standard" +} + +// IsFlex is the implementation of the wrapper function of the same name in +// ../appengine.go. See that file for commentary. +func IsFlex() bool { + return appengineFlex +} + +// IsAppEngine is the implementation of the wrapper function of the same name in +// ../appengine.go. See that file for commentary. +func IsAppEngine() bool { + return IsStandard() || IsFlex() +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/identity_classic.go b/upstream/vendor/google.golang.org/appengine/internal/identity_classic.go new file mode 100644 index 00000000000..5ad3548bf74 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/identity_classic.go @@ -0,0 +1,62 @@ +// Copyright 2015 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build appengine +// +build appengine + +package internal + +import ( + "context" + + "appengine" +) + +func init() { + appengineStandard = true +} + +func DefaultVersionHostname(ctx context.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.DefaultVersionHostname(c) +} + +func Datacenter(_ context.Context) string { return appengine.Datacenter() } +func ServerSoftware() string { return appengine.ServerSoftware() } +func InstanceID() string { return appengine.InstanceID() } +func IsDevAppServer() bool { return appengine.IsDevAppServer() } + +func RequestID(ctx context.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.RequestID(c) +} + +func ModuleName(ctx context.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.ModuleName(c) +} +func VersionID(ctx context.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return appengine.VersionID(c) +} + +func fullyQualifiedAppID(ctx context.Context) string { + c := fromContext(ctx) + if c == nil { + panic(errNotAppEngineContext) + } + return c.FullyQualifiedAppID() +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/identity_flex.go b/upstream/vendor/google.golang.org/appengine/internal/identity_flex.go new file mode 100644 index 00000000000..4201b6b585a --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/identity_flex.go @@ -0,0 +1,12 @@ +// Copyright 2018 Google LLC. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build appenginevm +// +build appenginevm + +package internal + +func init() { + appengineFlex = true +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/identity_vm.go b/upstream/vendor/google.golang.org/appengine/internal/identity_vm.go new file mode 100644 index 00000000000..18ddda3a423 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/identity_vm.go @@ -0,0 +1,134 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build !appengine +// +build !appengine + +package internal + +import ( + "context" + "log" + "net/http" + "os" + "strings" +) + +// These functions are implementations of the wrapper functions +// in ../appengine/identity.go. See that file for commentary. + +const ( + hDefaultVersionHostname = "X-AppEngine-Default-Version-Hostname" + hRequestLogId = "X-AppEngine-Request-Log-Id" + hDatacenter = "X-AppEngine-Datacenter" +) + +func ctxHeaders(ctx context.Context) http.Header { + c := fromContext(ctx) + if c == nil { + return nil + } + return c.Request().Header +} + +func DefaultVersionHostname(ctx context.Context) string { + return ctxHeaders(ctx).Get(hDefaultVersionHostname) +} + +func RequestID(ctx context.Context) string { + return ctxHeaders(ctx).Get(hRequestLogId) +} + +func Datacenter(ctx context.Context) string { + if dc := ctxHeaders(ctx).Get(hDatacenter); dc != "" { + return dc + } + // If the header isn't set, read zone from the metadata service. + // It has the format projects/[NUMERIC_PROJECT_ID]/zones/[ZONE] + zone, err := getMetadata("instance/zone") + if err != nil { + log.Printf("Datacenter: %v", err) + return "" + } + parts := strings.Split(string(zone), "/") + if len(parts) == 0 { + return "" + } + return parts[len(parts)-1] +} + +func ServerSoftware() string { + // TODO(dsymonds): Remove fallback when we've verified this. + if s := os.Getenv("SERVER_SOFTWARE"); s != "" { + return s + } + if s := os.Getenv("GAE_ENV"); s != "" { + return s + } + return "Google App Engine/1.x.x" +} + +// TODO(dsymonds): Remove the metadata fetches. + +func ModuleName(_ context.Context) string { + if s := os.Getenv("GAE_MODULE_NAME"); s != "" { + return s + } + if s := os.Getenv("GAE_SERVICE"); s != "" { + return s + } + return string(mustGetMetadata("instance/attributes/gae_backend_name")) +} + +func VersionID(_ context.Context) string { + if s1, s2 := os.Getenv("GAE_MODULE_VERSION"), os.Getenv("GAE_MINOR_VERSION"); s1 != "" && s2 != "" { + return s1 + "." + s2 + } + if s1, s2 := os.Getenv("GAE_VERSION"), os.Getenv("GAE_DEPLOYMENT_ID"); s1 != "" && s2 != "" { + return s1 + "." + s2 + } + return string(mustGetMetadata("instance/attributes/gae_backend_version")) + "." + string(mustGetMetadata("instance/attributes/gae_backend_minor_version")) +} + +func InstanceID() string { + if s := os.Getenv("GAE_MODULE_INSTANCE"); s != "" { + return s + } + if s := os.Getenv("GAE_INSTANCE"); s != "" { + return s + } + return string(mustGetMetadata("instance/attributes/gae_backend_instance")) +} + +func partitionlessAppID() string { + // gae_project has everything except the partition prefix. + if appID := os.Getenv("GAE_LONG_APP_ID"); appID != "" { + return appID + } + if project := os.Getenv("GOOGLE_CLOUD_PROJECT"); project != "" { + return project + } + return string(mustGetMetadata("instance/attributes/gae_project")) +} + +func fullyQualifiedAppID(_ context.Context) string { + if s := os.Getenv("GAE_APPLICATION"); s != "" { + return s + } + appID := partitionlessAppID() + + part := os.Getenv("GAE_PARTITION") + if part == "" { + part = string(mustGetMetadata("instance/attributes/gae_partition")) + } + + if part != "" { + appID = part + "~" + appID + } + return appID +} + +func IsDevAppServer() bool { + return os.Getenv("RUN_WITH_DEVAPPSERVER") != "" || os.Getenv("GAE_ENV") == "localdev" +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/internal.go b/upstream/vendor/google.golang.org/appengine/internal/internal.go new file mode 100644 index 00000000000..051ea3980ab --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/internal.go @@ -0,0 +1,110 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +// Package internal provides support for package appengine. +// +// Programs should not use this package directly. Its API is not stable. +// Use packages appengine and appengine/* instead. +package internal + +import ( + "fmt" + + "github.com/golang/protobuf/proto" + + remotepb "google.golang.org/appengine/internal/remote_api" +) + +// errorCodeMaps is a map of service name to the error code map for the service. +var errorCodeMaps = make(map[string]map[int32]string) + +// RegisterErrorCodeMap is called from API implementations to register their +// error code map. This should only be called from init functions. +func RegisterErrorCodeMap(service string, m map[int32]string) { + errorCodeMaps[service] = m +} + +type timeoutCodeKey struct { + service string + code int32 +} + +// timeoutCodes is the set of service+code pairs that represent timeouts. +var timeoutCodes = make(map[timeoutCodeKey]bool) + +func RegisterTimeoutErrorCode(service string, code int32) { + timeoutCodes[timeoutCodeKey{service, code}] = true +} + +// APIError is the type returned by appengine.Context's Call method +// when an API call fails in an API-specific way. This may be, for instance, +// a taskqueue API call failing with TaskQueueServiceError::UNKNOWN_QUEUE. +type APIError struct { + Service string + Detail string + Code int32 // API-specific error code +} + +func (e *APIError) Error() string { + if e.Code == 0 { + if e.Detail == "" { + return "APIError <empty>" + } + return e.Detail + } + s := fmt.Sprintf("API error %d", e.Code) + if m, ok := errorCodeMaps[e.Service]; ok { + s += " (" + e.Service + ": " + m[e.Code] + ")" + } else { + // Shouldn't happen, but provide a bit more detail if it does. + s = e.Service + " " + s + } + if e.Detail != "" { + s += ": " + e.Detail + } + return s +} + +func (e *APIError) IsTimeout() bool { + return timeoutCodes[timeoutCodeKey{e.Service, e.Code}] +} + +// CallError is the type returned by appengine.Context's Call method when an +// API call fails in a generic way, such as RpcError::CAPABILITY_DISABLED. +type CallError struct { + Detail string + Code int32 + // TODO: Remove this if we get a distinguishable error code. + Timeout bool +} + +func (e *CallError) Error() string { + var msg string + switch remotepb.RpcError_ErrorCode(e.Code) { + case remotepb.RpcError_UNKNOWN: + return e.Detail + case remotepb.RpcError_OVER_QUOTA: + msg = "Over quota" + case remotepb.RpcError_CAPABILITY_DISABLED: + msg = "Capability disabled" + case remotepb.RpcError_CANCELLED: + msg = "Canceled" + default: + msg = fmt.Sprintf("Call error %d", e.Code) + } + s := msg + ": " + e.Detail + if e.Timeout { + s += " (timeout)" + } + return s +} + +func (e *CallError) IsTimeout() bool { + return e.Timeout +} + +// NamespaceMods is a map from API service to a function that will mutate an RPC request to attach a namespace. +// The function should be prepared to be called on the same message more than once; it should only modify the +// RPC request the first time. +var NamespaceMods = make(map[string]func(m proto.Message, namespace string)) diff --git a/upstream/vendor/google.golang.org/appengine/internal/log/log_service.pb.go b/upstream/vendor/google.golang.org/appengine/internal/log/log_service.pb.go new file mode 100644 index 00000000000..8545ac4ad6a --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/log/log_service.pb.go @@ -0,0 +1,1313 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/log/log_service.proto + +package log + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type LogServiceError_ErrorCode int32 + +const ( + LogServiceError_OK LogServiceError_ErrorCode = 0 + LogServiceError_INVALID_REQUEST LogServiceError_ErrorCode = 1 + LogServiceError_STORAGE_ERROR LogServiceError_ErrorCode = 2 +) + +var LogServiceError_ErrorCode_name = map[int32]string{ + 0: "OK", + 1: "INVALID_REQUEST", + 2: "STORAGE_ERROR", +} +var LogServiceError_ErrorCode_value = map[string]int32{ + "OK": 0, + "INVALID_REQUEST": 1, + "STORAGE_ERROR": 2, +} + +func (x LogServiceError_ErrorCode) Enum() *LogServiceError_ErrorCode { + p := new(LogServiceError_ErrorCode) + *p = x + return p +} +func (x LogServiceError_ErrorCode) String() string { + return proto.EnumName(LogServiceError_ErrorCode_name, int32(x)) +} +func (x *LogServiceError_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(LogServiceError_ErrorCode_value, data, "LogServiceError_ErrorCode") + if err != nil { + return err + } + *x = LogServiceError_ErrorCode(value) + return nil +} +func (LogServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{0, 0} +} + +type LogServiceError struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogServiceError) Reset() { *m = LogServiceError{} } +func (m *LogServiceError) String() string { return proto.CompactTextString(m) } +func (*LogServiceError) ProtoMessage() {} +func (*LogServiceError) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{0} +} +func (m *LogServiceError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogServiceError.Unmarshal(m, b) +} +func (m *LogServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogServiceError.Marshal(b, m, deterministic) +} +func (dst *LogServiceError) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogServiceError.Merge(dst, src) +} +func (m *LogServiceError) XXX_Size() int { + return xxx_messageInfo_LogServiceError.Size(m) +} +func (m *LogServiceError) XXX_DiscardUnknown() { + xxx_messageInfo_LogServiceError.DiscardUnknown(m) +} + +var xxx_messageInfo_LogServiceError proto.InternalMessageInfo + +type UserAppLogLine struct { + TimestampUsec *int64 `protobuf:"varint,1,req,name=timestamp_usec,json=timestampUsec" json:"timestamp_usec,omitempty"` + Level *int64 `protobuf:"varint,2,req,name=level" json:"level,omitempty"` + Message *string `protobuf:"bytes,3,req,name=message" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserAppLogLine) Reset() { *m = UserAppLogLine{} } +func (m *UserAppLogLine) String() string { return proto.CompactTextString(m) } +func (*UserAppLogLine) ProtoMessage() {} +func (*UserAppLogLine) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{1} +} +func (m *UserAppLogLine) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserAppLogLine.Unmarshal(m, b) +} +func (m *UserAppLogLine) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserAppLogLine.Marshal(b, m, deterministic) +} +func (dst *UserAppLogLine) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserAppLogLine.Merge(dst, src) +} +func (m *UserAppLogLine) XXX_Size() int { + return xxx_messageInfo_UserAppLogLine.Size(m) +} +func (m *UserAppLogLine) XXX_DiscardUnknown() { + xxx_messageInfo_UserAppLogLine.DiscardUnknown(m) +} + +var xxx_messageInfo_UserAppLogLine proto.InternalMessageInfo + +func (m *UserAppLogLine) GetTimestampUsec() int64 { + if m != nil && m.TimestampUsec != nil { + return *m.TimestampUsec + } + return 0 +} + +func (m *UserAppLogLine) GetLevel() int64 { + if m != nil && m.Level != nil { + return *m.Level + } + return 0 +} + +func (m *UserAppLogLine) GetMessage() string { + if m != nil && m.Message != nil { + return *m.Message + } + return "" +} + +type UserAppLogGroup struct { + LogLine []*UserAppLogLine `protobuf:"bytes,2,rep,name=log_line,json=logLine" json:"log_line,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserAppLogGroup) Reset() { *m = UserAppLogGroup{} } +func (m *UserAppLogGroup) String() string { return proto.CompactTextString(m) } +func (*UserAppLogGroup) ProtoMessage() {} +func (*UserAppLogGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{2} +} +func (m *UserAppLogGroup) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserAppLogGroup.Unmarshal(m, b) +} +func (m *UserAppLogGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserAppLogGroup.Marshal(b, m, deterministic) +} +func (dst *UserAppLogGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserAppLogGroup.Merge(dst, src) +} +func (m *UserAppLogGroup) XXX_Size() int { + return xxx_messageInfo_UserAppLogGroup.Size(m) +} +func (m *UserAppLogGroup) XXX_DiscardUnknown() { + xxx_messageInfo_UserAppLogGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_UserAppLogGroup proto.InternalMessageInfo + +func (m *UserAppLogGroup) GetLogLine() []*UserAppLogLine { + if m != nil { + return m.LogLine + } + return nil +} + +type FlushRequest struct { + Logs []byte `protobuf:"bytes,1,opt,name=logs" json:"logs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FlushRequest) Reset() { *m = FlushRequest{} } +func (m *FlushRequest) String() string { return proto.CompactTextString(m) } +func (*FlushRequest) ProtoMessage() {} +func (*FlushRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{3} +} +func (m *FlushRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FlushRequest.Unmarshal(m, b) +} +func (m *FlushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FlushRequest.Marshal(b, m, deterministic) +} +func (dst *FlushRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushRequest.Merge(dst, src) +} +func (m *FlushRequest) XXX_Size() int { + return xxx_messageInfo_FlushRequest.Size(m) +} +func (m *FlushRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FlushRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FlushRequest proto.InternalMessageInfo + +func (m *FlushRequest) GetLogs() []byte { + if m != nil { + return m.Logs + } + return nil +} + +type SetStatusRequest struct { + Status *string `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetStatusRequest) Reset() { *m = SetStatusRequest{} } +func (m *SetStatusRequest) String() string { return proto.CompactTextString(m) } +func (*SetStatusRequest) ProtoMessage() {} +func (*SetStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{4} +} +func (m *SetStatusRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetStatusRequest.Unmarshal(m, b) +} +func (m *SetStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetStatusRequest.Marshal(b, m, deterministic) +} +func (dst *SetStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetStatusRequest.Merge(dst, src) +} +func (m *SetStatusRequest) XXX_Size() int { + return xxx_messageInfo_SetStatusRequest.Size(m) +} +func (m *SetStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetStatusRequest proto.InternalMessageInfo + +func (m *SetStatusRequest) GetStatus() string { + if m != nil && m.Status != nil { + return *m.Status + } + return "" +} + +type LogOffset struct { + RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogOffset) Reset() { *m = LogOffset{} } +func (m *LogOffset) String() string { return proto.CompactTextString(m) } +func (*LogOffset) ProtoMessage() {} +func (*LogOffset) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{5} +} +func (m *LogOffset) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogOffset.Unmarshal(m, b) +} +func (m *LogOffset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogOffset.Marshal(b, m, deterministic) +} +func (dst *LogOffset) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogOffset.Merge(dst, src) +} +func (m *LogOffset) XXX_Size() int { + return xxx_messageInfo_LogOffset.Size(m) +} +func (m *LogOffset) XXX_DiscardUnknown() { + xxx_messageInfo_LogOffset.DiscardUnknown(m) +} + +var xxx_messageInfo_LogOffset proto.InternalMessageInfo + +func (m *LogOffset) GetRequestId() []byte { + if m != nil { + return m.RequestId + } + return nil +} + +type LogLine struct { + Time *int64 `protobuf:"varint,1,req,name=time" json:"time,omitempty"` + Level *int32 `protobuf:"varint,2,req,name=level" json:"level,omitempty"` + LogMessage *string `protobuf:"bytes,3,req,name=log_message,json=logMessage" json:"log_message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogLine) Reset() { *m = LogLine{} } +func (m *LogLine) String() string { return proto.CompactTextString(m) } +func (*LogLine) ProtoMessage() {} +func (*LogLine) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{6} +} +func (m *LogLine) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogLine.Unmarshal(m, b) +} +func (m *LogLine) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogLine.Marshal(b, m, deterministic) +} +func (dst *LogLine) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogLine.Merge(dst, src) +} +func (m *LogLine) XXX_Size() int { + return xxx_messageInfo_LogLine.Size(m) +} +func (m *LogLine) XXX_DiscardUnknown() { + xxx_messageInfo_LogLine.DiscardUnknown(m) +} + +var xxx_messageInfo_LogLine proto.InternalMessageInfo + +func (m *LogLine) GetTime() int64 { + if m != nil && m.Time != nil { + return *m.Time + } + return 0 +} + +func (m *LogLine) GetLevel() int32 { + if m != nil && m.Level != nil { + return *m.Level + } + return 0 +} + +func (m *LogLine) GetLogMessage() string { + if m != nil && m.LogMessage != nil { + return *m.LogMessage + } + return "" +} + +type RequestLog struct { + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + ModuleId *string `protobuf:"bytes,37,opt,name=module_id,json=moduleId,def=default" json:"module_id,omitempty"` + VersionId *string `protobuf:"bytes,2,req,name=version_id,json=versionId" json:"version_id,omitempty"` + RequestId []byte `protobuf:"bytes,3,req,name=request_id,json=requestId" json:"request_id,omitempty"` + Offset *LogOffset `protobuf:"bytes,35,opt,name=offset" json:"offset,omitempty"` + Ip *string `protobuf:"bytes,4,req,name=ip" json:"ip,omitempty"` + Nickname *string `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` + StartTime *int64 `protobuf:"varint,6,req,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int64 `protobuf:"varint,7,req,name=end_time,json=endTime" json:"end_time,omitempty"` + Latency *int64 `protobuf:"varint,8,req,name=latency" json:"latency,omitempty"` + Mcycles *int64 `protobuf:"varint,9,req,name=mcycles" json:"mcycles,omitempty"` + Method *string `protobuf:"bytes,10,req,name=method" json:"method,omitempty"` + Resource *string `protobuf:"bytes,11,req,name=resource" json:"resource,omitempty"` + HttpVersion *string `protobuf:"bytes,12,req,name=http_version,json=httpVersion" json:"http_version,omitempty"` + Status *int32 `protobuf:"varint,13,req,name=status" json:"status,omitempty"` + ResponseSize *int64 `protobuf:"varint,14,req,name=response_size,json=responseSize" json:"response_size,omitempty"` + Referrer *string `protobuf:"bytes,15,opt,name=referrer" json:"referrer,omitempty"` + UserAgent *string `protobuf:"bytes,16,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"` + UrlMapEntry *string `protobuf:"bytes,17,req,name=url_map_entry,json=urlMapEntry" json:"url_map_entry,omitempty"` + Combined *string `protobuf:"bytes,18,req,name=combined" json:"combined,omitempty"` + ApiMcycles *int64 `protobuf:"varint,19,opt,name=api_mcycles,json=apiMcycles" json:"api_mcycles,omitempty"` + Host *string `protobuf:"bytes,20,opt,name=host" json:"host,omitempty"` + Cost *float64 `protobuf:"fixed64,21,opt,name=cost" json:"cost,omitempty"` + TaskQueueName *string `protobuf:"bytes,22,opt,name=task_queue_name,json=taskQueueName" json:"task_queue_name,omitempty"` + TaskName *string `protobuf:"bytes,23,opt,name=task_name,json=taskName" json:"task_name,omitempty"` + WasLoadingRequest *bool `protobuf:"varint,24,opt,name=was_loading_request,json=wasLoadingRequest" json:"was_loading_request,omitempty"` + PendingTime *int64 `protobuf:"varint,25,opt,name=pending_time,json=pendingTime" json:"pending_time,omitempty"` + ReplicaIndex *int32 `protobuf:"varint,26,opt,name=replica_index,json=replicaIndex,def=-1" json:"replica_index,omitempty"` + Finished *bool `protobuf:"varint,27,opt,name=finished,def=1" json:"finished,omitempty"` + CloneKey []byte `protobuf:"bytes,28,opt,name=clone_key,json=cloneKey" json:"clone_key,omitempty"` + Line []*LogLine `protobuf:"bytes,29,rep,name=line" json:"line,omitempty"` + LinesIncomplete *bool `protobuf:"varint,36,opt,name=lines_incomplete,json=linesIncomplete" json:"lines_incomplete,omitempty"` + AppEngineRelease []byte `protobuf:"bytes,38,opt,name=app_engine_release,json=appEngineRelease" json:"app_engine_release,omitempty"` + ExitReason *int32 `protobuf:"varint,30,opt,name=exit_reason,json=exitReason" json:"exit_reason,omitempty"` + WasThrottledForTime *bool `protobuf:"varint,31,opt,name=was_throttled_for_time,json=wasThrottledForTime" json:"was_throttled_for_time,omitempty"` + WasThrottledForRequests *bool `protobuf:"varint,32,opt,name=was_throttled_for_requests,json=wasThrottledForRequests" json:"was_throttled_for_requests,omitempty"` + ThrottledTime *int64 `protobuf:"varint,33,opt,name=throttled_time,json=throttledTime" json:"throttled_time,omitempty"` + ServerName []byte `protobuf:"bytes,34,opt,name=server_name,json=serverName" json:"server_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestLog) Reset() { *m = RequestLog{} } +func (m *RequestLog) String() string { return proto.CompactTextString(m) } +func (*RequestLog) ProtoMessage() {} +func (*RequestLog) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{7} +} +func (m *RequestLog) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RequestLog.Unmarshal(m, b) +} +func (m *RequestLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RequestLog.Marshal(b, m, deterministic) +} +func (dst *RequestLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestLog.Merge(dst, src) +} +func (m *RequestLog) XXX_Size() int { + return xxx_messageInfo_RequestLog.Size(m) +} +func (m *RequestLog) XXX_DiscardUnknown() { + xxx_messageInfo_RequestLog.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestLog proto.InternalMessageInfo + +const Default_RequestLog_ModuleId string = "default" +const Default_RequestLog_ReplicaIndex int32 = -1 +const Default_RequestLog_Finished bool = true + +func (m *RequestLog) GetAppId() string { + if m != nil && m.AppId != nil { + return *m.AppId + } + return "" +} + +func (m *RequestLog) GetModuleId() string { + if m != nil && m.ModuleId != nil { + return *m.ModuleId + } + return Default_RequestLog_ModuleId +} + +func (m *RequestLog) GetVersionId() string { + if m != nil && m.VersionId != nil { + return *m.VersionId + } + return "" +} + +func (m *RequestLog) GetRequestId() []byte { + if m != nil { + return m.RequestId + } + return nil +} + +func (m *RequestLog) GetOffset() *LogOffset { + if m != nil { + return m.Offset + } + return nil +} + +func (m *RequestLog) GetIp() string { + if m != nil && m.Ip != nil { + return *m.Ip + } + return "" +} + +func (m *RequestLog) GetNickname() string { + if m != nil && m.Nickname != nil { + return *m.Nickname + } + return "" +} + +func (m *RequestLog) GetStartTime() int64 { + if m != nil && m.StartTime != nil { + return *m.StartTime + } + return 0 +} + +func (m *RequestLog) GetEndTime() int64 { + if m != nil && m.EndTime != nil { + return *m.EndTime + } + return 0 +} + +func (m *RequestLog) GetLatency() int64 { + if m != nil && m.Latency != nil { + return *m.Latency + } + return 0 +} + +func (m *RequestLog) GetMcycles() int64 { + if m != nil && m.Mcycles != nil { + return *m.Mcycles + } + return 0 +} + +func (m *RequestLog) GetMethod() string { + if m != nil && m.Method != nil { + return *m.Method + } + return "" +} + +func (m *RequestLog) GetResource() string { + if m != nil && m.Resource != nil { + return *m.Resource + } + return "" +} + +func (m *RequestLog) GetHttpVersion() string { + if m != nil && m.HttpVersion != nil { + return *m.HttpVersion + } + return "" +} + +func (m *RequestLog) GetStatus() int32 { + if m != nil && m.Status != nil { + return *m.Status + } + return 0 +} + +func (m *RequestLog) GetResponseSize() int64 { + if m != nil && m.ResponseSize != nil { + return *m.ResponseSize + } + return 0 +} + +func (m *RequestLog) GetReferrer() string { + if m != nil && m.Referrer != nil { + return *m.Referrer + } + return "" +} + +func (m *RequestLog) GetUserAgent() string { + if m != nil && m.UserAgent != nil { + return *m.UserAgent + } + return "" +} + +func (m *RequestLog) GetUrlMapEntry() string { + if m != nil && m.UrlMapEntry != nil { + return *m.UrlMapEntry + } + return "" +} + +func (m *RequestLog) GetCombined() string { + if m != nil && m.Combined != nil { + return *m.Combined + } + return "" +} + +func (m *RequestLog) GetApiMcycles() int64 { + if m != nil && m.ApiMcycles != nil { + return *m.ApiMcycles + } + return 0 +} + +func (m *RequestLog) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host + } + return "" +} + +func (m *RequestLog) GetCost() float64 { + if m != nil && m.Cost != nil { + return *m.Cost + } + return 0 +} + +func (m *RequestLog) GetTaskQueueName() string { + if m != nil && m.TaskQueueName != nil { + return *m.TaskQueueName + } + return "" +} + +func (m *RequestLog) GetTaskName() string { + if m != nil && m.TaskName != nil { + return *m.TaskName + } + return "" +} + +func (m *RequestLog) GetWasLoadingRequest() bool { + if m != nil && m.WasLoadingRequest != nil { + return *m.WasLoadingRequest + } + return false +} + +func (m *RequestLog) GetPendingTime() int64 { + if m != nil && m.PendingTime != nil { + return *m.PendingTime + } + return 0 +} + +func (m *RequestLog) GetReplicaIndex() int32 { + if m != nil && m.ReplicaIndex != nil { + return *m.ReplicaIndex + } + return Default_RequestLog_ReplicaIndex +} + +func (m *RequestLog) GetFinished() bool { + if m != nil && m.Finished != nil { + return *m.Finished + } + return Default_RequestLog_Finished +} + +func (m *RequestLog) GetCloneKey() []byte { + if m != nil { + return m.CloneKey + } + return nil +} + +func (m *RequestLog) GetLine() []*LogLine { + if m != nil { + return m.Line + } + return nil +} + +func (m *RequestLog) GetLinesIncomplete() bool { + if m != nil && m.LinesIncomplete != nil { + return *m.LinesIncomplete + } + return false +} + +func (m *RequestLog) GetAppEngineRelease() []byte { + if m != nil { + return m.AppEngineRelease + } + return nil +} + +func (m *RequestLog) GetExitReason() int32 { + if m != nil && m.ExitReason != nil { + return *m.ExitReason + } + return 0 +} + +func (m *RequestLog) GetWasThrottledForTime() bool { + if m != nil && m.WasThrottledForTime != nil { + return *m.WasThrottledForTime + } + return false +} + +func (m *RequestLog) GetWasThrottledForRequests() bool { + if m != nil && m.WasThrottledForRequests != nil { + return *m.WasThrottledForRequests + } + return false +} + +func (m *RequestLog) GetThrottledTime() int64 { + if m != nil && m.ThrottledTime != nil { + return *m.ThrottledTime + } + return 0 +} + +func (m *RequestLog) GetServerName() []byte { + if m != nil { + return m.ServerName + } + return nil +} + +type LogModuleVersion struct { + ModuleId *string `protobuf:"bytes,1,opt,name=module_id,json=moduleId,def=default" json:"module_id,omitempty"` + VersionId *string `protobuf:"bytes,2,opt,name=version_id,json=versionId" json:"version_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogModuleVersion) Reset() { *m = LogModuleVersion{} } +func (m *LogModuleVersion) String() string { return proto.CompactTextString(m) } +func (*LogModuleVersion) ProtoMessage() {} +func (*LogModuleVersion) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{8} +} +func (m *LogModuleVersion) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogModuleVersion.Unmarshal(m, b) +} +func (m *LogModuleVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogModuleVersion.Marshal(b, m, deterministic) +} +func (dst *LogModuleVersion) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogModuleVersion.Merge(dst, src) +} +func (m *LogModuleVersion) XXX_Size() int { + return xxx_messageInfo_LogModuleVersion.Size(m) +} +func (m *LogModuleVersion) XXX_DiscardUnknown() { + xxx_messageInfo_LogModuleVersion.DiscardUnknown(m) +} + +var xxx_messageInfo_LogModuleVersion proto.InternalMessageInfo + +const Default_LogModuleVersion_ModuleId string = "default" + +func (m *LogModuleVersion) GetModuleId() string { + if m != nil && m.ModuleId != nil { + return *m.ModuleId + } + return Default_LogModuleVersion_ModuleId +} + +func (m *LogModuleVersion) GetVersionId() string { + if m != nil && m.VersionId != nil { + return *m.VersionId + } + return "" +} + +type LogReadRequest struct { + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + VersionId []string `protobuf:"bytes,2,rep,name=version_id,json=versionId" json:"version_id,omitempty"` + ModuleVersion []*LogModuleVersion `protobuf:"bytes,19,rep,name=module_version,json=moduleVersion" json:"module_version,omitempty"` + StartTime *int64 `protobuf:"varint,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int64 `protobuf:"varint,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + Offset *LogOffset `protobuf:"bytes,5,opt,name=offset" json:"offset,omitempty"` + RequestId [][]byte `protobuf:"bytes,6,rep,name=request_id,json=requestId" json:"request_id,omitempty"` + MinimumLogLevel *int32 `protobuf:"varint,7,opt,name=minimum_log_level,json=minimumLogLevel" json:"minimum_log_level,omitempty"` + IncludeIncomplete *bool `protobuf:"varint,8,opt,name=include_incomplete,json=includeIncomplete" json:"include_incomplete,omitempty"` + Count *int64 `protobuf:"varint,9,opt,name=count" json:"count,omitempty"` + CombinedLogRegex *string `protobuf:"bytes,14,opt,name=combined_log_regex,json=combinedLogRegex" json:"combined_log_regex,omitempty"` + HostRegex *string `protobuf:"bytes,15,opt,name=host_regex,json=hostRegex" json:"host_regex,omitempty"` + ReplicaIndex *int32 `protobuf:"varint,16,opt,name=replica_index,json=replicaIndex" json:"replica_index,omitempty"` + IncludeAppLogs *bool `protobuf:"varint,10,opt,name=include_app_logs,json=includeAppLogs" json:"include_app_logs,omitempty"` + AppLogsPerRequest *int32 `protobuf:"varint,17,opt,name=app_logs_per_request,json=appLogsPerRequest" json:"app_logs_per_request,omitempty"` + IncludeHost *bool `protobuf:"varint,11,opt,name=include_host,json=includeHost" json:"include_host,omitempty"` + IncludeAll *bool `protobuf:"varint,12,opt,name=include_all,json=includeAll" json:"include_all,omitempty"` + CacheIterator *bool `protobuf:"varint,13,opt,name=cache_iterator,json=cacheIterator" json:"cache_iterator,omitempty"` + NumShards *int32 `protobuf:"varint,18,opt,name=num_shards,json=numShards" json:"num_shards,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogReadRequest) Reset() { *m = LogReadRequest{} } +func (m *LogReadRequest) String() string { return proto.CompactTextString(m) } +func (*LogReadRequest) ProtoMessage() {} +func (*LogReadRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{9} +} +func (m *LogReadRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogReadRequest.Unmarshal(m, b) +} +func (m *LogReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogReadRequest.Marshal(b, m, deterministic) +} +func (dst *LogReadRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogReadRequest.Merge(dst, src) +} +func (m *LogReadRequest) XXX_Size() int { + return xxx_messageInfo_LogReadRequest.Size(m) +} +func (m *LogReadRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LogReadRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LogReadRequest proto.InternalMessageInfo + +func (m *LogReadRequest) GetAppId() string { + if m != nil && m.AppId != nil { + return *m.AppId + } + return "" +} + +func (m *LogReadRequest) GetVersionId() []string { + if m != nil { + return m.VersionId + } + return nil +} + +func (m *LogReadRequest) GetModuleVersion() []*LogModuleVersion { + if m != nil { + return m.ModuleVersion + } + return nil +} + +func (m *LogReadRequest) GetStartTime() int64 { + if m != nil && m.StartTime != nil { + return *m.StartTime + } + return 0 +} + +func (m *LogReadRequest) GetEndTime() int64 { + if m != nil && m.EndTime != nil { + return *m.EndTime + } + return 0 +} + +func (m *LogReadRequest) GetOffset() *LogOffset { + if m != nil { + return m.Offset + } + return nil +} + +func (m *LogReadRequest) GetRequestId() [][]byte { + if m != nil { + return m.RequestId + } + return nil +} + +func (m *LogReadRequest) GetMinimumLogLevel() int32 { + if m != nil && m.MinimumLogLevel != nil { + return *m.MinimumLogLevel + } + return 0 +} + +func (m *LogReadRequest) GetIncludeIncomplete() bool { + if m != nil && m.IncludeIncomplete != nil { + return *m.IncludeIncomplete + } + return false +} + +func (m *LogReadRequest) GetCount() int64 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *LogReadRequest) GetCombinedLogRegex() string { + if m != nil && m.CombinedLogRegex != nil { + return *m.CombinedLogRegex + } + return "" +} + +func (m *LogReadRequest) GetHostRegex() string { + if m != nil && m.HostRegex != nil { + return *m.HostRegex + } + return "" +} + +func (m *LogReadRequest) GetReplicaIndex() int32 { + if m != nil && m.ReplicaIndex != nil { + return *m.ReplicaIndex + } + return 0 +} + +func (m *LogReadRequest) GetIncludeAppLogs() bool { + if m != nil && m.IncludeAppLogs != nil { + return *m.IncludeAppLogs + } + return false +} + +func (m *LogReadRequest) GetAppLogsPerRequest() int32 { + if m != nil && m.AppLogsPerRequest != nil { + return *m.AppLogsPerRequest + } + return 0 +} + +func (m *LogReadRequest) GetIncludeHost() bool { + if m != nil && m.IncludeHost != nil { + return *m.IncludeHost + } + return false +} + +func (m *LogReadRequest) GetIncludeAll() bool { + if m != nil && m.IncludeAll != nil { + return *m.IncludeAll + } + return false +} + +func (m *LogReadRequest) GetCacheIterator() bool { + if m != nil && m.CacheIterator != nil { + return *m.CacheIterator + } + return false +} + +func (m *LogReadRequest) GetNumShards() int32 { + if m != nil && m.NumShards != nil { + return *m.NumShards + } + return 0 +} + +type LogReadResponse struct { + Log []*RequestLog `protobuf:"bytes,1,rep,name=log" json:"log,omitempty"` + Offset *LogOffset `protobuf:"bytes,2,opt,name=offset" json:"offset,omitempty"` + LastEndTime *int64 `protobuf:"varint,3,opt,name=last_end_time,json=lastEndTime" json:"last_end_time,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogReadResponse) Reset() { *m = LogReadResponse{} } +func (m *LogReadResponse) String() string { return proto.CompactTextString(m) } +func (*LogReadResponse) ProtoMessage() {} +func (*LogReadResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{10} +} +func (m *LogReadResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogReadResponse.Unmarshal(m, b) +} +func (m *LogReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogReadResponse.Marshal(b, m, deterministic) +} +func (dst *LogReadResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogReadResponse.Merge(dst, src) +} +func (m *LogReadResponse) XXX_Size() int { + return xxx_messageInfo_LogReadResponse.Size(m) +} +func (m *LogReadResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LogReadResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LogReadResponse proto.InternalMessageInfo + +func (m *LogReadResponse) GetLog() []*RequestLog { + if m != nil { + return m.Log + } + return nil +} + +func (m *LogReadResponse) GetOffset() *LogOffset { + if m != nil { + return m.Offset + } + return nil +} + +func (m *LogReadResponse) GetLastEndTime() int64 { + if m != nil && m.LastEndTime != nil { + return *m.LastEndTime + } + return 0 +} + +type LogUsageRecord struct { + VersionId *string `protobuf:"bytes,1,opt,name=version_id,json=versionId" json:"version_id,omitempty"` + StartTime *int32 `protobuf:"varint,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int32 `protobuf:"varint,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + Count *int64 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` + TotalSize *int64 `protobuf:"varint,5,opt,name=total_size,json=totalSize" json:"total_size,omitempty"` + Records *int32 `protobuf:"varint,6,opt,name=records" json:"records,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogUsageRecord) Reset() { *m = LogUsageRecord{} } +func (m *LogUsageRecord) String() string { return proto.CompactTextString(m) } +func (*LogUsageRecord) ProtoMessage() {} +func (*LogUsageRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{11} +} +func (m *LogUsageRecord) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogUsageRecord.Unmarshal(m, b) +} +func (m *LogUsageRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogUsageRecord.Marshal(b, m, deterministic) +} +func (dst *LogUsageRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogUsageRecord.Merge(dst, src) +} +func (m *LogUsageRecord) XXX_Size() int { + return xxx_messageInfo_LogUsageRecord.Size(m) +} +func (m *LogUsageRecord) XXX_DiscardUnknown() { + xxx_messageInfo_LogUsageRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_LogUsageRecord proto.InternalMessageInfo + +func (m *LogUsageRecord) GetVersionId() string { + if m != nil && m.VersionId != nil { + return *m.VersionId + } + return "" +} + +func (m *LogUsageRecord) GetStartTime() int32 { + if m != nil && m.StartTime != nil { + return *m.StartTime + } + return 0 +} + +func (m *LogUsageRecord) GetEndTime() int32 { + if m != nil && m.EndTime != nil { + return *m.EndTime + } + return 0 +} + +func (m *LogUsageRecord) GetCount() int64 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *LogUsageRecord) GetTotalSize() int64 { + if m != nil && m.TotalSize != nil { + return *m.TotalSize + } + return 0 +} + +func (m *LogUsageRecord) GetRecords() int32 { + if m != nil && m.Records != nil { + return *m.Records + } + return 0 +} + +type LogUsageRequest struct { + AppId *string `protobuf:"bytes,1,req,name=app_id,json=appId" json:"app_id,omitempty"` + VersionId []string `protobuf:"bytes,2,rep,name=version_id,json=versionId" json:"version_id,omitempty"` + StartTime *int32 `protobuf:"varint,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + EndTime *int32 `protobuf:"varint,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + ResolutionHours *uint32 `protobuf:"varint,5,opt,name=resolution_hours,json=resolutionHours,def=1" json:"resolution_hours,omitempty"` + CombineVersions *bool `protobuf:"varint,6,opt,name=combine_versions,json=combineVersions" json:"combine_versions,omitempty"` + UsageVersion *int32 `protobuf:"varint,7,opt,name=usage_version,json=usageVersion" json:"usage_version,omitempty"` + VersionsOnly *bool `protobuf:"varint,8,opt,name=versions_only,json=versionsOnly" json:"versions_only,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogUsageRequest) Reset() { *m = LogUsageRequest{} } +func (m *LogUsageRequest) String() string { return proto.CompactTextString(m) } +func (*LogUsageRequest) ProtoMessage() {} +func (*LogUsageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{12} +} +func (m *LogUsageRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogUsageRequest.Unmarshal(m, b) +} +func (m *LogUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogUsageRequest.Marshal(b, m, deterministic) +} +func (dst *LogUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogUsageRequest.Merge(dst, src) +} +func (m *LogUsageRequest) XXX_Size() int { + return xxx_messageInfo_LogUsageRequest.Size(m) +} +func (m *LogUsageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LogUsageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LogUsageRequest proto.InternalMessageInfo + +const Default_LogUsageRequest_ResolutionHours uint32 = 1 + +func (m *LogUsageRequest) GetAppId() string { + if m != nil && m.AppId != nil { + return *m.AppId + } + return "" +} + +func (m *LogUsageRequest) GetVersionId() []string { + if m != nil { + return m.VersionId + } + return nil +} + +func (m *LogUsageRequest) GetStartTime() int32 { + if m != nil && m.StartTime != nil { + return *m.StartTime + } + return 0 +} + +func (m *LogUsageRequest) GetEndTime() int32 { + if m != nil && m.EndTime != nil { + return *m.EndTime + } + return 0 +} + +func (m *LogUsageRequest) GetResolutionHours() uint32 { + if m != nil && m.ResolutionHours != nil { + return *m.ResolutionHours + } + return Default_LogUsageRequest_ResolutionHours +} + +func (m *LogUsageRequest) GetCombineVersions() bool { + if m != nil && m.CombineVersions != nil { + return *m.CombineVersions + } + return false +} + +func (m *LogUsageRequest) GetUsageVersion() int32 { + if m != nil && m.UsageVersion != nil { + return *m.UsageVersion + } + return 0 +} + +func (m *LogUsageRequest) GetVersionsOnly() bool { + if m != nil && m.VersionsOnly != nil { + return *m.VersionsOnly + } + return false +} + +type LogUsageResponse struct { + Usage []*LogUsageRecord `protobuf:"bytes,1,rep,name=usage" json:"usage,omitempty"` + Summary *LogUsageRecord `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogUsageResponse) Reset() { *m = LogUsageResponse{} } +func (m *LogUsageResponse) String() string { return proto.CompactTextString(m) } +func (*LogUsageResponse) ProtoMessage() {} +func (*LogUsageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_log_service_f054fd4b5012319d, []int{13} +} +func (m *LogUsageResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogUsageResponse.Unmarshal(m, b) +} +func (m *LogUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogUsageResponse.Marshal(b, m, deterministic) +} +func (dst *LogUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogUsageResponse.Merge(dst, src) +} +func (m *LogUsageResponse) XXX_Size() int { + return xxx_messageInfo_LogUsageResponse.Size(m) +} +func (m *LogUsageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LogUsageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LogUsageResponse proto.InternalMessageInfo + +func (m *LogUsageResponse) GetUsage() []*LogUsageRecord { + if m != nil { + return m.Usage + } + return nil +} + +func (m *LogUsageResponse) GetSummary() *LogUsageRecord { + if m != nil { + return m.Summary + } + return nil +} + +func init() { + proto.RegisterType((*LogServiceError)(nil), "appengine.LogServiceError") + proto.RegisterType((*UserAppLogLine)(nil), "appengine.UserAppLogLine") + proto.RegisterType((*UserAppLogGroup)(nil), "appengine.UserAppLogGroup") + proto.RegisterType((*FlushRequest)(nil), "appengine.FlushRequest") + proto.RegisterType((*SetStatusRequest)(nil), "appengine.SetStatusRequest") + proto.RegisterType((*LogOffset)(nil), "appengine.LogOffset") + proto.RegisterType((*LogLine)(nil), "appengine.LogLine") + proto.RegisterType((*RequestLog)(nil), "appengine.RequestLog") + proto.RegisterType((*LogModuleVersion)(nil), "appengine.LogModuleVersion") + proto.RegisterType((*LogReadRequest)(nil), "appengine.LogReadRequest") + proto.RegisterType((*LogReadResponse)(nil), "appengine.LogReadResponse") + proto.RegisterType((*LogUsageRecord)(nil), "appengine.LogUsageRecord") + proto.RegisterType((*LogUsageRequest)(nil), "appengine.LogUsageRequest") + proto.RegisterType((*LogUsageResponse)(nil), "appengine.LogUsageResponse") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/log/log_service.proto", fileDescriptor_log_service_f054fd4b5012319d) +} + +var fileDescriptor_log_service_f054fd4b5012319d = []byte{ + // 1553 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x72, 0xdb, 0xc6, + 0x15, 0x2e, 0x48, 0x51, 0x24, 0x0f, 0x49, 0x91, 0x5a, 0xcb, 0xce, 0xda, 0xae, 0x6b, 0x1a, 0x4e, + 0x1c, 0xd6, 0x93, 0x48, 0x93, 0xa4, 0x57, 0xca, 0x95, 0xd3, 0x2a, 0x8e, 0x26, 0xb4, 0xd5, 0x40, + 0x72, 0x3a, 0xd3, 0x1b, 0x0c, 0x0a, 0x1c, 0x81, 0x18, 0x2f, 0xb1, 0xc8, 0xee, 0xc2, 0x91, 0x72, + 0xdb, 0xdb, 0x3e, 0x46, 0x1f, 0xa2, 0xaf, 0xd2, 0xb7, 0xe9, 0xec, 0xd9, 0x05, 0x44, 0x2a, 0x4d, + 0xc6, 0x33, 0xb9, 0xe0, 0x10, 0xfb, 0x9d, 0x83, 0xdd, 0xf3, 0xf3, 0x9d, 0x6f, 0x01, 0xc7, 0xb9, + 0x94, 0xb9, 0xc0, 0xc3, 0x5c, 0x8a, 0xa4, 0xcc, 0x0f, 0xa5, 0xca, 0x8f, 0x92, 0xaa, 0xc2, 0x32, + 0x2f, 0x4a, 0x3c, 0x2a, 0x4a, 0x83, 0xaa, 0x4c, 0xc4, 0x91, 0x90, 0xb9, 0xfd, 0xc5, 0x1a, 0xd5, + 0xbb, 0x22, 0xc5, 0xc3, 0x4a, 0x49, 0x23, 0xd9, 0xb0, 0xf5, 0x0c, 0x5f, 0xc3, 0x74, 0x29, 0xf3, + 0x73, 0x67, 0x3e, 0x51, 0x4a, 0xaa, 0xf0, 0x4b, 0x18, 0xd2, 0xc3, 0x9f, 0x65, 0x86, 0x6c, 0x17, + 0x3a, 0x67, 0xdf, 0xce, 0x7e, 0xc7, 0xee, 0xc0, 0xf4, 0xf4, 0xf5, 0xf7, 0x2f, 0x96, 0xa7, 0x7f, + 0x89, 0xa3, 0x93, 0xef, 0xde, 0x9c, 0x9c, 0x5f, 0xcc, 0x02, 0xb6, 0x0f, 0x93, 0xf3, 0x8b, 0xb3, + 0xe8, 0xc5, 0xcb, 0x93, 0xf8, 0x24, 0x8a, 0xce, 0xa2, 0x59, 0x27, 0xcc, 0x61, 0xef, 0x8d, 0x46, + 0xf5, 0xa2, 0xaa, 0x96, 0x32, 0x5f, 0x16, 0x25, 0xb2, 0x8f, 0x60, 0xcf, 0x14, 0x6b, 0xd4, 0x26, + 0x59, 0x57, 0x71, 0xad, 0x31, 0xe5, 0xc1, 0xbc, 0xb3, 0xe8, 0x46, 0x93, 0x16, 0x7d, 0xa3, 0x31, + 0x65, 0x07, 0xd0, 0x13, 0xf8, 0x0e, 0x05, 0xef, 0x90, 0xd5, 0x2d, 0x18, 0x87, 0xfe, 0x1a, 0xb5, + 0x4e, 0x72, 0xe4, 0xdd, 0x79, 0x67, 0x31, 0x8c, 0x9a, 0x65, 0xf8, 0x12, 0xa6, 0x37, 0x07, 0xbd, + 0x54, 0xb2, 0xae, 0xd8, 0x9f, 0x60, 0x60, 0x73, 0x15, 0x45, 0x89, 0xbc, 0x33, 0xef, 0x2e, 0x46, + 0x9f, 0xdf, 0x3f, 0x6c, 0x33, 0x3d, 0xdc, 0x0e, 0x2b, 0xea, 0x0b, 0xf7, 0x10, 0x86, 0x30, 0xfe, + 0x5a, 0xd4, 0x7a, 0x15, 0xe1, 0x0f, 0x35, 0x6a, 0xc3, 0x18, 0xec, 0x08, 0x99, 0x6b, 0x1e, 0xcc, + 0x83, 0xc5, 0x38, 0xa2, 0xe7, 0xf0, 0x39, 0xcc, 0xce, 0xd1, 0x9c, 0x9b, 0xc4, 0xd4, 0xba, 0xf1, + 0xbb, 0x07, 0xbb, 0x9a, 0x00, 0xca, 0x67, 0x18, 0xf9, 0x55, 0xf8, 0x1c, 0x86, 0x4b, 0x99, 0x9f, + 0x5d, 0x5e, 0x6a, 0x34, 0xec, 0x11, 0x80, 0x72, 0xfe, 0x71, 0x91, 0xf9, 0x2d, 0x87, 0x1e, 0x39, + 0xcd, 0xc2, 0x0b, 0xe8, 0x37, 0x65, 0x62, 0xb0, 0x63, 0x0b, 0xe2, 0x8b, 0x43, 0xcf, 0xdb, 0x35, + 0xe9, 0x35, 0x35, 0x79, 0x0c, 0x23, 0x9b, 0xe6, 0x76, 0x5d, 0x40, 0xc8, 0xfc, 0x95, 0x2f, 0xcd, + 0x3f, 0x01, 0xc0, 0x47, 0xb9, 0x94, 0x39, 0xbb, 0x0b, 0xbb, 0x49, 0x55, 0xb9, 0xf3, 0xad, 0x6b, + 0x2f, 0xa9, 0xaa, 0xd3, 0x8c, 0x7d, 0x08, 0xc3, 0xb5, 0xcc, 0x6a, 0x81, 0xd6, 0xf2, 0xd1, 0x3c, + 0x58, 0x0c, 0x8f, 0xfb, 0x19, 0x5e, 0x26, 0xb5, 0x30, 0xd1, 0xc0, 0x59, 0x4e, 0x33, 0x9b, 0xc0, + 0x3b, 0x54, 0xba, 0x90, 0xa5, 0x75, 0xeb, 0xd0, 0x06, 0x43, 0x8f, 0x38, 0xf3, 0x46, 0x7e, 0x36, + 0x94, 0xcd, 0xfc, 0xd8, 0x27, 0xb0, 0x2b, 0xa9, 0x10, 0xfc, 0xe9, 0x3c, 0x58, 0x8c, 0x3e, 0x3f, + 0xd8, 0xe8, 0x47, 0x5b, 0xa4, 0xc8, 0xfb, 0xb0, 0x3d, 0xe8, 0x14, 0x15, 0xdf, 0xa1, 0x33, 0x3a, + 0x45, 0xc5, 0x1e, 0xc0, 0xa0, 0x2c, 0xd2, 0xb7, 0x65, 0xb2, 0x46, 0xde, 0xb3, 0x01, 0x46, 0xed, + 0xda, 0x1e, 0xac, 0x4d, 0xa2, 0x4c, 0x4c, 0x45, 0xdb, 0xa5, 0xa2, 0x0d, 0x09, 0xb9, 0xb0, 0x95, + 0xbb, 0x0f, 0x03, 0x2c, 0x33, 0x67, 0xec, 0x93, 0xb1, 0x8f, 0x65, 0x46, 0x26, 0x0e, 0x7d, 0x91, + 0x18, 0x2c, 0xd3, 0x6b, 0x3e, 0x70, 0x16, 0xbf, 0x24, 0xb2, 0xa5, 0xd7, 0xa9, 0x40, 0xcd, 0x87, + 0xce, 0xe2, 0x97, 0xb6, 0xd7, 0x6b, 0x34, 0x2b, 0x99, 0x71, 0x70, 0xbd, 0x76, 0x2b, 0x1b, 0xa1, + 0x42, 0x2d, 0x6b, 0x95, 0x22, 0x1f, 0x91, 0xa5, 0x5d, 0xb3, 0x27, 0x30, 0x5e, 0x19, 0x53, 0xc5, + 0xbe, 0x58, 0x7c, 0x4c, 0xf6, 0x91, 0xc5, 0xbe, 0x77, 0xd0, 0x06, 0x85, 0x26, 0xd4, 0x60, 0xbf, + 0x62, 0x4f, 0x61, 0xa2, 0x50, 0x57, 0xb2, 0xd4, 0x18, 0xeb, 0xe2, 0x27, 0xe4, 0x7b, 0x14, 0xce, + 0xb8, 0x01, 0xcf, 0x8b, 0x9f, 0xd0, 0x9d, 0x7d, 0x89, 0x4a, 0xa1, 0xe2, 0x53, 0x57, 0x9d, 0x66, + 0x6d, 0xab, 0x53, 0x6b, 0x54, 0x71, 0x92, 0x63, 0x69, 0xf8, 0x8c, 0xac, 0x43, 0x8b, 0xbc, 0xb0, + 0x00, 0x0b, 0x61, 0x52, 0x2b, 0x11, 0xaf, 0x93, 0x2a, 0xc6, 0xd2, 0xa8, 0x6b, 0xbe, 0xef, 0x62, + 0xab, 0x95, 0x78, 0x95, 0x54, 0x27, 0x16, 0xb2, 0xdb, 0xa7, 0x72, 0xfd, 0x8f, 0xa2, 0xc4, 0x8c, + 0x33, 0x97, 0x5a, 0xb3, 0xb6, 0x0c, 0x4c, 0xaa, 0x22, 0x6e, 0x8a, 0x75, 0x67, 0x1e, 0x2c, 0xba, + 0x11, 0x24, 0x55, 0xf1, 0xca, 0xd7, 0x8b, 0xc1, 0xce, 0x4a, 0x6a, 0xc3, 0x0f, 0xe8, 0x64, 0x7a, + 0xb6, 0x58, 0x6a, 0xb1, 0xbb, 0xf3, 0x60, 0x11, 0x44, 0xf4, 0xcc, 0x9e, 0xc1, 0xd4, 0x24, 0xfa, + 0x6d, 0xfc, 0x43, 0x8d, 0x35, 0xc6, 0xd4, 0xe8, 0x7b, 0xf4, 0xca, 0xc4, 0xc2, 0xdf, 0x59, 0xf4, + 0xb5, 0xed, 0xf6, 0x43, 0x18, 0x92, 0x1f, 0x79, 0x7c, 0xe0, 0x92, 0xb5, 0x00, 0x19, 0x0f, 0xe1, + 0xce, 0x8f, 0x89, 0x8e, 0x85, 0x4c, 0xb2, 0xa2, 0xcc, 0x63, 0xcf, 0x3e, 0xce, 0xe7, 0xc1, 0x62, + 0x10, 0xed, 0xff, 0x98, 0xe8, 0xa5, 0xb3, 0x34, 0x83, 0xfb, 0x04, 0xc6, 0x15, 0x96, 0xe4, 0x4b, + 0xfc, 0xb8, 0x4f, 0xe1, 0x8f, 0x3c, 0x46, 0x1c, 0xf9, 0xd8, 0x36, 0xa0, 0x12, 0x45, 0x9a, 0xc4, + 0x45, 0x99, 0xe1, 0x15, 0x7f, 0x30, 0x0f, 0x16, 0xbd, 0xe3, 0xce, 0xa7, 0x9f, 0xd9, 0x26, 0x90, + 0xe1, 0xd4, 0xe2, 0x6c, 0x0e, 0x83, 0xcb, 0xa2, 0x2c, 0xf4, 0x0a, 0x33, 0xfe, 0xd0, 0x1e, 0x78, + 0xbc, 0x63, 0x54, 0x8d, 0x51, 0x8b, 0xda, 0xd0, 0x53, 0x21, 0x4b, 0x8c, 0xdf, 0xe2, 0x35, 0xff, + 0x3d, 0x09, 0xc0, 0x80, 0x80, 0x6f, 0xf1, 0x9a, 0x3d, 0x83, 0x1d, 0x52, 0xab, 0x47, 0xa4, 0x56, + 0x6c, 0x7b, 0x3a, 0x48, 0xa6, 0xc8, 0xce, 0xfe, 0x08, 0x33, 0xfb, 0xaf, 0xe3, 0xa2, 0x4c, 0xe5, + 0xba, 0x12, 0x68, 0x90, 0x7f, 0x48, 0xf9, 0x4d, 0x09, 0x3f, 0x6d, 0x61, 0xf6, 0x09, 0x30, 0x3b, + 0xed, 0x6e, 0x9b, 0x58, 0xa1, 0xc0, 0x44, 0x23, 0x7f, 0x46, 0x07, 0xcf, 0x92, 0xaa, 0x3a, 0x21, + 0x43, 0xe4, 0x70, 0xdb, 0x49, 0xbc, 0x2a, 0x4c, 0xac, 0x30, 0xd1, 0xb2, 0xe4, 0x7f, 0xb0, 0x69, + 0x46, 0x60, 0xa1, 0x88, 0x10, 0xf6, 0x05, 0xdc, 0xb3, 0xc5, 0x35, 0x2b, 0x25, 0x8d, 0x11, 0x98, + 0xc5, 0x97, 0x52, 0xb9, 0xb2, 0x3d, 0xa6, 0xf3, 0x6d, 0xe9, 0x2f, 0x1a, 0xe3, 0xd7, 0x52, 0x51, + 0xf9, 0xbe, 0x84, 0x07, 0x3f, 0x7f, 0xc9, 0xf7, 0x45, 0xf3, 0x39, 0xbd, 0xf8, 0xc1, 0xad, 0x17, + 0x7d, 0x77, 0x34, 0xdd, 0x17, 0xed, 0x8b, 0x74, 0xd2, 0x13, 0x6a, 0xd0, 0xa4, 0x45, 0xe9, 0x8c, + 0xc7, 0x30, 0xb2, 0x97, 0x1a, 0x2a, 0x47, 0x8a, 0x90, 0x12, 0x04, 0x07, 0x59, 0x5a, 0x84, 0x7f, + 0x83, 0xd9, 0x52, 0xe6, 0xaf, 0x48, 0xc8, 0x9a, 0x81, 0xdb, 0xd2, 0xbc, 0xe0, 0x7d, 0x35, 0x2f, + 0xd8, 0xd2, 0xbc, 0xf0, 0xbf, 0x3d, 0xd8, 0x5b, 0xca, 0x3c, 0xc2, 0x24, 0x6b, 0x28, 0xf5, 0x0b, + 0x12, 0x7b, 0x7b, 0xa3, 0xee, 0xb6, 0x78, 0x7e, 0x05, 0x7b, 0x3e, 0x9a, 0x46, 0x23, 0xee, 0x10, + 0x0f, 0x1e, 0x6e, 0xf3, 0x60, 0x2b, 0x85, 0x68, 0xb2, 0xde, 0xca, 0x68, 0x5b, 0x07, 0xbb, 0x54, + 0xa9, 0x5f, 0xd0, 0xc1, 0x1d, 0x32, 0xb6, 0x3a, 0x78, 0xa3, 0xcd, 0xbd, 0xf7, 0xd0, 0xe6, 0x6d, + 0xa1, 0xdf, 0x9d, 0x77, 0xb7, 0x85, 0xfe, 0x39, 0xec, 0xaf, 0x8b, 0xb2, 0x58, 0xd7, 0xeb, 0x98, + 0xae, 0x60, 0xba, 0xb5, 0xfa, 0xc4, 0xa6, 0xa9, 0x37, 0x58, 0x46, 0xd3, 0xfd, 0xf5, 0x29, 0xb0, + 0xa2, 0x4c, 0x45, 0x9d, 0xe1, 0x26, 0x9d, 0x07, 0x6e, 0x5c, 0xbd, 0x65, 0x83, 0xd0, 0x07, 0xd0, + 0x4b, 0x65, 0x5d, 0x1a, 0x3e, 0xa4, 0xf8, 0xdd, 0xc2, 0xd2, 0xbc, 0x91, 0x23, 0x3a, 0x51, 0x61, + 0x8e, 0x57, 0x7c, 0x8f, 0x7a, 0x35, 0x6b, 0x2c, 0xd4, 0xa5, 0x1c, 0xaf, 0x6c, 0xf4, 0x56, 0x83, + 0xbc, 0x97, 0x53, 0xcb, 0xa1, 0x45, 0x9c, 0xf9, 0xe9, 0xed, 0x71, 0x9f, 0x51, 0xe4, 0xdb, 0xa3, + 0xbe, 0x80, 0x59, 0x13, 0xb6, 0xed, 0x35, 0x7d, 0x23, 0x00, 0x05, 0xbd, 0xe7, 0x71, 0xf7, 0x75, + 0xa1, 0xd9, 0x11, 0x1c, 0x34, 0x1e, 0x71, 0x85, 0x2d, 0xf3, 0xf9, 0x3e, 0xed, 0xba, 0x9f, 0x38, + 0xb7, 0xbf, 0xa2, 0xda, 0x50, 0xa4, 0x66, 0x6b, 0x92, 0xcd, 0x11, 0x6d, 0x3b, 0xf2, 0xd8, 0x37, + 0x56, 0x29, 0x1f, 0xc3, 0xa8, 0x3d, 0x5d, 0x08, 0x3e, 0x26, 0x0f, 0x68, 0x0e, 0x16, 0xc2, 0x8e, + 0x4d, 0x9a, 0xa4, 0x2b, 0x8c, 0x0b, 0x83, 0x2a, 0x31, 0x52, 0xf1, 0x09, 0xf9, 0x4c, 0x08, 0x3d, + 0xf5, 0xa0, 0xad, 0x44, 0x59, 0xaf, 0x63, 0xbd, 0x4a, 0x54, 0xa6, 0x39, 0xa3, 0x88, 0x86, 0x65, + 0xbd, 0x3e, 0x27, 0x20, 0xfc, 0x57, 0x40, 0xdf, 0x83, 0x8e, 0xdb, 0xee, 0xb2, 0x61, 0x1f, 0x43, + 0x57, 0xc8, 0x9c, 0x07, 0xc4, 0xcd, 0xbb, 0x1b, 0x2c, 0xb9, 0xf9, 0xc6, 0x88, 0xac, 0xc7, 0x06, + 0xa3, 0x3a, 0xef, 0xc1, 0xa8, 0x10, 0x26, 0x22, 0xd1, 0x26, 0x6e, 0xf9, 0xe9, 0xc8, 0x3b, 0xb2, + 0xe0, 0x89, 0xe3, 0x68, 0xf8, 0x9f, 0x80, 0x46, 0xed, 0x8d, 0xfd, 0xac, 0x89, 0x30, 0x95, 0xea, + 0xf6, 0x4c, 0x05, 0xb7, 0x86, 0xf3, 0xd6, 0x3c, 0x74, 0x5c, 0x7e, 0xff, 0x7f, 0x1e, 0xba, 0x64, + 0x6c, 0xe7, 0xa1, 0xe5, 0xd9, 0xce, 0x26, 0xcf, 0x1e, 0x01, 0x18, 0x69, 0x12, 0xe1, 0xee, 0xe1, + 0x9e, 0x9b, 0x2f, 0x42, 0xe8, 0x12, 0xe6, 0xd0, 0x57, 0x14, 0x97, 0xe6, 0xbb, 0x6e, 0x3b, 0xbf, + 0x0c, 0xff, 0xdd, 0xa1, 0x4a, 0xfa, 0xd0, 0x7f, 0x8b, 0x4c, 0xfc, 0x7c, 0xc4, 0x7b, 0xbf, 0x36, + 0xe2, 0xbd, 0xcd, 0x11, 0x9f, 0xd9, 0xcf, 0x11, 0x51, 0x1b, 0xbb, 0xf7, 0x4a, 0xd6, 0x4a, 0x53, + 0x0a, 0x93, 0xe3, 0xe0, 0xb3, 0x68, 0x7a, 0x63, 0xfa, 0xc6, 0x5a, 0xec, 0x25, 0xe3, 0x07, 0xa7, + 0xd1, 0x23, 0x97, 0xd4, 0x20, 0x9a, 0x7a, 0xdc, 0x8b, 0x0e, 0x7d, 0xa0, 0xd4, 0x36, 0xb1, 0x56, + 0xb8, 0xdc, 0xa8, 0x8f, 0x09, 0x6c, 0xa4, 0xe9, 0x29, 0x4c, 0x9a, 0x7d, 0x62, 0x59, 0x8a, 0x6b, + 0x3f, 0xe2, 0xe3, 0x06, 0x3c, 0x2b, 0xc5, 0x75, 0x78, 0x45, 0x2a, 0xed, 0xab, 0xe4, 0x09, 0x77, + 0x04, 0x3d, 0xda, 0xc8, 0x53, 0xee, 0xfe, 0x36, 0x8d, 0x36, 0xc8, 0x10, 0x39, 0x3f, 0xf6, 0x05, + 0xf4, 0x75, 0xbd, 0x5e, 0x27, 0xea, 0xda, 0x33, 0xef, 0x57, 0x5e, 0x69, 0x3c, 0xbf, 0xea, 0xfd, + 0xdd, 0x92, 0xf6, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0xd9, 0xa0, 0xf8, 0x48, 0x0d, 0x00, + 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/log/log_service.proto b/upstream/vendor/google.golang.org/appengine/internal/log/log_service.proto new file mode 100644 index 00000000000..8981dc47577 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/log/log_service.proto @@ -0,0 +1,150 @@ +syntax = "proto2"; +option go_package = "log"; + +package appengine; + +message LogServiceError { + enum ErrorCode { + OK = 0; + INVALID_REQUEST = 1; + STORAGE_ERROR = 2; + } +} + +message UserAppLogLine { + required int64 timestamp_usec = 1; + required int64 level = 2; + required string message = 3; +} + +message UserAppLogGroup { + repeated UserAppLogLine log_line = 2; +} + +message FlushRequest { + optional bytes logs = 1; +} + +message SetStatusRequest { + required string status = 1; +} + + +message LogOffset { + optional bytes request_id = 1; +} + +message LogLine { + required int64 time = 1; + required int32 level = 2; + required string log_message = 3; +} + +message RequestLog { + required string app_id = 1; + optional string module_id = 37 [default="default"]; + required string version_id = 2; + required bytes request_id = 3; + optional LogOffset offset = 35; + required string ip = 4; + optional string nickname = 5; + required int64 start_time = 6; + required int64 end_time = 7; + required int64 latency = 8; + required int64 mcycles = 9; + required string method = 10; + required string resource = 11; + required string http_version = 12; + required int32 status = 13; + required int64 response_size = 14; + optional string referrer = 15; + optional string user_agent = 16; + required string url_map_entry = 17; + required string combined = 18; + optional int64 api_mcycles = 19; + optional string host = 20; + optional double cost = 21; + + optional string task_queue_name = 22; + optional string task_name = 23; + + optional bool was_loading_request = 24; + optional int64 pending_time = 25; + optional int32 replica_index = 26 [default = -1]; + optional bool finished = 27 [default = true]; + optional bytes clone_key = 28; + + repeated LogLine line = 29; + + optional bool lines_incomplete = 36; + optional bytes app_engine_release = 38; + + optional int32 exit_reason = 30; + optional bool was_throttled_for_time = 31; + optional bool was_throttled_for_requests = 32; + optional int64 throttled_time = 33; + + optional bytes server_name = 34; +} + +message LogModuleVersion { + optional string module_id = 1 [default="default"]; + optional string version_id = 2; +} + +message LogReadRequest { + required string app_id = 1; + repeated string version_id = 2; + repeated LogModuleVersion module_version = 19; + + optional int64 start_time = 3; + optional int64 end_time = 4; + optional LogOffset offset = 5; + repeated bytes request_id = 6; + + optional int32 minimum_log_level = 7; + optional bool include_incomplete = 8; + optional int64 count = 9; + + optional string combined_log_regex = 14; + optional string host_regex = 15; + optional int32 replica_index = 16; + + optional bool include_app_logs = 10; + optional int32 app_logs_per_request = 17; + optional bool include_host = 11; + optional bool include_all = 12; + optional bool cache_iterator = 13; + optional int32 num_shards = 18; +} + +message LogReadResponse { + repeated RequestLog log = 1; + optional LogOffset offset = 2; + optional int64 last_end_time = 3; +} + +message LogUsageRecord { + optional string version_id = 1; + optional int32 start_time = 2; + optional int32 end_time = 3; + optional int64 count = 4; + optional int64 total_size = 5; + optional int32 records = 6; +} + +message LogUsageRequest { + required string app_id = 1; + repeated string version_id = 2; + optional int32 start_time = 3; + optional int32 end_time = 4; + optional uint32 resolution_hours = 5 [default = 1]; + optional bool combine_versions = 6; + optional int32 usage_version = 7; + optional bool versions_only = 8; +} + +message LogUsageResponse { + repeated LogUsageRecord usage = 1; + optional LogUsageRecord summary = 2; +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/main.go b/upstream/vendor/google.golang.org/appengine/internal/main.go new file mode 100644 index 00000000000..afd0ae84fdf --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/main.go @@ -0,0 +1,17 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build appengine +// +build appengine + +package internal + +import ( + "appengine_internal" +) + +func Main() { + MainPath = "" + appengine_internal.Main() +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/main_common.go b/upstream/vendor/google.golang.org/appengine/internal/main_common.go new file mode 100644 index 00000000000..357dce4dd01 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/main_common.go @@ -0,0 +1,7 @@ +package internal + +// MainPath stores the file path of the main package. On App Engine Standard +// using Go version 1.9 and below, this will be unset. On App Engine Flex and +// App Engine Standard second-gen (Go 1.11 and above), this will be the +// filepath to package main. +var MainPath string diff --git a/upstream/vendor/google.golang.org/appengine/internal/main_vm.go b/upstream/vendor/google.golang.org/appengine/internal/main_vm.go new file mode 100644 index 00000000000..86a8caf06f3 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/main_vm.go @@ -0,0 +1,70 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +//go:build !appengine +// +build !appengine + +package internal + +import ( + "io" + "log" + "net/http" + "net/url" + "os" + "path/filepath" + "runtime" +) + +func Main() { + MainPath = filepath.Dir(findMainPath()) + installHealthChecker(http.DefaultServeMux) + + port := "8080" + if s := os.Getenv("PORT"); s != "" { + port = s + } + + host := "" + if IsDevAppServer() { + host = "127.0.0.1" + } + if err := http.ListenAndServe(host+":"+port, Middleware(http.DefaultServeMux)); err != nil { + log.Fatalf("http.ListenAndServe: %v", err) + } +} + +// Find the path to package main by looking at the root Caller. +func findMainPath() string { + pc := make([]uintptr, 100) + n := runtime.Callers(2, pc) + frames := runtime.CallersFrames(pc[:n]) + for { + frame, more := frames.Next() + // Tests won't have package main, instead they have testing.tRunner + if frame.Function == "main.main" || frame.Function == "testing.tRunner" { + return frame.File + } + if !more { + break + } + } + return "" +} + +func installHealthChecker(mux *http.ServeMux) { + // If no health check handler has been installed by this point, add a trivial one. + const healthPath = "/_ah/health" + hreq := &http.Request{ + Method: "GET", + URL: &url.URL{ + Path: healthPath, + }, + } + if _, pat := mux.Handler(hreq); pat != healthPath { + mux.HandleFunc(healthPath, func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, "ok") + }) + } +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/metadata.go b/upstream/vendor/google.golang.org/appengine/internal/metadata.go new file mode 100644 index 00000000000..c4ba63bb481 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/metadata.go @@ -0,0 +1,60 @@ +// Copyright 2014 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +// This file has code for accessing metadata. +// +// References: +// https://cloud.google.com/compute/docs/metadata + +import ( + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +const ( + metadataHost = "metadata" + metadataPath = "/computeMetadata/v1/" +) + +var ( + metadataRequestHeaders = http.Header{ + "Metadata-Flavor": []string{"Google"}, + } +) + +// TODO(dsymonds): Do we need to support default values, like Python? +func mustGetMetadata(key string) []byte { + b, err := getMetadata(key) + if err != nil { + panic(fmt.Sprintf("Metadata fetch failed for '%s': %v", key, err)) + } + return b +} + +func getMetadata(key string) ([]byte, error) { + // TODO(dsymonds): May need to use url.Parse to support keys with query args. + req := &http.Request{ + Method: "GET", + URL: &url.URL{ + Scheme: "http", + Host: metadataHost, + Path: metadataPath + key, + }, + Header: metadataRequestHeaders, + Host: metadataHost, + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode != 200 { + return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode) + } + return ioutil.ReadAll(resp.Body) +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go b/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go new file mode 100644 index 00000000000..ddfc0c04a12 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go @@ -0,0 +1,786 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/modules/modules_service.proto + +package modules + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type ModulesServiceError_ErrorCode int32 + +const ( + ModulesServiceError_OK ModulesServiceError_ErrorCode = 0 + ModulesServiceError_INVALID_MODULE ModulesServiceError_ErrorCode = 1 + ModulesServiceError_INVALID_VERSION ModulesServiceError_ErrorCode = 2 + ModulesServiceError_INVALID_INSTANCES ModulesServiceError_ErrorCode = 3 + ModulesServiceError_TRANSIENT_ERROR ModulesServiceError_ErrorCode = 4 + ModulesServiceError_UNEXPECTED_STATE ModulesServiceError_ErrorCode = 5 +) + +var ModulesServiceError_ErrorCode_name = map[int32]string{ + 0: "OK", + 1: "INVALID_MODULE", + 2: "INVALID_VERSION", + 3: "INVALID_INSTANCES", + 4: "TRANSIENT_ERROR", + 5: "UNEXPECTED_STATE", +} +var ModulesServiceError_ErrorCode_value = map[string]int32{ + "OK": 0, + "INVALID_MODULE": 1, + "INVALID_VERSION": 2, + "INVALID_INSTANCES": 3, + "TRANSIENT_ERROR": 4, + "UNEXPECTED_STATE": 5, +} + +func (x ModulesServiceError_ErrorCode) Enum() *ModulesServiceError_ErrorCode { + p := new(ModulesServiceError_ErrorCode) + *p = x + return p +} +func (x ModulesServiceError_ErrorCode) String() string { + return proto.EnumName(ModulesServiceError_ErrorCode_name, int32(x)) +} +func (x *ModulesServiceError_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ModulesServiceError_ErrorCode_value, data, "ModulesServiceError_ErrorCode") + if err != nil { + return err + } + *x = ModulesServiceError_ErrorCode(value) + return nil +} +func (ModulesServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0, 0} +} + +type ModulesServiceError struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModulesServiceError) Reset() { *m = ModulesServiceError{} } +func (m *ModulesServiceError) String() string { return proto.CompactTextString(m) } +func (*ModulesServiceError) ProtoMessage() {} +func (*ModulesServiceError) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0} +} +func (m *ModulesServiceError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ModulesServiceError.Unmarshal(m, b) +} +func (m *ModulesServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ModulesServiceError.Marshal(b, m, deterministic) +} +func (dst *ModulesServiceError) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModulesServiceError.Merge(dst, src) +} +func (m *ModulesServiceError) XXX_Size() int { + return xxx_messageInfo_ModulesServiceError.Size(m) +} +func (m *ModulesServiceError) XXX_DiscardUnknown() { + xxx_messageInfo_ModulesServiceError.DiscardUnknown(m) +} + +var xxx_messageInfo_ModulesServiceError proto.InternalMessageInfo + +type GetModulesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetModulesRequest) Reset() { *m = GetModulesRequest{} } +func (m *GetModulesRequest) String() string { return proto.CompactTextString(m) } +func (*GetModulesRequest) ProtoMessage() {} +func (*GetModulesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{1} +} +func (m *GetModulesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetModulesRequest.Unmarshal(m, b) +} +func (m *GetModulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetModulesRequest.Marshal(b, m, deterministic) +} +func (dst *GetModulesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetModulesRequest.Merge(dst, src) +} +func (m *GetModulesRequest) XXX_Size() int { + return xxx_messageInfo_GetModulesRequest.Size(m) +} +func (m *GetModulesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetModulesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetModulesRequest proto.InternalMessageInfo + +type GetModulesResponse struct { + Module []string `protobuf:"bytes,1,rep,name=module" json:"module,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetModulesResponse) Reset() { *m = GetModulesResponse{} } +func (m *GetModulesResponse) String() string { return proto.CompactTextString(m) } +func (*GetModulesResponse) ProtoMessage() {} +func (*GetModulesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{2} +} +func (m *GetModulesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetModulesResponse.Unmarshal(m, b) +} +func (m *GetModulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetModulesResponse.Marshal(b, m, deterministic) +} +func (dst *GetModulesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetModulesResponse.Merge(dst, src) +} +func (m *GetModulesResponse) XXX_Size() int { + return xxx_messageInfo_GetModulesResponse.Size(m) +} +func (m *GetModulesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetModulesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetModulesResponse proto.InternalMessageInfo + +func (m *GetModulesResponse) GetModule() []string { + if m != nil { + return m.Module + } + return nil +} + +type GetVersionsRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetVersionsRequest) Reset() { *m = GetVersionsRequest{} } +func (m *GetVersionsRequest) String() string { return proto.CompactTextString(m) } +func (*GetVersionsRequest) ProtoMessage() {} +func (*GetVersionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{3} +} +func (m *GetVersionsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetVersionsRequest.Unmarshal(m, b) +} +func (m *GetVersionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetVersionsRequest.Marshal(b, m, deterministic) +} +func (dst *GetVersionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetVersionsRequest.Merge(dst, src) +} +func (m *GetVersionsRequest) XXX_Size() int { + return xxx_messageInfo_GetVersionsRequest.Size(m) +} +func (m *GetVersionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetVersionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetVersionsRequest proto.InternalMessageInfo + +func (m *GetVersionsRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +type GetVersionsResponse struct { + Version []string `protobuf:"bytes,1,rep,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetVersionsResponse) Reset() { *m = GetVersionsResponse{} } +func (m *GetVersionsResponse) String() string { return proto.CompactTextString(m) } +func (*GetVersionsResponse) ProtoMessage() {} +func (*GetVersionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{4} +} +func (m *GetVersionsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetVersionsResponse.Unmarshal(m, b) +} +func (m *GetVersionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetVersionsResponse.Marshal(b, m, deterministic) +} +func (dst *GetVersionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetVersionsResponse.Merge(dst, src) +} +func (m *GetVersionsResponse) XXX_Size() int { + return xxx_messageInfo_GetVersionsResponse.Size(m) +} +func (m *GetVersionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetVersionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetVersionsResponse proto.InternalMessageInfo + +func (m *GetVersionsResponse) GetVersion() []string { + if m != nil { + return m.Version + } + return nil +} + +type GetDefaultVersionRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDefaultVersionRequest) Reset() { *m = GetDefaultVersionRequest{} } +func (m *GetDefaultVersionRequest) String() string { return proto.CompactTextString(m) } +func (*GetDefaultVersionRequest) ProtoMessage() {} +func (*GetDefaultVersionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{5} +} +func (m *GetDefaultVersionRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDefaultVersionRequest.Unmarshal(m, b) +} +func (m *GetDefaultVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDefaultVersionRequest.Marshal(b, m, deterministic) +} +func (dst *GetDefaultVersionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDefaultVersionRequest.Merge(dst, src) +} +func (m *GetDefaultVersionRequest) XXX_Size() int { + return xxx_messageInfo_GetDefaultVersionRequest.Size(m) +} +func (m *GetDefaultVersionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDefaultVersionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDefaultVersionRequest proto.InternalMessageInfo + +func (m *GetDefaultVersionRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +type GetDefaultVersionResponse struct { + Version *string `protobuf:"bytes,1,req,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDefaultVersionResponse) Reset() { *m = GetDefaultVersionResponse{} } +func (m *GetDefaultVersionResponse) String() string { return proto.CompactTextString(m) } +func (*GetDefaultVersionResponse) ProtoMessage() {} +func (*GetDefaultVersionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{6} +} +func (m *GetDefaultVersionResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDefaultVersionResponse.Unmarshal(m, b) +} +func (m *GetDefaultVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDefaultVersionResponse.Marshal(b, m, deterministic) +} +func (dst *GetDefaultVersionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDefaultVersionResponse.Merge(dst, src) +} +func (m *GetDefaultVersionResponse) XXX_Size() int { + return xxx_messageInfo_GetDefaultVersionResponse.Size(m) +} +func (m *GetDefaultVersionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetDefaultVersionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDefaultVersionResponse proto.InternalMessageInfo + +func (m *GetDefaultVersionResponse) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +type GetNumInstancesRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNumInstancesRequest) Reset() { *m = GetNumInstancesRequest{} } +func (m *GetNumInstancesRequest) String() string { return proto.CompactTextString(m) } +func (*GetNumInstancesRequest) ProtoMessage() {} +func (*GetNumInstancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{7} +} +func (m *GetNumInstancesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetNumInstancesRequest.Unmarshal(m, b) +} +func (m *GetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetNumInstancesRequest.Marshal(b, m, deterministic) +} +func (dst *GetNumInstancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNumInstancesRequest.Merge(dst, src) +} +func (m *GetNumInstancesRequest) XXX_Size() int { + return xxx_messageInfo_GetNumInstancesRequest.Size(m) +} +func (m *GetNumInstancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNumInstancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNumInstancesRequest proto.InternalMessageInfo + +func (m *GetNumInstancesRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +func (m *GetNumInstancesRequest) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +type GetNumInstancesResponse struct { + Instances *int64 `protobuf:"varint,1,req,name=instances" json:"instances,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNumInstancesResponse) Reset() { *m = GetNumInstancesResponse{} } +func (m *GetNumInstancesResponse) String() string { return proto.CompactTextString(m) } +func (*GetNumInstancesResponse) ProtoMessage() {} +func (*GetNumInstancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{8} +} +func (m *GetNumInstancesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetNumInstancesResponse.Unmarshal(m, b) +} +func (m *GetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetNumInstancesResponse.Marshal(b, m, deterministic) +} +func (dst *GetNumInstancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNumInstancesResponse.Merge(dst, src) +} +func (m *GetNumInstancesResponse) XXX_Size() int { + return xxx_messageInfo_GetNumInstancesResponse.Size(m) +} +func (m *GetNumInstancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNumInstancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNumInstancesResponse proto.InternalMessageInfo + +func (m *GetNumInstancesResponse) GetInstances() int64 { + if m != nil && m.Instances != nil { + return *m.Instances + } + return 0 +} + +type SetNumInstancesRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + Instances *int64 `protobuf:"varint,3,req,name=instances" json:"instances,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetNumInstancesRequest) Reset() { *m = SetNumInstancesRequest{} } +func (m *SetNumInstancesRequest) String() string { return proto.CompactTextString(m) } +func (*SetNumInstancesRequest) ProtoMessage() {} +func (*SetNumInstancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{9} +} +func (m *SetNumInstancesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetNumInstancesRequest.Unmarshal(m, b) +} +func (m *SetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetNumInstancesRequest.Marshal(b, m, deterministic) +} +func (dst *SetNumInstancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetNumInstancesRequest.Merge(dst, src) +} +func (m *SetNumInstancesRequest) XXX_Size() int { + return xxx_messageInfo_SetNumInstancesRequest.Size(m) +} +func (m *SetNumInstancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetNumInstancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetNumInstancesRequest proto.InternalMessageInfo + +func (m *SetNumInstancesRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +func (m *SetNumInstancesRequest) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +func (m *SetNumInstancesRequest) GetInstances() int64 { + if m != nil && m.Instances != nil { + return *m.Instances + } + return 0 +} + +type SetNumInstancesResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetNumInstancesResponse) Reset() { *m = SetNumInstancesResponse{} } +func (m *SetNumInstancesResponse) String() string { return proto.CompactTextString(m) } +func (*SetNumInstancesResponse) ProtoMessage() {} +func (*SetNumInstancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{10} +} +func (m *SetNumInstancesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetNumInstancesResponse.Unmarshal(m, b) +} +func (m *SetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetNumInstancesResponse.Marshal(b, m, deterministic) +} +func (dst *SetNumInstancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetNumInstancesResponse.Merge(dst, src) +} +func (m *SetNumInstancesResponse) XXX_Size() int { + return xxx_messageInfo_SetNumInstancesResponse.Size(m) +} +func (m *SetNumInstancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetNumInstancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SetNumInstancesResponse proto.InternalMessageInfo + +type StartModuleRequest struct { + Module *string `protobuf:"bytes,1,req,name=module" json:"module,omitempty"` + Version *string `protobuf:"bytes,2,req,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartModuleRequest) Reset() { *m = StartModuleRequest{} } +func (m *StartModuleRequest) String() string { return proto.CompactTextString(m) } +func (*StartModuleRequest) ProtoMessage() {} +func (*StartModuleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{11} +} +func (m *StartModuleRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StartModuleRequest.Unmarshal(m, b) +} +func (m *StartModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StartModuleRequest.Marshal(b, m, deterministic) +} +func (dst *StartModuleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartModuleRequest.Merge(dst, src) +} +func (m *StartModuleRequest) XXX_Size() int { + return xxx_messageInfo_StartModuleRequest.Size(m) +} +func (m *StartModuleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StartModuleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StartModuleRequest proto.InternalMessageInfo + +func (m *StartModuleRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +func (m *StartModuleRequest) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +type StartModuleResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartModuleResponse) Reset() { *m = StartModuleResponse{} } +func (m *StartModuleResponse) String() string { return proto.CompactTextString(m) } +func (*StartModuleResponse) ProtoMessage() {} +func (*StartModuleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{12} +} +func (m *StartModuleResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StartModuleResponse.Unmarshal(m, b) +} +func (m *StartModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StartModuleResponse.Marshal(b, m, deterministic) +} +func (dst *StartModuleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartModuleResponse.Merge(dst, src) +} +func (m *StartModuleResponse) XXX_Size() int { + return xxx_messageInfo_StartModuleResponse.Size(m) +} +func (m *StartModuleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StartModuleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StartModuleResponse proto.InternalMessageInfo + +type StopModuleRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopModuleRequest) Reset() { *m = StopModuleRequest{} } +func (m *StopModuleRequest) String() string { return proto.CompactTextString(m) } +func (*StopModuleRequest) ProtoMessage() {} +func (*StopModuleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{13} +} +func (m *StopModuleRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StopModuleRequest.Unmarshal(m, b) +} +func (m *StopModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StopModuleRequest.Marshal(b, m, deterministic) +} +func (dst *StopModuleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopModuleRequest.Merge(dst, src) +} +func (m *StopModuleRequest) XXX_Size() int { + return xxx_messageInfo_StopModuleRequest.Size(m) +} +func (m *StopModuleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StopModuleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StopModuleRequest proto.InternalMessageInfo + +func (m *StopModuleRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +func (m *StopModuleRequest) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +type StopModuleResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopModuleResponse) Reset() { *m = StopModuleResponse{} } +func (m *StopModuleResponse) String() string { return proto.CompactTextString(m) } +func (*StopModuleResponse) ProtoMessage() {} +func (*StopModuleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{14} +} +func (m *StopModuleResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StopModuleResponse.Unmarshal(m, b) +} +func (m *StopModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StopModuleResponse.Marshal(b, m, deterministic) +} +func (dst *StopModuleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopModuleResponse.Merge(dst, src) +} +func (m *StopModuleResponse) XXX_Size() int { + return xxx_messageInfo_StopModuleResponse.Size(m) +} +func (m *StopModuleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StopModuleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StopModuleResponse proto.InternalMessageInfo + +type GetHostnameRequest struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + Instance *string `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetHostnameRequest) Reset() { *m = GetHostnameRequest{} } +func (m *GetHostnameRequest) String() string { return proto.CompactTextString(m) } +func (*GetHostnameRequest) ProtoMessage() {} +func (*GetHostnameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{15} +} +func (m *GetHostnameRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetHostnameRequest.Unmarshal(m, b) +} +func (m *GetHostnameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetHostnameRequest.Marshal(b, m, deterministic) +} +func (dst *GetHostnameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetHostnameRequest.Merge(dst, src) +} +func (m *GetHostnameRequest) XXX_Size() int { + return xxx_messageInfo_GetHostnameRequest.Size(m) +} +func (m *GetHostnameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetHostnameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetHostnameRequest proto.InternalMessageInfo + +func (m *GetHostnameRequest) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module + } + return "" +} + +func (m *GetHostnameRequest) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +func (m *GetHostnameRequest) GetInstance() string { + if m != nil && m.Instance != nil { + return *m.Instance + } + return "" +} + +type GetHostnameResponse struct { + Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetHostnameResponse) Reset() { *m = GetHostnameResponse{} } +func (m *GetHostnameResponse) String() string { return proto.CompactTextString(m) } +func (*GetHostnameResponse) ProtoMessage() {} +func (*GetHostnameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{16} +} +func (m *GetHostnameResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetHostnameResponse.Unmarshal(m, b) +} +func (m *GetHostnameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetHostnameResponse.Marshal(b, m, deterministic) +} +func (dst *GetHostnameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetHostnameResponse.Merge(dst, src) +} +func (m *GetHostnameResponse) XXX_Size() int { + return xxx_messageInfo_GetHostnameResponse.Size(m) +} +func (m *GetHostnameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetHostnameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetHostnameResponse proto.InternalMessageInfo + +func (m *GetHostnameResponse) GetHostname() string { + if m != nil && m.Hostname != nil { + return *m.Hostname + } + return "" +} + +func init() { + proto.RegisterType((*ModulesServiceError)(nil), "appengine.ModulesServiceError") + proto.RegisterType((*GetModulesRequest)(nil), "appengine.GetModulesRequest") + proto.RegisterType((*GetModulesResponse)(nil), "appengine.GetModulesResponse") + proto.RegisterType((*GetVersionsRequest)(nil), "appengine.GetVersionsRequest") + proto.RegisterType((*GetVersionsResponse)(nil), "appengine.GetVersionsResponse") + proto.RegisterType((*GetDefaultVersionRequest)(nil), "appengine.GetDefaultVersionRequest") + proto.RegisterType((*GetDefaultVersionResponse)(nil), "appengine.GetDefaultVersionResponse") + proto.RegisterType((*GetNumInstancesRequest)(nil), "appengine.GetNumInstancesRequest") + proto.RegisterType((*GetNumInstancesResponse)(nil), "appengine.GetNumInstancesResponse") + proto.RegisterType((*SetNumInstancesRequest)(nil), "appengine.SetNumInstancesRequest") + proto.RegisterType((*SetNumInstancesResponse)(nil), "appengine.SetNumInstancesResponse") + proto.RegisterType((*StartModuleRequest)(nil), "appengine.StartModuleRequest") + proto.RegisterType((*StartModuleResponse)(nil), "appengine.StartModuleResponse") + proto.RegisterType((*StopModuleRequest)(nil), "appengine.StopModuleRequest") + proto.RegisterType((*StopModuleResponse)(nil), "appengine.StopModuleResponse") + proto.RegisterType((*GetHostnameRequest)(nil), "appengine.GetHostnameRequest") + proto.RegisterType((*GetHostnameResponse)(nil), "appengine.GetHostnameResponse") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/modules/modules_service.proto", fileDescriptor_modules_service_9cd3bffe4e91c59a) +} + +var fileDescriptor_modules_service_9cd3bffe4e91c59a = []byte{ + // 457 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x6f, 0xd3, 0x30, + 0x14, 0xc6, 0x69, 0x02, 0xdb, 0xf2, 0x0e, 0x90, 0x3a, 0x5b, 0xd7, 0x4d, 0x1c, 0x50, 0x4e, 0x1c, + 0x50, 0x2b, 0x90, 0x10, 0xe7, 0xae, 0x35, 0x25, 0xb0, 0xa5, 0x28, 0xce, 0x2a, 0xc4, 0xa5, 0x0a, + 0xdb, 0x23, 0x8b, 0x94, 0xda, 0xc1, 0x76, 0x77, 0xe4, 0xbf, 0xe0, 0xff, 0x45, 0x4b, 0xed, 0xb6, + 0x81, 0x4e, 0x45, 0x68, 0xa7, 0xe4, 0x7d, 0xfe, 0xfc, 0x7b, 0x9f, 0x5f, 0xac, 0xc0, 0x59, 0x2e, + 0x44, 0x5e, 0x62, 0x2f, 0x17, 0x65, 0xc6, 0xf3, 0x9e, 0x90, 0x79, 0x3f, 0xab, 0x2a, 0xe4, 0x79, + 0xc1, 0xb1, 0x5f, 0x70, 0x8d, 0x92, 0x67, 0x65, 0x7f, 0x2e, 0xae, 0x17, 0x25, 0x2a, 0xfb, 0x9c, + 0x29, 0x94, 0xb7, 0xc5, 0x15, 0xf6, 0x2a, 0x29, 0xb4, 0x20, 0xde, 0x6a, 0x47, 0xf8, 0xab, 0x05, + 0xc1, 0xc5, 0xd2, 0xc4, 0x96, 0x1e, 0x2a, 0xa5, 0x90, 0xe1, 0x4f, 0xf0, 0xea, 0x97, 0xa1, 0xb8, + 0x46, 0xb2, 0x07, 0xce, 0xe4, 0x93, 0xff, 0x88, 0x10, 0x78, 0x1a, 0xc5, 0xd3, 0xc1, 0x79, 0x34, + 0x9a, 0x5d, 0x4c, 0x46, 0x97, 0xe7, 0xd4, 0x6f, 0x91, 0x00, 0x9e, 0x59, 0x6d, 0x4a, 0x13, 0x16, + 0x4d, 0x62, 0xdf, 0x21, 0x47, 0xd0, 0xb6, 0x62, 0x14, 0xb3, 0x74, 0x10, 0x0f, 0x29, 0xf3, 0xdd, + 0x3b, 0x6f, 0x9a, 0x0c, 0x62, 0x16, 0xd1, 0x38, 0x9d, 0xd1, 0x24, 0x99, 0x24, 0xfe, 0x63, 0x72, + 0x08, 0xfe, 0x65, 0x4c, 0xbf, 0x7c, 0xa6, 0xc3, 0x94, 0x8e, 0x66, 0x2c, 0x1d, 0xa4, 0xd4, 0x7f, + 0x12, 0x06, 0xd0, 0x1e, 0xa3, 0x36, 0xc9, 0x12, 0xfc, 0xb1, 0x40, 0xa5, 0xc3, 0x57, 0x40, 0x36, + 0x45, 0x55, 0x09, 0xae, 0x90, 0x74, 0x60, 0x6f, 0x79, 0xcc, 0x6e, 0xeb, 0x85, 0xfb, 0xd2, 0x4b, + 0x4c, 0x65, 0xdc, 0x53, 0x94, 0xaa, 0x10, 0xdc, 0x32, 0x1a, 0xee, 0xd6, 0x86, 0xbb, 0x0f, 0x41, + 0xc3, 0x6d, 0xe0, 0x5d, 0xd8, 0xbf, 0x5d, 0x6a, 0x86, 0x6e, 0xcb, 0xf0, 0x0d, 0x74, 0xc7, 0xa8, + 0x47, 0xf8, 0x3d, 0x5b, 0x94, 0x76, 0xdf, 0xae, 0x26, 0x6f, 0xe1, 0x64, 0xcb, 0x9e, 0x6d, 0xad, + 0x9c, 0xcd, 0x56, 0x1f, 0xa1, 0x33, 0x46, 0x1d, 0x2f, 0xe6, 0x11, 0x57, 0x3a, 0xe3, 0x57, 0xb8, + 0xeb, 0x34, 0x9b, 0x2c, 0xa7, 0x5e, 0x58, 0xb1, 0xde, 0xc1, 0xf1, 0x5f, 0x2c, 0x13, 0xe0, 0x39, + 0x78, 0x85, 0x15, 0xeb, 0x08, 0x6e, 0xb2, 0x16, 0xc2, 0x1b, 0xe8, 0xb0, 0x07, 0x0a, 0xd1, 0xec, + 0xe4, 0xfe, 0xd9, 0xe9, 0x04, 0x8e, 0xd9, 0xf6, 0x88, 0xe1, 0x7b, 0x20, 0x4c, 0x67, 0xd2, 0xdc, + 0x81, 0x6d, 0x01, 0x9c, 0xfb, 0x02, 0x34, 0x26, 0x7a, 0x04, 0x41, 0x83, 0x63, 0xf0, 0x14, 0xda, + 0x4c, 0x8b, 0xea, 0x7e, 0xfa, 0xbf, 0xcd, 0xf8, 0xf0, 0x2e, 0xe5, 0x1a, 0x63, 0xe0, 0xdf, 0xea, + 0xfb, 0xf8, 0x41, 0x28, 0xcd, 0xb3, 0xf9, 0xff, 0xd3, 0xc9, 0x29, 0x1c, 0xd8, 0x59, 0x75, 0xdd, + 0x7a, 0x69, 0x55, 0x87, 0xaf, 0xeb, 0x5b, 0xbc, 0xee, 0x61, 0xbe, 0xec, 0x29, 0x1c, 0xdc, 0x18, + 0xcd, 0x8c, 0x68, 0x55, 0x9f, 0x79, 0x5f, 0xf7, 0xcd, 0x5f, 0xe2, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x6e, 0xbc, 0xe0, 0x61, 0x5c, 0x04, 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.proto b/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.proto new file mode 100644 index 00000000000..d29f0065a2f --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/modules/modules_service.proto @@ -0,0 +1,80 @@ +syntax = "proto2"; +option go_package = "modules"; + +package appengine; + +message ModulesServiceError { + enum ErrorCode { + OK = 0; + INVALID_MODULE = 1; + INVALID_VERSION = 2; + INVALID_INSTANCES = 3; + TRANSIENT_ERROR = 4; + UNEXPECTED_STATE = 5; + } +} + +message GetModulesRequest { +} + +message GetModulesResponse { + repeated string module = 1; +} + +message GetVersionsRequest { + optional string module = 1; +} + +message GetVersionsResponse { + repeated string version = 1; +} + +message GetDefaultVersionRequest { + optional string module = 1; +} + +message GetDefaultVersionResponse { + required string version = 1; +} + +message GetNumInstancesRequest { + optional string module = 1; + optional string version = 2; +} + +message GetNumInstancesResponse { + required int64 instances = 1; +} + +message SetNumInstancesRequest { + optional string module = 1; + optional string version = 2; + required int64 instances = 3; +} + +message SetNumInstancesResponse {} + +message StartModuleRequest { + required string module = 1; + required string version = 2; +} + +message StartModuleResponse {} + +message StopModuleRequest { + optional string module = 1; + optional string version = 2; +} + +message StopModuleResponse {} + +message GetHostnameRequest { + optional string module = 1; + optional string version = 2; + optional string instance = 3; +} + +message GetHostnameResponse { + required string hostname = 1; +} + diff --git a/upstream/vendor/google.golang.org/appengine/internal/net.go b/upstream/vendor/google.golang.org/appengine/internal/net.go new file mode 100644 index 00000000000..fe429720e1f --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/net.go @@ -0,0 +1,56 @@ +// Copyright 2014 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +// This file implements a network dialer that limits the number of concurrent connections. +// It is only used for API calls. + +import ( + "log" + "net" + "runtime" + "sync" + "time" +) + +var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable. + +func limitRelease() { + // non-blocking + select { + case <-limitSem: + default: + // This should not normally happen. + log.Print("appengine: unbalanced limitSem release!") + } +} + +func limitDial(network, addr string) (net.Conn, error) { + limitSem <- 1 + + // Dial with a timeout in case the API host is MIA. + // The connection should normally be very fast. + conn, err := net.DialTimeout(network, addr, 10*time.Second) + if err != nil { + limitRelease() + return nil, err + } + lc := &limitConn{Conn: conn} + runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required + return lc, nil +} + +type limitConn struct { + close sync.Once + net.Conn +} + +func (lc *limitConn) Close() error { + defer lc.close.Do(func() { + limitRelease() + runtime.SetFinalizer(lc, nil) + }) + return lc.Conn.Close() +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/regen.sh b/upstream/vendor/google.golang.org/appengine/internal/regen.sh new file mode 100644 index 00000000000..2fdb546a633 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/regen.sh @@ -0,0 +1,40 @@ +#!/bin/bash -e +# +# This script rebuilds the generated code for the protocol buffers. +# To run this you will need protoc and goprotobuf installed; +# see https://github.com/golang/protobuf for instructions. + +PKG=google.golang.org/appengine + +function die() { + echo 1>&2 $* + exit 1 +} + +# Sanity check that the right tools are accessible. +for tool in go protoc protoc-gen-go; do + q=$(which $tool) || die "didn't find $tool" + echo 1>&2 "$tool: $q" +done + +echo -n 1>&2 "finding package dir... " +pkgdir=$(go list -f '{{.Dir}}' $PKG) +echo 1>&2 $pkgdir +base=$(echo $pkgdir | sed "s,/$PKG\$,,") +echo 1>&2 "base: $base" +cd $base + +# Run protoc once per package. +for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do + echo 1>&2 "* $dir" + protoc --go_out=. $dir/*.proto +done + +for f in $(find $PKG/internal -name '*.pb.go'); do + # Remove proto.RegisterEnum calls. + # These cause duplicate registration panics when these packages + # are used on classic App Engine. proto.RegisterEnum only affects + # parsing the text format; we don't care about that. + # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 + sed -i '/proto.RegisterEnum/d' $f +done diff --git a/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go b/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go new file mode 100644 index 00000000000..8d782a38e17 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/remote_api/remote_api.proto + +package remote_api + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type RpcError_ErrorCode int32 + +const ( + RpcError_UNKNOWN RpcError_ErrorCode = 0 + RpcError_CALL_NOT_FOUND RpcError_ErrorCode = 1 + RpcError_PARSE_ERROR RpcError_ErrorCode = 2 + RpcError_SECURITY_VIOLATION RpcError_ErrorCode = 3 + RpcError_OVER_QUOTA RpcError_ErrorCode = 4 + RpcError_REQUEST_TOO_LARGE RpcError_ErrorCode = 5 + RpcError_CAPABILITY_DISABLED RpcError_ErrorCode = 6 + RpcError_FEATURE_DISABLED RpcError_ErrorCode = 7 + RpcError_BAD_REQUEST RpcError_ErrorCode = 8 + RpcError_RESPONSE_TOO_LARGE RpcError_ErrorCode = 9 + RpcError_CANCELLED RpcError_ErrorCode = 10 + RpcError_REPLAY_ERROR RpcError_ErrorCode = 11 + RpcError_DEADLINE_EXCEEDED RpcError_ErrorCode = 12 +) + +var RpcError_ErrorCode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CALL_NOT_FOUND", + 2: "PARSE_ERROR", + 3: "SECURITY_VIOLATION", + 4: "OVER_QUOTA", + 5: "REQUEST_TOO_LARGE", + 6: "CAPABILITY_DISABLED", + 7: "FEATURE_DISABLED", + 8: "BAD_REQUEST", + 9: "RESPONSE_TOO_LARGE", + 10: "CANCELLED", + 11: "REPLAY_ERROR", + 12: "DEADLINE_EXCEEDED", +} +var RpcError_ErrorCode_value = map[string]int32{ + "UNKNOWN": 0, + "CALL_NOT_FOUND": 1, + "PARSE_ERROR": 2, + "SECURITY_VIOLATION": 3, + "OVER_QUOTA": 4, + "REQUEST_TOO_LARGE": 5, + "CAPABILITY_DISABLED": 6, + "FEATURE_DISABLED": 7, + "BAD_REQUEST": 8, + "RESPONSE_TOO_LARGE": 9, + "CANCELLED": 10, + "REPLAY_ERROR": 11, + "DEADLINE_EXCEEDED": 12, +} + +func (x RpcError_ErrorCode) Enum() *RpcError_ErrorCode { + p := new(RpcError_ErrorCode) + *p = x + return p +} +func (x RpcError_ErrorCode) String() string { + return proto.EnumName(RpcError_ErrorCode_name, int32(x)) +} +func (x *RpcError_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(RpcError_ErrorCode_value, data, "RpcError_ErrorCode") + if err != nil { + return err + } + *x = RpcError_ErrorCode(value) + return nil +} +func (RpcError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_remote_api_1978114ec33a273d, []int{2, 0} +} + +type Request struct { + ServiceName *string `protobuf:"bytes,2,req,name=service_name,json=serviceName" json:"service_name,omitempty"` + Method *string `protobuf:"bytes,3,req,name=method" json:"method,omitempty"` + Request []byte `protobuf:"bytes,4,req,name=request" json:"request,omitempty"` + RequestId *string `protobuf:"bytes,5,opt,name=request_id,json=requestId" json:"request_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { + return fileDescriptor_remote_api_1978114ec33a273d, []int{0} +} +func (m *Request) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Request.Unmarshal(m, b) +} +func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Request.Marshal(b, m, deterministic) +} +func (dst *Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_Request.Merge(dst, src) +} +func (m *Request) XXX_Size() int { + return xxx_messageInfo_Request.Size(m) +} +func (m *Request) XXX_DiscardUnknown() { + xxx_messageInfo_Request.DiscardUnknown(m) +} + +var xxx_messageInfo_Request proto.InternalMessageInfo + +func (m *Request) GetServiceName() string { + if m != nil && m.ServiceName != nil { + return *m.ServiceName + } + return "" +} + +func (m *Request) GetMethod() string { + if m != nil && m.Method != nil { + return *m.Method + } + return "" +} + +func (m *Request) GetRequest() []byte { + if m != nil { + return m.Request + } + return nil +} + +func (m *Request) GetRequestId() string { + if m != nil && m.RequestId != nil { + return *m.RequestId + } + return "" +} + +type ApplicationError struct { + Code *int32 `protobuf:"varint,1,req,name=code" json:"code,omitempty"` + Detail *string `protobuf:"bytes,2,req,name=detail" json:"detail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ApplicationError) Reset() { *m = ApplicationError{} } +func (m *ApplicationError) String() string { return proto.CompactTextString(m) } +func (*ApplicationError) ProtoMessage() {} +func (*ApplicationError) Descriptor() ([]byte, []int) { + return fileDescriptor_remote_api_1978114ec33a273d, []int{1} +} +func (m *ApplicationError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ApplicationError.Unmarshal(m, b) +} +func (m *ApplicationError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ApplicationError.Marshal(b, m, deterministic) +} +func (dst *ApplicationError) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationError.Merge(dst, src) +} +func (m *ApplicationError) XXX_Size() int { + return xxx_messageInfo_ApplicationError.Size(m) +} +func (m *ApplicationError) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationError.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationError proto.InternalMessageInfo + +func (m *ApplicationError) GetCode() int32 { + if m != nil && m.Code != nil { + return *m.Code + } + return 0 +} + +func (m *ApplicationError) GetDetail() string { + if m != nil && m.Detail != nil { + return *m.Detail + } + return "" +} + +type RpcError struct { + Code *int32 `protobuf:"varint,1,req,name=code" json:"code,omitempty"` + Detail *string `protobuf:"bytes,2,opt,name=detail" json:"detail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RpcError) Reset() { *m = RpcError{} } +func (m *RpcError) String() string { return proto.CompactTextString(m) } +func (*RpcError) ProtoMessage() {} +func (*RpcError) Descriptor() ([]byte, []int) { + return fileDescriptor_remote_api_1978114ec33a273d, []int{2} +} +func (m *RpcError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RpcError.Unmarshal(m, b) +} +func (m *RpcError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RpcError.Marshal(b, m, deterministic) +} +func (dst *RpcError) XXX_Merge(src proto.Message) { + xxx_messageInfo_RpcError.Merge(dst, src) +} +func (m *RpcError) XXX_Size() int { + return xxx_messageInfo_RpcError.Size(m) +} +func (m *RpcError) XXX_DiscardUnknown() { + xxx_messageInfo_RpcError.DiscardUnknown(m) +} + +var xxx_messageInfo_RpcError proto.InternalMessageInfo + +func (m *RpcError) GetCode() int32 { + if m != nil && m.Code != nil { + return *m.Code + } + return 0 +} + +func (m *RpcError) GetDetail() string { + if m != nil && m.Detail != nil { + return *m.Detail + } + return "" +} + +type Response struct { + Response []byte `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"` + Exception []byte `protobuf:"bytes,2,opt,name=exception" json:"exception,omitempty"` + ApplicationError *ApplicationError `protobuf:"bytes,3,opt,name=application_error,json=applicationError" json:"application_error,omitempty"` + JavaException []byte `protobuf:"bytes,4,opt,name=java_exception,json=javaException" json:"java_exception,omitempty"` + RpcError *RpcError `protobuf:"bytes,5,opt,name=rpc_error,json=rpcError" json:"rpc_error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_remote_api_1978114ec33a273d, []int{3} +} +func (m *Response) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Response.Unmarshal(m, b) +} +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Response.Marshal(b, m, deterministic) +} +func (dst *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(dst, src) +} +func (m *Response) XXX_Size() int { + return xxx_messageInfo_Response.Size(m) +} +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) +} + +var xxx_messageInfo_Response proto.InternalMessageInfo + +func (m *Response) GetResponse() []byte { + if m != nil { + return m.Response + } + return nil +} + +func (m *Response) GetException() []byte { + if m != nil { + return m.Exception + } + return nil +} + +func (m *Response) GetApplicationError() *ApplicationError { + if m != nil { + return m.ApplicationError + } + return nil +} + +func (m *Response) GetJavaException() []byte { + if m != nil { + return m.JavaException + } + return nil +} + +func (m *Response) GetRpcError() *RpcError { + if m != nil { + return m.RpcError + } + return nil +} + +func init() { + proto.RegisterType((*Request)(nil), "remote_api.Request") + proto.RegisterType((*ApplicationError)(nil), "remote_api.ApplicationError") + proto.RegisterType((*RpcError)(nil), "remote_api.RpcError") + proto.RegisterType((*Response)(nil), "remote_api.Response") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/remote_api/remote_api.proto", fileDescriptor_remote_api_1978114ec33a273d) +} + +var fileDescriptor_remote_api_1978114ec33a273d = []byte{ + // 531 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x51, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb1, 0x9b, 0x34, 0xf1, 0xc4, 0x2d, 0xdb, 0xa5, 0x14, 0x0b, 0x15, 0x29, 0x44, 0x42, + 0xca, 0x53, 0x2a, 0x38, 0x00, 0x62, 0x63, 0x6f, 0x91, 0x85, 0x65, 0xa7, 0x6b, 0xbb, 0x50, 0x5e, + 0x56, 0x2b, 0x67, 0x65, 0x8c, 0x12, 0xaf, 0xd9, 0x98, 0x8a, 0x17, 0x6e, 0xc0, 0xb5, 0x38, 0x0c, + 0xb7, 0x40, 0x36, 0x6e, 0x63, 0xf5, 0x89, 0xb7, 0x7f, 0x7e, 0x7b, 0xe6, 0x1b, 0xcd, 0xcc, 0xc2, + 0xbb, 0x5c, 0xa9, 0x7c, 0x23, 0x17, 0xb9, 0xda, 0x88, 0x32, 0x5f, 0x28, 0x9d, 0x5f, 0x88, 0xaa, + 0x92, 0x65, 0x5e, 0x94, 0xf2, 0xa2, 0x28, 0x6b, 0xa9, 0x4b, 0xb1, 0xb9, 0xd0, 0x72, 0xab, 0x6a, + 0xc9, 0x45, 0x55, 0xf4, 0xe4, 0xa2, 0xd2, 0xaa, 0x56, 0x18, 0xf6, 0xce, 0xec, 0x27, 0x8c, 0x98, + 0xfc, 0xf6, 0x5d, 0xee, 0x6a, 0xfc, 0x12, 0xec, 0x9d, 0xd4, 0xb7, 0x45, 0x26, 0x79, 0x29, 0xb6, + 0xd2, 0x31, 0xa7, 0xe6, 0xdc, 0x62, 0x93, 0xce, 0x0b, 0xc5, 0x56, 0xe2, 0x33, 0x38, 0xdc, 0xca, + 0xfa, 0x8b, 0x5a, 0x3b, 0x07, 0xed, 0xc7, 0x2e, 0xc2, 0x0e, 0x8c, 0xf4, 0xbf, 0x2a, 0xce, 0x60, + 0x6a, 0xce, 0x6d, 0x76, 0x17, 0xe2, 0x17, 0x00, 0x9d, 0xe4, 0xc5, 0xda, 0x19, 0x4e, 0x8d, 0xb9, + 0xc5, 0xac, 0xce, 0xf1, 0xd7, 0xb3, 0xb7, 0x80, 0x48, 0x55, 0x6d, 0x8a, 0x4c, 0xd4, 0x85, 0x2a, + 0xa9, 0xd6, 0x4a, 0x63, 0x0c, 0x83, 0x4c, 0xad, 0xa5, 0x63, 0x4c, 0xcd, 0xf9, 0x90, 0xb5, 0xba, + 0x01, 0xaf, 0x65, 0x2d, 0x8a, 0x4d, 0xd7, 0x55, 0x17, 0xcd, 0x7e, 0x9b, 0x30, 0x66, 0x55, 0xf6, + 0x7f, 0x89, 0x46, 0x2f, 0xf1, 0x97, 0x09, 0x56, 0x9b, 0xe5, 0x36, 0x7f, 0x4d, 0x60, 0x94, 0x86, + 0x1f, 0xc2, 0xe8, 0x63, 0x88, 0x1e, 0x61, 0x0c, 0xc7, 0x2e, 0x09, 0x02, 0x1e, 0x46, 0x09, 0xbf, + 0x8c, 0xd2, 0xd0, 0x43, 0x06, 0x7e, 0x0c, 0x93, 0x15, 0x61, 0x31, 0xe5, 0x94, 0xb1, 0x88, 0x21, + 0x13, 0x9f, 0x01, 0x8e, 0xa9, 0x9b, 0x32, 0x3f, 0xb9, 0xe1, 0xd7, 0x7e, 0x14, 0x90, 0xc4, 0x8f, + 0x42, 0x74, 0x80, 0x8f, 0x01, 0xa2, 0x6b, 0xca, 0xf8, 0x55, 0x1a, 0x25, 0x04, 0x0d, 0xf0, 0x53, + 0x38, 0x61, 0xf4, 0x2a, 0xa5, 0x71, 0xc2, 0x93, 0x28, 0xe2, 0x01, 0x61, 0xef, 0x29, 0x1a, 0xe2, + 0x67, 0xf0, 0xc4, 0x25, 0x2b, 0xb2, 0xf4, 0x83, 0xa6, 0x80, 0xe7, 0xc7, 0x64, 0x19, 0x50, 0x0f, + 0x1d, 0xe2, 0x53, 0x40, 0x97, 0x94, 0x24, 0x29, 0xa3, 0x7b, 0x77, 0xd4, 0xe0, 0x97, 0xc4, 0xe3, + 0x5d, 0x25, 0x34, 0x6e, 0xf0, 0x8c, 0xc6, 0xab, 0x28, 0x8c, 0x69, 0xaf, 0xae, 0x85, 0x8f, 0xc0, + 0x72, 0x49, 0xe8, 0xd2, 0xa0, 0xc9, 0x03, 0x8c, 0xc0, 0x66, 0x74, 0x15, 0x90, 0x9b, 0xae, 0xef, + 0x49, 0xd3, 0x8f, 0x47, 0x89, 0x17, 0xf8, 0x21, 0xe5, 0xf4, 0x93, 0x4b, 0xa9, 0x47, 0x3d, 0x64, + 0xcf, 0xfe, 0x18, 0x30, 0x66, 0x72, 0x57, 0xa9, 0x72, 0x27, 0xf1, 0x73, 0x18, 0xeb, 0x4e, 0x3b, + 0xc6, 0xd4, 0x98, 0xdb, 0xec, 0x3e, 0xc6, 0xe7, 0x60, 0xc9, 0x1f, 0x99, 0xac, 0x9a, 0x75, 0xb5, + 0x23, 0xb5, 0xd9, 0xde, 0xc0, 0x3e, 0x9c, 0x88, 0xfd, 0x3a, 0xb9, 0x6c, 0x06, 0xec, 0x1c, 0x4c, + 0x8d, 0xf9, 0xe4, 0xcd, 0xf9, 0xa2, 0x77, 0x87, 0x0f, 0x77, 0xce, 0x90, 0x78, 0x78, 0x05, 0xaf, + 0xe0, 0xf8, 0xab, 0xb8, 0x15, 0x7c, 0x4f, 0x1b, 0xb4, 0xb4, 0xa3, 0xc6, 0xa5, 0xf7, 0xc4, 0xd7, + 0x60, 0xe9, 0x2a, 0xeb, 0x48, 0xc3, 0x96, 0x74, 0xda, 0x27, 0xdd, 0x1d, 0x07, 0x1b, 0xeb, 0x4e, + 0x2d, 0xed, 0xcf, 0xbd, 0x07, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x38, 0xd1, 0x0f, 0x22, 0x4f, + 0x03, 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto b/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto new file mode 100644 index 00000000000..f21763a4e23 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto @@ -0,0 +1,44 @@ +syntax = "proto2"; +option go_package = "remote_api"; + +package remote_api; + +message Request { + required string service_name = 2; + required string method = 3; + required bytes request = 4; + optional string request_id = 5; +} + +message ApplicationError { + required int32 code = 1; + required string detail = 2; +} + +message RpcError { + enum ErrorCode { + UNKNOWN = 0; + CALL_NOT_FOUND = 1; + PARSE_ERROR = 2; + SECURITY_VIOLATION = 3; + OVER_QUOTA = 4; + REQUEST_TOO_LARGE = 5; + CAPABILITY_DISABLED = 6; + FEATURE_DISABLED = 7; + BAD_REQUEST = 8; + RESPONSE_TOO_LARGE = 9; + CANCELLED = 10; + REPLAY_ERROR = 11; + DEADLINE_EXCEEDED = 12; + } + required int32 code = 1; + optional string detail = 2; +} + +message Response { + optional bytes response = 1; + optional bytes exception = 2; + optional ApplicationError application_error = 3; + optional bytes java_exception = 4; + optional RpcError rpc_error = 5; +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/transaction.go b/upstream/vendor/google.golang.org/appengine/internal/transaction.go new file mode 100644 index 00000000000..2ae8ab9fa42 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/transaction.go @@ -0,0 +1,115 @@ +// Copyright 2014 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package internal + +// This file implements hooks for applying datastore transactions. + +import ( + "context" + "errors" + "reflect" + + "github.com/golang/protobuf/proto" + + basepb "google.golang.org/appengine/internal/base" + pb "google.golang.org/appengine/internal/datastore" +) + +var transactionSetters = make(map[reflect.Type]reflect.Value) + +// RegisterTransactionSetter registers a function that sets transaction information +// in a protocol buffer message. f should be a function with two arguments, +// the first being a protocol buffer type, and the second being *datastore.Transaction. +func RegisterTransactionSetter(f interface{}) { + v := reflect.ValueOf(f) + transactionSetters[v.Type().In(0)] = v +} + +// applyTransaction applies the transaction t to message pb +// by using the relevant setter passed to RegisterTransactionSetter. +func applyTransaction(pb proto.Message, t *pb.Transaction) { + v := reflect.ValueOf(pb) + if f, ok := transactionSetters[v.Type()]; ok { + f.Call([]reflect.Value{v, reflect.ValueOf(t)}) + } +} + +var transactionKey = "used for *Transaction" + +func transactionFromContext(ctx context.Context) *transaction { + t, _ := ctx.Value(&transactionKey).(*transaction) + return t +} + +func withTransaction(ctx context.Context, t *transaction) context.Context { + return context.WithValue(ctx, &transactionKey, t) +} + +type transaction struct { + transaction pb.Transaction + finished bool +} + +var ErrConcurrentTransaction = errors.New("internal: concurrent transaction") + +func RunTransactionOnce(c context.Context, f func(context.Context) error, xg bool, readOnly bool, previousTransaction *pb.Transaction) (*pb.Transaction, error) { + if transactionFromContext(c) != nil { + return nil, errors.New("nested transactions are not supported") + } + + // Begin the transaction. + t := &transaction{} + req := &pb.BeginTransactionRequest{ + App: proto.String(FullyQualifiedAppID(c)), + } + if xg { + req.AllowMultipleEg = proto.Bool(true) + } + if previousTransaction != nil { + req.PreviousTransaction = previousTransaction + } + if readOnly { + req.Mode = pb.BeginTransactionRequest_READ_ONLY.Enum() + } else { + req.Mode = pb.BeginTransactionRequest_READ_WRITE.Enum() + } + if err := Call(c, "datastore_v3", "BeginTransaction", req, &t.transaction); err != nil { + return nil, err + } + + // Call f, rolling back the transaction if f returns a non-nil error, or panics. + // The panic is not recovered. + defer func() { + if t.finished { + return + } + t.finished = true + // Ignore the error return value, since we are already returning a non-nil + // error (or we're panicking). + Call(c, "datastore_v3", "Rollback", &t.transaction, &basepb.VoidProto{}) + }() + if err := f(withTransaction(c, t)); err != nil { + return &t.transaction, err + } + t.finished = true + + // Commit the transaction. + res := &pb.CommitResponse{} + err := Call(c, "datastore_v3", "Commit", &t.transaction, res) + if ae, ok := err.(*APIError); ok { + /* TODO: restore this conditional + if appengine.IsDevAppServer() { + */ + // The Python Dev AppServer raises an ApplicationError with error code 2 (which is + // Error.CONCURRENT_TRANSACTION) and message "Concurrency exception.". + if ae.Code == int32(pb.Error_BAD_REQUEST) && ae.Detail == "ApplicationError: 2 Concurrency exception." { + return &t.transaction, ErrConcurrentTransaction + } + if ae.Code == int32(pb.Error_CONCURRENT_TRANSACTION) { + return &t.transaction, ErrConcurrentTransaction + } + } + return &t.transaction, err +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go b/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go new file mode 100644 index 00000000000..5f727750adc --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go @@ -0,0 +1,527 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto + +package urlfetch + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type URLFetchServiceError_ErrorCode int32 + +const ( + URLFetchServiceError_OK URLFetchServiceError_ErrorCode = 0 + URLFetchServiceError_INVALID_URL URLFetchServiceError_ErrorCode = 1 + URLFetchServiceError_FETCH_ERROR URLFetchServiceError_ErrorCode = 2 + URLFetchServiceError_UNSPECIFIED_ERROR URLFetchServiceError_ErrorCode = 3 + URLFetchServiceError_RESPONSE_TOO_LARGE URLFetchServiceError_ErrorCode = 4 + URLFetchServiceError_DEADLINE_EXCEEDED URLFetchServiceError_ErrorCode = 5 + URLFetchServiceError_SSL_CERTIFICATE_ERROR URLFetchServiceError_ErrorCode = 6 + URLFetchServiceError_DNS_ERROR URLFetchServiceError_ErrorCode = 7 + URLFetchServiceError_CLOSED URLFetchServiceError_ErrorCode = 8 + URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9 + URLFetchServiceError_TOO_MANY_REDIRECTS URLFetchServiceError_ErrorCode = 10 + URLFetchServiceError_MALFORMED_REPLY URLFetchServiceError_ErrorCode = 11 + URLFetchServiceError_CONNECTION_ERROR URLFetchServiceError_ErrorCode = 12 +) + +var URLFetchServiceError_ErrorCode_name = map[int32]string{ + 0: "OK", + 1: "INVALID_URL", + 2: "FETCH_ERROR", + 3: "UNSPECIFIED_ERROR", + 4: "RESPONSE_TOO_LARGE", + 5: "DEADLINE_EXCEEDED", + 6: "SSL_CERTIFICATE_ERROR", + 7: "DNS_ERROR", + 8: "CLOSED", + 9: "INTERNAL_TRANSIENT_ERROR", + 10: "TOO_MANY_REDIRECTS", + 11: "MALFORMED_REPLY", + 12: "CONNECTION_ERROR", +} +var URLFetchServiceError_ErrorCode_value = map[string]int32{ + "OK": 0, + "INVALID_URL": 1, + "FETCH_ERROR": 2, + "UNSPECIFIED_ERROR": 3, + "RESPONSE_TOO_LARGE": 4, + "DEADLINE_EXCEEDED": 5, + "SSL_CERTIFICATE_ERROR": 6, + "DNS_ERROR": 7, + "CLOSED": 8, + "INTERNAL_TRANSIENT_ERROR": 9, + "TOO_MANY_REDIRECTS": 10, + "MALFORMED_REPLY": 11, + "CONNECTION_ERROR": 12, +} + +func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode { + p := new(URLFetchServiceError_ErrorCode) + *p = x + return p +} +func (x URLFetchServiceError_ErrorCode) String() string { + return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x)) +} +func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode") + if err != nil { + return err + } + *x = URLFetchServiceError_ErrorCode(value) + return nil +} +func (URLFetchServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0, 0} +} + +type URLFetchRequest_RequestMethod int32 + +const ( + URLFetchRequest_GET URLFetchRequest_RequestMethod = 1 + URLFetchRequest_POST URLFetchRequest_RequestMethod = 2 + URLFetchRequest_HEAD URLFetchRequest_RequestMethod = 3 + URLFetchRequest_PUT URLFetchRequest_RequestMethod = 4 + URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5 + URLFetchRequest_PATCH URLFetchRequest_RequestMethod = 6 +) + +var URLFetchRequest_RequestMethod_name = map[int32]string{ + 1: "GET", + 2: "POST", + 3: "HEAD", + 4: "PUT", + 5: "DELETE", + 6: "PATCH", +} +var URLFetchRequest_RequestMethod_value = map[string]int32{ + "GET": 1, + "POST": 2, + "HEAD": 3, + "PUT": 4, + "DELETE": 5, + "PATCH": 6, +} + +func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod { + p := new(URLFetchRequest_RequestMethod) + *p = x + return p +} +func (x URLFetchRequest_RequestMethod) String() string { + return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x)) +} +func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod") + if err != nil { + return err + } + *x = URLFetchRequest_RequestMethod(value) + return nil +} +func (URLFetchRequest_RequestMethod) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0} +} + +type URLFetchServiceError struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} } +func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) } +func (*URLFetchServiceError) ProtoMessage() {} +func (*URLFetchServiceError) Descriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0} +} +func (m *URLFetchServiceError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_URLFetchServiceError.Unmarshal(m, b) +} +func (m *URLFetchServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_URLFetchServiceError.Marshal(b, m, deterministic) +} +func (dst *URLFetchServiceError) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLFetchServiceError.Merge(dst, src) +} +func (m *URLFetchServiceError) XXX_Size() int { + return xxx_messageInfo_URLFetchServiceError.Size(m) +} +func (m *URLFetchServiceError) XXX_DiscardUnknown() { + xxx_messageInfo_URLFetchServiceError.DiscardUnknown(m) +} + +var xxx_messageInfo_URLFetchServiceError proto.InternalMessageInfo + +type URLFetchRequest struct { + Method *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"` + Url *string `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"` + Header []*URLFetchRequest_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` + Payload []byte `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"` + FollowRedirects *bool `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"` + Deadline *float64 `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"` + MustValidateServerCertificate *bool `protobuf:"varint,9,opt,name=MustValidateServerCertificate,def=1" json:"MustValidateServerCertificate,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} } +func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) } +func (*URLFetchRequest) ProtoMessage() {} +func (*URLFetchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1} +} +func (m *URLFetchRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_URLFetchRequest.Unmarshal(m, b) +} +func (m *URLFetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_URLFetchRequest.Marshal(b, m, deterministic) +} +func (dst *URLFetchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLFetchRequest.Merge(dst, src) +} +func (m *URLFetchRequest) XXX_Size() int { + return xxx_messageInfo_URLFetchRequest.Size(m) +} +func (m *URLFetchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_URLFetchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_URLFetchRequest proto.InternalMessageInfo + +const Default_URLFetchRequest_FollowRedirects bool = true +const Default_URLFetchRequest_MustValidateServerCertificate bool = true + +func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod { + if m != nil && m.Method != nil { + return *m.Method + } + return URLFetchRequest_GET +} + +func (m *URLFetchRequest) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header { + if m != nil { + return m.Header + } + return nil +} + +func (m *URLFetchRequest) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *URLFetchRequest) GetFollowRedirects() bool { + if m != nil && m.FollowRedirects != nil { + return *m.FollowRedirects + } + return Default_URLFetchRequest_FollowRedirects +} + +func (m *URLFetchRequest) GetDeadline() float64 { + if m != nil && m.Deadline != nil { + return *m.Deadline + } + return 0 +} + +func (m *URLFetchRequest) GetMustValidateServerCertificate() bool { + if m != nil && m.MustValidateServerCertificate != nil { + return *m.MustValidateServerCertificate + } + return Default_URLFetchRequest_MustValidateServerCertificate +} + +type URLFetchRequest_Header struct { + Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"` + Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} } +func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) } +func (*URLFetchRequest_Header) ProtoMessage() {} +func (*URLFetchRequest_Header) Descriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0} +} +func (m *URLFetchRequest_Header) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_URLFetchRequest_Header.Unmarshal(m, b) +} +func (m *URLFetchRequest_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_URLFetchRequest_Header.Marshal(b, m, deterministic) +} +func (dst *URLFetchRequest_Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLFetchRequest_Header.Merge(dst, src) +} +func (m *URLFetchRequest_Header) XXX_Size() int { + return xxx_messageInfo_URLFetchRequest_Header.Size(m) +} +func (m *URLFetchRequest_Header) XXX_DiscardUnknown() { + xxx_messageInfo_URLFetchRequest_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_URLFetchRequest_Header proto.InternalMessageInfo + +func (m *URLFetchRequest_Header) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key + } + return "" +} + +func (m *URLFetchRequest_Header) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +type URLFetchResponse struct { + Content []byte `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"` + StatusCode *int32 `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"` + Header []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` + ContentWasTruncated *bool `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"` + ExternalBytesSent *int64 `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"` + ExternalBytesReceived *int64 `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"` + FinalUrl *string `protobuf:"bytes,9,opt,name=FinalUrl" json:"FinalUrl,omitempty"` + ApiCpuMilliseconds *int64 `protobuf:"varint,10,opt,name=ApiCpuMilliseconds,def=0" json:"ApiCpuMilliseconds,omitempty"` + ApiBytesSent *int64 `protobuf:"varint,11,opt,name=ApiBytesSent,def=0" json:"ApiBytesSent,omitempty"` + ApiBytesReceived *int64 `protobuf:"varint,12,opt,name=ApiBytesReceived,def=0" json:"ApiBytesReceived,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} } +func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) } +func (*URLFetchResponse) ProtoMessage() {} +func (*URLFetchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2} +} +func (m *URLFetchResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_URLFetchResponse.Unmarshal(m, b) +} +func (m *URLFetchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_URLFetchResponse.Marshal(b, m, deterministic) +} +func (dst *URLFetchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLFetchResponse.Merge(dst, src) +} +func (m *URLFetchResponse) XXX_Size() int { + return xxx_messageInfo_URLFetchResponse.Size(m) +} +func (m *URLFetchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_URLFetchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_URLFetchResponse proto.InternalMessageInfo + +const Default_URLFetchResponse_ContentWasTruncated bool = false +const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0 +const Default_URLFetchResponse_ApiBytesSent int64 = 0 +const Default_URLFetchResponse_ApiBytesReceived int64 = 0 + +func (m *URLFetchResponse) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *URLFetchResponse) GetStatusCode() int32 { + if m != nil && m.StatusCode != nil { + return *m.StatusCode + } + return 0 +} + +func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header { + if m != nil { + return m.Header + } + return nil +} + +func (m *URLFetchResponse) GetContentWasTruncated() bool { + if m != nil && m.ContentWasTruncated != nil { + return *m.ContentWasTruncated + } + return Default_URLFetchResponse_ContentWasTruncated +} + +func (m *URLFetchResponse) GetExternalBytesSent() int64 { + if m != nil && m.ExternalBytesSent != nil { + return *m.ExternalBytesSent + } + return 0 +} + +func (m *URLFetchResponse) GetExternalBytesReceived() int64 { + if m != nil && m.ExternalBytesReceived != nil { + return *m.ExternalBytesReceived + } + return 0 +} + +func (m *URLFetchResponse) GetFinalUrl() string { + if m != nil && m.FinalUrl != nil { + return *m.FinalUrl + } + return "" +} + +func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 { + if m != nil && m.ApiCpuMilliseconds != nil { + return *m.ApiCpuMilliseconds + } + return Default_URLFetchResponse_ApiCpuMilliseconds +} + +func (m *URLFetchResponse) GetApiBytesSent() int64 { + if m != nil && m.ApiBytesSent != nil { + return *m.ApiBytesSent + } + return Default_URLFetchResponse_ApiBytesSent +} + +func (m *URLFetchResponse) GetApiBytesReceived() int64 { + if m != nil && m.ApiBytesReceived != nil { + return *m.ApiBytesReceived + } + return Default_URLFetchResponse_ApiBytesReceived +} + +type URLFetchResponse_Header struct { + Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"` + Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} } +func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) } +func (*URLFetchResponse_Header) ProtoMessage() {} +func (*URLFetchResponse_Header) Descriptor() ([]byte, []int) { + return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2, 0} +} +func (m *URLFetchResponse_Header) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_URLFetchResponse_Header.Unmarshal(m, b) +} +func (m *URLFetchResponse_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_URLFetchResponse_Header.Marshal(b, m, deterministic) +} +func (dst *URLFetchResponse_Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLFetchResponse_Header.Merge(dst, src) +} +func (m *URLFetchResponse_Header) XXX_Size() int { + return xxx_messageInfo_URLFetchResponse_Header.Size(m) +} +func (m *URLFetchResponse_Header) XXX_DiscardUnknown() { + xxx_messageInfo_URLFetchResponse_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_URLFetchResponse_Header proto.InternalMessageInfo + +func (m *URLFetchResponse_Header) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key + } + return "" +} + +func (m *URLFetchResponse_Header) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +func init() { + proto.RegisterType((*URLFetchServiceError)(nil), "appengine.URLFetchServiceError") + proto.RegisterType((*URLFetchRequest)(nil), "appengine.URLFetchRequest") + proto.RegisterType((*URLFetchRequest_Header)(nil), "appengine.URLFetchRequest.Header") + proto.RegisterType((*URLFetchResponse)(nil), "appengine.URLFetchResponse") + proto.RegisterType((*URLFetchResponse_Header)(nil), "appengine.URLFetchResponse.Header") +} + +func init() { + proto.RegisterFile("google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto", fileDescriptor_urlfetch_service_b245a7065f33bced) +} + +var fileDescriptor_urlfetch_service_b245a7065f33bced = []byte{ + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xe3, 0x54, + 0x10, 0xc6, 0x76, 0x7e, 0xa7, 0x5d, 0x7a, 0x76, 0xb6, 0x45, 0x66, 0xb5, 0xa0, 0x10, 0x09, 0x29, + 0x17, 0x90, 0x2e, 0x2b, 0x24, 0x44, 0xaf, 0x70, 0xed, 0x93, 0xad, 0xa9, 0x63, 0x47, 0xc7, 0x4e, + 0x61, 0xb9, 0xb1, 0xac, 0x78, 0x9a, 0x5a, 0xb2, 0xec, 0x60, 0x9f, 0x2c, 0xf4, 0x35, 0x78, 0x0d, + 0xde, 0x87, 0xa7, 0xe1, 0x02, 0x9d, 0xc4, 0xc9, 0x6e, 0xbb, 0xd1, 0x4a, 0x5c, 0x65, 0xe6, 0x9b, + 0xef, 0xcc, 0x99, 0x7c, 0xdf, 0xf8, 0x80, 0xb3, 0x2c, 0xcb, 0x65, 0x4e, 0xe3, 0x65, 0x99, 0x27, + 0xc5, 0x72, 0x5c, 0x56, 0xcb, 0xf3, 0x64, 0xb5, 0xa2, 0x62, 0x99, 0x15, 0x74, 0x9e, 0x15, 0x92, + 0xaa, 0x22, 0xc9, 0xcf, 0xd7, 0x55, 0x7e, 0x4b, 0x72, 0x71, 0xb7, 0x0f, 0xe2, 0x9a, 0xaa, 0xb7, + 0xd9, 0x82, 0xc6, 0xab, 0xaa, 0x94, 0x25, 0xf6, 0xf7, 0x67, 0x86, 0x7f, 0xeb, 0x70, 0x3a, 0x17, + 0xde, 0x44, 0xb1, 0xc2, 0x2d, 0x89, 0x57, 0x55, 0x59, 0x0d, 0xff, 0xd2, 0xa1, 0xbf, 0x89, 0xec, + 0x32, 0x25, 0xec, 0x80, 0x1e, 0x5c, 0xb3, 0x4f, 0xf0, 0x04, 0x8e, 0x5c, 0xff, 0xc6, 0xf2, 0x5c, + 0x27, 0x9e, 0x0b, 0x8f, 0x69, 0x0a, 0x98, 0xf0, 0xc8, 0xbe, 0x8a, 0xb9, 0x10, 0x81, 0x60, 0x3a, + 0x9e, 0xc1, 0xd3, 0xb9, 0x1f, 0xce, 0xb8, 0xed, 0x4e, 0x5c, 0xee, 0x34, 0xb0, 0x81, 0x9f, 0x01, + 0x0a, 0x1e, 0xce, 0x02, 0x3f, 0xe4, 0x71, 0x14, 0x04, 0xb1, 0x67, 0x89, 0xd7, 0x9c, 0xb5, 0x14, + 0xdd, 0xe1, 0x96, 0xe3, 0xb9, 0x3e, 0x8f, 0xf9, 0xaf, 0x36, 0xe7, 0x0e, 0x77, 0x58, 0x1b, 0x3f, + 0x87, 0xb3, 0x30, 0xf4, 0x62, 0x9b, 0x8b, 0xc8, 0x9d, 0xb8, 0xb6, 0x15, 0xf1, 0xa6, 0x53, 0x07, + 0x9f, 0x40, 0xdf, 0xf1, 0xc3, 0x26, 0xed, 0x22, 0x40, 0xc7, 0xf6, 0x82, 0x90, 0x3b, 0xac, 0x87, + 0x2f, 0xc0, 0x74, 0xfd, 0x88, 0x0b, 0xdf, 0xf2, 0xe2, 0x48, 0x58, 0x7e, 0xe8, 0x72, 0x3f, 0x6a, + 0x98, 0x7d, 0x35, 0x82, 0xba, 0x79, 0x6a, 0xf9, 0x6f, 0x62, 0xc1, 0x1d, 0x57, 0x70, 0x3b, 0x0a, + 0x19, 0xe0, 0x33, 0x38, 0x99, 0x5a, 0xde, 0x24, 0x10, 0x53, 0xee, 0xc4, 0x82, 0xcf, 0xbc, 0x37, + 0xec, 0x08, 0x4f, 0x81, 0xd9, 0x81, 0xef, 0x73, 0x3b, 0x72, 0x03, 0xbf, 0x69, 0x71, 0x3c, 0xfc, + 0xc7, 0x80, 0x93, 0x9d, 0x5a, 0x82, 0x7e, 0x5f, 0x53, 0x2d, 0xf1, 0x27, 0xe8, 0x4c, 0x49, 0xde, + 0x95, 0xa9, 0xa9, 0x0d, 0xf4, 0xd1, 0xa7, 0xaf, 0x46, 0xe3, 0xbd, 0xba, 0xe3, 0x47, 0xdc, 0x71, + 0xf3, 0xbb, 0xe5, 0x8b, 0xe6, 0x1c, 0x32, 0x30, 0xe6, 0x55, 0x6e, 0xea, 0x03, 0x7d, 0xd4, 0x17, + 0x2a, 0xc4, 0x1f, 0xa1, 0x73, 0x47, 0x49, 0x4a, 0x95, 0x69, 0x0c, 0x8c, 0x11, 0xbc, 0xfa, 0xea, + 0x23, 0x3d, 0xaf, 0x36, 0x44, 0xd1, 0x1c, 0xc0, 0x17, 0xd0, 0x9d, 0x25, 0xf7, 0x79, 0x99, 0xa4, + 0x66, 0x67, 0xa0, 0x8d, 0x8e, 0x2f, 0xf5, 0x9e, 0x26, 0x76, 0x10, 0x8e, 0xe1, 0x64, 0x52, 0xe6, + 0x79, 0xf9, 0x87, 0xa0, 0x34, 0xab, 0x68, 0x21, 0x6b, 0xb3, 0x3b, 0xd0, 0x46, 0xbd, 0x8b, 0x96, + 0xac, 0xd6, 0x24, 0x1e, 0x17, 0xf1, 0x39, 0xf4, 0x1c, 0x4a, 0xd2, 0x3c, 0x2b, 0xc8, 0xec, 0x0d, + 0xb4, 0x91, 0x26, 0xf6, 0x39, 0xfe, 0x0c, 0x5f, 0x4c, 0xd7, 0xb5, 0xbc, 0x49, 0xf2, 0x2c, 0x4d, + 0x24, 0xa9, 0xed, 0xa1, 0xca, 0xa6, 0x4a, 0x66, 0xb7, 0xd9, 0x22, 0x91, 0x64, 0xf6, 0xdf, 0xeb, + 0xfc, 0x71, 0xea, 0xf3, 0x97, 0xd0, 0xd9, 0xfe, 0x0f, 0x25, 0xc6, 0x35, 0xdd, 0x9b, 0xad, 0xad, + 0x18, 0xd7, 0x74, 0x8f, 0xa7, 0xd0, 0xbe, 0x49, 0xf2, 0x35, 0x99, 0xed, 0x0d, 0xb6, 0x4d, 0x86, + 0x1e, 0x3c, 0x79, 0xa0, 0x26, 0x76, 0xc1, 0x78, 0xcd, 0x23, 0xa6, 0x61, 0x0f, 0x5a, 0xb3, 0x20, + 0x8c, 0x98, 0xae, 0xa2, 0x2b, 0x6e, 0x39, 0xcc, 0x50, 0xc5, 0xd9, 0x3c, 0x62, 0x2d, 0xb5, 0x2e, + 0x0e, 0xf7, 0x78, 0xc4, 0x59, 0x1b, 0xfb, 0xd0, 0x9e, 0x59, 0x91, 0x7d, 0xc5, 0x3a, 0xc3, 0x7f, + 0x0d, 0x60, 0xef, 0x84, 0xad, 0x57, 0x65, 0x51, 0x13, 0x9a, 0xd0, 0xb5, 0xcb, 0x42, 0x52, 0x21, + 0x4d, 0x4d, 0x49, 0x29, 0x76, 0x29, 0x7e, 0x09, 0x10, 0xca, 0x44, 0xae, 0x6b, 0xf5, 0x71, 0x6c, + 0x8c, 0x6b, 0x8b, 0xf7, 0x10, 0xbc, 0x78, 0xe4, 0xdf, 0xf0, 0xa0, 0x7f, 0xdb, 0x6b, 0x1e, 0x1b, + 0xf8, 0x03, 0x3c, 0x6b, 0xae, 0xf9, 0x25, 0xa9, 0xa3, 0x6a, 0x5d, 0x28, 0x81, 0xb6, 0x66, 0xf6, + 0x2e, 0xda, 0xb7, 0x49, 0x5e, 0x93, 0x38, 0xc4, 0xc0, 0x6f, 0xe0, 0x29, 0xff, 0x73, 0xfb, 0x02, + 0x5c, 0xde, 0x4b, 0xaa, 0x43, 0x35, 0xb8, 0x72, 0xd7, 0x10, 0x1f, 0x16, 0xf0, 0x7b, 0x38, 0x7b, + 0x00, 0x0a, 0x5a, 0x50, 0xf6, 0x96, 0xd2, 0x8d, 0xcd, 0x86, 0x38, 0x5c, 0x54, 0xfb, 0x30, 0xc9, + 0x8a, 0x24, 0x57, 0xfb, 0xaa, 0xec, 0xed, 0x8b, 0x7d, 0x8e, 0xdf, 0x01, 0x5a, 0xab, 0xcc, 0x5e, + 0xad, 0xa7, 0x59, 0x9e, 0x67, 0x35, 0x2d, 0xca, 0x22, 0xad, 0x4d, 0x50, 0xed, 0x2e, 0xb4, 0x97, + 0xe2, 0x40, 0x11, 0xbf, 0x86, 0x63, 0x6b, 0x95, 0xbd, 0x9b, 0xf6, 0x68, 0x47, 0x7e, 0x00, 0xe3, + 0xb7, 0xc0, 0x76, 0xf9, 0x7e, 0xcc, 0xe3, 0x1d, 0xf5, 0x83, 0xd2, 0xff, 0x5f, 0xa6, 0x4b, 0xf8, + 0xad, 0xb7, 0x7b, 0x2a, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x9f, 0x6d, 0x24, 0x63, 0x05, + 0x00, 0x00, +} diff --git a/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto b/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto new file mode 100644 index 00000000000..f695edf6a90 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto @@ -0,0 +1,64 @@ +syntax = "proto2"; +option go_package = "urlfetch"; + +package appengine; + +message URLFetchServiceError { + enum ErrorCode { + OK = 0; + INVALID_URL = 1; + FETCH_ERROR = 2; + UNSPECIFIED_ERROR = 3; + RESPONSE_TOO_LARGE = 4; + DEADLINE_EXCEEDED = 5; + SSL_CERTIFICATE_ERROR = 6; + DNS_ERROR = 7; + CLOSED = 8; + INTERNAL_TRANSIENT_ERROR = 9; + TOO_MANY_REDIRECTS = 10; + MALFORMED_REPLY = 11; + CONNECTION_ERROR = 12; + } +} + +message URLFetchRequest { + enum RequestMethod { + GET = 1; + POST = 2; + HEAD = 3; + PUT = 4; + DELETE = 5; + PATCH = 6; + } + required RequestMethod Method = 1; + required string Url = 2; + repeated group Header = 3 { + required string Key = 4; + required string Value = 5; + } + optional bytes Payload = 6 [ctype=CORD]; + + optional bool FollowRedirects = 7 [default=true]; + + optional double Deadline = 8; + + optional bool MustValidateServerCertificate = 9 [default=true]; +} + +message URLFetchResponse { + optional bytes Content = 1; + required int32 StatusCode = 2; + repeated group Header = 3 { + required string Key = 4; + required string Value = 5; + } + optional bool ContentWasTruncated = 6 [default=false]; + optional int64 ExternalBytesSent = 7; + optional int64 ExternalBytesReceived = 8; + + optional string FinalUrl = 9; + + optional int64 ApiCpuMilliseconds = 10 [default=0]; + optional int64 ApiBytesSent = 11 [default=0]; + optional int64 ApiBytesReceived = 12 [default=0]; +} diff --git a/upstream/vendor/google.golang.org/appengine/namespace.go b/upstream/vendor/google.golang.org/appengine/namespace.go new file mode 100644 index 00000000000..6f169be487d --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/namespace.go @@ -0,0 +1,24 @@ +// Copyright 2012 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package appengine + +import ( + "context" + "fmt" + "regexp" + + "google.golang.org/appengine/internal" +) + +// Namespace returns a replacement context that operates within the given namespace. +func Namespace(c context.Context, namespace string) (context.Context, error) { + if !validNamespace.MatchString(namespace) { + return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace) + } + return internal.NamespacedContext(c, namespace), nil +} + +// validNamespace matches valid namespace names. +var validNamespace = regexp.MustCompile(`^[0-9A-Za-z._-]{0,100}$`) diff --git a/upstream/vendor/google.golang.org/appengine/timeout.go b/upstream/vendor/google.golang.org/appengine/timeout.go new file mode 100644 index 00000000000..fcf3ad0a58f --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/timeout.go @@ -0,0 +1,20 @@ +// Copyright 2013 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +package appengine + +import "context" + +// IsTimeoutError reports whether err is a timeout error. +func IsTimeoutError(err error) bool { + if err == context.DeadlineExceeded { + return true + } + if t, ok := err.(interface { + IsTimeout() bool + }); ok { + return t.IsTimeout() + } + return false +} diff --git a/upstream/vendor/google.golang.org/appengine/urlfetch/urlfetch.go b/upstream/vendor/google.golang.org/appengine/urlfetch/urlfetch.go new file mode 100644 index 00000000000..6c0d72418d8 --- /dev/null +++ b/upstream/vendor/google.golang.org/appengine/urlfetch/urlfetch.go @@ -0,0 +1,209 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by the Apache 2.0 +// license that can be found in the LICENSE file. + +// Package urlfetch provides an http.RoundTripper implementation +// for fetching URLs via App Engine's urlfetch service. +package urlfetch // import "google.golang.org/appengine/urlfetch" + +import ( + "context" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + + "google.golang.org/appengine/internal" + pb "google.golang.org/appengine/internal/urlfetch" +) + +// Transport is an implementation of http.RoundTripper for +// App Engine. Users should generally create an http.Client using +// this transport and use the Client rather than using this transport +// directly. +type Transport struct { + Context context.Context + + // Controls whether the application checks the validity of SSL certificates + // over HTTPS connections. A value of false (the default) instructs the + // application to send a request to the server only if the certificate is + // valid and signed by a trusted certificate authority (CA), and also + // includes a hostname that matches the certificate. A value of true + // instructs the application to perform no certificate validation. + AllowInvalidServerCertificate bool +} + +// Verify statically that *Transport implements http.RoundTripper. +var _ http.RoundTripper = (*Transport)(nil) + +// Client returns an *http.Client using a default urlfetch Transport. This +// client will check the validity of SSL certificates. +// +// Any deadline of the provided context will be used for requests through this client. +// If the client does not have a deadline, then an App Engine default of 60 second is used. +func Client(ctx context.Context) *http.Client { + return &http.Client{ + Transport: &Transport{ + Context: ctx, + }, + } +} + +type bodyReader struct { + content []byte + truncated bool + closed bool +} + +// ErrTruncatedBody is the error returned after the final Read() from a +// response's Body if the body has been truncated by App Engine's proxy. +var ErrTruncatedBody = errors.New("urlfetch: truncated body") + +func statusCodeToText(code int) string { + if t := http.StatusText(code); t != "" { + return t + } + return strconv.Itoa(code) +} + +func (br *bodyReader) Read(p []byte) (n int, err error) { + if br.closed { + if br.truncated { + return 0, ErrTruncatedBody + } + return 0, io.EOF + } + n = copy(p, br.content) + if n > 0 { + br.content = br.content[n:] + return + } + if br.truncated { + br.closed = true + return 0, ErrTruncatedBody + } + return 0, io.EOF +} + +func (br *bodyReader) Close() error { + br.closed = true + br.content = nil + return nil +} + +// A map of the URL Fetch-accepted methods that take a request body. +var methodAcceptsRequestBody = map[string]bool{ + "POST": true, + "PUT": true, + "PATCH": true, +} + +// urlString returns a valid string given a URL. This function is necessary because +// the String method of URL doesn't correctly handle URLs with non-empty Opaque values. +// See http://code.google.com/p/go/issues/detail?id=4860. +func urlString(u *url.URL) string { + if u.Opaque == "" || strings.HasPrefix(u.Opaque, "//") { + return u.String() + } + aux := *u + aux.Opaque = "//" + aux.Host + aux.Opaque + return aux.String() +} + +// RoundTrip issues a single HTTP request and returns its response. Per the +// http.RoundTripper interface, RoundTrip only returns an error if there +// was an unsupported request or the URL Fetch proxy fails. +// Note that HTTP response codes such as 5xx, 403, 404, etc are not +// errors as far as the transport is concerned and will be returned +// with err set to nil. +func (t *Transport) RoundTrip(req *http.Request) (res *http.Response, err error) { + methNum, ok := pb.URLFetchRequest_RequestMethod_value[req.Method] + if !ok { + return nil, fmt.Errorf("urlfetch: unsupported HTTP method %q", req.Method) + } + + method := pb.URLFetchRequest_RequestMethod(methNum) + + freq := &pb.URLFetchRequest{ + Method: &method, + Url: proto.String(urlString(req.URL)), + FollowRedirects: proto.Bool(false), // http.Client's responsibility + MustValidateServerCertificate: proto.Bool(!t.AllowInvalidServerCertificate), + } + if deadline, ok := t.Context.Deadline(); ok { + freq.Deadline = proto.Float64(deadline.Sub(time.Now()).Seconds()) + } + + for k, vals := range req.Header { + for _, val := range vals { + freq.Header = append(freq.Header, &pb.URLFetchRequest_Header{ + Key: proto.String(k), + Value: proto.String(val), + }) + } + } + if methodAcceptsRequestBody[req.Method] && req.Body != nil { + // Avoid a []byte copy if req.Body has a Bytes method. + switch b := req.Body.(type) { + case interface { + Bytes() []byte + }: + freq.Payload = b.Bytes() + default: + freq.Payload, err = ioutil.ReadAll(req.Body) + if err != nil { + return nil, err + } + } + } + + fres := &pb.URLFetchResponse{} + if err := internal.Call(t.Context, "urlfetch", "Fetch", freq, fres); err != nil { + return nil, err + } + + res = &http.Response{} + res.StatusCode = int(*fres.StatusCode) + res.Status = fmt.Sprintf("%d %s", res.StatusCode, statusCodeToText(res.StatusCode)) + res.Header = make(http.Header) + res.Request = req + + // Faked: + res.ProtoMajor = 1 + res.ProtoMinor = 1 + res.Proto = "HTTP/1.1" + res.Close = true + + for _, h := range fres.Header { + hkey := http.CanonicalHeaderKey(*h.Key) + hval := *h.Value + if hkey == "Content-Length" { + // Will get filled in below for all but HEAD requests. + if req.Method == "HEAD" { + res.ContentLength, _ = strconv.ParseInt(hval, 10, 64) + } + continue + } + res.Header.Add(hkey, hval) + } + + if req.Method != "HEAD" { + res.ContentLength = int64(len(fres.Content)) + } + + truncated := fres.GetContentWasTruncated() + res.Body = &bodyReader{content: fres.Content, truncated: truncated} + return +} + +func init() { + internal.RegisterErrorCodeMap("urlfetch", pb.URLFetchServiceError_ErrorCode_name) + internal.RegisterTimeoutErrorCode("urlfetch", int32(pb.URLFetchServiceError_DEADLINE_EXCEEDED)) +} diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go index 8b462f3dfee..191bea48c86 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2015 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.12.2 // source: google/api/annotations.proto package annotations diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go index fe19e8f97a7..10f35d10e52 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -1024,13 +1024,6 @@ type MethodSettings struct { // The fully qualified name of the method, for which the options below apply. // This is used to find the method to apply the options. - // - // Example: - // - // publishing: - // method_settings: - // - selector: google.storage.control.v2.StorageControl.CreateFolder - // # method settings for CreateFolder... Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` // Describes settings to use for long-running operations when generating // API methods for RPCs. Complements RPCs that use the annotations in @@ -1040,12 +1033,15 @@ type MethodSettings struct { // // publishing: // method_settings: - // - selector: google.cloud.speech.v2.Speech.BatchRecognize - // long_running: - // initial_poll_delay: 60s # 1 minute - // poll_delay_multiplier: 1.5 - // max_poll_delay: 360s # 6 minutes - // total_poll_timeout: 54000s # 90 minutes + // - selector: google.cloud.speech.v2.Speech.BatchRecognize + // long_running: + // initial_poll_delay: + // seconds: 60 # 1 minute + // poll_delay_multiplier: 1.5 + // max_poll_delay: + // seconds: 360 # 6 minutes + // total_poll_timeout: + // seconds: 54000 # 90 minutes LongRunning *MethodSettings_LongRunning `protobuf:"bytes,2,opt,name=long_running,json=longRunning,proto3" json:"long_running,omitempty"` // List of top-level fields of the request message, that should be // automatically populated by the client libraries based on their @@ -1055,9 +1051,9 @@ type MethodSettings struct { // // publishing: // method_settings: - // - selector: google.example.v1.ExampleService.CreateExample - // auto_populated_fields: - // - request_id + // - selector: google.example.v1.ExampleService.CreateExample + // auto_populated_fields: + // - request_id AutoPopulatedFields []string `protobuf:"bytes,3,rep,name=auto_populated_fields,json=autoPopulatedFields,proto3" json:"auto_populated_fields,omitempty"` } diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go index 08505ba3fec..312d7eb49a9 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go index a462e7d0132..6ff36206dac 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -121,11 +121,6 @@ type FieldInfo struct { // any API consumer, just documents the API's format for the field it is // applied to. Format FieldInfo_Format `protobuf:"varint,1,opt,name=format,proto3,enum=google.api.FieldInfo_Format" json:"format,omitempty"` - // The type(s) that the annotated, generic field may represent. - // - // Currently, this must only be used on fields of type `google.protobuf.Any`. - // Supporting other generic types may be considered in the future. - ReferencedTypes []*TypeReference `protobuf:"bytes,2,rep,name=referenced_types,json=referencedTypes,proto3" json:"referenced_types,omitempty"` } func (x *FieldInfo) Reset() { @@ -167,70 +162,6 @@ func (x *FieldInfo) GetFormat() FieldInfo_Format { return FieldInfo_FORMAT_UNSPECIFIED } -func (x *FieldInfo) GetReferencedTypes() []*TypeReference { - if x != nil { - return x.ReferencedTypes - } - return nil -} - -// A reference to a message type, for use in [FieldInfo][google.api.FieldInfo]. -type TypeReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the type that the annotated, generic field may represent. - // If the type is in the same protobuf package, the value can be the simple - // message name e.g., `"MyMessage"`. Otherwise, the value must be the - // fully-qualified message name e.g., `"google.library.v1.Book"`. - // - // If the type(s) are unknown to the service (e.g. the field accepts generic - // user input), use the wildcard `"*"` to denote this behavior. - // - // See [AIP-202](https://google.aip.dev/202#type-references) for more details. - TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` -} - -func (x *TypeReference) Reset() { - *x = TypeReference{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_field_info_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TypeReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypeReference) ProtoMessage() {} - -func (x *TypeReference) ProtoReflect() protoreflect.Message { - mi := &file_google_api_field_info_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TypeReference.ProtoReflect.Descriptor instead. -func (*TypeReference) Descriptor() ([]byte, []int) { - return file_google_api_field_info_proto_rawDescGZIP(), []int{1} -} - -func (x *TypeReference) GetTypeName() string { - if x != nil { - return x.TypeName - } - return "" -} - var file_google_api_field_info_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FieldOptions)(nil), @@ -254,13 +185,6 @@ var ( // string actual_ip_address = 4 [ // (google.api.field_info).format = IPV4_OR_IPV6 // ]; - // google.protobuf.Any generic_field = 5 [ - // (google.api.field_info).referenced_types = {type_name: "ActualType"}, - // (google.api.field_info).referenced_types = {type_name: "OtherType"}, - // ]; - // google.protobuf.Any generic_user_input = 5 [ - // (google.api.field_info).referenced_types = {type_name: "*"}, - // ]; // // optional google.api.FieldInfo field_info = 291403980; E_FieldInfo = &file_google_api_field_info_proto_extTypes[0] @@ -273,37 +197,30 @@ var file_google_api_field_info_proto_rawDesc = []byte{ 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x01, 0x0a, 0x09, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x44, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x55, 0x49, 0x44, 0x34, - 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, - 0x49, 0x50, 0x56, 0x36, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x50, 0x56, 0x34, 0x5f, 0x4f, - 0x52, 0x5f, 0x49, 0x50, 0x56, 0x36, 0x10, 0x04, 0x22, 0x2c, 0x0a, 0x0d, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, - 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x57, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xcc, 0xf1, 0xf9, 0x8a, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, - 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x42, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, - 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, + 0x51, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, + 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x55, 0x49, 0x44, 0x34, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, + 0x49, 0x50, 0x56, 0x34, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x36, 0x10, 0x03, + 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x50, 0x56, 0x34, 0x5f, 0x4f, 0x52, 0x5f, 0x49, 0x50, 0x56, 0x36, + 0x10, 0x04, 0x3a, 0x57, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xcc, 0xf1, 0xf9, 0x8a, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x6c, 0x0a, 0x0e, 0x63, + 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -319,23 +236,21 @@ func file_google_api_field_info_proto_rawDescGZIP() []byte { } var file_google_api_field_info_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_field_info_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_google_api_field_info_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_api_field_info_proto_goTypes = []interface{}{ (FieldInfo_Format)(0), // 0: google.api.FieldInfo.Format (*FieldInfo)(nil), // 1: google.api.FieldInfo - (*TypeReference)(nil), // 2: google.api.TypeReference - (*descriptorpb.FieldOptions)(nil), // 3: google.protobuf.FieldOptions + (*descriptorpb.FieldOptions)(nil), // 2: google.protobuf.FieldOptions } var file_google_api_field_info_proto_depIdxs = []int32{ 0, // 0: google.api.FieldInfo.format:type_name -> google.api.FieldInfo.Format - 2, // 1: google.api.FieldInfo.referenced_types:type_name -> google.api.TypeReference - 3, // 2: google.api.field_info:extendee -> google.protobuf.FieldOptions - 1, // 3: google.api.field_info:type_name -> google.api.FieldInfo - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 3, // [3:4] is the sub-list for extension type_name - 2, // [2:3] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 2, // 1: google.api.field_info:extendee -> google.protobuf.FieldOptions + 1, // 2: google.api.field_info:type_name -> google.api.FieldInfo + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 2, // [2:3] is the sub-list for extension type_name + 1, // [1:2] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_google_api_field_info_proto_init() } @@ -356,18 +271,6 @@ func file_google_api_field_info_proto_init() { return nil } } - file_google_api_field_info_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TypeReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -375,7 +278,7 @@ func file_google_api_field_info_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_field_info_proto_rawDesc, NumEnums: 1, - NumMessages: 2, + NumMessages: 1, NumExtensions: 1, NumServices: 0, }, diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go index ffb5838cb18..8a0e1c345b9 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/api/http.proto package annotations @@ -102,7 +102,7 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { return false } -// gRPC Transcoding +// # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service @@ -143,8 +143,9 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // // This enables an HTTP REST to gRPC mapping as below: // -// - HTTP: `GET /v1/messages/123456` -// - gRPC: `GetMessage(name: "messages/123456")` +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. @@ -168,9 +169,11 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // // This enables a HTTP JSON to RPC mapping as below: // -// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` -// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: -// SubMessage(subfield: "foo"))` +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. @@ -200,8 +203,10 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // representation of the JSON in the request body is determined by // protos JSON encoding: // -// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` -// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the @@ -223,8 +228,10 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // // The following HTTP JSON to RPC mapping is enabled: // -// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` -// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in @@ -252,13 +259,13 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // // This enables the following two alternative HTTP JSON to RPC mappings: // -// - HTTP: `GET /v1/messages/123456` -// - gRPC: `GetMessage(message_id: "123456")` +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` // -// - HTTP: `GET /v1/users/me/messages/123456` -// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` -// -// # Rules for HTTP mapping +// ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: @@ -277,7 +284,7 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // request body, all // fields are passed via URL path and URL query parameters. // -// Path template syntax +// ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; @@ -316,7 +323,7 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // -// # Using gRPC API Service Configuration +// ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The @@ -331,14 +338,15 @@ func (x *Http) GetFullyDecodeReservedExpansion() bool { // specified in the service config will override any matching transcoding // configuration in the proto. // -// The following example selects a gRPC method and applies an `HttpRule` to it: +// Example: // // http: // rules: +// # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // -// # Special notes +// ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go index b5db279aebf..bbcc12d29c8 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/api/resource.proto package annotations @@ -253,13 +253,8 @@ type ResourceDescriptor struct { History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` // The plural name used in the resource name and permission names, such as // 'projects' for the resource name of 'projects/{project}' and the permission - // name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - // to this is for Nested Collections that have stuttering names, as defined - // in [AIP-122](https://google.aip.dev/122#nested-collections), where the - // collection ID in the resource name pattern does not necessarily directly - // match the `plural` value. - // - // It is the same concept of the `plural` field in k8s CRD spec + // name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same + // concept of the `plural` field in k8s CRD spec // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ // // Note: The plural form is required even for singleton resources. See diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go index 1d8397b02b4..9a9ae04c29a 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/api/routing.proto package annotations diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go index 9f81dbcd86e..137ff5b1e94 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go index 0a2ffb5955d..ca4415956f0 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go index 57aaa2c9f51..3f994b4e3e0 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go index c90c6015d26..0d718fc36d1 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -1105,66 +1105,25 @@ func (x *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry { // messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the // macro tests whether the property is set to its default. For map and struct // types, the macro tests whether the property `x` is defined on `m`. -// -// Comprehensions for the standard environment macros evaluation can be best -// visualized as the following pseudocode: -// -// ``` -// let `accu_var` = `accu_init` -// -// for (let `iter_var` in `iter_range`) { -// if (!`loop_condition`) { -// break -// } -// `accu_var` = `loop_step` -// } -// -// return `result` -// ``` -// -// Comprehensions for the optional V2 macros which support map-to-map -// translation differ slightly from the standard environment macros in that -// they expose both the key or index in addition to the value for each list -// or map entry: -// -// ``` -// let `accu_var` = `accu_init` -// -// for (let `iter_var`, `iter_var2` in `iter_range`) { -// if (!`loop_condition`) { -// break -// } -// `accu_var` = `loop_step` -// } -// -// return `result` -// ``` type Expr_Comprehension struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The name of the first iteration variable. - // When the iter_range is a list, this variable is the list element. - // When the iter_range is a map, this variable is the map entry key. + // The name of the iteration variable. IterVar string `protobuf:"bytes,1,opt,name=iter_var,json=iterVar,proto3" json:"iter_var,omitempty"` - // The name of the second iteration variable, empty if not set. - // When the iter_range is a list, this variable is the integer index. - // When the iter_range is a map, this variable is the map entry value. - // This field is only set for comprehension v2 macros. - IterVar2 string `protobuf:"bytes,8,opt,name=iter_var2,json=iterVar2,proto3" json:"iter_var2,omitempty"` - // The range over which the comprehension iterates. + // The range over which var iterates. IterRange *Expr `protobuf:"bytes,2,opt,name=iter_range,json=iterRange,proto3" json:"iter_range,omitempty"` // The name of the variable used for accumulation of the result. AccuVar string `protobuf:"bytes,3,opt,name=accu_var,json=accuVar,proto3" json:"accu_var,omitempty"` // The initial value of the accumulator. AccuInit *Expr `protobuf:"bytes,4,opt,name=accu_init,json=accuInit,proto3" json:"accu_init,omitempty"` - // An expression which can contain iter_var, iter_var2, and accu_var. + // An expression which can contain iter_var and accu_var. // // Returns false when the result has been computed and may be used as // a hint to short-circuit the remainder of the comprehension. LoopCondition *Expr `protobuf:"bytes,5,opt,name=loop_condition,json=loopCondition,proto3" json:"loop_condition,omitempty"` - // An expression which can contain iter_var, iter_var2, and accu_var. + // An expression which can contain iter_var and accu_var. // // Computes the next value of accu_var. LoopStep *Expr `protobuf:"bytes,6,opt,name=loop_step,json=loopStep,proto3" json:"loop_step,omitempty"` @@ -1213,13 +1172,6 @@ func (x *Expr_Comprehension) GetIterVar() string { return "" } -func (x *Expr_Comprehension) GetIterVar2() string { - if x != nil { - return x.IterVar2 - } - return "" -} - func (x *Expr_Comprehension) GetIterRange() *Expr { if x != nil { return x.IterRange @@ -1533,7 +1485,7 @@ var file_google_api_expr_v1alpha1_syntax_proto_rawDesc = []byte{ 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xcb, 0x0d, 0x0a, 0x04, 0x45, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xae, 0x0d, 0x0a, 0x04, 0x45, 0x78, 0x70, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, @@ -1615,134 +1567,132 @@ var file_google_api_expr_v1alpha1_syntax_proto_rawDesc = []byte{ 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x1a, 0x9a, - 0x03, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x1a, 0xfd, + 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x69, 0x74, 0x65, 0x72, 0x56, 0x61, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x69, - 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x72, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x69, 0x74, 0x65, 0x72, 0x56, 0x61, 0x72, 0x32, 0x12, 0x3d, 0x0a, 0x0a, 0x69, 0x74, 0x65, 0x72, - 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, + 0x28, 0x09, 0x52, 0x07, 0x69, 0x74, 0x65, 0x72, 0x56, 0x61, 0x72, 0x12, 0x3d, 0x0a, 0x0a, 0x69, + 0x74, 0x65, 0x72, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, + 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, + 0x09, 0x69, 0x74, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, + 0x63, 0x75, 0x5f, 0x76, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, + 0x63, 0x75, 0x56, 0x61, 0x72, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x75, 0x5f, 0x69, 0x6e, + 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x61, 0x63, 0x63, 0x75, 0x49, 0x6e, + 0x69, 0x74, 0x12, 0x45, 0x0a, 0x0e, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0d, 0x6c, 0x6f, 0x6f, 0x70, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x09, 0x6c, 0x6f, 0x6f, + 0x70, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x69, 0x74, - 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x75, 0x5f, - 0x76, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x75, 0x56, - 0x61, 0x72, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x75, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x61, 0x63, 0x63, 0x75, 0x49, 0x6e, 0x69, 0x74, 0x12, - 0x45, 0x0a, 0x0e, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x6c, 0x6f, + 0x6f, 0x70, 0x53, 0x74, 0x65, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x0b, + 0x0a, 0x09, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xc1, 0x03, 0x0a, 0x08, + 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, + 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, + 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, + 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, + 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, + 0x18, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 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, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x0e, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, + 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, + 0x8c, 0x07, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, + 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x4f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0d, 0x6c, 0x6f, 0x6f, 0x70, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x09, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x73, - 0x74, 0x65, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x72, 0x6f, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x4e, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x80, + 0x03, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x69, 0x0a, 0x13, + 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x08, 0x6c, 0x6f, 0x6f, 0x70, 0x53, - 0x74, 0x65, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x07, 0x20, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x52, 0x12, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, + 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, + 0x22, 0x6f, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, + 0x15, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4d, 0x50, + 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1a, + 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, + 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, + 0x03, 0x1a, 0x3c, 0x0a, 0x0e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x5d, 0x0a, 0x0f, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, - 0x78, 0x70, 0x72, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x65, - 0x78, 0x70, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xc1, 0x03, 0x0a, 0x08, 0x43, 0x6f, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, - 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, - 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, 0x01, 0x48, - 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x49, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x09, 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, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x8c, 0x07, 0x0a, - 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x79, 0x6e, 0x74, 0x61, 0x78, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, - 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x73, 0x12, 0x51, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, - 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0a, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x4e, 0x0a, 0x0a, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, - 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x80, 0x03, 0x0a, 0x09, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x69, 0x0a, 0x13, 0x61, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x52, 0x12, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, + 0x78, 0x70, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, + 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x42, 0x6e, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, - 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, - 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, - 0x4e, 0x54, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, - 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x48, - 0x45, 0x43, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x50, 0x4f, - 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x1a, 0x3c, - 0x0a, 0x0e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5d, 0x0a, 0x0f, - 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, - 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x72, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, 0x0a, 0x0e, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, - 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x42, 0x6e, 0x0a, - 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x53, - 0x79, 0x6e, 0x74, 0x61, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, - 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x0b, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go index 0a5ca6a1b9f..033f238684f 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go index e7d3805e365..3543268f84e 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/api/httpbody.proto package httpbody diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go index 498020e33cd..454948669dc 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// 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. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/api/launch_stage.proto package api diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go index bd46edbe735..cc5d52fbcc3 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/rpc/code.proto package code diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go index 3e562182792..7bd161e48ad 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/rpc/error_details.proto package errdetails diff --git a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go index 6ad1b1c1df0..a6b5081888b 100644 --- a/upstream/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go +++ b/upstream/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v4.24.4 +// protoc v3.21.9 // source: google/rpc/status.proto package status diff --git a/upstream/vendor/google.golang.org/grpc/CONTRIBUTING.md b/upstream/vendor/google.golang.org/grpc/CONTRIBUTING.md index 0854d298e41..608aa6e1ac5 100644 --- a/upstream/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/upstream/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -66,7 +66,7 @@ How to get your contributions merged smoothly and quickly. - **All tests need to be passing** before your change can be merged. We recommend you **run tests locally** before creating your PR to catch breakages early on. - - `./scripts/vet.sh` to catch vet errors + - `VET_SKIP_PROTO=1 ./vet.sh` to catch vet errors - `go test -cpu 1,4 -timeout 7m ./...` to run the tests - `go test -race -cpu 1,4 -timeout 7m ./...` to run tests in race mode diff --git a/upstream/vendor/google.golang.org/grpc/MAINTAINERS.md b/upstream/vendor/google.golang.org/grpc/MAINTAINERS.md index 5d4096d46a0..c6672c0a3ef 100644 --- a/upstream/vendor/google.golang.org/grpc/MAINTAINERS.md +++ b/upstream/vendor/google.golang.org/grpc/MAINTAINERS.md @@ -9,28 +9,20 @@ for general contribution guidelines. ## Maintainers (in alphabetical order) -- [aranjans](https://github.com/aranjans), Google LLC -- [arjan-bal](https://github.com/arjan-bal), Google LLC -- [arvindbr8](https://github.com/arvindbr8), Google LLC -- [atollena](https://github.com/atollena), Datadog, Inc. +- [cesarghali](https://github.com/cesarghali), Google LLC - [dfawley](https://github.com/dfawley), Google LLC - [easwars](https://github.com/easwars), Google LLC -- [erm-g](https://github.com/erm-g), Google LLC -- [gtcooke94](https://github.com/gtcooke94), Google LLC -- [purnesh42h](https://github.com/purnesh42h), Google LLC -- [zasweq](https://github.com/zasweq), Google LLC +- [menghanl](https://github.com/menghanl), Google LLC +- [srini100](https://github.com/srini100), Google LLC ## Emeritus Maintainers (in alphabetical order) -- [adelez](https://github.com/adelez) -- [canguler](https://github.com/canguler) -- [cesarghali](https://github.com/cesarghali) -- [iamqizhao](https://github.com/iamqizhao) -- [jeanbza](https://github.com/jeanbza) -- [jtattermusch](https://github.com/jtattermusch) -- [lyuxuan](https://github.com/lyuxuan) -- [makmukhi](https://github.com/makmukhi) -- [matt-kwong](https://github.com/matt-kwong) -- [menghanl](https://github.com/menghanl) -- [nicolasnoble](https://github.com/nicolasnoble) -- [srini100](https://github.com/srini100) -- [yongni](https://github.com/yongni) +- [adelez](https://github.com/adelez), Google LLC +- [canguler](https://github.com/canguler), Google LLC +- [iamqizhao](https://github.com/iamqizhao), Google LLC +- [jadekler](https://github.com/jadekler), Google LLC +- [jtattermusch](https://github.com/jtattermusch), Google LLC +- [lyuxuan](https://github.com/lyuxuan), Google LLC +- [makmukhi](https://github.com/makmukhi), Google LLC +- [matt-kwong](https://github.com/matt-kwong), Google LLC +- [nicolasnoble](https://github.com/nicolasnoble), Google LLC +- [yongni](https://github.com/yongni), Google LLC diff --git a/upstream/vendor/google.golang.org/grpc/Makefile b/upstream/vendor/google.golang.org/grpc/Makefile index be38384ff6f..1f8960922b3 100644 --- a/upstream/vendor/google.golang.org/grpc/Makefile +++ b/upstream/vendor/google.golang.org/grpc/Makefile @@ -30,20 +30,17 @@ testdeps: GO111MODULE=on go get -d -v -t google.golang.org/grpc/... vet: vetdeps - ./scripts/vet.sh + ./vet.sh vetdeps: - ./scripts/vet.sh -install + ./vet.sh -install .PHONY: \ all \ build \ clean \ - deps \ proto \ test \ - testsubmodule \ testrace \ - testdeps \ vet \ vetdeps diff --git a/upstream/vendor/google.golang.org/grpc/README.md b/upstream/vendor/google.golang.org/grpc/README.md index b572707c623..ab0fbb79b86 100644 --- a/upstream/vendor/google.golang.org/grpc/README.md +++ b/upstream/vendor/google.golang.org/grpc/README.md @@ -10,7 +10,7 @@ RPC framework that puts mobile and HTTP/2 first. For more information see the ## Prerequisites -- **[Go][]**: any one of the **two latest major** [releases][go-releases]. +- **[Go][]**: any one of the **three latest major** [releases][go-releases]. ## Installation diff --git a/upstream/vendor/google.golang.org/grpc/SECURITY.md b/upstream/vendor/google.golang.org/grpc/SECURITY.md index abab279379b..be6e108705c 100644 --- a/upstream/vendor/google.golang.org/grpc/SECURITY.md +++ b/upstream/vendor/google.golang.org/grpc/SECURITY.md @@ -1,3 +1,3 @@ # Security Policy -For information on gRPC Security Policy and reporting potential security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md). +For information on gRPC Security Policy and reporting potentional security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md). diff --git a/upstream/vendor/google.golang.org/grpc/backoff/backoff.go b/upstream/vendor/google.golang.org/grpc/backoff/backoff.go index d7b40b7cb66..0787d0b50ce 100644 --- a/upstream/vendor/google.golang.org/grpc/backoff/backoff.go +++ b/upstream/vendor/google.golang.org/grpc/backoff/backoff.go @@ -39,7 +39,7 @@ type Config struct { MaxDelay time.Duration } -// DefaultConfig is a backoff configuration with the default values specified +// DefaultConfig is a backoff configuration with the default values specfied // at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // This should be useful for callers who want to configure backoff with diff --git a/upstream/vendor/google.golang.org/grpc/balancer/balancer.go b/upstream/vendor/google.golang.org/grpc/balancer/balancer.go index b181f386a1b..f391744f729 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/balancer.go @@ -30,7 +30,6 @@ import ( "google.golang.org/grpc/channelz" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" - estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/metadata" @@ -73,21 +72,8 @@ func unregisterForTesting(name string) { delete(m, name) } -// connectedAddress returns the connected address for a SubConnState. The -// address is only valid if the state is READY. -func connectedAddress(scs SubConnState) resolver.Address { - return scs.connectedAddress -} - -// setConnectedAddress sets the connected address for a SubConnState. -func setConnectedAddress(scs *SubConnState, addr resolver.Address) { - scs.connectedAddress = addr -} - func init() { internal.BalancerUnregister = unregisterForTesting - internal.ConnectedAddress = connectedAddress - internal.SetConnectedAddress = setConnectedAddress } // Get returns the resolver builder registered with the given name. @@ -257,10 +243,6 @@ type BuildOptions struct { // same resolver.Target as passed to the resolver. See the documentation for // the resolver.Target type for details about what it contains. Target resolver.Target - // MetricsRecorder is the metrics recorder that balancers can use to record - // metrics. Balancer implementations which do not register metrics on - // metrics registry and record on them can ignore this field. - MetricsRecorder estats.MetricsRecorder } // Builder creates a balancer. @@ -428,9 +410,6 @@ type SubConnState struct { // ConnectionError is set if the ConnectivityState is TransientFailure, // describing the reason the SubConn failed. Otherwise, it is nil. ConnectionError error - // connectedAddr contains the connected address when ConnectivityState is - // Ready. Otherwise, it is indeterminate. - connectedAddress resolver.Address } // ClientConnState describes the state of a ClientConn relevant to the diff --git a/upstream/vendor/google.golang.org/grpc/balancer/base/balancer.go b/upstream/vendor/google.golang.org/grpc/balancer/base/balancer.go index 2b87bd79c75..a7f1eeec8e6 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/base/balancer.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/base/balancer.go @@ -36,7 +36,7 @@ type baseBuilder struct { config Config } -func (bb *baseBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { bal := &baseBalancer{ cc: cc, pickerBuilder: bb.pickerBuilder, @@ -259,6 +259,6 @@ type errPicker struct { err error // Pick() always returns this err. } -func (p *errPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { +func (p *errPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { return balancer.PickResult{}, p.err } diff --git a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go index 52f54e6a016..32989b3abb2 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go @@ -19,8 +19,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/lb/v1/load_balancer.proto package grpc_lb_v1 @@ -780,7 +780,7 @@ func file_grpc_lb_v1_load_balancer_proto_rawDescGZIP() []byte { } var file_grpc_lb_v1_load_balancer_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_grpc_lb_v1_load_balancer_proto_goTypes = []any{ +var file_grpc_lb_v1_load_balancer_proto_goTypes = []interface{}{ (*LoadBalanceRequest)(nil), // 0: grpc.lb.v1.LoadBalanceRequest (*InitialLoadBalanceRequest)(nil), // 1: grpc.lb.v1.InitialLoadBalanceRequest (*ClientStatsPerToken)(nil), // 2: grpc.lb.v1.ClientStatsPerToken @@ -818,7 +818,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_lb_v1_load_balancer_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoadBalanceRequest); i { case 0: return &v.state @@ -830,7 +830,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitialLoadBalanceRequest); i { case 0: return &v.state @@ -842,7 +842,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientStatsPerToken); i { case 0: return &v.state @@ -854,7 +854,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientStats); i { case 0: return &v.state @@ -866,7 +866,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoadBalanceResponse); i { case 0: return &v.state @@ -878,7 +878,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FallbackResponse); i { case 0: return &v.state @@ -890,7 +890,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitialLoadBalanceResponse); i { case 0: return &v.state @@ -902,7 +902,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerList); i { case 0: return &v.state @@ -914,7 +914,7 @@ func file_grpc_lb_v1_load_balancer_proto_init() { return nil } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_grpc_lb_v1_load_balancer_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Server); i { case 0: return &v.state @@ -927,11 +927,11 @@ func file_grpc_lb_v1_load_balancer_proto_init() { } } } - file_grpc_lb_v1_load_balancer_proto_msgTypes[0].OneofWrappers = []any{ + file_grpc_lb_v1_load_balancer_proto_msgTypes[0].OneofWrappers = []interface{}{ (*LoadBalanceRequest_InitialRequest)(nil), (*LoadBalanceRequest_ClientStats)(nil), } - file_grpc_lb_v1_load_balancer_proto_msgTypes[4].OneofWrappers = []any{ + file_grpc_lb_v1_load_balancer_proto_msgTypes[4].OneofWrappers = []interface{}{ (*LoadBalanceResponse_InitialResponse)(nil), (*LoadBalanceResponse_ServerList)(nil), (*LoadBalanceResponse_FallbackResponse)(nil), diff --git a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go index 84e6a25056b..d8ec6539d2a 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go @@ -19,8 +19,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.1 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 // source: grpc/lb/v1/load_balancer.proto package grpc_lb_v1 @@ -34,8 +34,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 const ( LoadBalancer_BalanceLoad_FullMethodName = "/grpc.lb.v1.LoadBalancer/BalanceLoad" @@ -46,7 +46,7 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type LoadBalancerClient interface { // Bidirectional rpc to get a list of servers. - BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[LoadBalanceRequest, LoadBalanceResponse], error) + BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) } type loadBalancerClient struct { @@ -57,38 +57,52 @@ func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient { return &loadBalancerClient{cc} } -func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[LoadBalanceRequest, LoadBalanceResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &LoadBalancer_ServiceDesc.Streams[0], LoadBalancer_BalanceLoad_FullMethodName, cOpts...) +func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) { + stream, err := c.cc.NewStream(ctx, &LoadBalancer_ServiceDesc.Streams[0], LoadBalancer_BalanceLoad_FullMethodName, opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[LoadBalanceRequest, LoadBalanceResponse]{ClientStream: stream} + x := &loadBalancerBalanceLoadClient{stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type LoadBalancer_BalanceLoadClient = grpc.BidiStreamingClient[LoadBalanceRequest, LoadBalanceResponse] +type LoadBalancer_BalanceLoadClient interface { + Send(*LoadBalanceRequest) error + Recv() (*LoadBalanceResponse, error) + grpc.ClientStream +} + +type loadBalancerBalanceLoadClient struct { + grpc.ClientStream +} + +func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) { + m := new(LoadBalanceResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // LoadBalancerServer is the server API for LoadBalancer service. // All implementations should embed UnimplementedLoadBalancerServer -// for forward compatibility. +// for forward compatibility type LoadBalancerServer interface { // Bidirectional rpc to get a list of servers. - BalanceLoad(grpc.BidiStreamingServer[LoadBalanceRequest, LoadBalanceResponse]) error + BalanceLoad(LoadBalancer_BalanceLoadServer) error } -// UnimplementedLoadBalancerServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedLoadBalancerServer struct{} +// UnimplementedLoadBalancerServer should be embedded to have forward compatible implementations. +type UnimplementedLoadBalancerServer struct { +} -func (UnimplementedLoadBalancerServer) BalanceLoad(grpc.BidiStreamingServer[LoadBalanceRequest, LoadBalanceResponse]) error { +func (UnimplementedLoadBalancerServer) BalanceLoad(LoadBalancer_BalanceLoadServer) error { return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented") } -func (UnimplementedLoadBalancerServer) testEmbeddedByValue() {} // UnsafeLoadBalancerServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to LoadBalancerServer will @@ -98,22 +112,34 @@ type UnsafeLoadBalancerServer interface { } func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer) { - // If the following call panics, it indicates UnimplementedLoadBalancerServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&LoadBalancer_ServiceDesc, srv) } func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LoadBalancerServer).BalanceLoad(&grpc.GenericServerStream[LoadBalanceRequest, LoadBalanceResponse]{ServerStream: stream}) + return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream}) +} + +type LoadBalancer_BalanceLoadServer interface { + Send(*LoadBalanceResponse) error + Recv() (*LoadBalanceRequest, error) + grpc.ServerStream +} + +type loadBalancerBalanceLoadServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type LoadBalancer_BalanceLoadServer = grpc.BidiStreamingServer[LoadBalanceRequest, LoadBalanceResponse] +func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) { + m := new(LoadBalanceRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // LoadBalancer_ServiceDesc is the grpc.ServiceDesc for LoadBalancer service. // It's only intended for direct use with grpc.RegisterService, diff --git a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go index c0987627413..47a3e938dcf 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go @@ -219,7 +219,7 @@ type lbBalancer struct { // All backends addresses, with metadata set to nil. This list contains all // backend addresses in the same order and with the same duplicates as in // serverlist. When generating picker, a SubConn slice with the same order - // but with only READY SCs will be generated. + // but with only READY SCs will be gerenated. backendAddrsWithoutMetadata []resolver.Address // Roundrobin functionalities. state connectivity.State diff --git a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_config.go b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_config.go index 96a57c8c70c..8942c31310a 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_config.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_config.go @@ -21,14 +21,14 @@ package grpclb import ( "encoding/json" - "google.golang.org/grpc/balancer/pickfirst" + "google.golang.org/grpc" "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/serviceconfig" ) const ( roundRobinName = roundrobin.Name - pickFirstName = pickfirst.Name + pickFirstName = grpc.PickFirstBalancerName ) type grpclbServiceConfig struct { diff --git a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_picker.go b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_picker.go index 671bc663fcb..20c5f2ec396 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_picker.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/grpclb/grpclb_picker.go @@ -19,13 +19,13 @@ package grpclb import ( - "math/rand" "sync" "sync/atomic" "google.golang.org/grpc/balancer" lbpb "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1" "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/status" ) @@ -112,7 +112,7 @@ type rrPicker struct { func newRRPicker(readySCs []balancer.SubConn) *rrPicker { return &rrPicker{ subConns: readySCs, - subConnsNext: rand.Intn(len(readySCs)), + subConnsNext: grpcrand.Intn(len(readySCs)), } } @@ -147,7 +147,7 @@ func newLBPicker(serverList []*lbpb.Server, readySCs []balancer.SubConn, stats * return &lbPicker{ serverList: serverList, subConns: readySCs, - subConnsNext: rand.Intn(len(readySCs)), + subConnsNext: grpcrand.Intn(len(readySCs)), stats: stats, } } diff --git a/upstream/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/upstream/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go index 260255d31b6..f7031ad2251 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go +++ b/upstream/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go @@ -22,12 +22,12 @@ package roundrobin import ( - "math/rand" "sync/atomic" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/grpcrand" ) // Name is the name of round_robin balancer. @@ -60,7 +60,7 @@ func (*rrPickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker { // Start at a random index, as the same RR balancer rebuilds a new // picker when SubConn states change, and we don't want to apply excess // load to the first server in the list. - next: uint32(rand.Intn(len(scs))), + next: uint32(grpcrand.Intn(len(scs))), } } diff --git a/upstream/vendor/google.golang.org/grpc/balancer_wrapper.go b/upstream/vendor/google.golang.org/grpc/balancer_wrapper.go index 8ad6ce2f095..af39b8a4c73 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer_wrapper.go +++ b/upstream/vendor/google.golang.org/grpc/balancer_wrapper.go @@ -25,15 +25,12 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" ) -var setConnectedAddress = internal.SetConnectedAddress.(func(*balancer.SubConnState, resolver.Address)) - // ccBalancerWrapper sits between the ClientConn and the Balancer. // // ccBalancerWrapper implements methods corresponding to the ones on the @@ -82,7 +79,6 @@ func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { CustomUserAgent: cc.dopts.copts.UserAgent, ChannelzParent: cc.channelz, Target: cc.parsedTarget, - MetricsRecorder: cc.metricsRecorderList, }, serializer: grpcsync.NewCallbackSerializer(ctx), serializerCancel: cancel, @@ -96,7 +92,7 @@ func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { // it is safe to call into the balancer here. func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { errCh := make(chan error) - uccs := func(ctx context.Context) { + ok := ccb.serializer.Schedule(func(ctx context.Context) { defer close(errCh) if ctx.Err() != nil || ccb.balancer == nil { return @@ -111,23 +107,17 @@ func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnStat logger.Infof("error from balancer.UpdateClientConnState: %v", err) } errCh <- err + }) + if !ok { + return nil } - onFailure := func() { close(errCh) } - - // UpdateClientConnState can race with Close, and when the latter wins, the - // serializer is closed, and the attempt to schedule the callback will fail. - // It is acceptable to ignore this failure. But since we want to handle the - // state update in a blocking fashion (when we successfully schedule the - // callback), we have to use the ScheduleOr method and not the MaybeSchedule - // method on the serializer. - ccb.serializer.ScheduleOr(uccs, onFailure) return <-errCh } // resolverError is invoked by grpc to push a resolver error to the underlying // balancer. The call to the balancer is executed from the serializer. func (ccb *ccBalancerWrapper) resolverError(err error) { - ccb.serializer.TrySchedule(func(ctx context.Context) { + ccb.serializer.Schedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } @@ -143,7 +133,7 @@ func (ccb *ccBalancerWrapper) close() { ccb.closed = true ccb.mu.Unlock() channelz.Info(logger, ccb.cc.channelz, "ccBalancerWrapper: closing") - ccb.serializer.TrySchedule(func(context.Context) { + ccb.serializer.Schedule(func(context.Context) { if ccb.balancer == nil { return } @@ -155,7 +145,7 @@ func (ccb *ccBalancerWrapper) close() { // exitIdle invokes the balancer's exitIdle method in the serializer. func (ccb *ccBalancerWrapper) exitIdle() { - ccb.serializer.TrySchedule(func(ctx context.Context) { + ccb.serializer.Schedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } @@ -192,7 +182,7 @@ func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer return acbw, nil } -func (ccb *ccBalancerWrapper) RemoveSubConn(balancer.SubConn) { +func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { // The graceful switch balancer will never call this. logger.Errorf("ccb RemoveSubConn(%v) called unexpectedly, sc") } @@ -208,10 +198,6 @@ func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resol func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { ccb.cc.mu.Lock() defer ccb.cc.mu.Unlock() - if ccb.cc.conns == nil { - // The CC has been closed; ignore this update. - return - } ccb.mu.Lock() if ccb.closed { @@ -262,29 +248,15 @@ type acBalancerWrapper struct { // updateState is invoked by grpc to push a subConn state update to the // underlying balancer. -func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolver.Address, err error) { - acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { +func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { + acbw.ccb.serializer.Schedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return } // Even though it is optional for balancers, gracefulswitch ensures // opts.StateListener is set, so this cannot ever be nil. // TODO: delete this comment when UpdateSubConnState is removed. - scs := balancer.SubConnState{ConnectivityState: s, ConnectionError: err} - if s == connectivity.Ready { - setConnectedAddress(&scs, curAddr) - } - acbw.stateListener(scs) - acbw.ac.mu.Lock() - defer acbw.ac.mu.Unlock() - if s == connectivity.Ready { - // When changing states to READY, reset stateReadyChan. Wait until - // after we notify the LB policy's listener(s) in order to prevent - // ac.getTransport() from unblocking before the LB policy starts - // tracking the subchannel as READY. - close(acbw.ac.stateReadyChan) - acbw.ac.stateReadyChan = make(chan struct{}) - } + acbw.stateListener(balancer.SubConnState{ConnectivityState: s, ConnectionError: err}) }) } @@ -342,8 +314,8 @@ func (acbw *acBalancerWrapper) GetOrBuildProducer(pb balancer.ProducerBuilder) ( pData := acbw.producers[pb] if pData == nil { // Not found; create a new one and add it to the producers map. - p, closeFn := pb.Build(acbw) - pData = &refCountedProducer{producer: p, close: closeFn} + p, close := pb.Build(acbw) + pData = &refCountedProducer{producer: p, close: close} acbw.producers[pb] = pData } // Account for this new reference. diff --git a/upstream/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/upstream/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 55bffaa77ef..856c75dd4e2 100644 --- a/upstream/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/upstream/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -18,8 +18,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/binlog/v1/binarylog.proto package grpc_binarylog_v1 @@ -1015,7 +1015,7 @@ func file_grpc_binlog_v1_binarylog_proto_rawDescGZIP() []byte { var file_grpc_binlog_v1_binarylog_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_grpc_binlog_v1_binarylog_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_grpc_binlog_v1_binarylog_proto_goTypes = []any{ +var file_grpc_binlog_v1_binarylog_proto_goTypes = []interface{}{ (GrpcLogEntry_EventType)(0), // 0: grpc.binarylog.v1.GrpcLogEntry.EventType (GrpcLogEntry_Logger)(0), // 1: grpc.binarylog.v1.GrpcLogEntry.Logger (Address_Type)(0), // 2: grpc.binarylog.v1.Address.Type @@ -1058,7 +1058,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_binlog_v1_binarylog_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GrpcLogEntry); i { case 0: return &v.state @@ -1070,7 +1070,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientHeader); i { case 0: return &v.state @@ -1082,7 +1082,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerHeader); i { case 0: return &v.state @@ -1094,7 +1094,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trailer); i { case 0: return &v.state @@ -1106,7 +1106,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Message); i { case 0: return &v.state @@ -1118,7 +1118,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Metadata); i { case 0: return &v.state @@ -1130,7 +1130,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MetadataEntry); i { case 0: return &v.state @@ -1142,7 +1142,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { return nil } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_grpc_binlog_v1_binarylog_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Address); i { case 0: return &v.state @@ -1155,7 +1155,7 @@ func file_grpc_binlog_v1_binarylog_proto_init() { } } } - file_grpc_binlog_v1_binarylog_proto_msgTypes[0].OneofWrappers = []any{ + file_grpc_binlog_v1_binarylog_proto_msgTypes[0].OneofWrappers = []interface{}{ (*GrpcLogEntry_ClientHeader)(nil), (*GrpcLogEntry_ServerHeader)(nil), (*GrpcLogEntry_Message)(nil), diff --git a/upstream/vendor/google.golang.org/grpc/clientconn.go b/upstream/vendor/google.golang.org/grpc/clientconn.go index 9c8850e3fdd..c7f2607114a 100644 --- a/upstream/vendor/google.golang.org/grpc/clientconn.go +++ b/upstream/vendor/google.golang.org/grpc/clientconn.go @@ -24,7 +24,6 @@ import ( "fmt" "math" "net/url" - "slices" "strings" "sync" "sync/atomic" @@ -32,15 +31,14 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" - "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/idle" + "google.golang.org/grpc/internal/pretty" iresolver "google.golang.org/grpc/internal/resolver" - "google.golang.org/grpc/internal/stats" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" @@ -75,8 +73,6 @@ var ( // invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default // service config. invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid" - // PickFirstBalancerName is the name of the pick_first balancer. - PickFirstBalancerName = pickfirst.Name ) // The following errors are returned from Dial and DialContext @@ -125,9 +121,8 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires // https://github.com/grpc/grpc/blob/master/doc/naming.md. e.g. to use dns // resolver, a "dns:///" prefix should be applied to the target. // -// The DialOptions returned by WithBlock, WithTimeout, -// WithReturnConnectionError, and FailOnNonTempDialError are ignored by this -// function. +// The DialOptions returned by WithBlock, WithTimeout, and +// WithReturnConnectionError are ignored by this function. func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ target: target, @@ -157,16 +152,6 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) for _, opt := range opts { opt.apply(&cc.dopts) } - - // Determine the resolver to use. - if err := cc.initParsedTargetAndResolverBuilder(); err != nil { - return nil, err - } - - for _, opt := range globalPerTargetDialOptions { - opt.DialOptionForTarget(cc.parsedTarget.URL).apply(&cc.dopts) - } - chainUnaryClientInterceptors(cc) chainStreamClientInterceptors(cc) @@ -175,7 +160,7 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) } if cc.dopts.defaultServiceConfigRawJSON != nil { - scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON, cc.dopts.maxCallAttempts) + scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON) if scpr.Err != nil { return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err) } @@ -183,30 +168,34 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) } cc.mkp = cc.dopts.copts.KeepaliveParams - if err = cc.initAuthority(); err != nil { + // Register ClientConn with channelz. + cc.channelzRegistration(target) + + // TODO: Ideally it should be impossible to error from this function after + // channelz registration. This will require removing some channelz logs + // from the following functions that can error. Errors can be returned to + // the user, and successful logs can be emitted here, after the checks have + // passed and channelz is subsequently registered. + + // Determine the resolver to use. + if err := cc.parseTargetAndFindResolver(); err != nil { + channelz.RemoveEntry(cc.channelz.ID) + return nil, err + } + if err = cc.determineAuthority(); err != nil { + channelz.RemoveEntry(cc.channelz.ID) return nil, err } - - // Register ClientConn with channelz. Note that this is only done after - // channel creation cannot fail. - cc.channelzRegistration(target) - channelz.Infof(logger, cc.channelz, "parsed dial target is: %#v", cc.parsedTarget) - channelz.Infof(logger, cc.channelz, "Channel authority set to %q", cc.authority) cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelz) cc.pickerWrapper = newPickerWrapper(cc.dopts.copts.StatsHandlers) - cc.metricsRecorderList = stats.NewMetricsRecorderList(cc.dopts.copts.StatsHandlers) - cc.initIdleStateLocked() // Safe to call without the lock, since nothing else has a reference to cc. cc.idlenessMgr = idle.NewManager((*idler)(cc), cc.dopts.idleTimeout) - return cc, nil } // Dial calls DialContext(context.Background(), target, opts...). -// -// Deprecated: use NewClient instead. Will be supported throughout 1.x. func Dial(target string, opts ...DialOption) (*ClientConn, error) { return DialContext(context.Background(), target, opts...) } @@ -220,8 +209,6 @@ func Dial(target string, opts ...DialOption) (*ClientConn, error) { // "passthrough" for backward compatibility. This distinction should not matter // to most users, but could matter to legacy users that specify a custom dialer // and expect it to receive the target string directly. -// -// Deprecated: use NewClient instead. Will be supported throughout 1.x. func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { // At the end of this method, we kick the channel out of idle, rather than // waiting for the first rpc. @@ -595,14 +582,13 @@ type ClientConn struct { cancel context.CancelFunc // Cancelled on close. // The following are initialized at dial time, and are read-only after that. - target string // User's dial target. - parsedTarget resolver.Target // See initParsedTargetAndResolverBuilder(). - authority string // See initAuthority(). - dopts dialOptions // Default and user specified dial options. - channelz *channelz.Channel // Channelz object. - resolverBuilder resolver.Builder // See initParsedTargetAndResolverBuilder(). - idlenessMgr *idle.Manager - metricsRecorderList *stats.MetricsRecorderList + target string // User's dial target. + parsedTarget resolver.Target // See parseTargetAndFindResolver(). + authority string // See determineAuthority(). + dopts dialOptions // Default and user specified dial options. + channelz *channelz.Channel // Channelz object. + resolverBuilder resolver.Builder // See parseTargetAndFindResolver(). + idlenessMgr *idle.Manager // The following provide their own synchronization, and therefore don't // require cc.mu to be held to access them. @@ -632,6 +618,11 @@ type ClientConn struct { // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool { ch := cc.csMgr.getNotifyChan() if cc.csMgr.getState() != sourceState { @@ -646,6 +637,11 @@ func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connec } // GetState returns the connectivity.State of ClientConn. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a later +// release. func (cc *ClientConn) GetState() connectivity.State { return cc.csMgr.getState() } @@ -692,7 +688,8 @@ func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error { var emptyServiceConfig *ServiceConfig func init() { - cfg := parseServiceConfig("{}", defaultMaxCallAttempts) + balancer.Register(pickfirstBuilder{}) + cfg := parseServiceConfig("{}") if cfg.Err != nil { panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err)) } @@ -808,11 +805,17 @@ func (cc *ClientConn) applyFailingLBLocked(sc *serviceconfig.ParseResult) { cc.csMgr.updateState(connectivity.TransientFailure) } -// Makes a copy of the input addresses slice. Addresses are passed during -// subconn creation and address update operations. -func copyAddresses(in []resolver.Address) []resolver.Address { +// Makes a copy of the input addresses slice and clears out the balancer +// attributes field. Addresses are passed during subconn creation and address +// update operations. In both cases, we will clear the balancer attributes by +// calling this function, and therefore we will be able to use the Equal method +// provided by the resolver.Address type for comparison. +func copyAddressesWithoutBalancerAttributes(in []resolver.Address) []resolver.Address { out := make([]resolver.Address, len(in)) - copy(out, in) + for i := range in { + out[i] = in[i] + out[i].BalancerAttributes = nil + } return out } @@ -825,19 +828,16 @@ func (cc *ClientConn) newAddrConnLocked(addrs []resolver.Address, opts balancer. } ac := &addrConn{ - state: connectivity.Idle, - cc: cc, - addrs: copyAddresses(addrs), - scopts: opts, - dopts: cc.dopts, - channelz: channelz.RegisterSubChannel(cc.channelz, ""), - resetBackoff: make(chan struct{}), - stateReadyChan: make(chan struct{}), + state: connectivity.Idle, + cc: cc, + addrs: copyAddressesWithoutBalancerAttributes(addrs), + scopts: opts, + dopts: cc.dopts, + channelz: channelz.RegisterSubChannel(cc.channelz, ""), + resetBackoff: make(chan struct{}), + stateChan: make(chan struct{}), } ac.ctx, ac.cancel = context.WithCancel(cc.ctx) - // Start with our address set to the first address; this may be updated if - // we connect to different addresses. - ac.channelz.ChannelMetrics.Target.Store(&addrs[0].Addr) channelz.AddTraceEvent(logger, ac.channelz, 0, &channelz.TraceEvent{ Desc: "Subchannel created", @@ -908,37 +908,32 @@ func (ac *addrConn) connect() error { ac.mu.Unlock() return nil } + ac.mu.Unlock() - ac.resetTransportAndUnlock() + ac.resetTransport() return nil } -// equalAddressIgnoringBalAttributes returns true is a and b are considered equal. -// This is different from the Equal method on the resolver.Address type which -// considers all fields to determine equality. Here, we only consider fields -// that are meaningful to the subConn. -func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { - return a.Addr == b.Addr && a.ServerName == b.ServerName && - a.Attributes.Equal(b.Attributes) && - a.Metadata == b.Metadata -} - -func equalAddressesIgnoringBalAttributes(a, b []resolver.Address) bool { - return slices.EqualFunc(a, b, func(a, b resolver.Address) bool { return equalAddressIgnoringBalAttributes(&a, &b) }) +func equalAddresses(a, b []resolver.Address) bool { + if len(a) != len(b) { + return false + } + for i, v := range a { + if !v.Equal(b[i]) { + return false + } + } + return true } // updateAddrs updates ac.addrs with the new addresses list and handles active // connections or connection attempts. func (ac *addrConn) updateAddrs(addrs []resolver.Address) { - addrs = copyAddresses(addrs) - limit := len(addrs) - if limit > 5 { - limit = 5 - } - channelz.Infof(logger, ac.channelz, "addrConn: updateAddrs addrs (%d of %d): %v", limit, len(addrs), addrs[:limit]) - ac.mu.Lock() - if equalAddressesIgnoringBalAttributes(ac.addrs, addrs) { + channelz.Infof(logger, ac.channelz, "addrConn: updateAddrs curAddr: %v, addrs: %v", pretty.ToJSON(ac.curAddr), pretty.ToJSON(addrs)) + + addrs = copyAddressesWithoutBalancerAttributes(addrs) + if equalAddresses(ac.addrs, addrs) { ac.mu.Unlock() return } @@ -957,7 +952,7 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { // Try to find the connected address. for _, a := range addrs { a.ServerName = ac.cc.getServerName(a) - if equalAddressIgnoringBalAttributes(&a, &ac.curAddr) { + if a.Equal(ac.curAddr) { // We are connected to a valid address, so do nothing but // update the addresses. ac.mu.Unlock() @@ -983,9 +978,11 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { ac.updateConnectivityState(connectivity.Idle, nil) } + ac.mu.Unlock() + // Since we were connecting/connected, we should start a new connection // attempt. - go ac.resetTransportAndUnlock() + go ac.resetTransport() } // getServerName determines the serverName to be used in the connection @@ -1170,17 +1167,13 @@ type addrConn struct { // is received, transport is closed, ac has been torn down). transport transport.ClientTransport // The current transport. - // This mutex is used on the RPC path, so its usage should be minimized as - // much as possible. - // TODO: Find a lock-free way to retrieve the transport and state from the - // addrConn. mu sync.Mutex curAddr resolver.Address // The current address. addrs []resolver.Address // All addresses that the resolver resolved to. // Use updateConnectivityState for updating addrConn's connectivity state. - state connectivity.State - stateReadyChan chan struct{} // closed and recreated on every READY state change. + state connectivity.State + stateChan chan struct{} // closed and recreated on every state change. backoffIdx int // Needs to be stateful for resetConnectBackoff. resetBackoff chan struct{} @@ -1193,6 +1186,9 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) if ac.state == s { return } + // When changing states, reset the state change channel. + close(ac.stateChan) + ac.stateChan = make(chan struct{}) ac.state = s ac.channelz.ChannelMetrics.State.Store(&s) if lastErr == nil { @@ -1200,7 +1196,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) } else { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } - ac.acbw.updateState(s, ac.curAddr, lastErr) + ac.acbw.updateState(s, lastErr) } // adjustParams updates parameters used to create transports upon @@ -1217,10 +1213,8 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) { } } -// resetTransportAndUnlock unconditionally connects the addrConn. -// -// ac.mu must be held by the caller, and this function will guarantee it is released. -func (ac *addrConn) resetTransportAndUnlock() { +func (ac *addrConn) resetTransport() { + ac.mu.Lock() acCtx := ac.ctx if acCtx.Err() != nil { ac.mu.Unlock() @@ -1298,7 +1292,6 @@ func (ac *addrConn) resetTransportAndUnlock() { func (ac *addrConn) tryAllAddrs(ctx context.Context, addrs []resolver.Address, connectDeadline time.Time) error { var firstConnErr error for _, addr := range addrs { - ac.channelz.ChannelMetrics.Target.Store(&addr.Addr) if ctx.Err() != nil { return errConnClosing } @@ -1510,7 +1503,7 @@ func (ac *addrConn) getReadyTransport() transport.ClientTransport { func (ac *addrConn) getTransport(ctx context.Context) (transport.ClientTransport, error) { for ctx.Err() == nil { ac.mu.Lock() - t, state, sc := ac.transport, ac.state, ac.stateReadyChan + t, state, sc := ac.transport, ac.state, ac.stateChan ac.mu.Unlock() if state == connectivity.Ready { return t, nil @@ -1573,7 +1566,7 @@ func (ac *addrConn) tearDown(err error) { } else { // Hard close the transport when the channel is entering idle or is // being shutdown. In the case where the channel is being shutdown, - // closing of transports is also taken care of by cancellation of cc.ctx. + // closing of transports is also taken care of by cancelation of cc.ctx. // But in the case where the channel is entering idle, we need to // explicitly close the transports here. Instead of distinguishing // between these two cases, it is simpler to close the transport @@ -1664,19 +1657,22 @@ func (cc *ClientConn) connectionError() error { return cc.lastConnectionError } -// initParsedTargetAndResolverBuilder parses the user's dial target and stores -// the parsed target in `cc.parsedTarget`. +// parseTargetAndFindResolver parses the user's dial target and stores the +// parsed target in `cc.parsedTarget`. // // The resolver to use is determined based on the scheme in the parsed target // and the same is stored in `cc.resolverBuilder`. // // Doesn't grab cc.mu as this method is expected to be called only at Dial time. -func (cc *ClientConn) initParsedTargetAndResolverBuilder() error { - logger.Infof("original dial target is: %q", cc.target) +func (cc *ClientConn) parseTargetAndFindResolver() error { + channelz.Infof(logger, cc.channelz, "original dial target is: %q", cc.target) var rb resolver.Builder parsedTarget, err := parseTarget(cc.target) - if err == nil { + if err != nil { + channelz.Infof(logger, cc.channelz, "dial target %q parse failed: %v", cc.target, err) + } else { + channelz.Infof(logger, cc.channelz, "parsed dial target is: %#v", parsedTarget) rb = cc.getResolver(parsedTarget.URL.Scheme) if rb != nil { cc.parsedTarget = parsedTarget @@ -1695,12 +1691,15 @@ func (cc *ClientConn) initParsedTargetAndResolverBuilder() error { defScheme = resolver.GetDefaultScheme() } + channelz.Infof(logger, cc.channelz, "fallback to scheme %q", defScheme) canonicalTarget := defScheme + ":///" + cc.target parsedTarget, err = parseTarget(canonicalTarget) if err != nil { + channelz.Infof(logger, cc.channelz, "dial target %q parse failed: %v", canonicalTarget, err) return err } + channelz.Infof(logger, cc.channelz, "parsed dial target is: %+v", parsedTarget) rb = cc.getResolver(parsedTarget.URL.Scheme) if rb == nil { return fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme) @@ -1740,7 +1739,7 @@ func encodeAuthority(authority string) string { return false case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // Subdelim characters return false - case ':', '[', ']', '@': // Authority related delimiters + case ':', '[', ']', '@': // Authority related delimeters return false } // Everything else must be escaped. @@ -1790,7 +1789,7 @@ func encodeAuthority(authority string) string { // credentials do not match the authority configured through the dial option. // // Doesn't grab cc.mu as this method is expected to be called only at Dial time. -func (cc *ClientConn) initAuthority() error { +func (cc *ClientConn) determineAuthority() error { dopts := cc.dopts // Historically, we had two options for users to specify the serverName or // authority for a channel. One was through the transport credentials @@ -1823,5 +1822,6 @@ func (cc *ClientConn) initAuthority() error { } else { cc.authority = encodeAuthority(endpoint) } + channelz.Infof(logger, cc.channelz, "Channel authority set to %q", cc.authority) return nil } diff --git a/upstream/vendor/google.golang.org/grpc/codec.go b/upstream/vendor/google.golang.org/grpc/codec.go index e840858b77b..411e3dfd47c 100644 --- a/upstream/vendor/google.golang.org/grpc/codec.go +++ b/upstream/vendor/google.golang.org/grpc/codec.go @@ -21,73 +21,18 @@ package grpc import ( "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/proto" // to register the Codec for "proto" - "google.golang.org/grpc/mem" ) -// baseCodec captures the new encoding.CodecV2 interface without the Name -// function, allowing it to be implemented by older Codec and encoding.Codec -// implementations. The omitted Name function is only needed for the register in -// the encoding package and is not part of the core functionality. +// baseCodec contains the functionality of both Codec and encoding.Codec, but +// omits the name/string, which vary between the two and are not needed for +// anything besides the registry in the encoding package. type baseCodec interface { - Marshal(v any) (mem.BufferSlice, error) - Unmarshal(data mem.BufferSlice, v any) error -} - -// getCodec returns an encoding.CodecV2 for the codec of the given name (if -// registered). Initially checks the V2 registry with encoding.GetCodecV2 and -// returns the V2 codec if it is registered. Otherwise, it checks the V1 registry -// with encoding.GetCodec and if it is registered wraps it with newCodecV1Bridge -// to turn it into an encoding.CodecV2. Returns nil otherwise. -func getCodec(name string) encoding.CodecV2 { - if codecV1 := encoding.GetCodec(name); codecV1 != nil { - return newCodecV1Bridge(codecV1) - } - - return encoding.GetCodecV2(name) -} - -func newCodecV0Bridge(c Codec) baseCodec { - return codecV0Bridge{codec: c} -} - -func newCodecV1Bridge(c encoding.Codec) encoding.CodecV2 { - return codecV1Bridge{ - codecV0Bridge: codecV0Bridge{codec: c}, - name: c.Name(), - } -} - -var _ baseCodec = codecV0Bridge{} - -type codecV0Bridge struct { - codec interface { - Marshal(v any) ([]byte, error) - Unmarshal(data []byte, v any) error - } -} - -func (c codecV0Bridge) Marshal(v any) (mem.BufferSlice, error) { - data, err := c.codec.Marshal(v) - if err != nil { - return nil, err - } - return mem.BufferSlice{mem.NewBuffer(&data, nil)}, nil -} - -func (c codecV0Bridge) Unmarshal(data mem.BufferSlice, v any) (err error) { - return c.codec.Unmarshal(data.Materialize(), v) -} - -var _ encoding.CodecV2 = codecV1Bridge{} - -type codecV1Bridge struct { - codecV0Bridge - name string + Marshal(v any) ([]byte, error) + Unmarshal(data []byte, v any) error } -func (c codecV1Bridge) Name() string { - return c.name -} +var _ baseCodec = Codec(nil) +var _ baseCodec = encoding.Codec(nil) // Codec defines the interface gRPC uses to encode and decode messages. // Note that implementations of this interface must be thread safe; diff --git a/upstream/vendor/google.golang.org/grpc/codegen.sh b/upstream/vendor/google.golang.org/grpc/codegen.sh new file mode 100644 index 00000000000..4cdc6ba7c09 --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/codegen.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This script serves as an example to demonstrate how to generate the gRPC-Go +# interface and the related messages from .proto file. +# +# It assumes the installation of i) Google proto buffer compiler at +# https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen +# plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have +# not, please install them first. +# +# We recommend running this script at $GOPATH/src. +# +# If this is not what you need, feel free to make your own scripts. Again, this +# script is for demonstration purpose. +# +proto=$1 +protoc --go_out=plugins=grpc:. $proto diff --git a/upstream/vendor/google.golang.org/grpc/codes/codes.go b/upstream/vendor/google.golang.org/grpc/codes/codes.go index 0b42c302b24..08476ad1fe1 100644 --- a/upstream/vendor/google.golang.org/grpc/codes/codes.go +++ b/upstream/vendor/google.golang.org/grpc/codes/codes.go @@ -235,7 +235,7 @@ func (c *Code) UnmarshalJSON(b []byte) error { if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { if ci >= _maxCode { - return fmt.Errorf("invalid code: %d", ci) + return fmt.Errorf("invalid code: %q", ci) } *c = Code(ci) diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aeadrekey.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aeadrekey.go index 7e4bfee8886..43726e877b8 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aeadrekey.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aeadrekey.go @@ -49,7 +49,7 @@ func (k KeySizeError) Error() string { // newRekeyAEAD creates a new instance of aes128gcm with rekeying. // The key argument should be 44 bytes, the first 32 bytes are used as a key -// for HKDF-expand and the remaining 12 bytes are used as a random mask for +// for HKDF-expand and the remainining 12 bytes are used as a random mask for // the counter. func newRekeyAEAD(key []byte) (*rekeyAEAD, error) { k := len(key) diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aes128gcmrekey.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aes128gcmrekey.go index b5bbb5497aa..6a9035ea254 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aes128gcmrekey.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/aes128gcmrekey.go @@ -51,7 +51,7 @@ type aes128gcmRekey struct { // NewAES128GCMRekey creates an instance that uses aes128gcm with rekeying // for ALTS record. The key argument should be 44 bytes, the first 32 bytes -// are used as a key for HKDF-expand and the remaining 12 bytes are used +// are used as a key for HKDF-expand and the remainining 12 bytes are used // as a random mask for the counter. func NewAES128GCMRekey(side core.Side, key []byte) (ALTSRecordCrypto, error) { inCounter := NewInCounter(side, overflowLenAES128GCMRekey) diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go index f1ea7bb2081..0d64fb37a12 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go @@ -266,3 +266,10 @@ func (p *conn) Write(b []byte) (n int, err error) { } return n, nil } + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go index 50721f690ac..6c867dd8501 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go @@ -128,7 +128,7 @@ type altsHandshaker struct { // NewClientHandshaker creates a core.Handshaker that performs a client-side // ALTS handshake by acting as a proxy between the peer and the ALTS handshaker // service in the metadata server. -func NewClientHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, opts *ClientHandshakerOptions) (core.Handshaker, error) { +func NewClientHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, opts *ClientHandshakerOptions) (core.Handshaker, error) { return &altsHandshaker{ stream: nil, conn: c, @@ -141,7 +141,7 @@ func NewClientHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, o // NewServerHandshaker creates a core.Handshaker that performs a server-side // ALTS handshake by acting as a proxy between the peer and the ALTS handshaker // service in the metadata server. -func NewServerHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, opts *ServerHandshakerOptions) (core.Handshaker, error) { +func NewServerHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, opts *ServerHandshakerOptions) (core.Handshaker, error) { return &altsHandshaker{ stream: nil, conn: c, diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/service/service.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/service/service.go index b3af0359072..e1cdafb980c 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/service/service.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/service/service.go @@ -34,6 +34,8 @@ var ( // to a corresponding connection to a hypervisor handshaker service // instance. hsConnMap = make(map[string]*grpc.ClientConn) + // hsDialer will be reassigned in tests. + hsDialer = grpc.Dial ) // Dial dials the handshake service in the hypervisor. If a connection has @@ -48,7 +50,7 @@ func Dial(hsAddress string) (*grpc.ClientConn, error) { // Create a new connection to the handshaker service. Note that // this connection stays open until the application is closed. var err error - hsConn, err = grpc.Dial(hsAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + hsConn, err = hsDialer(hsAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, err } diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/altscontext.pb.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/altscontext.pb.go index b7de8f05b76..ca4d0331543 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/altscontext.pb.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/altscontext.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/gcp/altscontext.proto package grpc_gcp @@ -201,7 +201,7 @@ func file_grpc_gcp_altscontext_proto_rawDescGZIP() []byte { } var file_grpc_gcp_altscontext_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_gcp_altscontext_proto_goTypes = []any{ +var file_grpc_gcp_altscontext_proto_goTypes = []interface{}{ (*AltsContext)(nil), // 0: grpc.gcp.AltsContext nil, // 1: grpc.gcp.AltsContext.PeerAttributesEntry (SecurityLevel)(0), // 2: grpc.gcp.SecurityLevel @@ -225,7 +225,7 @@ func file_grpc_gcp_altscontext_proto_init() { } file_grpc_gcp_transport_security_common_proto_init() if !protoimpl.UnsafeEnabled { - file_grpc_gcp_altscontext_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_gcp_altscontext_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AltsContext); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go index 79b5dad476c..93ceaeb2f9c 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/gcp/handshaker.proto package grpc_gcp @@ -458,11 +458,11 @@ type ServerHandshakeParameters struct { // (Optional) A list of local identities supported by the server, if // specified. Otherwise, the handshaker chooses a default local identity. LocalIdentities []*Identity `protobuf:"bytes,2,rep,name=local_identities,json=localIdentities,proto3" json:"local_identities,omitempty"` - // A token created by the caller only intended for use in - // ALTS connections. The token should be used to authenticate to - // the peer. The token MUST be strongly bound to the ALTS credentials + // (Optional) An access token created by the caller only intended for use in + // ALTS connections. The access token that should be used to authenticate to + // the peer. The access token MUST be strongly bound to the ALTS credentials // used to establish the connection that the token is sent over. - Token *string `protobuf:"bytes,3,opt,name=token,proto3,oneof" json:"token,omitempty"` + AccessToken *string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3,oneof" json:"access_token,omitempty"` } func (x *ServerHandshakeParameters) Reset() { @@ -511,9 +511,9 @@ func (x *ServerHandshakeParameters) GetLocalIdentities() []*Identity { return nil } -func (x *ServerHandshakeParameters) GetToken() string { - if x != nil && x.Token != nil { - return *x.Token +func (x *ServerHandshakeParameters) GetAccessToken() string { + if x != nil && x.AccessToken != nil { + return *x.AccessToken } return "" } @@ -533,7 +533,7 @@ type StartServerHandshakeReq struct { // to handshake_parameters is the integer value of HandshakeProtocol enum. HandshakeParameters map[int32]*ServerHandshakeParameters `protobuf:"bytes,2,rep,name=handshake_parameters,json=handshakeParameters,proto3" json:"handshake_parameters,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple HandshakeReq messages. + // that the peer's out_frames are split into multiple HandshakReq messages. InBytes []byte `protobuf:"bytes,3,opt,name=in_bytes,json=inBytes,proto3" json:"in_bytes,omitempty"` // (Optional) Local endpoint information of the connection to the client, // such as local IP address, port number, and network protocol. @@ -1071,7 +1071,7 @@ var file_grpc_gcp_handshaker_proto_rawDesc = []byte{ 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, - 0x22, 0xfb, 0x04, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x22, 0xf6, 0x04, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x12, 0x5b, 0x0a, 0x1b, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, @@ -1108,140 +1108,141 @@ var file_grpc_gcp_handshaker_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x72, 0x70, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0x80, 0x01, - 0x01, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xaf, - 0x01, 0x0a, 0x19, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, - 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x3d, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0x80, 0x01, 0x01, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0xa5, 0x04, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x15, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x73, 0x12, 0x6d, 0x0a, 0x14, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, - 0x65, 0x71, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x13, 0x68, 0x61, 0x6e, + 0x6d, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xbe, 0x01, 0x0a, 0x19, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x73, 0x12, 0x3d, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa5, 0x04, 0x0a, 0x17, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x6d, 0x0a, 0x14, 0x68, + 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0e, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x0e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x52, 0x70, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x72, 0x70, 0x63, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, - 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, - 0x61, 0x78, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x6b, 0x0a, 0x18, 0x48, - 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x67, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, - 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x62, 0x0a, 0x17, 0x4e, 0x65, 0x78, 0x74, - 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, - 0x0a, 0x12, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, - 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4d, 0x73, 0x22, 0xe5, 0x01, 0x0a, - 0x0d, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x46, - 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, - 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x46, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x48, - 0x00, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x37, - 0x0a, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x61, 0x6e, 0x64, - 0x73, 0x68, 0x61, 0x6b, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x48, - 0x00, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x5f, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x9a, 0x03, 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, - 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x0f, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x37, 0x0a, 0x0d, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, - 0x63, 0x70, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x70, 0x65, 0x65, - 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x13, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x3b, 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x40, 0x0a, + 0x0c, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x52, + 0x70, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x0b, 0x72, 0x70, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x6b, 0x0a, 0x18, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, + 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x62, 0x0a, 0x17, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x61, 0x74, + 0x65, 0x6e, 0x63, 0x79, 0x4d, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x0d, 0x48, 0x61, 0x6e, 0x64, 0x73, + 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x46, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, + 0x70, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x61, 0x6e, + 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x6e, 0x65, 0x78, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, + 0x70, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x65, 0x78, + 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x9a, + 0x03, 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, + 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x0d, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x11, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0f, 0x6b, 0x65, 0x65, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x6e, - 0x12, 0x49, 0x0a, 0x11, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x52, 0x70, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0f, 0x70, 0x65, 0x65, 0x72, - 0x52, 0x70, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, - 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x22, 0x40, 0x0a, 0x10, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x22, 0xbe, 0x01, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x66, 0x72, - 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x63, - 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, - 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x2a, 0x4a, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, - 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x22, 0x0a, 0x1e, 0x48, 0x41, 0x4e, - 0x44, 0x53, 0x48, 0x41, 0x4b, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x4c, 0x54, 0x53, 0x10, 0x02, - 0x2a, 0x45, 0x0a, 0x0f, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x1c, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x50, - 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x01, 0x12, 0x07, - 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x02, 0x32, 0x5b, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, - 0x68, 0x61, 0x6b, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0b, - 0x44, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x17, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, - 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x42, 0x6b, 0x0a, 0x15, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x61, 0x6c, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x42, 0x0f, 0x48, - 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x2f, 0x61, 0x6c, 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x63, - 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x2a, + 0x0a, 0x11, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6b, 0x65, 0x65, 0x70, 0x43, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x49, 0x0a, 0x11, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, + 0x2e, 0x52, 0x70, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0f, 0x70, 0x65, 0x65, 0x72, 0x52, 0x70, 0x63, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, + 0x61, 0x78, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x40, 0x0a, 0x10, 0x48, + 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xbe, 0x01, + 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, + 0x25, 0x0a, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x62, 0x79, 0x74, 0x65, 0x73, 0x43, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, + 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x4a, + 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x12, 0x22, 0x0a, 0x1e, 0x48, 0x41, 0x4e, 0x44, 0x53, 0x48, 0x41, 0x4b, 0x45, + 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, + 0x12, 0x08, 0x0a, 0x04, 0x41, 0x4c, 0x54, 0x53, 0x10, 0x02, 0x2a, 0x45, 0x0a, 0x0f, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x20, 0x0a, + 0x1c, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, + 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, + 0x02, 0x32, 0x5b, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x44, 0x6f, 0x48, 0x61, 0x6e, 0x64, + 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, + 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x18, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x63, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x6b, + 0x0a, 0x15, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x6c, 0x74, 0x73, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x42, 0x0f, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, + 0x6b, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x2f, 0x61, + 0x6c, 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1258,7 +1259,7 @@ func file_grpc_gcp_handshaker_proto_rawDescGZIP() []byte { var file_grpc_gcp_handshaker_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_grpc_gcp_handshaker_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_grpc_gcp_handshaker_proto_goTypes = []any{ +var file_grpc_gcp_handshaker_proto_goTypes = []interface{}{ (HandshakeProtocol)(0), // 0: grpc.gcp.HandshakeProtocol (NetworkProtocol)(0), // 1: grpc.gcp.NetworkProtocol (*Endpoint)(nil), // 2: grpc.gcp.Endpoint @@ -1314,7 +1315,7 @@ func file_grpc_gcp_handshaker_proto_init() { } file_grpc_gcp_transport_security_common_proto_init() if !protoimpl.UnsafeEnabled { - file_grpc_gcp_handshaker_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Endpoint); i { case 0: return &v.state @@ -1326,7 +1327,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Identity); i { case 0: return &v.state @@ -1338,7 +1339,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartClientHandshakeReq); i { case 0: return &v.state @@ -1350,7 +1351,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerHandshakeParameters); i { case 0: return &v.state @@ -1362,7 +1363,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartServerHandshakeReq); i { case 0: return &v.state @@ -1374,7 +1375,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NextHandshakeMessageReq); i { case 0: return &v.state @@ -1386,7 +1387,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HandshakerReq); i { case 0: return &v.state @@ -1398,7 +1399,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HandshakerResult); i { case 0: return &v.state @@ -1410,7 +1411,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HandshakerStatus); i { case 0: return &v.state @@ -1422,7 +1423,7 @@ func file_grpc_gcp_handshaker_proto_init() { return nil } } - file_grpc_gcp_handshaker_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_grpc_gcp_handshaker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HandshakerResp); i { case 0: return &v.state @@ -1435,12 +1436,12 @@ func file_grpc_gcp_handshaker_proto_init() { } } } - file_grpc_gcp_handshaker_proto_msgTypes[1].OneofWrappers = []any{ + file_grpc_gcp_handshaker_proto_msgTypes[1].OneofWrappers = []interface{}{ (*Identity_ServiceAccount)(nil), (*Identity_Hostname)(nil), } - file_grpc_gcp_handshaker_proto_msgTypes[3].OneofWrappers = []any{} - file_grpc_gcp_handshaker_proto_msgTypes[6].OneofWrappers = []any{ + file_grpc_gcp_handshaker_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_grpc_gcp_handshaker_proto_msgTypes[6].OneofWrappers = []interface{}{ (*HandshakerReq_ClientStart)(nil), (*HandshakerReq_ServerStart)(nil), (*HandshakerReq_Next)(nil), diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go index 34443b1d2dc..ba1c46f64b1 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.1 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 // source: grpc/gcp/handshaker.proto package grpc_gcp @@ -32,8 +32,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 const ( HandshakerService_DoHandshake_FullMethodName = "/grpc.gcp.HandshakerService/DoHandshake" @@ -49,7 +49,7 @@ type HandshakerServiceClient interface { // messages with next. Each time client sends a request, the handshaker // service expects to respond. Client does not have to wait for service's // response before sending next request. - DoHandshake(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[HandshakerReq, HandshakerResp], error) + DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) } type handshakerServiceClient struct { @@ -60,22 +60,40 @@ func NewHandshakerServiceClient(cc grpc.ClientConnInterface) HandshakerServiceCl return &handshakerServiceClient{cc} } -func (c *handshakerServiceClient) DoHandshake(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[HandshakerReq, HandshakerResp], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &HandshakerService_ServiceDesc.Streams[0], HandshakerService_DoHandshake_FullMethodName, cOpts...) +func (c *handshakerServiceClient) DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) { + stream, err := c.cc.NewStream(ctx, &HandshakerService_ServiceDesc.Streams[0], HandshakerService_DoHandshake_FullMethodName, opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[HandshakerReq, HandshakerResp]{ClientStream: stream} + x := &handshakerServiceDoHandshakeClient{stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type HandshakerService_DoHandshakeClient = grpc.BidiStreamingClient[HandshakerReq, HandshakerResp] +type HandshakerService_DoHandshakeClient interface { + Send(*HandshakerReq) error + Recv() (*HandshakerResp, error) + grpc.ClientStream +} + +type handshakerServiceDoHandshakeClient struct { + grpc.ClientStream +} + +func (x *handshakerServiceDoHandshakeClient) Send(m *HandshakerReq) error { + return x.ClientStream.SendMsg(m) +} + +func (x *handshakerServiceDoHandshakeClient) Recv() (*HandshakerResp, error) { + m := new(HandshakerResp) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // HandshakerServiceServer is the server API for HandshakerService service. // All implementations must embed UnimplementedHandshakerServiceServer -// for forward compatibility. +// for forward compatibility type HandshakerServiceServer interface { // Handshaker service accepts a stream of handshaker request, returning a // stream of handshaker response. Client is expected to send exactly one @@ -83,22 +101,18 @@ type HandshakerServiceServer interface { // messages with next. Each time client sends a request, the handshaker // service expects to respond. Client does not have to wait for service's // response before sending next request. - DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error + DoHandshake(HandshakerService_DoHandshakeServer) error mustEmbedUnimplementedHandshakerServiceServer() } -// UnimplementedHandshakerServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedHandshakerServiceServer struct{} +// UnimplementedHandshakerServiceServer must be embedded to have forward compatible implementations. +type UnimplementedHandshakerServiceServer struct { +} -func (UnimplementedHandshakerServiceServer) DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error { +func (UnimplementedHandshakerServiceServer) DoHandshake(HandshakerService_DoHandshakeServer) error { return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented") } func (UnimplementedHandshakerServiceServer) mustEmbedUnimplementedHandshakerServiceServer() {} -func (UnimplementedHandshakerServiceServer) testEmbeddedByValue() {} // UnsafeHandshakerServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to HandshakerServiceServer will @@ -108,22 +122,34 @@ type UnsafeHandshakerServiceServer interface { } func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) { - // If the following call panics, it indicates UnimplementedHandshakerServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&HandshakerService_ServiceDesc, srv) } func _HandshakerService_DoHandshake_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(HandshakerServiceServer).DoHandshake(&grpc.GenericServerStream[HandshakerReq, HandshakerResp]{ServerStream: stream}) + return srv.(HandshakerServiceServer).DoHandshake(&handshakerServiceDoHandshakeServer{stream}) +} + +type HandshakerService_DoHandshakeServer interface { + Send(*HandshakerResp) error + Recv() (*HandshakerReq, error) + grpc.ServerStream +} + +type handshakerServiceDoHandshakeServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type HandshakerService_DoHandshakeServer = grpc.BidiStreamingServer[HandshakerReq, HandshakerResp] +func (x *handshakerServiceDoHandshakeServer) Send(m *HandshakerResp) error { + return x.ServerStream.SendMsg(m) +} + +func (x *handshakerServiceDoHandshakeServer) Recv() (*HandshakerReq, error) { + m := new(HandshakerReq) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // HandshakerService_ServiceDesc is the grpc.ServiceDesc for HandshakerService service. // It's only intended for direct use with grpc.RegisterService, diff --git a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/transport_security_common.pb.go b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/transport_security_common.pb.go index 6956c14f6a9..3e53b2b13bc 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/transport_security_common.pb.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/transport_security_common.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/gcp/transport_security_common.proto package grpc_gcp @@ -253,7 +253,7 @@ func file_grpc_gcp_transport_security_common_proto_rawDescGZIP() []byte { var file_grpc_gcp_transport_security_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_grpc_gcp_transport_security_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_gcp_transport_security_common_proto_goTypes = []any{ +var file_grpc_gcp_transport_security_common_proto_goTypes = []interface{}{ (SecurityLevel)(0), // 0: grpc.gcp.SecurityLevel (*RpcProtocolVersions)(nil), // 1: grpc.gcp.RpcProtocolVersions (*RpcProtocolVersions_Version)(nil), // 2: grpc.gcp.RpcProtocolVersions.Version @@ -274,7 +274,7 @@ func file_grpc_gcp_transport_security_common_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gcp_transport_security_common_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_gcp_transport_security_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RpcProtocolVersions); i { case 0: return &v.state @@ -286,7 +286,7 @@ func file_grpc_gcp_transport_security_common_proto_init() { return nil } } - file_grpc_gcp_transport_security_common_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_grpc_gcp_transport_security_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RpcProtocolVersions_Version); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/grpc/credentials/credentials.go b/upstream/vendor/google.golang.org/grpc/credentials/credentials.go index 665e790bb0f..f6b55c68b56 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/credentials.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/credentials.go @@ -30,7 +30,7 @@ import ( "google.golang.org/grpc/attributes" icredentials "google.golang.org/grpc/internal/credentials" - "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" ) // PerRPCCredentials defines the common interface for the credentials which need to @@ -237,7 +237,7 @@ func ClientHandshakeInfoFromContext(ctx context.Context) ClientHandshakeInfo { } // CheckSecurityLevel checks if a connection's security level is greater than or equal to the specified one. -// It returns success if 1) the condition is satisfied or 2) AuthInfo struct does not implement GetCommonAuthInfo() method +// It returns success if 1) the condition is satisified or 2) AuthInfo struct does not implement GetCommonAuthInfo() method // or 3) CommonAuthInfo.SecurityLevel has an invalid zero value. For 2) and 3), it is for the purpose of backward-compatibility. // // This API is experimental. @@ -287,5 +287,5 @@ type ChannelzSecurityValue interface { type OtherChannelzSecurityValue struct { ChannelzSecurityValue Name string - Value proto.Message + Value protoadapt.MessageV1 } diff --git a/upstream/vendor/google.golang.org/grpc/credentials/insecure/insecure.go b/upstream/vendor/google.golang.org/grpc/credentials/insecure/insecure.go index 4c805c64462..82bee1443bf 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/insecure/insecure.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/insecure/insecure.go @@ -40,7 +40,7 @@ func NewCredentials() credentials.TransportCredentials { // NoSecurity. type insecureTC struct{} -func (insecureTC) ClientHandshake(_ context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) { +func (insecureTC) ClientHandshake(ctx context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) { return conn, info{credentials.CommonAuthInfo{SecurityLevel: credentials.NoSecurity}}, nil } diff --git a/upstream/vendor/google.golang.org/grpc/credentials/oauth/oauth.go b/upstream/vendor/google.golang.org/grpc/credentials/oauth/oauth.go index 328b838ed1f..d475cbc0894 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/oauth/oauth.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/oauth/oauth.go @@ -38,7 +38,7 @@ type TokenSource struct { } // GetRequestMetadata gets the request metadata as a map from a TokenSource. -func (ts TokenSource) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { +func (ts TokenSource) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { token, err := ts.Token() if err != nil { return nil, err @@ -127,7 +127,7 @@ func NewOauthAccess(token *oauth2.Token) credentials.PerRPCCredentials { return oauthAccess{token: *token} } -func (oa oauthAccess) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { +func (oa oauthAccess) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { ri, _ := credentials.RequestInfoFromContext(ctx) if err := credentials.CheckSecurityLevel(ri.AuthInfo, credentials.PrivacyAndIntegrity); err != nil { return nil, fmt.Errorf("unable to transfer oauthAccess PerRPCCredentials: %v", err) @@ -156,7 +156,7 @@ type serviceAccount struct { t *oauth2.Token } -func (s *serviceAccount) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { +func (s *serviceAccount) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { s.mu.Lock() defer s.mu.Unlock() if !s.t.Valid() { diff --git a/upstream/vendor/google.golang.org/grpc/credentials/tls.go b/upstream/vendor/google.golang.org/grpc/credentials/tls.go index 4114358545e..5dafd34edf9 100644 --- a/upstream/vendor/google.golang.org/grpc/credentials/tls.go +++ b/upstream/vendor/google.golang.org/grpc/credentials/tls.go @@ -27,13 +27,9 @@ import ( "net/url" "os" - "google.golang.org/grpc/grpclog" credinternal "google.golang.org/grpc/internal/credentials" - "google.golang.org/grpc/internal/envconfig" ) -var logger = grpclog.Component("credentials") - // TLSInfo contains the auth information for a TLS authenticated connection. // It implements the AuthInfo interface. type TLSInfo struct { @@ -116,22 +112,6 @@ func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawCon conn.Close() return nil, nil, ctx.Err() } - - // The negotiated protocol can be either of the following: - // 1. h2: When the server supports ALPN. Only HTTP/2 can be negotiated since - // it is the only protocol advertised by the client during the handshake. - // The tls library ensures that the server chooses a protocol advertised - // by the client. - // 2. "" (empty string): If the server doesn't support ALPN. ALPN is a requirement - // for using HTTP/2 over TLS. We can terminate the connection immediately. - np := conn.ConnectionState().NegotiatedProtocol - if np == "" { - if envconfig.EnforceALPNEnabled { - conn.Close() - return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property") - } - logger.Warningf("Allowing TLS connection to server %q with ALPN disabled. TLS connections to servers with ALPN disabled will be disallowed in future grpc-go releases", cfg.ServerName) - } tlsInfo := TLSInfo{ State: conn.ConnectionState(), CommonAuthInfo: CommonAuthInfo{ @@ -151,20 +131,8 @@ func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) conn.Close() return nil, nil, err } - cs := conn.ConnectionState() - // The negotiated application protocol can be empty only if the client doesn't - // support ALPN. In such cases, we can close the connection since ALPN is required - // for using HTTP/2 over TLS. - if cs.NegotiatedProtocol == "" { - if envconfig.EnforceALPNEnabled { - conn.Close() - return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property") - } else if logger.V(2) { - logger.Info("Allowing TLS connection from client with ALPN disabled. TLS connections with ALPN disabled will be disallowed in future grpc-go releases") - } - } tlsInfo := TLSInfo{ - State: cs, + State: conn.ConnectionState(), CommonAuthInfo: CommonAuthInfo{ SecurityLevel: PrivacyAndIntegrity, }, diff --git a/upstream/vendor/google.golang.org/grpc/dialoptions.go b/upstream/vendor/google.golang.org/grpc/dialoptions.go index 2b285beee37..402493224e0 100644 --- a/upstream/vendor/google.golang.org/grpc/dialoptions.go +++ b/upstream/vendor/google.golang.org/grpc/dialoptions.go @@ -21,7 +21,6 @@ package grpc import ( "context" "net" - "net/url" "time" "google.golang.org/grpc/backoff" @@ -33,16 +32,10 @@ import ( "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/mem" "google.golang.org/grpc/resolver" "google.golang.org/grpc/stats" ) -const ( - // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#limits-on-retries-and-hedges - defaultMaxCallAttempts = 5 -) - func init() { internal.AddGlobalDialOptions = func(opt ...DialOption) { globalDialOptions = append(globalDialOptions, opt...) @@ -50,18 +43,10 @@ func init() { internal.ClearGlobalDialOptions = func() { globalDialOptions = nil } - internal.AddGlobalPerTargetDialOptions = func(opt any) { - if ptdo, ok := opt.(perTargetDialOption); ok { - globalPerTargetDialOptions = append(globalPerTargetDialOptions, ptdo) - } - } - internal.ClearGlobalPerTargetDialOptions = func() { - globalPerTargetDialOptions = nil - } internal.WithBinaryLogger = withBinaryLogger internal.JoinDialOptions = newJoinDialOption internal.DisableGlobalDialOptions = newDisableGlobalDialOptions - internal.WithBufferPool = withBufferPool + internal.WithRecvBufferPool = withRecvBufferPool } // dialOptions configure a Dial call. dialOptions are set by the DialOption @@ -93,8 +78,8 @@ type dialOptions struct { defaultServiceConfigRawJSON *string resolvers []resolver.Builder idleTimeout time.Duration + recvBufferPool SharedBufferPool defaultScheme string - maxCallAttempts int } // DialOption configures how we set up the connection. @@ -104,19 +89,6 @@ type DialOption interface { var globalDialOptions []DialOption -// perTargetDialOption takes a parsed target and returns a dial option to apply. -// -// This gets called after NewClient() parses the target, and allows per target -// configuration set through a returned DialOption. The DialOption will not take -// effect if specifies a resolver builder, as that Dial Option is factored in -// while parsing target. -type perTargetDialOption interface { - // DialOption returns a Dial Option to apply. - DialOptionForTarget(parsedTarget url.URL) DialOption -} - -var globalPerTargetDialOptions []perTargetDialOption - // EmptyDialOption does not alter the dial configuration. It can be embedded in // another structure to build custom dial options. // @@ -328,9 +300,6 @@ func withBackoff(bs internalbackoff.Strategy) DialOption { // // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md -// -// Deprecated: this DialOption is not supported by NewClient. -// Will be supported throughout 1.x. func WithBlock() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true @@ -345,8 +314,10 @@ func WithBlock() DialOption { // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // -// Deprecated: this DialOption is not supported by NewClient. -// Will be supported throughout 1.x. +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. func WithReturnConnectionError() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true @@ -416,8 +387,8 @@ func WithCredentialsBundle(b credentials.Bundle) DialOption { // WithTimeout returns a DialOption that configures a timeout for dialing a // ClientConn initially. This is valid if and only if WithBlock() is present. // -// Deprecated: this DialOption is not supported by NewClient. -// Will be supported throughout 1.x. +// Deprecated: use DialContext instead of Dial and context.WithTimeout +// instead. Will be supported throughout 1.x. func WithTimeout(d time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.timeout = d @@ -499,8 +470,9 @@ func withBinaryLogger(bl binarylog.Logger) DialOption { // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // -// Deprecated: this DialOption is not supported by NewClient. -// This API may be changed or removed in a +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func FailOnNonTempDialError(f bool) DialOption { return newFuncDialOption(func(o *dialOptions) { @@ -518,8 +490,6 @@ func WithUserAgent(s string) DialOption { // WithKeepaliveParams returns a DialOption that specifies keepalive parameters // for the client transport. -// -// Keepalive is disabled by default. func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption { if kp.Time < internal.KeepaliveMinPingTime { logger.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime) @@ -631,22 +601,12 @@ func WithDisableRetry() DialOption { }) } -// MaxHeaderListSizeDialOption is a DialOption that specifies the maximum -// (uncompressed) size of header list that the client is prepared to accept. -type MaxHeaderListSizeDialOption struct { - MaxHeaderListSize uint32 -} - -func (o MaxHeaderListSizeDialOption) apply(do *dialOptions) { - do.copts.MaxHeaderListSize = &o.MaxHeaderListSize -} - // WithMaxHeaderListSize returns a DialOption that specifies the maximum // (uncompressed) size of header list that the client is prepared to accept. func WithMaxHeaderListSize(s uint32) DialOption { - return MaxHeaderListSizeDialOption{ - MaxHeaderListSize: s, - } + return newFuncDialOption(func(o *dialOptions) { + o.copts.MaxHeaderListSize = &s + }) } // WithDisableHealthCheck disables the LB channel health checking for all @@ -679,17 +639,16 @@ func defaultDialOptions() dialOptions { WriteBufferSize: defaultWriteBufSize, UseProxy: true, UserAgent: grpcUA, - BufferPool: mem.DefaultBufferPool(), }, bs: internalbackoff.DefaultExponential, healthCheckFunc: internal.HealthCheckFunc, idleTimeout: 30 * time.Minute, + recvBufferPool: nopBufferPool{}, defaultScheme: "dns", - maxCallAttempts: defaultMaxCallAttempts, } } -// withMinConnectDeadline specifies the function that clientconn uses to +// withGetMinConnectDeadline specifies the function that clientconn uses to // get minConnectDeadline. This can be used to make connection attempts happen // faster/slower. // @@ -743,25 +702,25 @@ func WithIdleTimeout(d time.Duration) DialOption { }) } -// WithMaxCallAttempts returns a DialOption that configures the maximum number -// of attempts per call (including retries and hedging) using the channel. -// Service owners may specify a higher value for these parameters, but higher -// values will be treated as equal to the maximum value by the client -// implementation. This mitigates security concerns related to the service -// config being transferred to the client via DNS. +// WithRecvBufferPool returns a DialOption that configures the ClientConn +// to use the provided shared buffer pool for parsing incoming messages. Depending +// on the application's workload, this could result in reduced memory allocation. // -// A value of 5 will be used if this dial option is not set or n < 2. -func WithMaxCallAttempts(n int) DialOption { - return newFuncDialOption(func(o *dialOptions) { - if n < 2 { - n = defaultMaxCallAttempts - } - o.maxCallAttempts = n - }) +// If you are unsure about how to implement a memory pool but want to utilize one, +// begin with grpc.NewSharedBufferPool. +// +// Note: The shared buffer pool feature will not be active if any of the following +// options are used: WithStatsHandler, EnableTracing, or binary logging. In such +// cases, the shared buffer pool will be ignored. +// +// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in +// v1.60.0 or later. +func WithRecvBufferPool(bufferPool SharedBufferPool) DialOption { + return withRecvBufferPool(bufferPool) } -func withBufferPool(bufferPool mem.BufferPool) DialOption { +func withRecvBufferPool(bufferPool SharedBufferPool) DialOption { return newFuncDialOption(func(o *dialOptions) { - o.copts.BufferPool = bufferPool + o.recvBufferPool = bufferPool }) } diff --git a/upstream/vendor/google.golang.org/grpc/doc.go b/upstream/vendor/google.golang.org/grpc/doc.go index e7b532b6f80..0022859ad74 100644 --- a/upstream/vendor/google.golang.org/grpc/doc.go +++ b/upstream/vendor/google.golang.org/grpc/doc.go @@ -16,7 +16,7 @@ * */ -//go:generate ./scripts/regenerate.sh +//go:generate ./regenerate.sh /* Package grpc implements an RPC system called gRPC. diff --git a/upstream/vendor/google.golang.org/grpc/encoding/encoding.go b/upstream/vendor/google.golang.org/grpc/encoding/encoding.go index 11d0ae142c4..5ebf88d7147 100644 --- a/upstream/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/upstream/vendor/google.golang.org/grpc/encoding/encoding.go @@ -94,7 +94,7 @@ type Codec interface { Name() string } -var registeredCodecs = make(map[string]any) +var registeredCodecs = make(map[string]Codec) // RegisterCodec registers the provided Codec for use with all gRPC clients and // servers. @@ -126,6 +126,5 @@ func RegisterCodec(codec Codec) { // // The content-subtype is expected to be lowercase. func GetCodec(contentSubtype string) Codec { - c, _ := registeredCodecs[contentSubtype].(Codec) - return c + return registeredCodecs[contentSubtype] } diff --git a/upstream/vendor/google.golang.org/grpc/encoding/encoding_v2.go b/upstream/vendor/google.golang.org/grpc/encoding/encoding_v2.go deleted file mode 100644 index 074c5e234a7..00000000000 --- a/upstream/vendor/google.golang.org/grpc/encoding/encoding_v2.go +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package encoding - -import ( - "strings" - - "google.golang.org/grpc/mem" -) - -// CodecV2 defines the interface gRPC uses to encode and decode messages. Note -// that implementations of this interface must be thread safe; a CodecV2's -// methods can be called from concurrent goroutines. -type CodecV2 interface { - // Marshal returns the wire format of v. The buffers in the returned - // [mem.BufferSlice] must have at least one reference each, which will be freed - // by gRPC when they are no longer needed. - Marshal(v any) (out mem.BufferSlice, err error) - // Unmarshal parses the wire format into v. Note that data will be freed as soon - // as this function returns. If the codec wishes to guarantee access to the data - // after this function, it must take its own reference that it frees when it is - // no longer needed. - Unmarshal(data mem.BufferSlice, v any) error - // Name returns the name of the Codec implementation. The returned string - // will be used as part of content type in transmission. The result must be - // static; the result cannot change between calls. - Name() string -} - -// RegisterCodecV2 registers the provided CodecV2 for use with all gRPC clients and -// servers. -// -// The CodecV2 will be stored and looked up by result of its Name() method, which -// should match the content-subtype of the encoding handled by the CodecV2. This -// is case-insensitive, and is stored and looked up as lowercase. If the -// result of calling Name() is an empty string, RegisterCodecV2 will panic. See -// Content-Type on -// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for -// more details. -// -// If both a Codec and CodecV2 are registered with the same name, the CodecV2 -// will be used. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple Codecs are -// registered with the same name, the one registered last will take effect. -func RegisterCodecV2(codec CodecV2) { - if codec == nil { - panic("cannot register a nil CodecV2") - } - if codec.Name() == "" { - panic("cannot register CodecV2 with empty string result for Name()") - } - contentSubtype := strings.ToLower(codec.Name()) - registeredCodecs[contentSubtype] = codec -} - -// GetCodecV2 gets a registered CodecV2 by content-subtype, or nil if no CodecV2 is -// registered for the content-subtype. -// -// The content-subtype is expected to be lowercase. -func GetCodecV2(contentSubtype string) CodecV2 { - c, _ := registeredCodecs[contentSubtype].(CodecV2) - return c -} diff --git a/upstream/vendor/google.golang.org/grpc/encoding/proto/proto.go b/upstream/vendor/google.golang.org/grpc/encoding/proto/proto.go index ceec319dd2f..66d5cdf03ec 100644 --- a/upstream/vendor/google.golang.org/grpc/encoding/proto/proto.go +++ b/upstream/vendor/google.golang.org/grpc/encoding/proto/proto.go @@ -1,6 +1,6 @@ /* * - * Copyright 2024 gRPC authors. + * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import ( "fmt" "google.golang.org/grpc/encoding" - "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" ) @@ -33,51 +32,28 @@ import ( const Name = "proto" func init() { - encoding.RegisterCodecV2(&codecV2{}) + encoding.RegisterCodec(codec{}) } -// codec is a CodecV2 implementation with protobuf. It is the default codec for -// gRPC. -type codecV2 struct{} +// codec is a Codec implementation with protobuf. It is the default codec for gRPC. +type codec struct{} -func (c *codecV2) Marshal(v any) (data mem.BufferSlice, err error) { +func (codec) Marshal(v any) ([]byte, error) { vv := messageV2Of(v) if vv == nil { - return nil, fmt.Errorf("proto: failed to marshal, message is %T, want proto.Message", v) + return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v) } - size := proto.Size(vv) - if mem.IsBelowBufferPoolingThreshold(size) { - buf, err := proto.Marshal(vv) - if err != nil { - return nil, err - } - data = append(data, mem.SliceBuffer(buf)) - } else { - pool := mem.DefaultBufferPool() - buf := pool.Get(size) - if _, err := (proto.MarshalOptions{}).MarshalAppend((*buf)[:0], vv); err != nil { - pool.Put(buf) - return nil, err - } - data = append(data, mem.NewBuffer(buf, pool)) - } - - return data, nil + return proto.Marshal(vv) } -func (c *codecV2) Unmarshal(data mem.BufferSlice, v any) (err error) { +func (codec) Unmarshal(data []byte, v any) error { vv := messageV2Of(v) if vv == nil { return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) } - buf := data.MaterializeToBuffer(mem.DefaultBufferPool()) - defer buf.Free() - // TODO: Upgrade proto.Unmarshal to support mem.BufferSlice. Right now, it's not - // really possible without a major overhaul of the proto package, but the - // vtprotobuf library may be able to support this. - return proto.Unmarshal(buf.ReadOnlyData(), vv) + return proto.Unmarshal(data, vv) } func messageV2Of(v any) proto.Message { @@ -91,6 +67,6 @@ func messageV2Of(v any) proto.Message { return nil } -func (c *codecV2) Name() string { +func (codec) Name() string { return Name } diff --git a/upstream/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go b/upstream/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go deleted file mode 100644 index 1d827dd5d9d..00000000000 --- a/upstream/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go +++ /dev/null @@ -1,269 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package stats - -import ( - "maps" - - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/internal" -) - -func init() { - internal.SnapshotMetricRegistryForTesting = snapshotMetricsRegistryForTesting -} - -var logger = grpclog.Component("metrics-registry") - -// DefaultMetrics are the default metrics registered through global metrics -// registry. This is written to at initialization time only, and is read only -// after initialization. -var DefaultMetrics = NewMetrics() - -// MetricDescriptor is the data for a registered metric. -type MetricDescriptor struct { - // The name of this metric. This name must be unique across the whole binary - // (including any per call metrics). See - // https://github.com/grpc/proposal/blob/master/A79-non-per-call-metrics-architecture.md#metric-instrument-naming-conventions - // for metric naming conventions. - Name Metric - // The description of this metric. - Description string - // The unit (e.g. entries, seconds) of this metric. - Unit string - // The required label keys for this metric. These are intended to - // metrics emitted from a stats handler. - Labels []string - // The optional label keys for this metric. These are intended to attached - // to metrics emitted from a stats handler if configured. - OptionalLabels []string - // Whether this metric is on by default. - Default bool - // The type of metric. This is set by the metric registry, and not intended - // to be set by a component registering a metric. - Type MetricType - // Bounds are the bounds of this metric. This only applies to histogram - // metrics. If unset or set with length 0, stats handlers will fall back to - // default bounds. - Bounds []float64 -} - -// MetricType is the type of metric. -type MetricType int - -// Type of metric supported by this instrument registry. -const ( - MetricTypeIntCount MetricType = iota - MetricTypeFloatCount - MetricTypeIntHisto - MetricTypeFloatHisto - MetricTypeIntGauge -) - -// Int64CountHandle is a typed handle for a int count metric. This handle -// is passed at the recording point in order to know which metric to record -// on. -type Int64CountHandle MetricDescriptor - -// Descriptor returns the int64 count handle typecast to a pointer to a -// MetricDescriptor. -func (h *Int64CountHandle) Descriptor() *MetricDescriptor { - return (*MetricDescriptor)(h) -} - -// Record records the int64 count value on the metrics recorder provided. -func (h *Int64CountHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { - recorder.RecordInt64Count(h, incr, labels...) -} - -// Float64CountHandle is a typed handle for a float count metric. This handle is -// passed at the recording point in order to know which metric to record on. -type Float64CountHandle MetricDescriptor - -// Descriptor returns the float64 count handle typecast to a pointer to a -// MetricDescriptor. -func (h *Float64CountHandle) Descriptor() *MetricDescriptor { - return (*MetricDescriptor)(h) -} - -// Record records the float64 count value on the metrics recorder provided. -func (h *Float64CountHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { - recorder.RecordFloat64Count(h, incr, labels...) -} - -// Int64HistoHandle is a typed handle for an int histogram metric. This handle -// is passed at the recording point in order to know which metric to record on. -type Int64HistoHandle MetricDescriptor - -// Descriptor returns the int64 histo handle typecast to a pointer to a -// MetricDescriptor. -func (h *Int64HistoHandle) Descriptor() *MetricDescriptor { - return (*MetricDescriptor)(h) -} - -// Record records the int64 histo value on the metrics recorder provided. -func (h *Int64HistoHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { - recorder.RecordInt64Histo(h, incr, labels...) -} - -// Float64HistoHandle is a typed handle for a float histogram metric. This -// handle is passed at the recording point in order to know which metric to -// record on. -type Float64HistoHandle MetricDescriptor - -// Descriptor returns the float64 histo handle typecast to a pointer to a -// MetricDescriptor. -func (h *Float64HistoHandle) Descriptor() *MetricDescriptor { - return (*MetricDescriptor)(h) -} - -// Record records the float64 histo value on the metrics recorder provided. -func (h *Float64HistoHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { - recorder.RecordFloat64Histo(h, incr, labels...) -} - -// Int64GaugeHandle is a typed handle for an int gauge metric. This handle is -// passed at the recording point in order to know which metric to record on. -type Int64GaugeHandle MetricDescriptor - -// Descriptor returns the int64 gauge handle typecast to a pointer to a -// MetricDescriptor. -func (h *Int64GaugeHandle) Descriptor() *MetricDescriptor { - return (*MetricDescriptor)(h) -} - -// Record records the int64 histo value on the metrics recorder provided. -func (h *Int64GaugeHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { - recorder.RecordInt64Gauge(h, incr, labels...) -} - -// registeredMetrics are the registered metric descriptor names. -var registeredMetrics = make(map[Metric]bool) - -// metricsRegistry contains all of the registered metrics. -// -// This is written to only at init time, and read only after that. -var metricsRegistry = make(map[Metric]*MetricDescriptor) - -// DescriptorForMetric returns the MetricDescriptor from the global registry. -// -// Returns nil if MetricDescriptor not present. -func DescriptorForMetric(metric Metric) *MetricDescriptor { - return metricsRegistry[metric] -} - -func registerMetric(name Metric, def bool) { - if registeredMetrics[name] { - logger.Fatalf("metric %v already registered", name) - } - registeredMetrics[name] = true - if def { - DefaultMetrics = DefaultMetrics.Add(name) - } -} - -// RegisterInt64Count registers the metric description onto the global registry. -// It returns a typed handle to use to recording data. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple metrics are -// registered with the same name, this function will panic. -func RegisterInt64Count(descriptor MetricDescriptor) *Int64CountHandle { - registerMetric(descriptor.Name, descriptor.Default) - descriptor.Type = MetricTypeIntCount - descPtr := &descriptor - metricsRegistry[descriptor.Name] = descPtr - return (*Int64CountHandle)(descPtr) -} - -// RegisterFloat64Count registers the metric description onto the global -// registry. It returns a typed handle to use to recording data. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple metrics are -// registered with the same name, this function will panic. -func RegisterFloat64Count(descriptor MetricDescriptor) *Float64CountHandle { - registerMetric(descriptor.Name, descriptor.Default) - descriptor.Type = MetricTypeFloatCount - descPtr := &descriptor - metricsRegistry[descriptor.Name] = descPtr - return (*Float64CountHandle)(descPtr) -} - -// RegisterInt64Histo registers the metric description onto the global registry. -// It returns a typed handle to use to recording data. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple metrics are -// registered with the same name, this function will panic. -func RegisterInt64Histo(descriptor MetricDescriptor) *Int64HistoHandle { - registerMetric(descriptor.Name, descriptor.Default) - descriptor.Type = MetricTypeIntHisto - descPtr := &descriptor - metricsRegistry[descriptor.Name] = descPtr - return (*Int64HistoHandle)(descPtr) -} - -// RegisterFloat64Histo registers the metric description onto the global -// registry. It returns a typed handle to use to recording data. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple metrics are -// registered with the same name, this function will panic. -func RegisterFloat64Histo(descriptor MetricDescriptor) *Float64HistoHandle { - registerMetric(descriptor.Name, descriptor.Default) - descriptor.Type = MetricTypeFloatHisto - descPtr := &descriptor - metricsRegistry[descriptor.Name] = descPtr - return (*Float64HistoHandle)(descPtr) -} - -// RegisterInt64Gauge registers the metric description onto the global registry. -// It returns a typed handle to use to recording data. -// -// NOTE: this function must only be called during initialization time (i.e. in -// an init() function), and is not thread-safe. If multiple metrics are -// registered with the same name, this function will panic. -func RegisterInt64Gauge(descriptor MetricDescriptor) *Int64GaugeHandle { - registerMetric(descriptor.Name, descriptor.Default) - descriptor.Type = MetricTypeIntGauge - descPtr := &descriptor - metricsRegistry[descriptor.Name] = descPtr - return (*Int64GaugeHandle)(descPtr) -} - -// snapshotMetricsRegistryForTesting snapshots the global data of the metrics -// registry. Returns a cleanup function that sets the metrics registry to its -// original state. -func snapshotMetricsRegistryForTesting() func() { - oldDefaultMetrics := DefaultMetrics - oldRegisteredMetrics := registeredMetrics - oldMetricsRegistry := metricsRegistry - - registeredMetrics = make(map[Metric]bool) - metricsRegistry = make(map[Metric]*MetricDescriptor) - maps.Copy(registeredMetrics, registeredMetrics) - maps.Copy(metricsRegistry, metricsRegistry) - - return func() { - DefaultMetrics = oldDefaultMetrics - registeredMetrics = oldRegisteredMetrics - metricsRegistry = oldMetricsRegistry - } -} diff --git a/upstream/vendor/google.golang.org/grpc/experimental/stats/metrics.go b/upstream/vendor/google.golang.org/grpc/experimental/stats/metrics.go deleted file mode 100644 index 3221f7a633a..00000000000 --- a/upstream/vendor/google.golang.org/grpc/experimental/stats/metrics.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package stats contains experimental metrics/stats API's. -package stats - -import "maps" - -// MetricsRecorder records on metrics derived from metric registry. -type MetricsRecorder interface { - // RecordInt64Count records the measurement alongside labels on the int - // count associated with the provided handle. - RecordInt64Count(handle *Int64CountHandle, incr int64, labels ...string) - // RecordFloat64Count records the measurement alongside labels on the float - // count associated with the provided handle. - RecordFloat64Count(handle *Float64CountHandle, incr float64, labels ...string) - // RecordInt64Histo records the measurement alongside labels on the int - // histo associated with the provided handle. - RecordInt64Histo(handle *Int64HistoHandle, incr int64, labels ...string) - // RecordFloat64Histo records the measurement alongside labels on the float - // histo associated with the provided handle. - RecordFloat64Histo(handle *Float64HistoHandle, incr float64, labels ...string) - // RecordInt64Gauge records the measurement alongside labels on the int - // gauge associated with the provided handle. - RecordInt64Gauge(handle *Int64GaugeHandle, incr int64, labels ...string) -} - -// Metric is an identifier for a metric. -type Metric string - -// Metrics is a set of metrics to record. Once created, Metrics is immutable, -// however Add and Remove can make copies with specific metrics added or -// removed, respectively. -// -// Do not construct directly; use NewMetrics instead. -type Metrics struct { - // metrics are the set of metrics to initialize. - metrics map[Metric]bool -} - -// NewMetrics returns a Metrics containing Metrics. -func NewMetrics(metrics ...Metric) *Metrics { - newMetrics := make(map[Metric]bool) - for _, metric := range metrics { - newMetrics[metric] = true - } - return &Metrics{ - metrics: newMetrics, - } -} - -// Metrics returns the metrics set. The returned map is read-only and must not -// be modified. -func (m *Metrics) Metrics() map[Metric]bool { - return m.metrics -} - -// Add adds the metrics to the metrics set and returns a new copy with the -// additional metrics. -func (m *Metrics) Add(metrics ...Metric) *Metrics { - newMetrics := make(map[Metric]bool) - for metric := range m.metrics { - newMetrics[metric] = true - } - - for _, metric := range metrics { - newMetrics[metric] = true - } - return &Metrics{ - metrics: newMetrics, - } -} - -// Join joins the metrics passed in with the metrics set, and returns a new copy -// with the merged metrics. -func (m *Metrics) Join(metrics *Metrics) *Metrics { - newMetrics := make(map[Metric]bool) - maps.Copy(newMetrics, m.metrics) - maps.Copy(newMetrics, metrics.metrics) - return &Metrics{ - metrics: newMetrics, - } -} - -// Remove removes the metrics from the metrics set and returns a new copy with -// the metrics removed. -func (m *Metrics) Remove(metrics ...Metric) *Metrics { - newMetrics := make(map[Metric]bool) - for metric := range m.metrics { - newMetrics[metric] = true - } - - for _, metric := range metrics { - delete(newMetrics, metric) - } - return &Metrics{ - metrics: newMetrics, - } -} diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/component.go b/upstream/vendor/google.golang.org/grpc/grpclog/component.go index f1ae080dcb8..ac73c9ced25 100644 --- a/upstream/vendor/google.golang.org/grpc/grpclog/component.go +++ b/upstream/vendor/google.golang.org/grpc/grpclog/component.go @@ -20,6 +20,8 @@ package grpclog import ( "fmt" + + "google.golang.org/grpc/internal/grpclog" ) // componentData records the settings for a component. @@ -31,22 +33,22 @@ var cache = map[string]*componentData{} func (c *componentData) InfoDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - InfoDepth(depth+1, args...) + grpclog.InfoDepth(depth+1, args...) } func (c *componentData) WarningDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - WarningDepth(depth+1, args...) + grpclog.WarningDepth(depth+1, args...) } func (c *componentData) ErrorDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - ErrorDepth(depth+1, args...) + grpclog.ErrorDepth(depth+1, args...) } func (c *componentData) FatalDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - FatalDepth(depth+1, args...) + grpclog.FatalDepth(depth+1, args...) } func (c *componentData) Info(args ...any) { diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/grpclog.go b/upstream/vendor/google.golang.org/grpc/grpclog/grpclog.go index db320105e64..16928c9cb99 100644 --- a/upstream/vendor/google.golang.org/grpc/grpclog/grpclog.go +++ b/upstream/vendor/google.golang.org/grpc/grpclog/grpclog.go @@ -18,15 +18,18 @@ // Package grpclog defines logging for grpc. // -// In the default logger, severity level can be set by environment variable -// GRPC_GO_LOG_SEVERITY_LEVEL, verbosity level can be set by -// GRPC_GO_LOG_VERBOSITY_LEVEL. -package grpclog +// All logs in transport and grpclb packages only go to verbose level 2. +// All logs in other packages in grpc are logged in spite of the verbosity level. +// +// In the default logger, +// severity level can be set by environment variable GRPC_GO_LOG_SEVERITY_LEVEL, +// verbosity level can be set by GRPC_GO_LOG_VERBOSITY_LEVEL. +package grpclog // import "google.golang.org/grpc/grpclog" import ( "os" - "google.golang.org/grpc/grpclog/internal" + "google.golang.org/grpc/internal/grpclog" ) func init() { @@ -35,58 +38,58 @@ func init() { // V reports whether verbosity level l is at least the requested verbose level. func V(l int) bool { - return internal.LoggerV2Impl.V(l) + return grpclog.Logger.V(l) } // Info logs to the INFO log. func Info(args ...any) { - internal.LoggerV2Impl.Info(args...) + grpclog.Logger.Info(args...) } // Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. func Infof(format string, args ...any) { - internal.LoggerV2Impl.Infof(format, args...) + grpclog.Logger.Infof(format, args...) } // Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println. func Infoln(args ...any) { - internal.LoggerV2Impl.Infoln(args...) + grpclog.Logger.Infoln(args...) } // Warning logs to the WARNING log. func Warning(args ...any) { - internal.LoggerV2Impl.Warning(args...) + grpclog.Logger.Warning(args...) } // Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. func Warningf(format string, args ...any) { - internal.LoggerV2Impl.Warningf(format, args...) + grpclog.Logger.Warningf(format, args...) } // Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println. func Warningln(args ...any) { - internal.LoggerV2Impl.Warningln(args...) + grpclog.Logger.Warningln(args...) } // Error logs to the ERROR log. func Error(args ...any) { - internal.LoggerV2Impl.Error(args...) + grpclog.Logger.Error(args...) } // Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. func Errorf(format string, args ...any) { - internal.LoggerV2Impl.Errorf(format, args...) + grpclog.Logger.Errorf(format, args...) } // Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println. func Errorln(args ...any) { - internal.LoggerV2Impl.Errorln(args...) + grpclog.Logger.Errorln(args...) } // Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. // It calls os.Exit() with exit code 1. func Fatal(args ...any) { - internal.LoggerV2Impl.Fatal(args...) + grpclog.Logger.Fatal(args...) // Make sure fatal logs will exit. os.Exit(1) } @@ -94,15 +97,15 @@ func Fatal(args ...any) { // Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. // It calls os.Exit() with exit code 1. func Fatalf(format string, args ...any) { - internal.LoggerV2Impl.Fatalf(format, args...) + grpclog.Logger.Fatalf(format, args...) // Make sure fatal logs will exit. os.Exit(1) } // Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. -// It calls os.Exit() with exit code 1. +// It calle os.Exit()) with exit code 1. func Fatalln(args ...any) { - internal.LoggerV2Impl.Fatalln(args...) + grpclog.Logger.Fatalln(args...) // Make sure fatal logs will exit. os.Exit(1) } @@ -111,76 +114,19 @@ func Fatalln(args ...any) { // // Deprecated: use Info. func Print(args ...any) { - internal.LoggerV2Impl.Info(args...) + grpclog.Logger.Info(args...) } // Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. // // Deprecated: use Infof. func Printf(format string, args ...any) { - internal.LoggerV2Impl.Infof(format, args...) + grpclog.Logger.Infof(format, args...) } // Println prints to the logger. Arguments are handled in the manner of fmt.Println. // // Deprecated: use Infoln. func Println(args ...any) { - internal.LoggerV2Impl.Infoln(args...) -} - -// InfoDepth logs to the INFO log at the specified depth. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func InfoDepth(depth int, args ...any) { - if internal.DepthLoggerV2Impl != nil { - internal.DepthLoggerV2Impl.InfoDepth(depth, args...) - } else { - internal.LoggerV2Impl.Infoln(args...) - } -} - -// WarningDepth logs to the WARNING log at the specified depth. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func WarningDepth(depth int, args ...any) { - if internal.DepthLoggerV2Impl != nil { - internal.DepthLoggerV2Impl.WarningDepth(depth, args...) - } else { - internal.LoggerV2Impl.Warningln(args...) - } -} - -// ErrorDepth logs to the ERROR log at the specified depth. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func ErrorDepth(depth int, args ...any) { - if internal.DepthLoggerV2Impl != nil { - internal.DepthLoggerV2Impl.ErrorDepth(depth, args...) - } else { - internal.LoggerV2Impl.Errorln(args...) - } -} - -// FatalDepth logs to the FATAL log at the specified depth. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func FatalDepth(depth int, args ...any) { - if internal.DepthLoggerV2Impl != nil { - internal.DepthLoggerV2Impl.FatalDepth(depth, args...) - } else { - internal.LoggerV2Impl.Fatalln(args...) - } - os.Exit(1) + grpclog.Logger.Infoln(args...) } diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go b/upstream/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go deleted file mode 100644 index 59c03bc14c2..00000000000 --- a/upstream/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package internal contains functionality internal to the grpclog package. -package internal - -// LoggerV2Impl is the logger used for the non-depth log functions. -var LoggerV2Impl LoggerV2 - -// DepthLoggerV2Impl is the logger used for the depth log functions. -var DepthLoggerV2Impl DepthLoggerV2 diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/internal/logger.go b/upstream/vendor/google.golang.org/grpc/grpclog/internal/logger.go deleted file mode 100644 index e524fdd40b2..00000000000 --- a/upstream/vendor/google.golang.org/grpc/grpclog/internal/logger.go +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package internal - -// Logger mimics golang's standard Logger as an interface. -// -// Deprecated: use LoggerV2. -type Logger interface { - Fatal(args ...any) - Fatalf(format string, args ...any) - Fatalln(args ...any) - Print(args ...any) - Printf(format string, args ...any) - Println(args ...any) -} - -// LoggerWrapper wraps Logger into a LoggerV2. -type LoggerWrapper struct { - Logger -} - -// Info logs to INFO log. Arguments are handled in the manner of fmt.Print. -func (l *LoggerWrapper) Info(args ...any) { - l.Logger.Print(args...) -} - -// Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. -func (l *LoggerWrapper) Infoln(args ...any) { - l.Logger.Println(args...) -} - -// Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. -func (l *LoggerWrapper) Infof(format string, args ...any) { - l.Logger.Printf(format, args...) -} - -// Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. -func (l *LoggerWrapper) Warning(args ...any) { - l.Logger.Print(args...) -} - -// Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. -func (l *LoggerWrapper) Warningln(args ...any) { - l.Logger.Println(args...) -} - -// Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. -func (l *LoggerWrapper) Warningf(format string, args ...any) { - l.Logger.Printf(format, args...) -} - -// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. -func (l *LoggerWrapper) Error(args ...any) { - l.Logger.Print(args...) -} - -// Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. -func (l *LoggerWrapper) Errorln(args ...any) { - l.Logger.Println(args...) -} - -// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. -func (l *LoggerWrapper) Errorf(format string, args ...any) { - l.Logger.Printf(format, args...) -} - -// V reports whether verbosity level l is at least the requested verbose level. -func (*LoggerWrapper) V(int) bool { - // Returns true for all verbose level. - return true -} diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/logger.go b/upstream/vendor/google.golang.org/grpc/grpclog/logger.go index 4b203585707..b1674d8267c 100644 --- a/upstream/vendor/google.golang.org/grpc/grpclog/logger.go +++ b/upstream/vendor/google.golang.org/grpc/grpclog/logger.go @@ -18,17 +18,70 @@ package grpclog -import "google.golang.org/grpc/grpclog/internal" +import "google.golang.org/grpc/internal/grpclog" // Logger mimics golang's standard Logger as an interface. // // Deprecated: use LoggerV2. -type Logger internal.Logger +type Logger interface { + Fatal(args ...any) + Fatalf(format string, args ...any) + Fatalln(args ...any) + Print(args ...any) + Printf(format string, args ...any) + Println(args ...any) +} // SetLogger sets the logger that is used in grpc. Call only from // init() functions. // // Deprecated: use SetLoggerV2. func SetLogger(l Logger) { - internal.LoggerV2Impl = &internal.LoggerWrapper{Logger: l} + grpclog.Logger = &loggerWrapper{Logger: l} +} + +// loggerWrapper wraps Logger into a LoggerV2. +type loggerWrapper struct { + Logger +} + +func (g *loggerWrapper) Info(args ...any) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Infoln(args ...any) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Infof(format string, args ...any) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Warning(args ...any) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Warningln(args ...any) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Warningf(format string, args ...any) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Error(args ...any) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Errorln(args ...any) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Errorf(format string, args ...any) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) V(l int) bool { + // Returns true for all verbose level. + return true } diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/loggerv2.go b/upstream/vendor/google.golang.org/grpc/grpclog/loggerv2.go index 892dc13d164..ecfd36d7130 100644 --- a/upstream/vendor/google.golang.org/grpc/grpclog/loggerv2.go +++ b/upstream/vendor/google.golang.org/grpc/grpclog/loggerv2.go @@ -19,16 +19,52 @@ package grpclog import ( + "encoding/json" + "fmt" "io" + "log" "os" "strconv" "strings" - "google.golang.org/grpc/grpclog/internal" + "google.golang.org/grpc/internal/grpclog" ) // LoggerV2 does underlying logging work for grpclog. -type LoggerV2 internal.LoggerV2 +type LoggerV2 interface { + // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. + Info(args ...any) + // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. + Infoln(args ...any) + // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. + Infof(format string, args ...any) + // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. + Warning(args ...any) + // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. + Warningln(args ...any) + // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. + Warningf(format string, args ...any) + // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. + Error(args ...any) + // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + Errorln(args ...any) + // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + Errorf(format string, args ...any) + // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatal(args ...any) + // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalln(args ...any) + // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalf(format string, args ...any) + // V reports whether verbosity level l is at least the requested verbose level. + V(l int) bool +} // SetLoggerV2 sets logger that is used in grpc to a V2 logger. // Not mutex-protected, should be called before any gRPC functions. @@ -36,8 +72,34 @@ func SetLoggerV2(l LoggerV2) { if _, ok := l.(*componentData); ok { panic("cannot use component logger as grpclog logger") } - internal.LoggerV2Impl = l - internal.DepthLoggerV2Impl, _ = l.(internal.DepthLoggerV2) + grpclog.Logger = l + grpclog.DepthLogger, _ = l.(grpclog.DepthLoggerV2) +} + +const ( + // infoLog indicates Info severity. + infoLog int = iota + // warningLog indicates Warning severity. + warningLog + // errorLog indicates Error severity. + errorLog + // fatalLog indicates Fatal severity. + fatalLog +) + +// severityName contains the string representation of each severity. +var severityName = []string{ + infoLog: "INFO", + warningLog: "WARNING", + errorLog: "ERROR", + fatalLog: "FATAL", +} + +// loggerT is the default logger used by grpclog. +type loggerT struct { + m []*log.Logger + v int + jsonFormat bool } // NewLoggerV2 creates a loggerV2 with the provided writers. @@ -46,13 +108,32 @@ func SetLoggerV2(l LoggerV2) { // Warning logs will be written to warningW and infoW. // Info logs will be written to infoW. func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2 { - return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{}) + return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{}) } // NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and // verbosity level. func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2 { - return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{Verbosity: v}) + return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{verbose: v}) +} + +type loggerV2Config struct { + verbose int + jsonFormat bool +} + +func newLoggerV2WithConfig(infoW, warningW, errorW io.Writer, c loggerV2Config) LoggerV2 { + var m []*log.Logger + flag := log.LstdFlags + if c.jsonFormat { + flag = 0 + } + m = append(m, log.New(infoW, "", flag)) + m = append(m, log.New(io.MultiWriter(infoW, warningW), "", flag)) + ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. + m = append(m, log.New(ew, "", flag)) + m = append(m, log.New(ew, "", flag)) + return &loggerT{m: m, v: c.verbose, jsonFormat: c.jsonFormat} } // newLoggerV2 creates a loggerV2 to be used as default logger. @@ -80,10 +161,80 @@ func newLoggerV2() LoggerV2 { jsonFormat := strings.EqualFold(os.Getenv("GRPC_GO_LOG_FORMATTER"), "json") - return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{ - Verbosity: v, - FormatJSON: jsonFormat, + return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{ + verbose: v, + jsonFormat: jsonFormat, + }) +} + +func (g *loggerT) output(severity int, s string) { + sevStr := severityName[severity] + if !g.jsonFormat { + g.m[severity].Output(2, fmt.Sprintf("%v: %v", sevStr, s)) + return + } + // TODO: we can also include the logging component, but that needs more + // (API) changes. + b, _ := json.Marshal(map[string]string{ + "severity": sevStr, + "message": s, }) + g.m[severity].Output(2, string(b)) +} + +func (g *loggerT) Info(args ...any) { + g.output(infoLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Infoln(args ...any) { + g.output(infoLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Infof(format string, args ...any) { + g.output(infoLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Warning(args ...any) { + g.output(warningLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Warningln(args ...any) { + g.output(warningLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Warningf(format string, args ...any) { + g.output(warningLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Error(args ...any) { + g.output(errorLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Errorln(args ...any) { + g.output(errorLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Errorf(format string, args ...any) { + g.output(errorLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Fatal(args ...any) { + g.output(fatalLog, fmt.Sprint(args...)) + os.Exit(1) +} + +func (g *loggerT) Fatalln(args ...any) { + g.output(fatalLog, fmt.Sprintln(args...)) + os.Exit(1) +} + +func (g *loggerT) Fatalf(format string, args ...any) { + g.output(fatalLog, fmt.Sprintf(format, args...)) + os.Exit(1) +} + +func (g *loggerT) V(l int) bool { + return l <= g.v } // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements @@ -94,4 +245,14 @@ func newLoggerV2() LoggerV2 { // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. -type DepthLoggerV2 internal.DepthLoggerV2 +type DepthLoggerV2 interface { + LoggerV2 + // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println. + InfoDepth(depth int, args ...any) + // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println. + WarningDepth(depth int, args ...any) + // ErrorDepth logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Println. + ErrorDepth(depth int, args ...any) + // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println. + FatalDepth(depth int, args ...any) +} diff --git a/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go index d92335445f6..5bf880d4190 100644 --- a/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ b/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.2 // source: grpc/health/v1/health.proto package grpc_health_v1 @@ -237,7 +237,7 @@ func file_grpc_health_v1_health_proto_rawDescGZIP() []byte { var file_grpc_health_v1_health_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_grpc_health_v1_health_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_health_v1_health_proto_goTypes = []any{ +var file_grpc_health_v1_health_proto_goTypes = []interface{}{ (HealthCheckResponse_ServingStatus)(0), // 0: grpc.health.v1.HealthCheckResponse.ServingStatus (*HealthCheckRequest)(nil), // 1: grpc.health.v1.HealthCheckRequest (*HealthCheckResponse)(nil), // 2: grpc.health.v1.HealthCheckResponse @@ -261,7 +261,7 @@ func file_grpc_health_v1_health_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_health_v1_health_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_grpc_health_v1_health_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthCheckRequest); i { case 0: return &v.state @@ -273,7 +273,7 @@ func file_grpc_health_v1_health_proto_init() { return nil } } - file_grpc_health_v1_health_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_grpc_health_v1_health_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthCheckResponse); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go b/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go index f96b8ab4927..4c46c098dc6 100644 --- a/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go +++ b/upstream/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.1 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 // source: grpc/health/v1/health.proto package grpc_health_v1 @@ -32,8 +32,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 const ( Health_Check_FullMethodName = "/grpc.health.v1.Health/Check" @@ -43,10 +43,6 @@ const ( // HealthClient is the client API for Health service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Health is gRPC's mechanism for checking whether a server is able to handle -// RPCs. Its semantics are documented in -// https://github.com/grpc/grpc/blob/master/doc/health-checking.md. type HealthClient interface { // Check gets the health of the specified service. If the requested service // is unknown, the call will fail with status NOT_FOUND. If the caller does @@ -73,7 +69,7 @@ type HealthClient interface { // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. - Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) + Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) } type healthClient struct { @@ -85,22 +81,20 @@ func NewHealthClient(cc grpc.ClientConnInterface) HealthClient { } func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, cOpts...) +func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) { + stream, err := c.cc.NewStream(ctx, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[HealthCheckRequest, HealthCheckResponse]{ClientStream: stream} + x := &healthWatchClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -110,16 +104,26 @@ func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts . return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Health_WatchClient = grpc.ServerStreamingClient[HealthCheckResponse] +type Health_WatchClient interface { + Recv() (*HealthCheckResponse, error) + grpc.ClientStream +} + +type healthWatchClient struct { + grpc.ClientStream +} + +func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) { + m := new(HealthCheckResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // HealthServer is the server API for Health service. // All implementations should embed UnimplementedHealthServer -// for forward compatibility. -// -// Health is gRPC's mechanism for checking whether a server is able to handle -// RPCs. Its semantics are documented in -// https://github.com/grpc/grpc/blob/master/doc/health-checking.md. +// for forward compatibility type HealthServer interface { // Check gets the health of the specified service. If the requested service // is unknown, the call will fail with status NOT_FOUND. If the caller does @@ -146,23 +150,19 @@ type HealthServer interface { // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. - Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error + Watch(*HealthCheckRequest, Health_WatchServer) error } -// UnimplementedHealthServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedHealthServer struct{} +// UnimplementedHealthServer should be embedded to have forward compatible implementations. +type UnimplementedHealthServer struct { +} func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") } -func (UnimplementedHealthServer) Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error { +func (UnimplementedHealthServer) Watch(*HealthCheckRequest, Health_WatchServer) error { return status.Errorf(codes.Unimplemented, "method Watch not implemented") } -func (UnimplementedHealthServer) testEmbeddedByValue() {} // UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to HealthServer will @@ -172,13 +172,6 @@ type UnsafeHealthServer interface { } func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) { - // If the following call panics, it indicates UnimplementedHealthServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&Health_ServiceDesc, srv) } @@ -205,11 +198,21 @@ func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { if err := stream.RecvMsg(m); err != nil { return err } - return srv.(HealthServer).Watch(m, &grpc.GenericServerStream[HealthCheckRequest, HealthCheckResponse]{ServerStream: stream}) + return srv.(HealthServer).Watch(m, &healthWatchServer{stream}) +} + +type Health_WatchServer interface { + Send(*HealthCheckResponse) error + grpc.ServerStream +} + +type healthWatchServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Health_WatchServer = grpc.ServerStreamingServer[HealthCheckResponse] +func (x *healthWatchServer) Send(m *HealthCheckResponse) error { + return x.ServerStream.SendMsg(m) +} // Health_ServiceDesc is the grpc.ServiceDesc for Health service. // It's only intended for direct use with grpc.RegisterService, diff --git a/upstream/vendor/google.golang.org/grpc/internal/backoff/backoff.go b/upstream/vendor/google.golang.org/grpc/internal/backoff/backoff.go index b15cf482d29..fed1c011a32 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/backoff/backoff.go +++ b/upstream/vendor/google.golang.org/grpc/internal/backoff/backoff.go @@ -25,10 +25,10 @@ package backoff import ( "context" "errors" - "math/rand" "time" grpcbackoff "google.golang.org/grpc/backoff" + "google.golang.org/grpc/internal/grpcrand" ) // Strategy defines the methodology for backing off after a grpc connection @@ -67,7 +67,7 @@ func (bc Exponential) Backoff(retries int) time.Duration { } // Randomize backoff delays so that if a cluster of requests start at // the same time, they won't operate in lockstep. - backoff *= 1 + bc.Config.Jitter*(rand.Float64()*2-1) + backoff *= 1 + bc.Config.Jitter*(grpcrand.Float64()*2-1) if backoff < 0 { return 0 } diff --git a/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go b/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go index 13821a92660..6bf7f87396f 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go +++ b/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go @@ -75,6 +75,7 @@ func ParseConfig(cfg json.RawMessage) (serviceconfig.LoadBalancingConfig, error) if err != nil { return nil, fmt.Errorf("error parsing config for policy %q: %v", name, err) } + return &lbConfig{childBuilder: builder, childConfig: cfg}, nil } diff --git a/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go b/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go index 73bb4c4ee9a..45d5e50ea9b 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go +++ b/upstream/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go @@ -169,6 +169,7 @@ func (gsb *Balancer) latestBalancer() *balancerWrapper { func (gsb *Balancer) UpdateClientConnState(state balancer.ClientConnState) error { // The resolver data is only relevant to the most recent LB Policy. balToUpdate := gsb.latestBalancer() + gsbCfg, ok := state.BalancerConfig.(*lbConfig) if ok { // Switch to the child in the config unless it is already active. diff --git a/upstream/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go b/upstream/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go index 9669328914a..e8456a77c25 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go +++ b/upstream/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go @@ -65,7 +65,7 @@ type TruncatingMethodLogger struct { callID uint64 idWithinCallGen *callIDGenerator - sink Sink // TODO(blog): make this pluggable. + sink Sink // TODO(blog): make this plugable. } // NewTruncatingMethodLogger returns a new truncating method logger. @@ -80,7 +80,7 @@ func NewTruncatingMethodLogger(h, m uint64) *TruncatingMethodLogger { callID: idGen.next(), idWithinCallGen: &callIDGenerator{}, - sink: DefaultSink, // TODO(blog): make it pluggable. + sink: DefaultSink, // TODO(blog): make it plugable. } } @@ -106,7 +106,7 @@ func (ml *TruncatingMethodLogger) Build(c LogEntryConfig) *binlogpb.GrpcLogEntry } // Log creates a proto binary log entry, and logs it to the sink. -func (ml *TruncatingMethodLogger) Log(_ context.Context, c LogEntryConfig) { +func (ml *TruncatingMethodLogger) Log(ctx context.Context, c LogEntryConfig) { ml.sink.Write(ml.Build(c)) } @@ -397,7 +397,7 @@ func metadataKeyOmit(key string) bool { switch key { case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te": return true - case "grpc-trace-bin": // grpc-trace-bin is special because it's visible to users. + case "grpc-trace-bin": // grpc-trace-bin is special because it's visiable to users. return false } return strings.HasPrefix(key, "grpc-") diff --git a/upstream/vendor/google.golang.org/grpc/internal/channelz/channelmap.go b/upstream/vendor/google.golang.org/grpc/internal/channelz/channelmap.go index 64c791953d0..dfe18b08925 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/channelz/channelmap.go +++ b/upstream/vendor/google.golang.org/grpc/internal/channelz/channelmap.go @@ -46,7 +46,7 @@ type entry interface { // channelMap is the storage data structure for channelz. // -// Methods of channelMap can be divided into two categories with respect to +// Methods of channelMap can be divided in two two categories with respect to // locking. // // 1. Methods acquire the global lock. @@ -234,6 +234,13 @@ func copyMap(m map[int64]string) map[int64]string { return n } +func min(a, b int) int { + if a < b { + return a + } + return b +} + func (c *channelMap) getTopChannels(id int64, maxResults int) ([]*Channel, bool) { if maxResults <= 0 { maxResults = EntriesPerPage diff --git a/upstream/vendor/google.golang.org/grpc/internal/channelz/funcs.go b/upstream/vendor/google.golang.org/grpc/internal/channelz/funcs.go index 078bb81238b..03e24e1507a 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/channelz/funcs.go +++ b/upstream/vendor/google.golang.org/grpc/internal/channelz/funcs.go @@ -33,7 +33,7 @@ var ( // outside this package except by tests. IDGen IDGenerator - db = newChannelMap() + db *channelMap = newChannelMap() // EntriesPerPage defines the number of channelz entries to be shown on a web page. EntriesPerPage = 50 curState int32 diff --git a/upstream/vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go b/upstream/vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go index 0e6e18e185c..d1ed8df6a51 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go +++ b/upstream/vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go @@ -35,13 +35,13 @@ type SocketOptionData struct { // Getsockopt defines the function to get socket options requested by channelz. // It is to be passed to syscall.RawConn.Control(). // Windows OS doesn't support Socket Option -func (s *SocketOptionData) Getsockopt(uintptr) { +func (s *SocketOptionData) Getsockopt(fd uintptr) { once.Do(func() { logger.Warning("Channelz: socket options are not supported on non-linux environments") }) } // GetSocketOption gets the socket option info of the conn. -func GetSocketOption(any) *SocketOptionData { +func GetSocketOption(c any) *SocketOptionData { return nil } diff --git a/upstream/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/upstream/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 452985f8d8f..685a3cb41b1 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/upstream/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -28,6 +28,9 @@ import ( var ( // TXTErrIgnore is set if TXT errors should be ignored ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false"). TXTErrIgnore = boolFromEnv("GRPC_GO_IGNORE_TXT_ERRORS", true) + // AdvertiseCompressors is set if registered compressor should be advertised + // ("GRPC_GO_ADVERTISE_COMPRESSORS" is not "false"). + AdvertiseCompressors = boolFromEnv("GRPC_GO_ADVERTISE_COMPRESSORS", true) // RingHashCap indicates the maximum ring size which defaults to 4096 // entries but may be overridden by setting the environment variable // "GRPC_RING_HASH_CAP". This does not override the default bounds @@ -40,16 +43,6 @@ var ( // ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS // handshakes that can be performed. ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100) - // EnforceALPNEnabled is set if TLS connections to servers with ALPN disabled - // should be rejected. The HTTP/2 protocol requires ALPN to be enabled, this - // option is present for backward compatibility. This option may be overridden - // by setting the environment variable "GRPC_ENFORCE_ALPN_ENABLED" to "true" - // or "false". - EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", true) - // XDSFallbackSupport is the env variable that controls whether support for - // xDS fallback is turned on. If this is unset or is false, only the first - // xDS server in the list of server configs will be used. - XDSFallbackSupport = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK", false) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/upstream/vendor/google.golang.org/grpc/internal/experimental.go b/upstream/vendor/google.golang.org/grpc/internal/experimental.go index 7617be21589..7f7044e1731 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/experimental.go +++ b/upstream/vendor/google.golang.org/grpc/internal/experimental.go @@ -18,11 +18,11 @@ package internal var ( - // WithBufferPool is implemented by the grpc package and returns a dial + // WithRecvBufferPool is implemented by the grpc package and returns a dial // option to configure a shared buffer pool for a grpc.ClientConn. - WithBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption + WithRecvBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption - // BufferPool is implemented by the grpc package and returns a server + // RecvBufferPool is implemented by the grpc package and returns a server // option to configure a shared buffer pool for a grpc.Server. - BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption + RecvBufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption ) diff --git a/upstream/vendor/google.golang.org/grpc/internal/googlecloud/googlecloud.go b/upstream/vendor/google.golang.org/grpc/internal/googlecloud/googlecloud.go index 43423d8ad9a..6717b757f80 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/googlecloud/googlecloud.go +++ b/upstream/vendor/google.golang.org/grpc/internal/googlecloud/googlecloud.go @@ -62,9 +62,9 @@ func isRunningOnGCE(manufacturer []byte, goos string) bool { name = strings.TrimSpace(name) return name == "Google" || name == "Google Compute Engine" case "windows": - name = strings.ReplaceAll(name, " ", "") - name = strings.ReplaceAll(name, "\n", "") - name = strings.ReplaceAll(name, "\r", "") + name = strings.Replace(name, " ", "", -1) + name = strings.Replace(name, "\n", "", -1) + name = strings.Replace(name, "\r", "", -1) return name == "Google" default: return false diff --git a/upstream/vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go b/upstream/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go similarity index 52% rename from upstream/vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go rename to upstream/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go index 07df71e98a8..bfc45102ab2 100644 --- a/upstream/vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go +++ b/upstream/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go @@ -1,6 +1,6 @@ /* * - * Copyright 2024 gRPC authors. + * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +16,59 @@ * */ -package internal +// Package grpclog (internal) defines depth logging for grpc. +package grpclog import ( - "encoding/json" - "fmt" - "io" - "log" "os" ) +// Logger is the logger used for the non-depth log functions. +var Logger LoggerV2 + +// DepthLogger is the logger used for the depth log functions. +var DepthLogger DepthLoggerV2 + +// InfoDepth logs to the INFO log at the specified depth. +func InfoDepth(depth int, args ...any) { + if DepthLogger != nil { + DepthLogger.InfoDepth(depth, args...) + } else { + Logger.Infoln(args...) + } +} + +// WarningDepth logs to the WARNING log at the specified depth. +func WarningDepth(depth int, args ...any) { + if DepthLogger != nil { + DepthLogger.WarningDepth(depth, args...) + } else { + Logger.Warningln(args...) + } +} + +// ErrorDepth logs to the ERROR log at the specified depth. +func ErrorDepth(depth int, args ...any) { + if DepthLogger != nil { + DepthLogger.ErrorDepth(depth, args...) + } else { + Logger.Errorln(args...) + } +} + +// FatalDepth logs to the FATAL log at the specified depth. +func FatalDepth(depth int, args ...any) { + if DepthLogger != nil { + DepthLogger.FatalDepth(depth, args...) + } else { + Logger.Fatalln(args...) + } + os.Exit(1) +} + // LoggerV2 does underlying logging work for grpclog. +// This is a copy of the LoggerV2 defined in the external grpclog package. It +// is defined here to avoid a circular dependency. type LoggerV2 interface { // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. Info(args ...any) @@ -65,13 +107,14 @@ type LoggerV2 interface { // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements // DepthLoggerV2, the below functions will be called with the appropriate stack // depth set for trivial functions the logger may ignore. +// This is a copy of the DepthLoggerV2 defined in the external grpclog package. +// It is defined here to avoid a circular dependency. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type DepthLoggerV2 interface { - LoggerV2 // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println. InfoDepth(depth int, args ...any) // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println. @@ -81,124 +124,3 @@ type DepthLoggerV2 interface { // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println. FatalDepth(depth int, args ...any) } - -const ( - // infoLog indicates Info severity. - infoLog int = iota - // warningLog indicates Warning severity. - warningLog - // errorLog indicates Error severity. - errorLog - // fatalLog indicates Fatal severity. - fatalLog -) - -// severityName contains the string representation of each severity. -var severityName = []string{ - infoLog: "INFO", - warningLog: "WARNING", - errorLog: "ERROR", - fatalLog: "FATAL", -} - -// loggerT is the default logger used by grpclog. -type loggerT struct { - m []*log.Logger - v int - jsonFormat bool -} - -func (g *loggerT) output(severity int, s string) { - sevStr := severityName[severity] - if !g.jsonFormat { - g.m[severity].Output(2, fmt.Sprintf("%v: %v", sevStr, s)) - return - } - // TODO: we can also include the logging component, but that needs more - // (API) changes. - b, _ := json.Marshal(map[string]string{ - "severity": sevStr, - "message": s, - }) - g.m[severity].Output(2, string(b)) -} - -func (g *loggerT) Info(args ...any) { - g.output(infoLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Infoln(args ...any) { - g.output(infoLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Infof(format string, args ...any) { - g.output(infoLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Warning(args ...any) { - g.output(warningLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Warningln(args ...any) { - g.output(warningLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Warningf(format string, args ...any) { - g.output(warningLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Error(args ...any) { - g.output(errorLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Errorln(args ...any) { - g.output(errorLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Errorf(format string, args ...any) { - g.output(errorLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Fatal(args ...any) { - g.output(fatalLog, fmt.Sprint(args...)) - os.Exit(1) -} - -func (g *loggerT) Fatalln(args ...any) { - g.output(fatalLog, fmt.Sprintln(args...)) - os.Exit(1) -} - -func (g *loggerT) Fatalf(format string, args ...any) { - g.output(fatalLog, fmt.Sprintf(format, args...)) - os.Exit(1) -} - -func (g *loggerT) V(l int) bool { - return l <= g.v -} - -// LoggerV2Config configures the LoggerV2 implementation. -type LoggerV2Config struct { - // Verbosity sets the verbosity level of the logger. - Verbosity int - // FormatJSON controls whether the logger should output logs in JSON format. - FormatJSON bool -} - -// NewLoggerV2 creates a new LoggerV2 instance with the provided configuration. -// The infoW, warningW, and errorW writers are used to write log messages of -// different severity levels. -func NewLoggerV2(infoW, warningW, errorW io.Writer, c LoggerV2Config) LoggerV2 { - var m []*log.Logger - flag := log.LstdFlags - if c.FormatJSON { - flag = 0 - } - m = append(m, log.New(infoW, "", flag)) - m = append(m, log.New(io.MultiWriter(infoW, warningW), "", flag)) - ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. - m = append(m, log.New(ew, "", flag)) - m = append(m, log.New(ew, "", flag)) - return &loggerT{m: m, v: c.Verbosity, jsonFormat: c.FormatJSON} -} diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go b/upstream/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go similarity index 63% rename from upstream/vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go rename to upstream/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go index 092ad187a2c..faa998de763 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go +++ b/upstream/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go @@ -16,21 +16,17 @@ * */ -// Package grpclog provides logging functionality for internal gRPC packages, -// outside of the functionality provided by the external `grpclog` package. package grpclog import ( "fmt" - - "google.golang.org/grpc/grpclog" ) // PrefixLogger does logging with a prefix. // // Logging method on a nil logs without any prefix. type PrefixLogger struct { - logger grpclog.DepthLoggerV2 + logger DepthLoggerV2 prefix string } @@ -42,7 +38,7 @@ func (pl *PrefixLogger) Infof(format string, args ...any) { pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) return } - grpclog.InfoDepth(1, fmt.Sprintf(format, args...)) + InfoDepth(1, fmt.Sprintf(format, args...)) } // Warningf does warning logging. @@ -52,7 +48,7 @@ func (pl *PrefixLogger) Warningf(format string, args ...any) { pl.logger.WarningDepth(1, fmt.Sprintf(format, args...)) return } - grpclog.WarningDepth(1, fmt.Sprintf(format, args...)) + WarningDepth(1, fmt.Sprintf(format, args...)) } // Errorf does error logging. @@ -62,18 +58,36 @@ func (pl *PrefixLogger) Errorf(format string, args ...any) { pl.logger.ErrorDepth(1, fmt.Sprintf(format, args...)) return } - grpclog.ErrorDepth(1, fmt.Sprintf(format, args...)) + ErrorDepth(1, fmt.Sprintf(format, args...)) } -// V reports whether verbosity level l is at least the requested verbose level. -func (pl *PrefixLogger) V(l int) bool { +// Debugf does info logging at verbose level 2. +func (pl *PrefixLogger) Debugf(format string, args ...any) { + // TODO(6044): Refactor interfaces LoggerV2 and DepthLogger, and maybe + // rewrite PrefixLogger a little to ensure that we don't use the global + // `Logger` here, and instead use the `logger` field. + if !Logger.V(2) { + return + } if pl != nil { - return pl.logger.V(l) + // Handle nil, so the tests can pass in a nil logger. + format = pl.prefix + format + pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) + return } - return true + InfoDepth(1, fmt.Sprintf(format, args...)) + +} + +// V reports whether verbosity level l is at least the requested verbose level. +func (pl *PrefixLogger) V(l int) bool { + // TODO(6044): Refactor interfaces LoggerV2 and DepthLogger, and maybe + // rewrite PrefixLogger a little to ensure that we don't use the global + // `Logger` here, and instead use the `logger` field. + return Logger.V(l) } // NewPrefixLogger creates a prefix logger with the given prefix. -func NewPrefixLogger(logger grpclog.DepthLoggerV2, prefix string) *PrefixLogger { +func NewPrefixLogger(logger DepthLoggerV2, prefix string) *PrefixLogger { return &PrefixLogger{logger: logger, prefix: prefix} } diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go new file mode 100644 index 00000000000..0126d6b5108 --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go @@ -0,0 +1,100 @@ +//go:build !go1.21 + +// TODO: when this file is deleted (after Go 1.20 support is dropped), delete +// all of grpcrand and call the rand package directly. + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpcrand implements math/rand functions in a concurrent-safe way +// with a global random source, independent of math/rand's global source. +package grpcrand + +import ( + "math/rand" + "sync" + "time" +) + +var ( + r = rand.New(rand.NewSource(time.Now().UnixNano())) + mu sync.Mutex +) + +// Int implements rand.Int on the grpcrand global source. +func Int() int { + mu.Lock() + defer mu.Unlock() + return r.Int() +} + +// Int63n implements rand.Int63n on the grpcrand global source. +func Int63n(n int64) int64 { + mu.Lock() + defer mu.Unlock() + return r.Int63n(n) +} + +// Intn implements rand.Intn on the grpcrand global source. +func Intn(n int) int { + mu.Lock() + defer mu.Unlock() + return r.Intn(n) +} + +// Int31n implements rand.Int31n on the grpcrand global source. +func Int31n(n int32) int32 { + mu.Lock() + defer mu.Unlock() + return r.Int31n(n) +} + +// Float64 implements rand.Float64 on the grpcrand global source. +func Float64() float64 { + mu.Lock() + defer mu.Unlock() + return r.Float64() +} + +// Uint64 implements rand.Uint64 on the grpcrand global source. +func Uint64() uint64 { + mu.Lock() + defer mu.Unlock() + return r.Uint64() +} + +// Uint32 implements rand.Uint32 on the grpcrand global source. +func Uint32() uint32 { + mu.Lock() + defer mu.Unlock() + return r.Uint32() +} + +// ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source. +func ExpFloat64() float64 { + mu.Lock() + defer mu.Unlock() + return r.ExpFloat64() +} + +// Shuffle implements rand.Shuffle on the grpcrand global source. +var Shuffle = func(n int, f func(int, int)) { + mu.Lock() + defer mu.Unlock() + r.Shuffle(n, f) +} diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go b/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go new file mode 100644 index 00000000000..c37299af1ef --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go @@ -0,0 +1,73 @@ +//go:build go1.21 + +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpcrand implements math/rand functions in a concurrent-safe way +// with a global random source, independent of math/rand's global source. +package grpcrand + +import "math/rand" + +// This implementation will be used for Go version 1.21 or newer. +// For older versions, the original implementation with mutex will be used. + +// Int implements rand.Int on the grpcrand global source. +func Int() int { + return rand.Int() +} + +// Int63n implements rand.Int63n on the grpcrand global source. +func Int63n(n int64) int64 { + return rand.Int63n(n) +} + +// Intn implements rand.Intn on the grpcrand global source. +func Intn(n int) int { + return rand.Intn(n) +} + +// Int31n implements rand.Int31n on the grpcrand global source. +func Int31n(n int32) int32 { + return rand.Int31n(n) +} + +// Float64 implements rand.Float64 on the grpcrand global source. +func Float64() float64 { + return rand.Float64() +} + +// Uint64 implements rand.Uint64 on the grpcrand global source. +func Uint64() uint64 { + return rand.Uint64() +} + +// Uint32 implements rand.Uint32 on the grpcrand global source. +func Uint32() uint32 { + return rand.Uint32() +} + +// ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source. +func ExpFloat64() float64 { + return rand.ExpFloat64() +} + +// Shuffle implements rand.Shuffle on the grpcrand global source. +var Shuffle = func(n int, f func(int, int)) { + rand.Shuffle(n, f) +} diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/upstream/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index 19b9d639275..f7f40a16ace 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/upstream/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -53,28 +53,16 @@ func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { return cs } -// TrySchedule tries to schedules the provided callback function f to be -// executed in the order it was added. This is a best-effort operation. If the -// context passed to NewCallbackSerializer was canceled before this method is -// called, the callback will not be scheduled. +// Schedule adds a callback to be scheduled after existing callbacks are run. // // Callbacks are expected to honor the context when performing any blocking // operations, and should return early when the context is canceled. -func (cs *CallbackSerializer) TrySchedule(f func(ctx context.Context)) { - cs.callbacks.Put(f) -} - -// ScheduleOr schedules the provided callback function f to be executed in the -// order it was added. If the context passed to NewCallbackSerializer has been -// canceled before this method is called, the onFailure callback will be -// executed inline instead. // -// Callbacks are expected to honor the context when performing any blocking -// operations, and should return early when the context is canceled. -func (cs *CallbackSerializer) ScheduleOr(f func(ctx context.Context), onFailure func()) { - if cs.callbacks.Put(f) != nil { - onFailure() - } +// Return value indicates if the callback was successfully added to the list of +// callbacks to be executed by the serializer. It is not possible to add +// callbacks once the context passed to NewCallbackSerializer is cancelled. +func (cs *CallbackSerializer) Schedule(f func(ctx context.Context)) bool { + return cs.callbacks.Put(f) == nil } func (cs *CallbackSerializer) run(ctx context.Context) { diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go b/upstream/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go index 6d8c2f518df..aef8cec1ab0 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go +++ b/upstream/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go @@ -77,7 +77,7 @@ func (ps *PubSub) Subscribe(sub Subscriber) (cancel func()) { if ps.msg != nil { msg := ps.msg - ps.cs.TrySchedule(func(context.Context) { + ps.cs.Schedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[sub] { @@ -103,7 +103,7 @@ func (ps *PubSub) Publish(msg any) { ps.msg = msg for sub := range ps.subscribers { s := sub - ps.cs.TrySchedule(func(context.Context) { + ps.cs.Schedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[s] { diff --git a/upstream/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go b/upstream/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go index e8d866984b3..9f409096798 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go +++ b/upstream/vendor/google.golang.org/grpc/internal/grpcutil/compressor.go @@ -20,6 +20,8 @@ package grpcutil import ( "strings" + + "google.golang.org/grpc/internal/envconfig" ) // RegisteredCompressorNames holds names of the registered compressors. @@ -38,5 +40,8 @@ func IsCompressorNameRegistered(name string) bool { // RegisteredCompressors returns a string of registered compressor names // separated by comma. func RegisteredCompressors() string { + if !envconfig.AdvertiseCompressors { + return "" + } return strings.Join(RegisteredCompressorNames, ",") } diff --git a/upstream/vendor/google.golang.org/grpc/internal/internal.go b/upstream/vendor/google.golang.org/grpc/internal/internal.go index 7aae9240ffc..48d24bdb4e6 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/internal.go +++ b/upstream/vendor/google.golang.org/grpc/internal/internal.go @@ -106,14 +106,6 @@ var ( // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. ClearGlobalDialOptions func() - - // AddGlobalPerTargetDialOptions adds a PerTargetDialOption that will be - // configured for newly created ClientConns. - AddGlobalPerTargetDialOptions any // func (opt any) - // ClearGlobalPerTargetDialOptions clears the slice of global late apply - // dial options. - ClearGlobalPerTargetDialOptions func() - // JoinDialOptions combines the dial options passed as arguments into a // single dial option. JoinDialOptions any // func(...grpc.DialOption) grpc.DialOption @@ -134,8 +126,7 @@ var ( // deleted or changed. BinaryLogger any // func(binarylog.Logger) grpc.ServerOption - // SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a - // provided grpc.ClientConn. + // SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a provided grpc.ClientConn SubscribeToConnectivityStateChanges any // func(*grpc.ClientConn, grpcsync.Subscriber) // NewXDSResolverWithConfigForTesting creates a new xds resolver builder using @@ -183,7 +174,7 @@ var ( // GRPCResolverSchemeExtraMetadata determines when gRPC will add extra // metadata to RPCs. - GRPCResolverSchemeExtraMetadata = "xds" + GRPCResolverSchemeExtraMetadata string = "xds" // EnterIdleModeForTesting gets the ClientConn to enter IDLE mode. EnterIdleModeForTesting any // func(*grpc.ClientConn) @@ -193,45 +184,25 @@ var ( ChannelzTurnOffForTesting func() - // TriggerXDSResourceNotFoundForTesting causes the provided xDS Client to - // invoke resource-not-found error for the given resource type and name. - TriggerXDSResourceNotFoundForTesting any // func(xdsclient.XDSClient, xdsresource.Type, string) error - - // FromOutgoingContextRaw returns the un-merged, intermediary contents of - // metadata.rawMD. - FromOutgoingContextRaw any // func(context.Context) (metadata.MD, [][]string, bool) - - // UserSetDefaultScheme is set to true if the user has overridden the - // default resolver scheme. - UserSetDefaultScheme = false + // TriggerXDSResourceNameNotFoundForTesting triggers the resource-not-found + // error for a given resource type and name. This is usually triggered when + // the associated watch timer fires. For testing purposes, having this + // function makes events more predictable than relying on timer events. + TriggerXDSResourceNameNotFoundForTesting any // func(func(xdsresource.Type, string), string, string) error - // ShuffleAddressListForTesting pseudo-randomizes the order of addresses. n - // is the number of elements. swap swaps the elements with indexes i and j. - ShuffleAddressListForTesting any // func(n int, swap func(i, j int)) + // TriggerXDSResourceNameNotFoundClient invokes the testing xDS Client + // singleton to invoke resource not found for a resource type name and + // resource name. + TriggerXDSResourceNameNotFoundClient any // func(string, string) error - // ConnectedAddress returns the connected address for a SubConnState. The - // address is only valid if the state is READY. - ConnectedAddress any // func (scs SubConnState) resolver.Address - - // SetConnectedAddress sets the connected address for a SubConnState. - SetConnectedAddress any // func(scs *SubConnState, addr resolver.Address) - - // SnapshotMetricRegistryForTesting snapshots the global data of the metric - // registry. Returns a cleanup function that sets the metric registry to its - // original state. Only called in testing functions. - SnapshotMetricRegistryForTesting func() func() - - // SetDefaultBufferPoolForTesting updates the default buffer pool, for - // testing purposes. - SetDefaultBufferPoolForTesting any // func(mem.BufferPool) + // FromOutgoingContextRaw returns the un-merged, intermediary contents of metadata.rawMD. + FromOutgoingContextRaw any // func(context.Context) (metadata.MD, [][]string, bool) - // SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for - // testing purposes. - SetBufferPoolingThresholdForTesting any // func(int) + // UserSetDefaultScheme is set to true if the user has overridden the default resolver scheme. + UserSetDefaultScheme bool = false ) -// HealthChecker defines the signature of the client-side LB channel health -// checking function. +// HealthChecker defines the signature of the client-side LB channel health checking function. // // The implementation is expected to create a health checking RPC stream by // calling newStream(), watch for the health status of serviceName, and report diff --git a/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index 4552db16b02..abab35e250e 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go +++ b/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -24,7 +24,6 @@ import ( "context" "encoding/json" "fmt" - "math/rand" "net" "os" "strconv" @@ -36,35 +35,28 @@ import ( "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/resolver/dns/internal" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) -var ( - // EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB - // addresses from SRV records. Must not be changed after init time. - EnableSRVLookups = false +// EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB +// addresses from SRV records. Must not be changed after init time. +var EnableSRVLookups = false - // MinResolutionInterval is the minimum interval at which re-resolutions are - // allowed. This helps to prevent excessive re-resolution. - MinResolutionInterval = 30 * time.Second +// ResolvingTimeout specifies the maximum duration for a DNS resolution request. +// If the timeout expires before a response is received, the request will be canceled. +// +// It is recommended to set this value at application startup. Avoid modifying this variable +// after initialization as it's not thread-safe for concurrent modification. +var ResolvingTimeout = 30 * time.Second - // ResolvingTimeout specifies the maximum duration for a DNS resolution request. - // If the timeout expires before a response is received, the request will be canceled. - // - // It is recommended to set this value at application startup. Avoid modifying this variable - // after initialization as it's not thread-safe for concurrent modification. - ResolvingTimeout = 30 * time.Second - - logger = grpclog.Component("dns") -) +var logger = grpclog.Component("dns") func init() { resolver.Register(NewBuilder()) internal.TimeAfterFunc = time.After - internal.TimeNowFunc = time.Now - internal.TimeUntilFunc = time.Until internal.NewNetResolver = newNetResolver internal.AddressDialer = addressDialer } @@ -211,12 +203,12 @@ func (d *dnsResolver) watcher() { err = d.cc.UpdateState(*state) } - var nextResolutionTime time.Time + var waitTime time.Duration if err == nil { // Success resolving, wait for the next ResolveNow. However, also wait 30 // seconds at the very least to prevent constantly re-resolving. backoffIndex = 1 - nextResolutionTime = internal.TimeNowFunc().Add(MinResolutionInterval) + waitTime = internal.MinResolutionRate select { case <-d.ctx.Done(): return @@ -225,13 +217,13 @@ func (d *dnsResolver) watcher() { } else { // Poll on an error found in DNS Resolver or an error received from // ClientConn. - nextResolutionTime = internal.TimeNowFunc().Add(backoff.DefaultExponential.Backoff(backoffIndex)) + waitTime = backoff.DefaultExponential.Backoff(backoffIndex) backoffIndex++ } select { case <-d.ctx.Done(): return - case <-internal.TimeAfterFunc(internal.TimeUntilFunc(nextResolutionTime)): + case <-internal.TimeAfterFunc(waitTime): } } } @@ -425,7 +417,7 @@ func chosenByPercentage(a *int) bool { if a == nil { return true } - return rand.Intn(100)+1 <= *a + return grpcrand.Intn(100)+1 <= *a } func canaryingSC(js string) string { diff --git a/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go b/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go index c0eae4f5f83..c7fc557d00c 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go +++ b/upstream/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go @@ -28,7 +28,7 @@ import ( // NetResolver groups the methods on net.Resolver that are used by the DNS // resolver implementation. This allows the default net.Resolver instance to be -// overridden from tests. +// overidden from tests. type NetResolver interface { LookupHost(ctx context.Context, host string) (addrs []string, err error) LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) @@ -50,23 +50,16 @@ var ( // The following vars are overridden from tests. var ( + // MinResolutionRate is the minimum rate at which re-resolutions are + // allowed. This helps to prevent excessive re-resolution. + MinResolutionRate = 30 * time.Second + // TimeAfterFunc is used by the DNS resolver to wait for the given duration - // to elapse. In non-test code, this is implemented by time.After. In test + // to elapse. In non-test code, this is implemented by time.After. In test // code, this can be used to control the amount of time the resolver is // blocked waiting for the duration to elapse. TimeAfterFunc func(time.Duration) <-chan time.Time - // TimeNowFunc is used by the DNS resolver to get the current time. - // In non-test code, this is implemented by time.Now. In test code, - // this can be used to control the current time for the resolver. - TimeNowFunc func() time.Time - - // TimeUntilFunc is used by the DNS resolver to calculate the remaining - // wait time for re-resolution. In non-test code, this is implemented by - // time.Until. In test code, this can be used to control the remaining - // time for resolver to wait for re-resolution. - TimeUntilFunc func(time.Time) time.Duration - // NewNetResolver returns the net.Resolver instance for the given target. NewNetResolver func(string) (NetResolver, error) diff --git a/upstream/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go b/upstream/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go index b901c7bace5..afac56572ad 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go +++ b/upstream/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go @@ -55,7 +55,7 @@ func (r *passthroughResolver) start() { r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint()}}}) } -func (*passthroughResolver) ResolveNow(resolver.ResolveNowOptions) {} +func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOptions) {} func (*passthroughResolver) Close() {} diff --git a/upstream/vendor/google.golang.org/grpc/internal/stats/labels.go b/upstream/vendor/google.golang.org/grpc/internal/stats/labels.go deleted file mode 100644 index fd33af51ae8..00000000000 --- a/upstream/vendor/google.golang.org/grpc/internal/stats/labels.go +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package stats provides internal stats related functionality. -package stats - -import "context" - -// Labels are the labels for metrics. -type Labels struct { - // TelemetryLabels are the telemetry labels to record. - TelemetryLabels map[string]string -} - -type labelsKey struct{} - -// GetLabels returns the Labels stored in the context, or nil if there is one. -func GetLabels(ctx context.Context) *Labels { - labels, _ := ctx.Value(labelsKey{}).(*Labels) - return labels -} - -// SetLabels sets the Labels in the context. -func SetLabels(ctx context.Context, labels *Labels) context.Context { - // could also append - return context.WithValue(ctx, labelsKey{}, labels) -} diff --git a/upstream/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go b/upstream/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go deleted file mode 100644 index be110d41f9a..00000000000 --- a/upstream/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package stats - -import ( - "fmt" - - estats "google.golang.org/grpc/experimental/stats" - "google.golang.org/grpc/stats" -) - -// MetricsRecorderList forwards Record calls to all of its metricsRecorders. -// -// It eats any record calls where the label values provided do not match the -// number of label keys. -type MetricsRecorderList struct { - // metricsRecorders are the metrics recorders this list will forward to. - metricsRecorders []estats.MetricsRecorder -} - -// NewMetricsRecorderList creates a new metric recorder list with all the stats -// handlers provided which implement the MetricsRecorder interface. -// If no stats handlers provided implement the MetricsRecorder interface, -// the MetricsRecorder list returned is a no-op. -func NewMetricsRecorderList(shs []stats.Handler) *MetricsRecorderList { - var mrs []estats.MetricsRecorder - for _, sh := range shs { - if mr, ok := sh.(estats.MetricsRecorder); ok { - mrs = append(mrs, mr) - } - } - return &MetricsRecorderList{ - metricsRecorders: mrs, - } -} - -func verifyLabels(desc *estats.MetricDescriptor, labelsRecv ...string) { - if got, want := len(labelsRecv), len(desc.Labels)+len(desc.OptionalLabels); got != want { - panic(fmt.Sprintf("Received %d labels in call to record metric %q, but expected %d.", got, desc.Name, want)) - } -} - -func (l *MetricsRecorderList) RecordInt64Count(handle *estats.Int64CountHandle, incr int64, labels ...string) { - verifyLabels(handle.Descriptor(), labels...) - - for _, metricRecorder := range l.metricsRecorders { - metricRecorder.RecordInt64Count(handle, incr, labels...) - } -} - -func (l *MetricsRecorderList) RecordFloat64Count(handle *estats.Float64CountHandle, incr float64, labels ...string) { - verifyLabels(handle.Descriptor(), labels...) - - for _, metricRecorder := range l.metricsRecorders { - metricRecorder.RecordFloat64Count(handle, incr, labels...) - } -} - -func (l *MetricsRecorderList) RecordInt64Histo(handle *estats.Int64HistoHandle, incr int64, labels ...string) { - verifyLabels(handle.Descriptor(), labels...) - - for _, metricRecorder := range l.metricsRecorders { - metricRecorder.RecordInt64Histo(handle, incr, labels...) - } -} - -func (l *MetricsRecorderList) RecordFloat64Histo(handle *estats.Float64HistoHandle, incr float64, labels ...string) { - verifyLabels(handle.Descriptor(), labels...) - - for _, metricRecorder := range l.metricsRecorders { - metricRecorder.RecordFloat64Histo(handle, incr, labels...) - } -} - -func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, incr int64, labels ...string) { - verifyLabels(handle.Descriptor(), labels...) - - for _, metricRecorder := range l.metricsRecorders { - metricRecorder.RecordInt64Gauge(handle, incr, labels...) - } -} diff --git a/upstream/vendor/google.golang.org/grpc/internal/status/status.go b/upstream/vendor/google.golang.org/grpc/internal/status/status.go index 757925381fe..c7dbc820595 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/status/status.go +++ b/upstream/vendor/google.golang.org/grpc/internal/status/status.go @@ -138,11 +138,11 @@ func (s *Status) WithDetails(details ...protoadapt.MessageV1) (*Status, error) { // s.Code() != OK implies that s.Proto() != nil. p := s.Proto() for _, detail := range details { - m, err := anypb.New(protoadapt.MessageV2Of(detail)) + any, err := anypb.New(protoadapt.MessageV2Of(detail)) if err != nil { return nil, err } - p.Details = append(p.Details, m) + p.Details = append(p.Details, any) } return &Status{s: p}, nil } diff --git a/upstream/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go b/upstream/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go index 54c24c2ff38..999f52cd75b 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go +++ b/upstream/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go @@ -58,20 +58,20 @@ func GetRusage() *Rusage { // CPUTimeDiff returns the differences of user CPU time and system CPU time used // between two Rusage structs. It a no-op function for non-linux environments. -func CPUTimeDiff(*Rusage, *Rusage) (float64, float64) { +func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) { log() return 0, 0 } // SetTCPUserTimeout is a no-op function under non-linux environments. -func SetTCPUserTimeout(net.Conn, time.Duration) error { +func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error { log() return nil } // GetTCPUserTimeout is a no-op function under non-linux environments. // A negative return value indicates the operation is not supported -func GetTCPUserTimeout(net.Conn) (int, error) { +func GetTCPUserTimeout(conn net.Conn) (int, error) { log() return -1, nil } diff --git a/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go b/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go index 7e7aaa54636..078137b7fd7 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go +++ b/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go @@ -44,7 +44,7 @@ func NetDialerWithTCPKeepalive() *net.Dialer { // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for - // the TCP keepalive interval and time parameters. + // the TCP keealive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1) diff --git a/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go b/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go index d5c1085eeae..fd7d43a8907 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go +++ b/upstream/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go @@ -44,7 +44,7 @@ func NetDialerWithTCPKeepalive() *net.Dialer { // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for - // the TCP keepalive interval and time parameters. + // the TCP keealive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_KEEPALIVE, 1) diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/upstream/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index ef72fbb3a01..83c3829826a 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -32,7 +32,6 @@ import ( "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" - "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) @@ -149,9 +148,9 @@ type dataFrame struct { streamID uint32 endStream bool h []byte - reader mem.Reader + d []byte // onEachWrite is called every time - // a part of data is written out. + // a part of d is written out. onEachWrite func() } @@ -194,7 +193,7 @@ type goAway struct { code http2.ErrCode debugData []byte headsUp bool - closeConn error // if set, loopyWriter will exit with this error + closeConn error // if set, loopyWriter will exit, resulting in conn closure } func (*goAway) isTransportResponseFrame() bool { return false } @@ -290,22 +289,18 @@ func (l *outStreamList) dequeue() *outStream { } // controlBuffer is a way to pass information to loopy. -// -// Information is passed as specific struct types called control frames. A -// control frame not only represents data, messages or headers to be sent out -// but can also be used to instruct loopy to update its internal state. It -// shouldn't be confused with an HTTP2 frame, although some of the control -// frames like dataFrame and headerFrame do go out on wire as HTTP2 frames. +// Information is passed as specific struct types called control frames. +// A control frame not only represents data, messages or headers to be sent out +// but can also be used to instruct loopy to update its internal state. +// It shouldn't be confused with an HTTP2 frame, although some of the control frames +// like dataFrame and headerFrame do go out on wire as HTTP2 frames. type controlBuffer struct { - wakeupCh chan struct{} // Unblocks readers waiting for something to read. - done <-chan struct{} // Closed when the transport is done. - - // Mutex guards all the fields below, except trfChan which can be read - // atomically without holding mu. + ch chan struct{} + done <-chan struct{} mu sync.Mutex - consumerWaiting bool // True when readers are blocked waiting for new data. - closed bool // True when the controlbuf is finished. - list *itemList // List of queued control frames. + consumerWaiting bool + list *itemList + err error // transportResponseFrames counts the number of queued items that represent // the response of an action initiated by the peer. trfChan is created @@ -313,59 +308,47 @@ type controlBuffer struct { // closed and nilled when transportResponseFrames drops below the // threshold. Both fields are protected by mu. transportResponseFrames int - trfChan atomic.Pointer[chan struct{}] + trfChan atomic.Value // chan struct{} } func newControlBuffer(done <-chan struct{}) *controlBuffer { return &controlBuffer{ - wakeupCh: make(chan struct{}, 1), - list: &itemList{}, - done: done, + ch: make(chan struct{}, 1), + list: &itemList{}, + done: done, } } -// throttle blocks if there are too many frames in the control buf that -// represent the response of an action initiated by the peer, like -// incomingSettings cleanupStreams etc. +// throttle blocks if there are too many incomingSettings/cleanupStreams in the +// controlbuf. func (c *controlBuffer) throttle() { - if ch := c.trfChan.Load(); ch != nil { + ch, _ := c.trfChan.Load().(chan struct{}) + if ch != nil { select { - case <-(*ch): + case <-ch: case <-c.done: } } } -// put adds an item to the controlbuf. func (c *controlBuffer) put(it cbItem) error { _, err := c.executeAndPut(nil, it) return err } -// executeAndPut runs f, and if the return value is true, adds the given item to -// the controlbuf. The item could be nil, in which case, this method simply -// executes f and does not add the item to the controlbuf. -// -// The first return value indicates whether the item was successfully added to -// the control buffer. A non-nil error, specifically ErrConnClosing, is returned -// if the control buffer is already closed. -func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { +func (c *controlBuffer) executeAndPut(f func(it any) bool, it cbItem) (bool, error) { + var wakeUp bool c.mu.Lock() - defer c.mu.Unlock() - - if c.closed { - return false, ErrConnClosing + if c.err != nil { + c.mu.Unlock() + return false, c.err } if f != nil { - if !f() { // f wasn't successful + if !f(it) { // f wasn't successful + c.mu.Unlock() return false, nil } } - if it == nil { - return true, nil - } - - var wakeUp bool if c.consumerWaiting { wakeUp = true c.consumerWaiting = false @@ -376,102 +359,98 @@ func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are adding the frame that puts us over the threshold; create // a throttling channel. - ch := make(chan struct{}) - c.trfChan.Store(&ch) + c.trfChan.Store(make(chan struct{})) } } + c.mu.Unlock() if wakeUp { select { - case c.wakeupCh <- struct{}{}: + case c.ch <- struct{}{}: default: } } return true, nil } -// get returns the next control frame from the control buffer. If block is true -// **and** there are no control frames in the control buffer, the call blocks -// until one of the conditions is met: there is a frame to return or the -// transport is closed. +// Note argument f should never be nil. +func (c *controlBuffer) execute(f func(it any) bool, it any) (bool, error) { + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return false, c.err + } + if !f(it) { // f wasn't successful + c.mu.Unlock() + return false, nil + } + c.mu.Unlock() + return true, nil +} + func (c *controlBuffer) get(block bool) (any, error) { for { c.mu.Lock() - frame, err := c.getOnceLocked() - if frame != nil || err != nil || !block { - // If we read a frame or an error, we can return to the caller. The - // call to getOnceLocked() returns a nil frame and a nil error if - // there is nothing to read, and in that case, if the caller asked - // us not to block, we can return now as well. + if c.err != nil { c.mu.Unlock() - return frame, err + return nil, c.err + } + if !c.list.isEmpty() { + h := c.list.dequeue().(cbItem) + if h.isTransportResponseFrame() { + if c.transportResponseFrames == maxQueuedTransportResponseFrames { + // We are removing the frame that put us over the + // threshold; close and clear the throttling channel. + ch := c.trfChan.Load().(chan struct{}) + close(ch) + c.trfChan.Store((chan struct{})(nil)) + } + c.transportResponseFrames-- + } + c.mu.Unlock() + return h, nil + } + if !block { + c.mu.Unlock() + return nil, nil } c.consumerWaiting = true c.mu.Unlock() - - // Release the lock above and wait to be woken up. select { - case <-c.wakeupCh: + case <-c.ch: case <-c.done: return nil, errors.New("transport closed by client") } } } -// Callers must not use this method, but should instead use get(). -// -// Caller must hold c.mu. -func (c *controlBuffer) getOnceLocked() (any, error) { - if c.closed { - return false, ErrConnClosing - } - if c.list.isEmpty() { - return nil, nil - } - h := c.list.dequeue().(cbItem) - if h.isTransportResponseFrame() { - if c.transportResponseFrames == maxQueuedTransportResponseFrames { - // We are removing the frame that put us over the - // threshold; close and clear the throttling channel. - ch := c.trfChan.Swap(nil) - close(*ch) - } - c.transportResponseFrames-- - } - return h, nil -} - -// finish closes the control buffer, cleaning up any streams that have queued -// header frames. Once this method returns, no more frames can be added to the -// control buffer, and attempts to do so will return ErrConnClosing. func (c *controlBuffer) finish() { c.mu.Lock() - defer c.mu.Unlock() - - if c.closed { + if c.err != nil { + c.mu.Unlock() return } - c.closed = true + c.err = ErrConnClosing // There may be headers for streams in the control buffer. // These streams need to be cleaned out since the transport // is still not aware of these yet. for head := c.list.dequeueAll(); head != nil; head = head.next { - switch v := head.it.(type) { - case *headerFrame: - if v.onOrphaned != nil { // It will be nil on the server-side. - v.onOrphaned(ErrConnClosing) - } - case *dataFrame: - _ = v.reader.Close() + hdr, ok := head.it.(*headerFrame) + if !ok { + continue + } + if hdr.onOrphaned != nil { // It will be nil on the server-side. + hdr.onOrphaned(ErrConnClosing) } } - // In case throttle() is currently in flight, it needs to be unblocked. // Otherwise, the transport may not close, since the transport is closed by // the reader encountering the connection error. - ch := c.trfChan.Swap(nil) + ch, _ := c.trfChan.Load().(chan struct{}) if ch != nil { - close(*ch) + close(ch) } + c.trfChan.Store((chan struct{})(nil)) + c.mu.Unlock() } type side int @@ -487,7 +466,7 @@ const ( // stream maintains a queue of data frames; as loopy receives data frames // it gets added to the queue of the relevant stream. // Loopy goes over this list of active streams by processing one node every iteration, -// thereby closely resembling a round-robin scheduling over all streams. While +// thereby closely resemebling to a round-robin scheduling over all streams. While // processing a stream, loopy writes out data bytes from this stream capped by the min // of http2MaxFrameLen, connection-level flow control and stream-level flow control. type loopyWriter struct { @@ -511,29 +490,26 @@ type loopyWriter struct { draining bool conn net.Conn logger *grpclog.PrefixLogger - bufferPool mem.BufferPool // Side-specific handlers ssGoAwayHandler func(*goAway) (bool, error) } -func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator, conn net.Conn, logger *grpclog.PrefixLogger, goAwayHandler func(*goAway) (bool, error), bufferPool mem.BufferPool) *loopyWriter { +func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator, conn net.Conn, logger *grpclog.PrefixLogger) *loopyWriter { var buf bytes.Buffer l := &loopyWriter{ - side: s, - cbuf: cbuf, - sendQuota: defaultWindowSize, - oiws: defaultWindowSize, - estdStreams: make(map[uint32]*outStream), - activeStreams: newOutStreamList(), - framer: fr, - hBuf: &buf, - hEnc: hpack.NewEncoder(&buf), - bdpEst: bdpEst, - conn: conn, - logger: logger, - ssGoAwayHandler: goAwayHandler, - bufferPool: bufferPool, + side: s, + cbuf: cbuf, + sendQuota: defaultWindowSize, + oiws: defaultWindowSize, + estdStreams: make(map[uint32]*outStream), + activeStreams: newOutStreamList(), + framer: fr, + hBuf: &buf, + hEnc: hpack.NewEncoder(&buf), + bdpEst: bdpEst, + conn: conn, + logger: logger, } return l } @@ -791,11 +767,6 @@ func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { // not be established yet. delete(l.estdStreams, c.streamID) str.deleteSelf() - for head := str.itl.dequeueAll(); head != nil; head = head.next { - if df, ok := head.it.(*dataFrame); ok { - _ = df.reader.Close() - } - } } if c.rst { // If RST_STREAM needs to be sent. if err := l.framer.fr.WriteRSTStream(c.streamID, c.rstCode); err != nil { @@ -931,18 +902,16 @@ func (l *loopyWriter) processData() (bool, error) { dataItem := str.itl.peek().(*dataFrame) // Peek at the first data item this stream. // A data item is represented by a dataFrame, since it later translates into // multiple HTTP2 data frames. - // Every dataFrame has two buffers; h that keeps grpc-message header and data - // that is the actual message. As an optimization to keep wire traffic low, data - // from data is copied to h to make as big as the maximum possible HTTP2 frame - // size. + // Every dataFrame has two buffers; h that keeps grpc-message header and d that is actual data. + // As an optimization to keep wire traffic low, data from d is copied to h to make as big as the + // maximum possible HTTP2 frame size. - if len(dataItem.h) == 0 && dataItem.reader.Remaining() == 0 { // Empty data frame + if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // Empty data frame // Client sends out empty data frame with endStream = true if err := l.framer.fr.WriteData(dataItem.streamID, dataItem.endStream, nil); err != nil { return false, err } str.itl.dequeue() // remove the empty data item from stream - _ = dataItem.reader.Close() if str.itl.isEmpty() { str.state = empty } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // the next item is trailers. @@ -957,7 +926,9 @@ func (l *loopyWriter) processData() (bool, error) { } return false, nil } - + var ( + buf []byte + ) // Figure out the maximum size we can send maxSize := http2MaxFrameLen if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota <= 0 { // stream-level flow control. @@ -971,50 +942,43 @@ func (l *loopyWriter) processData() (bool, error) { } // Compute how much of the header and data we can send within quota and max frame length hSize := min(maxSize, len(dataItem.h)) - dSize := min(maxSize-hSize, dataItem.reader.Remaining()) - remainingBytes := len(dataItem.h) + dataItem.reader.Remaining() - hSize - dSize - size := hSize + dSize - - var buf *[]byte - - if hSize != 0 && dSize == 0 { - buf = &dataItem.h - } else { - // Note: this is only necessary because the http2.Framer does not support - // partially writing a frame, so the sequence must be materialized into a buffer. - // TODO: Revisit once https://github.com/golang/go/issues/66655 is addressed. - pool := l.bufferPool - if pool == nil { - // Note that this is only supposed to be nil in tests. Otherwise, stream is - // always initialized with a BufferPool. - pool = mem.DefaultBufferPool() + dSize := min(maxSize-hSize, len(dataItem.d)) + if hSize != 0 { + if dSize == 0 { + buf = dataItem.h + } else { + // We can add some data to grpc message header to distribute bytes more equally across frames. + // Copy on the stack to avoid generating garbage + var localBuf [http2MaxFrameLen]byte + copy(localBuf[:hSize], dataItem.h) + copy(localBuf[hSize:], dataItem.d[:dSize]) + buf = localBuf[:hSize+dSize] } - buf = pool.Get(size) - defer pool.Put(buf) - - copy((*buf)[:hSize], dataItem.h) - _, _ = dataItem.reader.Read((*buf)[hSize:]) + } else { + buf = dataItem.d } + size := hSize + dSize + // Now that outgoing flow controls are checked we can replenish str's write quota str.wq.replenish(size) var endStream bool // If this is the last data message on this stream and all of it can be written in this iteration. - if dataItem.endStream && remainingBytes == 0 { + if dataItem.endStream && len(dataItem.h)+len(dataItem.d) <= size { endStream = true } if dataItem.onEachWrite != nil { dataItem.onEachWrite() } - if err := l.framer.fr.WriteData(dataItem.streamID, endStream, (*buf)[:size]); err != nil { + if err := l.framer.fr.WriteData(dataItem.streamID, endStream, buf[:size]); err != nil { return false, err } str.bytesOutStanding += size l.sendQuota -= uint32(size) dataItem.h = dataItem.h[hSize:] + dataItem.d = dataItem.d[dSize:] - if remainingBytes == 0 { // All the data from that message was written out. - _ = dataItem.reader.Close() + if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // All the data from that message was written out. str.itl.dequeue() } if str.itl.isEmpty() { @@ -1033,3 +997,10 @@ func (l *loopyWriter) processData() (bool, error) { } return false, nil } + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/upstream/vendor/google.golang.org/grpc/internal/transport/handler_server.go index ce878693bd7..4a3ddce29a4 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -24,6 +24,7 @@ package transport import ( + "bytes" "context" "errors" "fmt" @@ -39,7 +40,6 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -50,7 +50,7 @@ import ( // NewServerHandlerTransport returns a ServerTransport handling gRPC from // inside an http.Handler, or writes an HTTP error to w and returns an error. // It requires that the http Server supports HTTP/2. -func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []stats.Handler, bufferPool mem.BufferPool) (ServerTransport, error) { +func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []stats.Handler) (ServerTransport, error) { if r.Method != http.MethodPost { w.Header().Set("Allow", http.MethodPost) msg := fmt.Sprintf("invalid gRPC request method %q", r.Method) @@ -98,7 +98,6 @@ func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []s contentType: contentType, contentSubtype: contentSubtype, stats: stats, - bufferPool: bufferPool, } st.logger = prefixLoggerForServerHandlerTransport(st) @@ -172,8 +171,6 @@ type serverHandlerTransport struct { stats []stats.Handler logger *grpclog.PrefixLogger - - bufferPool mem.BufferPool } func (ht *serverHandlerTransport) Close(err error) { @@ -247,7 +244,6 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro } s.hdrMu.Lock() - defer s.hdrMu.Unlock() if p := st.Proto(); p != nil && len(p.Details) > 0 { delete(s.trailer, grpcStatusDetailsBinHeader) stBytes, err := proto.Marshal(p) @@ -272,6 +268,7 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro } } } + s.hdrMu.Unlock() }) if err == nil { // transport has not been closed @@ -333,28 +330,16 @@ func (ht *serverHandlerTransport) writeCustomHeaders(s *Stream) { s.hdrMu.Unlock() } -func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data mem.BufferSlice, _ *Options) error { - // Always take a reference because otherwise there is no guarantee the data will - // be available after this function returns. This is what callers to Write - // expect. - data.Ref() +func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { headersWritten := s.updateHeaderSent() - err := ht.do(func() { - defer data.Free() + return ht.do(func() { if !headersWritten { ht.writePendingHeaders(s) } ht.rw.Write(hdr) - for _, b := range data { - _, _ = ht.rw.Write(b.ReadOnlyData()) - } + ht.rw.Write(data) ht.rw.(http.Flusher).Flush() }) - if err != nil { - data.Free() - return err - } - return nil } func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { @@ -421,7 +406,7 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream headerWireLength: 0, // won't have access to header wire length until golang/go#18997. } s.trReader = &transportReader{ - reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf}, + reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf, freeBuffer: func(*bytes.Buffer) {}}, windowHandler: func(int) {}, } @@ -430,19 +415,21 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream go func() { defer close(readerDone) - for { - buf := ht.bufferPool.Get(http2MaxFrameLen) - n, err := req.Body.Read(*buf) + // TODO: minimize garbage, optimize recvBuffer code/ownership + const readSize = 8196 + for buf := make([]byte, readSize); ; { + n, err := req.Body.Read(buf) if n > 0 { - *buf = (*buf)[:n] - s.buf.put(recvMsg{buffer: mem.NewBuffer(buf, ht.bufferPool)}) - } else { - ht.bufferPool.Put(buf) + s.buf.put(recvMsg{buffer: bytes.NewBuffer(buf[:n:n])}) + buf = buf[n:] } if err != nil { s.buf.put(recvMsg{err: mapRecvMsgError(err)}) return } + if len(buf) == 0 { + buf = make([]byte, readSize) + } } }() @@ -475,7 +462,7 @@ func (ht *serverHandlerTransport) IncrMsgSent() {} func (ht *serverHandlerTransport) IncrMsgRecv() {} -func (ht *serverHandlerTransport) Drain(string) { +func (ht *serverHandlerTransport) Drain(debugData string) { panic("Drain() is not implemented") } diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/upstream/vendor/google.golang.org/grpc/internal/transport/http2_client.go index c769deab53c..deba0c4d9ef 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -47,7 +47,6 @@ import ( isyscall "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" @@ -60,8 +59,6 @@ import ( // atomically. var clientConnectionCounter uint64 -var goAwayLoopyWriterTimeout = 5 * time.Second - var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // http2Client implements the ClientTransport interface with HTTP2. @@ -117,11 +114,11 @@ type http2Client struct { streamQuota int64 streamsQuotaAvailable chan struct{} waitingStreams uint32 + nextID uint32 registeredCompressors string // Do not access controlBuf with mu held. mu sync.Mutex // guard the following variables - nextID uint32 state transportState activeStreams map[uint32]*Stream // prevGoAway ID records the Last-Stream-ID in the previous GOAway frame. @@ -147,7 +144,7 @@ type http2Client struct { onClose func(GoAwayReason) - bufferPool mem.BufferPool + bufferPool *bufferPool connectionID uint64 logger *grpclog.PrefixLogger @@ -232,7 +229,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } }(conn) - // The following defer and goroutine monitor the connectCtx for cancellation + // The following defer and goroutine monitor the connectCtx for cancelation // and deadline. On context expiration, the connection is hard closed and // this function will naturally fail as a result. Otherwise, the defer // waits for the goroutine to exit to prevent the context from being @@ -349,7 +346,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts streamQuota: defaultMaxStreamsClient, streamsQuotaAvailable: make(chan struct{}, 1), keepaliveEnabled: keepaliveEnabled, - bufferPool: opts.BufferPool, + bufferPool: newBufferPool(), onClose: onClose, } var czSecurity credentials.ChannelzSecurityValue @@ -411,10 +408,10 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts readerErrCh := make(chan error, 1) go t.reader(readerErrCh) defer func() { + if err == nil { + err = <-readerErrCh + } if err != nil { - // writerDone should be closed since the loopy goroutine - // wouldn't have started in the case this function returns an error. - close(t.writerDone) t.Close(err) } }() @@ -461,12 +458,8 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts if err := t.framer.writer.Flush(); err != nil { return nil, err } - // Block until the server preface is received successfully or an error occurs. - if err = <-readerErrCh; err != nil { - return nil, err - } go func() { - t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) + t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger) if err := t.loopy.run(); !isIOError(err) { // Immediately close the connection, as the loopy writer returns // when there are no more active streams and we were draining (the @@ -507,6 +500,7 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { closeStream: func(err error) { t.CloseStream(s, err) }, + freeBuffer: t.bufferPool.put, }, windowHandler: func(n int) { t.updateWindow(s, uint32(n)) @@ -523,17 +517,6 @@ func (t *http2Client) getPeer() *peer.Peer { } } -// OutgoingGoAwayHandler writes a GOAWAY to the connection. Always returns (false, err) as we want the GoAway -// to be the last frame loopy writes to the transport. -func (t *http2Client) outgoingGoAwayHandler(g *goAway) (bool, error) { - t.mu.Lock() - defer t.mu.Unlock() - if err := t.framer.fr.WriteGoAway(t.nextID-2, http2.ErrCodeNo, g.debugData); err != nil { - return false, err - } - return false, g.closeConn -} - func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) ([]hpack.HeaderField, error) { aud := t.createAudience(callHdr) ri := credentials.RequestInfo{ @@ -772,7 +755,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, hdr := &headerFrame{ hf: headerFields, endStream: false, - initStream: func(uint32) error { + initStream: func(id uint32) error { t.mu.Lock() // TODO: handle transport closure in loopy instead and remove this // initStream is never called when transport is draining. @@ -798,7 +781,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, firstTry := true var ch chan struct{} transportDrainRequired := false - checkForStreamQuota := func() bool { + checkForStreamQuota := func(it any) bool { if t.streamQuota <= 0 { // Can go negative if server decreases it. if firstTry { t.waitingStreams++ @@ -810,24 +793,23 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, t.waitingStreams-- } t.streamQuota-- - - t.mu.Lock() - if t.state == draining || t.activeStreams == nil { // Can be niled from Close(). - t.mu.Unlock() - return false // Don't create a stream if the transport is already closed. - } - - hdr.streamID = t.nextID + h := it.(*headerFrame) + h.streamID = t.nextID t.nextID += 2 + // Drain client transport if nextID > MaxStreamID which signals gRPC that // the connection is closed and a new one must be created for subsequent RPCs. transportDrainRequired = t.nextID > MaxStreamID - s.id = hdr.streamID + s.id = h.streamID s.fc = &inFlow{limit: uint32(t.initialWindowSize)} + t.mu.Lock() + if t.state == draining || t.activeStreams == nil { // Can be niled from Close(). + t.mu.Unlock() + return false // Don't create a stream if the transport is already closed. + } t.activeStreams[s.id] = s t.mu.Unlock() - if t.streamQuota > 0 && t.waitingStreams > 0 { select { case t.streamsQuotaAvailable <- struct{}{}: @@ -837,12 +819,13 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, return true } var hdrListSizeErr error - checkForHeaderListSize := func() bool { + checkForHeaderListSize := func(it any) bool { if t.maxSendHeaderListSize == nil { return true } + hdrFrame := it.(*headerFrame) var sz int64 - for _, f := range hdr.hf { + for _, f := range hdrFrame.hf { if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { hdrListSizeErr = status.Errorf(codes.Internal, "header list size to send violates the maximum size (%d bytes) set by server", *t.maxSendHeaderListSize) return false @@ -851,8 +834,8 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, return true } for { - success, err := t.controlBuf.executeAndPut(func() bool { - return checkForHeaderListSize() && checkForStreamQuota() + success, err := t.controlBuf.executeAndPut(func(it any) bool { + return checkForHeaderListSize(it) && checkForStreamQuota(it) }, hdr) if err != nil { // Connection closed. @@ -963,7 +946,7 @@ func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2. rst: rst, rstCode: rstCode, } - addBackStreamQuota := func() bool { + addBackStreamQuota := func(any) bool { t.streamQuota++ if t.streamQuota > 0 && t.waitingStreams > 0 { select { @@ -983,9 +966,8 @@ func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2. // Close kicks off the shutdown process of the transport. This should be called // only once on a transport. Once it is called, the transport should not be -// accessed anymore. +// accessed any more. func (t *http2Client) Close(err error) { - t.conn.SetWriteDeadline(time.Now().Add(time.Second * 10)) t.mu.Lock() // Make sure we only close once. if t.state == closing { @@ -1009,20 +991,7 @@ func (t *http2Client) Close(err error) { t.kpDormancyCond.Signal() } t.mu.Unlock() - - // Per HTTP/2 spec, a GOAWAY frame must be sent before closing the - // connection. See https://httpwg.org/specs/rfc7540.html#GOAWAY. It - // also waits for loopyWriter to be closed with a timer to avoid the - // long blocking in case the connection is blackholed, i.e. TCP is - // just stuck. - t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte("client transport shutdown"), closeConn: err}) - timer := time.NewTimer(goAwayLoopyWriterTimeout) - defer timer.Stop() - select { - case <-t.writerDone: // success - case <-timer.C: - t.logger.Infof("Failed to write a GOAWAY frame as part of connection close after %s. Giving up and closing the transport.", goAwayLoopyWriterTimeout) - } + t.controlBuf.finish() t.cancel() t.conn.Close() channelz.RemoveEntry(t.channelz.ID) @@ -1078,36 +1047,27 @@ func (t *http2Client) GracefulClose() { // Write formats the data into HTTP2 data frame(s) and sends it out. The caller // should proceed only if Write returns nil. -func (t *http2Client) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error { - reader := data.Reader() - +func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { if opts.Last { // If it's the last message, update stream state. if !s.compareAndSwapState(streamActive, streamWriteDone) { - _ = reader.Close() return errStreamDone } } else if s.getState() != streamActive { - _ = reader.Close() return errStreamDone } df := &dataFrame{ streamID: s.id, endStream: opts.Last, h: hdr, - reader: reader, + d: data, } - if hdr != nil || df.reader.Remaining() != 0 { // If it's not an empty data frame, check quota. - if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { - _ = reader.Close() + if hdr != nil || data != nil { // If it's not an empty data frame, check quota. + if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { return err } } - if err := t.controlBuf.put(df); err != nil { - _ = reader.Close() - return err - } - return nil + return t.controlBuf.put(df) } func (t *http2Client) getStream(f http2.Frame) *Stream { @@ -1139,7 +1099,7 @@ func (t *http2Client) updateWindow(s *Stream, n uint32) { // for the transport and the stream based on the current bdp // estimation. func (t *http2Client) updateFlowControl(n uint32) { - updateIWS := func() bool { + updateIWS := func(any) bool { t.initialWindowSize = int32(n) t.mu.Lock() for _, s := range t.activeStreams { @@ -1212,13 +1172,10 @@ func (t *http2Client) handleData(f *http2.DataFrame) { // guarantee f.Data() is consumed before the arrival of next frame. // Can this copy be eliminated? if len(f.Data()) > 0 { - pool := t.bufferPool - if pool == nil { - // Note that this is only supposed to be nil in tests. Otherwise, stream is - // always initialized with a BufferPool. - pool = mem.DefaultBufferPool() - } - s.write(recvMsg{buffer: mem.Copy(f.Data(), pool)}) + buffer := t.bufferPool.get() + buffer.Reset() + buffer.Write(f.Data()) + s.write(recvMsg{buffer: buffer}) } } // The server has closed the stream without sending trailers. Record that @@ -1247,7 +1204,7 @@ func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { if statusCode == codes.Canceled { if d, ok := s.ctx.Deadline(); ok && !d.After(time.Now()) { // Our deadline was already exceeded, and that was likely the cause - // of this cancellation. Alter the status code accordingly. + // of this cancelation. Alter the status code accordingly. statusCode = codes.DeadlineExceeded } } @@ -1295,7 +1252,7 @@ func (t *http2Client) handleSettings(f *http2.SettingsFrame, isFirst bool) { } updateFuncs = append(updateFuncs, updateStreamQuota) } - t.controlBuf.executeAndPut(func() bool { + t.controlBuf.executeAndPut(func(any) bool { for _, f := range updateFuncs { f() } @@ -1332,7 +1289,7 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { id := f.LastStreamID if id > 0 && id%2 == 0 { t.mu.Unlock() - t.Close(connectionErrorf(true, nil, "received goaway with non-zero even-numbered stream id: %v", id)) + t.Close(connectionErrorf(true, nil, "received goaway with non-zero even-numbered numbered stream id: %v", id)) return } // A client can receive multiple GoAways from the server (see @@ -1667,10 +1624,11 @@ func (t *http2Client) reader(errCh chan<- error) { t.closeStream(s, status.Error(code, msg), true, http2.ErrCodeProtocol, status.New(code, msg), nil, false) } continue + } else { + // Transport error. + t.Close(connectionErrorf(true, err, "error reading from server: %v", err)) + return } - // Transport error. - t.Close(connectionErrorf(true, err, "error reading from server: %v", err)) - return } switch frame := frame.(type) { case *http2.MetaHeadersFrame: @@ -1695,6 +1653,13 @@ func (t *http2Client) reader(errCh chan<- error) { } } +func minTime(a, b time.Duration) time.Duration { + if a < b { + return a + } + return b +} + // keepalive running in a separate goroutine makes sure the connection is alive by sending pings. func (t *http2Client) keepalive() { p := &ping{data: [8]byte{}} @@ -1762,7 +1727,7 @@ func (t *http2Client) keepalive() { // timeoutLeft. This will ensure that we wait only for kp.Time // before sending out the next ping (for cases where the ping is // acked). - sleepDuration := min(t.kp.Time, timeoutLeft) + sleepDuration := minTime(t.kp.Time, timeoutLeft) timeoutLeft -= sleepDuration timer.Reset(sleepDuration) case <-t.ctx.Done(): diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/upstream/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 584b50fe553..d582e047109 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -25,7 +25,6 @@ import ( "fmt" "io" "math" - "math/rand" "net" "net/http" "strconv" @@ -39,12 +38,12 @@ import ( "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/internal/syscall" - "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" @@ -120,7 +119,7 @@ type http2Server struct { // Fields below are for channelz metric collection. channelz *channelz.Socket - bufferPool mem.BufferPool + bufferPool *bufferPool connectionID uint64 @@ -262,7 +261,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, idle: time.Now(), kep: kep, initialWindowSize: iwz, - bufferPool: config.BufferPool, + bufferPool: newBufferPool(), } var czSecurity credentials.ChannelzSecurityValue if au, ok := authInfo.(credentials.ChannelzSecurityInfo); ok { @@ -331,7 +330,8 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, t.handleSettings(sf) go func() { - t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) + t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger) + t.loopy.ssGoAwayHandler = t.outgoingGoAwayHandler err := t.loopy.run() close(t.loopyWriterDone) if !isIOError(err) { @@ -614,9 +614,10 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade s.wq = newWriteQuota(defaultWriteQuota, s.ctxDone) s.trReader = &transportReader{ reader: &recvBufferReader{ - ctx: s.ctx, - ctxDone: s.ctxDone, - recv: s.buf, + ctx: s.ctx, + ctxDone: s.ctxDone, + recv: s.buf, + freeBuffer: t.bufferPool.put, }, windowHandler: func(n int) { t.updateWindow(s, uint32(n)) @@ -813,13 +814,10 @@ func (t *http2Server) handleData(f *http2.DataFrame) { // guarantee f.Data() is consumed before the arrival of next frame. // Can this copy be eliminated? if len(f.Data()) > 0 { - pool := t.bufferPool - if pool == nil { - // Note that this is only supposed to be nil in tests. Otherwise, stream is - // always initialized with a BufferPool. - pool = mem.DefaultBufferPool() - } - s.write(recvMsg{buffer: mem.Copy(f.Data(), pool)}) + buffer := t.bufferPool.get() + buffer.Reset() + buffer.Write(f.Data()) + s.write(recvMsg{buffer: buffer}) } } if f.StreamEnded() { @@ -862,7 +860,7 @@ func (t *http2Server) handleSettings(f *http2.SettingsFrame) { } return nil }) - t.controlBuf.executeAndPut(func() bool { + t.controlBuf.executeAndPut(func(any) bool { for _, f := range updateFuncs { f() } @@ -1016,13 +1014,12 @@ func (t *http2Server) writeHeaderLocked(s *Stream) error { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) } headerFields = appendHeaderFieldsFromMD(headerFields, s.header) - hf := &headerFrame{ + success, err := t.controlBuf.executeAndPut(t.checkForHeaderListSize, &headerFrame{ streamID: s.id, hf: headerFields, endStream: false, onWrite: t.setResetPingStrikes, - } - success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf) }, hf) + }) if !success { if err != nil { return err @@ -1092,9 +1089,7 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { onWrite: t.setResetPingStrikes, } - success, err := t.controlBuf.executeAndPut(func() bool { - return t.checkForHeaderListSize(trailingHeader) - }, nil) + success, err := t.controlBuf.execute(t.checkForHeaderListSize, trailingHeader) if !success { if err != nil { return err @@ -1117,37 +1112,27 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { // Write converts the data into HTTP2 data frame and sends it out. Non-nil error // is returns if it fails (e.g., framing error, transport error). -func (t *http2Server) Write(s *Stream, hdr []byte, data mem.BufferSlice, _ *Options) error { - reader := data.Reader() - +func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { if !s.isHeaderSent() { // Headers haven't been written yet. if err := t.WriteHeader(s, nil); err != nil { - _ = reader.Close() return err } } else { // Writing headers checks for this condition. if s.getState() == streamDone { - _ = reader.Close() return t.streamContextErr(s) } } - df := &dataFrame{ streamID: s.id, h: hdr, - reader: reader, + d: data, onEachWrite: t.setResetPingStrikes, } - if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { - _ = reader.Close() + if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { return t.streamContextErr(s) } - if err := t.controlBuf.put(df); err != nil { - _ = reader.Close() - return err - } - return nil + return t.controlBuf.put(df) } // keepalive running in a separate goroutine does the following: @@ -1223,7 +1208,7 @@ func (t *http2Server) keepalive() { continue } if outstandingPing && kpTimeoutLeft <= 0 { - t.Close(fmt.Errorf("keepalive ping not acked within timeout %s", t.kp.Timeout)) + t.Close(fmt.Errorf("keepalive ping not acked within timeout %s", t.kp.Time)) return } if !outstandingPing { @@ -1238,7 +1223,7 @@ func (t *http2Server) keepalive() { // timeoutLeft. This will ensure that we wait only for kp.Time // before sending out the next ping (for cases where the ping is // acked). - sleepDuration := min(t.kp.Time, kpTimeoutLeft) + sleepDuration := minTime(t.kp.Time, kpTimeoutLeft) kpTimeoutLeft -= sleepDuration kpTimer.Reset(sleepDuration) case <-t.done: @@ -1455,7 +1440,7 @@ func getJitter(v time.Duration) time.Duration { } // Generate a jitter between +/- 10% of the value. r := int64(v / 10) - j := rand.Int63n(2*r) - r + j := grpcrand.Int63n(2*r) - r return time.Duration(j) } diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/http_util.go b/upstream/vendor/google.golang.org/grpc/internal/transport/http_util.go index 3613d7b6481..39cef3bd442 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -317,32 +317,28 @@ func newBufWriter(conn net.Conn, batchSize int, pool *sync.Pool) *bufWriter { return w } -func (w *bufWriter) Write(b []byte) (int, error) { +func (w *bufWriter) Write(b []byte) (n int, err error) { if w.err != nil { return 0, w.err } if w.batchSize == 0 { // Buffer has been disabled. - n, err := w.conn.Write(b) + n, err = w.conn.Write(b) return n, toIOError(err) } if w.buf == nil { b := w.pool.Get().(*[]byte) w.buf = *b } - written := 0 for len(b) > 0 { - copied := copy(w.buf[w.offset:], b) - b = b[copied:] - written += copied - w.offset += copied - if w.offset < w.batchSize { - continue - } - if err := w.flushKeepBuffer(); err != nil { - return written, err + nn := copy(w.buf[w.offset:], b) + b = b[nn:] + w.offset += nn + n += nn + if w.offset >= w.batchSize { + err = w.flushKeepBuffer() } } - return written, nil + return n, err } func (w *bufWriter) Flush() error { @@ -393,7 +389,7 @@ type framer struct { fr *http2.Framer } -var writeBufferPoolMap = make(map[int]*sync.Pool) +var writeBufferPoolMap map[int]*sync.Pool = make(map[int]*sync.Pool) var writeBufferMutex sync.Mutex func newFramer(conn net.Conn, writeBufferSize, readBufferSize int, sharedWriteBuffer bool, maxHeaderListSize uint32) *framer { diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/proxy.go b/upstream/vendor/google.golang.org/grpc/internal/transport/proxy.go index 54b22443654..24fa1032574 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/proxy.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/proxy.go @@ -107,14 +107,8 @@ func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, backendAddr stri } return nil, fmt.Errorf("failed to do connect handshake, response: %q", dump) } - // The buffer could contain extra bytes from the target server, so we can't - // discard it. However, in many cases where the server waits for the client - // to send the first message (e.g. when TLS is being used), the buffer will - // be empty, so we can avoid the overhead of reading through this buffer. - if r.Buffered() != 0 { - return &bufConn{Conn: conn, r: r}, nil - } - return conn, nil + + return &bufConn{Conn: conn, r: r}, nil } // proxyDial dials, connecting to a proxy first if necessary. Checks if a proxy diff --git a/upstream/vendor/google.golang.org/grpc/internal/transport/transport.go b/upstream/vendor/google.golang.org/grpc/internal/transport/transport.go index fdd6fa86cc1..0d2a6e47f67 100644 --- a/upstream/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/upstream/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -22,6 +22,7 @@ package transport import ( + "bytes" "context" "errors" "fmt" @@ -36,7 +37,6 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" @@ -47,10 +47,32 @@ import ( const logLevel = 2 +type bufferPool struct { + pool sync.Pool +} + +func newBufferPool() *bufferPool { + return &bufferPool{ + pool: sync.Pool{ + New: func() any { + return new(bytes.Buffer) + }, + }, + } +} + +func (p *bufferPool) get() *bytes.Buffer { + return p.pool.Get().(*bytes.Buffer) +} + +func (p *bufferPool) put(b *bytes.Buffer) { + p.pool.Put(b) +} + // recvMsg represents the received msg from the transport. All transport // protocol specific info has been removed. type recvMsg struct { - buffer mem.Buffer + buffer *bytes.Buffer // nil: received some data // io.EOF: stream is completed. data is nil. // other non-nil error: transport failure. data is nil. @@ -80,9 +102,6 @@ func newRecvBuffer() *recvBuffer { func (b *recvBuffer) put(r recvMsg) { b.mu.Lock() if b.err != nil { - // drop the buffer on the floor. Since b.err is not nil, any subsequent reads - // will always return an error, making this buffer inaccessible. - r.buffer.Free() b.mu.Unlock() // An error had occurred earlier, don't accept more // data or errors. @@ -129,97 +148,45 @@ type recvBufferReader struct { ctx context.Context ctxDone <-chan struct{} // cache of ctx.Done() (for performance). recv *recvBuffer - last mem.Buffer // Stores the remaining data in the previous calls. + last *bytes.Buffer // Stores the remaining data in the previous calls. err error + freeBuffer func(*bytes.Buffer) } -func (r *recvBufferReader) ReadHeader(header []byte) (n int, err error) { +// Read reads the next len(p) bytes from last. If last is drained, it tries to +// read additional data from recv. It blocks if there no additional data available +// in recv. If Read returns any non-nil error, it will continue to return that error. +func (r *recvBufferReader) Read(p []byte) (n int, err error) { if r.err != nil { return 0, r.err } if r.last != nil { - n, r.last = mem.ReadUnsafe(header, r.last) - return n, nil - } - if r.closeStream != nil { - n, r.err = r.readHeaderClient(header) - } else { - n, r.err = r.readHeader(header) - } - return n, r.err -} - -// Read reads the next n bytes from last. If last is drained, it tries to read -// additional data from recv. It blocks if there no additional data available in -// recv. If Read returns any non-nil error, it will continue to return that -// error. -func (r *recvBufferReader) Read(n int) (buf mem.Buffer, err error) { - if r.err != nil { - return nil, r.err - } - if r.last != nil { - buf = r.last - if r.last.Len() > n { - buf, r.last = mem.SplitUnsafe(buf, n) - } else { + // Read remaining data left in last call. + copied, _ := r.last.Read(p) + if r.last.Len() == 0 { + r.freeBuffer(r.last) r.last = nil } - return buf, nil + return copied, nil } if r.closeStream != nil { - buf, r.err = r.readClient(n) + n, r.err = r.readClient(p) } else { - buf, r.err = r.read(n) + n, r.err = r.read(p) } - return buf, r.err + return n, r.err } -func (r *recvBufferReader) readHeader(header []byte) (n int, err error) { +func (r *recvBufferReader) read(p []byte) (n int, err error) { select { case <-r.ctxDone: return 0, ContextErr(r.ctx.Err()) case m := <-r.recv.get(): - return r.readHeaderAdditional(m, header) - } -} - -func (r *recvBufferReader) read(n int) (buf mem.Buffer, err error) { - select { - case <-r.ctxDone: - return nil, ContextErr(r.ctx.Err()) - case m := <-r.recv.get(): - return r.readAdditional(m, n) - } -} - -func (r *recvBufferReader) readHeaderClient(header []byte) (n int, err error) { - // If the context is canceled, then closes the stream with nil metadata. - // closeStream writes its error parameter to r.recv as a recvMsg. - // r.readAdditional acts on that message and returns the necessary error. - select { - case <-r.ctxDone: - // Note that this adds the ctx error to the end of recv buffer, and - // reads from the head. This will delay the error until recv buffer is - // empty, thus will delay ctx cancellation in Recv(). - // - // It's done this way to fix a race between ctx cancel and trailer. The - // race was, stream.Recv() may return ctx error if ctxDone wins the - // race, but stream.Trailer() may return a non-nil md because the stream - // was not marked as done when trailer is received. This closeStream - // call will mark stream as done, thus fix the race. - // - // TODO: delaying ctx error seems like a unnecessary side effect. What - // we really want is to mark the stream as done, and return ctx error - // faster. - r.closeStream(ContextErr(r.ctx.Err())) - m := <-r.recv.get() - return r.readHeaderAdditional(m, header) - case m := <-r.recv.get(): - return r.readHeaderAdditional(m, header) + return r.readAdditional(m, p) } } -func (r *recvBufferReader) readClient(n int) (buf mem.Buffer, err error) { +func (r *recvBufferReader) readClient(p []byte) (n int, err error) { // If the context is canceled, then closes the stream with nil metadata. // closeStream writes its error parameter to r.recv as a recvMsg. // r.readAdditional acts on that message and returns the necessary error. @@ -240,40 +207,25 @@ func (r *recvBufferReader) readClient(n int) (buf mem.Buffer, err error) { // faster. r.closeStream(ContextErr(r.ctx.Err())) m := <-r.recv.get() - return r.readAdditional(m, n) + return r.readAdditional(m, p) case m := <-r.recv.get(): - return r.readAdditional(m, n) + return r.readAdditional(m, p) } } -func (r *recvBufferReader) readHeaderAdditional(m recvMsg, header []byte) (n int, err error) { +func (r *recvBufferReader) readAdditional(m recvMsg, p []byte) (n int, err error) { r.recv.load() if m.err != nil { - if m.buffer != nil { - m.buffer.Free() - } return 0, m.err } - - n, r.last = mem.ReadUnsafe(header, m.buffer) - - return n, nil -} - -func (r *recvBufferReader) readAdditional(m recvMsg, n int) (b mem.Buffer, err error) { - r.recv.load() - if m.err != nil { - if m.buffer != nil { - m.buffer.Free() - } - return nil, m.err - } - - if m.buffer.Len() > n { - m.buffer, r.last = mem.SplitUnsafe(m.buffer, n) + copied, _ := m.buffer.Read(p) + if m.buffer.Len() == 0 { + r.freeBuffer(m.buffer) + r.last = nil + } else { + r.last = m.buffer } - - return m.buffer, nil + return copied, nil } type streamState uint32 @@ -289,7 +241,7 @@ const ( type Stream struct { id uint32 st ServerTransport // nil for client side Stream - ct ClientTransport // nil for server side Stream + ct *http2Client // nil for server side Stream ctx context.Context // the associated context of the stream cancel context.CancelFunc // always nil for client side Stream done chan struct{} // closed at the end of stream to unblock writers. On the client side. @@ -299,7 +251,7 @@ type Stream struct { recvCompress string sendCompress string buf *recvBuffer - trReader *transportReader + trReader io.Reader fc *inFlow wq *writeQuota @@ -352,7 +304,7 @@ func (s *Stream) isHeaderSent() bool { } // updateHeaderSent updates headerSent and returns true -// if it was already set. It is valid only on server-side. +// if it was alreay set. It is valid only on server-side. func (s *Stream) updateHeaderSent() bool { return atomic.SwapUint32(&s.headerSent, 1) == 1 } @@ -456,7 +408,7 @@ func (s *Stream) TrailersOnly() bool { return s.noHeaders } -// Trailer returns the cached trailer metadata. Note that if it is not called +// Trailer returns the cached trailer metedata. Note that if it is not called // after the entire stream is done, it could return an empty MD. Client // side only. // It can be safely read only after stream has ended that is either read @@ -547,87 +499,36 @@ func (s *Stream) write(m recvMsg) { s.buf.put(m) } -func (s *Stream) ReadHeader(header []byte) (err error) { - // Don't request a read if there was an error earlier - if er := s.trReader.er; er != nil { - return er - } - s.requestRead(len(header)) - for len(header) != 0 { - n, err := s.trReader.ReadHeader(header) - header = header[n:] - if len(header) == 0 { - err = nil - } - if err != nil { - if n > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - } - return nil -} - -// Read reads n bytes from the wire for this stream. -func (s *Stream) Read(n int) (data mem.BufferSlice, err error) { +// Read reads all p bytes from the wire for this stream. +func (s *Stream) Read(p []byte) (n int, err error) { // Don't request a read if there was an error earlier - if er := s.trReader.er; er != nil { - return nil, er + if er := s.trReader.(*transportReader).er; er != nil { + return 0, er } - s.requestRead(n) - for n != 0 { - buf, err := s.trReader.Read(n) - var bufLen int - if buf != nil { - bufLen = buf.Len() - } - n -= bufLen - if n == 0 { - err = nil - } - if err != nil { - if bufLen > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - data.Free() - return nil, err - } - data = append(data, buf) - } - return data, nil + s.requestRead(len(p)) + return io.ReadFull(s.trReader, p) } -// transportReader reads all the data available for this Stream from the transport and +// tranportReader reads all the data available for this Stream from the transport and // passes them into the decoder, which converts them into a gRPC message stream. // The error is io.EOF when the stream is done or another non-nil error if // the stream broke. type transportReader struct { - reader *recvBufferReader + reader io.Reader // The handler to control the window update procedure for both this // particular stream and the associated transport. windowHandler func(int) er error } -func (t *transportReader) ReadHeader(header []byte) (int, error) { - n, err := t.reader.ReadHeader(header) - if err != nil { - t.er = err - return 0, err - } - t.windowHandler(len(header)) - return n, nil -} - -func (t *transportReader) Read(n int) (mem.Buffer, error) { - buf, err := t.reader.Read(n) +func (t *transportReader) Read(p []byte) (n int, err error) { + n, err = t.reader.Read(p) if err != nil { t.er = err - return buf, err + return } - t.windowHandler(buf.Len()) - return buf, nil + t.windowHandler(n) + return } // BytesReceived indicates whether any bytes have been received on this stream. @@ -673,7 +574,6 @@ type ServerConfig struct { ChannelzParent *channelz.Server MaxHeaderListSize *uint32 HeaderTableSize *uint32 - BufferPool mem.BufferPool } // ConnectOptions covers all relevant options for communicating with the server. @@ -712,8 +612,6 @@ type ConnectOptions struct { MaxHeaderListSize *uint32 // UseProxy specifies if a proxy should be used. UseProxy bool - // The mem.BufferPool to use when reading/writing to the wire. - BufferPool mem.BufferPool } // NewClientTransport establishes the transport with the required ConnectOptions @@ -775,7 +673,7 @@ type ClientTransport interface { // Write sends the data for the given stream. A nil stream indicates // the write is to be performed on the transport as a whole. - Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error + Write(s *Stream, hdr []byte, data []byte, opts *Options) error // NewStream creates a Stream for an RPC. NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error) @@ -827,7 +725,7 @@ type ServerTransport interface { // Write sends the data for the given stream. // Write may not be called on all streams. - Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error + Write(s *Stream, hdr []byte, data []byte, opts *Options) error // WriteStatus sends the status of a stream to the client. WriteStatus is // the final call made on a stream and always occurs. @@ -900,7 +798,7 @@ var ( // connection is draining. This could be caused by goaway or balancer // removing the address. errStreamDrain = status.Error(codes.Unavailable, "the connection is draining") - // errStreamDone is returned from write at the client side to indicate application + // errStreamDone is returned from write at the client side to indiacte application // layer of an error. errStreamDone = errors.New("the stream is done") // StatusGoAway indicates that the server sent a GOAWAY that included this diff --git a/upstream/vendor/google.golang.org/grpc/keepalive/keepalive.go b/upstream/vendor/google.golang.org/grpc/keepalive/keepalive.go index eb42b19fb99..34d31b5e7d3 100644 --- a/upstream/vendor/google.golang.org/grpc/keepalive/keepalive.go +++ b/upstream/vendor/google.golang.org/grpc/keepalive/keepalive.go @@ -34,29 +34,15 @@ type ClientParameters struct { // After a duration of this time if the client doesn't see any activity it // pings the server to see if the transport is still alive. // If set below 10s, a minimum value of 10s will be used instead. - // - // Note that gRPC servers have a default EnforcementPolicy.MinTime of 5 - // minutes (which means the client shouldn't ping more frequently than every - // 5 minutes). - // - // Though not ideal, it's not a strong requirement for Time to be less than - // EnforcementPolicy.MinTime. Time will automatically double if the server - // disconnects due to its enforcement policy. - // - // For more details, see - // https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md - Time time.Duration + Time time.Duration // The current default value is infinity. // After having pinged for keepalive check, the client waits for a duration // of Timeout and if no activity is seen even after that the connection is // closed. - // - // If keepalive is enabled, and this value is not explicitly set, the default - // is 20 seconds. - Timeout time.Duration + Timeout time.Duration // The current default value is 20 seconds. // If true, client sends keepalive pings even with no active RPCs. If false, // when there are no active RPCs, Time and Timeout will be ignored and no // keepalive pings will be sent. - PermitWithoutStream bool + PermitWithoutStream bool // false by default. } // ServerParameters is used to set keepalive and max-age parameters on the diff --git a/upstream/vendor/google.golang.org/grpc/mem/buffer_pool.go b/upstream/vendor/google.golang.org/grpc/mem/buffer_pool.go deleted file mode 100644 index c37c58c0233..00000000000 --- a/upstream/vendor/google.golang.org/grpc/mem/buffer_pool.go +++ /dev/null @@ -1,194 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package mem - -import ( - "sort" - "sync" - - "google.golang.org/grpc/internal" -) - -// BufferPool is a pool of buffers that can be shared and reused, resulting in -// decreased memory allocation. -type BufferPool interface { - // Get returns a buffer with specified length from the pool. - Get(length int) *[]byte - - // Put returns a buffer to the pool. - Put(*[]byte) -} - -var defaultBufferPoolSizes = []int{ - 256, - 4 << 10, // 4KB (go page size) - 16 << 10, // 16KB (max HTTP/2 frame size used by gRPC) - 32 << 10, // 32KB (default buffer size for io.Copy) - 1 << 20, // 1MB -} - -var defaultBufferPool BufferPool - -func init() { - defaultBufferPool = NewTieredBufferPool(defaultBufferPoolSizes...) - - internal.SetDefaultBufferPoolForTesting = func(pool BufferPool) { - defaultBufferPool = pool - } - - internal.SetBufferPoolingThresholdForTesting = func(threshold int) { - bufferPoolingThreshold = threshold - } -} - -// DefaultBufferPool returns the current default buffer pool. It is a BufferPool -// created with NewBufferPool that uses a set of default sizes optimized for -// expected workflows. -func DefaultBufferPool() BufferPool { - return defaultBufferPool -} - -// NewTieredBufferPool returns a BufferPool implementation that uses multiple -// underlying pools of the given pool sizes. -func NewTieredBufferPool(poolSizes ...int) BufferPool { - sort.Ints(poolSizes) - pools := make([]*sizedBufferPool, len(poolSizes)) - for i, s := range poolSizes { - pools[i] = newSizedBufferPool(s) - } - return &tieredBufferPool{ - sizedPools: pools, - } -} - -// tieredBufferPool implements the BufferPool interface with multiple tiers of -// buffer pools for different sizes of buffers. -type tieredBufferPool struct { - sizedPools []*sizedBufferPool - fallbackPool simpleBufferPool -} - -func (p *tieredBufferPool) Get(size int) *[]byte { - return p.getPool(size).Get(size) -} - -func (p *tieredBufferPool) Put(buf *[]byte) { - p.getPool(cap(*buf)).Put(buf) -} - -func (p *tieredBufferPool) getPool(size int) BufferPool { - poolIdx := sort.Search(len(p.sizedPools), func(i int) bool { - return p.sizedPools[i].defaultSize >= size - }) - - if poolIdx == len(p.sizedPools) { - return &p.fallbackPool - } - - return p.sizedPools[poolIdx] -} - -// sizedBufferPool is a BufferPool implementation that is optimized for specific -// buffer sizes. For example, HTTP/2 frames within gRPC have a default max size -// of 16kb and a sizedBufferPool can be configured to only return buffers with a -// capacity of 16kb. Note that however it does not support returning larger -// buffers and in fact panics if such a buffer is requested. Because of this, -// this BufferPool implementation is not meant to be used on its own and rather -// is intended to be embedded in a tieredBufferPool such that Get is only -// invoked when the required size is smaller than or equal to defaultSize. -type sizedBufferPool struct { - pool sync.Pool - defaultSize int -} - -func (p *sizedBufferPool) Get(size int) *[]byte { - buf := p.pool.Get().(*[]byte) - b := *buf - clear(b[:cap(b)]) - *buf = b[:size] - return buf -} - -func (p *sizedBufferPool) Put(buf *[]byte) { - if cap(*buf) < p.defaultSize { - // Ignore buffers that are too small to fit in the pool. Otherwise, when - // Get is called it will panic as it tries to index outside the bounds - // of the buffer. - return - } - p.pool.Put(buf) -} - -func newSizedBufferPool(size int) *sizedBufferPool { - return &sizedBufferPool{ - pool: sync.Pool{ - New: func() any { - buf := make([]byte, size) - return &buf - }, - }, - defaultSize: size, - } -} - -var _ BufferPool = (*simpleBufferPool)(nil) - -// simpleBufferPool is an implementation of the BufferPool interface that -// attempts to pool buffers with a sync.Pool. When Get is invoked, it tries to -// acquire a buffer from the pool but if that buffer is too small, it returns it -// to the pool and creates a new one. -type simpleBufferPool struct { - pool sync.Pool -} - -func (p *simpleBufferPool) Get(size int) *[]byte { - bs, ok := p.pool.Get().(*[]byte) - if ok && cap(*bs) >= size { - *bs = (*bs)[:size] - return bs - } - - // A buffer was pulled from the pool, but it is too small. Put it back in - // the pool and create one large enough. - if ok { - p.pool.Put(bs) - } - - b := make([]byte, size) - return &b -} - -func (p *simpleBufferPool) Put(buf *[]byte) { - p.pool.Put(buf) -} - -var _ BufferPool = NopBufferPool{} - -// NopBufferPool is a buffer pool that returns new buffers without pooling. -type NopBufferPool struct{} - -// Get returns a buffer with specified length from the pool. -func (NopBufferPool) Get(length int) *[]byte { - b := make([]byte, length) - return &b -} - -// Put returns a buffer to the pool. -func (NopBufferPool) Put(*[]byte) { -} diff --git a/upstream/vendor/google.golang.org/grpc/mem/buffer_slice.go b/upstream/vendor/google.golang.org/grpc/mem/buffer_slice.go deleted file mode 100644 index 228e9c2f20f..00000000000 --- a/upstream/vendor/google.golang.org/grpc/mem/buffer_slice.go +++ /dev/null @@ -1,226 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package mem - -import ( - "io" -) - -// BufferSlice offers a means to represent data that spans one or more Buffer -// instances. A BufferSlice is meant to be immutable after creation, and methods -// like Ref create and return copies of the slice. This is why all methods have -// value receivers rather than pointer receivers. -// -// Note that any of the methods that read the underlying buffers such as Ref, -// Len or CopyTo etc., will panic if any underlying buffers have already been -// freed. It is recommended to not directly interact with any of the underlying -// buffers directly, rather such interactions should be mediated through the -// various methods on this type. -// -// By convention, any APIs that return (mem.BufferSlice, error) should reduce -// the burden on the caller by never returning a mem.BufferSlice that needs to -// be freed if the error is non-nil, unless explicitly stated. -type BufferSlice []Buffer - -// Len returns the sum of the length of all the Buffers in this slice. -// -// # Warning -// -// Invoking the built-in len on a BufferSlice will return the number of buffers -// in the slice, and *not* the value returned by this function. -func (s BufferSlice) Len() int { - var length int - for _, b := range s { - length += b.Len() - } - return length -} - -// Ref invokes Ref on each buffer in the slice. -func (s BufferSlice) Ref() { - for _, b := range s { - b.Ref() - } -} - -// Free invokes Buffer.Free() on each Buffer in the slice. -func (s BufferSlice) Free() { - for _, b := range s { - b.Free() - } -} - -// CopyTo copies each of the underlying Buffer's data into the given buffer, -// returning the number of bytes copied. Has the same semantics as the copy -// builtin in that it will copy as many bytes as it can, stopping when either dst -// is full or s runs out of data, returning the minimum of s.Len() and len(dst). -func (s BufferSlice) CopyTo(dst []byte) int { - off := 0 - for _, b := range s { - off += copy(dst[off:], b.ReadOnlyData()) - } - return off -} - -// Materialize concatenates all the underlying Buffer's data into a single -// contiguous buffer using CopyTo. -func (s BufferSlice) Materialize() []byte { - l := s.Len() - if l == 0 { - return nil - } - out := make([]byte, l) - s.CopyTo(out) - return out -} - -// MaterializeToBuffer functions like Materialize except that it writes the data -// to a single Buffer pulled from the given BufferPool. -// -// As a special case, if the input BufferSlice only actually has one Buffer, this -// function simply increases the refcount before returning said Buffer. Freeing this -// buffer won't release it until the BufferSlice is itself released. -func (s BufferSlice) MaterializeToBuffer(pool BufferPool) Buffer { - if len(s) == 1 { - s[0].Ref() - return s[0] - } - sLen := s.Len() - if sLen == 0 { - return emptyBuffer{} - } - buf := pool.Get(sLen) - s.CopyTo(*buf) - return NewBuffer(buf, pool) -} - -// Reader returns a new Reader for the input slice after taking references to -// each underlying buffer. -func (s BufferSlice) Reader() Reader { - s.Ref() - return &sliceReader{ - data: s, - len: s.Len(), - } -} - -// Reader exposes a BufferSlice's data as an io.Reader, allowing it to interface -// with other parts systems. It also provides an additional convenience method -// Remaining(), which returns the number of unread bytes remaining in the slice. -// Buffers will be freed as they are read. -type Reader interface { - io.Reader - io.ByteReader - // Close frees the underlying BufferSlice and never returns an error. Subsequent - // calls to Read will return (0, io.EOF). - Close() error - // Remaining returns the number of unread bytes remaining in the slice. - Remaining() int -} - -type sliceReader struct { - data BufferSlice - len int - // The index into data[0].ReadOnlyData(). - bufferIdx int -} - -func (r *sliceReader) Remaining() int { - return r.len -} - -func (r *sliceReader) Close() error { - r.data.Free() - r.data = nil - r.len = 0 - return nil -} - -func (r *sliceReader) freeFirstBufferIfEmpty() bool { - if len(r.data) == 0 || r.bufferIdx != len(r.data[0].ReadOnlyData()) { - return false - } - - r.data[0].Free() - r.data = r.data[1:] - r.bufferIdx = 0 - return true -} - -func (r *sliceReader) Read(buf []byte) (n int, _ error) { - if r.len == 0 { - return 0, io.EOF - } - - for len(buf) != 0 && r.len != 0 { - // Copy as much as possible from the first Buffer in the slice into the - // given byte slice. - data := r.data[0].ReadOnlyData() - copied := copy(buf, data[r.bufferIdx:]) - r.len -= copied // Reduce len by the number of bytes copied. - r.bufferIdx += copied // Increment the buffer index. - n += copied // Increment the total number of bytes read. - buf = buf[copied:] // Shrink the given byte slice. - - // If we have copied all the data from the first Buffer, free it and advance to - // the next in the slice. - r.freeFirstBufferIfEmpty() - } - - return n, nil -} - -func (r *sliceReader) ReadByte() (byte, error) { - if r.len == 0 { - return 0, io.EOF - } - - // There may be any number of empty buffers in the slice, clear them all until a - // non-empty buffer is reached. This is guaranteed to exit since r.len is not 0. - for r.freeFirstBufferIfEmpty() { - } - - b := r.data[0].ReadOnlyData()[r.bufferIdx] - r.len-- - r.bufferIdx++ - // Free the first buffer in the slice if the last byte was read - r.freeFirstBufferIfEmpty() - return b, nil -} - -var _ io.Writer = (*writer)(nil) - -type writer struct { - buffers *BufferSlice - pool BufferPool -} - -func (w *writer) Write(p []byte) (n int, err error) { - b := Copy(p, w.pool) - *w.buffers = append(*w.buffers, b) - return b.Len(), nil -} - -// NewWriter wraps the given BufferSlice and BufferPool to implement the -// io.Writer interface. Every call to Write copies the contents of the given -// buffer into a new Buffer pulled from the given pool and the Buffer is added to -// the given BufferSlice. -func NewWriter(buffers *BufferSlice, pool BufferPool) io.Writer { - return &writer{buffers: buffers, pool: pool} -} diff --git a/upstream/vendor/google.golang.org/grpc/mem/buffers.go b/upstream/vendor/google.golang.org/grpc/mem/buffers.go deleted file mode 100644 index 4d66b2ccc2b..00000000000 --- a/upstream/vendor/google.golang.org/grpc/mem/buffers.go +++ /dev/null @@ -1,252 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package mem provides utilities that facilitate memory reuse in byte slices -// that are used as buffers. -// -// # Experimental -// -// Notice: All APIs in this package are EXPERIMENTAL and may be changed or -// removed in a later release. -package mem - -import ( - "fmt" - "sync" - "sync/atomic" -) - -// A Buffer represents a reference counted piece of data (in bytes) that can be -// acquired by a call to NewBuffer() or Copy(). A reference to a Buffer may be -// released by calling Free(), which invokes the free function given at creation -// only after all references are released. -// -// Note that a Buffer is not safe for concurrent access and instead each -// goroutine should use its own reference to the data, which can be acquired via -// a call to Ref(). -// -// Attempts to access the underlying data after releasing the reference to the -// Buffer will panic. -type Buffer interface { - // ReadOnlyData returns the underlying byte slice. Note that it is undefined - // behavior to modify the contents of this slice in any way. - ReadOnlyData() []byte - // Ref increases the reference counter for this Buffer. - Ref() - // Free decrements this Buffer's reference counter and frees the underlying - // byte slice if the counter reaches 0 as a result of this call. - Free() - // Len returns the Buffer's size. - Len() int - - split(n int) (left, right Buffer) - read(buf []byte) (int, Buffer) -} - -var ( - bufferPoolingThreshold = 1 << 10 - - bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} - refObjectPool = sync.Pool{New: func() any { return new(atomic.Int32) }} -) - -func IsBelowBufferPoolingThreshold(size int) bool { - return size <= bufferPoolingThreshold -} - -type buffer struct { - origData *[]byte - data []byte - refs *atomic.Int32 - pool BufferPool -} - -func newBuffer() *buffer { - return bufferObjectPool.Get().(*buffer) -} - -// NewBuffer creates a new Buffer from the given data, initializing the reference -// counter to 1. The data will then be returned to the given pool when all -// references to the returned Buffer are released. As a special case to avoid -// additional allocations, if the given buffer pool is nil, the returned buffer -// will be a "no-op" Buffer where invoking Buffer.Free() does nothing and the -// underlying data is never freed. -// -// Note that the backing array of the given data is not copied. -func NewBuffer(data *[]byte, pool BufferPool) Buffer { - if pool == nil || IsBelowBufferPoolingThreshold(len(*data)) { - return (SliceBuffer)(*data) - } - b := newBuffer() - b.origData = data - b.data = *data - b.pool = pool - b.refs = refObjectPool.Get().(*atomic.Int32) - b.refs.Add(1) - return b -} - -// Copy creates a new Buffer from the given data, initializing the reference -// counter to 1. -// -// It acquires a []byte from the given pool and copies over the backing array -// of the given data. The []byte acquired from the pool is returned to the -// pool when all references to the returned Buffer are released. -func Copy(data []byte, pool BufferPool) Buffer { - if IsBelowBufferPoolingThreshold(len(data)) { - buf := make(SliceBuffer, len(data)) - copy(buf, data) - return buf - } - - buf := pool.Get(len(data)) - copy(*buf, data) - return NewBuffer(buf, pool) -} - -func (b *buffer) ReadOnlyData() []byte { - if b.refs == nil { - panic("Cannot read freed buffer") - } - return b.data -} - -func (b *buffer) Ref() { - if b.refs == nil { - panic("Cannot ref freed buffer") - } - b.refs.Add(1) -} - -func (b *buffer) Free() { - if b.refs == nil { - panic("Cannot free freed buffer") - } - - refs := b.refs.Add(-1) - switch { - case refs > 0: - return - case refs == 0: - if b.pool != nil { - b.pool.Put(b.origData) - } - - refObjectPool.Put(b.refs) - b.origData = nil - b.data = nil - b.refs = nil - b.pool = nil - bufferObjectPool.Put(b) - default: - panic("Cannot free freed buffer") - } -} - -func (b *buffer) Len() int { - return len(b.ReadOnlyData()) -} - -func (b *buffer) split(n int) (Buffer, Buffer) { - if b.refs == nil { - panic("Cannot split freed buffer") - } - - b.refs.Add(1) - split := newBuffer() - split.origData = b.origData - split.data = b.data[n:] - split.refs = b.refs - split.pool = b.pool - - b.data = b.data[:n] - - return b, split -} - -func (b *buffer) read(buf []byte) (int, Buffer) { - if b.refs == nil { - panic("Cannot read freed buffer") - } - - n := copy(buf, b.data) - if n == len(b.data) { - b.Free() - return n, nil - } - - b.data = b.data[n:] - return n, b -} - -// String returns a string representation of the buffer. May be used for -// debugging purposes. -func (b *buffer) String() string { - return fmt.Sprintf("mem.Buffer(%p, data: %p, length: %d)", b, b.ReadOnlyData(), len(b.ReadOnlyData())) -} - -func ReadUnsafe(dst []byte, buf Buffer) (int, Buffer) { - return buf.read(dst) -} - -// SplitUnsafe modifies the receiver to point to the first n bytes while it -// returns a new reference to the remaining bytes. The returned Buffer functions -// just like a normal reference acquired using Ref(). -func SplitUnsafe(buf Buffer, n int) (left, right Buffer) { - return buf.split(n) -} - -type emptyBuffer struct{} - -func (e emptyBuffer) ReadOnlyData() []byte { - return nil -} - -func (e emptyBuffer) Ref() {} -func (e emptyBuffer) Free() {} - -func (e emptyBuffer) Len() int { - return 0 -} - -func (e emptyBuffer) split(int) (left, right Buffer) { - return e, e -} - -func (e emptyBuffer) read([]byte) (int, Buffer) { - return 0, e -} - -type SliceBuffer []byte - -func (s SliceBuffer) ReadOnlyData() []byte { return s } -func (s SliceBuffer) Ref() {} -func (s SliceBuffer) Free() {} -func (s SliceBuffer) Len() int { return len(s) } - -func (s SliceBuffer) split(n int) (left, right Buffer) { - return s[:n], s[n:] -} - -func (s SliceBuffer) read(buf []byte) (int, Buffer) { - n := copy(buf, s) - if n == len(s) { - return n, nil - } - return n, s[n:] -} diff --git a/upstream/vendor/google.golang.org/grpc/metadata/metadata.go b/upstream/vendor/google.golang.org/grpc/metadata/metadata.go index d2e15253bbf..1e9485fd6e2 100644 --- a/upstream/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/upstream/vendor/google.golang.org/grpc/metadata/metadata.go @@ -213,6 +213,11 @@ func FromIncomingContext(ctx context.Context) (MD, bool) { // ValueFromIncomingContext returns the metadata value corresponding to the metadata // key from the incoming metadata if it exists. Keys are matched in a case insensitive // manner. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. func ValueFromIncomingContext(ctx context.Context, key string) []string { md, ok := ctx.Value(mdIncomingKey{}).(MD) if !ok { @@ -223,7 +228,7 @@ func ValueFromIncomingContext(ctx context.Context, key string) []string { return copyOf(v) } for k, v := range md { - // Case insensitive comparison: MD is a map, and there's no guarantee + // Case insenitive comparison: MD is a map, and there's no guarantee // that the MD attached to the context is created using our helper // functions. if strings.EqualFold(k, key) { diff --git a/upstream/vendor/google.golang.org/grpc/peer/peer.go b/upstream/vendor/google.golang.org/grpc/peer/peer.go index 499a49c8c1c..a821ff9b2b7 100644 --- a/upstream/vendor/google.golang.org/grpc/peer/peer.go +++ b/upstream/vendor/google.golang.org/grpc/peer/peer.go @@ -22,9 +22,7 @@ package peer import ( "context" - "fmt" "net" - "strings" "google.golang.org/grpc/credentials" ) @@ -41,34 +39,6 @@ type Peer struct { AuthInfo credentials.AuthInfo } -// String ensures the Peer types implements the Stringer interface in order to -// allow to print a context with a peerKey value effectively. -func (p *Peer) String() string { - if p == nil { - return "Peer<nil>" - } - sb := &strings.Builder{} - sb.WriteString("Peer{") - if p.Addr != nil { - fmt.Fprintf(sb, "Addr: '%s', ", p.Addr.String()) - } else { - fmt.Fprintf(sb, "Addr: <nil>, ") - } - if p.LocalAddr != nil { - fmt.Fprintf(sb, "LocalAddr: '%s', ", p.LocalAddr.String()) - } else { - fmt.Fprintf(sb, "LocalAddr: <nil>, ") - } - if p.AuthInfo != nil { - fmt.Fprintf(sb, "AuthInfo: '%s'", p.AuthInfo.AuthType()) - } else { - fmt.Fprintf(sb, "AuthInfo: <nil>") - } - sb.WriteString("}") - - return sb.String() -} - type peerKey struct{} // NewContext creates a new context with peer information attached. diff --git a/upstream/vendor/google.golang.org/grpc/picker_wrapper.go b/upstream/vendor/google.golang.org/grpc/picker_wrapper.go index bdaa2130e48..bf56faa76d3 100644 --- a/upstream/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/upstream/vendor/google.golang.org/grpc/picker_wrapper.go @@ -20,9 +20,8 @@ package grpc import ( "context" - "fmt" "io" - "sync/atomic" + "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" @@ -33,43 +32,35 @@ import ( "google.golang.org/grpc/status" ) -// pickerGeneration stores a picker and a channel used to signal that a picker -// newer than this one is available. -type pickerGeneration struct { - // picker is the picker produced by the LB policy. May be nil if a picker - // has never been produced. - picker balancer.Picker - // blockingCh is closed when the picker has been invalidated because there - // is a new one available. - blockingCh chan struct{} -} - // pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick // actions and unblock when there's a picker update. type pickerWrapper struct { - // If pickerGen holds a nil pointer, the pickerWrapper is closed. - pickerGen atomic.Pointer[pickerGeneration] + mu sync.Mutex + done bool + blockingCh chan struct{} + picker balancer.Picker statsHandlers []stats.Handler // to record blocking picker calls } func newPickerWrapper(statsHandlers []stats.Handler) *pickerWrapper { - pw := &pickerWrapper{ + return &pickerWrapper{ + blockingCh: make(chan struct{}), statsHandlers: statsHandlers, } - pw.pickerGen.Store(&pickerGeneration{ - blockingCh: make(chan struct{}), - }) - return pw } -// updatePicker is called by UpdateState calls from the LB policy. It -// unblocks all blocked pick. +// updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. func (pw *pickerWrapper) updatePicker(p balancer.Picker) { - old := pw.pickerGen.Swap(&pickerGeneration{ - picker: p, - blockingCh: make(chan struct{}), - }) - close(old.blockingCh) + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() + return + } + pw.picker = p + // pw.blockingCh should never be nil. + close(pw.blockingCh) + pw.blockingCh = make(chan struct{}) + pw.mu.Unlock() } // doneChannelzWrapper performs the following: @@ -106,24 +97,27 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. var lastPickErr error for { - pg := pw.pickerGen.Load() - if pg == nil { + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() return nil, balancer.PickResult{}, ErrClientConnClosing } - if pg.picker == nil { - ch = pg.blockingCh + + if pw.picker == nil { + ch = pw.blockingCh } - if ch == pg.blockingCh { + if ch == pw.blockingCh { // This could happen when either: // - pw.picker is nil (the previous if condition), or - // - we have already called pick on the current picker. + // - has called pick on the current picker. + pw.mu.Unlock() select { case <-ctx.Done(): var errStr string if lastPickErr != nil { errStr = "latest balancer error: " + lastPickErr.Error() } else { - errStr = fmt.Sprintf("received context error while waiting for new LB policy update: %s", ctx.Err().Error()) + errStr = ctx.Err().Error() } switch ctx.Err() { case context.DeadlineExceeded: @@ -150,8 +144,9 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. } } - ch = pg.blockingCh - p := pg.picker + ch = pw.blockingCh + p := pw.picker + pw.mu.Unlock() pickResult, err := p.Pick(info) if err != nil { @@ -201,15 +196,24 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. } func (pw *pickerWrapper) close() { - old := pw.pickerGen.Swap(nil) - close(old.blockingCh) + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { + return + } + pw.done = true + close(pw.blockingCh) } // reset clears the pickerWrapper and prepares it for being used again when idle // mode is exited. func (pw *pickerWrapper) reset() { - old := pw.pickerGen.Swap(&pickerGeneration{blockingCh: make(chan struct{})}) - close(old.blockingCh) + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { + return + } + pw.blockingCh = make(chan struct{}) } // dropError is a wrapper error that indicates the LB policy wishes to drop the diff --git a/upstream/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go b/upstream/vendor/google.golang.org/grpc/pickfirst.go similarity index 72% rename from upstream/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go rename to upstream/vendor/google.golang.org/grpc/pickfirst.go index 4d69b4052f8..e3ea42ba962 100644 --- a/upstream/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go +++ b/upstream/vendor/google.golang.org/grpc/pickfirst.go @@ -16,55 +16,45 @@ * */ -// Package pickfirst contains the pick_first load balancing policy. -package pickfirst +package grpc import ( "encoding/json" "errors" "fmt" - "math/rand" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/internal" internalgrpclog "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) -func init() { - balancer.Register(pickfirstBuilder{}) - internal.ShuffleAddressListForTesting = func(n int, swap func(i, j int)) { rand.Shuffle(n, swap) } -} - -var logger = grpclog.Component("pick-first-lb") - const ( - // Name is the name of the pick_first balancer. - Name = "pick_first" - logPrefix = "[pick-first-lb %p] " + // PickFirstBalancerName is the name of the pick_first balancer. + PickFirstBalancerName = "pick_first" + logPrefix = "[pick-first-lb %p] " ) type pickfirstBuilder struct{} -func (pickfirstBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (pickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { b := &pickfirstBalancer{cc: cc} b.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(logPrefix, b)) return b } func (pickfirstBuilder) Name() string { - return Name + return PickFirstBalancerName } type pfConfig struct { serviceconfig.LoadBalancingConfig `json:"-"` // If set to true, instructs the LB policy to shuffle the order of the list - // of endpoints received from the name resolver before attempting to + // of addresses received from the name resolver before attempting to // connect to them. ShuffleAddressList bool `json:"shuffleAddressList"` } @@ -103,14 +93,9 @@ func (b *pickfirstBalancer) ResolverError(err error) { }) } -type Shuffler interface { - ShuffleAddressListForTesting(n int, swap func(i, j int)) -} - -func ShuffleAddressListForTesting(n int, swap func(i, j int)) { rand.Shuffle(n, swap) } - func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error { - if len(state.ResolverState.Addresses) == 0 && len(state.ResolverState.Endpoints) == 0 { + addrs := state.ResolverState.Addresses + if len(addrs) == 0 { // The resolver reported an empty address list. Treat it like an error by // calling b.ResolverError. if b.subConn != nil { @@ -122,49 +107,22 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState b.ResolverError(errors.New("produced zero addresses")) return balancer.ErrBadResolverState } + // We don't have to guard this block with the env var because ParseConfig // already does so. cfg, ok := state.BalancerConfig.(pfConfig) if state.BalancerConfig != nil && !ok { return fmt.Errorf("pickfirst: received illegal BalancerConfig (type %T): %v", state.BalancerConfig, state.BalancerConfig) } + if cfg.ShuffleAddressList { + addrs = append([]resolver.Address{}, addrs...) + grpcrand.Shuffle(len(addrs), func(i, j int) { addrs[i], addrs[j] = addrs[j], addrs[i] }) + } if b.logger.V(2) { b.logger.Infof("Received new config %s, resolver state %s", pretty.ToJSON(cfg), pretty.ToJSON(state.ResolverState)) } - var addrs []resolver.Address - if endpoints := state.ResolverState.Endpoints; len(endpoints) != 0 { - // Perform the optional shuffling described in gRFC A62. The shuffling will - // change the order of endpoints but not touch the order of the addresses - // within each endpoint. - A61 - if cfg.ShuffleAddressList { - endpoints = append([]resolver.Endpoint{}, endpoints...) - internal.ShuffleAddressListForTesting.(func(int, func(int, int)))(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) - } - - // "Flatten the list by concatenating the ordered list of addresses for each - // of the endpoints, in order." - A61 - for _, endpoint := range endpoints { - // "In the flattened list, interleave addresses from the two address - // families, as per RFC-8304 section 4." - A61 - // TODO: support the above language. - addrs = append(addrs, endpoint.Addresses...) - } - } else { - // Endpoints not set, process addresses until we migrate resolver - // emissions fully to Endpoints. The top channel does wrap emitted - // addresses with endpoints, however some balancers such as weighted - // target do not forward the corresponding correct endpoints down/split - // endpoints properly. Once all balancers correctly forward endpoints - // down, can delete this else conditional. - addrs = state.ResolverState.Addresses - if cfg.ShuffleAddressList { - addrs = append([]resolver.Address{}, addrs...) - rand.Shuffle(len(addrs), func(i, j int) { addrs[i], addrs[j] = addrs[j], addrs[i] }) - } - } - if b.subConn != nil { b.cc.UpdateAddresses(b.subConn, addrs) return nil diff --git a/upstream/vendor/google.golang.org/grpc/preloader.go b/upstream/vendor/google.golang.org/grpc/preloader.go index e87a17f36a5..73bd6336433 100644 --- a/upstream/vendor/google.golang.org/grpc/preloader.go +++ b/upstream/vendor/google.golang.org/grpc/preloader.go @@ -20,7 +20,6 @@ package grpc import ( "google.golang.org/grpc/codes" - "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) @@ -32,10 +31,9 @@ import ( // later release. type PreparedMsg struct { // Struct for preparing msg before sending them - encodedData mem.BufferSlice + encodedData []byte hdr []byte - payload mem.BufferSlice - pf payloadFormat + payload []byte } // Encode marshalls and compresses the message using the codec and compressor for the stream. @@ -59,27 +57,11 @@ func (p *PreparedMsg) Encode(s Stream, msg any) error { if err != nil { return err } - - materializedData := data.Materialize() - data.Free() - p.encodedData = mem.BufferSlice{mem.NewBuffer(&materializedData, nil)} - - // TODO: it should be possible to grab the bufferPool from the underlying - // stream implementation with a type cast to its actual type (such as - // addrConnStream) and accessing the buffer pool directly. - var compData mem.BufferSlice - compData, p.pf, err = compress(p.encodedData, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp, mem.DefaultBufferPool()) + p.encodedData = data + compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp) if err != nil { return err } - - if p.pf.isCompressed() { - materializedCompData := compData.Materialize() - compData.Free() - compData = mem.BufferSlice{mem.NewBuffer(&materializedCompData, nil)} - } - - p.hdr, p.payload = msgHeader(p.encodedData, compData, p.pf) - + p.hdr, p.payload = msgHeader(data, compData) return nil } diff --git a/upstream/vendor/google.golang.org/grpc/regenerate.sh b/upstream/vendor/google.golang.org/grpc/regenerate.sh new file mode 100644 index 00000000000..a6f26c8ab0f --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/regenerate.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# Copyright 2020 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eu -o pipefail + +WORKDIR=$(mktemp -d) + +function finish { + rm -rf "$WORKDIR" +} +trap finish EXIT + +export GOBIN=${WORKDIR}/bin +export PATH=${GOBIN}:${PATH} +mkdir -p ${GOBIN} + +echo "remove existing generated files" +# grpc_testing_not_regenerate/*.pb.go is not re-generated, +# see grpc_testing_not_regenerate/README.md for details. +rm -f $(find . -name '*.pb.go' | grep -v 'grpc_testing_not_regenerate') + +echo "go install google.golang.org/protobuf/cmd/protoc-gen-go" +(cd test/tools && go install google.golang.org/protobuf/cmd/protoc-gen-go) + +echo "go install cmd/protoc-gen-go-grpc" +(cd cmd/protoc-gen-go-grpc && go install .) + +echo "git clone https://github.com/grpc/grpc-proto" +git clone --quiet https://github.com/grpc/grpc-proto ${WORKDIR}/grpc-proto + +echo "git clone https://github.com/protocolbuffers/protobuf" +git clone --quiet https://github.com/protocolbuffers/protobuf ${WORKDIR}/protobuf + +# Pull in code.proto as a proto dependency +mkdir -p ${WORKDIR}/googleapis/google/rpc +echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto" +curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > ${WORKDIR}/googleapis/google/rpc/code.proto + +mkdir -p ${WORKDIR}/out + +# Generates sources without the embed requirement +LEGACY_SOURCES=( + ${WORKDIR}/grpc-proto/grpc/binlog/v1/binarylog.proto + ${WORKDIR}/grpc-proto/grpc/channelz/v1/channelz.proto + ${WORKDIR}/grpc-proto/grpc/health/v1/health.proto + ${WORKDIR}/grpc-proto/grpc/lb/v1/load_balancer.proto + profiling/proto/service.proto + ${WORKDIR}/grpc-proto/grpc/reflection/v1alpha/reflection.proto + ${WORKDIR}/grpc-proto/grpc/reflection/v1/reflection.proto +) + +# Generates only the new gRPC Service symbols +SOURCES=( + $(git ls-files --exclude-standard --cached --others "*.proto" | grep -v '^\(profiling/proto/service.proto\|reflection/grpc_reflection_v1alpha/reflection.proto\)$') + ${WORKDIR}/grpc-proto/grpc/gcp/altscontext.proto + ${WORKDIR}/grpc-proto/grpc/gcp/handshaker.proto + ${WORKDIR}/grpc-proto/grpc/gcp/transport_security_common.proto + ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls.proto + ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls_config.proto + ${WORKDIR}/grpc-proto/grpc/testing/*.proto + ${WORKDIR}/grpc-proto/grpc/core/*.proto +) + +# These options of the form 'Mfoo.proto=bar' instruct the codegen to use an +# import path of 'bar' in the generated code when 'foo.proto' is imported in +# one of the sources. +# +# Note that the protos listed here are all for testing purposes. All protos to +# be used externally should have a go_package option (and they don't need to be +# listed here). +OPTS=Mgrpc/core/stats.proto=google.golang.org/grpc/interop/grpc_testing/core,\ +Mgrpc/testing/benchmark_service.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/stats.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/report_qps_scenario_service.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/messages.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/worker_service.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/control.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/test.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/payloads.proto=google.golang.org/grpc/interop/grpc_testing,\ +Mgrpc/testing/empty.proto=google.golang.org/grpc/interop/grpc_testing + +for src in ${SOURCES[@]}; do + echo "protoc ${src}" + protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS}:${WORKDIR}/out \ + -I"." \ + -I${WORKDIR}/grpc-proto \ + -I${WORKDIR}/googleapis \ + -I${WORKDIR}/protobuf/src \ + ${src} +done + +for src in ${LEGACY_SOURCES[@]}; do + echo "protoc ${src}" + protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS},require_unimplemented_servers=false:${WORKDIR}/out \ + -I"." \ + -I${WORKDIR}/grpc-proto \ + -I${WORKDIR}/googleapis \ + -I${WORKDIR}/protobuf/src \ + ${src} +done + +# The go_package option in grpc/lookup/v1/rls.proto doesn't match the +# current location. Move it into the right place. +mkdir -p ${WORKDIR}/out/google.golang.org/grpc/internal/proto/grpc_lookup_v1 +mv ${WORKDIR}/out/google.golang.org/grpc/lookup/grpc_lookup_v1/* ${WORKDIR}/out/google.golang.org/grpc/internal/proto/grpc_lookup_v1 + +# grpc_testing_not_regenerate/*.pb.go are not re-generated, +# see grpc_testing_not_regenerate/README.md for details. +rm ${WORKDIR}/out/google.golang.org/grpc/reflection/grpc_testing_not_regenerate/*.pb.go + +cp -R ${WORKDIR}/out/google.golang.org/grpc/* . diff --git a/upstream/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/upstream/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go index ef3d6ed6c43..b54a3a3225d 100644 --- a/upstream/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go +++ b/upstream/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go @@ -18,6 +18,9 @@ // Package dns implements a dns resolver to be installed as the default resolver // in grpc. +// +// Deprecated: this package is imported by grpc and should not need to be +// imported directly by users. package dns import ( @@ -49,12 +52,3 @@ func SetResolvingTimeout(timeout time.Duration) { func NewBuilder() resolver.Builder { return dns.NewBuilder() } - -// SetMinResolutionInterval sets the default minimum interval at which DNS -// re-resolutions are allowed. This helps to prevent excessive re-resolution. -// -// It must be called only at application startup, before any gRPC calls are -// made. Modifying this value after initialization is not thread-safe. -func SetMinResolutionInterval(d time.Duration) { - dns.MinResolutionInterval = d -} diff --git a/upstream/vendor/google.golang.org/grpc/resolver/manual/manual.go b/upstream/vendor/google.golang.org/grpc/resolver/manual/manual.go index 09e864a89d3..f2efa2a2cb5 100644 --- a/upstream/vendor/google.golang.org/grpc/resolver/manual/manual.go +++ b/upstream/vendor/google.golang.org/grpc/resolver/manual/manual.go @@ -76,11 +76,9 @@ func (r *Resolver) InitialState(s resolver.State) { // Build returns itself for Resolver, because it's both a builder and a resolver. func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { + r.BuildCallback(target, cc, opts) r.mu.Lock() defer r.mu.Unlock() - // Call BuildCallback after locking to avoid a race when UpdateState - // or ReportError is called before Build returns. - r.BuildCallback(target, cc, opts) r.CC = cc if r.lastSeenState != nil { err := r.CC.UpdateState(*r.lastSeenState) diff --git a/upstream/vendor/google.golang.org/grpc/resolver_wrapper.go b/upstream/vendor/google.golang.org/grpc/resolver_wrapper.go index 23bb3fb2582..9dcc9780f89 100644 --- a/upstream/vendor/google.golang.org/grpc/resolver_wrapper.go +++ b/upstream/vendor/google.golang.org/grpc/resolver_wrapper.go @@ -66,7 +66,7 @@ func newCCResolverWrapper(cc *ClientConn) *ccResolverWrapper { // any newly created ccResolverWrapper, except that close may be called instead. func (ccr *ccResolverWrapper) start() error { errCh := make(chan error) - ccr.serializer.TrySchedule(func(ctx context.Context) { + ccr.serializer.Schedule(func(ctx context.Context) { if ctx.Err() != nil { return } @@ -85,7 +85,7 @@ func (ccr *ccResolverWrapper) start() error { } func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { - ccr.serializer.TrySchedule(func(ctx context.Context) { + ccr.serializer.Schedule(func(ctx context.Context) { if ctx.Err() != nil || ccr.resolver == nil { return } @@ -102,7 +102,7 @@ func (ccr *ccResolverWrapper) close() { ccr.closed = true ccr.mu.Unlock() - ccr.serializer.TrySchedule(func(context.Context) { + ccr.serializer.Schedule(func(context.Context) { if ccr.resolver == nil { return } @@ -171,15 +171,12 @@ func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { // ParseServiceConfig is called by resolver implementations to parse a JSON // representation of the service config. func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { - return parseServiceConfig(scJSON, ccr.cc.dopts.maxCallAttempts) + return parseServiceConfig(scJSON) } // addChannelzTraceEvent adds a channelz trace event containing the new // state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { - if !logger.V(0) && !channelz.IsOn() { - return - } var updates []string var oldSC, newSC *ServiceConfig var oldOK, newOK bool diff --git a/upstream/vendor/google.golang.org/grpc/rpc_util.go b/upstream/vendor/google.golang.org/grpc/rpc_util.go index 2d96f1405e8..998e251ddc4 100644 --- a/upstream/vendor/google.golang.org/grpc/rpc_util.go +++ b/upstream/vendor/google.golang.org/grpc/rpc_util.go @@ -19,6 +19,7 @@ package grpc import ( + "bytes" "compress/gzip" "context" "encoding/binary" @@ -34,7 +35,6 @@ import ( "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal/transport" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -220,8 +220,8 @@ type HeaderCallOption struct { HeaderAddr *metadata.MD } -func (o HeaderCallOption) before(*callInfo) error { return nil } -func (o HeaderCallOption) after(_ *callInfo, attempt *csAttempt) { +func (o HeaderCallOption) before(c *callInfo) error { return nil } +func (o HeaderCallOption) after(c *callInfo, attempt *csAttempt) { *o.HeaderAddr, _ = attempt.s.Header() } @@ -242,8 +242,8 @@ type TrailerCallOption struct { TrailerAddr *metadata.MD } -func (o TrailerCallOption) before(*callInfo) error { return nil } -func (o TrailerCallOption) after(_ *callInfo, attempt *csAttempt) { +func (o TrailerCallOption) before(c *callInfo) error { return nil } +func (o TrailerCallOption) after(c *callInfo, attempt *csAttempt) { *o.TrailerAddr = attempt.s.Trailer() } @@ -264,20 +264,24 @@ type PeerCallOption struct { PeerAddr *peer.Peer } -func (o PeerCallOption) before(*callInfo) error { return nil } -func (o PeerCallOption) after(_ *callInfo, attempt *csAttempt) { +func (o PeerCallOption) before(c *callInfo) error { return nil } +func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) { if x, ok := peer.FromContext(attempt.s.Context()); ok { *o.PeerAddr = *x } } -// WaitForReady configures the RPC's behavior when the client is in -// TRANSIENT_FAILURE, which occurs when all addresses fail to connect. If -// waitForReady is false, the RPC will fail immediately. Otherwise, the client -// will wait until a connection becomes available or the RPC's deadline is -// reached. +// WaitForReady configures the action to take when an RPC is attempted on broken +// connections or unreachable servers. If waitForReady is false and the +// connection is in the TRANSIENT_FAILURE state, the RPC will fail +// immediately. Otherwise, the RPC client will block the call until a +// connection is available (or the call is canceled or times out) and will +// retry the call if it fails due to a transient error. gRPC will not retry if +// data was written to the wire unless the server indicates it did not process +// the data. Please refer to +// https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md. // -// By default, RPCs do not "wait for ready". +// By default, RPCs don't "wait for ready". func WaitForReady(waitForReady bool) CallOption { return FailFastCallOption{FailFast: !waitForReady} } @@ -304,7 +308,7 @@ func (o FailFastCallOption) before(c *callInfo) error { c.failFast = o.FailFast return nil } -func (o FailFastCallOption) after(*callInfo, *csAttempt) {} +func (o FailFastCallOption) after(c *callInfo, attempt *csAttempt) {} // OnFinish returns a CallOption that configures a callback to be called when // the call completes. The error passed to the callback is the status of the @@ -339,7 +343,7 @@ func (o OnFinishCallOption) before(c *callInfo) error { return nil } -func (o OnFinishCallOption) after(*callInfo, *csAttempt) {} +func (o OnFinishCallOption) after(c *callInfo, attempt *csAttempt) {} // MaxCallRecvMsgSize returns a CallOption which sets the maximum message size // in bytes the client can receive. If this is not set, gRPC uses the default @@ -363,7 +367,7 @@ func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error { c.maxReceiveMessageSize = &o.MaxRecvMsgSize return nil } -func (o MaxRecvMsgSizeCallOption) after(*callInfo, *csAttempt) {} +func (o MaxRecvMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {} // MaxCallSendMsgSize returns a CallOption which sets the maximum message size // in bytes the client can send. If this is not set, gRPC uses the default @@ -387,7 +391,7 @@ func (o MaxSendMsgSizeCallOption) before(c *callInfo) error { c.maxSendMessageSize = &o.MaxSendMsgSize return nil } -func (o MaxSendMsgSizeCallOption) after(*callInfo, *csAttempt) {} +func (o MaxSendMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {} // PerRPCCredentials returns a CallOption that sets credentials.PerRPCCredentials // for a call. @@ -410,7 +414,7 @@ func (o PerRPCCredsCallOption) before(c *callInfo) error { c.creds = o.Creds return nil } -func (o PerRPCCredsCallOption) after(*callInfo, *csAttempt) {} +func (o PerRPCCredsCallOption) after(c *callInfo, attempt *csAttempt) {} // UseCompressor returns a CallOption which sets the compressor used when // sending the request. If WithCompressor is also set, UseCompressor has @@ -438,7 +442,7 @@ func (o CompressorCallOption) before(c *callInfo) error { c.compressorType = o.CompressorType return nil } -func (o CompressorCallOption) after(*callInfo, *csAttempt) {} +func (o CompressorCallOption) after(c *callInfo, attempt *csAttempt) {} // CallContentSubtype returns a CallOption that will set the content-subtype // for a call. For example, if content-subtype is "json", the Content-Type over @@ -475,7 +479,7 @@ func (o ContentSubtypeCallOption) before(c *callInfo) error { c.contentSubtype = o.ContentSubtype return nil } -func (o ContentSubtypeCallOption) after(*callInfo, *csAttempt) {} +func (o ContentSubtypeCallOption) after(c *callInfo, attempt *csAttempt) {} // ForceCodec returns a CallOption that will set codec to be used for all // request and response messages for a call. The result of calling Name() will @@ -511,50 +515,10 @@ type ForceCodecCallOption struct { } func (o ForceCodecCallOption) before(c *callInfo) error { - c.codec = newCodecV1Bridge(o.Codec) + c.codec = o.Codec return nil } -func (o ForceCodecCallOption) after(*callInfo, *csAttempt) {} - -// ForceCodecV2 returns a CallOption that will set codec to be used for all -// request and response messages for a call. The result of calling Name() will -// be used as the content-subtype after converting to lowercase, unless -// CallContentSubtype is also used. -// -// See Content-Type on -// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for -// more details. Also see the documentation on RegisterCodec and -// CallContentSubtype for more details on the interaction between Codec and -// content-subtype. -// -// This function is provided for advanced users; prefer to use only -// CallContentSubtype to select a registered codec instead. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func ForceCodecV2(codec encoding.CodecV2) CallOption { - return ForceCodecV2CallOption{CodecV2: codec} -} - -// ForceCodecV2CallOption is a CallOption that indicates the codec used for -// marshaling messages. -// -// # Experimental -// -// Notice: This type is EXPERIMENTAL and may be changed or removed in a -// later release. -type ForceCodecV2CallOption struct { - CodecV2 encoding.CodecV2 -} - -func (o ForceCodecV2CallOption) before(c *callInfo) error { - c.codec = o.CodecV2 - return nil -} - -func (o ForceCodecV2CallOption) after(*callInfo, *csAttempt) {} +func (o ForceCodecCallOption) after(c *callInfo, attempt *csAttempt) {} // CallCustomCodec behaves like ForceCodec, but accepts a grpc.Codec instead of // an encoding.Codec. @@ -576,10 +540,10 @@ type CustomCodecCallOption struct { } func (o CustomCodecCallOption) before(c *callInfo) error { - c.codec = newCodecV0Bridge(o.Codec) + c.codec = o.Codec return nil } -func (o CustomCodecCallOption) after(*callInfo, *csAttempt) {} +func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {} // MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory // used for buffering this RPC's requests for retry purposes. @@ -607,7 +571,7 @@ func (o MaxRetryRPCBufferSizeCallOption) before(c *callInfo) error { c.maxRetryRPCBufferSize = o.MaxRetryRPCBufferSize return nil } -func (o MaxRetryRPCBufferSizeCallOption) after(*callInfo, *csAttempt) {} +func (o MaxRetryRPCBufferSizeCallOption) after(c *callInfo, attempt *csAttempt) {} // The format of the payload: compressed or not? type payloadFormat uint8 @@ -617,28 +581,19 @@ const ( compressionMade payloadFormat = 1 // compressed ) -func (pf payloadFormat) isCompressed() bool { - return pf == compressionMade -} - -type streamReader interface { - ReadHeader(header []byte) error - Read(n int) (mem.BufferSlice, error) -} - // parser reads complete gRPC messages from the underlying reader. type parser struct { // r is the underlying reader. // See the comment on recvMsg for the permissible // error types. - r streamReader + r io.Reader // The header of a gRPC message. Find more detail at // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md header [5]byte - // bufferPool is the pool of shared receive buffers. - bufferPool mem.BufferPool + // recvBufferPool is the pool of shared receive buffers. + recvBufferPool SharedBufferPool } // recvMsg reads a complete gRPC message from the stream. @@ -653,15 +608,14 @@ type parser struct { // - an error from the status package // // No other error values or types must be returned, which also means -// that the underlying streamReader must not return an incompatible +// that the underlying io.Reader must not return an incompatible // error. -func (p *parser) recvMsg(maxReceiveMessageSize int) (payloadFormat, mem.BufferSlice, error) { - err := p.r.ReadHeader(p.header[:]) - if err != nil { +func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byte, err error) { + if _, err := p.r.Read(p.header[:]); err != nil { return 0, nil, err } - pf := payloadFormat(p.header[0]) + pf = payloadFormat(p.header[0]) length := binary.BigEndian.Uint32(p.header[1:]) if length == 0 { @@ -673,21 +627,20 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (payloadFormat, mem.BufferSl if int(length) > maxReceiveMessageSize { return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) } - - data, err := p.r.Read(int(length)) - if err != nil { + msg = p.recvBufferPool.Get(int(length)) + if _, err := p.r.Read(msg); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return 0, nil, err } - return pf, data, nil + return pf, msg, nil } // encode serializes msg and returns a buffer containing the message, or an // error if it is too large to be transmitted by grpc. If msg is nil, it // generates an empty message. -func encode(c baseCodec, msg any) (mem.BufferSlice, error) { +func encode(c baseCodec, msg any) ([]byte, error) { if msg == nil { // NOTE: typed nils will not be caught by this check return nil, nil } @@ -695,8 +648,7 @@ func encode(c baseCodec, msg any) (mem.BufferSlice, error) { if err != nil { return nil, status.Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error()) } - if uint(b.Len()) > math.MaxUint32 { - b.Free() + if uint(len(b)) > math.MaxUint32 { return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", len(b)) } return b, nil @@ -707,41 +659,34 @@ func encode(c baseCodec, msg any) (mem.BufferSlice, error) { // indicating no compression was done. // // TODO(dfawley): eliminate cp parameter by wrapping Compressor in an encoding.Compressor. -func compress(in mem.BufferSlice, cp Compressor, compressor encoding.Compressor, pool mem.BufferPool) (mem.BufferSlice, payloadFormat, error) { - if (compressor == nil && cp == nil) || in.Len() == 0 { - return nil, compressionNone, nil +func compress(in []byte, cp Compressor, compressor encoding.Compressor) ([]byte, error) { + if compressor == nil && cp == nil { + return nil, nil + } + if len(in) == 0 { + return nil, nil } - var out mem.BufferSlice - w := mem.NewWriter(&out, pool) wrapErr := func(err error) error { - out.Free() return status.Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) } + cbuf := &bytes.Buffer{} if compressor != nil { - z, err := compressor.Compress(w) + z, err := compressor.Compress(cbuf) if err != nil { - return nil, 0, wrapErr(err) + return nil, wrapErr(err) } - for _, b := range in { - if _, err := z.Write(b.ReadOnlyData()); err != nil { - return nil, 0, wrapErr(err) - } + if _, err := z.Write(in); err != nil { + return nil, wrapErr(err) } if err := z.Close(); err != nil { - return nil, 0, wrapErr(err) + return nil, wrapErr(err) } } else { - // This is obviously really inefficient since it fully materializes the data, but - // there is no way around this with the old Compressor API. At least it attempts - // to return the buffer to the provider, in the hopes it can be reused (maybe - // even by a subsequent call to this very function). - buf := in.MaterializeToBuffer(pool) - defer buf.Free() - if err := cp.Do(w, buf.ReadOnlyData()); err != nil { - return nil, 0, wrapErr(err) + if err := cp.Do(cbuf, in); err != nil { + return nil, wrapErr(err) } } - return out, compressionMade, nil + return cbuf.Bytes(), nil } const ( @@ -752,36 +697,33 @@ const ( // msgHeader returns a 5-byte header for the message being transmitted and the // payload, which is compData if non-nil or data otherwise. -func msgHeader(data, compData mem.BufferSlice, pf payloadFormat) (hdr []byte, payload mem.BufferSlice) { +func msgHeader(data, compData []byte) (hdr []byte, payload []byte) { hdr = make([]byte, headerLen) - hdr[0] = byte(pf) - - var length uint32 - if pf.isCompressed() { - length = uint32(compData.Len()) - payload = compData + if compData != nil { + hdr[0] = byte(compressionMade) + data = compData } else { - length = uint32(data.Len()) - payload = data + hdr[0] = byte(compressionNone) } // Write length of payload into buf - binary.BigEndian.PutUint32(hdr[payloadLen:], length) - return hdr, payload + binary.BigEndian.PutUint32(hdr[payloadLen:], uint32(len(data))) + return hdr, data } -func outPayload(client bool, msg any, dataLength, payloadLength int, t time.Time) *stats.OutPayload { +func outPayload(client bool, msg any, data, payload []byte, t time.Time) *stats.OutPayload { return &stats.OutPayload{ Client: client, Payload: msg, - Length: dataLength, - WireLength: payloadLength + headerLen, - CompressedLength: payloadLength, + Data: data, + Length: len(data), + WireLength: len(payload) + headerLen, + CompressedLength: len(payload), SentTime: t, } } -func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool) *status.Status { +func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool) *status.Status { switch pf { case compressionNone: case compressionMade: @@ -789,11 +731,7 @@ func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding") } if !haveCompressor { - if isServer { - return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) - } else { - return status.Newf(codes.Internal, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) - } + return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) } default: return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf) @@ -803,129 +741,104 @@ func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool type payloadInfo struct { compressedLength int // The compressed length got from wire. - uncompressedBytes mem.BufferSlice -} - -func (p *payloadInfo) free() { - if p != nil && p.uncompressedBytes != nil { - p.uncompressedBytes.Free() - } + uncompressedBytes []byte } // recvAndDecompress reads a message from the stream, decompressing it if necessary. // // Cancelling the returned cancel function releases the buffer back to the pool. So the caller should cancel as soon as // the buffer is no longer needed. -// TODO: Refactor this function to reduce the number of arguments. -// See: https://google.github.io/styleguide/go/best-practices.html#function-argument-lists -func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool, -) (out mem.BufferSlice, err error) { - pf, compressed, err := p.recvMsg(maxReceiveMessageSize) +func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, +) (uncompressedBuf []byte, cancel func(), err error) { + pf, compressedBuf, err := p.recvMsg(maxReceiveMessageSize) if err != nil { - return nil, err + return nil, nil, err } - compressedLength := compressed.Len() - - if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil, isServer); st != nil { - compressed.Free() - return nil, st.Err() + if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil); st != nil { + return nil, nil, st.Err() } var size int - if pf.isCompressed() { - defer compressed.Free() - + if pf == compressionMade { // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, // use this decompressor as the default. if dc != nil { - var uncompressedBuf []byte - uncompressedBuf, err = dc.Do(compressed.Reader()) - if err == nil { - out = mem.BufferSlice{mem.NewBuffer(&uncompressedBuf, nil)} - } + uncompressedBuf, err = dc.Do(bytes.NewReader(compressedBuf)) size = len(uncompressedBuf) } else { - out, size, err = decompress(compressor, compressed, maxReceiveMessageSize, p.bufferPool) + uncompressedBuf, size, err = decompress(compressor, compressedBuf, maxReceiveMessageSize) } if err != nil { - return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) + return nil, nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) } if size > maxReceiveMessageSize { - out.Free() // TODO: Revisit the error code. Currently keep it consistent with java // implementation. - return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize) + return nil, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize) } } else { - out = compressed + uncompressedBuf = compressedBuf } if payInfo != nil { - payInfo.compressedLength = compressedLength - out.Ref() - payInfo.uncompressedBytes = out + payInfo.compressedLength = len(compressedBuf) + payInfo.uncompressedBytes = uncompressedBuf + + cancel = func() {} + } else { + cancel = func() { + p.recvBufferPool.Put(&compressedBuf) + } } - return out, nil + return uncompressedBuf, cancel, nil } // Using compressor, decompress d, returning data and size. // Optionally, if data will be over maxReceiveMessageSize, just return the size. -func decompress(compressor encoding.Compressor, d mem.BufferSlice, maxReceiveMessageSize int, pool mem.BufferPool) (mem.BufferSlice, int, error) { - dcReader, err := compressor.Decompress(d.Reader()) +func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize int) ([]byte, int, error) { + dcReader, err := compressor.Decompress(bytes.NewReader(d)) if err != nil { return nil, 0, err } - - // TODO: Can/should this still be preserved with the new BufferSlice API? Are - // there any actual benefits to allocating a single large buffer instead of - // multiple smaller ones? - //if sizer, ok := compressor.(interface { - // DecompressedSize(compressedBytes []byte) int - //}); ok { - // if size := sizer.DecompressedSize(d); size >= 0 { - // if size > maxReceiveMessageSize { - // return nil, size, nil - // } - // // size is used as an estimate to size the buffer, but we - // // will read more data if available. - // // +MinRead so ReadFrom will not reallocate if size is correct. - // // - // // TODO: If we ensure that the buffer size is the same as the DecompressedSize, - // // we can also utilize the recv buffer pool here. - // buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) - // bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) - // return buf.Bytes(), int(bytesRead), err - // } - //} - - var out mem.BufferSlice - _, err = io.Copy(mem.NewWriter(&out, pool), io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) - if err != nil { - out.Free() - return nil, 0, err + if sizer, ok := compressor.(interface { + DecompressedSize(compressedBytes []byte) int + }); ok { + if size := sizer.DecompressedSize(d); size >= 0 { + if size > maxReceiveMessageSize { + return nil, size, nil + } + // size is used as an estimate to size the buffer, but we + // will read more data if available. + // +MinRead so ReadFrom will not reallocate if size is correct. + // + // TODO: If we ensure that the buffer size is the same as the DecompressedSize, + // we can also utilize the recv buffer pool here. + buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) + bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return buf.Bytes(), int(bytesRead), err + } } - return out, out.Len(), nil + // Read from LimitReader with limit max+1. So if the underlying + // reader is over limit, the result will be bigger than max. + d, err = io.ReadAll(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return d, len(d), err } // For the two compressor parameters, both should not be set, but if they are, // dc takes precedence over compressor. // TODO(dfawley): wrap the old compressor/decompressor using the new API? -func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) error { - data, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor, isServer) +func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) error { + buf, cancel, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor) if err != nil { return err } + defer cancel() - // If the codec wants its own reference to the data, it can get it. Otherwise, always - // free the buffers. - defer data.Free() - - if err := c.Unmarshal(data, m); err != nil { + if err := c.Unmarshal(buf, m); err != nil { return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message: %v", err) } - return nil } @@ -1028,7 +941,7 @@ func setCallInfoCodec(c *callInfo) error { // encoding.Codec (Name vs. String method name). We only support // setting content subtype from encoding.Codec to avoid a behavior // change with the deprecated version. - if ec, ok := c.codec.(encoding.CodecV2); ok { + if ec, ok := c.codec.(encoding.Codec); ok { c.contentSubtype = strings.ToLower(ec.Name()) } } @@ -1037,12 +950,12 @@ func setCallInfoCodec(c *callInfo) error { if c.contentSubtype == "" { // No codec specified in CallOptions; use proto by default. - c.codec = getCodec(proto.Name) + c.codec = encoding.GetCodec(proto.Name) return nil } // c.contentSubtype is already lowercased in CallContentSubtype - c.codec = getCodec(c.contentSubtype) + c.codec = encoding.GetCodec(c.contentSubtype) if c.codec == nil { return status.Errorf(codes.Internal, "no codec registered for content-subtype %s", c.contentSubtype) } @@ -1051,7 +964,7 @@ func setCallInfoCodec(c *callInfo) error { // The SupportPackageIsVersion variables are referenced from generated protocol // buffer files to ensure compatibility with the gRPC version used. The latest -// support package version is 9. +// support package version is 7. // // Older versions are kept for compatibility. // @@ -1063,7 +976,6 @@ const ( SupportPackageIsVersion6 = true SupportPackageIsVersion7 = true SupportPackageIsVersion8 = true - SupportPackageIsVersion9 = true ) const grpcUA = "grpc-go/" + Version diff --git a/upstream/vendor/google.golang.org/grpc/server.go b/upstream/vendor/google.golang.org/grpc/server.go index d1e1415a40f..fd4558daa52 100644 --- a/upstream/vendor/google.golang.org/grpc/server.go +++ b/upstream/vendor/google.golang.org/grpc/server.go @@ -45,7 +45,6 @@ import ( "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -81,7 +80,7 @@ func init() { } internal.BinaryLogger = binaryLogger internal.JoinServerOptions = newJoinServerOption - internal.BufferPool = bufferPool + internal.RecvBufferPool = recvBufferPool } var statusOK = status.New(codes.OK, "") @@ -171,7 +170,7 @@ type serverOptions struct { maxHeaderListSize *uint32 headerTableSize *uint32 numServerWorkers uint32 - bufferPool mem.BufferPool + recvBufferPool SharedBufferPool waitForHandlers bool } @@ -182,7 +181,7 @@ var defaultServerOptions = serverOptions{ connectionTimeout: 120 * time.Second, writeBufferSize: defaultWriteBufSize, readBufferSize: defaultReadBufSize, - bufferPool: mem.DefaultBufferPool(), + recvBufferPool: nopBufferPool{}, } var globalServerOptions []ServerOption @@ -314,7 +313,7 @@ func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { // Will be supported throughout 1.x. func CustomCodec(codec Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.codec = newCodecV0Bridge(codec) + o.codec = codec }) } @@ -343,22 +342,7 @@ func CustomCodec(codec Codec) ServerOption { // later release. func ForceServerCodec(codec encoding.Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.codec = newCodecV1Bridge(codec) - }) -} - -// ForceServerCodecV2 is the equivalent of ForceServerCodec, but for the new -// CodecV2 interface. -// -// Will be supported throughout 1.x. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func ForceServerCodecV2(codecV2 encoding.CodecV2) ServerOption { - return newFuncServerOption(func(o *serverOptions) { - o.codec = codecV2 + o.codec = codec }) } @@ -543,22 +527,12 @@ func ConnectionTimeout(d time.Duration) ServerOption { }) } -// MaxHeaderListSizeServerOption is a ServerOption that sets the max -// (uncompressed) size of header list that the server is prepared to accept. -type MaxHeaderListSizeServerOption struct { - MaxHeaderListSize uint32 -} - -func (o MaxHeaderListSizeServerOption) apply(so *serverOptions) { - so.maxHeaderListSize = &o.MaxHeaderListSize -} - // MaxHeaderListSize returns a ServerOption that sets the max (uncompressed) size // of header list that the server is prepared to accept. func MaxHeaderListSize(s uint32) ServerOption { - return MaxHeaderListSizeServerOption{ - MaxHeaderListSize: s, - } + return newFuncServerOption(func(o *serverOptions) { + o.maxHeaderListSize = &s + }) } // HeaderTableSize returns a ServerOption that sets the size of dynamic @@ -608,9 +582,26 @@ func WaitForHandlers(w bool) ServerOption { }) } -func bufferPool(bufferPool mem.BufferPool) ServerOption { +// RecvBufferPool returns a ServerOption that configures the server +// to use the provided shared buffer pool for parsing incoming messages. Depending +// on the application's workload, this could result in reduced memory allocation. +// +// If you are unsure about how to implement a memory pool but want to utilize one, +// begin with grpc.NewSharedBufferPool. +// +// Note: The shared buffer pool feature will not be active if any of the following +// options are used: StatsHandler, EnableTracing, or binary logging. In such +// cases, the shared buffer pool will be ignored. +// +// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in +// v1.60.0 or later. +func RecvBufferPool(bufferPool SharedBufferPool) ServerOption { + return recvBufferPool(bufferPool) +} + +func recvBufferPool(bufferPool SharedBufferPool) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.bufferPool = bufferPool + o.recvBufferPool = bufferPool }) } @@ -621,7 +612,7 @@ func bufferPool(bufferPool mem.BufferPool) ServerOption { // workload (assuming a QPS of a few thousand requests/sec). const serverWorkerResetThreshold = 1 << 16 -// serverWorker blocks on a *transport.Stream channel forever and waits for +// serverWorkers blocks on a *transport.Stream channel forever and waits for // data to be fed by serveStreams. This allows multiple requests to be // processed by the same goroutine, removing the need for expensive stack // re-allocations (see the runtime.morestack problem [1]). @@ -979,7 +970,6 @@ func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { ChannelzParent: s.channelz, MaxHeaderListSize: s.opts.maxHeaderListSize, HeaderTableSize: s.opts.headerTableSize, - BufferPool: s.opts.bufferPool, } st, err := transport.NewServerTransport(c, config) if err != nil { @@ -1072,7 +1062,7 @@ var _ http.Handler = (*Server)(nil) // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { - st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandlers, s.opts.bufferPool) + st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandlers) if err != nil { // Errors returned from transport.NewServerHandlerTransport have // already been written to w. @@ -1142,35 +1132,20 @@ func (s *Server) sendResponse(ctx context.Context, t transport.ServerTransport, channelz.Error(logger, s.channelz, "grpc: server failed to encode response: ", err) return err } - - compData, pf, err := compress(data, cp, comp, s.opts.bufferPool) + compData, err := compress(data, cp, comp) if err != nil { - data.Free() channelz.Error(logger, s.channelz, "grpc: server failed to compress response: ", err) return err } - - hdr, payload := msgHeader(data, compData, pf) - - defer func() { - compData.Free() - data.Free() - // payload does not need to be freed here, it is either data or compData, both of - // which are already freed. - }() - - dataLen := data.Len() - payloadLen := payload.Len() + hdr, payload := msgHeader(data, compData) // TODO(dfawley): should we be checking len(data) instead? - if payloadLen > s.opts.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", payloadLen, s.opts.maxSendMessageSize) + if len(payload) > s.opts.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(payload), s.opts.maxSendMessageSize) } err = t.Write(stream, hdr, payload, opts) if err == nil { - if len(s.opts.statsHandlers) != 0 { - for _, sh := range s.opts.statsHandlers { - sh.HandleRPC(ctx, outPayload(false, msg, dataLen, payloadLen, time.Now())) - } + for _, sh := range s.opts.statsHandlers { + sh.HandleRPC(ctx, outPayload(false, msg, data, payload, time.Now())) } } return err @@ -1349,37 +1324,37 @@ func (s *Server) processUnaryRPC(ctx context.Context, t transport.ServerTranspor var payInfo *payloadInfo if len(shs) != 0 || len(binlogs) != 0 { payInfo = &payloadInfo{} - defer payInfo.free() } - d, err := recvAndDecompress(&parser{r: stream, bufferPool: s.opts.bufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp, true) + d, cancel, err := recvAndDecompress(&parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp) if err != nil { if e := t.WriteStatus(stream, status.Convert(err)); e != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) } return err } - defer d.Free() if channelz.IsOn() { t.IncrMsgRecv() } df := func(v any) error { + defer cancel() + if err := s.getCodec(stream.ContentSubtype()).Unmarshal(d, v); err != nil { return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) } - for _, sh := range shs { sh.HandleRPC(ctx, &stats.InPayload{ RecvTime: time.Now(), Payload: v, - Length: d.Len(), + Length: len(d), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, + Data: d, }) } if len(binlogs) != 0 { cm := &binarylog.ClientMessage{ - Message: d.Materialize(), + Message: d, } for _, binlog := range binlogs { binlog.Log(ctx, cm) @@ -1563,7 +1538,7 @@ func (s *Server) processStreamingRPC(ctx context.Context, t transport.ServerTran ctx: ctx, t: t, s: stream, - p: &parser{r: stream, bufferPool: s.opts.bufferPool}, + p: &parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, codec: s.getCodec(stream.ContentSubtype()), maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, @@ -1978,12 +1953,12 @@ func (s *Server) getCodec(contentSubtype string) baseCodec { return s.opts.codec } if contentSubtype == "" { - return getCodec(proto.Name) + return encoding.GetCodec(proto.Name) } - codec := getCodec(contentSubtype) + codec := encoding.GetCodec(contentSubtype) if codec == nil { logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name) - return getCodec(proto.Name) + return encoding.GetCodec(proto.Name) } return codec } diff --git a/upstream/vendor/google.golang.org/grpc/service_config.go b/upstream/vendor/google.golang.org/grpc/service_config.go index 2671c5ef69f..2b35c5d2130 100644 --- a/upstream/vendor/google.golang.org/grpc/service_config.go +++ b/upstream/vendor/google.golang.org/grpc/service_config.go @@ -26,7 +26,6 @@ import ( "time" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" @@ -164,18 +163,16 @@ type jsonSC struct { } func init() { - internal.ParseServiceConfig = func(js string) *serviceconfig.ParseResult { - return parseServiceConfig(js, defaultMaxCallAttempts) - } + internal.ParseServiceConfig = parseServiceConfig } -func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { +func parseServiceConfig(js string) *serviceconfig.ParseResult { if len(js) == 0 { return &serviceconfig.ParseResult{Err: fmt.Errorf("no JSON service config provided")} } var rsc jsonSC err := json.Unmarshal([]byte(js), &rsc) if err != nil { - logger.Warningf("grpc: unmarshalling service config %s: %v", js, err) + logger.Warningf("grpc: unmarshaling service config %s: %v", js, err) return &serviceconfig.ParseResult{Err: err} } sc := ServiceConfig{ @@ -186,12 +183,12 @@ func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { } c := rsc.LoadBalancingConfig if c == nil { - name := pickfirst.Name + name := PickFirstBalancerName if rsc.LoadBalancingPolicy != nil { name = *rsc.LoadBalancingPolicy } if balancer.Get(name) == nil { - name = pickfirst.Name + name = PickFirstBalancerName } cfg := []map[string]any{{name: struct{}{}}} strCfg, err := json.Marshal(cfg) @@ -221,8 +218,8 @@ func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { WaitForReady: m.WaitForReady, Timeout: (*time.Duration)(m.Timeout), } - if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy, maxAttempts); err != nil { - logger.Warningf("grpc: unmarshalling service config %s: %v", js, err) + if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil { + logger.Warningf("grpc: unmarshaling service config %s: %v", js, err) return &serviceconfig.ParseResult{Err: err} } if m.MaxRequestMessageBytes != nil { @@ -242,13 +239,13 @@ func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { for i, n := range *m.Name { path, err := n.generatePath() if err != nil { - logger.Warningf("grpc: error unmarshalling service config %s due to methodConfig[%d]: %v", js, i, err) + logger.Warningf("grpc: error unmarshaling service config %s due to methodConfig[%d]: %v", js, i, err) return &serviceconfig.ParseResult{Err: err} } if _, ok := paths[path]; ok { err = errDuplicatedName - logger.Warningf("grpc: error unmarshalling service config %s due to methodConfig[%d]: %v", js, i, err) + logger.Warningf("grpc: error unmarshaling service config %s due to methodConfig[%d]: %v", js, i, err) return &serviceconfig.ParseResult{Err: err} } paths[path] = struct{}{} @@ -267,7 +264,7 @@ func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { return &serviceconfig.ParseResult{Config: &sc} } -func convertRetryPolicy(jrp *jsonRetryPolicy, maxAttempts int) (p *internalserviceconfig.RetryPolicy, err error) { +func convertRetryPolicy(jrp *jsonRetryPolicy) (p *internalserviceconfig.RetryPolicy, err error) { if jrp == nil { return nil, nil } @@ -281,16 +278,17 @@ func convertRetryPolicy(jrp *jsonRetryPolicy, maxAttempts int) (p *internalservi return nil, nil } - if jrp.MaxAttempts < maxAttempts { - maxAttempts = jrp.MaxAttempts - } rp := &internalserviceconfig.RetryPolicy{ - MaxAttempts: maxAttempts, + MaxAttempts: jrp.MaxAttempts, InitialBackoff: time.Duration(jrp.InitialBackoff), MaxBackoff: time.Duration(jrp.MaxBackoff), BackoffMultiplier: jrp.BackoffMultiplier, RetryableStatusCodes: make(map[codes.Code]bool), } + if rp.MaxAttempts > 5 { + // TODO(retry): Make the max maxAttempts configurable. + rp.MaxAttempts = 5 + } for _, code := range jrp.RetryableStatusCodes { rp.RetryableStatusCodes[code] = true } diff --git a/upstream/vendor/google.golang.org/grpc/shared_buffer_pool.go b/upstream/vendor/google.golang.org/grpc/shared_buffer_pool.go new file mode 100644 index 00000000000..48a64cfe8e2 --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/shared_buffer_pool.go @@ -0,0 +1,154 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import "sync" + +// SharedBufferPool is a pool of buffers that can be shared, resulting in +// decreased memory allocation. Currently, in gRPC-go, it is only utilized +// for parsing incoming messages. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +type SharedBufferPool interface { + // Get returns a buffer with specified length from the pool. + // + // The returned byte slice may be not zero initialized. + Get(length int) []byte + + // Put returns a buffer to the pool. + Put(*[]byte) +} + +// NewSharedBufferPool creates a simple SharedBufferPool with buckets +// of different sizes to optimize memory usage. This prevents the pool from +// wasting large amounts of memory, even when handling messages of varying sizes. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func NewSharedBufferPool() SharedBufferPool { + return &simpleSharedBufferPool{ + pools: [poolArraySize]simpleSharedBufferChildPool{ + newBytesPool(level0PoolMaxSize), + newBytesPool(level1PoolMaxSize), + newBytesPool(level2PoolMaxSize), + newBytesPool(level3PoolMaxSize), + newBytesPool(level4PoolMaxSize), + newBytesPool(0), + }, + } +} + +// simpleSharedBufferPool is a simple implementation of SharedBufferPool. +type simpleSharedBufferPool struct { + pools [poolArraySize]simpleSharedBufferChildPool +} + +func (p *simpleSharedBufferPool) Get(size int) []byte { + return p.pools[p.poolIdx(size)].Get(size) +} + +func (p *simpleSharedBufferPool) Put(bs *[]byte) { + p.pools[p.poolIdx(cap(*bs))].Put(bs) +} + +func (p *simpleSharedBufferPool) poolIdx(size int) int { + switch { + case size <= level0PoolMaxSize: + return level0PoolIdx + case size <= level1PoolMaxSize: + return level1PoolIdx + case size <= level2PoolMaxSize: + return level2PoolIdx + case size <= level3PoolMaxSize: + return level3PoolIdx + case size <= level4PoolMaxSize: + return level4PoolIdx + default: + return levelMaxPoolIdx + } +} + +const ( + level0PoolMaxSize = 16 // 16 B + level1PoolMaxSize = level0PoolMaxSize * 16 // 256 B + level2PoolMaxSize = level1PoolMaxSize * 16 // 4 KB + level3PoolMaxSize = level2PoolMaxSize * 16 // 64 KB + level4PoolMaxSize = level3PoolMaxSize * 16 // 1 MB +) + +const ( + level0PoolIdx = iota + level1PoolIdx + level2PoolIdx + level3PoolIdx + level4PoolIdx + levelMaxPoolIdx + poolArraySize +) + +type simpleSharedBufferChildPool interface { + Get(size int) []byte + Put(any) +} + +type bufferPool struct { + sync.Pool + + defaultSize int +} + +func (p *bufferPool) Get(size int) []byte { + bs := p.Pool.Get().(*[]byte) + + if cap(*bs) < size { + p.Pool.Put(bs) + + return make([]byte, size) + } + + return (*bs)[:size] +} + +func newBytesPool(size int) simpleSharedBufferChildPool { + return &bufferPool{ + Pool: sync.Pool{ + New: func() any { + bs := make([]byte, size) + return &bs + }, + }, + defaultSize: size, + } +} + +// nopBufferPool is a buffer pool just makes new buffer without pooling. +type nopBufferPool struct { +} + +func (nopBufferPool) Get(length int) []byte { + return make([]byte, length) +} + +func (nopBufferPool) Put(*[]byte) { +} diff --git a/upstream/vendor/google.golang.org/grpc/stats/stats.go b/upstream/vendor/google.golang.org/grpc/stats/stats.go index 71195c4943d..4ab70e2d462 100644 --- a/upstream/vendor/google.golang.org/grpc/stats/stats.go +++ b/upstream/vendor/google.golang.org/grpc/stats/stats.go @@ -73,10 +73,10 @@ func (*PickerUpdated) isRPCStats() {} type InPayload struct { // Client is true if this InPayload is from client side. Client bool - // Payload is the payload with original type. This may be modified after - // the call to HandleRPC which provides the InPayload returns and must be - // copied if needed later. + // Payload is the payload with original type. Payload any + // Data is the serialized message payload. + Data []byte // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). @@ -143,10 +143,10 @@ func (s *InTrailer) isRPCStats() {} type OutPayload struct { // Client is true if this OutPayload is from client side. Client bool - // Payload is the payload with original type. This may be modified after - // the call to HandleRPC which provides the OutPayload returns and must be - // copied if needed later. + // Payload is the payload with original type. Payload any + // Data is the serialized message payload. + Data []byte // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). Length int diff --git a/upstream/vendor/google.golang.org/grpc/stream.go b/upstream/vendor/google.golang.org/grpc/stream.go index bb2b2a216ce..d939ffc6348 100644 --- a/upstream/vendor/google.golang.org/grpc/stream.go +++ b/upstream/vendor/google.golang.org/grpc/stream.go @@ -23,7 +23,6 @@ import ( "errors" "io" "math" - "math/rand" "strconv" "sync" "time" @@ -35,13 +34,13 @@ import ( "google.golang.org/grpc/internal/balancerload" "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/grpcutil" imetadata "google.golang.org/grpc/internal/metadata" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/serviceconfig" istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" - "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -360,7 +359,7 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client cs.attempt = a return nil } - if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }); err != nil { + if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }); err != nil { return nil, err } @@ -517,8 +516,7 @@ func (a *csAttempt) newStream() error { return toRPCErr(nse.Err) } a.s = s - a.ctx = s.Context() - a.p = &parser{r: s, bufferPool: a.cs.cc.dopts.copts.BufferPool} + a.p = &parser{r: s, recvBufferPool: a.cs.cc.dopts.recvBufferPool} return nil } @@ -567,15 +565,10 @@ type clientStream struct { // place where we need to check if the attempt is nil. attempt *csAttempt // TODO(hedging): hedging will have multiple attempts simultaneously. - committed bool // active attempt committed for retry? - onCommit func() - replayBuffer []replayOp // operations to replay on retry - replayBufferSize int // current size of replayBuffer -} - -type replayOp struct { - op func(a *csAttempt) error - cleanup func() + committed bool // active attempt committed for retry? + onCommit func() + buffer []func(a *csAttempt) error // operations to replay on retry + bufferSize int // current size of buffer } // csAttempt implements a single transport stream attempt within a @@ -613,12 +606,7 @@ func (cs *clientStream) commitAttemptLocked() { cs.onCommit() } cs.committed = true - for _, op := range cs.replayBuffer { - if op.cleanup != nil { - op.cleanup() - } - } - cs.replayBuffer = nil + cs.buffer = nil } func (cs *clientStream) commitAttempt() { @@ -710,7 +698,7 @@ func (a *csAttempt) shouldRetry(err error) (bool, error) { if max := float64(rp.MaxBackoff); cur > max { cur = max } - dur = time.Duration(rand.Int63n(int64(cur))) + dur = time.Duration(grpcrand.Int63n(int64(cur))) cs.numRetriesSincePushback++ } @@ -743,7 +731,7 @@ func (cs *clientStream) retryLocked(attempt *csAttempt, lastErr error) error { // the stream is canceled. return err } - // Note that the first op in replayBuffer always sets cs.attempt + // Note that the first op in the replay buffer always sets cs.attempt // if it is able to pick a transport and create a stream. if lastErr = cs.replayBufferLocked(attempt); lastErr == nil { return nil @@ -772,7 +760,7 @@ func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) // already be status errors. return toRPCErr(op(cs.attempt)) } - if len(cs.replayBuffer) == 0 { + if len(cs.buffer) == 0 { // For the first op, which controls creation of the stream and // assigns cs.attempt, we need to create a new attempt inline // before executing the first op. On subsequent ops, the attempt @@ -862,26 +850,25 @@ func (cs *clientStream) Trailer() metadata.MD { } func (cs *clientStream) replayBufferLocked(attempt *csAttempt) error { - for _, f := range cs.replayBuffer { - if err := f.op(attempt); err != nil { + for _, f := range cs.buffer { + if err := f(attempt); err != nil { return err } } return nil } -func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error, cleanup func()) { +func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error) { // Note: we still will buffer if retry is disabled (for transparent retries). if cs.committed { return } - cs.replayBufferSize += sz - if cs.replayBufferSize > cs.callInfo.maxRetryRPCBufferSize { + cs.bufferSize += sz + if cs.bufferSize > cs.callInfo.maxRetryRPCBufferSize { cs.commitAttemptLocked() - cleanup() return } - cs.replayBuffer = append(cs.replayBuffer, replayOp{op: op, cleanup: cleanup}) + cs.buffer = append(cs.buffer, op) } func (cs *clientStream) SendMsg(m any) (err error) { @@ -903,50 +890,23 @@ func (cs *clientStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, data, payload, pf, err := prepareMsg(m, cs.codec, cs.cp, cs.comp, cs.cc.dopts.copts.BufferPool) + hdr, payload, data, err := prepareMsg(m, cs.codec, cs.cp, cs.comp) if err != nil { return err } - defer func() { - data.Free() - // only free payload if compression was made, and therefore it is a different set - // of buffers from data. - if pf.isCompressed() { - payload.Free() - } - }() - - dataLen := data.Len() - payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? - if payloadLen > *cs.callInfo.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, *cs.callInfo.maxSendMessageSize) + if len(payload) > *cs.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), *cs.callInfo.maxSendMessageSize) } - - // always take an extra ref in case data == payload (i.e. when the data isn't - // compressed). The original ref will always be freed by the deferred free above. - payload.Ref() op := func(a *csAttempt) error { - return a.sendMsg(m, hdr, payload, dataLen, payloadLen) - } - - // onSuccess is invoked when the op is captured for a subsequent retry. If the - // stream was established by a previous message and therefore retries are - // disabled, onSuccess will not be invoked, and payloadRef can be freed - // immediately. - onSuccessCalled := false - err = cs.withRetry(op, func() { - cs.bufferForRetryLocked(len(hdr)+payloadLen, op, payload.Free) - onSuccessCalled = true - }) - if !onSuccessCalled { - payload.Free() + return a.sendMsg(m, hdr, payload, data) } + err = cs.withRetry(op, func() { cs.bufferForRetryLocked(len(hdr)+len(payload), op) }) if len(cs.binlogs) != 0 && err == nil { cm := &binarylog.ClientMessage{ OnClientSide: true, - Message: data.Materialize(), + Message: data, } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, cm) @@ -963,7 +923,6 @@ func (cs *clientStream) RecvMsg(m any) error { var recvInfo *payloadInfo if len(cs.binlogs) != 0 { recvInfo = &payloadInfo{} - defer recvInfo.free() } err := cs.withRetry(func(a *csAttempt) error { return a.recvMsg(m, recvInfo) @@ -971,7 +930,7 @@ func (cs *clientStream) RecvMsg(m any) error { if len(cs.binlogs) != 0 && err == nil { sm := &binarylog.ServerMessage{ OnClientSide: true, - Message: recvInfo.uncompressedBytes.Materialize(), + Message: recvInfo.uncompressedBytes, } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, sm) @@ -998,7 +957,7 @@ func (cs *clientStream) CloseSend() error { // RecvMsg. This also matches historical behavior. return nil } - cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }) + cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }) if len(cs.binlogs) != 0 { chc := &binarylog.ClientHalfClose{ OnClientSide: true, @@ -1074,7 +1033,7 @@ func (cs *clientStream) finish(err error) { cs.cancel() } -func (a *csAttempt) sendMsg(m any, hdr []byte, payld mem.BufferSlice, dataLength, payloadLength int) error { +func (a *csAttempt) sendMsg(m any, hdr, payld, data []byte) error { cs := a.cs if a.trInfo != nil { a.mu.Lock() @@ -1092,10 +1051,8 @@ func (a *csAttempt) sendMsg(m any, hdr []byte, payld mem.BufferSlice, dataLength } return io.EOF } - if len(a.statsHandlers) != 0 { - for _, sh := range a.statsHandlers { - sh.HandleRPC(a.ctx, outPayload(true, m, dataLength, payloadLength, time.Now())) - } + for _, sh := range a.statsHandlers { + sh.HandleRPC(a.ctx, outPayload(true, m, data, payld, time.Now())) } if channelz.IsOn() { a.t.IncrMsgSent() @@ -1107,7 +1064,6 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { cs := a.cs if len(a.statsHandlers) != 0 && payInfo == nil { payInfo = &payloadInfo{} - defer payInfo.free() } if !a.decompSet { @@ -1126,7 +1082,8 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { // Only initialize this state once per stream. a.decompSet = true } - if err := recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decomp, false); err != nil { + err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decomp) + if err != nil { if err == io.EOF { if statusErr := a.s.Status().Err(); statusErr != nil { return statusErr @@ -1145,12 +1102,14 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { } for _, sh := range a.statsHandlers { sh.HandleRPC(a.ctx, &stats.InPayload{ - Client: true, - RecvTime: time.Now(), - Payload: m, + Client: true, + RecvTime: time.Now(), + Payload: m, + // TODO truncate large payload. + Data: payInfo.uncompressedBytes, WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, - Length: payInfo.uncompressedBytes.Len(), + Length: len(payInfo.uncompressedBytes), }) } if channelz.IsOn() { @@ -1162,12 +1121,14 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { } // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. - if err := recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decomp, false); err == io.EOF { + err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decomp) + if err == nil { + return toRPCErr(errors.New("grpc: client streaming protocol violation: get <nil>, want <EOF>")) + } + if err == io.EOF { return a.s.Status().Err() // non-server streaming Recv returns nil on success - } else if err != nil { - return toRPCErr(err) } - return toRPCErr(errors.New("grpc: client streaming protocol violation: get <nil>, want <EOF>")) + return toRPCErr(err) } func (a *csAttempt) finish(err error) { @@ -1223,12 +1184,12 @@ func (a *csAttempt) finish(err error) { a.mu.Unlock() } -// newNonRetryClientStream creates a ClientStream with the specified transport, on the +// newClientStream creates a ClientStream with the specified transport, on the // given addrConn. // // It's expected that the given transport is either the same one in addrConn, or // is already closed. To avoid race, transport is specified separately, instead -// of using ac.transport. +// of using ac.transpot. // // Main difference between this and ClientConn.NewStream: // - no retry @@ -1314,7 +1275,7 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin return nil, err } as.s = s - as.p = &parser{r: s, bufferPool: ac.dopts.copts.BufferPool} + as.p = &parser{r: s, recvBufferPool: ac.dopts.recvBufferPool} ac.incrCallsStarted() if desc != unaryStreamDesc { // Listen on stream context to cleanup when the stream context is @@ -1411,26 +1372,17 @@ func (as *addrConnStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, data, payload, pf, err := prepareMsg(m, as.codec, as.cp, as.comp, as.ac.dopts.copts.BufferPool) + hdr, payld, _, err := prepareMsg(m, as.codec, as.cp, as.comp) if err != nil { return err } - defer func() { - data.Free() - // only free payload if compression was made, and therefore it is a different set - // of buffers from data. - if pf.isCompressed() { - payload.Free() - } - }() - // TODO(dfawley): should we be checking len(data) instead? - if payload.Len() > *as.callInfo.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payload.Len(), *as.callInfo.maxSendMessageSize) + if len(payld) > *as.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payld), *as.callInfo.maxSendMessageSize) } - if err := as.t.Write(as.s, hdr, payload, &transport.Options{Last: !as.desc.ClientStreams}); err != nil { + if err := as.t.Write(as.s, hdr, payld, &transport.Options{Last: !as.desc.ClientStreams}); err != nil { if !as.desc.ClientStreams { // For non-client-streaming RPCs, we return nil instead of EOF on error // because the generated code requires it. finish is not called; RecvMsg() @@ -1470,7 +1422,8 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { // Only initialize this state once per stream. as.decompSet = true } - if err := recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp, false); err != nil { + err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) + if err != nil { if err == io.EOF { if statusErr := as.s.Status().Err(); statusErr != nil { return statusErr @@ -1490,12 +1443,14 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. - if err := recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp, false); err == io.EOF { + err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) + if err == nil { + return toRPCErr(errors.New("grpc: client streaming protocol violation: get <nil>, want <EOF>")) + } + if err == io.EOF { return as.s.Status().Err() // non-server streaming Recv returns nil on success - } else if err != nil { - return toRPCErr(err) } - return toRPCErr(errors.New("grpc: client streaming protocol violation: get <nil>, want <EOF>")) + return toRPCErr(err) } func (as *addrConnStream) finish(err error) { @@ -1689,31 +1644,18 @@ func (ss *serverStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, data, payload, pf, err := prepareMsg(m, ss.codec, ss.cp, ss.comp, ss.p.bufferPool) + hdr, payload, data, err := prepareMsg(m, ss.codec, ss.cp, ss.comp) if err != nil { return err } - defer func() { - data.Free() - // only free payload if compression was made, and therefore it is a different set - // of buffers from data. - if pf.isCompressed() { - payload.Free() - } - }() - - dataLen := data.Len() - payloadLen := payload.Len() - // TODO(dfawley): should we be checking len(data) instead? - if payloadLen > ss.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, ss.maxSendMessageSize) + if len(payload) > ss.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), ss.maxSendMessageSize) } if err := ss.t.Write(ss.s, hdr, payload, &transport.Options{Last: false}); err != nil { return toRPCErr(err) } - if len(ss.binlogs) != 0 { if !ss.serverHeaderBinlogged { h, _ := ss.s.Header() @@ -1726,7 +1668,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } } sm := &binarylog.ServerMessage{ - Message: data.Materialize(), + Message: data, } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, sm) @@ -1734,7 +1676,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } if len(ss.statsHandler) != 0 { for _, sh := range ss.statsHandler { - sh.HandleRPC(ss.s.Context(), outPayload(false, m, dataLen, payloadLen, time.Now())) + sh.HandleRPC(ss.s.Context(), outPayload(false, m, data, payload, time.Now())) } } return nil @@ -1771,9 +1713,8 @@ func (ss *serverStream) RecvMsg(m any) (err error) { var payInfo *payloadInfo if len(ss.statsHandler) != 0 || len(ss.binlogs) != 0 { payInfo = &payloadInfo{} - defer payInfo.free() } - if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, payInfo, ss.decomp, true); err != nil { + if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, payInfo, ss.decomp); err != nil { if err == io.EOF { if len(ss.binlogs) != 0 { chc := &binarylog.ClientHalfClose{} @@ -1791,9 +1732,11 @@ func (ss *serverStream) RecvMsg(m any) (err error) { if len(ss.statsHandler) != 0 { for _, sh := range ss.statsHandler { sh.HandleRPC(ss.s.Context(), &stats.InPayload{ - RecvTime: time.Now(), - Payload: m, - Length: payInfo.uncompressedBytes.Len(), + RecvTime: time.Now(), + Payload: m, + // TODO truncate large payload. + Data: payInfo.uncompressedBytes, + Length: len(payInfo.uncompressedBytes), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, }) @@ -1801,7 +1744,7 @@ func (ss *serverStream) RecvMsg(m any) (err error) { } if len(ss.binlogs) != 0 { cm := &binarylog.ClientMessage{ - Message: payInfo.uncompressedBytes.Materialize(), + Message: payInfo.uncompressedBytes, } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, cm) @@ -1816,26 +1759,23 @@ func MethodFromServerStream(stream ServerStream) (string, bool) { return Method(stream.Context()) } -// prepareMsg returns the hdr, payload and data using the compressors passed or -// using the passed preparedmsg. The returned boolean indicates whether -// compression was made and therefore whether the payload needs to be freed in -// addition to the returned data. Freeing the payload if the returned boolean is -// false can lead to undefined behavior. -func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor, pool mem.BufferPool) (hdr []byte, data, payload mem.BufferSlice, pf payloadFormat, err error) { +// prepareMsg returns the hdr, payload and data +// using the compressors passed or using the +// passed preparedmsg +func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor) (hdr, payload, data []byte, err error) { if preparedMsg, ok := m.(*PreparedMsg); ok { - return preparedMsg.hdr, preparedMsg.encodedData, preparedMsg.payload, preparedMsg.pf, nil + return preparedMsg.hdr, preparedMsg.payload, preparedMsg.encodedData, nil } // The input interface is not a prepared msg. // Marshal and Compress the data at this point data, err = encode(codec, m) if err != nil { - return nil, nil, nil, 0, err + return nil, nil, nil, err } - compData, pf, err := compress(data, cp, comp, pool) + compData, err := compress(data, cp, comp) if err != nil { - data.Free() - return nil, nil, nil, 0, err + return nil, nil, nil, err } - hdr, payload = msgHeader(data, compData, pf) - return hdr, data, payload, pf, nil + hdr, payload = msgHeader(data, compData) + return hdr, payload, data, nil } diff --git a/upstream/vendor/google.golang.org/grpc/stream_interfaces.go b/upstream/vendor/google.golang.org/grpc/stream_interfaces.go deleted file mode 100644 index 0037fee0bd7..00000000000 --- a/upstream/vendor/google.golang.org/grpc/stream_interfaces.go +++ /dev/null @@ -1,238 +0,0 @@ -/* - * - * Copyright 2024 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package grpc - -// ServerStreamingClient represents the client side of a server-streaming (one -// request, many responses) RPC. It is generic over the type of the response -// message. It is used in generated code. -type ServerStreamingClient[Res any] interface { - // Recv receives the next response message from the server. The client may - // repeatedly call Recv to read messages from the response stream. If - // io.EOF is returned, the stream has terminated with an OK status. Any - // other error is compatible with the status package and indicates the - // RPC's status code and message. - Recv() (*Res, error) - - // ClientStream is embedded to provide Context, Header, and Trailer - // functionality. No other methods in the ClientStream should be called - // directly. - ClientStream -} - -// ServerStreamingServer represents the server side of a server-streaming (one -// request, many responses) RPC. It is generic over the type of the response -// message. It is used in generated code. -// -// To terminate the response stream, return from the handler method and return -// an error from the status package, or use nil to indicate an OK status code. -type ServerStreamingServer[Res any] interface { - // Send sends a response message to the client. The server handler may - // call Send multiple times to send multiple messages to the client. An - // error is returned if the stream was terminated unexpectedly, and the - // handler method should return, as the stream is no longer usable. - Send(*Res) error - - // ServerStream is embedded to provide Context, SetHeader, SendHeader, and - // SetTrailer functionality. No other methods in the ServerStream should - // be called directly. - ServerStream -} - -// ClientStreamingClient represents the client side of a client-streaming (many -// requests, one response) RPC. It is generic over both the type of the request -// message stream and the type of the unary response message. It is used in -// generated code. -type ClientStreamingClient[Req any, Res any] interface { - // Send sends a request message to the server. The client may call Send - // multiple times to send multiple messages to the server. On error, Send - // aborts the stream. If the error was generated by the client, the status - // is returned directly. Otherwise, io.EOF is returned, and the status of - // the stream may be discovered using CloseAndRecv(). - Send(*Req) error - - // CloseAndRecv closes the request stream and waits for the server's - // response. This method must be called once and only once after sending - // all request messages. Any error returned is implemented by the status - // package. - CloseAndRecv() (*Res, error) - - // ClientStream is embedded to provide Context, Header, and Trailer - // functionality. No other methods in the ClientStream should be called - // directly. - ClientStream -} - -// ClientStreamingServer represents the server side of a client-streaming (many -// requests, one response) RPC. It is generic over both the type of the request -// message stream and the type of the unary response message. It is used in -// generated code. -// -// To terminate the RPC, call SendAndClose and return nil from the method -// handler or do not call SendAndClose and return an error from the status -// package. -type ClientStreamingServer[Req any, Res any] interface { - // Recv receives the next request message from the client. The server may - // repeatedly call Recv to read messages from the request stream. If - // io.EOF is returned, it indicates the client called CloseAndRecv on its - // ClientStreamingClient. Any other error indicates the stream was - // terminated unexpectedly, and the handler method should return, as the - // stream is no longer usable. - Recv() (*Req, error) - - // SendAndClose sends a single response message to the client and closes - // the stream. This method must be called once and only once after all - // request messages have been processed. Recv should not be called after - // calling SendAndClose. - SendAndClose(*Res) error - - // ServerStream is embedded to provide Context, SetHeader, SendHeader, and - // SetTrailer functionality. No other methods in the ServerStream should - // be called directly. - ServerStream -} - -// BidiStreamingClient represents the client side of a bidirectional-streaming -// (many requests, many responses) RPC. It is generic over both the type of the -// request message stream and the type of the response message stream. It is -// used in generated code. -type BidiStreamingClient[Req any, Res any] interface { - // Send sends a request message to the server. The client may call Send - // multiple times to send multiple messages to the server. On error, Send - // aborts the stream. If the error was generated by the client, the status - // is returned directly. Otherwise, io.EOF is returned, and the status of - // the stream may be discovered using Recv(). - Send(*Req) error - - // Recv receives the next response message from the server. The client may - // repeatedly call Recv to read messages from the response stream. If - // io.EOF is returned, the stream has terminated with an OK status. Any - // other error is compatible with the status package and indicates the - // RPC's status code and message. - Recv() (*Res, error) - - // ClientStream is embedded to provide Context, Header, Trailer, and - // CloseSend functionality. No other methods in the ClientStream should be - // called directly. - ClientStream -} - -// BidiStreamingServer represents the server side of a bidirectional-streaming -// (many requests, many responses) RPC. It is generic over both the type of the -// request message stream and the type of the response message stream. It is -// used in generated code. -// -// To terminate the stream, return from the handler method and return -// an error from the status package, or use nil to indicate an OK status code. -type BidiStreamingServer[Req any, Res any] interface { - // Recv receives the next request message from the client. The server may - // repeatedly call Recv to read messages from the request stream. If - // io.EOF is returned, it indicates the client called CloseSend on its - // BidiStreamingClient. Any other error indicates the stream was - // terminated unexpectedly, and the handler method should return, as the - // stream is no longer usable. - Recv() (*Req, error) - - // Send sends a response message to the client. The server handler may - // call Send multiple times to send multiple messages to the client. An - // error is returned if the stream was terminated unexpectedly, and the - // handler method should return, as the stream is no longer usable. - Send(*Res) error - - // ServerStream is embedded to provide Context, SetHeader, SendHeader, and - // SetTrailer functionality. No other methods in the ServerStream should - // be called directly. - ServerStream -} - -// GenericClientStream implements the ServerStreamingClient, ClientStreamingClient, -// and BidiStreamingClient interfaces. It is used in generated code. -type GenericClientStream[Req any, Res any] struct { - ClientStream -} - -var _ ServerStreamingClient[string] = (*GenericClientStream[int, string])(nil) -var _ ClientStreamingClient[int, string] = (*GenericClientStream[int, string])(nil) -var _ BidiStreamingClient[int, string] = (*GenericClientStream[int, string])(nil) - -// Send pushes one message into the stream of requests to be consumed by the -// server. The type of message which can be sent is determined by the Req type -// parameter of the GenericClientStream receiver. -func (x *GenericClientStream[Req, Res]) Send(m *Req) error { - return x.ClientStream.SendMsg(m) -} - -// Recv reads one message from the stream of responses generated by the server. -// The type of the message returned is determined by the Res type parameter -// of the GenericClientStream receiver. -func (x *GenericClientStream[Req, Res]) Recv() (*Res, error) { - m := new(Res) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// CloseAndRecv closes the sending side of the stream, then receives the unary -// response from the server. The type of message which it returns is determined -// by the Res type parameter of the GenericClientStream receiver. -func (x *GenericClientStream[Req, Res]) CloseAndRecv() (*Res, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(Res) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// GenericServerStream implements the ServerStreamingServer, ClientStreamingServer, -// and BidiStreamingServer interfaces. It is used in generated code. -type GenericServerStream[Req any, Res any] struct { - ServerStream -} - -var _ ServerStreamingServer[string] = (*GenericServerStream[int, string])(nil) -var _ ClientStreamingServer[int, string] = (*GenericServerStream[int, string])(nil) -var _ BidiStreamingServer[int, string] = (*GenericServerStream[int, string])(nil) - -// Send pushes one message into the stream of responses to be consumed by the -// client. The type of message which can be sent is determined by the Res -// type parameter of the serverStreamServer receiver. -func (x *GenericServerStream[Req, Res]) Send(m *Res) error { - return x.ServerStream.SendMsg(m) -} - -// SendAndClose pushes the unary response to the client. The type of message -// which can be sent is determined by the Res type parameter of the -// clientStreamServer receiver. -func (x *GenericServerStream[Req, Res]) SendAndClose(m *Res) error { - return x.ServerStream.SendMsg(m) -} - -// Recv reads one message from the stream of requests generated by the client. -// The type of the message returned is determined by the Req type parameter -// of the clientStreamServer receiver. -func (x *GenericServerStream[Req, Res]) Recv() (*Req, error) { - m := new(Req) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} diff --git a/upstream/vendor/google.golang.org/grpc/version.go b/upstream/vendor/google.golang.org/grpc/version.go index 187fbf11951..2556f758386 100644 --- a/upstream/vendor/google.golang.org/grpc/version.go +++ b/upstream/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.67.0" +const Version = "1.63.2" diff --git a/upstream/vendor/google.golang.org/grpc/vet.sh b/upstream/vendor/google.golang.org/grpc/vet.sh new file mode 100644 index 00000000000..7e6b92e491a --- /dev/null +++ b/upstream/vendor/google.golang.org/grpc/vet.sh @@ -0,0 +1,195 @@ +#!/bin/bash + +set -ex # Exit on error; debugging enabled. +set -o pipefail # Fail a pipe if any sub-command fails. + +# not makes sure the command passed to it does not exit with a return code of 0. +not() { + # This is required instead of the earlier (! $COMMAND) because subshells and + # pipefail don't work the same on Darwin as in Linux. + ! "$@" +} + +die() { + echo "$@" >&2 + exit 1 +} + +fail_on_output() { + tee /dev/stderr | not read +} + +# Check to make sure it's safe to modify the user's git repo. +git status --porcelain | fail_on_output + +# Undo any edits made by this script. +cleanup() { + git reset --hard HEAD +} +trap cleanup EXIT + +PATH="${HOME}/go/bin:${GOROOT}/bin:${PATH}" +go version + +if [[ "$1" = "-install" ]]; then + # Install the pinned versions as defined in module tools. + pushd ./test/tools + go install \ + golang.org/x/tools/cmd/goimports \ + honnef.co/go/tools/cmd/staticcheck \ + github.com/client9/misspell/cmd/misspell + popd + if [[ -z "${VET_SKIP_PROTO}" ]]; then + if [[ "${GITHUB_ACTIONS}" = "true" ]]; then + PROTOBUF_VERSION=25.2 # a.k.a. v4.22.0 in pb.go files. + PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip + pushd /home/runner/go + wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME} + unzip ${PROTOC_FILENAME} + bin/protoc --version + popd + elif not which protoc > /dev/null; then + die "Please install protoc into your path" + fi + fi + exit 0 +elif [[ "$#" -ne 0 ]]; then + die "Unknown argument(s): $*" +fi + +# - Check that generated proto files are up to date. +if [[ -z "${VET_SKIP_PROTO}" ]]; then + make proto && git status --porcelain 2>&1 | fail_on_output || \ + (git status; git --no-pager diff; exit 1) +fi + +if [[ -n "${VET_ONLY_PROTO}" ]]; then + exit 0 +fi + +# - Ensure all source files contain a copyright message. +# (Done in two parts because Darwin "git grep" has broken support for compound +# exclusion matches.) +(grep -L "DO NOT EDIT" $(git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)" -- '*.go') || true) | fail_on_output + +# - Make sure all tests in grpc and grpc/test use leakcheck via Teardown. +not grep 'func Test[^(]' *_test.go +not grep 'func Test[^(]' test/*.go + +# - Check for typos in test function names +git grep 'func (s) ' -- "*_test.go" | not grep -v 'func (s) Test' +git grep 'func [A-Z]' -- "*_test.go" | not grep -v 'func Test\|Benchmark\|Example' + +# - Do not import x/net/context. +not git grep -l 'x/net/context' -- "*.go" + +# - Do not use time.After except in tests. It has the potential to leak the +# timer since there is no way to stop it early. +git grep -l 'time.After(' -- "*.go" | not grep -v '_test.go\|test_utils\|testutils' + +# - Do not import math/rand for real library code. Use internal/grpcrand for +# thread safety. +git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^interop/stress\|grpcrand\|^benchmark\|wrr_test' + +# - Do not use "interface{}"; use "any" instead. +git grep -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc\|grpc_testing_not_regenerate' + +# - Do not call grpclog directly. Use grpclog.Component instead. +git grep -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpclog.F' --or -e 'grpclog.V' -- "*.go" | not grep -v '^grpclog/component.go\|^internal/grpctest/tlogger_test.go' + +# - Ensure all ptypes proto packages are renamed when importing. +not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go" + +# - Ensure all usages of grpc_testing package are renamed when importing. +not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" -- "*.go" + +# - Ensure all xds proto imports are renamed to *pb or *grpc. +git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "' + +misspell -error . + +# - gofmt, goimports, go vet, go mod tidy. +# Perform these checks on each module inside gRPC. +for MOD_FILE in $(find . -name 'go.mod'); do + MOD_DIR=$(dirname ${MOD_FILE}) + pushd ${MOD_DIR} + go vet -all ./... | fail_on_output + gofmt -s -d -l . 2>&1 | fail_on_output + goimports -l . 2>&1 | not grep -vE "\.pb\.go" + + go mod tidy -compat=1.19 + git status --porcelain 2>&1 | fail_on_output || \ + (git status; git --no-pager diff; exit 1) + popd +done + +# - Collection of static analysis checks +SC_OUT="$(mktemp)" +staticcheck -go 1.19 -checks 'all' ./... > "${SC_OUT}" || true + +# Error for anything other than checks that need exclusions. +grep -v "(ST1000)" "${SC_OUT}" | grep -v "(SA1019)" | grep -v "(ST1003)" | not grep -v "(ST1019)\|\(other import of\)" + +# Exclude underscore checks for generated code. +grep "(ST1003)" "${SC_OUT}" | not grep -v '\(.pb.go:\)\|\(code_string_test.go:\)\|\(grpc_testing_not_regenerate\)' + +# Error for duplicate imports not including grpc protos. +grep "(ST1019)\|\(other import of\)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused +channelz/grpc_channelz_v1" +go-control-plane/envoy +grpclb/grpc_lb_v1" +health/grpc_health_v1" +interop/grpc_testing" +orca/v3" +proto/grpc_gcp" +proto/grpc_lookup_v1" +reflection/grpc_reflection_v1" +reflection/grpc_reflection_v1alpha" +XXXXX PleaseIgnoreUnused' + +# Error for any package comments not in generated code. +grep "(ST1000)" "${SC_OUT}" | not grep -v "\.pb\.go:" + +# Only ignore the following deprecated types/fields/functions and exclude +# generated code. +grep "(SA1019)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused +XXXXX Protobuf related deprecation errors: +"github.com/golang/protobuf +.pb.go: +grpc_testing_not_regenerate +: ptypes. +proto.RegisterType +XXXXX gRPC internal usage deprecation errors: +"google.golang.org/grpc +: grpc. +: v1alpha. +: v1alphareflectionpb. +BalancerAttributes is deprecated: +CredsBundle is deprecated: +Metadata is deprecated: use Attributes instead. +NewSubConn is deprecated: +OverrideServerName is deprecated: +RemoveSubConn is deprecated: +SecurityVersion is deprecated: +Target is deprecated: Use the Target field in the BuildOptions instead. +UpdateAddresses is deprecated: +UpdateSubConnState is deprecated: +balancer.ErrTransientFailure is deprecated: +grpc/reflection/v1alpha/reflection.proto +SwitchTo is deprecated: +XXXXX xDS deprecated fields we support +.ExactMatch +.PrefixMatch +.SafeRegexMatch +.SuffixMatch +GetContainsMatch +GetExactMatch +GetMatchSubjectAltNames +GetPrefixMatch +GetSafeRegexMatch +GetSuffixMatch +GetTlsCertificateCertificateProviderInstance +GetValidationContextCertificateProviderInstance +XXXXX PleaseIgnoreUnused' + +echo SUCCESS diff --git a/upstream/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/upstream/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index bb2966e3b4c..f47902371a6 100644 --- a/upstream/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/upstream/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -102,7 +102,7 @@ type decoder struct { } // newError returns an error object with position info. -func (d decoder) newError(pos int, f string, x ...any) error { +func (d decoder) newError(pos int, f string, x ...interface{}) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) @@ -114,7 +114,7 @@ func (d decoder) unexpectedTokenError(tok json.Token) error { } // syntaxError returns a syntax error for given position. -func (d decoder) syntaxError(pos int, f string, x ...any) error { +func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) diff --git a/upstream/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/upstream/vendor/google.golang.org/protobuf/encoding/protojson/encode.go index 29846df222c..3f75098b6fb 100644 --- a/upstream/vendor/google.golang.org/protobuf/encoding/protojson/encode.go +++ b/upstream/vendor/google.golang.org/protobuf/encoding/protojson/encode.go @@ -25,17 +25,15 @@ const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in JSON format using default options. -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } @@ -112,9 +110,8 @@ type MarshalOptions struct { // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "<nil>" // invalid syntax, but okay since this is for debugging @@ -125,9 +122,8 @@ func (o MarshalOptions) Format(m proto.Message) string { } // Marshal marshals the given [proto.Message] in the JSON format using options in -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// MarshalOptions. Do not depend on the output being stable. It may change over +// time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } diff --git a/upstream/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/upstream/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index 24bc98ac422..a45f112bce3 100644 --- a/upstream/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/upstream/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -84,7 +84,7 @@ type decoder struct { } // newError returns an error object with position info. -func (d decoder) newError(pos int, f string, x ...any) error { +func (d decoder) newError(pos int, f string, x ...interface{}) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) @@ -96,7 +96,7 @@ func (d decoder) unexpectedTokenError(tok text.Token) error { } // syntaxError returns a syntax error for given position. -func (d decoder) syntaxError(pos int, f string, x ...any) error { +func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) diff --git a/upstream/vendor/google.golang.org/protobuf/encoding/prototext/encode.go b/upstream/vendor/google.golang.org/protobuf/encoding/prototext/encode.go index 1f57e6610a2..95967e8112a 100644 --- a/upstream/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +++ b/upstream/vendor/google.golang.org/protobuf/encoding/prototext/encode.go @@ -27,17 +27,15 @@ const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in textproto format using default -// options. Do not depend on the output being stable. Its output will change -// across different builds of your program, even when using the same version of -// the protobuf module. +// options. Do not depend on the output being stable. It may change over time +// across different versions of the program. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } @@ -86,9 +84,8 @@ type MarshalOptions struct { // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. Its output will change across -// different builds of your program, even when using the same version of the -// protobuf module. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "<nil>" // invalid syntax, but okay since this is for debugging @@ -101,9 +98,8 @@ func (o MarshalOptions) Format(m proto.Message) string { } // Marshal writes the given [proto.Message] in textproto format using options in -// MarshalOptions object. Do not depend on the output being stable. Its output -// will change across different builds of your program, even when using the -// same version of the protobuf module. +// MarshalOptions object. Do not depend on the output being stable. It may +// change over time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/upstream/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index 87e46bd4dfb..a45625c8d1f 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -252,7 +252,6 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu {rv.MethodByName("Values"), "Values"}, {rv.MethodByName("ReservedNames"), "ReservedNames"}, {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, - {rv.MethodByName("IsClosed"), "IsClosed"}, }...) case protoreflect.EnumValueDescriptor: diff --git a/upstream/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/upstream/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index ff6a38360ad..18f07568743 100644 Binary files a/upstream/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb and b/upstream/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb differ diff --git a/upstream/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go b/upstream/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go deleted file mode 100644 index 029a6a12d74..00000000000 --- a/upstream/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go +++ /dev/null @@ -1,13 +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 editionssupport defines constants for editions that are supported. -package editionssupport - -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" - -const ( - Minimum = descriptorpb.Edition_EDITION_PROTO2 - Maximum = descriptorpb.Edition_EDITION_2023 -) diff --git a/upstream/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/upstream/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go index ea1d3e65a57..d2b3ac031e1 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go @@ -214,7 +214,7 @@ func (d *Decoder) parseNext() (Token, error) { // newSyntaxError returns an error with line and column information useful for // syntax errors. -func (d *Decoder) newSyntaxError(pos int, f string, x ...any) error { +func (d *Decoder) newSyntaxError(pos int, f string, x ...interface{}) error { e := errors.New(f, x...) line, column := d.Position(pos) return errors.New("syntax error (line %d:%d): %v", line, column, e) diff --git a/upstream/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/upstream/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 7e87c760443..373d208374f 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,7 +32,6 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 - f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -108,7 +107,8 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.EditionFeatures.IsPacked = true + f.L1.HasPacked = true + f.L1.IsPacked = true case strings.HasPrefix(s, "weak="): f.L1.IsWeak = true f.L1.Message = filedesc.PlaceholderMessage(protoreflect.FullName(s[len("weak="):])) diff --git a/upstream/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/upstream/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 099b2bf451b..87853e786d0 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -601,7 +601,7 @@ func (d *Decoder) consumeToken(kind Kind, size int, attrs uint8) Token { // newSyntaxError returns a syntax error with line and column information for // current position. -func (d *Decoder) newSyntaxError(f string, x ...any) error { +func (d *Decoder) newSyntaxError(f string, x ...interface{}) error { e := errors.New(f, x...) line, column := d.Position(len(d.orig) - len(d.in)) return errors.New("syntax error (line %d:%d): %v", line, column, e) diff --git a/upstream/vendor/google.golang.org/protobuf/internal/errors/errors.go b/upstream/vendor/google.golang.org/protobuf/internal/errors/errors.go index c2d6bd5265d..20c17b35e3a 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/errors/errors.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/errors/errors.go @@ -17,7 +17,7 @@ var Error = errors.New("protobuf error") // New formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. -func New(f string, x ...any) error { +func New(f string, x ...interface{}) error { return &prefixError{s: format(f, x...)} } @@ -43,7 +43,7 @@ func (e *prefixError) Unwrap() error { // Wrap returns an error that has a "proto" prefix, the formatted string described // by the format specifier and arguments, and a suffix of err. The error wraps err. -func Wrap(err error, f string, x ...any) error { +func Wrap(err error, f string, x ...interface{}) error { return &wrapError{ s: format(f, x...), err: err, @@ -67,7 +67,7 @@ func (e *wrapError) Is(target error) bool { return target == Error } -func format(f string, x ...any) string { +func format(f string, x ...interface{}) string { // avoid "proto: " prefix when chaining for i := 0; i < len(x); i++ { switch e := x[i].(type) { @@ -87,18 +87,3 @@ func InvalidUTF8(name string) error { func RequiredNotSet(name string) error { return New("required field %v not set", name) } - -type SizeMismatchError struct { - Calculated, Measured int -} - -func (e *SizeMismatchError) Error() string { - return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured) -} - -func MismatchedSizeCalculation(calculated, measured int) error { - return &SizeMismatchError{ - Calculated: calculated, - Measured: measured, - } -} diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index df53ff40b25..8826bcf4021 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -7,7 +7,6 @@ package filedesc import ( "bytes" "fmt" - "strings" "sync" "sync/atomic" @@ -109,12 +108,9 @@ func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd } func (fd *File) Parent() protoreflect.Descriptor { return nil } func (fd *File) Index() int { return 0 } func (fd *File) Syntax() protoreflect.Syntax { return fd.L1.Syntax } - -// Not exported and just used to reconstruct the original FileDescriptor proto -func (fd *File) Edition() int32 { return int32(fd.L1.Edition) } -func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } -func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } -func (fd *File) IsPlaceholder() bool { return false } +func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } +func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } +func (fd *File) IsPlaceholder() bool { return false } func (fd *File) Options() protoreflect.ProtoMessage { if f := fd.lazyInit().Options; f != nil { return f() @@ -206,9 +202,6 @@ func (ed *Enum) lazyInit() *EnumL2 { ed.L0.ParentFile.lazyInit() // implicitly initializes L2 return ed.L2 } -func (ed *Enum) IsClosed() bool { - return !ed.L1.EditionFeatures.IsOpenEnum -} func (ed *EnumValue) Options() protoreflect.ProtoMessage { if f := ed.L1.Options; f != nil { @@ -258,6 +251,10 @@ type ( StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto IsWeak bool // promoted from google.protobuf.FieldOptions + HasPacked bool // promoted from google.protobuf.FieldOptions + IsPacked bool // promoted from google.protobuf.FieldOptions + HasEnforceUTF8 bool // promoted from google.protobuf.FieldOptions + EnforceUTF8 bool // promoted from google.protobuf.FieldOptions Default defaultValue ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields Enum protoreflect.EnumDescriptor @@ -334,7 +331,8 @@ func (fd *Field) HasPresence() bool { if fd.L1.Cardinality == protoreflect.Repeated { return false } - return fd.IsExtension() || fd.L1.EditionFeatures.IsFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil + explicitFieldPresence := fd.Syntax() == protoreflect.Editions && fd.L1.EditionFeatures.IsFieldPresence + return fd.Syntax() == protoreflect.Proto2 || explicitFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil } func (fd *Field) HasOptionalKeyword() bool { return (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional @@ -347,7 +345,14 @@ func (fd *Field) IsPacked() bool { case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: return false } - return fd.L1.EditionFeatures.IsPacked + if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions { + return fd.L1.EditionFeatures.IsPacked + } + if fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3 { + // proto3 repeated fields are packed by default. + return !fd.L1.HasPacked || fd.L1.IsPacked + } + return fd.L1.IsPacked } func (fd *Field) IsExtension() bool { return false } func (fd *Field) IsWeak() bool { return fd.L1.IsWeak } @@ -383,10 +388,6 @@ func (fd *Field) Message() protoreflect.MessageDescriptor { } return fd.L1.Message } -func (fd *Field) IsMapEntry() bool { - parent, ok := fd.L0.Parent.(protoreflect.MessageDescriptor) - return ok && parent.IsMapEntry() -} func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) } func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} @@ -398,7 +399,13 @@ func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} // WARNING: This method is exempt from the compatibility promise and may be // removed in the future without warning. func (fd *Field) EnforceUTF8() bool { - return fd.L1.EditionFeatures.IsUTF8Validated + if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions { + return fd.L1.EditionFeatures.IsUTF8Validated + } + if fd.L1.HasEnforceUTF8 { + return fd.L1.EnforceUTF8 + } + return fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3 } func (od *Oneof) IsSynthetic() bool { @@ -431,6 +438,7 @@ type ( Options func() protoreflect.ProtoMessage StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto + IsPacked bool // promoted from google.protobuf.FieldOptions Default defaultValue Enum protoreflect.EnumDescriptor Message protoreflect.MessageDescriptor @@ -453,16 +461,7 @@ func (xd *Extension) HasPresence() bool { return xd.L1.Cardi func (xd *Extension) HasOptionalKeyword() bool { return (xd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && xd.L1.Cardinality == protoreflect.Optional) || xd.lazyInit().IsProto3Optional } -func (xd *Extension) IsPacked() bool { - if xd.L1.Cardinality != protoreflect.Repeated { - return false - } - switch xd.L1.Kind { - case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: - return false - } - return xd.L1.EditionFeatures.IsPacked -} +func (xd *Extension) IsPacked() bool { return xd.lazyInit().IsPacked } func (xd *Extension) IsExtension() bool { return true } func (xd *Extension) IsWeak() bool { return false } func (xd *Extension) IsList() bool { return xd.Cardinality() == protoreflect.Repeated } @@ -543,9 +542,8 @@ func (md *Method) ProtoInternal(pragma.DoNotImplement) {} // Surrogate files are can be used to create standalone descriptors // where the syntax is only information derived from the parent file. var ( - SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}} - SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}} - SurrogateEdition2023 = &File{L1: FileL1{Syntax: protoreflect.Editions, Edition: Edition2023}, L2: &FileL2{}} + SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}} + SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}} ) type ( @@ -587,34 +585,6 @@ func (s *stringName) InitJSON(name string) { s.nameJSON = name } -// Returns true if this field is structured like the synthetic field of a proto2 -// group. This allows us to expand our treatment of delimited fields without -// breaking proto2 files that have been upgraded to editions. -func isGroupLike(fd protoreflect.FieldDescriptor) bool { - // Groups are always group types. - if fd.Kind() != protoreflect.GroupKind { - return false - } - - // Group fields are always the lowercase type name. - if strings.ToLower(string(fd.Message().Name())) != string(fd.Name()) { - return false - } - - // Groups could only be defined in the same file they're used. - if fd.Message().ParentFile() != fd.ParentFile() { - return false - } - - // Group messages are always defined in the same scope as the field. File - // level extensions will compare NULL == NULL here, which is why the file - // comparison above is necessary to ensure both come from the same file. - if fd.IsExtension() { - return fd.Parent() == fd.Message().Parent() - } - return fd.ContainingMessage() == fd.Message().Parent() -} - func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName { s.once.Do(func() { if fd.IsExtension() { @@ -635,7 +605,7 @@ func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName { // Format the text name. s.nameText = string(fd.Name()) - if isGroupLike(fd) { + if fd.Kind() == protoreflect.GroupKind { s.nameText = string(fd.Message().Name()) } } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go index 8a57d60b08c..237e64fd237 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go @@ -113,10 +113,8 @@ func (fd *File) unmarshalSeed(b []byte) { switch string(v) { case "proto2": fd.L1.Syntax = protoreflect.Proto2 - fd.L1.Edition = EditionProto2 case "proto3": fd.L1.Syntax = protoreflect.Proto3 - fd.L1.Edition = EditionProto3 case "editions": fd.L1.Syntax = protoreflect.Editions default: @@ -179,10 +177,11 @@ func (fd *File) unmarshalSeed(b []byte) { // If syntax is missing, it is assumed to be proto2. if fd.L1.Syntax == 0 { fd.L1.Syntax = protoreflect.Proto2 - fd.L1.Edition = EditionProto2 } - fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition) + if fd.L1.Syntax == protoreflect.Editions { + fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition) + } // Parse editions features from options if any if options != nil { @@ -268,7 +267,6 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protorefl ed.L0.ParentFile = pf ed.L0.Parent = pd ed.L0.Index = i - ed.L1.EditionFeatures = featuresFromParentDesc(ed.Parent()) var numValues int for b := b; len(b) > 0; { @@ -445,7 +443,6 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot xd.L0.ParentFile = pf xd.L0.Parent = pd xd.L0.Index = i - xd.L1.EditionFeatures = featuresFromParentDesc(pd) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) @@ -470,38 +467,6 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot xd.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.FieldDescriptorProto_Extendee_field_number: xd.L1.Extendee = PlaceholderMessage(makeFullName(sb, v)) - case genid.FieldDescriptorProto_Options_field_number: - xd.unmarshalOptions(v) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } - - if xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded { - xd.L1.Kind = protoreflect.GroupKind - } -} - -func (xd *Extension) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.FieldOptions_Packed_field_number: - xd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) - } - case protowire.BytesType: - v, m := protowire.ConsumeBytes(b) - b = b[m:] - switch num { - case genid.FieldOptions_Features_field_number: - xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) @@ -534,7 +499,7 @@ func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protor } var nameBuilderPool = sync.Pool{ - New: func() any { return new(strs.Builder) }, + New: func() interface{} { return new(strs.Builder) }, } func getBuilder() *strs.Builder { diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index e56c91a8dbe..482a61cc10e 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -45,11 +45,6 @@ func (file *File) resolveMessages() { case protoreflect.MessageKind, protoreflect.GroupKind: fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx) depIdx++ - if fd.L1.Kind == protoreflect.GroupKind && (fd.IsMap() || fd.IsMapEntry()) { - // A map field might inherit delimited encoding from a file-wide default feature. - // But maps never actually use delimited encoding. (At least for now...) - fd.L1.Kind = protoreflect.MessageKind - } } // Default is resolved here since it depends on Enum being resolved. @@ -471,10 +466,10 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref b = b[m:] } } - if fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded { + if fd.Syntax() == protoreflect.Editions && fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded { fd.L1.Kind = protoreflect.GroupKind } - if fd.L1.EditionFeatures.IsLegacyRequired { + if fd.Syntax() == protoreflect.Editions && fd.L1.EditionFeatures.IsLegacyRequired { fd.L1.Cardinality = protoreflect.Required } if rawTypeName != nil { @@ -501,11 +496,13 @@ func (fd *Field) unmarshalOptions(b []byte) { b = b[m:] switch num { case genid.FieldOptions_Packed_field_number: - fd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) + fd.L1.HasPacked = true + fd.L1.IsPacked = protowire.DecodeBool(v) case genid.FieldOptions_Weak_field_number: fd.L1.IsWeak = protowire.DecodeBool(v) case FieldOptions_EnforceUTF8: - fd.L1.EditionFeatures.IsUTF8Validated = protowire.DecodeBool(v) + fd.L1.HasEnforceUTF8 = true + fd.L1.EnforceUTF8 = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) @@ -551,6 +548,7 @@ func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { var rawTypeName []byte var rawOptions []byte + xd.L1.EditionFeatures = featuresFromParentDesc(xd.L1.Extendee) xd.L2 = new(ExtensionL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) @@ -574,6 +572,7 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { case genid.FieldDescriptorProto_TypeName_field_number: rawTypeName = v case genid.FieldDescriptorProto_Options_field_number: + xd.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -581,6 +580,12 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { b = b[m:] } } + if xd.Syntax() == protoreflect.Editions && xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded { + xd.L1.Kind = protoreflect.GroupKind + } + if xd.Syntax() == protoreflect.Editions && xd.L1.EditionFeatures.IsLegacyRequired { + xd.L1.Cardinality = protoreflect.Required + } if rawTypeName != nil { name := makeFullName(sb, rawTypeName) switch xd.L1.Kind { @@ -593,6 +598,32 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { xd.L2.Options = xd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Field, rawOptions) } +func (xd *Extension) unmarshalOptions(b []byte) { + for len(b) > 0 { + num, typ, n := protowire.ConsumeTag(b) + b = b[n:] + switch typ { + case protowire.VarintType: + v, m := protowire.ConsumeVarint(b) + b = b[m:] + switch num { + case genid.FieldOptions_Packed_field_number: + xd.L2.IsPacked = protowire.DecodeBool(v) + } + case protowire.BytesType: + v, m := protowire.ConsumeBytes(b) + b = b[m:] + switch num { + case genid.FieldOptions_Features_field_number: + xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures) + } + default: + m := protowire.ConsumeFieldValue(num, typ, b) + b = b[m:] + } + } +} + func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) { var rawMethods [][]byte var rawOptions []byte diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go index f4107c05f4e..30db19fdc75 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go @@ -8,7 +8,6 @@ package filedesc import ( "fmt" - "strings" "sync" "google.golang.org/protobuf/internal/descfmt" @@ -199,16 +198,6 @@ func (p *Fields) lazyInit() *Fields { if _, ok := p.byText[d.TextName()]; !ok { p.byText[d.TextName()] = d } - if isGroupLike(d) { - lowerJSONName := strings.ToLower(d.JSONName()) - if _, ok := p.byJSON[lowerJSONName]; !ok { - p.byJSON[lowerJSONName] = d - } - lowerTextName := strings.ToLower(d.TextName()) - if _, ok := p.byText[lowerTextName]; !ok { - p.byText[lowerTextName] = d - } - } if _, ok := p.byNum[d.Number()]; !ok { p.byNum[d.Number()] = d } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/editions.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/editions.go index 11f5f356b66..0375a49d407 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/editions.go @@ -14,13 +14,9 @@ import ( ) var defaultsCache = make(map[Edition]EditionFeatures) -var defaultsKeys = []Edition{} func init() { unmarshalEditionDefaults(editiondefaults.Defaults) - SurrogateProto2.L1.EditionFeatures = getFeaturesFor(EditionProto2) - SurrogateProto3.L1.EditionFeatures = getFeaturesFor(EditionProto3) - SurrogateEdition2023.L1.EditionFeatures = getFeaturesFor(Edition2023) } func unmarshalGoFeature(b []byte, parent EditionFeatures) EditionFeatures { @@ -108,15 +104,12 @@ func unmarshalEditionDefault(b []byte) { v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { - case genid.FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number: - fs = unmarshalFeatureSet(v, fs) - case genid.FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number: + case genid.FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number: fs = unmarshalFeatureSet(v, fs) } } } defaultsCache[ed] = fs - defaultsKeys = append(defaultsKeys, ed) } func unmarshalEditionDefaults(b []byte) { @@ -142,15 +135,8 @@ func unmarshalEditionDefaults(b []byte) { } func getFeaturesFor(ed Edition) EditionFeatures { - match := EditionUnknown - for _, key := range defaultsKeys { - if key > ed { - break - } - match = key - } - if match == EditionUnknown { - panic(fmt.Sprintf("unsupported edition: %v", ed)) + if def, ok := defaultsCache[ed]; ok { + return def } - return defaultsCache[match] + panic(fmt.Sprintf("unsupported edition: %v", ed)) } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go index bfb3b841704..28240ebc5c4 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go @@ -63,7 +63,6 @@ func (e PlaceholderEnum) Options() protoreflect.ProtoMessage { return des func (e PlaceholderEnum) Values() protoreflect.EnumValueDescriptors { return emptyEnumValues } func (e PlaceholderEnum) ReservedNames() protoreflect.Names { return emptyNames } func (e PlaceholderEnum) ReservedRanges() protoreflect.EnumRanges { return emptyEnumRanges } -func (e PlaceholderEnum) IsClosed() bool { return false } func (e PlaceholderEnum) ProtoType(protoreflect.EnumDescriptor) { return } func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/filetype/build.go b/upstream/vendor/google.golang.org/protobuf/internal/filetype/build.go index ba83fea44c3..f0e38c4ef4e 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/filetype/build.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/filetype/build.go @@ -68,7 +68,7 @@ type Builder struct { // and for input and output messages referenced by service methods. // Dependencies must come after declarations, but the ordering of // dependencies themselves is unspecified. - GoTypes []any + GoTypes []interface{} // DependencyIndexes is an ordered list of indexes into GoTypes for the // dependencies of messages, extensions, or services. @@ -268,7 +268,7 @@ func (x depIdxs) Get(i, j int32) int32 { type ( resolverByIndex struct { - goTypes []any + goTypes []interface{} depIdxs depIdxs fileRegistry } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/upstream/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index f30ab6b586f..40272c893f7 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -21,7 +21,6 @@ const ( // Enum values for google.protobuf.Edition. const ( Edition_EDITION_UNKNOWN_enum_value = 0 - Edition_EDITION_LEGACY_enum_value = 900 Edition_EDITION_PROTO2_enum_value = 998 Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 @@ -654,7 +653,6 @@ const ( FieldOptions_Targets_field_name protoreflect.Name = "targets" FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults" FieldOptions_Features_field_name protoreflect.Name = "features" - FieldOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype" @@ -669,7 +667,6 @@ const ( FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets" FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults" FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features" - FieldOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.feature_support" FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option" ) @@ -687,7 +684,6 @@ const ( FieldOptions_Targets_field_number protoreflect.FieldNumber = 19 FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20 FieldOptions_Features_field_number protoreflect.FieldNumber = 21 - FieldOptions_FeatureSupport_field_number protoreflect.FieldNumber = 22 FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -771,33 +767,6 @@ const ( FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2 ) -// Names for google.protobuf.FieldOptions.FeatureSupport. -const ( - FieldOptions_FeatureSupport_message_name protoreflect.Name = "FeatureSupport" - FieldOptions_FeatureSupport_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport" -) - -// Field names for google.protobuf.FieldOptions.FeatureSupport. -const ( - FieldOptions_FeatureSupport_EditionIntroduced_field_name protoreflect.Name = "edition_introduced" - FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" - FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" - FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" - - FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" - FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" - FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" - FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" -) - -// Field numbers for google.protobuf.FieldOptions.FeatureSupport. -const ( - FieldOptions_FeatureSupport_EditionIntroduced_field_number protoreflect.FieldNumber = 1 - FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 - FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 - FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 -) - // Names for google.protobuf.OneofOptions. const ( OneofOptions_message_name protoreflect.Name = "OneofOptions" @@ -860,13 +829,11 @@ const ( EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumValueOptions_Features_field_name protoreflect.Name = "features" EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" - EnumValueOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" - EnumValueOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.feature_support" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" ) @@ -875,7 +842,6 @@ const ( EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 - EnumValueOptions_FeatureSupport_field_number protoreflect.FieldNumber = 4 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -1144,20 +1110,17 @@ const ( // Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" - FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_name protoreflect.Name = "overridable_features" - FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_name protoreflect.Name = "fixed_features" + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_name protoreflect.Name = "features" - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" - FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features" - FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features" + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features" ) // Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 - FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number protoreflect.FieldNumber = 4 - FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number protoreflect.FieldNumber = 5 + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.SourceCodeInfo. diff --git a/upstream/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go b/upstream/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go index 9a652a2b424..fd9015e8eee 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go @@ -10,7 +10,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) -const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto" +const File_reflect_protodesc_proto_go_features_proto = "reflect/protodesc/proto/go_features.proto" // Names for google.protobuf.GoFeatures. const ( diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/api_export.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/api_export.go index 5d5771c2ed5..a371f98de14 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/api_export.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/api_export.go @@ -22,13 +22,13 @@ type Export struct{} // NewError formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. -func (Export) NewError(f string, x ...any) error { +func (Export) NewError(f string, x ...interface{}) error { return errors.New(f, x...) } // enum is any enum type generated by protoc-gen-go // and must be a named int32 type. -type enum = any +type enum = interface{} // EnumOf returns the protoreflect.Enum interface over e. // It returns nil if e is nil. @@ -81,7 +81,7 @@ func (Export) EnumStringOf(ed protoreflect.EnumDescriptor, n protoreflect.EnumNu // message is any message type generated by protoc-gen-go // and must be a pointer to a named struct type. -type message = any +type message = interface{} // legacyMessageWrapper wraps a v2 message as a v1 message. type legacyMessageWrapper struct{ m protoreflect.ProtoMessage } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/checkinit.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/checkinit.go index f29e6a8fa88..bff041edc94 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/checkinit.go @@ -68,7 +68,7 @@ func (mi *MessageInfo) isInitExtensions(ext *map[int32]ExtensionField) error { } for _, x := range *ext { ei := getExtensionFieldInfo(x.Type()) - if ei.funcs.isInit == nil || x.isUnexpandedLazy() { + if ei.funcs.isInit == nil { continue } v := x.Value() diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go index 4bb0a7a20ce..2b8f122c27b 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go @@ -99,28 +99,6 @@ func (f *ExtensionField) canLazy(xt protoreflect.ExtensionType) bool { return false } -// isUnexpandedLazy returns true if the ExensionField is lazy and not -// yet expanded, which means it's present and already checked for -// initialized required fields. -func (f *ExtensionField) isUnexpandedLazy() bool { - return f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0 -} - -// lazyBuffer retrieves the buffer for a lazy extension if it's not yet expanded. -// -// The returned buffer has to be kept over whatever operation we're planning, -// as re-retrieving it will fail after the message is lazily decoded. -func (f *ExtensionField) lazyBuffer() []byte { - // This function might be in the critical path, so check the atomic without - // taking a look first, then only take the lock if needed. - if !f.isUnexpandedLazy() { - return nil - } - f.lazy.mu.Lock() - defer f.lazy.mu.Unlock() - return f.lazy.b -} - func (f *ExtensionField) lazyInit() { f.lazy.mu.Lock() defer f.lazy.mu.Unlock() diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_field.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_field.go index 78ee47e44b9..3fadd241e1c 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_field.go @@ -233,15 +233,9 @@ func sizeMessageInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int { } func appendMessageInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - calculatedSize := f.mi.sizePointer(p.Elem(), opts) b = protowire.AppendVarint(b, f.wiretag) - b = protowire.AppendVarint(b, uint64(calculatedSize)) - before := len(b) - b, err := f.mi.marshalAppendPointer(b, p.Elem(), opts) - if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { - return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) - } - return b, err + b = protowire.AppendVarint(b, uint64(f.mi.sizePointer(p.Elem(), opts))) + return f.mi.marshalAppendPointer(b, p.Elem(), opts) } func consumeMessageInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { @@ -268,21 +262,14 @@ func isInitMessageInfo(p pointer, f *coderFieldInfo) error { return f.mi.checkInitializedPointer(p.Elem()) } -func sizeMessage(m proto.Message, tagsize int, opts marshalOptions) int { - return protowire.SizeBytes(opts.Options().Size(m)) + tagsize +func sizeMessage(m proto.Message, tagsize int, _ marshalOptions) int { + return protowire.SizeBytes(proto.Size(m)) + tagsize } func appendMessage(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { - mopts := opts.Options() - calculatedSize := mopts.Size(m) b = protowire.AppendVarint(b, wiretag) - b = protowire.AppendVarint(b, uint64(calculatedSize)) - before := len(b) - b, err := mopts.MarshalAppend(b, m) - if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { - return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) - } - return b, err + b = protowire.AppendVarint(b, uint64(proto.Size(m))) + return opts.Options().MarshalAppend(b, m) } func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { @@ -418,8 +405,8 @@ func consumeGroupType(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf return f.mi.unmarshalPointer(b, p.Elem(), f.num, opts) } -func sizeGroup(m proto.Message, tagsize int, opts marshalOptions) int { - return 2*tagsize + opts.Options().Size(m) +func sizeGroup(m proto.Message, tagsize int, _ marshalOptions) int { + return 2*tagsize + proto.Size(m) } func appendGroup(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { @@ -495,14 +482,10 @@ func appendMessageSliceInfo(b []byte, p pointer, f *coderFieldInfo, opts marshal b = protowire.AppendVarint(b, f.wiretag) siz := f.mi.sizePointer(v, opts) b = protowire.AppendVarint(b, uint64(siz)) - before := len(b) b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } - if measuredSize := len(b) - before; siz != measuredSize { - return nil, errors.MismatchedSizeCalculation(siz, measuredSize) - } } return b, nil } @@ -537,34 +520,28 @@ func isInitMessageSliceInfo(p pointer, f *coderFieldInfo) error { return nil } -func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, opts marshalOptions) int { - mopts := opts.Options() +func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, _ marshalOptions) int { s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) - n += protowire.SizeBytes(mopts.Size(m)) + tagsize + n += protowire.SizeBytes(proto.Size(m)) + tagsize } return n } func appendMessageSlice(b []byte, p pointer, wiretag uint64, goType reflect.Type, opts marshalOptions) ([]byte, error) { - mopts := opts.Options() s := p.PointerSlice() var err error for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) b = protowire.AppendVarint(b, wiretag) - siz := mopts.Size(m) + siz := proto.Size(m) b = protowire.AppendVarint(b, uint64(siz)) - before := len(b) - b, err = mopts.MarshalAppend(b, m) + b, err = opts.Options().MarshalAppend(b, m) if err != nil { return b, err } - if measuredSize := len(b) - before; siz != measuredSize { - return nil, errors.MismatchedSizeCalculation(siz, measuredSize) - } } return b, nil } @@ -605,12 +582,11 @@ func isInitMessageSlice(p pointer, goType reflect.Type) error { // Slices of messages func sizeMessageSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { - mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() - n += protowire.SizeBytes(mopts.Size(m)) + tagsize + n += protowire.SizeBytes(proto.Size(m)) + tagsize } return n } @@ -621,17 +597,13 @@ func appendMessageSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() b = protowire.AppendVarint(b, wiretag) - siz := mopts.Size(m) + siz := proto.Size(m) b = protowire.AppendVarint(b, uint64(siz)) - before := len(b) var err error b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } - if measuredSize := len(b) - before; siz != measuredSize { - return nil, errors.MismatchedSizeCalculation(siz, measuredSize) - } } return b, nil } @@ -679,12 +651,11 @@ var coderMessageSliceValue = valueCoderFuncs{ } func sizeGroupSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { - mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() - n += 2*tagsize + mopts.Size(m) + n += 2*tagsize + proto.Size(m) } return n } @@ -767,13 +738,12 @@ func makeGroupSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) } } -func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, opts marshalOptions) int { - mopts := opts.Options() +func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, _ marshalOptions) int { s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(messageType.Elem())) - n += 2*tagsize + mopts.Size(m) + n += 2*tagsize + proto.Size(m) } return n } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index fb35f0bae9c..111b9d16f99 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -9,7 +9,6 @@ import ( "sort" "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" ) @@ -241,16 +240,11 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder size += mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) size += mapi.valFuncs.size(val, mapValTagSize, opts) b = protowire.AppendVarint(b, uint64(size)) - before := len(b) b, err := mapi.keyFuncs.marshal(b, key.Value(), mapi.keyWiretag, opts) if err != nil { return nil, err } - b, err = mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts) - if measuredSize := len(b) - before; size != measuredSize && err == nil { - return nil, errors.MismatchedSizeCalculation(size, measuredSize) - } - return b, err + return mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts) } else { key := mapi.conv.keyConv.PBValueOf(keyrv).MapKey() val := pointerOfValue(valrv) @@ -265,12 +259,7 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder } b = protowire.AppendVarint(b, mapi.valWiretag) b = protowire.AppendVarint(b, uint64(valSize)) - before := len(b) - b, err = f.mi.marshalAppendPointer(b, val, opts) - if measuredSize := len(b) - before; valSize != measuredSize && err == nil { - return nil, errors.MismatchedSizeCalculation(valSize, measuredSize) - } - return b, err + return f.mi.marshalAppendPointer(b, val, opts) } } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go index 7a16ec13dd1..b7a23faf1e4 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go @@ -26,15 +26,6 @@ func sizeMessageSet(mi *MessageInfo, p pointer, opts marshalOptions) (size int) } num, _ := protowire.DecodeTag(xi.wiretag) size += messageset.SizeField(num) - if fullyLazyExtensions(opts) { - // Don't expand the extension, instead use the buffer to calculate size - if lb := x.lazyBuffer(); lb != nil { - // We got hold of the buffer, so it's still lazy. - // Don't count the tag size in the extension buffer, it's already added. - size += protowire.SizeTag(messageset.FieldMessage) + len(lb) - xi.tagsize - continue - } - } size += xi.funcs.size(x.Value(), protowire.SizeTag(messageset.FieldMessage), opts) } @@ -94,19 +85,6 @@ func marshalMessageSetField(mi *MessageInfo, b []byte, x ExtensionField, opts ma xi := getExtensionFieldInfo(x.Type()) num, _ := protowire.DecodeTag(xi.wiretag) b = messageset.AppendFieldStart(b, num) - - if fullyLazyExtensions(opts) { - // Don't expand the extension if it's still in wire format, instead use the buffer content. - if lb := x.lazyBuffer(); lb != nil { - // The tag inside the lazy buffer is a different tag (the extension - // number), but what we need here is the tag for FieldMessage: - b = protowire.AppendVarint(b, protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType)) - b = append(b, lb[xi.tagsize:]...) - b = messageset.AppendFieldEnd(b) - return b, nil - } - } - b, err := xi.funcs.marshal(b, x.Value(), protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType), opts) if err != nil { return b, err diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert.go index e06ece55a26..185ef2efa5b 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert.go @@ -14,7 +14,7 @@ import ( // unwrapper unwraps the value to the underlying value. // This is implemented by List and Map. type unwrapper interface { - protoUnwrap() any + protoUnwrap() interface{} } // A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types. diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_list.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_list.go index 18cb96fd70a..f89136516f9 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_list.go @@ -136,6 +136,6 @@ func (ls *listReflect) NewElement() protoreflect.Value { func (ls *listReflect) IsValid() bool { return !ls.v.IsNil() } -func (ls *listReflect) protoUnwrap() any { +func (ls *listReflect) protoUnwrap() interface{} { return ls.v.Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_map.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_map.go index 304244a651d..f30b0a0576d 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/convert_map.go @@ -116,6 +116,6 @@ func (ms *mapReflect) NewValue() protoreflect.Value { func (ms *mapReflect) IsValid() bool { return !ms.v.IsNil() } -func (ms *mapReflect) protoUnwrap() any { +func (ms *mapReflect) protoUnwrap() interface{} { return ms.v.Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/encode.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/encode.go index febd2122472..845c67d6e7e 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/encode.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/encode.go @@ -49,11 +49,8 @@ func (mi *MessageInfo) sizePointer(p pointer, opts marshalOptions) (size int) { return 0 } if opts.UseCachedSize() && mi.sizecacheOffset.IsValid() { - // The size cache contains the size + 1, to allow the - // zero value to be invalid, while also allowing for a - // 0 size to be cached. - if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size > 0 { - return int(size - 1) + if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size >= 0 { + return int(size) } } return mi.sizePointerSlow(p, opts) @@ -63,7 +60,7 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int if flags.ProtoLegacy && mi.isMessageSet { size = sizeMessageSet(mi, p, opts) if mi.sizecacheOffset.IsValid() { - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) } return size } @@ -87,16 +84,13 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int } } if mi.sizecacheOffset.IsValid() { - if size > (math.MaxInt32 - 1) { + if size > math.MaxInt32 { // The size is too large for the int32 sizecache field. // We will need to recompute the size when encoding; // unfortunately expensive, but better than invalid output. - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), 0) + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), -1) } else { - // The size cache contains the size + 1, to allow the - // zero value to be invalid, while also allowing for a - // 0 size to be cached. - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) } } return size @@ -155,14 +149,6 @@ func (mi *MessageInfo) marshalAppendPointer(b []byte, p pointer, opts marshalOpt return b, nil } -// fullyLazyExtensions returns true if we should attempt to keep extensions lazy over size and marshal. -func fullyLazyExtensions(opts marshalOptions) bool { - // When deterministic marshaling is requested, force an unmarshal for lazy - // extensions to produce a deterministic result, instead of passing through - // bytes lazily that may or may not match what Go Protobuf would produce. - return opts.flags&piface.MarshalDeterministic == 0 -} - func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marshalOptions) (n int) { if ext == nil { return 0 @@ -172,14 +158,6 @@ func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marsha if xi.funcs.size == nil { continue } - if fullyLazyExtensions(opts) { - // Don't expand the extension, instead use the buffer to calculate size - if lb := x.lazyBuffer(); lb != nil { - // We got hold of the buffer, so it's still lazy. - n += len(lb) - continue - } - } n += xi.funcs.size(x.Value(), xi.tagsize, opts) } return n @@ -198,13 +176,6 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField, var err error for _, x := range *ext { xi := getExtensionFieldInfo(x.Type()) - if fullyLazyExtensions(opts) { - // Don't expand the extension if it's still in wire format, instead use the buffer content. - if lb := x.lazyBuffer(); lb != nil { - b = append(b, lb...) - continue - } - } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) } return b, err @@ -220,13 +191,6 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField, for _, k := range keys { x := (*ext)[int32(k)] xi := getExtensionFieldInfo(x.Type()) - if fullyLazyExtensions(opts) { - // Don't expand the extension if it's still in wire format, instead use the buffer content. - if lb := x.lazyBuffer(); lb != nil { - b = append(b, lb...) - continue - } - } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) if err != nil { return b, err diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/extension.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/extension.go index e31249f64f7..cb25b0bae1d 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/extension.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/extension.go @@ -53,7 +53,7 @@ type ExtensionInfo struct { // type returned by InterfaceOf may not be identical. // // Deprecated: Use InterfaceOf(xt.Zero()) instead. - ExtensionType any + ExtensionType interface{} // Field is the field number of the extension. // @@ -95,16 +95,16 @@ func (xi *ExtensionInfo) New() protoreflect.Value { func (xi *ExtensionInfo) Zero() protoreflect.Value { return xi.lazyInit().Zero() } -func (xi *ExtensionInfo) ValueOf(v any) protoreflect.Value { +func (xi *ExtensionInfo) ValueOf(v interface{}) protoreflect.Value { return xi.lazyInit().PBValueOf(reflect.ValueOf(v)) } -func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) any { +func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) interface{} { return xi.lazyInit().GoValueOf(v).Interface() } func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool { return xi.lazyInit().IsValidPB(v) } -func (xi *ExtensionInfo) IsValidInterface(v any) bool { +func (xi *ExtensionInfo) IsValidInterface(v interface{}) bool { return xi.lazyInit().IsValidGo(reflect.ValueOf(v)) } func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor { diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go index 81b2b1a763d..c2a803bb2f9 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go @@ -97,7 +97,7 @@ func (e *legacyEnumWrapper) Number() protoreflect.EnumNumber { func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum { return e } -func (e *legacyEnumWrapper) protoUnwrap() any { +func (e *legacyEnumWrapper) protoUnwrap() interface{} { v := reflect.New(e.goTyp).Elem() v.SetInt(int64(e.num)) return v.Interface() @@ -167,7 +167,6 @@ func aberrantLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor { ed := &filedesc.Enum{L2: new(filedesc.EnumL2)} ed.L0.FullName = AberrantDeriveFullName(t) // e.g., github_com.user.repo.MyEnum ed.L0.ParentFile = filedesc.SurrogateProto3 - ed.L1.EditionFeatures = ed.L0.ParentFile.L1.EditionFeatures ed.L2.Values.List = append(ed.L2.Values.List, filedesc.EnumValue{}) // TODO: Use the presence of a UnmarshalJSON method to determine proto2? diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go index 6e8677ee633..87b30d0504c 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go @@ -118,7 +118,7 @@ func (xi *ExtensionInfo) initFromLegacy() { xd.L1.Number = protoreflect.FieldNumber(xi.Field) xd.L1.Cardinality = fd.L1.Cardinality xd.L1.Kind = fd.L1.Kind - xd.L1.EditionFeatures = fd.L1.EditionFeatures + xd.L2.IsPacked = fd.L1.IsPacked xd.L2.Default = fd.L1.Default xd.L1.Extendee = Export{}.MessageDescriptorOf(xi.ExtendedType) xd.L2.Enum = ed diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go index b649f1124b8..9ab091086c9 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go @@ -7,7 +7,7 @@ package impl import ( "bytes" "compress/gzip" - "io" + "io/ioutil" "sync" "google.golang.org/protobuf/internal/filedesc" @@ -51,7 +51,7 @@ func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { if err != nil { panic(err) } - b2, err := io.ReadAll(zr) + b2, err := ioutil.ReadAll(zr) if err != nil { panic(err) } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go index bf0b6049b46..2ab2c629784 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go @@ -204,7 +204,6 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName } } - md.L1.EditionFeatures = md.L0.ParentFile.L1.EditionFeatures // Obtain a list of oneof wrapper types. var oneofWrappers []reflect.Type methods := make([]reflect.Method, 0, 2) @@ -216,7 +215,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]any); ok { + if vs, ok := v.Interface().([]interface{}); ok { for _, v := range vs { oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) } @@ -251,7 +250,6 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName od := &md.L2.Oneofs.List[n] od.L0.FullName = md.FullName().Append(protoreflect.Name(tag)) od.L0.ParentFile = md.L0.ParentFile - od.L1.EditionFeatures = md.L1.EditionFeatures od.L0.Parent = md od.L0.Index = n @@ -262,7 +260,6 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName aberrantAppendField(md, f.Type, tag, "", "") fd := &md.L2.Fields.List[len(md.L2.Fields.List)-1] fd.L1.ContainingOneof = od - fd.L1.EditionFeatures = od.L1.EditionFeatures od.L1.Fields.List = append(od.L1.Fields.List, fd) } } @@ -310,14 +307,14 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey, fd.L0.Parent = md fd.L0.Index = n - if fd.L1.IsWeak || fd.L1.EditionFeatures.IsPacked { + if fd.L1.IsWeak || fd.L1.HasPacked { fd.L1.Options = func() protoreflect.ProtoMessage { opts := descopts.Field.ProtoReflect().New() if fd.L1.IsWeak { opts.Set(opts.Descriptor().Fields().ByName("weak"), protoreflect.ValueOfBool(true)) } - if fd.L1.EditionFeatures.IsPacked { - opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.EditionFeatures.IsPacked)) + if fd.L1.HasPacked { + opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.IsPacked)) } return opts.Interface() } @@ -347,7 +344,6 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey, md2.L0.ParentFile = md.L0.ParentFile md2.L0.Parent = md md2.L0.Index = n - md2.L1.EditionFeatures = md.L1.EditionFeatures md2.L1.IsMapEntry = true md2.L2.Options = func() protoreflect.ProtoMessage { @@ -567,6 +563,6 @@ func (m aberrantMessage) IsValid() bool { func (m aberrantMessage) ProtoMethods() *protoiface.Methods { return aberrantProtoMethods } -func (m aberrantMessage) protoUnwrap() any { +func (m aberrantMessage) protoUnwrap() interface{} { return m.v.Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/message.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/message.go index 019399d454d..629bacdcedd 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -35,7 +35,7 @@ type MessageInfo struct { Exporter exporter // OneofWrappers is list of pointers to oneof wrapper struct types. - OneofWrappers []any + OneofWrappers []interface{} initMu sync.Mutex // protects all unexported fields initDone uint32 @@ -47,7 +47,7 @@ type MessageInfo struct { // exporter is a function that returns a reference to the ith field of v, // where v is a pointer to a struct. It returns nil if it does not support // exporting the requested field (e.g., already exported). -type exporter func(v any, i int) any +type exporter func(v interface{}, i int) interface{} // getMessageInfo returns the MessageInfo for any message type that // is generated by our implementation of protoc-gen-go (for v2 and on). @@ -201,7 +201,7 @@ fieldLoop: } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]any); ok { + if vs, ok := v.Interface().([]interface{}); ok { oneofWrappers = vs } } @@ -256,7 +256,7 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType { type mapEntryType struct { desc protoreflect.MessageDescriptor - valType any // zero value of enum or message type + valType interface{} // zero value of enum or message type } func (mt mapEntryType) New() protoreflect.Message { diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go index ecb4623d701..d9ea010bef9 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go @@ -20,7 +20,7 @@ type reflectMessageInfo struct { // fieldTypes contains the zero value of an enum or message field. // For lists, it contains the element type. // For maps, it contains the entry value type. - fieldTypes map[protoreflect.FieldNumber]any + fieldTypes map[protoreflect.FieldNumber]interface{} // denseFields is a subset of fields where: // 0 < fieldDesc.Number() < len(denseFields) @@ -28,7 +28,7 @@ type reflectMessageInfo struct { denseFields []*fieldInfo // rangeInfos is a list of all fields (not belonging to a oneof) and oneofs. - rangeInfos []any // either *fieldInfo or *oneofInfo + rangeInfos []interface{} // either *fieldInfo or *oneofInfo getUnknown func(pointer) protoreflect.RawFields setUnknown func(pointer, protoreflect.RawFields) @@ -224,7 +224,7 @@ func (mi *MessageInfo) makeFieldTypes(si structInfo) { } if ft != nil { if mi.fieldTypes == nil { - mi.fieldTypes = make(map[protoreflect.FieldNumber]any) + mi.fieldTypes = make(map[protoreflect.FieldNumber]interface{}) } mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface() } @@ -247,39 +247,39 @@ func (m *extensionMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.V } } } -func (m *extensionMap) Has(xd protoreflect.ExtensionTypeDescriptor) (ok bool) { +func (m *extensionMap) Has(xt protoreflect.ExtensionType) (ok bool) { if m == nil { return false } + xd := xt.TypeDescriptor() x, ok := (*m)[int32(xd.Number())] if !ok { return false } - if x.isUnexpandedLazy() { - // Avoid calling x.Value(), which triggers a lazy unmarshal. - return true - } switch { case xd.IsList(): return x.Value().List().Len() > 0 case xd.IsMap(): return x.Value().Map().Len() > 0 + case xd.Message() != nil: + return x.Value().Message().IsValid() } return true } -func (m *extensionMap) Clear(xd protoreflect.ExtensionTypeDescriptor) { - delete(*m, int32(xd.Number())) +func (m *extensionMap) Clear(xt protoreflect.ExtensionType) { + delete(*m, int32(xt.TypeDescriptor().Number())) } -func (m *extensionMap) Get(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { +func (m *extensionMap) Get(xt protoreflect.ExtensionType) protoreflect.Value { + xd := xt.TypeDescriptor() if m != nil { if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } } - return xd.Type().Zero() + return xt.Zero() } -func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protoreflect.Value) { - xt := xd.Type() +func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) { + xd := xt.TypeDescriptor() isValid := true switch { case !xt.IsValidValue(v): @@ -292,7 +292,7 @@ func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protorefle isValid = v.Message().IsValid() } if !isValid { - panic(fmt.Sprintf("%v: assigning invalid value", xd.FullName())) + panic(fmt.Sprintf("%v: assigning invalid value", xt.TypeDescriptor().FullName())) } if *m == nil { @@ -302,15 +302,16 @@ func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protorefle x.Set(xt, v) (*m)[int32(xd.Number())] = x } -func (m *extensionMap) Mutable(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { +func (m *extensionMap) Mutable(xt protoreflect.ExtensionType) protoreflect.Value { + xd := xt.TypeDescriptor() if xd.Kind() != protoreflect.MessageKind && xd.Kind() != protoreflect.GroupKind && !xd.IsList() && !xd.IsMap() { panic("invalid Mutable on field with non-composite type") } if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } - v := xd.Type().New() - m.Set(xd, v) + v := xt.New() + m.Set(xt, v) return v } @@ -393,7 +394,7 @@ var ( // MessageOf returns a reflective view over a message. The input must be a // pointer to a named Go struct. If the provided type has a ProtoReflect method, // it must be implemented by calling this method. -func (mi *MessageInfo) MessageOf(m any) protoreflect.Message { +func (mi *MessageInfo) MessageOf(m interface{}) protoreflect.Message { if reflect.TypeOf(m) != mi.GoReflectType { panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType)) } @@ -421,13 +422,13 @@ func (m *messageIfaceWrapper) Reset() { func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message { return (*messageReflectWrapper)(m) } -func (m *messageIfaceWrapper) protoUnwrap() any { +func (m *messageIfaceWrapper) protoUnwrap() interface{} { return m.p.AsIfaceOf(m.mi.GoReflectType.Elem()) } // checkField verifies that the provided field descriptor is valid. // Exactly one of the returned values is populated. -func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionTypeDescriptor) { +func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionType) { var fi *fieldInfo if n := fd.Number(); 0 < n && int(n) < len(mi.denseFields) { fi = mi.denseFields[n] @@ -456,7 +457,7 @@ func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, if !ok { panic(fmt.Sprintf("extension %v does not implement protoreflect.ExtensionTypeDescriptor", fd.FullName())) } - return nil, xtd + return nil, xtd.Type() } panic(fmt.Sprintf("field %v is invalid", fd.FullName())) } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go index 99dc23c6f0a..741d6e5b6bd 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go @@ -23,13 +23,12 @@ func (m *messageState) New() protoreflect.Message { func (m *messageState) Interface() protoreflect.ProtoMessage { return m.protoUnwrap().(protoreflect.ProtoMessage) } -func (m *messageState) protoUnwrap() any { +func (m *messageState) protoUnwrap() interface{} { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageState) ProtoMethods() *protoiface.Methods { - mi := m.messageInfo() - mi.init() - return &mi.methods + m.messageInfo().init() + return &m.messageInfo().methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code @@ -42,9 +41,8 @@ func (m *messageState) ProtoMessageInfo() *MessageInfo { } func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - mi := m.messageInfo() - mi.init() - for _, ri := range mi.rangeInfos { + m.messageInfo().init() + for _, ri := range m.messageInfo().rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { @@ -54,86 +52,77 @@ func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.V } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { - fi := mi.fields[n] + fi := m.messageInfo().fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } - mi.extensionMap(m.pointer()).Range(f) + m.messageInfo().extensionMap(m.pointer()).Range(f) } func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.has(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Has(xd) + return m.messageInfo().extensionMap(m.pointer()).Has(xt) } } func (m *messageState) Clear(fd protoreflect.FieldDescriptor) { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { fi.clear(m.pointer()) } else { - mi.extensionMap(m.pointer()).Clear(xd) + m.messageInfo().extensionMap(m.pointer()).Clear(xt) } } func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.get(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Get(xd) + return m.messageInfo().extensionMap(m.pointer()).Get(xt) } } func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { - mi.extensionMap(m.pointer()).Set(xd, v) + m.messageInfo().extensionMap(m.pointer()).Set(xt, v) } } func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Mutable(xd) + return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) } } func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.newField() } else { - return xd.Type().New() + return xt.New() } } func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - mi := m.messageInfo() - mi.init() - if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { + m.messageInfo().init() + if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageState) GetUnknown() protoreflect.RawFields { - mi := m.messageInfo() - mi.init() - return mi.getUnknown(m.pointer()) + m.messageInfo().init() + return m.messageInfo().getUnknown(m.pointer()) } func (m *messageState) SetUnknown(b protoreflect.RawFields) { - mi := m.messageInfo() - mi.init() - mi.setUnknown(m.pointer(), b) + m.messageInfo().init() + m.messageInfo().setUnknown(m.pointer(), b) } func (m *messageState) IsValid() bool { return !m.pointer().IsNil() @@ -154,13 +143,12 @@ func (m *messageReflectWrapper) Interface() protoreflect.ProtoMessage { } return (*messageIfaceWrapper)(m) } -func (m *messageReflectWrapper) protoUnwrap() any { +func (m *messageReflectWrapper) protoUnwrap() interface{} { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods { - mi := m.messageInfo() - mi.init() - return &mi.methods + m.messageInfo().init() + return &m.messageInfo().methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code @@ -173,9 +161,8 @@ func (m *messageReflectWrapper) ProtoMessageInfo() *MessageInfo { } func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - mi := m.messageInfo() - mi.init() - for _, ri := range mi.rangeInfos { + m.messageInfo().init() + for _, ri := range m.messageInfo().rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { @@ -185,86 +172,77 @@ func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, proto } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { - fi := mi.fields[n] + fi := m.messageInfo().fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } - mi.extensionMap(m.pointer()).Range(f) + m.messageInfo().extensionMap(m.pointer()).Range(f) } func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.has(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Has(xd) + return m.messageInfo().extensionMap(m.pointer()).Has(xt) } } func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { fi.clear(m.pointer()) } else { - mi.extensionMap(m.pointer()).Clear(xd) + m.messageInfo().extensionMap(m.pointer()).Clear(xt) } } func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.get(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Get(xd) + return m.messageInfo().extensionMap(m.pointer()).Get(xt) } } func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { - mi.extensionMap(m.pointer()).Set(xd, v) + m.messageInfo().extensionMap(m.pointer()).Set(xt, v) } } func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { - return mi.extensionMap(m.pointer()).Mutable(xd) + return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) } } func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - mi := m.messageInfo() - mi.init() - if fi, xd := mi.checkField(fd); fi != nil { + m.messageInfo().init() + if fi, xt := m.messageInfo().checkField(fd); fi != nil { return fi.newField() } else { - return xd.Type().New() + return xt.New() } } func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - mi := m.messageInfo() - mi.init() - if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { + m.messageInfo().init() + if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageReflectWrapper) GetUnknown() protoreflect.RawFields { - mi := m.messageInfo() - mi.init() - return mi.getUnknown(m.pointer()) + m.messageInfo().init() + return m.messageInfo().getUnknown(m.pointer()) } func (m *messageReflectWrapper) SetUnknown(b protoreflect.RawFields) { - mi := m.messageInfo() - mi.init() - mi.setUnknown(m.pointer(), b) + m.messageInfo().init() + m.messageInfo().setUnknown(m.pointer(), b) } func (m *messageReflectWrapper) IsValid() bool { return !m.pointer().IsNil() diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go index da685e8a29d..517e94434c7 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go @@ -16,7 +16,7 @@ import ( const UnsafeEnabled = false // Pointer is an opaque pointer type. -type Pointer any +type Pointer interface{} // offset represents the offset to a struct field, accessible from a pointer. // The offset is the field index into a struct. @@ -62,7 +62,7 @@ func pointerOfValue(v reflect.Value) pointer { } // pointerOfIface returns the pointer portion of an interface. -func pointerOfIface(v any) pointer { +func pointerOfIface(v interface{}) pointer { return pointer{v: reflect.ValueOf(v)} } @@ -93,7 +93,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value { // AsIfaceOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to p.AsValueOf(t).Interface() -func (p pointer) AsIfaceOf(t reflect.Type) any { +func (p pointer) AsIfaceOf(t reflect.Type) interface{} { return p.AsValueOf(t).Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index 5f20ca5d8ab..4b020e31164 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -50,7 +50,7 @@ func pointerOfValue(v reflect.Value) pointer { } // pointerOfIface returns the pointer portion of an interface. -func pointerOfIface(v any) pointer { +func pointerOfIface(v interface{}) pointer { type ifaceHeader struct { Type unsafe.Pointer Data unsafe.Pointer @@ -80,7 +80,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value { // AsIfaceOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to p.AsValueOf(t).Interface() -func (p pointer) AsIfaceOf(t reflect.Type) any { +func (p pointer) AsIfaceOf(t reflect.Type) interface{} { // TODO: Use tricky unsafe magic to directly create ifaceHeader. return p.AsValueOf(t).Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/internal/order/range.go b/upstream/vendor/google.golang.org/protobuf/internal/order/range.go index a1f09162d05..1665a68e5b7 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/order/range.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/order/range.go @@ -18,7 +18,7 @@ type messageField struct { } var messageFieldPool = sync.Pool{ - New: func() any { return new([]messageField) }, + New: func() interface{} { return new([]messageField) }, } type ( @@ -69,7 +69,7 @@ type mapEntry struct { } var mapEntryPool = sync.Pool{ - New: func() any { return new([]mapEntry) }, + New: func() interface{} { return new([]mapEntry) }, } type ( diff --git a/upstream/vendor/google.golang.org/protobuf/internal/version/version.go b/upstream/vendor/google.golang.org/protobuf/internal/version/version.go index dbbf1f6862c..a50fcfb49b7 100644 --- a/upstream/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/upstream/vendor/google.golang.org/protobuf/internal/version/version.go @@ -51,8 +51,8 @@ import ( // 10. Send out the CL for review and submit it. const ( Major = 1 - Minor = 34 - Patch = 2 + Minor = 33 + Patch = 0 PreRelease = "" ) diff --git a/upstream/vendor/google.golang.org/protobuf/proto/decode.go b/upstream/vendor/google.golang.org/protobuf/proto/decode.go index d75a6534c1b..e5b03b56771 100644 --- a/upstream/vendor/google.golang.org/protobuf/proto/decode.go +++ b/upstream/vendor/google.golang.org/protobuf/proto/decode.go @@ -51,8 +51,6 @@ type UnmarshalOptions struct { // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). -// -// See the [UnmarshalOptions] type if you need more control. func Unmarshal(b []byte, m Message) error { _, err := UnmarshalOptions{RecursionLimit: protowire.DefaultRecursionLimit}.unmarshal(b, m.ProtoReflect()) return err diff --git a/upstream/vendor/google.golang.org/protobuf/proto/encode.go b/upstream/vendor/google.golang.org/protobuf/proto/encode.go index 1f847bcc358..4fed202f9fc 100644 --- a/upstream/vendor/google.golang.org/protobuf/proto/encode.go +++ b/upstream/vendor/google.golang.org/protobuf/proto/encode.go @@ -5,17 +5,12 @@ package proto import ( - "errors" - "fmt" - "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" - - protoerrors "google.golang.org/protobuf/internal/errors" ) // MarshalOptions configures the marshaler. @@ -75,32 +70,7 @@ type MarshalOptions struct { UseCachedSize bool } -// flags turns the specified MarshalOptions (user-facing) into -// protoiface.MarshalInputFlags (used internally by the marshaler). -// -// See impl.marshalOptions.Options for the inverse operation. -func (o MarshalOptions) flags() protoiface.MarshalInputFlags { - var flags protoiface.MarshalInputFlags - - // Note: o.AllowPartial is always forced to true by MarshalOptions.marshal, - // which is why it is not a part of MarshalInputFlags. - - if o.Deterministic { - flags |= protoiface.MarshalDeterministic - } - - if o.UseCachedSize { - flags |= protoiface.MarshalUseCachedSize - } - - return flags -} - // Marshal returns the wire-format encoding of m. -// -// This is the most common entry point for encoding a Protobuf message. -// -// See the [MarshalOptions] type if you need more control. func Marshal(m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to output. if m == nil { @@ -146,9 +116,6 @@ func emptyBytesForMessage(m Message) []byte { // MarshalAppend appends the wire-format encoding of m to b, // returning the result. -// -// This is a less common entry point than [Marshal], which is only needed if you -// need to supply your own buffers for performance reasons. func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to append. if m == nil { @@ -178,7 +145,12 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac in := protoiface.MarshalInput{ Message: m, Buf: b, - Flags: o.flags(), + } + if o.Deterministic { + in.Flags |= protoiface.MarshalDeterministic + } + if o.UseCachedSize { + in.Flags |= protoiface.MarshalUseCachedSize } if methods.Size != nil { sout := methods.Size(protoiface.SizeInput{ @@ -196,10 +168,6 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac out.Buf, err = o.marshalMessageSlow(b, m) } if err != nil { - var mismatch *protoerrors.SizeMismatchError - if errors.As(err, &mismatch) { - return out, fmt.Errorf("marshaling %s: %v", string(m.Descriptor().FullName()), err) - } return out, err } if allowPartial { diff --git a/upstream/vendor/google.golang.org/protobuf/proto/extension.go b/upstream/vendor/google.golang.org/protobuf/proto/extension.go index d248f292846..17899a3a767 100644 --- a/upstream/vendor/google.golang.org/protobuf/proto/extension.go +++ b/upstream/vendor/google.golang.org/protobuf/proto/extension.go @@ -11,21 +11,18 @@ import ( // HasExtension reports whether an extension field is populated. // It returns false if m is invalid or if xt does not extend m. func HasExtension(m Message, xt protoreflect.ExtensionType) bool { - // Treat nil message interface or descriptor as an empty message; no populated - // fields. - if m == nil || xt == nil { + // Treat nil message interface as an empty message; no populated fields. + if m == nil { return false } // As a special-case, we reports invalid or mismatching descriptors // as always not being populated (since they aren't). - mr := m.ProtoReflect() - xd := xt.TypeDescriptor() - if mr.Descriptor() != xd.ContainingMessage() { + if xt == nil || m.ProtoReflect().Descriptor() != xt.TypeDescriptor().ContainingMessage() { return false } - return mr.Has(xd) + return m.ProtoReflect().Has(xt.TypeDescriptor()) } // ClearExtension clears an extension field such that subsequent @@ -39,7 +36,7 @@ func ClearExtension(m Message, xt protoreflect.ExtensionType) { // If the field is unpopulated, it returns the default value for // scalars and an immutable, empty value for lists or messages. // It panics if xt does not extend m. -func GetExtension(m Message, xt protoreflect.ExtensionType) any { +func GetExtension(m Message, xt protoreflect.ExtensionType) interface{} { // Treat nil message interface as an empty message; return the default. if m == nil { return xt.InterfaceOf(xt.Zero()) @@ -51,7 +48,7 @@ func GetExtension(m Message, xt protoreflect.ExtensionType) any { // SetExtension stores the value of an extension field. // It panics if m is invalid, xt does not extend m, or if type of v // is invalid for the specified extension field. -func SetExtension(m Message, xt protoreflect.ExtensionType, v any) { +func SetExtension(m Message, xt protoreflect.ExtensionType, v interface{}) { xd := xt.TypeDescriptor() pv := xt.ValueOf(v) @@ -78,7 +75,7 @@ func SetExtension(m Message, xt protoreflect.ExtensionType, v any) { // It returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current extension field. -func RangeExtensions(m Message, f func(protoreflect.ExtensionType, any) bool) { +func RangeExtensions(m Message, f func(protoreflect.ExtensionType, interface{}) bool) { // Treat nil message interface as an empty message; nothing to range over. if m == nil { return diff --git a/upstream/vendor/google.golang.org/protobuf/proto/messageset.go b/upstream/vendor/google.golang.org/protobuf/proto/messageset.go index 575d14831ff..312d5d45c60 100644 --- a/upstream/vendor/google.golang.org/protobuf/proto/messageset.go +++ b/upstream/vendor/google.golang.org/protobuf/proto/messageset.go @@ -47,16 +47,11 @@ func (o MarshalOptions) marshalMessageSet(b []byte, m protoreflect.Message) ([]b func (o MarshalOptions) marshalMessageSetField(b []byte, fd protoreflect.FieldDescriptor, value protoreflect.Value) ([]byte, error) { b = messageset.AppendFieldStart(b, fd.Number()) b = protowire.AppendTag(b, messageset.FieldMessage, protowire.BytesType) - calculatedSize := o.Size(value.Message().Interface()) - b = protowire.AppendVarint(b, uint64(calculatedSize)) - before := len(b) + b = protowire.AppendVarint(b, uint64(o.Size(value.Message().Interface()))) b, err := o.marshalMessage(b, value.Message()) if err != nil { return b, err } - if measuredSize := len(b) - before; calculatedSize != measuredSize { - return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) - } b = messageset.AppendFieldEnd(b) return b, nil } diff --git a/upstream/vendor/google.golang.org/protobuf/proto/size.go b/upstream/vendor/google.golang.org/protobuf/proto/size.go index 052fb5ae313..f1692b49b6c 100644 --- a/upstream/vendor/google.golang.org/protobuf/proto/size.go +++ b/upstream/vendor/google.golang.org/protobuf/proto/size.go @@ -34,7 +34,6 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) { if methods != nil && methods.Size != nil { out := methods.Size(protoiface.SizeInput{ Message: m, - Flags: o.flags(), }) return out.Size } @@ -43,7 +42,6 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) { // This case is mainly used for legacy types with a Marshal method. out, _ := methods.Marshal(protoiface.MarshalInput{ Message: m, - Flags: o.flags(), }) return len(out.Buf) } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go index 8fbecb4f58d..baa0cc6218f 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go @@ -13,7 +13,6 @@ package protodesc import ( - "google.golang.org/protobuf/internal/editionssupport" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/pragma" @@ -92,17 +91,15 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot switch fd.GetSyntax() { case "proto2", "": f.L1.Syntax = protoreflect.Proto2 - f.L1.Edition = filedesc.EditionProto2 case "proto3": f.L1.Syntax = protoreflect.Proto3 - f.L1.Edition = filedesc.EditionProto3 case "editions": f.L1.Syntax = protoreflect.Editions f.L1.Edition = fromEditionProto(fd.GetEdition()) default: return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) } - if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) { + if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < SupportedEditionsMinimum || fd.GetEdition() > SupportedEditionsMaximum) { return nil, errors.New("use of edition %v not yet supported by the Go Protobuf runtime", fd.GetEdition()) } f.L1.Path = fd.GetName() @@ -117,7 +114,9 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot opts = proto.Clone(opts).(*descriptorpb.FileOptions) f.L2.Options = func() protoreflect.ProtoMessage { return opts } } - initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) + if f.L1.Syntax == protoreflect.Editions { + initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) + } f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) for _, i := range fd.GetPublicDependency() { @@ -220,10 +219,10 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot if err := validateEnumDeclarations(f.L1.Enums.List, fd.GetEnumType()); err != nil { return nil, err } - if err := validateMessageDeclarations(f, f.L1.Messages.List, fd.GetMessageType()); err != nil { + if err := validateMessageDeclarations(f.L1.Messages.List, fd.GetMessageType()); err != nil { return nil, err } - if err := validateExtensionDeclarations(f, f.L1.Extensions.List, fd.GetExtension()); err != nil { + if err := validateExtensionDeclarations(f.L1.Extensions.List, fd.GetExtension()); err != nil { return nil, err } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go index 85617554272..b3278163c52 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go @@ -69,7 +69,9 @@ func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProt if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { return nil, err } - m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) + if m.Base.L0.ParentFile.Syntax() == protoreflect.Editions { + m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) + } if opts := md.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.MessageOptions) m.L2.Options = func() protoreflect.ProtoMessage { return opts } @@ -144,15 +146,13 @@ func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDesc if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil { return nil, err } - f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) f.L1.IsProto3Optional = fd.GetProto3Optional() if opts := fd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) f.L1.Options = func() protoreflect.ProtoMessage { return opts } f.L1.IsWeak = opts.GetWeak() - if opts.Packed != nil { - f.L1.EditionFeatures.IsPacked = opts.GetPacked() - } + f.L1.HasPacked = opts.Packed != nil + f.L1.IsPacked = opts.GetPacked() } f.L1.Number = protoreflect.FieldNumber(fd.GetNumber()) f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel()) @@ -163,12 +163,32 @@ func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDesc f.L1.StringName.InitJSON(fd.GetJsonName()) } - if f.L1.EditionFeatures.IsLegacyRequired { - f.L1.Cardinality = protoreflect.Required - } + if f.Base.L0.ParentFile.Syntax() == protoreflect.Editions { + f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) + + if f.L1.EditionFeatures.IsLegacyRequired { + f.L1.Cardinality = protoreflect.Required + } + // We reuse the existing field because the old option `[packed = + // true]` is mutually exclusive with the editions feature. + if canBePacked(fd) { + f.L1.HasPacked = true + f.L1.IsPacked = f.L1.EditionFeatures.IsPacked + } + + // We pretend this option is always explicitly set because the only + // use of HasEnforceUTF8 is to determine whether to use EnforceUTF8 + // or to return the appropriate default. + // When using editions we either parse the option or resolve the + // appropriate default here (instead of later when this option is + // requested from the descriptor). + // In proto2/proto3 syntax HasEnforceUTF8 might be false. + f.L1.HasEnforceUTF8 = true + f.L1.EnforceUTF8 = f.L1.EditionFeatures.IsUTF8Validated - if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { - f.L1.Kind = protoreflect.GroupKind + if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { + f.L1.Kind = protoreflect.GroupKind + } } } return fs, nil @@ -181,10 +201,12 @@ func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDesc if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil { return nil, err } - o.L1.EditionFeatures = mergeEditionFeatures(parent, od.GetOptions().GetFeatures()) if opts := od.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.OneofOptions) o.L1.Options = func() protoreflect.ProtoMessage { return opts } + if parent.Syntax() == protoreflect.Editions { + o.L1.EditionFeatures = mergeEditionFeatures(parent, opts.GetFeatures()) + } } } return os, nil @@ -198,13 +220,10 @@ func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescript if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil { return nil, err } - x.L1.EditionFeatures = mergeEditionFeatures(parent, xd.GetOptions().GetFeatures()) if opts := xd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) x.L2.Options = func() protoreflect.ProtoMessage { return opts } - if opts.Packed != nil { - x.L1.EditionFeatures.IsPacked = opts.GetPacked() - } + x.L2.IsPacked = opts.GetPacked() } x.L1.Number = protoreflect.FieldNumber(xd.GetNumber()) x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel()) diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go index f3cebab29c8..254ca585424 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go @@ -46,11 +46,6 @@ func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*desc if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName()), f.IsWeak()); err != nil { return errors.New("message field %q cannot resolve type: %v", f.FullName(), err) } - if f.L1.Kind == protoreflect.GroupKind && (f.IsMap() || f.IsMapEntry()) { - // A map field might inherit delimited encoding from a file-wide default feature. - // But maps never actually use delimited encoding. (At least for now...) - f.L1.Kind = protoreflect.MessageKind - } if fd.DefaultValue != nil { v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) if err != nil { diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go index 6de31c2ebdb..e4dcaf876c9 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go @@ -45,11 +45,11 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri if allowAlias && !foundAlias { return errors.New("enum %q allows aliases, but none were found", e.FullName()) } - if !e.IsClosed() { + if e.Syntax() == protoreflect.Proto3 { if v := e.Values().Get(0); v.Number() != 0 { - return errors.New("enum %q using open semantics must have zero number for the first value", v.FullName()) + return errors.New("enum %q using proto3 semantics must have zero number for the first value", v.FullName()) } - // Verify that value names in open enums do not conflict if the + // Verify that value names in proto3 do not conflict if the // case-insensitive prefix is removed. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:4991-5055 names := map[string]protoreflect.EnumValueDescriptor{} @@ -58,7 +58,7 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri v1 := e.Values().Get(i) s := strs.EnumValueName(strs.TrimEnumPrefix(string(v1.Name()), prefix)) if v2, ok := names[s]; ok && v1.Number() != v2.Number() { - return errors.New("enum %q using open semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) + return errors.New("enum %q using proto3 semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) } names[s] = v1 } @@ -80,9 +80,7 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri return nil } -func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { - // There are a few limited exceptions only for proto3 - isProto3 := file.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) +func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { for i, md := range mds { m := &ms[i] @@ -109,13 +107,25 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds if isMessageSet && !flags.ProtoLegacy { return errors.New("message %q is a MessageSet, which is a legacy proto1 feature that is no longer supported", m.FullName()) } - if isMessageSet && (isProto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { + if isMessageSet && (m.Syntax() == protoreflect.Proto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { return errors.New("message %q is an invalid proto1 MessageSet", m.FullName()) } - if isProto3 { + if m.Syntax() == protoreflect.Proto3 { if m.ExtensionRanges().Len() > 0 { return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName()) } + // Verify that field names in proto3 do not conflict if lowercased + // with all underscores removed. + // See protoc v3.8.0: src/google/protobuf/descriptor.cc:5830-5847 + names := map[string]protoreflect.FieldDescriptor{} + for i := 0; i < m.Fields().Len(); i++ { + f1 := m.Fields().Get(i) + s := strings.Replace(strings.ToLower(string(f1.Name())), "_", "", -1) + if f2, ok := names[s]; ok { + return errors.New("message %q using proto3 semantics has conflict: %q with %q", m.FullName(), f1.Name(), f2.Name()) + } + names[s] = f1 + } } for j, fd := range md.GetField() { @@ -139,7 +149,7 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee()) } if f.L1.IsProto3Optional { - if !isProto3 { + if f.Syntax() != protoreflect.Proto3 { return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName()) } if f.Cardinality() != protoreflect.Optional { @@ -152,29 +162,26 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds if f.IsWeak() && !flags.ProtoLegacy { return errors.New("message field %q is a weak field, which is a legacy proto1 feature that is no longer supported", f.FullName()) } - if f.IsWeak() && (!f.HasPresence() || !isOptionalMessage(f) || f.ContainingOneof() != nil) { + if f.IsWeak() && (f.Syntax() != protoreflect.Proto2 || !isOptionalMessage(f) || f.ContainingOneof() != nil) { return errors.New("message field %q may only be weak for an optional message", f.FullName()) } if f.IsPacked() && !isPackable(f) { return errors.New("message field %q is not packable", f.FullName()) } - if err := checkValidGroup(file, f); err != nil { + if err := checkValidGroup(f); err != nil { return errors.New("message field %q is an invalid group: %v", f.FullName(), err) } if err := checkValidMap(f); err != nil { return errors.New("message field %q is an invalid map: %v", f.FullName(), err) } - if isProto3 { + if f.Syntax() == protoreflect.Proto3 { if f.Cardinality() == protoreflect.Required { return errors.New("message field %q using proto3 semantics cannot be required", f.FullName()) } - if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { - return errors.New("message field %q using proto3 semantics may only depend on open enums", f.FullName()) + if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().Syntax() != protoreflect.Proto3 { + return errors.New("message field %q using proto3 semantics may only depend on a proto3 enum", f.FullName()) } } - if f.Cardinality() == protoreflect.Optional && !f.HasPresence() && f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { - return errors.New("message field %q with implicit presence may only use open enums", f.FullName()) - } } seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs for j := range md.GetOneofDecl() { @@ -208,17 +215,17 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil { return err } - if err := validateMessageDeclarations(file, m.L1.Messages.List, md.GetNestedType()); err != nil { + if err := validateMessageDeclarations(m.L1.Messages.List, md.GetNestedType()); err != nil { return err } - if err := validateExtensionDeclarations(file, m.L1.Extensions.List, md.GetExtension()); err != nil { + if err := validateExtensionDeclarations(m.L1.Extensions.List, md.GetExtension()); err != nil { return err } } return nil } -func validateExtensionDeclarations(f *filedesc.File, xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { +func validateExtensionDeclarations(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { for i, xd := range xds { x := &xs[i] // NOTE: Avoid using the IsValid method since extensions to MessageSet @@ -260,13 +267,13 @@ func validateExtensionDeclarations(f *filedesc.File, xs []filedesc.Extension, xd if x.IsPacked() && !isPackable(x) { return errors.New("extension field %q is not packable", x.FullName()) } - if err := checkValidGroup(f, x); err != nil { + if err := checkValidGroup(x); err != nil { return errors.New("extension field %q is an invalid group: %v", x.FullName(), err) } if md := x.Message(); md != nil && md.IsMapEntry() { return errors.New("extension field %q cannot be a map entry", x.FullName()) } - if f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) { + if x.Syntax() == protoreflect.Proto3 { switch x.ContainingMessage().FullName() { case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName(): @@ -302,25 +309,21 @@ func isPackable(fd protoreflect.FieldDescriptor) bool { // checkValidGroup reports whether fd is a valid group according to the same // rules that protoc imposes. -func checkValidGroup(f *filedesc.File, fd protoreflect.FieldDescriptor) error { +func checkValidGroup(fd protoreflect.FieldDescriptor) error { md := fd.Message() switch { case fd.Kind() != protoreflect.GroupKind: return nil - case f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3): + case fd.Syntax() == protoreflect.Proto3: return errors.New("invalid under proto3 semantics") case md == nil || md.IsPlaceholder(): return errors.New("message must be resolvable") - } - if f.L1.Edition < fromEditionProto(descriptorpb.Edition_EDITION_2023) { - switch { - case fd.FullName().Parent() != md.FullName().Parent(): - return errors.New("message and field must be declared in the same scope") - case !unicode.IsUpper(rune(md.Name()[0])): - return errors.New("message name must start with an uppercase") - case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): - return errors.New("field name must be lowercased form of the message name") - } + case fd.FullName().Parent() != md.FullName().Parent(): + return errors.New("message and field must be declared in the same scope") + case !unicode.IsUpper(rune(md.Name()[0])): + return errors.New("message name must start with an uppercase") + case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): + return errors.New("field name must be lowercased form of the message name") } return nil } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go index 804830eda36..2a6b29d1791 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go @@ -17,6 +17,11 @@ import ( gofeaturespb "google.golang.org/protobuf/types/gofeaturespb" ) +const ( + SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 + SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2023 +) + var defaults = &descriptorpb.FeatureSetDefaults{} var defaultsCacheMu sync.Mutex var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet) @@ -62,20 +67,18 @@ func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb) os.Exit(1) } - fsed := defaults.GetDefaults()[0] + fs := defaults.GetDefaults()[0].GetFeatures() // Using a linear search for now. // Editions are guaranteed to be sorted and thus we could use a binary search. // Given that there are only a handful of editions (with one more per year) // there is not much reason to use a binary search. for _, def := range defaults.GetDefaults() { if def.GetEdition() <= edpb { - fsed = def + fs = def.GetFeatures() } else { break } } - fs := proto.Clone(fsed.GetFixedFeatures()).(*descriptorpb.FeatureSet) - proto.Merge(fs, fsed.GetOverridableFeatures()) defaultsCache[ed] = fs return fs } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go index a5de8d40013..9d6e05420f7 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go @@ -73,16 +73,6 @@ func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileD if syntax := file.Syntax(); syntax != protoreflect.Proto2 && syntax.IsValid() { p.Syntax = proto.String(file.Syntax().String()) } - if file.Syntax() == protoreflect.Editions { - desc := file - if fileImportDesc, ok := file.(protoreflect.FileImport); ok { - desc = fileImportDesc.FileDescriptor - } - - if editionsInterface, ok := desc.(interface{ Edition() int32 }); ok { - p.Edition = descriptorpb.Edition(editionsInterface.Edition()).Enum() - } - } return p } @@ -163,18 +153,6 @@ func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.Fi if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() { p.Proto3Optional = proto.Bool(true) } - if field.Syntax() == protoreflect.Editions { - // Editions have no group keyword, this type is only set so that downstream users continue - // treating this as delimited encoding. - if p.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { - p.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() - } - // Editions have no required keyword, this label is only set so that downstream users continue - // treating it as required. - if p.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { - p.Label = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() - } - } if field.HasDefault() { def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor) if err != nil && field.DefaultEnumValue() != nil { diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go index c85bfaa5bb7..00b01fbd8c9 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go @@ -161,7 +161,7 @@ const ( // IsValid reports whether the syntax is valid. func (s Syntax) IsValid() bool { switch s { - case Proto2, Proto3, Editions: + case Proto2, Proto3: return true default: return false diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index ea154eec44d..7dcc2ff09e9 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -373,8 +373,6 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte { b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault) case 21: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) - case 22: - b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -485,8 +483,6 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte { b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "debug_redact", nil) - case 4: - b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -523,23 +519,6 @@ func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte { return b } -func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { - if len(*p) == 0 { - return b - } - switch (*p)[0] { - case 1: - b = p.appendSingularField(b, "edition_introduced", nil) - case 2: - b = p.appendSingularField(b, "edition_deprecated", nil) - case 3: - b = p.appendSingularField(b, "deprecation_warning", nil) - case 4: - b = p.appendSingularField(b, "edition_removed", nil) - } - return b -} - func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte { if len(*p) == 0 { return b diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go index cd8fadbaf8f..60ff62b4c85 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go @@ -510,7 +510,7 @@ type ExtensionType interface { // // ValueOf is more extensive than protoreflect.ValueOf for a given field's // value as it has more type information available. - ValueOf(any) Value + ValueOf(interface{}) Value // InterfaceOf completely unwraps the Value to the underlying Go type. // InterfaceOf panics if the input is nil or does not represent the @@ -519,13 +519,13 @@ type ExtensionType interface { // // InterfaceOf is able to unwrap the Value further than Value.Interface // as it has more type information available. - InterfaceOf(Value) any + InterfaceOf(Value) interface{} // IsValidValue reports whether the Value is valid to assign to the field. IsValidValue(Value) bool // IsValidInterface reports whether the input is valid to assign to the field. - IsValidInterface(any) bool + IsValidInterface(interface{}) bool } // EnumDescriptor describes an enum and @@ -544,12 +544,6 @@ type EnumDescriptor interface { // ReservedRanges is a list of reserved ranges of enum numbers. ReservedRanges() EnumRanges - // IsClosed reports whether this enum uses closed semantics. - // See https://protobuf.dev/programming-guides/enum/#definitions. - // Note: the Go protobuf implementation is not spec compliant and treats - // all enums as open enums. - IsClosed() bool - isEnumDescriptor } type isEnumDescriptor interface{ ProtoType(EnumDescriptor) } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go index 75f83a2af03..7ced876f4e8 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go @@ -32,11 +32,11 @@ const ( type value struct { pragma.DoNotCompare // 0B - typ valueType // 8B - num uint64 // 8B - str string // 16B - bin []byte // 24B - iface any // 16B + typ valueType // 8B + num uint64 // 8B + str string // 16B + bin []byte // 24B + iface interface{} // 16B } func valueOfString(v string) Value { @@ -45,7 +45,7 @@ func valueOfString(v string) Value { func valueOfBytes(v []byte) Value { return Value{typ: bytesType, bin: v} } -func valueOfIface(v any) Value { +func valueOfIface(v interface{}) Value { return Value{typ: ifaceType, iface: v} } @@ -55,6 +55,6 @@ func (v Value) getString() string { func (v Value) getBytes() []byte { return v.bin } -func (v Value) getIface() any { +func (v Value) getIface() interface{} { return v.iface } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go index 9fe83cef5a9..1603097311e 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go @@ -69,8 +69,8 @@ import ( // composite Value. Modifying an empty, read-only value panics. type Value value -// The protoreflect API uses a custom Value union type instead of any -// to keep the future open for performance optimizations. Using an any +// The protoreflect API uses a custom Value union type instead of interface{} +// to keep the future open for performance optimizations. Using an interface{} // always incurs an allocation for primitives (e.g., int64) since it needs to // be boxed on the heap (as interfaces can only contain pointers natively). // Instead, we represent the Value union as a flat struct that internally keeps @@ -85,7 +85,7 @@ type Value value // ValueOf returns a Value initialized with the concrete value stored in v. // This panics if the type does not match one of the allowed types in the // Value union. -func ValueOf(v any) Value { +func ValueOf(v interface{}) Value { switch v := v.(type) { case nil: return Value{} @@ -192,10 +192,10 @@ func (v Value) IsValid() bool { return v.typ != nilType } -// Interface returns v as an any. +// Interface returns v as an interface{}. // // Invariant: v == ValueOf(v).Interface() -func (v Value) Interface() any { +func (v Value) Interface() interface{} { switch v.typ { case nilType: return nil @@ -406,8 +406,8 @@ func (k MapKey) IsValid() bool { return Value(k).IsValid() } -// Interface returns k as an any. -func (k MapKey) Interface() any { +// Interface returns k as an interface{}. +func (k MapKey) Interface() interface{} { return Value(k).Interface() } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go index 7f3583ead81..b1fdbe3e8e1 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go @@ -45,7 +45,7 @@ var ( // typeOf returns a pointer to the Go type information. // The pointer is comparable and equal if and only if the types are identical. -func typeOf(t any) unsafe.Pointer { +func typeOf(t interface{}) unsafe.Pointer { return (*ifaceHeader)(unsafe.Pointer(&t)).Type } @@ -80,7 +80,7 @@ func valueOfBytes(v []byte) Value { p := (*sliceHeader)(unsafe.Pointer(&v)) return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))} } -func valueOfIface(v any) Value { +func valueOfIface(v interface{}) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} } @@ -93,7 +93,7 @@ func (v Value) getBytes() (x []byte) { *(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)} return x } -func (v Value) getIface() (x any) { +func (v Value) getIface() (x interface{}) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go index f7d386990a0..43547011173 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go @@ -15,7 +15,7 @@ import ( type ( ifaceHeader struct { - _ [0]any // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. + _ [0]interface{} // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. Type unsafe.Pointer Data unsafe.Pointer } @@ -37,7 +37,7 @@ var ( // typeOf returns a pointer to the Go type information. // The pointer is comparable and equal if and only if the types are identical. -func typeOf(t any) unsafe.Pointer { +func typeOf(t interface{}) unsafe.Pointer { return (*ifaceHeader)(unsafe.Pointer(&t)).Type } @@ -70,7 +70,7 @@ func valueOfString(v string) Value { func valueOfBytes(v []byte) Value { return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} } -func valueOfIface(v any) Value { +func valueOfIface(v interface{}) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} } @@ -81,7 +81,7 @@ func (v Value) getString() string { func (v Value) getBytes() []byte { return unsafe.Slice((*byte)(v.ptr), v.num) } -func (v Value) getIface() (x any) { +func (v Value) getIface() (x interface{}) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x } diff --git a/upstream/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go b/upstream/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go index de177733914..6267dc52a67 100644 --- a/upstream/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +++ b/upstream/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go @@ -95,7 +95,7 @@ type Files struct { // multiple files. Only top-level declarations are registered. // Note that enum values are in the top-level since that are in the same // scope as the parent enum. - descsByName map[protoreflect.FullName]any + descsByName map[protoreflect.FullName]interface{} filesByPath map[string][]protoreflect.FileDescriptor numFiles int } @@ -117,7 +117,7 @@ func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error { defer globalMutex.Unlock() } if r.descsByName == nil { - r.descsByName = map[protoreflect.FullName]any{ + r.descsByName = map[protoreflect.FullName]interface{}{ "": &packageDescriptor{}, } r.filesByPath = make(map[string][]protoreflect.FileDescriptor) @@ -485,7 +485,7 @@ type Types struct { } type ( - typesByName map[protoreflect.FullName]any + typesByName map[protoreflect.FullName]interface{} extensionsByMessage map[protoreflect.FullName]extensionsByNumber extensionsByNumber map[protoreflect.FieldNumber]protoreflect.ExtensionType ) @@ -570,7 +570,7 @@ func (r *Types) RegisterExtension(xt protoreflect.ExtensionType) error { return nil } -func (r *Types) register(kind string, desc protoreflect.Descriptor, typ any) error { +func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interface{}) error { name := desc.FullName() prev := r.typesByName[name] if prev != nil { @@ -841,7 +841,7 @@ func (r *Types) RangeExtensionsByMessage(message protoreflect.FullName, f func(p } } -func typeName(t any) string { +func typeName(t interface{}) string { switch t.(type) { case protoreflect.EnumType: return "enum" @@ -854,7 +854,7 @@ func typeName(t any) string { } } -func amendErrorWithCaller(err error, prev, curr any) error { +func amendErrorWithCaller(err error, prev, curr interface{}) error { prevPkg := goPackage(prev) currPkg := goPackage(curr) if prevPkg == "" || currPkg == "" || prevPkg == currPkg { @@ -863,7 +863,7 @@ func amendErrorWithCaller(err error, prev, curr any) error { return errors.New("%s\n\tpreviously from: %q\n\tcurrently from: %q", err, prevPkg, currPkg) } -func goPackage(v any) string { +func goPackage(v interface{}) string { switch d := v.(type) { case protoreflect.EnumType: v = d.Descriptor() diff --git a/upstream/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/upstream/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 9403eb07507..78624cf60b3 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -54,9 +54,6 @@ type Edition int32 const ( // A placeholder for an unknown edition value. Edition_EDITION_UNKNOWN Edition = 0 - // A placeholder edition for specifying default behaviors *before* a feature - // was first introduced. This is effectively an "infinite past". - Edition_EDITION_LEGACY Edition = 900 // Legacy syntax "editions". These pre-date editions, but behave much like // distinct editions. These can't be used to specify the edition of proto // files, but feature definitions must supply proto2/proto3 defaults for @@ -85,7 +82,6 @@ const ( var ( Edition_name = map[int32]string{ 0: "EDITION_UNKNOWN", - 900: "EDITION_LEGACY", 998: "EDITION_PROTO2", 999: "EDITION_PROTO3", 1000: "EDITION_2023", @@ -99,7 +95,6 @@ var ( } Edition_value = map[string]int32{ "EDITION_UNKNOWN": 0, - "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -2182,16 +2177,12 @@ type FileOptions struct { // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` - // A proto2 file can set this to true to opt in to UTF-8 checking for Java, - // which will throw an exception if invalid UTF-8 is parsed from the wire or - // assigned to a string field. - // - // TODO: clarify exactly what kinds of field types this option - // applies to, and update these docs accordingly. - // - // Proto3 files already perform these checks. Setting the option explicitly to - // false has no effect: it cannot be used to opt proto3 files out of UTF-8 - // checks. + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` // Sets the Go package where structs generated from this .proto will be @@ -2688,8 +2679,7 @@ type FieldOptions struct { Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"` // Any features defined in the specific edition. - Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` - FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,22,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` + Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2821,13 +2811,6 @@ func (x *FieldOptions) GetFeatures() *FeatureSet { return nil } -func (x *FieldOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { - if x != nil { - return x.FeatureSupport - } - return nil -} - func (x *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -3012,8 +2995,6 @@ type EnumValueOptions struct { // out when using debug formats, e.g. when the field contains sensitive // credentials. DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` - // Information about the support window of a feature value. - FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,4,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -3077,13 +3058,6 @@ func (x *EnumValueOptions) GetDebugRedact() bool { return Default_EnumValueOptions_DebugRedact } -func (x *EnumValueOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { - if x != nil { - return x.FeatureSupport - } - return nil -} - func (x *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -3994,88 +3968,6 @@ func (x *FieldOptions_EditionDefault) GetValue() string { return "" } -// Information about the support window of a feature. -type FieldOptions_FeatureSupport struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The edition that this feature was first available in. In editions - // earlier than this one, the default assigned to EDITION_LEGACY will be - // used, and proto files will not be able to override it. - EditionIntroduced *Edition `protobuf:"varint,1,opt,name=edition_introduced,json=editionIntroduced,enum=google.protobuf.Edition" json:"edition_introduced,omitempty"` - // The edition this feature becomes deprecated in. Using this after this - // edition may trigger warnings. - EditionDeprecated *Edition `protobuf:"varint,2,opt,name=edition_deprecated,json=editionDeprecated,enum=google.protobuf.Edition" json:"edition_deprecated,omitempty"` - // The deprecation warning text if this feature is used after the edition it - // was marked deprecated in. - DeprecationWarning *string `protobuf:"bytes,3,opt,name=deprecation_warning,json=deprecationWarning" json:"deprecation_warning,omitempty"` - // The edition this feature is no longer available in. In editions after - // this one, the last default assigned will be used, and proto files will - // not be able to override it. - EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` -} - -func (x *FieldOptions_FeatureSupport) Reset() { - *x = FieldOptions_FeatureSupport{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FieldOptions_FeatureSupport) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FieldOptions_FeatureSupport) ProtoMessage() {} - -func (x *FieldOptions_FeatureSupport) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FieldOptions_FeatureSupport.ProtoReflect.Descriptor instead. -func (*FieldOptions_FeatureSupport) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 1} -} - -func (x *FieldOptions_FeatureSupport) GetEditionIntroduced() Edition { - if x != nil && x.EditionIntroduced != nil { - return *x.EditionIntroduced - } - return Edition_EDITION_UNKNOWN -} - -func (x *FieldOptions_FeatureSupport) GetEditionDeprecated() Edition { - if x != nil && x.EditionDeprecated != nil { - return *x.EditionDeprecated - } - return Edition_EDITION_UNKNOWN -} - -func (x *FieldOptions_FeatureSupport) GetDeprecationWarning() string { - if x != nil && x.DeprecationWarning != nil { - return *x.DeprecationWarning - } - return "" -} - -func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { - if x != nil && x.EditionRemoved != nil { - return *x.EditionRemoved - } - return Edition_EDITION_UNKNOWN -} - // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -4093,7 +3985,7 @@ type UninterpretedOption_NamePart struct { func (x *UninterpretedOption_NamePart) Reset() { *x = UninterpretedOption_NamePart{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4106,7 +3998,7 @@ func (x *UninterpretedOption_NamePart) String() string { func (*UninterpretedOption_NamePart) ProtoMessage() {} func (x *UninterpretedOption_NamePart) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4145,17 +4037,14 @@ type FeatureSetDefaults_FeatureSetEditionDefault struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` - // Defaults of features that can be overridden in this edition. - OverridableFeatures *FeatureSet `protobuf:"bytes,4,opt,name=overridable_features,json=overridableFeatures" json:"overridable_features,omitempty"` - // Defaults of features that can't be overridden in this edition. - FixedFeatures *FeatureSet `protobuf:"bytes,5,opt,name=fixed_features,json=fixedFeatures" json:"fixed_features,omitempty"` + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` } func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { *x = FeatureSetDefaults_FeatureSetEditionDefault{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4168,7 +4057,7 @@ func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4191,16 +4080,9 @@ func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetEdition() Edition { return Edition_EDITION_UNKNOWN } -func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetOverridableFeatures() *FeatureSet { +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFeatures() *FeatureSet { if x != nil { - return x.OverridableFeatures - } - return nil -} - -func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFixedFeatures() *FeatureSet { - if x != nil { - return x.FixedFeatures + return x.Features } return nil } @@ -4306,7 +4188,7 @@ type SourceCodeInfo_Location struct { func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4319,7 +4201,7 @@ func (x *SourceCodeInfo_Location) String() string { func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4393,7 +4275,7 @@ type GeneratedCodeInfo_Annotation struct { func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[32] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4406,7 +4288,7 @@ func (x *GeneratedCodeInfo_Annotation) String() string { func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[32] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4715,7 +4597,7 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x67, 0x12, 0x30, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x69, 0x6e, 0x67, 0x22, 0xad, 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x69, 0x6e, 0x67, 0x22, 0x97, 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, @@ -4788,445 +4670,405 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x49, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, - 0x02, 0x4a, 0x04, 0x08, 0x2a, 0x10, 0x2b, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x52, 0x14, 0x70, - 0x68, 0x70, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x22, 0xf4, 0x03, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, - 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, - 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, - 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, - 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, - 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, + 0x02, 0x4a, 0x04, 0x08, 0x2a, 0x10, 0x2b, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xf4, 0x03, + 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, + 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, + 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, + 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, + 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, + 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, + 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, + 0x08, 0x09, 0x10, 0x0a, 0x22, 0xad, 0x0a, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, + 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, + 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, + 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, + 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, + 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, + 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, + 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, + 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, + 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, + 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, + 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, + 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, + 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, + 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, + 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, + 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, + 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, + 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, + 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, + 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, + 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, + 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, + 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, + 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, + 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, + 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, + 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, + 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, + 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, + 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, + 0x08, 0x12, 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, + 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, + 0x80, 0x80, 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, + 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, + 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, + 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, - 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, - 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x9d, 0x0d, 0x0a, 0x0c, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, - 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, - 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, - 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, - 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, - 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, - 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, + 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, + 0x02, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x81, 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, + 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, - 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, - 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, - 0x55, 0x0a, 0x0f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x96, 0x02, 0x0a, - 0x0e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, - 0x47, 0x0a, 0x12, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, - 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x12, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, - 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x72, 0x6e, 0x69, - 0x6e, 0x67, 0x12, 0x41, 0x0a, 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, - 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, - 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, - 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, - 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, - 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, - 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, - 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, - 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, - 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, - 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, - 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x12, 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, - 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, - 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, - 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, - 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, - 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, - 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, - 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, - 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xd8, 0x02, - 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, - 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x55, 0x0a, 0x0f, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6f, 0x72, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, - 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, - 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, + 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, + 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, 0x0a, 0x14, 0x75, - 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, - 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, 0x69, 0x64, 0x65, - 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x22, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, - 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6d, - 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, 0x08, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, - 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, - 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x10, - 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, 0x10, - 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, 0x0a, - 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, - 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, - 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, - 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, - 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, 0x0a, - 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, - 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x61, - 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x0a, 0x0a, 0x0a, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x3f, 0x88, 0x01, - 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x4c, - 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, 0x4d, 0x50, 0x4c, - 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x4c, - 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0d, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x09, - 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, - 0x6d, 0x54, 0x79, 0x70, 0x65, 0x42, 0x29, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, - 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, - 0x09, 0x12, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, - 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x17, 0x72, - 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, - 0x2d, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, - 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x50, - 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x15, - 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, - 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7e, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, 0x38, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x29, 0x88, 0x01, 0x01, 0x98, - 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, 0xe6, - 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, 0xb2, - 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0e, 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7e, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x26, 0x88, 0x01, - 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, - 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xb2, 0x01, - 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, - 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x42, 0x39, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, 0x01, 0x06, 0x98, 0x01, - 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, - 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, - 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0a, - 0x6a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, - 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, - 0x43, 0x49, 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, - 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, - 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, - 0x50, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, - 0x02, 0x22, 0x56, 0x0a, 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, - 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, - 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, - 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0e, 0x55, 0x74, 0x66, - 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, - 0x54, 0x46, 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, - 0x46, 0x59, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x22, 0x04, - 0x08, 0x01, 0x10, 0x01, 0x22, 0x53, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, - 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, - 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, - 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, - 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x22, 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, - 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x17, 0x0a, 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, - 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, - 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, - 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, 0x10, 0x8b, 0x4e, 0x2a, 0x06, 0x08, 0x8b, 0x4e, - 0x10, 0x90, 0x4e, 0x2a, 0x06, 0x08, 0x90, 0x4e, 0x10, 0x91, 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, - 0x10, 0xe8, 0x07, 0x22, 0xef, 0x03, 0x0a, 0x12, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, + 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, + 0x80, 0x80, 0x02, 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, + 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, + 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, + 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, + 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, + 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, + 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, + 0x54, 0x53, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, + 0x4e, 0x54, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, + 0x9a, 0x03, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, + 0x50, 0x61, 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x10, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x1a, 0x4a, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, + 0x0b, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x0a, 0x0a, + 0x0a, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x0e, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, + 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, + 0x39, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, + 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, + 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, + 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x09, 0x65, 0x6e, 0x75, + 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, - 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, - 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, - 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xf8, 0x01, 0x0a, 0x18, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x14, 0x6f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x13, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, - 0x62, 0x6c, 0x65, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, + 0x70, 0x65, 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0b, + 0x12, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x09, 0x12, 0x04, + 0x4f, 0x50, 0x45, 0x4e, 0x18, 0xe7, 0x07, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x92, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, - 0x52, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, - 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, - 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, - 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, - 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, - 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, - 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, - 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, - 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, - 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, - 0x10, 0x02, 0x2a, 0xa7, 0x02, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, - 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, - 0x45, 0x47, 0x41, 0x43, 0x59, 0x10, 0x84, 0x07, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, 0x13, 0x0a, - 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, - 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, - 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x32, 0x30, 0x32, 0x34, 0x10, 0xe9, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x5f, 0x54, - 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, - 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, 0x53, 0x54, - 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, - 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, - 0x4e, 0x4c, 0x59, 0x10, 0x9f, 0x8d, 0x06, 0x12, 0x13, 0x0a, 0x0b, 0x45, 0x44, 0x49, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0xff, 0xff, 0xff, 0xff, 0x07, 0x42, 0x7e, 0x0a, 0x13, - 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, - 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x27, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, + 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, + 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0x52, + 0x15, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x78, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, + 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0x88, 0x01, 0x01, + 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, + 0xe6, 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, + 0x52, 0x0e, 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x78, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x20, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, + 0x01, 0x01, 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, + 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7c, 0x0a, 0x0b, 0x6a, 0x73, + 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, + 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x33, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, + 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, + 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, + 0x01, 0x0a, 0x12, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0x52, 0x0a, 0x6a, 0x73, + 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x49, 0x45, + 0x4c, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, + 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, + 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, + 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, + 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x02, 0x22, + 0x56, 0x0a, 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, 0x50, 0x45, + 0x41, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, + 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, + 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x43, 0x0a, 0x0e, 0x55, 0x74, 0x66, 0x38, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x54, 0x46, + 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, + 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x22, 0x53, 0x0a, 0x0f, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, + 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, + 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, + 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, + 0x02, 0x22, 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x17, 0x0a, 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, + 0x57, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, + 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, + 0x10, 0xe9, 0x07, 0x2a, 0x06, 0x08, 0xe9, 0x07, 0x10, 0xea, 0x07, 0x2a, 0x06, 0x08, 0xea, 0x07, + 0x10, 0xeb, 0x07, 0x2a, 0x06, 0x08, 0x8b, 0x4e, 0x10, 0x90, 0x4e, 0x2a, 0x06, 0x08, 0x90, 0x4e, + 0x10, 0x91, 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, 0x10, 0xe8, 0x07, 0x22, 0xfe, 0x02, 0x0a, 0x12, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, + 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, + 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x41, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x87, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, + 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, + 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, + 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, + 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, + 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, + 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, + 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, + 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, + 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, + 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, + 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, + 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, + 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, + 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, 0x02, 0x2a, 0x92, 0x02, 0x0a, 0x07, 0x45, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, + 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, + 0x33, 0x10, 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x32, 0x30, 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x10, 0xe9, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, + 0x59, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, + 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, + 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, + 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, + 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, + 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, + 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9f, 0x8d, 0x06, 0x12, 0x13, 0x0a, 0x0b, 0x45, 0x44, 0x49, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0xff, 0xff, 0xff, 0xff, 0x07, 0x42, 0x7e, + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, + 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, } var ( @@ -5242,8 +5084,8 @@ func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { } var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 17) -var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 33) -var file_google_protobuf_descriptor_proto_goTypes = []any{ +var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_google_protobuf_descriptor_proto_goTypes = []interface{}{ (Edition)(0), // 0: google.protobuf.Edition (ExtensionRangeOptions_VerificationState)(0), // 1: google.protobuf.ExtensionRangeOptions.VerificationState (FieldDescriptorProto_Type)(0), // 2: google.protobuf.FieldDescriptorProto.Type @@ -5289,11 +5131,10 @@ var file_google_protobuf_descriptor_proto_goTypes = []any{ (*ExtensionRangeOptions_Declaration)(nil), // 42: google.protobuf.ExtensionRangeOptions.Declaration (*EnumDescriptorProto_EnumReservedRange)(nil), // 43: google.protobuf.EnumDescriptorProto.EnumReservedRange (*FieldOptions_EditionDefault)(nil), // 44: google.protobuf.FieldOptions.EditionDefault - (*FieldOptions_FeatureSupport)(nil), // 45: google.protobuf.FieldOptions.FeatureSupport - (*UninterpretedOption_NamePart)(nil), // 46: google.protobuf.UninterpretedOption.NamePart - (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 47: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - (*SourceCodeInfo_Location)(nil), // 48: google.protobuf.SourceCodeInfo.Location - (*GeneratedCodeInfo_Annotation)(nil), // 49: google.protobuf.GeneratedCodeInfo.Annotation + (*UninterpretedOption_NamePart)(nil), // 45: google.protobuf.UninterpretedOption.NamePart + (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 46: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + (*SourceCodeInfo_Location)(nil), // 47: google.protobuf.SourceCodeInfo.Location + (*GeneratedCodeInfo_Annotation)(nil), // 48: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ 18, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto @@ -5338,46 +5179,40 @@ var file_google_protobuf_descriptor_proto_depIdxs = []int32{ 8, // 39: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType 44, // 40: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault 36, // 41: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet - 45, // 42: google.protobuf.FieldOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport - 35, // 43: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 44: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 45: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 46: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 47: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 48: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet - 45, // 49: google.protobuf.EnumValueOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport - 35, // 50: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 51: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 52: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 9, // 53: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel - 36, // 54: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 55: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 46, // 56: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart - 10, // 57: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence - 11, // 58: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType - 12, // 59: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding - 13, // 60: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation - 14, // 61: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding - 15, // 62: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat - 47, // 63: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - 0, // 64: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition - 0, // 65: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition - 48, // 66: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location - 49, // 67: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation - 20, // 68: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions - 0, // 69: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition - 0, // 70: google.protobuf.FieldOptions.FeatureSupport.edition_introduced:type_name -> google.protobuf.Edition - 0, // 71: google.protobuf.FieldOptions.FeatureSupport.edition_deprecated:type_name -> google.protobuf.Edition - 0, // 72: google.protobuf.FieldOptions.FeatureSupport.edition_removed:type_name -> google.protobuf.Edition - 0, // 73: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition - 36, // 74: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features:type_name -> google.protobuf.FeatureSet - 36, // 75: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features:type_name -> google.protobuf.FeatureSet - 16, // 76: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic - 77, // [77:77] is the sub-list for method output_type - 77, // [77:77] is the sub-list for method input_type - 77, // [77:77] is the sub-list for extension type_name - 77, // [77:77] is the sub-list for extension extendee - 0, // [0:77] is the sub-list for field type_name + 35, // 42: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 43: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 44: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 45: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 46: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 47: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 48: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 49: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 50: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 9, // 51: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel + 36, // 52: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 53: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 45, // 54: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart + 10, // 55: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence + 11, // 56: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType + 12, // 57: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding + 13, // 58: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation + 14, // 59: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding + 15, // 60: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat + 46, // 61: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + 0, // 62: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition + 0, // 63: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition + 47, // 64: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location + 48, // 65: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation + 20, // 66: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions + 0, // 67: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition + 0, // 68: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition + 36, // 69: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features:type_name -> google.protobuf.FeatureSet + 16, // 70: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic + 71, // [71:71] is the sub-list for method output_type + 71, // [71:71] is the sub-list for method input_type + 71, // [71:71] is the sub-list for extension type_name + 71, // [71:71] is the sub-list for extension extendee + 0, // [0:71] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } @@ -5386,7 +5221,7 @@ func file_google_protobuf_descriptor_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_descriptor_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileDescriptorSet); i { case 0: return &v.state @@ -5398,7 +5233,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileDescriptorProto); i { case 0: return &v.state @@ -5410,7 +5245,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DescriptorProto); i { case 0: return &v.state @@ -5422,7 +5257,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionRangeOptions); i { case 0: return &v.state @@ -5436,7 +5271,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldDescriptorProto); i { case 0: return &v.state @@ -5448,7 +5283,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OneofDescriptorProto); i { case 0: return &v.state @@ -5460,7 +5295,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumDescriptorProto); i { case 0: return &v.state @@ -5472,7 +5307,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumValueDescriptorProto); i { case 0: return &v.state @@ -5484,7 +5319,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceDescriptorProto); i { case 0: return &v.state @@ -5496,7 +5331,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodDescriptorProto); i { case 0: return &v.state @@ -5508,7 +5343,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileOptions); i { case 0: return &v.state @@ -5522,7 +5357,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MessageOptions); i { case 0: return &v.state @@ -5536,7 +5371,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldOptions); i { case 0: return &v.state @@ -5550,7 +5385,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OneofOptions); i { case 0: return &v.state @@ -5564,7 +5399,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumOptions); i { case 0: return &v.state @@ -5578,7 +5413,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumValueOptions); i { case 0: return &v.state @@ -5592,7 +5427,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[16].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceOptions); i { case 0: return &v.state @@ -5606,7 +5441,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[17].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodOptions); i { case 0: return &v.state @@ -5620,7 +5455,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[18].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UninterpretedOption); i { case 0: return &v.state @@ -5632,7 +5467,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FeatureSet); i { case 0: return &v.state @@ -5646,7 +5481,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FeatureSetDefaults); i { case 0: return &v.state @@ -5658,7 +5493,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SourceCodeInfo); i { case 0: return &v.state @@ -5670,7 +5505,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeneratedCodeInfo); i { case 0: return &v.state @@ -5682,7 +5517,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DescriptorProto_ExtensionRange); i { case 0: return &v.state @@ -5694,7 +5529,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DescriptorProto_ReservedRange); i { case 0: return &v.state @@ -5706,7 +5541,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionRangeOptions_Declaration); i { case 0: return &v.state @@ -5718,7 +5553,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { case 0: return &v.state @@ -5730,7 +5565,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldOptions_EditionDefault); i { case 0: return &v.state @@ -5742,19 +5577,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*FieldOptions_FeatureSupport); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UninterpretedOption_NamePart); i { case 0: return &v.state @@ -5766,7 +5589,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FeatureSetDefaults_FeatureSetEditionDefault); i { case 0: return &v.state @@ -5778,7 +5601,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SourceCodeInfo_Location); i { case 0: return &v.state @@ -5790,7 +5613,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[32].Exporter = func(v any, i int) any { + file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeneratedCodeInfo_Annotation); i { case 0: return &v.state @@ -5809,7 +5632,7 @@ func file_google_protobuf_descriptor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc, NumEnums: 17, - NumMessages: 33, + NumMessages: 32, NumExtensions: 0, NumServices: 0, }, diff --git a/upstream/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go b/upstream/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go index 1ba1dfa5ad8..39b024b46b8 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go +++ b/upstream/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go @@ -294,7 +294,7 @@ func (m *Message) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { case fd.IsMap(): return protoreflect.ValueOfMap(&dynamicMap{ desc: fd, - mapv: make(map[any]protoreflect.Value), + mapv: make(map[interface{}]protoreflect.Value), }) case fd.IsList(): return protoreflect.ValueOfList(&dynamicList{desc: fd}) @@ -450,7 +450,7 @@ func (x *dynamicList) IsValid() bool { type dynamicMap struct { desc protoreflect.FieldDescriptor - mapv map[any]protoreflect.Value + mapv map[interface{}]protoreflect.Value } func (x *dynamicMap) Get(k protoreflect.MapKey) protoreflect.Value { return x.mapv[k.Interface()] } @@ -634,11 +634,11 @@ func newListEntry(fd protoreflect.FieldDescriptor) protoreflect.Value { // // The InterfaceOf and ValueOf methods of the extension type are defined as: // -// func (xt extensionType) ValueOf(iv any) protoreflect.Value { +// func (xt extensionType) ValueOf(iv interface{}) protoreflect.Value { // return protoreflect.ValueOf(iv) // } // -// func (xt extensionType) InterfaceOf(v protoreflect.Value) any { +// func (xt extensionType) InterfaceOf(v protoreflect.Value) interface{} { // return v.Interface() // } // @@ -658,7 +658,7 @@ func (xt extensionType) New() protoreflect.Value { case xt.desc.IsMap(): return protoreflect.ValueOfMap(&dynamicMap{ desc: xt.desc, - mapv: make(map[any]protoreflect.Value), + mapv: make(map[interface{}]protoreflect.Value), }) case xt.desc.IsList(): return protoreflect.ValueOfList(&dynamicList{desc: xt.desc}) @@ -686,18 +686,18 @@ func (xt extensionType) TypeDescriptor() protoreflect.ExtensionTypeDescriptor { return xt.desc } -func (xt extensionType) ValueOf(iv any) protoreflect.Value { +func (xt extensionType) ValueOf(iv interface{}) protoreflect.Value { v := protoreflect.ValueOf(iv) typecheck(xt.desc, v) return v } -func (xt extensionType) InterfaceOf(v protoreflect.Value) any { +func (xt extensionType) InterfaceOf(v protoreflect.Value) interface{} { typecheck(xt.desc, v) return v.Interface() } -func (xt extensionType) IsValidInterface(iv any) bool { +func (xt extensionType) IsValidInterface(iv interface{}) bool { return typeIsValid(xt.desc, protoreflect.ValueOf(iv)) == nil } diff --git a/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go b/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go index a2ca940c50f..25de5ae0085 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go @@ -6,9 +6,9 @@ // https://developers.google.com/open-source/licenses/bsd // Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/go_features.proto +// source: reflect/protodesc/proto/go_features.proto -package gofeaturespb +package proto import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -30,7 +30,7 @@ type GoFeatures struct { func (x *GoFeatures) Reset() { *x = GoFeatures{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_go_features_proto_msgTypes[0] + mi := &file_reflect_protodesc_proto_go_features_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -43,7 +43,7 @@ func (x *GoFeatures) String() string { func (*GoFeatures) ProtoMessage() {} func (x *GoFeatures) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_go_features_proto_msgTypes[0] + mi := &file_reflect_protodesc_proto_go_features_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -56,7 +56,7 @@ func (x *GoFeatures) ProtoReflect() protoreflect.Message { // Deprecated: Use GoFeatures.ProtoReflect.Descriptor instead. func (*GoFeatures) Descriptor() ([]byte, []int) { - return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0} + return file_reflect_protodesc_proto_go_features_proto_rawDescGZIP(), []int{0} } func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { @@ -66,73 +66,69 @@ func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { return false } -var file_google_protobuf_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ +var file_reflect_protodesc_proto_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FeatureSet)(nil), ExtensionType: (*GoFeatures)(nil), Field: 1002, - Name: "pb.go", + Name: "google.protobuf.go", Tag: "bytes,1002,opt,name=go", - Filename: "google/protobuf/go_features.proto", + Filename: "reflect/protodesc/proto/go_features.proto", }, } // Extension fields to descriptorpb.FeatureSet. var ( - // optional pb.GoFeatures go = 1002; - E_Go = &file_google_protobuf_go_features_proto_extTypes[0] + // optional google.protobuf.GoFeatures go = 1002; + E_Go = &file_reflect_protodesc_proto_go_features_proto_extTypes[0] ) -var File_google_protobuf_go_features_proto protoreflect.FileDescriptor - -var file_google_protobuf_go_features_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x0a, 0x47, 0x6f, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x1a, 0x6c, 0x65, 0x67, - 0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x6a, 0x73, - 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x80, 0x01, - 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72, - 0x75, 0x65, 0x18, 0x84, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18, - 0xe7, 0x07, 0xb2, 0x01, 0x5b, 0x08, 0xe8, 0x07, 0x10, 0xe8, 0x07, 0x1a, 0x53, 0x54, 0x68, 0x65, - 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, - 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, - 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x52, 0x17, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x3c, 0x0a, 0x02, 0x67, 0x6f, 0x12, - 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x52, 0x02, 0x67, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x6f, 0x66, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x70, 0x62, +var File_reflect_protodesc_proto_go_features_proto protoreflect.FileDescriptor + +var file_reflect_protodesc_proto_go_features_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x64, + 0x65, 0x73, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x1a, 0x20, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, + 0x0a, 0x0a, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x1a, + 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, + 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x1f, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72, 0x75, + 0x65, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18, 0xe7, + 0x07, 0x52, 0x17, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x49, 0x0a, 0x02, 0x67, 0x6f, + 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x52, 0x02, 0x67, 0x6f, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x64, 0x65, 0x73, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, } var ( - file_google_protobuf_go_features_proto_rawDescOnce sync.Once - file_google_protobuf_go_features_proto_rawDescData = file_google_protobuf_go_features_proto_rawDesc + file_reflect_protodesc_proto_go_features_proto_rawDescOnce sync.Once + file_reflect_protodesc_proto_go_features_proto_rawDescData = file_reflect_protodesc_proto_go_features_proto_rawDesc ) -func file_google_protobuf_go_features_proto_rawDescGZIP() []byte { - file_google_protobuf_go_features_proto_rawDescOnce.Do(func() { - file_google_protobuf_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_go_features_proto_rawDescData) +func file_reflect_protodesc_proto_go_features_proto_rawDescGZIP() []byte { + file_reflect_protodesc_proto_go_features_proto_rawDescOnce.Do(func() { + file_reflect_protodesc_proto_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(file_reflect_protodesc_proto_go_features_proto_rawDescData) }) - return file_google_protobuf_go_features_proto_rawDescData + return file_reflect_protodesc_proto_go_features_proto_rawDescData } -var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_go_features_proto_goTypes = []any{ - (*GoFeatures)(nil), // 0: pb.GoFeatures +var file_reflect_protodesc_proto_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_reflect_protodesc_proto_go_features_proto_goTypes = []interface{}{ + (*GoFeatures)(nil), // 0: google.protobuf.GoFeatures (*descriptorpb.FeatureSet)(nil), // 1: google.protobuf.FeatureSet } -var file_google_protobuf_go_features_proto_depIdxs = []int32{ - 1, // 0: pb.go:extendee -> google.protobuf.FeatureSet - 0, // 1: pb.go:type_name -> pb.GoFeatures +var file_reflect_protodesc_proto_go_features_proto_depIdxs = []int32{ + 1, // 0: google.protobuf.go:extendee -> google.protobuf.FeatureSet + 0, // 1: google.protobuf.go:type_name -> google.protobuf.GoFeatures 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 1, // [1:2] is the sub-list for extension type_name @@ -140,13 +136,13 @@ var file_google_protobuf_go_features_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_google_protobuf_go_features_proto_init() } -func file_google_protobuf_go_features_proto_init() { - if File_google_protobuf_go_features_proto != nil { +func init() { file_reflect_protodesc_proto_go_features_proto_init() } +func file_reflect_protodesc_proto_go_features_proto_init() { + if File_reflect_protodesc_proto_go_features_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_go_features_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_reflect_protodesc_proto_go_features_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoFeatures); i { case 0: return &v.state @@ -163,19 +159,19 @@ func file_google_protobuf_go_features_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_protobuf_go_features_proto_rawDesc, + RawDescriptor: file_reflect_protodesc_proto_go_features_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 1, NumServices: 0, }, - GoTypes: file_google_protobuf_go_features_proto_goTypes, - DependencyIndexes: file_google_protobuf_go_features_proto_depIdxs, - MessageInfos: file_google_protobuf_go_features_proto_msgTypes, - ExtensionInfos: file_google_protobuf_go_features_proto_extTypes, + GoTypes: file_reflect_protodesc_proto_go_features_proto_goTypes, + DependencyIndexes: file_reflect_protodesc_proto_go_features_proto_depIdxs, + MessageInfos: file_reflect_protodesc_proto_go_features_proto_msgTypes, + ExtensionInfos: file_reflect_protodesc_proto_go_features_proto_extTypes, }.Build() - File_google_protobuf_go_features_proto = out.File - file_google_protobuf_go_features_proto_rawDesc = nil - file_google_protobuf_go_features_proto_goTypes = nil - file_google_protobuf_go_features_proto_depIdxs = nil + File_reflect_protodesc_proto_go_features_proto = out.File + file_reflect_protodesc_proto_go_features_proto_rawDesc = nil + file_reflect_protodesc_proto_go_features_proto_goTypes = nil + file_reflect_protodesc_proto_go_features_proto_depIdxs = nil } diff --git a/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto b/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto new file mode 100644 index 00000000000..d246571296e --- /dev/null +++ b/upstream/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto @@ -0,0 +1,28 @@ +// Protocol Buffers - Google's data interchange format +// 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 or at +// https://developers.google.com/open-source/licenses/bsd + +syntax = "proto2"; + +package google.protobuf; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/protobuf/types/gofeaturespb"; + +extend google.protobuf.FeatureSet { + optional GoFeatures go = 1002; +} + +message GoFeatures { + // Whether or not to generate the deprecated UnmarshalJSON method for enums. + optional bool legacy_unmarshal_json_enum = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + edition_defaults = { edition: EDITION_PROTO2, value: "true" }, + edition_defaults = { edition: EDITION_PROTO3, value: "false" } + ]; +} diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 7172b43d383..9de51be5403 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -445,7 +445,7 @@ func file_google_protobuf_any_proto_rawDescGZIP() []byte { } var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_any_proto_goTypes = []any{ +var file_google_protobuf_any_proto_goTypes = []interface{}{ (*Any)(nil), // 0: google.protobuf.Any } var file_google_protobuf_any_proto_depIdxs = []int32{ @@ -462,7 +462,7 @@ func file_google_protobuf_any_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Any); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go index 1b71bcd910a..df709a8dd4c 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go @@ -323,7 +323,7 @@ func file_google_protobuf_duration_proto_rawDescGZIP() []byte { } var file_google_protobuf_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_duration_proto_goTypes = []any{ +var file_google_protobuf_duration_proto_goTypes = []interface{}{ (*Duration)(nil), // 0: google.protobuf.Duration } var file_google_protobuf_duration_proto_depIdxs = []int32{ @@ -340,7 +340,7 @@ func file_google_protobuf_duration_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Duration); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go index d87b4fb8281..9a7277ba394 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go @@ -115,7 +115,7 @@ func file_google_protobuf_empty_proto_rawDescGZIP() []byte { } var file_google_protobuf_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_empty_proto_goTypes = []any{ +var file_google_protobuf_empty_proto_goTypes = []interface{}{ (*Empty)(nil), // 0: google.protobuf.Empty } var file_google_protobuf_empty_proto_depIdxs = []int32{ @@ -132,7 +132,7 @@ func file_google_protobuf_empty_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go index ac1e91bb6dd..e8789cb331e 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go @@ -537,7 +537,7 @@ func file_google_protobuf_field_mask_proto_rawDescGZIP() []byte { } var file_google_protobuf_field_mask_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_field_mask_proto_goTypes = []any{ +var file_google_protobuf_field_mask_proto_goTypes = []interface{}{ (*FieldMask)(nil), // 0: google.protobuf.FieldMask } var file_google_protobuf_field_mask_proto_depIdxs = []int32{ @@ -554,7 +554,7 @@ func file_google_protobuf_field_mask_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldMask); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go index d45361cbc72..d2bac8b88ea 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go @@ -49,11 +49,11 @@ // The standard Go "encoding/json" package has functionality to serialize // arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and // ListValue.AsSlice methods can convert the protobuf message representation into -// a form represented by any, map[string]any, and []any. +// a form represented by interface{}, map[string]interface{}, and []interface{}. // This form can be used with other packages that operate on such data structures // and also directly with the standard json package. // -// In order to convert the any, map[string]any, and []any +// In order to convert the interface{}, map[string]interface{}, and []interface{} // forms back as Value, Struct, and ListValue messages, use the NewStruct, // NewList, and NewValue constructor functions. // @@ -88,28 +88,28 @@ // // To construct a Value message representing the above JSON object: // -// m, err := structpb.NewValue(map[string]any{ +// m, err := structpb.NewValue(map[string]interface{}{ // "firstName": "John", // "lastName": "Smith", // "isAlive": true, // "age": 27, -// "address": map[string]any{ +// "address": map[string]interface{}{ // "streetAddress": "21 2nd Street", // "city": "New York", // "state": "NY", // "postalCode": "10021-3100", // }, -// "phoneNumbers": []any{ -// map[string]any{ +// "phoneNumbers": []interface{}{ +// map[string]interface{}{ // "type": "home", // "number": "212 555-1234", // }, -// map[string]any{ +// map[string]interface{}{ // "type": "office", // "number": "646 555-4567", // }, // }, -// "children": []any{}, +// "children": []interface{}{}, // "spouse": nil, // }) // if err != nil { @@ -197,7 +197,7 @@ type Struct struct { // NewStruct constructs a Struct from a general-purpose Go map. // The map keys must be valid UTF-8. // The map values are converted using NewValue. -func NewStruct(v map[string]any) (*Struct, error) { +func NewStruct(v map[string]interface{}) (*Struct, error) { x := &Struct{Fields: make(map[string]*Value, len(v))} for k, v := range v { if !utf8.ValidString(k) { @@ -214,9 +214,9 @@ func NewStruct(v map[string]any) (*Struct, error) { // AsMap converts x to a general-purpose Go map. // The map values are converted by calling Value.AsInterface. -func (x *Struct) AsMap() map[string]any { +func (x *Struct) AsMap() map[string]interface{} { f := x.GetFields() - vs := make(map[string]any, len(f)) + vs := make(map[string]interface{}, len(f)) for k, v := range f { vs[k] = v.AsInterface() } @@ -306,13 +306,13 @@ type Value struct { // ║ float32, float64 │ stored as NumberValue ║ // ║ string │ stored as StringValue; must be valid UTF-8 ║ // ║ []byte │ stored as StringValue; base64-encoded ║ -// ║ map[string]any │ stored as StructValue ║ -// ║ []any │ stored as ListValue ║ +// ║ map[string]interface{} │ stored as StructValue ║ +// ║ []interface{} │ stored as ListValue ║ // ╚════════════════════════╧════════════════════════════════════════════╝ // // When converting an int64 or uint64 to a NumberValue, numeric precision loss // is possible since they are stored as a float64. -func NewValue(v any) (*Value, error) { +func NewValue(v interface{}) (*Value, error) { switch v := v.(type) { case nil: return NewNullValue(), nil @@ -342,13 +342,13 @@ func NewValue(v any) (*Value, error) { case []byte: s := base64.StdEncoding.EncodeToString(v) return NewStringValue(s), nil - case map[string]any: + case map[string]interface{}: v2, err := NewStruct(v) if err != nil { return nil, err } return NewStructValue(v2), nil - case []any: + case []interface{}: v2, err := NewList(v) if err != nil { return nil, err @@ -396,7 +396,7 @@ func NewListValue(v *ListValue) *Value { // // Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are // converted as strings to remain compatible with MarshalJSON. -func (x *Value) AsInterface() any { +func (x *Value) AsInterface() interface{} { switch v := x.GetKind().(type) { case *Value_NumberValue: if v != nil { @@ -580,7 +580,7 @@ type ListValue struct { // NewList constructs a ListValue from a general-purpose Go slice. // The slice elements are converted using NewValue. -func NewList(v []any) (*ListValue, error) { +func NewList(v []interface{}) (*ListValue, error) { x := &ListValue{Values: make([]*Value, len(v))} for i, v := range v { var err error @@ -594,9 +594,9 @@ func NewList(v []any) (*ListValue, error) { // AsSlice converts x to a general-purpose Go slice. // The slice elements are converted by calling Value.AsInterface. -func (x *ListValue) AsSlice() []any { +func (x *ListValue) AsSlice() []interface{} { vals := x.GetValues() - vs := make([]any, len(vals)) + vs := make([]interface{}, len(vals)) for i, v := range vals { vs[i] = v.AsInterface() } @@ -716,7 +716,7 @@ func file_google_protobuf_struct_proto_rawDescGZIP() []byte { var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_google_protobuf_struct_proto_goTypes = []any{ +var file_google_protobuf_struct_proto_goTypes = []interface{}{ (NullValue)(0), // 0: google.protobuf.NullValue (*Struct)(nil), // 1: google.protobuf.Struct (*Value)(nil), // 2: google.protobuf.Value @@ -743,7 +743,7 @@ func file_google_protobuf_struct_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Struct); i { case 0: return &v.state @@ -755,7 +755,7 @@ func file_google_protobuf_struct_proto_init() { return nil } } - file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value); i { case 0: return &v.state @@ -767,7 +767,7 @@ func file_google_protobuf_struct_proto_init() { return nil } } - file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListValue); i { case 0: return &v.state @@ -780,7 +780,7 @@ func file_google_protobuf_struct_proto_init() { } } } - file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []any{ + file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []interface{}{ (*Value_NullValue)(nil), (*Value_NumberValue)(nil), (*Value_StringValue)(nil), diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 83a5a645b08..81511a3363e 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -332,7 +332,7 @@ func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte { } var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_timestamp_proto_goTypes = []any{ +var file_google_protobuf_timestamp_proto_goTypes = []interface{}{ (*Timestamp)(nil), // 0: google.protobuf.Timestamp } var file_google_protobuf_timestamp_proto_depIdxs = []int32{ @@ -349,7 +349,7 @@ func file_google_protobuf_timestamp_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Timestamp); i { case 0: return &v.state diff --git a/upstream/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go b/upstream/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go index e473f826aa3..762a87130f8 100644 --- a/upstream/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go +++ b/upstream/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go @@ -605,7 +605,7 @@ func file_google_protobuf_wrappers_proto_rawDescGZIP() []byte { } var file_google_protobuf_wrappers_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_google_protobuf_wrappers_proto_goTypes = []any{ +var file_google_protobuf_wrappers_proto_goTypes = []interface{}{ (*DoubleValue)(nil), // 0: google.protobuf.DoubleValue (*FloatValue)(nil), // 1: google.protobuf.FloatValue (*Int64Value)(nil), // 2: google.protobuf.Int64Value @@ -630,7 +630,7 @@ func file_google_protobuf_wrappers_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DoubleValue); i { case 0: return &v.state @@ -642,7 +642,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FloatValue); i { case 0: return &v.state @@ -654,7 +654,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Int64Value); i { case 0: return &v.state @@ -666,7 +666,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UInt64Value); i { case 0: return &v.state @@ -678,7 +678,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Int32Value); i { case 0: return &v.state @@ -690,7 +690,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UInt32Value); i { case 0: return &v.state @@ -702,7 +702,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BoolValue); i { case 0: return &v.state @@ -714,7 +714,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StringValue); i { case 0: return &v.state @@ -726,7 +726,7 @@ func file_google_protobuf_wrappers_proto_init() { return nil } } - file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BytesValue); i { case 0: return &v.state diff --git a/upstream/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go b/upstream/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go index bd6b17e1588..575456c8386 100644 --- a/upstream/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go +++ b/upstream/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go @@ -226,7 +226,7 @@ type ValidatingAdmissionPolicySpec struct { // +listType=map // +listMapKey=name // +optional - Variables []Variable `json:"variables,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=variables"` + Variables []Variable `json:"variables" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=variables"` } type MatchCondition v1.MatchCondition diff --git a/upstream/vendor/k8s.io/api/admissionregistration/v1beta1/types.go b/upstream/vendor/k8s.io/api/admissionregistration/v1beta1/types.go index 12c680dc972..c199702fbd0 100644 --- a/upstream/vendor/k8s.io/api/admissionregistration/v1beta1/types.go +++ b/upstream/vendor/k8s.io/api/admissionregistration/v1beta1/types.go @@ -242,7 +242,7 @@ type ValidatingAdmissionPolicySpec struct { // +listType=map // +listMapKey=name // +optional - Variables []Variable `json:"variables,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=variables"` + Variables []Variable `json:"variables" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=variables"` } // ParamKind is a tuple of Group Kind and Version. diff --git a/upstream/vendor/k8s.io/api/batch/v1/generated.proto b/upstream/vendor/k8s.io/api/batch/v1/generated.proto index f8997798892..4f0822440fa 100644 --- a/upstream/vendor/k8s.io/api/batch/v1/generated.proto +++ b/upstream/vendor/k8s.io/api/batch/v1/generated.proto @@ -229,8 +229,8 @@ message JobSpec { // batch.kubernetes.io/job-index-failure-count annotation. It can only // be set when Job's completionMode=Indexed, and the Pod's restart // policy is Never. The field is immutable. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional optional int32 backoffLimitPerIndex = 12; @@ -242,8 +242,8 @@ message JobSpec { // It can only be specified when backoffLimitPerIndex is set. // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional optional int32 maxFailedIndexes = 13; @@ -326,8 +326,7 @@ message JobSpec { // // When using podFailurePolicy, Failed is the the only allowed value. // TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. - // This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. - // This is on by default. + // This is an alpha field. Enable JobPodReplacementPolicy to be able to use this field. // +optional optional string podReplacementPolicy = 14; } @@ -376,8 +375,8 @@ message JobStatus { // The number of pods which are terminating (in phase Pending or Running // and have a deletionTimestamp). // - // This field is beta-level. The job controller populates the field when - // the feature gate JobPodReplacementPolicy is enabled (enabled by default). + // This field is alpha-level. The job controller populates the field when + // the feature gate JobPodReplacementPolicy is enabled (disabled by default). // +optional optional int32 terminating = 11; @@ -399,8 +398,8 @@ message JobStatus { // last element of the series, separated by a hyphen. // For example, if the failed indexes are 1, 3, 4, 5 and 7, they are // represented as "1,3-5,7". - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional optional string failedIndexes = 10; @@ -422,6 +421,9 @@ message JobStatus { optional UncountedTerminatedPods uncountedTerminatedPods = 8; // The number of pods which have a Ready condition. + // + // This field is beta-level. The job controller populates the field when + // the feature gate JobReadyPods is enabled (enabled by default). // +optional optional int32 ready = 9; } @@ -510,8 +512,8 @@ message PodFailurePolicyRule { // running pods are terminated. // - FailIndex: indicates that the pod's index is marked as Failed and will // not be restarted. - // This value is beta-level. It can be used when the - // `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). + // This value is alpha-level. It can be used when the + // `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default). // - Ignore: indicates that the counter towards the .backoffLimit is not // incremented and a replacement pod is created. // - Count: indicates that the pod is handled in the default way - the diff --git a/upstream/vendor/k8s.io/api/batch/v1/types.go b/upstream/vendor/k8s.io/api/batch/v1/types.go index 53fdf3c8d01..8a28614c0b4 100644 --- a/upstream/vendor/k8s.io/api/batch/v1/types.go +++ b/upstream/vendor/k8s.io/api/batch/v1/types.go @@ -124,7 +124,6 @@ const ( // This is an action which might be taken on a pod failure - mark the // Job's index as failed to avoid restarts within this index. This action // can only be used when backoffLimitPerIndex is set. - // This value is beta-level. PodFailurePolicyActionFailIndex PodFailurePolicyAction = "FailIndex" // This is an action which might be taken on a pod failure - the counter towards @@ -219,8 +218,8 @@ type PodFailurePolicyRule struct { // running pods are terminated. // - FailIndex: indicates that the pod's index is marked as Failed and will // not be restarted. - // This value is beta-level. It can be used when the - // `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). + // This value is alpha-level. It can be used when the + // `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default). // - Ignore: indicates that the counter towards the .backoffLimit is not // incremented and a replacement pod is created. // - Count: indicates that the pod is handled in the default way - the @@ -304,8 +303,8 @@ type JobSpec struct { // batch.kubernetes.io/job-index-failure-count annotation. It can only // be set when Job's completionMode=Indexed, and the Pod's restart // policy is Never. The field is immutable. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty" protobuf:"varint,12,opt,name=backoffLimitPerIndex"` @@ -317,8 +316,8 @@ type JobSpec struct { // It can only be specified when backoffLimitPerIndex is set. // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty" protobuf:"varint,13,opt,name=maxFailedIndexes"` @@ -406,8 +405,7 @@ type JobSpec struct { // // When using podFailurePolicy, Failed is the the only allowed value. // TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. - // This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. - // This is on by default. + // This is an alpha field. Enable JobPodReplacementPolicy to be able to use this field. // +optional PodReplacementPolicy *PodReplacementPolicy `json:"podReplacementPolicy,omitempty" protobuf:"bytes,14,opt,name=podReplacementPolicy,casttype=podReplacementPolicy"` } @@ -456,8 +454,8 @@ type JobStatus struct { // The number of pods which are terminating (in phase Pending or Running // and have a deletionTimestamp). // - // This field is beta-level. The job controller populates the field when - // the feature gate JobPodReplacementPolicy is enabled (enabled by default). + // This field is alpha-level. The job controller populates the field when + // the feature gate JobPodReplacementPolicy is enabled (disabled by default). // +optional Terminating *int32 `json:"terminating,omitempty" protobuf:"varint,11,opt,name=terminating"` @@ -479,8 +477,8 @@ type JobStatus struct { // last element of the series, separated by a hyphen. // For example, if the failed indexes are 1, 3, 4, 5 and 7, they are // represented as "1,3-5,7". - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). + // This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` + // feature gate is enabled (disabled by default). // +optional FailedIndexes *string `json:"failedIndexes,omitempty" protobuf:"bytes,10,opt,name=failedIndexes"` @@ -502,6 +500,9 @@ type JobStatus struct { UncountedTerminatedPods *UncountedTerminatedPods `json:"uncountedTerminatedPods,omitempty" protobuf:"bytes,8,opt,name=uncountedTerminatedPods"` // The number of pods which have a Ready condition. + // + // This field is beta-level. The job controller populates the field when + // the feature gate JobReadyPods is enabled (enabled by default). // +optional Ready *int32 `json:"ready,omitempty" protobuf:"varint,9,opt,name=ready"` } @@ -534,25 +535,6 @@ const ( JobFailureTarget JobConditionType = "FailureTarget" ) -const ( - // JobReasonPodFailurePolicy reason indicates a job failure condition is added due to - // a failed pod matching a pod failure policy rule - // https://kep.k8s.io/3329 - // This is currently a beta field. - JobReasonPodFailurePolicy string = "PodFailurePolicy" - // JobReasonBackOffLimitExceeded reason indicates that pods within a job have failed a number of - // times higher than backOffLimit times. - JobReasonBackoffLimitExceeded string = "BackoffLimitExceeded" - // JobReasponDeadlineExceeded means job duration is past ActiveDeadline - JobReasonDeadlineExceeded string = "DeadlineExceeded" - // JobReasonMaxFailedIndexesExceeded indicates that an indexed of a job failed - // This const is used in beta-level feature: https://kep.k8s.io/3850. - JobReasonMaxFailedIndexesExceeded string = "MaxFailedIndexesExceeded" - // JobReasonFailedIndexes means Job has failed indexes. - // This const is used in beta-level feature: https://kep.k8s.io/3850. - JobReasonFailedIndexes string = "FailedIndexes" -) - // JobCondition describes current state of a job. type JobCondition struct { // Type of job condition, Complete or Failed. diff --git a/upstream/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go index 980f1e47505..43b4e1e7d94 100644 --- a/upstream/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -117,15 +117,15 @@ var map_JobSpec = map[string]string{ "activeDeadlineSeconds": "Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.", "podFailurePolicy": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.\n\nThis field is beta-level. It can be used when the `JobPodFailurePolicy` feature gate is enabled (enabled by default).", "backoffLimit": "Specifies the number of retries before marking this job failed. Defaults to 6", - "backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", - "maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).", + "maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).", "selector": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "manualSelector": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", "template": "Describes the pod that will be created when executing a job. The only allowed template.spec.restartPolicy values are \"Never\" or \"OnFailure\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "ttlSecondsAfterFinished": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.", "completionMode": "completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nMore completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job.", "suspend": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.", - "podReplacementPolicy": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. This is on by default.", + "podReplacementPolicy": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an alpha field. Enable JobPodReplacementPolicy to be able to use this field.", } func (JobSpec) SwaggerDoc() map[string]string { @@ -140,11 +140,11 @@ var map_JobStatus = map[string]string{ "active": "The number of pending and running pods.", "succeeded": "The number of pods which reached phase Succeeded.", "failed": "The number of pods which reached phase Failed.", - "terminating": "The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).\n\nThis field is beta-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (enabled by default).", + "terminating": "The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).\n\nThis field is alpha-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (disabled by default).", "completedIndexes": "completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".", - "failedIndexes": "FailedIndexes holds the failed indexes when backoffLimitPerIndex=true. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "failedIndexes": "FailedIndexes holds the failed indexes when backoffLimitPerIndex=true. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).", "uncountedTerminatedPods": "uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status:\n\n1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nOld jobs might not be tracked using this field, in which case the field remains null.", - "ready": "The number of pods which have a Ready condition.", + "ready": "The number of pods which have a Ready condition.\n\nThis field is beta-level. The job controller populates the field when the feature gate JobReadyPods is enabled (enabled by default).", } func (JobStatus) SwaggerDoc() map[string]string { @@ -193,7 +193,7 @@ func (PodFailurePolicyOnPodConditionsPattern) SwaggerDoc() map[string]string { var map_PodFailurePolicyRule = map[string]string{ "": "PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.", - "action": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n This value is beta-level. It can be used when the\n `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", + "action": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n This value is alpha-level. It can be used when the\n `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default).\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", "onExitCodes": "Represents the requirement on the container exit codes.", "onPodConditions": "Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.", } diff --git a/upstream/vendor/k8s.io/api/core/v1/generated.pb.go b/upstream/vendor/k8s.io/api/core/v1/generated.pb.go index 04c7939e0d5..c267a5febde 100644 --- a/upstream/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/upstream/vendor/k8s.io/api/core/v1/generated.pb.go @@ -525,38 +525,10 @@ func (m *ClientIPConfig) XXX_DiscardUnknown() { var xxx_messageInfo_ClientIPConfig proto.InternalMessageInfo -func (m *ClusterTrustBundleProjection) Reset() { *m = ClusterTrustBundleProjection{} } -func (*ClusterTrustBundleProjection) ProtoMessage() {} -func (*ClusterTrustBundleProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{17} -} -func (m *ClusterTrustBundleProjection) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterTrustBundleProjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ClusterTrustBundleProjection) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterTrustBundleProjection.Merge(m, src) -} -func (m *ClusterTrustBundleProjection) XXX_Size() int { - return m.Size() -} -func (m *ClusterTrustBundleProjection) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterTrustBundleProjection.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterTrustBundleProjection proto.InternalMessageInfo - func (m *ComponentCondition) Reset() { *m = ComponentCondition{} } func (*ComponentCondition) ProtoMessage() {} func (*ComponentCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{18} + return fileDescriptor_83c10c24ec417dc9, []int{17} } func (m *ComponentCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -584,7 +556,7 @@ var xxx_messageInfo_ComponentCondition proto.InternalMessageInfo func (m *ComponentStatus) Reset() { *m = ComponentStatus{} } func (*ComponentStatus) ProtoMessage() {} func (*ComponentStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{19} + return fileDescriptor_83c10c24ec417dc9, []int{18} } func (m *ComponentStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -612,7 +584,7 @@ var xxx_messageInfo_ComponentStatus proto.InternalMessageInfo func (m *ComponentStatusList) Reset() { *m = ComponentStatusList{} } func (*ComponentStatusList) ProtoMessage() {} func (*ComponentStatusList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{20} + return fileDescriptor_83c10c24ec417dc9, []int{19} } func (m *ComponentStatusList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -640,7 +612,7 @@ var xxx_messageInfo_ComponentStatusList proto.InternalMessageInfo func (m *ConfigMap) Reset() { *m = ConfigMap{} } func (*ConfigMap) ProtoMessage() {} func (*ConfigMap) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{21} + return fileDescriptor_83c10c24ec417dc9, []int{20} } func (m *ConfigMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -668,7 +640,7 @@ var xxx_messageInfo_ConfigMap proto.InternalMessageInfo func (m *ConfigMapEnvSource) Reset() { *m = ConfigMapEnvSource{} } func (*ConfigMapEnvSource) ProtoMessage() {} func (*ConfigMapEnvSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{22} + return fileDescriptor_83c10c24ec417dc9, []int{21} } func (m *ConfigMapEnvSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,7 +668,7 @@ var xxx_messageInfo_ConfigMapEnvSource proto.InternalMessageInfo func (m *ConfigMapKeySelector) Reset() { *m = ConfigMapKeySelector{} } func (*ConfigMapKeySelector) ProtoMessage() {} func (*ConfigMapKeySelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{23} + return fileDescriptor_83c10c24ec417dc9, []int{22} } func (m *ConfigMapKeySelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -724,7 +696,7 @@ var xxx_messageInfo_ConfigMapKeySelector proto.InternalMessageInfo func (m *ConfigMapList) Reset() { *m = ConfigMapList{} } func (*ConfigMapList) ProtoMessage() {} func (*ConfigMapList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{24} + return fileDescriptor_83c10c24ec417dc9, []int{23} } func (m *ConfigMapList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +724,7 @@ var xxx_messageInfo_ConfigMapList proto.InternalMessageInfo func (m *ConfigMapNodeConfigSource) Reset() { *m = ConfigMapNodeConfigSource{} } func (*ConfigMapNodeConfigSource) ProtoMessage() {} func (*ConfigMapNodeConfigSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{25} + return fileDescriptor_83c10c24ec417dc9, []int{24} } func (m *ConfigMapNodeConfigSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -780,7 +752,7 @@ var xxx_messageInfo_ConfigMapNodeConfigSource proto.InternalMessageInfo func (m *ConfigMapProjection) Reset() { *m = ConfigMapProjection{} } func (*ConfigMapProjection) ProtoMessage() {} func (*ConfigMapProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{26} + return fileDescriptor_83c10c24ec417dc9, []int{25} } func (m *ConfigMapProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -808,7 +780,7 @@ var xxx_messageInfo_ConfigMapProjection proto.InternalMessageInfo func (m *ConfigMapVolumeSource) Reset() { *m = ConfigMapVolumeSource{} } func (*ConfigMapVolumeSource) ProtoMessage() {} func (*ConfigMapVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{27} + return fileDescriptor_83c10c24ec417dc9, []int{26} } func (m *ConfigMapVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +808,7 @@ var xxx_messageInfo_ConfigMapVolumeSource proto.InternalMessageInfo func (m *Container) Reset() { *m = Container{} } func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{28} + return fileDescriptor_83c10c24ec417dc9, []int{27} } func (m *Container) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -864,7 +836,7 @@ var xxx_messageInfo_Container proto.InternalMessageInfo func (m *ContainerImage) Reset() { *m = ContainerImage{} } func (*ContainerImage) ProtoMessage() {} func (*ContainerImage) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{29} + return fileDescriptor_83c10c24ec417dc9, []int{28} } func (m *ContainerImage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -892,7 +864,7 @@ var xxx_messageInfo_ContainerImage proto.InternalMessageInfo func (m *ContainerPort) Reset() { *m = ContainerPort{} } func (*ContainerPort) ProtoMessage() {} func (*ContainerPort) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{30} + return fileDescriptor_83c10c24ec417dc9, []int{29} } func (m *ContainerPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -920,7 +892,7 @@ var xxx_messageInfo_ContainerPort proto.InternalMessageInfo func (m *ContainerResizePolicy) Reset() { *m = ContainerResizePolicy{} } func (*ContainerResizePolicy) ProtoMessage() {} func (*ContainerResizePolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{31} + return fileDescriptor_83c10c24ec417dc9, []int{30} } func (m *ContainerResizePolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -948,7 +920,7 @@ var xxx_messageInfo_ContainerResizePolicy proto.InternalMessageInfo func (m *ContainerState) Reset() { *m = ContainerState{} } func (*ContainerState) ProtoMessage() {} func (*ContainerState) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{32} + return fileDescriptor_83c10c24ec417dc9, []int{31} } func (m *ContainerState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -976,7 +948,7 @@ var xxx_messageInfo_ContainerState proto.InternalMessageInfo func (m *ContainerStateRunning) Reset() { *m = ContainerStateRunning{} } func (*ContainerStateRunning) ProtoMessage() {} func (*ContainerStateRunning) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{33} + return fileDescriptor_83c10c24ec417dc9, []int{32} } func (m *ContainerStateRunning) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1004,7 +976,7 @@ var xxx_messageInfo_ContainerStateRunning proto.InternalMessageInfo func (m *ContainerStateTerminated) Reset() { *m = ContainerStateTerminated{} } func (*ContainerStateTerminated) ProtoMessage() {} func (*ContainerStateTerminated) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{34} + return fileDescriptor_83c10c24ec417dc9, []int{33} } func (m *ContainerStateTerminated) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1032,7 +1004,7 @@ var xxx_messageInfo_ContainerStateTerminated proto.InternalMessageInfo func (m *ContainerStateWaiting) Reset() { *m = ContainerStateWaiting{} } func (*ContainerStateWaiting) ProtoMessage() {} func (*ContainerStateWaiting) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{35} + return fileDescriptor_83c10c24ec417dc9, []int{34} } func (m *ContainerStateWaiting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1060,7 +1032,7 @@ var xxx_messageInfo_ContainerStateWaiting proto.InternalMessageInfo func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } func (*ContainerStatus) ProtoMessage() {} func (*ContainerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{36} + return fileDescriptor_83c10c24ec417dc9, []int{35} } func (m *ContainerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1088,7 +1060,7 @@ var xxx_messageInfo_ContainerStatus proto.InternalMessageInfo func (m *DaemonEndpoint) Reset() { *m = DaemonEndpoint{} } func (*DaemonEndpoint) ProtoMessage() {} func (*DaemonEndpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{37} + return fileDescriptor_83c10c24ec417dc9, []int{36} } func (m *DaemonEndpoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1116,7 +1088,7 @@ var xxx_messageInfo_DaemonEndpoint proto.InternalMessageInfo func (m *DownwardAPIProjection) Reset() { *m = DownwardAPIProjection{} } func (*DownwardAPIProjection) ProtoMessage() {} func (*DownwardAPIProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{38} + return fileDescriptor_83c10c24ec417dc9, []int{37} } func (m *DownwardAPIProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1144,7 +1116,7 @@ var xxx_messageInfo_DownwardAPIProjection proto.InternalMessageInfo func (m *DownwardAPIVolumeFile) Reset() { *m = DownwardAPIVolumeFile{} } func (*DownwardAPIVolumeFile) ProtoMessage() {} func (*DownwardAPIVolumeFile) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{39} + return fileDescriptor_83c10c24ec417dc9, []int{38} } func (m *DownwardAPIVolumeFile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1172,7 +1144,7 @@ var xxx_messageInfo_DownwardAPIVolumeFile proto.InternalMessageInfo func (m *DownwardAPIVolumeSource) Reset() { *m = DownwardAPIVolumeSource{} } func (*DownwardAPIVolumeSource) ProtoMessage() {} func (*DownwardAPIVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{40} + return fileDescriptor_83c10c24ec417dc9, []int{39} } func (m *DownwardAPIVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1200,7 +1172,7 @@ var xxx_messageInfo_DownwardAPIVolumeSource proto.InternalMessageInfo func (m *EmptyDirVolumeSource) Reset() { *m = EmptyDirVolumeSource{} } func (*EmptyDirVolumeSource) ProtoMessage() {} func (*EmptyDirVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{41} + return fileDescriptor_83c10c24ec417dc9, []int{40} } func (m *EmptyDirVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1228,7 +1200,7 @@ var xxx_messageInfo_EmptyDirVolumeSource proto.InternalMessageInfo func (m *EndpointAddress) Reset() { *m = EndpointAddress{} } func (*EndpointAddress) ProtoMessage() {} func (*EndpointAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{42} + return fileDescriptor_83c10c24ec417dc9, []int{41} } func (m *EndpointAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1256,7 +1228,7 @@ var xxx_messageInfo_EndpointAddress proto.InternalMessageInfo func (m *EndpointPort) Reset() { *m = EndpointPort{} } func (*EndpointPort) ProtoMessage() {} func (*EndpointPort) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{43} + return fileDescriptor_83c10c24ec417dc9, []int{42} } func (m *EndpointPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1284,7 +1256,7 @@ var xxx_messageInfo_EndpointPort proto.InternalMessageInfo func (m *EndpointSubset) Reset() { *m = EndpointSubset{} } func (*EndpointSubset) ProtoMessage() {} func (*EndpointSubset) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{44} + return fileDescriptor_83c10c24ec417dc9, []int{43} } func (m *EndpointSubset) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1312,7 +1284,7 @@ var xxx_messageInfo_EndpointSubset proto.InternalMessageInfo func (m *Endpoints) Reset() { *m = Endpoints{} } func (*Endpoints) ProtoMessage() {} func (*Endpoints) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{45} + return fileDescriptor_83c10c24ec417dc9, []int{44} } func (m *Endpoints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1340,7 +1312,7 @@ var xxx_messageInfo_Endpoints proto.InternalMessageInfo func (m *EndpointsList) Reset() { *m = EndpointsList{} } func (*EndpointsList) ProtoMessage() {} func (*EndpointsList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{46} + return fileDescriptor_83c10c24ec417dc9, []int{45} } func (m *EndpointsList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1368,7 +1340,7 @@ var xxx_messageInfo_EndpointsList proto.InternalMessageInfo func (m *EnvFromSource) Reset() { *m = EnvFromSource{} } func (*EnvFromSource) ProtoMessage() {} func (*EnvFromSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{47} + return fileDescriptor_83c10c24ec417dc9, []int{46} } func (m *EnvFromSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1396,7 +1368,7 @@ var xxx_messageInfo_EnvFromSource proto.InternalMessageInfo func (m *EnvVar) Reset() { *m = EnvVar{} } func (*EnvVar) ProtoMessage() {} func (*EnvVar) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{48} + return fileDescriptor_83c10c24ec417dc9, []int{47} } func (m *EnvVar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1424,7 +1396,7 @@ var xxx_messageInfo_EnvVar proto.InternalMessageInfo func (m *EnvVarSource) Reset() { *m = EnvVarSource{} } func (*EnvVarSource) ProtoMessage() {} func (*EnvVarSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{49} + return fileDescriptor_83c10c24ec417dc9, []int{48} } func (m *EnvVarSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1452,7 +1424,7 @@ var xxx_messageInfo_EnvVarSource proto.InternalMessageInfo func (m *EphemeralContainer) Reset() { *m = EphemeralContainer{} } func (*EphemeralContainer) ProtoMessage() {} func (*EphemeralContainer) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{50} + return fileDescriptor_83c10c24ec417dc9, []int{49} } func (m *EphemeralContainer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1480,7 +1452,7 @@ var xxx_messageInfo_EphemeralContainer proto.InternalMessageInfo func (m *EphemeralContainerCommon) Reset() { *m = EphemeralContainerCommon{} } func (*EphemeralContainerCommon) ProtoMessage() {} func (*EphemeralContainerCommon) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{51} + return fileDescriptor_83c10c24ec417dc9, []int{50} } func (m *EphemeralContainerCommon) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1508,7 +1480,7 @@ var xxx_messageInfo_EphemeralContainerCommon proto.InternalMessageInfo func (m *EphemeralVolumeSource) Reset() { *m = EphemeralVolumeSource{} } func (*EphemeralVolumeSource) ProtoMessage() {} func (*EphemeralVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{52} + return fileDescriptor_83c10c24ec417dc9, []int{51} } func (m *EphemeralVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1536,7 +1508,7 @@ var xxx_messageInfo_EphemeralVolumeSource proto.InternalMessageInfo func (m *Event) Reset() { *m = Event{} } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{53} + return fileDescriptor_83c10c24ec417dc9, []int{52} } func (m *Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1564,7 +1536,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo func (m *EventList) Reset() { *m = EventList{} } func (*EventList) ProtoMessage() {} func (*EventList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{54} + return fileDescriptor_83c10c24ec417dc9, []int{53} } func (m *EventList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1592,7 +1564,7 @@ var xxx_messageInfo_EventList proto.InternalMessageInfo func (m *EventSeries) Reset() { *m = EventSeries{} } func (*EventSeries) ProtoMessage() {} func (*EventSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{55} + return fileDescriptor_83c10c24ec417dc9, []int{54} } func (m *EventSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1620,7 +1592,7 @@ var xxx_messageInfo_EventSeries proto.InternalMessageInfo func (m *EventSource) Reset() { *m = EventSource{} } func (*EventSource) ProtoMessage() {} func (*EventSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{56} + return fileDescriptor_83c10c24ec417dc9, []int{55} } func (m *EventSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1648,7 +1620,7 @@ var xxx_messageInfo_EventSource proto.InternalMessageInfo func (m *ExecAction) Reset() { *m = ExecAction{} } func (*ExecAction) ProtoMessage() {} func (*ExecAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{57} + return fileDescriptor_83c10c24ec417dc9, []int{56} } func (m *ExecAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1676,7 +1648,7 @@ var xxx_messageInfo_ExecAction proto.InternalMessageInfo func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} } func (*FCVolumeSource) ProtoMessage() {} func (*FCVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{58} + return fileDescriptor_83c10c24ec417dc9, []int{57} } func (m *FCVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1704,7 +1676,7 @@ var xxx_messageInfo_FCVolumeSource proto.InternalMessageInfo func (m *FlexPersistentVolumeSource) Reset() { *m = FlexPersistentVolumeSource{} } func (*FlexPersistentVolumeSource) ProtoMessage() {} func (*FlexPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{59} + return fileDescriptor_83c10c24ec417dc9, []int{58} } func (m *FlexPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1732,7 +1704,7 @@ var xxx_messageInfo_FlexPersistentVolumeSource proto.InternalMessageInfo func (m *FlexVolumeSource) Reset() { *m = FlexVolumeSource{} } func (*FlexVolumeSource) ProtoMessage() {} func (*FlexVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{60} + return fileDescriptor_83c10c24ec417dc9, []int{59} } func (m *FlexVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1760,7 +1732,7 @@ var xxx_messageInfo_FlexVolumeSource proto.InternalMessageInfo func (m *FlockerVolumeSource) Reset() { *m = FlockerVolumeSource{} } func (*FlockerVolumeSource) ProtoMessage() {} func (*FlockerVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{61} + return fileDescriptor_83c10c24ec417dc9, []int{60} } func (m *FlockerVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1788,7 +1760,7 @@ var xxx_messageInfo_FlockerVolumeSource proto.InternalMessageInfo func (m *GCEPersistentDiskVolumeSource) Reset() { *m = GCEPersistentDiskVolumeSource{} } func (*GCEPersistentDiskVolumeSource) ProtoMessage() {} func (*GCEPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{62} + return fileDescriptor_83c10c24ec417dc9, []int{61} } func (m *GCEPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1816,7 +1788,7 @@ var xxx_messageInfo_GCEPersistentDiskVolumeSource proto.InternalMessageInfo func (m *GRPCAction) Reset() { *m = GRPCAction{} } func (*GRPCAction) ProtoMessage() {} func (*GRPCAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{63} + return fileDescriptor_83c10c24ec417dc9, []int{62} } func (m *GRPCAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1844,7 +1816,7 @@ var xxx_messageInfo_GRPCAction proto.InternalMessageInfo func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSource{} } func (*GitRepoVolumeSource) ProtoMessage() {} func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{64} + return fileDescriptor_83c10c24ec417dc9, []int{63} } func (m *GitRepoVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1872,7 +1844,7 @@ var xxx_messageInfo_GitRepoVolumeSource proto.InternalMessageInfo func (m *GlusterfsPersistentVolumeSource) Reset() { *m = GlusterfsPersistentVolumeSource{} } func (*GlusterfsPersistentVolumeSource) ProtoMessage() {} func (*GlusterfsPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{65} + return fileDescriptor_83c10c24ec417dc9, []int{64} } func (m *GlusterfsPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1900,7 +1872,7 @@ var xxx_messageInfo_GlusterfsPersistentVolumeSource proto.InternalMessageInfo func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} } func (*GlusterfsVolumeSource) ProtoMessage() {} func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{66} + return fileDescriptor_83c10c24ec417dc9, []int{65} } func (m *GlusterfsVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1928,7 +1900,7 @@ var xxx_messageInfo_GlusterfsVolumeSource proto.InternalMessageInfo func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} } func (*HTTPGetAction) ProtoMessage() {} func (*HTTPGetAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{67} + return fileDescriptor_83c10c24ec417dc9, []int{66} } func (m *HTTPGetAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1956,7 +1928,7 @@ var xxx_messageInfo_HTTPGetAction proto.InternalMessageInfo func (m *HTTPHeader) Reset() { *m = HTTPHeader{} } func (*HTTPHeader) ProtoMessage() {} func (*HTTPHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{68} + return fileDescriptor_83c10c24ec417dc9, []int{67} } func (m *HTTPHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1984,7 +1956,7 @@ var xxx_messageInfo_HTTPHeader proto.InternalMessageInfo func (m *HostAlias) Reset() { *m = HostAlias{} } func (*HostAlias) ProtoMessage() {} func (*HostAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{69} + return fileDescriptor_83c10c24ec417dc9, []int{68} } func (m *HostAlias) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2012,7 +1984,7 @@ var xxx_messageInfo_HostAlias proto.InternalMessageInfo func (m *HostIP) Reset() { *m = HostIP{} } func (*HostIP) ProtoMessage() {} func (*HostIP) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{70} + return fileDescriptor_83c10c24ec417dc9, []int{69} } func (m *HostIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2040,7 +2012,7 @@ var xxx_messageInfo_HostIP proto.InternalMessageInfo func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} } func (*HostPathVolumeSource) ProtoMessage() {} func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{71} + return fileDescriptor_83c10c24ec417dc9, []int{70} } func (m *HostPathVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2068,7 +2040,7 @@ var xxx_messageInfo_HostPathVolumeSource proto.InternalMessageInfo func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} } func (*ISCSIPersistentVolumeSource) ProtoMessage() {} func (*ISCSIPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{72} + return fileDescriptor_83c10c24ec417dc9, []int{71} } func (m *ISCSIPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2096,7 +2068,7 @@ var xxx_messageInfo_ISCSIPersistentVolumeSource proto.InternalMessageInfo func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} } func (*ISCSIVolumeSource) ProtoMessage() {} func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{73} + return fileDescriptor_83c10c24ec417dc9, []int{72} } func (m *ISCSIVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2124,7 +2096,7 @@ var xxx_messageInfo_ISCSIVolumeSource proto.InternalMessageInfo func (m *KeyToPath) Reset() { *m = KeyToPath{} } func (*KeyToPath) ProtoMessage() {} func (*KeyToPath) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{74} + return fileDescriptor_83c10c24ec417dc9, []int{73} } func (m *KeyToPath) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2152,7 +2124,7 @@ var xxx_messageInfo_KeyToPath proto.InternalMessageInfo func (m *Lifecycle) Reset() { *m = Lifecycle{} } func (*Lifecycle) ProtoMessage() {} func (*Lifecycle) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{75} + return fileDescriptor_83c10c24ec417dc9, []int{74} } func (m *Lifecycle) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2180,7 +2152,7 @@ var xxx_messageInfo_Lifecycle proto.InternalMessageInfo func (m *LifecycleHandler) Reset() { *m = LifecycleHandler{} } func (*LifecycleHandler) ProtoMessage() {} func (*LifecycleHandler) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{76} + return fileDescriptor_83c10c24ec417dc9, []int{75} } func (m *LifecycleHandler) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2208,7 +2180,7 @@ var xxx_messageInfo_LifecycleHandler proto.InternalMessageInfo func (m *LimitRange) Reset() { *m = LimitRange{} } func (*LimitRange) ProtoMessage() {} func (*LimitRange) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{77} + return fileDescriptor_83c10c24ec417dc9, []int{76} } func (m *LimitRange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2236,7 +2208,7 @@ var xxx_messageInfo_LimitRange proto.InternalMessageInfo func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} } func (*LimitRangeItem) ProtoMessage() {} func (*LimitRangeItem) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{78} + return fileDescriptor_83c10c24ec417dc9, []int{77} } func (m *LimitRangeItem) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2264,7 +2236,7 @@ var xxx_messageInfo_LimitRangeItem proto.InternalMessageInfo func (m *LimitRangeList) Reset() { *m = LimitRangeList{} } func (*LimitRangeList) ProtoMessage() {} func (*LimitRangeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{79} + return fileDescriptor_83c10c24ec417dc9, []int{78} } func (m *LimitRangeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2292,7 +2264,7 @@ var xxx_messageInfo_LimitRangeList proto.InternalMessageInfo func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} } func (*LimitRangeSpec) ProtoMessage() {} func (*LimitRangeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{80} + return fileDescriptor_83c10c24ec417dc9, []int{79} } func (m *LimitRangeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2320,7 +2292,7 @@ var xxx_messageInfo_LimitRangeSpec proto.InternalMessageInfo func (m *List) Reset() { *m = List{} } func (*List) ProtoMessage() {} func (*List) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{81} + return fileDescriptor_83c10c24ec417dc9, []int{80} } func (m *List) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2348,7 +2320,7 @@ var xxx_messageInfo_List proto.InternalMessageInfo func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} } func (*LoadBalancerIngress) ProtoMessage() {} func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{82} + return fileDescriptor_83c10c24ec417dc9, []int{81} } func (m *LoadBalancerIngress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2376,7 +2348,7 @@ var xxx_messageInfo_LoadBalancerIngress proto.InternalMessageInfo func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} } func (*LoadBalancerStatus) ProtoMessage() {} func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{83} + return fileDescriptor_83c10c24ec417dc9, []int{82} } func (m *LoadBalancerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2404,7 +2376,7 @@ var xxx_messageInfo_LoadBalancerStatus proto.InternalMessageInfo func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} } func (*LocalObjectReference) ProtoMessage() {} func (*LocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{84} + return fileDescriptor_83c10c24ec417dc9, []int{83} } func (m *LocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2432,7 +2404,7 @@ var xxx_messageInfo_LocalObjectReference proto.InternalMessageInfo func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} } func (*LocalVolumeSource) ProtoMessage() {} func (*LocalVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{85} + return fileDescriptor_83c10c24ec417dc9, []int{84} } func (m *LocalVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2457,38 +2429,10 @@ func (m *LocalVolumeSource) XXX_DiscardUnknown() { var xxx_messageInfo_LocalVolumeSource proto.InternalMessageInfo -func (m *ModifyVolumeStatus) Reset() { *m = ModifyVolumeStatus{} } -func (*ModifyVolumeStatus) ProtoMessage() {} -func (*ModifyVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{86} -} -func (m *ModifyVolumeStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ModifyVolumeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ModifyVolumeStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyVolumeStatus.Merge(m, src) -} -func (m *ModifyVolumeStatus) XXX_Size() int { - return m.Size() -} -func (m *ModifyVolumeStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyVolumeStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyVolumeStatus proto.InternalMessageInfo - func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} } func (*NFSVolumeSource) ProtoMessage() {} func (*NFSVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{87} + return fileDescriptor_83c10c24ec417dc9, []int{85} } func (m *NFSVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2516,7 +2460,7 @@ var xxx_messageInfo_NFSVolumeSource proto.InternalMessageInfo func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} func (*Namespace) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{88} + return fileDescriptor_83c10c24ec417dc9, []int{86} } func (m *Namespace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2544,7 +2488,7 @@ var xxx_messageInfo_Namespace proto.InternalMessageInfo func (m *NamespaceCondition) Reset() { *m = NamespaceCondition{} } func (*NamespaceCondition) ProtoMessage() {} func (*NamespaceCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{89} + return fileDescriptor_83c10c24ec417dc9, []int{87} } func (m *NamespaceCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2572,7 +2516,7 @@ var xxx_messageInfo_NamespaceCondition proto.InternalMessageInfo func (m *NamespaceList) Reset() { *m = NamespaceList{} } func (*NamespaceList) ProtoMessage() {} func (*NamespaceList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{90} + return fileDescriptor_83c10c24ec417dc9, []int{88} } func (m *NamespaceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2600,7 +2544,7 @@ var xxx_messageInfo_NamespaceList proto.InternalMessageInfo func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} } func (*NamespaceSpec) ProtoMessage() {} func (*NamespaceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{91} + return fileDescriptor_83c10c24ec417dc9, []int{89} } func (m *NamespaceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2628,7 +2572,7 @@ var xxx_messageInfo_NamespaceSpec proto.InternalMessageInfo func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} } func (*NamespaceStatus) ProtoMessage() {} func (*NamespaceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{92} + return fileDescriptor_83c10c24ec417dc9, []int{90} } func (m *NamespaceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2656,7 +2600,7 @@ var xxx_messageInfo_NamespaceStatus proto.InternalMessageInfo func (m *Node) Reset() { *m = Node{} } func (*Node) ProtoMessage() {} func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{93} + return fileDescriptor_83c10c24ec417dc9, []int{91} } func (m *Node) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2684,7 +2628,7 @@ var xxx_messageInfo_Node proto.InternalMessageInfo func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (*NodeAddress) ProtoMessage() {} func (*NodeAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{94} + return fileDescriptor_83c10c24ec417dc9, []int{92} } func (m *NodeAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2712,7 +2656,7 @@ var xxx_messageInfo_NodeAddress proto.InternalMessageInfo func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } func (*NodeAffinity) ProtoMessage() {} func (*NodeAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{95} + return fileDescriptor_83c10c24ec417dc9, []int{93} } func (m *NodeAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2740,7 +2684,7 @@ var xxx_messageInfo_NodeAffinity proto.InternalMessageInfo func (m *NodeCondition) Reset() { *m = NodeCondition{} } func (*NodeCondition) ProtoMessage() {} func (*NodeCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{96} + return fileDescriptor_83c10c24ec417dc9, []int{94} } func (m *NodeCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2768,7 +2712,7 @@ var xxx_messageInfo_NodeCondition proto.InternalMessageInfo func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} } func (*NodeConfigSource) ProtoMessage() {} func (*NodeConfigSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{97} + return fileDescriptor_83c10c24ec417dc9, []int{95} } func (m *NodeConfigSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2796,7 +2740,7 @@ var xxx_messageInfo_NodeConfigSource proto.InternalMessageInfo func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} } func (*NodeConfigStatus) ProtoMessage() {} func (*NodeConfigStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{98} + return fileDescriptor_83c10c24ec417dc9, []int{96} } func (m *NodeConfigStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2824,7 +2768,7 @@ var xxx_messageInfo_NodeConfigStatus proto.InternalMessageInfo func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} } func (*NodeDaemonEndpoints) ProtoMessage() {} func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{99} + return fileDescriptor_83c10c24ec417dc9, []int{97} } func (m *NodeDaemonEndpoints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2852,7 +2796,7 @@ var xxx_messageInfo_NodeDaemonEndpoints proto.InternalMessageInfo func (m *NodeList) Reset() { *m = NodeList{} } func (*NodeList) ProtoMessage() {} func (*NodeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{100} + return fileDescriptor_83c10c24ec417dc9, []int{98} } func (m *NodeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2880,7 +2824,7 @@ var xxx_messageInfo_NodeList proto.InternalMessageInfo func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} } func (*NodeProxyOptions) ProtoMessage() {} func (*NodeProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{101} + return fileDescriptor_83c10c24ec417dc9, []int{99} } func (m *NodeProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2908,7 +2852,7 @@ var xxx_messageInfo_NodeProxyOptions proto.InternalMessageInfo func (m *NodeResources) Reset() { *m = NodeResources{} } func (*NodeResources) ProtoMessage() {} func (*NodeResources) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{102} + return fileDescriptor_83c10c24ec417dc9, []int{100} } func (m *NodeResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2936,7 +2880,7 @@ var xxx_messageInfo_NodeResources proto.InternalMessageInfo func (m *NodeSelector) Reset() { *m = NodeSelector{} } func (*NodeSelector) ProtoMessage() {} func (*NodeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{103} + return fileDescriptor_83c10c24ec417dc9, []int{101} } func (m *NodeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2964,7 +2908,7 @@ var xxx_messageInfo_NodeSelector proto.InternalMessageInfo func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} } func (*NodeSelectorRequirement) ProtoMessage() {} func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{104} + return fileDescriptor_83c10c24ec417dc9, []int{102} } func (m *NodeSelectorRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2992,7 +2936,7 @@ var xxx_messageInfo_NodeSelectorRequirement proto.InternalMessageInfo func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} } func (*NodeSelectorTerm) ProtoMessage() {} func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{105} + return fileDescriptor_83c10c24ec417dc9, []int{103} } func (m *NodeSelectorTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3020,7 +2964,7 @@ var xxx_messageInfo_NodeSelectorTerm proto.InternalMessageInfo func (m *NodeSpec) Reset() { *m = NodeSpec{} } func (*NodeSpec) ProtoMessage() {} func (*NodeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{106} + return fileDescriptor_83c10c24ec417dc9, []int{104} } func (m *NodeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3048,7 +2992,7 @@ var xxx_messageInfo_NodeSpec proto.InternalMessageInfo func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (*NodeStatus) ProtoMessage() {} func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{107} + return fileDescriptor_83c10c24ec417dc9, []int{105} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3076,7 +3020,7 @@ var xxx_messageInfo_NodeStatus proto.InternalMessageInfo func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} } func (*NodeSystemInfo) ProtoMessage() {} func (*NodeSystemInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{108} + return fileDescriptor_83c10c24ec417dc9, []int{106} } func (m *NodeSystemInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3104,7 +3048,7 @@ var xxx_messageInfo_NodeSystemInfo proto.InternalMessageInfo func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} } func (*ObjectFieldSelector) ProtoMessage() {} func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{109} + return fileDescriptor_83c10c24ec417dc9, []int{107} } func (m *ObjectFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3132,7 +3076,7 @@ var xxx_messageInfo_ObjectFieldSelector proto.InternalMessageInfo func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} func (*ObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{110} + return fileDescriptor_83c10c24ec417dc9, []int{108} } func (m *ObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3160,7 +3104,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo func (m *PersistentVolume) Reset() { *m = PersistentVolume{} } func (*PersistentVolume) ProtoMessage() {} func (*PersistentVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{111} + return fileDescriptor_83c10c24ec417dc9, []int{109} } func (m *PersistentVolume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3188,7 +3132,7 @@ var xxx_messageInfo_PersistentVolume proto.InternalMessageInfo func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} } func (*PersistentVolumeClaim) ProtoMessage() {} func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{112} + return fileDescriptor_83c10c24ec417dc9, []int{110} } func (m *PersistentVolumeClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3216,7 +3160,7 @@ var xxx_messageInfo_PersistentVolumeClaim proto.InternalMessageInfo func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} } func (*PersistentVolumeClaimCondition) ProtoMessage() {} func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{113} + return fileDescriptor_83c10c24ec417dc9, []int{111} } func (m *PersistentVolumeClaimCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3244,7 +3188,7 @@ var xxx_messageInfo_PersistentVolumeClaimCondition proto.InternalMessageInfo func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} } func (*PersistentVolumeClaimList) ProtoMessage() {} func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{114} + return fileDescriptor_83c10c24ec417dc9, []int{112} } func (m *PersistentVolumeClaimList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3272,7 +3216,7 @@ var xxx_messageInfo_PersistentVolumeClaimList proto.InternalMessageInfo func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} } func (*PersistentVolumeClaimSpec) ProtoMessage() {} func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{115} + return fileDescriptor_83c10c24ec417dc9, []int{113} } func (m *PersistentVolumeClaimSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3300,7 +3244,7 @@ var xxx_messageInfo_PersistentVolumeClaimSpec proto.InternalMessageInfo func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} } func (*PersistentVolumeClaimStatus) ProtoMessage() {} func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{116} + return fileDescriptor_83c10c24ec417dc9, []int{114} } func (m *PersistentVolumeClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3328,7 +3272,7 @@ var xxx_messageInfo_PersistentVolumeClaimStatus proto.InternalMessageInfo func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} } func (*PersistentVolumeClaimTemplate) ProtoMessage() {} func (*PersistentVolumeClaimTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{117} + return fileDescriptor_83c10c24ec417dc9, []int{115} } func (m *PersistentVolumeClaimTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3356,7 +3300,7 @@ var xxx_messageInfo_PersistentVolumeClaimTemplate proto.InternalMessageInfo func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} } func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{118} + return fileDescriptor_83c10c24ec417dc9, []int{116} } func (m *PersistentVolumeClaimVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3384,7 +3328,7 @@ var xxx_messageInfo_PersistentVolumeClaimVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} } func (*PersistentVolumeList) ProtoMessage() {} func (*PersistentVolumeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{119} + return fileDescriptor_83c10c24ec417dc9, []int{117} } func (m *PersistentVolumeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3412,7 +3356,7 @@ var xxx_messageInfo_PersistentVolumeList proto.InternalMessageInfo func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} } func (*PersistentVolumeSource) ProtoMessage() {} func (*PersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{120} + return fileDescriptor_83c10c24ec417dc9, []int{118} } func (m *PersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3440,7 +3384,7 @@ var xxx_messageInfo_PersistentVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} } func (*PersistentVolumeSpec) ProtoMessage() {} func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{121} + return fileDescriptor_83c10c24ec417dc9, []int{119} } func (m *PersistentVolumeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3468,7 +3412,7 @@ var xxx_messageInfo_PersistentVolumeSpec proto.InternalMessageInfo func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} } func (*PersistentVolumeStatus) ProtoMessage() {} func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{122} + return fileDescriptor_83c10c24ec417dc9, []int{120} } func (m *PersistentVolumeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3496,7 +3440,7 @@ var xxx_messageInfo_PersistentVolumeStatus proto.InternalMessageInfo func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} } func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{123} + return fileDescriptor_83c10c24ec417dc9, []int{121} } func (m *PhotonPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3524,7 +3468,7 @@ var xxx_messageInfo_PhotonPersistentDiskVolumeSource proto.InternalMessageInfo func (m *Pod) Reset() { *m = Pod{} } func (*Pod) ProtoMessage() {} func (*Pod) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{124} + return fileDescriptor_83c10c24ec417dc9, []int{122} } func (m *Pod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3552,7 +3496,7 @@ var xxx_messageInfo_Pod proto.InternalMessageInfo func (m *PodAffinity) Reset() { *m = PodAffinity{} } func (*PodAffinity) ProtoMessage() {} func (*PodAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{125} + return fileDescriptor_83c10c24ec417dc9, []int{123} } func (m *PodAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3580,7 +3524,7 @@ var xxx_messageInfo_PodAffinity proto.InternalMessageInfo func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} } func (*PodAffinityTerm) ProtoMessage() {} func (*PodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{126} + return fileDescriptor_83c10c24ec417dc9, []int{124} } func (m *PodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3608,7 +3552,7 @@ var xxx_messageInfo_PodAffinityTerm proto.InternalMessageInfo func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} } func (*PodAntiAffinity) ProtoMessage() {} func (*PodAntiAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{127} + return fileDescriptor_83c10c24ec417dc9, []int{125} } func (m *PodAntiAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3636,7 +3580,7 @@ var xxx_messageInfo_PodAntiAffinity proto.InternalMessageInfo func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} } func (*PodAttachOptions) ProtoMessage() {} func (*PodAttachOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{128} + return fileDescriptor_83c10c24ec417dc9, []int{126} } func (m *PodAttachOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3664,7 +3608,7 @@ var xxx_messageInfo_PodAttachOptions proto.InternalMessageInfo func (m *PodCondition) Reset() { *m = PodCondition{} } func (*PodCondition) ProtoMessage() {} func (*PodCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{129} + return fileDescriptor_83c10c24ec417dc9, []int{127} } func (m *PodCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3692,7 +3636,7 @@ var xxx_messageInfo_PodCondition proto.InternalMessageInfo func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} } func (*PodDNSConfig) ProtoMessage() {} func (*PodDNSConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{130} + return fileDescriptor_83c10c24ec417dc9, []int{128} } func (m *PodDNSConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3720,7 +3664,7 @@ var xxx_messageInfo_PodDNSConfig proto.InternalMessageInfo func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} } func (*PodDNSConfigOption) ProtoMessage() {} func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{131} + return fileDescriptor_83c10c24ec417dc9, []int{129} } func (m *PodDNSConfigOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3748,7 +3692,7 @@ var xxx_messageInfo_PodDNSConfigOption proto.InternalMessageInfo func (m *PodExecOptions) Reset() { *m = PodExecOptions{} } func (*PodExecOptions) ProtoMessage() {} func (*PodExecOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{132} + return fileDescriptor_83c10c24ec417dc9, []int{130} } func (m *PodExecOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3776,7 +3720,7 @@ var xxx_messageInfo_PodExecOptions proto.InternalMessageInfo func (m *PodIP) Reset() { *m = PodIP{} } func (*PodIP) ProtoMessage() {} func (*PodIP) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{133} + return fileDescriptor_83c10c24ec417dc9, []int{131} } func (m *PodIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3804,7 +3748,7 @@ var xxx_messageInfo_PodIP proto.InternalMessageInfo func (m *PodList) Reset() { *m = PodList{} } func (*PodList) ProtoMessage() {} func (*PodList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{134} + return fileDescriptor_83c10c24ec417dc9, []int{132} } func (m *PodList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3832,7 +3776,7 @@ var xxx_messageInfo_PodList proto.InternalMessageInfo func (m *PodLogOptions) Reset() { *m = PodLogOptions{} } func (*PodLogOptions) ProtoMessage() {} func (*PodLogOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{135} + return fileDescriptor_83c10c24ec417dc9, []int{133} } func (m *PodLogOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3860,7 +3804,7 @@ var xxx_messageInfo_PodLogOptions proto.InternalMessageInfo func (m *PodOS) Reset() { *m = PodOS{} } func (*PodOS) ProtoMessage() {} func (*PodOS) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{136} + return fileDescriptor_83c10c24ec417dc9, []int{134} } func (m *PodOS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3888,7 +3832,7 @@ var xxx_messageInfo_PodOS proto.InternalMessageInfo func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} } func (*PodPortForwardOptions) ProtoMessage() {} func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{137} + return fileDescriptor_83c10c24ec417dc9, []int{135} } func (m *PodPortForwardOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3916,7 +3860,7 @@ var xxx_messageInfo_PodPortForwardOptions proto.InternalMessageInfo func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} } func (*PodProxyOptions) ProtoMessage() {} func (*PodProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{138} + return fileDescriptor_83c10c24ec417dc9, []int{136} } func (m *PodProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3944,7 +3888,7 @@ var xxx_messageInfo_PodProxyOptions proto.InternalMessageInfo func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} } func (*PodReadinessGate) ProtoMessage() {} func (*PodReadinessGate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{139} + return fileDescriptor_83c10c24ec417dc9, []int{137} } func (m *PodReadinessGate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3972,7 +3916,7 @@ var xxx_messageInfo_PodReadinessGate proto.InternalMessageInfo func (m *PodResourceClaim) Reset() { *m = PodResourceClaim{} } func (*PodResourceClaim) ProtoMessage() {} func (*PodResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{140} + return fileDescriptor_83c10c24ec417dc9, []int{138} } func (m *PodResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4000,7 +3944,7 @@ var xxx_messageInfo_PodResourceClaim proto.InternalMessageInfo func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} } func (*PodResourceClaimStatus) ProtoMessage() {} func (*PodResourceClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{141} + return fileDescriptor_83c10c24ec417dc9, []int{139} } func (m *PodResourceClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4028,7 +3972,7 @@ var xxx_messageInfo_PodResourceClaimStatus proto.InternalMessageInfo func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} } func (*PodSchedulingGate) ProtoMessage() {} func (*PodSchedulingGate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{142} + return fileDescriptor_83c10c24ec417dc9, []int{140} } func (m *PodSchedulingGate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4056,7 +4000,7 @@ var xxx_messageInfo_PodSchedulingGate proto.InternalMessageInfo func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (*PodSecurityContext) ProtoMessage() {} func (*PodSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{143} + return fileDescriptor_83c10c24ec417dc9, []int{141} } func (m *PodSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4084,7 +4028,7 @@ var xxx_messageInfo_PodSecurityContext proto.InternalMessageInfo func (m *PodSignature) Reset() { *m = PodSignature{} } func (*PodSignature) ProtoMessage() {} func (*PodSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{144} + return fileDescriptor_83c10c24ec417dc9, []int{142} } func (m *PodSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4112,7 +4056,7 @@ var xxx_messageInfo_PodSignature proto.InternalMessageInfo func (m *PodSpec) Reset() { *m = PodSpec{} } func (*PodSpec) ProtoMessage() {} func (*PodSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{145} + return fileDescriptor_83c10c24ec417dc9, []int{143} } func (m *PodSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4140,7 +4084,7 @@ var xxx_messageInfo_PodSpec proto.InternalMessageInfo func (m *PodStatus) Reset() { *m = PodStatus{} } func (*PodStatus) ProtoMessage() {} func (*PodStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{146} + return fileDescriptor_83c10c24ec417dc9, []int{144} } func (m *PodStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4168,7 +4112,7 @@ var xxx_messageInfo_PodStatus proto.InternalMessageInfo func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } func (*PodStatusResult) ProtoMessage() {} func (*PodStatusResult) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{147} + return fileDescriptor_83c10c24ec417dc9, []int{145} } func (m *PodStatusResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4196,7 +4140,7 @@ var xxx_messageInfo_PodStatusResult proto.InternalMessageInfo func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (*PodTemplate) ProtoMessage() {} func (*PodTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{148} + return fileDescriptor_83c10c24ec417dc9, []int{146} } func (m *PodTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4224,7 +4168,7 @@ var xxx_messageInfo_PodTemplate proto.InternalMessageInfo func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (*PodTemplateList) ProtoMessage() {} func (*PodTemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{149} + return fileDescriptor_83c10c24ec417dc9, []int{147} } func (m *PodTemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4252,7 +4196,7 @@ var xxx_messageInfo_PodTemplateList proto.InternalMessageInfo func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } func (*PodTemplateSpec) ProtoMessage() {} func (*PodTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{150} + return fileDescriptor_83c10c24ec417dc9, []int{148} } func (m *PodTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4280,7 +4224,7 @@ var xxx_messageInfo_PodTemplateSpec proto.InternalMessageInfo func (m *PortStatus) Reset() { *m = PortStatus{} } func (*PortStatus) ProtoMessage() {} func (*PortStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{151} + return fileDescriptor_83c10c24ec417dc9, []int{149} } func (m *PortStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4308,7 +4252,7 @@ var xxx_messageInfo_PortStatus proto.InternalMessageInfo func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } func (*PortworxVolumeSource) ProtoMessage() {} func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{152} + return fileDescriptor_83c10c24ec417dc9, []int{150} } func (m *PortworxVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4336,7 +4280,7 @@ var xxx_messageInfo_PortworxVolumeSource proto.InternalMessageInfo func (m *Preconditions) Reset() { *m = Preconditions{} } func (*Preconditions) ProtoMessage() {} func (*Preconditions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{153} + return fileDescriptor_83c10c24ec417dc9, []int{151} } func (m *Preconditions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4364,7 +4308,7 @@ var xxx_messageInfo_Preconditions proto.InternalMessageInfo func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} } func (*PreferAvoidPodsEntry) ProtoMessage() {} func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{154} + return fileDescriptor_83c10c24ec417dc9, []int{152} } func (m *PreferAvoidPodsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4392,7 +4336,7 @@ var xxx_messageInfo_PreferAvoidPodsEntry proto.InternalMessageInfo func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} } func (*PreferredSchedulingTerm) ProtoMessage() {} func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{155} + return fileDescriptor_83c10c24ec417dc9, []int{153} } func (m *PreferredSchedulingTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4420,7 +4364,7 @@ var xxx_messageInfo_PreferredSchedulingTerm proto.InternalMessageInfo func (m *Probe) Reset() { *m = Probe{} } func (*Probe) ProtoMessage() {} func (*Probe) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{156} + return fileDescriptor_83c10c24ec417dc9, []int{154} } func (m *Probe) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4448,7 +4392,7 @@ var xxx_messageInfo_Probe proto.InternalMessageInfo func (m *ProbeHandler) Reset() { *m = ProbeHandler{} } func (*ProbeHandler) ProtoMessage() {} func (*ProbeHandler) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{157} + return fileDescriptor_83c10c24ec417dc9, []int{155} } func (m *ProbeHandler) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4476,7 +4420,7 @@ var xxx_messageInfo_ProbeHandler proto.InternalMessageInfo func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} } func (*ProjectedVolumeSource) ProtoMessage() {} func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{158} + return fileDescriptor_83c10c24ec417dc9, []int{156} } func (m *ProjectedVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4504,7 +4448,7 @@ var xxx_messageInfo_ProjectedVolumeSource proto.InternalMessageInfo func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} } func (*QuobyteVolumeSource) ProtoMessage() {} func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{159} + return fileDescriptor_83c10c24ec417dc9, []int{157} } func (m *QuobyteVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4532,7 +4476,7 @@ var xxx_messageInfo_QuobyteVolumeSource proto.InternalMessageInfo func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} } func (*RBDPersistentVolumeSource) ProtoMessage() {} func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{160} + return fileDescriptor_83c10c24ec417dc9, []int{158} } func (m *RBDPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4560,7 +4504,7 @@ var xxx_messageInfo_RBDPersistentVolumeSource proto.InternalMessageInfo func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} } func (*RBDVolumeSource) ProtoMessage() {} func (*RBDVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{161} + return fileDescriptor_83c10c24ec417dc9, []int{159} } func (m *RBDVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4588,7 +4532,7 @@ var xxx_messageInfo_RBDVolumeSource proto.InternalMessageInfo func (m *RangeAllocation) Reset() { *m = RangeAllocation{} } func (*RangeAllocation) ProtoMessage() {} func (*RangeAllocation) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{162} + return fileDescriptor_83c10c24ec417dc9, []int{160} } func (m *RangeAllocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4616,7 +4560,7 @@ var xxx_messageInfo_RangeAllocation proto.InternalMessageInfo func (m *ReplicationController) Reset() { *m = ReplicationController{} } func (*ReplicationController) ProtoMessage() {} func (*ReplicationController) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{163} + return fileDescriptor_83c10c24ec417dc9, []int{161} } func (m *ReplicationController) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4644,7 +4588,7 @@ var xxx_messageInfo_ReplicationController proto.InternalMessageInfo func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} } func (*ReplicationControllerCondition) ProtoMessage() {} func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{164} + return fileDescriptor_83c10c24ec417dc9, []int{162} } func (m *ReplicationControllerCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4672,7 +4616,7 @@ var xxx_messageInfo_ReplicationControllerCondition proto.InternalMessageInfo func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} } func (*ReplicationControllerList) ProtoMessage() {} func (*ReplicationControllerList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{165} + return fileDescriptor_83c10c24ec417dc9, []int{163} } func (m *ReplicationControllerList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4700,7 +4644,7 @@ var xxx_messageInfo_ReplicationControllerList proto.InternalMessageInfo func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} } func (*ReplicationControllerSpec) ProtoMessage() {} func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{166} + return fileDescriptor_83c10c24ec417dc9, []int{164} } func (m *ReplicationControllerSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4728,7 +4672,7 @@ var xxx_messageInfo_ReplicationControllerSpec proto.InternalMessageInfo func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} } func (*ReplicationControllerStatus) ProtoMessage() {} func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{167} + return fileDescriptor_83c10c24ec417dc9, []int{165} } func (m *ReplicationControllerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4756,7 +4700,7 @@ var xxx_messageInfo_ReplicationControllerStatus proto.InternalMessageInfo func (m *ResourceClaim) Reset() { *m = ResourceClaim{} } func (*ResourceClaim) ProtoMessage() {} func (*ResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{168} + return fileDescriptor_83c10c24ec417dc9, []int{166} } func (m *ResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4784,7 +4728,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} } func (*ResourceFieldSelector) ProtoMessage() {} func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{169} + return fileDescriptor_83c10c24ec417dc9, []int{167} } func (m *ResourceFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4812,7 +4756,7 @@ var xxx_messageInfo_ResourceFieldSelector proto.InternalMessageInfo func (m *ResourceQuota) Reset() { *m = ResourceQuota{} } func (*ResourceQuota) ProtoMessage() {} func (*ResourceQuota) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{170} + return fileDescriptor_83c10c24ec417dc9, []int{168} } func (m *ResourceQuota) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4840,7 +4784,7 @@ var xxx_messageInfo_ResourceQuota proto.InternalMessageInfo func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} } func (*ResourceQuotaList) ProtoMessage() {} func (*ResourceQuotaList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{171} + return fileDescriptor_83c10c24ec417dc9, []int{169} } func (m *ResourceQuotaList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4868,7 +4812,7 @@ var xxx_messageInfo_ResourceQuotaList proto.InternalMessageInfo func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} } func (*ResourceQuotaSpec) ProtoMessage() {} func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{172} + return fileDescriptor_83c10c24ec417dc9, []int{170} } func (m *ResourceQuotaSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4896,7 +4840,7 @@ var xxx_messageInfo_ResourceQuotaSpec proto.InternalMessageInfo func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} } func (*ResourceQuotaStatus) ProtoMessage() {} func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{173} + return fileDescriptor_83c10c24ec417dc9, []int{171} } func (m *ResourceQuotaStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4924,7 +4868,7 @@ var xxx_messageInfo_ResourceQuotaStatus proto.InternalMessageInfo func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (*ResourceRequirements) ProtoMessage() {} func (*ResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{174} + return fileDescriptor_83c10c24ec417dc9, []int{172} } func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4952,7 +4896,7 @@ var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} } func (*SELinuxOptions) ProtoMessage() {} func (*SELinuxOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{175} + return fileDescriptor_83c10c24ec417dc9, []int{173} } func (m *SELinuxOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4980,7 +4924,7 @@ var xxx_messageInfo_SELinuxOptions proto.InternalMessageInfo func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} } func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{176} + return fileDescriptor_83c10c24ec417dc9, []int{174} } func (m *ScaleIOPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5008,7 +4952,7 @@ var xxx_messageInfo_ScaleIOPersistentVolumeSource proto.InternalMessageInfo func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} } func (*ScaleIOVolumeSource) ProtoMessage() {} func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{177} + return fileDescriptor_83c10c24ec417dc9, []int{175} } func (m *ScaleIOVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5036,7 +4980,7 @@ var xxx_messageInfo_ScaleIOVolumeSource proto.InternalMessageInfo func (m *ScopeSelector) Reset() { *m = ScopeSelector{} } func (*ScopeSelector) ProtoMessage() {} func (*ScopeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{178} + return fileDescriptor_83c10c24ec417dc9, []int{176} } func (m *ScopeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5064,7 +5008,7 @@ var xxx_messageInfo_ScopeSelector proto.InternalMessageInfo func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} } func (*ScopedResourceSelectorRequirement) ProtoMessage() {} func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{179} + return fileDescriptor_83c10c24ec417dc9, []int{177} } func (m *ScopedResourceSelectorRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5092,7 +5036,7 @@ var xxx_messageInfo_ScopedResourceSelectorRequirement proto.InternalMessageInfo func (m *SeccompProfile) Reset() { *m = SeccompProfile{} } func (*SeccompProfile) ProtoMessage() {} func (*SeccompProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{180} + return fileDescriptor_83c10c24ec417dc9, []int{178} } func (m *SeccompProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5120,7 +5064,7 @@ var xxx_messageInfo_SeccompProfile proto.InternalMessageInfo func (m *Secret) Reset() { *m = Secret{} } func (*Secret) ProtoMessage() {} func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{181} + return fileDescriptor_83c10c24ec417dc9, []int{179} } func (m *Secret) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5148,7 +5092,7 @@ var xxx_messageInfo_Secret proto.InternalMessageInfo func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} } func (*SecretEnvSource) ProtoMessage() {} func (*SecretEnvSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{182} + return fileDescriptor_83c10c24ec417dc9, []int{180} } func (m *SecretEnvSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5176,7 +5120,7 @@ var xxx_messageInfo_SecretEnvSource proto.InternalMessageInfo func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} } func (*SecretKeySelector) ProtoMessage() {} func (*SecretKeySelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{183} + return fileDescriptor_83c10c24ec417dc9, []int{181} } func (m *SecretKeySelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5204,7 +5148,7 @@ var xxx_messageInfo_SecretKeySelector proto.InternalMessageInfo func (m *SecretList) Reset() { *m = SecretList{} } func (*SecretList) ProtoMessage() {} func (*SecretList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{184} + return fileDescriptor_83c10c24ec417dc9, []int{182} } func (m *SecretList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5232,7 +5176,7 @@ var xxx_messageInfo_SecretList proto.InternalMessageInfo func (m *SecretProjection) Reset() { *m = SecretProjection{} } func (*SecretProjection) ProtoMessage() {} func (*SecretProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{185} + return fileDescriptor_83c10c24ec417dc9, []int{183} } func (m *SecretProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5260,7 +5204,7 @@ var xxx_messageInfo_SecretProjection proto.InternalMessageInfo func (m *SecretReference) Reset() { *m = SecretReference{} } func (*SecretReference) ProtoMessage() {} func (*SecretReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{186} + return fileDescriptor_83c10c24ec417dc9, []int{184} } func (m *SecretReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5288,7 +5232,7 @@ var xxx_messageInfo_SecretReference proto.InternalMessageInfo func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} } func (*SecretVolumeSource) ProtoMessage() {} func (*SecretVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{187} + return fileDescriptor_83c10c24ec417dc9, []int{185} } func (m *SecretVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5316,7 +5260,7 @@ var xxx_messageInfo_SecretVolumeSource proto.InternalMessageInfo func (m *SecurityContext) Reset() { *m = SecurityContext{} } func (*SecurityContext) ProtoMessage() {} func (*SecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{188} + return fileDescriptor_83c10c24ec417dc9, []int{186} } func (m *SecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5344,7 +5288,7 @@ var xxx_messageInfo_SecurityContext proto.InternalMessageInfo func (m *SerializedReference) Reset() { *m = SerializedReference{} } func (*SerializedReference) ProtoMessage() {} func (*SerializedReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{189} + return fileDescriptor_83c10c24ec417dc9, []int{187} } func (m *SerializedReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5372,7 +5316,7 @@ var xxx_messageInfo_SerializedReference proto.InternalMessageInfo func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{190} + return fileDescriptor_83c10c24ec417dc9, []int{188} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5400,7 +5344,7 @@ var xxx_messageInfo_Service proto.InternalMessageInfo func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } func (*ServiceAccount) ProtoMessage() {} func (*ServiceAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{191} + return fileDescriptor_83c10c24ec417dc9, []int{189} } func (m *ServiceAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5428,7 +5372,7 @@ var xxx_messageInfo_ServiceAccount proto.InternalMessageInfo func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} } func (*ServiceAccountList) ProtoMessage() {} func (*ServiceAccountList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{192} + return fileDescriptor_83c10c24ec417dc9, []int{190} } func (m *ServiceAccountList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5456,7 +5400,7 @@ var xxx_messageInfo_ServiceAccountList proto.InternalMessageInfo func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} } func (*ServiceAccountTokenProjection) ProtoMessage() {} func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{193} + return fileDescriptor_83c10c24ec417dc9, []int{191} } func (m *ServiceAccountTokenProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5484,7 +5428,7 @@ var xxx_messageInfo_ServiceAccountTokenProjection proto.InternalMessageInfo func (m *ServiceList) Reset() { *m = ServiceList{} } func (*ServiceList) ProtoMessage() {} func (*ServiceList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{194} + return fileDescriptor_83c10c24ec417dc9, []int{192} } func (m *ServiceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5512,7 +5456,7 @@ var xxx_messageInfo_ServiceList proto.InternalMessageInfo func (m *ServicePort) Reset() { *m = ServicePort{} } func (*ServicePort) ProtoMessage() {} func (*ServicePort) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{195} + return fileDescriptor_83c10c24ec417dc9, []int{193} } func (m *ServicePort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5540,7 +5484,7 @@ var xxx_messageInfo_ServicePort proto.InternalMessageInfo func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} } func (*ServiceProxyOptions) ProtoMessage() {} func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{196} + return fileDescriptor_83c10c24ec417dc9, []int{194} } func (m *ServiceProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5568,7 +5512,7 @@ var xxx_messageInfo_ServiceProxyOptions proto.InternalMessageInfo func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } func (*ServiceSpec) ProtoMessage() {} func (*ServiceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{197} + return fileDescriptor_83c10c24ec417dc9, []int{195} } func (m *ServiceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5596,7 +5540,7 @@ var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo func (m *ServiceStatus) Reset() { *m = ServiceStatus{} } func (*ServiceStatus) ProtoMessage() {} func (*ServiceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{198} + return fileDescriptor_83c10c24ec417dc9, []int{196} } func (m *ServiceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5624,7 +5568,7 @@ var xxx_messageInfo_ServiceStatus proto.InternalMessageInfo func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} } func (*SessionAffinityConfig) ProtoMessage() {} func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{199} + return fileDescriptor_83c10c24ec417dc9, []int{197} } func (m *SessionAffinityConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5649,38 +5593,10 @@ func (m *SessionAffinityConfig) XXX_DiscardUnknown() { var xxx_messageInfo_SessionAffinityConfig proto.InternalMessageInfo -func (m *SleepAction) Reset() { *m = SleepAction{} } -func (*SleepAction) ProtoMessage() {} -func (*SleepAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{200} -} -func (m *SleepAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SleepAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *SleepAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SleepAction.Merge(m, src) -} -func (m *SleepAction) XXX_Size() int { - return m.Size() -} -func (m *SleepAction) XXX_DiscardUnknown() { - xxx_messageInfo_SleepAction.DiscardUnknown(m) -} - -var xxx_messageInfo_SleepAction proto.InternalMessageInfo - func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} } func (*StorageOSPersistentVolumeSource) ProtoMessage() {} func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{201} + return fileDescriptor_83c10c24ec417dc9, []int{198} } func (m *StorageOSPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5708,7 +5624,7 @@ var xxx_messageInfo_StorageOSPersistentVolumeSource proto.InternalMessageInfo func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} } func (*StorageOSVolumeSource) ProtoMessage() {} func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{202} + return fileDescriptor_83c10c24ec417dc9, []int{199} } func (m *StorageOSVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5736,7 +5652,7 @@ var xxx_messageInfo_StorageOSVolumeSource proto.InternalMessageInfo func (m *Sysctl) Reset() { *m = Sysctl{} } func (*Sysctl) ProtoMessage() {} func (*Sysctl) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{203} + return fileDescriptor_83c10c24ec417dc9, []int{200} } func (m *Sysctl) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5764,7 +5680,7 @@ var xxx_messageInfo_Sysctl proto.InternalMessageInfo func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} } func (*TCPSocketAction) ProtoMessage() {} func (*TCPSocketAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{204} + return fileDescriptor_83c10c24ec417dc9, []int{201} } func (m *TCPSocketAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5792,7 +5708,7 @@ var xxx_messageInfo_TCPSocketAction proto.InternalMessageInfo func (m *Taint) Reset() { *m = Taint{} } func (*Taint) ProtoMessage() {} func (*Taint) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{205} + return fileDescriptor_83c10c24ec417dc9, []int{202} } func (m *Taint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5820,7 +5736,7 @@ var xxx_messageInfo_Taint proto.InternalMessageInfo func (m *Toleration) Reset() { *m = Toleration{} } func (*Toleration) ProtoMessage() {} func (*Toleration) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{206} + return fileDescriptor_83c10c24ec417dc9, []int{203} } func (m *Toleration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5848,7 +5764,7 @@ var xxx_messageInfo_Toleration proto.InternalMessageInfo func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} } func (*TopologySelectorLabelRequirement) ProtoMessage() {} func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{207} + return fileDescriptor_83c10c24ec417dc9, []int{204} } func (m *TopologySelectorLabelRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5876,7 +5792,7 @@ var xxx_messageInfo_TopologySelectorLabelRequirement proto.InternalMessageInfo func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} } func (*TopologySelectorTerm) ProtoMessage() {} func (*TopologySelectorTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{208} + return fileDescriptor_83c10c24ec417dc9, []int{205} } func (m *TopologySelectorTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5904,7 +5820,7 @@ var xxx_messageInfo_TopologySelectorTerm proto.InternalMessageInfo func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} } func (*TopologySpreadConstraint) ProtoMessage() {} func (*TopologySpreadConstraint) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{209} + return fileDescriptor_83c10c24ec417dc9, []int{206} } func (m *TopologySpreadConstraint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5932,7 +5848,7 @@ var xxx_messageInfo_TopologySpreadConstraint proto.InternalMessageInfo func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } func (*TypedLocalObjectReference) ProtoMessage() {} func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{210} + return fileDescriptor_83c10c24ec417dc9, []int{207} } func (m *TypedLocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5960,7 +5876,7 @@ var xxx_messageInfo_TypedLocalObjectReference proto.InternalMessageInfo func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} } func (*TypedObjectReference) ProtoMessage() {} func (*TypedObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{211} + return fileDescriptor_83c10c24ec417dc9, []int{208} } func (m *TypedObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5988,7 +5904,7 @@ var xxx_messageInfo_TypedObjectReference proto.InternalMessageInfo func (m *Volume) Reset() { *m = Volume{} } func (*Volume) ProtoMessage() {} func (*Volume) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{212} + return fileDescriptor_83c10c24ec417dc9, []int{209} } func (m *Volume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6016,7 +5932,7 @@ var xxx_messageInfo_Volume proto.InternalMessageInfo func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } func (*VolumeDevice) ProtoMessage() {} func (*VolumeDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{213} + return fileDescriptor_83c10c24ec417dc9, []int{210} } func (m *VolumeDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6044,7 +5960,7 @@ var xxx_messageInfo_VolumeDevice proto.InternalMessageInfo func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (*VolumeMount) ProtoMessage() {} func (*VolumeMount) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{214} + return fileDescriptor_83c10c24ec417dc9, []int{211} } func (m *VolumeMount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6072,7 +5988,7 @@ var xxx_messageInfo_VolumeMount proto.InternalMessageInfo func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} } func (*VolumeNodeAffinity) ProtoMessage() {} func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{215} + return fileDescriptor_83c10c24ec417dc9, []int{212} } func (m *VolumeNodeAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6100,7 +6016,7 @@ var xxx_messageInfo_VolumeNodeAffinity proto.InternalMessageInfo func (m *VolumeProjection) Reset() { *m = VolumeProjection{} } func (*VolumeProjection) ProtoMessage() {} func (*VolumeProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{216} + return fileDescriptor_83c10c24ec417dc9, []int{213} } func (m *VolumeProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6125,38 +6041,10 @@ func (m *VolumeProjection) XXX_DiscardUnknown() { var xxx_messageInfo_VolumeProjection proto.InternalMessageInfo -func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} } -func (*VolumeResourceRequirements) ProtoMessage() {} -func (*VolumeResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{217} -} -func (m *VolumeResourceRequirements) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeResourceRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *VolumeResourceRequirements) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeResourceRequirements.Merge(m, src) -} -func (m *VolumeResourceRequirements) XXX_Size() int { - return m.Size() -} -func (m *VolumeResourceRequirements) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeResourceRequirements.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeResourceRequirements proto.InternalMessageInfo - func (m *VolumeSource) Reset() { *m = VolumeSource{} } func (*VolumeSource) ProtoMessage() {} func (*VolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{218} + return fileDescriptor_83c10c24ec417dc9, []int{214} } func (m *VolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6184,7 +6072,7 @@ var xxx_messageInfo_VolumeSource proto.InternalMessageInfo func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{219} + return fileDescriptor_83c10c24ec417dc9, []int{215} } func (m *VsphereVirtualDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6212,7 +6100,7 @@ var xxx_messageInfo_VsphereVirtualDiskVolumeSource proto.InternalMessageInfo func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (*WeightedPodAffinityTerm) ProtoMessage() {} func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{220} + return fileDescriptor_83c10c24ec417dc9, []int{216} } func (m *WeightedPodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6240,7 +6128,7 @@ var xxx_messageInfo_WeightedPodAffinityTerm proto.InternalMessageInfo func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} } func (*WindowsSecurityContextOptions) ProtoMessage() {} func (*WindowsSecurityContextOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{221} + return fileDescriptor_83c10c24ec417dc9, []int{217} } func (m *WindowsSecurityContextOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6285,7 +6173,6 @@ func init() { proto.RegisterType((*CinderVolumeSource)(nil), "k8s.io.api.core.v1.CinderVolumeSource") proto.RegisterType((*ClaimSource)(nil), "k8s.io.api.core.v1.ClaimSource") proto.RegisterType((*ClientIPConfig)(nil), "k8s.io.api.core.v1.ClientIPConfig") - proto.RegisterType((*ClusterTrustBundleProjection)(nil), "k8s.io.api.core.v1.ClusterTrustBundleProjection") proto.RegisterType((*ComponentCondition)(nil), "k8s.io.api.core.v1.ComponentCondition") proto.RegisterType((*ComponentStatus)(nil), "k8s.io.api.core.v1.ComponentStatus") proto.RegisterType((*ComponentStatusList)(nil), "k8s.io.api.core.v1.ComponentStatusList") @@ -6364,7 +6251,6 @@ func init() { proto.RegisterType((*LoadBalancerStatus)(nil), "k8s.io.api.core.v1.LoadBalancerStatus") proto.RegisterType((*LocalObjectReference)(nil), "k8s.io.api.core.v1.LocalObjectReference") proto.RegisterType((*LocalVolumeSource)(nil), "k8s.io.api.core.v1.LocalVolumeSource") - proto.RegisterType((*ModifyVolumeStatus)(nil), "k8s.io.api.core.v1.ModifyVolumeStatus") proto.RegisterType((*NFSVolumeSource)(nil), "k8s.io.api.core.v1.NFSVolumeSource") proto.RegisterType((*Namespace)(nil), "k8s.io.api.core.v1.Namespace") proto.RegisterType((*NamespaceCondition)(nil), "k8s.io.api.core.v1.NamespaceCondition") @@ -6496,7 +6382,6 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.ServiceSpec.SelectorEntry") proto.RegisterType((*ServiceStatus)(nil), "k8s.io.api.core.v1.ServiceStatus") proto.RegisterType((*SessionAffinityConfig)(nil), "k8s.io.api.core.v1.SessionAffinityConfig") - proto.RegisterType((*SleepAction)(nil), "k8s.io.api.core.v1.SleepAction") proto.RegisterType((*StorageOSPersistentVolumeSource)(nil), "k8s.io.api.core.v1.StorageOSPersistentVolumeSource") proto.RegisterType((*StorageOSVolumeSource)(nil), "k8s.io.api.core.v1.StorageOSVolumeSource") proto.RegisterType((*Sysctl)(nil), "k8s.io.api.core.v1.Sysctl") @@ -6513,9 +6398,6 @@ func init() { proto.RegisterType((*VolumeMount)(nil), "k8s.io.api.core.v1.VolumeMount") proto.RegisterType((*VolumeNodeAffinity)(nil), "k8s.io.api.core.v1.VolumeNodeAffinity") proto.RegisterType((*VolumeProjection)(nil), "k8s.io.api.core.v1.VolumeProjection") - proto.RegisterType((*VolumeResourceRequirements)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements") - proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements.LimitsEntry") - proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements.RequestsEntry") proto.RegisterType((*VolumeSource)(nil), "k8s.io.api.core.v1.VolumeSource") proto.RegisterType((*VsphereVirtualDiskVolumeSource)(nil), "k8s.io.api.core.v1.VsphereVirtualDiskVolumeSource") proto.RegisterType((*WeightedPodAffinityTerm)(nil), "k8s.io.api.core.v1.WeightedPodAffinityTerm") @@ -6527,974 +6409,934 @@ func init() { } var fileDescriptor_83c10c24ec417dc9 = []byte{ - // 15465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x90, 0x1c, 0xc9, - 0x75, 0x18, 0xcc, 0xea, 0x9e, 0xab, 0xdf, 0xdc, 0x39, 0x00, 0x76, 0x30, 0x0b, 0xa0, 0xb1, 0xb5, - 0xbb, 0x58, 0xec, 0x35, 0x20, 0xf6, 0x20, 0x97, 0xbb, 0xcb, 0x15, 0xe7, 0x04, 0x66, 0x31, 0x33, - 0xe8, 0xcd, 0x1e, 0x00, 0xe4, 0x72, 0xc9, 0x8f, 0x85, 0xee, 0x9c, 0x99, 0xe2, 0x74, 0x57, 0xf5, - 0x56, 0x55, 0x0f, 0x30, 0xf8, 0xc8, 0x90, 0x44, 0x7d, 0xa2, 0x44, 0x4a, 0x5f, 0x04, 0xe3, 0x0b, - 0x7d, 0x47, 0x50, 0x0a, 0xc5, 0x17, 0x92, 0xac, 0xc3, 0xb4, 0x64, 0xd3, 0x94, 0x25, 0x59, 0xd4, - 0xe5, 0x2b, 0x2c, 0x29, 0x1c, 0xb2, 0xac, 0x08, 0x8b, 0x0a, 0x2b, 0x3c, 0x32, 0x21, 0x47, 0x28, - 0xf4, 0xc3, 0x92, 0x7c, 0xfc, 0xb0, 0x61, 0xd9, 0x72, 0xe4, 0x59, 0x99, 0x75, 0x74, 0xf7, 0x60, - 0x07, 0xc3, 0x25, 0x63, 0xff, 0x75, 0xbf, 0xf7, 0xf2, 0x65, 0x56, 0x9e, 0x2f, 0xdf, 0x7b, 0xf9, - 0x1e, 0xbc, 0xb2, 0xf3, 0x52, 0x38, 0xeb, 0xfa, 0x17, 0x76, 0xda, 0x37, 0x49, 0xe0, 0x91, 0x88, - 0x84, 0x17, 0x76, 0x89, 0x57, 0xf7, 0x83, 0x0b, 0x02, 0xe1, 0xb4, 0xdc, 0x0b, 0x35, 0x3f, 0x20, - 0x17, 0x76, 0x2f, 0x5e, 0xd8, 0x22, 0x1e, 0x09, 0x9c, 0x88, 0xd4, 0x67, 0x5b, 0x81, 0x1f, 0xf9, - 0x08, 0x71, 0x9a, 0x59, 0xa7, 0xe5, 0xce, 0x52, 0x9a, 0xd9, 0xdd, 0x8b, 0x33, 0xcf, 0x6e, 0xb9, - 0xd1, 0x76, 0xfb, 0xe6, 0x6c, 0xcd, 0x6f, 0x5e, 0xd8, 0xf2, 0xb7, 0xfc, 0x0b, 0x8c, 0xf4, 0x66, - 0x7b, 0x93, 0xfd, 0x63, 0x7f, 0xd8, 0x2f, 0xce, 0x62, 0xe6, 0x85, 0xb8, 0x9a, 0xa6, 0x53, 0xdb, - 0x76, 0x3d, 0x12, 0xec, 0x5d, 0x68, 0xed, 0x6c, 0xb1, 0x7a, 0x03, 0x12, 0xfa, 0xed, 0xa0, 0x46, - 0x92, 0x15, 0x77, 0x2c, 0x15, 0x5e, 0x68, 0x92, 0xc8, 0xc9, 0x68, 0xee, 0xcc, 0x85, 0xbc, 0x52, - 0x41, 0xdb, 0x8b, 0xdc, 0x66, 0xba, 0x9a, 0x0f, 0x74, 0x2b, 0x10, 0xd6, 0xb6, 0x49, 0xd3, 0x49, - 0x95, 0x7b, 0x3e, 0xaf, 0x5c, 0x3b, 0x72, 0x1b, 0x17, 0x5c, 0x2f, 0x0a, 0xa3, 0x20, 0x59, 0xc8, - 0xfe, 0x86, 0x05, 0x67, 0xe7, 0x6e, 0x54, 0x97, 0x1a, 0x4e, 0x18, 0xb9, 0xb5, 0xf9, 0x86, 0x5f, - 0xdb, 0xa9, 0x46, 0x7e, 0x40, 0xae, 0xfb, 0x8d, 0x76, 0x93, 0x54, 0x59, 0x47, 0xa0, 0x67, 0x60, - 0x68, 0x97, 0xfd, 0x5f, 0x59, 0x9c, 0xb6, 0xce, 0x5a, 0xe7, 0x4b, 0xf3, 0x13, 0xbf, 0xbd, 0x5f, - 0x7e, 0xdf, 0xdd, 0xfd, 0xf2, 0xd0, 0x75, 0x01, 0xc7, 0x8a, 0x02, 0x9d, 0x83, 0x81, 0xcd, 0x70, - 0x63, 0xaf, 0x45, 0xa6, 0x0b, 0x8c, 0x76, 0x4c, 0xd0, 0x0e, 0x2c, 0x57, 0x29, 0x14, 0x0b, 0x2c, - 0xba, 0x00, 0xa5, 0x96, 0x13, 0x44, 0x6e, 0xe4, 0xfa, 0xde, 0x74, 0xf1, 0xac, 0x75, 0xbe, 0x7f, - 0x7e, 0x52, 0x90, 0x96, 0x2a, 0x12, 0x81, 0x63, 0x1a, 0xda, 0x8c, 0x80, 0x38, 0xf5, 0xab, 0x5e, - 0x63, 0x6f, 0xba, 0xef, 0xac, 0x75, 0x7e, 0x28, 0x6e, 0x06, 0x16, 0x70, 0xac, 0x28, 0xec, 0x2f, - 0x17, 0x60, 0x68, 0x6e, 0x73, 0xd3, 0xf5, 0xdc, 0x68, 0x0f, 0x5d, 0x87, 0x11, 0xcf, 0xaf, 0x13, - 0xf9, 0x9f, 0x7d, 0xc5, 0xf0, 0x73, 0x67, 0x67, 0xd3, 0x53, 0x69, 0x76, 0x5d, 0xa3, 0x9b, 0x9f, - 0xb8, 0xbb, 0x5f, 0x1e, 0xd1, 0x21, 0xd8, 0xe0, 0x83, 0x30, 0x0c, 0xb7, 0xfc, 0xba, 0x62, 0x5b, - 0x60, 0x6c, 0xcb, 0x59, 0x6c, 0x2b, 0x31, 0xd9, 0xfc, 0xf8, 0xdd, 0xfd, 0xf2, 0xb0, 0x06, 0xc0, - 0x3a, 0x13, 0x74, 0x13, 0xc6, 0xe9, 0x5f, 0x2f, 0x72, 0x15, 0xdf, 0x22, 0xe3, 0xfb, 0x68, 0x1e, - 0x5f, 0x8d, 0x74, 0x7e, 0xea, 0xee, 0x7e, 0x79, 0x3c, 0x01, 0xc4, 0x49, 0x86, 0xf6, 0x1d, 0x18, - 0x9b, 0x8b, 0x22, 0xa7, 0xb6, 0x4d, 0xea, 0x7c, 0x04, 0xd1, 0x0b, 0xd0, 0xe7, 0x39, 0x4d, 0x22, - 0xc6, 0xf7, 0xac, 0xe8, 0xd8, 0xbe, 0x75, 0xa7, 0x49, 0xee, 0xed, 0x97, 0x27, 0xae, 0x79, 0xee, - 0xdb, 0x6d, 0x31, 0x2b, 0x28, 0x0c, 0x33, 0x6a, 0xf4, 0x1c, 0x40, 0x9d, 0xec, 0xba, 0x35, 0x52, - 0x71, 0xa2, 0x6d, 0x31, 0xde, 0x48, 0x94, 0x85, 0x45, 0x85, 0xc1, 0x1a, 0x95, 0x7d, 0x1b, 0x4a, - 0x73, 0xbb, 0xbe, 0x5b, 0xaf, 0xf8, 0xf5, 0x10, 0xed, 0xc0, 0x78, 0x2b, 0x20, 0x9b, 0x24, 0x50, - 0xa0, 0x69, 0xeb, 0x6c, 0xf1, 0xfc, 0xf0, 0x73, 0xe7, 0x33, 0x3f, 0xd6, 0x24, 0x5d, 0xf2, 0xa2, - 0x60, 0x6f, 0xfe, 0x21, 0x51, 0xdf, 0x78, 0x02, 0x8b, 0x93, 0x9c, 0xed, 0x7f, 0x5a, 0x80, 0xe3, - 0x73, 0x77, 0xda, 0x01, 0x59, 0x74, 0xc3, 0x9d, 0xe4, 0x0c, 0xaf, 0xbb, 0xe1, 0xce, 0x7a, 0xdc, - 0x03, 0x6a, 0x6a, 0x2d, 0x0a, 0x38, 0x56, 0x14, 0xe8, 0x59, 0x18, 0xa4, 0xbf, 0xaf, 0xe1, 0x15, - 0xf1, 0xc9, 0x53, 0x82, 0x78, 0x78, 0xd1, 0x89, 0x9c, 0x45, 0x8e, 0xc2, 0x92, 0x06, 0xad, 0xc1, - 0x70, 0x8d, 0x2d, 0xc8, 0xad, 0x35, 0xbf, 0x4e, 0xd8, 0x60, 0x96, 0xe6, 0x9f, 0xa6, 0xe4, 0x0b, - 0x31, 0xf8, 0xde, 0x7e, 0x79, 0x9a, 0xb7, 0x4d, 0xb0, 0xd0, 0x70, 0x58, 0x2f, 0x8f, 0x6c, 0xb5, - 0xbe, 0xfa, 0x18, 0x27, 0xc8, 0x58, 0x5b, 0xe7, 0xb5, 0xa5, 0xd2, 0xcf, 0x96, 0xca, 0x48, 0xf6, - 0x32, 0x41, 0x17, 0xa1, 0x6f, 0xc7, 0xf5, 0xea, 0xd3, 0x03, 0x8c, 0xd7, 0x69, 0x3a, 0xe6, 0x57, - 0x5c, 0xaf, 0x7e, 0x6f, 0xbf, 0x3c, 0x69, 0x34, 0x87, 0x02, 0x31, 0x23, 0xb5, 0xff, 0xb3, 0x05, - 0x65, 0x86, 0x5b, 0x76, 0x1b, 0xa4, 0x42, 0x82, 0xd0, 0x0d, 0x23, 0xe2, 0x45, 0x46, 0x87, 0x3e, - 0x07, 0x10, 0x92, 0x5a, 0x40, 0x22, 0xad, 0x4b, 0xd5, 0xc4, 0xa8, 0x2a, 0x0c, 0xd6, 0xa8, 0xe8, - 0x86, 0x10, 0x6e, 0x3b, 0x01, 0x9b, 0x5f, 0xa2, 0x63, 0xd5, 0x86, 0x50, 0x95, 0x08, 0x1c, 0xd3, - 0x18, 0x1b, 0x42, 0xb1, 0xdb, 0x86, 0x80, 0x3e, 0x0c, 0xe3, 0x71, 0x65, 0x61, 0xcb, 0xa9, 0xc9, - 0x0e, 0x64, 0x4b, 0xa6, 0x6a, 0xa2, 0x70, 0x92, 0xd6, 0xfe, 0xdb, 0x96, 0x98, 0x3c, 0xf4, 0xab, - 0xdf, 0xe5, 0xdf, 0x6a, 0xff, 0x8a, 0x05, 0x83, 0xf3, 0xae, 0x57, 0x77, 0xbd, 0x2d, 0xf4, 0x29, - 0x18, 0xa2, 0x67, 0x53, 0xdd, 0x89, 0x1c, 0xb1, 0xef, 0xbd, 0x5f, 0x5b, 0x5b, 0xea, 0xa8, 0x98, - 0x6d, 0xed, 0x6c, 0x51, 0x40, 0x38, 0x4b, 0xa9, 0xe9, 0x6a, 0xbb, 0x7a, 0xf3, 0xd3, 0xa4, 0x16, - 0xad, 0x91, 0xc8, 0x89, 0x3f, 0x27, 0x86, 0x61, 0xc5, 0x15, 0x5d, 0x81, 0x81, 0xc8, 0x09, 0xb6, - 0x48, 0x24, 0x36, 0xc0, 0xcc, 0x8d, 0x8a, 0x97, 0xc4, 0x74, 0x45, 0x12, 0xaf, 0x46, 0xe2, 0x63, - 0x61, 0x83, 0x15, 0xc5, 0x82, 0x85, 0xfd, 0x3f, 0x06, 0xe1, 0xe4, 0x42, 0x75, 0x25, 0x67, 0x5e, - 0x9d, 0x83, 0x81, 0x7a, 0xe0, 0xee, 0x92, 0x40, 0xf4, 0xb3, 0xe2, 0xb2, 0xc8, 0xa0, 0x58, 0x60, - 0xd1, 0x4b, 0x30, 0xc2, 0x0f, 0xa4, 0xcb, 0x8e, 0x57, 0x6f, 0xc8, 0x2e, 0x3e, 0x26, 0xa8, 0x47, - 0xae, 0x6b, 0x38, 0x6c, 0x50, 0x1e, 0x70, 0x52, 0x9d, 0x4b, 0x2c, 0xc6, 0xbc, 0xc3, 0xee, 0x0b, - 0x16, 0x4c, 0xf0, 0x6a, 0xe6, 0xa2, 0x28, 0x70, 0x6f, 0xb6, 0x23, 0x12, 0x4e, 0xf7, 0xb3, 0x9d, - 0x6e, 0x21, 0xab, 0xb7, 0x72, 0x7b, 0x60, 0xf6, 0x7a, 0x82, 0x0b, 0xdf, 0x04, 0xa7, 0x45, 0xbd, - 0x13, 0x49, 0x34, 0x4e, 0x55, 0x8b, 0xbe, 0xcf, 0x82, 0x99, 0x9a, 0xef, 0x45, 0x81, 0xdf, 0x68, - 0x90, 0xa0, 0xd2, 0xbe, 0xd9, 0x70, 0xc3, 0x6d, 0x3e, 0x4f, 0x31, 0xd9, 0x64, 0x3b, 0x41, 0xce, - 0x18, 0x2a, 0x22, 0x31, 0x86, 0x67, 0xee, 0xee, 0x97, 0x67, 0x16, 0x72, 0x59, 0xe1, 0x0e, 0xd5, - 0xa0, 0x1d, 0x40, 0xf4, 0x28, 0xad, 0x46, 0xce, 0x16, 0x89, 0x2b, 0x1f, 0xec, 0xbd, 0xf2, 0x13, - 0x77, 0xf7, 0xcb, 0x68, 0x3d, 0xc5, 0x02, 0x67, 0xb0, 0x45, 0x6f, 0xc3, 0x31, 0x0a, 0x4d, 0x7d, - 0xeb, 0x50, 0xef, 0xd5, 0x4d, 0xdf, 0xdd, 0x2f, 0x1f, 0x5b, 0xcf, 0x60, 0x82, 0x33, 0x59, 0xa3, - 0xef, 0xb1, 0xe0, 0x64, 0xfc, 0xf9, 0x4b, 0xb7, 0x5b, 0x8e, 0x57, 0x8f, 0x2b, 0x2e, 0xf5, 0x5e, - 0x31, 0xdd, 0x93, 0x4f, 0x2e, 0xe4, 0x71, 0xc2, 0xf9, 0x95, 0x20, 0x0f, 0xa6, 0x68, 0xd3, 0x92, - 0x75, 0x43, 0xef, 0x75, 0x3f, 0x74, 0x77, 0xbf, 0x3c, 0xb5, 0x9e, 0xe6, 0x81, 0xb3, 0x18, 0xcf, - 0x2c, 0xc0, 0xf1, 0xcc, 0xd9, 0x89, 0x26, 0xa0, 0xb8, 0x43, 0xb8, 0xd4, 0x55, 0xc2, 0xf4, 0x27, - 0x3a, 0x06, 0xfd, 0xbb, 0x4e, 0xa3, 0x2d, 0x16, 0x26, 0xe6, 0x7f, 0x5e, 0x2e, 0xbc, 0x64, 0xd9, - 0xff, 0xac, 0x08, 0xe3, 0x0b, 0xd5, 0x95, 0xfb, 0x5a, 0xf5, 0xfa, 0xb1, 0x57, 0xe8, 0x78, 0xec, - 0xc5, 0x87, 0x68, 0x31, 0xf7, 0x10, 0xfd, 0xee, 0x8c, 0x25, 0xdb, 0xc7, 0x96, 0xec, 0x87, 0x72, - 0x96, 0xec, 0x21, 0x2f, 0xd4, 0xdd, 0x9c, 0x59, 0xdb, 0xcf, 0x06, 0x30, 0x53, 0x42, 0x5a, 0xf5, - 0x6b, 0x4e, 0x23, 0xb9, 0xd5, 0x1e, 0x70, 0xea, 0x1e, 0xce, 0x38, 0xd6, 0x60, 0x64, 0xc1, 0x69, - 0x39, 0x37, 0xdd, 0x86, 0x1b, 0xb9, 0x24, 0x44, 0x4f, 0x40, 0xd1, 0xa9, 0xd7, 0x99, 0x74, 0x57, - 0x9a, 0x3f, 0x7e, 0x77, 0xbf, 0x5c, 0x9c, 0xab, 0x53, 0x31, 0x03, 0x14, 0xd5, 0x1e, 0xa6, 0x14, - 0xe8, 0x29, 0xe8, 0xab, 0x07, 0x7e, 0x6b, 0xba, 0xc0, 0x28, 0xe9, 0x2a, 0xef, 0x5b, 0x0c, 0xfc, - 0x56, 0x82, 0x94, 0xd1, 0xd8, 0xbf, 0x55, 0x80, 0x53, 0x0b, 0xa4, 0xb5, 0xbd, 0x5c, 0xcd, 0x39, - 0x2f, 0xce, 0xc3, 0x50, 0xd3, 0xf7, 0xdc, 0xc8, 0x0f, 0x42, 0x51, 0x35, 0x9b, 0x11, 0x6b, 0x02, - 0x86, 0x15, 0x16, 0x9d, 0x85, 0xbe, 0x56, 0x2c, 0xc4, 0x8e, 0x48, 0x01, 0x98, 0x89, 0xaf, 0x0c, - 0x43, 0x29, 0xda, 0x21, 0x09, 0xc4, 0x8c, 0x51, 0x14, 0xd7, 0x42, 0x12, 0x60, 0x86, 0x89, 0x25, - 0x01, 0x2a, 0x23, 0x88, 0x13, 0x21, 0x21, 0x09, 0x50, 0x0c, 0xd6, 0xa8, 0x50, 0x05, 0x4a, 0x61, - 0x62, 0x64, 0x7b, 0x5a, 0x9a, 0xa3, 0x4c, 0x54, 0x50, 0x23, 0x19, 0x33, 0x31, 0x4e, 0xb0, 0x81, - 0xae, 0xa2, 0xc2, 0xd7, 0x0b, 0x80, 0x78, 0x17, 0x7e, 0x9b, 0x75, 0xdc, 0xb5, 0x74, 0xc7, 0xf5, - 0xbe, 0x24, 0x0e, 0xab, 0xf7, 0xfe, 0x8b, 0x05, 0xa7, 0x16, 0x5c, 0xaf, 0x4e, 0x82, 0x9c, 0x09, - 0xf8, 0x60, 0xee, 0xce, 0x07, 0x13, 0x52, 0x8c, 0x29, 0xd6, 0x77, 0x08, 0x53, 0xcc, 0xfe, 0x4b, - 0x0b, 0x10, 0xff, 0xec, 0x77, 0xdd, 0xc7, 0x5e, 0x4b, 0x7f, 0xec, 0x21, 0x4c, 0x0b, 0xfb, 0xef, - 0x5a, 0x30, 0xbc, 0xd0, 0x70, 0xdc, 0xa6, 0xf8, 0xd4, 0x05, 0x98, 0x94, 0x8a, 0x22, 0x06, 0xd6, - 0x64, 0x7f, 0xba, 0xb9, 0x4d, 0xe2, 0x24, 0x12, 0xa7, 0xe9, 0xd1, 0xc7, 0xe1, 0xa4, 0x01, 0xdc, - 0x20, 0xcd, 0x56, 0xc3, 0x89, 0xf4, 0x5b, 0x01, 0x3b, 0xfd, 0x71, 0x1e, 0x11, 0xce, 0x2f, 0x6f, - 0xaf, 0xc2, 0xd8, 0x42, 0xc3, 0x25, 0x5e, 0xb4, 0x52, 0x59, 0xf0, 0xbd, 0x4d, 0x77, 0x0b, 0xbd, - 0x0c, 0x63, 0x91, 0xdb, 0x24, 0x7e, 0x3b, 0xaa, 0x92, 0x9a, 0xef, 0xb1, 0xbb, 0xb6, 0x75, 0xbe, - 0x7f, 0x1e, 0xdd, 0xdd, 0x2f, 0x8f, 0x6d, 0x18, 0x18, 0x9c, 0xa0, 0xb4, 0x7f, 0x9a, 0xee, 0xb4, - 0x8d, 0x76, 0x18, 0x91, 0x60, 0x23, 0x68, 0x87, 0xd1, 0x7c, 0x9b, 0x4a, 0xcb, 0x95, 0xc0, 0xa7, - 0x1d, 0xe8, 0xfa, 0x1e, 0x3a, 0x65, 0x28, 0x10, 0x86, 0xa4, 0xf2, 0x40, 0x28, 0x0a, 0x66, 0x01, - 0x42, 0x77, 0xcb, 0x23, 0x81, 0xf6, 0x69, 0x63, 0x6c, 0x71, 0x2b, 0x28, 0xd6, 0x28, 0x50, 0x03, - 0x46, 0x1b, 0xce, 0x4d, 0xd2, 0xa8, 0x92, 0x06, 0xa9, 0x45, 0x7e, 0x20, 0x54, 0x20, 0xcf, 0xf7, - 0x76, 0x73, 0x59, 0xd5, 0x8b, 0xce, 0x4f, 0xde, 0xdd, 0x2f, 0x8f, 0x1a, 0x20, 0x6c, 0x32, 0xa7, - 0x9b, 0x9d, 0xdf, 0xa2, 0x5f, 0xe1, 0x34, 0xf4, 0xeb, 0xf2, 0x55, 0x01, 0xc3, 0x0a, 0xab, 0x36, - 0xbb, 0xbe, 0xbc, 0xcd, 0xce, 0xfe, 0x63, 0xba, 0x34, 0xfc, 0x66, 0xcb, 0xf7, 0x88, 0x17, 0x2d, - 0xf8, 0x5e, 0x9d, 0x2b, 0xaf, 0x5e, 0x86, 0xbe, 0x88, 0x4e, 0x75, 0xde, 0x3d, 0xe7, 0x64, 0x41, - 0x3a, 0xc1, 0xef, 0xed, 0x97, 0x4f, 0xa4, 0x4b, 0xb0, 0x25, 0xc0, 0xca, 0xa0, 0x0f, 0xc1, 0x40, - 0x18, 0x39, 0x51, 0x3b, 0x14, 0x1d, 0xf7, 0x88, 0x5c, 0x28, 0x55, 0x06, 0xbd, 0xb7, 0x5f, 0x1e, - 0x57, 0xc5, 0x38, 0x08, 0x8b, 0x02, 0xe8, 0x49, 0x18, 0x6c, 0x92, 0x30, 0x74, 0xb6, 0xa4, 0xa0, - 0x33, 0x2e, 0xca, 0x0e, 0xae, 0x71, 0x30, 0x96, 0x78, 0xf4, 0x28, 0xf4, 0x93, 0x20, 0xf0, 0x03, - 0xf1, 0x6d, 0xa3, 0x82, 0xb0, 0x7f, 0x89, 0x02, 0x31, 0xc7, 0xd9, 0xff, 0xd2, 0x82, 0x71, 0xd5, - 0x56, 0x5e, 0xd7, 0x11, 0x5c, 0x30, 0xdf, 0x04, 0xa8, 0xc9, 0x0f, 0x0c, 0x99, 0x60, 0x30, 0xfc, - 0xdc, 0xb9, 0x4c, 0x19, 0x2c, 0xd5, 0x8d, 0x31, 0x67, 0x05, 0x0a, 0xb1, 0xc6, 0xcd, 0xfe, 0x75, - 0x0b, 0xa6, 0x12, 0x5f, 0xb4, 0xea, 0x86, 0x11, 0x7a, 0x2b, 0xf5, 0x55, 0xb3, 0x3d, 0x4e, 0x3e, - 0x37, 0xe4, 0xdf, 0xa4, 0x76, 0x29, 0x09, 0xd1, 0xbe, 0xe8, 0x32, 0xf4, 0xbb, 0x11, 0x69, 0xca, - 0x8f, 0x79, 0xb4, 0xe3, 0xc7, 0xf0, 0x56, 0xc5, 0x23, 0xb2, 0x42, 0x4b, 0x62, 0xce, 0xc0, 0xfe, - 0xad, 0x22, 0x94, 0xf8, 0xfa, 0x5e, 0x73, 0x5a, 0x47, 0x30, 0x16, 0x4f, 0x43, 0xc9, 0x6d, 0x36, - 0xdb, 0x91, 0x73, 0x53, 0x9c, 0xd4, 0x43, 0x7c, 0xd7, 0x5c, 0x91, 0x40, 0x1c, 0xe3, 0xd1, 0x0a, - 0xf4, 0xb1, 0xa6, 0xf0, 0xaf, 0x7c, 0x22, 0xfb, 0x2b, 0x45, 0xdb, 0x67, 0x17, 0x9d, 0xc8, 0xe1, - 0x42, 0xb2, 0x5a, 0x57, 0x14, 0x84, 0x19, 0x0b, 0xe4, 0x00, 0xdc, 0x74, 0x3d, 0x27, 0xd8, 0xa3, - 0xb0, 0xe9, 0x22, 0x63, 0xf8, 0x6c, 0x67, 0x86, 0xf3, 0x8a, 0x9e, 0xb3, 0x55, 0x1f, 0x16, 0x23, - 0xb0, 0xc6, 0x74, 0xe6, 0x83, 0x50, 0x52, 0xc4, 0x07, 0x91, 0x75, 0x67, 0x3e, 0x0c, 0xe3, 0x89, - 0xba, 0xba, 0x15, 0x1f, 0xd1, 0x45, 0xe5, 0x5f, 0x65, 0x5b, 0x86, 0x68, 0xf5, 0x92, 0xb7, 0x2b, - 0x8e, 0x98, 0x3b, 0x70, 0xac, 0x91, 0x71, 0x48, 0x89, 0x71, 0xed, 0xfd, 0x50, 0x3b, 0x25, 0x3e, - 0xfb, 0x58, 0x16, 0x16, 0x67, 0xd6, 0x61, 0xec, 0x88, 0x85, 0x4e, 0x3b, 0x22, 0xdd, 0xef, 0x8e, - 0xa9, 0xc6, 0x5f, 0x21, 0x7b, 0x6a, 0x53, 0xfd, 0x56, 0x36, 0xff, 0x34, 0xef, 0x7d, 0xbe, 0x5d, - 0x0e, 0x0b, 0x06, 0xc5, 0x2b, 0x64, 0x8f, 0x0f, 0x85, 0xfe, 0x75, 0xc5, 0x8e, 0x5f, 0xf7, 0x55, - 0x0b, 0x46, 0xd5, 0xd7, 0x1d, 0xc1, 0xbe, 0x30, 0x6f, 0xee, 0x0b, 0xa7, 0x3b, 0x4e, 0xf0, 0x9c, - 0x1d, 0xe1, 0xeb, 0x05, 0x38, 0xa9, 0x68, 0xe8, 0xb5, 0x8f, 0xff, 0x11, 0xb3, 0xea, 0x02, 0x94, - 0x3c, 0xa5, 0x00, 0xb5, 0x4c, 0xcd, 0x63, 0xac, 0xfe, 0x8c, 0x69, 0xe8, 0x91, 0xe7, 0xc5, 0x87, - 0xf6, 0x88, 0x6e, 0x19, 0x10, 0x87, 0xfb, 0x3c, 0x14, 0xdb, 0x6e, 0x5d, 0x1c, 0x30, 0xef, 0x97, - 0xbd, 0x7d, 0x6d, 0x65, 0xf1, 0xde, 0x7e, 0xf9, 0x91, 0x3c, 0xab, 0x14, 0x3d, 0xd9, 0xc2, 0xd9, - 0x6b, 0x2b, 0x8b, 0x98, 0x16, 0x46, 0x73, 0x30, 0x2e, 0x45, 0x99, 0xeb, 0x54, 0x92, 0xf6, 0x3d, - 0x71, 0x0e, 0x29, 0xf5, 0x3e, 0x36, 0xd1, 0x38, 0x49, 0x8f, 0x16, 0x61, 0x62, 0xa7, 0x7d, 0x93, - 0x34, 0x48, 0xc4, 0x3f, 0xf8, 0x0a, 0xe1, 0xca, 0xef, 0x52, 0x7c, 0xe9, 0xbe, 0x92, 0xc0, 0xe3, - 0x54, 0x09, 0xfb, 0x6f, 0xd8, 0x79, 0x20, 0x7a, 0x4f, 0x93, 0x6f, 0xbe, 0x95, 0xd3, 0xb9, 0x97, - 0x59, 0x71, 0x85, 0xec, 0x6d, 0xf8, 0x54, 0x0e, 0xc9, 0x9e, 0x15, 0xc6, 0x9c, 0xef, 0xeb, 0x38, - 0xe7, 0x7f, 0xb1, 0x00, 0xc7, 0x55, 0x0f, 0x18, 0xf2, 0xfd, 0xb7, 0x7b, 0x1f, 0x5c, 0x84, 0xe1, - 0x3a, 0xd9, 0x74, 0xda, 0x8d, 0x48, 0x59, 0x62, 0xfa, 0xb9, 0x35, 0x6e, 0x31, 0x06, 0x63, 0x9d, - 0xe6, 0x00, 0xdd, 0xf6, 0xf3, 0xa3, 0xec, 0x20, 0x8e, 0x1c, 0x3a, 0xc7, 0xd5, 0xaa, 0xb1, 0x72, - 0x57, 0xcd, 0xa3, 0xd0, 0xef, 0x36, 0xa9, 0x60, 0x56, 0x30, 0xe5, 0xad, 0x15, 0x0a, 0xc4, 0x1c, - 0x87, 0x1e, 0x87, 0xc1, 0x9a, 0xdf, 0x6c, 0x3a, 0x5e, 0x9d, 0x1d, 0x79, 0xa5, 0xf9, 0x61, 0x2a, - 0xbb, 0x2d, 0x70, 0x10, 0x96, 0x38, 0x2a, 0x7c, 0x3b, 0xc1, 0x16, 0x57, 0x4f, 0x09, 0xe1, 0x7b, - 0x2e, 0xd8, 0x0a, 0x31, 0x83, 0xd2, 0xdb, 0xf5, 0x2d, 0x3f, 0xd8, 0x71, 0xbd, 0xad, 0x45, 0x37, - 0x10, 0x4b, 0x42, 0x9d, 0x85, 0x37, 0x14, 0x06, 0x6b, 0x54, 0x68, 0x19, 0xfa, 0x5b, 0x7e, 0x10, - 0x85, 0xd3, 0x03, 0xac, 0xbb, 0x1f, 0xc9, 0xd9, 0x88, 0xf8, 0xd7, 0x56, 0xfc, 0x20, 0x8a, 0x3f, - 0x80, 0xfe, 0x0b, 0x31, 0x2f, 0x8e, 0x56, 0x61, 0x90, 0x78, 0xbb, 0xcb, 0x81, 0xdf, 0x9c, 0x9e, - 0xca, 0xe7, 0xb4, 0xc4, 0x49, 0xf8, 0x34, 0x8b, 0x65, 0x54, 0x01, 0xc6, 0x92, 0x05, 0xfa, 0x10, - 0x14, 0x89, 0xb7, 0x3b, 0x3d, 0xc8, 0x38, 0xcd, 0xe4, 0x70, 0xba, 0xee, 0x04, 0xf1, 0x9e, 0xbf, - 0xe4, 0xed, 0x62, 0x5a, 0x06, 0x7d, 0x0c, 0x4a, 0x72, 0xc3, 0x08, 0x85, 0xde, 0x37, 0x73, 0xc2, - 0xca, 0x6d, 0x06, 0x93, 0xb7, 0xdb, 0x6e, 0x40, 0x9a, 0xc4, 0x8b, 0xc2, 0x78, 0x87, 0x94, 0xd8, - 0x10, 0xc7, 0xdc, 0x50, 0x0d, 0x46, 0x02, 0x12, 0xba, 0x77, 0x48, 0xc5, 0x6f, 0xb8, 0xb5, 0xbd, - 0xe9, 0x87, 0x58, 0xf3, 0x9e, 0xec, 0xd8, 0x65, 0x58, 0x2b, 0x10, 0xdb, 0x25, 0x74, 0x28, 0x36, - 0x98, 0xa2, 0x37, 0x60, 0x34, 0x20, 0x61, 0xe4, 0x04, 0x91, 0xa8, 0x65, 0x5a, 0xd9, 0x11, 0x47, - 0xb1, 0x8e, 0xe0, 0xd7, 0x89, 0xb8, 0x9a, 0x18, 0x83, 0x4d, 0x0e, 0xe8, 0x63, 0xd2, 0x48, 0xb2, - 0xe6, 0xb7, 0xbd, 0x28, 0x9c, 0x2e, 0xb1, 0x76, 0x67, 0x9a, 0xaf, 0xaf, 0xc7, 0x74, 0x49, 0x2b, - 0x0a, 0x2f, 0x8c, 0x0d, 0x56, 0xe8, 0x13, 0x30, 0xca, 0xff, 0x73, 0x23, 0x70, 0x38, 0x7d, 0x9c, - 0xf1, 0x3e, 0x9b, 0xcf, 0x9b, 0x13, 0xce, 0x1f, 0x17, 0xcc, 0x47, 0x75, 0x68, 0x88, 0x4d, 0x6e, - 0x08, 0xc3, 0x68, 0xc3, 0xdd, 0x25, 0x1e, 0x09, 0xc3, 0x4a, 0xe0, 0xdf, 0x24, 0x42, 0xa7, 0x7d, - 0x32, 0xdb, 0x68, 0xec, 0xdf, 0x24, 0xe2, 0x12, 0xa8, 0x97, 0xc1, 0x26, 0x0b, 0x74, 0x0d, 0xc6, - 0x02, 0xe2, 0xd4, 0xdd, 0x98, 0xe9, 0x70, 0x37, 0xa6, 0xec, 0xe2, 0x8c, 0x8d, 0x42, 0x38, 0xc1, - 0x04, 0x5d, 0x85, 0x11, 0xd6, 0xe7, 0xed, 0x16, 0x67, 0x7a, 0xa2, 0x1b, 0x53, 0xe6, 0x73, 0x50, - 0xd5, 0x8a, 0x60, 0x83, 0x01, 0x7a, 0x1d, 0x4a, 0x0d, 0x77, 0x93, 0xd4, 0xf6, 0x6a, 0x0d, 0x32, - 0x3d, 0xc2, 0xb8, 0x65, 0x6e, 0x86, 0xab, 0x92, 0x88, 0xcb, 0xe7, 0xea, 0x2f, 0x8e, 0x8b, 0xa3, - 0xeb, 0x70, 0x22, 0x22, 0x41, 0xd3, 0xf5, 0x1c, 0xba, 0x89, 0x89, 0x2b, 0x21, 0xb3, 0xe5, 0x8f, - 0xb2, 0xd9, 0x75, 0x46, 0x8c, 0xc6, 0x89, 0x8d, 0x4c, 0x2a, 0x9c, 0x53, 0x1a, 0xdd, 0x86, 0xe9, - 0x0c, 0x0c, 0x9f, 0xb7, 0xc7, 0x18, 0xe7, 0x57, 0x05, 0xe7, 0xe9, 0x8d, 0x1c, 0xba, 0x7b, 0x1d, - 0x70, 0x38, 0x97, 0x3b, 0xba, 0x0a, 0xe3, 0x6c, 0xe7, 0xac, 0xb4, 0x1b, 0x0d, 0x51, 0xe1, 0x18, - 0xab, 0xf0, 0x71, 0x29, 0x47, 0xac, 0x98, 0xe8, 0x7b, 0xfb, 0x65, 0x88, 0xff, 0xe1, 0x64, 0x69, - 0x74, 0x93, 0x99, 0x8d, 0xdb, 0x81, 0x1b, 0xed, 0xd1, 0x55, 0x45, 0x6e, 0x47, 0xd3, 0xe3, 0x1d, - 0x55, 0x68, 0x3a, 0xa9, 0xb2, 0x2d, 0xeb, 0x40, 0x9c, 0x64, 0x48, 0x8f, 0x82, 0x30, 0xaa, 0xbb, - 0xde, 0xf4, 0x04, 0xbf, 0x4f, 0xc9, 0x9d, 0xb4, 0x4a, 0x81, 0x98, 0xe3, 0x98, 0xc9, 0x98, 0xfe, - 0xb8, 0x4a, 0x4f, 0xdc, 0x49, 0x46, 0x18, 0x9b, 0x8c, 0x25, 0x02, 0xc7, 0x34, 0x54, 0x08, 0x8e, - 0xa2, 0xbd, 0x69, 0xc4, 0x48, 0xd5, 0x86, 0xb8, 0xb1, 0xf1, 0x31, 0x4c, 0xe1, 0xf6, 0x4d, 0x18, - 0x53, 0xdb, 0x04, 0xeb, 0x13, 0x54, 0x86, 0x7e, 0x26, 0xf6, 0x09, 0x85, 0x6f, 0x89, 0x36, 0x81, - 0x89, 0x84, 0x98, 0xc3, 0x59, 0x13, 0xdc, 0x3b, 0x64, 0x7e, 0x2f, 0x22, 0x5c, 0x17, 0x51, 0xd4, - 0x9a, 0x20, 0x11, 0x38, 0xa6, 0xb1, 0xff, 0x27, 0x17, 0x9f, 0xe3, 0x53, 0xa2, 0x87, 0x73, 0xf1, - 0x19, 0x18, 0xda, 0xf6, 0xc3, 0x88, 0x52, 0xb3, 0x3a, 0xfa, 0x63, 0x81, 0xf9, 0xb2, 0x80, 0x63, - 0x45, 0x81, 0x5e, 0x81, 0xd1, 0x9a, 0x5e, 0x81, 0x38, 0xd4, 0xd5, 0x36, 0x62, 0xd4, 0x8e, 0x4d, - 0x5a, 0xf4, 0x12, 0x0c, 0x31, 0x37, 0xa8, 0x9a, 0xdf, 0x10, 0xd2, 0xa6, 0x94, 0x4c, 0x86, 0x2a, - 0x02, 0x7e, 0x4f, 0xfb, 0x8d, 0x15, 0x35, 0x3a, 0x07, 0x03, 0xb4, 0x09, 0x2b, 0x15, 0x71, 0x9c, - 0x2a, 0xdd, 0xe5, 0x65, 0x06, 0xc5, 0x02, 0x6b, 0xff, 0xba, 0xc5, 0x64, 0xa9, 0xf4, 0x9e, 0x8f, - 0x2e, 0xb3, 0x43, 0x83, 0x9d, 0x20, 0x9a, 0xee, 0xf0, 0x31, 0xed, 0x24, 0x50, 0xb8, 0x7b, 0x89, - 0xff, 0xd8, 0x28, 0x89, 0xde, 0x4c, 0x9e, 0x0c, 0x5c, 0xa0, 0x78, 0x41, 0x76, 0x41, 0xf2, 0x74, - 0x78, 0x38, 0x3e, 0xe2, 0x68, 0x7b, 0x3a, 0x1d, 0x11, 0xf6, 0xff, 0x55, 0xd0, 0x66, 0x49, 0x35, - 0x72, 0x22, 0x82, 0x2a, 0x30, 0x78, 0xcb, 0x71, 0x23, 0xd7, 0xdb, 0x12, 0x72, 0x5f, 0xe7, 0x83, - 0x8e, 0x15, 0xba, 0xc1, 0x0b, 0x70, 0xe9, 0x45, 0xfc, 0xc1, 0x92, 0x0d, 0xe5, 0x18, 0xb4, 0x3d, - 0x8f, 0x72, 0x2c, 0xf4, 0xca, 0x11, 0xf3, 0x02, 0x9c, 0xa3, 0xf8, 0x83, 0x25, 0x1b, 0xf4, 0x16, - 0x80, 0xdc, 0x21, 0x48, 0x5d, 0xe8, 0x0e, 0x9f, 0xe9, 0xce, 0x74, 0x43, 0x95, 0xe1, 0xca, 0xc9, - 0xf8, 0x3f, 0xd6, 0xf8, 0xd9, 0x91, 0x36, 0xa6, 0x7a, 0x63, 0xd0, 0xc7, 0xe9, 0x12, 0x75, 0x82, - 0x88, 0xd4, 0xe7, 0x22, 0xd1, 0x39, 0x4f, 0xf5, 0x76, 0x39, 0xdc, 0x70, 0x9b, 0x44, 0x5f, 0xce, - 0x82, 0x09, 0x8e, 0xf9, 0xd9, 0xbf, 0x5c, 0x84, 0xe9, 0xbc, 0xe6, 0xd2, 0x45, 0x43, 0x6e, 0xbb, - 0xd1, 0x02, 0x15, 0x6b, 0x2d, 0x73, 0xd1, 0x2c, 0x09, 0x38, 0x56, 0x14, 0x74, 0xf6, 0x86, 0xee, - 0x96, 0xbc, 0xdb, 0xf7, 0xc7, 0xb3, 0xb7, 0xca, 0xa0, 0x58, 0x60, 0x29, 0x5d, 0x40, 0x9c, 0x50, - 0xf8, 0xe7, 0x69, 0xb3, 0x1c, 0x33, 0x28, 0x16, 0x58, 0x5d, 0xcb, 0xd8, 0xd7, 0x45, 0xcb, 0x68, - 0x74, 0x51, 0xff, 0xe1, 0x76, 0x11, 0xfa, 0x24, 0xc0, 0xa6, 0xeb, 0xb9, 0xe1, 0x36, 0xe3, 0x3e, - 0x70, 0x60, 0xee, 0x4a, 0x28, 0x5e, 0x56, 0x5c, 0xb0, 0xc6, 0x11, 0xbd, 0x08, 0xc3, 0x6a, 0x03, - 0x59, 0x59, 0x64, 0xce, 0x0a, 0x9a, 0xf3, 0x57, 0xbc, 0x9b, 0x2e, 0x62, 0x9d, 0xce, 0xfe, 0x74, - 0x72, 0xbe, 0x88, 0x15, 0xa0, 0xf5, 0xaf, 0xd5, 0x6b, 0xff, 0x16, 0x3a, 0xf7, 0xaf, 0xfd, 0xcd, - 0x01, 0x18, 0x37, 0x2a, 0x6b, 0x87, 0x3d, 0xec, 0xb9, 0x97, 0xe8, 0x01, 0xe4, 0x44, 0x44, 0xac, - 0x3f, 0xbb, 0xfb, 0x52, 0xd1, 0x0f, 0x29, 0xba, 0x02, 0x78, 0x79, 0xf4, 0x49, 0x28, 0x35, 0x9c, - 0x90, 0x69, 0x2c, 0x89, 0x58, 0x77, 0xbd, 0x30, 0x8b, 0x2f, 0x84, 0x4e, 0x18, 0x69, 0xa7, 0x3e, - 0xe7, 0x1d, 0xb3, 0xa4, 0x27, 0x25, 0x95, 0xaf, 0xa4, 0x03, 0xa8, 0x6a, 0x04, 0x15, 0xc2, 0xf6, - 0x30, 0xc7, 0xa1, 0x97, 0xd8, 0xd6, 0x4a, 0x67, 0xc5, 0x02, 0x95, 0x46, 0xd9, 0x34, 0xeb, 0x37, - 0x84, 0x6c, 0x85, 0xc3, 0x06, 0x65, 0x7c, 0x27, 0x1b, 0xe8, 0x70, 0x27, 0x7b, 0x12, 0x06, 0xd9, - 0x0f, 0x35, 0x03, 0xd4, 0x68, 0xac, 0x70, 0x30, 0x96, 0xf8, 0xe4, 0x84, 0x19, 0xea, 0x6d, 0xc2, - 0xd0, 0x5b, 0x9f, 0x98, 0xd4, 0xcc, 0x51, 0x64, 0x88, 0xef, 0x72, 0x62, 0xca, 0x63, 0x89, 0x43, - 0x3f, 0x63, 0x01, 0x72, 0x1a, 0xf4, 0xb6, 0x4c, 0xc1, 0xea, 0x72, 0x03, 0x4c, 0xd4, 0x7e, 0xa5, - 0x6b, 0xb7, 0xb7, 0xc3, 0xd9, 0xb9, 0x54, 0x69, 0xae, 0x29, 0x7d, 0x59, 0x34, 0x11, 0xa5, 0x09, - 0xf4, 0xc3, 0x68, 0xd5, 0x0d, 0xa3, 0xcf, 0xfd, 0x49, 0xe2, 0x70, 0xca, 0x68, 0x12, 0xba, 0xa6, - 0x5f, 0xbe, 0x86, 0x0f, 0x78, 0xf9, 0x1a, 0xcd, 0xbb, 0x78, 0xcd, 0xb4, 0xe1, 0xa1, 0x9c, 0x2f, - 0xc8, 0xd0, 0xbf, 0x2e, 0xea, 0xfa, 0xd7, 0x2e, 0x5a, 0xbb, 0x59, 0x59, 0xc7, 0xec, 0x1b, 0x6d, - 0xc7, 0x8b, 0xdc, 0x68, 0x4f, 0xd7, 0xd7, 0x3e, 0x05, 0x63, 0x8b, 0x0e, 0x69, 0xfa, 0xde, 0x92, - 0x57, 0x6f, 0xf9, 0xae, 0x17, 0xa1, 0x69, 0xe8, 0x63, 0xc2, 0x07, 0xdf, 0x7a, 0xfb, 0x68, 0xef, - 0x61, 0x06, 0xb1, 0xb7, 0xe0, 0xf8, 0xa2, 0x7f, 0xcb, 0xbb, 0xe5, 0x04, 0xf5, 0xb9, 0xca, 0x8a, - 0xa6, 0x4f, 0x5a, 0x97, 0xfa, 0x0c, 0x2b, 0xff, 0xb6, 0xa8, 0x95, 0xe4, 0xd7, 0xa1, 0x65, 0xb7, - 0x41, 0x72, 0xb4, 0x7e, 0xff, 0x6f, 0xc1, 0xa8, 0x29, 0xa6, 0x57, 0x36, 0x2b, 0x2b, 0xd7, 0x40, - 0xff, 0x06, 0x0c, 0x6d, 0xba, 0xa4, 0x51, 0xc7, 0x64, 0x53, 0xf4, 0xce, 0x13, 0xf9, 0x2e, 0x7c, - 0xcb, 0x94, 0x52, 0x19, 0xd7, 0x98, 0x36, 0x64, 0x59, 0x14, 0xc6, 0x8a, 0x0d, 0xda, 0x81, 0x09, - 0xd9, 0x87, 0x12, 0x2b, 0xf6, 0x83, 0x27, 0x3b, 0x0d, 0xbc, 0xc9, 0xfc, 0xd8, 0xdd, 0xfd, 0xf2, - 0x04, 0x4e, 0xb0, 0xc1, 0x29, 0xc6, 0xe8, 0x14, 0xf4, 0x35, 0xe9, 0xc9, 0xd7, 0xc7, 0xba, 0x9f, - 0xa9, 0x3f, 0x98, 0x26, 0x87, 0x41, 0xed, 0x1f, 0xb3, 0xe0, 0xa1, 0x54, 0xcf, 0x08, 0x8d, 0xd6, - 0x21, 0x8f, 0x42, 0x52, 0xc3, 0x54, 0xe8, 0xae, 0x61, 0xb2, 0xff, 0x8e, 0x05, 0xc7, 0x96, 0x9a, - 0xad, 0x68, 0x6f, 0xd1, 0x35, 0xad, 0xe9, 0x1f, 0x84, 0x81, 0x26, 0xa9, 0xbb, 0xed, 0xa6, 0x18, - 0xb9, 0xb2, 0x3c, 0x1d, 0xd6, 0x18, 0xf4, 0xde, 0x7e, 0x79, 0xb4, 0x1a, 0xf9, 0x81, 0xb3, 0x45, - 0x38, 0x00, 0x0b, 0x72, 0x76, 0xc6, 0xba, 0x77, 0xc8, 0xaa, 0xdb, 0x74, 0xa3, 0xfb, 0x9b, 0xed, - 0xc2, 0x10, 0x2e, 0x99, 0xe0, 0x98, 0x9f, 0xfd, 0x0d, 0x0b, 0xc6, 0xe5, 0xbc, 0x9f, 0xab, 0xd7, - 0x03, 0x12, 0x86, 0x68, 0x06, 0x0a, 0x6e, 0x4b, 0xb4, 0x12, 0x44, 0x2b, 0x0b, 0x2b, 0x15, 0x5c, - 0x70, 0x5b, 0x52, 0x9c, 0x67, 0x07, 0x50, 0xd1, 0xf4, 0x09, 0xb8, 0x2c, 0xe0, 0x58, 0x51, 0xa0, - 0xf3, 0x30, 0xe4, 0xf9, 0x75, 0x2e, 0x11, 0x0b, 0x1b, 0x2b, 0xa5, 0x5c, 0x17, 0x30, 0xac, 0xb0, - 0xa8, 0x02, 0x25, 0xee, 0x31, 0x1a, 0x4f, 0xda, 0x9e, 0xfc, 0x4e, 0xd9, 0x97, 0x6d, 0xc8, 0x92, - 0x38, 0x66, 0x62, 0xff, 0xa6, 0x05, 0x23, 0xf2, 0xcb, 0x7a, 0xbc, 0xab, 0xd0, 0xa5, 0x15, 0xdf, - 0x53, 0xe2, 0xa5, 0x45, 0xef, 0x1a, 0x0c, 0x63, 0x5c, 0x31, 0x8a, 0x07, 0xba, 0x62, 0x5c, 0x84, - 0x61, 0xa7, 0xd5, 0xaa, 0x98, 0xf7, 0x13, 0x36, 0x95, 0xe6, 0x62, 0x30, 0xd6, 0x69, 0xec, 0x1f, - 0x2d, 0xc0, 0x98, 0xfc, 0x82, 0x6a, 0xfb, 0x66, 0x48, 0x22, 0xb4, 0x01, 0x25, 0x87, 0x8f, 0x12, - 0x91, 0x93, 0xfc, 0xd1, 0x6c, 0xbd, 0x99, 0x31, 0xa4, 0xb1, 0xa0, 0x35, 0x27, 0x4b, 0xe3, 0x98, - 0x11, 0x6a, 0xc0, 0xa4, 0xe7, 0x47, 0xec, 0xd0, 0x55, 0xf8, 0x4e, 0xa6, 0xcc, 0x24, 0xf7, 0x93, - 0x82, 0xfb, 0xe4, 0x7a, 0x92, 0x0b, 0x4e, 0x33, 0x46, 0x4b, 0x52, 0x17, 0x59, 0xcc, 0x57, 0x22, - 0xe9, 0x03, 0x97, 0xad, 0x8a, 0xb4, 0x7f, 0xcd, 0x82, 0x92, 0x24, 0x3b, 0x0a, 0xab, 0xf5, 0x1a, - 0x0c, 0x86, 0x6c, 0x10, 0x64, 0xd7, 0xd8, 0x9d, 0x1a, 0xce, 0xc7, 0x2b, 0x96, 0x25, 0xf8, 0xff, - 0x10, 0x4b, 0x1e, 0xcc, 0x14, 0xa5, 0x9a, 0xff, 0x2e, 0x31, 0x45, 0xa9, 0xf6, 0xe4, 0x1c, 0x4a, - 0x7f, 0xc6, 0xda, 0xac, 0xe9, 0x76, 0xa9, 0xc8, 0xdb, 0x0a, 0xc8, 0xa6, 0x7b, 0x3b, 0x29, 0xf2, - 0x56, 0x18, 0x14, 0x0b, 0x2c, 0x7a, 0x0b, 0x46, 0x6a, 0xd2, 0x06, 0x11, 0xaf, 0xf0, 0x73, 0x1d, - 0xed, 0x61, 0xca, 0x74, 0xca, 0x75, 0x68, 0x0b, 0x5a, 0x79, 0x6c, 0x70, 0x33, 0x3d, 0xa2, 0x8a, - 0xdd, 0x3c, 0xa2, 0x62, 0xbe, 0xf9, 0xfe, 0x41, 0x3f, 0x6e, 0xc1, 0x00, 0xd7, 0x3d, 0xf7, 0xa6, - 0xfa, 0xd7, 0x2c, 0xc9, 0x71, 0xdf, 0x5d, 0xa7, 0x40, 0x21, 0x69, 0xa0, 0x35, 0x28, 0xb1, 0x1f, - 0x4c, 0x77, 0x5e, 0xcc, 0x7f, 0xb0, 0xc4, 0x6b, 0xd5, 0x1b, 0x78, 0x5d, 0x16, 0xc3, 0x31, 0x07, - 0xfb, 0x47, 0x8a, 0x74, 0x77, 0x8b, 0x49, 0x8d, 0x43, 0xdf, 0x7a, 0x70, 0x87, 0x7e, 0xe1, 0x41, - 0x1d, 0xfa, 0x5b, 0x30, 0x5e, 0xd3, 0xec, 0xce, 0xf1, 0x48, 0x9e, 0xef, 0x38, 0x49, 0x34, 0x13, - 0x35, 0xd7, 0xce, 0x2d, 0x98, 0x4c, 0x70, 0x92, 0x2b, 0xfa, 0x38, 0x8c, 0xf0, 0x71, 0x16, 0xb5, - 0x70, 0xa7, 0xb2, 0xc7, 0xf3, 0xe7, 0x8b, 0x5e, 0x05, 0xd7, 0xe6, 0x6a, 0xc5, 0xb1, 0xc1, 0xcc, - 0xfe, 0x2b, 0x0b, 0xd0, 0x52, 0x6b, 0x9b, 0x34, 0x49, 0xe0, 0x34, 0x62, 0xf3, 0xd1, 0x17, 0x2d, - 0x98, 0x26, 0x29, 0xf0, 0x82, 0xdf, 0x6c, 0x8a, 0xcb, 0x62, 0x8e, 0x3e, 0x63, 0x29, 0xa7, 0x8c, - 0x7a, 0xd1, 0x35, 0x9d, 0x47, 0x81, 0x73, 0xeb, 0x43, 0x6b, 0x30, 0xc5, 0x4f, 0x49, 0x85, 0xd0, - 0xbc, 0xb8, 0x1e, 0x16, 0x8c, 0xa7, 0x36, 0xd2, 0x24, 0x38, 0xab, 0x9c, 0xfd, 0x6b, 0xa3, 0x90, - 0xdb, 0x8a, 0xf7, 0xec, 0x66, 0xef, 0xd9, 0xcd, 0xde, 0xb3, 0x9b, 0xbd, 0x67, 0x37, 0x7b, 0xcf, - 0x6e, 0xf6, 0x9e, 0xdd, 0xec, 0x5d, 0x6a, 0x37, 0xfb, 0xbf, 0x2d, 0x38, 0xae, 0x8e, 0x2f, 0xe3, - 0xc2, 0xfe, 0x19, 0x98, 0xe2, 0xcb, 0xcd, 0x70, 0xc6, 0x16, 0xc7, 0xf5, 0xc5, 0xcc, 0x99, 0x9b, - 0x78, 0x34, 0x60, 0x14, 0xe4, 0xaf, 0xaf, 0x32, 0x10, 0x38, 0xab, 0x1a, 0xfb, 0x97, 0x87, 0xa0, - 0x7f, 0x69, 0x97, 0x78, 0xd1, 0x11, 0x5c, 0x6d, 0x6a, 0x30, 0xe6, 0x7a, 0xbb, 0x7e, 0x63, 0x97, - 0xd4, 0x39, 0xfe, 0x20, 0x37, 0xf0, 0x13, 0x82, 0xf5, 0xd8, 0x8a, 0xc1, 0x02, 0x27, 0x58, 0x3e, - 0x08, 0xeb, 0xc3, 0x25, 0x18, 0xe0, 0x87, 0x8f, 0x30, 0x3d, 0x64, 0xee, 0xd9, 0xac, 0x13, 0xc5, - 0x91, 0x1a, 0x5b, 0x46, 0xf8, 0xe1, 0x26, 0x8a, 0xa3, 0x4f, 0xc3, 0xd8, 0xa6, 0x1b, 0x84, 0xd1, - 0x86, 0xdb, 0xa4, 0x47, 0x43, 0xb3, 0x75, 0x1f, 0xd6, 0x06, 0xd5, 0x0f, 0xcb, 0x06, 0x27, 0x9c, - 0xe0, 0x8c, 0xb6, 0x60, 0xb4, 0xe1, 0xe8, 0x55, 0x0d, 0x1e, 0xb8, 0x2a, 0x75, 0x3a, 0xac, 0xea, - 0x8c, 0xb0, 0xc9, 0x97, 0x2e, 0xa7, 0x1a, 0x53, 0x98, 0x0f, 0x31, 0x75, 0x86, 0x5a, 0x4e, 0x5c, - 0x53, 0xce, 0x71, 0x54, 0x40, 0x63, 0x8e, 0xec, 0x25, 0x53, 0x40, 0xd3, 0xdc, 0xd5, 0x3f, 0x05, - 0x25, 0x42, 0xbb, 0x90, 0x32, 0x16, 0x07, 0xcc, 0x85, 0xde, 0xda, 0xba, 0xe6, 0xd6, 0x02, 0xdf, - 0xb4, 0xf3, 0x2c, 0x49, 0x4e, 0x38, 0x66, 0x8a, 0x16, 0x60, 0x20, 0x24, 0x81, 0xab, 0x74, 0xc9, - 0x1d, 0x86, 0x91, 0x91, 0xf1, 0xe7, 0x7d, 0xfc, 0x37, 0x16, 0x45, 0xe9, 0xf4, 0x72, 0x98, 0x2a, - 0x96, 0x1d, 0x06, 0xda, 0xf4, 0x9a, 0x63, 0x50, 0x2c, 0xb0, 0xe8, 0x75, 0x18, 0x0c, 0x48, 0x83, - 0x19, 0x12, 0x47, 0x7b, 0x9f, 0xe4, 0xdc, 0x2e, 0xc9, 0xcb, 0x61, 0xc9, 0x00, 0x5d, 0x01, 0x14, - 0x10, 0x2a, 0xe0, 0xb9, 0xde, 0x96, 0x72, 0xef, 0x16, 0x1b, 0xad, 0x12, 0xa4, 0x71, 0x4c, 0x21, - 0x5f, 0x76, 0xe2, 0x8c, 0x62, 0xe8, 0x12, 0x4c, 0x2a, 0xe8, 0x8a, 0x17, 0x46, 0x0e, 0xdd, 0xe0, - 0xc6, 0x19, 0x2f, 0xa5, 0x5f, 0xc1, 0x49, 0x02, 0x9c, 0x2e, 0x63, 0xff, 0x9c, 0x05, 0xbc, 0x9f, - 0x8f, 0x40, 0xab, 0xf0, 0x9a, 0xa9, 0x55, 0x38, 0x99, 0x3b, 0x72, 0x39, 0x1a, 0x85, 0x9f, 0xb3, - 0x60, 0x58, 0x1b, 0xd9, 0x78, 0xce, 0x5a, 0x1d, 0xe6, 0x6c, 0x1b, 0x26, 0xe8, 0x4c, 0xbf, 0x7a, - 0x33, 0x24, 0xc1, 0x2e, 0xa9, 0xb3, 0x89, 0x59, 0xb8, 0xbf, 0x89, 0xa9, 0x5c, 0x49, 0x57, 0x13, - 0x0c, 0x71, 0xaa, 0x0a, 0xfb, 0x53, 0xb2, 0xa9, 0xca, 0xf3, 0xb6, 0xa6, 0xc6, 0x3c, 0xe1, 0x79, - 0xab, 0x46, 0x15, 0xc7, 0x34, 0x74, 0xa9, 0x6d, 0xfb, 0x61, 0x94, 0xf4, 0xbc, 0xbd, 0xec, 0x87, - 0x11, 0x66, 0x18, 0xfb, 0x79, 0x80, 0xa5, 0xdb, 0xa4, 0xc6, 0x67, 0xac, 0x7e, 0xe9, 0xb1, 0xf2, - 0x2f, 0x3d, 0xf6, 0x1f, 0x58, 0x30, 0xb6, 0xbc, 0x60, 0x9c, 0x5c, 0xb3, 0x00, 0xfc, 0xa6, 0x76, - 0xe3, 0xc6, 0xba, 0x74, 0xff, 0xe0, 0x16, 0x70, 0x05, 0xc5, 0x1a, 0x05, 0x3a, 0x09, 0xc5, 0x46, - 0xdb, 0x13, 0x6a, 0xcf, 0x41, 0x7a, 0x3c, 0xae, 0xb6, 0x3d, 0x4c, 0x61, 0xda, 0xab, 0xae, 0x62, - 0xcf, 0xaf, 0xba, 0xba, 0x46, 0x73, 0x41, 0x65, 0xe8, 0xbf, 0x75, 0xcb, 0xad, 0xf3, 0x37, 0xf3, - 0xc2, 0x35, 0xe5, 0xc6, 0x8d, 0x95, 0xc5, 0x10, 0x73, 0xb8, 0xfd, 0xa5, 0x22, 0xcc, 0x2c, 0x37, - 0xc8, 0xed, 0x77, 0x18, 0x37, 0xa0, 0xd7, 0x37, 0x69, 0x07, 0x53, 0x20, 0x1d, 0xf4, 0xdd, 0x61, - 0xf7, 0xfe, 0xd8, 0x84, 0x41, 0xee, 0x78, 0x2a, 0xa3, 0x08, 0x64, 0x9a, 0xfb, 0xf2, 0x3b, 0x64, - 0x96, 0x3b, 0xb0, 0x0a, 0x73, 0x9f, 0x3a, 0x30, 0x05, 0x14, 0x4b, 0xe6, 0x33, 0x2f, 0xc3, 0x88, - 0x4e, 0x79, 0xa0, 0x17, 0xc0, 0xdf, 0x5b, 0x84, 0x09, 0xda, 0x82, 0x07, 0x3a, 0x10, 0xd7, 0xd2, - 0x03, 0x71, 0xd8, 0xaf, 0x40, 0xbb, 0x8f, 0xc6, 0x5b, 0xc9, 0xd1, 0xb8, 0x98, 0x37, 0x1a, 0x47, - 0x3d, 0x06, 0xdf, 0x67, 0xc1, 0xd4, 0x72, 0xc3, 0xaf, 0xed, 0x24, 0x5e, 0x6a, 0xbe, 0x08, 0xc3, - 0x74, 0x3b, 0x0e, 0x8d, 0xa0, 0x25, 0x46, 0x18, 0x1b, 0x81, 0xc2, 0x3a, 0x9d, 0x56, 0xec, 0xda, - 0xb5, 0x95, 0xc5, 0xac, 0xe8, 0x37, 0x02, 0x85, 0x75, 0x3a, 0xfb, 0xf7, 0x2c, 0x38, 0x7d, 0x69, - 0x61, 0x29, 0x9e, 0x8a, 0xa9, 0x00, 0x3c, 0xe7, 0x60, 0xa0, 0x55, 0xd7, 0x9a, 0x12, 0xab, 0x85, - 0x17, 0x59, 0x2b, 0x04, 0xf6, 0xdd, 0x12, 0x5c, 0xea, 0x1a, 0xc0, 0x25, 0x5c, 0x59, 0x10, 0xfb, - 0xae, 0xb4, 0x02, 0x59, 0xb9, 0x56, 0xa0, 0xc7, 0x61, 0x90, 0x9e, 0x0b, 0x6e, 0x4d, 0xb6, 0x9b, - 0x1b, 0xf4, 0x39, 0x08, 0x4b, 0x9c, 0xfd, 0xb3, 0x16, 0x4c, 0x5d, 0x72, 0x23, 0x7a, 0x68, 0x27, - 0x23, 0xcc, 0xd0, 0x53, 0x3b, 0x74, 0x23, 0x3f, 0xd8, 0x4b, 0x46, 0x98, 0xc1, 0x0a, 0x83, 0x35, - 0x2a, 0xfe, 0x41, 0xbb, 0x2e, 0x7b, 0x49, 0x51, 0x30, 0xed, 0x6e, 0x58, 0xc0, 0xb1, 0xa2, 0xa0, - 0xfd, 0x55, 0x77, 0x03, 0xa6, 0xb2, 0xdc, 0x13, 0x1b, 0xb7, 0xea, 0xaf, 0x45, 0x89, 0xc0, 0x31, - 0x8d, 0xfd, 0x17, 0x16, 0x94, 0x2f, 0xf1, 0xf7, 0xa0, 0x9b, 0x61, 0xce, 0xa6, 0xfb, 0x3c, 0x94, - 0x88, 0x34, 0x10, 0xc8, 0xb7, 0xb1, 0x52, 0x10, 0x55, 0x96, 0x03, 0x1e, 0xe8, 0x46, 0xd1, 0xf5, - 0xf0, 0x9c, 0xfc, 0x60, 0xef, 0x81, 0x97, 0x01, 0x11, 0xbd, 0x2e, 0x3d, 0xf2, 0x0f, 0x0b, 0x21, - 0xb2, 0x94, 0xc2, 0xe2, 0x8c, 0x12, 0xf6, 0x8f, 0x59, 0x70, 0x5c, 0x7d, 0xf0, 0xbb, 0xee, 0x33, - 0xed, 0xaf, 0x15, 0x60, 0xf4, 0xf2, 0xc6, 0x46, 0xe5, 0x12, 0x89, 0xb4, 0x59, 0xd9, 0xd9, 0xec, - 0x8f, 0x35, 0xeb, 0x65, 0xa7, 0x3b, 0x62, 0x3b, 0x72, 0x1b, 0xb3, 0x3c, 0x80, 0xdc, 0xec, 0x8a, - 0x17, 0x5d, 0x0d, 0xaa, 0x51, 0xe0, 0x7a, 0x5b, 0x99, 0x33, 0x5d, 0xca, 0x2c, 0xc5, 0x3c, 0x99, - 0x05, 0x3d, 0x0f, 0x03, 0x2c, 0x82, 0x9d, 0x1c, 0x84, 0x87, 0xd5, 0x15, 0x8b, 0x41, 0xef, 0xed, - 0x97, 0x4b, 0xd7, 0xf0, 0x0a, 0xff, 0x83, 0x05, 0x29, 0xba, 0x06, 0xc3, 0xdb, 0x51, 0xd4, 0xba, - 0x4c, 0x9c, 0x3a, 0x09, 0xe4, 0x2e, 0x7b, 0x26, 0x6b, 0x97, 0xa5, 0x9d, 0xc0, 0xc9, 0xe2, 0x8d, - 0x29, 0x86, 0x85, 0x58, 0xe7, 0x63, 0x57, 0x01, 0x62, 0xdc, 0x21, 0x19, 0x6e, 0xec, 0x0d, 0x28, - 0xd1, 0xcf, 0x9d, 0x6b, 0xb8, 0x4e, 0x67, 0xd3, 0xf8, 0xd3, 0x50, 0x92, 0x86, 0xef, 0x50, 0x84, - 0xbb, 0x60, 0x27, 0x92, 0xb4, 0x8b, 0x87, 0x38, 0xc6, 0xdb, 0x8f, 0x81, 0xf0, 0x2d, 0xed, 0xc4, - 0xd2, 0xde, 0x84, 0x63, 0xcc, 0x49, 0xd6, 0x89, 0xb6, 0x8d, 0x39, 0xda, 0x7d, 0x32, 0x3c, 0x23, - 0xee, 0x75, 0xfc, 0xcb, 0xa6, 0xb5, 0xc7, 0xc9, 0x23, 0x92, 0x63, 0x7c, 0xc7, 0xb3, 0xff, 0xbc, - 0x0f, 0x1e, 0x5e, 0xa9, 0xe6, 0xc7, 0x69, 0x7a, 0x09, 0x46, 0xb8, 0xb8, 0x48, 0xa7, 0x86, 0xd3, - 0x10, 0xf5, 0x2a, 0x0d, 0xe8, 0x86, 0x86, 0xc3, 0x06, 0x25, 0x3a, 0x0d, 0x45, 0xf7, 0x6d, 0x2f, - 0xf9, 0x74, 0x6f, 0xe5, 0x8d, 0x75, 0x4c, 0xe1, 0x14, 0x4d, 0x25, 0x4f, 0xbe, 0xa5, 0x2b, 0xb4, - 0x92, 0x3e, 0x5f, 0x83, 0x31, 0x37, 0xac, 0x85, 0xee, 0x8a, 0x47, 0xd7, 0xa9, 0xb6, 0xd2, 0x95, - 0xce, 0x81, 0x36, 0x5a, 0x61, 0x71, 0x82, 0x5a, 0x3b, 0x5f, 0xfa, 0x7b, 0x96, 0x5e, 0xbb, 0x46, - 0x89, 0xa0, 0xdb, 0x7f, 0x8b, 0x7d, 0x5d, 0xc8, 0x54, 0xf0, 0x62, 0xfb, 0xe7, 0x1f, 0x1c, 0x62, - 0x89, 0xa3, 0x17, 0xba, 0xda, 0xb6, 0xd3, 0x9a, 0x6b, 0x47, 0xdb, 0x8b, 0x6e, 0x58, 0xf3, 0x77, - 0x49, 0xb0, 0xc7, 0xee, 0xe2, 0x43, 0xf1, 0x85, 0x4e, 0x21, 0x16, 0x2e, 0xcf, 0x55, 0x28, 0x25, - 0x4e, 0x97, 0x41, 0x73, 0x30, 0x2e, 0x81, 0x55, 0x12, 0xb2, 0x23, 0x60, 0x98, 0xb1, 0x51, 0x8f, - 0xe9, 0x04, 0x58, 0x31, 0x49, 0xd2, 0x9b, 0x02, 0x2e, 0x1c, 0x86, 0x80, 0xfb, 0x41, 0x18, 0x75, - 0x3d, 0x37, 0x72, 0x9d, 0xc8, 0xe7, 0xf6, 0x23, 0x7e, 0xed, 0x66, 0x0a, 0xe6, 0x15, 0x1d, 0x81, - 0x4d, 0x3a, 0xfb, 0xdf, 0xf7, 0xc1, 0x24, 0x1b, 0xb6, 0xf7, 0x66, 0xd8, 0x77, 0xd2, 0x0c, 0xbb, - 0x96, 0x9e, 0x61, 0x87, 0x21, 0xb9, 0xdf, 0xf7, 0x34, 0xfb, 0x34, 0x94, 0xd4, 0xfb, 0x41, 0xf9, - 0x80, 0xd8, 0xca, 0x79, 0x40, 0xdc, 0xfd, 0xf4, 0x96, 0x2e, 0x69, 0xc5, 0x4c, 0x97, 0xb4, 0xaf, - 0x58, 0x10, 0x1b, 0x16, 0xd0, 0x1b, 0x50, 0x6a, 0xf9, 0xcc, 0xc3, 0x35, 0x90, 0x6e, 0xe3, 0x8f, - 0x75, 0xb4, 0x4c, 0xf0, 0x50, 0x75, 0x01, 0xef, 0x85, 0x8a, 0x2c, 0x8a, 0x63, 0x2e, 0xe8, 0x0a, - 0x0c, 0xb6, 0x02, 0x52, 0x8d, 0x58, 0x1c, 0xa5, 0xde, 0x19, 0xf2, 0x59, 0xc3, 0x0b, 0x62, 0xc9, - 0xc1, 0xfe, 0x85, 0x02, 0x4c, 0x24, 0x49, 0xd1, 0xab, 0xd0, 0x47, 0x6e, 0x93, 0x9a, 0x68, 0x6f, - 0xe6, 0x51, 0x1c, 0xab, 0x26, 0x78, 0x07, 0xd0, 0xff, 0x98, 0x95, 0x42, 0x97, 0x61, 0x90, 0x9e, - 0xc3, 0x97, 0x54, 0xcc, 0xc0, 0x47, 0xf2, 0xce, 0x72, 0x25, 0xd0, 0xf0, 0xc6, 0x09, 0x10, 0x96, - 0xc5, 0x99, 0x1f, 0x58, 0xad, 0x55, 0xa5, 0x57, 0x9c, 0xa8, 0xd3, 0x4d, 0x7c, 0x63, 0xa1, 0xc2, - 0x89, 0x04, 0x37, 0xee, 0x07, 0x26, 0x81, 0x38, 0x66, 0x82, 0x3e, 0x02, 0xfd, 0x61, 0x83, 0x90, - 0x96, 0x30, 0xf4, 0x67, 0x2a, 0x17, 0xab, 0x94, 0x40, 0x70, 0x62, 0xca, 0x08, 0x06, 0xc0, 0xbc, - 0xa0, 0xfd, 0x8b, 0x16, 0x00, 0x77, 0x9c, 0x73, 0xbc, 0x2d, 0x72, 0x04, 0xfa, 0xf8, 0x45, 0xe8, - 0x0b, 0x5b, 0xa4, 0xd6, 0xc9, 0x7d, 0x3b, 0x6e, 0x4f, 0xb5, 0x45, 0x6a, 0xf1, 0x9c, 0xa5, 0xff, - 0x30, 0x2b, 0x6d, 0x7f, 0x3f, 0xc0, 0x58, 0x4c, 0xb6, 0x12, 0x91, 0x26, 0x7a, 0xd6, 0x08, 0x5b, - 0x72, 0x32, 0x11, 0xb6, 0xa4, 0xc4, 0xa8, 0x35, 0xd5, 0xef, 0xa7, 0xa1, 0xd8, 0x74, 0x6e, 0x0b, - 0xdd, 0xde, 0xd3, 0x9d, 0x9b, 0x41, 0xf9, 0xcf, 0xae, 0x39, 0xb7, 0xf9, 0xf5, 0xf7, 0x69, 0xb9, - 0xc6, 0xd6, 0x9c, 0xdb, 0x5d, 0x5d, 0x8c, 0x69, 0x25, 0xac, 0x2e, 0xd7, 0x13, 0x3e, 0x61, 0x3d, - 0xd5, 0xe5, 0x7a, 0xc9, 0xba, 0x5c, 0xaf, 0x87, 0xba, 0x5c, 0x0f, 0xdd, 0x81, 0x41, 0xe1, 0xb2, - 0x29, 0x22, 0xc0, 0x5d, 0xe8, 0xa1, 0x3e, 0xe1, 0xf1, 0xc9, 0xeb, 0xbc, 0x20, 0xaf, 0xf7, 0x02, - 0xda, 0xb5, 0x5e, 0x59, 0x21, 0xfa, 0x7f, 0x2c, 0x18, 0x13, 0xbf, 0x31, 0x79, 0xbb, 0x4d, 0xc2, - 0x48, 0x88, 0xbf, 0x1f, 0xe8, 0xbd, 0x0d, 0xa2, 0x20, 0x6f, 0xca, 0x07, 0xe4, 0x49, 0x65, 0x22, - 0xbb, 0xb6, 0x28, 0xd1, 0x0a, 0xf4, 0x0b, 0x16, 0x1c, 0x6b, 0x3a, 0xb7, 0x79, 0x8d, 0x1c, 0x86, - 0x9d, 0xc8, 0xf5, 0x85, 0xeb, 0xc3, 0xab, 0xbd, 0x0d, 0x7f, 0xaa, 0x38, 0x6f, 0xa4, 0xb4, 0x73, - 0x1e, 0xcb, 0x22, 0xe9, 0xda, 0xd4, 0xcc, 0x76, 0xcd, 0x6c, 0xc2, 0x90, 0x9c, 0x6f, 0x0f, 0xd2, - 0x3f, 0x9c, 0xd5, 0x23, 0xe6, 0xda, 0x03, 0xad, 0xe7, 0xd3, 0x30, 0xa2, 0xcf, 0xb1, 0x07, 0x5a, - 0xd7, 0xdb, 0x30, 0x95, 0x31, 0x97, 0x1e, 0x68, 0x95, 0xb7, 0xe0, 0x64, 0xee, 0xfc, 0x78, 0xa0, - 0xfe, 0xfd, 0x5f, 0xb3, 0xf4, 0x7d, 0xf0, 0x08, 0x8c, 0x22, 0x0b, 0xa6, 0x51, 0xe4, 0x4c, 0xe7, - 0x95, 0x93, 0x63, 0x19, 0x79, 0x4b, 0x6f, 0x34, 0xdd, 0xd5, 0xd1, 0xeb, 0x30, 0xd0, 0xa0, 0x10, - 0xe9, 0xf8, 0x6b, 0x77, 0x5f, 0x91, 0xb1, 0x38, 0xca, 0xe0, 0x21, 0x16, 0x1c, 0xec, 0x5f, 0xb1, - 0xa0, 0xef, 0x08, 0x7a, 0x02, 0x9b, 0x3d, 0xf1, 0x6c, 0x2e, 0x6b, 0x11, 0x0c, 0x7f, 0x16, 0x3b, - 0xb7, 0x96, 0x6e, 0x47, 0xc4, 0x0b, 0xd9, 0x99, 0x9e, 0xd9, 0x31, 0xfb, 0x16, 0x4c, 0xad, 0xfa, - 0x4e, 0x7d, 0xde, 0x69, 0x38, 0x5e, 0x8d, 0x04, 0x2b, 0xde, 0xd6, 0x81, 0xbc, 0xd6, 0x0b, 0x5d, - 0xbd, 0xd6, 0x5f, 0x82, 0x01, 0xb7, 0xa5, 0x05, 0xf7, 0x3e, 0x4b, 0x3b, 0x70, 0xa5, 0x22, 0xe2, - 0x7a, 0x23, 0xa3, 0x72, 0x06, 0xc5, 0x82, 0x9e, 0x8e, 0x3c, 0x77, 0x17, 0xeb, 0xcb, 0x1f, 0x79, - 0x2a, 0xc5, 0x27, 0x43, 0x40, 0x19, 0x8e, 0xcd, 0xdb, 0x60, 0x54, 0x21, 0x5e, 0x7d, 0x61, 0x18, - 0x74, 0xf9, 0x97, 0x8a, 0xe1, 0x7f, 0x22, 0x5b, 0xba, 0x4e, 0x75, 0x8c, 0xf6, 0x9e, 0x89, 0x03, - 0xb0, 0x64, 0x64, 0xbf, 0x04, 0x99, 0x21, 0x3b, 0xba, 0x6b, 0x4e, 0xec, 0x8f, 0xc1, 0x24, 0x2b, - 0x79, 0x40, 0xad, 0x84, 0x9d, 0xd0, 0xf7, 0x66, 0xc4, 0x69, 0xb5, 0xff, 0x8d, 0x05, 0x68, 0xcd, - 0xaf, 0xbb, 0x9b, 0x7b, 0x82, 0x39, 0xff, 0xfe, 0xb7, 0xa1, 0xcc, 0xaf, 0x7d, 0xc9, 0x58, 0xa6, - 0x0b, 0x0d, 0x27, 0x0c, 0x35, 0x5d, 0xf3, 0x13, 0xa2, 0xde, 0xf2, 0x46, 0x67, 0x72, 0xdc, 0x8d, - 0x1f, 0x7a, 0x23, 0x11, 0xa8, 0xed, 0x43, 0xa9, 0x40, 0x6d, 0x4f, 0x64, 0x7a, 0x7c, 0xa4, 0x5b, - 0x2f, 0x03, 0xb8, 0xd9, 0x5f, 0xb0, 0x60, 0x7c, 0x3d, 0x11, 0x9b, 0xf3, 0x1c, 0x33, 0x7f, 0x67, - 0xd8, 0x50, 0xaa, 0x0c, 0x8a, 0x05, 0xf6, 0xd0, 0x75, 0x8c, 0x7f, 0x63, 0x41, 0x1c, 0x22, 0xe8, - 0x08, 0xa4, 0xda, 0x05, 0x43, 0xaa, 0xcd, 0xbc, 0x21, 0xa8, 0xe6, 0xe4, 0x09, 0xb5, 0xe8, 0x8a, - 0x1a, 0x93, 0x0e, 0x97, 0x83, 0x98, 0x0d, 0x5f, 0x67, 0x63, 0xe6, 0xc0, 0xa9, 0xd1, 0xf8, 0xc3, - 0x02, 0x20, 0x45, 0xdb, 0x73, 0x70, 0xbf, 0x74, 0x89, 0xc3, 0x09, 0xee, 0xb7, 0x0b, 0x88, 0x39, - 0x70, 0x04, 0x8e, 0x17, 0x72, 0xb6, 0xae, 0xd0, 0xaa, 0x1e, 0xcc, 0x3b, 0x64, 0x46, 0xbe, 0xf6, - 0x5b, 0x4d, 0x71, 0xc3, 0x19, 0x35, 0x68, 0x8e, 0x39, 0xfd, 0xbd, 0x3a, 0xe6, 0x0c, 0x74, 0x79, - 0xb6, 0xfa, 0x55, 0x0b, 0x46, 0x55, 0x37, 0xbd, 0x4b, 0x1e, 0x37, 0xa8, 0xf6, 0xe4, 0x9c, 0x2b, - 0x15, 0xad, 0xc9, 0xec, 0xbc, 0xfd, 0x2e, 0xf6, 0xfc, 0xd8, 0x69, 0xb8, 0x77, 0x88, 0x8a, 0x9a, - 0x5b, 0x16, 0xcf, 0x89, 0x05, 0xf4, 0xde, 0x7e, 0x79, 0x54, 0xfd, 0xe3, 0x51, 0x2f, 0xe3, 0x22, - 0xf6, 0x4f, 0xd1, 0xc5, 0x6e, 0x4e, 0x45, 0xf4, 0x22, 0xf4, 0xb7, 0xb6, 0x9d, 0x90, 0x24, 0x1e, - 0x81, 0xf5, 0x57, 0x28, 0xf0, 0xde, 0x7e, 0x79, 0x4c, 0x15, 0x60, 0x10, 0xcc, 0xa9, 0x7b, 0x0f, - 0x99, 0x98, 0x9e, 0x9c, 0x5d, 0x43, 0x26, 0xfe, 0x95, 0x05, 0x7d, 0xeb, 0xf4, 0xf4, 0x7a, 0xf0, - 0x5b, 0xc0, 0x6b, 0xc6, 0x16, 0x70, 0x2a, 0x2f, 0x61, 0x4b, 0xee, 0xea, 0x5f, 0x4e, 0xac, 0xfe, - 0x33, 0xb9, 0x1c, 0x3a, 0x2f, 0xfc, 0x26, 0x0c, 0xb3, 0x34, 0x30, 0xe2, 0xc1, 0xdb, 0xf3, 0xc6, - 0x82, 0x2f, 0x27, 0x16, 0xfc, 0xb8, 0x46, 0xaa, 0xad, 0xf4, 0x27, 0x61, 0x50, 0xbc, 0xa0, 0x4a, - 0xbe, 0xe2, 0x16, 0xb4, 0x58, 0xe2, 0xed, 0x1f, 0x2f, 0x82, 0x91, 0x76, 0x06, 0xfd, 0x9a, 0x05, - 0xb3, 0x01, 0xf7, 0xac, 0xae, 0x2f, 0xb6, 0x03, 0xd7, 0xdb, 0xaa, 0xd6, 0xb6, 0x49, 0xbd, 0xdd, - 0x70, 0xbd, 0xad, 0x95, 0x2d, 0xcf, 0x57, 0xe0, 0xa5, 0xdb, 0xa4, 0xd6, 0x66, 0x56, 0xcf, 0x2e, - 0x39, 0x6e, 0xd4, 0x0b, 0x85, 0xe7, 0xee, 0xee, 0x97, 0x67, 0xf1, 0x81, 0x78, 0xe3, 0x03, 0xb6, - 0x05, 0xfd, 0x9e, 0x05, 0x17, 0x78, 0x36, 0x96, 0xde, 0xdb, 0xdf, 0x41, 0x89, 0x50, 0x91, 0xac, - 0x62, 0x26, 0x1b, 0x24, 0x68, 0xce, 0x7f, 0x50, 0x74, 0xe8, 0x85, 0xca, 0xc1, 0xea, 0xc2, 0x07, - 0x6d, 0x9c, 0xfd, 0x8f, 0x8a, 0x30, 0x2a, 0x42, 0xeb, 0x89, 0x33, 0xe0, 0x45, 0x63, 0x4a, 0x3c, - 0x92, 0x98, 0x12, 0x93, 0x06, 0xf1, 0xe1, 0x6c, 0xff, 0x21, 0x4c, 0xd2, 0xcd, 0xf9, 0x32, 0x71, - 0x82, 0xe8, 0x26, 0x71, 0xb8, 0xbf, 0x5d, 0xf1, 0xc0, 0xbb, 0xbf, 0x52, 0xfc, 0xae, 0x26, 0x99, - 0xe1, 0x34, 0xff, 0xef, 0xa4, 0x33, 0xc7, 0x83, 0x89, 0x54, 0x74, 0xc4, 0x37, 0xa1, 0xa4, 0x9e, - 0xff, 0x88, 0x4d, 0xa7, 0x73, 0x90, 0xd1, 0x24, 0x07, 0xae, 0x57, 0x8c, 0x9f, 0x9e, 0xc5, 0xec, - 0xec, 0xbf, 0x57, 0x30, 0x2a, 0xe4, 0x83, 0xb8, 0x0e, 0x43, 0x4e, 0xc8, 0x02, 0x1f, 0xd7, 0x3b, - 0xa9, 0x7e, 0x53, 0xd5, 0xb0, 0x27, 0x58, 0x73, 0xa2, 0x24, 0x56, 0x3c, 0xd0, 0x65, 0xee, 0xd5, - 0xb8, 0x4b, 0x3a, 0xe9, 0x7d, 0x53, 0xdc, 0x40, 0xfa, 0x3d, 0xee, 0x12, 0x2c, 0xca, 0xa3, 0x4f, - 0x70, 0xb7, 0xd3, 0x2b, 0x9e, 0x7f, 0xcb, 0xbb, 0xe4, 0xfb, 0x32, 0x8c, 0x4a, 0x6f, 0x0c, 0x27, - 0xa5, 0xb3, 0xa9, 0x2a, 0x8e, 0x4d, 0x6e, 0xbd, 0x85, 0x1b, 0xfe, 0x0c, 0xb0, 0xec, 0x13, 0xe6, - 0x6b, 0xfb, 0x10, 0x11, 0x18, 0x17, 0x71, 0x1b, 0x25, 0x4c, 0xf4, 0x5d, 0xe6, 0x0d, 0xd7, 0x2c, - 0x1d, 0x5b, 0x28, 0xae, 0x98, 0x2c, 0x70, 0x92, 0xa7, 0xfd, 0x33, 0x16, 0xb0, 0x97, 0xc7, 0x47, - 0x20, 0x8f, 0x7c, 0xd8, 0x94, 0x47, 0xa6, 0xf3, 0x3a, 0x39, 0x47, 0x14, 0x79, 0x81, 0xcf, 0xac, - 0x4a, 0xe0, 0xdf, 0xde, 0x13, 0xbe, 0x42, 0xdd, 0x2f, 0x57, 0xf6, 0x7f, 0xb7, 0xf8, 0x26, 0x16, - 0xc7, 0x69, 0xf8, 0x2c, 0x0c, 0xd5, 0x9c, 0x96, 0x53, 0xe3, 0x39, 0xd2, 0x72, 0x15, 0x9d, 0x46, - 0xa1, 0xd9, 0x05, 0x51, 0x82, 0x2b, 0xee, 0x64, 0xfc, 0xcf, 0x21, 0x09, 0xee, 0xaa, 0xac, 0x53, - 0x55, 0xce, 0xec, 0xc0, 0xa8, 0xc1, 0xec, 0x81, 0x6a, 0x79, 0x3e, 0xcb, 0x8f, 0x58, 0x15, 0xaf, - 0xb6, 0x09, 0x93, 0x9e, 0xf6, 0x9f, 0x1e, 0x28, 0xf2, 0xe6, 0xfc, 0x58, 0xb7, 0x43, 0x94, 0x9d, - 0x3e, 0xda, 0xa3, 0xe6, 0x04, 0x1b, 0x9c, 0xe6, 0x6c, 0xff, 0x84, 0x05, 0x0f, 0xe9, 0x84, 0xda, - 0xbb, 0xa9, 0x6e, 0xd6, 0xa7, 0x45, 0x18, 0xf2, 0x5b, 0x24, 0x70, 0x22, 0x3f, 0x10, 0xa7, 0xc6, - 0x79, 0xd9, 0xe9, 0x57, 0x05, 0xfc, 0x9e, 0xc8, 0xf8, 0x21, 0xb9, 0x4b, 0x38, 0x56, 0x25, 0xe9, - 0xd5, 0x9a, 0x75, 0x46, 0x28, 0x5e, 0xc8, 0xb1, 0x3d, 0x80, 0x39, 0x32, 0x84, 0x58, 0x60, 0xec, - 0x3f, 0xb7, 0xf8, 0xc4, 0xd2, 0x9b, 0x8e, 0xde, 0x86, 0x89, 0xa6, 0x13, 0xd5, 0xb6, 0x97, 0x6e, - 0xb7, 0x02, 0x6e, 0xcb, 0x93, 0xfd, 0xf4, 0x74, 0xb7, 0x7e, 0xd2, 0x3e, 0x32, 0xf6, 0xa4, 0x5d, - 0x4b, 0x30, 0xc3, 0x29, 0xf6, 0xe8, 0x26, 0x0c, 0x33, 0x18, 0x7b, 0xfc, 0x19, 0x76, 0x12, 0x0d, - 0xf2, 0x6a, 0x53, 0xbe, 0x20, 0x6b, 0x31, 0x1f, 0xac, 0x33, 0xb5, 0xbf, 0x52, 0xe4, 0xab, 0x9d, - 0x89, 0xf2, 0x4f, 0xc2, 0x60, 0xcb, 0xaf, 0x2f, 0xac, 0x2c, 0x62, 0x31, 0x0a, 0xea, 0x18, 0xa9, - 0x70, 0x30, 0x96, 0x78, 0x74, 0x1e, 0x86, 0xc4, 0x4f, 0x69, 0x7b, 0x65, 0x7b, 0xb3, 0xa0, 0x0b, - 0xb1, 0xc2, 0xa2, 0xe7, 0x00, 0x5a, 0x81, 0xbf, 0xeb, 0xd6, 0x59, 0x30, 0x98, 0xa2, 0xe9, 0xc6, - 0x55, 0x51, 0x18, 0xac, 0x51, 0xa1, 0x57, 0x60, 0xb4, 0xed, 0x85, 0x5c, 0x1c, 0xd1, 0x42, 0x6e, - 0x2b, 0x07, 0xa3, 0x6b, 0x3a, 0x12, 0x9b, 0xb4, 0x68, 0x0e, 0x06, 0x22, 0x87, 0xb9, 0x25, 0xf5, - 0xe7, 0x7b, 0x5b, 0x6f, 0x50, 0x0a, 0x3d, 0x1d, 0x17, 0x2d, 0x80, 0x45, 0x41, 0xf4, 0xa6, 0x7c, - 0x87, 0xcd, 0x37, 0x76, 0xf1, 0xcc, 0xa1, 0xb7, 0x43, 0x40, 0x7b, 0x85, 0x2d, 0x9e, 0x4f, 0x18, - 0xbc, 0xd0, 0xcb, 0x00, 0xe4, 0x76, 0x44, 0x02, 0xcf, 0x69, 0x28, 0x67, 0x42, 0x25, 0x17, 0x2c, - 0xfa, 0xeb, 0x7e, 0x74, 0x2d, 0x24, 0x4b, 0x8a, 0x02, 0x6b, 0xd4, 0xf6, 0xef, 0x95, 0x00, 0x62, - 0xb9, 0x1d, 0xdd, 0x49, 0x6d, 0x5c, 0xcf, 0x74, 0x96, 0xf4, 0x0f, 0x6f, 0xd7, 0x42, 0x9f, 0xb7, - 0x60, 0x58, 0xc4, 0xbc, 0x61, 0x23, 0x54, 0xe8, 0xbc, 0x71, 0x9a, 0xa1, 0x77, 0x68, 0x09, 0xde, - 0x84, 0xe7, 0xe5, 0x0c, 0xd5, 0x30, 0x5d, 0x5b, 0xa1, 0x57, 0x8c, 0xde, 0x2f, 0xaf, 0x8a, 0x45, - 0xa3, 0x2b, 0xd5, 0x55, 0xb1, 0xc4, 0xce, 0x08, 0xfd, 0x96, 0x78, 0xcd, 0xb8, 0x25, 0xf6, 0xe5, - 0x3f, 0x34, 0x35, 0xc4, 0xd7, 0x6e, 0x17, 0x44, 0x54, 0xd1, 0x83, 0x4e, 0xf4, 0xe7, 0xbf, 0x8e, - 0xd4, 0xee, 0x49, 0x5d, 0x02, 0x4e, 0x7c, 0x1a, 0xc6, 0xeb, 0xa6, 0x10, 0x20, 0x66, 0xe2, 0x13, - 0x79, 0x7c, 0x13, 0x32, 0x43, 0x7c, 0xec, 0x27, 0x10, 0x38, 0xc9, 0x18, 0x55, 0x78, 0x0c, 0x92, - 0x15, 0x6f, 0xd3, 0x17, 0x4f, 0x6d, 0xec, 0xdc, 0xb1, 0xdc, 0x0b, 0x23, 0xd2, 0xa4, 0x94, 0xf1, - 0xe9, 0xbe, 0x2e, 0xca, 0x62, 0xc5, 0x05, 0xbd, 0x0e, 0x03, 0xec, 0x79, 0x5c, 0x38, 0x3d, 0x94, - 0xaf, 0x88, 0x37, 0x83, 0x31, 0xc6, 0x0b, 0x92, 0xfd, 0x0d, 0xb1, 0xe0, 0x80, 0x2e, 0xcb, 0xc7, - 0xa7, 0xe1, 0x8a, 0x77, 0x2d, 0x24, 0xec, 0xf1, 0x69, 0x69, 0xfe, 0xb1, 0xf8, 0x5d, 0x29, 0x87, - 0x67, 0x26, 0xed, 0x34, 0x4a, 0x52, 0x29, 0x4a, 0xfc, 0x97, 0xb9, 0x40, 0x45, 0xe8, 0xa8, 0xcc, - 0xe6, 0x99, 0xf9, 0x42, 0xe3, 0xee, 0xbc, 0x6e, 0xb2, 0xc0, 0x49, 0x9e, 0x54, 0x22, 0xe5, 0xab, - 0x5e, 0x3c, 0xd6, 0xe9, 0xb6, 0x77, 0xf0, 0x8b, 0x38, 0x3b, 0x8d, 0x38, 0x04, 0x8b, 0xf2, 0x47, - 0x2a, 0x1e, 0xcc, 0x78, 0x30, 0x91, 0x5c, 0xa2, 0x0f, 0x54, 0x1c, 0xf9, 0xd3, 0x3e, 0x18, 0x33, - 0xa7, 0x14, 0xba, 0x00, 0x25, 0xc1, 0x44, 0xe5, 0xd3, 0x51, 0xab, 0x64, 0x4d, 0x22, 0x70, 0x4c, - 0xc3, 0xd2, 0x28, 0xb1, 0xe2, 0x9a, 0x77, 0x76, 0x9c, 0x46, 0x49, 0x61, 0xb0, 0x46, 0x45, 0x2f, - 0x56, 0x37, 0x7d, 0x3f, 0x52, 0x07, 0x92, 0x9a, 0x77, 0xf3, 0x0c, 0x8a, 0x05, 0x96, 0x1e, 0x44, - 0x3b, 0x24, 0xf0, 0x48, 0xc3, 0x0c, 0xcf, 0xae, 0x0e, 0xa2, 0x2b, 0x3a, 0x12, 0x9b, 0xb4, 0xf4, - 0x38, 0xf5, 0x43, 0x36, 0x91, 0xc5, 0xf5, 0x2d, 0xf6, 0x76, 0xaf, 0xf2, 0x77, 0xfb, 0x12, 0x8f, - 0x3e, 0x06, 0x0f, 0xa9, 0x50, 0x68, 0x98, 0x1b, 0x79, 0x64, 0x8d, 0x03, 0x86, 0xb6, 0xe5, 0xa1, - 0x85, 0x6c, 0x32, 0x9c, 0x57, 0x1e, 0xbd, 0x06, 0x63, 0x42, 0xc4, 0x97, 0x1c, 0x07, 0x4d, 0xd7, - 0xad, 0x2b, 0x06, 0x16, 0x27, 0xa8, 0x65, 0x80, 0x79, 0x26, 0x65, 0x4b, 0x0e, 0x43, 0xe9, 0x00, - 0xf3, 0x3a, 0x1e, 0xa7, 0x4a, 0xa0, 0x39, 0x18, 0xe7, 0x32, 0x98, 0xeb, 0x6d, 0xf1, 0x31, 0x11, - 0x6f, 0xe9, 0xd4, 0x92, 0xba, 0x6a, 0xa2, 0x71, 0x92, 0x1e, 0xbd, 0x04, 0x23, 0x4e, 0x50, 0xdb, - 0x76, 0x23, 0x52, 0x8b, 0xda, 0x01, 0x7f, 0x64, 0xa7, 0xf9, 0xbe, 0xcd, 0x69, 0x38, 0x6c, 0x50, - 0xda, 0x77, 0x60, 0x2a, 0x23, 0xa0, 0x07, 0x9d, 0x38, 0x4e, 0xcb, 0x95, 0xdf, 0x94, 0x70, 0x30, - 0x9f, 0xab, 0xac, 0xc8, 0xaf, 0xd1, 0xa8, 0xe8, 0xec, 0x64, 0x81, 0x3f, 0xb4, 0xd4, 0xbf, 0x6a, - 0x76, 0x2e, 0x4b, 0x04, 0x8e, 0x69, 0xec, 0xff, 0x54, 0x80, 0xf1, 0x0c, 0xc3, 0x11, 0x4b, 0x3f, - 0x9b, 0xb8, 0xa4, 0xc4, 0xd9, 0x66, 0xcd, 0x7c, 0x05, 0x85, 0x03, 0xe4, 0x2b, 0x28, 0x76, 0xcb, - 0x57, 0xd0, 0xf7, 0x4e, 0xf2, 0x15, 0x98, 0x3d, 0xd6, 0xdf, 0x53, 0x8f, 0x65, 0xe4, 0x38, 0x18, - 0x38, 0x60, 0x8e, 0x03, 0xa3, 0xd3, 0x07, 0x7b, 0xe8, 0xf4, 0x1f, 0x29, 0xc0, 0x44, 0xd2, 0xe6, - 0x74, 0x04, 0x7a, 0xdb, 0xd7, 0x0d, 0xbd, 0xed, 0xf9, 0x5e, 0xde, 0x3e, 0xe7, 0xea, 0x70, 0x71, - 0x42, 0x87, 0xfb, 0x54, 0x4f, 0xdc, 0x3a, 0xeb, 0x73, 0x7f, 0xb2, 0x00, 0xc7, 0x33, 0x4d, 0x71, - 0x47, 0xd0, 0x37, 0x57, 0x8d, 0xbe, 0x79, 0xb6, 0xe7, 0x77, 0xe1, 0xb9, 0x1d, 0x74, 0x23, 0xd1, - 0x41, 0x17, 0x7a, 0x67, 0xd9, 0xb9, 0x97, 0xbe, 0x51, 0x84, 0x33, 0x99, 0xe5, 0x62, 0xb5, 0xe7, - 0xb2, 0xa1, 0xf6, 0x7c, 0x2e, 0xa1, 0xf6, 0xb4, 0x3b, 0x97, 0x3e, 0x1c, 0x3d, 0xa8, 0x78, 0x1f, - 0xcd, 0xa2, 0x3c, 0xdc, 0xa7, 0x0e, 0xd4, 0x78, 0x1f, 0xad, 0x18, 0x61, 0x93, 0xef, 0x77, 0x92, - 0xee, 0xf3, 0x77, 0x2c, 0x38, 0x99, 0x39, 0x36, 0x47, 0xa0, 0xeb, 0x5a, 0x37, 0x75, 0x5d, 0x4f, - 0xf6, 0x3c, 0x5b, 0x73, 0x94, 0x5f, 0x5f, 0x18, 0xc8, 0xf9, 0x16, 0x76, 0x93, 0xbf, 0x0a, 0xc3, - 0x4e, 0xad, 0x46, 0xc2, 0x70, 0xcd, 0xaf, 0xab, 0xd0, 0xe6, 0xcf, 0xb2, 0x7b, 0x56, 0x0c, 0xbe, - 0xb7, 0x5f, 0x9e, 0x49, 0xb2, 0x88, 0xd1, 0x58, 0xe7, 0x80, 0x3e, 0x01, 0x43, 0xa1, 0xcc, 0x4a, - 0xd7, 0x77, 0xff, 0x59, 0xe9, 0x98, 0x92, 0x40, 0x69, 0x2a, 0x14, 0x4b, 0xf4, 0xbf, 0xe9, 0xf1, - 0x76, 0xd2, 0x52, 0x65, 0x22, 0xfa, 0xcb, 0x7d, 0x44, 0xdd, 0x79, 0x0e, 0x60, 0x57, 0x5d, 0x09, - 0x92, 0x5a, 0x08, 0xed, 0xb2, 0xa0, 0x51, 0xa1, 0x8f, 0xc0, 0x44, 0xc8, 0x43, 0x4d, 0xc6, 0xce, - 0x13, 0x7c, 0x2e, 0xb2, 0x68, 0x5d, 0xd5, 0x04, 0x0e, 0xa7, 0xa8, 0xd1, 0xb2, 0xac, 0x95, 0xb9, - 0xc9, 0xf0, 0xe9, 0x79, 0x2e, 0xae, 0x51, 0xb8, 0xca, 0x1c, 0x4b, 0x0e, 0x02, 0xeb, 0x7e, 0xad, - 0x24, 0xfa, 0x04, 0x00, 0x9d, 0x44, 0x42, 0x1b, 0x31, 0x98, 0xbf, 0x85, 0xd2, 0xbd, 0xa5, 0x9e, - 0xe9, 0x3b, 0xce, 0x1e, 0x36, 0x2f, 0x2a, 0x26, 0x58, 0x63, 0x88, 0x1c, 0x18, 0x8d, 0xff, 0xc5, - 0x19, 0xa2, 0xcf, 0xe7, 0xd6, 0x90, 0x64, 0xce, 0x14, 0xdf, 0x8b, 0x3a, 0x0b, 0x6c, 0x72, 0x44, - 0x1f, 0x87, 0x93, 0xbb, 0xb9, 0x1e, 0x29, 0xa5, 0x38, 0xe9, 0x63, 0xbe, 0x1f, 0x4a, 0x7e, 0x79, - 0xfb, 0x77, 0x01, 0x1e, 0xee, 0xb0, 0xd3, 0xa3, 0x39, 0xd3, 0x9a, 0xfc, 0x74, 0x52, 0x45, 0x30, - 0x93, 0x59, 0xd8, 0xd0, 0x19, 0x24, 0x16, 0x54, 0xe1, 0x1d, 0x2f, 0xa8, 0x1f, 0xb2, 0x34, 0xe5, - 0x0d, 0x77, 0xe7, 0xfd, 0xf0, 0x01, 0x4f, 0xb0, 0x43, 0xd4, 0xe6, 0x6c, 0x66, 0xa8, 0x44, 0x9e, - 0xeb, 0xb9, 0x39, 0xbd, 0xeb, 0x48, 0xbe, 0x96, 0x1d, 0xbc, 0x99, 0x6b, 0x4b, 0x2e, 0x1d, 0xf4, - 0xfb, 0x8f, 0x2a, 0x90, 0xf3, 0x1f, 0x5a, 0x70, 0x32, 0x05, 0xe6, 0x6d, 0x20, 0xa1, 0x88, 0x2f, - 0xb6, 0xfe, 0x8e, 0x1b, 0x2f, 0x19, 0xf2, 0x6f, 0xb8, 0x2c, 0xbe, 0xe1, 0x64, 0x2e, 0x5d, 0xb2, - 0xe9, 0x5f, 0xfc, 0x93, 0xf2, 0x14, 0xab, 0xc0, 0x24, 0xc4, 0xf9, 0x4d, 0x47, 0x2d, 0x38, 0x5b, - 0x6b, 0x07, 0x41, 0x3c, 0x59, 0x33, 0x16, 0x27, 0xbf, 0xeb, 0x3d, 0x76, 0x77, 0xbf, 0x7c, 0x76, - 0xa1, 0x0b, 0x2d, 0xee, 0xca, 0x0d, 0x79, 0x80, 0x9a, 0x29, 0xbf, 0x2f, 0x91, 0x18, 0x3e, 0xd3, - 0x53, 0x23, 0xed, 0x25, 0xc6, 0x1f, 0xb0, 0x66, 0x78, 0x8f, 0x65, 0x70, 0x3e, 0x5a, 0xed, 0xc9, - 0xb7, 0x26, 0x32, 0xf7, 0xcc, 0x2a, 0x9c, 0xe9, 0x3c, 0x99, 0x0e, 0xf4, 0x78, 0xfe, 0x0f, 0x2c, - 0x38, 0xdd, 0x31, 0x42, 0xd3, 0xb7, 0xe1, 0x65, 0xc1, 0xfe, 0x9c, 0x05, 0x8f, 0x64, 0x96, 0x30, - 0x5c, 0x0c, 0x2f, 0x40, 0xa9, 0x96, 0x48, 0x6b, 0x1c, 0xc7, 0x2a, 0x51, 0x29, 0x8d, 0x63, 0x1a, - 0xc3, 0x93, 0xb0, 0xd0, 0xd5, 0x93, 0xf0, 0x37, 0x2d, 0x48, 0x1d, 0xf5, 0x47, 0x20, 0x79, 0xae, - 0x98, 0x92, 0xe7, 0x63, 0xbd, 0xf4, 0x66, 0x8e, 0xd0, 0xf9, 0x97, 0xe3, 0x70, 0x22, 0xe7, 0xed, - 0xeb, 0x2e, 0x4c, 0x6e, 0xd5, 0x88, 0x19, 0xec, 0xa0, 0x53, 0x10, 0xb0, 0x8e, 0x91, 0x11, 0x78, - 0x36, 0xe9, 0x14, 0x09, 0x4e, 0x57, 0x81, 0x3e, 0x67, 0xc1, 0x31, 0xe7, 0x56, 0xb8, 0x44, 0x6f, - 0x10, 0x6e, 0x6d, 0xbe, 0xe1, 0xd7, 0x76, 0xa8, 0x60, 0x26, 0x97, 0xd5, 0x0b, 0x99, 0x5a, 0xdd, - 0x1b, 0xd5, 0x14, 0xbd, 0x51, 0xfd, 0xf4, 0xdd, 0xfd, 0xf2, 0xb1, 0x2c, 0x2a, 0x9c, 0x59, 0x17, - 0xc2, 0x22, 0x7b, 0x8f, 0x13, 0x6d, 0x77, 0x0a, 0xc7, 0x91, 0xf5, 0x48, 0x99, 0x8b, 0xc4, 0x12, - 0x83, 0x15, 0x1f, 0xf4, 0x29, 0x28, 0x6d, 0xc9, 0x97, 0xf7, 0x19, 0x22, 0x77, 0xdc, 0x91, 0x9d, - 0xe3, 0x11, 0x70, 0xd7, 0x0c, 0x45, 0x84, 0x63, 0xa6, 0xe8, 0x35, 0x28, 0x7a, 0x9b, 0x61, 0xa7, - 0xf4, 0xfb, 0x09, 0x1f, 0x5c, 0x1e, 0xf4, 0x66, 0x7d, 0xb9, 0x8a, 0x69, 0x41, 0x74, 0x19, 0x8a, - 0xc1, 0xcd, 0xba, 0x30, 0x49, 0x64, 0x2e, 0x52, 0x3c, 0xbf, 0x98, 0xd3, 0x2a, 0xc6, 0x09, 0xcf, - 0x2f, 0x62, 0xca, 0x02, 0x55, 0xa0, 0x9f, 0x3d, 0x18, 0x15, 0xa2, 0x6d, 0xe6, 0x55, 0xbe, 0xc3, - 0xc3, 0x6b, 0xfe, 0x18, 0x8d, 0x11, 0x60, 0xce, 0x08, 0x6d, 0xc0, 0x40, 0x8d, 0xa5, 0x6a, 0x17, - 0xb2, 0xec, 0xfb, 0x33, 0x8d, 0x0f, 0x1d, 0x72, 0xd8, 0x0b, 0x5d, 0x3c, 0xa3, 0xc0, 0x82, 0x17, - 0xe3, 0x4a, 0x5a, 0xdb, 0x9b, 0xf2, 0xc4, 0xca, 0xe6, 0x4a, 0x5a, 0xdb, 0xcb, 0xd5, 0x8e, 0x5c, - 0x19, 0x05, 0x16, 0xbc, 0xd0, 0xcb, 0x50, 0xd8, 0xac, 0x89, 0xc7, 0xa0, 0x99, 0x56, 0x08, 0x33, - 0x6e, 0xd1, 0xfc, 0xc0, 0xdd, 0xfd, 0x72, 0x61, 0x79, 0x01, 0x17, 0x36, 0x6b, 0x68, 0x1d, 0x06, - 0x37, 0x79, 0xa4, 0x13, 0x61, 0x68, 0x78, 0x22, 0x3b, 0x08, 0x4b, 0x2a, 0x18, 0x0a, 0x7f, 0x58, - 0x28, 0x10, 0x58, 0x32, 0x61, 0xc9, 0x64, 0x54, 0xc4, 0x16, 0x11, 0x30, 0x72, 0xf6, 0x60, 0x51, - 0x76, 0xf8, 0x55, 0x23, 0x8e, 0xfb, 0x82, 0x35, 0x8e, 0x74, 0x56, 0x3b, 0x77, 0xda, 0x01, 0xcb, - 0x26, 0x20, 0x22, 0x8b, 0x65, 0xce, 0xea, 0x39, 0x49, 0xd4, 0x69, 0x56, 0x2b, 0x22, 0x1c, 0x33, - 0x45, 0x3b, 0x30, 0xba, 0x1b, 0xb6, 0xb6, 0x89, 0x5c, 0xd2, 0x2c, 0xd0, 0x58, 0x8e, 0x34, 0x7b, - 0x5d, 0x10, 0xba, 0x41, 0xd4, 0x76, 0x1a, 0xa9, 0x5d, 0x88, 0x5d, 0x6b, 0xae, 0xeb, 0xcc, 0xb0, - 0xc9, 0x9b, 0x76, 0xff, 0xdb, 0x6d, 0xff, 0xe6, 0x5e, 0x44, 0x44, 0x9c, 0xc7, 0xcc, 0xee, 0x7f, - 0x83, 0x93, 0xa4, 0xbb, 0x5f, 0x20, 0xb0, 0x64, 0x82, 0xae, 0x8b, 0xee, 0x61, 0xbb, 0xe7, 0x44, - 0x7e, 0x10, 0xe9, 0x39, 0x49, 0x94, 0xd3, 0x29, 0x6c, 0xb7, 0x8c, 0x59, 0xb1, 0x5d, 0xb2, 0xb5, - 0xed, 0x47, 0xbe, 0x97, 0xd8, 0xa1, 0x27, 0xf3, 0x77, 0xc9, 0x4a, 0x06, 0x7d, 0x7a, 0x97, 0xcc, - 0xa2, 0xc2, 0x99, 0x75, 0xa1, 0x3a, 0x8c, 0xb5, 0xfc, 0x20, 0xba, 0xe5, 0x07, 0x72, 0x7e, 0xa1, - 0x0e, 0x8a, 0x52, 0x83, 0x52, 0xd4, 0xc8, 0x42, 0xa8, 0x9a, 0x18, 0x9c, 0xe0, 0x89, 0x3e, 0x0a, - 0x83, 0x61, 0xcd, 0x69, 0x90, 0x95, 0xab, 0xd3, 0x53, 0xf9, 0xc7, 0x4f, 0x95, 0x93, 0xe4, 0xcc, - 0x2e, 0x1e, 0xa8, 0x86, 0x93, 0x60, 0xc9, 0x0e, 0x2d, 0x43, 0x3f, 0x4b, 0xd2, 0xca, 0x82, 0x92, - 0xe6, 0xc4, 0xc2, 0x4e, 0x3d, 0xf7, 0xe0, 0x7b, 0x13, 0x03, 0x63, 0x5e, 0x9c, 0xae, 0x01, 0xa1, - 0x29, 0xf0, 0xc3, 0xe9, 0xe3, 0xf9, 0x6b, 0x40, 0x28, 0x18, 0xae, 0x56, 0x3b, 0xad, 0x01, 0x45, - 0x84, 0x63, 0xa6, 0x74, 0x67, 0xa6, 0xbb, 0xe9, 0x89, 0x0e, 0xae, 0x7c, 0xb9, 0x7b, 0x29, 0xdb, - 0x99, 0xe9, 0x4e, 0x4a, 0x59, 0xd8, 0xbf, 0x3e, 0x94, 0x96, 0x59, 0x98, 0x86, 0xe9, 0xff, 0xb0, - 0x52, 0xce, 0x07, 0x1f, 0xe8, 0x55, 0xe1, 0x7d, 0x88, 0x17, 0xd7, 0xcf, 0x59, 0x70, 0xa2, 0x95, - 0xf9, 0x21, 0x42, 0x00, 0xe8, 0x4d, 0x6f, 0xce, 0x3f, 0x5d, 0x05, 0xb0, 0xcd, 0xc6, 0xe3, 0x9c, - 0x9a, 0x92, 0xca, 0x81, 0xe2, 0x3b, 0x56, 0x0e, 0xac, 0xc1, 0x50, 0x8d, 0xdf, 0xe4, 0x64, 0xe0, - 0xf5, 0x9e, 0xc2, 0x2f, 0x32, 0x51, 0x42, 0x5c, 0x01, 0x37, 0xb1, 0x62, 0x81, 0x7e, 0xd8, 0x82, - 0xd3, 0xc9, 0xa6, 0x63, 0xc2, 0xd0, 0x22, 0xea, 0x2d, 0x57, 0x6b, 0x2d, 0x8b, 0xef, 0x4f, 0xc9, - 0xff, 0x06, 0xf1, 0xbd, 0x6e, 0x04, 0xb8, 0x73, 0x65, 0x68, 0x31, 0x43, 0xaf, 0x36, 0x60, 0x5a, - 0x14, 0x7b, 0xd0, 0xad, 0xbd, 0x00, 0x23, 0x4d, 0xbf, 0xed, 0x45, 0xc2, 0xf3, 0x4f, 0x78, 0x21, - 0x31, 0xef, 0x9b, 0x35, 0x0d, 0x8e, 0x0d, 0xaa, 0x84, 0x46, 0x6e, 0xe8, 0xbe, 0x35, 0x72, 0x6f, - 0xc1, 0x88, 0xa7, 0xb9, 0xaa, 0x77, 0xba, 0xc1, 0x0a, 0xed, 0xa2, 0x46, 0xcd, 0x5b, 0xa9, 0x43, - 0xb0, 0xc1, 0xad, 0xb3, 0xb6, 0x0c, 0xde, 0x99, 0xb6, 0xec, 0x68, 0xfd, 0x0d, 0x7f, 0xbe, 0x90, - 0x71, 0x63, 0xe0, 0x5a, 0xb9, 0x57, 0x4d, 0xad, 0xdc, 0xb9, 0xa4, 0x56, 0x2e, 0x65, 0xaa, 0x32, - 0x14, 0x72, 0xbd, 0x67, 0x87, 0xeb, 0x39, 0xa4, 0xee, 0xf7, 0x5a, 0xf0, 0x10, 0xb3, 0x7d, 0xd0, - 0x0a, 0xde, 0xb1, 0xbd, 0xe3, 0xe1, 0xbb, 0xfb, 0xe5, 0x87, 0x56, 0xb3, 0xd9, 0xe1, 0xbc, 0x7a, - 0xec, 0x06, 0x9c, 0xed, 0x76, 0xee, 0x32, 0x1f, 0xd7, 0xba, 0x72, 0x8e, 0x88, 0x7d, 0x5c, 0xeb, - 0x2b, 0x8b, 0x98, 0x61, 0x7a, 0x0d, 0x18, 0x67, 0xff, 0x07, 0x0b, 0x8a, 0x15, 0xbf, 0x7e, 0x04, - 0x37, 0xfa, 0x0f, 0x1b, 0x37, 0xfa, 0x87, 0xb3, 0x4f, 0xfc, 0x7a, 0xae, 0xb1, 0x6f, 0x29, 0x61, - 0xec, 0x3b, 0x9d, 0xc7, 0xa0, 0xb3, 0x69, 0xef, 0xa7, 0x8a, 0x30, 0x5c, 0xf1, 0xeb, 0x6a, 0x9d, - 0xfd, 0x93, 0xfb, 0x79, 0x60, 0x92, 0x9b, 0xef, 0x47, 0xe3, 0xcc, 0x5c, 0x63, 0x65, 0xc8, 0x81, - 0x6f, 0xb3, 0x77, 0x26, 0x37, 0x88, 0xbb, 0xb5, 0x1d, 0x91, 0x7a, 0xf2, 0x73, 0x8e, 0xee, 0x9d, - 0xc9, 0x37, 0x8b, 0x30, 0x9e, 0xa8, 0x1d, 0x35, 0x60, 0xb4, 0xa1, 0x9b, 0x92, 0xc4, 0x3c, 0xbd, - 0x2f, 0x2b, 0x94, 0xf0, 0xd3, 0xd7, 0x40, 0xd8, 0x64, 0x8e, 0x66, 0x01, 0x94, 0x6f, 0x85, 0xd4, - 0xf6, 0xb3, 0x6b, 0x8d, 0x72, 0xbe, 0x08, 0xb1, 0x46, 0x81, 0x5e, 0x84, 0xe1, 0xc8, 0x6f, 0xf9, - 0x0d, 0x7f, 0x6b, 0xef, 0x0a, 0x91, 0xb1, 0x04, 0x95, 0xf7, 0xed, 0x46, 0x8c, 0xc2, 0x3a, 0x1d, - 0xba, 0x0d, 0x93, 0x8a, 0x49, 0xf5, 0x10, 0xcc, 0x6b, 0x4c, 0x6d, 0xb2, 0x9e, 0xe4, 0x88, 0xd3, - 0x95, 0xa0, 0x97, 0x61, 0x8c, 0xb9, 0x01, 0xb3, 0xf2, 0x57, 0xc8, 0x9e, 0x8c, 0x31, 0xcb, 0x24, - 0xec, 0x35, 0x03, 0x83, 0x13, 0x94, 0x68, 0x01, 0x26, 0x9b, 0x6e, 0x98, 0x28, 0x3e, 0xc0, 0x8a, - 0xb3, 0x06, 0xac, 0x25, 0x91, 0x38, 0x4d, 0x6f, 0xff, 0xac, 0x18, 0x63, 0x2f, 0x72, 0xdf, 0x5b, - 0x8e, 0xef, 0xee, 0xe5, 0xf8, 0x0d, 0x0b, 0x26, 0x68, 0xed, 0xcc, 0xb7, 0x51, 0x0a, 0x52, 0x2a, - 0x0b, 0x81, 0xd5, 0x21, 0x0b, 0xc1, 0x39, 0xba, 0x6d, 0xd7, 0xfd, 0x76, 0x24, 0xb4, 0xa3, 0xda, - 0xbe, 0x4c, 0xa1, 0x58, 0x60, 0x05, 0x1d, 0x09, 0x02, 0xf1, 0x1e, 0x5b, 0xa7, 0x23, 0x41, 0x80, - 0x05, 0x56, 0x26, 0x29, 0xe8, 0xcb, 0x4e, 0x52, 0xc0, 0x63, 0x4d, 0x0b, 0x2f, 0x38, 0x21, 0xd2, - 0x6a, 0xb1, 0xa6, 0xa5, 0x7b, 0x5c, 0x4c, 0x63, 0x7f, 0xad, 0x08, 0x23, 0x15, 0xbf, 0x1e, 0x3b, - 0x76, 0xbc, 0x60, 0x38, 0x76, 0x9c, 0x4d, 0x38, 0x76, 0x4c, 0xe8, 0xb4, 0xef, 0xb9, 0x71, 0x7c, - 0xab, 0xdc, 0x38, 0x7e, 0xc3, 0x62, 0xa3, 0xb6, 0xb8, 0x5e, 0xe5, 0xae, 0xb2, 0xe8, 0x22, 0x0c, - 0xb3, 0x1d, 0x8e, 0x05, 0x00, 0x90, 0xde, 0x0e, 0x2c, 0x69, 0xe0, 0x7a, 0x0c, 0xc6, 0x3a, 0x0d, - 0x3a, 0x0f, 0x43, 0x21, 0x71, 0x82, 0xda, 0xb6, 0xda, 0xde, 0x85, 0x6b, 0x02, 0x87, 0x61, 0x85, - 0x45, 0x6f, 0xc4, 0x61, 0x8e, 0x8b, 0xf9, 0x0f, 0x8a, 0xf5, 0xf6, 0xf0, 0x25, 0x92, 0x1f, 0xdb, - 0xd8, 0xbe, 0x01, 0x28, 0x4d, 0xdf, 0x43, 0x20, 0xce, 0xb2, 0x19, 0x88, 0xb3, 0x94, 0x0a, 0xc2, - 0xf9, 0xd7, 0x16, 0x8c, 0x55, 0xfc, 0x3a, 0x5d, 0xba, 0xdf, 0x49, 0xeb, 0x54, 0x8f, 0xf1, 0x3e, - 0xd0, 0x21, 0xc6, 0xfb, 0xa3, 0xd0, 0x5f, 0xf1, 0xeb, 0x5d, 0x82, 0x85, 0xfe, 0x2d, 0x0b, 0x06, - 0x2b, 0x7e, 0xfd, 0x08, 0x0c, 0x2f, 0xaf, 0x9a, 0x86, 0x97, 0x87, 0x72, 0xe6, 0x4d, 0x8e, 0xad, - 0xe5, 0xff, 0xef, 0x83, 0x51, 0xda, 0x4e, 0x7f, 0x4b, 0x0e, 0xa5, 0xd1, 0x6d, 0x56, 0x0f, 0xdd, - 0x46, 0xaf, 0x01, 0x7e, 0xa3, 0xe1, 0xdf, 0x4a, 0x0e, 0xeb, 0x32, 0x83, 0x62, 0x81, 0x45, 0xcf, - 0xc0, 0x50, 0x2b, 0x20, 0xbb, 0xae, 0x2f, 0xe4, 0x6b, 0xcd, 0x8c, 0x55, 0x11, 0x70, 0xac, 0x28, - 0xe8, 0xc5, 0x3b, 0x74, 0x3d, 0x2a, 0x4b, 0xd4, 0x7c, 0xaf, 0xce, 0x6d, 0x13, 0x45, 0x91, 0x88, - 0x48, 0x83, 0x63, 0x83, 0x0a, 0xdd, 0x80, 0x12, 0xfb, 0xcf, 0xb6, 0x9d, 0x83, 0xa7, 0x40, 0x17, - 0xa9, 0x59, 0x05, 0x03, 0x1c, 0xf3, 0x42, 0xcf, 0x01, 0x44, 0x32, 0x99, 0x47, 0x28, 0x82, 0x46, - 0xaa, 0xbb, 0x88, 0x4a, 0xf3, 0x11, 0x62, 0x8d, 0x0a, 0x3d, 0x0d, 0xa5, 0xc8, 0x71, 0x1b, 0xab, - 0xae, 0xc7, 0xec, 0xf7, 0xb4, 0xfd, 0x22, 0x43, 0xaa, 0x00, 0xe2, 0x18, 0x4f, 0x65, 0x41, 0x16, - 0x0e, 0x68, 0x7e, 0x2f, 0x12, 0xc9, 0xc0, 0x8a, 0x5c, 0x16, 0x5c, 0x55, 0x50, 0xac, 0x51, 0xa0, - 0x6d, 0x38, 0xe5, 0x7a, 0x2c, 0x69, 0x0f, 0xa9, 0xee, 0xb8, 0xad, 0x8d, 0xd5, 0xea, 0x75, 0x12, - 0xb8, 0x9b, 0x7b, 0xf3, 0x4e, 0x6d, 0x87, 0x78, 0x32, 0xb9, 0xf5, 0x63, 0xa2, 0x89, 0xa7, 0x56, - 0x3a, 0xd0, 0xe2, 0x8e, 0x9c, 0xec, 0xe7, 0xd9, 0x7c, 0xbf, 0x5a, 0x45, 0x4f, 0x19, 0x5b, 0xc7, - 0x09, 0x7d, 0xeb, 0xb8, 0xb7, 0x5f, 0x1e, 0xb8, 0x5a, 0xd5, 0x62, 0xd2, 0xbc, 0x04, 0xc7, 0x2b, - 0x7e, 0xbd, 0xe2, 0x07, 0xd1, 0xb2, 0x1f, 0xdc, 0x72, 0x82, 0xba, 0x9c, 0x5e, 0x65, 0x19, 0x95, - 0x87, 0xee, 0x9f, 0xfd, 0x7c, 0x77, 0x31, 0x22, 0xee, 0x3c, 0xcf, 0x24, 0xb6, 0x03, 0x3e, 0xb7, - 0xac, 0x31, 0xd9, 0x41, 0xa5, 0xbd, 0xba, 0xe4, 0x44, 0x04, 0x5d, 0x85, 0xd1, 0x9a, 0x7e, 0x8c, - 0x8a, 0xe2, 0x4f, 0xca, 0x83, 0xcc, 0x38, 0x63, 0x33, 0xcf, 0x5d, 0xb3, 0xbc, 0xfd, 0x59, 0x51, - 0x09, 0x57, 0x44, 0x70, 0x97, 0xd6, 0x5e, 0xf2, 0xbf, 0xcb, 0xbc, 0x38, 0x85, 0xfc, 0x98, 0x87, - 0xdc, 0xae, 0xdc, 0x31, 0x2f, 0x8e, 0xfd, 0xdd, 0x70, 0x22, 0x59, 0x7d, 0xcf, 0x49, 0xe8, 0x17, - 0x60, 0x32, 0xd0, 0x0b, 0x6a, 0x49, 0x06, 0x8f, 0xf3, 0x5c, 0x26, 0x09, 0x24, 0x4e, 0xd3, 0xdb, - 0x2f, 0xc2, 0x24, 0xbd, 0xfc, 0x2a, 0x41, 0x8e, 0xf5, 0x72, 0xf7, 0xf0, 0x44, 0xff, 0xb1, 0x9f, - 0x1d, 0x44, 0x89, 0x8c, 0x53, 0xe8, 0x93, 0x30, 0x16, 0x92, 0x55, 0xd7, 0x6b, 0xdf, 0x96, 0xba, - 0xb5, 0x0e, 0xef, 0x8c, 0xab, 0x4b, 0x3a, 0x25, 0xbf, 0x3f, 0x98, 0x30, 0x9c, 0xe0, 0x86, 0x9a, - 0x30, 0x76, 0xcb, 0xf5, 0xea, 0xfe, 0xad, 0x50, 0xf2, 0x1f, 0xca, 0x57, 0xd4, 0xdf, 0xe0, 0x94, - 0x89, 0x36, 0x1a, 0xd5, 0xdd, 0x30, 0x98, 0xe1, 0x04, 0x73, 0xba, 0xd8, 0x83, 0xb6, 0x37, 0x17, - 0x5e, 0x0b, 0x09, 0x7f, 0x39, 0x2a, 0x16, 0x3b, 0x96, 0x40, 0x1c, 0xe3, 0xe9, 0x62, 0x67, 0x7f, - 0x2e, 0x05, 0x7e, 0x9b, 0xa7, 0x37, 0x12, 0x8b, 0x1d, 0x2b, 0x28, 0xd6, 0x28, 0xe8, 0x66, 0xc8, - 0xfe, 0xad, 0xfb, 0x1e, 0xf6, 0xfd, 0x48, 0x6e, 0x9f, 0x2c, 0x3d, 0x9f, 0x06, 0xc7, 0x06, 0x15, - 0x5a, 0x06, 0x14, 0xb6, 0x5b, 0xad, 0x06, 0x73, 0x5d, 0x74, 0x1a, 0x8c, 0x15, 0x77, 0xbb, 0x2a, - 0x72, 0xef, 0x96, 0x6a, 0x0a, 0x8b, 0x33, 0x4a, 0xd0, 0x73, 0x71, 0x53, 0x34, 0xb5, 0x9f, 0x35, - 0x95, 0x1b, 0xf5, 0xaa, 0xbc, 0x9d, 0x12, 0x87, 0x96, 0x60, 0x30, 0xdc, 0x0b, 0x6b, 0x51, 0x23, - 0xec, 0x94, 0x0c, 0xb1, 0xca, 0x48, 0xb4, 0x5c, 0xbc, 0xbc, 0x08, 0x96, 0x65, 0x51, 0x0d, 0xa6, - 0x04, 0xc7, 0x85, 0x6d, 0xc7, 0x53, 0x29, 0xda, 0xb8, 0xf7, 0xde, 0xc5, 0xbb, 0xfb, 0xe5, 0x29, - 0x51, 0xb3, 0x8e, 0xbe, 0xb7, 0x5f, 0xa6, 0x8b, 0x23, 0x03, 0x83, 0xb3, 0xb8, 0xf1, 0xc9, 0x57, - 0xab, 0xf9, 0xcd, 0x56, 0x25, 0xf0, 0x37, 0xdd, 0x06, 0xe9, 0x64, 0x18, 0xad, 0x1a, 0x94, 0x62, - 0xf2, 0x19, 0x30, 0x9c, 0xe0, 0x66, 0x7f, 0x96, 0xc9, 0x8e, 0x55, 0x77, 0xcb, 0x73, 0xa2, 0x76, - 0x40, 0x50, 0x13, 0x46, 0x5b, 0x6c, 0x77, 0x11, 0x49, 0x87, 0xc4, 0x5c, 0x7f, 0xa1, 0x47, 0xfd, - 0xd7, 0x2d, 0x96, 0x36, 0xd1, 0xf0, 0x83, 0xac, 0xe8, 0xec, 0xb0, 0xc9, 0xdd, 0xfe, 0x17, 0x27, - 0x99, 0xf4, 0x51, 0xe5, 0x4a, 0xad, 0x41, 0xf1, 0x6c, 0x4c, 0x5c, 0x63, 0x67, 0xf2, 0xd5, 0xc7, - 0xf1, 0xb0, 0x88, 0xa7, 0x67, 0x58, 0x96, 0x45, 0x9f, 0x80, 0x31, 0x7a, 0x2b, 0x54, 0x12, 0x40, - 0x38, 0x7d, 0x2c, 0x3f, 0xbc, 0x8f, 0xa2, 0xd2, 0x13, 0x92, 0xe9, 0x85, 0x71, 0x82, 0x19, 0x7a, - 0x83, 0xb9, 0x06, 0x4a, 0xd6, 0x85, 0x5e, 0x58, 0xeb, 0x5e, 0x80, 0x92, 0xad, 0xc6, 0x04, 0xb5, - 0x61, 0x2a, 0x9d, 0x76, 0x35, 0x9c, 0xb6, 0xf3, 0xc5, 0xeb, 0x74, 0xe6, 0xd4, 0x38, 0x73, 0x54, - 0x1a, 0x17, 0xe2, 0x2c, 0xfe, 0x68, 0x35, 0x99, 0x14, 0xb3, 0x68, 0x28, 0x9e, 0x53, 0x89, 0x31, - 0x47, 0x3b, 0xe6, 0xc3, 0xdc, 0x82, 0xd3, 0x5a, 0x5e, 0xc1, 0x4b, 0x81, 0xc3, 0x5c, 0x53, 0x5c, - 0xb6, 0x9d, 0x6a, 0x72, 0xd1, 0x23, 0x77, 0xf7, 0xcb, 0xa7, 0x37, 0x3a, 0x11, 0xe2, 0xce, 0x7c, - 0xd0, 0x55, 0x38, 0xce, 0x83, 0x53, 0x2c, 0x12, 0xa7, 0xde, 0x70, 0x3d, 0x25, 0x78, 0xf1, 0x25, - 0x7f, 0xf2, 0xee, 0x7e, 0xf9, 0xf8, 0x5c, 0x16, 0x01, 0xce, 0x2e, 0x87, 0x5e, 0x85, 0x52, 0xdd, - 0x0b, 0x45, 0x1f, 0x0c, 0x18, 0xa9, 0x1b, 0x4b, 0x8b, 0xeb, 0x55, 0xf5, 0xfd, 0xf1, 0x1f, 0x1c, - 0x17, 0x40, 0x5b, 0xdc, 0xf2, 0xa1, 0xd4, 0x55, 0x83, 0xa9, 0x98, 0x85, 0x49, 0x8d, 0xae, 0xf1, - 0x3c, 0x9d, 0x9b, 0xfc, 0xd4, 0xab, 0x2d, 0xe3, 0xe5, 0xba, 0xc1, 0x18, 0xbd, 0x0e, 0x48, 0xa4, - 0x08, 0x99, 0xab, 0xb1, 0x8c, 0x56, 0x9a, 0x3b, 0xa2, 0xba, 0x85, 0x56, 0x53, 0x14, 0x38, 0xa3, - 0x14, 0xba, 0x4c, 0x77, 0x15, 0x1d, 0x2a, 0x76, 0x2d, 0x95, 0x20, 0x78, 0x91, 0xb4, 0x02, 0xc2, - 0x3c, 0xe8, 0x4c, 0x8e, 0x38, 0x51, 0x0e, 0xd5, 0xe1, 0x94, 0xd3, 0x8e, 0x7c, 0x66, 0x54, 0x32, - 0x49, 0x37, 0xfc, 0x1d, 0xe2, 0x31, 0x7b, 0xee, 0x10, 0x8b, 0x85, 0x78, 0x6a, 0xae, 0x03, 0x1d, - 0xee, 0xc8, 0x85, 0x4a, 0xe4, 0x32, 0xe7, 0xbf, 0xb0, 0xf7, 0x18, 0x2f, 0x6d, 0xb9, 0x11, 0x54, - 0x52, 0xa0, 0x17, 0x61, 0x78, 0xdb, 0x0f, 0xa3, 0x75, 0x12, 0xdd, 0xf2, 0x83, 0x1d, 0x11, 0x93, - 0x3c, 0xce, 0x03, 0x11, 0xa3, 0xb0, 0x4e, 0x47, 0xaf, 0xdc, 0xcc, 0xdb, 0x68, 0x65, 0x91, 0x39, - 0x7a, 0x0c, 0xc5, 0x7b, 0xcc, 0x65, 0x0e, 0xc6, 0x12, 0x2f, 0x49, 0x57, 0x2a, 0x0b, 0xcc, 0x69, - 0x23, 0x41, 0xba, 0x52, 0x59, 0xc0, 0x12, 0x4f, 0xa7, 0x6b, 0xb8, 0xed, 0x04, 0xa4, 0x12, 0xf8, - 0x35, 0x12, 0x6a, 0xd9, 0x47, 0x1e, 0xe6, 0x11, 0xd7, 0xe9, 0x74, 0xad, 0x66, 0x11, 0xe0, 0xec, - 0x72, 0x88, 0xa4, 0x73, 0x6a, 0x8e, 0xe5, 0x5b, 0xdb, 0xd2, 0xf2, 0x4c, 0x8f, 0x69, 0x35, 0x3d, - 0x98, 0x50, 0xd9, 0x3c, 0x79, 0x8c, 0xf5, 0x70, 0x7a, 0x9c, 0xcd, 0xed, 0xde, 0x03, 0xb4, 0x2b, - 0xfb, 0xe5, 0x4a, 0x82, 0x13, 0x4e, 0xf1, 0x36, 0x82, 0x6d, 0x4e, 0x74, 0x0d, 0xb6, 0x79, 0x01, - 0x4a, 0x61, 0xfb, 0x66, 0xdd, 0x6f, 0x3a, 0xae, 0xc7, 0x9c, 0x36, 0xb4, 0xbb, 0x5f, 0x55, 0x22, - 0x70, 0x4c, 0x83, 0x96, 0x61, 0xc8, 0x91, 0xc6, 0x49, 0x94, 0x1f, 0x47, 0x4c, 0x99, 0x24, 0x79, - 0x68, 0x1d, 0x69, 0x8e, 0x54, 0x65, 0xd1, 0x2b, 0x30, 0x2a, 0x82, 0x2b, 0x88, 0x04, 0xd8, 0x53, - 0xe6, 0x0b, 0xd8, 0xaa, 0x8e, 0xc4, 0x26, 0x2d, 0xba, 0x06, 0xc3, 0x91, 0xdf, 0x60, 0xcf, 0x38, - 0xa9, 0x98, 0x77, 0x22, 0x3f, 0xdc, 0xe7, 0x86, 0x22, 0xd3, 0xd5, 0xe6, 0xaa, 0x28, 0xd6, 0xf9, - 0xa0, 0x0d, 0x3e, 0xdf, 0x59, 0xae, 0x11, 0x12, 0x8a, 0x0c, 0xca, 0xa7, 0xf3, 0x3c, 0xee, 0x18, - 0x99, 0xb9, 0x1c, 0x44, 0x49, 0xac, 0xb3, 0x41, 0x97, 0x60, 0xb2, 0x15, 0xb8, 0x3e, 0x9b, 0x13, - 0xca, 0xd8, 0x3a, 0x6d, 0x66, 0x16, 0xac, 0x24, 0x09, 0x70, 0xba, 0x0c, 0x8b, 0x8d, 0x21, 0x80, - 0xd3, 0x27, 0x79, 0x76, 0x24, 0x7e, 0x95, 0xe6, 0x30, 0xac, 0xb0, 0x68, 0x8d, 0xed, 0xc4, 0x5c, - 0x0b, 0x34, 0x3d, 0x93, 0x1f, 0xba, 0x4c, 0xd7, 0x16, 0x71, 0xe1, 0x55, 0xfd, 0xc5, 0x31, 0x07, - 0x54, 0xd7, 0x92, 0x12, 0xd3, 0x2b, 0x40, 0x38, 0x7d, 0xaa, 0x83, 0xcb, 0x67, 0xe2, 0x56, 0x16, - 0x0b, 0x04, 0x06, 0x38, 0xc4, 0x09, 0x9e, 0xe8, 0x23, 0x30, 0x21, 0xe2, 0xd0, 0xc6, 0xdd, 0x74, - 0x3a, 0x7e, 0x16, 0x83, 0x13, 0x38, 0x9c, 0xa2, 0xe6, 0xd9, 0x89, 0x9c, 0x9b, 0x0d, 0x22, 0xb6, - 0xbe, 0x55, 0xd7, 0xdb, 0x09, 0xa7, 0xcf, 0xb0, 0xfd, 0x41, 0x64, 0x27, 0x4a, 0x62, 0x71, 0x46, - 0x09, 0xb4, 0x01, 0x13, 0xad, 0x80, 0x90, 0x26, 0x13, 0xf4, 0xc5, 0x79, 0x56, 0xe6, 0xa1, 0x61, - 0x68, 0x4b, 0x2a, 0x09, 0xdc, 0xbd, 0x0c, 0x18, 0x4e, 0x71, 0x40, 0xb7, 0x60, 0xc8, 0xdf, 0x25, - 0xc1, 0x36, 0x71, 0xea, 0xd3, 0x67, 0x3b, 0x3c, 0xd6, 0x12, 0x87, 0xdb, 0x55, 0x41, 0x9b, 0xf0, - 0x65, 0x91, 0xe0, 0xee, 0xbe, 0x2c, 0xb2, 0x32, 0xf4, 0x7f, 0x5a, 0x70, 0x52, 0x5a, 0x87, 0xaa, - 0x2d, 0xda, 0xeb, 0x0b, 0xbe, 0x17, 0x46, 0x01, 0x0f, 0x66, 0xf2, 0x48, 0x7e, 0x80, 0x8f, 0x8d, - 0x9c, 0x42, 0x4a, 0x11, 0x7d, 0x32, 0x8f, 0x22, 0xc4, 0xf9, 0x35, 0xd2, 0xab, 0x69, 0x48, 0x22, - 0xb9, 0x19, 0xcd, 0x85, 0xcb, 0x6f, 0x2c, 0xae, 0x4f, 0x3f, 0xca, 0x23, 0xb1, 0xd0, 0xc5, 0x50, - 0x4d, 0x22, 0x71, 0x9a, 0x1e, 0x5d, 0x84, 0x82, 0x1f, 0x4e, 0x3f, 0xd6, 0x21, 0x8f, 0xb5, 0x5f, - 0xbf, 0x5a, 0xe5, 0x3e, 0x8d, 0x57, 0xab, 0xb8, 0xe0, 0x87, 0x32, 0x43, 0x10, 0xbd, 0x8f, 0x85, - 0xd3, 0x8f, 0x73, 0xb5, 0xa5, 0xcc, 0x10, 0xc4, 0x80, 0x38, 0xc6, 0xa3, 0x6d, 0x18, 0x0f, 0x8d, - 0x7b, 0x6f, 0x38, 0x7d, 0x8e, 0xf5, 0xd4, 0xe3, 0x79, 0x83, 0x66, 0x50, 0x6b, 0xa9, 0x3b, 0x4c, - 0x2e, 0x38, 0xc9, 0x96, 0xaf, 0x2e, 0xed, 0xe6, 0x1d, 0x4e, 0x3f, 0xd1, 0x65, 0x75, 0x69, 0xc4, - 0xfa, 0xea, 0xd2, 0x79, 0xe0, 0x04, 0xcf, 0x99, 0xef, 0x82, 0xc9, 0x94, 0xb8, 0x74, 0x10, 0xff, - 0xfd, 0x99, 0x1d, 0x18, 0x35, 0xa6, 0xe4, 0x03, 0x75, 0xef, 0xf8, 0x9d, 0x12, 0x94, 0x94, 0xd9, - 0x1d, 0x5d, 0x30, 0x3d, 0x3a, 0x4e, 0x26, 0x3d, 0x3a, 0x86, 0x2a, 0x7e, 0xdd, 0x70, 0xe2, 0xd8, - 0xc8, 0x88, 0xd7, 0x99, 0xb7, 0x01, 0xf6, 0xfe, 0xc8, 0x48, 0x33, 0x25, 0x14, 0x7b, 0x76, 0x0d, - 0xe9, 0xeb, 0x68, 0x9d, 0xb8, 0x04, 0x93, 0x9e, 0xcf, 0x64, 0x74, 0x52, 0x97, 0x02, 0x18, 0x93, - 0xb3, 0x4a, 0x7a, 0x00, 0xac, 0x04, 0x01, 0x4e, 0x97, 0xa1, 0x15, 0x72, 0x41, 0x29, 0x69, 0x0e, - 0xe1, 0x72, 0x14, 0x16, 0x58, 0x7a, 0x37, 0xe4, 0xbf, 0xc2, 0xe9, 0x89, 0xfc, 0xbb, 0x21, 0x2f, - 0x94, 0x14, 0xc6, 0x42, 0x29, 0x8c, 0x31, 0xed, 0x7f, 0xcb, 0xaf, 0xaf, 0x54, 0x84, 0x98, 0xaf, - 0x45, 0xd2, 0xae, 0xaf, 0x54, 0x30, 0xc7, 0xa1, 0x39, 0x18, 0x60, 0x3f, 0xc2, 0xe9, 0x91, 0xfc, - 0x80, 0x49, 0xac, 0x84, 0x96, 0xa1, 0x90, 0x15, 0xc0, 0xa2, 0x20, 0xd3, 0xee, 0xd2, 0xbb, 0x11, - 0xd3, 0xee, 0x0e, 0xde, 0xa7, 0x76, 0x57, 0x32, 0xc0, 0x31, 0x2f, 0x74, 0x1b, 0x8e, 0x1b, 0xf7, - 0x51, 0xf5, 0xea, 0x0a, 0xf2, 0x0d, 0xbf, 0x09, 0xe2, 0xf9, 0xd3, 0xa2, 0xd1, 0xc7, 0x57, 0xb2, - 0x38, 0xe1, 0xec, 0x0a, 0x50, 0x03, 0x26, 0x6b, 0xa9, 0x5a, 0x87, 0x7a, 0xaf, 0x55, 0xcd, 0x8b, - 0x74, 0x8d, 0x69, 0xc6, 0xe8, 0x15, 0x18, 0x7a, 0xdb, 0xe7, 0x4e, 0x5a, 0xe2, 0x6a, 0x22, 0x23, - 0x7e, 0x0c, 0xbd, 0x71, 0xb5, 0xca, 0xe0, 0xf7, 0xf6, 0xcb, 0xc3, 0x15, 0xbf, 0x2e, 0xff, 0x62, - 0x55, 0x00, 0xfd, 0x80, 0x05, 0x33, 0xe9, 0x0b, 0xaf, 0x6a, 0xf4, 0x68, 0xef, 0x8d, 0xb6, 0x45, - 0xa5, 0x33, 0x4b, 0xb9, 0xec, 0x70, 0x87, 0xaa, 0xd0, 0x87, 0xe8, 0x7a, 0x0a, 0xdd, 0x3b, 0x44, - 0xa4, 0x77, 0x7e, 0x24, 0x5e, 0x4f, 0x14, 0x7a, 0x6f, 0xbf, 0x3c, 0xce, 0x77, 0x46, 0xf7, 0x8e, - 0x8a, 0xf9, 0xcd, 0x0b, 0xa0, 0xef, 0x86, 0xe3, 0x41, 0x5a, 0x83, 0x4a, 0xa4, 0x10, 0xfe, 0x54, - 0x2f, 0xbb, 0x6c, 0x72, 0xc0, 0x71, 0x16, 0x43, 0x9c, 0x5d, 0x8f, 0xfd, 0xab, 0x16, 0xd3, 0x6f, - 0x8b, 0x66, 0x91, 0xb0, 0xdd, 0x38, 0x8a, 0xa4, 0xf2, 0x4b, 0x86, 0xed, 0xf8, 0xbe, 0x3d, 0x9b, - 0xfe, 0xb1, 0xc5, 0x3c, 0x9b, 0x8e, 0xf0, 0x8d, 0xd6, 0x1b, 0x30, 0x14, 0xc9, 0x64, 0xff, 0x1d, - 0xf2, 0xe0, 0x6b, 0x8d, 0x62, 0xde, 0x5d, 0xea, 0x92, 0xa3, 0xf2, 0xfa, 0x2b, 0x36, 0xf6, 0x3f, - 0xe0, 0x23, 0x20, 0x31, 0x47, 0x60, 0xa2, 0x5b, 0x34, 0x4d, 0x74, 0xe5, 0x2e, 0x5f, 0x90, 0x63, - 0xaa, 0xfb, 0xfb, 0x66, 0xbb, 0x99, 0x72, 0xef, 0xdd, 0xee, 0x52, 0x67, 0x7f, 0xc1, 0x02, 0x88, - 0x93, 0x2c, 0xf4, 0x90, 0xce, 0xf5, 0x25, 0x7a, 0xad, 0xf1, 0x23, 0xbf, 0xe6, 0x37, 0x84, 0x81, - 0xe2, 0x54, 0x6c, 0x25, 0xe4, 0xf0, 0x7b, 0xda, 0x6f, 0xac, 0xa8, 0x51, 0x59, 0x46, 0x3d, 0x2d, - 0xc6, 0x76, 0x6b, 0x23, 0xe2, 0xe9, 0x97, 0x2d, 0x38, 0x96, 0xe5, 0xf0, 0x4f, 0x2f, 0xc9, 0x5c, - 0xcd, 0xa9, 0xdc, 0x1d, 0xd5, 0x68, 0x5e, 0x17, 0x70, 0xac, 0x28, 0x7a, 0xce, 0x93, 0x7b, 0xb0, - 0x04, 0x00, 0x57, 0x61, 0xb4, 0x12, 0x10, 0x4d, 0xbe, 0x78, 0x8d, 0x47, 0xd2, 0xe1, 0xed, 0x79, - 0xe6, 0xc0, 0x51, 0x74, 0xec, 0xaf, 0x14, 0xe0, 0x18, 0x77, 0xda, 0x99, 0xdb, 0xf5, 0xdd, 0x7a, - 0xc5, 0xaf, 0x8b, 0x67, 0x9a, 0x6f, 0xc2, 0x48, 0x4b, 0xd3, 0x4d, 0x77, 0x0a, 0x66, 0xad, 0xeb, - 0xb0, 0x63, 0x6d, 0x9a, 0x0e, 0xc5, 0x06, 0x2f, 0x54, 0x87, 0x11, 0xb2, 0xeb, 0xd6, 0x94, 0xe7, - 0x47, 0xe1, 0xc0, 0x87, 0xb4, 0xaa, 0x65, 0x49, 0xe3, 0x83, 0x0d, 0xae, 0x3d, 0xbb, 0xda, 0x6a, - 0x22, 0x5a, 0x5f, 0x17, 0x6f, 0x8f, 0x1f, 0xb5, 0xe0, 0xa1, 0x9c, 0xd0, 0xd7, 0xb4, 0xba, 0x5b, - 0xcc, 0x3d, 0x4a, 0x4c, 0x5b, 0x55, 0x1d, 0x77, 0x9a, 0xc2, 0x02, 0x8b, 0x3e, 0x0a, 0xc0, 0x9d, - 0x9e, 0x88, 0x57, 0xeb, 0x1a, 0x23, 0xd8, 0x08, 0x6f, 0xaa, 0x45, 0xaa, 0x94, 0xe5, 0xb1, 0xc6, - 0xcb, 0xfe, 0x72, 0x1f, 0xf4, 0x33, 0x27, 0x1b, 0x54, 0x81, 0xc1, 0x6d, 0x9e, 0x25, 0xae, 0xe3, - 0xb8, 0x51, 0x5a, 0x99, 0x78, 0x2e, 0x1e, 0x37, 0x0d, 0x8a, 0x25, 0x1b, 0xb4, 0x06, 0x53, 0x3c, - 0x59, 0x5f, 0x63, 0x91, 0x34, 0x9c, 0x3d, 0xa9, 0xf6, 0xe5, 0xf9, 0xe7, 0x95, 0xfa, 0x7b, 0x25, - 0x4d, 0x82, 0xb3, 0xca, 0xa1, 0xd7, 0x60, 0x8c, 0x5e, 0xc3, 0xfd, 0x76, 0x24, 0x39, 0xf1, 0x34, - 0x7d, 0xea, 0x66, 0xb2, 0x61, 0x60, 0x71, 0x82, 0x1a, 0xbd, 0x02, 0xa3, 0xad, 0x94, 0x82, 0xbb, - 0x3f, 0xd6, 0x04, 0x99, 0x4a, 0x6d, 0x93, 0x96, 0xf9, 0xfc, 0xb7, 0xd9, 0x0b, 0x87, 0x8d, 0xed, - 0x80, 0x84, 0xdb, 0x7e, 0xa3, 0xce, 0x24, 0xe0, 0x7e, 0xcd, 0xe7, 0x3f, 0x81, 0xc7, 0xa9, 0x12, - 0x94, 0xcb, 0xa6, 0xe3, 0x36, 0xda, 0x01, 0x89, 0xb9, 0x0c, 0x98, 0x5c, 0x96, 0x13, 0x78, 0x9c, - 0x2a, 0xd1, 0x5d, 0x73, 0x3f, 0x78, 0x38, 0x9a, 0x7b, 0xfb, 0xa7, 0x0b, 0x60, 0x0c, 0xed, 0x77, - 0x70, 0xfa, 0xc0, 0x57, 0xa1, 0x6f, 0x2b, 0x68, 0xd5, 0x84, 0x43, 0x59, 0xe6, 0x97, 0xc5, 0xb9, - 0xc3, 0xf9, 0x97, 0xd1, 0xff, 0x98, 0x95, 0xa2, 0x6b, 0xfc, 0x78, 0x25, 0xf0, 0xe9, 0x21, 0x27, - 0x63, 0x2d, 0xaa, 0xa7, 0x35, 0x83, 0x32, 0x48, 0x44, 0x87, 0xa8, 0xc4, 0xe2, 0x7d, 0x00, 0xe7, - 0x60, 0xf8, 0x5e, 0x55, 0x45, 0x28, 0x18, 0xc9, 0x05, 0x5d, 0x84, 0x61, 0x91, 0xd1, 0x8d, 0xbd, - 0x00, 0xe1, 0x8b, 0x89, 0xf9, 0x8a, 0x2d, 0xc6, 0x60, 0xac, 0xd3, 0xd8, 0x3f, 0x58, 0x80, 0xa9, - 0x8c, 0x27, 0x7c, 0xfc, 0x18, 0xd9, 0x72, 0xc3, 0x48, 0xa5, 0x27, 0xd7, 0x8e, 0x11, 0x0e, 0xc7, - 0x8a, 0x82, 0xee, 0x55, 0xfc, 0xa0, 0x4a, 0x1e, 0x4e, 0xe2, 0x89, 0x8c, 0xc0, 0x1e, 0x30, 0xd1, - 0xf7, 0x59, 0xe8, 0x6b, 0x87, 0x44, 0xc6, 0x13, 0x57, 0xc7, 0x36, 0x33, 0x6b, 0x33, 0x0c, 0xbd, - 0x02, 0x6e, 0x29, 0x0b, 0xb1, 0x76, 0x05, 0xe4, 0x36, 0x62, 0x8e, 0xa3, 0x8d, 0x8b, 0x88, 0xe7, - 0x78, 0x91, 0xb8, 0x28, 0xc6, 0x81, 0x71, 0x19, 0x14, 0x0b, 0xac, 0xfd, 0xa5, 0x22, 0x9c, 0xcc, - 0x7d, 0xd4, 0x4b, 0x9b, 0xde, 0xf4, 0x3d, 0x37, 0xf2, 0x95, 0x13, 0x1e, 0x0f, 0x86, 0x4b, 0x5a, - 0xdb, 0x6b, 0x02, 0x8e, 0x15, 0x05, 0x3a, 0x07, 0xfd, 0x4c, 0x29, 0x9e, 0x4a, 0xd4, 0x3e, 0xbf, - 0xc8, 0xa3, 0x23, 0x72, 0xb4, 0x76, 0xaa, 0x17, 0x3b, 0x9e, 0xea, 0x8f, 0x52, 0x09, 0xc6, 0x6f, - 0x24, 0x0f, 0x14, 0xda, 0x5c, 0xdf, 0x6f, 0x60, 0x86, 0x44, 0x8f, 0x8b, 0xfe, 0x4a, 0x78, 0x9d, - 0x61, 0xa7, 0xee, 0x87, 0x5a, 0xa7, 0x3d, 0x09, 0x83, 0x3b, 0x64, 0x2f, 0x70, 0xbd, 0xad, 0xa4, - 0x37, 0xe2, 0x15, 0x0e, 0xc6, 0x12, 0x6f, 0xe6, 0x0c, 0x1e, 0x3c, 0x8c, 0x9c, 0xc1, 0xfa, 0x0c, - 0x18, 0xea, 0x2a, 0x9e, 0xfc, 0x50, 0x11, 0xc6, 0xf1, 0xfc, 0xe2, 0x7b, 0x03, 0x71, 0x2d, 0x3d, - 0x10, 0x87, 0x91, 0x5a, 0xf7, 0x60, 0xa3, 0xf1, 0x4b, 0x16, 0x8c, 0xb3, 0xbc, 0x72, 0x22, 0x22, - 0x87, 0xeb, 0x7b, 0x47, 0x70, 0x15, 0x78, 0x14, 0xfa, 0x03, 0x5a, 0x69, 0x32, 0x43, 0x3b, 0x6b, - 0x09, 0xe6, 0x38, 0x74, 0x0a, 0xfa, 0x58, 0x13, 0xe8, 0xe0, 0x8d, 0xf0, 0x2d, 0x78, 0xd1, 0x89, - 0x1c, 0xcc, 0xa0, 0x2c, 0x36, 0x20, 0x26, 0xad, 0x86, 0xcb, 0x1b, 0x1d, 0xbb, 0x2c, 0xbc, 0x3b, - 0xc2, 0x7d, 0x64, 0x36, 0xed, 0x9d, 0xc5, 0x06, 0xcc, 0x66, 0xd9, 0xf9, 0x9a, 0xfd, 0x17, 0x05, - 0x38, 0x93, 0x59, 0xae, 0xe7, 0xd8, 0x80, 0x9d, 0x4b, 0x3f, 0xc8, 0x14, 0x59, 0xc5, 0x23, 0xf4, - 0xf5, 0xee, 0xeb, 0x55, 0xfa, 0xef, 0xef, 0x21, 0x64, 0x5f, 0x66, 0x97, 0xbd, 0x4b, 0x42, 0xf6, - 0x65, 0xb6, 0x2d, 0x47, 0x4d, 0xf0, 0x37, 0x85, 0x9c, 0x6f, 0x61, 0x0a, 0x83, 0xf3, 0x74, 0x9f, - 0x61, 0xc8, 0x50, 0x5e, 0xc2, 0xf9, 0x1e, 0xc3, 0x61, 0x58, 0x61, 0xd1, 0x1c, 0x8c, 0x37, 0x5d, - 0x8f, 0x6e, 0x3e, 0x7b, 0xa6, 0x28, 0xae, 0x6c, 0x19, 0x6b, 0x26, 0x1a, 0x27, 0xe9, 0x91, 0xab, - 0x85, 0xf3, 0xe3, 0x5f, 0xf7, 0xca, 0x81, 0x56, 0xdd, 0xac, 0xe9, 0xce, 0xa1, 0x7a, 0x31, 0x23, - 0xb4, 0xdf, 0x9a, 0xa6, 0x27, 0x2a, 0xf6, 0xae, 0x27, 0x1a, 0xc9, 0xd6, 0x11, 0xcd, 0xbc, 0x02, - 0xa3, 0xf7, 0x6d, 0x1b, 0xb1, 0xbf, 0x51, 0x84, 0x87, 0x3b, 0x2c, 0x7b, 0xbe, 0xd7, 0x1b, 0x63, - 0xa0, 0xed, 0xf5, 0xa9, 0x71, 0xa8, 0xc0, 0xb1, 0xcd, 0x76, 0xa3, 0xb1, 0xc7, 0x1e, 0x35, 0x91, - 0xba, 0xa4, 0x10, 0x32, 0xa5, 0x54, 0x8e, 0x1c, 0x5b, 0xce, 0xa0, 0xc1, 0x99, 0x25, 0xe9, 0x15, - 0x8b, 0x9e, 0x24, 0x7b, 0x8a, 0x55, 0xe2, 0x8a, 0x85, 0x75, 0x24, 0x36, 0x69, 0xd1, 0x25, 0x98, - 0x74, 0x76, 0x1d, 0x97, 0xe7, 0x44, 0x90, 0x0c, 0xf8, 0x1d, 0x4b, 0xe9, 0xa2, 0xe7, 0x92, 0x04, - 0x38, 0x5d, 0x06, 0xbd, 0x0e, 0xc8, 0xbf, 0xc9, 0x1e, 0x4a, 0xd4, 0x2f, 0x11, 0x4f, 0x58, 0xdd, - 0xd9, 0xd8, 0x15, 0xe3, 0x2d, 0xe1, 0x6a, 0x8a, 0x02, 0x67, 0x94, 0x4a, 0x04, 0x96, 0x1b, 0xc8, - 0x0f, 0x2c, 0xd7, 0x79, 0x5f, 0xec, 0x9a, 0x9d, 0xed, 0x22, 0x8c, 0x1e, 0xd0, 0xfd, 0xd7, 0xfe, - 0xb7, 0x16, 0x28, 0x05, 0xb1, 0x19, 0x18, 0xfa, 0x15, 0xe6, 0x9f, 0xcc, 0x55, 0xdb, 0x5a, 0x2c, - 0xa8, 0xe3, 0x9a, 0x7f, 0x72, 0x8c, 0xc4, 0x26, 0x2d, 0x9f, 0x43, 0x9a, 0x5f, 0xb1, 0x71, 0x2b, - 0x10, 0x71, 0x2b, 0x15, 0x05, 0xfa, 0x18, 0x0c, 0xd6, 0xdd, 0x5d, 0x37, 0x14, 0xca, 0xb1, 0x03, - 0x1b, 0xe3, 0xe2, 0xad, 0x73, 0x91, 0xb3, 0xc1, 0x92, 0x9f, 0xfd, 0x43, 0x85, 0xb8, 0x4f, 0xde, - 0x68, 0xfb, 0x91, 0x73, 0x04, 0x27, 0xf9, 0x25, 0xe3, 0x24, 0x7f, 0x3c, 0x7b, 0xa0, 0xb5, 0x26, - 0xe5, 0x9e, 0xe0, 0x57, 0x13, 0x27, 0xf8, 0x13, 0xdd, 0x59, 0x75, 0x3e, 0xb9, 0xff, 0xa1, 0x05, - 0x93, 0x06, 0xfd, 0x11, 0x1c, 0x20, 0xcb, 0xe6, 0x01, 0xf2, 0x48, 0xd7, 0x6f, 0xc8, 0x39, 0x38, - 0xbe, 0xbf, 0x98, 0x68, 0x3b, 0x3b, 0x30, 0xde, 0x86, 0xbe, 0x6d, 0x27, 0xa8, 0x77, 0x4a, 0x59, - 0x94, 0x2a, 0x34, 0x7b, 0xd9, 0x09, 0x84, 0xa7, 0xc2, 0x33, 0xb2, 0xd7, 0x29, 0xa8, 0xab, 0x97, - 0x02, 0xab, 0x0a, 0xbd, 0x04, 0x03, 0x61, 0xcd, 0x6f, 0xa9, 0x37, 0x53, 0x2c, 0xe5, 0x6f, 0x95, - 0x41, 0xee, 0xed, 0x97, 0x91, 0x59, 0x1d, 0x05, 0x63, 0x41, 0x8f, 0xde, 0x84, 0x51, 0xf6, 0x4b, - 0xb9, 0x0d, 0x16, 0xf3, 0x35, 0x18, 0x55, 0x9d, 0x90, 0xfb, 0xd4, 0x1a, 0x20, 0x6c, 0xb2, 0x9a, - 0xd9, 0x82, 0x92, 0xfa, 0xac, 0x07, 0x6a, 0xed, 0xfe, 0x57, 0x45, 0x98, 0xca, 0x98, 0x73, 0x28, - 0x34, 0x46, 0xe2, 0x62, 0x8f, 0x53, 0xf5, 0x1d, 0x8e, 0x45, 0xc8, 0x2e, 0x50, 0x75, 0x31, 0xb7, - 0x7a, 0xae, 0xf4, 0x5a, 0x48, 0x92, 0x95, 0x52, 0x50, 0xf7, 0x4a, 0x69, 0x65, 0x47, 0xd6, 0xd5, - 0xb4, 0x22, 0xd5, 0xd2, 0x07, 0x3a, 0xa6, 0xbf, 0xd1, 0x07, 0xc7, 0xb2, 0xe2, 0x09, 0xa3, 0xcf, - 0x24, 0xf2, 0x88, 0xbf, 0xd0, 0xa9, 0x87, 0xf5, 0x92, 0x3c, 0xb9, 0xb8, 0x08, 0xe3, 0x39, 0x6b, - 0x66, 0x16, 0xef, 0xda, 0xcd, 0xa2, 0x4e, 0x16, 0x5e, 0x27, 0xe0, 0xf9, 0xdf, 0xe5, 0xf6, 0xf1, - 0x81, 0x9e, 0x1b, 0x20, 0x12, 0xc7, 0x87, 0x09, 0x97, 0x24, 0x09, 0xee, 0xee, 0x92, 0x24, 0x6b, - 0x46, 0x2b, 0x30, 0x50, 0xe3, 0xbe, 0x2e, 0xc5, 0xee, 0x5b, 0x18, 0x77, 0x74, 0x51, 0x1b, 0xb0, - 0x70, 0x70, 0x11, 0x0c, 0x66, 0x5c, 0x18, 0xd6, 0x3a, 0xe6, 0x81, 0x4e, 0x9e, 0x1d, 0x7a, 0xf0, - 0x69, 0x5d, 0xf0, 0x40, 0x27, 0xd0, 0x8f, 0x5a, 0x90, 0x78, 0xf0, 0xa2, 0x94, 0x72, 0x56, 0xae, - 0x52, 0xee, 0x2c, 0xf4, 0x05, 0x7e, 0x83, 0x24, 0x93, 0x54, 0x63, 0xbf, 0x41, 0x30, 0xc3, 0x50, - 0x8a, 0x28, 0x56, 0xb5, 0x8c, 0xe8, 0xd7, 0x48, 0x71, 0x41, 0x7c, 0x14, 0xfa, 0x1b, 0x64, 0x97, - 0x34, 0x92, 0xb9, 0x04, 0x57, 0x29, 0x10, 0x73, 0x9c, 0xfd, 0x4b, 0x7d, 0x70, 0xba, 0x63, 0xac, - 0x2b, 0x7a, 0x19, 0xdb, 0x72, 0x22, 0x72, 0xcb, 0xd9, 0x4b, 0x26, 0xfd, 0xba, 0xc4, 0xc1, 0x58, - 0xe2, 0xd9, 0xf3, 0x4f, 0x9e, 0xbb, 0x23, 0xa1, 0xc2, 0x14, 0x29, 0x3b, 0x04, 0xd6, 0x54, 0x89, - 0x15, 0x0f, 0x43, 0x25, 0xf6, 0x1c, 0x40, 0x18, 0x36, 0xb8, 0x5b, 0x60, 0x5d, 0xbc, 0x2b, 0x8d, - 0x73, 0xbc, 0x54, 0x57, 0x05, 0x06, 0x6b, 0x54, 0x68, 0x11, 0x26, 0x5a, 0x81, 0x1f, 0x71, 0x8d, - 0xf0, 0x22, 0xf7, 0x9c, 0xed, 0x37, 0xc3, 0x0c, 0x55, 0x12, 0x78, 0x9c, 0x2a, 0x81, 0x5e, 0x84, - 0x61, 0x11, 0x7a, 0xa8, 0xe2, 0xfb, 0x0d, 0xa1, 0x84, 0x52, 0xce, 0xa4, 0xd5, 0x18, 0x85, 0x75, - 0x3a, 0xad, 0x18, 0x53, 0x33, 0x0f, 0x66, 0x16, 0xe3, 0xaa, 0x66, 0x8d, 0x2e, 0x11, 0xa6, 0x7c, - 0xa8, 0xa7, 0x30, 0xe5, 0xb1, 0x5a, 0xae, 0xd4, 0xb3, 0xd5, 0x13, 0xba, 0x2a, 0xb2, 0xbe, 0xda, - 0x07, 0x53, 0x62, 0xe2, 0x3c, 0xe8, 0xe9, 0x72, 0x2d, 0x3d, 0x5d, 0x0e, 0x43, 0x71, 0xf7, 0xde, - 0x9c, 0x39, 0xea, 0x39, 0xf3, 0xc3, 0x16, 0x98, 0x92, 0x1a, 0xfa, 0xdf, 0x73, 0xb3, 0x26, 0xbe, - 0x98, 0x2b, 0xf9, 0xc5, 0x31, 0x8c, 0xdf, 0x59, 0xfe, 0x44, 0xfb, 0x5f, 0x5b, 0xf0, 0x48, 0x57, - 0x8e, 0x68, 0x09, 0x4a, 0x4c, 0x9c, 0xd4, 0x2e, 0x7a, 0x4f, 0x28, 0xcf, 0x7a, 0x89, 0xc8, 0x91, - 0x6e, 0xe3, 0x92, 0x68, 0x29, 0x95, 0x9e, 0xf2, 0xc9, 0x8c, 0xf4, 0x94, 0xc7, 0x8d, 0xee, 0xb9, - 0xcf, 0xfc, 0x94, 0x5f, 0xa4, 0x27, 0x8e, 0xf1, 0xaa, 0x0d, 0x7d, 0xc0, 0x50, 0x3a, 0xda, 0x09, - 0xa5, 0x23, 0x32, 0xa9, 0xb5, 0x33, 0xe4, 0x23, 0x30, 0xc1, 0x62, 0x12, 0xb2, 0x77, 0x1e, 0xe2, - 0xbd, 0x5d, 0x21, 0xf6, 0xe5, 0x5e, 0x4d, 0xe0, 0x70, 0x8a, 0xda, 0xfe, 0xb3, 0x22, 0x0c, 0xf0, - 0xe5, 0x77, 0x04, 0xd7, 0xcb, 0xa7, 0xa1, 0xe4, 0x36, 0x9b, 0x6d, 0x9e, 0x71, 0xb0, 0x3f, 0xf6, - 0x0c, 0x5e, 0x91, 0x40, 0x1c, 0xe3, 0xd1, 0xb2, 0xd0, 0x77, 0x77, 0x08, 0x7b, 0xcc, 0x1b, 0x3e, - 0xbb, 0xe8, 0x44, 0x0e, 0x97, 0x95, 0xd4, 0x39, 0x1b, 0x6b, 0xc6, 0xd1, 0x27, 0x01, 0xc2, 0x28, - 0x70, 0xbd, 0x2d, 0x0a, 0x13, 0xb1, 0xf1, 0x9f, 0xea, 0xc0, 0xad, 0xaa, 0x88, 0x39, 0xcf, 0x78, - 0xcf, 0x51, 0x08, 0xac, 0x71, 0x44, 0xb3, 0xc6, 0x49, 0x3f, 0x93, 0x18, 0x3b, 0xe0, 0x5c, 0xe3, - 0x31, 0x9b, 0xf9, 0x20, 0x94, 0x14, 0xf3, 0x6e, 0xda, 0xaf, 0x11, 0x5d, 0x2c, 0xfa, 0x30, 0x8c, - 0x27, 0xda, 0x76, 0x20, 0xe5, 0xd9, 0x2f, 0x5b, 0x30, 0xce, 0x1b, 0xb3, 0xe4, 0xed, 0x8a, 0xd3, - 0xe0, 0x0e, 0x1c, 0x6b, 0x64, 0xec, 0xca, 0x62, 0xf8, 0x7b, 0xdf, 0xc5, 0x95, 0xb2, 0x2c, 0x0b, - 0x8b, 0x33, 0xeb, 0x40, 0xe7, 0xe9, 0x8a, 0xa3, 0xbb, 0xae, 0xd3, 0x10, 0xf1, 0x0d, 0x46, 0xf8, - 0x6a, 0xe3, 0x30, 0xac, 0xb0, 0xf6, 0x1f, 0x59, 0x30, 0xc9, 0x5b, 0x7e, 0x85, 0xec, 0xa9, 0xbd, - 0xe9, 0x5b, 0xd9, 0x76, 0x91, 0xeb, 0xb6, 0x90, 0x93, 0xeb, 0x56, 0xff, 0xb4, 0x62, 0xc7, 0x4f, - 0xfb, 0x8a, 0x05, 0x62, 0x86, 0x1c, 0x81, 0x3e, 0xe3, 0xbb, 0x4c, 0x7d, 0xc6, 0x4c, 0xfe, 0x22, - 0xc8, 0x51, 0x64, 0xfc, 0xb5, 0x05, 0x13, 0x9c, 0x20, 0xb6, 0xd5, 0x7f, 0x4b, 0xc7, 0x61, 0xde, - 0xfc, 0xa2, 0x4c, 0xe7, 0xcb, 0x2b, 0x64, 0x6f, 0xc3, 0xaf, 0x38, 0xd1, 0x76, 0xf6, 0x47, 0x19, - 0x83, 0xd5, 0xd7, 0x71, 0xb0, 0xea, 0x72, 0x01, 0x19, 0xa9, 0xe0, 0xba, 0x04, 0x08, 0x38, 0x68, - 0x2a, 0x38, 0xfb, 0xcf, 0x2d, 0x40, 0xbc, 0x1a, 0x43, 0x70, 0xa3, 0xe2, 0x10, 0x83, 0x6a, 0x07, - 0x5d, 0xbc, 0x35, 0x29, 0x0c, 0xd6, 0xa8, 0x0e, 0xa5, 0x7b, 0x12, 0x0e, 0x17, 0xc5, 0xee, 0x0e, - 0x17, 0x07, 0xe8, 0xd1, 0x7f, 0x3e, 0x00, 0xc9, 0x97, 0x7d, 0xe8, 0x3a, 0x8c, 0xd4, 0x9c, 0x96, - 0x73, 0xd3, 0x6d, 0xb8, 0x91, 0x4b, 0xc2, 0x4e, 0xde, 0x58, 0x0b, 0x1a, 0x9d, 0x30, 0x91, 0x6b, - 0x10, 0x6c, 0xf0, 0x41, 0xb3, 0x00, 0xad, 0xc0, 0xdd, 0x75, 0x1b, 0x64, 0x8b, 0xa9, 0x5d, 0x58, - 0x44, 0x15, 0xee, 0x1a, 0x26, 0xa1, 0x58, 0xa3, 0xc8, 0x08, 0xa3, 0x50, 0x7c, 0xc0, 0x61, 0x14, - 0xe0, 0xc8, 0xc2, 0x28, 0xf4, 0x1d, 0x28, 0x8c, 0xc2, 0xd0, 0x81, 0xc3, 0x28, 0xf4, 0xf7, 0x14, - 0x46, 0x01, 0xc3, 0x09, 0x29, 0x7b, 0xd2, 0xff, 0xcb, 0x6e, 0x83, 0x88, 0x0b, 0x07, 0x0f, 0x03, - 0x33, 0x73, 0x77, 0xbf, 0x7c, 0x02, 0x67, 0x52, 0xe0, 0x9c, 0x92, 0xe8, 0xa3, 0x30, 0xed, 0x34, - 0x1a, 0xfe, 0x2d, 0x35, 0xa8, 0x4b, 0x61, 0xcd, 0x69, 0x70, 0x13, 0xc8, 0x20, 0xe3, 0x7a, 0xea, - 0xee, 0x7e, 0x79, 0x7a, 0x2e, 0x87, 0x06, 0xe7, 0x96, 0x46, 0xaf, 0x42, 0xa9, 0x15, 0xf8, 0xb5, - 0x35, 0xed, 0xf9, 0xf1, 0x19, 0xda, 0x81, 0x15, 0x09, 0xbc, 0xb7, 0x5f, 0x1e, 0x55, 0x7f, 0xd8, - 0x81, 0x1f, 0x17, 0xc8, 0x88, 0x8b, 0x30, 0x7c, 0xa8, 0x71, 0x11, 0x76, 0x60, 0xaa, 0x4a, 0x02, - 0xd7, 0x69, 0xb8, 0x77, 0xa8, 0xbc, 0x2c, 0xf7, 0xa7, 0x0d, 0x28, 0x05, 0x89, 0x1d, 0xb9, 0xa7, - 0x50, 0xc4, 0x5a, 0x36, 0x2e, 0xb9, 0x03, 0xc7, 0x8c, 0xec, 0xff, 0x66, 0xc1, 0xa0, 0x78, 0xc9, - 0x77, 0x04, 0x52, 0xe3, 0x9c, 0x61, 0x94, 0x28, 0x67, 0x77, 0x18, 0x6b, 0x4c, 0xae, 0x39, 0x62, - 0x25, 0x61, 0x8e, 0x78, 0xa4, 0x13, 0x93, 0xce, 0x86, 0x88, 0xff, 0xaf, 0x48, 0xa5, 0x77, 0xe3, - 0x4d, 0xf9, 0x83, 0xef, 0x82, 0x75, 0x18, 0x0c, 0xc5, 0x9b, 0xe6, 0x42, 0xfe, 0x6b, 0x90, 0xe4, - 0x20, 0xc6, 0x5e, 0x74, 0xe2, 0x15, 0xb3, 0x64, 0x92, 0xf9, 0x58, 0xba, 0xf8, 0x00, 0x1f, 0x4b, - 0x77, 0x7b, 0x75, 0xdf, 0x77, 0x18, 0xaf, 0xee, 0xed, 0xaf, 0xb3, 0x93, 0x53, 0x87, 0x1f, 0x81, - 0x50, 0x75, 0xc9, 0x3c, 0x63, 0xed, 0x0e, 0x33, 0x4b, 0x34, 0x2a, 0x47, 0xb8, 0xfa, 0x45, 0x0b, - 0x4e, 0x67, 0x7c, 0x95, 0x26, 0x69, 0x3d, 0x03, 0x43, 0x4e, 0xbb, 0xee, 0xaa, 0xb5, 0xac, 0x99, - 0x26, 0xe7, 0x04, 0x1c, 0x2b, 0x0a, 0xb4, 0x00, 0x93, 0xe4, 0x76, 0xcb, 0xe5, 0x86, 0x5c, 0xdd, - 0xf9, 0xb8, 0xc8, 0x9f, 0x7f, 0x2e, 0x25, 0x91, 0x38, 0x4d, 0xaf, 0x02, 0x44, 0x15, 0x73, 0x03, - 0x44, 0xfd, 0xbc, 0x05, 0xc3, 0xea, 0x55, 0xef, 0x03, 0xef, 0xed, 0x8f, 0x98, 0xbd, 0xfd, 0x70, - 0x87, 0xde, 0xce, 0xe9, 0xe6, 0x3f, 0x28, 0xa8, 0xf6, 0x56, 0xfc, 0x20, 0xea, 0x41, 0x82, 0xbb, - 0xff, 0x87, 0x13, 0x17, 0x61, 0xd8, 0x69, 0xb5, 0x24, 0x42, 0x7a, 0xc0, 0xb1, 0xc0, 0xf2, 0x31, - 0x18, 0xeb, 0x34, 0xea, 0x1d, 0x47, 0x31, 0xf7, 0x1d, 0x47, 0x1d, 0x20, 0x72, 0x82, 0x2d, 0x12, - 0x51, 0x98, 0x70, 0xd8, 0xcd, 0xdf, 0x6f, 0xda, 0x91, 0xdb, 0x98, 0x75, 0xbd, 0x28, 0x8c, 0x82, - 0xd9, 0x15, 0x2f, 0xba, 0x1a, 0xf0, 0x2b, 0xa4, 0x16, 0x62, 0x4d, 0xf1, 0xc2, 0x1a, 0x5f, 0x19, - 0xc1, 0x82, 0xd5, 0xd1, 0x6f, 0xba, 0x52, 0xac, 0x0b, 0x38, 0x56, 0x14, 0xf6, 0x07, 0xd9, 0xe9, - 0xc3, 0xfa, 0xf4, 0x60, 0xe1, 0xc5, 0x7e, 0x72, 0x44, 0x8d, 0x06, 0x33, 0x8a, 0x2e, 0xea, 0x41, - 0xcc, 0x3a, 0x6f, 0xf6, 0xb4, 0x62, 0xfd, 0x45, 0x64, 0x1c, 0xe9, 0x0c, 0x7d, 0x3c, 0xe5, 0x1e, - 0xf3, 0x6c, 0x97, 0x53, 0xe3, 0x00, 0x0e, 0x31, 0x2c, 0xcb, 0x14, 0xcb, 0xc1, 0xb3, 0x52, 0x11, - 0xeb, 0x42, 0xcb, 0x32, 0x25, 0x10, 0x38, 0xa6, 0xa1, 0xc2, 0x94, 0xfa, 0x13, 0x4e, 0xa3, 0x38, - 0x18, 0xb1, 0xa2, 0x0e, 0xb1, 0x46, 0x81, 0x2e, 0x08, 0x85, 0x02, 0xb7, 0x0b, 0x3c, 0x9c, 0x50, - 0x28, 0xc8, 0xee, 0xd2, 0xb4, 0x40, 0x17, 0x61, 0x98, 0xdc, 0x8e, 0x48, 0xe0, 0x39, 0x0d, 0x5a, - 0x43, 0x7f, 0x1c, 0x3f, 0x73, 0x29, 0x06, 0x63, 0x9d, 0x06, 0x6d, 0xc0, 0x78, 0xc8, 0xf5, 0x6c, - 0x2a, 0x04, 0x3e, 0xd7, 0x57, 0x3e, 0xa5, 0xde, 0x53, 0x9b, 0xe8, 0x7b, 0x0c, 0xc4, 0x77, 0x27, - 0x19, 0x65, 0x22, 0xc9, 0x02, 0xbd, 0x06, 0x63, 0x0d, 0xdf, 0xa9, 0xcf, 0x3b, 0x0d, 0xc7, 0xab, - 0xb1, 0xfe, 0x19, 0x32, 0x73, 0x95, 0xaf, 0x1a, 0x58, 0x9c, 0xa0, 0xa6, 0xc2, 0x9b, 0x0e, 0x11, - 0x61, 0xda, 0x1c, 0x6f, 0x8b, 0x84, 0xd3, 0x25, 0xf6, 0x55, 0x4c, 0x78, 0x5b, 0xcd, 0xa1, 0xc1, - 0xb9, 0xa5, 0xd1, 0x4b, 0x30, 0x22, 0x3f, 0x5f, 0x0b, 0xca, 0x12, 0x3f, 0x89, 0xd1, 0x70, 0xd8, - 0xa0, 0x44, 0x21, 0x1c, 0x97, 0xff, 0x37, 0x02, 0x67, 0x73, 0xd3, 0xad, 0x89, 0x48, 0x05, 0xfc, - 0xf9, 0xf0, 0x87, 0xe5, 0x5b, 0xc5, 0xa5, 0x2c, 0xa2, 0x7b, 0xfb, 0xe5, 0x53, 0xa2, 0xd7, 0x32, - 0xf1, 0x38, 0x9b, 0x37, 0x5a, 0x83, 0xa9, 0x6d, 0xe2, 0x34, 0xa2, 0xed, 0x85, 0x6d, 0x52, 0xdb, - 0x91, 0x0b, 0x8e, 0x85, 0x79, 0xd1, 0x9e, 0x8e, 0x5c, 0x4e, 0x93, 0xe0, 0xac, 0x72, 0xe8, 0x2d, - 0x98, 0x6e, 0xb5, 0x6f, 0x36, 0xdc, 0x70, 0x7b, 0xdd, 0x8f, 0x98, 0x13, 0xd2, 0x5c, 0xbd, 0x1e, - 0x90, 0x90, 0xbf, 0x2e, 0x65, 0x47, 0xaf, 0x0c, 0xa4, 0x53, 0xc9, 0xa1, 0xc3, 0xb9, 0x1c, 0xd0, - 0x1d, 0x38, 0x9e, 0x98, 0x08, 0x22, 0x22, 0xc6, 0x58, 0x7e, 0x02, 0x9c, 0x6a, 0x56, 0x01, 0x11, - 0x5c, 0x26, 0x0b, 0x85, 0xb3, 0xab, 0x40, 0x2f, 0x03, 0xb8, 0xad, 0x65, 0xa7, 0xe9, 0x36, 0xe8, - 0x55, 0x71, 0x8a, 0xcd, 0x11, 0x7a, 0x6d, 0x80, 0x95, 0x8a, 0x84, 0xd2, 0xbd, 0x59, 0xfc, 0xdb, - 0xc3, 0x1a, 0x35, 0x5a, 0x85, 0x31, 0xf1, 0x6f, 0x4f, 0x0c, 0xe9, 0xa4, 0xca, 0x95, 0x38, 0x26, - 0x4b, 0xa8, 0x71, 0x4c, 0x40, 0x70, 0xa2, 0x2c, 0xda, 0x82, 0xd3, 0x32, 0x51, 0xa3, 0x3e, 0x3f, - 0xe5, 0x18, 0x84, 0x2c, 0xeb, 0xcc, 0x10, 0x7f, 0x95, 0x32, 0xd7, 0x89, 0x10, 0x77, 0xe6, 0x43, - 0xcf, 0x75, 0x7d, 0x9a, 0xf3, 0x37, 0xc7, 0xc7, 0xe3, 0x88, 0x83, 0xab, 0x49, 0x24, 0x4e, 0xd3, - 0x23, 0x1f, 0x8e, 0xbb, 0x5e, 0xd6, 0xac, 0x3e, 0xc1, 0x18, 0x7d, 0x88, 0x3f, 0xb7, 0xee, 0x3c, - 0xa3, 0x33, 0xf1, 0x38, 0x9b, 0xef, 0x3b, 0xf3, 0xfb, 0xfb, 0x43, 0x8b, 0x96, 0xd6, 0xa4, 0x73, - 0xf4, 0x29, 0x18, 0xd1, 0x3f, 0x4a, 0x48, 0x1a, 0xe7, 0xb2, 0x85, 0x57, 0x6d, 0x4f, 0xe0, 0xb2, - 0xbd, 0x5a, 0xf7, 0x3a, 0x0e, 0x1b, 0x1c, 0x51, 0x2d, 0x23, 0xb6, 0xc1, 0x85, 0xde, 0x24, 0x99, - 0xde, 0xdd, 0xde, 0x08, 0x64, 0x4f, 0x77, 0xb4, 0x0a, 0x43, 0xb5, 0x86, 0x4b, 0xbc, 0x68, 0xa5, - 0xd2, 0x29, 0x7a, 0xe3, 0x82, 0xa0, 0x11, 0xeb, 0x47, 0x24, 0x90, 0xe1, 0x30, 0xac, 0x38, 0xd8, - 0x2f, 0xc1, 0x70, 0xb5, 0x41, 0x48, 0x8b, 0x3f, 0xdf, 0x41, 0x4f, 0xb2, 0xdb, 0x04, 0x93, 0x07, - 0x2d, 0x26, 0x0f, 0xea, 0x17, 0x05, 0x26, 0x09, 0x4a, 0xbc, 0xfd, 0x5b, 0x05, 0x28, 0x77, 0xc9, - 0x63, 0x94, 0x30, 0x60, 0x59, 0x3d, 0x19, 0xb0, 0xe6, 0x60, 0x3c, 0xfe, 0xa7, 0xeb, 0xc6, 0x94, - 0x0f, 0xec, 0x75, 0x13, 0x8d, 0x93, 0xf4, 0x3d, 0x3f, 0x67, 0xd0, 0x6d, 0x60, 0x7d, 0x5d, 0x1f, - 0xe4, 0x18, 0xb6, 0xef, 0xfe, 0xde, 0x2f, 0xcc, 0xb9, 0x76, 0x4c, 0xfb, 0xeb, 0x05, 0x38, 0xae, - 0xba, 0xf0, 0x3b, 0xb7, 0xe3, 0xae, 0xa5, 0x3b, 0xee, 0x10, 0xac, 0xc0, 0xf6, 0x55, 0x18, 0xe0, - 0x81, 0x2c, 0x7b, 0x10, 0xd4, 0x1f, 0x35, 0xe3, 0x6b, 0x2b, 0xd9, 0xd0, 0x88, 0xb1, 0xfd, 0x03, - 0x16, 0x8c, 0x27, 0xde, 0xc5, 0x21, 0xac, 0x3d, 0x9e, 0xbe, 0x1f, 0x61, 0x3a, 0x4b, 0x4c, 0x3f, - 0x0b, 0x7d, 0xdb, 0x7e, 0x18, 0x25, 0x5d, 0x44, 0x2e, 0xfb, 0x61, 0x84, 0x19, 0xc6, 0xfe, 0x63, - 0x0b, 0xfa, 0x37, 0x1c, 0xd7, 0x8b, 0xa4, 0x39, 0xc1, 0xca, 0x31, 0x27, 0xf4, 0xf2, 0x5d, 0xe8, - 0x45, 0x18, 0x20, 0x9b, 0x9b, 0xa4, 0x16, 0x89, 0x51, 0x95, 0x41, 0x14, 0x06, 0x96, 0x18, 0x94, - 0x4a, 0x8e, 0xac, 0x32, 0xfe, 0x17, 0x0b, 0x62, 0x74, 0x03, 0x4a, 0x91, 0xdb, 0x24, 0x73, 0xf5, - 0xba, 0x30, 0xb2, 0xdf, 0x47, 0xe4, 0x8f, 0x0d, 0xc9, 0x00, 0xc7, 0xbc, 0xec, 0x2f, 0x15, 0x00, - 0xe2, 0x08, 0x60, 0xdd, 0x3e, 0x71, 0x3e, 0x65, 0x7e, 0x3d, 0x97, 0x61, 0x7e, 0x45, 0x31, 0xc3, - 0x0c, 0xdb, 0xab, 0xea, 0xa6, 0x62, 0x4f, 0xdd, 0xd4, 0x77, 0x90, 0x6e, 0x5a, 0x80, 0xc9, 0x38, - 0x82, 0x99, 0x19, 0xc0, 0x91, 0x1d, 0xba, 0x1b, 0x49, 0x24, 0x4e, 0xd3, 0xdb, 0x04, 0xce, 0xaa, - 0x40, 0x4e, 0xe2, 0x2c, 0x64, 0x1e, 0xe4, 0xba, 0x39, 0xbb, 0x4b, 0x3f, 0xc5, 0xf6, 0xe5, 0x42, - 0xae, 0x7d, 0xf9, 0x27, 0x2c, 0x38, 0x96, 0xac, 0x87, 0x3d, 0xb7, 0xfe, 0x82, 0x05, 0xc7, 0xe3, - 0x34, 0x1e, 0x69, 0x9b, 0xfe, 0x0b, 0x1d, 0x83, 0x53, 0xe5, 0xb4, 0x38, 0x8e, 0xd6, 0xb1, 0x96, - 0xc5, 0x1a, 0x67, 0xd7, 0x68, 0xff, 0xd7, 0x3e, 0x98, 0xce, 0x8b, 0x6a, 0xc5, 0x1e, 0x98, 0x38, - 0xb7, 0xab, 0x3b, 0xe4, 0x96, 0x70, 0xe3, 0x8f, 0x1f, 0x98, 0x70, 0x30, 0x96, 0xf8, 0x64, 0xe6, - 0x96, 0x42, 0x8f, 0x99, 0x5b, 0xb6, 0x61, 0xf2, 0xd6, 0x36, 0xf1, 0xae, 0x79, 0xa1, 0x13, 0xb9, - 0xe1, 0xa6, 0xcb, 0x2c, 0xd2, 0x7c, 0xde, 0xc8, 0xec, 0xe3, 0x93, 0x37, 0x92, 0x04, 0xf7, 0xf6, - 0xcb, 0xa7, 0x0d, 0x40, 0xdc, 0x64, 0xbe, 0x91, 0xe0, 0x34, 0xd3, 0x74, 0xe2, 0x9b, 0xbe, 0x07, - 0x9c, 0xf8, 0xa6, 0xe9, 0x0a, 0x3f, 0x16, 0xf9, 0x7a, 0x80, 0xdd, 0x35, 0xd7, 0x14, 0x14, 0x6b, - 0x14, 0xe8, 0x13, 0x80, 0xf4, 0xcc, 0x65, 0x46, 0x50, 0xd1, 0x67, 0xef, 0xee, 0x97, 0xd1, 0x7a, - 0x0a, 0x7b, 0x6f, 0xbf, 0x3c, 0x45, 0xa1, 0x2b, 0x1e, 0xbd, 0xb3, 0xc6, 0x91, 0xd8, 0x32, 0x18, - 0xa1, 0x1b, 0x30, 0x41, 0xa1, 0x6c, 0x45, 0xc9, 0x88, 0xa5, 0xfc, 0x9e, 0xf9, 0xf4, 0xdd, 0xfd, - 0xf2, 0xc4, 0x7a, 0x02, 0x97, 0xc7, 0x3a, 0xc5, 0x24, 0x23, 0xff, 0xcd, 0x50, 0xaf, 0xf9, 0x6f, - 0xec, 0x2f, 0x58, 0x70, 0x92, 0x1e, 0x70, 0xf5, 0xd5, 0x1c, 0xb3, 0xb4, 0xd3, 0x72, 0xb9, 0xe1, - 0x43, 0x1c, 0x35, 0x4c, 0xc1, 0x56, 0x59, 0xe1, 0x66, 0x0f, 0x85, 0xa5, 0x3b, 0xfc, 0x8e, 0xeb, - 0xd5, 0x93, 0x3b, 0xfc, 0x15, 0xd7, 0xab, 0x63, 0x86, 0x51, 0x47, 0x56, 0x31, 0xf7, 0x11, 0xc3, - 0x57, 0xe9, 0x5a, 0xa5, 0x6d, 0xf9, 0x96, 0x36, 0x03, 0x3d, 0xad, 0x1b, 0x29, 0x85, 0x3f, 0x62, - 0xae, 0x81, 0xf2, 0xf3, 0x16, 0x88, 0x47, 0xcf, 0x3d, 0x9c, 0xc9, 0x6f, 0xc2, 0xc8, 0x6e, 0x3a, - 0xab, 0xe3, 0xd9, 0xfc, 0x57, 0xe0, 0x22, 0x56, 0xbb, 0x12, 0xd1, 0x8d, 0x0c, 0x8e, 0x06, 0x2f, - 0xbb, 0x0e, 0x02, 0xbb, 0x48, 0x98, 0x29, 0xa2, 0x7b, 0x6b, 0x9e, 0x03, 0xa8, 0x33, 0x5a, 0x96, - 0xea, 0xb9, 0x60, 0x4a, 0x5c, 0x8b, 0x0a, 0x83, 0x35, 0x2a, 0xfb, 0x77, 0x0b, 0x30, 0x2c, 0xb3, - 0x08, 0xb6, 0xbd, 0x5e, 0x14, 0x86, 0x07, 0x4a, 0x2b, 0x8e, 0x2e, 0x40, 0x89, 0x69, 0xb4, 0x2b, - 0xb1, 0x9e, 0x55, 0xe9, 0x93, 0xd6, 0x24, 0x02, 0xc7, 0x34, 0x4c, 0x7c, 0x6f, 0xdf, 0x64, 0xe4, - 0x89, 0x27, 0xba, 0x55, 0x0e, 0xc6, 0x12, 0x8f, 0x3e, 0x0a, 0x13, 0xbc, 0x5c, 0xe0, 0xb7, 0x9c, - 0x2d, 0x6e, 0x05, 0xeb, 0x57, 0x71, 0x4f, 0x26, 0xd6, 0x12, 0xb8, 0x7b, 0xfb, 0xe5, 0x63, 0x49, - 0x18, 0x33, 0xef, 0xa6, 0xb8, 0x30, 0x67, 0x37, 0x5e, 0x09, 0xdd, 0xd5, 0x53, 0x3e, 0x72, 0x31, - 0x0a, 0xeb, 0x74, 0xf6, 0xa7, 0x00, 0xa5, 0xf3, 0x29, 0xa2, 0xd7, 0xb9, 0xb3, 0xb4, 0x1b, 0x90, - 0x7a, 0x27, 0x73, 0xaf, 0x1e, 0xdd, 0x43, 0xbe, 0xae, 0xe3, 0xa5, 0xb0, 0x2a, 0x6f, 0xff, 0x60, - 0x1f, 0x4c, 0x24, 0xe3, 0x09, 0xa0, 0xcb, 0x30, 0xc0, 0x45, 0x4a, 0xc1, 0xbe, 0x83, 0x37, 0x91, - 0x16, 0x85, 0x80, 0x1d, 0xae, 0x42, 0x2a, 0x15, 0xe5, 0xd1, 0x5b, 0x30, 0x5c, 0xf7, 0x6f, 0x79, - 0xb7, 0x9c, 0xa0, 0x3e, 0x57, 0x59, 0x11, 0xd3, 0x39, 0x53, 0xc5, 0xb1, 0x18, 0x93, 0xe9, 0x91, - 0x0d, 0x98, 0xe5, 0x3c, 0x46, 0x61, 0x9d, 0x1d, 0xda, 0x60, 0x29, 0x42, 0x36, 0xdd, 0xad, 0x35, - 0xa7, 0xd5, 0xe9, 0xe5, 0xcc, 0x82, 0x24, 0xd2, 0x38, 0x8f, 0x8a, 0x3c, 0x22, 0x1c, 0x81, 0x63, - 0x46, 0xe8, 0x33, 0x30, 0x15, 0xe6, 0x18, 0x5d, 0xf2, 0xd2, 0xeb, 0x76, 0xb2, 0x43, 0xcc, 0x3f, - 0x74, 0x77, 0xbf, 0x3c, 0x95, 0x65, 0x9e, 0xc9, 0xaa, 0x06, 0xdd, 0x06, 0x24, 0x94, 0x9b, 0x1b, - 0x41, 0x3b, 0x8c, 0xe6, 0xdb, 0x5e, 0xbd, 0x21, 0x53, 0x88, 0x64, 0x27, 0xe0, 0x4e, 0x51, 0x6b, - 0x75, 0xb3, 0xf8, 0xa2, 0x69, 0x0a, 0x9c, 0x51, 0x87, 0xfd, 0xf9, 0x3e, 0x98, 0x91, 0x09, 0x4c, - 0x33, 0x5e, 0x08, 0x7c, 0xce, 0x4a, 0x3c, 0x11, 0x78, 0x39, 0x7f, 0x57, 0x7a, 0x60, 0x0f, 0x05, - 0xbe, 0x98, 0x7e, 0x28, 0xf0, 0xea, 0x01, 0x9b, 0x71, 0x68, 0xcf, 0x05, 0xbe, 0x63, 0x7d, 0xfc, - 0xbf, 0x7c, 0x0c, 0x8c, 0x73, 0xc4, 0x48, 0xf8, 0x6f, 0x1d, 0x52, 0xc2, 0x7f, 0x0c, 0x43, 0xa4, - 0xd9, 0x8a, 0xf6, 0x16, 0xdd, 0x40, 0xb4, 0x38, 0x93, 0xe7, 0x92, 0xa0, 0x49, 0xf3, 0x94, 0x18, - 0xac, 0xf8, 0xa0, 0x5d, 0x98, 0xdc, 0xaa, 0x91, 0x44, 0xce, 0xef, 0x62, 0xfe, 0xba, 0xbd, 0xb4, - 0xb0, 0xd4, 0x21, 0xe1, 0x37, 0xbb, 0xa9, 0xa4, 0x48, 0x70, 0xba, 0x0a, 0x96, 0x6f, 0xdc, 0xb9, - 0x15, 0x2e, 0x35, 0x9c, 0x30, 0x72, 0x6b, 0xf3, 0x0d, 0xbf, 0xb6, 0x53, 0x8d, 0xfc, 0x40, 0x26, - 0x1c, 0xcb, 0xbc, 0x28, 0xcc, 0xdd, 0xa8, 0xa6, 0xe8, 0xd3, 0xf9, 0xc6, 0xb3, 0xa8, 0x70, 0x66, - 0x5d, 0x68, 0x1d, 0x06, 0xb7, 0xdc, 0x08, 0x93, 0x96, 0x2f, 0x76, 0x8b, 0xcc, 0xad, 0xf0, 0x12, - 0x27, 0x49, 0xe7, 0xff, 0x16, 0x08, 0x2c, 0x99, 0xa0, 0xd7, 0xd5, 0x21, 0x30, 0x90, 0xaf, 0x2d, - 0x4c, 0x7b, 0x5e, 0x65, 0x1e, 0x03, 0xaf, 0x41, 0xd1, 0xdb, 0x0c, 0x3b, 0xc5, 0x0b, 0x59, 0x5f, - 0xae, 0xa6, 0xf3, 0x72, 0xaf, 0x2f, 0x57, 0x31, 0x2d, 0xc8, 0x9e, 0x16, 0x86, 0xb5, 0xd0, 0x15, - 0xa9, 0x53, 0x32, 0x5f, 0x5a, 0xae, 0x54, 0x17, 0xaa, 0x2b, 0xe9, 0x5c, 0xe4, 0x0c, 0x8c, 0x79, - 0x71, 0x74, 0x1d, 0x4a, 0x5b, 0x7c, 0xe3, 0xdb, 0x0c, 0x45, 0x12, 0xe3, 0xcc, 0xc3, 0xe8, 0x92, - 0x24, 0x4a, 0x67, 0x20, 0x57, 0x28, 0x1c, 0xb3, 0x42, 0x9f, 0xb7, 0xe0, 0x78, 0x32, 0x0b, 0x34, - 0x7b, 0x10, 0x24, 0x9c, 0x94, 0x5e, 0xec, 0x25, 0x2d, 0x37, 0x2b, 0x60, 0x54, 0xc8, 0x14, 0xfc, - 0x99, 0x64, 0x38, 0xbb, 0x3a, 0xda, 0xd1, 0xc1, 0xcd, 0xba, 0x70, 0x96, 0xc9, 0xec, 0xe8, 0x44, - 0xf0, 0x14, 0xde, 0xd1, 0x78, 0x7e, 0x11, 0xd3, 0x82, 0x68, 0x03, 0x60, 0xb3, 0x41, 0x64, 0xc2, - 0xfa, 0x91, 0xfc, 0xd3, 0x7f, 0x59, 0x51, 0xc9, 0x6c, 0x41, 0x54, 0x26, 0x8c, 0xa1, 0x58, 0xe3, - 0x43, 0xa7, 0x52, 0xcd, 0xf5, 0xea, 0x24, 0x60, 0xe6, 0x93, 0x9c, 0xa9, 0xb4, 0xc0, 0x28, 0xd2, - 0x53, 0x89, 0xc3, 0xb1, 0xe0, 0xc0, 0x78, 0x91, 0xd6, 0xf6, 0x66, 0xd8, 0x29, 0x2c, 0xfe, 0x02, - 0x69, 0x6d, 0x27, 0x26, 0x14, 0xe7, 0xc5, 0xe0, 0x58, 0x70, 0xa0, 0x4b, 0x66, 0x93, 0x2e, 0x20, - 0x12, 0x4c, 0x8f, 0xe7, 0x2f, 0x99, 0x65, 0x4e, 0x92, 0x5e, 0x32, 0x02, 0x81, 0x25, 0x13, 0xf4, - 0x49, 0x53, 0xda, 0x99, 0x60, 0x3c, 0x9f, 0xee, 0x22, 0xed, 0x18, 0x7c, 0x3b, 0xcb, 0x3b, 0x2f, - 0x43, 0x61, 0xb3, 0xc6, 0xcc, 0x2e, 0x39, 0x0a, 0xee, 0xe5, 0x05, 0x83, 0x1b, 0x0b, 0x33, 0xbd, - 0xbc, 0x80, 0x0b, 0x9b, 0x35, 0x3a, 0xf5, 0x9d, 0x3b, 0xed, 0x80, 0x2c, 0xbb, 0x0d, 0x22, 0x42, - 0xe4, 0x67, 0x4e, 0xfd, 0x39, 0x49, 0x94, 0x9e, 0xfa, 0x0a, 0x85, 0x63, 0x56, 0x94, 0x6f, 0x2c, - 0x83, 0x4d, 0xe5, 0xf3, 0x55, 0xa2, 0x56, 0x9a, 0x6f, 0xa6, 0x14, 0xb6, 0x03, 0xa3, 0xbb, 0x61, - 0x6b, 0x9b, 0xc8, 0x5d, 0x91, 0x19, 0x84, 0x72, 0x5e, 0xd3, 0x5f, 0x17, 0x84, 0x6e, 0x10, 0xb5, - 0x9d, 0x46, 0x6a, 0x23, 0x67, 0x7a, 0x80, 0xeb, 0x3a, 0x33, 0x6c, 0xf2, 0xa6, 0x13, 0xe1, 0x6d, - 0x1e, 0xf2, 0x8a, 0x99, 0x86, 0x72, 0x26, 0x42, 0x46, 0x54, 0x2c, 0x3e, 0x11, 0x04, 0x02, 0x4b, - 0x26, 0xaa, 0xb3, 0xd9, 0x01, 0x74, 0xa2, 0x4b, 0x67, 0xa7, 0xda, 0x1b, 0x77, 0x36, 0x3b, 0x70, - 0x62, 0x56, 0xec, 0xa0, 0x69, 0x65, 0x24, 0xcc, 0x9e, 0x7e, 0x28, 0xff, 0xa0, 0xe9, 0x96, 0x60, - 0x9b, 0x1f, 0x34, 0x59, 0x54, 0x38, 0xb3, 0x2e, 0xfa, 0x71, 0x2d, 0x19, 0xbd, 0x4c, 0x84, 0xf1, - 0x7f, 0x32, 0x27, 0xf8, 0x5f, 0x3a, 0xc4, 0x19, 0xff, 0x38, 0x85, 0xc2, 0x31, 0x2b, 0x54, 0x87, - 0xb1, 0x96, 0x11, 0x15, 0x93, 0xa5, 0x23, 0xc8, 0x91, 0x0b, 0xb2, 0xe2, 0x67, 0x72, 0x75, 0x86, - 0x89, 0xc1, 0x09, 0x9e, 0xcc, 0x37, 0x8c, 0x3f, 0xf4, 0x62, 0xd9, 0x0a, 0x72, 0x86, 0x3a, 0xe3, - 0x2d, 0x18, 0x1f, 0x6a, 0x81, 0xc0, 0x92, 0x09, 0xed, 0x0d, 0xf1, 0x3c, 0xc9, 0x0f, 0x59, 0xd2, - 0x8f, 0x3c, 0x13, 0x6e, 0x96, 0x4d, 0x43, 0x86, 0x82, 0x16, 0x28, 0x1c, 0xb3, 0xa2, 0x3b, 0x39, - 0x3d, 0xf0, 0x4e, 0xe5, 0xef, 0xe4, 0xc9, 0xe3, 0x8e, 0xed, 0xe4, 0xf4, 0xb0, 0x2b, 0x8a, 0xa3, - 0x4e, 0x45, 0x2e, 0x66, 0x09, 0x0b, 0x72, 0xda, 0xa5, 0x42, 0x1f, 0xa7, 0xdb, 0xa5, 0x50, 0x38, - 0x66, 0x65, 0xff, 0x60, 0x01, 0xce, 0x74, 0x5e, 0x6f, 0xb1, 0xa1, 0xa6, 0x12, 0x7b, 0xb3, 0x24, - 0x0c, 0x35, 0x5c, 0x6d, 0x10, 0x53, 0xf5, 0x1c, 0xcc, 0xf4, 0x12, 0x4c, 0xaa, 0x47, 0x64, 0x0d, - 0xb7, 0xb6, 0xb7, 0x1e, 0x6b, 0x6a, 0x54, 0xd8, 0x8f, 0x6a, 0x92, 0x00, 0xa7, 0xcb, 0xa0, 0x39, - 0x18, 0x37, 0x80, 0x2b, 0x8b, 0x42, 0x3d, 0x10, 0x87, 0xc8, 0x37, 0xd1, 0x38, 0x49, 0x6f, 0xff, - 0x9c, 0x05, 0x0f, 0xe5, 0xe4, 0x2b, 0xee, 0x39, 0x56, 0xe7, 0x26, 0x8c, 0xb7, 0xcc, 0xa2, 0x5d, - 0xc2, 0x0b, 0x1b, 0x59, 0x91, 0x55, 0x5b, 0x13, 0x08, 0x9c, 0x64, 0x6a, 0xff, 0x4c, 0x01, 0x4e, - 0x77, 0xf4, 0x8a, 0x46, 0x18, 0x4e, 0x6c, 0x35, 0x43, 0x67, 0x21, 0x20, 0x75, 0xe2, 0x45, 0xae, - 0xd3, 0xa8, 0xb6, 0x48, 0x4d, 0x33, 0xb5, 0x31, 0xf7, 0xe2, 0x4b, 0x6b, 0xd5, 0xb9, 0x34, 0x05, - 0xce, 0x29, 0x89, 0x96, 0x01, 0xa5, 0x31, 0x62, 0x84, 0xd9, 0xd5, 0x34, 0xcd, 0x0f, 0x67, 0x94, - 0x40, 0x1f, 0x84, 0x51, 0xe5, 0x6d, 0xad, 0x8d, 0x38, 0xdb, 0xd8, 0xb1, 0x8e, 0xc0, 0x26, 0x1d, - 0xba, 0xc8, 0x73, 0xa7, 0x88, 0x2c, 0x3b, 0xc2, 0x2e, 0x37, 0x2e, 0x13, 0xa3, 0x08, 0x30, 0xd6, - 0x69, 0xe6, 0x5f, 0xfa, 0xed, 0x6f, 0x9e, 0x79, 0xdf, 0xef, 0x7f, 0xf3, 0xcc, 0xfb, 0xfe, 0xe8, - 0x9b, 0x67, 0xde, 0xf7, 0x3d, 0x77, 0xcf, 0x58, 0xbf, 0x7d, 0xf7, 0x8c, 0xf5, 0xfb, 0x77, 0xcf, - 0x58, 0x7f, 0x74, 0xf7, 0x8c, 0xf5, 0xef, 0xee, 0x9e, 0xb1, 0xbe, 0xf4, 0xa7, 0x67, 0xde, 0xf7, - 0x26, 0x8a, 0xa3, 0xdf, 0x5e, 0xa0, 0xa3, 0x73, 0x61, 0xf7, 0xe2, 0xff, 0x0a, 0x00, 0x00, 0xff, - 0xff, 0x31, 0xd1, 0xcb, 0x48, 0xf3, 0x1a, 0x01, 0x00, + // 14822 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x70, 0x24, 0xc9, + 0x75, 0x18, 0xcc, 0xea, 0xc6, 0xd5, 0x0f, 0x77, 0x62, 0x0e, 0x0c, 0x76, 0x66, 0x7a, 0xb6, 0x76, + 0x77, 0x76, 0xf6, 0xc2, 0x70, 0xf6, 0x20, 0x97, 0xbb, 0xe4, 0x8a, 0x38, 0x67, 0xb0, 0x03, 0x60, + 0x7a, 0xb3, 0x31, 0x33, 0xe4, 0x72, 0xc9, 0x60, 0xa1, 0x3b, 0x01, 0x14, 0xd1, 0xa8, 0xea, 0xad, + 0xaa, 0xc6, 0x0c, 0xe6, 0x23, 0x43, 0x12, 0xf5, 0xe9, 0xa0, 0xa4, 0xef, 0x0b, 0xc6, 0x17, 0xfa, + 0x8e, 0xa0, 0x14, 0x8a, 0x2f, 0x24, 0x59, 0x87, 0x69, 0xd9, 0xa6, 0x29, 0x4b, 0xb2, 0xa8, 0xcb, + 0x57, 0x58, 0x72, 0x38, 0x64, 0x59, 0x11, 0x16, 0x15, 0xa1, 0x30, 0x24, 0x8e, 0x1c, 0x21, 0x2b, + 0xc2, 0x96, 0xe4, 0xe3, 0x87, 0x0d, 0xcb, 0x96, 0x23, 0xcf, 0xca, 0xac, 0xa3, 0xbb, 0x31, 0x8b, + 0x01, 0x97, 0x8c, 0xfd, 0xd7, 0xfd, 0xde, 0xcb, 0x97, 0x59, 0x79, 0xbe, 0x7c, 0xef, 0xe5, 0x7b, + 0xf0, 0xea, 0xf6, 0xcb, 0xe1, 0xb4, 0xeb, 0x5f, 0xde, 0x6e, 0xad, 0x93, 0xc0, 0x23, 0x11, 0x09, + 0x2f, 0xef, 0x12, 0xaf, 0xee, 0x07, 0x97, 0x05, 0xc2, 0x69, 0xba, 0x97, 0x6b, 0x7e, 0x40, 0x2e, + 0xef, 0x5e, 0xb9, 0xbc, 0x49, 0x3c, 0x12, 0x38, 0x11, 0xa9, 0x4f, 0x37, 0x03, 0x3f, 0xf2, 0x11, + 0xe2, 0x34, 0xd3, 0x4e, 0xd3, 0x9d, 0xa6, 0x34, 0xd3, 0xbb, 0x57, 0xa6, 0x9e, 0xdb, 0x74, 0xa3, + 0xad, 0xd6, 0xfa, 0x74, 0xcd, 0xdf, 0xb9, 0xbc, 0xe9, 0x6f, 0xfa, 0x97, 0x19, 0xe9, 0x7a, 0x6b, + 0x83, 0xfd, 0x63, 0x7f, 0xd8, 0x2f, 0xce, 0x62, 0xea, 0xc5, 0xb8, 0x9a, 0x1d, 0xa7, 0xb6, 0xe5, + 0x7a, 0x24, 0xd8, 0xbb, 0xdc, 0xdc, 0xde, 0x64, 0xf5, 0x06, 0x24, 0xf4, 0x5b, 0x41, 0x8d, 0x24, + 0x2b, 0x6e, 0x5b, 0x2a, 0xbc, 0xbc, 0x43, 0x22, 0x27, 0xa3, 0xb9, 0x53, 0x97, 0xf3, 0x4a, 0x05, + 0x2d, 0x2f, 0x72, 0x77, 0xd2, 0xd5, 0x7c, 0xa0, 0x53, 0x81, 0xb0, 0xb6, 0x45, 0x76, 0x9c, 0x54, + 0xb9, 0x17, 0xf2, 0xca, 0xb5, 0x22, 0xb7, 0x71, 0xd9, 0xf5, 0xa2, 0x30, 0x0a, 0x92, 0x85, 0xec, + 0xaf, 0x5b, 0x70, 0x61, 0xe6, 0x76, 0x75, 0xa1, 0xe1, 0x84, 0x91, 0x5b, 0x9b, 0x6d, 0xf8, 0xb5, + 0xed, 0x6a, 0xe4, 0x07, 0xe4, 0x96, 0xdf, 0x68, 0xed, 0x90, 0x2a, 0xeb, 0x08, 0xf4, 0x2c, 0x0c, + 0xec, 0xb2, 0xff, 0x4b, 0xf3, 0x93, 0xd6, 0x05, 0xeb, 0x52, 0x69, 0x76, 0xec, 0xb7, 0xf6, 0xcb, + 0xef, 0xbb, 0xbf, 0x5f, 0x1e, 0xb8, 0x25, 0xe0, 0x58, 0x51, 0xa0, 0x8b, 0xd0, 0xb7, 0x11, 0xae, + 0xed, 0x35, 0xc9, 0x64, 0x81, 0xd1, 0x8e, 0x08, 0xda, 0xbe, 0xc5, 0x2a, 0x85, 0x62, 0x81, 0x45, + 0x97, 0xa1, 0xd4, 0x74, 0x82, 0xc8, 0x8d, 0x5c, 0xdf, 0x9b, 0x2c, 0x5e, 0xb0, 0x2e, 0xf5, 0xce, + 0x8e, 0x0b, 0xd2, 0x52, 0x45, 0x22, 0x70, 0x4c, 0x43, 0x9b, 0x11, 0x10, 0xa7, 0x7e, 0xc3, 0x6b, + 0xec, 0x4d, 0xf6, 0x5c, 0xb0, 0x2e, 0x0d, 0xc4, 0xcd, 0xc0, 0x02, 0x8e, 0x15, 0x85, 0xfd, 0xa5, + 0x02, 0x0c, 0xcc, 0x6c, 0x6c, 0xb8, 0x9e, 0x1b, 0xed, 0xa1, 0x5b, 0x30, 0xe4, 0xf9, 0x75, 0x22, + 0xff, 0xb3, 0xaf, 0x18, 0x7c, 0xfe, 0xc2, 0x74, 0x7a, 0x2a, 0x4d, 0xaf, 0x6a, 0x74, 0xb3, 0x63, + 0xf7, 0xf7, 0xcb, 0x43, 0x3a, 0x04, 0x1b, 0x7c, 0x10, 0x86, 0xc1, 0xa6, 0x5f, 0x57, 0x6c, 0x0b, + 0x8c, 0x6d, 0x39, 0x8b, 0x6d, 0x25, 0x26, 0x9b, 0x1d, 0xbd, 0xbf, 0x5f, 0x1e, 0xd4, 0x00, 0x58, + 0x67, 0x82, 0xd6, 0x61, 0x94, 0xfe, 0xf5, 0x22, 0x57, 0xf1, 0x2d, 0x32, 0xbe, 0x8f, 0xe5, 0xf1, + 0xd5, 0x48, 0x67, 0x27, 0xee, 0xef, 0x97, 0x47, 0x13, 0x40, 0x9c, 0x64, 0x68, 0xdf, 0x83, 0x91, + 0x99, 0x28, 0x72, 0x6a, 0x5b, 0xa4, 0xce, 0x47, 0x10, 0xbd, 0x08, 0x3d, 0x9e, 0xb3, 0x43, 0xc4, + 0xf8, 0x5e, 0x10, 0x1d, 0xdb, 0xb3, 0xea, 0xec, 0x90, 0x83, 0xfd, 0xf2, 0xd8, 0x4d, 0xcf, 0x7d, + 0xbb, 0x25, 0x66, 0x05, 0x85, 0x61, 0x46, 0x8d, 0x9e, 0x07, 0xa8, 0x93, 0x5d, 0xb7, 0x46, 0x2a, + 0x4e, 0xb4, 0x25, 0xc6, 0x1b, 0x89, 0xb2, 0x30, 0xaf, 0x30, 0x58, 0xa3, 0xb2, 0xef, 0x42, 0x69, + 0x66, 0xd7, 0x77, 0xeb, 0x15, 0xbf, 0x1e, 0xa2, 0x6d, 0x18, 0x6d, 0x06, 0x64, 0x83, 0x04, 0x0a, + 0x34, 0x69, 0x5d, 0x28, 0x5e, 0x1a, 0x7c, 0xfe, 0x52, 0xe6, 0xc7, 0x9a, 0xa4, 0x0b, 0x5e, 0x14, + 0xec, 0xcd, 0x9e, 0x16, 0xf5, 0x8d, 0x26, 0xb0, 0x38, 0xc9, 0xd9, 0xfe, 0x27, 0x05, 0x38, 0x39, + 0x73, 0xaf, 0x15, 0x90, 0x79, 0x37, 0xdc, 0x4e, 0xce, 0xf0, 0xba, 0x1b, 0x6e, 0xaf, 0xc6, 0x3d, + 0xa0, 0xa6, 0xd6, 0xbc, 0x80, 0x63, 0x45, 0x81, 0x9e, 0x83, 0x7e, 0xfa, 0xfb, 0x26, 0x5e, 0x12, + 0x9f, 0x3c, 0x21, 0x88, 0x07, 0xe7, 0x9d, 0xc8, 0x99, 0xe7, 0x28, 0x2c, 0x69, 0xd0, 0x0a, 0x0c, + 0xd6, 0xd8, 0x82, 0xdc, 0x5c, 0xf1, 0xeb, 0x84, 0x0d, 0x66, 0x69, 0xf6, 0x19, 0x4a, 0x3e, 0x17, + 0x83, 0x0f, 0xf6, 0xcb, 0x93, 0xbc, 0x6d, 0x82, 0x85, 0x86, 0xc3, 0x7a, 0x79, 0x64, 0xab, 0xf5, + 0xd5, 0xc3, 0x38, 0x41, 0xc6, 0xda, 0xba, 0xa4, 0x2d, 0x95, 0x5e, 0xb6, 0x54, 0x86, 0xb2, 0x97, + 0x09, 0xba, 0x02, 0x3d, 0xdb, 0xae, 0x57, 0x9f, 0xec, 0x63, 0xbc, 0xce, 0xd1, 0x31, 0xbf, 0xee, + 0x7a, 0xf5, 0x83, 0xfd, 0xf2, 0xb8, 0xd1, 0x1c, 0x0a, 0xc4, 0x8c, 0xd4, 0xfe, 0xcf, 0x16, 0x94, + 0x19, 0x6e, 0xd1, 0x6d, 0x90, 0x0a, 0x09, 0x42, 0x37, 0x8c, 0x88, 0x17, 0x19, 0x1d, 0xfa, 0x3c, + 0x40, 0x48, 0x6a, 0x01, 0x89, 0xb4, 0x2e, 0x55, 0x13, 0xa3, 0xaa, 0x30, 0x58, 0xa3, 0xa2, 0x1b, + 0x42, 0xb8, 0xe5, 0x04, 0x6c, 0x7e, 0x89, 0x8e, 0x55, 0x1b, 0x42, 0x55, 0x22, 0x70, 0x4c, 0x63, + 0x6c, 0x08, 0xc5, 0x4e, 0x1b, 0x02, 0xfa, 0x08, 0x8c, 0xc6, 0x95, 0x85, 0x4d, 0xa7, 0x26, 0x3b, + 0x90, 0x2d, 0x99, 0xaa, 0x89, 0xc2, 0x49, 0x5a, 0xfb, 0x6f, 0x5a, 0x62, 0xf2, 0xd0, 0xaf, 0x7e, + 0x97, 0x7f, 0xab, 0xfd, 0xcb, 0x16, 0xf4, 0xcf, 0xba, 0x5e, 0xdd, 0xf5, 0x36, 0xd1, 0xa7, 0x61, + 0x80, 0x9e, 0x4d, 0x75, 0x27, 0x72, 0xc4, 0xbe, 0xf7, 0x7e, 0x6d, 0x6d, 0xa9, 0xa3, 0x62, 0xba, + 0xb9, 0xbd, 0x49, 0x01, 0xe1, 0x34, 0xa5, 0xa6, 0xab, 0xed, 0xc6, 0xfa, 0x67, 0x48, 0x2d, 0x5a, + 0x21, 0x91, 0x13, 0x7f, 0x4e, 0x0c, 0xc3, 0x8a, 0x2b, 0xba, 0x0e, 0x7d, 0x91, 0x13, 0x6c, 0x92, + 0x48, 0x6c, 0x80, 0x99, 0x1b, 0x15, 0x2f, 0x89, 0xe9, 0x8a, 0x24, 0x5e, 0x8d, 0xc4, 0xc7, 0xc2, + 0x1a, 0x2b, 0x8a, 0x05, 0x0b, 0xfb, 0x7f, 0xf4, 0xc3, 0x99, 0xb9, 0xea, 0x52, 0xce, 0xbc, 0xba, + 0x08, 0x7d, 0xf5, 0xc0, 0xdd, 0x25, 0x81, 0xe8, 0x67, 0xc5, 0x65, 0x9e, 0x41, 0xb1, 0xc0, 0xa2, + 0x97, 0x61, 0x88, 0x1f, 0x48, 0xd7, 0x1c, 0xaf, 0xde, 0x90, 0x5d, 0x7c, 0x42, 0x50, 0x0f, 0xdd, + 0xd2, 0x70, 0xd8, 0xa0, 0x3c, 0xe4, 0xa4, 0xba, 0x98, 0x58, 0x8c, 0x79, 0x87, 0xdd, 0x17, 0x2c, + 0x18, 0xe3, 0xd5, 0xcc, 0x44, 0x51, 0xe0, 0xae, 0xb7, 0x22, 0x12, 0x4e, 0xf6, 0xb2, 0x9d, 0x6e, + 0x2e, 0xab, 0xb7, 0x72, 0x7b, 0x60, 0xfa, 0x56, 0x82, 0x0b, 0xdf, 0x04, 0x27, 0x45, 0xbd, 0x63, + 0x49, 0x34, 0x4e, 0x55, 0x8b, 0xbe, 0xc7, 0x82, 0xa9, 0x9a, 0xef, 0x45, 0x81, 0xdf, 0x68, 0x90, + 0xa0, 0xd2, 0x5a, 0x6f, 0xb8, 0xe1, 0x16, 0x9f, 0xa7, 0x98, 0x6c, 0xb0, 0x9d, 0x20, 0x67, 0x0c, + 0x15, 0x91, 0x18, 0xc3, 0xf3, 0xf7, 0xf7, 0xcb, 0x53, 0x73, 0xb9, 0xac, 0x70, 0x9b, 0x6a, 0xd0, + 0x36, 0x20, 0x7a, 0x94, 0x56, 0x23, 0x67, 0x93, 0xc4, 0x95, 0xf7, 0x77, 0x5f, 0xf9, 0xa9, 0xfb, + 0xfb, 0x65, 0xb4, 0x9a, 0x62, 0x81, 0x33, 0xd8, 0xa2, 0xb7, 0xe1, 0x04, 0x85, 0xa6, 0xbe, 0x75, + 0xa0, 0xfb, 0xea, 0x26, 0xef, 0xef, 0x97, 0x4f, 0xac, 0x66, 0x30, 0xc1, 0x99, 0xac, 0xd1, 0x77, + 0x59, 0x70, 0x26, 0xfe, 0xfc, 0x85, 0xbb, 0x4d, 0xc7, 0xab, 0xc7, 0x15, 0x97, 0xba, 0xaf, 0x98, + 0xee, 0xc9, 0x67, 0xe6, 0xf2, 0x38, 0xe1, 0xfc, 0x4a, 0x90, 0x07, 0x13, 0xb4, 0x69, 0xc9, 0xba, + 0xa1, 0xfb, 0xba, 0x4f, 0xdf, 0xdf, 0x2f, 0x4f, 0xac, 0xa6, 0x79, 0xe0, 0x2c, 0xc6, 0x53, 0x73, + 0x70, 0x32, 0x73, 0x76, 0xa2, 0x31, 0x28, 0x6e, 0x13, 0x2e, 0x75, 0x95, 0x30, 0xfd, 0x89, 0x4e, + 0x40, 0xef, 0xae, 0xd3, 0x68, 0x89, 0x85, 0x89, 0xf9, 0x9f, 0x57, 0x0a, 0x2f, 0x5b, 0xf6, 0x3f, + 0x2d, 0xc2, 0xe8, 0x5c, 0x75, 0xe9, 0x81, 0x56, 0xbd, 0x7e, 0xec, 0x15, 0xda, 0x1e, 0x7b, 0xf1, + 0x21, 0x5a, 0xcc, 0x3d, 0x44, 0xbf, 0x33, 0x63, 0xc9, 0xf6, 0xb0, 0x25, 0xfb, 0xa1, 0x9c, 0x25, + 0x7b, 0xc4, 0x0b, 0x75, 0x37, 0x67, 0xd6, 0xf6, 0xb2, 0x01, 0xcc, 0x94, 0x90, 0x96, 0xfd, 0x9a, + 0xd3, 0x48, 0x6e, 0xb5, 0x87, 0x9c, 0xba, 0x47, 0x33, 0x8e, 0x35, 0x18, 0x9a, 0x73, 0x9a, 0xce, + 0xba, 0xdb, 0x70, 0x23, 0x97, 0x84, 0xe8, 0x49, 0x28, 0x3a, 0xf5, 0x3a, 0x93, 0xee, 0x4a, 0xb3, + 0x27, 0xef, 0xef, 0x97, 0x8b, 0x33, 0x75, 0x2a, 0x66, 0x80, 0xa2, 0xda, 0xc3, 0x94, 0x02, 0x3d, + 0x0d, 0x3d, 0xf5, 0xc0, 0x6f, 0x4e, 0x16, 0x18, 0x25, 0x5d, 0xe5, 0x3d, 0xf3, 0x81, 0xdf, 0x4c, + 0x90, 0x32, 0x1a, 0xfb, 0x37, 0x0b, 0x70, 0x76, 0x8e, 0x34, 0xb7, 0x16, 0xab, 0x39, 0xe7, 0xc5, + 0x25, 0x18, 0xd8, 0xf1, 0x3d, 0x37, 0xf2, 0x83, 0x50, 0x54, 0xcd, 0x66, 0xc4, 0x8a, 0x80, 0x61, + 0x85, 0x45, 0x17, 0xa0, 0xa7, 0x19, 0x0b, 0xb1, 0x43, 0x52, 0x00, 0x66, 0xe2, 0x2b, 0xc3, 0x50, + 0x8a, 0x56, 0x48, 0x02, 0x31, 0x63, 0x14, 0xc5, 0xcd, 0x90, 0x04, 0x98, 0x61, 0x62, 0x49, 0x80, + 0xca, 0x08, 0xe2, 0x44, 0x48, 0x48, 0x02, 0x14, 0x83, 0x35, 0x2a, 0x54, 0x81, 0x52, 0x98, 0x18, + 0xd9, 0xae, 0x96, 0xe6, 0x30, 0x13, 0x15, 0xd4, 0x48, 0xc6, 0x4c, 0x8c, 0x13, 0xac, 0xaf, 0xa3, + 0xa8, 0xf0, 0xb5, 0x02, 0x20, 0xde, 0x85, 0xdf, 0x62, 0x1d, 0x77, 0x33, 0xdd, 0x71, 0xdd, 0x2f, + 0x89, 0xa3, 0xea, 0xbd, 0xff, 0x62, 0xc1, 0xd9, 0x39, 0xd7, 0xab, 0x93, 0x20, 0x67, 0x02, 0x3e, + 0x9c, 0xbb, 0xf3, 0xe1, 0x84, 0x14, 0x63, 0x8a, 0xf5, 0x1c, 0xc1, 0x14, 0xb3, 0xff, 0xc2, 0x02, + 0xc4, 0x3f, 0xfb, 0x5d, 0xf7, 0xb1, 0x37, 0xd3, 0x1f, 0x7b, 0x04, 0xd3, 0xc2, 0xfe, 0x3b, 0x16, + 0x0c, 0xce, 0x35, 0x1c, 0x77, 0x47, 0x7c, 0xea, 0x1c, 0x8c, 0x4b, 0x45, 0x11, 0x03, 0x6b, 0xb2, + 0x3f, 0xdd, 0xdc, 0xc6, 0x71, 0x12, 0x89, 0xd3, 0xf4, 0xe8, 0x13, 0x70, 0xc6, 0x00, 0xae, 0x91, + 0x9d, 0x66, 0xc3, 0x89, 0xf4, 0x5b, 0x01, 0x3b, 0xfd, 0x71, 0x1e, 0x11, 0xce, 0x2f, 0x6f, 0x2f, + 0xc3, 0xc8, 0x5c, 0xc3, 0x25, 0x5e, 0xb4, 0x54, 0x99, 0xf3, 0xbd, 0x0d, 0x77, 0x13, 0xbd, 0x02, + 0x23, 0x91, 0xbb, 0x43, 0xfc, 0x56, 0x54, 0x25, 0x35, 0xdf, 0x63, 0x77, 0x6d, 0xeb, 0x52, 0xef, + 0x2c, 0xba, 0xbf, 0x5f, 0x1e, 0x59, 0x33, 0x30, 0x38, 0x41, 0x69, 0xff, 0x21, 0x1d, 0x71, 0x7f, + 0xa7, 0xe9, 0x7b, 0xc4, 0x8b, 0xe6, 0x7c, 0xaf, 0xce, 0x75, 0x32, 0xaf, 0x40, 0x4f, 0x44, 0x47, + 0x90, 0x7f, 0xf9, 0x45, 0xb9, 0xb4, 0xe9, 0xb8, 0x1d, 0xec, 0x97, 0x4f, 0xa5, 0x4b, 0xb0, 0x91, + 0x65, 0x65, 0xd0, 0x87, 0xa0, 0x2f, 0x8c, 0x9c, 0xa8, 0x15, 0x8a, 0x4f, 0x7d, 0x54, 0x8e, 0x7f, + 0x95, 0x41, 0x0f, 0xf6, 0xcb, 0xa3, 0xaa, 0x18, 0x07, 0x61, 0x51, 0x00, 0x3d, 0x05, 0xfd, 0x3b, + 0x24, 0x0c, 0x9d, 0x4d, 0x79, 0x7e, 0x8f, 0x8a, 0xb2, 0xfd, 0x2b, 0x1c, 0x8c, 0x25, 0x1e, 0x3d, + 0x06, 0xbd, 0x24, 0x08, 0xfc, 0x40, 0xec, 0x2a, 0xc3, 0x82, 0xb0, 0x77, 0x81, 0x02, 0x31, 0xc7, + 0xd9, 0xff, 0xd2, 0x82, 0x51, 0xd5, 0x56, 0x5e, 0xd7, 0x31, 0xdc, 0x9b, 0xde, 0x04, 0xa8, 0xc9, + 0x0f, 0x0c, 0xd9, 0x79, 0x37, 0xf8, 0xfc, 0xc5, 0x4c, 0xd1, 0x22, 0xd5, 0x8d, 0x31, 0x67, 0x05, + 0x0a, 0xb1, 0xc6, 0xcd, 0xfe, 0x35, 0x0b, 0x26, 0x12, 0x5f, 0xb4, 0xec, 0x86, 0x11, 0x7a, 0x2b, + 0xf5, 0x55, 0xd3, 0xdd, 0x7d, 0x15, 0x2d, 0xcd, 0xbe, 0x49, 0x2d, 0x3e, 0x09, 0xd1, 0xbe, 0xe8, + 0x1a, 0xf4, 0xba, 0x11, 0xd9, 0x91, 0x1f, 0xf3, 0x58, 0xdb, 0x8f, 0xe1, 0xad, 0x8a, 0x47, 0x64, + 0x89, 0x96, 0xc4, 0x9c, 0x81, 0xfd, 0x9b, 0x45, 0x28, 0xf1, 0x69, 0xbb, 0xe2, 0x34, 0x8f, 0x61, + 0x2c, 0x9e, 0x81, 0x92, 0xbb, 0xb3, 0xd3, 0x8a, 0x9c, 0x75, 0x71, 0x00, 0x0d, 0xf0, 0xcd, 0x60, + 0x49, 0x02, 0x71, 0x8c, 0x47, 0x4b, 0xd0, 0xc3, 0x9a, 0xc2, 0xbf, 0xf2, 0xc9, 0xec, 0xaf, 0x14, + 0x6d, 0x9f, 0x9e, 0x77, 0x22, 0x87, 0xcb, 0x7e, 0xea, 0xe4, 0xa3, 0x20, 0xcc, 0x58, 0x20, 0x07, + 0x60, 0xdd, 0xf5, 0x9c, 0x60, 0x8f, 0xc2, 0x26, 0x8b, 0x8c, 0xe1, 0x73, 0xed, 0x19, 0xce, 0x2a, + 0x7a, 0xce, 0x56, 0x7d, 0x58, 0x8c, 0xc0, 0x1a, 0xd3, 0xa9, 0x0f, 0x42, 0x49, 0x11, 0x1f, 0x46, + 0x84, 0x9b, 0xfa, 0x08, 0x8c, 0x26, 0xea, 0xea, 0x54, 0x7c, 0x48, 0x97, 0x00, 0x7f, 0x85, 0x6d, + 0x19, 0xa2, 0xd5, 0x0b, 0xde, 0xae, 0xd8, 0x39, 0xef, 0xc1, 0x89, 0x46, 0xc6, 0xde, 0x2b, 0xc6, + 0xb5, 0xfb, 0xbd, 0xfa, 0xac, 0xf8, 0xec, 0x13, 0x59, 0x58, 0x9c, 0x59, 0x07, 0x95, 0x6a, 0xfc, + 0x26, 0x5d, 0x20, 0x4e, 0x43, 0xbf, 0x20, 0xdc, 0x10, 0x30, 0xac, 0xb0, 0x74, 0xbf, 0x3b, 0xa1, + 0x1a, 0x7f, 0x9d, 0xec, 0x55, 0x49, 0x83, 0xd4, 0x22, 0x3f, 0xf8, 0xa6, 0x36, 0xff, 0x1c, 0xef, + 0x7d, 0xbe, 0x5d, 0x0e, 0x0a, 0x06, 0xc5, 0xeb, 0x64, 0x8f, 0x0f, 0x85, 0xfe, 0x75, 0xc5, 0xb6, + 0x5f, 0xf7, 0x15, 0x0b, 0x86, 0xd5, 0xd7, 0x1d, 0xc3, 0xbe, 0x30, 0x6b, 0xee, 0x0b, 0xe7, 0xda, + 0x4e, 0xf0, 0x9c, 0x1d, 0xe1, 0x6b, 0x05, 0x38, 0xa3, 0x68, 0xe8, 0x6d, 0x86, 0xff, 0x11, 0xb3, + 0xea, 0x32, 0x94, 0x3c, 0xa5, 0xd7, 0xb3, 0x4c, 0x85, 0x5a, 0xac, 0xd5, 0x8b, 0x69, 0xa8, 0x50, + 0xea, 0xc5, 0xc7, 0xec, 0x90, 0xae, 0xf0, 0x16, 0xca, 0xed, 0x59, 0x28, 0xb6, 0xdc, 0xba, 0x38, + 0x60, 0xde, 0x2f, 0x7b, 0xfb, 0xe6, 0xd2, 0xfc, 0xc1, 0x7e, 0xf9, 0xd1, 0x3c, 0x63, 0x0b, 0x3d, + 0xd9, 0xc2, 0xe9, 0x9b, 0x4b, 0xf3, 0x98, 0x16, 0x46, 0x33, 0x30, 0x2a, 0x4f, 0xe8, 0x5b, 0x54, + 0x40, 0xf4, 0x3d, 0x71, 0x0e, 0x29, 0xad, 0x35, 0x36, 0xd1, 0x38, 0x49, 0x8f, 0xe6, 0x61, 0x6c, + 0xbb, 0xb5, 0x4e, 0x1a, 0x24, 0xe2, 0x1f, 0x7c, 0x9d, 0x70, 0x9d, 0x6e, 0x29, 0xbe, 0x4b, 0x5e, + 0x4f, 0xe0, 0x71, 0xaa, 0x84, 0xfd, 0xd7, 0xec, 0x3c, 0x10, 0xbd, 0x57, 0x09, 0x7c, 0x3a, 0xb1, + 0x28, 0xf7, 0x6f, 0xe6, 0x74, 0xee, 0x66, 0x56, 0x5c, 0x27, 0x7b, 0x6b, 0x3e, 0xbd, 0x4b, 0x64, + 0xcf, 0x0a, 0x63, 0xce, 0xf7, 0xb4, 0x9d, 0xf3, 0xbf, 0x50, 0x80, 0x93, 0xaa, 0x07, 0x0c, 0xb1, + 0xf5, 0x5b, 0xbd, 0x0f, 0xae, 0xc0, 0x60, 0x9d, 0x6c, 0x38, 0xad, 0x46, 0xa4, 0x0c, 0x0c, 0xbd, + 0xdc, 0xc8, 0x34, 0x1f, 0x83, 0xb1, 0x4e, 0x73, 0x88, 0x6e, 0xfb, 0xf9, 0x61, 0x76, 0x10, 0x47, + 0x0e, 0x9d, 0xe3, 0x6a, 0xd5, 0x58, 0xb9, 0xab, 0xe6, 0x31, 0xe8, 0x75, 0x77, 0xa8, 0x60, 0x56, + 0x30, 0xe5, 0xad, 0x25, 0x0a, 0xc4, 0x1c, 0x87, 0x9e, 0x80, 0xfe, 0x9a, 0xbf, 0xb3, 0xe3, 0x78, + 0x75, 0x76, 0xe4, 0x95, 0x66, 0x07, 0xa9, 0xec, 0x36, 0xc7, 0x41, 0x58, 0xe2, 0xd0, 0x59, 0xe8, + 0x71, 0x82, 0x4d, 0xae, 0x75, 0x29, 0xcd, 0x0e, 0xd0, 0x9a, 0x66, 0x82, 0xcd, 0x10, 0x33, 0x28, + 0xbd, 0x34, 0xde, 0xf1, 0x83, 0x6d, 0xd7, 0xdb, 0x9c, 0x77, 0x03, 0xb1, 0x24, 0xd4, 0x59, 0x78, + 0x5b, 0x61, 0xb0, 0x46, 0x85, 0x16, 0xa1, 0xb7, 0xe9, 0x07, 0x51, 0x38, 0xd9, 0xc7, 0xba, 0xfb, + 0xd1, 0x9c, 0x8d, 0x88, 0x7f, 0x6d, 0xc5, 0x0f, 0xa2, 0xf8, 0x03, 0xe8, 0xbf, 0x10, 0xf3, 0xe2, + 0x68, 0x19, 0xfa, 0x89, 0xb7, 0xbb, 0x18, 0xf8, 0x3b, 0x93, 0x13, 0xf9, 0x9c, 0x16, 0x38, 0x09, + 0x9f, 0x66, 0xb1, 0x8c, 0x2a, 0xc0, 0x58, 0xb2, 0x40, 0x1f, 0x82, 0x22, 0xf1, 0x76, 0x27, 0xfb, + 0x19, 0xa7, 0xa9, 0x1c, 0x4e, 0xb7, 0x9c, 0x20, 0xde, 0xf3, 0x17, 0xbc, 0x5d, 0x4c, 0xcb, 0xa0, + 0x8f, 0x43, 0x49, 0x6e, 0x18, 0xa1, 0x50, 0x67, 0x66, 0x4e, 0x58, 0xb9, 0xcd, 0x60, 0xf2, 0x76, + 0xcb, 0x0d, 0xc8, 0x0e, 0xf1, 0xa2, 0x30, 0xde, 0x21, 0x25, 0x36, 0xc4, 0x31, 0x37, 0x54, 0x83, + 0xa1, 0x80, 0x84, 0xee, 0x3d, 0x52, 0xf1, 0x1b, 0x6e, 0x6d, 0x6f, 0xf2, 0x34, 0x6b, 0xde, 0x53, + 0x6d, 0xbb, 0x0c, 0x6b, 0x05, 0x62, 0x75, 0xbb, 0x0e, 0xc5, 0x06, 0x53, 0xf4, 0x06, 0x0c, 0x07, + 0x24, 0x8c, 0x9c, 0x20, 0x12, 0xb5, 0x4c, 0x2a, 0xf3, 0xd8, 0x30, 0xd6, 0x11, 0xfc, 0x3a, 0x11, + 0x57, 0x13, 0x63, 0xb0, 0xc9, 0x01, 0x7d, 0x5c, 0xea, 0xfe, 0x57, 0xfc, 0x96, 0x17, 0x85, 0x93, + 0x25, 0xd6, 0xee, 0x4c, 0xab, 0xec, 0xad, 0x98, 0x2e, 0x69, 0x1c, 0xe0, 0x85, 0xb1, 0xc1, 0x0a, + 0x7d, 0x12, 0x86, 0xf9, 0x7f, 0x6e, 0xdb, 0x0c, 0x27, 0x4f, 0x32, 0xde, 0x17, 0xf2, 0x79, 0x73, + 0xc2, 0xd9, 0x93, 0x82, 0xf9, 0xb0, 0x0e, 0x0d, 0xb1, 0xc9, 0x0d, 0x61, 0x18, 0x6e, 0xb8, 0xbb, + 0xc4, 0x23, 0x61, 0x58, 0x09, 0xfc, 0x75, 0x22, 0x54, 0xb5, 0x67, 0xb2, 0x6d, 0xa1, 0xfe, 0x3a, + 0x99, 0x1d, 0xa7, 0x3c, 0x97, 0xf5, 0x32, 0xd8, 0x64, 0x81, 0x6e, 0xc2, 0x08, 0xbd, 0x1b, 0xbb, + 0x31, 0xd3, 0xc1, 0x4e, 0x4c, 0xd9, 0x7d, 0x10, 0x1b, 0x85, 0x70, 0x82, 0x09, 0xba, 0x01, 0x43, + 0xac, 0xcf, 0x5b, 0x4d, 0xce, 0xf4, 0x54, 0x27, 0xa6, 0xcc, 0x94, 0x5e, 0xd5, 0x8a, 0x60, 0x83, + 0x01, 0x7a, 0x1d, 0x4a, 0x0d, 0x77, 0x83, 0xd4, 0xf6, 0x6a, 0x0d, 0x32, 0x39, 0xc4, 0xb8, 0x65, + 0x6e, 0x86, 0xcb, 0x92, 0x88, 0xcb, 0xe7, 0xea, 0x2f, 0x8e, 0x8b, 0xa3, 0x5b, 0x70, 0x2a, 0x22, + 0xc1, 0x8e, 0xeb, 0x39, 0x74, 0x13, 0x13, 0x57, 0x42, 0x66, 0xa2, 0x1e, 0x66, 0xb3, 0xeb, 0xbc, + 0x18, 0x8d, 0x53, 0x6b, 0x99, 0x54, 0x38, 0xa7, 0x34, 0xba, 0x0b, 0x93, 0x19, 0x18, 0x3e, 0x6f, + 0x4f, 0x30, 0xce, 0x1f, 0x16, 0x9c, 0x27, 0xd7, 0x72, 0xe8, 0x0e, 0xda, 0xe0, 0x70, 0x2e, 0x77, + 0x74, 0x03, 0x46, 0xd9, 0xce, 0x59, 0x69, 0x35, 0x1a, 0xa2, 0xc2, 0x11, 0x56, 0xe1, 0x13, 0x52, + 0x8e, 0x58, 0x32, 0xd1, 0x07, 0xfb, 0x65, 0x88, 0xff, 0xe1, 0x64, 0x69, 0xb4, 0xce, 0xac, 0xa1, + 0xad, 0xc0, 0x8d, 0xf6, 0xe8, 0xaa, 0x22, 0x77, 0xa3, 0xc9, 0xd1, 0xb6, 0x9a, 0x21, 0x9d, 0x54, + 0x99, 0x4c, 0x75, 0x20, 0x4e, 0x32, 0xa4, 0x47, 0x41, 0x18, 0xd5, 0x5d, 0x6f, 0x72, 0x8c, 0xdf, + 0xa7, 0xe4, 0x4e, 0x5a, 0xa5, 0x40, 0xcc, 0x71, 0xcc, 0x12, 0x4a, 0x7f, 0xdc, 0xa0, 0x27, 0xee, + 0x38, 0x23, 0x8c, 0x2d, 0xa1, 0x12, 0x81, 0x63, 0x1a, 0x2a, 0x04, 0x47, 0xd1, 0xde, 0x24, 0x62, + 0xa4, 0x6a, 0x43, 0x5c, 0x5b, 0xfb, 0x38, 0xa6, 0x70, 0x7b, 0x1d, 0x46, 0xd4, 0x36, 0xc1, 0xfa, + 0x04, 0x95, 0xa1, 0x97, 0x89, 0x7d, 0x42, 0x8f, 0x59, 0xa2, 0x4d, 0x60, 0x22, 0x21, 0xe6, 0x70, + 0xd6, 0x04, 0xf7, 0x1e, 0x99, 0xdd, 0x8b, 0x08, 0xd7, 0x45, 0x14, 0xb5, 0x26, 0x48, 0x04, 0x8e, + 0x69, 0xec, 0xff, 0xc9, 0xc5, 0xe7, 0xf8, 0x94, 0xe8, 0xe2, 0x5c, 0x7c, 0x16, 0x06, 0xb6, 0xfc, + 0x30, 0xa2, 0xd4, 0xac, 0x8e, 0xde, 0x58, 0x60, 0xbe, 0x26, 0xe0, 0x58, 0x51, 0xa0, 0x57, 0x61, + 0xb8, 0xa6, 0x57, 0x20, 0x0e, 0x75, 0xb5, 0x8d, 0x18, 0xb5, 0x63, 0x93, 0x16, 0xbd, 0x0c, 0x03, + 0xcc, 0xbb, 0xa7, 0xe6, 0x37, 0x84, 0xb4, 0x29, 0x25, 0x93, 0x81, 0x8a, 0x80, 0x1f, 0x68, 0xbf, + 0xb1, 0xa2, 0x46, 0x17, 0xa1, 0x8f, 0x36, 0x61, 0xa9, 0x22, 0x8e, 0x53, 0xa5, 0x92, 0xbb, 0xc6, + 0xa0, 0x58, 0x60, 0xed, 0x5f, 0xb3, 0x98, 0x2c, 0x95, 0xde, 0xf3, 0xd1, 0x35, 0x76, 0x68, 0xb0, + 0x13, 0x44, 0x53, 0x89, 0x3d, 0xae, 0x9d, 0x04, 0x0a, 0x77, 0x90, 0xf8, 0x8f, 0x8d, 0x92, 0xe8, + 0xcd, 0xe4, 0xc9, 0xc0, 0x05, 0x8a, 0x17, 0x65, 0x17, 0x24, 0x4f, 0x87, 0x47, 0xe2, 0x23, 0x8e, + 0xb6, 0xa7, 0xdd, 0x11, 0x61, 0xff, 0x5f, 0x05, 0x6d, 0x96, 0x54, 0x23, 0x27, 0x22, 0xa8, 0x02, + 0xfd, 0x77, 0x1c, 0x37, 0x72, 0xbd, 0x4d, 0x21, 0xf7, 0xb5, 0x3f, 0xe8, 0x58, 0xa1, 0xdb, 0xbc, + 0x00, 0x97, 0x5e, 0xc4, 0x1f, 0x2c, 0xd9, 0x50, 0x8e, 0x41, 0xcb, 0xf3, 0x28, 0xc7, 0x42, 0xb7, + 0x1c, 0x31, 0x2f, 0xc0, 0x39, 0x8a, 0x3f, 0x58, 0xb2, 0x41, 0x6f, 0x01, 0xc8, 0x1d, 0x82, 0xd4, + 0x85, 0x57, 0xd0, 0xb3, 0x9d, 0x99, 0xae, 0xa9, 0x32, 0xb3, 0x23, 0x54, 0x36, 0x8a, 0xff, 0x63, + 0x8d, 0x9f, 0x1d, 0x69, 0x63, 0xaa, 0x37, 0x06, 0x7d, 0x82, 0x2e, 0x51, 0x27, 0x88, 0x48, 0x7d, + 0x26, 0x12, 0x9d, 0xf3, 0x74, 0x77, 0x97, 0xc3, 0x35, 0x77, 0x87, 0xe8, 0xcb, 0x59, 0x30, 0xc1, + 0x31, 0x3f, 0xfb, 0x97, 0x8a, 0x30, 0x99, 0xd7, 0x5c, 0xba, 0x68, 0xc8, 0x5d, 0x37, 0x9a, 0xa3, + 0x62, 0xad, 0x65, 0x2e, 0x9a, 0x05, 0x01, 0xc7, 0x8a, 0x82, 0xce, 0xde, 0xd0, 0xdd, 0x94, 0x77, + 0xfb, 0xde, 0x78, 0xf6, 0x56, 0x19, 0x14, 0x0b, 0x2c, 0xa5, 0x0b, 0x88, 0x13, 0x0a, 0xb7, 0x33, + 0x6d, 0x96, 0x63, 0x06, 0xc5, 0x02, 0xab, 0x6b, 0x19, 0x7b, 0x3a, 0x68, 0x19, 0x8d, 0x2e, 0xea, + 0x3d, 0xda, 0x2e, 0x42, 0x9f, 0x02, 0xd8, 0x70, 0x3d, 0x37, 0xdc, 0x62, 0xdc, 0xfb, 0x0e, 0xcd, + 0x5d, 0x09, 0xc5, 0x8b, 0x8a, 0x0b, 0xd6, 0x38, 0xa2, 0x97, 0x60, 0x50, 0x6d, 0x20, 0x4b, 0xf3, + 0xcc, 0x06, 0xaf, 0xf9, 0x34, 0xc5, 0xbb, 0xe9, 0x3c, 0xd6, 0xe9, 0xec, 0xcf, 0x24, 0xe7, 0x8b, + 0x58, 0x01, 0x5a, 0xff, 0x5a, 0xdd, 0xf6, 0x6f, 0xa1, 0x7d, 0xff, 0xda, 0xdf, 0xe8, 0x83, 0x51, + 0xa3, 0xb2, 0x56, 0xd8, 0xc5, 0x9e, 0x7b, 0x95, 0x1e, 0x40, 0x4e, 0x44, 0xc4, 0xfa, 0xb3, 0x3b, + 0x2f, 0x15, 0xfd, 0x90, 0xa2, 0x2b, 0x80, 0x97, 0x47, 0x9f, 0x82, 0x52, 0xc3, 0x09, 0x99, 0xc6, + 0x92, 0x88, 0x75, 0xd7, 0x0d, 0xb3, 0xf8, 0x42, 0xe8, 0x84, 0x91, 0x76, 0xea, 0x73, 0xde, 0x31, + 0x4b, 0x7a, 0x52, 0x52, 0xf9, 0x4a, 0xfa, 0x35, 0xaa, 0x46, 0x50, 0x21, 0x6c, 0x0f, 0x73, 0x1c, + 0x7a, 0x99, 0x6d, 0xad, 0x74, 0x56, 0xcc, 0x51, 0x69, 0x94, 0x4d, 0xb3, 0x5e, 0x43, 0xc8, 0x56, + 0x38, 0x6c, 0x50, 0xc6, 0x77, 0xb2, 0xbe, 0x36, 0x77, 0xb2, 0xa7, 0xa0, 0x9f, 0xfd, 0x50, 0x33, + 0x40, 0x8d, 0xc6, 0x12, 0x07, 0x63, 0x89, 0x4f, 0x4e, 0x98, 0x81, 0xee, 0x26, 0x0c, 0xbd, 0xf5, + 0x89, 0x49, 0xcd, 0xfc, 0x1f, 0x06, 0xf8, 0x2e, 0x27, 0xa6, 0x3c, 0x96, 0x38, 0xf4, 0x33, 0x16, + 0x20, 0xa7, 0x41, 0x6f, 0xcb, 0x14, 0xac, 0x2e, 0x37, 0xc0, 0x44, 0xed, 0x57, 0x3b, 0x76, 0x7b, + 0x2b, 0x9c, 0x9e, 0x49, 0x95, 0xe6, 0x9a, 0xd2, 0x57, 0x44, 0x13, 0x51, 0x9a, 0x40, 0x3f, 0x8c, + 0x96, 0xdd, 0x30, 0xfa, 0xfc, 0x1f, 0x25, 0x0e, 0xa7, 0x8c, 0x26, 0xa1, 0x9b, 0xfa, 0xe5, 0x6b, + 0xf0, 0x90, 0x97, 0xaf, 0xe1, 0xbc, 0x8b, 0xd7, 0x54, 0x0b, 0x4e, 0xe7, 0x7c, 0x41, 0x86, 0xfe, + 0x75, 0x5e, 0xd7, 0xbf, 0x76, 0xd0, 0xda, 0x4d, 0xcb, 0x3a, 0xa6, 0xdf, 0x68, 0x39, 0x5e, 0xe4, + 0x46, 0x7b, 0xba, 0xbe, 0xf6, 0x69, 0x18, 0x99, 0x77, 0xc8, 0x8e, 0xef, 0x2d, 0x78, 0xf5, 0xa6, + 0xef, 0x7a, 0x11, 0x9a, 0x84, 0x1e, 0x26, 0x7c, 0xf0, 0xad, 0xb7, 0x87, 0xf6, 0x1e, 0x66, 0x10, + 0x7b, 0x13, 0x4e, 0xce, 0xfb, 0x77, 0xbc, 0x3b, 0x4e, 0x50, 0x9f, 0xa9, 0x2c, 0x69, 0xfa, 0xa4, + 0x55, 0xa9, 0xcf, 0xb0, 0xf2, 0x6f, 0x8b, 0x5a, 0x49, 0x7e, 0x1d, 0x5a, 0x74, 0x1b, 0x24, 0x47, + 0xeb, 0xf7, 0xff, 0x16, 0x8c, 0x9a, 0x62, 0x7a, 0x65, 0x77, 0xb6, 0x72, 0xed, 0xce, 0x6f, 0xc0, + 0xc0, 0x86, 0x4b, 0x1a, 0x75, 0x4c, 0x36, 0x44, 0xef, 0x3c, 0x99, 0xef, 0x99, 0xb6, 0x48, 0x29, + 0xa5, 0x96, 0x97, 0x6b, 0x43, 0x16, 0x45, 0x61, 0xac, 0xd8, 0xa0, 0x6d, 0x18, 0x93, 0x7d, 0x28, + 0xb1, 0x62, 0x3f, 0x78, 0xaa, 0xdd, 0xc0, 0x9b, 0xcc, 0x4f, 0xdc, 0xdf, 0x2f, 0x8f, 0xe1, 0x04, + 0x1b, 0x9c, 0x62, 0x8c, 0xce, 0x42, 0xcf, 0x0e, 0x3d, 0xf9, 0x7a, 0x58, 0xf7, 0x33, 0xf5, 0x07, + 0xd3, 0xe4, 0x30, 0xa8, 0xfd, 0x63, 0x16, 0x9c, 0x4e, 0xf5, 0x8c, 0xd0, 0x68, 0x1d, 0xf1, 0x28, + 0x24, 0x35, 0x4c, 0x85, 0xce, 0x1a, 0x26, 0xfb, 0x6f, 0x59, 0x70, 0x62, 0x61, 0xa7, 0x19, 0xed, + 0xcd, 0xbb, 0xa6, 0x91, 0xf8, 0x83, 0xd0, 0xb7, 0x43, 0xea, 0x6e, 0x6b, 0x47, 0x8c, 0x5c, 0x59, + 0x9e, 0x0e, 0x2b, 0x0c, 0x7a, 0xb0, 0x5f, 0x1e, 0xae, 0x46, 0x7e, 0xe0, 0x6c, 0x12, 0x0e, 0xc0, + 0x82, 0x9c, 0x9d, 0xb1, 0xee, 0x3d, 0xb2, 0xec, 0xee, 0xb8, 0xd1, 0x83, 0xcd, 0x76, 0x61, 0xdf, + 0x95, 0x4c, 0x70, 0xcc, 0xcf, 0xfe, 0xba, 0x05, 0xa3, 0x72, 0xde, 0xcf, 0xd4, 0xeb, 0x01, 0x09, + 0x43, 0x34, 0x05, 0x05, 0xb7, 0x29, 0x5a, 0x09, 0xa2, 0x95, 0x85, 0xa5, 0x0a, 0x2e, 0xb8, 0x4d, + 0x29, 0xce, 0xb3, 0x03, 0xa8, 0x68, 0x9a, 0xba, 0xaf, 0x09, 0x38, 0x56, 0x14, 0xe8, 0x12, 0x0c, + 0x78, 0x7e, 0x9d, 0x4b, 0xc4, 0x5c, 0x94, 0x60, 0x13, 0x6c, 0x55, 0xc0, 0xb0, 0xc2, 0xa2, 0x0a, + 0x94, 0xb8, 0x23, 0x64, 0x3c, 0x69, 0xbb, 0x72, 0xa7, 0x64, 0x5f, 0xb6, 0x26, 0x4b, 0xe2, 0x98, + 0x89, 0xfd, 0x1b, 0x16, 0x0c, 0xc9, 0x2f, 0xeb, 0xf2, 0xae, 0x42, 0x97, 0x56, 0x7c, 0x4f, 0x89, + 0x97, 0x16, 0xbd, 0x6b, 0x30, 0x8c, 0x71, 0xc5, 0x28, 0x1e, 0xea, 0x8a, 0x71, 0x05, 0x06, 0x9d, + 0x66, 0xb3, 0x62, 0xde, 0x4f, 0xd8, 0x54, 0x9a, 0x89, 0xc1, 0x58, 0xa7, 0xb1, 0x7f, 0xb4, 0x00, + 0x23, 0xf2, 0x0b, 0xaa, 0xad, 0xf5, 0x90, 0x44, 0x68, 0x0d, 0x4a, 0x0e, 0x1f, 0x25, 0x22, 0x27, + 0xf9, 0x63, 0xd9, 0x7a, 0x33, 0x63, 0x48, 0x63, 0x41, 0x6b, 0x46, 0x96, 0xc6, 0x31, 0x23, 0xd4, + 0x80, 0x71, 0xcf, 0x8f, 0xd8, 0xa1, 0xab, 0xf0, 0xed, 0x4c, 0x99, 0x49, 0xee, 0x67, 0x04, 0xf7, + 0xf1, 0xd5, 0x24, 0x17, 0x9c, 0x66, 0x8c, 0x16, 0xa4, 0x2e, 0xb2, 0x98, 0xaf, 0x44, 0xd2, 0x07, + 0x2e, 0x5b, 0x15, 0x69, 0xff, 0xaa, 0x05, 0x25, 0x49, 0x76, 0x1c, 0x56, 0xeb, 0x15, 0xe8, 0x0f, + 0xd9, 0x20, 0xc8, 0xae, 0xb1, 0xdb, 0x35, 0x9c, 0x8f, 0x57, 0x2c, 0x4b, 0xf0, 0xff, 0x21, 0x96, + 0x3c, 0x98, 0x29, 0x4a, 0x35, 0xff, 0x5d, 0x62, 0x8a, 0x52, 0xed, 0xc9, 0x39, 0x94, 0xfe, 0x94, + 0xb5, 0x59, 0xd3, 0xed, 0x52, 0x91, 0xb7, 0x19, 0x90, 0x0d, 0xf7, 0x6e, 0x52, 0xe4, 0xad, 0x30, + 0x28, 0x16, 0x58, 0xf4, 0x16, 0x0c, 0xd5, 0xa4, 0x0d, 0x22, 0x5e, 0xe1, 0x17, 0xdb, 0xda, 0xc3, + 0x94, 0xe9, 0x94, 0xeb, 0xd0, 0xe6, 0xb4, 0xf2, 0xd8, 0xe0, 0x66, 0x3a, 0xfa, 0x14, 0x3b, 0x39, + 0xfa, 0xc4, 0x7c, 0xf3, 0xdd, 0x5e, 0x7e, 0xdc, 0x82, 0x3e, 0xae, 0x7b, 0xee, 0x4e, 0xf5, 0xaf, + 0x59, 0x92, 0xe3, 0xbe, 0xbb, 0x45, 0x81, 0x42, 0xd2, 0x40, 0x2b, 0x50, 0x62, 0x3f, 0x98, 0xee, + 0xbc, 0x98, 0xff, 0x0e, 0x87, 0xd7, 0xaa, 0x37, 0xf0, 0x96, 0x2c, 0x86, 0x63, 0x0e, 0xf6, 0x8f, + 0x14, 0xe9, 0xee, 0x16, 0x93, 0x1a, 0x87, 0xbe, 0xf5, 0xf0, 0x0e, 0xfd, 0xc2, 0xc3, 0x3a, 0xf4, + 0x37, 0x61, 0xb4, 0xa6, 0xd9, 0x9d, 0xe3, 0x91, 0xbc, 0xd4, 0x76, 0x92, 0x68, 0x26, 0x6a, 0xae, + 0x9d, 0x9b, 0x33, 0x99, 0xe0, 0x24, 0x57, 0xf4, 0x09, 0x18, 0xe2, 0xe3, 0x2c, 0x6a, 0xe1, 0xbe, + 0x52, 0x4f, 0xe4, 0xcf, 0x17, 0xbd, 0x0a, 0xae, 0xcd, 0xd5, 0x8a, 0x63, 0x83, 0x99, 0xfd, 0x97, + 0x16, 0xa0, 0x85, 0xe6, 0x16, 0xd9, 0x21, 0x81, 0xd3, 0x88, 0xcd, 0x47, 0x3f, 0x68, 0xc1, 0x24, + 0x49, 0x81, 0xe7, 0xfc, 0x9d, 0x1d, 0x71, 0x59, 0xcc, 0xd1, 0x67, 0x2c, 0xe4, 0x94, 0x51, 0x0f, + 0x95, 0x26, 0xf3, 0x28, 0x70, 0x6e, 0x7d, 0x68, 0x05, 0x26, 0xf8, 0x29, 0xa9, 0x10, 0x9a, 0xdf, + 0xd5, 0x23, 0x82, 0xf1, 0xc4, 0x5a, 0x9a, 0x04, 0x67, 0x95, 0xb3, 0x7f, 0x75, 0x18, 0x72, 0x5b, + 0xf1, 0x9e, 0xdd, 0xec, 0x3d, 0xbb, 0xd9, 0x7b, 0x76, 0xb3, 0xf7, 0xec, 0x66, 0xef, 0xd9, 0xcd, + 0xde, 0xb3, 0x9b, 0xbd, 0x4b, 0xed, 0x66, 0xff, 0xb7, 0x05, 0x27, 0xd5, 0xf1, 0x65, 0x5c, 0xd8, + 0x3f, 0x0b, 0x13, 0x7c, 0xb9, 0x19, 0x3e, 0xc6, 0xe2, 0xb8, 0xbe, 0x92, 0x39, 0x73, 0x13, 0xbe, + 0xf0, 0x46, 0x41, 0xfe, 0xa8, 0x28, 0x03, 0x81, 0xb3, 0xaa, 0xb1, 0x7f, 0x69, 0x00, 0x7a, 0x17, + 0x76, 0x89, 0x17, 0x1d, 0xc3, 0xd5, 0xa6, 0x06, 0x23, 0xae, 0xb7, 0xeb, 0x37, 0x76, 0x49, 0x9d, + 0xe3, 0x0f, 0x73, 0x03, 0x3f, 0x25, 0x58, 0x8f, 0x2c, 0x19, 0x2c, 0x70, 0x82, 0xe5, 0xc3, 0xb0, + 0x3e, 0x5c, 0x85, 0x3e, 0x7e, 0xf8, 0x08, 0xd3, 0x43, 0xe6, 0x9e, 0xcd, 0x3a, 0x51, 0x1c, 0xa9, + 0xb1, 0x65, 0x84, 0x1f, 0x6e, 0xa2, 0x38, 0xfa, 0x0c, 0x8c, 0x6c, 0xb8, 0x41, 0x18, 0xad, 0xb9, + 0x3b, 0xf4, 0x68, 0xd8, 0x69, 0x3e, 0x80, 0xb5, 0x41, 0xf5, 0xc3, 0xa2, 0xc1, 0x09, 0x27, 0x38, + 0xa3, 0x4d, 0x18, 0x6e, 0x38, 0x7a, 0x55, 0xfd, 0x87, 0xae, 0x4a, 0x9d, 0x0e, 0xcb, 0x3a, 0x23, + 0x6c, 0xf2, 0xa5, 0xcb, 0xa9, 0xc6, 0x14, 0xe6, 0x03, 0x4c, 0x9d, 0xa1, 0x96, 0x13, 0xd7, 0x94, + 0x73, 0x1c, 0x15, 0xd0, 0x98, 0x23, 0x7b, 0xc9, 0x14, 0xd0, 0x34, 0x77, 0xf5, 0x4f, 0x43, 0x89, + 0xd0, 0x2e, 0xa4, 0x8c, 0xc5, 0x01, 0x73, 0xb9, 0xbb, 0xb6, 0xae, 0xb8, 0xb5, 0xc0, 0x37, 0xed, + 0x3c, 0x0b, 0x92, 0x13, 0x8e, 0x99, 0xa2, 0x39, 0xe8, 0x0b, 0x49, 0xe0, 0x2a, 0x5d, 0x72, 0x9b, + 0x61, 0x64, 0x64, 0xfc, 0xd5, 0x1a, 0xff, 0x8d, 0x45, 0x51, 0x3a, 0xbd, 0x1c, 0xa6, 0x8a, 0x65, + 0x87, 0x81, 0x36, 0xbd, 0x66, 0x18, 0x14, 0x0b, 0x2c, 0x7a, 0x1d, 0xfa, 0x03, 0xd2, 0x60, 0x86, + 0xc4, 0xe1, 0xee, 0x27, 0x39, 0xb7, 0x4b, 0xf2, 0x72, 0x58, 0x32, 0x40, 0xd7, 0x01, 0x05, 0x84, + 0x0a, 0x78, 0xae, 0xb7, 0xa9, 0xdc, 0xbb, 0xc5, 0x46, 0xab, 0x04, 0x69, 0x1c, 0x53, 0xc8, 0x07, + 0x8b, 0x38, 0xa3, 0x18, 0xba, 0x0a, 0xe3, 0x0a, 0xba, 0xe4, 0x85, 0x91, 0x43, 0x37, 0xb8, 0x51, + 0xc6, 0x4b, 0xe9, 0x57, 0x70, 0x92, 0x00, 0xa7, 0xcb, 0xd8, 0x3f, 0x67, 0x01, 0xef, 0xe7, 0x63, + 0xd0, 0x2a, 0xbc, 0x66, 0x6a, 0x15, 0xce, 0xe4, 0x8e, 0x5c, 0x8e, 0x46, 0xe1, 0xe7, 0x2c, 0x18, + 0xd4, 0x46, 0x36, 0x9e, 0xb3, 0x56, 0x9b, 0x39, 0xdb, 0x82, 0x31, 0x3a, 0xd3, 0x6f, 0xac, 0x87, + 0x24, 0xd8, 0x25, 0x75, 0x36, 0x31, 0x0b, 0x0f, 0x36, 0x31, 0x95, 0x2b, 0xe9, 0x72, 0x82, 0x21, + 0x4e, 0x55, 0x61, 0x7f, 0x5a, 0x36, 0x55, 0x79, 0xde, 0xd6, 0xd4, 0x98, 0x27, 0x3c, 0x6f, 0xd5, + 0xa8, 0xe2, 0x98, 0x86, 0x2e, 0xb5, 0x2d, 0x3f, 0x8c, 0x92, 0x9e, 0xb7, 0xd7, 0xfc, 0x30, 0xc2, + 0x0c, 0x63, 0xbf, 0x00, 0xb0, 0x70, 0x97, 0xd4, 0xf8, 0x8c, 0xd5, 0x2f, 0x3d, 0x56, 0xfe, 0xa5, + 0xc7, 0xfe, 0x3d, 0x0b, 0x46, 0x16, 0xe7, 0x8c, 0x93, 0x6b, 0x1a, 0x80, 0xdf, 0xd4, 0x6e, 0xdf, + 0x5e, 0x95, 0xee, 0x1f, 0xdc, 0x02, 0xae, 0xa0, 0x58, 0xa3, 0x40, 0x67, 0xa0, 0xd8, 0x68, 0x79, + 0x42, 0xed, 0xd9, 0x4f, 0x8f, 0xc7, 0xe5, 0x96, 0x87, 0x29, 0x4c, 0x7b, 0xac, 0x54, 0xec, 0xfa, + 0xb1, 0x52, 0xc7, 0x20, 0x25, 0xa8, 0x0c, 0xbd, 0x77, 0xee, 0xb8, 0x75, 0xfe, 0x14, 0x5c, 0xb8, + 0xa6, 0xdc, 0xbe, 0xbd, 0x34, 0x1f, 0x62, 0x0e, 0xb7, 0xbf, 0x58, 0x84, 0xa9, 0xc5, 0x06, 0xb9, + 0xfb, 0x0e, 0x9f, 0xc3, 0x77, 0xfb, 0xd4, 0xea, 0x70, 0x0a, 0xa4, 0xc3, 0x3e, 0xa7, 0xeb, 0xdc, + 0x1f, 0x1b, 0xd0, 0xcf, 0x1d, 0x4f, 0xe5, 0xe3, 0xf8, 0x4c, 0x73, 0x5f, 0x7e, 0x87, 0x4c, 0x73, + 0x07, 0x56, 0x61, 0xee, 0x53, 0x07, 0xa6, 0x80, 0x62, 0xc9, 0x7c, 0xea, 0x15, 0x18, 0xd2, 0x29, + 0x0f, 0xf5, 0xb0, 0xf5, 0xbb, 0x8b, 0x30, 0x46, 0x5b, 0xf0, 0x50, 0x07, 0xe2, 0x66, 0x7a, 0x20, + 0x8e, 0xfa, 0x71, 0x63, 0xe7, 0xd1, 0x78, 0x2b, 0x39, 0x1a, 0x57, 0xf2, 0x46, 0xe3, 0xb8, 0xc7, + 0xe0, 0x7b, 0x2c, 0x98, 0x58, 0x6c, 0xf8, 0xb5, 0xed, 0xc4, 0x03, 0xc4, 0x97, 0x60, 0x90, 0x6e, + 0xc7, 0xa1, 0x11, 0x8b, 0xc3, 0x88, 0xce, 0x22, 0x50, 0x58, 0xa7, 0xd3, 0x8a, 0xdd, 0xbc, 0xb9, + 0x34, 0x9f, 0x15, 0xd4, 0x45, 0xa0, 0xb0, 0x4e, 0x67, 0xff, 0x8e, 0x05, 0xe7, 0xae, 0xce, 0x2d, + 0xc4, 0x53, 0x31, 0x15, 0x57, 0xe6, 0x22, 0xf4, 0x35, 0xeb, 0x5a, 0x53, 0x62, 0xb5, 0xf0, 0x3c, + 0x6b, 0x85, 0xc0, 0xbe, 0x5b, 0x62, 0x26, 0xdd, 0x04, 0xb8, 0x8a, 0x2b, 0x73, 0x62, 0xdf, 0x95, + 0x56, 0x20, 0x2b, 0xd7, 0x0a, 0xf4, 0x04, 0xf4, 0xd3, 0x73, 0xc1, 0xad, 0xc9, 0x76, 0x73, 0x83, + 0x3e, 0x07, 0x61, 0x89, 0xb3, 0x7f, 0xd6, 0x82, 0x89, 0xab, 0x6e, 0x44, 0x0f, 0xed, 0x64, 0xe0, + 0x14, 0x7a, 0x6a, 0x87, 0x6e, 0xe4, 0x07, 0x7b, 0xc9, 0xc0, 0x29, 0x58, 0x61, 0xb0, 0x46, 0xc5, + 0x3f, 0x68, 0xd7, 0x65, 0x2f, 0x29, 0x0a, 0xa6, 0xdd, 0x0d, 0x0b, 0x38, 0x56, 0x14, 0xb4, 0xbf, + 0xea, 0x6e, 0xc0, 0x54, 0x96, 0x7b, 0x62, 0xe3, 0x56, 0xfd, 0x35, 0x2f, 0x11, 0x38, 0xa6, 0xb1, + 0xff, 0xdc, 0x82, 0xf2, 0xd5, 0x46, 0x2b, 0x8c, 0x48, 0xb0, 0x11, 0xe6, 0x6c, 0xba, 0x2f, 0x40, + 0x89, 0x48, 0x03, 0x81, 0x7c, 0xf2, 0x29, 0x05, 0x51, 0x65, 0x39, 0xe0, 0xf1, 0x5b, 0x14, 0x5d, + 0x17, 0xaf, 0xa4, 0x0f, 0xf7, 0xcc, 0x75, 0x11, 0x10, 0xd1, 0xeb, 0xd2, 0x03, 0xda, 0xb0, 0xc8, + 0x18, 0x0b, 0x29, 0x2c, 0xce, 0x28, 0x61, 0xff, 0x98, 0x05, 0x27, 0xd5, 0x07, 0xbf, 0xeb, 0x3e, + 0xd3, 0xfe, 0x6a, 0x01, 0x86, 0xaf, 0xad, 0xad, 0x55, 0xae, 0x92, 0x48, 0x9b, 0x95, 0xed, 0xcd, + 0xfe, 0x58, 0xb3, 0x5e, 0xb6, 0xbb, 0x23, 0xb6, 0x22, 0xb7, 0x31, 0xcd, 0xe3, 0xa2, 0x4d, 0x2f, + 0x79, 0xd1, 0x8d, 0xa0, 0x1a, 0x05, 0xae, 0xb7, 0x99, 0x39, 0xd3, 0xa5, 0xcc, 0x52, 0xcc, 0x93, + 0x59, 0xd0, 0x0b, 0xd0, 0xc7, 0x02, 0xb3, 0xc9, 0x41, 0x78, 0x44, 0x5d, 0xb1, 0x18, 0xf4, 0x60, + 0xbf, 0x5c, 0xba, 0x89, 0x97, 0xf8, 0x1f, 0x2c, 0x48, 0xd1, 0x4d, 0x18, 0xdc, 0x8a, 0xa2, 0xe6, + 0x35, 0xe2, 0xd4, 0x49, 0x20, 0x77, 0xd9, 0xf3, 0x59, 0xbb, 0x2c, 0xed, 0x04, 0x4e, 0x16, 0x6f, + 0x4c, 0x31, 0x2c, 0xc4, 0x3a, 0x1f, 0xbb, 0x0a, 0x10, 0xe3, 0x8e, 0xc8, 0x70, 0x63, 0xaf, 0x41, + 0x89, 0x7e, 0xee, 0x4c, 0xc3, 0x75, 0xda, 0x9b, 0xc6, 0x9f, 0x81, 0x92, 0x34, 0x7c, 0x87, 0x22, + 0x8a, 0x03, 0x3b, 0x91, 0xa4, 0x5d, 0x3c, 0xc4, 0x31, 0xde, 0x7e, 0x1c, 0x84, 0x6f, 0x69, 0x3b, + 0x96, 0xf6, 0x06, 0x9c, 0x60, 0x4e, 0xb2, 0x4e, 0xb4, 0x65, 0xcc, 0xd1, 0xce, 0x93, 0xe1, 0x59, + 0x71, 0xaf, 0xe3, 0x5f, 0x36, 0xa9, 0x3d, 0x4e, 0x1e, 0x92, 0x1c, 0xe3, 0x3b, 0x9e, 0xfd, 0x67, + 0x3d, 0xf0, 0xc8, 0x52, 0x35, 0x3f, 0xfc, 0xd0, 0xcb, 0x30, 0xc4, 0xc5, 0x45, 0x3a, 0x35, 0x9c, + 0x86, 0xa8, 0x57, 0x69, 0x40, 0xd7, 0x34, 0x1c, 0x36, 0x28, 0xd1, 0x39, 0x28, 0xba, 0x6f, 0x7b, + 0xc9, 0xa7, 0x7b, 0x4b, 0x6f, 0xac, 0x62, 0x0a, 0xa7, 0x68, 0x2a, 0x79, 0xf2, 0x2d, 0x5d, 0xa1, + 0x95, 0xf4, 0xf9, 0x1a, 0x8c, 0xb8, 0x61, 0x2d, 0x74, 0x97, 0x3c, 0xba, 0x4e, 0xb5, 0x95, 0xae, + 0x74, 0x0e, 0xb4, 0xd1, 0x0a, 0x8b, 0x13, 0xd4, 0xda, 0xf9, 0xd2, 0xdb, 0xb5, 0xf4, 0xda, 0x31, + 0xf8, 0x01, 0xdd, 0xfe, 0x9b, 0xec, 0xeb, 0x42, 0xa6, 0x82, 0x17, 0xdb, 0x3f, 0xff, 0xe0, 0x10, + 0x4b, 0x1c, 0xbd, 0xd0, 0xd5, 0xb6, 0x9c, 0xe6, 0x4c, 0x2b, 0xda, 0x9a, 0x77, 0xc3, 0x9a, 0xbf, + 0x4b, 0x82, 0x3d, 0x76, 0x17, 0x1f, 0x88, 0x2f, 0x74, 0x0a, 0x31, 0x77, 0x6d, 0xa6, 0x42, 0x29, + 0x71, 0xba, 0x0c, 0x9a, 0x81, 0x51, 0x09, 0xac, 0x92, 0x90, 0x1d, 0x01, 0x83, 0x8c, 0x8d, 0x7a, + 0x4c, 0x27, 0xc0, 0x8a, 0x49, 0x92, 0xde, 0x14, 0x70, 0xe1, 0x28, 0x04, 0xdc, 0x0f, 0xc2, 0xb0, + 0xeb, 0xb9, 0x91, 0xeb, 0x44, 0x3e, 0xb7, 0x1f, 0xf1, 0x6b, 0x37, 0x53, 0x30, 0x2f, 0xe9, 0x08, + 0x6c, 0xd2, 0xd9, 0xff, 0xb6, 0x07, 0xc6, 0xd9, 0xb0, 0xbd, 0x37, 0xc3, 0xbe, 0x9d, 0x66, 0xd8, + 0xcd, 0xf4, 0x0c, 0x3b, 0x0a, 0xc9, 0xfd, 0x81, 0xa7, 0xd9, 0x67, 0xa0, 0xa4, 0xde, 0x0f, 0xca, + 0x07, 0xc4, 0x56, 0xce, 0x03, 0xe2, 0xce, 0xa7, 0xb7, 0x74, 0x49, 0x2b, 0x66, 0xba, 0xa4, 0x7d, + 0xd9, 0x82, 0xd8, 0xb0, 0x80, 0xde, 0x80, 0x52, 0xd3, 0x67, 0x1e, 0xae, 0x81, 0x74, 0x1b, 0x7f, + 0xbc, 0xad, 0x65, 0x82, 0x47, 0x60, 0x0b, 0x78, 0x2f, 0x54, 0x64, 0x51, 0x1c, 0x73, 0x41, 0xd7, + 0xa1, 0xbf, 0x19, 0x90, 0x6a, 0xc4, 0xc2, 0x03, 0x75, 0xcf, 0x90, 0xcf, 0x1a, 0x5e, 0x10, 0x4b, + 0x0e, 0xf6, 0xbf, 0xb7, 0x60, 0x2c, 0x49, 0x8a, 0x3e, 0x0c, 0x3d, 0xe4, 0x2e, 0xa9, 0x89, 0xf6, + 0x66, 0x1e, 0xc5, 0xb1, 0x6a, 0x82, 0x77, 0x00, 0xfd, 0x8f, 0x59, 0x29, 0x74, 0x0d, 0xfa, 0xe9, + 0x39, 0x7c, 0x55, 0x85, 0xc2, 0x7b, 0x34, 0xef, 0x2c, 0x57, 0x02, 0x0d, 0x6f, 0x9c, 0x00, 0x61, + 0x59, 0x9c, 0xf9, 0x81, 0xd5, 0x9a, 0x55, 0x7a, 0xc5, 0x89, 0xda, 0xdd, 0xc4, 0xd7, 0xe6, 0x2a, + 0x9c, 0x48, 0x70, 0xe3, 0x7e, 0x60, 0x12, 0x88, 0x63, 0x26, 0xf6, 0x2f, 0x58, 0x00, 0xdc, 0xed, + 0xcd, 0xf1, 0x36, 0xc9, 0x31, 0x68, 0xd3, 0xe7, 0xa1, 0x27, 0x6c, 0x92, 0x5a, 0x3b, 0xe7, 0xeb, + 0xb8, 0x3d, 0xd5, 0x26, 0xa9, 0xc5, 0x33, 0x8e, 0xfe, 0xc3, 0xac, 0xb4, 0xfd, 0xbd, 0x00, 0x23, + 0x31, 0xd9, 0x52, 0x44, 0x76, 0xd0, 0x73, 0x46, 0xd0, 0x91, 0x33, 0x89, 0xa0, 0x23, 0x25, 0x46, + 0xad, 0x29, 0x6e, 0x3f, 0x03, 0xc5, 0x1d, 0xe7, 0xae, 0xd0, 0xcc, 0x3d, 0xd3, 0xbe, 0x19, 0x94, + 0xff, 0xf4, 0x8a, 0x73, 0x97, 0x5f, 0x5e, 0x9f, 0x91, 0x2b, 0x64, 0xc5, 0xb9, 0xdb, 0xd1, 0x41, + 0x98, 0x56, 0xc2, 0xea, 0x72, 0x3d, 0xe1, 0xd1, 0xd5, 0x55, 0x5d, 0xae, 0x97, 0xac, 0xcb, 0xf5, + 0xba, 0xa8, 0xcb, 0xf5, 0xd0, 0x3d, 0xe8, 0x17, 0x0e, 0x97, 0x22, 0x2c, 0xd9, 0xe5, 0x2e, 0xea, + 0x13, 0xfe, 0x9a, 0xbc, 0xce, 0xcb, 0xf2, 0x72, 0x2e, 0xa0, 0x1d, 0xeb, 0x95, 0x15, 0xa2, 0xff, + 0xc7, 0x82, 0x11, 0xf1, 0x1b, 0x93, 0xb7, 0x5b, 0x24, 0x8c, 0x84, 0xf0, 0xfa, 0x81, 0xee, 0xdb, + 0x20, 0x0a, 0xf2, 0xa6, 0x7c, 0x40, 0x9e, 0x33, 0x26, 0xb2, 0x63, 0x8b, 0x12, 0xad, 0x40, 0x7f, + 0xdb, 0x82, 0x13, 0x3b, 0xce, 0x5d, 0x5e, 0x23, 0x87, 0x61, 0x27, 0x72, 0x7d, 0xe1, 0xb8, 0xf0, + 0xe1, 0xee, 0x86, 0x3f, 0x55, 0x9c, 0x37, 0x52, 0x5a, 0x29, 0x4f, 0x64, 0x91, 0x74, 0x6c, 0x6a, + 0x66, 0xbb, 0xa6, 0x36, 0x60, 0x40, 0xce, 0xb7, 0x87, 0xe9, 0xdd, 0xcd, 0xea, 0x11, 0x73, 0xed, + 0xa1, 0xd6, 0xf3, 0x19, 0x18, 0xd2, 0xe7, 0xd8, 0x43, 0xad, 0xeb, 0x6d, 0x98, 0xc8, 0x98, 0x4b, + 0x0f, 0xb5, 0xca, 0x3b, 0x70, 0x26, 0x77, 0x7e, 0x3c, 0x54, 0xef, 0xfc, 0xaf, 0x5a, 0xfa, 0x3e, + 0x78, 0x0c, 0x26, 0x8d, 0x39, 0xd3, 0xa4, 0x71, 0xbe, 0xfd, 0xca, 0xc9, 0xb1, 0x6b, 0xbc, 0xa5, + 0x37, 0x9a, 0xee, 0xea, 0xe8, 0x75, 0xe8, 0x6b, 0x50, 0x88, 0x74, 0xdb, 0xb5, 0x3b, 0xaf, 0xc8, + 0x58, 0x98, 0x64, 0xf0, 0x10, 0x0b, 0x0e, 0xf6, 0x2f, 0x5b, 0xd0, 0x73, 0x0c, 0x3d, 0x81, 0xcd, + 0x9e, 0x78, 0x2e, 0x97, 0xb5, 0x88, 0xd0, 0x3e, 0x8d, 0x9d, 0x3b, 0x0b, 0x77, 0x23, 0xe2, 0x85, + 0xec, 0x44, 0xce, 0xec, 0x98, 0x9f, 0xb2, 0x60, 0x62, 0xd9, 0x77, 0xea, 0xb3, 0x4e, 0xc3, 0xf1, + 0x6a, 0x24, 0x58, 0xf2, 0x36, 0x0f, 0xe5, 0x73, 0x5e, 0xe8, 0xe8, 0x73, 0x3e, 0x27, 0x5d, 0xb6, + 0x7a, 0xf2, 0xc7, 0x8f, 0x4a, 0xd2, 0xc9, 0x30, 0x4c, 0x86, 0x73, 0xf1, 0x16, 0x20, 0xbd, 0x95, + 0xe2, 0xe5, 0x15, 0x86, 0x7e, 0x97, 0xb7, 0x57, 0x0c, 0xe2, 0x93, 0xd9, 0x12, 0x6e, 0xea, 0xf3, + 0xb4, 0x37, 0x45, 0x1c, 0x80, 0x25, 0x23, 0xfb, 0x65, 0xc8, 0x0c, 0x9b, 0xd1, 0x59, 0x7b, 0x61, + 0x7f, 0x1c, 0xc6, 0x59, 0xc9, 0x43, 0x6a, 0x06, 0xec, 0x84, 0xce, 0x35, 0x23, 0x04, 0xa8, 0xfd, + 0x05, 0x0b, 0x46, 0x57, 0x13, 0x91, 0x11, 0x2f, 0x32, 0x2b, 0x6d, 0x86, 0xaa, 0xbf, 0xca, 0xa0, + 0x58, 0x60, 0x8f, 0x5c, 0x15, 0xf6, 0xd7, 0x16, 0xc4, 0x91, 0x6c, 0x8e, 0x41, 0x7c, 0x9b, 0x33, + 0xc4, 0xb7, 0x4c, 0x41, 0x56, 0x35, 0x27, 0x4f, 0x7a, 0x43, 0xd7, 0x55, 0x8c, 0xb7, 0x36, 0x32, + 0x6c, 0xcc, 0x86, 0x4f, 0xc5, 0x11, 0x33, 0x10, 0x9c, 0x8c, 0xfa, 0x66, 0xff, 0x7e, 0x01, 0x90, + 0xa2, 0xed, 0x3a, 0x06, 0x5d, 0xba, 0xc4, 0xd1, 0xc4, 0xa0, 0xdb, 0x05, 0xc4, 0xfc, 0x0c, 0x02, + 0xc7, 0x0b, 0x39, 0x5b, 0x57, 0x28, 0xff, 0x0e, 0xe7, 0xc4, 0x30, 0x25, 0x1f, 0xa5, 0x2d, 0xa7, + 0xb8, 0xe1, 0x8c, 0x1a, 0x34, 0xff, 0x91, 0xde, 0x6e, 0xfd, 0x47, 0xfa, 0x3a, 0xbc, 0xae, 0xfc, + 0x8a, 0x05, 0xc3, 0xaa, 0x9b, 0xde, 0x25, 0x3e, 0xf8, 0xaa, 0x3d, 0x39, 0x1b, 0x68, 0x45, 0x6b, + 0x32, 0x3b, 0x58, 0xbe, 0x83, 0xbd, 0x92, 0x75, 0x1a, 0xee, 0x3d, 0xa2, 0x62, 0x96, 0x96, 0xc5, + 0xab, 0x57, 0x01, 0x3d, 0xd8, 0x2f, 0x0f, 0xab, 0x7f, 0x3c, 0x26, 0x7b, 0x5c, 0x84, 0x6e, 0xc9, + 0xa3, 0x89, 0xa9, 0x88, 0x5e, 0x82, 0xde, 0xe6, 0x96, 0x13, 0x92, 0xc4, 0x5b, 0xa5, 0xde, 0x0a, + 0x05, 0x1e, 0xec, 0x97, 0x47, 0x54, 0x01, 0x06, 0xc1, 0x9c, 0xba, 0xfb, 0xc8, 0x7e, 0xe9, 0xc9, + 0xd9, 0x31, 0xb2, 0xdf, 0x5f, 0x5a, 0xd0, 0xb3, 0xea, 0xd7, 0x8f, 0x63, 0x0b, 0x78, 0xcd, 0xd8, + 0x02, 0xce, 0xe6, 0xa5, 0xcb, 0xc8, 0x5d, 0xfd, 0x8b, 0x89, 0xd5, 0x7f, 0x3e, 0x97, 0x43, 0xfb, + 0x85, 0xbf, 0x03, 0x83, 0x2c, 0x09, 0x87, 0x78, 0x97, 0xf5, 0x82, 0xb1, 0xe0, 0xcb, 0x89, 0x05, + 0x3f, 0xaa, 0x91, 0x6a, 0x2b, 0xfd, 0x29, 0xe8, 0x17, 0x0f, 0x7d, 0x92, 0x8f, 0x8d, 0x05, 0x2d, + 0x96, 0x78, 0xfb, 0xc7, 0x8b, 0x60, 0x24, 0xfd, 0x40, 0xbf, 0x6a, 0xc1, 0x74, 0xc0, 0x1d, 0x80, + 0xeb, 0xf3, 0xad, 0xc0, 0xf5, 0x36, 0xab, 0xb5, 0x2d, 0x52, 0x6f, 0x35, 0x5c, 0x6f, 0x73, 0x69, + 0xd3, 0xf3, 0x15, 0x78, 0xe1, 0x2e, 0xa9, 0xb5, 0x98, 0x71, 0xae, 0x43, 0x86, 0x11, 0xe5, 0x48, + 0xff, 0xfc, 0xfd, 0xfd, 0xf2, 0x34, 0x3e, 0x14, 0x6f, 0x7c, 0xc8, 0xb6, 0xa0, 0xdf, 0xb1, 0xe0, + 0x32, 0xcf, 0x85, 0xd1, 0x7d, 0xfb, 0xdb, 0xdc, 0x96, 0x2b, 0x92, 0x55, 0xcc, 0x64, 0x8d, 0x04, + 0x3b, 0xb3, 0x1f, 0x14, 0x1d, 0x7a, 0xb9, 0x72, 0xb8, 0xba, 0xf0, 0x61, 0x1b, 0x67, 0xff, 0xc3, + 0x22, 0x0c, 0x8b, 0x08, 0x70, 0xe2, 0x0c, 0x78, 0xc9, 0x98, 0x12, 0x8f, 0x26, 0xa6, 0xc4, 0xb8, + 0x41, 0x7c, 0x34, 0xdb, 0x7f, 0x08, 0xe3, 0x74, 0x73, 0xbe, 0x46, 0x9c, 0x20, 0x5a, 0x27, 0x0e, + 0x77, 0x0b, 0x2b, 0x1e, 0x7a, 0xf7, 0x57, 0xfa, 0xc9, 0xe5, 0x24, 0x33, 0x9c, 0xe6, 0xff, 0xed, + 0x74, 0xe6, 0x78, 0x30, 0x96, 0x0a, 0xe2, 0xf7, 0x26, 0x94, 0xd4, 0x2b, 0x15, 0xb1, 0xe9, 0xb4, + 0x8f, 0x85, 0x99, 0xe4, 0xc0, 0xd5, 0x5f, 0xf1, 0x0b, 0xa9, 0x98, 0x9d, 0xfd, 0x77, 0x0b, 0x46, + 0x85, 0x7c, 0x10, 0x57, 0x61, 0xc0, 0x09, 0x43, 0x77, 0xd3, 0x23, 0xf5, 0x76, 0x1a, 0xca, 0x54, + 0x35, 0xec, 0xa5, 0xd0, 0x8c, 0x28, 0x89, 0x15, 0x0f, 0x74, 0x8d, 0x3b, 0xdf, 0xed, 0x92, 0x76, + 0xea, 0xc9, 0x14, 0x37, 0x90, 0xee, 0x79, 0xbb, 0x04, 0x8b, 0xf2, 0xe8, 0x93, 0xdc, 0x3b, 0xf2, + 0xba, 0xe7, 0xdf, 0xf1, 0xae, 0xfa, 0xbe, 0x8c, 0xf6, 0xd1, 0x1d, 0xc3, 0x71, 0xe9, 0x13, 0xa9, + 0x8a, 0x63, 0x93, 0x5b, 0x77, 0x51, 0x71, 0x3f, 0x0b, 0x2c, 0xf6, 0xbf, 0xf9, 0x28, 0x3c, 0x44, + 0x04, 0x46, 0x45, 0x78, 0x41, 0x09, 0x13, 0x7d, 0x97, 0x79, 0x95, 0x33, 0x4b, 0xc7, 0x8a, 0xf4, + 0xeb, 0x26, 0x0b, 0x9c, 0xe4, 0x69, 0xff, 0x8c, 0x05, 0xec, 0x81, 0xec, 0x31, 0xc8, 0x23, 0x1f, + 0x31, 0xe5, 0x91, 0xc9, 0xbc, 0x4e, 0xce, 0x11, 0x45, 0x5e, 0xe4, 0x33, 0xab, 0x12, 0xf8, 0x77, + 0xf7, 0x84, 0x4b, 0x4b, 0xe7, 0xfb, 0x87, 0xfd, 0xdf, 0x2d, 0xbe, 0x89, 0xc5, 0xe1, 0x04, 0x3e, + 0x07, 0x03, 0x35, 0xa7, 0xe9, 0xd4, 0x78, 0x86, 0xaa, 0x5c, 0x8d, 0x9e, 0x51, 0x68, 0x7a, 0x4e, + 0x94, 0xe0, 0x1a, 0x2a, 0x19, 0xa6, 0x72, 0x40, 0x82, 0x3b, 0x6a, 0xa5, 0x54, 0x95, 0x53, 0xdb, + 0x30, 0x6c, 0x30, 0x7b, 0xa8, 0xea, 0x8c, 0xcf, 0xf1, 0x23, 0x56, 0x85, 0x55, 0xdd, 0x81, 0x71, + 0x4f, 0xfb, 0x4f, 0x0f, 0x14, 0x79, 0xb9, 0x7c, 0xbc, 0xd3, 0x21, 0xca, 0x4e, 0x1f, 0xed, 0xed, + 0x6d, 0x82, 0x0d, 0x4e, 0x73, 0xb6, 0x7f, 0xc2, 0x82, 0xd3, 0x3a, 0xa1, 0xf6, 0xbc, 0xa7, 0x93, + 0x91, 0x64, 0x1e, 0x06, 0xfc, 0x26, 0x09, 0x9c, 0xc8, 0x0f, 0xc4, 0xa9, 0x71, 0x49, 0x76, 0xfa, + 0x0d, 0x01, 0x3f, 0x10, 0xf9, 0x16, 0x24, 0x77, 0x09, 0xc7, 0xaa, 0x24, 0xbd, 0x7d, 0xb2, 0xce, + 0x08, 0xc5, 0x43, 0x2e, 0xb6, 0x07, 0x30, 0x7b, 0x7b, 0x88, 0x05, 0xc6, 0xfe, 0x33, 0x8b, 0x4f, + 0x2c, 0xbd, 0xe9, 0xe8, 0x6d, 0x18, 0xdb, 0x71, 0xa2, 0xda, 0xd6, 0xc2, 0xdd, 0x66, 0xc0, 0x4d, + 0x4e, 0xb2, 0x9f, 0x9e, 0xe9, 0xd4, 0x4f, 0xda, 0x47, 0xc6, 0x0e, 0x9f, 0x2b, 0x09, 0x66, 0x38, + 0xc5, 0x1e, 0xad, 0xc3, 0x20, 0x83, 0xb1, 0x37, 0x8a, 0x61, 0x3b, 0xd1, 0x20, 0xaf, 0x36, 0xe5, + 0xb2, 0xb0, 0x12, 0xf3, 0xc1, 0x3a, 0x53, 0xfb, 0xcb, 0x45, 0xbe, 0xda, 0x99, 0x28, 0xff, 0x14, + 0xf4, 0x37, 0xfd, 0xfa, 0xdc, 0xd2, 0x3c, 0x16, 0xa3, 0xa0, 0x8e, 0x91, 0x0a, 0x07, 0x63, 0x89, + 0x47, 0x97, 0x60, 0x40, 0xfc, 0x94, 0x26, 0x42, 0xb6, 0x37, 0x0b, 0xba, 0x10, 0x2b, 0x2c, 0x7a, + 0x1e, 0xa0, 0x19, 0xf8, 0xbb, 0x6e, 0x9d, 0xc5, 0x2c, 0x29, 0x9a, 0xde, 0x46, 0x15, 0x85, 0xc1, + 0x1a, 0x15, 0x7a, 0x15, 0x86, 0x5b, 0x5e, 0xc8, 0xc5, 0x11, 0x2d, 0x32, 0xb4, 0xf2, 0x83, 0xb9, + 0xa9, 0x23, 0xb1, 0x49, 0x8b, 0x66, 0xa0, 0x2f, 0x72, 0x98, 0xf7, 0x4c, 0x6f, 0xbe, 0x53, 0xf0, + 0x1a, 0xa5, 0xd0, 0x93, 0x21, 0xd1, 0x02, 0x58, 0x14, 0x44, 0x6f, 0xca, 0xe7, 0xc2, 0x7c, 0x63, + 0x17, 0xde, 0xf8, 0xdd, 0x1d, 0x02, 0xda, 0x63, 0x61, 0xe1, 0xe5, 0x6f, 0xf0, 0x42, 0xaf, 0x00, + 0x90, 0xbb, 0x11, 0x09, 0x3c, 0xa7, 0xa1, 0x7c, 0xde, 0x94, 0x5c, 0x30, 0xef, 0xaf, 0xfa, 0xd1, + 0xcd, 0x90, 0x2c, 0x28, 0x0a, 0xac, 0x51, 0xdb, 0xbf, 0x53, 0x02, 0x88, 0xe5, 0x76, 0x74, 0x2f, + 0xb5, 0x71, 0x3d, 0xdb, 0x5e, 0xd2, 0x3f, 0xba, 0x5d, 0x0b, 0x7d, 0x9f, 0x05, 0x83, 0x22, 0x34, + 0x0b, 0x1b, 0xa1, 0x42, 0xfb, 0x8d, 0xd3, 0x8c, 0x10, 0x43, 0x4b, 0xf0, 0x26, 0xbc, 0x20, 0x67, + 0xa8, 0x86, 0xe9, 0xd8, 0x0a, 0xbd, 0x62, 0xf4, 0x7e, 0x79, 0x55, 0x2c, 0x1a, 0x5d, 0xa9, 0xae, + 0x8a, 0x25, 0x76, 0x46, 0xe8, 0xb7, 0xc4, 0x9b, 0xc6, 0x2d, 0xb1, 0x27, 0xff, 0x3d, 0xa4, 0x21, + 0xbe, 0x76, 0xba, 0x20, 0xa2, 0x8a, 0x1e, 0x1b, 0xa1, 0x37, 0xff, 0x11, 0x9f, 0x76, 0x4f, 0xea, + 0x10, 0x17, 0xe1, 0x33, 0x30, 0x5a, 0x37, 0x85, 0x00, 0x31, 0x13, 0x9f, 0xcc, 0xe3, 0x9b, 0x90, + 0x19, 0xe2, 0x63, 0x3f, 0x81, 0xc0, 0x49, 0xc6, 0xa8, 0xc2, 0x43, 0x65, 0x2c, 0x79, 0x1b, 0xbe, + 0x78, 0x11, 0x62, 0xe7, 0x8e, 0xe5, 0x5e, 0x18, 0x91, 0x1d, 0x4a, 0x19, 0x9f, 0xee, 0xab, 0xa2, + 0x2c, 0x56, 0x5c, 0xd0, 0xeb, 0xd0, 0xc7, 0x5e, 0x71, 0x85, 0x93, 0x03, 0xf9, 0x1a, 0x67, 0x33, + 0x66, 0x60, 0xbc, 0x20, 0xd9, 0xdf, 0x10, 0x0b, 0x0e, 0xe8, 0x9a, 0x7c, 0x23, 0x19, 0x2e, 0x79, + 0x37, 0x43, 0xc2, 0xde, 0x48, 0x96, 0x66, 0x1f, 0x8f, 0x9f, 0x3f, 0x72, 0x78, 0x66, 0xca, 0x44, + 0xa3, 0x24, 0x95, 0xa2, 0xc4, 0x7f, 0x99, 0x89, 0x51, 0x44, 0x38, 0xca, 0x6c, 0x9e, 0x99, 0xad, + 0x31, 0xee, 0xce, 0x5b, 0x26, 0x0b, 0x9c, 0xe4, 0x49, 0x25, 0x52, 0xbe, 0xea, 0xc5, 0x9b, 0x92, + 0x4e, 0x7b, 0x07, 0xbf, 0x88, 0xb3, 0xd3, 0x88, 0x43, 0xb0, 0x28, 0x7f, 0xac, 0xe2, 0xc1, 0x94, + 0x07, 0x63, 0xc9, 0x25, 0xfa, 0x50, 0xc5, 0x91, 0x3f, 0xe9, 0x81, 0x11, 0x73, 0x4a, 0xa1, 0xcb, + 0x50, 0x12, 0x4c, 0x54, 0x36, 0x13, 0xb5, 0x4a, 0x56, 0x24, 0x02, 0xc7, 0x34, 0x2c, 0x89, 0x0d, + 0x2b, 0xae, 0x39, 0x11, 0xc7, 0x49, 0x6c, 0x14, 0x06, 0x6b, 0x54, 0xf4, 0x62, 0xb5, 0xee, 0xfb, + 0x91, 0x3a, 0x90, 0xd4, 0xbc, 0x9b, 0x65, 0x50, 0x2c, 0xb0, 0xf4, 0x20, 0xda, 0x26, 0x81, 0x47, + 0x1a, 0x66, 0x14, 0x71, 0x75, 0x10, 0x5d, 0xd7, 0x91, 0xd8, 0xa4, 0xa5, 0xc7, 0xa9, 0x1f, 0xb2, + 0x89, 0x2c, 0xae, 0x6f, 0xb1, 0x53, 0x76, 0x95, 0x3f, 0x2f, 0x97, 0x78, 0xf4, 0x71, 0x38, 0xad, + 0x22, 0x76, 0x61, 0x6e, 0xcd, 0x90, 0x35, 0xf6, 0x19, 0xda, 0x96, 0xd3, 0x73, 0xd9, 0x64, 0x38, + 0xaf, 0x3c, 0x7a, 0x0d, 0x46, 0x84, 0x88, 0x2f, 0x39, 0xf6, 0x9b, 0x1e, 0x46, 0xd7, 0x0d, 0x2c, + 0x4e, 0x50, 0xcb, 0x38, 0xe8, 0x4c, 0xca, 0x96, 0x1c, 0x06, 0xd2, 0x71, 0xd0, 0x75, 0x3c, 0x4e, + 0x95, 0x40, 0x33, 0x30, 0xca, 0x65, 0x30, 0xd7, 0xdb, 0xe4, 0x63, 0x22, 0x9e, 0x7c, 0xa9, 0x25, + 0x75, 0xc3, 0x44, 0xe3, 0x24, 0x3d, 0x7a, 0x19, 0x86, 0x9c, 0xa0, 0xb6, 0xe5, 0x46, 0xa4, 0x16, + 0xb5, 0x02, 0xfe, 0x16, 0x4c, 0x73, 0xd1, 0x9a, 0xd1, 0x70, 0xd8, 0xa0, 0xb4, 0xef, 0xc1, 0x44, + 0x46, 0xdc, 0x09, 0x3a, 0x71, 0x9c, 0xa6, 0x2b, 0xbf, 0x29, 0xe1, 0x07, 0x3d, 0x53, 0x59, 0x92, + 0x5f, 0xa3, 0x51, 0xd1, 0xd9, 0xc9, 0xe2, 0x53, 0x68, 0x89, 0x57, 0xd5, 0xec, 0x5c, 0x94, 0x08, + 0x1c, 0xd3, 0xd8, 0xff, 0xa9, 0x00, 0xa3, 0x19, 0xb6, 0x15, 0x96, 0xfc, 0x33, 0x71, 0x49, 0x89, + 0x73, 0x7d, 0x9a, 0x61, 0xf5, 0x0b, 0x87, 0x08, 0xab, 0x5f, 0xec, 0x14, 0x56, 0xbf, 0xe7, 0x9d, + 0x84, 0xd5, 0x37, 0x7b, 0xac, 0xb7, 0xab, 0x1e, 0xcb, 0x08, 0xc5, 0xdf, 0x77, 0xc8, 0x50, 0xfc, + 0x46, 0xa7, 0xf7, 0x77, 0xd1, 0xe9, 0x3f, 0x52, 0x80, 0xb1, 0xa4, 0x2b, 0xe9, 0x31, 0xe8, 0x6d, + 0x5f, 0x37, 0xf4, 0xb6, 0x97, 0xba, 0x79, 0xa2, 0x9b, 0xab, 0xc3, 0xc5, 0x09, 0x1d, 0xee, 0xd3, + 0x5d, 0x71, 0x6b, 0xaf, 0xcf, 0xfd, 0xc9, 0x02, 0x9c, 0xcc, 0x7c, 0x23, 0x7c, 0x0c, 0x7d, 0x73, + 0xc3, 0xe8, 0x9b, 0xe7, 0xba, 0x7e, 0xbe, 0x9c, 0xdb, 0x41, 0xb7, 0x13, 0x1d, 0x74, 0xb9, 0x7b, + 0x96, 0xed, 0x7b, 0xe9, 0xeb, 0x45, 0x38, 0x9f, 0x59, 0x2e, 0x56, 0x7b, 0x2e, 0x1a, 0x6a, 0xcf, + 0xe7, 0x13, 0x6a, 0x4f, 0xbb, 0x7d, 0xe9, 0xa3, 0xd1, 0x83, 0x8a, 0x67, 0xbc, 0x2c, 0x18, 0xc1, + 0x03, 0xea, 0x40, 0x8d, 0x67, 0xbc, 0x8a, 0x11, 0x36, 0xf9, 0x7e, 0x3b, 0xe9, 0x3e, 0x7f, 0xdb, + 0x82, 0x33, 0x99, 0x63, 0x73, 0x0c, 0xba, 0xae, 0x55, 0x53, 0xd7, 0xf5, 0x54, 0xd7, 0xb3, 0x35, + 0x47, 0xf9, 0xf5, 0xd3, 0xbd, 0x39, 0xdf, 0xc2, 0x6e, 0xf2, 0x37, 0x60, 0xd0, 0xa9, 0xd5, 0x48, + 0x18, 0xae, 0xf8, 0x75, 0x15, 0x81, 0xfb, 0x39, 0x76, 0xcf, 0x8a, 0xc1, 0x07, 0xfb, 0xe5, 0xa9, + 0x24, 0x8b, 0x18, 0x8d, 0x75, 0x0e, 0xe8, 0x93, 0x30, 0x10, 0x8a, 0x73, 0x53, 0x8c, 0xfd, 0x0b, + 0x5d, 0x76, 0x8e, 0xb3, 0x4e, 0x1a, 0x66, 0xa8, 0x27, 0xa5, 0xa9, 0x50, 0x2c, 0xcd, 0xb0, 0x30, + 0x85, 0x23, 0x0d, 0x0b, 0xf3, 0x3c, 0xc0, 0xae, 0xba, 0x0c, 0x24, 0xf5, 0x0f, 0xda, 0x35, 0x41, + 0xa3, 0x42, 0x1f, 0x85, 0xb1, 0x90, 0xc7, 0x42, 0x9c, 0x6b, 0x38, 0x21, 0x7b, 0x6d, 0x23, 0x66, + 0x21, 0x0b, 0x27, 0x55, 0x4d, 0xe0, 0x70, 0x8a, 0x1a, 0x2d, 0xca, 0x5a, 0x59, 0xe0, 0x46, 0x3e, + 0x31, 0x2f, 0xc6, 0x35, 0x8a, 0xd4, 0xe3, 0x27, 0x92, 0xdd, 0xcf, 0x3a, 0x5e, 0x2b, 0x89, 0x3e, + 0x09, 0x40, 0xa7, 0x8f, 0xd0, 0x43, 0xf4, 0xe7, 0x6f, 0x9e, 0x74, 0x57, 0xa9, 0x67, 0x3a, 0x37, + 0xb3, 0x97, 0xb7, 0xf3, 0x8a, 0x09, 0xd6, 0x18, 0x22, 0x07, 0x86, 0xe3, 0x7f, 0x71, 0x66, 0xde, + 0x4b, 0xb9, 0x35, 0x24, 0x99, 0x33, 0x95, 0xf7, 0xbc, 0xce, 0x02, 0x9b, 0x1c, 0xed, 0x7f, 0x37, + 0x00, 0x8f, 0xb4, 0xd9, 0x86, 0xd1, 0x8c, 0x69, 0xea, 0x7d, 0x26, 0x79, 0x7f, 0x9f, 0xca, 0x2c, + 0x6c, 0x5c, 0xe8, 0x13, 0xb3, 0xbd, 0xf0, 0x8e, 0x67, 0xfb, 0x0f, 0x59, 0x9a, 0x66, 0x85, 0x3b, + 0x95, 0x7e, 0xe4, 0x90, 0xc7, 0xcb, 0x11, 0xaa, 0x5a, 0x36, 0x32, 0xf4, 0x15, 0xcf, 0x77, 0xdd, + 0x9c, 0xee, 0x15, 0x18, 0x5f, 0xcd, 0x0e, 0x00, 0xcc, 0x55, 0x19, 0x57, 0x0f, 0xfb, 0xfd, 0xc7, + 0x15, 0x0c, 0xf8, 0xf7, 0x2d, 0x38, 0x93, 0x02, 0xf3, 0x36, 0x90, 0x50, 0xc4, 0xa8, 0x5a, 0x7d, + 0xc7, 0x8d, 0x97, 0x0c, 0xf9, 0x37, 0x5c, 0x13, 0xdf, 0x70, 0x26, 0x97, 0x2e, 0xd9, 0xf4, 0x1f, + 0xfc, 0xa3, 0xf2, 0x04, 0xab, 0xc0, 0x24, 0xc4, 0xf9, 0x4d, 0x3f, 0xde, 0x8b, 0xff, 0x37, 0x27, + 0xf6, 0xf1, 0xd4, 0x32, 0x9c, 0x6f, 0xdf, 0xd5, 0x87, 0x7a, 0x9e, 0xfc, 0x7b, 0x16, 0x9c, 0x6b, + 0x1b, 0x03, 0xe7, 0x5b, 0x50, 0xce, 0xb5, 0x3f, 0x6f, 0xc1, 0xa3, 0x99, 0x25, 0x0c, 0xef, 0xb8, + 0xcb, 0x50, 0xaa, 0x25, 0xf2, 0xa1, 0xc6, 0xd1, 0x20, 0x54, 0x2e, 0xd4, 0x98, 0xc6, 0x70, 0x82, + 0x2b, 0x74, 0x74, 0x82, 0xfb, 0x0d, 0x0b, 0x52, 0x67, 0xd5, 0x31, 0x08, 0x4d, 0x4b, 0xa6, 0xd0, + 0xf4, 0x78, 0x37, 0xbd, 0x99, 0x23, 0x2f, 0xfd, 0xc5, 0x28, 0x9c, 0xca, 0x79, 0x5d, 0xb8, 0x0b, + 0xe3, 0x9b, 0x35, 0x62, 0x3e, 0x27, 0x6f, 0x17, 0x66, 0xa9, 0xed, 0xdb, 0x73, 0x9e, 0x86, 0x36, + 0x45, 0x82, 0xd3, 0x55, 0xa0, 0xcf, 0x5b, 0x70, 0xc2, 0xb9, 0x13, 0x2e, 0x50, 0xe1, 0xd7, 0xad, + 0xcd, 0x36, 0xfc, 0xda, 0x36, 0x95, 0x2c, 0xe4, 0xb2, 0x7a, 0x31, 0x53, 0x21, 0x79, 0xbb, 0x9a, + 0xa2, 0x37, 0xaa, 0x67, 0x49, 0xc7, 0xb3, 0xa8, 0x70, 0x66, 0x5d, 0x08, 0x8b, 0xfc, 0x28, 0xf4, + 0x6a, 0xdd, 0x26, 0xe0, 0x41, 0xd6, 0x33, 0x50, 0x2e, 0xcd, 0x49, 0x0c, 0x56, 0x7c, 0xd0, 0xa7, + 0xa1, 0xb4, 0x29, 0xdf, 0x36, 0x67, 0x48, 0x8b, 0x71, 0x47, 0xb6, 0x7f, 0xf1, 0xcd, 0xbd, 0x0a, + 0x14, 0x11, 0x8e, 0x99, 0xa2, 0xd7, 0xa0, 0xe8, 0x6d, 0x84, 0xed, 0xf2, 0x76, 0x27, 0xdc, 0x47, + 0x79, 0x58, 0x91, 0xd5, 0xc5, 0x2a, 0xa6, 0x05, 0xd1, 0x35, 0x28, 0x06, 0xeb, 0x75, 0xa1, 0x4d, + 0xcf, 0x5c, 0xa4, 0x78, 0x76, 0x3e, 0xa7, 0x55, 0x8c, 0x13, 0x9e, 0x9d, 0xc7, 0x94, 0x05, 0xaa, + 0x40, 0x2f, 0x7b, 0x92, 0x27, 0x64, 0xb3, 0xcc, 0x5b, 0x68, 0x9b, 0xa7, 0xad, 0x3c, 0xf6, 0x08, + 0x23, 0xc0, 0x9c, 0x11, 0x5a, 0x83, 0xbe, 0x1a, 0xcb, 0xf1, 0x2c, 0x84, 0xb1, 0xf7, 0x67, 0xea, + 0xcd, 0xdb, 0x24, 0xbf, 0x16, 0x6a, 0x64, 0x46, 0x81, 0x05, 0x2f, 0xc6, 0x95, 0x34, 0xb7, 0x36, + 0x42, 0xa6, 0x77, 0xcb, 0xe3, 0xda, 0x26, 0xa7, 0xbb, 0xe0, 0xca, 0x28, 0xb0, 0xe0, 0x85, 0x5e, + 0x81, 0xc2, 0x46, 0x4d, 0x3c, 0xb7, 0xcb, 0x54, 0xa0, 0x9b, 0x91, 0x61, 0x66, 0xfb, 0xee, 0xef, + 0x97, 0x0b, 0x8b, 0x73, 0xb8, 0xb0, 0x51, 0x43, 0xab, 0xd0, 0xbf, 0xc1, 0x63, 0x49, 0x08, 0x1d, + 0xf9, 0x93, 0xd9, 0x61, 0x2e, 0x52, 0xe1, 0x26, 0xf8, 0xd3, 0x2d, 0x81, 0xc0, 0x92, 0x09, 0x4b, + 0xd7, 0xa1, 0x62, 0x62, 0x88, 0x90, 0x7c, 0xd3, 0x87, 0x8b, 0x63, 0xc2, 0x65, 0xe5, 0x38, 0xb2, + 0x06, 0xd6, 0x38, 0xd2, 0x59, 0xed, 0xdc, 0x6b, 0x05, 0x2c, 0x5e, 0xbb, 0x88, 0xdd, 0x94, 0x39, + 0xab, 0x67, 0x24, 0x51, 0xbb, 0x59, 0xad, 0x88, 0x70, 0xcc, 0x14, 0x6d, 0xc3, 0xf0, 0x6e, 0xd8, + 0xdc, 0x22, 0x72, 0x49, 0xb3, 0x50, 0x4e, 0x39, 0xb2, 0xde, 0x2d, 0x41, 0xe8, 0x06, 0x51, 0xcb, + 0x69, 0xa4, 0x76, 0x21, 0x26, 0x97, 0xdf, 0xd2, 0x99, 0x61, 0x93, 0x37, 0xed, 0xfe, 0xb7, 0x5b, + 0xfe, 0xfa, 0x5e, 0x44, 0x44, 0x24, 0xbd, 0xcc, 0xee, 0x7f, 0x83, 0x93, 0xa4, 0xbb, 0x5f, 0x20, + 0xb0, 0x64, 0x82, 0x6e, 0x89, 0xee, 0x61, 0xbb, 0xe7, 0x58, 0x7e, 0x98, 0xde, 0x19, 0x49, 0x94, + 0xd3, 0x29, 0x6c, 0xb7, 0x8c, 0x59, 0xb1, 0x5d, 0xb2, 0xb9, 0xe5, 0x47, 0xbe, 0x97, 0xd8, 0xa1, + 0xc7, 0xf3, 0x77, 0xc9, 0x4a, 0x06, 0x7d, 0x7a, 0x97, 0xcc, 0xa2, 0xc2, 0x99, 0x75, 0xa1, 0x3a, + 0x8c, 0x34, 0xfd, 0x20, 0xba, 0xe3, 0x07, 0x72, 0x7e, 0xa1, 0x36, 0x3a, 0x3e, 0x83, 0x52, 0xd4, + 0xc8, 0x82, 0x54, 0x9a, 0x18, 0x9c, 0xe0, 0x89, 0x3e, 0x06, 0xfd, 0x61, 0xcd, 0x69, 0x90, 0xa5, + 0x1b, 0x93, 0x13, 0xf9, 0xc7, 0x4f, 0x95, 0x93, 0xe4, 0xcc, 0x2e, 0x1e, 0x0a, 0x84, 0x93, 0x60, + 0xc9, 0x0e, 0x2d, 0x42, 0x2f, 0x4b, 0x83, 0xc9, 0xc2, 0x3e, 0xe6, 0x44, 0x1b, 0x4e, 0x39, 0xf3, + 0xf3, 0xbd, 0x89, 0x81, 0x31, 0x2f, 0x4e, 0xd7, 0x80, 0xb8, 0xea, 0xfa, 0xe1, 0xe4, 0xc9, 0xfc, + 0x35, 0x20, 0x6e, 0xc8, 0x37, 0xaa, 0xed, 0xd6, 0x80, 0x22, 0xc2, 0x31, 0x53, 0xba, 0x33, 0xd3, + 0xdd, 0xf4, 0x54, 0x1b, 0x2f, 0xb4, 0xdc, 0xbd, 0x94, 0xed, 0xcc, 0x74, 0x27, 0xa5, 0x2c, 0xec, + 0x3f, 0xee, 0x4f, 0xcb, 0x2c, 0x4c, 0x39, 0xf2, 0xbf, 0x5b, 0x29, 0xbb, 0xf9, 0x07, 0xba, 0xd5, + 0xd5, 0x1e, 0xe1, 0xb5, 0xee, 0xf3, 0x16, 0x9c, 0x6a, 0x66, 0x7e, 0x88, 0x10, 0x00, 0xba, 0x53, + 0xf9, 0xf2, 0x4f, 0x57, 0x21, 0x42, 0xb3, 0xf1, 0x38, 0xa7, 0xa6, 0xe4, 0xd5, 0xb9, 0xf8, 0x8e, + 0xaf, 0xce, 0x2b, 0x30, 0x50, 0xe3, 0xf7, 0x1c, 0x19, 0xda, 0xba, 0xab, 0x00, 0x77, 0x4c, 0x94, + 0x10, 0x17, 0xa4, 0x0d, 0xac, 0x58, 0xa0, 0x1f, 0xb6, 0xe0, 0x5c, 0xb2, 0xe9, 0x98, 0x30, 0xb4, + 0x88, 0x2b, 0xca, 0xf5, 0x32, 0x8b, 0xe2, 0xfb, 0x53, 0xf2, 0xbf, 0x41, 0x7c, 0xd0, 0x89, 0x00, + 0xb7, 0xaf, 0x0c, 0xcd, 0x67, 0x28, 0x86, 0xfa, 0x4c, 0x63, 0x58, 0x17, 0xca, 0xa1, 0x17, 0x61, + 0x68, 0xc7, 0x6f, 0x79, 0x91, 0x70, 0x5a, 0x13, 0x0e, 0x34, 0xcc, 0x71, 0x64, 0x45, 0x83, 0x63, + 0x83, 0x2a, 0xa1, 0x52, 0x1a, 0x78, 0x60, 0x95, 0xd2, 0x5b, 0x30, 0xe4, 0x69, 0x5e, 0xd6, 0x42, + 0x1e, 0xb8, 0x98, 0x1f, 0x13, 0x58, 0xf7, 0xc9, 0xe6, 0xad, 0xd4, 0x21, 0xd8, 0xe0, 0x76, 0xbc, + 0xde, 0x6c, 0x3f, 0x5f, 0xc8, 0x10, 0xea, 0xb9, 0x5a, 0xe9, 0xc3, 0xa6, 0x5a, 0xe9, 0x62, 0x52, + 0xad, 0x94, 0x32, 0x84, 0x18, 0x1a, 0xa5, 0xee, 0x53, 0x64, 0x75, 0x1d, 0x57, 0xf4, 0xbb, 0x2d, + 0x38, 0xcd, 0x34, 0xeb, 0xb4, 0x82, 0x77, 0xac, 0x4d, 0x7f, 0xe4, 0xfe, 0x7e, 0xf9, 0xf4, 0x72, + 0x36, 0x3b, 0x9c, 0x57, 0x8f, 0xdd, 0x80, 0x0b, 0x9d, 0x8e, 0x46, 0xe6, 0x41, 0x59, 0x57, 0xa6, + 0xf7, 0xd8, 0x83, 0xb2, 0xbe, 0x34, 0x8f, 0x19, 0xa6, 0xdb, 0xa8, 0x59, 0xf6, 0x7f, 0xb0, 0xa0, + 0x58, 0xf1, 0xeb, 0xc7, 0x70, 0xe9, 0xfe, 0x88, 0x71, 0xe9, 0x7e, 0x24, 0xfb, 0x50, 0xae, 0xe7, + 0x9a, 0x92, 0x16, 0x12, 0xa6, 0xa4, 0x73, 0x79, 0x0c, 0xda, 0x1b, 0x8e, 0x7e, 0xaa, 0x08, 0x83, + 0x15, 0xbf, 0xae, 0x9e, 0x2f, 0xfc, 0xe3, 0x07, 0x79, 0xbe, 0x90, 0x9b, 0xf4, 0x44, 0xe3, 0xcc, + 0x1c, 0x2f, 0xe5, 0xcb, 0xed, 0x6f, 0xb1, 0x57, 0x0c, 0xb7, 0x89, 0xbb, 0xb9, 0x15, 0x91, 0x7a, + 0xf2, 0x73, 0x8e, 0xef, 0x15, 0xc3, 0x1f, 0x17, 0x60, 0x34, 0x51, 0x3b, 0x6a, 0xc0, 0x70, 0x43, + 0x37, 0x54, 0x88, 0x79, 0xfa, 0x40, 0x36, 0x0e, 0xe1, 0x05, 0xae, 0x81, 0xb0, 0xc9, 0x1c, 0x4d, + 0x03, 0x28, 0xcb, 0xbd, 0x54, 0x57, 0xb3, 0x9b, 0x87, 0x32, 0xed, 0x87, 0x58, 0xa3, 0x40, 0x2f, + 0xc1, 0x60, 0xe4, 0x37, 0xfd, 0x86, 0xbf, 0xb9, 0x77, 0x9d, 0xc8, 0x80, 0x6a, 0xca, 0xb7, 0x73, + 0x2d, 0x46, 0x61, 0x9d, 0x0e, 0xdd, 0x85, 0x71, 0xc5, 0xa4, 0x7a, 0x04, 0xc6, 0x1b, 0xa6, 0xd9, + 0x58, 0x4d, 0x72, 0xc4, 0xe9, 0x4a, 0xec, 0x9f, 0x2d, 0xf2, 0x2e, 0xf6, 0x22, 0xf7, 0xbd, 0xd5, + 0xf0, 0xee, 0x5e, 0x0d, 0x5f, 0xb7, 0x60, 0x8c, 0xd6, 0xce, 0x1c, 0xd7, 0xa4, 0xa8, 0xa1, 0x22, + 0xa1, 0x5b, 0x6d, 0x22, 0xa1, 0x5f, 0xa4, 0xbb, 0x66, 0xdd, 0x6f, 0x45, 0x42, 0x7f, 0xa8, 0x6d, + 0x8b, 0x14, 0x8a, 0x05, 0x56, 0xd0, 0x91, 0x20, 0x10, 0x8f, 0x6d, 0x75, 0x3a, 0x12, 0x04, 0x58, + 0x60, 0x65, 0xa0, 0xf4, 0x9e, 0xec, 0x40, 0xe9, 0x3c, 0xde, 0xad, 0x70, 0x71, 0x12, 0x42, 0x9f, + 0x16, 0xef, 0x56, 0xfa, 0x3e, 0xc5, 0x34, 0xf6, 0x57, 0x8b, 0x30, 0x54, 0xf1, 0xeb, 0xb1, 0xd5, + 0xfe, 0x45, 0xc3, 0x6a, 0x7f, 0x21, 0x61, 0xb5, 0x1f, 0xd3, 0x69, 0xdf, 0xb3, 0xd1, 0x7f, 0xb3, + 0x6c, 0xf4, 0xbf, 0x6e, 0xb1, 0x51, 0x9b, 0x5f, 0xad, 0x72, 0x3f, 0x48, 0x74, 0x05, 0x06, 0xd9, + 0x06, 0xc3, 0x5e, 0x77, 0x4b, 0x53, 0x36, 0x4b, 0x5c, 0xb6, 0x1a, 0x83, 0xb1, 0x4e, 0x83, 0x2e, + 0xc1, 0x40, 0x48, 0x9c, 0xa0, 0xb6, 0xa5, 0x76, 0x57, 0x61, 0x77, 0xe6, 0x30, 0xac, 0xb0, 0xe8, + 0x8d, 0x38, 0xd4, 0x6a, 0x31, 0xff, 0xb5, 0xa8, 0xde, 0x1e, 0xbe, 0x44, 0xf2, 0xe3, 0xab, 0xda, + 0xb7, 0x01, 0xa5, 0xe9, 0xbb, 0x08, 0x06, 0x58, 0x36, 0x83, 0x01, 0x96, 0x52, 0x81, 0x00, 0xff, + 0xca, 0x82, 0x91, 0x8a, 0x5f, 0xa7, 0x4b, 0xf7, 0xdb, 0x69, 0x9d, 0xea, 0x71, 0xa6, 0xfb, 0xda, + 0xc4, 0x99, 0x7e, 0x0c, 0x7a, 0x2b, 0x7e, 0xbd, 0x43, 0xc0, 0xc2, 0xbf, 0x61, 0x41, 0x7f, 0xc5, + 0xaf, 0x1f, 0x83, 0x69, 0xe2, 0xc3, 0xa6, 0x69, 0xe2, 0x74, 0xce, 0xbc, 0xc9, 0xb1, 0x46, 0xfc, + 0xff, 0x3d, 0x30, 0x4c, 0xdb, 0xe9, 0x6f, 0xca, 0xa1, 0x34, 0xba, 0xcd, 0xea, 0xa2, 0xdb, 0xa8, + 0x14, 0xee, 0x37, 0x1a, 0xfe, 0x9d, 0xe4, 0xb0, 0x2e, 0x32, 0x28, 0x16, 0x58, 0xf4, 0x2c, 0x0c, + 0x34, 0x03, 0xb2, 0xeb, 0xfa, 0x42, 0xbc, 0xd5, 0x0c, 0x3d, 0x15, 0x01, 0xc7, 0x8a, 0x82, 0x5e, + 0x4d, 0x43, 0xd7, 0xa3, 0x47, 0x79, 0xcd, 0xf7, 0xea, 0x5c, 0x7b, 0x5f, 0x14, 0xc9, 0x50, 0x34, + 0x38, 0x36, 0xa8, 0xd0, 0x6d, 0x28, 0xb1, 0xff, 0x6c, 0xdb, 0x39, 0x7c, 0x1a, 0x66, 0x91, 0x1e, + 0x52, 0x30, 0xc0, 0x31, 0x2f, 0xf4, 0x3c, 0x40, 0x24, 0x13, 0x0a, 0x84, 0x22, 0x70, 0x9d, 0xba, + 0x0a, 0xa8, 0x54, 0x03, 0x21, 0xd6, 0xa8, 0xd0, 0x33, 0x50, 0x8a, 0x1c, 0xb7, 0xb1, 0xec, 0x7a, + 0xcc, 0xfe, 0x4b, 0xdb, 0x2f, 0xb2, 0x34, 0x0a, 0x20, 0x8e, 0xf1, 0x54, 0x14, 0x63, 0x41, 0x4d, + 0x78, 0x12, 0xfa, 0x01, 0x46, 0xcd, 0x44, 0xb1, 0x65, 0x05, 0xc5, 0x1a, 0x05, 0xda, 0x82, 0xb3, + 0xae, 0xc7, 0x12, 0x87, 0x90, 0xea, 0xb6, 0xdb, 0x5c, 0x5b, 0xae, 0xde, 0x22, 0x81, 0xbb, 0xb1, + 0x37, 0xeb, 0xd4, 0xb6, 0x89, 0x27, 0x13, 0xec, 0xca, 0xbc, 0xeb, 0x67, 0x97, 0xda, 0xd0, 0xe2, + 0xb6, 0x9c, 0xec, 0x17, 0xd8, 0x7c, 0xbf, 0x51, 0x45, 0x4f, 0x1b, 0x5b, 0xc7, 0x29, 0x7d, 0xeb, + 0x38, 0xd8, 0x2f, 0xf7, 0xdd, 0xa8, 0x6a, 0x31, 0x39, 0x5e, 0x86, 0x93, 0x15, 0xbf, 0x5e, 0xf1, + 0x83, 0x68, 0xd1, 0x0f, 0xee, 0x38, 0x41, 0x5d, 0x4e, 0xaf, 0xb2, 0x8c, 0x4a, 0x42, 0xf7, 0xcf, + 0x5e, 0xbe, 0xbb, 0x18, 0x11, 0x47, 0x5e, 0x60, 0x12, 0xdb, 0x21, 0xdf, 0xd2, 0xd5, 0x98, 0xec, + 0xa0, 0x52, 0xef, 0x5c, 0x75, 0x22, 0x82, 0x6e, 0xb0, 0x14, 0xfa, 0xf1, 0x31, 0x2a, 0x8a, 0x3f, + 0xa5, 0xa5, 0xd0, 0x8f, 0x91, 0x99, 0xe7, 0xae, 0x59, 0xde, 0xfe, 0x9c, 0xa8, 0x84, 0xeb, 0x01, + 0xb8, 0xbf, 0x62, 0x37, 0x39, 0xa8, 0x65, 0x6e, 0x8e, 0x42, 0x7e, 0x52, 0x07, 0x6e, 0x79, 0x6d, + 0x9b, 0x9b, 0xc3, 0xfe, 0x4e, 0x38, 0x95, 0xac, 0xbe, 0xeb, 0x44, 0xd8, 0x73, 0x30, 0x1e, 0xe8, + 0x05, 0xb5, 0x44, 0x67, 0x27, 0x79, 0x3e, 0x85, 0x04, 0x12, 0xa7, 0xe9, 0xed, 0x97, 0x60, 0x9c, + 0xde, 0x3d, 0x95, 0x20, 0xc7, 0x7a, 0xb9, 0x73, 0x78, 0x96, 0xff, 0xd8, 0xcb, 0x0e, 0xa2, 0x44, + 0xd6, 0x1b, 0xf4, 0x29, 0x18, 0x09, 0xc9, 0xb2, 0xeb, 0xb5, 0xee, 0x4a, 0xed, 0x53, 0x9b, 0x47, + 0xa4, 0xd5, 0x05, 0x9d, 0x92, 0xeb, 0xb0, 0x4d, 0x18, 0x4e, 0x70, 0x43, 0x3b, 0x30, 0x72, 0xc7, + 0xf5, 0xea, 0xfe, 0x9d, 0x50, 0xf2, 0x1f, 0xc8, 0x57, 0x65, 0xdf, 0xe6, 0x94, 0x89, 0x36, 0x1a, + 0xd5, 0xdd, 0x36, 0x98, 0xe1, 0x04, 0x73, 0xba, 0xd8, 0x83, 0x96, 0x37, 0x13, 0xde, 0x0c, 0x09, + 0x7f, 0x16, 0x28, 0x16, 0x3b, 0x96, 0x40, 0x1c, 0xe3, 0xe9, 0x62, 0x67, 0x7f, 0xae, 0x06, 0x7e, + 0x8b, 0xa7, 0x58, 0x11, 0x8b, 0x1d, 0x2b, 0x28, 0xd6, 0x28, 0xe8, 0x66, 0xc8, 0xfe, 0xad, 0xfa, + 0x1e, 0xf6, 0xfd, 0x48, 0x6e, 0x9f, 0x2c, 0x45, 0x98, 0x06, 0xc7, 0x06, 0x15, 0x5a, 0x04, 0x14, + 0xb6, 0x9a, 0xcd, 0x06, 0xf3, 0x4e, 0x73, 0x1a, 0x8c, 0x15, 0x77, 0xdb, 0x29, 0xf2, 0x10, 0xd1, + 0xd5, 0x14, 0x16, 0x67, 0x94, 0xa0, 0xe7, 0xe2, 0x86, 0x68, 0x6a, 0x2f, 0x6b, 0x2a, 0x37, 0x7b, + 0x55, 0x79, 0x3b, 0x25, 0x0e, 0x2d, 0x40, 0x7f, 0xb8, 0x17, 0xd6, 0xa2, 0x46, 0xd8, 0x2e, 0x21, + 0x5b, 0x95, 0x91, 0x68, 0xf9, 0x40, 0x79, 0x11, 0x2c, 0xcb, 0xa2, 0x1a, 0x4c, 0x08, 0x8e, 0x73, + 0x5b, 0x8e, 0xa7, 0xd2, 0x44, 0x71, 0x27, 0xfd, 0x2b, 0xf7, 0xf7, 0xcb, 0x13, 0xa2, 0x66, 0x1d, + 0x7d, 0xb0, 0x5f, 0xa6, 0x8b, 0x23, 0x03, 0x83, 0xb3, 0xb8, 0xf1, 0xc9, 0x57, 0xab, 0xf9, 0x3b, + 0xcd, 0x4a, 0xe0, 0x6f, 0xb8, 0x0d, 0xd2, 0xce, 0x74, 0x58, 0x35, 0x28, 0xc5, 0xe4, 0x33, 0x60, + 0x38, 0xc1, 0xcd, 0xfe, 0x1c, 0x93, 0x1d, 0xab, 0xee, 0xa6, 0xe7, 0x44, 0xad, 0x80, 0xa0, 0x1d, + 0x18, 0x6e, 0xb2, 0xdd, 0x45, 0x24, 0x3e, 0x11, 0x73, 0xfd, 0xc5, 0x2e, 0xd5, 0x4f, 0x77, 0x58, + 0xea, 0x36, 0xc3, 0xd5, 0xad, 0xa2, 0xb3, 0xc3, 0x26, 0x77, 0xfb, 0x5f, 0x9c, 0x61, 0xd2, 0x47, + 0x95, 0xeb, 0x94, 0xfa, 0xc5, 0x9b, 0x20, 0x71, 0x8d, 0x9d, 0xca, 0x57, 0xb0, 0xc6, 0xc3, 0x22, + 0xde, 0x15, 0x61, 0x59, 0x16, 0x7d, 0x12, 0x46, 0xe8, 0xad, 0x50, 0x49, 0x00, 0xe1, 0xe4, 0x89, + 0xfc, 0xd8, 0x2d, 0x8a, 0x4a, 0x4f, 0x8a, 0xa4, 0x17, 0xc6, 0x09, 0x66, 0xe8, 0x0d, 0xe6, 0x5a, + 0x26, 0x59, 0x17, 0xba, 0x61, 0xad, 0x7b, 0x91, 0x49, 0xb6, 0x1a, 0x13, 0xd4, 0x82, 0x89, 0x74, + 0xea, 0xc7, 0x70, 0xd2, 0xce, 0x17, 0xaf, 0xd3, 0xd9, 0x1b, 0xe3, 0xec, 0x35, 0x69, 0x5c, 0x88, + 0xb3, 0xf8, 0xa3, 0xe5, 0x64, 0x62, 0xbe, 0xa2, 0xa1, 0xf7, 0x4d, 0x25, 0xe7, 0x1b, 0x6e, 0x9b, + 0x93, 0x6f, 0x13, 0xce, 0x69, 0xb9, 0xcd, 0xae, 0x06, 0x0e, 0x73, 0xde, 0x70, 0xd9, 0x76, 0xaa, + 0xc9, 0x45, 0x8f, 0xde, 0xdf, 0x2f, 0x9f, 0x5b, 0x6b, 0x47, 0x88, 0xdb, 0xf3, 0x41, 0x37, 0xe0, + 0x24, 0x8f, 0x3c, 0x30, 0x4f, 0x9c, 0x7a, 0xc3, 0xf5, 0x94, 0xe0, 0xc5, 0x97, 0xfc, 0x99, 0xfb, + 0xfb, 0xe5, 0x93, 0x33, 0x59, 0x04, 0x38, 0xbb, 0x1c, 0xfa, 0x30, 0x94, 0xea, 0x5e, 0x28, 0xfa, + 0xa0, 0xcf, 0x48, 0x1f, 0x57, 0x9a, 0x5f, 0xad, 0xaa, 0xef, 0x8f, 0xff, 0xe0, 0xb8, 0x00, 0xda, + 0xe4, 0xb6, 0x01, 0xa5, 0x2d, 0xea, 0x4f, 0x45, 0x5e, 0x4b, 0x2a, 0x54, 0x8d, 0xb7, 0xc7, 0xdc, + 0x28, 0xa6, 0x9e, 0xe4, 0x18, 0xcf, 0x92, 0x0d, 0xc6, 0xe8, 0x75, 0x40, 0x22, 0x4d, 0xc1, 0x4c, + 0x8d, 0x65, 0xd5, 0x61, 0x47, 0xe3, 0x80, 0xf9, 0x1a, 0xb6, 0x9a, 0xa2, 0xc0, 0x19, 0xa5, 0xd0, + 0x35, 0xba, 0xab, 0xe8, 0x50, 0xb1, 0x6b, 0xa9, 0x24, 0xa5, 0xf3, 0xa4, 0x19, 0x10, 0xe6, 0x63, + 0x66, 0x72, 0xc4, 0x89, 0x72, 0xa8, 0x0e, 0x67, 0x9d, 0x56, 0xe4, 0x33, 0xb3, 0x8b, 0x49, 0xba, + 0xe6, 0x6f, 0x13, 0x8f, 0x59, 0x3c, 0x07, 0x66, 0x2f, 0x50, 0xc9, 0x6e, 0xa6, 0x0d, 0x1d, 0x6e, + 0xcb, 0x85, 0x4a, 0xe4, 0x2a, 0x2b, 0x39, 0x98, 0xf1, 0xe4, 0x32, 0x32, 0x93, 0xbf, 0x04, 0x83, + 0x5b, 0x7e, 0x18, 0xad, 0x92, 0xe8, 0x8e, 0x1f, 0x6c, 0x8b, 0xb8, 0xc8, 0x71, 0x2c, 0xfa, 0x18, + 0x85, 0x75, 0x3a, 0x7a, 0xe5, 0x66, 0xfe, 0x38, 0x4b, 0xf3, 0xcc, 0x15, 0x62, 0x20, 0xde, 0x63, + 0xae, 0x71, 0x30, 0x96, 0x78, 0x49, 0xba, 0x54, 0x99, 0x63, 0x6e, 0x0d, 0x09, 0xd2, 0xa5, 0xca, + 0x1c, 0x96, 0x78, 0x3a, 0x5d, 0xc3, 0x2d, 0x27, 0x20, 0x95, 0xc0, 0xaf, 0x91, 0x50, 0xcb, 0x80, + 0xf0, 0x08, 0x8f, 0xfa, 0x4c, 0xa7, 0x6b, 0x35, 0x8b, 0x00, 0x67, 0x97, 0x43, 0x24, 0x9d, 0xd7, + 0x6f, 0x24, 0xdf, 0x1e, 0x95, 0x96, 0x67, 0xba, 0x4c, 0xed, 0xe7, 0xc1, 0x98, 0xca, 0x28, 0xc8, + 0xe3, 0x3c, 0x87, 0x93, 0xa3, 0x6c, 0x6e, 0x77, 0x1f, 0x24, 0x5a, 0x59, 0xf8, 0x96, 0x12, 0x9c, + 0x70, 0x8a, 0xb7, 0x11, 0x32, 0x70, 0xac, 0x63, 0xc8, 0xc0, 0xcb, 0x50, 0x0a, 0x5b, 0xeb, 0x75, + 0x7f, 0xc7, 0x71, 0x3d, 0xe6, 0xd6, 0xa0, 0xdd, 0xfd, 0xaa, 0x12, 0x81, 0x63, 0x1a, 0xb4, 0x08, + 0x03, 0x8e, 0x34, 0xdf, 0xa1, 0xfc, 0x20, 0x51, 0xca, 0x68, 0xc7, 0xe3, 0xa6, 0x48, 0x83, 0x9d, + 0x2a, 0x8b, 0x5e, 0x85, 0x61, 0xf1, 0x72, 0x5e, 0x24, 0xe1, 0x9d, 0x30, 0x9f, 0x37, 0x56, 0x75, + 0x24, 0x36, 0x69, 0xd1, 0x4d, 0x18, 0x8c, 0xfc, 0x06, 0x7b, 0xa3, 0x47, 0xc5, 0xbc, 0x53, 0xf9, + 0xe1, 0x0e, 0xd7, 0x14, 0x99, 0xae, 0xb5, 0x56, 0x45, 0xb1, 0xce, 0x07, 0xad, 0xf1, 0xf9, 0xce, + 0xf2, 0x1d, 0x90, 0x50, 0x64, 0x71, 0x3d, 0x97, 0xe7, 0x93, 0xc6, 0xc8, 0xcc, 0xe5, 0x20, 0x4a, + 0x62, 0x9d, 0x0d, 0xba, 0x0a, 0xe3, 0xcd, 0xc0, 0xf5, 0xd9, 0x9c, 0x50, 0x96, 0xdb, 0x49, 0x33, + 0xbb, 0x59, 0x25, 0x49, 0x80, 0xd3, 0x65, 0x58, 0xe0, 0x03, 0x01, 0x9c, 0x3c, 0xc3, 0x33, 0xb4, + 0xf0, 0xab, 0x34, 0x87, 0x61, 0x85, 0x45, 0x2b, 0x6c, 0x27, 0xe6, 0x5a, 0xa0, 0xc9, 0xa9, 0xfc, + 0xb8, 0x54, 0xba, 0xb6, 0x88, 0x0b, 0xaf, 0xea, 0x2f, 0x8e, 0x39, 0xa0, 0xba, 0x96, 0x18, 0x95, + 0x5e, 0x01, 0xc2, 0xc9, 0xb3, 0x6d, 0x9c, 0x22, 0x13, 0xb7, 0xb2, 0x58, 0x20, 0x30, 0xc0, 0x21, + 0x4e, 0xf0, 0x44, 0x1f, 0x85, 0x31, 0x11, 0x4d, 0x33, 0xee, 0xa6, 0x73, 0xf1, 0xcb, 0x07, 0x9c, + 0xc0, 0xe1, 0x14, 0x35, 0xcf, 0x90, 0xe2, 0xac, 0x37, 0x88, 0xd8, 0xfa, 0x96, 0x5d, 0x6f, 0x3b, + 0x9c, 0x3c, 0xcf, 0xf6, 0x07, 0x91, 0x21, 0x25, 0x89, 0xc5, 0x19, 0x25, 0xd0, 0x1a, 0x8c, 0x35, + 0x03, 0x42, 0x76, 0x98, 0xa0, 0x2f, 0xce, 0xb3, 0x32, 0x8f, 0xfb, 0x41, 0x5b, 0x52, 0x49, 0xe0, + 0x0e, 0x32, 0x60, 0x38, 0xc5, 0x01, 0xdd, 0x81, 0x01, 0x7f, 0x97, 0x04, 0x5b, 0xc4, 0xa9, 0x4f, + 0x5e, 0x68, 0xf3, 0x12, 0x47, 0x1c, 0x6e, 0x37, 0x04, 0x6d, 0xc2, 0xdb, 0x43, 0x82, 0x3b, 0x7b, + 0x7b, 0xc8, 0xca, 0xd0, 0xff, 0x61, 0xc1, 0x19, 0x69, 0x9c, 0xa9, 0x36, 0x69, 0xaf, 0xcf, 0xf9, + 0x5e, 0x18, 0x05, 0x3c, 0x52, 0xc5, 0xa3, 0xf9, 0xd1, 0x1b, 0xd6, 0x72, 0x0a, 0x29, 0x45, 0xf4, + 0x99, 0x3c, 0x8a, 0x10, 0xe7, 0xd7, 0x48, 0xaf, 0xa6, 0x21, 0x89, 0xe4, 0x66, 0x34, 0x13, 0x2e, + 0xbe, 0x31, 0xbf, 0x3a, 0xf9, 0x18, 0x0f, 0xb3, 0x41, 0x17, 0x43, 0x35, 0x89, 0xc4, 0x69, 0x7a, + 0x74, 0x05, 0x0a, 0x7e, 0x38, 0xf9, 0x78, 0x9b, 0x5c, 0xba, 0x7e, 0xfd, 0x46, 0x95, 0x7b, 0xfd, + 0xdd, 0xa8, 0xe2, 0x82, 0x1f, 0xca, 0x2c, 0x25, 0xf4, 0x3e, 0x16, 0x4e, 0x3e, 0xc1, 0xd5, 0x96, + 0x32, 0x4b, 0x09, 0x03, 0xe2, 0x18, 0x8f, 0xb6, 0x60, 0x34, 0x34, 0xee, 0xbd, 0xe1, 0xe4, 0x45, + 0xd6, 0x53, 0x4f, 0xe4, 0x0d, 0x9a, 0x41, 0xad, 0xa5, 0x0f, 0x30, 0xb9, 0xe0, 0x24, 0x5b, 0xbe, + 0xba, 0xb4, 0x9b, 0x77, 0x38, 0xf9, 0x64, 0x87, 0xd5, 0xa5, 0x11, 0xeb, 0xab, 0x4b, 0xe7, 0x81, + 0x13, 0x3c, 0xa7, 0xbe, 0x03, 0xc6, 0x53, 0xe2, 0xd2, 0x61, 0x3c, 0xdc, 0xa7, 0xb6, 0x61, 0xd8, + 0x98, 0x92, 0x0f, 0xd5, 0xbb, 0xe2, 0xb7, 0x4b, 0x50, 0x52, 0x56, 0x6f, 0x74, 0xd9, 0x74, 0xa8, + 0x38, 0x93, 0x74, 0xa8, 0x18, 0xa8, 0xf8, 0x75, 0xc3, 0x87, 0x62, 0x2d, 0x23, 0x18, 0x63, 0xde, + 0x06, 0xd8, 0xfd, 0x23, 0x15, 0xcd, 0x94, 0x50, 0xec, 0xda, 0x33, 0xa3, 0xa7, 0xad, 0x75, 0xe2, + 0x2a, 0x8c, 0x7b, 0x3e, 0x93, 0xd1, 0x49, 0x5d, 0x0a, 0x60, 0x4c, 0xce, 0x2a, 0xe9, 0xd1, 0x8d, + 0x12, 0x04, 0x38, 0x5d, 0x86, 0x56, 0xc8, 0x05, 0xa5, 0xa4, 0x39, 0x84, 0xcb, 0x51, 0x58, 0x60, + 0xe9, 0xdd, 0x90, 0xff, 0x0a, 0x27, 0xc7, 0xf2, 0xef, 0x86, 0xbc, 0x50, 0x52, 0x18, 0x0b, 0xa5, + 0x30, 0xc6, 0xb4, 0xff, 0x4d, 0xbf, 0xbe, 0x54, 0x11, 0x62, 0xbe, 0x16, 0x49, 0xb8, 0xbe, 0x54, + 0xc1, 0x1c, 0x87, 0x66, 0xa0, 0x8f, 0xfd, 0x08, 0x27, 0x87, 0xf2, 0xa3, 0xe1, 0xb0, 0x12, 0x5a, + 0x96, 0x34, 0x56, 0x00, 0x8b, 0x82, 0x4c, 0xbb, 0x4b, 0xef, 0x46, 0x4c, 0xbb, 0xdb, 0xff, 0x80, + 0xda, 0x5d, 0xc9, 0x00, 0xc7, 0xbc, 0xd0, 0x5d, 0x38, 0x69, 0xdc, 0x47, 0xd5, 0xab, 0x1d, 0xc8, + 0x37, 0xfc, 0x26, 0x88, 0x67, 0xcf, 0x89, 0x46, 0x9f, 0x5c, 0xca, 0xe2, 0x84, 0xb3, 0x2b, 0x40, + 0x0d, 0x18, 0xaf, 0xa5, 0x6a, 0x1d, 0xe8, 0xbe, 0x56, 0x35, 0x2f, 0xd2, 0x35, 0xa6, 0x19, 0xa3, + 0x57, 0x61, 0xe0, 0x6d, 0x3f, 0x64, 0x47, 0xa4, 0xb8, 0x9a, 0xc8, 0x70, 0x0e, 0x03, 0x6f, 0xdc, + 0xa8, 0x32, 0xf8, 0xc1, 0x7e, 0x79, 0xb0, 0xe2, 0xd7, 0xe5, 0x5f, 0xac, 0x0a, 0xa0, 0xef, 0xb7, + 0x60, 0x2a, 0x7d, 0xe1, 0x55, 0x8d, 0x1e, 0xee, 0xbe, 0xd1, 0xb6, 0xa8, 0x74, 0x6a, 0x21, 0x97, + 0x1d, 0x6e, 0x53, 0x15, 0xfa, 0x10, 0x5d, 0x4f, 0xa1, 0x7b, 0x8f, 0x88, 0x14, 0xb3, 0x8f, 0xc6, + 0xeb, 0x89, 0x42, 0x0f, 0xf6, 0xcb, 0xa3, 0x7c, 0x67, 0x74, 0xef, 0xc9, 0xe7, 0x4d, 0xa2, 0x00, + 0xfa, 0x4e, 0x38, 0x19, 0xa4, 0x35, 0xa8, 0x44, 0x0a, 0xe1, 0x4f, 0x77, 0xb3, 0xcb, 0x26, 0x07, + 0x1c, 0x67, 0x31, 0xc4, 0xd9, 0xf5, 0xd8, 0xbf, 0x62, 0x31, 0xfd, 0xb6, 0x68, 0x16, 0x09, 0x5b, + 0x8d, 0xe3, 0x48, 0x6c, 0xbd, 0x60, 0xd8, 0x8e, 0x1f, 0xd8, 0xb1, 0xe8, 0x1f, 0x59, 0xcc, 0xb1, + 0xe8, 0x18, 0x5f, 0x31, 0xbd, 0x01, 0x03, 0x91, 0x4c, 0x38, 0xde, 0x26, 0x17, 0xb7, 0xd6, 0x28, + 0xe6, 0x5c, 0xa5, 0x2e, 0x39, 0x2a, 0xb7, 0xb8, 0x62, 0x63, 0xff, 0x7d, 0x3e, 0x02, 0x12, 0x73, + 0x0c, 0x26, 0xba, 0x79, 0xd3, 0x44, 0x57, 0xee, 0xf0, 0x05, 0x39, 0xa6, 0xba, 0xbf, 0x67, 0xb6, + 0x9b, 0x29, 0xf7, 0xde, 0xed, 0x1e, 0x6d, 0xf6, 0x17, 0x2c, 0x80, 0x38, 0xc8, 0x7c, 0x17, 0x29, + 0x25, 0x5f, 0xa6, 0xd7, 0x1a, 0x3f, 0xf2, 0x6b, 0x7e, 0x43, 0x18, 0x28, 0xce, 0xc6, 0x56, 0x42, + 0x0e, 0x3f, 0xd0, 0x7e, 0x63, 0x45, 0x8d, 0xca, 0x32, 0xa4, 0x65, 0x31, 0xb6, 0x5b, 0x1b, 0xe1, + 0x2c, 0xbf, 0x64, 0xc1, 0x89, 0x2c, 0x97, 0x78, 0x7a, 0x49, 0xe6, 0x6a, 0x4e, 0xe5, 0x6d, 0xa8, + 0x46, 0xf3, 0x96, 0x80, 0x63, 0x45, 0xd1, 0x75, 0xae, 0xce, 0xc3, 0x45, 0x77, 0xbf, 0x01, 0xc3, + 0x95, 0x80, 0x68, 0xf2, 0xc5, 0x6b, 0x3c, 0x4c, 0x0a, 0x6f, 0xcf, 0xb3, 0x87, 0x0e, 0x91, 0x62, + 0x7f, 0xb9, 0x00, 0x27, 0xb8, 0xd3, 0xce, 0xcc, 0xae, 0xef, 0xd6, 0x2b, 0x7e, 0x5d, 0x3c, 0x64, + 0x7c, 0x13, 0x86, 0x9a, 0x9a, 0x6e, 0xba, 0x5d, 0xa4, 0x62, 0x5d, 0x87, 0x1d, 0x6b, 0xd3, 0x74, + 0x28, 0x36, 0x78, 0xa1, 0x3a, 0x0c, 0x91, 0x5d, 0xb7, 0xa6, 0x3c, 0x3f, 0x0a, 0x87, 0x3e, 0xa4, + 0x55, 0x2d, 0x0b, 0x1a, 0x1f, 0x6c, 0x70, 0x7d, 0x08, 0x19, 0xf4, 0xed, 0x1f, 0xb5, 0xe0, 0x74, + 0x4e, 0x5c, 0x63, 0x5a, 0xdd, 0x1d, 0xe6, 0x1e, 0x25, 0xa6, 0xad, 0xaa, 0x8e, 0x3b, 0x4d, 0x61, + 0x81, 0x45, 0x1f, 0x03, 0xe0, 0x4e, 0x4f, 0xc4, 0xab, 0x75, 0x0c, 0x00, 0x6b, 0xc4, 0xae, 0xd4, + 0xc2, 0x10, 0xca, 0xf2, 0x58, 0xe3, 0x65, 0x7f, 0xa9, 0x07, 0x7a, 0x99, 0x93, 0x0d, 0xaa, 0x40, + 0xff, 0x16, 0xcf, 0x54, 0xd5, 0x76, 0xdc, 0x28, 0xad, 0x4c, 0x7e, 0x15, 0x8f, 0x9b, 0x06, 0xc5, + 0x92, 0x0d, 0x5a, 0x81, 0x09, 0x9e, 0x30, 0xac, 0x31, 0x4f, 0x1a, 0xce, 0x9e, 0x54, 0xfb, 0xf2, + 0x1c, 0xd8, 0x4a, 0xfd, 0xbd, 0x94, 0x26, 0xc1, 0x59, 0xe5, 0xd0, 0x6b, 0x30, 0x42, 0xaf, 0xe1, + 0x7e, 0x2b, 0x92, 0x9c, 0x78, 0xaa, 0x30, 0x75, 0x33, 0x59, 0x33, 0xb0, 0x38, 0x41, 0x8d, 0x5e, + 0x85, 0xe1, 0x66, 0x4a, 0xc1, 0xdd, 0x1b, 0x6b, 0x82, 0x4c, 0xa5, 0xb6, 0x49, 0xcb, 0xbc, 0xe2, + 0x5b, 0xec, 0x0d, 0xc0, 0xda, 0x56, 0x40, 0xc2, 0x2d, 0xbf, 0x51, 0x67, 0x12, 0x70, 0xaf, 0xe6, + 0x15, 0x9f, 0xc0, 0xe3, 0x54, 0x09, 0xca, 0x65, 0xc3, 0x71, 0x1b, 0xad, 0x80, 0xc4, 0x5c, 0xfa, + 0x4c, 0x2e, 0x8b, 0x09, 0x3c, 0x4e, 0x95, 0xe8, 0xac, 0xb9, 0xef, 0x3f, 0x1a, 0xcd, 0xbd, 0xfd, + 0xd3, 0x05, 0x30, 0x86, 0xf6, 0xdb, 0x37, 0x85, 0x19, 0xfd, 0xb2, 0xcd, 0xa0, 0x59, 0x13, 0x0e, + 0x65, 0x99, 0x5f, 0x16, 0xe7, 0x2f, 0xe6, 0x5f, 0x46, 0xff, 0x63, 0x56, 0x8a, 0xae, 0xf1, 0x93, + 0x95, 0xc0, 0xa7, 0x87, 0x9c, 0x0c, 0xa4, 0xa7, 0x1e, 0x9f, 0xf4, 0xcb, 0x20, 0x03, 0x6d, 0x42, + 0xce, 0x0a, 0xf7, 0x7c, 0xce, 0xc1, 0xf0, 0xbd, 0xaa, 0x8a, 0x68, 0x1f, 0x92, 0x0b, 0xba, 0x02, + 0x83, 0x22, 0x2f, 0x15, 0x7b, 0x23, 0xc1, 0x17, 0x13, 0xf3, 0x15, 0x9b, 0x8f, 0xc1, 0x58, 0xa7, + 0xb1, 0x7f, 0xa0, 0x00, 0x13, 0x19, 0x8f, 0xdc, 0xf8, 0x31, 0xb2, 0xe9, 0x86, 0x91, 0x4a, 0x91, + 0xac, 0x1d, 0x23, 0x1c, 0x8e, 0x15, 0x05, 0xdd, 0xab, 0xf8, 0x41, 0x95, 0x3c, 0x9c, 0xc4, 0x23, + 0x12, 0x81, 0x3d, 0x64, 0xb2, 0xe1, 0x0b, 0xd0, 0xd3, 0x0a, 0x89, 0x0c, 0x16, 0xad, 0x8e, 0x6d, + 0x66, 0xd6, 0x66, 0x18, 0x7a, 0x05, 0xdc, 0x54, 0x16, 0x62, 0xed, 0x0a, 0xc8, 0x6d, 0xc4, 0x1c, + 0x47, 0x1b, 0x17, 0x11, 0xcf, 0xf1, 0x22, 0x71, 0x51, 0x8c, 0xa3, 0x9e, 0x32, 0x28, 0x16, 0x58, + 0xfb, 0x8b, 0x45, 0x38, 0x93, 0xfb, 0xec, 0x95, 0x36, 0x7d, 0xc7, 0xf7, 0xdc, 0xc8, 0x57, 0x4e, + 0x78, 0x3c, 0xd2, 0x29, 0x69, 0x6e, 0xad, 0x08, 0x38, 0x56, 0x14, 0xe8, 0x22, 0xf4, 0x32, 0xa5, + 0x78, 0x2a, 0x59, 0xf4, 0xec, 0x3c, 0x0f, 0x7d, 0xc7, 0xd1, 0x5d, 0xe7, 0xf7, 0x7f, 0x8c, 0x4a, + 0x30, 0x7e, 0x23, 0x79, 0xa0, 0xd0, 0xe6, 0xfa, 0x7e, 0x03, 0x33, 0x24, 0x7a, 0x42, 0xf4, 0x57, + 0xc2, 0xeb, 0x0c, 0x3b, 0x75, 0x3f, 0xd4, 0x3a, 0xed, 0x29, 0xe8, 0xdf, 0x26, 0x7b, 0x81, 0xeb, + 0x6d, 0x26, 0xbd, 0x11, 0xaf, 0x73, 0x30, 0x96, 0x78, 0x33, 0x6f, 0x69, 0xff, 0x51, 0x27, 0xe6, + 0x1f, 0xe8, 0x28, 0x9e, 0xfc, 0x50, 0x11, 0x46, 0xf1, 0xec, 0xfc, 0x7b, 0x03, 0x71, 0x33, 0x3d, + 0x10, 0x47, 0x9d, 0x98, 0xbf, 0xf3, 0x68, 0xfc, 0xa2, 0x05, 0xa3, 0x2c, 0x3b, 0x96, 0x88, 0x59, + 0xe1, 0xfa, 0xde, 0x31, 0x5c, 0x05, 0x1e, 0x83, 0xde, 0x80, 0x56, 0x9a, 0xcc, 0x12, 0xcd, 0x5a, + 0x82, 0x39, 0x0e, 0x9d, 0x85, 0x1e, 0xd6, 0x04, 0x3a, 0x78, 0x43, 0x7c, 0x0b, 0x9e, 0x77, 0x22, + 0x07, 0x33, 0x28, 0x0b, 0xfc, 0x86, 0x49, 0xb3, 0xe1, 0xf2, 0x46, 0xc7, 0x2e, 0x0b, 0xef, 0x8e, + 0x80, 0x18, 0x99, 0x4d, 0x7b, 0x67, 0x81, 0xdf, 0xb2, 0x59, 0xb6, 0xbf, 0x66, 0xff, 0x79, 0x01, + 0xce, 0x67, 0x96, 0xeb, 0x3a, 0xf0, 0x5b, 0xfb, 0xd2, 0x0f, 0x33, 0xff, 0x51, 0xf1, 0x18, 0x7d, + 0xbd, 0x7b, 0xba, 0x95, 0xfe, 0x7b, 0xbb, 0x88, 0xc7, 0x96, 0xd9, 0x65, 0xef, 0x92, 0x78, 0x6c, + 0x99, 0x6d, 0xcb, 0x51, 0x13, 0xfc, 0x75, 0x21, 0xe7, 0x5b, 0x98, 0xc2, 0xe0, 0x12, 0xdd, 0x67, + 0x18, 0x32, 0x94, 0x97, 0x70, 0xbe, 0xc7, 0x70, 0x18, 0x56, 0x58, 0x34, 0x03, 0xa3, 0x3b, 0xae, + 0x47, 0x37, 0x9f, 0x3d, 0x53, 0x14, 0x57, 0xb6, 0x8c, 0x15, 0x13, 0x8d, 0x93, 0xf4, 0xc8, 0xd5, + 0x62, 0xb5, 0xf1, 0xaf, 0x7b, 0xf5, 0x50, 0xab, 0x6e, 0xda, 0x74, 0xe7, 0x50, 0xbd, 0x98, 0x11, + 0xb7, 0x6d, 0x45, 0xd3, 0x13, 0x15, 0xbb, 0xd7, 0x13, 0x0d, 0x65, 0xeb, 0x88, 0xa6, 0x5e, 0x85, + 0xe1, 0x07, 0xb6, 0x8d, 0xd8, 0x5f, 0x2f, 0xc2, 0x23, 0x6d, 0x96, 0x3d, 0xdf, 0xeb, 0x8d, 0x31, + 0xd0, 0xf6, 0xfa, 0xd4, 0x38, 0x54, 0xe0, 0xc4, 0x46, 0xab, 0xd1, 0xd8, 0x63, 0x4f, 0xa0, 0x48, + 0x5d, 0x52, 0x08, 0x99, 0x52, 0x2a, 0x47, 0x4e, 0x2c, 0x66, 0xd0, 0xe0, 0xcc, 0x92, 0xf4, 0x8a, + 0x45, 0x4f, 0x92, 0x3d, 0xc5, 0x2a, 0x71, 0xc5, 0xc2, 0x3a, 0x12, 0x9b, 0xb4, 0xe8, 0x2a, 0x8c, + 0x3b, 0xbb, 0x8e, 0xcb, 0x03, 0xde, 0x4b, 0x06, 0xfc, 0x8e, 0xa5, 0x74, 0xd1, 0x33, 0x49, 0x02, + 0x9c, 0x2e, 0x83, 0x5e, 0x07, 0xe4, 0xaf, 0xb3, 0x87, 0x12, 0xf5, 0xab, 0xc4, 0x13, 0x56, 0x77, + 0x36, 0x76, 0xc5, 0x78, 0x4b, 0xb8, 0x91, 0xa2, 0xc0, 0x19, 0xa5, 0x12, 0x81, 0xc9, 0xfa, 0xf2, + 0x03, 0x93, 0xb5, 0xdf, 0x17, 0x3b, 0xa6, 0xde, 0xba, 0x02, 0xc3, 0x87, 0x74, 0xff, 0xb5, 0xff, + 0x8d, 0x05, 0x4a, 0x41, 0x6c, 0x46, 0xfd, 0x7d, 0x95, 0xf9, 0x27, 0x73, 0xd5, 0xb6, 0x16, 0x2d, + 0xe9, 0xa4, 0xe6, 0x9f, 0x1c, 0x23, 0xb1, 0x49, 0xcb, 0xe7, 0x90, 0xe6, 0x57, 0x6c, 0xdc, 0x0a, + 0x44, 0x68, 0x42, 0x45, 0x81, 0x3e, 0x0e, 0xfd, 0x75, 0x77, 0xd7, 0x0d, 0x85, 0x72, 0xec, 0xd0, + 0xc6, 0xb8, 0x78, 0xeb, 0x9c, 0xe7, 0x6c, 0xb0, 0xe4, 0x67, 0xff, 0x50, 0x21, 0xee, 0x93, 0x37, + 0x5a, 0x7e, 0xe4, 0x1c, 0xc3, 0x49, 0x7e, 0xd5, 0x38, 0xc9, 0x9f, 0x68, 0x17, 0x9f, 0x91, 0x35, + 0x29, 0xf7, 0x04, 0xbf, 0x91, 0x38, 0xc1, 0x9f, 0xec, 0xcc, 0xaa, 0xfd, 0xc9, 0xfd, 0x0f, 0x2c, + 0x18, 0x37, 0xe8, 0x8f, 0xe1, 0x00, 0x59, 0x34, 0x0f, 0x90, 0x47, 0x3b, 0x7e, 0x43, 0xce, 0xc1, + 0xf1, 0xbd, 0xc5, 0x44, 0xdb, 0xd9, 0x81, 0xf1, 0x36, 0xf4, 0x6c, 0x39, 0x41, 0xbd, 0x5d, 0x3e, + 0x9a, 0x54, 0xa1, 0xe9, 0x6b, 0x4e, 0x20, 0x3c, 0x15, 0x9e, 0x95, 0xbd, 0x4e, 0x41, 0x1d, 0xbd, + 0x14, 0x58, 0x55, 0xe8, 0x65, 0xe8, 0x0b, 0x6b, 0x7e, 0x53, 0xbd, 0x99, 0xba, 0xc0, 0x3a, 0x9a, + 0x41, 0x0e, 0xf6, 0xcb, 0xc8, 0xac, 0x8e, 0x82, 0xb1, 0xa0, 0x47, 0x6f, 0xc2, 0x30, 0xfb, 0xa5, + 0xdc, 0x06, 0x8b, 0xf9, 0x1a, 0x8c, 0xaa, 0x4e, 0xc8, 0x7d, 0x6a, 0x0d, 0x10, 0x36, 0x59, 0x4d, + 0x6d, 0x42, 0x49, 0x7d, 0xd6, 0x43, 0xb5, 0x76, 0xff, 0xab, 0x22, 0x4c, 0x64, 0xcc, 0x39, 0x14, + 0x1a, 0x23, 0x71, 0xa5, 0xcb, 0xa9, 0xfa, 0x0e, 0xc7, 0x22, 0x64, 0x17, 0xa8, 0xba, 0x98, 0x5b, + 0x5d, 0x57, 0x7a, 0x33, 0x24, 0xc9, 0x4a, 0x29, 0xa8, 0x73, 0xa5, 0xb4, 0xb2, 0x63, 0xeb, 0x6a, + 0x5a, 0x91, 0x6a, 0xe9, 0x43, 0x1d, 0xd3, 0x5f, 0xef, 0x81, 0x13, 0x59, 0x21, 0x63, 0xd1, 0x67, + 0x13, 0xd9, 0x90, 0x5f, 0xec, 0x36, 0xd8, 0x2c, 0x4f, 0x91, 0x2c, 0xc2, 0x40, 0x4e, 0x9b, 0xf9, + 0x91, 0x3b, 0x76, 0xb3, 0xa8, 0x93, 0x05, 0xa0, 0x09, 0x78, 0x16, 0x6b, 0xb9, 0x7d, 0x7c, 0xa0, + 0xeb, 0x06, 0x88, 0xf4, 0xd7, 0x61, 0xc2, 0x25, 0x49, 0x82, 0x3b, 0xbb, 0x24, 0xc9, 0x9a, 0xd1, + 0x12, 0xf4, 0xd5, 0xb8, 0xaf, 0x4b, 0xb1, 0xf3, 0x16, 0xc6, 0x1d, 0x5d, 0xd4, 0x06, 0x2c, 0x1c, + 0x5c, 0x04, 0x83, 0x29, 0x17, 0x06, 0xb5, 0x8e, 0x79, 0xa8, 0x93, 0x67, 0x9b, 0x1e, 0x7c, 0x5a, + 0x17, 0x3c, 0xd4, 0x09, 0xf4, 0xa3, 0x16, 0x24, 0x1e, 0xbc, 0x28, 0xa5, 0x9c, 0x95, 0xab, 0x94, + 0xbb, 0x00, 0x3d, 0x81, 0xdf, 0x20, 0xc9, 0x0c, 0xc4, 0xd8, 0x6f, 0x10, 0xcc, 0x30, 0x94, 0x22, + 0x8a, 0x55, 0x2d, 0x43, 0xfa, 0x35, 0x52, 0x5c, 0x10, 0x1f, 0x83, 0xde, 0x06, 0xd9, 0x25, 0x8d, + 0x64, 0xa2, 0xb8, 0x65, 0x0a, 0xc4, 0x1c, 0x67, 0xff, 0x62, 0x0f, 0x9c, 0x6b, 0x1b, 0x0d, 0x8a, + 0x5e, 0xc6, 0x36, 0x9d, 0x88, 0xdc, 0x71, 0xf6, 0x92, 0x19, 0x9d, 0xae, 0x72, 0x30, 0x96, 0x78, + 0xf6, 0xfc, 0x93, 0x27, 0x66, 0x48, 0xa8, 0x30, 0x45, 0x3e, 0x06, 0x81, 0x35, 0x55, 0x62, 0xc5, + 0xa3, 0x50, 0x89, 0x3d, 0x0f, 0x10, 0x86, 0x0d, 0xee, 0x16, 0x58, 0x17, 0xef, 0x4a, 0xe3, 0x04, + 0x1e, 0xd5, 0x65, 0x81, 0xc1, 0x1a, 0x15, 0x9a, 0x87, 0xb1, 0x66, 0xe0, 0x47, 0x5c, 0x23, 0x3c, + 0xcf, 0x3d, 0x67, 0x7b, 0xcd, 0x40, 0x3c, 0x95, 0x04, 0x1e, 0xa7, 0x4a, 0xa0, 0x97, 0x60, 0x50, + 0x04, 0xe7, 0xa9, 0xf8, 0x7e, 0x43, 0x28, 0xa1, 0x94, 0x33, 0x69, 0x35, 0x46, 0x61, 0x9d, 0x4e, + 0x2b, 0xc6, 0xd4, 0xcc, 0xfd, 0x99, 0xc5, 0xb8, 0xaa, 0x59, 0xa3, 0x4b, 0x44, 0xa2, 0x1e, 0xe8, + 0x2a, 0x12, 0x75, 0xac, 0x96, 0x2b, 0x75, 0x6d, 0xf5, 0x84, 0x8e, 0x8a, 0xac, 0xaf, 0xf4, 0xc0, + 0x84, 0x98, 0x38, 0x0f, 0x7b, 0xba, 0xdc, 0x4c, 0x4f, 0x97, 0xa3, 0x50, 0xdc, 0xbd, 0x37, 0x67, + 0x8e, 0x7b, 0xce, 0xfc, 0xb0, 0x05, 0xa6, 0xa4, 0x86, 0xfe, 0xb7, 0xdc, 0x94, 0x78, 0x2f, 0xe5, + 0x4a, 0x7e, 0x71, 0x94, 0xdf, 0x77, 0x96, 0x1c, 0xcf, 0xfe, 0xd7, 0x16, 0x3c, 0xda, 0x91, 0x23, + 0x5a, 0x80, 0x12, 0x13, 0x27, 0xb5, 0x8b, 0xde, 0x93, 0xca, 0xb3, 0x5e, 0x22, 0x72, 0xa4, 0xdb, + 0xb8, 0x24, 0x5a, 0x48, 0xe5, 0x1e, 0x7c, 0x2a, 0x23, 0xf7, 0xe0, 0x49, 0xa3, 0x7b, 0x1e, 0x30, + 0xf9, 0xe0, 0x0f, 0xd2, 0x13, 0xc7, 0x78, 0xd5, 0x86, 0x3e, 0x60, 0x28, 0x1d, 0xed, 0x84, 0xd2, + 0x11, 0x99, 0xd4, 0xda, 0x19, 0xf2, 0x51, 0x18, 0x63, 0x51, 0xfb, 0xd8, 0x3b, 0x0f, 0xf1, 0xde, + 0xae, 0x10, 0xfb, 0x72, 0x2f, 0x27, 0x70, 0x38, 0x45, 0x6d, 0xff, 0x69, 0x11, 0xfa, 0xf8, 0xf2, + 0x3b, 0x86, 0xeb, 0xe5, 0x33, 0x50, 0x72, 0x77, 0x76, 0x5a, 0x3c, 0x9d, 0x5c, 0x6f, 0xec, 0x19, + 0xbc, 0x24, 0x81, 0x38, 0xc6, 0xa3, 0x45, 0xa1, 0xef, 0x6e, 0x13, 0x18, 0x98, 0x37, 0x7c, 0x7a, + 0xde, 0x89, 0x1c, 0x2e, 0x2b, 0xa9, 0x73, 0x36, 0xd6, 0x8c, 0xa3, 0x4f, 0x01, 0x84, 0x51, 0xe0, + 0x7a, 0x9b, 0x14, 0x26, 0x62, 0xab, 0x3f, 0xdd, 0x86, 0x5b, 0x55, 0x11, 0x73, 0x9e, 0xf1, 0x9e, + 0xa3, 0x10, 0x58, 0xe3, 0x88, 0xa6, 0x8d, 0x93, 0x7e, 0x2a, 0x31, 0x76, 0xc0, 0xb9, 0xc6, 0x63, + 0x36, 0xf5, 0x41, 0x28, 0x29, 0xe6, 0x9d, 0xb4, 0x5f, 0x43, 0xba, 0x58, 0xf4, 0x11, 0x18, 0x4d, + 0xb4, 0xed, 0x50, 0xca, 0xb3, 0x5f, 0xb2, 0x60, 0x94, 0x37, 0x66, 0xc1, 0xdb, 0x15, 0xa7, 0xc1, + 0x3d, 0x38, 0xd1, 0xc8, 0xd8, 0x95, 0xc5, 0xf0, 0x77, 0xbf, 0x8b, 0x2b, 0x65, 0x59, 0x16, 0x16, + 0x67, 0xd6, 0x81, 0x2e, 0xd1, 0x15, 0x47, 0x77, 0x5d, 0xa7, 0x21, 0xe2, 0x1b, 0x0c, 0xf1, 0xd5, + 0xc6, 0x61, 0x58, 0x61, 0xed, 0x3f, 0xb0, 0x60, 0x9c, 0xb7, 0xfc, 0x3a, 0xd9, 0x53, 0x7b, 0xd3, + 0x37, 0xb3, 0xed, 0x22, 0x91, 0x69, 0x21, 0x27, 0x91, 0xa9, 0xfe, 0x69, 0xc5, 0xb6, 0x9f, 0xf6, + 0x65, 0x0b, 0xc4, 0x0c, 0x39, 0x06, 0x7d, 0xc6, 0x77, 0x98, 0xfa, 0x8c, 0xa9, 0xfc, 0x45, 0x90, + 0xa3, 0xc8, 0xf8, 0x2b, 0x0b, 0xc6, 0x38, 0x41, 0x6c, 0xab, 0xff, 0xa6, 0x8e, 0xc3, 0xac, 0xf9, + 0x45, 0x99, 0xce, 0x97, 0xd7, 0xc9, 0xde, 0x9a, 0x5f, 0x71, 0xa2, 0xad, 0xec, 0x8f, 0x32, 0x06, + 0xab, 0xa7, 0xed, 0x60, 0xd5, 0xe5, 0x02, 0x32, 0xf2, 0x7c, 0x75, 0x08, 0x10, 0x70, 0xd8, 0x3c, + 0x5f, 0xf6, 0x9f, 0x59, 0x80, 0x78, 0x35, 0x86, 0xe0, 0x46, 0xc5, 0x21, 0x06, 0xd5, 0x0e, 0xba, + 0x78, 0x6b, 0x52, 0x18, 0xac, 0x51, 0x1d, 0x49, 0xf7, 0x24, 0x1c, 0x2e, 0x8a, 0x9d, 0x1d, 0x2e, + 0x0e, 0xd1, 0xa3, 0xff, 0xac, 0x0f, 0x92, 0x2f, 0xfb, 0xd0, 0x2d, 0x18, 0xaa, 0x39, 0x4d, 0x67, + 0xdd, 0x6d, 0xb8, 0x91, 0x4b, 0xc2, 0x76, 0xde, 0x58, 0x73, 0x1a, 0x9d, 0x30, 0x91, 0x6b, 0x10, + 0x6c, 0xf0, 0x41, 0xd3, 0x00, 0xcd, 0xc0, 0xdd, 0x75, 0x1b, 0x64, 0x93, 0xa9, 0x5d, 0x58, 0x44, + 0x15, 0xee, 0x1a, 0x26, 0xa1, 0x58, 0xa3, 0xc8, 0x08, 0xa3, 0x50, 0x7c, 0xc8, 0x61, 0x14, 0xe0, + 0xd8, 0xc2, 0x28, 0xf4, 0x1c, 0x2a, 0x8c, 0xc2, 0xc0, 0xa1, 0xc3, 0x28, 0xf4, 0x76, 0x15, 0x46, + 0x01, 0xc3, 0x29, 0x29, 0x7b, 0xd2, 0xff, 0x8b, 0x6e, 0x83, 0x88, 0x0b, 0x07, 0x0f, 0x03, 0x33, + 0x75, 0x7f, 0xbf, 0x7c, 0x0a, 0x67, 0x52, 0xe0, 0x9c, 0x92, 0xe8, 0x63, 0x30, 0xe9, 0x34, 0x1a, + 0xfe, 0x1d, 0x35, 0xa8, 0x0b, 0x61, 0xcd, 0x69, 0x70, 0x13, 0x48, 0x3f, 0xe3, 0x7a, 0xf6, 0xfe, + 0x7e, 0x79, 0x72, 0x26, 0x87, 0x06, 0xe7, 0x96, 0x46, 0x1f, 0x86, 0x52, 0x33, 0xf0, 0x6b, 0x2b, + 0xda, 0xf3, 0xe3, 0xf3, 0xb4, 0x03, 0x2b, 0x12, 0x78, 0xb0, 0x5f, 0x1e, 0x56, 0x7f, 0xd8, 0x81, + 0x1f, 0x17, 0xc8, 0x88, 0x8b, 0x30, 0x78, 0xa4, 0x71, 0x11, 0xb6, 0x61, 0xa2, 0x4a, 0x02, 0xd7, + 0x69, 0xb8, 0xf7, 0xa8, 0xbc, 0x2c, 0xf7, 0xa7, 0x35, 0x28, 0x05, 0x89, 0x1d, 0xb9, 0xab, 0x60, + 0xbd, 0x5a, 0xc2, 0x25, 0xb9, 0x03, 0xc7, 0x8c, 0xec, 0xff, 0x66, 0x41, 0xbf, 0x78, 0xc9, 0x77, + 0x0c, 0x52, 0xe3, 0x8c, 0x61, 0x94, 0x28, 0x67, 0x77, 0x18, 0x6b, 0x4c, 0xae, 0x39, 0x62, 0x29, + 0x61, 0x8e, 0x78, 0xb4, 0x1d, 0x93, 0xf6, 0x86, 0x88, 0xff, 0xaf, 0x48, 0xa5, 0x77, 0xe3, 0x4d, + 0xf9, 0xc3, 0xef, 0x82, 0x55, 0xe8, 0x0f, 0xc5, 0x9b, 0xe6, 0x42, 0xfe, 0x6b, 0x90, 0xe4, 0x20, + 0xc6, 0x5e, 0x74, 0xe2, 0x15, 0xb3, 0x64, 0x92, 0xf9, 0x58, 0xba, 0xf8, 0x10, 0x1f, 0x4b, 0x77, + 0x7a, 0x75, 0xdf, 0x73, 0x14, 0xaf, 0xee, 0xed, 0xaf, 0xb1, 0x93, 0x53, 0x87, 0x1f, 0x83, 0x50, + 0x75, 0xd5, 0x3c, 0x63, 0xed, 0x36, 0x33, 0x4b, 0x34, 0x2a, 0x47, 0xb8, 0xfa, 0x05, 0x0b, 0xce, + 0x65, 0x7c, 0x95, 0x26, 0x69, 0x3d, 0x0b, 0x03, 0x4e, 0xab, 0xee, 0xaa, 0xb5, 0xac, 0x99, 0x26, + 0x67, 0x04, 0x1c, 0x2b, 0x0a, 0x34, 0x07, 0xe3, 0xe4, 0x6e, 0xd3, 0xe5, 0x86, 0x5c, 0xdd, 0xf9, + 0xb8, 0xc8, 0x9f, 0x7f, 0x2e, 0x24, 0x91, 0x38, 0x4d, 0xaf, 0x02, 0x44, 0x15, 0x73, 0x03, 0x44, + 0xfd, 0xbc, 0x05, 0x83, 0xea, 0x55, 0xef, 0x43, 0xef, 0xed, 0x8f, 0x9a, 0xbd, 0xfd, 0x48, 0x9b, + 0xde, 0xce, 0xe9, 0xe6, 0xdf, 0x2b, 0xa8, 0xf6, 0x56, 0xfc, 0x20, 0xea, 0x42, 0x82, 0x7b, 0xf0, + 0x87, 0x13, 0x57, 0x60, 0xd0, 0x69, 0x36, 0x25, 0x42, 0x7a, 0xc0, 0xb1, 0xd0, 0xeb, 0x31, 0x18, + 0xeb, 0x34, 0xea, 0x1d, 0x47, 0x31, 0xf7, 0x1d, 0x47, 0x1d, 0x20, 0x72, 0x82, 0x4d, 0x12, 0x51, + 0x98, 0x70, 0xd8, 0xcd, 0xdf, 0x6f, 0x5a, 0x91, 0xdb, 0x98, 0x76, 0xbd, 0x28, 0x8c, 0x82, 0xe9, + 0x25, 0x2f, 0xba, 0x11, 0xf0, 0x2b, 0xa4, 0x16, 0x62, 0x4d, 0xf1, 0xc2, 0x1a, 0x5f, 0x19, 0xc1, + 0x82, 0xd5, 0xd1, 0x6b, 0xba, 0x52, 0xac, 0x0a, 0x38, 0x56, 0x14, 0xf6, 0x07, 0xd9, 0xe9, 0xc3, + 0xfa, 0xf4, 0x70, 0xe1, 0xc5, 0x7e, 0x72, 0x48, 0x8d, 0x06, 0x33, 0x8a, 0xce, 0xeb, 0x41, 0xcc, + 0xda, 0x6f, 0xf6, 0xb4, 0x62, 0xfd, 0x45, 0x64, 0x1c, 0xe9, 0x0c, 0x7d, 0x22, 0xe5, 0x1e, 0xf3, + 0x5c, 0x87, 0x53, 0xe3, 0x10, 0x0e, 0x31, 0x2c, 0x0f, 0x13, 0xcb, 0x52, 0xb3, 0x54, 0x11, 0xeb, + 0x42, 0xcb, 0xc3, 0x24, 0x10, 0x38, 0xa6, 0xa1, 0xc2, 0x94, 0xfa, 0x13, 0x4e, 0xa2, 0x38, 0x16, + 0xb0, 0xa2, 0x0e, 0xb1, 0x46, 0x81, 0x2e, 0x0b, 0x85, 0x02, 0xb7, 0x0b, 0x3c, 0x92, 0x50, 0x28, + 0xc8, 0xee, 0xd2, 0xb4, 0x40, 0x57, 0x60, 0x90, 0xdc, 0x8d, 0x48, 0xe0, 0x39, 0x0d, 0x5a, 0x43, + 0x6f, 0x1c, 0x3f, 0x73, 0x21, 0x06, 0x63, 0x9d, 0x06, 0xad, 0xc1, 0x68, 0xc8, 0xf5, 0x6c, 0x2a, + 0x48, 0x3c, 0xd7, 0x57, 0x3e, 0xad, 0xde, 0x53, 0x9b, 0xe8, 0x03, 0x06, 0xe2, 0xbb, 0x93, 0x8c, + 0x32, 0x91, 0x64, 0x81, 0x5e, 0x83, 0x91, 0x86, 0xef, 0xd4, 0x67, 0x9d, 0x86, 0xe3, 0xd5, 0x58, + 0xff, 0x0c, 0x98, 0x89, 0xa8, 0x97, 0x0d, 0x2c, 0x4e, 0x50, 0x53, 0xe1, 0x4d, 0x87, 0x88, 0x30, + 0x6d, 0x8e, 0xb7, 0x49, 0x42, 0x91, 0x0f, 0x9e, 0x09, 0x6f, 0xcb, 0x39, 0x34, 0x38, 0xb7, 0x34, + 0x7a, 0x19, 0x86, 0xe4, 0xe7, 0x6b, 0x41, 0x59, 0xe2, 0x27, 0x31, 0x1a, 0x0e, 0x1b, 0x94, 0x28, + 0x84, 0x93, 0xf2, 0xff, 0x5a, 0xe0, 0x6c, 0x6c, 0xb8, 0x35, 0x11, 0xa9, 0x80, 0x3f, 0x1f, 0xfe, + 0x88, 0x7c, 0xab, 0xb8, 0x90, 0x45, 0x74, 0xb0, 0x5f, 0x3e, 0x2b, 0x7a, 0x2d, 0x13, 0x8f, 0xb3, + 0x79, 0xa3, 0x15, 0x98, 0xd8, 0x22, 0x4e, 0x23, 0xda, 0x9a, 0xdb, 0x22, 0xb5, 0x6d, 0xb9, 0xe0, + 0x58, 0x98, 0x17, 0xed, 0xe9, 0xc8, 0xb5, 0x34, 0x09, 0xce, 0x2a, 0x87, 0xde, 0x82, 0xc9, 0x66, + 0x6b, 0xbd, 0xe1, 0x86, 0x5b, 0xab, 0x7e, 0xc4, 0x9c, 0x90, 0x66, 0xea, 0xf5, 0x80, 0x84, 0xfc, + 0x75, 0x29, 0x3b, 0x7a, 0x65, 0x20, 0x9d, 0x4a, 0x0e, 0x1d, 0xce, 0xe5, 0x80, 0xee, 0xc1, 0xc9, + 0xc4, 0x44, 0x10, 0x11, 0x31, 0x46, 0xf2, 0x53, 0xc4, 0x54, 0xb3, 0x0a, 0x88, 0xe0, 0x32, 0x59, + 0x28, 0x9c, 0x5d, 0x05, 0x7a, 0x05, 0xc0, 0x6d, 0x2e, 0x3a, 0x3b, 0x6e, 0x83, 0x5e, 0x15, 0x27, + 0xd8, 0x1c, 0xa1, 0xd7, 0x06, 0x58, 0xaa, 0x48, 0x28, 0xdd, 0x9b, 0xc5, 0xbf, 0x3d, 0xac, 0x51, + 0xa3, 0x65, 0x18, 0x11, 0xff, 0xf6, 0xc4, 0x90, 0xf2, 0xc0, 0x2c, 0x8f, 0xb3, 0xa8, 0x5a, 0x15, + 0x1d, 0x73, 0x90, 0x82, 0xe0, 0x44, 0x59, 0xb4, 0x09, 0xe7, 0x64, 0xa2, 0x3f, 0x7d, 0x7e, 0xca, + 0x31, 0x08, 0x59, 0x5e, 0x96, 0x01, 0xfe, 0x2a, 0x65, 0xa6, 0x1d, 0x21, 0x6e, 0xcf, 0x87, 0x9e, + 0xeb, 0xfa, 0x34, 0xe7, 0x6f, 0x8e, 0x4f, 0xc6, 0x11, 0x07, 0x97, 0x93, 0x48, 0x9c, 0xa6, 0x47, + 0x3e, 0x9c, 0x74, 0xbd, 0xac, 0x59, 0x7d, 0x8a, 0x31, 0xfa, 0x10, 0x7f, 0x6e, 0xdd, 0x7e, 0x46, + 0x67, 0xe2, 0x71, 0x36, 0xdf, 0x77, 0xe6, 0xf7, 0xf7, 0xfb, 0x16, 0x2d, 0xad, 0x49, 0xe7, 0xe8, + 0xd3, 0x30, 0xa4, 0x7f, 0x94, 0x90, 0x34, 0x2e, 0x66, 0x0b, 0xaf, 0xda, 0x9e, 0xc0, 0x65, 0x7b, + 0xb5, 0xee, 0x75, 0x1c, 0x36, 0x38, 0xa2, 0x5a, 0x46, 0x6c, 0x83, 0xcb, 0xdd, 0x49, 0x32, 0xdd, + 0xbb, 0xbd, 0x11, 0xc8, 0x9e, 0xee, 0x68, 0x19, 0x06, 0x6a, 0x0d, 0x97, 0x78, 0xd1, 0x52, 0xa5, + 0x5d, 0xf4, 0xc6, 0x39, 0x41, 0x23, 0xd6, 0x8f, 0x48, 0xb1, 0xc2, 0x61, 0x58, 0x71, 0xb0, 0x7f, + 0xb3, 0x00, 0xe5, 0x0e, 0xf9, 0x7a, 0x12, 0x66, 0x28, 0xab, 0x2b, 0x33, 0xd4, 0x0c, 0x8c, 0xc6, + 0xff, 0x74, 0x0d, 0x97, 0xf2, 0x64, 0xbd, 0x65, 0xa2, 0x71, 0x92, 0xbe, 0xeb, 0x47, 0x09, 0xba, + 0x25, 0xab, 0xa7, 0xe3, 0xb3, 0x1a, 0xc3, 0x82, 0xdd, 0xdb, 0xfd, 0xb5, 0x37, 0xd7, 0x1a, 0x69, + 0x7f, 0xad, 0x00, 0x27, 0x55, 0x17, 0x7e, 0xfb, 0x76, 0xdc, 0xcd, 0x74, 0xc7, 0x1d, 0x81, 0x2d, + 0xd7, 0xbe, 0x01, 0x7d, 0x3c, 0x1c, 0x65, 0x17, 0xe2, 0xf6, 0x63, 0x66, 0x94, 0x6c, 0x25, 0xe1, + 0x19, 0x91, 0xb2, 0xbf, 0xdf, 0x82, 0xd1, 0xc4, 0xeb, 0x36, 0x84, 0xb5, 0x27, 0xd0, 0x0f, 0x22, + 0x12, 0x67, 0x09, 0xdb, 0x17, 0xa0, 0x67, 0xcb, 0x0f, 0xa3, 0xa4, 0xa3, 0xc7, 0x35, 0x3f, 0x8c, + 0x30, 0xc3, 0xd8, 0x7f, 0x68, 0x41, 0xef, 0x9a, 0xe3, 0x7a, 0x91, 0x34, 0x0a, 0x58, 0x39, 0x46, + 0x81, 0x6e, 0xbe, 0x0b, 0xbd, 0x04, 0x7d, 0x64, 0x63, 0x83, 0xd4, 0x22, 0x31, 0xaa, 0x32, 0x14, + 0x42, 0xdf, 0x02, 0x83, 0x52, 0xf9, 0x8f, 0x55, 0xc6, 0xff, 0x62, 0x41, 0x8c, 0x6e, 0x43, 0x29, + 0x72, 0x77, 0xc8, 0x4c, 0xbd, 0x2e, 0x4c, 0xe5, 0x0f, 0x10, 0xbf, 0x63, 0x4d, 0x32, 0xc0, 0x31, + 0x2f, 0xfb, 0x8b, 0x05, 0x80, 0x38, 0x8e, 0x57, 0xa7, 0x4f, 0x9c, 0x4d, 0x19, 0x51, 0x2f, 0x66, + 0x18, 0x51, 0x51, 0xcc, 0x30, 0xc3, 0x82, 0xaa, 0xba, 0xa9, 0xd8, 0x55, 0x37, 0xf5, 0x1c, 0xa6, + 0x9b, 0xe6, 0x60, 0x3c, 0x8e, 0x43, 0x66, 0x86, 0x61, 0x64, 0x47, 0xe7, 0x5a, 0x12, 0x89, 0xd3, + 0xf4, 0x36, 0x81, 0x0b, 0x2a, 0x1c, 0x93, 0x38, 0xd1, 0x98, 0x1f, 0xb8, 0x6e, 0x94, 0xee, 0xd0, + 0x4f, 0xb1, 0x95, 0xb8, 0x90, 0x6b, 0x25, 0xfe, 0x09, 0x0b, 0x4e, 0x24, 0xeb, 0x61, 0x8f, 0xa6, + 0xbf, 0x60, 0xc1, 0x49, 0x66, 0x2b, 0x67, 0xb5, 0xa6, 0x2d, 0xf3, 0x2f, 0xb6, 0x0d, 0x31, 0x95, + 0xd3, 0xe2, 0x38, 0xe6, 0xc6, 0x4a, 0x16, 0x6b, 0x9c, 0x5d, 0xa3, 0xfd, 0x5f, 0x7b, 0x60, 0x32, + 0x2f, 0x36, 0x15, 0x7b, 0x26, 0xe2, 0xdc, 0xad, 0x6e, 0x93, 0x3b, 0xc2, 0x19, 0x3f, 0x7e, 0x26, + 0xc2, 0xc1, 0x58, 0xe2, 0x93, 0xe9, 0x4f, 0x0a, 0x5d, 0xa6, 0x3f, 0xd9, 0x82, 0xf1, 0x3b, 0x5b, + 0xc4, 0xbb, 0xe9, 0x85, 0x4e, 0xe4, 0x86, 0x1b, 0x2e, 0xb3, 0x2b, 0xf3, 0x79, 0x23, 0x73, 0x50, + 0x8f, 0xdf, 0x4e, 0x12, 0x1c, 0xec, 0x97, 0xcf, 0x19, 0x80, 0xb8, 0xc9, 0x7c, 0x23, 0xc1, 0x69, + 0xa6, 0xe9, 0xec, 0x31, 0x3d, 0x0f, 0x39, 0x7b, 0xcc, 0x8e, 0x2b, 0xbc, 0x51, 0xe4, 0x1b, 0x00, + 0x76, 0x63, 0x5c, 0x51, 0x50, 0xac, 0x51, 0xa0, 0x4f, 0x02, 0xd2, 0x33, 0x74, 0x19, 0xa1, 0x41, + 0x9f, 0xbb, 0xbf, 0x5f, 0x46, 0xab, 0x29, 0xec, 0xc1, 0x7e, 0x79, 0x82, 0x42, 0x97, 0x3c, 0x7a, + 0xf3, 0x8c, 0xe3, 0xa9, 0x65, 0x30, 0x42, 0xb7, 0x61, 0x8c, 0x42, 0xd9, 0x8a, 0x92, 0x71, 0x47, + 0xf9, 0x6d, 0xf1, 0x99, 0xfb, 0xfb, 0xe5, 0xb1, 0xd5, 0x04, 0x2e, 0x8f, 0x75, 0x8a, 0x09, 0x7a, + 0x05, 0x46, 0xe2, 0x79, 0x75, 0x9d, 0xec, 0xf1, 0x00, 0x3d, 0x25, 0xae, 0xf0, 0x5e, 0x31, 0x30, + 0x38, 0x41, 0x69, 0x7f, 0xc1, 0x82, 0x33, 0xb9, 0x19, 0xf1, 0xd1, 0x25, 0x18, 0x70, 0x9a, 0x2e, + 0x37, 0x5f, 0x88, 0xa3, 0x86, 0xa9, 0xc9, 0x2a, 0x4b, 0xdc, 0x78, 0xa1, 0xb0, 0x74, 0x87, 0xdf, + 0x76, 0xbd, 0x7a, 0x72, 0x87, 0xbf, 0xee, 0x7a, 0x75, 0xcc, 0x30, 0xea, 0xc8, 0x2a, 0xe6, 0x3e, + 0x45, 0xf8, 0x0a, 0x5d, 0xab, 0x19, 0xb9, 0xf3, 0x8f, 0xb7, 0x19, 0xe8, 0x19, 0xdd, 0xd4, 0x28, + 0xbc, 0x0a, 0x73, 0xcd, 0x8c, 0xdf, 0x67, 0x81, 0x78, 0xba, 0xdc, 0xc5, 0x99, 0xfc, 0x26, 0x0c, + 0xed, 0xa6, 0xb3, 0x17, 0x5e, 0xc8, 0x7f, 0xcb, 0x2d, 0x22, 0xae, 0x2b, 0x41, 0xdb, 0xc8, 0x54, + 0x68, 0xf0, 0xb2, 0xeb, 0x20, 0xb0, 0xf3, 0x84, 0x19, 0x14, 0x3a, 0xb7, 0xe6, 0x79, 0x80, 0x3a, + 0xa3, 0x65, 0x29, 0x8d, 0x0b, 0xa6, 0xc4, 0x35, 0xaf, 0x30, 0x58, 0xa3, 0xb2, 0xff, 0x79, 0x01, + 0x06, 0x65, 0xb6, 0xbc, 0x96, 0xd7, 0x8d, 0xda, 0xef, 0x50, 0xe9, 0xb3, 0xd1, 0x65, 0x28, 0x31, + 0xbd, 0x74, 0x25, 0xd6, 0x96, 0x2a, 0xad, 0xd0, 0x8a, 0x44, 0xe0, 0x98, 0x86, 0xee, 0x8e, 0x61, + 0x6b, 0x9d, 0x91, 0x27, 0x1e, 0xda, 0x56, 0x39, 0x18, 0x4b, 0x3c, 0xfa, 0x18, 0x8c, 0xf1, 0x72, + 0x81, 0xdf, 0x74, 0x36, 0xb9, 0x2d, 0xab, 0x57, 0x45, 0x2f, 0x19, 0x5b, 0x49, 0xe0, 0x0e, 0xf6, + 0xcb, 0x27, 0x92, 0x30, 0x66, 0xa4, 0x4d, 0x71, 0x61, 0x2e, 0x6b, 0xbc, 0x12, 0xba, 0xab, 0xa7, + 0x3c, 0xdd, 0x62, 0x14, 0xd6, 0xe9, 0xec, 0x4f, 0x03, 0x4a, 0xe7, 0x0d, 0x44, 0xaf, 0x73, 0x97, + 0x67, 0x37, 0x20, 0xf5, 0x76, 0x46, 0x5b, 0x3d, 0x46, 0x87, 0x7c, 0x23, 0xc7, 0x4b, 0x61, 0x55, + 0xde, 0xfe, 0x3f, 0x8b, 0x30, 0x96, 0x8c, 0x0a, 0x80, 0xae, 0x41, 0x1f, 0x17, 0x29, 0x05, 0xfb, + 0x36, 0x3e, 0x41, 0x5a, 0x2c, 0x01, 0x76, 0xb8, 0x0a, 0xa9, 0x54, 0x94, 0x47, 0x6f, 0xc1, 0x60, + 0xdd, 0xbf, 0xe3, 0xdd, 0x71, 0x82, 0xfa, 0x4c, 0x65, 0x49, 0x4c, 0xe7, 0x4c, 0x45, 0xc5, 0x7c, + 0x4c, 0xa6, 0xc7, 0x27, 0x60, 0xf6, 0xef, 0x18, 0x85, 0x75, 0x76, 0x68, 0x8d, 0x25, 0xfa, 0xd8, + 0x70, 0x37, 0x57, 0x9c, 0x66, 0xbb, 0xf7, 0x2f, 0x73, 0x92, 0x48, 0xe3, 0x3c, 0x2c, 0xb2, 0x81, + 0x70, 0x04, 0x8e, 0x19, 0xa1, 0xcf, 0xc2, 0x44, 0x98, 0x63, 0x3a, 0xc9, 0x4b, 0x23, 0xdb, 0xce, + 0x9a, 0x30, 0x7b, 0xfa, 0xfe, 0x7e, 0x79, 0x22, 0xcb, 0xc8, 0x92, 0x55, 0x8d, 0xfd, 0xa5, 0x13, + 0x60, 0x2c, 0x62, 0x23, 0xab, 0xb8, 0x75, 0x44, 0x59, 0xc5, 0x31, 0x0c, 0x90, 0x9d, 0x66, 0xb4, + 0x37, 0xef, 0x06, 0x62, 0x4c, 0x32, 0x79, 0x2e, 0x08, 0x9a, 0x34, 0x4f, 0x89, 0xc1, 0x8a, 0x4f, + 0x76, 0xea, 0xf7, 0xe2, 0x37, 0x31, 0xf5, 0x7b, 0xcf, 0x31, 0xa6, 0x7e, 0x5f, 0x85, 0xfe, 0x4d, + 0x37, 0xc2, 0xa4, 0xe9, 0x8b, 0xcb, 0x5c, 0xe6, 0x3c, 0xbc, 0xca, 0x49, 0xd2, 0x49, 0x86, 0x05, + 0x02, 0x4b, 0x26, 0xe8, 0x75, 0xb5, 0x02, 0xfb, 0xf2, 0x15, 0x2e, 0x69, 0xe7, 0x95, 0xcc, 0x35, + 0x28, 0x12, 0xbc, 0xf7, 0x3f, 0x68, 0x82, 0xf7, 0x45, 0x99, 0x96, 0x7d, 0x20, 0xff, 0xb1, 0x1a, + 0xcb, 0xba, 0xde, 0x21, 0x19, 0xfb, 0x2d, 0x3d, 0x95, 0x7d, 0x29, 0x7f, 0x27, 0x50, 0x59, 0xea, + 0xbb, 0x4c, 0x60, 0xff, 0x7d, 0x16, 0x9c, 0x4c, 0xa6, 0x9a, 0x65, 0x6f, 0x2a, 0x84, 0x9f, 0xc7, + 0x4b, 0xdd, 0xe4, 0xfe, 0x65, 0x05, 0x8c, 0x0a, 0x99, 0x8e, 0x34, 0x93, 0x0c, 0x67, 0x57, 0x47, + 0x3b, 0x3a, 0x58, 0xaf, 0x0b, 0x7f, 0x83, 0xc7, 0x72, 0x32, 0xe1, 0xb7, 0xc9, 0x7f, 0xbf, 0x96, + 0x91, 0x75, 0xfd, 0xf1, 0xbc, 0xac, 0xeb, 0x5d, 0xe7, 0x5a, 0x7f, 0x5d, 0xe5, 0xc0, 0x1f, 0xce, + 0x9f, 0x4a, 0x3c, 0xc3, 0x7d, 0xc7, 0xcc, 0xf7, 0xaf, 0xab, 0xcc, 0xf7, 0x6d, 0x22, 0x8b, 0xf3, + 0xbc, 0xf6, 0x1d, 0xf3, 0xdd, 0x6b, 0x39, 0xeb, 0x47, 0x8f, 0x26, 0x67, 0xbd, 0x71, 0xd4, 0xf0, + 0xb4, 0xe9, 0xcf, 0x74, 0x38, 0x6a, 0x0c, 0xbe, 0xed, 0x0f, 0x1b, 0x9e, 0x9f, 0x7f, 0xfc, 0x81, + 0xf2, 0xf3, 0xdf, 0xd2, 0xf3, 0xdd, 0xa3, 0x0e, 0x09, 0xdd, 0x29, 0x51, 0x97, 0x59, 0xee, 0x6f, + 0xe9, 0x07, 0xe0, 0x44, 0x3e, 0x5f, 0x75, 0xce, 0xa5, 0xf9, 0x66, 0x1e, 0x81, 0xa9, 0xec, 0xf9, + 0x27, 0x8e, 0x27, 0x7b, 0xfe, 0xc9, 0x23, 0xcf, 0x9e, 0x7f, 0xea, 0x18, 0xb2, 0xe7, 0x9f, 0x3e, + 0xc6, 0xec, 0xf9, 0xb7, 0x98, 0x73, 0x14, 0x0f, 0x00, 0x25, 0x22, 0xa1, 0x3f, 0x95, 0x13, 0x3f, + 0x2d, 0x1d, 0x25, 0x8a, 0x7f, 0x9c, 0x42, 0xe1, 0x98, 0x55, 0x46, 0x56, 0xfe, 0xc9, 0x87, 0x90, + 0x95, 0x7f, 0x35, 0xce, 0xca, 0x7f, 0x26, 0x7f, 0xa8, 0x33, 0x9e, 0xd3, 0xe4, 0xe4, 0xe2, 0xbf, + 0xa5, 0xe7, 0xd0, 0x7f, 0xa4, 0x8d, 0x15, 0x2c, 0x4b, 0xa1, 0xdc, 0x26, 0x73, 0xfe, 0x6b, 0x3c, + 0x73, 0xfe, 0xd9, 0xfc, 0x9d, 0x3c, 0x79, 0xdc, 0x19, 0xf9, 0xf2, 0x69, 0xbb, 0x54, 0xf0, 0x57, + 0x16, 0xf3, 0x3d, 0xa7, 0x5d, 0x2a, 0x7a, 0x6c, 0xba, 0x5d, 0x0a, 0x85, 0x63, 0x56, 0xf6, 0x0f, + 0x14, 0xe0, 0x7c, 0xfb, 0xf5, 0x16, 0x6b, 0xc9, 0x2b, 0xb1, 0x43, 0x40, 0x42, 0x4b, 0xce, 0xef, + 0x6c, 0x31, 0x55, 0xd7, 0xf1, 0x20, 0xaf, 0xc2, 0xb8, 0x7a, 0x87, 0xd3, 0x70, 0x6b, 0x7b, 0xab, + 0xf1, 0x35, 0x59, 0x45, 0x4e, 0xa8, 0x26, 0x09, 0x70, 0xba, 0x0c, 0x9a, 0x81, 0x51, 0x03, 0xb8, + 0x34, 0x2f, 0xee, 0x66, 0x71, 0x94, 0x71, 0x13, 0x8d, 0x93, 0xf4, 0xf6, 0xcf, 0x59, 0x70, 0x3a, + 0x27, 0xe5, 0x6b, 0xd7, 0xe1, 0x0e, 0x37, 0x60, 0xb4, 0x69, 0x16, 0xed, 0x10, 0xa1, 0xd5, 0x48, + 0x2c, 0xab, 0xda, 0x9a, 0x40, 0xe0, 0x24, 0x53, 0xfb, 0x67, 0x0a, 0x70, 0xae, 0xad, 0x63, 0x29, + 0xc2, 0x70, 0x6a, 0x73, 0x27, 0x74, 0xe6, 0x02, 0x52, 0x27, 0x5e, 0xe4, 0x3a, 0x8d, 0x6a, 0x93, + 0xd4, 0x34, 0x3b, 0x07, 0xf3, 0xd0, 0xbc, 0xba, 0x52, 0x9d, 0x49, 0x53, 0xe0, 0x9c, 0x92, 0x68, + 0x11, 0x50, 0x1a, 0x23, 0x46, 0x98, 0x65, 0x0f, 0x48, 0xf3, 0xc3, 0x19, 0x25, 0xd0, 0x07, 0x61, + 0x58, 0x39, 0xac, 0x6a, 0x23, 0xce, 0x36, 0x76, 0xac, 0x23, 0xb0, 0x49, 0x87, 0xae, 0xf0, 0xf4, + 0x13, 0x22, 0x51, 0x89, 0x30, 0x8a, 0x8c, 0xca, 0xdc, 0x12, 0x02, 0x8c, 0x75, 0x9a, 0xd9, 0x97, + 0x7f, 0xeb, 0x1b, 0xe7, 0xdf, 0xf7, 0xbb, 0xdf, 0x38, 0xff, 0xbe, 0x3f, 0xf8, 0xc6, 0xf9, 0xf7, + 0x7d, 0xd7, 0xfd, 0xf3, 0xd6, 0x6f, 0xdd, 0x3f, 0x6f, 0xfd, 0xee, 0xfd, 0xf3, 0xd6, 0x1f, 0xdc, + 0x3f, 0x6f, 0xfd, 0xf1, 0xfd, 0xf3, 0xd6, 0x17, 0xff, 0xe4, 0xfc, 0xfb, 0xde, 0x44, 0x71, 0x00, + 0xd1, 0xcb, 0x74, 0x74, 0x2e, 0xef, 0x5e, 0xf9, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x0b, + 0x0a, 0x3d, 0x91, 0x13, 0x01, 0x00, } func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { @@ -8423,70 +8265,6 @@ func (m *ClientIPConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ClusterTrustBundleProjection) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterTrustBundleProjection) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClusterTrustBundleProjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Optional != nil { - i-- - if *m.Optional { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x22 - if m.LabelSelector != nil { - { - size, err := m.LabelSelector.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.SignerName != nil { - i -= len(*m.SignerName) - copy(dAtA[i:], *m.SignerName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.SignerName))) - i-- - dAtA[i] = 0x12 - } - if m.Name != nil { - i -= len(*m.Name) - copy(dAtA[i:], *m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ComponentCondition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -11927,18 +11705,6 @@ func (m *LifecycleHandler) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Sleep != nil { - { - size, err := m.Sleep.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } if m.TCPSocket != nil { { size, err := m.TCPSocket.MarshalToSizedBuffer(dAtA[:i]) @@ -12359,13 +12125,6 @@ func (m *LoadBalancerIngress) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if m.IPMode != nil { - i -= len(*m.IPMode) - copy(dAtA[i:], *m.IPMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.IPMode))) - i-- - dAtA[i] = 0x1a - } i -= len(m.Hostname) copy(dAtA[i:], m.Hostname) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Hostname))) @@ -12479,39 +12238,6 @@ func (m *LocalVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ModifyVolumeStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ModifyVolumeStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ModifyVolumeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x12 - i -= len(m.TargetVolumeAttributesClassName) - copy(dAtA[i:], m.TargetVolumeAttributesClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.TargetVolumeAttributesClassName))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *NFSVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -14031,13 +13757,6 @@ func (m *PersistentVolumeClaimSpec) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l - if m.VolumeAttributesClassName != nil { - i -= len(*m.VolumeAttributesClassName) - copy(dAtA[i:], *m.VolumeAttributesClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VolumeAttributesClassName))) - i-- - dAtA[i] = 0x4a - } if m.DataSourceRef != nil { { size, err := m.DataSourceRef.MarshalToSizedBuffer(dAtA[:i]) @@ -14135,25 +13854,6 @@ func (m *PersistentVolumeClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if m.ModifyVolumeStatus != nil { - { - size, err := m.ModifyVolumeStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.CurrentVolumeAttributesClassName != nil { - i -= len(*m.CurrentVolumeAttributesClassName) - copy(dAtA[i:], *m.CurrentVolumeAttributesClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.CurrentVolumeAttributesClassName))) - i-- - dAtA[i] = 0x42 - } if len(m.AllocatedResourceStatuses) > 0 { keysForAllocatedResourceStatuses := make([]string, 0, len(m.AllocatedResourceStatuses)) for k := range m.AllocatedResourceStatuses { @@ -14714,13 +14414,6 @@ func (m *PersistentVolumeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.VolumeAttributesClassName != nil { - i -= len(*m.VolumeAttributesClassName) - copy(dAtA[i:], *m.VolumeAttributesClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VolumeAttributesClassName))) - i-- - dAtA[i] = 0x52 - } if m.NodeAffinity != nil { { size, err := m.NodeAffinity.MarshalToSizedBuffer(dAtA[:i]) @@ -15029,24 +14722,6 @@ func (m *PodAffinityTerm) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.MismatchLabelKeys) > 0 { - for iNdEx := len(m.MismatchLabelKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MismatchLabelKeys[iNdEx]) - copy(dAtA[i:], m.MismatchLabelKeys[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.MismatchLabelKeys[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.MatchLabelKeys) > 0 { - for iNdEx := len(m.MatchLabelKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MatchLabelKeys[iNdEx]) - copy(dAtA[i:], m.MatchLabelKeys[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.MatchLabelKeys[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if m.NamespaceSelector != nil { { size, err := m.NamespaceSelector.MarshalToSizedBuffer(dAtA[:i]) @@ -19569,32 +19244,6 @@ func (m *SessionAffinityConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SleepAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SleepAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SleepAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i = encodeVarintGenerated(dAtA, i, uint64(m.Seconds)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - func (m *StorageOSPersistentVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -20301,18 +19950,6 @@ func (m *VolumeProjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClusterTrustBundle != nil { - { - size, err := m.ClusterTrustBundle.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if m.ServiceAccountToken != nil { { size, err := m.ServiceAccountToken.MarshalToSizedBuffer(dAtA[:i]) @@ -20364,87 +20001,6 @@ func (m *VolumeProjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *VolumeResourceRequirements) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeResourceRequirements) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Requests) > 0 { - keysForRequests := make([]string, 0, len(m.Requests)) - for k := range m.Requests { - keysForRequests = append(keysForRequests, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForRequests) - for iNdEx := len(keysForRequests) - 1; iNdEx >= 0; iNdEx-- { - v := m.Requests[ResourceName(keysForRequests[iNdEx])] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(keysForRequests[iNdEx]) - copy(dAtA[i:], keysForRequests[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForRequests[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Limits) > 0 { - keysForLimits := make([]string, 0, len(m.Limits)) - for k := range m.Limits { - keysForLimits = append(keysForLimits, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLimits) - for iNdEx := len(keysForLimits) - 1; iNdEx >= 0; iNdEx-- { - v := m.Limits[ResourceName(keysForLimits[iNdEx])] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(keysForLimits[iNdEx]) - copy(dAtA[i:], keysForLimits[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLimits[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *VolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -21337,32 +20893,6 @@ func (m *ClientIPConfig) Size() (n int) { return n } -func (m *ClusterTrustBundleProjection) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.SignerName != nil { - l = len(*m.SignerName) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.LabelSelector != nil { - l = m.LabelSelector.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.Path) - n += 1 + l + sovGenerated(uint64(l)) - if m.Optional != nil { - n += 2 - } - return n -} - func (m *ComponentCondition) Size() (n int) { if m == nil { return 0 @@ -22638,10 +22168,6 @@ func (m *LifecycleHandler) Size() (n int) { l = m.TCPSocket.Size() n += 1 + l + sovGenerated(uint64(l)) } - if m.Sleep != nil { - l = m.Sleep.Size() - n += 1 + l + sovGenerated(uint64(l)) - } return n } @@ -22773,10 +22299,6 @@ func (m *LoadBalancerIngress) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Hostname) n += 1 + l + sovGenerated(uint64(l)) - if m.IPMode != nil { - l = len(*m.IPMode) - n += 1 + l + sovGenerated(uint64(l)) - } if len(m.Ports) > 0 { for _, e := range m.Ports { l = e.Size() @@ -22827,19 +22349,6 @@ func (m *LocalVolumeSource) Size() (n int) { return n } -func (m *ModifyVolumeStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TargetVolumeAttributesClassName) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - func (m *NFSVolumeSource) Size() (n int) { if m == nil { return 0 @@ -23421,10 +22930,6 @@ func (m *PersistentVolumeClaimSpec) Size() (n int) { l = m.DataSourceRef.Size() n += 1 + l + sovGenerated(uint64(l)) } - if m.VolumeAttributesClassName != nil { - l = len(*m.VolumeAttributesClassName) - n += 1 + l + sovGenerated(uint64(l)) - } return n } @@ -23474,14 +22979,6 @@ func (m *PersistentVolumeClaimStatus) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } - if m.CurrentVolumeAttributesClassName != nil { - l = len(*m.CurrentVolumeAttributesClassName) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.ModifyVolumeStatus != nil { - l = m.ModifyVolumeStatus.Size() - n += 1 + l + sovGenerated(uint64(l)) - } return n } @@ -23669,10 +23166,6 @@ func (m *PersistentVolumeSpec) Size() (n int) { l = m.NodeAffinity.Size() n += 1 + l + sovGenerated(uint64(l)) } - if m.VolumeAttributesClassName != nil { - l = len(*m.VolumeAttributesClassName) - n += 1 + l + sovGenerated(uint64(l)) - } return n } @@ -23766,18 +23259,6 @@ func (m *PodAffinityTerm) Size() (n int) { l = m.NamespaceSelector.Size() n += 1 + l + sovGenerated(uint64(l)) } - if len(m.MatchLabelKeys) > 0 { - for _, s := range m.MatchLabelKeys { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.MismatchLabelKeys) > 0 { - for _, s := range m.MismatchLabelKeys { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } return n } @@ -25419,16 +24900,6 @@ func (m *SessionAffinityConfig) Size() (n int) { return n } -func (m *SleepAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovGenerated(uint64(m.Seconds)) - return n -} - func (m *StorageOSPersistentVolumeSource) Size() (n int) { if m == nil { return 0 @@ -25722,37 +25193,6 @@ func (m *VolumeProjection) Size() (n int) { l = m.ServiceAccountToken.Size() n += 1 + l + sovGenerated(uint64(l)) } - if m.ClusterTrustBundle != nil { - l = m.ClusterTrustBundle.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *VolumeResourceRequirements) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Limits) > 0 { - for k, v := range m.Limits { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - if len(m.Requests) > 0 { - for k, v := range m.Requests { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } return n } @@ -26183,20 +25623,6 @@ func (this *ClientIPConfig) String() string { }, "") return s } -func (this *ClusterTrustBundleProjection) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterTrustBundleProjection{`, - `Name:` + valueToStringGenerated(this.Name) + `,`, - `SignerName:` + valueToStringGenerated(this.SignerName) + `,`, - `LabelSelector:` + strings.Replace(fmt.Sprintf("%v", this.LabelSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Optional:` + valueToStringGenerated(this.Optional) + `,`, - `}`, - }, "") - return s -} func (this *ComponentCondition) String() string { if this == nil { return "nil" @@ -27151,7 +26577,6 @@ func (this *LifecycleHandler) String() string { `Exec:` + strings.Replace(this.Exec.String(), "ExecAction", "ExecAction", 1) + `,`, `HTTPGet:` + strings.Replace(this.HTTPGet.String(), "HTTPGetAction", "HTTPGetAction", 1) + `,`, `TCPSocket:` + strings.Replace(this.TCPSocket.String(), "TCPSocketAction", "TCPSocketAction", 1) + `,`, - `Sleep:` + strings.Replace(this.Sleep.String(), "SleepAction", "SleepAction", 1) + `,`, `}`, }, "") return s @@ -27291,7 +26716,6 @@ func (this *LoadBalancerIngress) String() string { s := strings.Join([]string{`&LoadBalancerIngress{`, `IP:` + fmt.Sprintf("%v", this.IP) + `,`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `IPMode:` + valueToStringGenerated(this.IPMode) + `,`, `Ports:` + repeatedStringForPorts + `,`, `}`, }, "") @@ -27333,17 +26757,6 @@ func (this *LocalVolumeSource) String() string { }, "") return s } -func (this *ModifyVolumeStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ModifyVolumeStatus{`, - `TargetVolumeAttributesClassName:` + fmt.Sprintf("%v", this.TargetVolumeAttributesClassName) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `}`, - }, "") - return s -} func (this *NFSVolumeSource) String() string { if this == nil { return "nil" @@ -27793,14 +27206,13 @@ func (this *PersistentVolumeClaimSpec) String() string { } s := strings.Join([]string{`&PersistentVolumeClaimSpec{`, `AccessModes:` + fmt.Sprintf("%v", this.AccessModes) + `,`, - `Resources:` + strings.Replace(strings.Replace(this.Resources.String(), "VolumeResourceRequirements", "VolumeResourceRequirements", 1), `&`, ``, 1) + `,`, + `Resources:` + strings.Replace(strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1), `&`, ``, 1) + `,`, `VolumeName:` + fmt.Sprintf("%v", this.VolumeName) + `,`, `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, `StorageClassName:` + valueToStringGenerated(this.StorageClassName) + `,`, `VolumeMode:` + valueToStringGenerated(this.VolumeMode) + `,`, `DataSource:` + strings.Replace(this.DataSource.String(), "TypedLocalObjectReference", "TypedLocalObjectReference", 1) + `,`, `DataSourceRef:` + strings.Replace(this.DataSourceRef.String(), "TypedObjectReference", "TypedObjectReference", 1) + `,`, - `VolumeAttributesClassName:` + valueToStringGenerated(this.VolumeAttributesClassName) + `,`, `}`, }, "") return s @@ -27851,8 +27263,6 @@ func (this *PersistentVolumeClaimStatus) String() string { `Conditions:` + repeatedStringForConditions + `,`, `AllocatedResources:` + mapStringForAllocatedResources + `,`, `AllocatedResourceStatuses:` + mapStringForAllocatedResourceStatuses + `,`, - `CurrentVolumeAttributesClassName:` + valueToStringGenerated(this.CurrentVolumeAttributesClassName) + `,`, - `ModifyVolumeStatus:` + strings.Replace(this.ModifyVolumeStatus.String(), "ModifyVolumeStatus", "ModifyVolumeStatus", 1) + `,`, `}`, }, "") return s @@ -27950,7 +27360,6 @@ func (this *PersistentVolumeSpec) String() string { `MountOptions:` + fmt.Sprintf("%v", this.MountOptions) + `,`, `VolumeMode:` + valueToStringGenerated(this.VolumeMode) + `,`, `NodeAffinity:` + strings.Replace(this.NodeAffinity.String(), "VolumeNodeAffinity", "VolumeNodeAffinity", 1) + `,`, - `VolumeAttributesClassName:` + valueToStringGenerated(this.VolumeAttributesClassName) + `,`, `}`, }, "") return s @@ -28021,8 +27430,6 @@ func (this *PodAffinityTerm) String() string { `Namespaces:` + fmt.Sprintf("%v", this.Namespaces) + `,`, `TopologyKey:` + fmt.Sprintf("%v", this.TopologyKey) + `,`, `NamespaceSelector:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, - `MatchLabelKeys:` + fmt.Sprintf("%v", this.MatchLabelKeys) + `,`, - `MismatchLabelKeys:` + fmt.Sprintf("%v", this.MismatchLabelKeys) + `,`, `}`, }, "") return s @@ -29302,16 +28709,6 @@ func (this *SessionAffinityConfig) String() string { }, "") return s } -func (this *SleepAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SleepAction{`, - `Seconds:` + fmt.Sprintf("%v", this.Seconds) + `,`, - `}`, - }, "") - return s -} func (this *StorageOSPersistentVolumeSource) String() string { if this == nil { return "nil" @@ -29513,38 +28910,6 @@ func (this *VolumeProjection) String() string { `DownwardAPI:` + strings.Replace(this.DownwardAPI.String(), "DownwardAPIProjection", "DownwardAPIProjection", 1) + `,`, `ConfigMap:` + strings.Replace(this.ConfigMap.String(), "ConfigMapProjection", "ConfigMapProjection", 1) + `,`, `ServiceAccountToken:` + strings.Replace(this.ServiceAccountToken.String(), "ServiceAccountTokenProjection", "ServiceAccountTokenProjection", 1) + `,`, - `ClusterTrustBundle:` + strings.Replace(this.ClusterTrustBundle.String(), "ClusterTrustBundleProjection", "ClusterTrustBundleProjection", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeResourceRequirements) String() string { - if this == nil { - return "nil" - } - keysForLimits := make([]string, 0, len(this.Limits)) - for k := range this.Limits { - keysForLimits = append(keysForLimits, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLimits) - mapStringForLimits := "ResourceList{" - for _, k := range keysForLimits { - mapStringForLimits += fmt.Sprintf("%v: %v,", k, this.Limits[ResourceName(k)]) - } - mapStringForLimits += "}" - keysForRequests := make([]string, 0, len(this.Requests)) - for k := range this.Requests { - keysForRequests = append(keysForRequests, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForRequests) - mapStringForRequests := "ResourceList{" - for _, k := range keysForRequests { - mapStringForRequests += fmt.Sprintf("%v: %v,", k, this.Requests[ResourceName(k)]) - } - mapStringForRequests += "}" - s := strings.Join([]string{`&VolumeResourceRequirements{`, - `Limits:` + mapStringForLimits + `,`, - `Requests:` + mapStringForRequests + `,`, `}`, }, "") return s @@ -32672,7 +32037,7 @@ func (m *ClientIPConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { +func (m *ComponentCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -32695,15 +32060,15 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClusterTrustBundleProjection: wiretype end group for non-group") + return fmt.Errorf("proto: ComponentCondition: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterTrustBundleProjection: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ComponentCondition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -32731,12 +32096,11 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Name = &s + m.Type = ComponentConditionType(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -32764,14 +32128,13 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.SignerName = &s + m.Status = ConditionStatus(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -32781,31 +32144,27 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.LabelSelector == nil { - m.LabelSelector = &v1.LabelSelector{} - } - if err := m.LabelSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -32833,29 +32192,8 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = string(dAtA[iNdEx:postIndex]) + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Optional", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Optional = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -32877,7 +32215,7 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { } return nil } -func (m *ComponentCondition) Unmarshal(dAtA []byte) error { +func (m *ComponentStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -32900,113 +32238,17 @@ func (m *ComponentCondition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ComponentCondition: wiretype end group for non-group") + return fmt.Errorf("proto: ComponentStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ComponentCondition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ComponentStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = ComponentConditionType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = ConditionStatus(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -33016,110 +32258,28 @@ func (m *ComponentCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ComponentStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ComponentStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ComponentStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -43888,42 +43048,6 @@ func (m *LifecycleHandler) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sleep", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Sleep == nil { - m.Sleep = &SleepAction{} - } - if err := m.Sleep.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -45199,39 +44323,6 @@ func (m *LoadBalancerIngress) Unmarshal(dAtA []byte) error { } m.Hostname = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPMode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := LoadBalancerIPMode(dAtA[iNdEx:postIndex]) - m.IPMode = &s - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) @@ -45568,7 +44659,7 @@ func (m *LocalVolumeSource) Unmarshal(dAtA []byte) error { } return nil } -func (m *ModifyVolumeStatus) Unmarshal(dAtA []byte) error { +func (m *NFSVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -45591,15 +44682,15 @@ func (m *ModifyVolumeStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModifyVolumeStatus: wiretype end group for non-group") + return fmt.Errorf("proto: NFSVolumeSource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModifyVolumeStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NFSVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetVolumeAttributesClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Server", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -45627,11 +44718,11 @@ func (m *ModifyVolumeStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TargetVolumeAttributesClassName = string(dAtA[iNdEx:postIndex]) + m.Server = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -45659,8 +44750,28 @@ func (m *ModifyVolumeStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = PersistentVolumeClaimModifyVolumeStatus(dAtA[iNdEx:postIndex]) + m.Path = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -45682,7 +44793,7 @@ func (m *ModifyVolumeStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *NFSVolumeSource) Unmarshal(dAtA []byte) error { +func (m *Namespace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -45705,17 +44816,17 @@ func (m *NFSVolumeSource) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NFSVolumeSource: wiretype end group for non-group") + return fmt.Errorf("proto: Namespace: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NFSVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Server", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -45725,278 +44836,144 @@ func (m *NFSVolumeSource) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Server = string(dAtA[iNdEx:postIndex]) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnly = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Namespace) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Namespace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamespaceCondition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamespaceCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamespaceCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NamespaceCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NamespaceCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NamespaceCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -50798,39 +49775,6 @@ func (m *PersistentVolumeClaimSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeAttributesClassName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.VolumeAttributesClassName = &s - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -51364,75 +50308,6 @@ func (m *PersistentVolumeClaimStatus) Unmarshal(dAtA []byte) error { } m.AllocatedResourceStatuses[ResourceName(mapkey)] = ((ClaimResourceStatus)(mapvalue)) iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentVolumeAttributesClassName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.CurrentVolumeAttributesClassName = &s - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModifyVolumeStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ModifyVolumeStatus == nil { - m.ModifyVolumeStatus = &ModifyVolumeStatus{} - } - if err := m.ModifyVolumeStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -53055,39 +51930,6 @@ func (m *PersistentVolumeSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeAttributesClassName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.VolumeAttributesClassName = &s - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -53837,70 +52679,6 @@ func (m *PodAffinityTerm) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MatchLabelKeys", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MatchLabelKeys = append(m.MatchLabelKeys, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MismatchLabelKeys", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MismatchLabelKeys = append(m.MismatchLabelKeys, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -68096,75 +66874,6 @@ func (m *SessionAffinityConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *SleepAction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SleepAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SleepAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) - } - m.Seconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Seconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *StorageOSPersistentVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -70709,350 +69418,6 @@ func (m *VolumeProjection) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterTrustBundle", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterTrustBundle == nil { - m.ClusterTrustBundle = &ClusterTrustBundleProjection{} - } - if err := m.ClusterTrustBundle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeResourceRequirements) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumeResourceRequirements: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeResourceRequirements: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Limits == nil { - m.Limits = make(ResourceList) - } - var mapkey ResourceName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Limits[ResourceName(mapkey)] = *mapvalue - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Requests == nil { - m.Requests = make(ResourceList) - } - var mapkey ResourceName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Requests[ResourceName(mapkey)] = *mapvalue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/upstream/vendor/k8s.io/api/core/v1/generated.proto b/upstream/vendor/k8s.io/api/core/v1/generated.proto index d099238cdf6..901e837313f 100644 --- a/upstream/vendor/k8s.io/api/core/v1/generated.proto +++ b/upstream/vendor/k8s.io/api/core/v1/generated.proto @@ -228,8 +228,10 @@ message CSIPersistentVolumeSource { // nodeExpandSecretRef is a reference to the secret object containing // sensitive information to pass to the CSI driver to complete the CSI // NodeExpandVolume call. + // This is a beta field which is enabled default by CSINodeExpandSecret feature gate. // This field is optional, may be omitted if no secret is required. If the // secret object contains more than one secret, all secrets are passed. + // +featureGate=CSINodeExpandSecret // +optional optional SecretReference nodeExpandSecretRef = 10; } @@ -431,40 +433,6 @@ message ClientIPConfig { optional int32 timeoutSeconds = 1; } -// ClusterTrustBundleProjection describes how to select a set of -// ClusterTrustBundle objects and project their contents into the pod -// filesystem. -message ClusterTrustBundleProjection { - // Select a single ClusterTrustBundle by object name. Mutually-exclusive - // with signerName and labelSelector. - // +optional - optional string name = 1; - - // Select all ClusterTrustBundles that match this signer name. - // Mutually-exclusive with name. The contents of all selected - // ClusterTrustBundles will be unified and deduplicated. - // +optional - optional string signerName = 2; - - // Select all ClusterTrustBundles that match this label selector. Only has - // effect if signerName is set. Mutually-exclusive with name. If unset, - // interpreted as "match nothing". If set but empty, interpreted as "match - // everything". - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 3; - - // If true, don't block pod startup if the referenced ClusterTrustBundle(s) - // aren't available. If using name, then the named ClusterTrustBundle is - // allowed not to exist. If using signerName, then the combination of - // signerName and labelSelector is allowed to match zero - // ClusterTrustBundles. - // +optional - optional bool optional = 5; - - // Relative path from the volume root to write the bundle. - optional string path = 4; -} - // Information about the condition of a component. message ComponentCondition { // Type of condition for a component. @@ -1191,7 +1159,7 @@ message EndpointPort { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // @@ -2120,11 +2088,6 @@ message LifecycleHandler { // lifecycle hooks will fail in runtime when tcp handler is specified. // +optional optional TCPSocketAction tcpSocket = 3; - - // Sleep represents the duration that the container should sleep before being terminated. - // +featureGate=PodLifecycleSleepAction - // +optional - optional SleepAction sleep = 4; } // LimitRange sets resource usage limits for each kind of resource in a Namespace. @@ -2208,15 +2171,6 @@ message LoadBalancerIngress { // +optional optional string hostname = 2; - // IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified. - // Setting this to "VIP" indicates that traffic is delivered to the node with - // the destination set to the load-balancer's IP and port. - // Setting this to "Proxy" indicates that traffic is delivered to the node or pod with - // the destination set to the node's IP and node port or the pod's IP and port. - // Service implementations may use this information to adjust traffic routing. - // +optional - optional string ipMode = 3; - // Ports is a list of records of service ports // If used, every port defined in the service should have an entry in it // +listType=atomic @@ -2257,24 +2211,6 @@ message LocalVolumeSource { optional string fsType = 2; } -// ModifyVolumeStatus represents the status object of ControllerModifyVolume operation -message ModifyVolumeStatus { - // targetVolumeAttributesClassName is the name of the VolumeAttributesClass the PVC currently being reconciled - optional string targetVolumeAttributesClassName = 1; - - // status is the status of the ControllerModifyVolume operation. It can be in any of following states: - // - Pending - // Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as - // the specified VolumeAttributesClass not existing. - // - InProgress - // InProgress indicates that the volume is being modified. - // - Infeasible - // Infeasible indicates that the request has been rejected as invalid by the CSI driver. To - // resolve the error, a valid VolumeAttributesClass needs to be specified. - // Note: New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately. - optional string status = 2; -} - // Represents an NFS mount that lasts the lifetime of a pod. // NFS volumes do not support ownership management or SELinux relabeling. message NFSVolumeSource { @@ -2880,7 +2816,7 @@ message PersistentVolumeClaimSpec { // status field of the claim. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources // +optional - optional VolumeResourceRequirements resources = 2; + optional ResourceRequirements resources = 2; // volumeName is the binding reference to the PersistentVolume backing this claim. // +optional @@ -2932,22 +2868,6 @@ message PersistentVolumeClaimSpec { // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. // +optional optional TypedObjectReference dataSourceRef = 8; - - // volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. - // If specified, the CSI driver will create or update the volume with the attributes defined - // in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, - // it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass - // will be applied to the claim but it's not allowed to reset this field to empty string once it is set. - // If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass - // will be set by the persistentvolume controller if it exists. - // If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be - // set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource - // exists. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass - // (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. - // +featureGate=VolumeAttributesClass - // +optional - optional string volumeAttributesClassName = 9; } // PersistentVolumeClaimStatus is the current status of a persistent volume claim. @@ -3037,20 +2957,6 @@ message PersistentVolumeClaimStatus { // +mapType=granular // +optional map<string, string> allocatedResourceStatuses = 7; - - // currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. - // When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - optional string currentVolumeAttributesClassName = 8; - - // ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. - // When this is unset, there is no ModifyVolume operation being attempted. - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - optional ModifyVolumeStatus modifyVolumeStatus = 9; } // PersistentVolumeClaimTemplate is used to produce @@ -3255,17 +3161,6 @@ message PersistentVolumeSpec { // This field influences the scheduling of pods that use this volume. // +optional optional VolumeNodeAffinity nodeAffinity = 9; - - // Name of VolumeAttributesClass to which this persistent volume belongs. Empty value - // is not allowed. When this field is not set, it indicates that this volume does not belong to any - // VolumeAttributesClass. This field is mutable and can be changed by the CSI driver - // after a volume has been updated successfully to a new class. - // For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound - // PersistentVolumeClaims during the binding process. - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - optional string volumeAttributesClassName = 10; } // PersistentVolumeStatus is the current status of a persistent volume. @@ -3286,7 +3181,7 @@ message PersistentVolumeStatus { // lastPhaseTransitionTime is the time the phase transitioned from one to another // and automatically resets to current time everytime a volume phase transitions. - // This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default). + // This is an alpha field and requires enabling PersistentVolumeLastPhaseTransitionTime feature. // +featureGate=PersistentVolumeLastPhaseTransitionTime // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastPhaseTransitionTime = 4; @@ -3358,7 +3253,6 @@ message PodAffinity { // a pod of the set of pods is running message PodAffinityTerm { // A label query over a set of resources, in this case pods. - // If it's null, this PodAffinityTerm matches with no Pods. // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 1; @@ -3383,32 +3277,6 @@ message PodAffinityTerm { // An empty selector ({}) matches all namespaces. // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4; - - // MatchLabelKeys is a set of pod label keys to select which pods will - // be taken into consideration. The keys are used to lookup values from the - // incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` - // to select the group of existing pods which pods will be taken into consideration - // for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming - // pod labels will be ignored. The default value is empty. - // The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. - // Also, MatchLabelKeys cannot be set when LabelSelector isn't set. - // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - // +listType=atomic - // +optional - repeated string matchLabelKeys = 5; - - // MismatchLabelKeys is a set of pod label keys to select which pods will - // be taken into consideration. The keys are used to lookup values from the - // incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` - // to select the group of existing pods which pods will be taken into consideration - // for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming - // pod labels will be ignored. The default value is empty. - // The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. - // Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. - // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - // +listType=atomic - // +optional - repeated string mismatchLabelKeys = 6; } // Pod anti affinity is a group of inter pod anti affinity scheduling rules. @@ -5382,7 +5250,7 @@ message ServicePort { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // @@ -5685,12 +5553,6 @@ message SessionAffinityConfig { optional ClientIPConfig clientIP = 1; } -// SleepAction describes a "sleep" action. -message SleepAction { - // Seconds is the number of seconds to sleep. - optional int64 seconds = 1; -} - // Represents a StorageOS persistent volume resource. message StorageOSPersistentVolumeSource { // volumeName is the human-readable name of the StorageOS volume. Volume @@ -6098,39 +5960,6 @@ message VolumeProjection { // serviceAccountToken is information about the serviceAccountToken data to project // +optional optional ServiceAccountTokenProjection serviceAccountToken = 4; - - // ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field - // of ClusterTrustBundle objects in an auto-updating file. - // - // Alpha, gated by the ClusterTrustBundleProjection feature gate. - // - // ClusterTrustBundle objects can either be selected by name, or by the - // combination of signer name and a label selector. - // - // Kubelet performs aggressive normalization of the PEM contents written - // into the pod filesystem. Esoteric PEM features such as inter-block - // comments and block headers are stripped. Certificates are deduplicated. - // The ordering of certificates within the file is arbitrary, and Kubelet - // may change the order over time. - // - // +featureGate=ClusterTrustBundleProjection - // +optional - optional ClusterTrustBundleProjection clusterTrustBundle = 5; -} - -// VolumeResourceRequirements describes the storage resource requirements for a volume. -message VolumeResourceRequirements { - // Limits describes the maximum amount of compute resources allowed. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // +optional - map<string, k8s.io.apimachinery.pkg.api.resource.Quantity> limits = 1; - - // Requests describes the minimum amount of compute resources required. - // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - // otherwise to an implementation-defined value. Requests cannot exceed Limits. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // +optional - map<string, k8s.io.apimachinery.pkg.api.resource.Quantity> requests = 2; } // Represents the source of a volume to mount. diff --git a/upstream/vendor/k8s.io/api/core/v1/types.go b/upstream/vendor/k8s.io/api/core/v1/types.go index 61ba21bcad4..9e05c223565 100644 --- a/upstream/vendor/k8s.io/api/core/v1/types.go +++ b/upstream/vendor/k8s.io/api/core/v1/types.go @@ -363,16 +363,6 @@ type PersistentVolumeSpec struct { // This field influences the scheduling of pods that use this volume. // +optional NodeAffinity *VolumeNodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,9,opt,name=nodeAffinity"` - // Name of VolumeAttributesClass to which this persistent volume belongs. Empty value - // is not allowed. When this field is not set, it indicates that this volume does not belong to any - // VolumeAttributesClass. This field is mutable and can be changed by the CSI driver - // after a volume has been updated successfully to a new class. - // For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound - // PersistentVolumeClaims during the binding process. - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty" protobuf:"bytes,10,opt,name=volumeAttributesClassName"` } // VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. @@ -423,7 +413,7 @@ type PersistentVolumeStatus struct { Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` // lastPhaseTransitionTime is the time the phase transitioned from one to another // and automatically resets to current time everytime a volume phase transitions. - // This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default). + // This is an alpha field and requires enabling PersistentVolumeLastPhaseTransitionTime feature. // +featureGate=PersistentVolumeLastPhaseTransitionTime // +optional LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastPhaseTransitionTime"` @@ -496,7 +486,7 @@ type PersistentVolumeClaimSpec struct { // status field of the claim. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources // +optional - Resources VolumeResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` + Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` // volumeName is the binding reference to the PersistentVolume backing this claim. // +optional VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"` @@ -543,21 +533,6 @@ type PersistentVolumeClaimSpec struct { // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. // +optional DataSourceRef *TypedObjectReference `json:"dataSourceRef,omitempty" protobuf:"bytes,8,opt,name=dataSourceRef"` - // volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. - // If specified, the CSI driver will create or update the volume with the attributes defined - // in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, - // it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass - // will be applied to the claim but it's not allowed to reset this field to empty string once it is set. - // If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass - // will be set by the persistentvolume controller if it exists. - // If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be - // set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource - // exists. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass - // (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. - // +featureGate=VolumeAttributesClass - // +optional - VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty" protobuf:"bytes,9,opt,name=volumeAttributesClassName"` } type TypedObjectReference struct { @@ -586,11 +561,6 @@ const ( PersistentVolumeClaimResizing PersistentVolumeClaimConditionType = "Resizing" // PersistentVolumeClaimFileSystemResizePending - controller resize is finished and a file system resize is pending on node PersistentVolumeClaimFileSystemResizePending PersistentVolumeClaimConditionType = "FileSystemResizePending" - - // Applying the target VolumeAttributesClass encountered an error - PersistentVolumeClaimVolumeModifyVolumeError PersistentVolumeClaimConditionType = "ModifyVolumeError" - // Volume is being modified - PersistentVolumeClaimVolumeModifyingVolume PersistentVolumeClaimConditionType = "ModifyingVolume" ) // +enum @@ -617,38 +587,6 @@ const ( PersistentVolumeClaimNodeResizeFailed ClaimResourceStatus = "NodeResizeFailed" ) -// +enum -// New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately -type PersistentVolumeClaimModifyVolumeStatus string - -const ( - // Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as - // the specified VolumeAttributesClass not existing - PersistentVolumeClaimModifyVolumePending PersistentVolumeClaimModifyVolumeStatus = "Pending" - // InProgress indicates that the volume is being modified - PersistentVolumeClaimModifyVolumeInProgress PersistentVolumeClaimModifyVolumeStatus = "InProgress" - // Infeasible indicates that the request has been rejected as invalid by the CSI driver. To - // resolve the error, a valid VolumeAttributesClass needs to be specified - PersistentVolumeClaimModifyVolumeInfeasible PersistentVolumeClaimModifyVolumeStatus = "Infeasible" -) - -// ModifyVolumeStatus represents the status object of ControllerModifyVolume operation -type ModifyVolumeStatus struct { - // targetVolumeAttributesClassName is the name of the VolumeAttributesClass the PVC currently being reconciled - TargetVolumeAttributesClassName string `json:"targetVolumeAttributesClassName,omitempty" protobuf:"bytes,1,opt,name=targetVolumeAttributesClassName"` - // status is the status of the ControllerModifyVolume operation. It can be in any of following states: - // - Pending - // Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as - // the specified VolumeAttributesClass not existing. - // - InProgress - // InProgress indicates that the volume is being modified. - // - Infeasible - // Infeasible indicates that the request has been rejected as invalid by the CSI driver. To - // resolve the error, a valid VolumeAttributesClass needs to be specified. - // Note: New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately. - Status PersistentVolumeClaimModifyVolumeStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=PersistentVolumeClaimModifyVolumeStatus"` -} - // PersistentVolumeClaimCondition contains details about state of pvc type PersistentVolumeClaimCondition struct { Type PersistentVolumeClaimConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PersistentVolumeClaimConditionType"` @@ -755,18 +693,6 @@ type PersistentVolumeClaimStatus struct { // +mapType=granular // +optional AllocatedResourceStatuses map[ResourceName]ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty" protobuf:"bytes,7,rep,name=allocatedResourceStatuses"` - // currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. - // When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty" protobuf:"bytes,8,opt,name=currentVolumeAttributesClassName"` - // ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. - // When this is unset, there is no ModifyVolume operation being attempted. - // This is an alpha field and requires enabling VolumeAttributesClass feature. - // +featureGate=VolumeAttributesClass - // +optional - ModifyVolumeStatus *ModifyVolumeStatus `json:"modifyVolumeStatus,omitempty" protobuf:"bytes,9,opt,name=modifyVolumeStatus"` } // +enum @@ -1837,40 +1763,6 @@ type ServiceAccountTokenProjection struct { Path string `json:"path" protobuf:"bytes,3,opt,name=path"` } -// ClusterTrustBundleProjection describes how to select a set of -// ClusterTrustBundle objects and project their contents into the pod -// filesystem. -type ClusterTrustBundleProjection struct { - // Select a single ClusterTrustBundle by object name. Mutually-exclusive - // with signerName and labelSelector. - // +optional - Name *string `json:"name,omitempty" protobuf:"bytes,1,rep,name=name"` - - // Select all ClusterTrustBundles that match this signer name. - // Mutually-exclusive with name. The contents of all selected - // ClusterTrustBundles will be unified and deduplicated. - // +optional - SignerName *string `json:"signerName,omitempty" protobuf:"bytes,2,rep,name=signerName"` - - // Select all ClusterTrustBundles that match this label selector. Only has - // effect if signerName is set. Mutually-exclusive with name. If unset, - // interpreted as "match nothing". If set but empty, interpreted as "match - // everything". - // +optional - LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,3,rep,name=labelSelector"` - - // If true, don't block pod startup if the referenced ClusterTrustBundle(s) - // aren't available. If using name, then the named ClusterTrustBundle is - // allowed not to exist. If using signerName, then the combination of - // signerName and labelSelector is allowed to match zero - // ClusterTrustBundles. - // +optional - Optional *bool `json:"optional,omitempty" protobuf:"varint,5,opt,name=optional"` - - // Relative path from the volume root to write the bundle. - Path string `json:"path" protobuf:"bytes,4,rep,name=path"` -} - // Represents a projected volume source type ProjectedVolumeSource struct { // sources is the list of volume projections @@ -1902,24 +1794,6 @@ type VolumeProjection struct { // serviceAccountToken is information about the serviceAccountToken data to project // +optional ServiceAccountToken *ServiceAccountTokenProjection `json:"serviceAccountToken,omitempty" protobuf:"bytes,4,opt,name=serviceAccountToken"` - - // ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field - // of ClusterTrustBundle objects in an auto-updating file. - // - // Alpha, gated by the ClusterTrustBundleProjection feature gate. - // - // ClusterTrustBundle objects can either be selected by name, or by the - // combination of signer name and a label selector. - // - // Kubelet performs aggressive normalization of the PEM contents written - // into the pod filesystem. Esoteric PEM features such as inter-block - // comments and block headers are stripped. Certificates are deduplicated. - // The ordering of certificates within the file is arbitrary, and Kubelet - // may change the order over time. - // - // +featureGate=ClusterTrustBundleProjection - // +optional - ClusterTrustBundle *ClusterTrustBundleProjection `json:"clusterTrustBundle,omitempty" protobuf:"bytes,5,opt,name=clusterTrustBundle"` } const ( @@ -2020,8 +1894,10 @@ type CSIPersistentVolumeSource struct { // nodeExpandSecretRef is a reference to the secret object containing // sensitive information to pass to the CSI driver to complete the CSI // NodeExpandVolume call. + // This is a beta field which is enabled default by CSINodeExpandSecret feature gate. // This field is optional, may be omitted if no secret is required. If the // secret object contains more than one secret, all secrets are passed. + // +featureGate=CSINodeExpandSecret // +optional NodeExpandSecretRef *SecretReference `json:"nodeExpandSecretRef,omitempty" protobuf:"bytes,10,opt,name=nodeExpandSecretRef"` } @@ -2396,12 +2272,6 @@ type ExecAction struct { Command []string `json:"command,omitempty" protobuf:"bytes,1,rep,name=command"` } -// SleepAction describes a "sleep" action. -type SleepAction struct { - // Seconds is the number of seconds to sleep. - Seconds int64 `json:"seconds" protobuf:"bytes,1,opt,name=seconds"` -} - // Probe describes a health check to be performed against a container to determine whether it is // alive or ready to receive traffic. type Probe struct { @@ -2547,27 +2417,6 @@ type ResourceRequirements struct { Claims []ResourceClaim `json:"claims,omitempty" protobuf:"bytes,3,opt,name=claims"` } -// VolumeResourceRequirements describes the storage resource requirements for a volume. -type VolumeResourceRequirements struct { - // Limits describes the maximum amount of compute resources allowed. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // +optional - Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"` - // Requests describes the minimum amount of compute resources required. - // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - // otherwise to an implementation-defined value. Requests cannot exceed Limits. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // +optional - Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"` - - // Claims got added by accident when volumes shared the ResourceRequirements struct - // with containers. Stripping the field got added in 1.27 and was backported to 1.26. - // Starting with Kubernetes 1.28, this field is not part of the volume API anymore. - // - // Future extensions must not use "claims" or field number 3. - // Claims []ResourceClaim `json:"claims,omitempty" protobuf:"bytes,3,opt,name=claims"` -} - // ResourceClaim references one entry in PodSpec.ResourceClaims. type ResourceClaim struct { // Name must match the name of one entry in pod.spec.resourceClaims of @@ -2797,10 +2646,6 @@ type LifecycleHandler struct { // lifecycle hooks will fail in runtime when tcp handler is specified. // +optional TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"` - // Sleep represents the duration that the container should sleep before being terminated. - // +featureGate=PodLifecycleSleepAction - // +optional - Sleep *SleepAction `json:"sleep,omitempty" protobuf:"bytes,4,opt,name=sleep"` } // Lifecycle describes actions that the management system should take in response to container lifecycle @@ -3000,9 +2845,6 @@ const ( // DisruptionTarget indicates the pod is about to be terminated due to a // disruption (such as preemption, eviction API or garbage-collection). DisruptionTarget PodConditionType = "DisruptionTarget" - // PodReadyToStartContainers pod sandbox is successfully configured and - // the pod is ready to launch containers. - PodReadyToStartContainers PodConditionType = "PodReadyToStartContainers" ) // These are reasons for a pod's transition to a condition. @@ -3294,7 +3136,6 @@ type WeightedPodAffinityTerm struct { // a pod of the set of pods is running type PodAffinityTerm struct { // A label query over a set of resources, in this case pods. - // If it's null, this PodAffinityTerm matches with no Pods. // +optional LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` // namespaces specifies a static list of namespace names that the term applies to. @@ -3316,30 +3157,6 @@ type PodAffinityTerm struct { // An empty selector ({}) matches all namespaces. // +optional NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,4,opt,name=namespaceSelector"` - // MatchLabelKeys is a set of pod label keys to select which pods will - // be taken into consideration. The keys are used to lookup values from the - // incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` - // to select the group of existing pods which pods will be taken into consideration - // for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming - // pod labels will be ignored. The default value is empty. - // The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. - // Also, MatchLabelKeys cannot be set when LabelSelector isn't set. - // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - // +listType=atomic - // +optional - MatchLabelKeys []string `json:"matchLabelKeys,omitempty" protobuf:"bytes,5,opt,name=matchLabelKeys"` - // MismatchLabelKeys is a set of pod label keys to select which pods will - // be taken into consideration. The keys are used to lookup values from the - // incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` - // to select the group of existing pods which pods will be taken into consideration - // for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming - // pod labels will be ignored. The default value is empty. - // The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. - // Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. - // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. - // +listType=atomic - // +optional - MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty" protobuf:"bytes,6,opt,name=mismatchLabelKeys"` } // Node affinity is a group of node affinity scheduling rules. @@ -4875,15 +4692,6 @@ type LoadBalancerIngress struct { // +optional Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"` - // IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified. - // Setting this to "VIP" indicates that traffic is delivered to the node with - // the destination set to the load-balancer's IP and port. - // Setting this to "Proxy" indicates that traffic is delivered to the node or pod with - // the destination set to the node's IP and node port or the pod's IP and port. - // Service implementations may use this information to adjust traffic routing. - // +optional - IPMode *LoadBalancerIPMode `json:"ipMode,omitempty" protobuf:"bytes,3,opt,name=ipMode"` - // Ports is a list of records of service ports // If used, every port defined in the service should have an entry in it // +listType=atomic @@ -4901,8 +4709,6 @@ const ( IPv4Protocol IPFamily = "IPv4" // IPv6Protocol indicates that this IP is IPv6 protocol IPv6Protocol IPFamily = "IPv6" - // IPFamilyUnknown indicates that this IP is unknown protocol - IPFamilyUnknown IPFamily = "" ) // IPFamilyPolicy represents the dual-stack-ness requested or required by a Service @@ -5197,7 +5003,7 @@ type ServicePort struct { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // @@ -5441,7 +5247,7 @@ type EndpointPort struct { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // @@ -7248,15 +7054,3 @@ type PortStatus struct { // +kubebuilder:validation:MaxLength=316 Error *string `json:"error,omitempty" protobuf:"bytes,3,opt,name=error"` } - -// LoadBalancerIPMode represents the mode of the LoadBalancer ingress IP -type LoadBalancerIPMode string - -const ( - // LoadBalancerIPModeVIP indicates that traffic is delivered to the node with - // the destination set to the load-balancer's IP and port. - LoadBalancerIPModeVIP LoadBalancerIPMode = "VIP" - // LoadBalancerIPModeProxy indicates that traffic is delivered to the node or pod with - // the destination set to the node's IP and port or the pod's IP and port. - LoadBalancerIPModeProxy LoadBalancerIPMode = "Proxy" -) diff --git a/upstream/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index fd6f7dc61b9..9734d8b41eb 100644 --- a/upstream/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -127,7 +127,7 @@ var map_CSIPersistentVolumeSource = map[string]string{ "nodeStageSecretRef": "nodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", "nodePublishSecretRef": "nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", "controllerExpandSecretRef": "controllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - "nodeExpandSecretRef": "nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed.", + "nodeExpandSecretRef": "nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This is a beta field which is enabled default by CSINodeExpandSecret feature gate. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed.", } func (CSIPersistentVolumeSource) SwaggerDoc() map[string]string { @@ -228,19 +228,6 @@ func (ClientIPConfig) SwaggerDoc() map[string]string { return map_ClientIPConfig } -var map_ClusterTrustBundleProjection = map[string]string{ - "": "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.", - "name": "Select a single ClusterTrustBundle by object name. Mutually-exclusive with signerName and labelSelector.", - "signerName": "Select all ClusterTrustBundles that match this signer name. Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated.", - "labelSelector": "Select all ClusterTrustBundles that match this label selector. Only has effect if signerName is set. Mutually-exclusive with name. If unset, interpreted as \"match nothing\". If set but empty, interpreted as \"match everything\".", - "optional": "If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles.", - "path": "Relative path from the volume root to write the bundle.", -} - -func (ClusterTrustBundleProjection) SwaggerDoc() map[string]string { - return map_ClusterTrustBundleProjection -} - var map_ComponentCondition = map[string]string{ "": "Information about the condition of a component.", "type": "Type of condition for a component. Valid value: \"Healthy\"", @@ -544,7 +531,7 @@ var map_EndpointPort = map[string]string{ "name": "The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.", "port": "The port number of the endpoint.", "protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", - "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", + "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", } func (EndpointPort) SwaggerDoc() map[string]string { @@ -948,7 +935,6 @@ var map_LifecycleHandler = map[string]string{ "exec": "Exec specifies the action to take.", "httpGet": "HTTPGet specifies the http request to perform.", "tcpSocket": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.", - "sleep": "Sleep represents the duration that the container should sleep before being terminated.", } func (LifecycleHandler) SwaggerDoc() map[string]string { @@ -1002,7 +988,6 @@ var map_LoadBalancerIngress = map[string]string{ "": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", "ip": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)", "hostname": "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)", - "ipMode": "IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified. Setting this to \"VIP\" indicates that traffic is delivered to the node with the destination set to the load-balancer's IP and port. Setting this to \"Proxy\" indicates that traffic is delivered to the node or pod with the destination set to the node's IP and node port or the pod's IP and port. Service implementations may use this information to adjust traffic routing.", "ports": "Ports is a list of records of service ports If used, every port defined in the service should have an entry in it", } @@ -1038,16 +1023,6 @@ func (LocalVolumeSource) SwaggerDoc() map[string]string { return map_LocalVolumeSource } -var map_ModifyVolumeStatus = map[string]string{ - "": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation", - "targetVolumeAttributesClassName": "targetVolumeAttributesClassName is the name of the VolumeAttributesClass the PVC currently being reconciled", - "status": "status is the status of the ControllerModifyVolume operation. It can be in any of following states:\n - Pending\n Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as\n the specified VolumeAttributesClass not existing.\n - InProgress\n InProgress indicates that the volume is being modified.\n - Infeasible\n Infeasible indicates that the request has been rejected as invalid by the CSI driver. To\n\t resolve the error, a valid VolumeAttributesClass needs to be specified.\nNote: New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately.", -} - -func (ModifyVolumeStatus) SwaggerDoc() map[string]string { - return map_ModifyVolumeStatus -} - var map_NFSVolumeSource = map[string]string{ "": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", "server": "server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", @@ -1364,16 +1339,15 @@ func (PersistentVolumeClaimList) SwaggerDoc() map[string]string { } var map_PersistentVolumeClaimSpec = map[string]string{ - "": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", - "accessModes": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - "selector": "selector is a label query over volumes to consider for binding.", - "resources": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", - "volumeName": "volumeName is the binding reference to the PersistentVolume backing this claim.", - "storageClassName": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", - "volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", - "dataSource": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", - "dataSourceRef": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", - "volumeAttributesClassName": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + "": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", + "accessModes": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", + "selector": "selector is a label query over volumes to consider for binding.", + "resources": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", + "volumeName": "volumeName is the binding reference to the PersistentVolume backing this claim.", + "storageClassName": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", + "volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", + "dataSource": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", + "dataSourceRef": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", } func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string { @@ -1381,15 +1355,13 @@ func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string { } var map_PersistentVolumeClaimStatus = map[string]string{ - "": "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", - "phase": "phase represents the current phase of PersistentVolumeClaim.", - "accessModes": "accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - "capacity": "capacity represents the actual resources of the underlying volume.", - "conditions": "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", - "allocatedResources": "allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nCapacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity.\n\nA controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", - "allocatedResourceStatuses": "allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nClaimResourceStatus can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState set when resize controller starts resizing the volume in control-plane.\n\t- ControllerResizeFailed:\n\t\tState set when resize has failed in resize controller with a terminal error.\n\t- NodeResizePending:\n\t\tState set when resize controller has finished resizing the volume but further resizing of\n\t\tvolume is needed on the node.\n\t- NodeResizeInProgress:\n\t\tState set when kubelet starts resizing the volume.\n\t- NodeResizeFailed:\n\t\tState set when resizing has failed in kubelet with a terminal error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor example: if expanding a PVC for more capacity - this field can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeFailed\"\nWhen this field is not set, it means that no resize operation is in progress for the given PVC.\n\nA controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", - "currentVolumeAttributesClassName": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.", - "modifyVolumeStatus": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature.", + "": "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", + "phase": "phase represents the current phase of PersistentVolumeClaim.", + "accessModes": "accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", + "capacity": "capacity represents the actual resources of the underlying volume.", + "conditions": "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", + "allocatedResources": "allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nCapacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity.\n\nA controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", + "allocatedResourceStatuses": "allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nClaimResourceStatus can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState set when resize controller starts resizing the volume in control-plane.\n\t- ControllerResizeFailed:\n\t\tState set when resize has failed in resize controller with a terminal error.\n\t- NodeResizePending:\n\t\tState set when resize controller has finished resizing the volume but further resizing of\n\t\tvolume is needed on the node.\n\t- NodeResizeInProgress:\n\t\tState set when kubelet starts resizing the volume.\n\t- NodeResizeFailed:\n\t\tState set when resizing has failed in kubelet with a terminal error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor example: if expanding a PVC for more capacity - this field can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeFailed\"\nWhen this field is not set, it means that no resize operation is in progress for the given PVC.\n\nA controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", } func (PersistentVolumeClaimStatus) SwaggerDoc() map[string]string { @@ -1466,7 +1438,6 @@ var map_PersistentVolumeSpec = map[string]string{ "mountOptions": "mountOptions is the list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", "volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.", "nodeAffinity": "nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.", - "volumeAttributesClassName": "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.", } func (PersistentVolumeSpec) SwaggerDoc() map[string]string { @@ -1478,7 +1449,7 @@ var map_PersistentVolumeStatus = map[string]string{ "phase": "phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase", "message": "message is a human-readable message indicating details about why the volume is in this state.", "reason": "reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.", - "lastPhaseTransitionTime": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", + "lastPhaseTransitionTime": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is an alpha field and requires enabling PersistentVolumeLastPhaseTransitionTime feature.", } func (PersistentVolumeStatus) SwaggerDoc() map[string]string { @@ -1518,12 +1489,10 @@ func (PodAffinity) SwaggerDoc() map[string]string { var map_PodAffinityTerm = map[string]string{ "": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running", - "labelSelector": "A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods.", + "labelSelector": "A label query over a set of resources, in this case pods.", "namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", "topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces.", - "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", - "mismatchLabelKeys": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", } func (PodAffinityTerm) SwaggerDoc() map[string]string { @@ -2356,7 +2325,7 @@ var map_ServicePort = map[string]string{ "": "ServicePort contains information on service's port.", "name": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.", "protocol": "The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP.", - "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", + "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", "port": "The port that will be exposed by this service.", "targetPort": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service", "nodePort": "The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport", @@ -2421,15 +2390,6 @@ func (SessionAffinityConfig) SwaggerDoc() map[string]string { return map_SessionAffinityConfig } -var map_SleepAction = map[string]string{ - "": "SleepAction describes a \"sleep\" action.", - "seconds": "Seconds is the number of seconds to sleep.", -} - -func (SleepAction) SwaggerDoc() map[string]string { - return map_SleepAction -} - var map_StorageOSPersistentVolumeSource = map[string]string{ "": "Represents a StorageOS persistent volume resource.", "volumeName": "volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", @@ -2606,23 +2566,12 @@ var map_VolumeProjection = map[string]string{ "downwardAPI": "downwardAPI information about the downwardAPI data to project", "configMap": "configMap information about the configMap data to project", "serviceAccountToken": "serviceAccountToken is information about the serviceAccountToken data to project", - "clusterTrustBundle": "ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field of ClusterTrustBundle objects in an auto-updating file.\n\nAlpha, gated by the ClusterTrustBundleProjection feature gate.\n\nClusterTrustBundle objects can either be selected by name, or by the combination of signer name and a label selector.\n\nKubelet performs aggressive normalization of the PEM contents written into the pod filesystem. Esoteric PEM features such as inter-block comments and block headers are stripped. Certificates are deduplicated. The ordering of certificates within the file is arbitrary, and Kubelet may change the order over time.", } func (VolumeProjection) SwaggerDoc() map[string]string { return map_VolumeProjection } -var map_VolumeResourceRequirements = map[string]string{ - "": "VolumeResourceRequirements describes the storage resource requirements for a volume.", - "limits": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", - "requests": "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/", -} - -func (VolumeResourceRequirements) SwaggerDoc() map[string]string { - return map_VolumeResourceRequirements -} - var map_VolumeSource = map[string]string{ "": "Represents the source of a volume to mount. Only one of its members may be specified.", "hostPath": "hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", diff --git a/upstream/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 45172e0e233..d76f0bbbcf7 100644 --- a/upstream/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -466,42 +466,6 @@ func (in *ClientIPConfig) DeepCopy() *ClientIPConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTrustBundleProjection) DeepCopyInto(out *ClusterTrustBundleProjection) { - *out = *in - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.SignerName != nil { - in, out := &in.SignerName, &out.SignerName - *out = new(string) - **out = **in - } - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.Optional != nil { - in, out := &in.Optional, &out.Optional - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundleProjection. -func (in *ClusterTrustBundleProjection) DeepCopy() *ClusterTrustBundleProjection { - if in == nil { - return nil - } - out := new(ClusterTrustBundleProjection) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ComponentCondition) DeepCopyInto(out *ComponentCondition) { *out = *in @@ -2081,11 +2045,6 @@ func (in *LifecycleHandler) DeepCopyInto(out *LifecycleHandler) { *out = new(TCPSocketAction) **out = **in } - if in.Sleep != nil { - in, out := &in.Sleep, &out.Sleep - *out = new(SleepAction) - **out = **in - } return } @@ -2269,11 +2228,6 @@ func (in *List) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancerIngress) DeepCopyInto(out *LoadBalancerIngress) { *out = *in - if in.IPMode != nil { - in, out := &in.IPMode, &out.IPMode - *out = new(LoadBalancerIPMode) - **out = **in - } if in.Ports != nil { in, out := &in.Ports, &out.Ports *out = make([]PortStatus, len(*in)) @@ -2354,22 +2308,6 @@ func (in *LocalVolumeSource) DeepCopy() *LocalVolumeSource { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ModifyVolumeStatus) DeepCopyInto(out *ModifyVolumeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModifyVolumeStatus. -func (in *ModifyVolumeStatus) DeepCopy() *ModifyVolumeStatus { - if in == nil { - return nil - } - out := new(ModifyVolumeStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NFSVolumeSource) DeepCopyInto(out *NFSVolumeSource) { *out = *in @@ -3118,11 +3056,6 @@ func (in *PersistentVolumeClaimSpec) DeepCopyInto(out *PersistentVolumeClaimSpec *out = new(TypedObjectReference) (*in).DeepCopyInto(*out) } - if in.VolumeAttributesClassName != nil { - in, out := &in.VolumeAttributesClassName, &out.VolumeAttributesClassName - *out = new(string) - **out = **in - } return } @@ -3172,16 +3105,6 @@ func (in *PersistentVolumeClaimStatus) DeepCopyInto(out *PersistentVolumeClaimSt (*out)[key] = val } } - if in.CurrentVolumeAttributesClassName != nil { - in, out := &in.CurrentVolumeAttributesClassName, &out.CurrentVolumeAttributesClassName - *out = new(string) - **out = **in - } - if in.ModifyVolumeStatus != nil { - in, out := &in.ModifyVolumeStatus, &out.ModifyVolumeStatus - *out = new(ModifyVolumeStatus) - **out = **in - } return } @@ -3424,11 +3347,6 @@ func (in *PersistentVolumeSpec) DeepCopyInto(out *PersistentVolumeSpec) { *out = new(VolumeNodeAffinity) (*in).DeepCopyInto(*out) } - if in.VolumeAttributesClassName != nil { - in, out := &in.VolumeAttributesClassName, &out.VolumeAttributesClassName - *out = new(string) - **out = **in - } return } @@ -3554,16 +3472,6 @@ func (in *PodAffinityTerm) DeepCopyInto(out *PodAffinityTerm) { *out = new(metav1.LabelSelector) (*in).DeepCopyInto(*out) } - if in.MatchLabelKeys != nil { - in, out := &in.MatchLabelKeys, &out.MatchLabelKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.MismatchLabelKeys != nil { - in, out := &in.MismatchLabelKeys, &out.MismatchLabelKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } return } @@ -5773,22 +5681,6 @@ func (in *SessionAffinityConfig) DeepCopy() *SessionAffinityConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SleepAction) DeepCopyInto(out *SleepAction) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SleepAction. -func (in *SleepAction) DeepCopy() *SleepAction { - if in == nil { - return nil - } - out := new(SleepAction) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageOSPersistentVolumeSource) DeepCopyInto(out *StorageOSPersistentVolumeSource) { *out = *in @@ -6135,11 +6027,6 @@ func (in *VolumeProjection) DeepCopyInto(out *VolumeProjection) { *out = new(ServiceAccountTokenProjection) (*in).DeepCopyInto(*out) } - if in.ClusterTrustBundle != nil { - in, out := &in.ClusterTrustBundle, &out.ClusterTrustBundle - *out = new(ClusterTrustBundleProjection) - (*in).DeepCopyInto(*out) - } return } @@ -6153,36 +6040,6 @@ func (in *VolumeProjection) DeepCopy() *VolumeProjection { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VolumeResourceRequirements) DeepCopyInto(out *VolumeResourceRequirements) { - *out = *in - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make(ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeResourceRequirements. -func (in *VolumeResourceRequirements) DeepCopy() *VolumeResourceRequirements { - if in == nil { - return nil - } - out := new(VolumeResourceRequirements) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeSource) DeepCopyInto(out *VolumeSource) { *out = *in diff --git a/upstream/vendor/k8s.io/api/discovery/v1/generated.proto b/upstream/vendor/k8s.io/api/discovery/v1/generated.proto index 6d234017b72..490ce892247 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1/generated.proto +++ b/upstream/vendor/k8s.io/api/discovery/v1/generated.proto @@ -118,7 +118,7 @@ message EndpointHints { // +structType=atomic message EndpointPort { // name represents the name of this port. All ports in an EndpointSlice must have a unique name. - // If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. + // If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. // Name must either be an empty string or pass DNS_LABEL validation: // * must be no more than 63 characters long. // * must consist of lower case alphanumeric characters or '-'. @@ -145,7 +145,7 @@ message EndpointPort { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // diff --git a/upstream/vendor/k8s.io/api/discovery/v1/types.go b/upstream/vendor/k8s.io/api/discovery/v1/types.go index 7ebb07ca359..efbb09918c2 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1/types.go +++ b/upstream/vendor/k8s.io/api/discovery/v1/types.go @@ -168,7 +168,7 @@ type ForZone struct { // +structType=atomic type EndpointPort struct { // name represents the name of this port. All ports in an EndpointSlice must have a unique name. - // If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. + // If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. // Name must either be an empty string or pass DNS_LABEL validation: // * must be no more than 63 characters long. // * must consist of lower case alphanumeric characters or '-'. @@ -195,7 +195,7 @@ type EndpointPort struct { // RFC-6335 and https://www.iana.org/assignments/service-names). // // * Kubernetes-defined prefixed names: - // * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + // * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540 // * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 // * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 // diff --git a/upstream/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go index 41c3060568f..bef7745398a 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go @@ -65,10 +65,10 @@ func (EndpointHints) SwaggerDoc() map[string]string { var map_EndpointPort = map[string]string{ "": "EndpointPort represents a Port used by an EndpointSlice", - "name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", + "name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", "protocol": "protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", "port": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", - "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", + "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", } func (EndpointPort) SwaggerDoc() map[string]string { diff --git a/upstream/vendor/k8s.io/api/discovery/v1beta1/generated.proto b/upstream/vendor/k8s.io/api/discovery/v1beta1/generated.proto index ec555a40b3a..8b6c360b0e6 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1beta1/generated.proto +++ b/upstream/vendor/k8s.io/api/discovery/v1beta1/generated.proto @@ -119,7 +119,7 @@ message EndpointHints { // EndpointPort represents a Port used by an EndpointSlice message EndpointPort { // name represents the name of this port. All ports in an EndpointSlice must have a unique name. - // If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. + // If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. // Name must either be an empty string or pass DNS_LABEL validation: // * must be no more than 63 characters long. // * must consist of lower case alphanumeric characters or '-'. diff --git a/upstream/vendor/k8s.io/api/discovery/v1beta1/types.go b/upstream/vendor/k8s.io/api/discovery/v1beta1/types.go index defd8e2ce69..f09f7f320cd 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1beta1/types.go +++ b/upstream/vendor/k8s.io/api/discovery/v1beta1/types.go @@ -172,7 +172,7 @@ type ForZone struct { // EndpointPort represents a Port used by an EndpointSlice type EndpointPort struct { // name represents the name of this port. All ports in an EndpointSlice must have a unique name. - // If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. + // If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. // Name must either be an empty string or pass DNS_LABEL validation: // * must be no more than 63 characters long. // * must consist of lower case alphanumeric characters or '-'. diff --git a/upstream/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go index 847d4d58e06..b1d4c306ccd 100644 --- a/upstream/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -64,7 +64,7 @@ func (EndpointHints) SwaggerDoc() map[string]string { var map_EndpointPort = map[string]string{ "": "EndpointPort represents a Port used by an EndpointSlice", - "name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", + "name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", "protocol": "protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", "port": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", "appProtocol": "appProtocol represents the application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/doc.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go similarity index 73% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/doc.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go index 1bc51d40665..a3d4d0c6075 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/doc.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,8 +17,9 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=true +// +k8s:prerelease-lifecycle-gen=true // +groupName=flowcontrol.apiserver.k8s.io -// Package v1 holds api types of version v1 for group "flowcontrol.apiserver.k8s.io". -package v1 // import "k8s.io/api/flowcontrol/v1" +// Package v1alpha1 holds api types of version v1alpha1 for group "flowcontrol.apiserver.k8s.io". +package v1alpha1 // import "k8s.io/api/flowcontrol/v1alpha1" diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go similarity index 91% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go index c235ba10dee..b54e1ceefbb 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go @@ -15,9 +15,9 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1/generated.proto +// source: k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto -package v1 +package v1alpha1 import ( fmt "fmt" @@ -46,7 +46,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *ExemptPriorityLevelConfiguration) Reset() { *m = ExemptPriorityLevelConfiguration{} } func (*ExemptPriorityLevelConfiguration) ProtoMessage() {} func (*ExemptPriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{0} + return fileDescriptor_45ba024d525b289b, []int{0} } func (m *ExemptPriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -74,7 +74,7 @@ var xxx_messageInfo_ExemptPriorityLevelConfiguration proto.InternalMessageInfo func (m *FlowDistinguisherMethod) Reset() { *m = FlowDistinguisherMethod{} } func (*FlowDistinguisherMethod) ProtoMessage() {} func (*FlowDistinguisherMethod) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{1} + return fileDescriptor_45ba024d525b289b, []int{1} } func (m *FlowDistinguisherMethod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -102,7 +102,7 @@ var xxx_messageInfo_FlowDistinguisherMethod proto.InternalMessageInfo func (m *FlowSchema) Reset() { *m = FlowSchema{} } func (*FlowSchema) ProtoMessage() {} func (*FlowSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{2} + return fileDescriptor_45ba024d525b289b, []int{2} } func (m *FlowSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +130,7 @@ var xxx_messageInfo_FlowSchema proto.InternalMessageInfo func (m *FlowSchemaCondition) Reset() { *m = FlowSchemaCondition{} } func (*FlowSchemaCondition) ProtoMessage() {} func (*FlowSchemaCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{3} + return fileDescriptor_45ba024d525b289b, []int{3} } func (m *FlowSchemaCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,7 +158,7 @@ var xxx_messageInfo_FlowSchemaCondition proto.InternalMessageInfo func (m *FlowSchemaList) Reset() { *m = FlowSchemaList{} } func (*FlowSchemaList) ProtoMessage() {} func (*FlowSchemaList) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{4} + return fileDescriptor_45ba024d525b289b, []int{4} } func (m *FlowSchemaList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -186,7 +186,7 @@ var xxx_messageInfo_FlowSchemaList proto.InternalMessageInfo func (m *FlowSchemaSpec) Reset() { *m = FlowSchemaSpec{} } func (*FlowSchemaSpec) ProtoMessage() {} func (*FlowSchemaSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{5} + return fileDescriptor_45ba024d525b289b, []int{5} } func (m *FlowSchemaSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -214,7 +214,7 @@ var xxx_messageInfo_FlowSchemaSpec proto.InternalMessageInfo func (m *FlowSchemaStatus) Reset() { *m = FlowSchemaStatus{} } func (*FlowSchemaStatus) ProtoMessage() {} func (*FlowSchemaStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{6} + return fileDescriptor_45ba024d525b289b, []int{6} } func (m *FlowSchemaStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -242,7 +242,7 @@ var xxx_messageInfo_FlowSchemaStatus proto.InternalMessageInfo func (m *GroupSubject) Reset() { *m = GroupSubject{} } func (*GroupSubject) ProtoMessage() {} func (*GroupSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{7} + return fileDescriptor_45ba024d525b289b, []int{7} } func (m *GroupSubject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -270,7 +270,7 @@ var xxx_messageInfo_GroupSubject proto.InternalMessageInfo func (m *LimitResponse) Reset() { *m = LimitResponse{} } func (*LimitResponse) ProtoMessage() {} func (*LimitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{8} + return fileDescriptor_45ba024d525b289b, []int{8} } func (m *LimitResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,7 +298,7 @@ var xxx_messageInfo_LimitResponse proto.InternalMessageInfo func (m *LimitedPriorityLevelConfiguration) Reset() { *m = LimitedPriorityLevelConfiguration{} } func (*LimitedPriorityLevelConfiguration) ProtoMessage() {} func (*LimitedPriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{9} + return fileDescriptor_45ba024d525b289b, []int{9} } func (m *LimitedPriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -326,7 +326,7 @@ var xxx_messageInfo_LimitedPriorityLevelConfiguration proto.InternalMessageInfo func (m *NonResourcePolicyRule) Reset() { *m = NonResourcePolicyRule{} } func (*NonResourcePolicyRule) ProtoMessage() {} func (*NonResourcePolicyRule) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{10} + return fileDescriptor_45ba024d525b289b, []int{10} } func (m *NonResourcePolicyRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -354,7 +354,7 @@ var xxx_messageInfo_NonResourcePolicyRule proto.InternalMessageInfo func (m *PolicyRulesWithSubjects) Reset() { *m = PolicyRulesWithSubjects{} } func (*PolicyRulesWithSubjects) ProtoMessage() {} func (*PolicyRulesWithSubjects) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{11} + return fileDescriptor_45ba024d525b289b, []int{11} } func (m *PolicyRulesWithSubjects) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -382,7 +382,7 @@ var xxx_messageInfo_PolicyRulesWithSubjects proto.InternalMessageInfo func (m *PriorityLevelConfiguration) Reset() { *m = PriorityLevelConfiguration{} } func (*PriorityLevelConfiguration) ProtoMessage() {} func (*PriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{12} + return fileDescriptor_45ba024d525b289b, []int{12} } func (m *PriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -410,7 +410,7 @@ var xxx_messageInfo_PriorityLevelConfiguration proto.InternalMessageInfo func (m *PriorityLevelConfigurationCondition) Reset() { *m = PriorityLevelConfigurationCondition{} } func (*PriorityLevelConfigurationCondition) ProtoMessage() {} func (*PriorityLevelConfigurationCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{13} + return fileDescriptor_45ba024d525b289b, []int{13} } func (m *PriorityLevelConfigurationCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -438,7 +438,7 @@ var xxx_messageInfo_PriorityLevelConfigurationCondition proto.InternalMessageInf func (m *PriorityLevelConfigurationList) Reset() { *m = PriorityLevelConfigurationList{} } func (*PriorityLevelConfigurationList) ProtoMessage() {} func (*PriorityLevelConfigurationList) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{14} + return fileDescriptor_45ba024d525b289b, []int{14} } func (m *PriorityLevelConfigurationList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -466,7 +466,7 @@ var xxx_messageInfo_PriorityLevelConfigurationList proto.InternalMessageInfo func (m *PriorityLevelConfigurationReference) Reset() { *m = PriorityLevelConfigurationReference{} } func (*PriorityLevelConfigurationReference) ProtoMessage() {} func (*PriorityLevelConfigurationReference) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{15} + return fileDescriptor_45ba024d525b289b, []int{15} } func (m *PriorityLevelConfigurationReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -494,7 +494,7 @@ var xxx_messageInfo_PriorityLevelConfigurationReference proto.InternalMessageInf func (m *PriorityLevelConfigurationSpec) Reset() { *m = PriorityLevelConfigurationSpec{} } func (*PriorityLevelConfigurationSpec) ProtoMessage() {} func (*PriorityLevelConfigurationSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{16} + return fileDescriptor_45ba024d525b289b, []int{16} } func (m *PriorityLevelConfigurationSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -522,7 +522,7 @@ var xxx_messageInfo_PriorityLevelConfigurationSpec proto.InternalMessageInfo func (m *PriorityLevelConfigurationStatus) Reset() { *m = PriorityLevelConfigurationStatus{} } func (*PriorityLevelConfigurationStatus) ProtoMessage() {} func (*PriorityLevelConfigurationStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{17} + return fileDescriptor_45ba024d525b289b, []int{17} } func (m *PriorityLevelConfigurationStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -550,7 +550,7 @@ var xxx_messageInfo_PriorityLevelConfigurationStatus proto.InternalMessageInfo func (m *QueuingConfiguration) Reset() { *m = QueuingConfiguration{} } func (*QueuingConfiguration) ProtoMessage() {} func (*QueuingConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{18} + return fileDescriptor_45ba024d525b289b, []int{18} } func (m *QueuingConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +578,7 @@ var xxx_messageInfo_QueuingConfiguration proto.InternalMessageInfo func (m *ResourcePolicyRule) Reset() { *m = ResourcePolicyRule{} } func (*ResourcePolicyRule) ProtoMessage() {} func (*ResourcePolicyRule) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{19} + return fileDescriptor_45ba024d525b289b, []int{19} } func (m *ResourcePolicyRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -606,7 +606,7 @@ var xxx_messageInfo_ResourcePolicyRule proto.InternalMessageInfo func (m *ServiceAccountSubject) Reset() { *m = ServiceAccountSubject{} } func (*ServiceAccountSubject) ProtoMessage() {} func (*ServiceAccountSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{20} + return fileDescriptor_45ba024d525b289b, []int{20} } func (m *ServiceAccountSubject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -634,7 +634,7 @@ var xxx_messageInfo_ServiceAccountSubject proto.InternalMessageInfo func (m *Subject) Reset() { *m = Subject{} } func (*Subject) ProtoMessage() {} func (*Subject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{21} + return fileDescriptor_45ba024d525b289b, []int{21} } func (m *Subject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -662,7 +662,7 @@ var xxx_messageInfo_Subject proto.InternalMessageInfo func (m *UserSubject) Reset() { *m = UserSubject{} } func (*UserSubject) ProtoMessage() {} func (*UserSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{22} + return fileDescriptor_45ba024d525b289b, []int{22} } func (m *UserSubject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -688,137 +688,139 @@ func (m *UserSubject) XXX_DiscardUnknown() { var xxx_messageInfo_UserSubject proto.InternalMessageInfo func init() { - proto.RegisterType((*ExemptPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.ExemptPriorityLevelConfiguration") - proto.RegisterType((*FlowDistinguisherMethod)(nil), "k8s.io.api.flowcontrol.v1.FlowDistinguisherMethod") - proto.RegisterType((*FlowSchema)(nil), "k8s.io.api.flowcontrol.v1.FlowSchema") - proto.RegisterType((*FlowSchemaCondition)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaCondition") - proto.RegisterType((*FlowSchemaList)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaList") - proto.RegisterType((*FlowSchemaSpec)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaSpec") - proto.RegisterType((*FlowSchemaStatus)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaStatus") - proto.RegisterType((*GroupSubject)(nil), "k8s.io.api.flowcontrol.v1.GroupSubject") - proto.RegisterType((*LimitResponse)(nil), "k8s.io.api.flowcontrol.v1.LimitResponse") - proto.RegisterType((*LimitedPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.LimitedPriorityLevelConfiguration") - proto.RegisterType((*NonResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1.NonResourcePolicyRule") - proto.RegisterType((*PolicyRulesWithSubjects)(nil), "k8s.io.api.flowcontrol.v1.PolicyRulesWithSubjects") - proto.RegisterType((*PriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfiguration") - proto.RegisterType((*PriorityLevelConfigurationCondition)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationCondition") - proto.RegisterType((*PriorityLevelConfigurationList)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationList") - proto.RegisterType((*PriorityLevelConfigurationReference)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationReference") - proto.RegisterType((*PriorityLevelConfigurationSpec)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationSpec") - proto.RegisterType((*PriorityLevelConfigurationStatus)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationStatus") - proto.RegisterType((*QueuingConfiguration)(nil), "k8s.io.api.flowcontrol.v1.QueuingConfiguration") - proto.RegisterType((*ResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1.ResourcePolicyRule") - proto.RegisterType((*ServiceAccountSubject)(nil), "k8s.io.api.flowcontrol.v1.ServiceAccountSubject") - proto.RegisterType((*Subject)(nil), "k8s.io.api.flowcontrol.v1.Subject") - proto.RegisterType((*UserSubject)(nil), "k8s.io.api.flowcontrol.v1.UserSubject") + proto.RegisterType((*ExemptPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.ExemptPriorityLevelConfiguration") + proto.RegisterType((*FlowDistinguisherMethod)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowDistinguisherMethod") + proto.RegisterType((*FlowSchema)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchema") + proto.RegisterType((*FlowSchemaCondition)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaCondition") + proto.RegisterType((*FlowSchemaList)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaList") + proto.RegisterType((*FlowSchemaSpec)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaSpec") + proto.RegisterType((*FlowSchemaStatus)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaStatus") + proto.RegisterType((*GroupSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.GroupSubject") + proto.RegisterType((*LimitResponse)(nil), "k8s.io.api.flowcontrol.v1alpha1.LimitResponse") + proto.RegisterType((*LimitedPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration") + proto.RegisterType((*NonResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1alpha1.NonResourcePolicyRule") + proto.RegisterType((*PolicyRulesWithSubjects)(nil), "k8s.io.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects") + proto.RegisterType((*PriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfiguration") + proto.RegisterType((*PriorityLevelConfigurationCondition)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition") + proto.RegisterType((*PriorityLevelConfigurationList)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationList") + proto.RegisterType((*PriorityLevelConfigurationReference)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference") + proto.RegisterType((*PriorityLevelConfigurationSpec)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec") + proto.RegisterType((*PriorityLevelConfigurationStatus)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus") + proto.RegisterType((*QueuingConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.QueuingConfiguration") + proto.RegisterType((*ResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1alpha1.ResourcePolicyRule") + proto.RegisterType((*ServiceAccountSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.ServiceAccountSubject") + proto.RegisterType((*Subject)(nil), "k8s.io.api.flowcontrol.v1alpha1.Subject") + proto.RegisterType((*UserSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.UserSubject") } func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1/generated.proto", fileDescriptor_f8a25df358697d27) -} - -var fileDescriptor_f8a25df358697d27 = []byte{ - // 1588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4b, 0x73, 0x1b, 0xc5, - 0x16, 0xb6, 0x64, 0xc9, 0xb6, 0x8e, 0x9f, 0x69, 0xc7, 0x65, 0xc5, 0xb9, 0x25, 0x39, 0x73, 0xeb, - 0xe6, 0x71, 0x43, 0xa4, 0xc4, 0x45, 0x20, 0xa9, 0x00, 0xa9, 0x4c, 0x12, 0xf2, 0xb2, 0x1d, 0xa7, - 0x95, 0x07, 0x15, 0xa8, 0x82, 0xd1, 0xa8, 0x2d, 0x4d, 0x2c, 0xcd, 0x0c, 0xdd, 0x33, 0x32, 0xa6, - 0x8a, 0x2a, 0x7e, 0x42, 0x56, 0x2c, 0x59, 0xc0, 0x3f, 0x60, 0x45, 0xc1, 0x86, 0x65, 0x76, 0x64, - 0x19, 0x58, 0xa8, 0x88, 0xf8, 0x0b, 0x2c, 0x20, 0x2b, 0xaa, 0x7b, 0x7a, 0x66, 0x34, 0x92, 0x66, - 0xac, 0xf2, 0x22, 0x6c, 0xd8, 0x79, 0xce, 0xf9, 0xce, 0x77, 0xba, 0x4f, 0x9f, 0x97, 0x0c, 0xea, - 0xce, 0x05, 0x56, 0x32, 0xac, 0xf2, 0x8e, 0x5b, 0x25, 0xd4, 0x24, 0x0e, 0x61, 0xe5, 0x36, 0x31, - 0x6b, 0x16, 0x2d, 0x4b, 0x85, 0x66, 0x1b, 0xe5, 0xed, 0xa6, 0xb5, 0xab, 0x5b, 0xa6, 0x43, 0xad, - 0x66, 0xb9, 0x7d, 0xae, 0x5c, 0x27, 0x26, 0xa1, 0x9a, 0x43, 0x6a, 0x25, 0x9b, 0x5a, 0x8e, 0x85, - 0x8e, 0x78, 0xd0, 0x92, 0x66, 0x1b, 0xa5, 0x1e, 0x68, 0xa9, 0x7d, 0x6e, 0xe5, 0x4c, 0xdd, 0x70, - 0x1a, 0x6e, 0xb5, 0xa4, 0x5b, 0xad, 0x72, 0xdd, 0xaa, 0x5b, 0x65, 0x61, 0x51, 0x75, 0xb7, 0xc5, - 0x97, 0xf8, 0x10, 0x7f, 0x79, 0x4c, 0x2b, 0x6f, 0x86, 0x4e, 0x5b, 0x9a, 0xde, 0x30, 0x4c, 0x42, - 0xf7, 0xca, 0xf6, 0x4e, 0x9d, 0x0b, 0x58, 0xb9, 0x45, 0x1c, 0x6d, 0x88, 0xff, 0x95, 0x72, 0x9c, - 0x15, 0x75, 0x4d, 0xc7, 0x68, 0x91, 0x01, 0x83, 0xb7, 0xf6, 0x33, 0x60, 0x7a, 0x83, 0xb4, 0xb4, - 0x7e, 0x3b, 0xe5, 0xc7, 0x14, 0xac, 0x5e, 0xff, 0x8c, 0xb4, 0x6c, 0x67, 0x8b, 0x1a, 0x16, 0x35, - 0x9c, 0xbd, 0x75, 0xd2, 0x26, 0xcd, 0xab, 0x96, 0xb9, 0x6d, 0xd4, 0x5d, 0xaa, 0x39, 0x86, 0x65, - 0xa2, 0x0f, 0x20, 0x6f, 0x5a, 0x2d, 0xc3, 0xd4, 0xb8, 0x5c, 0x77, 0x29, 0x25, 0xa6, 0xbe, 0x57, - 0x69, 0x68, 0x94, 0xb0, 0x7c, 0x6a, 0x35, 0x75, 0x32, 0xab, 0xfe, 0xa7, 0xdb, 0x29, 0xe6, 0x37, - 0x63, 0x30, 0x38, 0xd6, 0x1a, 0xbd, 0x0b, 0xf3, 0x4d, 0x62, 0xd6, 0xb4, 0x6a, 0x93, 0x6c, 0x11, - 0xaa, 0x13, 0xd3, 0xc9, 0xa7, 0x05, 0xe1, 0x62, 0xb7, 0x53, 0x9c, 0x5f, 0x8f, 0xaa, 0x70, 0x3f, - 0x56, 0x79, 0x0c, 0xcb, 0xef, 0x37, 0xad, 0xdd, 0x6b, 0x06, 0x73, 0x0c, 0xb3, 0xee, 0x1a, 0xac, - 0x41, 0xe8, 0x06, 0x71, 0x1a, 0x56, 0x0d, 0x5d, 0x86, 0x8c, 0xb3, 0x67, 0x13, 0x71, 0xbe, 0x9c, - 0x7a, 0xfa, 0x59, 0xa7, 0x38, 0xd6, 0xed, 0x14, 0x33, 0xf7, 0xf7, 0x6c, 0xf2, 0xaa, 0x53, 0x3c, - 0x1a, 0x63, 0xc6, 0xd5, 0x58, 0x18, 0x2a, 0x4f, 0xd3, 0x00, 0x1c, 0x55, 0x11, 0x81, 0x43, 0x9f, - 0xc0, 0x14, 0x7f, 0xac, 0x9a, 0xe6, 0x68, 0x82, 0x73, 0x7a, 0xed, 0x6c, 0x29, 0x4c, 0x92, 0x20, - 0xe6, 0x25, 0x7b, 0xa7, 0xce, 0x05, 0xac, 0xc4, 0xd1, 0xa5, 0xf6, 0xb9, 0xd2, 0xdd, 0xea, 0x13, - 0xa2, 0x3b, 0x1b, 0xc4, 0xd1, 0x54, 0x24, 0x4f, 0x01, 0xa1, 0x0c, 0x07, 0xac, 0xe8, 0x0e, 0x64, - 0x98, 0x4d, 0x74, 0x11, 0x80, 0xe9, 0xb5, 0x53, 0xa5, 0xd8, 0x14, 0x2c, 0x85, 0xc7, 0xaa, 0xd8, - 0x44, 0x57, 0x67, 0xfc, 0xcb, 0xf1, 0x2f, 0x2c, 0x48, 0x50, 0x05, 0x26, 0x98, 0xa3, 0x39, 0x2e, - 0xcb, 0x8f, 0x0b, 0xba, 0xd3, 0xa3, 0xd1, 0x09, 0x13, 0x75, 0x4e, 0x12, 0x4e, 0x78, 0xdf, 0x58, - 0x52, 0x29, 0x2f, 0xd2, 0xb0, 0x18, 0x82, 0xaf, 0x5a, 0x66, 0xcd, 0x10, 0xf9, 0x71, 0x29, 0x12, - 0xeb, 0x13, 0x7d, 0xb1, 0x5e, 0x1e, 0x62, 0x12, 0xc6, 0x19, 0x5d, 0x0c, 0x4e, 0x9a, 0x16, 0xe6, - 0xc7, 0xa2, 0xce, 0x5f, 0x75, 0x8a, 0xf3, 0x81, 0x59, 0xf4, 0x3c, 0xa8, 0x0d, 0xa8, 0xa9, 0x31, - 0xe7, 0x3e, 0xd5, 0x4c, 0xe6, 0xd1, 0x1a, 0x2d, 0x22, 0x2f, 0xfc, 0xff, 0xd1, 0x5e, 0x87, 0x5b, - 0xa8, 0x2b, 0xd2, 0x25, 0x5a, 0x1f, 0x60, 0xc3, 0x43, 0x3c, 0xa0, 0xe3, 0x30, 0x41, 0x89, 0xc6, - 0x2c, 0x33, 0x9f, 0x11, 0x47, 0x0e, 0xe2, 0x85, 0x85, 0x14, 0x4b, 0x2d, 0x3a, 0x05, 0x93, 0x2d, - 0xc2, 0x98, 0x56, 0x27, 0xf9, 0xac, 0x00, 0xce, 0x4b, 0xe0, 0xe4, 0x86, 0x27, 0xc6, 0xbe, 0x5e, - 0xf9, 0x21, 0x05, 0x73, 0x61, 0x9c, 0xd6, 0x0d, 0xe6, 0xa0, 0x8f, 0x06, 0x32, 0xae, 0x34, 0xda, - 0x9d, 0xb8, 0xb5, 0xc8, 0xb7, 0x05, 0xe9, 0x6e, 0xca, 0x97, 0xf4, 0x64, 0xdb, 0x6d, 0xc8, 0x1a, - 0x0e, 0x69, 0xf1, 0xa8, 0x8f, 0x9f, 0x9c, 0x5e, 0xfb, 0xdf, 0x48, 0xf9, 0xa1, 0xce, 0x4a, 0xc6, - 0xec, 0x2d, 0x6e, 0x8b, 0x3d, 0x0a, 0xe5, 0x97, 0xf1, 0xde, 0xc3, 0xf3, 0x2c, 0x44, 0xdf, 0xa4, - 0x60, 0xc5, 0x8e, 0xed, 0x28, 0xf2, 0x3e, 0xef, 0x25, 0x38, 0x8d, 0x6f, 0x47, 0x98, 0x6c, 0x13, - 0xde, 0x43, 0x88, 0xaa, 0xc8, 0xd3, 0xac, 0x24, 0x80, 0x13, 0x4e, 0x81, 0x6e, 0x03, 0x6a, 0x69, - 0x0e, 0x8f, 0x63, 0x7d, 0x8b, 0x12, 0x9d, 0xd4, 0x38, 0xab, 0x6c, 0x40, 0x41, 0x4e, 0x6c, 0x0c, - 0x20, 0xf0, 0x10, 0x2b, 0xf4, 0x05, 0x2c, 0xd6, 0x06, 0xfb, 0x89, 0x4c, 0xc6, 0xb5, 0x7d, 0xa2, - 0x3b, 0xa4, 0x13, 0xa9, 0xcb, 0xdd, 0x4e, 0x71, 0x71, 0x88, 0x02, 0x0f, 0xf3, 0x83, 0x1e, 0x41, - 0x96, 0xba, 0x4d, 0xc2, 0xf2, 0x19, 0xf1, 0x9c, 0x49, 0x0e, 0xb7, 0xac, 0xa6, 0xa1, 0xef, 0x61, - 0x8e, 0x7e, 0x64, 0x38, 0x8d, 0x8a, 0x2b, 0x9a, 0x11, 0x0b, 0xdf, 0x56, 0xa8, 0xb0, 0xc7, 0xa7, - 0xb4, 0x61, 0xa1, 0xbf, 0x3f, 0xa0, 0x2a, 0x80, 0xee, 0x97, 0x24, 0x9f, 0x00, 0xe3, 0x7d, 0xb9, - 0x19, 0x9f, 0x40, 0x41, 0x25, 0x87, 0xbd, 0x30, 0x10, 0x31, 0xdc, 0xc3, 0xaa, 0x9c, 0x85, 0x99, - 0x1b, 0xd4, 0x72, 0x6d, 0x79, 0x3c, 0xb4, 0x0a, 0x19, 0x53, 0x6b, 0xf9, 0x3d, 0x26, 0x68, 0x79, - 0x9b, 0x5a, 0x8b, 0x60, 0xa1, 0x51, 0xbe, 0x4e, 0xc1, 0xec, 0xba, 0xd1, 0x32, 0x1c, 0x4c, 0x98, - 0x6d, 0x99, 0x8c, 0xa0, 0xf3, 0x91, 0xbe, 0x74, 0xac, 0xaf, 0x2f, 0x1d, 0x8a, 0x80, 0x7b, 0x3a, - 0xd2, 0x43, 0x98, 0xfc, 0xd4, 0x25, 0xae, 0x61, 0xd6, 0x65, 0x2f, 0x2e, 0x27, 0xdc, 0xed, 0x9e, - 0x87, 0x8c, 0x24, 0x96, 0x3a, 0xcd, 0x6b, 0x5c, 0x6a, 0xb0, 0x4f, 0xa6, 0xfc, 0x91, 0x86, 0x63, - 0xc2, 0x27, 0xa9, 0xfd, 0x23, 0xc3, 0x96, 0xc0, 0x6c, 0xb3, 0xf7, 0xca, 0xf2, 0x76, 0x27, 0x13, - 0x6e, 0x17, 0x09, 0x91, 0xba, 0x24, 0x23, 0x18, 0x0d, 0x33, 0x8e, 0xb2, 0x0e, 0x9b, 0xe9, 0xe3, - 0xa3, 0xcf, 0x74, 0x74, 0x17, 0x96, 0xaa, 0x16, 0xa5, 0xd6, 0xae, 0x61, 0xd6, 0x85, 0x1f, 0x9f, - 0x24, 0x23, 0x48, 0x8e, 0x74, 0x3b, 0xc5, 0x25, 0x75, 0x18, 0x00, 0x0f, 0xb7, 0x53, 0x76, 0x61, - 0x69, 0x93, 0x77, 0x0d, 0x66, 0xb9, 0x54, 0x27, 0x61, 0xf6, 0xa3, 0x22, 0x64, 0xdb, 0x84, 0x56, - 0xbd, 0x0c, 0xce, 0xa9, 0x39, 0x9e, 0xfb, 0x0f, 0xb9, 0x00, 0x7b, 0x72, 0x7e, 0x13, 0x33, 0xb4, - 0x7c, 0x80, 0xd7, 0x59, 0x7e, 0x42, 0x40, 0xc5, 0x4d, 0x36, 0xa3, 0x2a, 0xdc, 0x8f, 0x55, 0x7e, - 0x4e, 0xc3, 0x72, 0x4c, 0xb1, 0xa1, 0x2d, 0x98, 0x62, 0xf2, 0x6f, 0x59, 0x40, 0x4a, 0xc2, 0x33, - 0x48, 0xb3, 0xb0, 0xa1, 0xfb, 0x3c, 0x38, 0x60, 0x41, 0x4f, 0x60, 0x96, 0x4a, 0xef, 0xc2, 0x9d, - 0x6c, 0xec, 0x67, 0x12, 0x68, 0x07, 0x63, 0x12, 0x3e, 0x31, 0xee, 0xe5, 0xc2, 0x51, 0x6a, 0xd4, - 0x86, 0x85, 0x9e, 0xcb, 0x7a, 0xee, 0xc6, 0x85, 0xbb, 0xb3, 0x09, 0xee, 0x86, 0xbe, 0x82, 0x9a, - 0x97, 0x1e, 0x17, 0x36, 0xfb, 0x18, 0xf1, 0x80, 0x0f, 0xe5, 0xa7, 0x34, 0x24, 0xf4, 0xfa, 0xd7, - 0xb0, 0xa3, 0x7d, 0x18, 0xd9, 0xd1, 0x2e, 0x1e, 0x68, 0x7e, 0xc5, 0xee, 0x6c, 0x7a, 0xdf, 0xce, - 0x76, 0xe9, 0x60, 0xf4, 0xc9, 0x3b, 0xdc, 0x9f, 0x69, 0xf8, 0x6f, 0xbc, 0x71, 0xb8, 0xd3, 0xdd, - 0x89, 0xf4, 0xce, 0xb7, 0xfb, 0x7a, 0xe7, 0x89, 0x11, 0x28, 0xfe, 0xdd, 0xf1, 0xfa, 0x76, 0xbc, - 0x5f, 0x53, 0x50, 0x88, 0x8f, 0xdb, 0x6b, 0xd8, 0xf9, 0x1e, 0x47, 0x77, 0xbe, 0xf3, 0x07, 0xca, - 0xaf, 0x98, 0x1d, 0xf0, 0x46, 0x52, 0x5a, 0x05, 0x2b, 0xdb, 0x08, 0x63, 0xfc, 0xdb, 0x74, 0x52, - 0x94, 0xc4, 0x72, 0xb9, 0xcf, 0xef, 0x8d, 0x88, 0xf5, 0x75, 0x93, 0x0f, 0x97, 0x16, 0x9f, 0x0f, - 0x5e, 0x2e, 0xea, 0x30, 0xd9, 0xf4, 0x86, 0xb0, 0xac, 0xe2, 0x77, 0xf6, 0x9b, 0x7f, 0x49, 0xe3, - 0xda, 0x1b, 0xf5, 0x12, 0x86, 0x7d, 0x66, 0xf4, 0x31, 0x4c, 0x10, 0xf1, 0xab, 0x7a, 0x84, 0x52, - 0xde, 0xef, 0xe7, 0xb7, 0x0a, 0x3c, 0xed, 0x3c, 0x14, 0x96, 0xb4, 0xca, 0x57, 0x29, 0x58, 0xdd, - 0xaf, 0x07, 0x20, 0x3a, 0x64, 0x4f, 0x3b, 0xd8, 0xce, 0x3d, 0xfa, 0xde, 0xf6, 0x5d, 0x0a, 0x0e, - 0x0f, 0xdb, 0x89, 0x78, 0x41, 0xf1, 0x45, 0x28, 0xd8, 0x62, 0x82, 0x82, 0xba, 0x27, 0xa4, 0x58, - 0x6a, 0xd1, 0x1b, 0x30, 0xd5, 0xd0, 0xcc, 0x5a, 0xc5, 0xf8, 0xdc, 0x5f, 0xc5, 0x83, 0x94, 0xbe, - 0x29, 0xe5, 0x38, 0x40, 0xa0, 0x6b, 0xb0, 0x20, 0xec, 0xd6, 0x89, 0x59, 0x77, 0x1a, 0xe2, 0x1d, - 0xe4, 0xb6, 0x11, 0xcc, 0x95, 0x7b, 0x7d, 0x7a, 0x3c, 0x60, 0xa1, 0xfc, 0x95, 0x02, 0x74, 0x90, - 0x05, 0xe1, 0x34, 0xe4, 0x34, 0xdb, 0x10, 0x7b, 0xaa, 0x57, 0x54, 0x39, 0x75, 0xb6, 0xdb, 0x29, - 0xe6, 0xae, 0x6c, 0xdd, 0xf2, 0x84, 0x38, 0xd4, 0x73, 0xb0, 0x3f, 0x45, 0xbd, 0x69, 0x29, 0xc1, - 0xbe, 0x63, 0x86, 0x43, 0x3d, 0xba, 0x00, 0x33, 0x7a, 0xd3, 0x65, 0x0e, 0xa1, 0x15, 0xdd, 0xb2, - 0x89, 0x68, 0x42, 0x53, 0xea, 0x61, 0x79, 0xa7, 0x99, 0xab, 0x3d, 0x3a, 0x1c, 0x41, 0xa2, 0x12, - 0x00, 0xaf, 0x23, 0x66, 0x6b, 0xdc, 0x4f, 0x56, 0xf8, 0x99, 0xe3, 0x0f, 0xb6, 0x19, 0x48, 0x71, - 0x0f, 0x42, 0x79, 0x02, 0x4b, 0x15, 0x42, 0xdb, 0x86, 0x4e, 0xae, 0xe8, 0xba, 0xe5, 0x9a, 0x8e, - 0xbf, 0x71, 0x97, 0x21, 0x17, 0xc0, 0x64, 0xa9, 0x1d, 0x92, 0xfe, 0x73, 0x01, 0x17, 0x0e, 0x31, - 0x41, 0x6d, 0xa7, 0x63, 0x6b, 0xfb, 0xfb, 0x34, 0x4c, 0x86, 0xf4, 0x99, 0x1d, 0xc3, 0xac, 0x49, - 0xe6, 0xa3, 0x3e, 0xfa, 0x8e, 0x61, 0xd6, 0x5e, 0x75, 0x8a, 0xd3, 0x12, 0xc6, 0x3f, 0xb1, 0x00, - 0xa2, 0x6b, 0x90, 0x71, 0x19, 0xa1, 0xb2, 0x6a, 0x8f, 0x27, 0xe4, 0xf1, 0x03, 0x46, 0xa8, 0xbf, - 0x32, 0x4d, 0x71, 0x52, 0x2e, 0xc0, 0xc2, 0x1a, 0xdd, 0x84, 0x6c, 0x9d, 0xbf, 0x87, 0x2c, 0xcc, - 0x13, 0x09, 0x34, 0xbd, 0xbf, 0x3f, 0xbc, 0xc7, 0x17, 0x12, 0xec, 0x11, 0xa0, 0x26, 0xcc, 0xb1, - 0x48, 0xe0, 0xc4, 0x23, 0x25, 0xaf, 0x40, 0x43, 0x23, 0xad, 0xa2, 0x6e, 0xa7, 0x38, 0x17, 0x55, - 0xe1, 0x3e, 0x6e, 0xa5, 0x0c, 0xd3, 0x3d, 0xd7, 0xda, 0xbf, 0x8f, 0xaa, 0x97, 0x9f, 0xbd, 0x2c, - 0x8c, 0x3d, 0x7f, 0x59, 0x18, 0x7b, 0xf1, 0xb2, 0x30, 0xf6, 0x65, 0xb7, 0x90, 0x7a, 0xd6, 0x2d, - 0xa4, 0x9e, 0x77, 0x0b, 0xa9, 0x17, 0xdd, 0x42, 0xea, 0xb7, 0x6e, 0x21, 0xf5, 0xf4, 0xf7, 0xc2, - 0xd8, 0xe3, 0x23, 0xb1, 0xff, 0x13, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x0a, 0x3e, 0x83, - 0x48, 0x15, 0x00, 0x00, + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto", fileDescriptor_45ba024d525b289b) +} + +var fileDescriptor_45ba024d525b289b = []byte{ + // 1621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6f, 0xdb, 0x46, + 0x1a, 0x36, 0x65, 0xc9, 0xb6, 0xc6, 0x9f, 0x19, 0xc7, 0xb0, 0xd6, 0x59, 0x48, 0x0e, 0x17, 0xd8, + 0x64, 0x37, 0x09, 0x15, 0x67, 0x93, 0x6c, 0x16, 0xc1, 0x22, 0x30, 0x93, 0x6c, 0xbe, 0x6c, 0xc7, + 0x1e, 0x27, 0xd9, 0x36, 0x48, 0x81, 0xd0, 0xd4, 0x58, 0x9a, 0x58, 0x22, 0xd9, 0x19, 0x52, 0x8e, + 0x8b, 0x1c, 0x0a, 0xf4, 0x0f, 0xf4, 0x07, 0xe4, 0xd8, 0x43, 0x6f, 0x05, 0x7a, 0xed, 0xa5, 0xc7, + 0xa0, 0xe8, 0x21, 0xc7, 0x9c, 0x84, 0x58, 0xbd, 0xf6, 0x07, 0xb4, 0x39, 0x14, 0xc5, 0x0c, 0x87, + 0xa4, 0x28, 0x89, 0xa2, 0x52, 0x03, 0x39, 0xf5, 0x66, 0xbe, 0x1f, 0xcf, 0x3b, 0xf3, 0xce, 0xfb, + 0xf1, 0xc8, 0xe0, 0xf6, 0xde, 0x15, 0xa6, 0x11, 0xbb, 0xbc, 0xe7, 0xed, 0x60, 0x6a, 0x61, 0x17, + 0xb3, 0x72, 0x13, 0x5b, 0x15, 0x9b, 0x96, 0xa5, 0xc2, 0x70, 0x48, 0x79, 0xb7, 0x6e, 0xef, 0x9b, + 0xb6, 0xe5, 0x52, 0xbb, 0x5e, 0x6e, 0xae, 0x18, 0x75, 0xa7, 0x66, 0xac, 0x94, 0xab, 0xd8, 0xc2, + 0xd4, 0x70, 0x71, 0x45, 0x73, 0xa8, 0xed, 0xda, 0xb0, 0xe4, 0x3b, 0x68, 0x86, 0x43, 0xb4, 0x0e, + 0x07, 0x2d, 0x70, 0x58, 0x3a, 0x57, 0x25, 0x6e, 0xcd, 0xdb, 0xd1, 0x4c, 0xbb, 0x51, 0xae, 0xda, + 0x55, 0xbb, 0x2c, 0xfc, 0x76, 0xbc, 0x5d, 0xf1, 0x25, 0x3e, 0xc4, 0x5f, 0x3e, 0xde, 0xd2, 0xc5, + 0xe8, 0x00, 0x0d, 0xc3, 0xac, 0x11, 0x0b, 0xd3, 0x83, 0xb2, 0xb3, 0x57, 0xe5, 0x02, 0x56, 0x6e, + 0x60, 0xd7, 0x28, 0x37, 0x7b, 0x4e, 0xb1, 0x54, 0x4e, 0xf2, 0xa2, 0x9e, 0xe5, 0x92, 0x06, 0xee, + 0x71, 0xb8, 0x9c, 0xe6, 0xc0, 0xcc, 0x1a, 0x6e, 0x18, 0xdd, 0x7e, 0xea, 0x77, 0x0a, 0x58, 0xbe, + 0xf9, 0x1c, 0x37, 0x1c, 0x77, 0x93, 0x12, 0x9b, 0x12, 0xf7, 0x60, 0x0d, 0x37, 0x71, 0xfd, 0xba, + 0x6d, 0xed, 0x92, 0xaa, 0x47, 0x0d, 0x97, 0xd8, 0x16, 0xfc, 0x08, 0x14, 0x2c, 0xbb, 0x41, 0x2c, + 0x83, 0xcb, 0x4d, 0x8f, 0x52, 0x6c, 0x99, 0x07, 0xdb, 0x35, 0x83, 0x62, 0x56, 0x50, 0x96, 0x95, + 0xd3, 0x39, 0xfd, 0xaf, 0xed, 0x56, 0xa9, 0xb0, 0x91, 0x60, 0x83, 0x12, 0xbd, 0xe1, 0x7f, 0xc1, + 0x6c, 0x1d, 0x5b, 0x15, 0x63, 0xa7, 0x8e, 0x37, 0x31, 0x35, 0xb1, 0xe5, 0x16, 0x32, 0x02, 0x70, + 0xbe, 0xdd, 0x2a, 0xcd, 0xae, 0xc5, 0x55, 0xa8, 0xdb, 0x56, 0x7d, 0x0c, 0x16, 0xff, 0x57, 0xb7, + 0xf7, 0x6f, 0x10, 0xe6, 0x12, 0xab, 0xea, 0x11, 0x56, 0xc3, 0x74, 0x1d, 0xbb, 0x35, 0xbb, 0x02, + 0xaf, 0x81, 0xac, 0x7b, 0xe0, 0x60, 0x71, 0xbe, 0xbc, 0x7e, 0xe6, 0x55, 0xab, 0x34, 0xd2, 0x6e, + 0x95, 0xb2, 0x0f, 0x0e, 0x1c, 0xfc, 0xae, 0x55, 0x3a, 0x91, 0xe0, 0xc6, 0xd5, 0x48, 0x38, 0xaa, + 0x2f, 0x33, 0x00, 0x70, 0xab, 0x6d, 0x91, 0x38, 0xf8, 0x14, 0x4c, 0xf0, 0xc7, 0xaa, 0x18, 0xae, + 0x21, 0x30, 0x27, 0x2f, 0x9c, 0xd7, 0xa2, 0x52, 0x09, 0x73, 0xae, 0x39, 0x7b, 0x55, 0x2e, 0x60, + 0x1a, 0xb7, 0xd6, 0x9a, 0x2b, 0xda, 0xfd, 0x9d, 0x67, 0xd8, 0x74, 0xd7, 0xb1, 0x6b, 0xe8, 0x50, + 0x9e, 0x02, 0x44, 0x32, 0x14, 0xa2, 0xc2, 0x2d, 0x90, 0x65, 0x0e, 0x36, 0x45, 0x02, 0x26, 0x2f, + 0x94, 0xb5, 0x94, 0x42, 0xd4, 0xa2, 0xc3, 0x6d, 0x3b, 0xd8, 0xd4, 0xa7, 0x82, 0x2b, 0xf2, 0x2f, + 0x24, 0xa0, 0xe0, 0xc7, 0x60, 0x8c, 0xb9, 0x86, 0xeb, 0xb1, 0xc2, 0xa8, 0x00, 0x5d, 0x79, 0x1f, + 0x50, 0xe1, 0xa8, 0xcf, 0x48, 0xd8, 0x31, 0xff, 0x1b, 0x49, 0x40, 0xf5, 0x4d, 0x06, 0xcc, 0x47, + 0xc6, 0xd7, 0x6d, 0xab, 0x42, 0x44, 0xad, 0x5c, 0x8d, 0xe5, 0xfd, 0x54, 0x57, 0xde, 0x17, 0xfb, + 0xb8, 0x44, 0x39, 0x87, 0xff, 0x09, 0xcf, 0x9b, 0x11, 0xee, 0x27, 0xe3, 0xc1, 0xdf, 0xb5, 0x4a, + 0xb3, 0xa1, 0x5b, 0xfc, 0x3c, 0xb0, 0x09, 0x60, 0xdd, 0x60, 0xee, 0x03, 0x6a, 0x58, 0xcc, 0x87, + 0x25, 0x0d, 0x2c, 0xaf, 0xfd, 0xcf, 0xe1, 0x5e, 0x8a, 0x7b, 0xe8, 0x4b, 0x32, 0x24, 0x5c, 0xeb, + 0x41, 0x43, 0x7d, 0x22, 0xc0, 0xbf, 0x83, 0x31, 0x8a, 0x0d, 0x66, 0x5b, 0x85, 0xac, 0x38, 0x72, + 0x98, 0x2f, 0x24, 0xa4, 0x48, 0x6a, 0xe1, 0x3f, 0xc0, 0x78, 0x03, 0x33, 0x66, 0x54, 0x71, 0x21, + 0x27, 0x0c, 0x67, 0xa5, 0xe1, 0xf8, 0xba, 0x2f, 0x46, 0x81, 0x5e, 0xfd, 0x5e, 0x01, 0x33, 0x51, + 0x9e, 0xd6, 0x08, 0x73, 0xe1, 0x93, 0x9e, 0xea, 0xd3, 0x86, 0xbb, 0x13, 0xf7, 0x16, 0xb5, 0x37, + 0x27, 0xc3, 0x4d, 0x04, 0x92, 0x8e, 0xca, 0xdb, 0x04, 0x39, 0xe2, 0xe2, 0x06, 0xcf, 0xfa, 0xe8, + 0xe9, 0xc9, 0x0b, 0x67, 0xde, 0xa3, 0x4a, 0xf4, 0x69, 0x89, 0x9b, 0xbb, 0xc3, 0x11, 0x90, 0x0f, + 0xa4, 0xfe, 0x3c, 0xda, 0x79, 0x05, 0x5e, 0x91, 0xf0, 0x6b, 0x05, 0x2c, 0x39, 0x89, 0x33, 0x46, + 0xde, 0xea, 0x46, 0x6a, 0xe8, 0xe4, 0x31, 0x85, 0xf0, 0x2e, 0xe6, 0xb3, 0x05, 0xeb, 0xaa, 0x3c, + 0xd3, 0xd2, 0x00, 0xe3, 0x01, 0x67, 0x81, 0x77, 0x01, 0x6c, 0x18, 0x2e, 0xcf, 0x69, 0x75, 0x93, + 0x62, 0x13, 0x57, 0x38, 0xaa, 0x1c, 0x4c, 0x61, 0x7d, 0xac, 0xf7, 0x58, 0xa0, 0x3e, 0x5e, 0xf0, + 0x0b, 0x05, 0xcc, 0x57, 0x7a, 0x07, 0x8d, 0xac, 0xcc, 0x2b, 0x43, 0xa5, 0xba, 0xcf, 0xa0, 0xd2, + 0x17, 0xdb, 0xad, 0xd2, 0x7c, 0x1f, 0x05, 0xea, 0x17, 0x0d, 0x7e, 0x02, 0x72, 0xd4, 0xab, 0x63, + 0x56, 0xc8, 0x8a, 0x17, 0x4e, 0x0f, 0xbb, 0x69, 0xd7, 0x89, 0x79, 0x80, 0xb8, 0xcf, 0xff, 0x89, + 0x5b, 0xdb, 0xf6, 0xc4, 0xc4, 0x62, 0xd1, 0x73, 0x0b, 0x15, 0xf2, 0x51, 0xd5, 0x17, 0x60, 0xae, + 0x7b, 0x70, 0xc0, 0x1a, 0x00, 0x66, 0xd0, 0xab, 0x7c, 0x4d, 0xf0, 0xb8, 0x17, 0xdf, 0xa3, 0xb2, + 0xc2, 0x46, 0x8f, 0xc6, 0x66, 0x28, 0x62, 0xa8, 0x03, 0x5b, 0x3d, 0x0f, 0xa6, 0x6e, 0x51, 0xdb, + 0x73, 0xe4, 0x21, 0xe1, 0x32, 0xc8, 0x5a, 0x46, 0x23, 0x18, 0x41, 0xe1, 0x5c, 0xdc, 0x30, 0x1a, + 0x18, 0x09, 0x8d, 0xfa, 0x95, 0x02, 0xa6, 0xd7, 0x48, 0x83, 0xb8, 0x08, 0x33, 0xc7, 0xb6, 0x18, + 0x86, 0x97, 0x62, 0x63, 0xeb, 0x64, 0xd7, 0xd8, 0x3a, 0x16, 0x33, 0xee, 0x18, 0x58, 0x4f, 0xc0, + 0xf8, 0xa7, 0x1e, 0xf6, 0x88, 0x55, 0x95, 0x63, 0xfb, 0x52, 0xea, 0x0d, 0xb7, 0x7c, 0xfb, 0x58, + 0xc5, 0xe9, 0x93, 0x7c, 0x10, 0x48, 0x0d, 0x0a, 0x20, 0xd5, 0xdf, 0x32, 0xe0, 0xa4, 0x88, 0x8c, + 0x2b, 0x03, 0xb6, 0xf3, 0x13, 0x50, 0x30, 0x18, 0xf3, 0x28, 0xae, 0x24, 0x6d, 0xe7, 0x65, 0x79, + 0x9d, 0xc2, 0x6a, 0x82, 0x1d, 0x4a, 0x44, 0x80, 0x7b, 0x60, 0xba, 0xde, 0x79, 0x79, 0x79, 0x4f, + 0x2d, 0xf5, 0x9e, 0xb1, 0x94, 0xe9, 0x0b, 0xf2, 0x08, 0xf1, 0xb4, 0xa3, 0x38, 0x76, 0x3f, 0x3a, + 0x30, 0x3a, 0x3c, 0x1d, 0x80, 0xf7, 0xc1, 0xc2, 0x8e, 0x4d, 0xa9, 0xbd, 0x4f, 0xac, 0xaa, 0x88, + 0x13, 0x80, 0x64, 0x05, 0xc8, 0x5f, 0xda, 0xad, 0xd2, 0x82, 0xde, 0xcf, 0x00, 0xf5, 0xf7, 0x53, + 0xf7, 0xc1, 0xc2, 0x06, 0x1f, 0x2c, 0xcc, 0xf6, 0xa8, 0x89, 0xa3, 0x9e, 0x80, 0x25, 0x90, 0x6b, + 0x62, 0xba, 0xe3, 0xd7, 0x75, 0x5e, 0xcf, 0xf3, 0x8e, 0x78, 0xc4, 0x05, 0xc8, 0x97, 0xf3, 0x9b, + 0x58, 0x91, 0xe7, 0x43, 0xb4, 0xc6, 0x0a, 0x63, 0xc2, 0x54, 0xdc, 0x64, 0x23, 0xae, 0x42, 0xdd, + 0xb6, 0xea, 0x61, 0x06, 0x2c, 0x26, 0xb4, 0x20, 0x7c, 0x04, 0x26, 0x98, 0xfc, 0x5b, 0xb6, 0xd5, + 0xe9, 0xd4, 0xc7, 0x90, 0xce, 0xd1, 0x16, 0x08, 0xd0, 0x50, 0x88, 0x05, 0x1d, 0x30, 0x4d, 0xe5, + 0x19, 0x44, 0x50, 0xb9, 0x0d, 0xfe, 0x95, 0x0a, 0xde, 0x9b, 0x9f, 0xe8, 0xb9, 0x51, 0x27, 0x22, + 0x8a, 0x07, 0x80, 0x2f, 0xc0, 0x5c, 0xc7, 0xc5, 0xfd, 0xa0, 0xa3, 0x22, 0xe8, 0xe5, 0xd4, 0xa0, + 0x7d, 0xdf, 0x45, 0x2f, 0xc8, 0xb8, 0x73, 0x1b, 0x5d, 0xb8, 0xa8, 0x27, 0x92, 0xfa, 0x63, 0x06, + 0x0c, 0x58, 0x10, 0x1f, 0x80, 0xf0, 0x19, 0x31, 0xc2, 0x77, 0xed, 0x08, 0xab, 0x2f, 0x91, 0x00, + 0x92, 0x2e, 0x02, 0xb8, 0x7a, 0x94, 0x20, 0x83, 0x09, 0xe1, 0x2f, 0x19, 0xf0, 0xb7, 0x64, 0xe7, + 0x88, 0x20, 0xde, 0x8b, 0x4d, 0xda, 0x7f, 0x77, 0x4d, 0xda, 0x53, 0x43, 0x40, 0xfc, 0x49, 0x18, + 0xbb, 0x08, 0xe3, 0x5b, 0x05, 0x14, 0x93, 0xf3, 0xf6, 0x01, 0x08, 0xe4, 0xd3, 0x38, 0x81, 0xbc, + 0x7a, 0x84, 0x2a, 0x4b, 0x20, 0x94, 0xb7, 0x06, 0x15, 0x57, 0xc8, 0xfc, 0x86, 0x58, 0xfd, 0xdf, + 0x64, 0x06, 0xe5, 0x4a, 0x30, 0xd5, 0x94, 0x9f, 0x30, 0x31, 0xef, 0x9b, 0x16, 0x5f, 0x40, 0x0d, + 0xbe, 0x43, 0xfc, 0x8a, 0x24, 0x60, 0xbc, 0xee, 0xaf, 0x6c, 0xd9, 0xd7, 0xfa, 0x70, 0x9b, 0x72, + 0xd0, 0x8a, 0xf7, 0xe9, 0x81, 0x34, 0x43, 0x01, 0x3e, 0xc4, 0x60, 0x0c, 0x8b, 0x9f, 0xee, 0x43, + 0x37, 0x77, 0xda, 0x2f, 0x7d, 0x1d, 0xf0, 0x42, 0xf4, 0xad, 0x90, 0x04, 0x57, 0x5f, 0x2a, 0x60, + 0x39, 0x6d, 0x2a, 0xc0, 0xe7, 0x7d, 0xd8, 0xde, 0x51, 0xc8, 0xfc, 0xf0, 0xec, 0xef, 0x5b, 0x05, + 0x1c, 0xef, 0xc7, 0xa9, 0x78, 0xa3, 0x71, 0x22, 0x15, 0xb2, 0xa0, 0xb0, 0xd1, 0xb6, 0x84, 0x14, + 0x49, 0x2d, 0x3c, 0x0b, 0x26, 0x6a, 0x86, 0x55, 0xd9, 0x26, 0x9f, 0x05, 0x1c, 0x3f, 0x2c, 0xf5, + 0xdb, 0x52, 0x8e, 0x42, 0x0b, 0x78, 0x03, 0xcc, 0x09, 0xbf, 0x35, 0x6c, 0x55, 0xdd, 0x9a, 0x78, + 0x13, 0xc9, 0x51, 0xc2, 0xdd, 0xb3, 0xd5, 0xa5, 0x47, 0x3d, 0x1e, 0xea, 0xaf, 0x0a, 0x80, 0x7f, + 0x84, 0x56, 0x9c, 0x01, 0x79, 0xc3, 0x21, 0x82, 0xed, 0xfa, 0xcd, 0x96, 0xd7, 0xa7, 0xdb, 0xad, + 0x52, 0x7e, 0x75, 0xf3, 0x8e, 0x2f, 0x44, 0x91, 0x9e, 0x1b, 0x07, 0xfb, 0xd6, 0xdf, 0xab, 0xd2, + 0x38, 0x08, 0xcc, 0x50, 0xa4, 0x87, 0x57, 0xc0, 0x94, 0x59, 0xf7, 0x98, 0x8b, 0xe9, 0xb6, 0x69, + 0x3b, 0x58, 0x0c, 0xa7, 0x09, 0xfd, 0xb8, 0xbc, 0xd3, 0xd4, 0xf5, 0x0e, 0x1d, 0x8a, 0x59, 0x42, + 0x0d, 0x00, 0xde, 0x59, 0xcc, 0x31, 0x78, 0x9c, 0x9c, 0x88, 0x33, 0xc3, 0x1f, 0x6c, 0x23, 0x94, + 0xa2, 0x0e, 0x0b, 0xf5, 0x19, 0x58, 0xd8, 0xc6, 0xb4, 0x49, 0x4c, 0xbc, 0x6a, 0x9a, 0xb6, 0x67, + 0xb9, 0x01, 0x6f, 0x2f, 0x83, 0x7c, 0x68, 0x26, 0x9b, 0xef, 0x98, 0x8c, 0x9f, 0x0f, 0xb1, 0x50, + 0x64, 0x13, 0x76, 0x7b, 0x26, 0xb1, 0xdb, 0x7f, 0xc8, 0x80, 0xf1, 0x08, 0x3e, 0xbb, 0x47, 0xac, + 0x8a, 0x44, 0x3e, 0x11, 0x58, 0xdf, 0x23, 0x56, 0xe5, 0x5d, 0xab, 0x34, 0x29, 0xcd, 0xf8, 0x27, + 0x12, 0x86, 0xf0, 0x2e, 0xc8, 0x7a, 0x0c, 0x53, 0xd9, 0xc7, 0x67, 0x53, 0xab, 0xf9, 0x21, 0xc3, + 0x34, 0x20, 0x5a, 0x13, 0x1c, 0x9a, 0x0b, 0x90, 0xc0, 0x80, 0x1b, 0x20, 0x57, 0xe5, 0xaf, 0x22, + 0x5b, 0xf5, 0x5c, 0x2a, 0x58, 0xe7, 0x2f, 0x1a, 0xbf, 0x10, 0x84, 0x04, 0xf9, 0x30, 0x90, 0x82, + 0x19, 0x16, 0x4b, 0xa2, 0x78, 0xb0, 0x61, 0x88, 0x53, 0xdf, 0xdc, 0xeb, 0xb0, 0xdd, 0x2a, 0xcd, + 0xc4, 0x55, 0xa8, 0x2b, 0x82, 0x5a, 0x06, 0x93, 0x1d, 0x57, 0x4c, 0x9f, 0xb5, 0xfa, 0xcd, 0x57, + 0x87, 0xc5, 0x91, 0xd7, 0x87, 0xc5, 0x91, 0x37, 0x87, 0xc5, 0x91, 0xcf, 0xdb, 0x45, 0xe5, 0x55, + 0xbb, 0xa8, 0xbc, 0x6e, 0x17, 0x95, 0x37, 0xed, 0xa2, 0xf2, 0xb6, 0x5d, 0x54, 0xbe, 0xfc, 0xa9, + 0x38, 0xf2, 0xb8, 0x94, 0xf2, 0x2f, 0xda, 0xdf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x6c, 0x4e, + 0x4e, 0xdd, 0x15, 0x00, 0x00, } func (m *ExemptPriorityLevelConfiguration) Marshal() (dAtA []byte, err error) { @@ -1242,11 +1244,9 @@ func (m *LimitedPriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (i } i-- dAtA[i] = 0x12 - if m.NominalConcurrencyShares != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.NominalConcurrencyShares)) - i-- - dAtA[i] = 0x8 - } + i = encodeVarintGenerated(dAtA, i, uint64(m.AssuredConcurrencyShares)) + i-- + dAtA[i] = 0x8 return len(dAtA) - i, nil } @@ -2007,9 +2007,7 @@ func (m *LimitedPriorityLevelConfiguration) Size() (n int) { } var l int _ = l - if m.NominalConcurrencyShares != nil { - n += 1 + sovGenerated(uint64(*m.NominalConcurrencyShares)) - } + n += 1 + sovGenerated(uint64(m.AssuredConcurrencyShares)) l = m.LimitResponse.Size() n += 1 + l + sovGenerated(uint64(l)) if m.LendablePercent != nil { @@ -2386,7 +2384,7 @@ func (this *LimitedPriorityLevelConfiguration) String() string { return "nil" } s := strings.Join([]string{`&LimitedPriorityLevelConfiguration{`, - `NominalConcurrencyShares:` + valueToStringGenerated(this.NominalConcurrencyShares) + `,`, + `AssuredConcurrencyShares:` + fmt.Sprintf("%v", this.AssuredConcurrencyShares) + `,`, `LimitResponse:` + strings.Replace(strings.Replace(this.LimitResponse.String(), "LimitResponse", "LimitResponse", 1), `&`, ``, 1) + `,`, `LendablePercent:` + valueToStringGenerated(this.LendablePercent) + `,`, `BorrowingLimitPercent:` + valueToStringGenerated(this.BorrowingLimitPercent) + `,`, @@ -3715,9 +3713,9 @@ func (m *LimitedPriorityLevelConfiguration) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NominalConcurrencyShares", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AssuredConcurrencyShares", wireType) } - var v int32 + m.AssuredConcurrencyShares = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3727,12 +3725,11 @@ func (m *LimitedPriorityLevelConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int32(b&0x7F) << shift + m.AssuredConcurrencyShares |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.NominalConcurrencyShares = &v case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LimitResponse", wireType) diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/generated.proto b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto similarity index 94% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/generated.proto rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto index a5c6f4fc4f3..6509386f26f 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/generated.proto +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto @@ -19,14 +19,14 @@ limitations under the License. syntax = "proto2"; -package k8s.io.api.flowcontrol.v1; +package k8s.io.api.flowcontrol.v1alpha1; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". -option go_package = "k8s.io/api/flowcontrol/v1"; +option go_package = "k8s.io/api/flowcontrol/v1alpha1"; // ExemptPriorityLevelConfiguration describes the configurable aspects // of the handling of exempt requests. @@ -153,8 +153,6 @@ message FlowSchemaStatus { // `conditions` is a list of the current states of FlowSchema. // +listType=map // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge // +optional repeated FlowSchemaCondition conditions = 1; } @@ -192,28 +190,23 @@ message LimitResponse { // - How are requests for this priority level limited? // - What should be done with requests that exceed the limit? message LimitedPriorityLevelConfiguration { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats available at this priority level. - // This is used both for requests dispatched from this priority level - // as well as requests dispatched from other priority levels - // borrowing seats from this level. - // The server's concurrency limit (ServerCL) is divided among the - // Limited priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) + // `assuredConcurrencyShares` (ACS) configures the execution + // limit, which is a limit on the number of requests of this + // priority level that may be exeucting at a given time. ACS must + // be a positive number. The server's concurrency limit (SCL) is + // divided among the concurrency-controlled priority levels in + // proportion to their assured concurrency shares. This produces + // the assured concurrency value (ACV) --- the number of requests + // that may be executing at a time --- for each such priority + // level: // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // - // If not specified, this field defaults to a value of 30. - // - // Setting this field to zero supports the construction of a - // "jail" for this priority level that is used to hold some request(s) + // ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) ) // + // bigger numbers of ACS mean more reserved concurrent requests (at the + // expense of every other PL). + // This field has a default value of 30. // +optional - optional int32 nominalConcurrencyShares = 1; + optional int32 assuredConcurrencyShares = 1; // `limitResponse` indicates what to do with requests that can not be executed right now optional LimitResponse limitResponse = 2; @@ -388,8 +381,6 @@ message PriorityLevelConfigurationStatus { // `conditions` is the current state of "request-priority". // +listType=map // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge // +optional repeated PriorityLevelConfigurationCondition conditions = 1; } diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/register.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go similarity index 95% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/register.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go index 02725b514e0..0c8a9cc5657 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/register.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1 +package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +26,7 @@ import ( const GroupName = "flowcontrol.apiserver.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/types.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go similarity index 88% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/types.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go index e62d23280e5..161411ff338 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/types.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1 +package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -57,55 +57,13 @@ const ( ResponseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" ) -const ( - // AutoUpdateAnnotationKey is the name of an annotation that enables - // automatic update of the spec of the bootstrap configuration - // object(s), if set to 'true'. - // - // On a fresh install, all bootstrap configuration objects will have auto - // update enabled with the following annotation key: - // apf.kubernetes.io/autoupdate-spec: 'true' - // - // The kube-apiserver periodically checks the bootstrap configuration - // objects on the cluster and applies updates if necessary. - // - // kube-apiserver enforces an 'always auto-update' policy for the - // mandatory configuration object(s). This implies: - // - the auto-update annotation key is added with a value of 'true' - // if it is missing. - // - the auto-update annotation key is set to 'true' if its current value - // is a boolean false or has an invalid boolean representation - // (if the cluster operator sets it to 'false' it will be stomped) - // - any changes to the spec made by the cluster operator will be - // stomped, except for changes to the `nominalConcurrencyShares` - // and `lendablePercent` fields of the PriorityLevelConfiguration - // named "exempt". - // - // The kube-apiserver will apply updates on the suggested configuration if: - // - the cluster operator has enabled auto-update by setting the annotation - // (apf.kubernetes.io/autoupdate-spec: 'true') or - // - the annotation key is missing but the generation is 1 - // - // If the suggested configuration object is missing the annotation key, - // kube-apiserver will update the annotation appropriately: - // - it is set to 'true' if generation of the object is '1' which usually - // indicates that the spec of the object has not been changed. - // - it is set to 'false' if generation of the object is greater than 1. - // - // The goal is to enable the kube-apiserver to apply update on suggested - // configuration objects installed by previous releases but not overwrite - // changes made by the cluster operators. - // Note that this distinction is imperfectly detected: in the case where an - // operator deletes a suggested configuration object and later creates it - // but with a variant spec and then does no updates of the object - // (generation is 1), the technique outlined above will incorrectly - // determine that the object should be auto-updated. - AutoUpdateAnnotationKey = "apf.kubernetes.io/autoupdate-spec" -) - // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.18 +// +k8s:prerelease-lifecycle-gen:deprecated=1.20 +// +k8s:prerelease-lifecycle-gen:removed=1.21 +// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,FlowSchema // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". @@ -126,6 +84,10 @@ type FlowSchema struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.18 +// +k8s:prerelease-lifecycle-gen:deprecated=1.20 +// +k8s:prerelease-lifecycle-gen:removed=1.21 +// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,FlowSchemaList // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { @@ -352,10 +314,8 @@ type FlowSchemaStatus struct { // `conditions` is a list of the current states of FlowSchema. // +listType=map // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge // +optional - Conditions []FlowSchemaCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + Conditions []FlowSchemaCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` } // FlowSchemaCondition describes conditions for a FlowSchema. @@ -381,6 +341,10 @@ type FlowSchemaConditionType string // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.18 +// +k8s:prerelease-lifecycle-gen:deprecated=1.20 +// +k8s:prerelease-lifecycle-gen:removed=1.21 +// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,PriorityLevelConfiguration // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfiguration struct { @@ -400,6 +364,10 @@ type PriorityLevelConfiguration struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.18 +// +k8s:prerelease-lifecycle-gen:deprecated=1.20 +// +k8s:prerelease-lifecycle-gen:removed=1.21 +// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,PriorityLevelConfigurationList // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { @@ -458,28 +426,23 @@ const ( // - How are requests for this priority level limited? // - What should be done with requests that exceed the limit? type LimitedPriorityLevelConfiguration struct { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats available at this priority level. - // This is used both for requests dispatched from this priority level - // as well as requests dispatched from other priority levels - // borrowing seats from this level. - // The server's concurrency limit (ServerCL) is divided among the - // Limited priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) - // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // - // If not specified, this field defaults to a value of 30. + // `assuredConcurrencyShares` (ACS) configures the execution + // limit, which is a limit on the number of requests of this + // priority level that may be exeucting at a given time. ACS must + // be a positive number. The server's concurrency limit (SCL) is + // divided among the concurrency-controlled priority levels in + // proportion to their assured concurrency shares. This produces + // the assured concurrency value (ACV) --- the number of requests + // that may be executing at a time --- for each such priority + // level: // - // Setting this field to zero supports the construction of a - // "jail" for this priority level that is used to hold some request(s) + // ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) ) // + // bigger numbers of ACS mean more reserved concurrent requests (at the + // expense of every other PL). + // This field has a default value of 30. // +optional - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares" protobuf:"varint,1,opt,name=nominalConcurrencyShares"` + AssuredConcurrencyShares int32 `json:"assuredConcurrencyShares" protobuf:"varint,1,opt,name=assuredConcurrencyShares"` // `limitResponse` indicates what to do with requests that can not be executed right now LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` @@ -623,10 +586,8 @@ type PriorityLevelConfigurationStatus struct { // `conditions` is the current state of "request-priority". // +listType=map // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge // +optional - Conditions []PriorityLevelConfigurationCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + Conditions []PriorityLevelConfigurationCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` } // PriorityLevelConfigurationCondition defines the condition of priority level. diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go similarity index 95% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go index b8cb436367a..1d0680c1085 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1 +package v1alpha1 // This file contains a collection of methods that can be used from go-restful to // generate Swagger API documentation for its models. Please read this PR for more @@ -122,7 +122,7 @@ func (LimitResponse) SwaggerDoc() map[string]string { var map_LimitedPriorityLevelConfiguration = map[string]string{ "": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", - "nominalConcurrencyShares": "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats available at this priority level. This is used both for requests dispatched from this priority level as well as requests dispatched from other priority levels borrowing seats from this level. The server's concurrency limit (ServerCL) is divided among the Limited priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level.\n\nIf not specified, this field defaults to a value of 30.\n\nSetting this field to zero supports the construction of a \"jail\" for this priority level that is used to hold some request(s)", + "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be exeucting at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", "limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now", "lendablePercent": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", "borrowingLimitPercent": "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from upstream/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go rename to upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go index f37090b75b4..a5c9737aa5f 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( runtime "k8s.io/apimachinery/pkg/runtime" @@ -237,11 +237,6 @@ func (in *LimitResponse) DeepCopy() *LimitResponse { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LimitedPriorityLevelConfiguration) DeepCopyInto(out *LimitedPriorityLevelConfiguration) { *out = *in - if in.NominalConcurrencyShares != nil { - in, out := &in.NominalConcurrencyShares, &out.NominalConcurrencyShares - *out = new(int32) - **out = **in - } in.LimitResponse.DeepCopyInto(&out.LimitResponse) if in.LendablePercent != nil { in, out := &in.LendablePercent, &out.LendablePercent diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.prerelease-lifecycle.go b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.prerelease-lifecycle.go new file mode 100644 index 00000000000..2b6a3d3fd96 --- /dev/null +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.prerelease-lifecycle.go @@ -0,0 +1,122 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by prerelease-lifecycle-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *FlowSchema) APILifecycleIntroduced() (major, minor int) { + return 1, 18 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *FlowSchema) APILifecycleDeprecated() (major, minor int) { + return 1, 20 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. +func (in *FlowSchema) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "FlowSchema"} +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *FlowSchema) APILifecycleRemoved() (major, minor int) { + return 1, 21 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *FlowSchemaList) APILifecycleIntroduced() (major, minor int) { + return 1, 18 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *FlowSchemaList) APILifecycleDeprecated() (major, minor int) { + return 1, 20 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. +func (in *FlowSchemaList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "FlowSchemaList"} +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *FlowSchemaList) APILifecycleRemoved() (major, minor int) { + return 1, 21 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PriorityLevelConfiguration) APILifecycleIntroduced() (major, minor int) { + return 1, 18 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PriorityLevelConfiguration) APILifecycleDeprecated() (major, minor int) { + return 1, 20 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. +func (in *PriorityLevelConfiguration) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "PriorityLevelConfiguration"} +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PriorityLevelConfiguration) APILifecycleRemoved() (major, minor int) { + return 1, 21 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PriorityLevelConfigurationList) APILifecycleIntroduced() (major, minor int) { + return 1, 18 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PriorityLevelConfigurationList) APILifecycleDeprecated() (major, minor int) { + return 1, 20 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. +func (in *PriorityLevelConfigurationList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "PriorityLevelConfigurationList"} +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PriorityLevelConfigurationList) APILifecycleRemoved() (major, minor int) { + return 1, 21 +} diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto index 04b54820c73..96df0ace798 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto @@ -192,7 +192,7 @@ message LimitResponse { message LimitedPriorityLevelConfiguration { // `assuredConcurrencyShares` (ACS) configures the execution // limit, which is a limit on the number of requests of this - // priority level that may be executing at a given time. ACS must + // priority level that may be exeucting at a given time. ACS must // be a positive number. The server's concurrency limit (SCL) is // divided among the concurrency-controlled priority levels in // proportion to their assured concurrency shares. This produces diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types.go index abc3e420096..9e05ff1a090 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types.go @@ -466,7 +466,7 @@ const ( type LimitedPriorityLevelConfiguration struct { // `assuredConcurrencyShares` (ACS) configures the execution // limit, which is a limit on the number of requests of this - // priority level that may be executing at a given time. ACS must + // priority level that may be exeucting at a given time. ACS must // be a positive number. The server's concurrency limit (SCL) is // divided among the concurrency-controlled priority levels in // proportion to their assured concurrency shares. This produces diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go index d69bdac6228..1405f3c3ca6 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go @@ -122,7 +122,7 @@ func (LimitResponse) SwaggerDoc() map[string]string { var map_LimitedPriorityLevelConfiguration = map[string]string{ "": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", - "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be executing at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", + "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be exeucting at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", "limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now", "lendablePercent": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", "borrowingLimitPercent": "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto index a832114afea..a8c8a327374 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto @@ -192,7 +192,7 @@ message LimitResponse { message LimitedPriorityLevelConfiguration { // `assuredConcurrencyShares` (ACS) configures the execution // limit, which is a limit on the number of requests of this - // priority level that may be executing at a given time. ACS must + // priority level that may be exeucting at a given time. ACS must // be a positive number. The server's concurrency limit (SCL) is // divided among the concurrency-controlled priority levels in // proportion to their assured concurrency shares. This produces diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types.go index c66cb173f4a..e8cf7abfff6 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types.go @@ -466,7 +466,7 @@ const ( type LimitedPriorityLevelConfiguration struct { // `assuredConcurrencyShares` (ACS) configures the execution // limit, which is a limit on the number of requests of this - // priority level that may be executing at a given time. ACS must + // priority level that may be exeucting at a given time. ACS must // be a positive number. The server's concurrency limit (SCL) is // divided among the concurrency-controlled priority levels in // proportion to their assured concurrency shares. This produces diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go index 921122731af..49a41780966 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go @@ -122,7 +122,7 @@ func (LimitResponse) SwaggerDoc() map[string]string { var map_LimitedPriorityLevelConfiguration = map[string]string{ "": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", - "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be executing at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", + "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be exeucting at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", "limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now", "lendablePercent": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", "borrowingLimitPercent": "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/types.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/types.go index 0ffc22a2365..810941557b2 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/types.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/types.go @@ -103,25 +103,10 @@ const ( AutoUpdateAnnotationKey = "apf.kubernetes.io/autoupdate-spec" ) -const ( - // This annotation is only for use in v1beta3. - // - // The presence of this annotation in a v1beta3 object means that - // a zero value in the 'NominalConcurrencyShares' field means zero - // rather than the old default of 30. - // - // To set a zero value for the 'NominalConcurrencyShares' field in v1beta3, - // set the annotation to an empty string: - // "flowcontrol.k8s.io/v1beta3-preserve-zero-concurrency-shares": "" - // - PriorityLevelPreserveZeroConcurrencySharesKey = "flowcontrol.k8s.io/v1beta3-preserve-zero-concurrency-shares" -) - // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1,FlowSchema // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". @@ -143,7 +128,6 @@ type FlowSchema struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1,FlowSchemaList // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { @@ -400,7 +384,6 @@ type FlowSchemaConditionType string // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1,PriorityLevelConfiguration // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfiguration struct { @@ -421,7 +404,6 @@ type PriorityLevelConfiguration struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1,PriorityLevelConfigurationList // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { diff --git a/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.prerelease-lifecycle.go b/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.prerelease-lifecycle.go index 7e46a1469db..24b76138500 100644 --- a/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.prerelease-lifecycle.go +++ b/upstream/vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.prerelease-lifecycle.go @@ -21,10 +21,6 @@ limitations under the License. package v1beta3 -import ( - schema "k8s.io/apimachinery/pkg/runtime/schema" -) - // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *FlowSchema) APILifecycleIntroduced() (major, minor int) { @@ -37,12 +33,6 @@ func (in *FlowSchema) APILifecycleDeprecated() (major, minor int) { return 1, 29 } -// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. -// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. -func (in *FlowSchema) APILifecycleReplacement() schema.GroupVersionKind { - return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "FlowSchema"} -} - // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *FlowSchema) APILifecycleRemoved() (major, minor int) { @@ -61,12 +51,6 @@ func (in *FlowSchemaList) APILifecycleDeprecated() (major, minor int) { return 1, 29 } -// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. -// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. -func (in *FlowSchemaList) APILifecycleReplacement() schema.GroupVersionKind { - return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "FlowSchemaList"} -} - // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *FlowSchemaList) APILifecycleRemoved() (major, minor int) { @@ -85,12 +69,6 @@ func (in *PriorityLevelConfiguration) APILifecycleDeprecated() (major, minor int return 1, 29 } -// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. -// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. -func (in *PriorityLevelConfiguration) APILifecycleReplacement() schema.GroupVersionKind { - return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "PriorityLevelConfiguration"} -} - // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *PriorityLevelConfiguration) APILifecycleRemoved() (major, minor int) { @@ -109,12 +87,6 @@ func (in *PriorityLevelConfigurationList) APILifecycleDeprecated() (major, minor return 1, 29 } -// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. -// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go. -func (in *PriorityLevelConfigurationList) APILifecycleReplacement() schema.GroupVersionKind { - return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "PriorityLevelConfigurationList"} -} - // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *PriorityLevelConfigurationList) APILifecycleRemoved() (major, minor int) { diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.pb.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.pb.go index 949ea513fe5..f54d1f82421 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.pb.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.pb.go @@ -25,12 +25,14 @@ import ( io "io" proto "github.com/gogo/protobuf/proto" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v11 "k8s.io/api/core/v1" math "math" math_bits "math/bits" reflect "reflect" strings "strings" + + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" ) // Reference imports to suppress errors if they are not otherwise used. @@ -44,15 +46,15 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func (m *IPAddress) Reset() { *m = IPAddress{} } -func (*IPAddress) ProtoMessage() {} -func (*IPAddress) Descriptor() ([]byte, []int) { +func (m *ClusterCIDR) Reset() { *m = ClusterCIDR{} } +func (*ClusterCIDR) ProtoMessage() {} +func (*ClusterCIDR) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{0} } -func (m *IPAddress) XXX_Unmarshal(b []byte) error { +func (m *ClusterCIDR) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ClusterCIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -60,27 +62,27 @@ func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } -func (m *IPAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPAddress.Merge(m, src) +func (m *ClusterCIDR) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterCIDR.Merge(m, src) } -func (m *IPAddress) XXX_Size() int { +func (m *ClusterCIDR) XXX_Size() int { return m.Size() } -func (m *IPAddress) XXX_DiscardUnknown() { - xxx_messageInfo_IPAddress.DiscardUnknown(m) +func (m *ClusterCIDR) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterCIDR.DiscardUnknown(m) } -var xxx_messageInfo_IPAddress proto.InternalMessageInfo +var xxx_messageInfo_ClusterCIDR proto.InternalMessageInfo -func (m *IPAddressList) Reset() { *m = IPAddressList{} } -func (*IPAddressList) ProtoMessage() {} -func (*IPAddressList) Descriptor() ([]byte, []int) { +func (m *ClusterCIDRList) Reset() { *m = ClusterCIDRList{} } +func (*ClusterCIDRList) ProtoMessage() {} +func (*ClusterCIDRList) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{1} } -func (m *IPAddressList) XXX_Unmarshal(b []byte) error { +func (m *ClusterCIDRList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IPAddressList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ClusterCIDRList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -88,27 +90,27 @@ func (m *IPAddressList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error } return b[:n], nil } -func (m *IPAddressList) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPAddressList.Merge(m, src) +func (m *ClusterCIDRList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterCIDRList.Merge(m, src) } -func (m *IPAddressList) XXX_Size() int { +func (m *ClusterCIDRList) XXX_Size() int { return m.Size() } -func (m *IPAddressList) XXX_DiscardUnknown() { - xxx_messageInfo_IPAddressList.DiscardUnknown(m) +func (m *ClusterCIDRList) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterCIDRList.DiscardUnknown(m) } -var xxx_messageInfo_IPAddressList proto.InternalMessageInfo +var xxx_messageInfo_ClusterCIDRList proto.InternalMessageInfo -func (m *IPAddressSpec) Reset() { *m = IPAddressSpec{} } -func (*IPAddressSpec) ProtoMessage() {} -func (*IPAddressSpec) Descriptor() ([]byte, []int) { +func (m *ClusterCIDRSpec) Reset() { *m = ClusterCIDRSpec{} } +func (*ClusterCIDRSpec) ProtoMessage() {} +func (*ClusterCIDRSpec) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{2} } -func (m *IPAddressSpec) XXX_Unmarshal(b []byte) error { +func (m *ClusterCIDRSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IPAddressSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ClusterCIDRSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -116,27 +118,27 @@ func (m *IPAddressSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error } return b[:n], nil } -func (m *IPAddressSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPAddressSpec.Merge(m, src) +func (m *ClusterCIDRSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterCIDRSpec.Merge(m, src) } -func (m *IPAddressSpec) XXX_Size() int { +func (m *ClusterCIDRSpec) XXX_Size() int { return m.Size() } -func (m *IPAddressSpec) XXX_DiscardUnknown() { - xxx_messageInfo_IPAddressSpec.DiscardUnknown(m) +func (m *ClusterCIDRSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterCIDRSpec.DiscardUnknown(m) } -var xxx_messageInfo_IPAddressSpec proto.InternalMessageInfo +var xxx_messageInfo_ClusterCIDRSpec proto.InternalMessageInfo -func (m *ParentReference) Reset() { *m = ParentReference{} } -func (*ParentReference) ProtoMessage() {} -func (*ParentReference) Descriptor() ([]byte, []int) { +func (m *IPAddress) Reset() { *m = IPAddress{} } +func (*IPAddress) ProtoMessage() {} +func (*IPAddress) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{3} } -func (m *ParentReference) XXX_Unmarshal(b []byte) error { +func (m *IPAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ParentReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -144,27 +146,27 @@ func (m *ParentReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, err } return b[:n], nil } -func (m *ParentReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParentReference.Merge(m, src) +func (m *IPAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddress.Merge(m, src) } -func (m *ParentReference) XXX_Size() int { +func (m *IPAddress) XXX_Size() int { return m.Size() } -func (m *ParentReference) XXX_DiscardUnknown() { - xxx_messageInfo_ParentReference.DiscardUnknown(m) +func (m *IPAddress) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddress.DiscardUnknown(m) } -var xxx_messageInfo_ParentReference proto.InternalMessageInfo +var xxx_messageInfo_IPAddress proto.InternalMessageInfo -func (m *ServiceCIDR) Reset() { *m = ServiceCIDR{} } -func (*ServiceCIDR) ProtoMessage() {} -func (*ServiceCIDR) Descriptor() ([]byte, []int) { +func (m *IPAddressList) Reset() { *m = IPAddressList{} } +func (*IPAddressList) ProtoMessage() {} +func (*IPAddressList) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{4} } -func (m *ServiceCIDR) XXX_Unmarshal(b []byte) error { +func (m *IPAddressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ServiceCIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IPAddressList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -172,27 +174,27 @@ func (m *ServiceCIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } -func (m *ServiceCIDR) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceCIDR.Merge(m, src) +func (m *IPAddressList) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddressList.Merge(m, src) } -func (m *ServiceCIDR) XXX_Size() int { +func (m *IPAddressList) XXX_Size() int { return m.Size() } -func (m *ServiceCIDR) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceCIDR.DiscardUnknown(m) +func (m *IPAddressList) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddressList.DiscardUnknown(m) } -var xxx_messageInfo_ServiceCIDR proto.InternalMessageInfo +var xxx_messageInfo_IPAddressList proto.InternalMessageInfo -func (m *ServiceCIDRList) Reset() { *m = ServiceCIDRList{} } -func (*ServiceCIDRList) ProtoMessage() {} -func (*ServiceCIDRList) Descriptor() ([]byte, []int) { +func (m *IPAddressSpec) Reset() { *m = IPAddressSpec{} } +func (*IPAddressSpec) ProtoMessage() {} +func (*IPAddressSpec) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{5} } -func (m *ServiceCIDRList) XXX_Unmarshal(b []byte) error { +func (m *IPAddressSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ServiceCIDRList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IPAddressSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -200,55 +202,27 @@ func (m *ServiceCIDRList) XXX_Marshal(b []byte, deterministic bool) ([]byte, err } return b[:n], nil } -func (m *ServiceCIDRList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceCIDRList.Merge(m, src) +func (m *IPAddressSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddressSpec.Merge(m, src) } -func (m *ServiceCIDRList) XXX_Size() int { +func (m *IPAddressSpec) XXX_Size() int { return m.Size() } -func (m *ServiceCIDRList) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceCIDRList.DiscardUnknown(m) +func (m *IPAddressSpec) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddressSpec.DiscardUnknown(m) } -var xxx_messageInfo_ServiceCIDRList proto.InternalMessageInfo +var xxx_messageInfo_IPAddressSpec proto.InternalMessageInfo -func (m *ServiceCIDRSpec) Reset() { *m = ServiceCIDRSpec{} } -func (*ServiceCIDRSpec) ProtoMessage() {} -func (*ServiceCIDRSpec) Descriptor() ([]byte, []int) { +func (m *ParentReference) Reset() { *m = ParentReference{} } +func (*ParentReference) ProtoMessage() {} +func (*ParentReference) Descriptor() ([]byte, []int) { return fileDescriptor_c1b7ac8d7d97acec, []int{6} } -func (m *ServiceCIDRSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceCIDRSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ServiceCIDRSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceCIDRSpec.Merge(m, src) -} -func (m *ServiceCIDRSpec) XXX_Size() int { - return m.Size() -} -func (m *ServiceCIDRSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceCIDRSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceCIDRSpec proto.InternalMessageInfo - -func (m *ServiceCIDRStatus) Reset() { *m = ServiceCIDRStatus{} } -func (*ServiceCIDRStatus) ProtoMessage() {} -func (*ServiceCIDRStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_c1b7ac8d7d97acec, []int{7} -} -func (m *ServiceCIDRStatus) XXX_Unmarshal(b []byte) error { +func (m *ParentReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ServiceCIDRStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ParentReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -256,27 +230,26 @@ func (m *ServiceCIDRStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } -func (m *ServiceCIDRStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceCIDRStatus.Merge(m, src) +func (m *ParentReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParentReference.Merge(m, src) } -func (m *ServiceCIDRStatus) XXX_Size() int { +func (m *ParentReference) XXX_Size() int { return m.Size() } -func (m *ServiceCIDRStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceCIDRStatus.DiscardUnknown(m) +func (m *ParentReference) XXX_DiscardUnknown() { + xxx_messageInfo_ParentReference.DiscardUnknown(m) } -var xxx_messageInfo_ServiceCIDRStatus proto.InternalMessageInfo +var xxx_messageInfo_ParentReference proto.InternalMessageInfo func init() { + proto.RegisterType((*ClusterCIDR)(nil), "k8s.io.api.networking.v1alpha1.ClusterCIDR") + proto.RegisterType((*ClusterCIDRList)(nil), "k8s.io.api.networking.v1alpha1.ClusterCIDRList") + proto.RegisterType((*ClusterCIDRSpec)(nil), "k8s.io.api.networking.v1alpha1.ClusterCIDRSpec") proto.RegisterType((*IPAddress)(nil), "k8s.io.api.networking.v1alpha1.IPAddress") proto.RegisterType((*IPAddressList)(nil), "k8s.io.api.networking.v1alpha1.IPAddressList") proto.RegisterType((*IPAddressSpec)(nil), "k8s.io.api.networking.v1alpha1.IPAddressSpec") proto.RegisterType((*ParentReference)(nil), "k8s.io.api.networking.v1alpha1.ParentReference") - proto.RegisterType((*ServiceCIDR)(nil), "k8s.io.api.networking.v1alpha1.ServiceCIDR") - proto.RegisterType((*ServiceCIDRList)(nil), "k8s.io.api.networking.v1alpha1.ServiceCIDRList") - proto.RegisterType((*ServiceCIDRSpec)(nil), "k8s.io.api.networking.v1alpha1.ServiceCIDRSpec") - proto.RegisterType((*ServiceCIDRStatus)(nil), "k8s.io.api.networking.v1alpha1.ServiceCIDRStatus") } func init() { @@ -284,51 +257,54 @@ func init() { } var fileDescriptor_c1b7ac8d7d97acec = []byte{ - // 648 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0xa4, 0xaa, 0x27, 0x5f, 0xbf, 0x52, 0xaf, 0xa2, 0x2e, 0x9c, 0x28, 0x6c, 0x8a, - 0xa0, 0x33, 0x24, 0x42, 0x88, 0x2d, 0x6e, 0xa5, 0xaa, 0x12, 0xb4, 0x65, 0xba, 0x02, 0x75, 0xc1, - 0xc4, 0xbe, 0x75, 0x4c, 0xf0, 0x8f, 0x66, 0xc6, 0x01, 0x76, 0x3c, 0x02, 0x2f, 0xc0, 0x73, 0xb0, - 0x02, 0x89, 0x5d, 0x97, 0x5d, 0x76, 0x55, 0x51, 0xf3, 0x22, 0x68, 0xc6, 0x8e, 0x9d, 0x34, 0xea, - 0xdf, 0xa6, 0x3b, 0xcf, 0xb9, 0xe7, 0x9c, 0xb9, 0xe7, 0xce, 0x8c, 0x8c, 0x76, 0x46, 0x2f, 0x04, - 0x0e, 0x62, 0x32, 0x4a, 0x07, 0xc0, 0x23, 0x90, 0x20, 0xc8, 0x18, 0x22, 0x2f, 0xe6, 0xa4, 0x28, - 0xb0, 0x24, 0x20, 0x11, 0xc8, 0x4f, 0x31, 0x1f, 0x05, 0x91, 0x4f, 0xc6, 0x3d, 0xf6, 0x31, 0x19, - 0xb2, 0x1e, 0xf1, 0x21, 0x02, 0xce, 0x24, 0x78, 0x38, 0xe1, 0xb1, 0x8c, 0x2d, 0x3b, 0xe7, 0x63, - 0x96, 0x04, 0xb8, 0xe2, 0xe3, 0x09, 0x7f, 0x7d, 0xd3, 0x0f, 0xe4, 0x30, 0x1d, 0x60, 0x37, 0x0e, - 0x89, 0x1f, 0xfb, 0x31, 0xd1, 0xb2, 0x41, 0x7a, 0xac, 0x57, 0x7a, 0xa1, 0xbf, 0x72, 0xbb, 0xf5, - 0x67, 0xd5, 0xf6, 0x21, 0x73, 0x87, 0x41, 0x04, 0xfc, 0x0b, 0x49, 0x46, 0xbe, 0x02, 0x04, 0x09, - 0x41, 0x32, 0x32, 0x9e, 0x6b, 0x62, 0x9d, 0x5c, 0xa5, 0xe2, 0x69, 0x24, 0x83, 0x10, 0xe6, 0x04, - 0xcf, 0x6f, 0x12, 0x08, 0x77, 0x08, 0x21, 0xbb, 0xac, 0xeb, 0xfe, 0x32, 0x90, 0xb9, 0x7b, 0xf0, - 0xd2, 0xf3, 0x38, 0x08, 0x61, 0xbd, 0x47, 0xcb, 0xaa, 0x23, 0x8f, 0x49, 0xd6, 0x32, 0x3a, 0xc6, - 0x46, 0xb3, 0xff, 0x14, 0x57, 0xe3, 0x28, 0x8d, 0x71, 0x32, 0xf2, 0x15, 0x20, 0xb0, 0x62, 0xe3, - 0x71, 0x0f, 0xef, 0x0f, 0x3e, 0x80, 0x2b, 0x5f, 0x83, 0x64, 0x8e, 0x75, 0x72, 0xde, 0xae, 0x65, - 0xe7, 0x6d, 0x54, 0x61, 0xb4, 0x74, 0xb5, 0xf6, 0x51, 0x5d, 0x24, 0xe0, 0xb6, 0x16, 0xb4, 0xfb, - 0x26, 0xbe, 0x7e, 0xd8, 0xb8, 0x6c, 0xed, 0x30, 0x01, 0xd7, 0xf9, 0xaf, 0xb0, 0xae, 0xab, 0x15, - 0xd5, 0x46, 0xdd, 0x9f, 0x06, 0x5a, 0x29, 0x59, 0xaf, 0x02, 0x21, 0xad, 0xa3, 0xb9, 0x10, 0xf8, - 0x76, 0x21, 0x94, 0x5a, 0x47, 0x78, 0x50, 0xec, 0xb3, 0x3c, 0x41, 0xa6, 0x02, 0xec, 0xa1, 0x46, - 0x20, 0x21, 0x14, 0xad, 0x85, 0xce, 0xe2, 0x46, 0xb3, 0xff, 0xe8, 0xd6, 0x09, 0x9c, 0x95, 0xc2, - 0xb5, 0xb1, 0xab, 0xf4, 0x34, 0xb7, 0xe9, 0x86, 0x53, 0xed, 0xab, 0x58, 0xd6, 0x11, 0x32, 0x13, - 0xc6, 0x21, 0x92, 0x14, 0x8e, 0x8b, 0xfe, 0xc9, 0x4d, 0x9b, 0x1c, 0x4c, 0x04, 0xc0, 0x21, 0x72, - 0xc1, 0x59, 0xc9, 0xce, 0xdb, 0x66, 0x09, 0xd2, 0xca, 0xb0, 0xfb, 0xc3, 0x40, 0xab, 0x97, 0xd8, - 0xd6, 0x43, 0xd4, 0xf0, 0x79, 0x9c, 0x26, 0x7a, 0x37, 0xb3, 0xea, 0x73, 0x47, 0x81, 0x34, 0xaf, - 0x59, 0x4f, 0xd0, 0x32, 0x07, 0x11, 0xa7, 0xdc, 0x05, 0x7d, 0x78, 0x66, 0x35, 0x25, 0x5a, 0xe0, - 0xb4, 0x64, 0x58, 0x04, 0x99, 0x11, 0x0b, 0x41, 0x24, 0xcc, 0x85, 0xd6, 0xa2, 0xa6, 0xaf, 0x15, - 0x74, 0x73, 0x6f, 0x52, 0xa0, 0x15, 0xc7, 0xea, 0xa0, 0xba, 0x5a, 0xb4, 0xea, 0x9a, 0x5b, 0x1e, - 0xb4, 0xe2, 0x52, 0x5d, 0xe9, 0x7e, 0x5f, 0x40, 0xcd, 0x43, 0xe0, 0xe3, 0xc0, 0x85, 0xad, 0xdd, - 0x6d, 0x7a, 0x0f, 0x77, 0xf5, 0xcd, 0xcc, 0x5d, 0xbd, 0xf1, 0x10, 0xa6, 0x9a, 0xbb, 0xea, 0xb6, - 0x5a, 0x6f, 0xd1, 0x92, 0x90, 0x4c, 0xa6, 0x42, 0x0f, 0xa5, 0xd9, 0xef, 0xdd, 0xc5, 0x54, 0x0b, - 0x9d, 0xff, 0x0b, 0xdb, 0xa5, 0x7c, 0x4d, 0x0b, 0xc3, 0xee, 0x6f, 0x03, 0xad, 0x4e, 0xb1, 0xef, - 0xe1, 0x29, 0x1c, 0xcc, 0x3e, 0x85, 0xc7, 0x77, 0xc8, 0x72, 0xc5, 0x63, 0xe8, 0xcf, 0x44, 0xd0, - 0xcf, 0xa1, 0x8d, 0x1a, 0x6e, 0xe0, 0x71, 0xd1, 0x32, 0x3a, 0x8b, 0x1b, 0xa6, 0x63, 0x2a, 0x8d, - 0x2a, 0x0a, 0x9a, 0xe3, 0xdd, 0xcf, 0x68, 0x6d, 0x6e, 0x48, 0x96, 0x8b, 0x90, 0x1b, 0x47, 0x5e, - 0x20, 0x83, 0x38, 0xca, 0xa5, 0xb3, 0x07, 0x78, 0x4d, 0xf4, 0xad, 0x89, 0xae, 0xba, 0x1d, 0x25, - 0x24, 0xe8, 0x94, 0xad, 0xb3, 0x7d, 0x72, 0x61, 0xd7, 0x4e, 0x2f, 0xec, 0xda, 0xd9, 0x85, 0x5d, - 0xfb, 0x9a, 0xd9, 0xc6, 0x49, 0x66, 0x1b, 0xa7, 0x99, 0x6d, 0x9c, 0x65, 0xb6, 0xf1, 0x27, 0xb3, - 0x8d, 0x6f, 0x7f, 0xed, 0xda, 0x3b, 0xfb, 0xfa, 0xff, 0xcf, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x29, 0x82, 0x11, 0x57, 0xb9, 0x06, 0x00, 0x00, -} - -func (m *IPAddress) Marshal() (dAtA []byte, err error) { + // 698 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcf, 0x4e, 0xdb, 0x4a, + 0x14, 0xc6, 0x63, 0x92, 0x48, 0x78, 0x00, 0x85, 0xeb, 0xcd, 0x8d, 0x58, 0x38, 0xb9, 0xb9, 0x1b, + 0xae, 0x6e, 0x19, 0x03, 0x42, 0x51, 0xb7, 0x98, 0x48, 0x34, 0x52, 0x0b, 0xe9, 0x20, 0xba, 0xa8, + 0x58, 0xd4, 0xb1, 0x0f, 0x8e, 0x1b, 0xfc, 0x47, 0x33, 0xe3, 0x54, 0xec, 0xfa, 0x08, 0x7d, 0xa1, + 0x56, 0x6a, 0x57, 0x2c, 0x59, 0xb2, 0x8a, 0x8a, 0xfb, 0x02, 0x5d, 0xb7, 0x9b, 0x6a, 0x26, 0x4e, + 0xec, 0x24, 0x0d, 0xd0, 0x0d, 0xbb, 0xcc, 0x39, 0xbf, 0xf3, 0xcd, 0x39, 0x73, 0xbe, 0x24, 0xe8, + 0xb0, 0xff, 0x94, 0x61, 0x2f, 0x34, 0xfa, 0x71, 0x17, 0x68, 0x00, 0x1c, 0x98, 0x31, 0x80, 0xc0, + 0x09, 0xa9, 0x91, 0x26, 0xac, 0xc8, 0x33, 0x02, 0xe0, 0xef, 0x42, 0xda, 0xf7, 0x02, 0xd7, 0x18, + 0xec, 0x58, 0x17, 0x51, 0xcf, 0xda, 0x31, 0x5c, 0x08, 0x80, 0x5a, 0x1c, 0x1c, 0x1c, 0xd1, 0x90, + 0x87, 0x9a, 0x3e, 0xe2, 0xb1, 0x15, 0x79, 0x38, 0xe3, 0xf1, 0x98, 0xdf, 0xd8, 0x72, 0x3d, 0xde, + 0x8b, 0xbb, 0xd8, 0x0e, 0x7d, 0xc3, 0x0d, 0xdd, 0xd0, 0x90, 0x65, 0xdd, 0xf8, 0x5c, 0x9e, 0xe4, + 0x41, 0x7e, 0x1a, 0xc9, 0x6d, 0x34, 0x72, 0xd7, 0xdb, 0x21, 0x05, 0x63, 0x30, 0x77, 0xe5, 0xc6, + 0x5e, 0xc6, 0xf8, 0x96, 0xdd, 0xf3, 0x02, 0xa0, 0x97, 0x46, 0xd4, 0x77, 0x45, 0x80, 0x19, 0x3e, + 0x70, 0xeb, 0x77, 0x55, 0xc6, 0xa2, 0x2a, 0x1a, 0x07, 0xdc, 0xf3, 0x61, 0xae, 0xa0, 0x79, 0x5f, + 0x01, 0xb3, 0x7b, 0xe0, 0x5b, 0xb3, 0x75, 0x8d, 0x2f, 0x0a, 0x5a, 0x39, 0xb8, 0x88, 0x19, 0x07, + 0x7a, 0xd0, 0x6e, 0x11, 0xed, 0x0d, 0x5a, 0x16, 0x3d, 0x39, 0x16, 0xb7, 0xaa, 0x4a, 0x5d, 0xd9, + 0x5c, 0xd9, 0xdd, 0xc6, 0xd9, 0xa3, 0x4d, 0xa4, 0x71, 0xd4, 0x77, 0x45, 0x80, 0x61, 0x41, 0xe3, + 0xc1, 0x0e, 0x3e, 0xee, 0xbe, 0x05, 0x9b, 0xbf, 0x00, 0x6e, 0x99, 0xda, 0xd5, 0xb0, 0x56, 0x48, + 0x86, 0x35, 0x94, 0xc5, 0xc8, 0x44, 0x55, 0x7b, 0x89, 0x4a, 0x2c, 0x02, 0xbb, 0xba, 0x24, 0xd5, + 0x0d, 0x7c, 0xf7, 0x4a, 0x70, 0xae, 0xb9, 0x93, 0x08, 0x6c, 0x73, 0x35, 0x15, 0x2f, 0x89, 0x13, + 0x91, 0x52, 0x8d, 0xcf, 0x0a, 0xaa, 0xe4, 0xb8, 0xe7, 0x1e, 0xe3, 0xda, 0xd9, 0xdc, 0x20, 0xf8, + 0x61, 0x83, 0x88, 0x6a, 0x39, 0xc6, 0x7a, 0x7a, 0xd3, 0xf2, 0x38, 0x92, 0x1b, 0xa2, 0x83, 0xca, + 0x1e, 0x07, 0x9f, 0x55, 0x97, 0xea, 0xc5, 0xcd, 0x95, 0xdd, 0xff, 0xff, 0x60, 0x0a, 0x73, 0x2d, + 0xd5, 0x2d, 0xb7, 0x85, 0x02, 0x19, 0x09, 0x35, 0xbe, 0x4f, 0xcf, 0x20, 0xa6, 0xd3, 0x5e, 0xa1, + 0xd5, 0x20, 0x74, 0xe0, 0x04, 0x2e, 0xc0, 0xe6, 0x21, 0x4d, 0xe7, 0xa8, 0xe7, 0x2f, 0x13, 0xb6, + 0x13, 0x5d, 0x1f, 0xe5, 0x38, 0x73, 0x3d, 0x19, 0xd6, 0x56, 0xf3, 0x11, 0x32, 0xa5, 0xa3, 0xed, + 0xa3, 0x4a, 0x04, 0x54, 0x00, 0xcf, 0x42, 0xc6, 0x4d, 0x8f, 0x33, 0xb9, 0x8d, 0xb2, 0xf9, 0x77, + 0xda, 0x5a, 0xa5, 0x33, 0x9d, 0x26, 0xb3, 0xbc, 0x56, 0x47, 0x25, 0x2f, 0x1a, 0xec, 0x55, 0x8b, + 0x75, 0x65, 0x53, 0xcd, 0x96, 0xd2, 0xee, 0x0c, 0xf6, 0x88, 0xcc, 0xa4, 0x44, 0xb3, 0x5a, 0x9a, + 0x23, 0x9a, 0x92, 0x68, 0x36, 0x3e, 0x29, 0x48, 0x6d, 0x77, 0xf6, 0x1d, 0x87, 0x02, 0x63, 0x8f, + 0xe0, 0xbc, 0xe3, 0x29, 0xe7, 0x6d, 0xdd, 0xb7, 0xb3, 0x49, 0x6b, 0x0b, 0x7d, 0xf7, 0x51, 0x41, + 0x6b, 0x13, 0xea, 0x11, 0x5c, 0x77, 0x34, 0xed, 0xba, 0xff, 0x1e, 0x3c, 0xc1, 0x02, 0xcf, 0xf9, + 0xb9, 0xf6, 0xa5, 0xe1, 0xce, 0x90, 0x1a, 0x59, 0x14, 0x02, 0x4e, 0xe0, 0x3c, 0xed, 0xff, 0xde, + 0x2f, 0x68, 0x67, 0x5c, 0x00, 0x14, 0x02, 0x1b, 0xcc, 0xb5, 0x64, 0x58, 0x53, 0x27, 0x41, 0x92, + 0x09, 0x36, 0x7e, 0x2a, 0xa8, 0x32, 0x43, 0x6b, 0xff, 0xa2, 0xb2, 0x4b, 0xc3, 0x38, 0x92, 0xb7, + 0xa9, 0x59, 0x9f, 0x87, 0x22, 0x48, 0x46, 0x39, 0xed, 0x09, 0x5a, 0xa6, 0xc0, 0xc2, 0x98, 0xda, + 0x20, 0x97, 0xa7, 0x66, 0xaf, 0x44, 0xd2, 0x38, 0x99, 0x10, 0x9a, 0x81, 0xd4, 0xc0, 0xf2, 0x81, + 0x45, 0x96, 0x0d, 0xa9, 0x3f, 0xff, 0x4a, 0x71, 0xf5, 0x68, 0x9c, 0x20, 0x19, 0x23, 0x9c, 0x2a, + 0x0e, 0xb3, 0x4e, 0x15, 0x2c, 0x91, 0x19, 0xcd, 0x44, 0xc5, 0xd8, 0x73, 0xaa, 0x65, 0x09, 0x6c, + 0xa7, 0x40, 0xf1, 0xb4, 0xdd, 0xfa, 0x31, 0xac, 0xfd, 0xb3, 0xe8, 0x97, 0x97, 0x5f, 0x46, 0xc0, + 0xf0, 0x69, 0xbb, 0x45, 0x44, 0xb1, 0xd9, 0xba, 0xba, 0xd5, 0x0b, 0xd7, 0xb7, 0x7a, 0xe1, 0xe6, + 0x56, 0x2f, 0xbc, 0x4f, 0x74, 0xe5, 0x2a, 0xd1, 0x95, 0xeb, 0x44, 0x57, 0x6e, 0x12, 0x5d, 0xf9, + 0x9a, 0xe8, 0xca, 0x87, 0x6f, 0x7a, 0xe1, 0xb5, 0x7e, 0xf7, 0x3f, 0xda, 0xaf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xf9, 0x9d, 0x9e, 0xc6, 0x0b, 0x07, 0x00, 0x00, +} + +func (m *ClusterCIDR) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -338,12 +314,12 @@ func (m *IPAddress) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *ClusterCIDR) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClusterCIDR) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -371,7 +347,7 @@ func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *IPAddressList) Marshal() (dAtA []byte, err error) { +func (m *ClusterCIDRList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -381,12 +357,12 @@ func (m *IPAddressList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IPAddressList) MarshalTo(dAtA []byte) (int, error) { +func (m *ClusterCIDRList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IPAddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClusterCIDRList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -418,7 +394,7 @@ func (m *IPAddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *IPAddressSpec) Marshal() (dAtA []byte, err error) { +func (m *ClusterCIDRSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -428,19 +404,32 @@ func (m *IPAddressSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IPAddressSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *ClusterCIDRSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IPAddressSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClusterCIDRSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ParentRef != nil { + i -= len(m.IPv6) + copy(dAtA[i:], m.IPv6) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.IPv6))) + i-- + dAtA[i] = 0x22 + i -= len(m.IPv4) + copy(dAtA[i:], m.IPv4) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.IPv4))) + i-- + dAtA[i] = 0x1a + i = encodeVarintGenerated(dAtA, i, uint64(m.PerNodeHostBits)) + i-- + dAtA[i] = 0x10 + if m.NodeSelector != nil { { - size, err := m.ParentRef.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -453,50 +442,7 @@ func (m *IPAddressSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ParentReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ParentReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParentReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x1a - i -= len(m.Resource) - copy(dAtA[i:], m.Resource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) - i-- - dAtA[i] = 0x12 - i -= len(m.Group) - copy(dAtA[i:], m.Group) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ServiceCIDR) Marshal() (dAtA []byte, err error) { +func (m *IPAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -506,26 +452,16 @@ func (m *ServiceCIDR) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ServiceCIDR) MarshalTo(dAtA []byte) (int, error) { +func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ServiceCIDR) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -549,7 +485,7 @@ func (m *ServiceCIDR) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ServiceCIDRList) Marshal() (dAtA []byte, err error) { +func (m *IPAddressList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -559,12 +495,12 @@ func (m *ServiceCIDRList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ServiceCIDRList) MarshalTo(dAtA []byte) (int, error) { +func (m *IPAddressList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ServiceCIDRList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IPAddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -596,7 +532,7 @@ func (m *ServiceCIDRList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ServiceCIDRSpec) Marshal() (dAtA []byte, err error) { +func (m *IPAddressSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -606,29 +542,32 @@ func (m *ServiceCIDRSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ServiceCIDRSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *IPAddressSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ServiceCIDRSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IPAddressSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.CIDRs) > 0 { - for iNdEx := len(m.CIDRs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CIDRs[iNdEx]) - copy(dAtA[i:], m.CIDRs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.CIDRs[iNdEx]))) - i-- - dAtA[i] = 0xa + if m.ParentRef != nil { + { + size, err := m.ParentRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ServiceCIDRStatus) Marshal() (dAtA []byte, err error) { +func (m *ParentReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -638,30 +577,41 @@ func (m *ServiceCIDRStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ServiceCIDRStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *ParentReference) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ServiceCIDRStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ParentReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) + i-- + dAtA[i] = 0x2a + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x12 + i -= len(m.Group) + copy(dAtA[i:], m.Group) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group))) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -676,7 +626,7 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *IPAddress) Size() (n int) { +func (m *ClusterCIDR) Size() (n int) { if m == nil { return 0 } @@ -689,7 +639,7 @@ func (m *IPAddress) Size() (n int) { return n } -func (m *IPAddressList) Size() (n int) { +func (m *ClusterCIDRList) Size() (n int) { if m == nil { return 0 } @@ -706,37 +656,25 @@ func (m *IPAddressList) Size() (n int) { return n } -func (m *IPAddressSpec) Size() (n int) { +func (m *ClusterCIDRSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ParentRef != nil { - l = m.ParentRef.Size() + if m.NodeSelector != nil { + l = m.NodeSelector.Size() n += 1 + l + sovGenerated(uint64(l)) } - return n -} - -func (m *ParentReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Group) + n += 1 + sovGenerated(uint64(m.PerNodeHostBits)) + l = len(m.IPv4) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Resource) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) + l = len(m.IPv6) n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *ServiceCIDR) Size() (n int) { +func (m *IPAddress) Size() (n int) { if m == nil { return 0 } @@ -746,12 +684,10 @@ func (m *ServiceCIDR) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *ServiceCIDRList) Size() (n int) { +func (m *IPAddressList) Size() (n int) { if m == nil { return 0 } @@ -768,33 +704,35 @@ func (m *ServiceCIDRList) Size() (n int) { return n } -func (m *ServiceCIDRSpec) Size() (n int) { +func (m *IPAddressSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.CIDRs) > 0 { - for _, s := range m.CIDRs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } + if m.ParentRef != nil { + l = m.ParentRef.Size() + n += 1 + l + sovGenerated(uint64(l)) } return n } -func (m *ServiceCIDRStatus) Size() (n int) { +func (m *ParentReference) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } + l = len(m.Group) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Resource) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -804,105 +742,93 @@ func sovGenerated(x uint64) (n int) { func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (this *IPAddress) String() string { +func (this *ClusterCIDR) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&IPAddress{`, + s := strings.Join([]string{`&ClusterCIDR{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "IPAddressSpec", "IPAddressSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterCIDRSpec", "ClusterCIDRSpec", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } -func (this *IPAddressList) String() string { +func (this *ClusterCIDRList) String() string { if this == nil { return "nil" } - repeatedStringForItems := "[]IPAddress{" + repeatedStringForItems := "[]ClusterCIDR{" for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "IPAddress", "IPAddress", 1), `&`, ``, 1) + "," + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ClusterCIDR", "ClusterCIDR", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{`&IPAddressList{`, + s := strings.Join([]string{`&ClusterCIDRList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } -func (this *IPAddressSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IPAddressSpec{`, - `ParentRef:` + strings.Replace(this.ParentRef.String(), "ParentReference", "ParentReference", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ParentReference) String() string { +func (this *ClusterCIDRSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ParentReference{`, - `Group:` + fmt.Sprintf("%v", this.Group) + `,`, - `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + s := strings.Join([]string{`&ClusterCIDRSpec{`, + `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v11.NodeSelector", 1) + `,`, + `PerNodeHostBits:` + fmt.Sprintf("%v", this.PerNodeHostBits) + `,`, + `IPv4:` + fmt.Sprintf("%v", this.IPv4) + `,`, + `IPv6:` + fmt.Sprintf("%v", this.IPv6) + `,`, `}`, }, "") return s } -func (this *ServiceCIDR) String() string { +func (this *IPAddress) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ServiceCIDR{`, + s := strings.Join([]string{`&IPAddress{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceCIDRSpec", "ServiceCIDRSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ServiceCIDRStatus", "ServiceCIDRStatus", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "IPAddressSpec", "IPAddressSpec", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } -func (this *ServiceCIDRList) String() string { +func (this *IPAddressList) String() string { if this == nil { return "nil" } - repeatedStringForItems := "[]ServiceCIDR{" + repeatedStringForItems := "[]IPAddress{" for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ServiceCIDR", "ServiceCIDR", 1), `&`, ``, 1) + "," + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "IPAddress", "IPAddress", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{`&ServiceCIDRList{`, + s := strings.Join([]string{`&IPAddressList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } -func (this *ServiceCIDRSpec) String() string { +func (this *IPAddressSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ServiceCIDRSpec{`, - `CIDRs:` + fmt.Sprintf("%v", this.CIDRs) + `,`, + s := strings.Join([]string{`&IPAddressSpec{`, + `ParentRef:` + strings.Replace(this.ParentRef.String(), "ParentReference", "ParentReference", 1) + `,`, `}`, }, "") return s } -func (this *ServiceCIDRStatus) String() string { +func (this *ParentReference) String() string { if this == nil { return "nil" } - repeatedStringForConditions := "[]Condition{" - for _, f := range this.Conditions { - repeatedStringForConditions += fmt.Sprintf("%v", f) + "," - } - repeatedStringForConditions += "}" - s := strings.Join([]string{`&ServiceCIDRStatus{`, - `Conditions:` + repeatedStringForConditions + `,`, + s := strings.Join([]string{`&ParentReference{`, + `Group:` + fmt.Sprintf("%v", this.Group) + `,`, + `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `}`, }, "") return s @@ -915,7 +841,7 @@ func valueToStringGenerated(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } -func (m *IPAddress) Unmarshal(dAtA []byte) error { +func (m *ClusterCIDR) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -938,10 +864,10 @@ func (m *IPAddress) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IPAddress: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterCIDR: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IPAddress: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterCIDR: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1031,7 +957,7 @@ func (m *IPAddress) Unmarshal(dAtA []byte) error { } return nil } -func (m *IPAddressList) Unmarshal(dAtA []byte) error { +func (m *ClusterCIDRList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1054,10 +980,10 @@ func (m *IPAddressList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IPAddressList: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterCIDRList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IPAddressList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterCIDRList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1090,96 +1016,12 @@ func (m *IPAddressList) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, IPAddress{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IPAddressSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IPAddressSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IPAddressSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentRef", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1206,10 +1048,8 @@ func (m *IPAddressSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ParentRef == nil { - m.ParentRef = &ParentReference{} - } - if err := m.ParentRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, ClusterCIDR{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1234,7 +1074,7 @@ func (m *IPAddressSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ParentReference) Unmarshal(dAtA []byte) error { +func (m *ClusterCIDRSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1257,17 +1097,17 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ParentReference: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterCIDRSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ParentReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterCIDRSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1277,29 +1117,33 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Group = string(dAtA[iNdEx:postIndex]) + if m.NodeSelector == nil { + m.NodeSelector = &v11.NodeSelector{} + } + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PerNodeHostBits", wireType) } - var stringLen uint64 + m.PerNodeHostBits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1309,27 +1153,14 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.PerNodeHostBits |= int32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IPv4", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1357,11 +1188,11 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Namespace = string(dAtA[iNdEx:postIndex]) + m.IPv4 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IPv6", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1389,7 +1220,7 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.IPv6 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1412,7 +1243,7 @@ func (m *ParentReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *ServiceCIDR) Unmarshal(dAtA []byte) error { +func (m *IPAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1435,10 +1266,10 @@ func (m *ServiceCIDR) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceCIDR: wiretype end group for non-group") + return fmt.Errorf("proto: IPAddress: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceCIDR: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IPAddress: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1507,39 +1338,6 @@ func (m *ServiceCIDR) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1561,7 +1359,7 @@ func (m *ServiceCIDR) Unmarshal(dAtA []byte) error { } return nil } -func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error { +func (m *IPAddressList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1584,10 +1382,10 @@ func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceCIDRList: wiretype end group for non-group") + return fmt.Errorf("proto: IPAddressList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceCIDRList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IPAddressList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1652,7 +1450,7 @@ func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ServiceCIDR{}) + m.Items = append(m.Items, IPAddress{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1678,7 +1476,7 @@ func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error { +func (m *IPAddressSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1701,17 +1499,17 @@ func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceCIDRSpec: wiretype end group for non-group") + return fmt.Errorf("proto: IPAddressSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceCIDRSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IPAddressSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CIDRs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ParentRef", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1721,23 +1519,27 @@ func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.CIDRs = append(m.CIDRs, string(dAtA[iNdEx:postIndex])) + if m.ParentRef == nil { + m.ParentRef = &ParentReference{} + } + if err := m.ParentRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1760,7 +1562,7 @@ func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ServiceCIDRStatus) Unmarshal(dAtA []byte) error { +func (m *ParentReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1783,17 +1585,17 @@ func (m *ServiceCIDRStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceCIDRStatus: wiretype end group for non-group") + return fmt.Errorf("proto: ParentReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceCIDRStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ParentReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1803,25 +1605,151 @@ func (m *ServiceCIDRStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Conditions = append(m.Conditions, v1.Condition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Group = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.proto b/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.proto index fb7971745d4..0f1f30d7011 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.proto +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/generated.proto @@ -21,6 +21,7 @@ syntax = "proto2"; package k8s.io.api.networking.v1alpha1; +import "k8s.io/api/core/v1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -28,6 +29,69 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". option go_package = "k8s.io/api/networking/v1alpha1"; +// ClusterCIDR represents a single configuration for per-Node Pod CIDR +// allocations when the MultiCIDRRangeAllocator is enabled (see the config for +// kube-controller-manager). A cluster may have any number of ClusterCIDR +// resources, all of which will be considered when allocating a CIDR for a +// Node. A ClusterCIDR is eligible to be used for a given Node when the node +// selector matches the node in question and has free CIDRs to allocate. In +// case of multiple matching ClusterCIDR resources, the allocator will attempt +// to break ties using internal heuristics, but any ClusterCIDR whose node +// selector matches the Node may be used. +message ClusterCIDR { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec is the desired state of the ClusterCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional ClusterCIDRSpec spec = 2; +} + +// ClusterCIDRList contains a list of ClusterCIDR. +message ClusterCIDRList { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of ClusterCIDRs. + repeated ClusterCIDR items = 2; +} + +// ClusterCIDRSpec defines the desired state of ClusterCIDR. +message ClusterCIDRSpec { + // nodeSelector defines which nodes the config is applicable to. + // An empty or nil nodeSelector selects all nodes. + // This field is immutable. + // +optional + optional k8s.io.api.core.v1.NodeSelector nodeSelector = 1; + + // perNodeHostBits defines the number of host bits to be configured per node. + // A subnet mask determines how much of the address is used for network bits + // and host bits. For example an IPv4 address of 192.168.0.0/24, splits the + // address into 24 bits for the network portion and 8 bits for the host portion. + // To allocate 256 IPs, set this field to 8 (a /24 mask for IPv4 or a /120 for IPv6). + // Minimum value is 4 (16 IPs). + // This field is immutable. + // +required + optional int32 perNodeHostBits = 2; + + // ipv4 defines an IPv4 IP block in CIDR notation(e.g. "10.0.0.0/8"). + // At least one of ipv4 and ipv6 must be specified. + // This field is immutable. + // +optional + optional string ipv4 = 3; + + // ipv6 defines an IPv6 IP block in CIDR notation(e.g. "2001:db8::/64"). + // At least one of ipv4 and ipv6 must be specified. + // This field is immutable. + // +optional + optional string ipv6 = 4; +} + // IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs // that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. // An IP address can be represented in different formats, to guarantee the uniqueness of the IP, @@ -83,56 +147,9 @@ message ParentReference { // Name is the name of the object being referenced. // +required optional string name = 4; -} - -// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). -// This range is used to allocate ClusterIPs to Service objects. -message ServiceCIDR { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec is the desired state of the ServiceCIDR. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ServiceCIDRSpec spec = 2; - - // status represents the current state of the ServiceCIDR. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ServiceCIDRStatus status = 3; -} - -// ServiceCIDRList contains a list of ServiceCIDR objects. -message ServiceCIDRList { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of ServiceCIDRs. - repeated ServiceCIDR items = 2; -} - -// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. -message ServiceCIDRSpec { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") - // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. - // This field is immutable. - // +optional - repeated string cidrs = 1; -} -// ServiceCIDRStatus describes the current state of the ServiceCIDR. -message ServiceCIDRStatus { - // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. - // Current service state + // UID is the uid of the object being referenced. // +optional - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + optional string uid = 5; } diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/register.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/register.go index c8f5856b5dc..8dda6394d47 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/register.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/register.go @@ -52,10 +52,10 @@ var ( // Adds the list of known types to the given scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, + &ClusterCIDR{}, + &ClusterCIDRList{}, &IPAddress{}, &IPAddressList{}, - &ServiceCIDR{}, - &ServiceCIDRList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/types.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/types.go index 9d56ca193e6..52e4a11e8b1 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/types.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/types.go @@ -17,9 +17,86 @@ limitations under the License. package v1alpha1 import ( + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.25 + +// ClusterCIDR represents a single configuration for per-Node Pod CIDR +// allocations when the MultiCIDRRangeAllocator is enabled (see the config for +// kube-controller-manager). A cluster may have any number of ClusterCIDR +// resources, all of which will be considered when allocating a CIDR for a +// Node. A ClusterCIDR is eligible to be used for a given Node when the node +// selector matches the node in question and has free CIDRs to allocate. In +// case of multiple matching ClusterCIDR resources, the allocator will attempt +// to break ties using internal heuristics, but any ClusterCIDR whose node +// selector matches the Node may be used. +type ClusterCIDR struct { + metav1.TypeMeta `json:",inline"` + + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec is the desired state of the ClusterCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Spec ClusterCIDRSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// ClusterCIDRSpec defines the desired state of ClusterCIDR. +type ClusterCIDRSpec struct { + // nodeSelector defines which nodes the config is applicable to. + // An empty or nil nodeSelector selects all nodes. + // This field is immutable. + // +optional + NodeSelector *v1.NodeSelector `json:"nodeSelector,omitempty" protobuf:"bytes,1,opt,name=nodeSelector"` + + // perNodeHostBits defines the number of host bits to be configured per node. + // A subnet mask determines how much of the address is used for network bits + // and host bits. For example an IPv4 address of 192.168.0.0/24, splits the + // address into 24 bits for the network portion and 8 bits for the host portion. + // To allocate 256 IPs, set this field to 8 (a /24 mask for IPv4 or a /120 for IPv6). + // Minimum value is 4 (16 IPs). + // This field is immutable. + // +required + PerNodeHostBits int32 `json:"perNodeHostBits" protobuf:"varint,2,opt,name=perNodeHostBits"` + + // ipv4 defines an IPv4 IP block in CIDR notation(e.g. "10.0.0.0/8"). + // At least one of ipv4 and ipv6 must be specified. + // This field is immutable. + // +optional + IPv4 string `json:"ipv4" protobuf:"bytes,3,opt,name=ipv4"` + + // ipv6 defines an IPv6 IP block in CIDR notation(e.g. "2001:db8::/64"). + // At least one of ipv4 and ipv6 must be specified. + // This field is immutable. + // +optional + IPv6 string `json:"ipv6" protobuf:"bytes,4,opt,name=ipv6"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.25 + +// ClusterCIDRList contains a list of ClusterCIDR. +type ClusterCIDRList struct { + metav1.TypeMeta `json:",inline"` + + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is the list of ClusterCIDRs. + Items []ClusterCIDR `json:"items" protobuf:"bytes,2,rep,name=items"` +} + // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -66,6 +143,9 @@ type ParentReference struct { // Name is the name of the object being referenced. // +required Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"` + // UID is the uid of the object being referenced. + // +optional + UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -81,70 +161,3 @@ type IPAddressList struct { // items is the list of IPAddresses. Items []IPAddress `json:"items" protobuf:"bytes,2,rep,name=items"` } - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.27 - -// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). -// This range is used to allocate ClusterIPs to Service objects. -type ServiceCIDR struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // spec is the desired state of the ServiceCIDR. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec ServiceCIDRSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // status represents the current state of the ServiceCIDR. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Status ServiceCIDRStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. -type ServiceCIDRSpec struct { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") - // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. - // This field is immutable. - // +optional - CIDRs []string `json:"cidrs,omitempty" protobuf:"bytes,1,opt,name=cidrs"` -} - -const ( - // ServiceCIDRConditionReady represents status of a ServiceCIDR that is ready to be used by the - // apiserver to allocate ClusterIPs for Services. - ServiceCIDRConditionReady = "Ready" - // ServiceCIDRReasonTerminating represents a reason where a ServiceCIDR is not ready because it is - // being deleted. - ServiceCIDRReasonTerminating = "Terminating" -) - -// ServiceCIDRStatus describes the current state of the ServiceCIDR. -type ServiceCIDRStatus struct { - // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. - // Current service state - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.27 - -// ServiceCIDRList contains a list of ServiceCIDR objects. -type ServiceCIDRList struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // items is the list of ServiceCIDRs. - Items []ServiceCIDR `json:"items" protobuf:"bytes,2,rep,name=items"` -} diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go index 481ec06030b..85304784f4e 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go @@ -27,6 +27,38 @@ package v1alpha1 // Those methods can be generated by using hack/update-codegen.sh // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_ClusterCIDR = map[string]string{ + "": "ClusterCIDR represents a single configuration for per-Node Pod CIDR allocations when the MultiCIDRRangeAllocator is enabled (see the config for kube-controller-manager). A cluster may have any number of ClusterCIDR resources, all of which will be considered when allocating a CIDR for a Node. A ClusterCIDR is eligible to be used for a given Node when the node selector matches the node in question and has free CIDRs to allocate. In case of multiple matching ClusterCIDR resources, the allocator will attempt to break ties using internal heuristics, but any ClusterCIDR whose node selector matches the Node may be used.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (ClusterCIDR) SwaggerDoc() map[string]string { + return map_ClusterCIDR +} + +var map_ClusterCIDRList = map[string]string{ + "": "ClusterCIDRList contains a list of ClusterCIDR.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is the list of ClusterCIDRs.", +} + +func (ClusterCIDRList) SwaggerDoc() map[string]string { + return map_ClusterCIDRList +} + +var map_ClusterCIDRSpec = map[string]string{ + "": "ClusterCIDRSpec defines the desired state of ClusterCIDR.", + "nodeSelector": "nodeSelector defines which nodes the config is applicable to. An empty or nil nodeSelector selects all nodes. This field is immutable.", + "perNodeHostBits": "perNodeHostBits defines the number of host bits to be configured per node. A subnet mask determines how much of the address is used for network bits and host bits. For example an IPv4 address of 192.168.0.0/24, splits the address into 24 bits for the network portion and 8 bits for the host portion. To allocate 256 IPs, set this field to 8 (a /24 mask for IPv4 or a /120 for IPv6). Minimum value is 4 (16 IPs). This field is immutable.", + "ipv4": "ipv4 defines an IPv4 IP block in CIDR notation(e.g. \"10.0.0.0/8\"). At least one of ipv4 and ipv6 must be specified. This field is immutable.", + "ipv6": "ipv6 defines an IPv6 IP block in CIDR notation(e.g. \"2001:db8::/64\"). At least one of ipv4 and ipv6 must be specified. This field is immutable.", +} + +func (ClusterCIDRSpec) SwaggerDoc() map[string]string { + return map_ClusterCIDRSpec +} + var map_IPAddress = map[string]string{ "": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -62,49 +94,11 @@ var map_ParentReference = map[string]string{ "resource": "Resource is the resource of the object being referenced.", "namespace": "Namespace is the namespace of the object being referenced.", "name": "Name is the name of the object being referenced.", + "uid": "UID is the uid of the object being referenced.", } func (ParentReference) SwaggerDoc() map[string]string { return map_ParentReference } -var map_ServiceCIDR = map[string]string{ - "": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - "status": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", -} - -func (ServiceCIDR) SwaggerDoc() map[string]string { - return map_ServiceCIDR -} - -var map_ServiceCIDRList = map[string]string{ - "": "ServiceCIDRList contains a list of ServiceCIDR objects.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "items": "items is the list of ServiceCIDRs.", -} - -func (ServiceCIDRList) SwaggerDoc() map[string]string { - return map_ServiceCIDRList -} - -var map_ServiceCIDRSpec = map[string]string{ - "": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", - "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", -} - -func (ServiceCIDRSpec) SwaggerDoc() map[string]string { - return map_ServiceCIDRSpec -} - -var map_ServiceCIDRStatus = map[string]string{ - "": "ServiceCIDRStatus describes the current state of the ServiceCIDR.", - "conditions": "conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state", -} - -func (ServiceCIDRStatus) SwaggerDoc() map[string]string { - return map_ServiceCIDRStatus -} - // AUTO-GENERATED FUNCTIONS END HERE diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.deepcopy.go index 5c8f697ba36..97db2eacc95 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.deepcopy.go @@ -22,12 +22,12 @@ limitations under the License. package v1alpha1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddress) DeepCopyInto(out *IPAddress) { +func (in *ClusterCIDR) DeepCopyInto(out *ClusterCIDR) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -35,18 +35,18 @@ func (in *IPAddress) DeepCopyInto(out *IPAddress) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddress. -func (in *IPAddress) DeepCopy() *IPAddress { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCIDR. +func (in *ClusterCIDR) DeepCopy() *ClusterCIDR { if in == nil { return nil } - out := new(IPAddress) + out := new(ClusterCIDR) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddress) DeepCopyObject() runtime.Object { +func (in *ClusterCIDR) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -54,13 +54,13 @@ func (in *IPAddress) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { +func (in *ClusterCIDRList) DeepCopyInto(out *ClusterCIDRList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]IPAddress, len(*in)) + *out = make([]ClusterCIDR, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -68,18 +68,18 @@ func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList. -func (in *IPAddressList) DeepCopy() *IPAddressList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCIDRList. +func (in *ClusterCIDRList) DeepCopy() *ClusterCIDRList { if in == nil { return nil } - out := new(IPAddressList) + out := new(ClusterCIDRList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddressList) DeepCopyObject() runtime.Object { +func (in *ClusterCIDRList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -87,64 +87,47 @@ func (in *IPAddressList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { +func (in *ClusterCIDRSpec) DeepCopyInto(out *ClusterCIDRSpec) { *out = *in - if in.ParentRef != nil { - in, out := &in.ParentRef, &out.ParentRef - *out = new(ParentReference) - **out = **in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = new(v1.NodeSelector) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. -func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { - if in == nil { - return nil - } - out := new(IPAddressSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ParentReference) DeepCopyInto(out *ParentReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentReference. -func (in *ParentReference) DeepCopy() *ParentReference { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCIDRSpec. +func (in *ClusterCIDRSpec) DeepCopy() *ClusterCIDRSpec { if in == nil { return nil } - out := new(ParentReference) + out := new(ClusterCIDRSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceCIDR) DeepCopyInto(out *ServiceCIDR) { +func (in *IPAddress) DeepCopyInto(out *IPAddress) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDR. -func (in *ServiceCIDR) DeepCopy() *ServiceCIDR { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddress. +func (in *IPAddress) DeepCopy() *IPAddress { if in == nil { return nil } - out := new(ServiceCIDR) + out := new(IPAddress) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceCIDR) DeepCopyObject() runtime.Object { +func (in *IPAddress) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -152,13 +135,13 @@ func (in *ServiceCIDR) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceCIDRList) DeepCopyInto(out *ServiceCIDRList) { +func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ServiceCIDR, len(*in)) + *out = make([]IPAddress, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -166,18 +149,18 @@ func (in *ServiceCIDRList) DeepCopyInto(out *ServiceCIDRList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRList. -func (in *ServiceCIDRList) DeepCopy() *ServiceCIDRList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList. +func (in *IPAddressList) DeepCopy() *IPAddressList { if in == nil { return nil } - out := new(ServiceCIDRList) + out := new(IPAddressList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceCIDRList) DeepCopyObject() runtime.Object { +func (in *IPAddressList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -185,45 +168,38 @@ func (in *ServiceCIDRList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceCIDRSpec) DeepCopyInto(out *ServiceCIDRSpec) { +func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { *out = *in - if in.CIDRs != nil { - in, out := &in.CIDRs, &out.CIDRs - *out = make([]string, len(*in)) - copy(*out, *in) + if in.ParentRef != nil { + in, out := &in.ParentRef, &out.ParentRef + *out = new(ParentReference) + **out = **in } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRSpec. -func (in *ServiceCIDRSpec) DeepCopy() *ServiceCIDRSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. +func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { if in == nil { return nil } - out := new(ServiceCIDRSpec) + out := new(IPAddressSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceCIDRStatus) DeepCopyInto(out *ServiceCIDRStatus) { +func (in *ParentReference) DeepCopyInto(out *ParentReference) { *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRStatus. -func (in *ServiceCIDRStatus) DeepCopy() *ServiceCIDRStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentReference. +func (in *ParentReference) DeepCopy() *ParentReference { if in == nil { return nil } - out := new(ServiceCIDRStatus) + out := new(ParentReference) in.DeepCopyInto(out) return out } diff --git a/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.prerelease-lifecycle.go b/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.prerelease-lifecycle.go index 714e7b6253b..60438ba59fc 100644 --- a/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.prerelease-lifecycle.go +++ b/upstream/vendor/k8s.io/api/networking/v1alpha1/zz_generated.prerelease-lifecycle.go @@ -23,72 +23,72 @@ package v1alpha1 // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *IPAddress) APILifecycleIntroduced() (major, minor int) { - return 1, 27 +func (in *ClusterCIDR) APILifecycleIntroduced() (major, minor int) { + return 1, 25 } // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *IPAddress) APILifecycleDeprecated() (major, minor int) { - return 1, 30 +func (in *ClusterCIDR) APILifecycleDeprecated() (major, minor int) { + return 1, 28 } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *IPAddress) APILifecycleRemoved() (major, minor int) { - return 1, 33 +func (in *ClusterCIDR) APILifecycleRemoved() (major, minor int) { + return 1, 31 } // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *IPAddressList) APILifecycleIntroduced() (major, minor int) { - return 1, 27 +func (in *ClusterCIDRList) APILifecycleIntroduced() (major, minor int) { + return 1, 25 } // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *IPAddressList) APILifecycleDeprecated() (major, minor int) { - return 1, 30 +func (in *ClusterCIDRList) APILifecycleDeprecated() (major, minor int) { + return 1, 28 } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *IPAddressList) APILifecycleRemoved() (major, minor int) { - return 1, 33 +func (in *ClusterCIDRList) APILifecycleRemoved() (major, minor int) { + return 1, 31 } // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *ServiceCIDR) APILifecycleIntroduced() (major, minor int) { +func (in *IPAddress) APILifecycleIntroduced() (major, minor int) { return 1, 27 } // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *ServiceCIDR) APILifecycleDeprecated() (major, minor int) { +func (in *IPAddress) APILifecycleDeprecated() (major, minor int) { return 1, 30 } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *ServiceCIDR) APILifecycleRemoved() (major, minor int) { +func (in *IPAddress) APILifecycleRemoved() (major, minor int) { return 1, 33 } // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *ServiceCIDRList) APILifecycleIntroduced() (major, minor int) { +func (in *IPAddressList) APILifecycleIntroduced() (major, minor int) { return 1, 27 } // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *ServiceCIDRList) APILifecycleDeprecated() (major, minor int) { +func (in *IPAddressList) APILifecycleDeprecated() (major, minor int) { return 1, 30 } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *ServiceCIDRList) APILifecycleRemoved() (major, minor int) { +func (in *IPAddressList) APILifecycleRemoved() (major, minor int) { return 1, 33 } diff --git a/upstream/vendor/k8s.io/api/policy/v1/doc.go b/upstream/vendor/k8s.io/api/policy/v1/doc.go index 177cdf52368..b46af58e43c 100644 --- a/upstream/vendor/k8s.io/api/policy/v1/doc.go +++ b/upstream/vendor/k8s.io/api/policy/v1/doc.go @@ -19,6 +19,6 @@ limitations under the License. // +k8s:openapi-gen=true // Package policy is for any kind of policy object. Suitable examples, even if -// they aren't all here, are PodDisruptionBudget, +// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, // NetworkPolicy, etc. package v1 // import "k8s.io/api/policy/v1" diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/doc.go b/upstream/vendor/k8s.io/api/policy/v1beta1/doc.go index 76da54b4c73..9e9c7d13abc 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/doc.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/doc.go @@ -20,6 +20,6 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // Package policy is for any kind of policy object. Suitable examples, even if -// they aren't all here, are PodDisruptionBudget, +// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, // NetworkPolicy, etc. package v1beta1 // import "k8s.io/api/policy/v1beta1" diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/generated.pb.go b/upstream/vendor/k8s.io/api/policy/v1beta1/generated.pb.go index efba41b3fda..0b75d641541 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/generated.pb.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/generated.pb.go @@ -26,6 +26,8 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + k8s_io_api_core_v1 "k8s.io/api/core/v1" + v11 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math "math" @@ -47,10 +49,94 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +func (m *AllowedCSIDriver) Reset() { *m = AllowedCSIDriver{} } +func (*AllowedCSIDriver) ProtoMessage() {} +func (*AllowedCSIDriver) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{0} +} +func (m *AllowedCSIDriver) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedCSIDriver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AllowedCSIDriver) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedCSIDriver.Merge(m, src) +} +func (m *AllowedCSIDriver) XXX_Size() int { + return m.Size() +} +func (m *AllowedCSIDriver) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedCSIDriver.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedCSIDriver proto.InternalMessageInfo + +func (m *AllowedFlexVolume) Reset() { *m = AllowedFlexVolume{} } +func (*AllowedFlexVolume) ProtoMessage() {} +func (*AllowedFlexVolume) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{1} +} +func (m *AllowedFlexVolume) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedFlexVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AllowedFlexVolume) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedFlexVolume.Merge(m, src) +} +func (m *AllowedFlexVolume) XXX_Size() int { + return m.Size() +} +func (m *AllowedFlexVolume) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedFlexVolume.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedFlexVolume proto.InternalMessageInfo + +func (m *AllowedHostPath) Reset() { *m = AllowedHostPath{} } +func (*AllowedHostPath) ProtoMessage() {} +func (*AllowedHostPath) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{2} +} +func (m *AllowedHostPath) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedHostPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AllowedHostPath) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedHostPath.Merge(m, src) +} +func (m *AllowedHostPath) XXX_Size() int { + return m.Size() +} +func (m *AllowedHostPath) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedHostPath.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedHostPath proto.InternalMessageInfo + func (m *Eviction) Reset() { *m = Eviction{} } func (*Eviction) ProtoMessage() {} func (*Eviction) Descriptor() ([]byte, []int) { - return fileDescriptor_014060e454a820dc, []int{0} + return fileDescriptor_014060e454a820dc, []int{3} } func (m *Eviction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,10 +161,94 @@ func (m *Eviction) XXX_DiscardUnknown() { var xxx_messageInfo_Eviction proto.InternalMessageInfo +func (m *FSGroupStrategyOptions) Reset() { *m = FSGroupStrategyOptions{} } +func (*FSGroupStrategyOptions) ProtoMessage() {} +func (*FSGroupStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{4} +} +func (m *FSGroupStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FSGroupStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FSGroupStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_FSGroupStrategyOptions.Merge(m, src) +} +func (m *FSGroupStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *FSGroupStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_FSGroupStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_FSGroupStrategyOptions proto.InternalMessageInfo + +func (m *HostPortRange) Reset() { *m = HostPortRange{} } +func (*HostPortRange) ProtoMessage() {} +func (*HostPortRange) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{5} +} +func (m *HostPortRange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HostPortRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HostPortRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostPortRange.Merge(m, src) +} +func (m *HostPortRange) XXX_Size() int { + return m.Size() +} +func (m *HostPortRange) XXX_DiscardUnknown() { + xxx_messageInfo_HostPortRange.DiscardUnknown(m) +} + +var xxx_messageInfo_HostPortRange proto.InternalMessageInfo + +func (m *IDRange) Reset() { *m = IDRange{} } +func (*IDRange) ProtoMessage() {} +func (*IDRange) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{6} +} +func (m *IDRange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IDRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IDRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_IDRange.Merge(m, src) +} +func (m *IDRange) XXX_Size() int { + return m.Size() +} +func (m *IDRange) XXX_DiscardUnknown() { + xxx_messageInfo_IDRange.DiscardUnknown(m) +} + +var xxx_messageInfo_IDRange proto.InternalMessageInfo + func (m *PodDisruptionBudget) Reset() { *m = PodDisruptionBudget{} } func (*PodDisruptionBudget) ProtoMessage() {} func (*PodDisruptionBudget) Descriptor() ([]byte, []int) { - return fileDescriptor_014060e454a820dc, []int{1} + return fileDescriptor_014060e454a820dc, []int{7} } func (m *PodDisruptionBudget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,7 +276,7 @@ var xxx_messageInfo_PodDisruptionBudget proto.InternalMessageInfo func (m *PodDisruptionBudgetList) Reset() { *m = PodDisruptionBudgetList{} } func (*PodDisruptionBudgetList) ProtoMessage() {} func (*PodDisruptionBudgetList) Descriptor() ([]byte, []int) { - return fileDescriptor_014060e454a820dc, []int{2} + return fileDescriptor_014060e454a820dc, []int{8} } func (m *PodDisruptionBudgetList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,7 +304,7 @@ var xxx_messageInfo_PodDisruptionBudgetList proto.InternalMessageInfo func (m *PodDisruptionBudgetSpec) Reset() { *m = PodDisruptionBudgetSpec{} } func (*PodDisruptionBudgetSpec) ProtoMessage() {} func (*PodDisruptionBudgetSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_014060e454a820dc, []int{3} + return fileDescriptor_014060e454a820dc, []int{9} } func (m *PodDisruptionBudgetSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -162,7 +332,7 @@ var xxx_messageInfo_PodDisruptionBudgetSpec proto.InternalMessageInfo func (m *PodDisruptionBudgetStatus) Reset() { *m = PodDisruptionBudgetStatus{} } func (*PodDisruptionBudgetStatus) ProtoMessage() {} func (*PodDisruptionBudgetStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_014060e454a820dc, []int{4} + return fileDescriptor_014060e454a820dc, []int{10} } func (m *PodDisruptionBudgetStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -187,13 +357,251 @@ func (m *PodDisruptionBudgetStatus) XXX_DiscardUnknown() { var xxx_messageInfo_PodDisruptionBudgetStatus proto.InternalMessageInfo +func (m *PodSecurityPolicy) Reset() { *m = PodSecurityPolicy{} } +func (*PodSecurityPolicy) ProtoMessage() {} +func (*PodSecurityPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{11} +} +func (m *PodSecurityPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSecurityPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodSecurityPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSecurityPolicy.Merge(m, src) +} +func (m *PodSecurityPolicy) XXX_Size() int { + return m.Size() +} +func (m *PodSecurityPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_PodSecurityPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSecurityPolicy proto.InternalMessageInfo + +func (m *PodSecurityPolicyList) Reset() { *m = PodSecurityPolicyList{} } +func (*PodSecurityPolicyList) ProtoMessage() {} +func (*PodSecurityPolicyList) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{12} +} +func (m *PodSecurityPolicyList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSecurityPolicyList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodSecurityPolicyList) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSecurityPolicyList.Merge(m, src) +} +func (m *PodSecurityPolicyList) XXX_Size() int { + return m.Size() +} +func (m *PodSecurityPolicyList) XXX_DiscardUnknown() { + xxx_messageInfo_PodSecurityPolicyList.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSecurityPolicyList proto.InternalMessageInfo + +func (m *PodSecurityPolicySpec) Reset() { *m = PodSecurityPolicySpec{} } +func (*PodSecurityPolicySpec) ProtoMessage() {} +func (*PodSecurityPolicySpec) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{13} +} +func (m *PodSecurityPolicySpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSecurityPolicySpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodSecurityPolicySpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSecurityPolicySpec.Merge(m, src) +} +func (m *PodSecurityPolicySpec) XXX_Size() int { + return m.Size() +} +func (m *PodSecurityPolicySpec) XXX_DiscardUnknown() { + xxx_messageInfo_PodSecurityPolicySpec.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSecurityPolicySpec proto.InternalMessageInfo + +func (m *RunAsGroupStrategyOptions) Reset() { *m = RunAsGroupStrategyOptions{} } +func (*RunAsGroupStrategyOptions) ProtoMessage() {} +func (*RunAsGroupStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{14} +} +func (m *RunAsGroupStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RunAsGroupStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RunAsGroupStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_RunAsGroupStrategyOptions.Merge(m, src) +} +func (m *RunAsGroupStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *RunAsGroupStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_RunAsGroupStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_RunAsGroupStrategyOptions proto.InternalMessageInfo + +func (m *RunAsUserStrategyOptions) Reset() { *m = RunAsUserStrategyOptions{} } +func (*RunAsUserStrategyOptions) ProtoMessage() {} +func (*RunAsUserStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{15} +} +func (m *RunAsUserStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RunAsUserStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RunAsUserStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_RunAsUserStrategyOptions.Merge(m, src) +} +func (m *RunAsUserStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *RunAsUserStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_RunAsUserStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_RunAsUserStrategyOptions proto.InternalMessageInfo + +func (m *RuntimeClassStrategyOptions) Reset() { *m = RuntimeClassStrategyOptions{} } +func (*RuntimeClassStrategyOptions) ProtoMessage() {} +func (*RuntimeClassStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{16} +} +func (m *RuntimeClassStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuntimeClassStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RuntimeClassStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuntimeClassStrategyOptions.Merge(m, src) +} +func (m *RuntimeClassStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *RuntimeClassStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_RuntimeClassStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_RuntimeClassStrategyOptions proto.InternalMessageInfo + +func (m *SELinuxStrategyOptions) Reset() { *m = SELinuxStrategyOptions{} } +func (*SELinuxStrategyOptions) ProtoMessage() {} +func (*SELinuxStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{17} +} +func (m *SELinuxStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SELinuxStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SELinuxStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_SELinuxStrategyOptions.Merge(m, src) +} +func (m *SELinuxStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *SELinuxStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_SELinuxStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_SELinuxStrategyOptions proto.InternalMessageInfo + +func (m *SupplementalGroupsStrategyOptions) Reset() { *m = SupplementalGroupsStrategyOptions{} } +func (*SupplementalGroupsStrategyOptions) ProtoMessage() {} +func (*SupplementalGroupsStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_014060e454a820dc, []int{18} +} +func (m *SupplementalGroupsStrategyOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SupplementalGroupsStrategyOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SupplementalGroupsStrategyOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_SupplementalGroupsStrategyOptions.Merge(m, src) +} +func (m *SupplementalGroupsStrategyOptions) XXX_Size() int { + return m.Size() +} +func (m *SupplementalGroupsStrategyOptions) XXX_DiscardUnknown() { + xxx_messageInfo_SupplementalGroupsStrategyOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_SupplementalGroupsStrategyOptions proto.InternalMessageInfo + func init() { + proto.RegisterType((*AllowedCSIDriver)(nil), "k8s.io.api.policy.v1beta1.AllowedCSIDriver") + proto.RegisterType((*AllowedFlexVolume)(nil), "k8s.io.api.policy.v1beta1.AllowedFlexVolume") + proto.RegisterType((*AllowedHostPath)(nil), "k8s.io.api.policy.v1beta1.AllowedHostPath") proto.RegisterType((*Eviction)(nil), "k8s.io.api.policy.v1beta1.Eviction") + proto.RegisterType((*FSGroupStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.FSGroupStrategyOptions") + proto.RegisterType((*HostPortRange)(nil), "k8s.io.api.policy.v1beta1.HostPortRange") + proto.RegisterType((*IDRange)(nil), "k8s.io.api.policy.v1beta1.IDRange") proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudget") proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetList") proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetSpec") proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetStatus") proto.RegisterMapType((map[string]v1.Time)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetStatus.DisruptedPodsEntry") + proto.RegisterType((*PodSecurityPolicy)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicy") + proto.RegisterType((*PodSecurityPolicyList)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicyList") + proto.RegisterType((*PodSecurityPolicySpec)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicySpec") + proto.RegisterType((*RunAsGroupStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.RunAsGroupStrategyOptions") + proto.RegisterType((*RunAsUserStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.RunAsUserStrategyOptions") + proto.RegisterType((*RuntimeClassStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.RuntimeClassStrategyOptions") + proto.RegisterType((*SELinuxStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.SELinuxStrategyOptions") + proto.RegisterType((*SupplementalGroupsStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.SupplementalGroupsStrategyOptions") } func init() { @@ -201,64 +609,132 @@ func init() { } var fileDescriptor_014060e454a820dc = []byte{ - // 857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0xc7, 0x45, 0xcb, 0x72, 0x9d, 0xad, 0x24, 0xb8, 0xdb, 0x2f, 0x5b, 0x07, 0x2a, 0xd0, 0x29, - 0x28, 0xd0, 0x65, 0x9d, 0x04, 0x85, 0xd1, 0x43, 0x9b, 0x30, 0x32, 0xd2, 0x14, 0x31, 0x6c, 0xac, - 0x9c, 0x4b, 0x91, 0x02, 0x5d, 0x91, 0x13, 0x69, 0x2b, 0x92, 0x4b, 0x70, 0x97, 0x6c, 0x74, 0xcb, - 0xa1, 0x0f, 0xd0, 0xf7, 0xe8, 0x83, 0xd4, 0x87, 0x1e, 0xd2, 0x5b, 0xd0, 0x83, 0x50, 0xb3, 0x6f, - 0xd1, 0x53, 0xc1, 0x25, 0xf5, 0x41, 0x7d, 0x34, 0x4a, 0x0e, 0xb9, 0x71, 0x67, 0xe6, 0xff, 0x1b, - 0xce, 0xc7, 0x52, 0x42, 0xf6, 0xe8, 0x44, 0x12, 0x2e, 0xac, 0x51, 0xdc, 0x87, 0x28, 0x00, 0x05, - 0xd2, 0x4a, 0x20, 0x70, 0x45, 0x64, 0x15, 0x0e, 0x16, 0x72, 0x2b, 0x14, 0x1e, 0x77, 0xc6, 0x56, - 0x72, 0xdc, 0x07, 0xc5, 0x8e, 0xad, 0x01, 0x04, 0x10, 0x31, 0x05, 0x2e, 0x09, 0x23, 0xa1, 0x04, - 0x3e, 0xca, 0x43, 0x09, 0x0b, 0x39, 0xc9, 0x43, 0x49, 0x11, 0xda, 0xfa, 0x7c, 0xc0, 0xd5, 0x30, - 0xee, 0x13, 0x47, 0xf8, 0xd6, 0x40, 0x0c, 0x84, 0xa5, 0x15, 0xfd, 0xf8, 0x99, 0x3e, 0xe9, 0x83, - 0x7e, 0xca, 0x49, 0xad, 0xbb, 0xf3, 0xa4, 0x3e, 0x73, 0x86, 0x3c, 0x80, 0x68, 0x6c, 0x85, 0xa3, - 0x41, 0x66, 0x90, 0x96, 0x0f, 0x8a, 0x59, 0xc9, 0x4a, 0xfe, 0x96, 0xb5, 0x49, 0x15, 0xc5, 0x81, - 0xe2, 0x3e, 0xac, 0x08, 0xbe, 0x7c, 0x9d, 0x40, 0x3a, 0x43, 0xf0, 0xd9, 0x8a, 0xee, 0xce, 0x26, - 0x5d, 0xac, 0xb8, 0x67, 0xf1, 0x40, 0x49, 0x15, 0x2d, 0x8b, 0x3a, 0x7f, 0x19, 0x68, 0xff, 0x34, - 0xe1, 0x8e, 0xe2, 0x22, 0xc0, 0x3f, 0xa2, 0xfd, 0xac, 0x0a, 0x97, 0x29, 0x76, 0x68, 0xdc, 0x34, - 0x6e, 0xbd, 0x7f, 0xfb, 0x0b, 0x32, 0xef, 0xde, 0x0c, 0x4a, 0xc2, 0xd1, 0x20, 0x33, 0x48, 0x92, - 0x45, 0x93, 0xe4, 0x98, 0x9c, 0xf7, 0x7f, 0x02, 0x47, 0x9d, 0x81, 0x62, 0x36, 0xbe, 0x9a, 0xb4, - 0x2b, 0xe9, 0xa4, 0x8d, 0xe6, 0x36, 0x3a, 0xa3, 0x62, 0x0f, 0x35, 0x5c, 0xf0, 0x40, 0xc1, 0x79, - 0x98, 0x65, 0x94, 0x87, 0x3b, 0x3a, 0xcd, 0x9d, 0xed, 0xd2, 0x74, 0x17, 0xa5, 0xf6, 0x07, 0xe9, - 0xa4, 0xdd, 0x28, 0x99, 0x68, 0x19, 0xde, 0xf9, 0x6d, 0x07, 0x7d, 0x78, 0x21, 0xdc, 0x2e, 0x97, - 0x51, 0xac, 0x4d, 0x76, 0xec, 0x0e, 0x40, 0xbd, 0x83, 0x3a, 0x2f, 0xd1, 0xae, 0x0c, 0xc1, 0x29, - 0xca, 0xbb, 0x4d, 0x36, 0xee, 0x20, 0x59, 0xf3, 0x7e, 0xbd, 0x10, 0x1c, 0xbb, 0x5e, 0xf0, 0x77, - 0xb3, 0x13, 0xd5, 0x34, 0xfc, 0x14, 0xed, 0x49, 0xc5, 0x54, 0x2c, 0x0f, 0xab, 0x9a, 0x7b, 0xf7, - 0x0d, 0xb9, 0x5a, 0x6b, 0x37, 0x0b, 0xf2, 0x5e, 0x7e, 0xa6, 0x05, 0xb3, 0xf3, 0x87, 0x81, 0x3e, - 0x5d, 0xa3, 0x7a, 0xcc, 0xa5, 0xc2, 0x4f, 0x57, 0x3a, 0x46, 0xb6, 0xeb, 0x58, 0xa6, 0xd6, 0xfd, - 0x3a, 0x28, 0xb2, 0xee, 0x4f, 0x2d, 0x0b, 0xdd, 0xea, 0xa1, 0x1a, 0x57, 0xe0, 0x67, 0xdb, 0x50, - 0x5d, 0x42, 0x6f, 0x51, 0x96, 0xdd, 0x28, 0xd0, 0xb5, 0x47, 0x19, 0x84, 0xe6, 0xac, 0xce, 0x9f, - 0xd5, 0xb5, 0xe5, 0x64, 0xed, 0xc4, 0xcf, 0x50, 0xdd, 0xe7, 0xc1, 0xfd, 0x84, 0x71, 0x8f, 0xf5, - 0x3d, 0x78, 0xed, 0x12, 0x64, 0x37, 0x88, 0xe4, 0x37, 0x88, 0x3c, 0x0a, 0xd4, 0x79, 0xd4, 0x53, - 0x11, 0x0f, 0x06, 0xf6, 0x41, 0x3a, 0x69, 0xd7, 0xcf, 0x16, 0x48, 0xb4, 0xc4, 0xc5, 0x3f, 0xa0, - 0x7d, 0x09, 0x1e, 0x38, 0x4a, 0x44, 0x6f, 0xb6, 0xe9, 0x8f, 0x59, 0x1f, 0xbc, 0x5e, 0x21, 0xb5, - 0xeb, 0x59, 0xdf, 0xa6, 0x27, 0x3a, 0x43, 0x62, 0x0f, 0x35, 0x7d, 0xf6, 0xfc, 0x49, 0xc0, 0x66, - 0x85, 0x54, 0xdf, 0xb2, 0x10, 0x9c, 0x4e, 0xda, 0xcd, 0xb3, 0x12, 0x8b, 0x2e, 0xb1, 0xf1, 0x0b, - 0x03, 0xb5, 0xe2, 0x60, 0x08, 0xcc, 0x53, 0xc3, 0xf1, 0x85, 0x70, 0xa7, 0x9f, 0x8d, 0x0b, 0x3d, - 0xa1, 0xc3, 0xdd, 0x9b, 0xc6, 0xad, 0x1b, 0xf6, 0xbd, 0x74, 0xd2, 0x6e, 0x3d, 0xd9, 0x18, 0xf5, - 0xef, 0xa4, 0x6d, 0x6e, 0xf6, 0x5e, 0x8e, 0x43, 0xa0, 0xff, 0x93, 0xa3, 0xf3, 0x7b, 0x0d, 0x1d, - 0x6d, 0x5c, 0x6c, 0xfc, 0x1d, 0xc2, 0xa2, 0x2f, 0x21, 0x4a, 0xc0, 0x7d, 0x98, 0x7f, 0xe6, 0xb8, - 0x08, 0xf4, 0x6c, 0xab, 0x76, 0xab, 0xd8, 0x11, 0x7c, 0xbe, 0x12, 0x41, 0xd7, 0xa8, 0xf0, 0x2f, - 0x06, 0x6a, 0xb8, 0x79, 0x1a, 0x70, 0x2f, 0x84, 0x3b, 0xdd, 0xcd, 0x87, 0x6f, 0x73, 0xe5, 0x48, - 0x77, 0x91, 0x74, 0x1a, 0xa8, 0x68, 0x6c, 0x7f, 0x5c, 0xbc, 0x50, 0xa3, 0xe4, 0xa3, 0xe5, 0xa4, - 0x59, 0x49, 0xee, 0x0c, 0x29, 0xef, 0x7b, 0x9e, 0xf8, 0x19, 0x5c, 0x3d, 0xe5, 0xda, 0xbc, 0xa4, - 0xee, 0x4a, 0x04, 0x5d, 0xa3, 0xc2, 0x5f, 0xa3, 0xa6, 0x13, 0x47, 0x11, 0x04, 0xea, 0xdb, 0xbc, - 0xbf, 0x7a, 0x64, 0x35, 0xfb, 0x93, 0x82, 0xd3, 0x7c, 0x50, 0xf2, 0xd2, 0xa5, 0xe8, 0x4c, 0xef, - 0x82, 0xe4, 0x11, 0xb8, 0x53, 0x7d, 0xad, 0xac, 0xef, 0x96, 0xbc, 0x74, 0x29, 0x1a, 0x9f, 0xa0, - 0x3a, 0x3c, 0x0f, 0xc1, 0x99, 0x36, 0x74, 0x4f, 0xab, 0x3f, 0x2a, 0xd4, 0xf5, 0xd3, 0x05, 0x1f, - 0x2d, 0x45, 0x62, 0x07, 0x21, 0x47, 0x04, 0x2e, 0xcf, 0x7f, 0x32, 0xde, 0xd3, 0x83, 0xb0, 0xb6, - 0xbb, 0x48, 0x0f, 0xa6, 0xba, 0xf9, 0x07, 0x7b, 0x66, 0x92, 0x74, 0x01, 0xdb, 0xf2, 0x10, 0x5e, - 0x1d, 0x13, 0x3e, 0x40, 0xd5, 0x11, 0x8c, 0xf5, 0x12, 0xdd, 0xa0, 0xd9, 0x23, 0xbe, 0x87, 0x6a, - 0x09, 0xf3, 0x62, 0x28, 0x2e, 0xf4, 0x67, 0xdb, 0xbd, 0xc7, 0x25, 0xf7, 0x81, 0xe6, 0xc2, 0xaf, - 0x76, 0x4e, 0x0c, 0xfb, 0x9b, 0xab, 0x6b, 0xb3, 0xf2, 0xf2, 0xda, 0xac, 0xbc, 0xba, 0x36, 0x2b, - 0x2f, 0x52, 0xd3, 0xb8, 0x4a, 0x4d, 0xe3, 0x65, 0x6a, 0x1a, 0xaf, 0x52, 0xd3, 0xf8, 0x3b, 0x35, - 0x8d, 0x5f, 0xff, 0x31, 0x2b, 0xdf, 0x1f, 0x6d, 0xfc, 0x9b, 0xf3, 0x5f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x96, 0x9a, 0x3a, 0xb5, 0x1b, 0x09, 0x00, 0x00, + // 1946 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x5b, 0x73, 0xdb, 0xc6, + 0x15, 0x16, 0x4c, 0x5d, 0xa8, 0xd5, 0xc5, 0xe2, 0xea, 0x62, 0x48, 0x69, 0x08, 0x07, 0x99, 0xe9, + 0xb8, 0x69, 0x0a, 0xc6, 0xb2, 0xe3, 0x7a, 0x9a, 0x5e, 0x2c, 0x88, 0x92, 0xad, 0x8c, 0x65, 0xb1, + 0x4b, 0x2b, 0xd3, 0x76, 0xdc, 0x4e, 0x97, 0xc0, 0x8a, 0x44, 0x04, 0x02, 0x28, 0x76, 0xc1, 0x88, + 0x6f, 0x79, 0xe8, 0x43, 0x1f, 0xfb, 0x07, 0x32, 0xfd, 0x01, 0x9d, 0x3e, 0xf5, 0x47, 0xd4, 0x99, + 0xe9, 0x74, 0xd2, 0xb7, 0x4c, 0x1f, 0x38, 0x35, 0xfb, 0x2f, 0xfc, 0xd4, 0xc1, 0x72, 0x01, 0x12, + 0x37, 0xd2, 0xce, 0x8c, 0xfd, 0x46, 0xec, 0xf9, 0xbe, 0xef, 0xec, 0x9e, 0xdd, 0x3d, 0x67, 0x77, + 0x09, 0xf4, 0xcb, 0xfb, 0x54, 0xb3, 0xdc, 0xda, 0x65, 0xd0, 0x22, 0xbe, 0x43, 0x18, 0xa1, 0xb5, + 0x1e, 0x71, 0x4c, 0xd7, 0xaf, 0x09, 0x03, 0xf6, 0xac, 0x9a, 0xe7, 0xda, 0x96, 0xd1, 0xaf, 0xf5, + 0x6e, 0xb7, 0x08, 0xc3, 0xb7, 0x6b, 0x6d, 0xe2, 0x10, 0x1f, 0x33, 0x62, 0x6a, 0x9e, 0xef, 0x32, + 0x17, 0xee, 0x8e, 0xa0, 0x1a, 0xf6, 0x2c, 0x6d, 0x04, 0xd5, 0x04, 0x74, 0xef, 0x47, 0x6d, 0x8b, + 0x75, 0x82, 0x96, 0x66, 0xb8, 0xdd, 0x5a, 0xdb, 0x6d, 0xbb, 0x35, 0xce, 0x68, 0x05, 0x17, 0xfc, + 0x8b, 0x7f, 0xf0, 0x5f, 0x23, 0xa5, 0x3d, 0x75, 0xc2, 0xa9, 0xe1, 0xfa, 0xa4, 0xd6, 0xcb, 0x78, + 0xdb, 0xbb, 0x3b, 0xc6, 0x74, 0xb1, 0xd1, 0xb1, 0x1c, 0xe2, 0xf7, 0x6b, 0xde, 0x65, 0x3b, 0x6c, + 0xa0, 0xb5, 0x2e, 0x61, 0x38, 0x8f, 0x55, 0x2b, 0x62, 0xf9, 0x81, 0xc3, 0xac, 0x2e, 0xc9, 0x10, + 0xee, 0xcd, 0x22, 0x50, 0xa3, 0x43, 0xba, 0x38, 0xc3, 0xbb, 0x53, 0xc4, 0x0b, 0x98, 0x65, 0xd7, + 0x2c, 0x87, 0x51, 0xe6, 0xa7, 0x49, 0xea, 0x5d, 0xb0, 0x71, 0x60, 0xdb, 0xee, 0x17, 0xc4, 0x3c, + 0x6c, 0x9e, 0xd4, 0x7d, 0xab, 0x47, 0x7c, 0x78, 0x13, 0xcc, 0x3b, 0xb8, 0x4b, 0x64, 0xe9, 0xa6, + 0x74, 0x6b, 0x59, 0x5f, 0x7d, 0x3e, 0x50, 0xe6, 0x86, 0x03, 0x65, 0xfe, 0x09, 0xee, 0x12, 0xc4, + 0x2d, 0xea, 0x27, 0xa0, 0x22, 0x58, 0xc7, 0x36, 0xb9, 0xfa, 0xcc, 0xb5, 0x83, 0x2e, 0x81, 0xdf, + 0x07, 0x8b, 0x26, 0x17, 0x10, 0xc4, 0x75, 0x41, 0x5c, 0x1c, 0xc9, 0x22, 0x61, 0x55, 0x29, 0xb8, + 0x2e, 0xc8, 0x8f, 0x5c, 0xca, 0x1a, 0x98, 0x75, 0xe0, 0x3e, 0x00, 0x1e, 0x66, 0x9d, 0x86, 0x4f, + 0x2e, 0xac, 0x2b, 0x41, 0x87, 0x82, 0x0e, 0x1a, 0xb1, 0x05, 0x4d, 0xa0, 0xe0, 0x87, 0xa0, 0xec, + 0x13, 0x6c, 0x9e, 0x39, 0x76, 0x5f, 0xbe, 0x76, 0x53, 0xba, 0x55, 0xd6, 0x37, 0x04, 0xa3, 0x8c, + 0x44, 0x3b, 0x8a, 0x11, 0xea, 0x7f, 0x24, 0x50, 0x3e, 0xea, 0x59, 0x06, 0xb3, 0x5c, 0x07, 0xfe, + 0x1e, 0x94, 0xc3, 0xd9, 0x32, 0x31, 0xc3, 0xdc, 0xd9, 0xca, 0xfe, 0x47, 0xda, 0x78, 0x25, 0xc5, + 0xc1, 0xd3, 0xbc, 0xcb, 0x76, 0xd8, 0x40, 0xb5, 0x10, 0xad, 0xf5, 0x6e, 0x6b, 0x67, 0xad, 0xcf, + 0x89, 0xc1, 0x4e, 0x09, 0xc3, 0xe3, 0xee, 0x8d, 0xdb, 0x50, 0xac, 0x0a, 0x6d, 0xb0, 0x66, 0x12, + 0x9b, 0x30, 0x72, 0xe6, 0x85, 0x1e, 0x29, 0xef, 0xe1, 0xca, 0xfe, 0x9d, 0x57, 0x73, 0x53, 0x9f, + 0xa4, 0xea, 0x95, 0xe1, 0x40, 0x59, 0x4b, 0x34, 0xa1, 0xa4, 0xb8, 0xfa, 0x95, 0x04, 0x76, 0x8e, + 0x9b, 0x0f, 0x7d, 0x37, 0xf0, 0x9a, 0x2c, 0x9c, 0xdd, 0x76, 0x5f, 0x98, 0xe0, 0x8f, 0xc1, 0xbc, + 0x1f, 0xd8, 0xd1, 0x5c, 0xbe, 0x1f, 0xcd, 0x25, 0x0a, 0x6c, 0xf2, 0x72, 0xa0, 0x6c, 0xa6, 0x58, + 0x4f, 0xfb, 0x1e, 0x41, 0x9c, 0x00, 0x3f, 0x05, 0x8b, 0x3e, 0x76, 0xda, 0x24, 0xec, 0x7a, 0xe9, + 0xd6, 0xca, 0xbe, 0xaa, 0x15, 0xee, 0x35, 0xed, 0xa4, 0x8e, 0x42, 0xe8, 0x78, 0xc6, 0xf9, 0x27, + 0x45, 0x42, 0x41, 0x3d, 0x05, 0x6b, 0x7c, 0xaa, 0x5d, 0x9f, 0x71, 0x0b, 0x7c, 0x17, 0x94, 0xba, + 0x96, 0xc3, 0x3b, 0xb5, 0xa0, 0xaf, 0x08, 0x56, 0xe9, 0xd4, 0x72, 0x50, 0xd8, 0xce, 0xcd, 0xf8, + 0x8a, 0xc7, 0x6c, 0xd2, 0x8c, 0xaf, 0x50, 0xd8, 0xae, 0x3e, 0x04, 0x4b, 0xc2, 0xe3, 0xa4, 0x50, + 0x69, 0xba, 0x50, 0x29, 0x47, 0xe8, 0xaf, 0xd7, 0xc0, 0x66, 0xc3, 0x35, 0xeb, 0x16, 0xf5, 0x03, + 0x1e, 0x2f, 0x3d, 0x30, 0xdb, 0x84, 0xbd, 0x85, 0xf5, 0xf1, 0x14, 0xcc, 0x53, 0x8f, 0x18, 0x62, + 0x59, 0xec, 0x4f, 0x89, 0x6d, 0x4e, 0xff, 0x9a, 0x1e, 0x31, 0xc6, 0xdb, 0x32, 0xfc, 0x42, 0x5c, + 0x0d, 0x3e, 0x03, 0x8b, 0x94, 0x61, 0x16, 0x50, 0xb9, 0xc4, 0x75, 0xef, 0xbe, 0xa6, 0x2e, 0xe7, + 0x8e, 0x67, 0x71, 0xf4, 0x8d, 0x84, 0xa6, 0xfa, 0x4f, 0x09, 0xdc, 0xc8, 0x61, 0x3d, 0xb6, 0x28, + 0x83, 0xcf, 0x32, 0x11, 0xd3, 0x5e, 0x2d, 0x62, 0x21, 0x9b, 0xc7, 0x2b, 0xde, 0xbc, 0x51, 0xcb, + 0x44, 0xb4, 0x9a, 0x60, 0xc1, 0x62, 0xa4, 0x1b, 0x2d, 0x45, 0xed, 0xf5, 0x86, 0xa5, 0xaf, 0x09, + 0xe9, 0x85, 0x93, 0x50, 0x04, 0x8d, 0xb4, 0xd4, 0x7f, 0x97, 0x72, 0x87, 0x13, 0x86, 0x13, 0x5e, + 0x80, 0xd5, 0xae, 0xe5, 0x1c, 0xf4, 0xb0, 0x65, 0xe3, 0x96, 0xd8, 0x3d, 0xd3, 0x16, 0x41, 0x98, + 0x61, 0xb5, 0x51, 0x86, 0xd5, 0x4e, 0x1c, 0x76, 0xe6, 0x37, 0x99, 0x6f, 0x39, 0x6d, 0x7d, 0x63, + 0x38, 0x50, 0x56, 0x4f, 0x27, 0x94, 0x50, 0x42, 0x17, 0xfe, 0x16, 0x94, 0x29, 0xb1, 0x89, 0xc1, + 0x5c, 0xff, 0xf5, 0x32, 0xc4, 0x63, 0xdc, 0x22, 0x76, 0x53, 0x50, 0xf5, 0xd5, 0x30, 0x6e, 0xd1, + 0x17, 0x8a, 0x25, 0xa1, 0x0d, 0xd6, 0xbb, 0xf8, 0xea, 0xdc, 0xc1, 0xf1, 0x40, 0x4a, 0xdf, 0x71, + 0x20, 0x70, 0x38, 0x50, 0xd6, 0x4f, 0x13, 0x5a, 0x28, 0xa5, 0x0d, 0xbf, 0x94, 0xc0, 0x5e, 0xe0, + 0x74, 0x08, 0xb6, 0x59, 0xa7, 0xdf, 0x70, 0xcd, 0x28, 0xdd, 0x36, 0xf8, 0x0c, 0xc9, 0xf3, 0x3c, + 0x03, 0x3d, 0x18, 0x0e, 0x94, 0xbd, 0xf3, 0x42, 0xd4, 0xcb, 0x81, 0x52, 0x2d, 0xb6, 0xf2, 0xf4, + 0x34, 0xc5, 0x87, 0xfa, 0x8f, 0x05, 0xb0, 0x5b, 0xb8, 0xb0, 0xe1, 0xa7, 0x00, 0xba, 0x2d, 0x4a, + 0xfc, 0x1e, 0x31, 0x1f, 0x8e, 0xca, 0xa0, 0xe5, 0x46, 0xb9, 0x63, 0x4f, 0xac, 0x11, 0x78, 0x96, + 0x41, 0xa0, 0x1c, 0x16, 0xfc, 0xa3, 0x04, 0xd6, 0xcc, 0x91, 0x1b, 0x62, 0x36, 0x5c, 0x33, 0x5a, + 0x9b, 0x0f, 0xbf, 0xcb, 0x96, 0xd3, 0xea, 0x93, 0x4a, 0x47, 0x0e, 0xf3, 0xfb, 0xfa, 0xb6, 0xe8, + 0xd0, 0x5a, 0xc2, 0x86, 0x92, 0x4e, 0xc3, 0x21, 0x99, 0xb1, 0x24, 0x15, 0x65, 0x95, 0xcf, 0xf2, + 0xc2, 0x78, 0x48, 0xf5, 0x0c, 0x02, 0xe5, 0xb0, 0xe0, 0xcf, 0xc1, 0xba, 0x11, 0xf8, 0x3e, 0x71, + 0xd8, 0xa3, 0x51, 0x7c, 0xf9, 0x94, 0x2d, 0xe8, 0x3b, 0x42, 0x67, 0xfd, 0x30, 0x61, 0x45, 0x29, + 0x74, 0xc8, 0x37, 0x09, 0xb5, 0x7c, 0x62, 0x46, 0xfc, 0x85, 0x24, 0xbf, 0x9e, 0xb0, 0xa2, 0x14, + 0x1a, 0xde, 0x07, 0xab, 0xe4, 0xca, 0x23, 0x46, 0x14, 0xd0, 0x45, 0xce, 0xde, 0x12, 0xec, 0xd5, + 0xa3, 0x09, 0x1b, 0x4a, 0x20, 0xa1, 0x01, 0x80, 0xe1, 0x3a, 0xa6, 0x35, 0x2a, 0xb5, 0x4b, 0x7c, + 0x22, 0x6a, 0xaf, 0xb6, 0x91, 0x0e, 0x23, 0xde, 0x38, 0x61, 0xc7, 0x4d, 0x14, 0x4d, 0xc8, 0xee, + 0xd9, 0x00, 0x66, 0xa7, 0x09, 0x6e, 0x80, 0xd2, 0x25, 0xe9, 0x8f, 0xca, 0x2b, 0x0a, 0x7f, 0xc2, + 0x07, 0x60, 0xa1, 0x87, 0xed, 0x80, 0x88, 0x0d, 0xfd, 0xc1, 0xab, 0xf5, 0xe3, 0xa9, 0xd5, 0x25, + 0x68, 0x44, 0xfc, 0xc9, 0xb5, 0xfb, 0x92, 0xfa, 0xb5, 0x04, 0x2a, 0x0d, 0xd7, 0x6c, 0x12, 0x23, + 0xf0, 0x2d, 0xd6, 0x1f, 0xad, 0xef, 0xb7, 0x50, 0x98, 0x50, 0xa2, 0x30, 0x7d, 0x34, 0x7d, 0x35, + 0x27, 0x7b, 0x57, 0x54, 0x96, 0xd4, 0xe7, 0x12, 0xd8, 0xce, 0xa0, 0xdf, 0x42, 0xd9, 0xf8, 0x65, + 0xb2, 0x6c, 0x7c, 0xf8, 0x3a, 0x83, 0x29, 0x28, 0x1a, 0x5f, 0x57, 0x72, 0x86, 0xc2, 0x4b, 0x46, + 0x78, 0x84, 0xf5, 0xad, 0x9e, 0x65, 0x93, 0x36, 0x31, 0xf9, 0x60, 0xca, 0x13, 0x47, 0xd8, 0xd8, + 0x82, 0x26, 0x50, 0x90, 0x82, 0x1d, 0x93, 0x5c, 0xe0, 0xc0, 0x66, 0x07, 0xa6, 0x79, 0x88, 0x3d, + 0xdc, 0xb2, 0x6c, 0x8b, 0x59, 0xe2, 0xcc, 0xb5, 0xac, 0x7f, 0x32, 0x1c, 0x28, 0x3b, 0xf5, 0x5c, + 0xc4, 0xcb, 0x81, 0xf2, 0x6e, 0xf6, 0xca, 0xa2, 0xc5, 0x90, 0x3e, 0x2a, 0x90, 0x86, 0x7d, 0x20, + 0xfb, 0xe4, 0x0f, 0x41, 0xb8, 0xf3, 0xea, 0xbe, 0xeb, 0x25, 0xdc, 0x96, 0xb8, 0xdb, 0x9f, 0x0d, + 0x07, 0x8a, 0x8c, 0x0a, 0x30, 0xb3, 0x1d, 0x17, 0xca, 0xc3, 0xcf, 0xc1, 0x26, 0x16, 0x97, 0x8d, + 0x49, 0xaf, 0xf3, 0xdc, 0xeb, 0xfd, 0xe1, 0x40, 0xd9, 0x3c, 0xc8, 0x9a, 0x67, 0x3b, 0xcc, 0x13, + 0x85, 0x35, 0xb0, 0xd4, 0xe3, 0xf7, 0x12, 0x2a, 0x2f, 0x70, 0xfd, 0xed, 0xe1, 0x40, 0x59, 0x1a, + 0x5d, 0x55, 0x42, 0xcd, 0xc5, 0xe3, 0x26, 0x2f, 0x27, 0x11, 0x0a, 0x7e, 0x0c, 0x56, 0x3a, 0x2e, + 0x65, 0x4f, 0x08, 0xfb, 0xc2, 0xf5, 0x2f, 0x79, 0xf6, 0x29, 0xeb, 0x9b, 0x62, 0x06, 0x57, 0x1e, + 0x8d, 0x4d, 0x68, 0x12, 0x07, 0x7f, 0x0d, 0x96, 0x3b, 0xe2, 0x6c, 0x1b, 0xa5, 0x9e, 0x5b, 0x53, + 0x16, 0x5a, 0xe2, 0x1c, 0xac, 0x57, 0x84, 0xfc, 0x72, 0xd4, 0x4c, 0xd1, 0x58, 0x0d, 0xfe, 0x00, + 0x2c, 0xf1, 0x8f, 0x93, 0xba, 0x5c, 0xe6, 0xbd, 0xb9, 0x2e, 0xe0, 0x4b, 0x8f, 0x46, 0xcd, 0x28, + 0xb2, 0x47, 0xd0, 0x93, 0xc6, 0xa1, 0xbc, 0x9c, 0x85, 0x9e, 0x34, 0x0e, 0x51, 0x64, 0x87, 0xcf, + 0xc0, 0x12, 0x25, 0x8f, 0x2d, 0x27, 0xb8, 0x92, 0x01, 0xdf, 0x72, 0xb7, 0xa7, 0x74, 0xb7, 0x79, + 0xc4, 0x91, 0xa9, 0x5b, 0xc5, 0x58, 0x5d, 0xd8, 0x51, 0x24, 0x09, 0x4d, 0xb0, 0xec, 0x07, 0xce, + 0x01, 0x3d, 0xa7, 0xc4, 0x97, 0x57, 0x32, 0x47, 0x9a, 0xb4, 0x3e, 0x8a, 0xb0, 0x69, 0x0f, 0x71, + 0x64, 0x62, 0x04, 0x1a, 0x0b, 0x43, 0x13, 0x00, 0xfe, 0xc1, 0x2f, 0x2f, 0xf2, 0xce, 0xcc, 0xc3, + 0x2e, 0x8a, 0xc1, 0x69, 0x3f, 0xeb, 0xe1, 0xf6, 0x1c, 0x9b, 0xd1, 0x84, 0x2e, 0xfc, 0x93, 0x04, + 0x20, 0x0d, 0x3c, 0xcf, 0x26, 0x5d, 0xe2, 0x30, 0x6c, 0xf3, 0x56, 0x2a, 0xaf, 0x72, 0x77, 0x3f, + 0x9d, 0x16, 0xb5, 0x0c, 0x29, 0xed, 0x36, 0xae, 0xcd, 0x59, 0x28, 0xca, 0xf1, 0x19, 0x4e, 0xda, + 0x85, 0x18, 0xed, 0xda, 0xcc, 0x49, 0xcb, 0xbf, 0x0a, 0x8e, 0x27, 0x4d, 0xd8, 0x51, 0x24, 0x09, + 0x3f, 0x03, 0x3b, 0xd1, 0x45, 0x19, 0xb9, 0x2e, 0x3b, 0xb6, 0x6c, 0x42, 0xfb, 0x94, 0x91, 0xae, + 0xbc, 0xce, 0x17, 0x53, 0x55, 0x30, 0x77, 0x50, 0x2e, 0x0a, 0x15, 0xb0, 0x61, 0x17, 0x28, 0x51, + 0x12, 0x0a, 0x77, 0x68, 0x9c, 0x05, 0x8f, 0xa8, 0x81, 0xed, 0xd1, 0xe9, 0xeb, 0x3a, 0x77, 0xf0, + 0xfe, 0x70, 0xa0, 0x28, 0xf5, 0xe9, 0x50, 0x34, 0x4b, 0x0b, 0xfe, 0x0a, 0xc8, 0xb8, 0xc8, 0xcf, + 0x06, 0xf7, 0xf3, 0xbd, 0x30, 0xb3, 0x15, 0x3a, 0x28, 0x64, 0x43, 0x0f, 0x6c, 0xe0, 0xe4, 0x93, + 0x05, 0x95, 0x2b, 0x7c, 0xaf, 0x7f, 0x30, 0x65, 0x1e, 0x52, 0xaf, 0x1c, 0xba, 0x2c, 0xc2, 0xb8, + 0x91, 0x32, 0x50, 0x94, 0x51, 0x87, 0x57, 0x00, 0xe2, 0xf4, 0x0b, 0x0b, 0x95, 0xe1, 0xcc, 0x42, + 0x96, 0x79, 0x96, 0x19, 0x2f, 0xb5, 0x8c, 0x89, 0xa2, 0x1c, 0x1f, 0x90, 0x81, 0x0a, 0x4e, 0xbd, + 0x08, 0x51, 0xf9, 0x06, 0x77, 0xfc, 0xc3, 0xd9, 0x8e, 0x63, 0x8e, 0xbe, 0x2b, 0xfc, 0x56, 0xd2, + 0x16, 0x8a, 0xb2, 0x0e, 0xe0, 0x63, 0xb0, 0x25, 0x1a, 0xcf, 0x1d, 0x8a, 0x2f, 0x48, 0xb3, 0x4f, + 0x0d, 0x66, 0x53, 0x79, 0x93, 0xe7, 0x6e, 0x79, 0x38, 0x50, 0xb6, 0x0e, 0x72, 0xec, 0x28, 0x97, + 0x05, 0x1f, 0x80, 0x8d, 0x0b, 0xd7, 0x6f, 0x59, 0xa6, 0x49, 0x9c, 0x48, 0x69, 0x8b, 0x2b, 0x6d, + 0x85, 0xf1, 0x3f, 0x4e, 0xd9, 0x50, 0x06, 0x0d, 0x29, 0xd8, 0x16, 0xca, 0x0d, 0xdf, 0x35, 0x4e, + 0xdd, 0xc0, 0x61, 0x61, 0xb9, 0xa0, 0xf2, 0x76, 0x5c, 0x22, 0xb7, 0x0f, 0xf2, 0x00, 0x2f, 0x07, + 0xca, 0xcd, 0x9c, 0x72, 0x95, 0x00, 0xa1, 0x7c, 0x6d, 0x68, 0x83, 0x55, 0xf1, 0xc6, 0x77, 0x68, + 0x63, 0x4a, 0x65, 0x99, 0x6f, 0xf5, 0x7b, 0xd3, 0x13, 0x5b, 0x0c, 0x4f, 0xef, 0x77, 0x7e, 0xf9, + 0x9c, 0x04, 0xa0, 0x84, 0xba, 0xfa, 0x17, 0x09, 0xec, 0x16, 0x26, 0x46, 0x78, 0x2f, 0xf1, 0x70, + 0xa4, 0xa6, 0x1e, 0x8e, 0x60, 0x96, 0xf8, 0x06, 0xde, 0x8d, 0xbe, 0x92, 0x80, 0x5c, 0x54, 0x21, + 0xe0, 0xc7, 0x89, 0x0e, 0xbe, 0x97, 0xea, 0x60, 0x25, 0xc3, 0x7b, 0x03, 0xfd, 0xfb, 0x97, 0x04, + 0xde, 0x99, 0x32, 0x03, 0x71, 0x42, 0x22, 0xe6, 0x24, 0xea, 0x09, 0x0e, 0xb7, 0xb2, 0xc4, 0xd7, + 0xd1, 0x38, 0x21, 0xe5, 0x60, 0x50, 0x21, 0x1b, 0x9e, 0x83, 0x1b, 0x22, 0x1b, 0xa6, 0x6d, 0xfc, + 0xe4, 0xbe, 0xac, 0xbf, 0x33, 0x1c, 0x28, 0x37, 0xea, 0xf9, 0x10, 0x54, 0xc4, 0x55, 0xff, 0x26, + 0x81, 0x9d, 0xfc, 0x92, 0x0f, 0xef, 0x24, 0xc2, 0xad, 0xa4, 0xc2, 0x7d, 0x3d, 0xc5, 0x12, 0xc1, + 0xfe, 0x1d, 0x58, 0x17, 0x07, 0x83, 0xe4, 0x3b, 0x68, 0x22, 0xe8, 0xe1, 0x16, 0x09, 0xcf, 0xf4, + 0x42, 0x22, 0x5a, 0xbe, 0xfc, 0xc9, 0x21, 0xd9, 0x86, 0x52, 0x6a, 0xea, 0xdf, 0x25, 0xf0, 0xde, + 0xcc, 0x62, 0x0b, 0xf5, 0x44, 0xd7, 0xb5, 0x54, 0xd7, 0xab, 0xc5, 0x02, 0x6f, 0xe6, 0x39, 0x54, + 0xff, 0xc5, 0xf3, 0x17, 0xd5, 0xb9, 0x6f, 0x5e, 0x54, 0xe7, 0xbe, 0x7d, 0x51, 0x9d, 0xfb, 0x72, + 0x58, 0x95, 0x9e, 0x0f, 0xab, 0xd2, 0x37, 0xc3, 0xaa, 0xf4, 0xed, 0xb0, 0x2a, 0xfd, 0x77, 0x58, + 0x95, 0xfe, 0xfc, 0xbf, 0xea, 0xdc, 0x6f, 0x76, 0x0b, 0xff, 0x06, 0xf9, 0x7f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xb4, 0x84, 0x53, 0xfb, 0x3b, 0x19, 0x00, 0x00, } -func (m *Eviction) Marshal() (dAtA []byte, err error) { +func (m *AllowedCSIDriver) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -268,41 +744,233 @@ func (m *Eviction) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Eviction) MarshalTo(dAtA []byte) (int, error) { +func (m *AllowedCSIDriver) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Eviction) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllowedCSIDriver) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.DeleteOptions != nil { - { - size, err := m.DeleteOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AllowedFlexVolume) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllowedFlexVolume) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedFlexVolume) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AllowedHostPath) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllowedHostPath) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedHostPath) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.ReadOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.PathPrefix) + copy(dAtA[i:], m.PathPrefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PathPrefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Eviction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Eviction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Eviction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DeleteOptions != nil { + { + size, err := m.DeleteOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FSGroupStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FSGroupStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FSGroupStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ranges) > 0 { + for iNdEx := len(m.Ranges) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ranges[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } +func (m *HostPortRange) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HostPortRange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostPortRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Max)) + i-- + dAtA[i] = 0x10 + i = encodeVarintGenerated(dAtA, i, uint64(m.Min)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *IDRange) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IDRange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IDRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Max)) + i-- + dAtA[i] = 0x10 + i = encodeVarintGenerated(dAtA, i, uint64(m.Min)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + func (m *PodDisruptionBudget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -550,247 +1218,3446 @@ func (m *PodDisruptionBudgetStatus) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *PodSecurityPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *Eviction) Size() (n int) { - if m == nil { - return 0 - } + +func (m *PodSecurityPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodSecurityPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.DeleteOptions != nil { - l = m.DeleteOptions.Size() - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *PodDisruptionBudget) Size() (n int) { - if m == nil { - return 0 +func (m *PodSecurityPolicyList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n + return dAtA[:n], nil } -func (m *PodDisruptionBudgetList) Size() (n int) { - if m == nil { - return 0 - } +func (m *PodSecurityPolicyList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodSecurityPolicyList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - return n + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *PodDisruptionBudgetSpec) Size() (n int) { - if m == nil { - return 0 +func (m *PodSecurityPolicySpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *PodSecurityPolicySpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodSecurityPolicySpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.MinAvailable != nil { - l = m.MinAvailable.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.RuntimeClass != nil { + { + size, err := m.RuntimeClass.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 } - if m.Selector != nil { - l = m.Selector.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.AllowedCSIDrivers) > 0 { + for iNdEx := len(m.AllowedCSIDrivers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedCSIDrivers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } } - if m.MaxUnavailable != nil { - l = m.MaxUnavailable.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.RunAsGroup != nil { + { + size, err := m.RunAsGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 } - if m.UnhealthyPodEvictionPolicy != nil { - l = len(*m.UnhealthyPodEvictionPolicy) - n += 1 + l + sovGenerated(uint64(l)) + if len(m.AllowedProcMountTypes) > 0 { + for iNdEx := len(m.AllowedProcMountTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedProcMountTypes[iNdEx]) + copy(dAtA[i:], m.AllowedProcMountTypes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllowedProcMountTypes[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } } - return n -} - -func (m *PodDisruptionBudgetStatus) Size() (n int) { - if m == nil { - return 0 + if len(m.ForbiddenSysctls) > 0 { + for iNdEx := len(m.ForbiddenSysctls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ForbiddenSysctls[iNdEx]) + copy(dAtA[i:], m.ForbiddenSysctls[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ForbiddenSysctls[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } } - var l int - _ = l - n += 1 + sovGenerated(uint64(m.ObservedGeneration)) - if len(m.DisruptedPods) > 0 { - for k, v := range m.DisruptedPods { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + if len(m.AllowedUnsafeSysctls) > 0 { + for iNdEx := len(m.AllowedUnsafeSysctls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedUnsafeSysctls[iNdEx]) + copy(dAtA[i:], m.AllowedUnsafeSysctls[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllowedUnsafeSysctls[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a } } - n += 1 + sovGenerated(uint64(m.DisruptionsAllowed)) - n += 1 + sovGenerated(uint64(m.CurrentHealthy)) - n += 1 + sovGenerated(uint64(m.DesiredHealthy)) - n += 1 + sovGenerated(uint64(m.ExpectedPods)) - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.AllowedFlexVolumes) > 0 { + for iNdEx := len(m.AllowedFlexVolumes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedFlexVolumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 } } - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Eviction) String() string { - if this == nil { - return "nil" + if len(m.AllowedHostPaths) > 0 { + for iNdEx := len(m.AllowedHostPaths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedHostPaths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } } - s := strings.Join([]string{`&Eviction{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "v1.DeleteOptions", 1) + `,`, - `}`, - }, "") - return s -} -func (this *PodDisruptionBudget) String() string { - if this == nil { - return "nil" + if m.AllowPrivilegeEscalation != nil { + i-- + if *m.AllowPrivilegeEscalation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 } - s := strings.Join([]string{`&PodDisruptionBudget{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *PodDisruptionBudgetList) String() string { - if this == nil { - return "nil" + if m.DefaultAllowPrivilegeEscalation != nil { + i-- + if *m.DefaultAllowPrivilegeEscalation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 } - repeatedStringForItems := "[]PodDisruptionBudget{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + "," + i-- + if m.ReadOnlyRootFilesystem { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - repeatedStringForItems += "}" - s := strings.Join([]string{`&PodDisruptionBudgetList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *PodDisruptionBudgetSpec) String() string { - if this == nil { - return "nil" + i-- + dAtA[i] = 0x70 + { + size, err := m.FSGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - s := strings.Join([]string{`&PodDisruptionBudgetSpec{`, - `MinAvailable:` + strings.Replace(fmt.Sprintf("%v", this.MinAvailable), "IntOrString", "intstr.IntOrString", 1) + `,`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, - `MaxUnavailable:` + strings.Replace(fmt.Sprintf("%v", this.MaxUnavailable), "IntOrString", "intstr.IntOrString", 1) + `,`, - `UnhealthyPodEvictionPolicy:` + valueToStringGenerated(this.UnhealthyPodEvictionPolicy) + `,`, - `}`, - }, "") - return s -} -func (this *PodDisruptionBudgetStatus) String() string { - if this == nil { - return "nil" + i-- + dAtA[i] = 0x6a + { + size, err := m.SupplementalGroups.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - repeatedStringForConditions := "[]Condition{" - for _, f := range this.Conditions { - repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + i-- + dAtA[i] = 0x62 + { + size, err := m.RunAsUser.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - repeatedStringForConditions += "}" - keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) - for k := range this.DisruptedPods { - keysForDisruptedPods = append(keysForDisruptedPods, k) + i-- + dAtA[i] = 0x5a + { + size, err := m.SELinux.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) - mapStringForDisruptedPods := "map[string]v1.Time{" - for _, k := range keysForDisruptedPods { - mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + i-- + dAtA[i] = 0x52 + i-- + if m.HostIPC { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - mapStringForDisruptedPods += "}" - s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, - `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, - `DisruptedPods:` + mapStringForDisruptedPods + `,`, - `DisruptionsAllowed:` + fmt.Sprintf("%v", this.DisruptionsAllowed) + `,`, - `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, - `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, - `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, - `Conditions:` + repeatedStringForConditions + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + i-- + dAtA[i] = 0x48 + i-- + if m.HostPID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + i-- + dAtA[i] = 0x40 + if len(m.HostPorts) > 0 { + for iNdEx := len(m.HostPorts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HostPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.HostNetwork { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if len(m.Volumes) > 0 { + for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Volumes[iNdEx]) + copy(dAtA[i:], m.Volumes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Volumes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.AllowedCapabilities) > 0 { + for iNdEx := len(m.AllowedCapabilities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedCapabilities[iNdEx]) + copy(dAtA[i:], m.AllowedCapabilities[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllowedCapabilities[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RequiredDropCapabilities) > 0 { + for iNdEx := len(m.RequiredDropCapabilities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequiredDropCapabilities[iNdEx]) + copy(dAtA[i:], m.RequiredDropCapabilities[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RequiredDropCapabilities[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.DefaultAddCapabilities) > 0 { + for iNdEx := len(m.DefaultAddCapabilities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultAddCapabilities[iNdEx]) + copy(dAtA[i:], m.DefaultAddCapabilities[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DefaultAddCapabilities[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i-- + if m.Privileged { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } -func (m *Eviction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + +func (m *RunAsGroupStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RunAsGroupStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RunAsGroupStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ranges) > 0 { + for iNdEx := len(m.Ranges) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ranges[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RunAsUserStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RunAsUserStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RunAsUserStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ranges) > 0 { + for iNdEx := len(m.Ranges) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ranges[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RuntimeClassStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuntimeClassStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuntimeClassStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DefaultRuntimeClassName != nil { + i -= len(*m.DefaultRuntimeClassName) + copy(dAtA[i:], *m.DefaultRuntimeClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.DefaultRuntimeClassName))) + i-- + dAtA[i] = 0x12 + } + if len(m.AllowedRuntimeClassNames) > 0 { + for iNdEx := len(m.AllowedRuntimeClassNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedRuntimeClassNames[iNdEx]) + copy(dAtA[i:], m.AllowedRuntimeClassNames[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllowedRuntimeClassNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SELinuxStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SELinuxStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SELinuxStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SELinuxOptions != nil { + { + size, err := m.SELinuxOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SupplementalGroupsStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SupplementalGroupsStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SupplementalGroupsStrategyOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ranges) > 0 { + for iNdEx := len(m.Ranges) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ranges[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllowedCSIDriver) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AllowedFlexVolume) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AllowedHostPath) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PathPrefix) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *Eviction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.DeleteOptions != nil { + l = m.DeleteOptions.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *FSGroupStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *HostPortRange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Min)) + n += 1 + sovGenerated(uint64(m.Max)) + return n +} + +func (m *IDRange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Min)) + n += 1 + sovGenerated(uint64(m.Max)) + return n +} + +func (m *PodDisruptionBudget) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodDisruptionBudgetList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodDisruptionBudgetSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinAvailable != nil { + l = m.MinAvailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Selector != nil { + l = m.Selector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxUnavailable != nil { + l = m.MaxUnavailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.UnhealthyPodEvictionPolicy != nil { + l = len(*m.UnhealthyPodEvictionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodDisruptionBudgetStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.ObservedGeneration)) + if len(m.DisruptedPods) > 0 { + for k, v := range m.DisruptedPods { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 1 + sovGenerated(uint64(m.DisruptionsAllowed)) + n += 1 + sovGenerated(uint64(m.CurrentHealthy)) + n += 1 + sovGenerated(uint64(m.DesiredHealthy)) + n += 1 + sovGenerated(uint64(m.ExpectedPods)) + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodSecurityPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodSecurityPolicyList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodSecurityPolicySpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + if len(m.DefaultAddCapabilities) > 0 { + for _, s := range m.DefaultAddCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.RequiredDropCapabilities) > 0 { + for _, s := range m.RequiredDropCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedCapabilities) > 0 { + for _, s := range m.AllowedCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Volumes) > 0 { + for _, s := range m.Volumes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + if len(m.HostPorts) > 0 { + for _, e := range m.HostPorts { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + n += 2 + l = m.SELinux.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.RunAsUser.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.SupplementalGroups.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.FSGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.DefaultAllowPrivilegeEscalation != nil { + n += 2 + } + if m.AllowPrivilegeEscalation != nil { + n += 3 + } + if len(m.AllowedHostPaths) > 0 { + for _, e := range m.AllowedHostPaths { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedFlexVolumes) > 0 { + for _, e := range m.AllowedFlexVolumes { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedUnsafeSysctls) > 0 { + for _, s := range m.AllowedUnsafeSysctls { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if len(m.ForbiddenSysctls) > 0 { + for _, s := range m.ForbiddenSysctls { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedProcMountTypes) > 0 { + for _, s := range m.AllowedProcMountTypes { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.RunAsGroup != nil { + l = m.RunAsGroup.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + if len(m.AllowedCSIDrivers) > 0 { + for _, e := range m.AllowedCSIDrivers { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.RuntimeClass != nil { + l = m.RuntimeClass.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *RunAsGroupStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *RunAsUserStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *RuntimeClassStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedRuntimeClassNames) > 0 { + for _, s := range m.AllowedRuntimeClassNames { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.DefaultRuntimeClassName != nil { + l = len(*m.DefaultRuntimeClassName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SELinuxStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if m.SELinuxOptions != nil { + l = m.SELinuxOptions.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SupplementalGroupsStrategyOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AllowedCSIDriver) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllowedCSIDriver{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *AllowedFlexVolume) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllowedFlexVolume{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `}`, + }, "") + return s +} +func (this *AllowedHostPath) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllowedHostPath{`, + `PathPrefix:` + fmt.Sprintf("%v", this.PathPrefix) + `,`, + `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, + `}`, + }, "") + return s +} +func (this *Eviction) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Eviction{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "v1.DeleteOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FSGroupStrategyOptions) String() string { + if this == nil { + return "nil" + } + repeatedStringForRanges := "[]IDRange{" + for _, f := range this.Ranges { + repeatedStringForRanges += strings.Replace(strings.Replace(f.String(), "IDRange", "IDRange", 1), `&`, ``, 1) + "," + } + repeatedStringForRanges += "}" + s := strings.Join([]string{`&FSGroupStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + repeatedStringForRanges + `,`, + `}`, + }, "") + return s +} +func (this *HostPortRange) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&HostPortRange{`, + `Min:` + fmt.Sprintf("%v", this.Min) + `,`, + `Max:` + fmt.Sprintf("%v", this.Max) + `,`, + `}`, + }, "") + return s +} +func (this *IDRange) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IDRange{`, + `Min:` + fmt.Sprintf("%v", this.Min) + `,`, + `Max:` + fmt.Sprintf("%v", this.Max) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudget) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudget{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodDisruptionBudget{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodDisruptionBudgetList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudgetSpec{`, + `MinAvailable:` + strings.Replace(fmt.Sprintf("%v", this.MinAvailable), "IntOrString", "intstr.IntOrString", 1) + `,`, + `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `MaxUnavailable:` + strings.Replace(fmt.Sprintf("%v", this.MaxUnavailable), "IntOrString", "intstr.IntOrString", 1) + `,`, + `UnhealthyPodEvictionPolicy:` + valueToStringGenerated(this.UnhealthyPodEvictionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) + for k := range this.DisruptedPods { + keysForDisruptedPods = append(keysForDisruptedPods, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) + mapStringForDisruptedPods := "map[string]v1.Time{" + for _, k := range keysForDisruptedPods { + mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + } + mapStringForDisruptedPods += "}" + s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, + `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, + `DisruptedPods:` + mapStringForDisruptedPods + `,`, + `DisruptionsAllowed:` + fmt.Sprintf("%v", this.DisruptionsAllowed) + `,`, + `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, + `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, + `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSecurityPolicy{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodSecurityPolicySpec", "PodSecurityPolicySpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicyList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodSecurityPolicy{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodSecurityPolicy", "PodSecurityPolicy", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodSecurityPolicyList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicySpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForHostPorts := "[]HostPortRange{" + for _, f := range this.HostPorts { + repeatedStringForHostPorts += strings.Replace(strings.Replace(f.String(), "HostPortRange", "HostPortRange", 1), `&`, ``, 1) + "," + } + repeatedStringForHostPorts += "}" + repeatedStringForAllowedHostPaths := "[]AllowedHostPath{" + for _, f := range this.AllowedHostPaths { + repeatedStringForAllowedHostPaths += strings.Replace(strings.Replace(f.String(), "AllowedHostPath", "AllowedHostPath", 1), `&`, ``, 1) + "," + } + repeatedStringForAllowedHostPaths += "}" + repeatedStringForAllowedFlexVolumes := "[]AllowedFlexVolume{" + for _, f := range this.AllowedFlexVolumes { + repeatedStringForAllowedFlexVolumes += strings.Replace(strings.Replace(f.String(), "AllowedFlexVolume", "AllowedFlexVolume", 1), `&`, ``, 1) + "," + } + repeatedStringForAllowedFlexVolumes += "}" + repeatedStringForAllowedCSIDrivers := "[]AllowedCSIDriver{" + for _, f := range this.AllowedCSIDrivers { + repeatedStringForAllowedCSIDrivers += strings.Replace(strings.Replace(f.String(), "AllowedCSIDriver", "AllowedCSIDriver", 1), `&`, ``, 1) + "," + } + repeatedStringForAllowedCSIDrivers += "}" + s := strings.Join([]string{`&PodSecurityPolicySpec{`, + `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, + `DefaultAddCapabilities:` + fmt.Sprintf("%v", this.DefaultAddCapabilities) + `,`, + `RequiredDropCapabilities:` + fmt.Sprintf("%v", this.RequiredDropCapabilities) + `,`, + `AllowedCapabilities:` + fmt.Sprintf("%v", this.AllowedCapabilities) + `,`, + `Volumes:` + fmt.Sprintf("%v", this.Volumes) + `,`, + `HostNetwork:` + fmt.Sprintf("%v", this.HostNetwork) + `,`, + `HostPorts:` + repeatedStringForHostPorts + `,`, + `HostPID:` + fmt.Sprintf("%v", this.HostPID) + `,`, + `HostIPC:` + fmt.Sprintf("%v", this.HostIPC) + `,`, + `SELinux:` + strings.Replace(strings.Replace(this.SELinux.String(), "SELinuxStrategyOptions", "SELinuxStrategyOptions", 1), `&`, ``, 1) + `,`, + `RunAsUser:` + strings.Replace(strings.Replace(this.RunAsUser.String(), "RunAsUserStrategyOptions", "RunAsUserStrategyOptions", 1), `&`, ``, 1) + `,`, + `SupplementalGroups:` + strings.Replace(strings.Replace(this.SupplementalGroups.String(), "SupplementalGroupsStrategyOptions", "SupplementalGroupsStrategyOptions", 1), `&`, ``, 1) + `,`, + `FSGroup:` + strings.Replace(strings.Replace(this.FSGroup.String(), "FSGroupStrategyOptions", "FSGroupStrategyOptions", 1), `&`, ``, 1) + `,`, + `ReadOnlyRootFilesystem:` + fmt.Sprintf("%v", this.ReadOnlyRootFilesystem) + `,`, + `DefaultAllowPrivilegeEscalation:` + valueToStringGenerated(this.DefaultAllowPrivilegeEscalation) + `,`, + `AllowPrivilegeEscalation:` + valueToStringGenerated(this.AllowPrivilegeEscalation) + `,`, + `AllowedHostPaths:` + repeatedStringForAllowedHostPaths + `,`, + `AllowedFlexVolumes:` + repeatedStringForAllowedFlexVolumes + `,`, + `AllowedUnsafeSysctls:` + fmt.Sprintf("%v", this.AllowedUnsafeSysctls) + `,`, + `ForbiddenSysctls:` + fmt.Sprintf("%v", this.ForbiddenSysctls) + `,`, + `AllowedProcMountTypes:` + fmt.Sprintf("%v", this.AllowedProcMountTypes) + `,`, + `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "RunAsGroupStrategyOptions", "RunAsGroupStrategyOptions", 1) + `,`, + `AllowedCSIDrivers:` + repeatedStringForAllowedCSIDrivers + `,`, + `RuntimeClass:` + strings.Replace(this.RuntimeClass.String(), "RuntimeClassStrategyOptions", "RuntimeClassStrategyOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RunAsGroupStrategyOptions) String() string { + if this == nil { + return "nil" + } + repeatedStringForRanges := "[]IDRange{" + for _, f := range this.Ranges { + repeatedStringForRanges += strings.Replace(strings.Replace(f.String(), "IDRange", "IDRange", 1), `&`, ``, 1) + "," + } + repeatedStringForRanges += "}" + s := strings.Join([]string{`&RunAsGroupStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + repeatedStringForRanges + `,`, + `}`, + }, "") + return s +} +func (this *RunAsUserStrategyOptions) String() string { + if this == nil { + return "nil" + } + repeatedStringForRanges := "[]IDRange{" + for _, f := range this.Ranges { + repeatedStringForRanges += strings.Replace(strings.Replace(f.String(), "IDRange", "IDRange", 1), `&`, ``, 1) + "," + } + repeatedStringForRanges += "}" + s := strings.Join([]string{`&RunAsUserStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + repeatedStringForRanges + `,`, + `}`, + }, "") + return s +} +func (this *RuntimeClassStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RuntimeClassStrategyOptions{`, + `AllowedRuntimeClassNames:` + fmt.Sprintf("%v", this.AllowedRuntimeClassNames) + `,`, + `DefaultRuntimeClassName:` + valueToStringGenerated(this.DefaultRuntimeClassName) + `,`, + `}`, + }, "") + return s +} +func (this *SELinuxStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SELinuxStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `SELinuxOptions:` + strings.Replace(fmt.Sprintf("%v", this.SELinuxOptions), "SELinuxOptions", "v11.SELinuxOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SupplementalGroupsStrategyOptions) String() string { + if this == nil { + return "nil" + } + repeatedStringForRanges := "[]IDRange{" + for _, f := range this.Ranges { + repeatedStringForRanges += strings.Replace(strings.Replace(f.String(), "IDRange", "IDRange", 1), `&`, ``, 1) + "," + } + repeatedStringForRanges += "}" + s := strings.Join([]string{`&SupplementalGroupsStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + repeatedStringForRanges + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AllowedCSIDriver) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedCSIDriver: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedCSIDriver: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedFlexVolume) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedFlexVolume: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedFlexVolume: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedHostPath) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedHostPath: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedHostPath: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PathPrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PathPrefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Eviction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Eviction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeleteOptions == nil { + m.DeleteOptions = &v1.DeleteOptions{} + } + if err := m.DeleteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FSGroupStrategyOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FSGroupStrategyOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FSGroupStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = FSGroupStrategyType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostPortRange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HostPortRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostPortRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + m.Min = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Min |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + m.Max = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Max |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IDRange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IDRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IDRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + m.Min = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Min |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + m.Max = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Max |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodDisruptionBudget{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinAvailable == nil { + m.MinAvailable = &intstr.IntOrString{} + } + if err := m.MinAvailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selector == nil { + m.Selector = &v1.LabelSelector{} + } + if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUnavailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxUnavailable == nil { + m.MaxUnavailable = &intstr.IntOrString{} + } + if err := m.MaxUnavailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnhealthyPodEvictionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := UnhealthyPodEvictionPolicyType(dAtA[iNdEx:postIndex]) + m.UnhealthyPodEvictionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + m.ObservedGeneration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObservedGeneration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptedPods == nil { + m.DisruptedPods = make(map[string]v1.Time) + } + var mapkey string + mapvalue := &v1.Time{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &v1.Time{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.DisruptedPods[mapkey] = *mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionsAllowed", wireType) + } + m.DisruptionsAllowed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisruptionsAllowed |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) + } + m.CurrentHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentHealthy |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType) + } + m.DesiredHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DesiredHealthy |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType) + } + m.ExpectedPods = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedPods |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicyList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicyList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicyList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodSecurityPolicy{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicySpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicySpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicySpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Privileged = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultAddCapabilities", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultAddCapabilities = append(m.DefaultAddCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequiredDropCapabilities", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequiredDropCapabilities = append(m.RequiredDropCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedCapabilities", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedCapabilities = append(m.AllowedCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, FSType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostNetwork", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostNetwork = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPorts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostPorts = append(m.HostPorts, HostPortRange{}) + if err := m.HostPorts[len(m.HostPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPID", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostPID = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostIPC", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostIPC = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SELinux", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SELinux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SupplementalGroups.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FSGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FSGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnlyRootFilesystem", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnlyRootFilesystem = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultAllowPrivilegeEscalation", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.DefaultAllowPrivilegeEscalation = &b + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowPrivilegeEscalation", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Eviction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + b := bool(v != 0) + m.AllowPrivilegeEscalation = &b + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedHostPaths", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -817,13 +4684,14 @@ func (m *Eviction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedHostPaths = append(m.AllowedHostPaths, AllowedHostPath{}) + if err := m.AllowedHostPaths[len(m.AllowedHostPaths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedFlexVolumes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -850,66 +4718,110 @@ func (m *Eviction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DeleteOptions == nil { - m.DeleteOptions = &v1.DeleteOptions{} - } - if err := m.DeleteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedFlexVolumes = append(m.AllowedFlexVolumes, AllowedFlexVolume{}) + if err := m.AllowedFlexVolumes[len(m.AllowedFlexVolumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedUnsafeSysctls", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + m.AllowedUnsafeSysctls = append(m.AllowedUnsafeSysctls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForbiddenSysctls", wireType) } - if iNdEx >= l { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.ForbiddenSysctls = append(m.ForbiddenSysctls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedProcMountTypes", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedProcMountTypes = append(m.AllowedProcMountTypes, k8s_io_api_core_v1.ProcMountType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 22: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -936,13 +4848,16 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.RunAsGroup == nil { + m.RunAsGroup = &RunAsGroupStrategyOptions{} + } + if err := m.RunAsGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 23: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedCSIDrivers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -969,13 +4884,14 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedCSIDrivers = append(m.AllowedCSIDrivers, AllowedCSIDriver{}) + if err := m.AllowedCSIDrivers[len(m.AllowedCSIDrivers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 24: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeClass", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1002,7 +4918,10 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.RuntimeClass == nil { + m.RuntimeClass = &RuntimeClassStrategyOptions{} + } + if err := m.RuntimeClass.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1027,7 +4946,7 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { +func (m *RunAsGroupStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1050,17 +4969,17 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group") + return fmt.Errorf("proto: RunAsGroupStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RunAsGroupStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1070,28 +4989,27 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Rule = RunAsGroupStrategy(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1118,8 +5036,8 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PodDisruptionBudget{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1144,7 +5062,7 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { +func (m *RunAsUserStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1167,17 +5085,17 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group") + return fmt.Errorf("proto: RunAsUserStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RunAsUserStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1187,31 +5105,27 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.MinAvailable == nil { - m.MinAvailable = &intstr.IntOrString{} - } - if err := m.MinAvailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Rule = RunAsUserStrategy(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1238,18 +5152,66 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Selector == nil { - m.Selector = &v1.LabelSelector{} - } - if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuntimeClassStrategyOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuntimeClassStrategyOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuntimeClassStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxUnavailable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedRuntimeClassNames", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1259,31 +5221,27 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.MaxUnavailable == nil { - m.MaxUnavailable = &intstr.IntOrString{} - } - if err := m.MaxUnavailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AllowedRuntimeClassNames = append(m.AllowedRuntimeClassNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnhealthyPodEvictionPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultRuntimeClassName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1311,8 +5269,8 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := UnhealthyPodEvictionPolicyType(dAtA[iNdEx:postIndex]) - m.UnhealthyPodEvictionPolicy = &s + s := string(dAtA[iNdEx:postIndex]) + m.DefaultRuntimeClassName = &s iNdEx = postIndex default: iNdEx = preIndex @@ -1335,7 +5293,7 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { +func (m *SELinuxStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1358,17 +5316,17 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group") + return fmt.Errorf("proto: SELinuxStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SELinuxStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - m.ObservedGeneration = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1378,14 +5336,27 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ObservedGeneration |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = SELinuxStrategy(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SELinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1412,168 +5383,68 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DisruptedPods == nil { - m.DisruptedPods = make(map[string]v1.Time) + if m.SELinuxOptions == nil { + m.SELinuxOptions = &v11.SELinuxOptions{} } - var mapkey string - mapvalue := &v1.Time{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &v1.Time{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.SELinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.DisruptedPods[mapkey] = *mapvalue iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DisruptionsAllowed", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - m.DisruptionsAllowed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DisruptionsAllowed |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.CurrentHealthy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentHealthy |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SupplementalGroupsStrategyOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.DesiredHealthy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DesiredHealthy |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SupplementalGroupsStrategyOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SupplementalGroupsStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - m.ExpectedPods = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1583,14 +5454,27 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ExpectedPods |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 7: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = SupplementalGroupsStrategyType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1617,8 +5501,8 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Conditions = append(m.Conditions, v1.Condition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/generated.proto b/upstream/vendor/k8s.io/api/policy/v1beta1/generated.proto index d1409913f1e..16301c236af 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -21,6 +21,7 @@ syntax = "proto2"; package k8s.io.api.policy.v1beta1; +import "k8s.io/api/core/v1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -29,6 +30,35 @@ import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". option go_package = "k8s.io/api/policy/v1beta1"; +// AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used. +message AllowedCSIDriver { + // Name is the registered name of the CSI driver + optional string name = 1; +} + +// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. +message AllowedFlexVolume { + // driver is the name of the Flexvolume driver. + optional string driver = 1; +} + +// AllowedHostPath defines the host volume conditions that will be enabled by a policy +// for pods to use. It requires the path prefix to be defined. +message AllowedHostPath { + // pathPrefix is the path prefix that the host volume must match. + // It does not support `*`. + // Trailing slashes are trimmed when validating the path prefix with a host path. + // + // Examples: + // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` + // `/foo` would not allow `/food` or `/etc/foo` + optional string pathPrefix = 1; + + // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. + // +optional + optional bool readOnly = 2; +} + // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods/<pod name>/evictions. @@ -42,6 +72,37 @@ message Eviction { optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; } +// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. +message FSGroupStrategyOptions { + // rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + // +optional + optional string rule = 1; + + // ranges are the allowed ranges of fs groups. If you would like to force a single + // fs group then supply a single range with the same start and end. Required for MustRunAs. + // +optional + repeated IDRange ranges = 2; +} + +// HostPortRange defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +message HostPortRange { + // min is the start of the range, inclusive. + optional int32 min = 1; + + // max is the end of the range, inclusive. + optional int32 max = 2; +} + +// IDRange provides a min/max of an allowed range of IDs. +message IDRange { + // min is the start of the range, inclusive. + optional int64 min = 1; + + // max is the end of the range, inclusive. + optional int64 max = 2; +} + // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods message PodDisruptionBudget { // Standard object's metadata. @@ -177,3 +238,219 @@ message PodDisruptionBudgetStatus { repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7; } +// PodSecurityPolicy governs the ability to make requests that affect the Security Context +// that will be applied to a pod and container. +// Deprecated in 1.21. +message PodSecurityPolicy { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the policy enforced. + // +optional + optional PodSecurityPolicySpec spec = 2; +} + +// PodSecurityPolicyList is a list of PodSecurityPolicy objects. +message PodSecurityPolicyList { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is a list of schema objects. + repeated PodSecurityPolicy items = 2; +} + +// PodSecurityPolicySpec defines the policy enforced. +message PodSecurityPolicySpec { + // privileged determines if a pod can request to be run as privileged. + // +optional + optional bool privileged = 1; + + // defaultAddCapabilities is the default set of capabilities that will be added to the container + // unless the pod spec specifically drops the capability. You may not list a capability in both + // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly + // allowed, and need not be included in the allowedCapabilities list. + // +optional + repeated string defaultAddCapabilities = 2; + + // requiredDropCapabilities are the capabilities that will be dropped from the container. These + // are required to be dropped and cannot be added. + // +optional + repeated string requiredDropCapabilities = 3; + + // allowedCapabilities is a list of capabilities that can be requested to add to the container. + // Capabilities in this field may be added at the pod author's discretion. + // You must not list a capability in both allowedCapabilities and requiredDropCapabilities. + // +optional + repeated string allowedCapabilities = 4; + + // volumes is an allowlist of volume plugins. Empty indicates that + // no volumes may be used. To allow all volumes you may use '*'. + // +optional + repeated string volumes = 5; + + // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + // +optional + optional bool hostNetwork = 6; + + // hostPorts determines which host port ranges are allowed to be exposed. + // +optional + repeated HostPortRange hostPorts = 7; + + // hostPID determines if the policy allows the use of HostPID in the pod spec. + // +optional + optional bool hostPID = 8; + + // hostIPC determines if the policy allows the use of HostIPC in the pod spec. + // +optional + optional bool hostIPC = 9; + + // seLinux is the strategy that will dictate the allowable labels that may be set. + optional SELinuxStrategyOptions seLinux = 10; + + // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + optional RunAsUserStrategyOptions runAsUser = 11; + + // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. + // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the + // RunAsGroup feature gate to be enabled. + // +optional + optional RunAsGroupStrategyOptions runAsGroup = 22; + + // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. + optional SupplementalGroupsStrategyOptions supplementalGroups = 12; + + // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. + optional FSGroupStrategyOptions fsGroup = 13; + + // readOnlyRootFilesystem when set to true will force containers to run with a read only root file + // system. If the container specifically requests to run with a non-read only root file system + // the PSP should deny the pod. + // If set to false the container may run with a read only root file system if it wishes but it + // will not be forced to. + // +optional + optional bool readOnlyRootFilesystem = 14; + + // defaultAllowPrivilegeEscalation controls the default setting for whether a + // process can gain more privileges than its parent process. + // +optional + optional bool defaultAllowPrivilegeEscalation = 15; + + // allowPrivilegeEscalation determines if a pod can request to allow + // privilege escalation. If unspecified, defaults to true. + // +optional + optional bool allowPrivilegeEscalation = 16; + + // allowedHostPaths is an allowlist of host paths. Empty indicates + // that all host paths may be used. + // +optional + repeated AllowedHostPath allowedHostPaths = 17; + + // allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all + // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes + // is allowed in the "volumes" field. + // +optional + repeated AllowedFlexVolume allowedFlexVolumes = 18; + + // AllowedCSIDrivers is an allowlist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. + // An empty value indicates that any CSI driver can be used for inline ephemeral volumes. + // +optional + repeated AllowedCSIDriver allowedCSIDrivers = 23; + + // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. + // Each entry is either a plain sysctl name or ends in "*" in which case it is considered + // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. + // Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection. + // + // Examples: + // e.g. "foo/*" allows "foo/bar", "foo/baz", etc. + // e.g. "foo.*" allows "foo.bar", "foo.baz", etc. + // +optional + repeated string allowedUnsafeSysctls = 19; + + // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. + // Each entry is either a plain sysctl name or ends in "*" in which case it is considered + // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. + // + // Examples: + // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. + // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. + // +optional + repeated string forbiddenSysctls = 20; + + // AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. + // Empty or nil indicates that only the DefaultProcMountType may be used. + // This requires the ProcMountType feature flag to be enabled. + // +optional + repeated string allowedProcMountTypes = 21; + + // runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. + // If this field is omitted, the pod's runtimeClassName field is unrestricted. + // Enforcement of this field depends on the RuntimeClass feature gate being enabled. + // +optional + optional RuntimeClassStrategyOptions runtimeClass = 24; +} + +// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. +message RunAsGroupStrategyOptions { + // rule is the strategy that will dictate the allowable RunAsGroup values that may be set. + optional string rule = 1; + + // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid + // then supply a single range with the same start and end. Required for MustRunAs. + // +optional + repeated IDRange ranges = 2; +} + +// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. +message RunAsUserStrategyOptions { + // rule is the strategy that will dictate the allowable RunAsUser values that may be set. + optional string rule = 1; + + // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid + // then supply a single range with the same start and end. Required for MustRunAs. + // +optional + repeated IDRange ranges = 2; +} + +// RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses +// for a pod. +message RuntimeClassStrategyOptions { + // allowedRuntimeClassNames is an allowlist of RuntimeClass names that may be specified on a pod. + // A value of "*" means that any RuntimeClass name is allowed, and must be the only item in the + // list. An empty list requires the RuntimeClassName field to be unset. + repeated string allowedRuntimeClassNames = 1; + + // defaultRuntimeClassName is the default RuntimeClassName to set on the pod. + // The default MUST be allowed by the allowedRuntimeClassNames list. + // A value of nil does not mutate the Pod. + // +optional + optional string defaultRuntimeClassName = 2; +} + +// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. +message SELinuxStrategyOptions { + // rule is the strategy that will dictate the allowable labels that may be set. + optional string rule = 1; + + // seLinuxOptions required to run as; required for MustRunAs + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2; +} + +// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. +message SupplementalGroupsStrategyOptions { + // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + // +optional + optional string rule = 1; + + // ranges are the allowed ranges of supplemental groups. If you would like to force a single + // supplemental group then supply a single range with the same start and end. Required for MustRunAs. + // +optional + repeated IDRange ranges = 2; +} + diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/register.go b/upstream/vendor/k8s.io/api/policy/v1beta1/register.go index d77f1304070..b3efd6326b5 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/register.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/register.go @@ -46,6 +46,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &PodDisruptionBudget{}, &PodDisruptionBudgetList{}, + &PodSecurityPolicy{}, + &PodSecurityPolicyList{}, &Eviction{}, ) // Add the watch version that applies diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/types.go b/upstream/vendor/k8s.io/api/policy/v1beta1/types.go index bc5f970d270..1e6b075e32d 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/types.go @@ -17,6 +17,7 @@ limitations under the License. package v1beta1 import ( + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -227,3 +228,373 @@ type Eviction struct { // +optional DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` } + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.10 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 + +// PodSecurityPolicy governs the ability to make requests that affect the Security Context +// that will be applied to a pod and container. +// Deprecated in 1.21. +type PodSecurityPolicy struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the policy enforced. + // +optional + Spec PodSecurityPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// PodSecurityPolicySpec defines the policy enforced. +type PodSecurityPolicySpec struct { + // privileged determines if a pod can request to be run as privileged. + // +optional + Privileged bool `json:"privileged,omitempty" protobuf:"varint,1,opt,name=privileged"` + // defaultAddCapabilities is the default set of capabilities that will be added to the container + // unless the pod spec specifically drops the capability. You may not list a capability in both + // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly + // allowed, and need not be included in the allowedCapabilities list. + // +optional + DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty" protobuf:"bytes,2,rep,name=defaultAddCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // requiredDropCapabilities are the capabilities that will be dropped from the container. These + // are required to be dropped and cannot be added. + // +optional + RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty" protobuf:"bytes,3,rep,name=requiredDropCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // allowedCapabilities is a list of capabilities that can be requested to add to the container. + // Capabilities in this field may be added at the pod author's discretion. + // You must not list a capability in both allowedCapabilities and requiredDropCapabilities. + // +optional + AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty" protobuf:"bytes,4,rep,name=allowedCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // volumes is an allowlist of volume plugins. Empty indicates that + // no volumes may be used. To allow all volumes you may use '*'. + // +optional + Volumes []FSType `json:"volumes,omitempty" protobuf:"bytes,5,rep,name=volumes,casttype=FSType"` + // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + // +optional + HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,6,opt,name=hostNetwork"` + // hostPorts determines which host port ranges are allowed to be exposed. + // +optional + HostPorts []HostPortRange `json:"hostPorts,omitempty" protobuf:"bytes,7,rep,name=hostPorts"` + // hostPID determines if the policy allows the use of HostPID in the pod spec. + // +optional + HostPID bool `json:"hostPID,omitempty" protobuf:"varint,8,opt,name=hostPID"` + // hostIPC determines if the policy allows the use of HostIPC in the pod spec. + // +optional + HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,9,opt,name=hostIPC"` + // seLinux is the strategy that will dictate the allowable labels that may be set. + SELinux SELinuxStrategyOptions `json:"seLinux" protobuf:"bytes,10,opt,name=seLinux"` + // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + RunAsUser RunAsUserStrategyOptions `json:"runAsUser" protobuf:"bytes,11,opt,name=runAsUser"` + // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. + // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the + // RunAsGroup feature gate to be enabled. + // +optional + RunAsGroup *RunAsGroupStrategyOptions `json:"runAsGroup,omitempty" protobuf:"bytes,22,opt,name=runAsGroup"` + // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. + SupplementalGroups SupplementalGroupsStrategyOptions `json:"supplementalGroups" protobuf:"bytes,12,opt,name=supplementalGroups"` + // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. + FSGroup FSGroupStrategyOptions `json:"fsGroup" protobuf:"bytes,13,opt,name=fsGroup"` + // readOnlyRootFilesystem when set to true will force containers to run with a read only root file + // system. If the container specifically requests to run with a non-read only root file system + // the PSP should deny the pod. + // If set to false the container may run with a read only root file system if it wishes but it + // will not be forced to. + // +optional + ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,14,opt,name=readOnlyRootFilesystem"` + // defaultAllowPrivilegeEscalation controls the default setting for whether a + // process can gain more privileges than its parent process. + // +optional + DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty" protobuf:"varint,15,opt,name=defaultAllowPrivilegeEscalation"` + // allowPrivilegeEscalation determines if a pod can request to allow + // privilege escalation. If unspecified, defaults to true. + // +optional + AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,16,opt,name=allowPrivilegeEscalation"` + // allowedHostPaths is an allowlist of host paths. Empty indicates + // that all host paths may be used. + // +optional + AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty" protobuf:"bytes,17,rep,name=allowedHostPaths"` + // allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all + // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes + // is allowed in the "volumes" field. + // +optional + AllowedFlexVolumes []AllowedFlexVolume `json:"allowedFlexVolumes,omitempty" protobuf:"bytes,18,rep,name=allowedFlexVolumes"` + // AllowedCSIDrivers is an allowlist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. + // An empty value indicates that any CSI driver can be used for inline ephemeral volumes. + // +optional + AllowedCSIDrivers []AllowedCSIDriver `json:"allowedCSIDrivers,omitempty" protobuf:"bytes,23,rep,name=allowedCSIDrivers"` + // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. + // Each entry is either a plain sysctl name or ends in "*" in which case it is considered + // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. + // Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection. + // + // Examples: + // e.g. "foo/*" allows "foo/bar", "foo/baz", etc. + // e.g. "foo.*" allows "foo.bar", "foo.baz", etc. + // +optional + AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty" protobuf:"bytes,19,rep,name=allowedUnsafeSysctls"` + // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. + // Each entry is either a plain sysctl name or ends in "*" in which case it is considered + // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. + // + // Examples: + // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. + // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. + // +optional + ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty" protobuf:"bytes,20,rep,name=forbiddenSysctls"` + // AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. + // Empty or nil indicates that only the DefaultProcMountType may be used. + // This requires the ProcMountType feature flag to be enabled. + // +optional + AllowedProcMountTypes []v1.ProcMountType `json:"allowedProcMountTypes,omitempty" protobuf:"bytes,21,opt,name=allowedProcMountTypes"` + // runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. + // If this field is omitted, the pod's runtimeClassName field is unrestricted. + // Enforcement of this field depends on the RuntimeClass feature gate being enabled. + // +optional + RuntimeClass *RuntimeClassStrategyOptions `json:"runtimeClass,omitempty" protobuf:"bytes,24,opt,name=runtimeClass"` +} + +// AllowedHostPath defines the host volume conditions that will be enabled by a policy +// for pods to use. It requires the path prefix to be defined. +type AllowedHostPath struct { + // pathPrefix is the path prefix that the host volume must match. + // It does not support `*`. + // Trailing slashes are trimmed when validating the path prefix with a host path. + // + // Examples: + // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` + // `/foo` would not allow `/food` or `/etc/foo` + PathPrefix string `json:"pathPrefix,omitempty" protobuf:"bytes,1,rep,name=pathPrefix"` + + // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. + // +optional + ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` +} + +// AllowAllCapabilities can be used as a value for the PodSecurityPolicy.AllowAllCapabilities +// field and means that any capabilities are allowed to be requested. +var AllowAllCapabilities v1.Capability = "*" + +// FSType gives strong typing to different file systems that are used by volumes. +type FSType string + +const ( + AzureFile FSType = "azureFile" + Flocker FSType = "flocker" + FlexVolume FSType = "flexVolume" + HostPath FSType = "hostPath" + EmptyDir FSType = "emptyDir" + GCEPersistentDisk FSType = "gcePersistentDisk" + AWSElasticBlockStore FSType = "awsElasticBlockStore" + GitRepo FSType = "gitRepo" + Secret FSType = "secret" + NFS FSType = "nfs" + ISCSI FSType = "iscsi" + Glusterfs FSType = "glusterfs" + PersistentVolumeClaim FSType = "persistentVolumeClaim" + RBD FSType = "rbd" + Cinder FSType = "cinder" + CephFS FSType = "cephFS" + DownwardAPI FSType = "downwardAPI" + FC FSType = "fc" + ConfigMap FSType = "configMap" + VsphereVolume FSType = "vsphereVolume" + Quobyte FSType = "quobyte" + AzureDisk FSType = "azureDisk" + PhotonPersistentDisk FSType = "photonPersistentDisk" + StorageOS FSType = "storageos" + Projected FSType = "projected" + PortworxVolume FSType = "portworxVolume" + ScaleIO FSType = "scaleIO" + CSI FSType = "csi" + Ephemeral FSType = "ephemeral" + All FSType = "*" +) + +// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. +type AllowedFlexVolume struct { + // driver is the name of the Flexvolume driver. + Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` +} + +// AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used. +type AllowedCSIDriver struct { + // Name is the registered name of the CSI driver + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` +} + +// HostPortRange defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +type HostPortRange struct { + // min is the start of the range, inclusive. + Min int32 `json:"min" protobuf:"varint,1,opt,name=min"` + // max is the end of the range, inclusive. + Max int32 `json:"max" protobuf:"varint,2,opt,name=max"` +} + +// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. +type SELinuxStrategyOptions struct { + // rule is the strategy that will dictate the allowable labels that may be set. + Rule SELinuxStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=SELinuxStrategy"` + // seLinuxOptions required to run as; required for MustRunAs + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"` +} + +// SELinuxStrategy denotes strategy types for generating SELinux options for a +// Security Context. +type SELinuxStrategy string + +const ( + // SELinuxStrategyMustRunAs means that container must have SELinux labels of X applied. + SELinuxStrategyMustRunAs SELinuxStrategy = "MustRunAs" + // SELinuxStrategyRunAsAny means that container may make requests for any SELinux context labels. + SELinuxStrategyRunAsAny SELinuxStrategy = "RunAsAny" +) + +// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. +type RunAsUserStrategyOptions struct { + // rule is the strategy that will dictate the allowable RunAsUser values that may be set. + Rule RunAsUserStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsUserStrategy"` + // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid + // then supply a single range with the same start and end. Required for MustRunAs. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. +type RunAsGroupStrategyOptions struct { + // rule is the strategy that will dictate the allowable RunAsGroup values that may be set. + Rule RunAsGroupStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsGroupStrategy"` + // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid + // then supply a single range with the same start and end. Required for MustRunAs. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// IDRange provides a min/max of an allowed range of IDs. +type IDRange struct { + // min is the start of the range, inclusive. + Min int64 `json:"min" protobuf:"varint,1,opt,name=min"` + // max is the end of the range, inclusive. + Max int64 `json:"max" protobuf:"varint,2,opt,name=max"` +} + +// RunAsUserStrategy denotes strategy types for generating RunAsUser values for a +// Security Context. +type RunAsUserStrategy string + +const ( + // RunAsUserStrategyMustRunAs means that container must run as a particular uid. + RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs" + // RunAsUserStrategyMustRunAsNonRoot means that container must run as a non-root uid. + RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot" + // RunAsUserStrategyRunAsAny means that container may make requests for any uid. + RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny" +) + +// RunAsGroupStrategy denotes strategy types for generating RunAsGroup values for a +// Security Context. +type RunAsGroupStrategy string + +const ( + // RunAsGroupStrategyMayRunAs means that container does not need to run with a particular gid. + // However, when RunAsGroup are specified, they have to fall in the defined range. + RunAsGroupStrategyMayRunAs RunAsGroupStrategy = "MayRunAs" + // RunAsGroupStrategyMustRunAs means that container must run as a particular gid. + RunAsGroupStrategyMustRunAs RunAsGroupStrategy = "MustRunAs" + // RunAsUserStrategyRunAsAny means that container may make requests for any gid. + RunAsGroupStrategyRunAsAny RunAsGroupStrategy = "RunAsAny" +) + +// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. +type FSGroupStrategyOptions struct { + // rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + // +optional + Rule FSGroupStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=FSGroupStrategyType"` + // ranges are the allowed ranges of fs groups. If you would like to force a single + // fs group then supply a single range with the same start and end. Required for MustRunAs. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// FSGroupStrategyType denotes strategy types for generating FSGroup values for a +// SecurityContext +type FSGroupStrategyType string + +const ( + // FSGroupStrategyMayRunAs means that container does not need to have FSGroup of X applied. + // However, when FSGroups are specified, they have to fall in the defined range. + FSGroupStrategyMayRunAs FSGroupStrategyType = "MayRunAs" + // FSGroupStrategyMustRunAs meant that container must have FSGroup of X applied. + FSGroupStrategyMustRunAs FSGroupStrategyType = "MustRunAs" + // FSGroupStrategyRunAsAny means that container may make requests for any FSGroup labels. + FSGroupStrategyRunAsAny FSGroupStrategyType = "RunAsAny" +) + +// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. +type SupplementalGroupsStrategyOptions struct { + // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + // +optional + Rule SupplementalGroupsStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=SupplementalGroupsStrategyType"` + // ranges are the allowed ranges of supplemental groups. If you would like to force a single + // supplemental group then supply a single range with the same start and end. Required for MustRunAs. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// SupplementalGroupsStrategyType denotes strategy types for determining valid supplemental +// groups for a SecurityContext. +type SupplementalGroupsStrategyType string + +const ( + // SupplementalGroupsStrategyMayRunAs means that container does not need to run with a particular gid. + // However, when gids are specified, they have to fall in the defined range. + SupplementalGroupsStrategyMayRunAs SupplementalGroupsStrategyType = "MayRunAs" + // SupplementalGroupsStrategyMustRunAs means that container must run as a particular gid. + SupplementalGroupsStrategyMustRunAs SupplementalGroupsStrategyType = "MustRunAs" + // SupplementalGroupsStrategyRunAsAny means that container may make requests for any gid. + SupplementalGroupsStrategyRunAsAny SupplementalGroupsStrategyType = "RunAsAny" +) + +// RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses +// for a pod. +type RuntimeClassStrategyOptions struct { + // allowedRuntimeClassNames is an allowlist of RuntimeClass names that may be specified on a pod. + // A value of "*" means that any RuntimeClass name is allowed, and must be the only item in the + // list. An empty list requires the RuntimeClassName field to be unset. + AllowedRuntimeClassNames []string `json:"allowedRuntimeClassNames" protobuf:"bytes,1,rep,name=allowedRuntimeClassNames"` + // defaultRuntimeClassName is the default RuntimeClassName to set on the pod. + // The default MUST be allowed by the allowedRuntimeClassNames list. + // A value of nil does not mutate the Pod. + // +optional + DefaultRuntimeClassName *string `json:"defaultRuntimeClassName,omitempty" protobuf:"bytes,2,opt,name=defaultRuntimeClassName"` +} + +// AllowAllRuntimeClassNames can be used as a value for the +// RuntimeClassStrategyOptions.AllowedRuntimeClassNames field and means that any RuntimeClassName is +// allowed. +const AllowAllRuntimeClassNames = "*" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.10 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 + +// PodSecurityPolicyList is a list of PodSecurityPolicy objects. +type PodSecurityPolicyList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is a list of schema objects. + Items []PodSecurityPolicy `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index 4a79d759495..266a9a853a8 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -27,6 +27,34 @@ package v1beta1 // Those methods can be generated by using hack/update-codegen.sh // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_AllowedCSIDriver = map[string]string{ + "": "AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.", + "name": "Name is the registered name of the CSI driver", +} + +func (AllowedCSIDriver) SwaggerDoc() map[string]string { + return map_AllowedCSIDriver +} + +var map_AllowedFlexVolume = map[string]string{ + "": "AllowedFlexVolume represents a single Flexvolume that is allowed to be used.", + "driver": "driver is the name of the Flexvolume driver.", +} + +func (AllowedFlexVolume) SwaggerDoc() map[string]string { + return map_AllowedFlexVolume +} + +var map_AllowedHostPath = map[string]string{ + "": "AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.", + "pathPrefix": "pathPrefix is the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path.\n\nExamples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar` `/foo` would not allow `/food` or `/etc/foo`", + "readOnly": "when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.", +} + +func (AllowedHostPath) SwaggerDoc() map[string]string { + return map_AllowedHostPath +} + var map_Eviction = map[string]string{ "": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/<pod name>/evictions.", "metadata": "ObjectMeta describes the pod that is being evicted.", @@ -37,6 +65,36 @@ func (Eviction) SwaggerDoc() map[string]string { return map_Eviction } +var map_FSGroupStrategyOptions = map[string]string{ + "": "FSGroupStrategyOptions defines the strategy type and options used to create the strategy.", + "rule": "rule is the strategy that will dictate what FSGroup is used in the SecurityContext.", + "ranges": "ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs.", +} + +func (FSGroupStrategyOptions) SwaggerDoc() map[string]string { + return map_FSGroupStrategyOptions +} + +var map_HostPortRange = map[string]string{ + "": "HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.", + "min": "min is the start of the range, inclusive.", + "max": "max is the end of the range, inclusive.", +} + +func (HostPortRange) SwaggerDoc() map[string]string { + return map_HostPortRange +} + +var map_IDRange = map[string]string{ + "": "IDRange provides a min/max of an allowed range of IDs.", + "min": "min is the start of the range, inclusive.", + "max": "max is the end of the range, inclusive.", +} + +func (IDRange) SwaggerDoc() map[string]string { + return map_IDRange +} + var map_PodDisruptionBudget = map[string]string{ "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -85,4 +143,106 @@ func (PodDisruptionBudgetStatus) SwaggerDoc() map[string]string { return map_PodDisruptionBudgetStatus } +var map_PodSecurityPolicy = map[string]string{ + "": "PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. Deprecated in 1.21.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the policy enforced.", +} + +func (PodSecurityPolicy) SwaggerDoc() map[string]string { + return map_PodSecurityPolicy +} + +var map_PodSecurityPolicyList = map[string]string{ + "": "PodSecurityPolicyList is a list of PodSecurityPolicy objects.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is a list of schema objects.", +} + +func (PodSecurityPolicyList) SwaggerDoc() map[string]string { + return map_PodSecurityPolicyList +} + +var map_PodSecurityPolicySpec = map[string]string{ + "": "PodSecurityPolicySpec defines the policy enforced.", + "privileged": "privileged determines if a pod can request to be run as privileged.", + "defaultAddCapabilities": "defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list.", + "requiredDropCapabilities": "requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.", + "allowedCapabilities": "allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities.", + "volumes": "volumes is an allowlist of volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'.", + "hostNetwork": "hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.", + "hostPorts": "hostPorts determines which host port ranges are allowed to be exposed.", + "hostPID": "hostPID determines if the policy allows the use of HostPID in the pod spec.", + "hostIPC": "hostIPC determines if the policy allows the use of HostIPC in the pod spec.", + "seLinux": "seLinux is the strategy that will dictate the allowable labels that may be set.", + "runAsUser": "runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.", + "runAsGroup": "RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled.", + "supplementalGroups": "supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.", + "fsGroup": "fsGroup is the strategy that will dictate what fs group is used by the SecurityContext.", + "readOnlyRootFilesystem": "readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.", + "defaultAllowPrivilegeEscalation": "defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.", + "allowPrivilegeEscalation": "allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.", + "allowedHostPaths": "allowedHostPaths is an allowlist of host paths. Empty indicates that all host paths may be used.", + "allowedFlexVolumes": "allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the \"volumes\" field.", + "allowedCSIDrivers": "AllowedCSIDrivers is an allowlist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. An empty value indicates that any CSI driver can be used for inline ephemeral volumes.", + "allowedUnsafeSysctls": "allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in \"*\" in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection.\n\nExamples: e.g. \"foo/*\" allows \"foo/bar\", \"foo/baz\", etc. e.g. \"foo.*\" allows \"foo.bar\", \"foo.baz\", etc.", + "forbiddenSysctls": "forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in \"*\" in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.\n\nExamples: e.g. \"foo/*\" forbids \"foo/bar\", \"foo/baz\", etc. e.g. \"foo.*\" forbids \"foo.bar\", \"foo.baz\", etc.", + "allowedProcMountTypes": "AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled.", + "runtimeClass": "runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. If this field is omitted, the pod's runtimeClassName field is unrestricted. Enforcement of this field depends on the RuntimeClass feature gate being enabled.", +} + +func (PodSecurityPolicySpec) SwaggerDoc() map[string]string { + return map_PodSecurityPolicySpec +} + +var map_RunAsGroupStrategyOptions = map[string]string{ + "": "RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.", + "rule": "rule is the strategy that will dictate the allowable RunAsGroup values that may be set.", + "ranges": "ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs.", +} + +func (RunAsGroupStrategyOptions) SwaggerDoc() map[string]string { + return map_RunAsGroupStrategyOptions +} + +var map_RunAsUserStrategyOptions = map[string]string{ + "": "RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.", + "rule": "rule is the strategy that will dictate the allowable RunAsUser values that may be set.", + "ranges": "ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs.", +} + +func (RunAsUserStrategyOptions) SwaggerDoc() map[string]string { + return map_RunAsUserStrategyOptions +} + +var map_RuntimeClassStrategyOptions = map[string]string{ + "": "RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses for a pod.", + "allowedRuntimeClassNames": "allowedRuntimeClassNames is an allowlist of RuntimeClass names that may be specified on a pod. A value of \"*\" means that any RuntimeClass name is allowed, and must be the only item in the list. An empty list requires the RuntimeClassName field to be unset.", + "defaultRuntimeClassName": "defaultRuntimeClassName is the default RuntimeClassName to set on the pod. The default MUST be allowed by the allowedRuntimeClassNames list. A value of nil does not mutate the Pod.", +} + +func (RuntimeClassStrategyOptions) SwaggerDoc() map[string]string { + return map_RuntimeClassStrategyOptions +} + +var map_SELinuxStrategyOptions = map[string]string{ + "": "SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.", + "rule": "rule is the strategy that will dictate the allowable labels that may be set.", + "seLinuxOptions": "seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", +} + +func (SELinuxStrategyOptions) SwaggerDoc() map[string]string { + return map_SELinuxStrategyOptions +} + +var map_SupplementalGroupsStrategyOptions = map[string]string{ + "": "SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.", + "rule": "rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.", + "ranges": "ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs.", +} + +func (SupplementalGroupsStrategyOptions) SwaggerDoc() map[string]string { + return map_SupplementalGroupsStrategyOptions +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go index 51895ffdb9b..8602d1adcad 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go @@ -22,11 +22,60 @@ limitations under the License. package v1beta1 import ( + corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedCSIDriver) DeepCopyInto(out *AllowedCSIDriver) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedCSIDriver. +func (in *AllowedCSIDriver) DeepCopy() *AllowedCSIDriver { + if in == nil { + return nil + } + out := new(AllowedCSIDriver) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedFlexVolume) DeepCopyInto(out *AllowedFlexVolume) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedFlexVolume. +func (in *AllowedFlexVolume) DeepCopy() *AllowedFlexVolume { + if in == nil { + return nil + } + out := new(AllowedFlexVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedHostPath) DeepCopyInto(out *AllowedHostPath) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedHostPath. +func (in *AllowedHostPath) DeepCopy() *AllowedHostPath { + if in == nil { + return nil + } + out := new(AllowedHostPath) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Eviction) DeepCopyInto(out *Eviction) { *out = *in @@ -58,6 +107,59 @@ func (in *Eviction) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FSGroupStrategyOptions) DeepCopyInto(out *FSGroupStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FSGroupStrategyOptions. +func (in *FSGroupStrategyOptions) DeepCopy() *FSGroupStrategyOptions { + if in == nil { + return nil + } + out := new(FSGroupStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostPortRange) DeepCopyInto(out *HostPortRange) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPortRange. +func (in *HostPortRange) DeepCopy() *HostPortRange { + if in == nil { + return nil + } + out := new(HostPortRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IDRange) DeepCopyInto(out *IDRange) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IDRange. +func (in *IDRange) DeepCopy() *IDRange { + if in == nil { + return nil + } + out := new(IDRange) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodDisruptionBudget) DeepCopyInto(out *PodDisruptionBudget) { *out = *in @@ -184,3 +286,268 @@ func (in *PodDisruptionBudgetStatus) DeepCopy() *PodDisruptionBudgetStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodSecurityPolicy) DeepCopyInto(out *PodSecurityPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicy. +func (in *PodSecurityPolicy) DeepCopy() *PodSecurityPolicy { + if in == nil { + return nil + } + out := new(PodSecurityPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodSecurityPolicy) 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 *PodSecurityPolicyList) DeepCopyInto(out *PodSecurityPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodSecurityPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyList. +func (in *PodSecurityPolicyList) DeepCopy() *PodSecurityPolicyList { + if in == nil { + return nil + } + out := new(PodSecurityPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodSecurityPolicyList) 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 *PodSecurityPolicySpec) DeepCopyInto(out *PodSecurityPolicySpec) { + *out = *in + if in.DefaultAddCapabilities != nil { + in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities + *out = make([]corev1.Capability, len(*in)) + copy(*out, *in) + } + if in.RequiredDropCapabilities != nil { + in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities + *out = make([]corev1.Capability, len(*in)) + copy(*out, *in) + } + if in.AllowedCapabilities != nil { + in, out := &in.AllowedCapabilities, &out.AllowedCapabilities + *out = make([]corev1.Capability, len(*in)) + copy(*out, *in) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]FSType, len(*in)) + copy(*out, *in) + } + if in.HostPorts != nil { + in, out := &in.HostPorts, &out.HostPorts + *out = make([]HostPortRange, len(*in)) + copy(*out, *in) + } + in.SELinux.DeepCopyInto(&out.SELinux) + in.RunAsUser.DeepCopyInto(&out.RunAsUser) + if in.RunAsGroup != nil { + in, out := &in.RunAsGroup, &out.RunAsGroup + *out = new(RunAsGroupStrategyOptions) + (*in).DeepCopyInto(*out) + } + in.SupplementalGroups.DeepCopyInto(&out.SupplementalGroups) + in.FSGroup.DeepCopyInto(&out.FSGroup) + if in.DefaultAllowPrivilegeEscalation != nil { + in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation + *out = new(bool) + **out = **in + } + if in.AllowPrivilegeEscalation != nil { + in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation + *out = new(bool) + **out = **in + } + if in.AllowedHostPaths != nil { + in, out := &in.AllowedHostPaths, &out.AllowedHostPaths + *out = make([]AllowedHostPath, len(*in)) + copy(*out, *in) + } + if in.AllowedFlexVolumes != nil { + in, out := &in.AllowedFlexVolumes, &out.AllowedFlexVolumes + *out = make([]AllowedFlexVolume, len(*in)) + copy(*out, *in) + } + if in.AllowedCSIDrivers != nil { + in, out := &in.AllowedCSIDrivers, &out.AllowedCSIDrivers + *out = make([]AllowedCSIDriver, len(*in)) + copy(*out, *in) + } + if in.AllowedUnsafeSysctls != nil { + in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ForbiddenSysctls != nil { + in, out := &in.ForbiddenSysctls, &out.ForbiddenSysctls + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowedProcMountTypes != nil { + in, out := &in.AllowedProcMountTypes, &out.AllowedProcMountTypes + *out = make([]corev1.ProcMountType, len(*in)) + copy(*out, *in) + } + if in.RuntimeClass != nil { + in, out := &in.RuntimeClass, &out.RuntimeClass + *out = new(RuntimeClassStrategyOptions) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicySpec. +func (in *PodSecurityPolicySpec) DeepCopy() *PodSecurityPolicySpec { + if in == nil { + return nil + } + out := new(PodSecurityPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RunAsGroupStrategyOptions) DeepCopyInto(out *RunAsGroupStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunAsGroupStrategyOptions. +func (in *RunAsGroupStrategyOptions) DeepCopy() *RunAsGroupStrategyOptions { + if in == nil { + return nil + } + out := new(RunAsGroupStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RunAsUserStrategyOptions) DeepCopyInto(out *RunAsUserStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunAsUserStrategyOptions. +func (in *RunAsUserStrategyOptions) DeepCopy() *RunAsUserStrategyOptions { + if in == nil { + return nil + } + out := new(RunAsUserStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuntimeClassStrategyOptions) DeepCopyInto(out *RuntimeClassStrategyOptions) { + *out = *in + if in.AllowedRuntimeClassNames != nil { + in, out := &in.AllowedRuntimeClassNames, &out.AllowedRuntimeClassNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DefaultRuntimeClassName != nil { + in, out := &in.DefaultRuntimeClassName, &out.DefaultRuntimeClassName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeClassStrategyOptions. +func (in *RuntimeClassStrategyOptions) DeepCopy() *RuntimeClassStrategyOptions { + if in == nil { + return nil + } + out := new(RuntimeClassStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SELinuxStrategyOptions) DeepCopyInto(out *SELinuxStrategyOptions) { + *out = *in + if in.SELinuxOptions != nil { + in, out := &in.SELinuxOptions, &out.SELinuxOptions + *out = new(corev1.SELinuxOptions) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SELinuxStrategyOptions. +func (in *SELinuxStrategyOptions) DeepCopy() *SELinuxStrategyOptions { + if in == nil { + return nil + } + out := new(SELinuxStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SupplementalGroupsStrategyOptions) DeepCopyInto(out *SupplementalGroupsStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupplementalGroupsStrategyOptions. +func (in *SupplementalGroupsStrategyOptions) DeepCopy() *SupplementalGroupsStrategyOptions { + if in == nil { + return nil + } + out := new(SupplementalGroupsStrategyOptions) + in.DeepCopyInto(out) + return out +} diff --git a/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go b/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go index 765a71e4728..612061d6cf7 100644 --- a/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/upstream/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go @@ -90,3 +90,39 @@ func (in *PodDisruptionBudgetList) APILifecycleReplacement() schema.GroupVersion func (in *PodDisruptionBudgetList) APILifecycleRemoved() (major, minor int) { return 1, 25 } + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodSecurityPolicy) APILifecycleIntroduced() (major, minor int) { + return 1, 10 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PodSecurityPolicy) APILifecycleDeprecated() (major, minor int) { + return 1, 21 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PodSecurityPolicy) APILifecycleRemoved() (major, minor int) { + return 1, 25 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodSecurityPolicyList) APILifecycleIntroduced() (major, minor int) { + return 1, 10 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PodSecurityPolicyList) APILifecycleDeprecated() (major, minor int) { + return 1, 21 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PodSecurityPolicyList) APILifecycleRemoved() (major, minor int) { + return 1, 25 +} diff --git a/upstream/vendor/k8s.io/api/resource/v1alpha2/generated.proto b/upstream/vendor/k8s.io/api/resource/v1alpha2/generated.proto index f7748f9a1a2..02412398c43 100644 --- a/upstream/vendor/k8s.io/api/resource/v1alpha2/generated.proto +++ b/upstream/vendor/k8s.io/api/resource/v1alpha2/generated.proto @@ -107,7 +107,7 @@ message PodSchedulingContextSpec { // that suits all pending resources. This may get increased in the // future, but not reduced. // - // +listType=atomic + // +listType=set // +optional repeated string potentialNodes = 2; } @@ -208,7 +208,7 @@ message ResourceClaimSchedulingStatus { // PodSchedulingSpec.PotentialNodes. This may get increased in the // future, but not reduced. // - // +listType=atomic + // +listType=set // +optional repeated string unsuitableNodes = 2; } diff --git a/upstream/vendor/k8s.io/api/resource/v1alpha2/types.go b/upstream/vendor/k8s.io/api/resource/v1alpha2/types.go index a614ff9dc1b..21936bfe3d1 100644 --- a/upstream/vendor/k8s.io/api/resource/v1alpha2/types.go +++ b/upstream/vendor/k8s.io/api/resource/v1alpha2/types.go @@ -248,7 +248,7 @@ type PodSchedulingContextSpec struct { // that suits all pending resources. This may get increased in the // future, but not reduced. // - // +listType=atomic + // +listType=set // +optional PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"` } @@ -283,7 +283,7 @@ type ResourceClaimSchedulingStatus struct { // PodSchedulingSpec.PotentialNodes. This may get increased in the // future, but not reduced. // - // +listType=atomic + // +listType=set // +optional UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"` } diff --git a/upstream/vendor/k8s.io/api/storage/v1/generated.proto b/upstream/vendor/k8s.io/api/storage/v1/generated.proto index b35f708c663..5f8eccaefc5 100644 --- a/upstream/vendor/k8s.io/api/storage/v1/generated.proto +++ b/upstream/vendor/k8s.io/api/storage/v1/generated.proto @@ -88,7 +88,7 @@ message CSIDriverSpec { // If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. // The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. // - // The following VolumeContext will be passed if podInfoOnMount is set to true. + // The following VolumeConext will be passed if podInfoOnMount is set to true. // This list might grow, but the prefix will be used. // "csi.storage.k8s.io/pod.name": pod.Name // "csi.storage.k8s.io/pod.namespace": pod.Namespace diff --git a/upstream/vendor/k8s.io/api/storage/v1/types.go b/upstream/vendor/k8s.io/api/storage/v1/types.go index 7d7b7664b89..c785f368efd 100644 --- a/upstream/vendor/k8s.io/api/storage/v1/types.go +++ b/upstream/vendor/k8s.io/api/storage/v1/types.go @@ -291,7 +291,7 @@ type CSIDriverSpec struct { // If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. // The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. // - // The following VolumeContext will be passed if podInfoOnMount is set to true. + // The following VolumeConext will be passed if podInfoOnMount is set to true. // This list might grow, but the prefix will be used. // "csi.storage.k8s.io/pod.name": pod.Name // "csi.storage.k8s.io/pod.namespace": pod.Namespace diff --git a/upstream/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go index 69ee6836107..c92a7f95a29 100644 --- a/upstream/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go @@ -50,7 +50,7 @@ func (CSIDriverList) SwaggerDoc() map[string]string { var map_CSIDriverSpec = map[string]string{ "": "CSIDriverSpec is the specification of a CSIDriver.", "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.\n\nThis field is immutable.", - "podInfoOnMount": "podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false.\n\nThe CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.\n\nThe following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", + "podInfoOnMount": "podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false.\n\nThe CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.\n\nThe following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", "volumeLifecycleModes": "volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism.\n\nThe other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume.\n\nFor more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future.\n\nThis field is beta. This field is immutable.", "storageCapacity": "storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis field was immutable in Kubernetes <= 1.22 and now is mutable.", "fsGroupPolicy": "fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details.\n\nThis field is immutable.\n\nDefaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce.", diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.pb.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.pb.go index 2b15ec3feb0..1f3f380108a 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.pb.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.pb.go @@ -243,66 +243,10 @@ func (m *VolumeAttachmentStatus) XXX_DiscardUnknown() { var xxx_messageInfo_VolumeAttachmentStatus proto.InternalMessageInfo -func (m *VolumeAttributesClass) Reset() { *m = VolumeAttributesClass{} } -func (*VolumeAttributesClass) ProtoMessage() {} -func (*VolumeAttributesClass) Descriptor() ([]byte, []int) { - return fileDescriptor_10f856db1e670dc4, []int{7} -} -func (m *VolumeAttributesClass) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAttributesClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *VolumeAttributesClass) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAttributesClass.Merge(m, src) -} -func (m *VolumeAttributesClass) XXX_Size() int { - return m.Size() -} -func (m *VolumeAttributesClass) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAttributesClass.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAttributesClass proto.InternalMessageInfo - -func (m *VolumeAttributesClassList) Reset() { *m = VolumeAttributesClassList{} } -func (*VolumeAttributesClassList) ProtoMessage() {} -func (*VolumeAttributesClassList) Descriptor() ([]byte, []int) { - return fileDescriptor_10f856db1e670dc4, []int{8} -} -func (m *VolumeAttributesClassList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAttributesClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *VolumeAttributesClassList) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAttributesClassList.Merge(m, src) -} -func (m *VolumeAttributesClassList) XXX_Size() int { - return m.Size() -} -func (m *VolumeAttributesClassList) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAttributesClassList.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAttributesClassList proto.InternalMessageInfo - func (m *VolumeError) Reset() { *m = VolumeError{} } func (*VolumeError) ProtoMessage() {} func (*VolumeError) Descriptor() ([]byte, []int) { - return fileDescriptor_10f856db1e670dc4, []int{9} + return fileDescriptor_10f856db1e670dc4, []int{7} } func (m *VolumeError) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,9 +280,6 @@ func init() { proto.RegisterType((*VolumeAttachmentSpec)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttachmentSpec") proto.RegisterType((*VolumeAttachmentStatus)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttachmentStatus") proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttachmentStatus.AttachmentMetadataEntry") - proto.RegisterType((*VolumeAttributesClass)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttributesClass") - proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttributesClass.ParametersEntry") - proto.RegisterType((*VolumeAttributesClassList)(nil), "k8s.io.api.storage.v1alpha1.VolumeAttributesClassList") proto.RegisterType((*VolumeError)(nil), "k8s.io.api.storage.v1alpha1.VolumeError") } @@ -347,71 +288,65 @@ func init() { } var fileDescriptor_10f856db1e670dc4 = []byte{ - // 1023 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcb, 0x6e, 0x23, 0x45, - 0x17, 0x4e, 0xe7, 0x32, 0xe3, 0xa9, 0xe4, 0xff, 0xc7, 0x53, 0xca, 0x0c, 0xc6, 0x23, 0xb5, 0x23, - 0xaf, 0x0c, 0x62, 0xba, 0x49, 0x40, 0x68, 0x84, 0xc4, 0xc2, 0x9d, 0x64, 0x11, 0x91, 0x84, 0xa1, - 0x1c, 0x01, 0x02, 0x16, 0x94, 0xdb, 0x07, 0xbb, 0x62, 0xf7, 0x45, 0x55, 0xd5, 0x16, 0x66, 0xc5, - 0x8a, 0x35, 0x3b, 0xde, 0x80, 0x67, 0xc9, 0x02, 0x89, 0xd1, 0xac, 0x66, 0x65, 0x91, 0x86, 0x67, - 0x60, 0xc1, 0x06, 0xd4, 0xd5, 0xe5, 0x76, 0xc7, 0x6d, 0x07, 0x27, 0x8b, 0xec, 0x5c, 0xe7, 0xf2, - 0x9d, 0xdb, 0x77, 0x4e, 0x27, 0xe8, 0xa0, 0xff, 0x5c, 0x58, 0x2c, 0xb0, 0xfb, 0x51, 0x1b, 0xb8, - 0x0f, 0x12, 0x84, 0x3d, 0x04, 0xbf, 0x13, 0x70, 0x5b, 0x2b, 0x68, 0xc8, 0x6c, 0x21, 0x03, 0x4e, - 0xbb, 0x60, 0x0f, 0x77, 0xe9, 0x20, 0xec, 0xd1, 0x5d, 0xbb, 0x0b, 0x3e, 0x70, 0x2a, 0xa1, 0x63, - 0x85, 0x3c, 0x90, 0x01, 0x7e, 0x9a, 0x1a, 0x5b, 0x34, 0x64, 0x96, 0x36, 0xb6, 0x26, 0xc6, 0xd5, - 0x67, 0x5d, 0x26, 0x7b, 0x51, 0xdb, 0x72, 0x03, 0xcf, 0xee, 0x06, 0xdd, 0xc0, 0x56, 0x3e, 0xed, - 0xe8, 0x5b, 0xf5, 0x52, 0x0f, 0xf5, 0x2b, 0xc5, 0xaa, 0xd6, 0x73, 0x81, 0xdd, 0x80, 0x27, 0x51, - 0x67, 0xe3, 0x55, 0xdf, 0x9f, 0xda, 0x78, 0xd4, 0xed, 0x31, 0x1f, 0xf8, 0xc8, 0x0e, 0xfb, 0x5d, - 0xe5, 0xc4, 0x41, 0x04, 0x11, 0x77, 0xe1, 0x46, 0x5e, 0xc2, 0xf6, 0x40, 0xd2, 0x79, 0xb1, 0xec, - 0x45, 0x5e, 0x3c, 0xf2, 0x25, 0xf3, 0x8a, 0x61, 0x3e, 0xf8, 0x2f, 0x07, 0xe1, 0xf6, 0xc0, 0xa3, - 0xb3, 0x7e, 0xf5, 0xbf, 0xd6, 0x10, 0xde, 0x6f, 0x1d, 0xb5, 0xd2, 0xfe, 0xed, 0xd3, 0x90, 0xba, - 0x4c, 0x8e, 0xf0, 0x37, 0xa8, 0x94, 0xa4, 0xd6, 0xa1, 0x92, 0x56, 0x8c, 0x1d, 0xa3, 0xb1, 0xb9, - 0xf7, 0xae, 0x35, 0x6d, 0x77, 0x16, 0xc1, 0x0a, 0xfb, 0xdd, 0x44, 0x20, 0xac, 0xc4, 0xda, 0x1a, - 0xee, 0x5a, 0x9f, 0xb4, 0xcf, 0xc1, 0x95, 0x27, 0x20, 0xa9, 0x83, 0x2f, 0xc6, 0xb5, 0x95, 0x78, - 0x5c, 0x43, 0x53, 0x19, 0xc9, 0x50, 0x31, 0x43, 0x5b, 0x7e, 0xd0, 0x81, 0xb3, 0x20, 0x0c, 0x06, - 0x41, 0x77, 0x54, 0x59, 0x55, 0x51, 0xde, 0x5b, 0x2e, 0xca, 0x31, 0x6d, 0xc3, 0xa0, 0x05, 0x03, - 0x70, 0x65, 0xc0, 0x9d, 0x72, 0x3c, 0xae, 0x6d, 0x9d, 0xe6, 0xc0, 0xc8, 0x15, 0x68, 0x7c, 0x80, - 0xca, 0x9a, 0x1f, 0xfb, 0x03, 0x2a, 0xc4, 0x29, 0xf5, 0xa0, 0xb2, 0xb6, 0x63, 0x34, 0x1e, 0x38, - 0x15, 0x9d, 0x62, 0xb9, 0x35, 0xa3, 0x27, 0x05, 0x0f, 0xfc, 0x05, 0x2a, 0xb9, 0xba, 0x3d, 0x95, - 0x75, 0x95, 0xac, 0x75, 0x5d, 0xb2, 0xd6, 0x84, 0x11, 0xd6, 0xa7, 0x11, 0xf5, 0x25, 0x93, 0x23, - 0x67, 0x2b, 0x1e, 0xd7, 0x4a, 0x93, 0x16, 0x93, 0x0c, 0x0d, 0x0b, 0xf4, 0xc8, 0xa3, 0xdf, 0x31, - 0x2f, 0xf2, 0x3e, 0x0b, 0x06, 0x91, 0x07, 0x2d, 0xf6, 0x3d, 0x54, 0x36, 0x6e, 0x15, 0xe2, 0x71, - 0x3c, 0xae, 0x3d, 0x3a, 0x99, 0x05, 0x23, 0x45, 0xfc, 0xfa, 0xaf, 0x06, 0x7a, 0x52, 0x1c, 0xfc, - 0x31, 0x13, 0x12, 0x7f, 0x5d, 0x18, 0xbe, 0xb5, 0xe4, 0x58, 0x98, 0x48, 0x47, 0x5f, 0xd6, 0x7d, - 0x2d, 0x4d, 0x24, 0xb9, 0xc1, 0x9f, 0xa1, 0x0d, 0x26, 0xc1, 0x13, 0x95, 0xd5, 0x9d, 0xb5, 0xc6, - 0xe6, 0x9e, 0x6d, 0x5d, 0xb3, 0xc6, 0x56, 0x31, 0x43, 0xe7, 0x7f, 0x1a, 0x7b, 0xe3, 0x28, 0x41, - 0x21, 0x29, 0x58, 0xfd, 0x97, 0x55, 0x54, 0x4e, 0xab, 0x6b, 0x4a, 0x49, 0xdd, 0x9e, 0x07, 0xbe, - 0xbc, 0x03, 0x16, 0xb7, 0xd0, 0xba, 0x08, 0xc1, 0xd5, 0xec, 0xdd, 0xbd, 0xb6, 0x96, 0xd9, 0xf4, - 0x5a, 0x21, 0xb8, 0xce, 0x96, 0x86, 0x5f, 0x4f, 0x5e, 0x44, 0x81, 0xe1, 0xaf, 0xd0, 0x3d, 0x21, - 0xa9, 0x8c, 0x84, 0x62, 0xe9, 0xd5, 0xa5, 0x58, 0x02, 0x56, 0xb9, 0x3a, 0xff, 0xd7, 0xc0, 0xf7, - 0xd2, 0x37, 0xd1, 0x90, 0xf5, 0x0b, 0x03, 0x6d, 0xcf, 0xba, 0xdc, 0xc1, 0xd4, 0xc9, 0xd5, 0xa9, - 0x3f, 0xbb, 0x51, 0x49, 0x0b, 0x66, 0xfe, 0xca, 0x40, 0x4f, 0x0a, 0xd5, 0xab, 0x85, 0xc0, 0xc7, - 0x68, 0x3b, 0x04, 0x2e, 0x98, 0x90, 0xe0, 0xcb, 0xd4, 0x46, 0xad, 0xbd, 0x91, 0xae, 0x7d, 0x3c, - 0xae, 0x6d, 0xbf, 0x98, 0xa3, 0x27, 0x73, 0xbd, 0xf0, 0x39, 0x2a, 0x33, 0x7f, 0xc0, 0x7c, 0xd0, - 0xfb, 0x33, 0x9d, 0x78, 0x23, 0x5f, 0x47, 0xf2, 0xe1, 0x48, 0x1a, 0x32, 0x8b, 0xac, 0x06, 0xbd, - 0x9d, 0x9c, 0x99, 0xa3, 0x19, 0x14, 0x52, 0xc0, 0xad, 0xff, 0x36, 0x67, 0x3e, 0x89, 0x02, 0xbf, - 0x83, 0x4a, 0x54, 0x49, 0x80, 0xeb, 0x32, 0xb2, 0x7e, 0x37, 0xb5, 0x9c, 0x64, 0x16, 0x8a, 0x43, - 0xaa, 0x15, 0x73, 0x0e, 0xeb, 0x12, 0x1c, 0x52, 0xae, 0x39, 0x0e, 0xa9, 0x37, 0xd1, 0x90, 0x49, - 0x2a, 0xc9, 0x81, 0xcd, 0x1d, 0xd2, 0x2c, 0x95, 0x53, 0x2d, 0x27, 0x99, 0x45, 0xfd, 0x9f, 0xb5, - 0x39, 0x63, 0x52, 0x64, 0xcc, 0xd5, 0xd4, 0x51, 0x35, 0x95, 0x0a, 0x35, 0x75, 0xb2, 0x9a, 0x3a, - 0xf8, 0x67, 0x03, 0x61, 0x9a, 0x41, 0x9c, 0x4c, 0xc8, 0x9a, 0x32, 0xea, 0xe3, 0x5b, 0x2c, 0x89, - 0xd5, 0x2c, 0xa0, 0x1d, 0xfa, 0x92, 0x8f, 0x9c, 0xaa, 0xce, 0x02, 0x17, 0x0d, 0xc8, 0x9c, 0x14, - 0xf0, 0x39, 0xda, 0x4c, 0xa5, 0x87, 0x9c, 0x07, 0x5c, 0xaf, 0x6d, 0x63, 0x89, 0x8c, 0x94, 0xbd, - 0x63, 0xc6, 0xe3, 0xda, 0x66, 0x73, 0x0a, 0xf0, 0xf7, 0xb8, 0xb6, 0x99, 0xd3, 0x93, 0x3c, 0x78, - 0x12, 0xab, 0x03, 0xd3, 0x58, 0xeb, 0xb7, 0x89, 0x75, 0x00, 0x8b, 0x63, 0xe5, 0xc0, 0xab, 0x87, - 0xe8, 0x8d, 0x05, 0x2d, 0xc2, 0x65, 0xb4, 0xd6, 0x87, 0x51, 0xca, 0x44, 0x92, 0xfc, 0xc4, 0xdb, - 0x68, 0x63, 0x48, 0x07, 0x51, 0xca, 0xb8, 0x07, 0x24, 0x7d, 0x7c, 0xb8, 0xfa, 0xdc, 0xa8, 0xff, - 0xb9, 0x8a, 0x1e, 0x67, 0x13, 0xe0, 0xac, 0x1d, 0x49, 0x10, 0xea, 0xc3, 0x7a, 0x07, 0x17, 0x7a, - 0x0f, 0xa1, 0x0e, 0x67, 0x43, 0xe0, 0x8a, 0xad, 0x2a, 0xb5, 0xa9, 0xc7, 0x41, 0xa6, 0x21, 0x39, - 0x2b, 0x3c, 0x44, 0x28, 0xa4, 0x9c, 0x7a, 0x20, 0x81, 0x27, 0x47, 0x38, 0xe1, 0x97, 0xb3, 0x1c, - 0xbf, 0xf2, 0xd5, 0x59, 0x2f, 0x32, 0x90, 0x94, 0x56, 0x59, 0xdc, 0xa9, 0x82, 0xe4, 0x22, 0x55, - 0x3f, 0x42, 0x0f, 0x67, 0x5c, 0x6e, 0xd4, 0xe6, 0x57, 0x06, 0x7a, 0x73, 0x6e, 0x22, 0x77, 0x70, - 0xdf, 0x3f, 0xbf, 0x7a, 0xdf, 0xf7, 0x6e, 0xde, 0xad, 0x05, 0x47, 0xfe, 0x47, 0x03, 0xe5, 0xf9, - 0x89, 0x8f, 0xd1, 0x7a, 0xf2, 0xf7, 0xac, 0x2e, 0xe1, 0xed, 0xe5, 0x4a, 0x38, 0x63, 0x1e, 0x4c, - 0x3f, 0xb5, 0xc9, 0x8b, 0x28, 0x14, 0xfc, 0x16, 0xba, 0xef, 0x81, 0x10, 0xb4, 0x3b, 0xa1, 0xc6, - 0x43, 0x6d, 0x74, 0xff, 0x24, 0x15, 0x93, 0x89, 0xde, 0x69, 0x5e, 0x5c, 0x9a, 0x2b, 0x2f, 0x2f, - 0xcd, 0x95, 0xd7, 0x97, 0xe6, 0xca, 0x0f, 0xb1, 0x69, 0x5c, 0xc4, 0xa6, 0xf1, 0x32, 0x36, 0x8d, - 0xd7, 0xb1, 0x69, 0xfc, 0x1e, 0x9b, 0xc6, 0x4f, 0x7f, 0x98, 0x2b, 0x5f, 0x3e, 0xbd, 0xe6, 0x3f, - 0x98, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x2f, 0x75, 0xee, 0xf8, 0x0c, 0x00, 0x00, + // 925 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x3f, 0x6f, 0x23, 0x45, + 0x14, 0xf7, 0xc6, 0xce, 0x9d, 0x6f, 0x1c, 0xc0, 0x37, 0x32, 0x87, 0xe5, 0x93, 0xd6, 0x91, 0x2b, + 0x83, 0xb8, 0x59, 0x72, 0x20, 0x74, 0xa2, 0xf3, 0x26, 0x29, 0x22, 0x92, 0x00, 0xe3, 0x08, 0x21, + 0xa0, 0x60, 0xbc, 0x7e, 0xd8, 0x13, 0x7b, 0xff, 0x68, 0x67, 0x36, 0xc2, 0x54, 0x54, 0xd4, 0x74, + 0x7c, 0x03, 0x3e, 0x4b, 0x0a, 0x24, 0x4e, 0x54, 0x57, 0x59, 0x64, 0xf9, 0x0e, 0x14, 0x34, 0xa0, + 0x9d, 0x1d, 0xaf, 0x37, 0x5e, 0x27, 0xe7, 0x4b, 0x71, 0x9d, 0xdf, 0x9b, 0xf7, 0x7e, 0xbf, 0xf7, + 0xdf, 0x8b, 0x0e, 0x26, 0xcf, 0x04, 0xe1, 0xbe, 0x35, 0x89, 0x06, 0x10, 0x7a, 0x20, 0x41, 0x58, + 0x17, 0xe0, 0x0d, 0xfd, 0xd0, 0xd2, 0x0f, 0x2c, 0xe0, 0x96, 0x90, 0x7e, 0xc8, 0x46, 0x60, 0x5d, + 0xec, 0xb1, 0x69, 0x30, 0x66, 0x7b, 0xd6, 0x08, 0x3c, 0x08, 0x99, 0x84, 0x21, 0x09, 0x42, 0x5f, + 0xfa, 0xf8, 0x71, 0x6a, 0x4c, 0x58, 0xc0, 0x89, 0x36, 0x26, 0x0b, 0xe3, 0xd6, 0x93, 0x11, 0x97, + 0xe3, 0x68, 0x40, 0x1c, 0xdf, 0xb5, 0x46, 0xfe, 0xc8, 0xb7, 0x94, 0xcf, 0x20, 0xfa, 0x5e, 0x49, + 0x4a, 0x50, 0xbf, 0x52, 0xac, 0x56, 0x27, 0x47, 0xec, 0xf8, 0x61, 0xc2, 0xba, 0xca, 0xd7, 0xfa, + 0x68, 0x69, 0xe3, 0x32, 0x67, 0xcc, 0x3d, 0x08, 0x67, 0x56, 0x30, 0x19, 0x29, 0xa7, 0x10, 0x84, + 0x1f, 0x85, 0x0e, 0xbc, 0x92, 0x97, 0xb0, 0x5c, 0x90, 0x6c, 0x1d, 0x97, 0x75, 0x93, 0x57, 0x18, + 0x79, 0x92, 0xbb, 0x45, 0x9a, 0x8f, 0x5f, 0xe6, 0x20, 0x9c, 0x31, 0xb8, 0x6c, 0xd5, 0xaf, 0xf3, + 0x4f, 0x19, 0xe1, 0xfd, 0xfe, 0x51, 0x3f, 0xad, 0xdf, 0x3e, 0x0b, 0x98, 0xc3, 0xe5, 0x0c, 0x7f, + 0x87, 0xaa, 0x49, 0x68, 0x43, 0x26, 0x59, 0xd3, 0xd8, 0x35, 0xba, 0xb5, 0xa7, 0x1f, 0x90, 0x65, + 0xb9, 0x33, 0x06, 0x12, 0x4c, 0x46, 0x89, 0x42, 0x90, 0xc4, 0x9a, 0x5c, 0xec, 0x91, 0xcf, 0x06, + 0xe7, 0xe0, 0xc8, 0x13, 0x90, 0xcc, 0xc6, 0x97, 0xf3, 0x76, 0x29, 0x9e, 0xb7, 0xd1, 0x52, 0x47, + 0x33, 0x54, 0xcc, 0xd1, 0x8e, 0xe7, 0x0f, 0xe1, 0xcc, 0x0f, 0xfc, 0xa9, 0x3f, 0x9a, 0x35, 0xb7, + 0x14, 0xcb, 0x87, 0x9b, 0xb1, 0x1c, 0xb3, 0x01, 0x4c, 0xfb, 0x30, 0x05, 0x47, 0xfa, 0xa1, 0x5d, + 0x8f, 0xe7, 0xed, 0x9d, 0xd3, 0x1c, 0x18, 0xbd, 0x06, 0x8d, 0x0f, 0x50, 0x5d, 0xcf, 0xc7, 0xfe, + 0x94, 0x09, 0x71, 0xca, 0x5c, 0x68, 0x96, 0x77, 0x8d, 0xee, 0x03, 0xbb, 0xa9, 0x43, 0xac, 0xf7, + 0x57, 0xde, 0x69, 0xc1, 0x03, 0x7f, 0x85, 0xaa, 0x8e, 0x2e, 0x4f, 0xb3, 0xa2, 0x82, 0x25, 0xb7, + 0x05, 0x4b, 0x16, 0x13, 0x41, 0xbe, 0x88, 0x98, 0x27, 0xb9, 0x9c, 0xd9, 0x3b, 0xf1, 0xbc, 0x5d, + 0x5d, 0x94, 0x98, 0x66, 0x68, 0x58, 0xa0, 0x87, 0x2e, 0xfb, 0x81, 0xbb, 0x91, 0xfb, 0xa5, 0x3f, + 0x8d, 0x5c, 0xe8, 0xf3, 0x1f, 0xa1, 0xb9, 0x7d, 0x27, 0x8a, 0xb7, 0xe3, 0x79, 0xfb, 0xe1, 0xc9, + 0x2a, 0x18, 0x2d, 0xe2, 0x77, 0x7e, 0x37, 0xd0, 0xa3, 0x62, 0xe3, 0x8f, 0xb9, 0x90, 0xf8, 0xdb, + 0x42, 0xf3, 0xc9, 0x86, 0x6d, 0xe1, 0x22, 0x6d, 0x7d, 0x5d, 0xd7, 0xb5, 0xba, 0xd0, 0xe4, 0x1a, + 0x7f, 0x86, 0xb6, 0xb9, 0x04, 0x57, 0x34, 0xb7, 0x76, 0xcb, 0xdd, 0xda, 0x53, 0x8b, 0xdc, 0xb2, + 0xc6, 0xa4, 0x18, 0xa1, 0xfd, 0x86, 0xc6, 0xde, 0x3e, 0x4a, 0x50, 0x68, 0x0a, 0xd6, 0xf9, 0x6d, + 0x0b, 0xd5, 0xd3, 0xec, 0x7a, 0x52, 0x32, 0x67, 0xec, 0x82, 0x27, 0x5f, 0xc3, 0x14, 0xf7, 0x51, + 0x45, 0x04, 0xe0, 0xe8, 0xe9, 0xdd, 0xbb, 0x35, 0x97, 0xd5, 0xf0, 0xfa, 0x01, 0x38, 0xf6, 0x8e, + 0x86, 0xaf, 0x24, 0x12, 0x55, 0x60, 0xf8, 0x1b, 0x74, 0x4f, 0x48, 0x26, 0x23, 0xa1, 0xa6, 0xf4, + 0xfa, 0x52, 0x6c, 0x00, 0xab, 0x5c, 0xed, 0x37, 0x35, 0xf0, 0xbd, 0x54, 0xa6, 0x1a, 0xb2, 0x73, + 0x69, 0xa0, 0xc6, 0xaa, 0xcb, 0x6b, 0xe8, 0x3a, 0xbd, 0xde, 0xf5, 0x27, 0xaf, 0x94, 0xd2, 0x0d, + 0x3d, 0xff, 0xd3, 0x40, 0x8f, 0x0a, 0xd9, 0xab, 0x85, 0xc0, 0xc7, 0xa8, 0x11, 0x40, 0x28, 0xb8, + 0x90, 0xe0, 0xc9, 0xd4, 0x46, 0xad, 0xbd, 0x91, 0xae, 0x7d, 0x3c, 0x6f, 0x37, 0x3e, 0x5f, 0xf3, + 0x4e, 0xd7, 0x7a, 0xe1, 0x73, 0x54, 0xe7, 0xde, 0x94, 0x7b, 0xa0, 0xf7, 0x67, 0xd9, 0xf1, 0x6e, + 0x3e, 0x8f, 0xe4, 0x8f, 0x23, 0x29, 0xc8, 0x2a, 0xb2, 0x6a, 0x74, 0x23, 0x39, 0x33, 0x47, 0x2b, + 0x28, 0xb4, 0x80, 0xdb, 0xf9, 0x63, 0x4d, 0x7f, 0x92, 0x07, 0xfc, 0x3e, 0xaa, 0x32, 0xa5, 0x81, + 0x50, 0xa7, 0x91, 0xd5, 0xbb, 0xa7, 0xf5, 0x34, 0xb3, 0x50, 0x33, 0xa4, 0x4a, 0xb1, 0xe6, 0xb0, + 0x6e, 0x30, 0x43, 0xca, 0x35, 0x37, 0x43, 0x4a, 0xa6, 0x1a, 0x32, 0x09, 0x25, 0x39, 0xb0, 0xb9, + 0x43, 0x9a, 0x85, 0x72, 0xaa, 0xf5, 0x34, 0xb3, 0xe8, 0xfc, 0x57, 0x5e, 0xd3, 0x26, 0x35, 0x8c, + 0xb9, 0x9c, 0x86, 0x2a, 0xa7, 0x6a, 0x21, 0xa7, 0x61, 0x96, 0xd3, 0x10, 0xff, 0x6a, 0x20, 0xcc, + 0x32, 0x88, 0x93, 0xc5, 0xb0, 0xa6, 0x13, 0xf5, 0xe9, 0x1d, 0x96, 0x84, 0xf4, 0x0a, 0x68, 0x87, + 0x9e, 0x0c, 0x67, 0x76, 0x4b, 0x47, 0x81, 0x8b, 0x06, 0x74, 0x4d, 0x08, 0xf8, 0x1c, 0xd5, 0x52, + 0xed, 0x61, 0x18, 0xfa, 0xa1, 0x5e, 0xdb, 0xee, 0x06, 0x11, 0x29, 0x7b, 0xdb, 0x8c, 0xe7, 0xed, + 0x5a, 0x6f, 0x09, 0xf0, 0xef, 0xbc, 0x5d, 0xcb, 0xbd, 0xd3, 0x3c, 0x78, 0xc2, 0x35, 0x84, 0x25, + 0x57, 0xe5, 0x2e, 0x5c, 0x07, 0x70, 0x33, 0x57, 0x0e, 0xbc, 0x75, 0x88, 0xde, 0xb9, 0xa1, 0x44, + 0xb8, 0x8e, 0xca, 0x13, 0x98, 0xa5, 0x93, 0x48, 0x93, 0x9f, 0xb8, 0x81, 0xb6, 0x2f, 0xd8, 0x34, + 0x4a, 0x27, 0xee, 0x01, 0x4d, 0x85, 0x4f, 0xb6, 0x9e, 0x19, 0x9d, 0x9f, 0x0d, 0x94, 0xe7, 0xc0, + 0xc7, 0xa8, 0x92, 0x7c, 0x93, 0xe8, 0x33, 0xf3, 0xde, 0x66, 0x67, 0xe6, 0x8c, 0xbb, 0xb0, 0x3c, + 0x97, 0x89, 0x44, 0x15, 0x0a, 0x7e, 0x17, 0xdd, 0x77, 0x41, 0x08, 0x36, 0xd2, 0xcc, 0xf6, 0x5b, + 0xda, 0xe8, 0xfe, 0x49, 0xaa, 0xa6, 0x8b, 0x77, 0xbb, 0x77, 0x79, 0x65, 0x96, 0x9e, 0x5f, 0x99, + 0xa5, 0x17, 0x57, 0x66, 0xe9, 0xa7, 0xd8, 0x34, 0x2e, 0x63, 0xd3, 0x78, 0x1e, 0x9b, 0xc6, 0x8b, + 0xd8, 0x34, 0xfe, 0x8a, 0x4d, 0xe3, 0x97, 0xbf, 0xcd, 0xd2, 0xd7, 0x8f, 0x6f, 0xf9, 0x0a, 0xfd, + 0x3f, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x8d, 0x17, 0x01, 0xbc, 0x0a, 0x00, 0x00, } func (m *CSIStorageCapacity) Marshal() (dAtA []byte, err error) { @@ -799,115 +734,6 @@ func (m *VolumeAttachmentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *VolumeAttributesClass) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAttributesClass) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAttributesClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Parameters) > 0 { - keysForParameters := make([]string, 0, len(m.Parameters)) - for k := range m.Parameters { - keysForParameters = append(keysForParameters, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForParameters) - for iNdEx := len(keysForParameters) - 1; iNdEx >= 0; iNdEx-- { - v := m.Parameters[string(keysForParameters[iNdEx])] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintGenerated(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(keysForParameters[iNdEx]) - copy(dAtA[i:], keysForParameters[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForParameters[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VolumeAttributesClassList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAttributesClassList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAttributesClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *VolumeError) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1089,44 +915,6 @@ func (m *VolumeAttachmentStatus) Size() (n int) { return n } -func (m *VolumeAttributesClass) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Parameters) > 0 { - for k, v := range m.Parameters { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - return n -} - -func (m *VolumeAttributesClassList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - func (m *VolumeError) Size() (n int) { if m == nil { return 0 @@ -1250,44 +1038,6 @@ func (this *VolumeAttachmentStatus) String() string { }, "") return s } -func (this *VolumeAttributesClass) String() string { - if this == nil { - return "nil" - } - keysForParameters := make([]string, 0, len(this.Parameters)) - for k := range this.Parameters { - keysForParameters = append(keysForParameters, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForParameters) - mapStringForParameters := "map[string]string{" - for _, k := range keysForParameters { - mapStringForParameters += fmt.Sprintf("%v: %v,", k, this.Parameters[k]) - } - mapStringForParameters += "}" - s := strings.Join([]string{`&VolumeAttributesClass{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `Parameters:` + mapStringForParameters + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAttributesClassList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]VolumeAttributesClass{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "VolumeAttributesClass", "VolumeAttributesClass", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&VolumeAttributesClassList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} func (this *VolumeError) String() string { if this == nil { return "nil" @@ -2448,365 +2198,6 @@ func (m *VolumeAttachmentStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *VolumeAttributesClass) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumeAttributesClass: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeAttributesClass: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Parameters == nil { - m.Parameters = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Parameters[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAttributesClassList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumeAttributesClassList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeAttributesClassList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, VolumeAttributesClass{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *VolumeError) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.proto b/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.proto index 49e522be53c..88250a0f013 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.proto +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/generated.proto @@ -216,46 +216,6 @@ message VolumeAttachmentStatus { optional VolumeError detachError = 4; } -// VolumeAttributesClass represents a specification of mutable volume attributes -// defined by the CSI driver. The class can be specified during dynamic provisioning -// of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. -message VolumeAttributesClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Name of the CSI driver - // This field is immutable. - optional string driverName = 2; - - // parameters hold volume attributes defined by the CSI driver. These values - // are opaque to the Kubernetes and are passed directly to the CSI driver. - // The underlying storage provider supports changing these attributes on an - // existing volume, however the parameters field itself is immutable. To - // invoke a volume update, a new VolumeAttributesClass should be created with - // new parameters, and the PersistentVolumeClaim should be updated to reference - // the new VolumeAttributesClass. - // - // This field is required and must contain at least one key/value pair. - // The keys cannot be empty, and the maximum number of parameters is 512, with - // a cumulative max size of 256K. If the CSI driver rejects invalid parameters, - // the target PersistentVolumeClaim will be set to an "Infeasible" state in the - // modifyVolumeStatus field. - map<string, string> parameters = 3; -} - -// VolumeAttributesClassList is a collection of VolumeAttributesClass objects. -message VolumeAttributesClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of VolumeAttributesClass objects. - repeated VolumeAttributesClass items = 2; -} - // VolumeError captures an error encountered during a volume operation. message VolumeError { // time represents the time the error was encountered. diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/register.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/register.go index a70f8e18634..779c858028c 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/register.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/register.go @@ -45,8 +45,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VolumeAttachmentList{}, &CSIStorageCapacity{}, &CSIStorageCapacityList{}, - &VolumeAttributesClass{}, - &VolumeAttributesClassList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/types.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/types.go index 5957e480749..59ef348a316 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/types.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/types.go @@ -251,55 +251,3 @@ type CSIStorageCapacityList struct { // +listMapKey=name Items []CSIStorageCapacity `json:"items" protobuf:"bytes,2,rep,name=items"` } - -// +genclient -// +genclient:nonNamespaced -// +k8s:prerelease-lifecycle-gen:introduced=1.29 -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// VolumeAttributesClass represents a specification of mutable volume attributes -// defined by the CSI driver. The class can be specified during dynamic provisioning -// of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. -type VolumeAttributesClass struct { - metav1.TypeMeta `json:",inline"` - - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Name of the CSI driver - // This field is immutable. - DriverName string `json:"driverName" protobuf:"bytes,2,opt,name=driverName"` - - // parameters hold volume attributes defined by the CSI driver. These values - // are opaque to the Kubernetes and are passed directly to the CSI driver. - // The underlying storage provider supports changing these attributes on an - // existing volume, however the parameters field itself is immutable. To - // invoke a volume update, a new VolumeAttributesClass should be created with - // new parameters, and the PersistentVolumeClaim should be updated to reference - // the new VolumeAttributesClass. - // - // This field is required and must contain at least one key/value pair. - // The keys cannot be empty, and the maximum number of parameters is 512, with - // a cumulative max size of 256K. If the CSI driver rejects invalid parameters, - // the target PersistentVolumeClaim will be set to an "Infeasible" state in the - // modifyVolumeStatus field. - Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"` -} - -// +k8s:prerelease-lifecycle-gen:introduced=1.29 -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// VolumeAttributesClassList is a collection of VolumeAttributesClass objects. -type VolumeAttributesClassList struct { - metav1.TypeMeta `json:",inline"` - - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // items is the list of VolumeAttributesClass objects. - Items []VolumeAttributesClass `json:"items" protobuf:"bytes,2,rep,name=items"` -} diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go index ac87dbdca34..ba6afbd5916 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go @@ -103,27 +103,6 @@ func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { return map_VolumeAttachmentStatus } -var map_VolumeAttributesClass = map[string]string{ - "": "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "driverName": "Name of the CSI driver This field is immutable.", - "parameters": "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.", -} - -func (VolumeAttributesClass) SwaggerDoc() map[string]string { - return map_VolumeAttributesClass -} - -var map_VolumeAttributesClassList = map[string]string{ - "": "VolumeAttributesClassList is a collection of VolumeAttributesClass objects.", - "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "items": "items is the list of VolumeAttributesClass objects.", -} - -func (VolumeAttributesClassList) SwaggerDoc() map[string]string { - return map_VolumeAttributesClassList -} - var map_VolumeError = map[string]string{ "": "VolumeError captures an error encountered during a volume operation.", "time": "time represents the time the error was encountered.", diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go index 942871f7889..d9bc94b2500 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go @@ -238,72 +238,6 @@ func (in *VolumeAttachmentStatus) DeepCopy() *VolumeAttachmentStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VolumeAttributesClass) DeepCopyInto(out *VolumeAttributesClass) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttributesClass. -func (in *VolumeAttributesClass) DeepCopy() *VolumeAttributesClass { - if in == nil { - return nil - } - out := new(VolumeAttributesClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VolumeAttributesClass) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VolumeAttributesClassList) DeepCopyInto(out *VolumeAttributesClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VolumeAttributesClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttributesClassList. -func (in *VolumeAttributesClassList) DeepCopy() *VolumeAttributesClassList { - if in == nil { - return nil - } - out := new(VolumeAttributesClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VolumeAttributesClassList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeError) DeepCopyInto(out *VolumeError) { *out = *in diff --git a/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.prerelease-lifecycle.go b/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.prerelease-lifecycle.go index c169e782ceb..41114c3c68f 100644 --- a/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.prerelease-lifecycle.go +++ b/upstream/vendor/k8s.io/api/storage/v1alpha1/zz_generated.prerelease-lifecycle.go @@ -120,39 +120,3 @@ func (in *VolumeAttachmentList) APILifecycleReplacement() schema.GroupVersionKin func (in *VolumeAttachmentList) APILifecycleRemoved() (major, minor int) { return 1, 24 } - -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *VolumeAttributesClass) APILifecycleIntroduced() (major, minor int) { - return 1, 29 -} - -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *VolumeAttributesClass) APILifecycleDeprecated() (major, minor int) { - return 1, 32 -} - -// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *VolumeAttributesClass) APILifecycleRemoved() (major, minor int) { - return 1, 35 -} - -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *VolumeAttributesClassList) APILifecycleIntroduced() (major, minor int) { - return 1, 29 -} - -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *VolumeAttributesClassList) APILifecycleDeprecated() (major, minor int) { - return 1, 32 -} - -// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *VolumeAttributesClassList) APILifecycleRemoved() (major, minor int) { - return 1, 35 -} diff --git a/upstream/vendor/k8s.io/api/storage/v1beta1/generated.proto b/upstream/vendor/k8s.io/api/storage/v1beta1/generated.proto index b99fd39e48a..2b354dd4715 100644 --- a/upstream/vendor/k8s.io/api/storage/v1beta1/generated.proto +++ b/upstream/vendor/k8s.io/api/storage/v1beta1/generated.proto @@ -91,7 +91,7 @@ message CSIDriverSpec { // If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. // The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. // - // The following VolumeContext will be passed if podInfoOnMount is set to true. + // The following VolumeConext will be passed if podInfoOnMount is set to true. // This list might grow, but the prefix will be used. // "csi.storage.k8s.io/pod.name": pod.Name // "csi.storage.k8s.io/pod.namespace": pod.Namespace diff --git a/upstream/vendor/k8s.io/api/storage/v1beta1/types.go b/upstream/vendor/k8s.io/api/storage/v1beta1/types.go index 0f5ade3c138..4c39b49ccd8 100644 --- a/upstream/vendor/k8s.io/api/storage/v1beta1/types.go +++ b/upstream/vendor/k8s.io/api/storage/v1beta1/types.go @@ -311,7 +311,7 @@ type CSIDriverSpec struct { // If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. // The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. // - // The following VolumeContext will be passed if podInfoOnMount is set to true. + // The following VolumeConext will be passed if podInfoOnMount is set to true. // This list might grow, but the prefix will be used. // "csi.storage.k8s.io/pod.name": pod.Name // "csi.storage.k8s.io/pod.namespace": pod.Namespace diff --git a/upstream/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/upstream/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go index 6d9d233066a..0f2718b9c14 100644 --- a/upstream/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go +++ b/upstream/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go @@ -50,7 +50,7 @@ func (CSIDriverList) SwaggerDoc() map[string]string { var map_CSIDriverSpec = map[string]string{ "": "CSIDriverSpec is the specification of a CSIDriver.", "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.\n\nThis field is immutable.", - "podInfoOnMount": "podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false.\n\nThe CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.\n\nThe following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", + "podInfoOnMount": "podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false.\n\nThe CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.\n\nThe following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", "volumeLifecycleModes": "volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism.\n\nThe other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume.\n\nFor more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future.\n\nThis field is immutable.", "storageCapacity": "storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis field was immutable in Kubernetes <= 1.22 and now is mutable.", "fsGroupPolicy": "fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details.\n\nThis field is immutable.\n\nDefaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce.", diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go index 8c4e147f0b9..cc1c7437fcd 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go @@ -210,19 +210,6 @@ type ValidationRule struct { // - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with // non-intersecting keys are appended, retaining their partial order. - // - // If `rule` makes use of the `oldSelf` variable it is implicitly a - // `transition rule`. - // - // By default, the `oldSelf` variable is the same type as `self`. - // When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional - // variable whose value() is the same type as `self`. - // See the documentation for the `optionalOldSelf` field for details. - // - // Transition rules by default are applied only on UPDATE requests and are - // skipped if an old value could not be found. You can opt a transition - // rule into unconditional evaluation by setting `optionalOldSelf` to true. - // Rule string // Message represents the message displayed when validation fails. The message is required if the Rule contains // line breaks. The message must not contain line breaks. @@ -259,24 +246,6 @@ type ValidationRule struct { // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` // +optional FieldPath string - - // optionalOldSelf is used to opt a transition rule into evaluation - // even when the object is first created, or if the old object is - // missing the value. - // - // When enabled `oldSelf` will be a CEL optional whose value will be - // `None` if there is no old value, or when the object is initially created. - // - // You may check for presence of oldSelf using `oldSelf.hasValue()` and - // unwrap it after checking using `oldSelf.value()`. Check the CEL - // documentation for Optional types for more information: - // https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes - // - // May not be set unless `oldSelf` is used in `rule`. - // - // +featureGate=CRDValidationRatcheting - // +optional - OptionalOldSelf *bool } // JSON represents any valid JSON value. diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go index 6c22a516985..75a573a2d25 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go @@ -814,204 +814,202 @@ func init() { } var fileDescriptor_f5a35c9667703937 = []byte{ - // 3137 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdf, 0x6f, 0x5c, 0x47, - 0xf5, 0xcf, 0x5d, 0x7b, 0xed, 0xf5, 0xd8, 0x89, 0xed, 0x49, 0xec, 0xef, 0x8d, 0x9b, 0x78, 0x9d, - 0xcd, 0xb7, 0xc1, 0x6d, 0xd3, 0x75, 0x1b, 0x5a, 0x1a, 0xca, 0x2f, 0x79, 0x6d, 0xa7, 0x75, 0x13, - 0xc7, 0xd6, 0x6c, 0x92, 0xba, 0x2d, 0xa2, 0xbd, 0xde, 0x3b, 0xbb, 0xbe, 0xf5, 0xfd, 0x95, 0x99, - 0x7b, 0xfd, 0x43, 0x02, 0xa9, 0x02, 0x55, 0x40, 0x25, 0x28, 0x0f, 0xa8, 0x3c, 0x21, 0x84, 0x50, - 0x1f, 0xe0, 0x01, 0xde, 0xe0, 0x5f, 0xe8, 0x0b, 0x52, 0x25, 0x24, 0x54, 0x09, 0x69, 0x45, 0x97, - 0x7f, 0x00, 0x09, 0x10, 0xc2, 0x0f, 0x08, 0xcd, 0x8f, 0x3b, 0x77, 0xf6, 0xee, 0x6e, 0x12, 0xd9, - 0xeb, 0xf6, 0x6d, 0xf7, 0x9c, 0x33, 0xe7, 0x73, 0xe6, 0xcc, 0x99, 0x33, 0x67, 0xce, 0x1d, 0x60, - 0xed, 0x5c, 0xa7, 0x65, 0x27, 0x58, 0xd8, 0x89, 0xb7, 0x30, 0xf1, 0x71, 0x84, 0xe9, 0xc2, 0x2e, - 0xf6, 0xed, 0x80, 0x2c, 0x48, 0x86, 0x15, 0x3a, 0x78, 0x3f, 0xc2, 0x3e, 0x75, 0x02, 0x9f, 0x3e, - 0x6d, 0x85, 0x0e, 0xc5, 0x64, 0x17, 0x93, 0x85, 0x70, 0xa7, 0xc1, 0x78, 0xb4, 0x5d, 0x60, 0x61, - 0xf7, 0xd9, 0x85, 0x06, 0xf6, 0x31, 0xb1, 0x22, 0x6c, 0x97, 0x43, 0x12, 0x44, 0x01, 0xbc, 0x2e, - 0x34, 0x95, 0xdb, 0x04, 0xdf, 0x54, 0x9a, 0xca, 0xe1, 0x4e, 0x83, 0xf1, 0x68, 0xbb, 0x40, 0x79, - 0xf7, 0xd9, 0x99, 0xa7, 0x1b, 0x4e, 0xb4, 0x1d, 0x6f, 0x95, 0x6b, 0x81, 0xb7, 0xd0, 0x08, 0x1a, - 0xc1, 0x02, 0x57, 0xb8, 0x15, 0xd7, 0xf9, 0x3f, 0xfe, 0x87, 0xff, 0x12, 0x40, 0x33, 0xcf, 0xa5, - 0x26, 0x7b, 0x56, 0x6d, 0xdb, 0xf1, 0x31, 0x39, 0x48, 0xed, 0xf4, 0x70, 0x64, 0x75, 0x31, 0x6f, - 0x66, 0xa1, 0xd7, 0x28, 0x12, 0xfb, 0x91, 0xe3, 0xe1, 0x8e, 0x01, 0x5f, 0x7a, 0xd8, 0x00, 0x5a, - 0xdb, 0xc6, 0x9e, 0x95, 0x1d, 0x57, 0x3a, 0x34, 0xc0, 0xe4, 0x52, 0xe0, 0xef, 0x62, 0xc2, 0x26, - 0x88, 0xf0, 0xfd, 0x18, 0xd3, 0x08, 0x56, 0xc0, 0x40, 0xec, 0xd8, 0xa6, 0x31, 0x67, 0xcc, 0x8f, - 0x54, 0x9e, 0xf9, 0xa8, 0x59, 0x3c, 0xd5, 0x6a, 0x16, 0x07, 0xee, 0xae, 0x2e, 0x1f, 0x36, 0x8b, - 0x97, 0x7a, 0x21, 0x45, 0x07, 0x21, 0xa6, 0xe5, 0xbb, 0xab, 0xcb, 0x88, 0x0d, 0x86, 0x2f, 0x81, - 0x49, 0x1b, 0x53, 0x87, 0x60, 0x7b, 0x71, 0x63, 0xf5, 0x9e, 0xd0, 0x6f, 0xe6, 0xb8, 0xc6, 0xf3, - 0x52, 0xe3, 0xe4, 0x72, 0x56, 0x00, 0x75, 0x8e, 0x81, 0x9b, 0x60, 0x38, 0xd8, 0x7a, 0x1b, 0xd7, - 0x22, 0x6a, 0x0e, 0xcc, 0x0d, 0xcc, 0x8f, 0x5e, 0x7b, 0xba, 0x9c, 0x2e, 0x9e, 0x32, 0x81, 0xaf, - 0x98, 0x9c, 0x6c, 0x19, 0x59, 0x7b, 0x2b, 0xc9, 0xa2, 0x55, 0xc6, 0x25, 0xda, 0xf0, 0xba, 0xd0, - 0x82, 0x12, 0x75, 0xa5, 0x5f, 0xe5, 0x00, 0xd4, 0x27, 0x4f, 0xc3, 0xc0, 0xa7, 0xb8, 0x2f, 0xb3, - 0xa7, 0x60, 0xa2, 0xc6, 0x35, 0x47, 0xd8, 0x96, 0xb8, 0x66, 0xee, 0x28, 0xd6, 0x9b, 0x12, 0x7f, - 0x62, 0x29, 0xa3, 0x0e, 0x75, 0x00, 0xc0, 0x3b, 0x60, 0x88, 0x60, 0x1a, 0xbb, 0x91, 0x39, 0x30, - 0x67, 0xcc, 0x8f, 0x5e, 0xbb, 0xda, 0x13, 0x8a, 0x87, 0x36, 0x0b, 0xbe, 0xf2, 0xee, 0xb3, 0xe5, - 0x6a, 0x64, 0x45, 0x31, 0xad, 0x9c, 0x91, 0x48, 0x43, 0x88, 0xeb, 0x40, 0x52, 0x57, 0xe9, 0xbf, - 0x06, 0x98, 0xd0, 0xbd, 0xb4, 0xeb, 0xe0, 0x3d, 0x48, 0xc0, 0x30, 0x11, 0xc1, 0xc2, 0xfd, 0x34, - 0x7a, 0xed, 0x66, 0xf9, 0xa8, 0x3b, 0xaa, 0xdc, 0x11, 0x7f, 0x95, 0x51, 0xb6, 0x5c, 0xf2, 0x0f, - 0x4a, 0x80, 0xe0, 0x2e, 0x28, 0x10, 0xb9, 0x46, 0x3c, 0x90, 0x46, 0xaf, 0xdd, 0xea, 0x0f, 0xa8, - 0xd0, 0x59, 0x19, 0x6b, 0x35, 0x8b, 0x85, 0xe4, 0x1f, 0x52, 0x58, 0xa5, 0x5f, 0xe4, 0xc0, 0xec, - 0x52, 0x4c, 0xa3, 0xc0, 0x43, 0x98, 0x06, 0x31, 0xa9, 0xe1, 0xa5, 0xc0, 0x8d, 0x3d, 0x7f, 0x19, - 0xd7, 0x1d, 0xdf, 0x89, 0x58, 0x8c, 0xce, 0x81, 0x41, 0xdf, 0xf2, 0xb0, 0x8c, 0x99, 0x31, 0xe9, - 0xc9, 0xc1, 0xdb, 0x96, 0x87, 0x11, 0xe7, 0x30, 0x09, 0x16, 0x22, 0x72, 0x07, 0x28, 0x89, 0x3b, - 0x07, 0x21, 0x46, 0x9c, 0x03, 0xaf, 0x80, 0xa1, 0x7a, 0x40, 0x3c, 0x4b, 0xac, 0xde, 0x48, 0xba, - 0x1e, 0x37, 0x38, 0x15, 0x49, 0x2e, 0x7c, 0x1e, 0x8c, 0xda, 0x98, 0xd6, 0x88, 0x13, 0x32, 0x68, - 0x73, 0x90, 0x0b, 0x9f, 0x95, 0xc2, 0xa3, 0xcb, 0x29, 0x0b, 0xe9, 0x72, 0xf0, 0x2a, 0x28, 0x84, - 0xc4, 0x09, 0x88, 0x13, 0x1d, 0x98, 0xf9, 0x39, 0x63, 0x3e, 0x5f, 0x99, 0x90, 0x63, 0x0a, 0x1b, - 0x92, 0x8e, 0x94, 0x04, 0x93, 0x7e, 0x9b, 0x06, 0xfe, 0x86, 0x15, 0x6d, 0x9b, 0x43, 0x1c, 0x41, - 0x49, 0xbf, 0x52, 0x5d, 0xbf, 0xcd, 0xe8, 0x48, 0x49, 0x94, 0xfe, 0x6c, 0x00, 0x33, 0xeb, 0xa1, - 0xc4, 0xbd, 0xf0, 0x06, 0x28, 0xd0, 0x88, 0xe5, 0x9c, 0xc6, 0x81, 0xf4, 0xcf, 0x93, 0x89, 0xaa, - 0xaa, 0xa4, 0x1f, 0x36, 0x8b, 0xd3, 0xe9, 0x88, 0x84, 0xca, 0x7d, 0xa3, 0xc6, 0xb2, 0x90, 0xdb, - 0xc3, 0x5b, 0xdb, 0x41, 0xb0, 0x23, 0x57, 0xff, 0x18, 0x21, 0xf7, 0xaa, 0x50, 0x94, 0x62, 0x8a, - 0x90, 0x93, 0x64, 0x94, 0x00, 0x95, 0xfe, 0x93, 0xcb, 0x4e, 0x4c, 0x5b, 0xf4, 0xb7, 0x40, 0x81, - 0x6d, 0x21, 0xdb, 0x8a, 0x2c, 0xb9, 0x09, 0x9e, 0x79, 0xb4, 0x0d, 0x27, 0xf6, 0xeb, 0x1a, 0x8e, - 0xac, 0x0a, 0x94, 0xae, 0x00, 0x29, 0x0d, 0x29, 0xad, 0x70, 0x1f, 0x0c, 0xd2, 0x10, 0xd7, 0xe4, - 0x7c, 0xef, 0x1d, 0x23, 0xda, 0x7b, 0xcc, 0xa1, 0x1a, 0xe2, 0x5a, 0x1a, 0x8c, 0xec, 0x1f, 0xe2, - 0x88, 0xf0, 0x1d, 0x03, 0x0c, 0x51, 0x9e, 0x17, 0x64, 0x2e, 0xd9, 0x3c, 0x01, 0xf0, 0x4c, 0xde, - 0x11, 0xff, 0x91, 0xc4, 0x2d, 0xfd, 0x33, 0x07, 0x2e, 0xf5, 0x1a, 0xba, 0x14, 0xf8, 0xb6, 0x58, - 0x84, 0x55, 0xb9, 0xaf, 0x44, 0x64, 0x3d, 0xaf, 0xef, 0xab, 0xc3, 0x66, 0xf1, 0xf1, 0x87, 0x2a, - 0xd0, 0x36, 0xe0, 0x97, 0xd5, 0x94, 0xc5, 0x26, 0xbd, 0xd4, 0x6e, 0xd8, 0x61, 0xb3, 0x38, 0xae, - 0x86, 0xb5, 0xdb, 0x0a, 0x77, 0x01, 0x74, 0x2d, 0x1a, 0xdd, 0x21, 0x96, 0x4f, 0x85, 0x5a, 0xc7, - 0xc3, 0xd2, 0x73, 0x4f, 0x3e, 0x5a, 0x50, 0xb0, 0x11, 0x95, 0x19, 0x09, 0x09, 0x6f, 0x75, 0x68, - 0x43, 0x5d, 0x10, 0x58, 0xce, 0x20, 0xd8, 0xa2, 0x2a, 0x0d, 0x68, 0x39, 0x9c, 0x51, 0x91, 0xe4, - 0xc2, 0x27, 0xc0, 0xb0, 0x87, 0x29, 0xb5, 0x1a, 0x98, 0xef, 0xfd, 0x91, 0xf4, 0x50, 0x5c, 0x13, - 0x64, 0x94, 0xf0, 0x4b, 0xff, 0x32, 0xc0, 0x85, 0x5e, 0x5e, 0xbb, 0xe5, 0xd0, 0x08, 0x7e, 0xb3, - 0x23, 0xec, 0xcb, 0x8f, 0x36, 0x43, 0x36, 0x9a, 0x07, 0xbd, 0x4a, 0x25, 0x09, 0x45, 0x0b, 0xf9, - 0x3d, 0x90, 0x77, 0x22, 0xec, 0x25, 0xa7, 0x25, 0xea, 0x7f, 0xd8, 0x55, 0x4e, 0x4b, 0xf8, 0xfc, - 0x2a, 0x03, 0x42, 0x02, 0xaf, 0xf4, 0x61, 0x0e, 0x5c, 0xec, 0x35, 0x84, 0xe5, 0x71, 0xca, 0x9c, - 0x1d, 0xba, 0x31, 0xb1, 0x5c, 0x19, 0x6c, 0xca, 0xd9, 0x1b, 0x9c, 0x8a, 0x24, 0x97, 0xe5, 0x4e, - 0xea, 0xf8, 0x8d, 0xd8, 0xb5, 0x88, 0x8c, 0x24, 0x35, 0xe1, 0xaa, 0xa4, 0x23, 0x25, 0x01, 0xcb, - 0x00, 0xd0, 0xed, 0x80, 0x44, 0x1c, 0x83, 0x57, 0x38, 0x23, 0x95, 0x33, 0x2c, 0x23, 0x54, 0x15, - 0x15, 0x69, 0x12, 0xec, 0x20, 0xd9, 0x71, 0x7c, 0x5b, 0x2e, 0xb8, 0xda, 0xbb, 0x37, 0x1d, 0xdf, - 0x46, 0x9c, 0xc3, 0xf0, 0x5d, 0x87, 0x46, 0x8c, 0x22, 0x57, 0xbb, 0xcd, 0xe1, 0x5c, 0x52, 0x49, - 0x30, 0xfc, 0x1a, 0x4b, 0xb0, 0x01, 0x71, 0x30, 0x35, 0x87, 0x52, 0xfc, 0x25, 0x45, 0x45, 0x9a, - 0x44, 0xe9, 0x2f, 0x83, 0xbd, 0xe3, 0x83, 0x25, 0x10, 0x78, 0x19, 0xe4, 0x1b, 0x24, 0x88, 0x43, - 0xe9, 0x25, 0xe5, 0xed, 0x97, 0x18, 0x11, 0x09, 0x1e, 0xfc, 0x36, 0xc8, 0xfb, 0x72, 0xc2, 0x2c, - 0x82, 0x5e, 0xed, 0xff, 0x32, 0x73, 0x6f, 0xa5, 0xe8, 0xc2, 0x91, 0x02, 0x14, 0x3e, 0x07, 0xf2, - 0xb4, 0x16, 0x84, 0x58, 0x3a, 0x71, 0x36, 0x11, 0xaa, 0x32, 0xe2, 0x61, 0xb3, 0x78, 0x3a, 0x51, - 0xc7, 0x09, 0x48, 0x08, 0xc3, 0xef, 0x1b, 0xa0, 0x20, 0x8f, 0x0b, 0x6a, 0x0e, 0xf3, 0xf0, 0x7c, - 0xad, 0xff, 0x76, 0xcb, 0xb2, 0x37, 0x5d, 0x33, 0x49, 0xa0, 0x48, 0x81, 0xc3, 0xef, 0x1a, 0x00, - 0xd4, 0xd4, 0xd9, 0x65, 0x8e, 0x70, 0x1f, 0xf6, 0x6d, 0xab, 0x68, 0xa7, 0xa2, 0x08, 0x84, 0xb4, - 0x54, 0xd2, 0x50, 0x61, 0x15, 0x4c, 0x85, 0x04, 0x73, 0xdd, 0x77, 0xfd, 0x1d, 0x3f, 0xd8, 0xf3, - 0x6f, 0x38, 0xd8, 0xb5, 0xa9, 0x09, 0xe6, 0x8c, 0xf9, 0x42, 0xe5, 0xa2, 0xb4, 0x7f, 0x6a, 0xa3, - 0x9b, 0x10, 0xea, 0x3e, 0xb6, 0xf4, 0xee, 0x40, 0xb6, 0xd6, 0xca, 0x9e, 0x17, 0xf0, 0x7d, 0x31, - 0x79, 0x91, 0x87, 0xa9, 0x69, 0xf0, 0x85, 0x78, 0xa3, 0xff, 0x0b, 0xa1, 0x72, 0x7d, 0x7a, 0x48, - 0x2b, 0x12, 0x45, 0x9a, 0x09, 0xf0, 0xa7, 0x06, 0x38, 0x6d, 0xd5, 0x6a, 0x38, 0x8c, 0xb0, 0x2d, - 0xb6, 0x71, 0xee, 0x64, 0xa3, 0x7a, 0x4a, 0x1a, 0x74, 0x7a, 0x51, 0x47, 0x45, 0xed, 0x46, 0xc0, - 0x17, 0xc1, 0x19, 0x1a, 0x05, 0x04, 0xdb, 0x49, 0x04, 0xc9, 0xec, 0x02, 0x5b, 0xcd, 0xe2, 0x99, - 0x6a, 0x1b, 0x07, 0x65, 0x24, 0x4b, 0x1f, 0xe7, 0x41, 0xf1, 0x21, 0x11, 0xfa, 0x08, 0x45, 0xef, - 0x15, 0x30, 0xc4, 0x67, 0x6a, 0x73, 0x87, 0x14, 0xb4, 0xa3, 0x9e, 0x53, 0x91, 0xe4, 0xb2, 0xe3, - 0x89, 0xe1, 0xb3, 0xe3, 0x69, 0x80, 0x0b, 0xaa, 0xe3, 0xa9, 0x2a, 0xc8, 0x28, 0xe1, 0xc3, 0x6b, - 0x00, 0xd8, 0x38, 0x24, 0x98, 0x65, 0x24, 0xdb, 0x1c, 0xe6, 0xd2, 0x6a, 0x7d, 0x96, 0x15, 0x07, - 0x69, 0x52, 0xf0, 0x06, 0x80, 0xc9, 0x3f, 0x27, 0xf0, 0x5f, 0xb5, 0x88, 0xef, 0xf8, 0x0d, 0xb3, - 0xc0, 0xcd, 0x9e, 0x66, 0xa7, 0xed, 0x72, 0x07, 0x17, 0x75, 0x19, 0x01, 0x77, 0xc1, 0x90, 0xb8, - 0x46, 0xf3, 0xbc, 0xd1, 0xc7, 0x1d, 0x77, 0xcf, 0x72, 0x1d, 0x9b, 0x43, 0x55, 0x00, 0x77, 0x0f, - 0x47, 0x41, 0x12, 0x0d, 0xbe, 0x67, 0x80, 0x31, 0x1a, 0x6f, 0x11, 0x29, 0x4d, 0x79, 0x56, 0x1f, - 0xbd, 0x76, 0xa7, 0x5f, 0xf0, 0x55, 0x4d, 0x77, 0x65, 0xa2, 0xd5, 0x2c, 0x8e, 0xe9, 0x14, 0xd4, - 0x86, 0x0d, 0x7f, 0x6f, 0x00, 0xd3, 0xb2, 0x45, 0xe8, 0x5b, 0xee, 0x06, 0x71, 0xfc, 0x08, 0x13, - 0x71, 0x21, 0x12, 0xc7, 0x47, 0x1f, 0x6b, 0xc5, 0xec, 0x3d, 0xab, 0x32, 0x27, 0x57, 0xda, 0x5c, - 0xec, 0x61, 0x01, 0xea, 0x69, 0x5b, 0xe9, 0xdf, 0x46, 0x36, 0xb5, 0x68, 0xb3, 0xac, 0xd6, 0x2c, - 0x17, 0xc3, 0x65, 0x30, 0xc1, 0xaa, 0x5f, 0x84, 0x43, 0xd7, 0xa9, 0x59, 0x94, 0xdf, 0x7e, 0x44, - 0x74, 0xab, 0x6b, 0x78, 0x35, 0xc3, 0x47, 0x1d, 0x23, 0xe0, 0x2b, 0x00, 0x8a, 0xb2, 0xb0, 0x4d, - 0x8f, 0xa8, 0x04, 0x54, 0x81, 0x57, 0xed, 0x90, 0x40, 0x5d, 0x46, 0xc1, 0x25, 0x30, 0xe9, 0x5a, - 0x5b, 0xd8, 0xad, 0x62, 0x17, 0xd7, 0xa2, 0x80, 0x70, 0x55, 0xe2, 0x7e, 0x38, 0xd5, 0x6a, 0x16, - 0x27, 0x6f, 0x65, 0x99, 0xa8, 0x53, 0xbe, 0x74, 0x29, 0xbb, 0x97, 0xf5, 0x89, 0x8b, 0x62, 0xfb, - 0x83, 0x1c, 0x98, 0xe9, 0x1d, 0x14, 0xf0, 0x3b, 0xaa, 0x34, 0x16, 0x15, 0xdf, 0x6b, 0x27, 0x10, - 0x7a, 0xf2, 0x3a, 0x00, 0x3a, 0xaf, 0x02, 0xf0, 0x80, 0x9d, 0xd7, 0x96, 0x9b, 0x5c, 0xfb, 0x37, - 0x4f, 0x02, 0x9d, 0xe9, 0xaf, 0x8c, 0x88, 0x2a, 0xc0, 0x72, 0xf9, 0xa1, 0x6f, 0xb9, 0xb8, 0xf4, - 0x61, 0xc7, 0xd5, 0x36, 0xdd, 0xac, 0xf0, 0x07, 0x06, 0x18, 0x0f, 0x42, 0xec, 0x2f, 0x6e, 0xac, - 0xde, 0xfb, 0xa2, 0xd8, 0xb4, 0xd2, 0x41, 0xab, 0x47, 0x37, 0x91, 0xdd, 0xaf, 0x85, 0xae, 0x0d, - 0x12, 0x84, 0xb4, 0x72, 0xb6, 0xd5, 0x2c, 0x8e, 0xaf, 0xb7, 0xa3, 0xa0, 0x2c, 0x6c, 0xc9, 0x03, - 0x53, 0x2b, 0xfb, 0x11, 0x26, 0xbe, 0xe5, 0x2e, 0x07, 0xb5, 0xd8, 0xc3, 0x7e, 0x24, 0x6c, 0xcc, - 0xb4, 0x0b, 0x8c, 0x47, 0x6c, 0x17, 0x5c, 0x04, 0x03, 0x31, 0x71, 0x65, 0xd4, 0x8e, 0xaa, 0x26, - 0x18, 0xba, 0x85, 0x18, 0xbd, 0x74, 0x09, 0x0c, 0x32, 0x3b, 0xe1, 0x79, 0x30, 0x40, 0xac, 0x3d, - 0xae, 0x75, 0xac, 0x32, 0xcc, 0x44, 0x90, 0xb5, 0x87, 0x18, 0xad, 0xf4, 0xf7, 0x39, 0x30, 0x9e, - 0x99, 0x0b, 0x9c, 0x01, 0x39, 0xd5, 0x59, 0x03, 0x52, 0x69, 0x6e, 0x75, 0x19, 0xe5, 0x1c, 0x1b, - 0xbe, 0xa0, 0xb2, 0xab, 0x00, 0x2d, 0xaa, 0xc3, 0x82, 0x53, 0x59, 0x59, 0x96, 0xaa, 0x63, 0x86, - 0x24, 0xe9, 0x91, 0xd9, 0x80, 0xeb, 0x72, 0x57, 0x08, 0x1b, 0x70, 0x1d, 0x31, 0xda, 0x51, 0x7b, - 0x25, 0x49, 0xb3, 0x26, 0xff, 0x08, 0xcd, 0x9a, 0xa1, 0x07, 0x36, 0x6b, 0x2e, 0x83, 0x7c, 0xe4, - 0x44, 0x2e, 0xe6, 0x27, 0x95, 0x56, 0x0c, 0xdf, 0x61, 0x44, 0x24, 0x78, 0x10, 0x83, 0x61, 0x1b, - 0xd7, 0xad, 0xd8, 0x8d, 0xf8, 0xa1, 0x34, 0x7a, 0xed, 0xeb, 0xc7, 0x8b, 0x1e, 0xd1, 0xcc, 0x58, - 0x16, 0x2a, 0x51, 0xa2, 0x1b, 0x3e, 0x0e, 0x86, 0x3d, 0x6b, 0xdf, 0xf1, 0x62, 0x8f, 0x57, 0x8c, - 0x86, 0x10, 0x5b, 0x13, 0x24, 0x94, 0xf0, 0x58, 0x12, 0xc4, 0xfb, 0x35, 0x37, 0xa6, 0xce, 0x2e, - 0x96, 0x4c, 0x59, 0xd2, 0xa9, 0x24, 0xb8, 0x92, 0xe1, 0xa3, 0x8e, 0x11, 0x1c, 0xcc, 0xf1, 0xf9, - 0xe0, 0x51, 0x0d, 0x4c, 0x90, 0x50, 0xc2, 0x6b, 0x07, 0x93, 0xf2, 0x63, 0xbd, 0xc0, 0xe4, 0xe0, - 0x8e, 0x11, 0xf0, 0x29, 0x30, 0xe2, 0x59, 0xfb, 0xb7, 0xb0, 0xdf, 0x88, 0xb6, 0xcd, 0xd3, 0x73, - 0xc6, 0xfc, 0x40, 0xe5, 0x74, 0xab, 0x59, 0x1c, 0x59, 0x4b, 0x88, 0x28, 0xe5, 0x73, 0x61, 0xc7, - 0x97, 0xc2, 0x67, 0x34, 0xe1, 0x84, 0x88, 0x52, 0x3e, 0xab, 0x4c, 0x42, 0x2b, 0x62, 0xfb, 0xca, - 0x1c, 0x6f, 0xbf, 0x38, 0x6f, 0x08, 0x32, 0x4a, 0xf8, 0x70, 0x1e, 0x14, 0x3c, 0x6b, 0x9f, 0xdf, - 0x29, 0xcd, 0x09, 0xae, 0x96, 0x37, 0x14, 0xd7, 0x24, 0x0d, 0x29, 0x2e, 0x97, 0x74, 0x7c, 0x21, - 0x39, 0xa9, 0x49, 0x4a, 0x1a, 0x52, 0x5c, 0x16, 0xbf, 0xb1, 0xef, 0xdc, 0x8f, 0xb1, 0x10, 0x86, - 0xdc, 0x33, 0x2a, 0x7e, 0xef, 0xa6, 0x2c, 0xa4, 0xcb, 0xb1, 0x3b, 0x9d, 0x17, 0xbb, 0x91, 0x13, - 0xba, 0x78, 0xbd, 0x6e, 0x9e, 0xe5, 0xfe, 0xe7, 0xa5, 0xfc, 0x9a, 0xa2, 0x22, 0x4d, 0x02, 0xbe, - 0x05, 0x06, 0xb1, 0x1f, 0x7b, 0xe6, 0x39, 0x7e, 0x7c, 0x1f, 0x37, 0xfa, 0xd4, 0x7e, 0x59, 0xf1, - 0x63, 0x0f, 0x71, 0xcd, 0xf0, 0x05, 0x70, 0xda, 0xb3, 0xf6, 0x59, 0x12, 0xc0, 0x24, 0x62, 0x17, - 0xcd, 0x29, 0x3e, 0xef, 0x49, 0x56, 0xc4, 0xae, 0xe9, 0x0c, 0xd4, 0x2e, 0xc7, 0x07, 0x3a, 0xbe, - 0x36, 0x70, 0x5a, 0x1b, 0xa8, 0x33, 0x50, 0xbb, 0x1c, 0x73, 0x32, 0xc1, 0xf7, 0x63, 0x87, 0x60, - 0xdb, 0xfc, 0x3f, 0x5e, 0xf7, 0xca, 0xfe, 0xae, 0xa0, 0x21, 0xc5, 0x85, 0xf7, 0x93, 0x96, 0x83, - 0xc9, 0x37, 0xdf, 0x46, 0xdf, 0x52, 0xf7, 0x3a, 0x59, 0x24, 0xc4, 0x3a, 0x10, 0xa7, 0x8a, 0xde, - 0x6c, 0x80, 0x3e, 0xc8, 0x5b, 0xae, 0xbb, 0x5e, 0x37, 0xcf, 0x73, 0x8f, 0xf7, 0xf1, 0xb4, 0x50, - 0x19, 0x66, 0x91, 0xe9, 0x47, 0x02, 0x86, 0xe1, 0x05, 0x3e, 0x8b, 0x85, 0x99, 0x13, 0xc3, 0x5b, - 0x67, 0xfa, 0x91, 0x80, 0xe1, 0xf3, 0xf3, 0x0f, 0xd6, 0xeb, 0xe6, 0x63, 0x27, 0x37, 0x3f, 0xa6, - 0x1f, 0x09, 0x18, 0x68, 0x83, 0x01, 0x3f, 0x88, 0xcc, 0x0b, 0xfd, 0x3e, 0x7b, 0xf9, 0x69, 0x72, - 0x3b, 0x88, 0x10, 0x53, 0x0f, 0x7f, 0x64, 0x00, 0x10, 0xa6, 0x91, 0x78, 0xf1, 0xb8, 0x2d, 0x80, - 0x0c, 0x5a, 0x39, 0x8d, 0xde, 0x15, 0x3f, 0x22, 0x07, 0xe9, 0xbd, 0x46, 0x8b, 0x72, 0xcd, 0x00, - 0xf8, 0x73, 0x03, 0x9c, 0xd3, 0xcb, 0x5d, 0x65, 0xd9, 0x2c, 0xf7, 0xc3, 0x7a, 0x1f, 0x03, 0xb9, - 0x12, 0x04, 0x6e, 0xc5, 0x6c, 0x35, 0x8b, 0xe7, 0x16, 0xbb, 0x00, 0xa2, 0xae, 0x66, 0xc0, 0x5f, - 0x1b, 0x60, 0x52, 0x66, 0x47, 0xcd, 0xb8, 0x22, 0x77, 0xdb, 0x5b, 0x7d, 0x74, 0x5b, 0x16, 0x42, - 0x78, 0x4f, 0x7d, 0x65, 0xec, 0xe0, 0xa3, 0x4e, 0xab, 0xe0, 0xef, 0x0c, 0x30, 0x66, 0xe3, 0x10, - 0xfb, 0x36, 0xf6, 0x6b, 0xcc, 0xcc, 0xb9, 0xe3, 0xf6, 0x15, 0xb2, 0x66, 0x2e, 0x6b, 0xda, 0x85, - 0x85, 0x65, 0x69, 0xe1, 0x98, 0xce, 0x3a, 0x6c, 0x16, 0xa7, 0xd3, 0xa1, 0x3a, 0x07, 0xb5, 0x19, - 0x08, 0x7f, 0x6c, 0x80, 0xf1, 0xd4, 0xed, 0xe2, 0x80, 0xb8, 0x74, 0x32, 0x0b, 0xcf, 0x4b, 0xd0, - 0xc5, 0x76, 0x2c, 0x94, 0x05, 0x87, 0xbf, 0x31, 0x58, 0xb5, 0x95, 0xdc, 0xd5, 0xa8, 0x59, 0xe2, - 0x1e, 0x7c, 0xbd, 0x9f, 0x1e, 0x54, 0xca, 0x85, 0x03, 0xaf, 0xa6, 0x95, 0x9c, 0xe2, 0x1c, 0x36, - 0x8b, 0x53, 0xba, 0xff, 0x14, 0x03, 0xe9, 0xc6, 0xc1, 0x77, 0x0d, 0x30, 0x86, 0xd3, 0x82, 0x99, - 0x9a, 0x97, 0x8f, 0xeb, 0xba, 0xae, 0xe5, 0xb7, 0xb8, 0x4e, 0x6b, 0x2c, 0x8a, 0xda, 0x60, 0x59, - 0xed, 0x87, 0xf7, 0x2d, 0x2f, 0x74, 0xb1, 0xf9, 0xff, 0xfd, 0xab, 0xfd, 0x56, 0x84, 0x4a, 0x94, - 0xe8, 0x86, 0x57, 0x41, 0xc1, 0x8f, 0x5d, 0xd7, 0xda, 0x72, 0xb1, 0xf9, 0x38, 0xaf, 0x22, 0x54, - 0x7f, 0xf1, 0xb6, 0xa4, 0x23, 0x25, 0x01, 0xeb, 0x60, 0x6e, 0xff, 0xa6, 0x7a, 0x7c, 0xd1, 0xb5, - 0x81, 0x67, 0x5e, 0xe1, 0x5a, 0x66, 0x5a, 0xcd, 0xe2, 0xf4, 0x66, 0xf7, 0x16, 0xdf, 0x43, 0x75, - 0xc0, 0x37, 0xc0, 0x63, 0x9a, 0xcc, 0x8a, 0xb7, 0x85, 0x6d, 0x1b, 0xdb, 0xc9, 0x45, 0xcb, 0xfc, - 0x02, 0x87, 0x50, 0xfb, 0x78, 0x33, 0x2b, 0x80, 0x1e, 0x34, 0x1a, 0xde, 0x02, 0xd3, 0x1a, 0x7b, - 0xd5, 0x8f, 0xd6, 0x49, 0x35, 0x22, 0x8e, 0xdf, 0x30, 0xe7, 0xb9, 0xde, 0x73, 0xc9, 0xee, 0xdb, - 0xd4, 0x78, 0xa8, 0xc7, 0x18, 0xf8, 0x72, 0x9b, 0x36, 0xfe, 0xe1, 0xc2, 0x0a, 0x6f, 0xe2, 0x03, - 0x6a, 0x3e, 0xc1, 0x8b, 0x0b, 0xbe, 0xce, 0x9b, 0x1a, 0x1d, 0xf5, 0x90, 0x87, 0xdf, 0x00, 0x67, - 0x33, 0x1c, 0x76, 0xaf, 0x30, 0x9f, 0x14, 0x17, 0x04, 0x56, 0x89, 0x6e, 0x26, 0x44, 0xd4, 0x4d, - 0x12, 0x7e, 0x15, 0x40, 0x8d, 0xbc, 0x66, 0x85, 0x7c, 0xfc, 0x53, 0xe2, 0xae, 0xc2, 0x56, 0x74, - 0x53, 0xd2, 0x50, 0x17, 0x39, 0xf8, 0x81, 0xd1, 0x36, 0x93, 0xf4, 0x36, 0x4b, 0xcd, 0xab, 0x7c, - 0xc3, 0xbe, 0x7c, 0xf4, 0x00, 0x4c, 0x95, 0xa1, 0xd8, 0xc5, 0x9a, 0x87, 0x35, 0x14, 0xd4, 0x03, - 0x7d, 0x86, 0x5d, 0xa6, 0x33, 0x39, 0x1c, 0x4e, 0x80, 0x81, 0x1d, 0x2c, 0x3f, 0x1b, 0x23, 0xf6, - 0x13, 0xbe, 0x09, 0xf2, 0xbb, 0x96, 0x1b, 0x27, 0xad, 0x80, 0xfe, 0x9d, 0xf5, 0x48, 0xe8, 0x7d, - 0x31, 0x77, 0xdd, 0x98, 0x79, 0xdf, 0x00, 0xd3, 0xdd, 0x4f, 0x95, 0xcf, 0xcb, 0xa2, 0x9f, 0x19, - 0x60, 0xb2, 0xe3, 0x00, 0xe9, 0x62, 0x8c, 0xdb, 0x6e, 0xcc, 0xbd, 0x3e, 0x9e, 0x04, 0x62, 0x23, - 0xf0, 0x8a, 0x56, 0xb7, 0xec, 0x87, 0x06, 0x98, 0xc8, 0x26, 0xe6, 0xcf, 0xc9, 0x4b, 0xa5, 0xf7, - 0x72, 0x60, 0xba, 0x7b, 0x0d, 0x0e, 0x3d, 0xd5, 0x5d, 0xe8, 0x7b, 0x83, 0xa6, 0x5b, 0xcb, 0xf6, - 0x1d, 0x03, 0x8c, 0xbe, 0xad, 0xe4, 0x92, 0xaf, 0x99, 0xfd, 0xec, 0x0a, 0x25, 0x47, 0x5f, 0xca, - 0xa0, 0x48, 0x87, 0x2c, 0xfd, 0xd6, 0x00, 0x53, 0x5d, 0x8f, 0x73, 0x78, 0x05, 0x0c, 0x59, 0xae, - 0x1b, 0xec, 0x89, 0x6e, 0x9e, 0xd6, 0x96, 0x5f, 0xe4, 0x54, 0x24, 0xb9, 0x9a, 0xcf, 0x72, 0x9f, - 0x81, 0xcf, 0x4a, 0x7f, 0x30, 0xc0, 0x85, 0x07, 0x45, 0xdd, 0x67, 0xbd, 0x86, 0xf3, 0xa0, 0x20, - 0x8b, 0xed, 0x03, 0xbe, 0x7e, 0x32, 0xbb, 0xca, 0x8c, 0xc0, 0x5f, 0xcb, 0x88, 0x5f, 0xa5, 0x5f, - 0x1a, 0x60, 0xa2, 0x8a, 0xc9, 0xae, 0x53, 0xc3, 0x08, 0xd7, 0x31, 0xc1, 0x7e, 0x0d, 0xc3, 0x05, - 0x30, 0xc2, 0xbf, 0x36, 0x86, 0x56, 0x2d, 0xf9, 0x46, 0x32, 0x29, 0x1d, 0x3d, 0x72, 0x3b, 0x61, - 0xa0, 0x54, 0x46, 0x7d, 0x4f, 0xc9, 0xf5, 0xfc, 0x9e, 0x72, 0x01, 0x0c, 0x86, 0x69, 0x03, 0xb8, - 0xc0, 0xb8, 0xbc, 0xe7, 0xcb, 0xa9, 0x9c, 0x1b, 0x90, 0x88, 0x77, 0xb9, 0xf2, 0x92, 0x1b, 0x90, - 0x08, 0x71, 0x6a, 0xe9, 0x4f, 0x39, 0x70, 0xa6, 0x3d, 0x3f, 0x33, 0x40, 0x12, 0xbb, 0x1d, 0x1f, - 0x70, 0x18, 0x0f, 0x71, 0x8e, 0xfe, 0x6e, 0x20, 0xf7, 0xe0, 0x77, 0x03, 0xf0, 0x25, 0x30, 0x29, - 0x7f, 0xae, 0xec, 0x87, 0x04, 0x53, 0xfe, 0x65, 0x72, 0xa0, 0xfd, 0xbd, 0xdf, 0x5a, 0x56, 0x00, - 0x75, 0x8e, 0x81, 0x5f, 0xc9, 0xbc, 0x69, 0xb8, 0x9c, 0xbe, 0x67, 0x60, 0xb5, 0x1d, 0x2f, 0x1d, - 0xee, 0xb1, 0x2d, 0xbf, 0x42, 0x48, 0x40, 0x32, 0x0f, 0x1d, 0x16, 0xc0, 0x48, 0x9d, 0x09, 0xf0, - 0x3e, 0x79, 0xbe, 0xdd, 0xe9, 0x37, 0x12, 0x06, 0x4a, 0x65, 0xe0, 0xd7, 0xc0, 0x78, 0x10, 0x8a, - 0x2a, 0x76, 0xdd, 0xb5, 0xab, 0xd8, 0xad, 0xf3, 0x8e, 0x5e, 0x21, 0x69, 0xbb, 0xb6, 0xb1, 0x50, - 0x56, 0xb6, 0xf4, 0x47, 0x03, 0x9c, 0x4d, 0x1e, 0x13, 0xb9, 0x0e, 0xf6, 0xa3, 0xa5, 0xc0, 0xaf, - 0x3b, 0x0d, 0x78, 0x5e, 0xb4, 0x4f, 0xb5, 0x9e, 0x64, 0xd2, 0x3a, 0x85, 0xf7, 0xc1, 0x30, 0x15, - 0xb1, 0x22, 0xc3, 0xf8, 0x95, 0xa3, 0x87, 0x71, 0x36, 0xe8, 0x44, 0xf5, 0x97, 0x50, 0x13, 0x1c, - 0x16, 0xc9, 0x35, 0xab, 0x12, 0xfb, 0xb6, 0x6c, 0xa1, 0x8f, 0x89, 0x48, 0x5e, 0x5a, 0x14, 0x34, - 0xa4, 0xb8, 0xa5, 0x7f, 0x18, 0x60, 0xb2, 0xe3, 0x71, 0x14, 0xfc, 0x9e, 0x01, 0xc6, 0x6a, 0xda, - 0xf4, 0x64, 0x3e, 0x58, 0x3b, 0xfe, 0x03, 0x2c, 0x4d, 0xa9, 0x28, 0xa1, 0x74, 0x0a, 0x6a, 0x03, - 0x85, 0x9b, 0xc0, 0xac, 0x65, 0xde, 0x21, 0x66, 0xbe, 0x6c, 0x5e, 0x68, 0x35, 0x8b, 0xe6, 0x52, - 0x0f, 0x19, 0xd4, 0x73, 0x74, 0xe5, 0x5b, 0x1f, 0x7d, 0x3a, 0x7b, 0xea, 0xe3, 0x4f, 0x67, 0x4f, - 0x7d, 0xf2, 0xe9, 0xec, 0xa9, 0x77, 0x5a, 0xb3, 0xc6, 0x47, 0xad, 0x59, 0xe3, 0xe3, 0xd6, 0xac, - 0xf1, 0x49, 0x6b, 0xd6, 0xf8, 0x6b, 0x6b, 0xd6, 0xf8, 0xc9, 0xdf, 0x66, 0x4f, 0xbd, 0x7e, 0xfd, - 0xa8, 0xaf, 0x8f, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x28, 0x77, 0xf5, 0x22, 0xd1, 0x2c, 0x00, - 0x00, + // 3111 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdd, 0x6f, 0x5c, 0x47, + 0x15, 0xcf, 0x5d, 0x7b, 0xed, 0xf5, 0xd8, 0x89, 0xed, 0x49, 0x6c, 0x6e, 0xdc, 0xc4, 0xeb, 0x6c, + 0x68, 0x70, 0xdb, 0x74, 0xdd, 0x9a, 0x96, 0x86, 0x82, 0x40, 0x5e, 0xdb, 0x69, 0xdd, 0xd8, 0xb1, + 0x35, 0x9b, 0xa4, 0x6e, 0x8b, 0x68, 0xaf, 0xf7, 0x8e, 0xd7, 0xb7, 0xbe, 0x5f, 0x99, 0xb9, 0xd7, + 0x1f, 0x12, 0x48, 0x15, 0xa8, 0x02, 0x2a, 0x41, 0x79, 0xa8, 0xca, 0x13, 0x42, 0x08, 0xf5, 0x01, + 0x1e, 0xe0, 0x0d, 0xfe, 0x85, 0xbe, 0x20, 0xf5, 0x09, 0x55, 0x42, 0x5a, 0xd1, 0xe5, 0x1f, 0x40, + 0x02, 0x84, 0xf0, 0x03, 0x42, 0xf3, 0x71, 0xe7, 0xce, 0xde, 0xdd, 0x4d, 0x22, 0x7b, 0xdd, 0xbe, + 0xed, 0x9e, 0x73, 0xe6, 0xfc, 0xce, 0x9c, 0x39, 0x73, 0xe6, 0xcc, 0xb9, 0x03, 0xac, 0xdd, 0x1b, + 0xb4, 0xec, 0x04, 0x73, 0xbb, 0xf1, 0x16, 0x26, 0x3e, 0x8e, 0x30, 0x9d, 0xdb, 0xc3, 0xbe, 0x1d, + 0x90, 0x39, 0xc9, 0xb0, 0x42, 0x07, 0x1f, 0x44, 0xd8, 0xa7, 0x4e, 0xe0, 0xd3, 0xa7, 0xad, 0xd0, + 0xa1, 0x98, 0xec, 0x61, 0x32, 0x17, 0xee, 0xd6, 0x19, 0x8f, 0xb6, 0x0a, 0xcc, 0xed, 0x3d, 0x3b, + 0x57, 0xc7, 0x3e, 0x26, 0x56, 0x84, 0xed, 0x72, 0x48, 0x82, 0x28, 0x80, 0x37, 0x84, 0xa6, 0x72, + 0x8b, 0xe0, 0x9b, 0x4a, 0x53, 0x39, 0xdc, 0xad, 0x33, 0x1e, 0x6d, 0x15, 0x28, 0xef, 0x3d, 0x3b, + 0xf5, 0x74, 0xdd, 0x89, 0x76, 0xe2, 0xad, 0x72, 0x2d, 0xf0, 0xe6, 0xea, 0x41, 0x3d, 0x98, 0xe3, + 0x0a, 0xb7, 0xe2, 0x6d, 0xfe, 0x8f, 0xff, 0xe1, 0xbf, 0x04, 0xd0, 0xd4, 0x73, 0xa9, 0xc9, 0x9e, + 0x55, 0xdb, 0x71, 0x7c, 0x4c, 0x0e, 0x53, 0x3b, 0x3d, 0x1c, 0x59, 0x1d, 0xcc, 0x9b, 0x9a, 0xeb, + 0x36, 0x8a, 0xc4, 0x7e, 0xe4, 0x78, 0xb8, 0x6d, 0xc0, 0xd7, 0x1e, 0x36, 0x80, 0xd6, 0x76, 0xb0, + 0x67, 0x65, 0xc7, 0x95, 0x8e, 0x0c, 0x30, 0xbe, 0x18, 0xf8, 0x7b, 0x98, 0xb0, 0x09, 0x22, 0x7c, + 0x3f, 0xc6, 0x34, 0x82, 0x15, 0xd0, 0x17, 0x3b, 0xb6, 0x69, 0xcc, 0x18, 0xb3, 0x43, 0x95, 0x67, + 0x3e, 0x6e, 0x14, 0xcf, 0x34, 0x1b, 0xc5, 0xbe, 0xbb, 0x2b, 0x4b, 0x47, 0x8d, 0xe2, 0x95, 0x6e, + 0x48, 0xd1, 0x61, 0x88, 0x69, 0xf9, 0xee, 0xca, 0x12, 0x62, 0x83, 0xe1, 0x4b, 0x60, 0xdc, 0xc6, + 0xd4, 0x21, 0xd8, 0x5e, 0xd8, 0x58, 0xb9, 0x27, 0xf4, 0x9b, 0x39, 0xae, 0xf1, 0xa2, 0xd4, 0x38, + 0xbe, 0x94, 0x15, 0x40, 0xed, 0x63, 0xe0, 0x26, 0x18, 0x0c, 0xb6, 0xde, 0xc6, 0xb5, 0x88, 0x9a, + 0x7d, 0x33, 0x7d, 0xb3, 0xc3, 0xf3, 0x4f, 0x97, 0xd3, 0xc5, 0x53, 0x26, 0xf0, 0x15, 0x93, 0x93, + 0x2d, 0x23, 0x6b, 0x7f, 0x39, 0x59, 0xb4, 0xca, 0xa8, 0x44, 0x1b, 0x5c, 0x17, 0x5a, 0x50, 0xa2, + 0xae, 0xf4, 0x9b, 0x1c, 0x80, 0xfa, 0xe4, 0x69, 0x18, 0xf8, 0x14, 0xf7, 0x64, 0xf6, 0x14, 0x8c, + 0xd5, 0xb8, 0xe6, 0x08, 0xdb, 0x12, 0xd7, 0xcc, 0x1d, 0xc7, 0x7a, 0x53, 0xe2, 0x8f, 0x2d, 0x66, + 0xd4, 0xa1, 0x36, 0x00, 0x78, 0x07, 0x0c, 0x10, 0x4c, 0x63, 0x37, 0x32, 0xfb, 0x66, 0x8c, 0xd9, + 0xe1, 0xf9, 0xeb, 0x5d, 0xa1, 0x78, 0x68, 0xb3, 0xe0, 0x2b, 0xef, 0x3d, 0x5b, 0xae, 0x46, 0x56, + 0x14, 0xd3, 0xca, 0x39, 0x89, 0x34, 0x80, 0xb8, 0x0e, 0x24, 0x75, 0x95, 0xfe, 0x67, 0x80, 0x31, + 0xdd, 0x4b, 0x7b, 0x0e, 0xde, 0x87, 0x04, 0x0c, 0x12, 0x11, 0x2c, 0xdc, 0x4f, 0xc3, 0xf3, 0xb7, + 0xca, 0xc7, 0xdd, 0x51, 0xe5, 0xb6, 0xf8, 0xab, 0x0c, 0xb3, 0xe5, 0x92, 0x7f, 0x50, 0x02, 0x04, + 0xf7, 0x40, 0x81, 0xc8, 0x35, 0xe2, 0x81, 0x34, 0x3c, 0xbf, 0xda, 0x1b, 0x50, 0xa1, 0xb3, 0x32, + 0xd2, 0x6c, 0x14, 0x0b, 0xc9, 0x3f, 0xa4, 0xb0, 0x4a, 0xbf, 0xca, 0x81, 0xe9, 0xc5, 0x98, 0x46, + 0x81, 0x87, 0x30, 0x0d, 0x62, 0x52, 0xc3, 0x8b, 0x81, 0x1b, 0x7b, 0xfe, 0x12, 0xde, 0x76, 0x7c, + 0x27, 0x62, 0x31, 0x3a, 0x03, 0xfa, 0x7d, 0xcb, 0xc3, 0x32, 0x66, 0x46, 0xa4, 0x27, 0xfb, 0x6f, + 0x5b, 0x1e, 0x46, 0x9c, 0xc3, 0x24, 0x58, 0x88, 0xc8, 0x1d, 0xa0, 0x24, 0xee, 0x1c, 0x86, 0x18, + 0x71, 0x0e, 0xbc, 0x06, 0x06, 0xb6, 0x03, 0xe2, 0x59, 0x62, 0xf5, 0x86, 0xd2, 0xf5, 0xb8, 0xc9, + 0xa9, 0x48, 0x72, 0xe1, 0xf3, 0x60, 0xd8, 0xc6, 0xb4, 0x46, 0x9c, 0x90, 0x41, 0x9b, 0xfd, 0x5c, + 0xf8, 0xbc, 0x14, 0x1e, 0x5e, 0x4a, 0x59, 0x48, 0x97, 0x83, 0xd7, 0x41, 0x21, 0x24, 0x4e, 0x40, + 0x9c, 0xe8, 0xd0, 0xcc, 0xcf, 0x18, 0xb3, 0xf9, 0xca, 0x98, 0x1c, 0x53, 0xd8, 0x90, 0x74, 0xa4, + 0x24, 0x98, 0xf4, 0xdb, 0x34, 0xf0, 0x37, 0xac, 0x68, 0xc7, 0x1c, 0xe0, 0x08, 0x4a, 0xfa, 0x95, + 0xea, 0xfa, 0x6d, 0x46, 0x47, 0x4a, 0xa2, 0xf4, 0x17, 0x03, 0x98, 0x59, 0x0f, 0x25, 0xee, 0x85, + 0x37, 0x41, 0x81, 0x46, 0x2c, 0xe7, 0xd4, 0x0f, 0xa5, 0x7f, 0x9e, 0x4c, 0x54, 0x55, 0x25, 0xfd, + 0xa8, 0x51, 0x9c, 0x4c, 0x47, 0x24, 0x54, 0xee, 0x1b, 0x35, 0x96, 0x85, 0xdc, 0x3e, 0xde, 0xda, + 0x09, 0x82, 0x5d, 0xb9, 0xfa, 0x27, 0x08, 0xb9, 0x57, 0x85, 0xa2, 0x14, 0x53, 0x84, 0x9c, 0x24, + 0xa3, 0x04, 0xa8, 0xf4, 0xdf, 0x5c, 0x76, 0x62, 0xda, 0xa2, 0xbf, 0x05, 0x0a, 0x6c, 0x0b, 0xd9, + 0x56, 0x64, 0xc9, 0x4d, 0xf0, 0xcc, 0xa3, 0x6d, 0x38, 0xb1, 0x5f, 0xd7, 0x70, 0x64, 0x55, 0xa0, + 0x74, 0x05, 0x48, 0x69, 0x48, 0x69, 0x85, 0x07, 0xa0, 0x9f, 0x86, 0xb8, 0x26, 0xe7, 0x7b, 0xef, + 0x04, 0xd1, 0xde, 0x65, 0x0e, 0xd5, 0x10, 0xd7, 0xd2, 0x60, 0x64, 0xff, 0x10, 0x47, 0x84, 0xef, + 0x18, 0x60, 0x80, 0xf2, 0xbc, 0x20, 0x73, 0xc9, 0xe6, 0x29, 0x80, 0x67, 0xf2, 0x8e, 0xf8, 0x8f, + 0x24, 0x6e, 0xe9, 0x5f, 0x39, 0x70, 0xa5, 0xdb, 0xd0, 0xc5, 0xc0, 0xb7, 0xc5, 0x22, 0xac, 0xc8, + 0x7d, 0x25, 0x22, 0xeb, 0x79, 0x7d, 0x5f, 0x1d, 0x35, 0x8a, 0x8f, 0x3f, 0x54, 0x81, 0xb6, 0x01, + 0xbf, 0xae, 0xa6, 0x2c, 0x36, 0xe9, 0x95, 0x56, 0xc3, 0x8e, 0x1a, 0xc5, 0x51, 0x35, 0xac, 0xd5, + 0x56, 0xb8, 0x07, 0xa0, 0x6b, 0xd1, 0xe8, 0x0e, 0xb1, 0x7c, 0x2a, 0xd4, 0x3a, 0x1e, 0x96, 0x9e, + 0x7b, 0xf2, 0xd1, 0x82, 0x82, 0x8d, 0xa8, 0x4c, 0x49, 0x48, 0xb8, 0xda, 0xa6, 0x0d, 0x75, 0x40, + 0x60, 0x39, 0x83, 0x60, 0x8b, 0xaa, 0x34, 0xa0, 0xe5, 0x70, 0x46, 0x45, 0x92, 0x0b, 0x9f, 0x00, + 0x83, 0x1e, 0xa6, 0xd4, 0xaa, 0x63, 0xbe, 0xf7, 0x87, 0xd2, 0x43, 0x71, 0x4d, 0x90, 0x51, 0xc2, + 0x2f, 0xfd, 0xdb, 0x00, 0x97, 0xba, 0x79, 0x6d, 0xd5, 0xa1, 0x11, 0xfc, 0x4e, 0x5b, 0xd8, 0x97, + 0x1f, 0x6d, 0x86, 0x6c, 0x34, 0x0f, 0x7a, 0x95, 0x4a, 0x12, 0x8a, 0x16, 0xf2, 0xfb, 0x20, 0xef, + 0x44, 0xd8, 0x4b, 0x4e, 0x4b, 0xd4, 0xfb, 0xb0, 0xab, 0x9c, 0x95, 0xf0, 0xf9, 0x15, 0x06, 0x84, + 0x04, 0x5e, 0xe9, 0xa3, 0x1c, 0xb8, 0xdc, 0x6d, 0x08, 0xcb, 0xe3, 0x94, 0x39, 0x3b, 0x74, 0x63, + 0x62, 0xb9, 0x32, 0xd8, 0x94, 0xb3, 0x37, 0x38, 0x15, 0x49, 0x2e, 0xcb, 0x9d, 0xd4, 0xf1, 0xeb, + 0xb1, 0x6b, 0x11, 0x19, 0x49, 0x6a, 0xc2, 0x55, 0x49, 0x47, 0x4a, 0x02, 0x96, 0x01, 0xa0, 0x3b, + 0x01, 0x89, 0x38, 0x06, 0xaf, 0x70, 0x86, 0x2a, 0xe7, 0x58, 0x46, 0xa8, 0x2a, 0x2a, 0xd2, 0x24, + 0xd8, 0x41, 0xb2, 0xeb, 0xf8, 0xb6, 0x5c, 0x70, 0xb5, 0x77, 0x6f, 0x39, 0xbe, 0x8d, 0x38, 0x87, + 0xe1, 0xbb, 0x0e, 0x8d, 0x18, 0x45, 0xae, 0x76, 0x8b, 0xc3, 0xb9, 0xa4, 0x92, 0x60, 0xf8, 0x35, + 0x96, 0x60, 0x03, 0xe2, 0x60, 0x6a, 0x0e, 0xa4, 0xf8, 0x8b, 0x8a, 0x8a, 0x34, 0x89, 0xd2, 0x5f, + 0xfb, 0xbb, 0xc7, 0x07, 0x4b, 0x20, 0xf0, 0x2a, 0xc8, 0xd7, 0x49, 0x10, 0x87, 0xd2, 0x4b, 0xca, + 0xdb, 0x2f, 0x31, 0x22, 0x12, 0x3c, 0xf8, 0x3d, 0x90, 0xf7, 0xe5, 0x84, 0x59, 0x04, 0xbd, 0xda, + 0xfb, 0x65, 0xe6, 0xde, 0x4a, 0xd1, 0x85, 0x23, 0x05, 0x28, 0x7c, 0x0e, 0xe4, 0x69, 0x2d, 0x08, + 0xb1, 0x74, 0xe2, 0x74, 0x22, 0x54, 0x65, 0xc4, 0xa3, 0x46, 0xf1, 0x6c, 0xa2, 0x8e, 0x13, 0x90, + 0x10, 0x86, 0x3f, 0x32, 0x40, 0x41, 0x1e, 0x17, 0xd4, 0x1c, 0xe4, 0xe1, 0xf9, 0x5a, 0xef, 0xed, + 0x96, 0x65, 0x6f, 0xba, 0x66, 0x92, 0x40, 0x91, 0x02, 0x87, 0x3f, 0x30, 0x00, 0xa8, 0xa9, 0xb3, + 0xcb, 0x1c, 0xe2, 0x3e, 0xec, 0xd9, 0x56, 0xd1, 0x4e, 0x45, 0x11, 0x08, 0x69, 0xa9, 0xa4, 0xa1, + 0xc2, 0x2a, 0x98, 0x08, 0x09, 0xe6, 0xba, 0xef, 0xfa, 0xbb, 0x7e, 0xb0, 0xef, 0xdf, 0x74, 0xb0, + 0x6b, 0x53, 0x13, 0xcc, 0x18, 0xb3, 0x85, 0xca, 0x65, 0x69, 0xff, 0xc4, 0x46, 0x27, 0x21, 0xd4, + 0x79, 0x6c, 0xe9, 0xdd, 0xbe, 0x6c, 0xad, 0x95, 0x3d, 0x2f, 0xe0, 0xfb, 0x62, 0xf2, 0x22, 0x0f, + 0x53, 0xd3, 0xe0, 0x0b, 0xf1, 0x46, 0xef, 0x17, 0x42, 0xe5, 0xfa, 0xf4, 0x90, 0x56, 0x24, 0x8a, + 0x34, 0x13, 0xe0, 0x07, 0x06, 0x38, 0x6b, 0xd5, 0x6a, 0x38, 0x8c, 0xb0, 0x2d, 0xb6, 0x71, 0xee, + 0x74, 0xa3, 0x7a, 0x42, 0x1a, 0x74, 0x76, 0x41, 0x47, 0x45, 0xad, 0x46, 0xc0, 0x17, 0xc1, 0x39, + 0x1a, 0x05, 0x04, 0xdb, 0x49, 0x04, 0xc9, 0xec, 0x02, 0x9b, 0x8d, 0xe2, 0xb9, 0x6a, 0x0b, 0x07, + 0x65, 0x24, 0x4b, 0x9f, 0xe4, 0x41, 0xf1, 0x21, 0x11, 0xfa, 0x08, 0x45, 0xef, 0x35, 0x30, 0xc0, + 0x67, 0x6a, 0x73, 0x87, 0x14, 0xb4, 0xa3, 0x9e, 0x53, 0x91, 0xe4, 0xb2, 0xe3, 0x89, 0xe1, 0xb3, + 0xe3, 0xa9, 0x8f, 0x0b, 0xaa, 0xe3, 0xa9, 0x2a, 0xc8, 0x28, 0xe1, 0xc3, 0x79, 0x00, 0x6c, 0x1c, + 0x12, 0xcc, 0x32, 0x92, 0x6d, 0x0e, 0x72, 0x69, 0xb5, 0x3e, 0x4b, 0x8a, 0x83, 0x34, 0x29, 0x78, + 0x13, 0xc0, 0xe4, 0x9f, 0x13, 0xf8, 0xaf, 0x5a, 0xc4, 0x77, 0xfc, 0xba, 0x59, 0xe0, 0x66, 0x4f, + 0xb2, 0xd3, 0x76, 0xa9, 0x8d, 0x8b, 0x3a, 0x8c, 0x80, 0x7b, 0x60, 0x40, 0x5c, 0xa3, 0x79, 0xde, + 0xe8, 0xe1, 0x8e, 0xbb, 0x67, 0xb9, 0x8e, 0xcd, 0xa1, 0x2a, 0x80, 0xbb, 0x87, 0xa3, 0x20, 0x89, + 0x06, 0xdf, 0x33, 0xc0, 0x08, 0x8d, 0xb7, 0x88, 0x94, 0xa6, 0x3c, 0xab, 0x0f, 0xcf, 0xdf, 0xe9, + 0x15, 0x7c, 0x55, 0xd3, 0x5d, 0x19, 0x6b, 0x36, 0x8a, 0x23, 0x3a, 0x05, 0xb5, 0x60, 0xc3, 0x3f, + 0x1a, 0xc0, 0xb4, 0x6c, 0x11, 0xfa, 0x96, 0xbb, 0x41, 0x1c, 0x3f, 0xc2, 0x44, 0x5c, 0x88, 0xc4, + 0xf1, 0xd1, 0xc3, 0x5a, 0x31, 0x7b, 0xcf, 0xaa, 0xcc, 0xc8, 0x95, 0x36, 0x17, 0xba, 0x58, 0x80, + 0xba, 0xda, 0x56, 0xfa, 0x8f, 0x91, 0x4d, 0x2d, 0xda, 0x2c, 0xab, 0x35, 0xcb, 0xc5, 0x70, 0x09, + 0x8c, 0xb1, 0xea, 0x17, 0xe1, 0xd0, 0x75, 0x6a, 0x16, 0xe5, 0xb7, 0x1f, 0x11, 0xdd, 0xea, 0x1a, + 0x5e, 0xcd, 0xf0, 0x51, 0xdb, 0x08, 0xf8, 0x0a, 0x80, 0xa2, 0x2c, 0x6c, 0xd1, 0x23, 0x2a, 0x01, + 0x55, 0xe0, 0x55, 0xdb, 0x24, 0x50, 0x87, 0x51, 0x70, 0x11, 0x8c, 0xbb, 0xd6, 0x16, 0x76, 0xab, + 0xd8, 0xc5, 0xb5, 0x28, 0x20, 0x5c, 0x95, 0xb8, 0x1f, 0x4e, 0x34, 0x1b, 0xc5, 0xf1, 0xd5, 0x2c, + 0x13, 0xb5, 0xcb, 0x97, 0xae, 0x64, 0xf7, 0xb2, 0x3e, 0x71, 0x51, 0x6c, 0x7f, 0x98, 0x03, 0x53, + 0xdd, 0x83, 0x02, 0x7e, 0x5f, 0x95, 0xc6, 0xa2, 0xe2, 0x7b, 0xed, 0x14, 0x42, 0x4f, 0x5e, 0x07, + 0x40, 0xfb, 0x55, 0x00, 0x1e, 0xb2, 0xf3, 0xda, 0x72, 0x93, 0x6b, 0xff, 0xe6, 0x69, 0xa0, 0x33, + 0xfd, 0x95, 0x21, 0x51, 0x05, 0x58, 0x2e, 0x3f, 0xf4, 0x2d, 0x17, 0x97, 0x3e, 0x6a, 0xbb, 0xda, + 0xa6, 0x9b, 0x15, 0xfe, 0xd8, 0x00, 0xa3, 0x41, 0x88, 0xfd, 0x85, 0x8d, 0x95, 0x7b, 0x5f, 0x15, + 0x9b, 0x56, 0x3a, 0x68, 0xe5, 0xf8, 0x26, 0xb2, 0xfb, 0xb5, 0xd0, 0xb5, 0x41, 0x82, 0x90, 0x56, + 0xce, 0x37, 0x1b, 0xc5, 0xd1, 0xf5, 0x56, 0x14, 0x94, 0x85, 0x2d, 0x79, 0x60, 0x62, 0xf9, 0x20, + 0xc2, 0xc4, 0xb7, 0xdc, 0xa5, 0xa0, 0x16, 0x7b, 0xd8, 0x8f, 0x84, 0x8d, 0x99, 0x76, 0x81, 0xf1, + 0x88, 0xed, 0x82, 0xcb, 0xa0, 0x2f, 0x26, 0xae, 0x8c, 0xda, 0x61, 0xd5, 0x04, 0x43, 0xab, 0x88, + 0xd1, 0x4b, 0x57, 0x40, 0x3f, 0xb3, 0x13, 0x5e, 0x04, 0x7d, 0xc4, 0xda, 0xe7, 0x5a, 0x47, 0x2a, + 0x83, 0x4c, 0x04, 0x59, 0xfb, 0x88, 0xd1, 0x4a, 0xff, 0x98, 0x01, 0xa3, 0x99, 0xb9, 0xc0, 0x29, + 0x90, 0x53, 0x9d, 0x35, 0x20, 0x95, 0xe6, 0x56, 0x96, 0x50, 0xce, 0xb1, 0xe1, 0x0b, 0x2a, 0xbb, + 0x0a, 0xd0, 0xa2, 0x3a, 0x2c, 0x38, 0x95, 0x95, 0x65, 0xa9, 0x3a, 0x66, 0x48, 0x92, 0x1e, 0x99, + 0x0d, 0x78, 0x5b, 0xee, 0x0a, 0x61, 0x03, 0xde, 0x46, 0x8c, 0x76, 0xdc, 0x5e, 0x49, 0xd2, 0xac, + 0xc9, 0x3f, 0x42, 0xb3, 0x66, 0xe0, 0x81, 0xcd, 0x9a, 0xab, 0x20, 0x1f, 0x39, 0x91, 0x8b, 0xf9, + 0x49, 0xa5, 0x15, 0xc3, 0x77, 0x18, 0x11, 0x09, 0x1e, 0xc4, 0x60, 0xd0, 0xc6, 0xdb, 0x56, 0xec, + 0x46, 0xfc, 0x50, 0x1a, 0x9e, 0xff, 0xd6, 0xc9, 0xa2, 0x47, 0x34, 0x33, 0x96, 0x84, 0x4a, 0x94, + 0xe8, 0x86, 0x8f, 0x83, 0x41, 0xcf, 0x3a, 0x70, 0xbc, 0xd8, 0xe3, 0x15, 0xa3, 0x21, 0xc4, 0xd6, + 0x04, 0x09, 0x25, 0x3c, 0x96, 0x04, 0xf1, 0x41, 0xcd, 0x8d, 0xa9, 0xb3, 0x87, 0x25, 0x53, 0x96, + 0x74, 0x2a, 0x09, 0x2e, 0x67, 0xf8, 0xa8, 0x6d, 0x04, 0x07, 0x73, 0x7c, 0x3e, 0x78, 0x58, 0x03, + 0x13, 0x24, 0x94, 0xf0, 0x5a, 0xc1, 0xa4, 0xfc, 0x48, 0x37, 0x30, 0x39, 0xb8, 0x6d, 0x04, 0x7c, + 0x0a, 0x0c, 0x79, 0xd6, 0xc1, 0x2a, 0xf6, 0xeb, 0xd1, 0x8e, 0x79, 0x76, 0xc6, 0x98, 0xed, 0xab, + 0x9c, 0x6d, 0x36, 0x8a, 0x43, 0x6b, 0x09, 0x11, 0xa5, 0x7c, 0x2e, 0xec, 0xf8, 0x52, 0xf8, 0x9c, + 0x26, 0x9c, 0x10, 0x51, 0xca, 0x67, 0x95, 0x49, 0x68, 0x45, 0x6c, 0x5f, 0x99, 0xa3, 0xad, 0x17, + 0xe7, 0x0d, 0x41, 0x46, 0x09, 0x1f, 0xce, 0x82, 0x82, 0x67, 0x1d, 0xf0, 0x3b, 0xa5, 0x39, 0xc6, + 0xd5, 0xf2, 0x86, 0xe2, 0x9a, 0xa4, 0x21, 0xc5, 0xe5, 0x92, 0x8e, 0x2f, 0x24, 0xc7, 0x35, 0x49, + 0x49, 0x43, 0x8a, 0xcb, 0xe2, 0x37, 0xf6, 0x9d, 0xfb, 0x31, 0x16, 0xc2, 0x90, 0x7b, 0x46, 0xc5, + 0xef, 0xdd, 0x94, 0x85, 0x74, 0x39, 0x76, 0xa7, 0xf3, 0x62, 0x37, 0x72, 0x42, 0x17, 0xaf, 0x6f, + 0x9b, 0xe7, 0xb9, 0xff, 0x79, 0x29, 0xbf, 0xa6, 0xa8, 0x48, 0x93, 0x80, 0x6f, 0x81, 0x7e, 0xec, + 0xc7, 0x9e, 0x79, 0x81, 0x1f, 0xdf, 0x27, 0x8d, 0x3e, 0xb5, 0x5f, 0x96, 0xfd, 0xd8, 0x43, 0x5c, + 0x33, 0x7c, 0x01, 0x9c, 0xf5, 0xac, 0x03, 0x96, 0x04, 0x30, 0x89, 0xd8, 0x45, 0x73, 0x82, 0xcf, + 0x7b, 0x9c, 0x15, 0xb1, 0x6b, 0x3a, 0x03, 0xb5, 0xca, 0xf1, 0x81, 0x8e, 0xaf, 0x0d, 0x9c, 0xd4, + 0x06, 0xea, 0x0c, 0xd4, 0x2a, 0xc7, 0x9c, 0x4c, 0xf0, 0xfd, 0xd8, 0x21, 0xd8, 0x36, 0xbf, 0xc4, + 0xeb, 0x5e, 0xd9, 0xdf, 0x15, 0x34, 0xa4, 0xb8, 0xf0, 0x7e, 0xd2, 0x72, 0x30, 0xf9, 0xe6, 0xdb, + 0xe8, 0x59, 0xea, 0x5e, 0x27, 0x0b, 0x84, 0x58, 0x87, 0xe2, 0x54, 0xd1, 0x9b, 0x0d, 0xd0, 0x07, + 0x79, 0xcb, 0x75, 0xd7, 0xb7, 0xcd, 0x8b, 0xdc, 0xe3, 0x3d, 0x3c, 0x2d, 0x54, 0x86, 0x59, 0x60, + 0xfa, 0x91, 0x80, 0x61, 0x78, 0x81, 0xcf, 0x62, 0x61, 0xea, 0xd4, 0xf0, 0xd6, 0x99, 0x7e, 0x24, + 0x60, 0xf8, 0xfc, 0xfc, 0xc3, 0xf5, 0x6d, 0xf3, 0xb1, 0xd3, 0x9b, 0x1f, 0xd3, 0x8f, 0x04, 0x0c, + 0xb4, 0x41, 0x9f, 0x1f, 0x44, 0xe6, 0xa5, 0x5e, 0x9f, 0xbd, 0xfc, 0x34, 0xb9, 0x1d, 0x44, 0x88, + 0xa9, 0x87, 0x3f, 0x35, 0x00, 0x08, 0xd3, 0x48, 0xbc, 0x7c, 0xd2, 0x16, 0x40, 0x06, 0xad, 0x9c, + 0x46, 0xef, 0xb2, 0x1f, 0x91, 0xc3, 0xf4, 0x5e, 0xa3, 0x45, 0xb9, 0x66, 0x00, 0xfc, 0xa5, 0x01, + 0x2e, 0xe8, 0xe5, 0xae, 0xb2, 0x6c, 0x9a, 0xfb, 0x61, 0xbd, 0x87, 0x81, 0x5c, 0x09, 0x02, 0xb7, + 0x62, 0x36, 0x1b, 0xc5, 0x0b, 0x0b, 0x1d, 0x00, 0x51, 0x47, 0x33, 0xe0, 0x6f, 0x0d, 0x30, 0x2e, + 0xb3, 0xa3, 0x66, 0x5c, 0x91, 0xbb, 0xed, 0xad, 0x1e, 0xba, 0x2d, 0x0b, 0x21, 0xbc, 0xa7, 0xbe, + 0x32, 0xb6, 0xf1, 0x51, 0xbb, 0x55, 0xf0, 0x0f, 0x06, 0x18, 0xb1, 0x71, 0x88, 0x7d, 0x1b, 0xfb, + 0x35, 0x66, 0xe6, 0xcc, 0x49, 0xfb, 0x0a, 0x59, 0x33, 0x97, 0x34, 0xed, 0xc2, 0xc2, 0xb2, 0xb4, + 0x70, 0x44, 0x67, 0x1d, 0x35, 0x8a, 0x93, 0xe9, 0x50, 0x9d, 0x83, 0x5a, 0x0c, 0x84, 0x3f, 0x33, + 0xc0, 0x68, 0xea, 0x76, 0x71, 0x40, 0x5c, 0x39, 0x9d, 0x85, 0xe7, 0x25, 0xe8, 0x42, 0x2b, 0x16, + 0xca, 0x82, 0xc3, 0xdf, 0x19, 0xac, 0xda, 0x4a, 0xee, 0x6a, 0xd4, 0x2c, 0x71, 0x0f, 0xbe, 0xde, + 0x4b, 0x0f, 0x2a, 0xe5, 0xc2, 0x81, 0xd7, 0xd3, 0x4a, 0x4e, 0x71, 0x8e, 0x1a, 0xc5, 0x09, 0xdd, + 0x7f, 0x8a, 0x81, 0x74, 0xe3, 0xe0, 0xbb, 0x06, 0x18, 0xc1, 0x69, 0xc1, 0x4c, 0xcd, 0xab, 0x27, + 0x75, 0x5d, 0xc7, 0xf2, 0x5b, 0x5c, 0xa7, 0x35, 0x16, 0x45, 0x2d, 0xb0, 0xac, 0xf6, 0xc3, 0x07, + 0x96, 0x17, 0xba, 0xd8, 0xfc, 0x72, 0xef, 0x6a, 0xbf, 0x65, 0xa1, 0x12, 0x25, 0xba, 0xe1, 0x75, + 0x50, 0xf0, 0x63, 0xd7, 0xb5, 0xb6, 0x5c, 0x6c, 0x3e, 0xce, 0xab, 0x08, 0xd5, 0x5f, 0xbc, 0x2d, + 0xe9, 0x48, 0x49, 0xc0, 0x6d, 0x30, 0x73, 0x70, 0x4b, 0x3d, 0xbe, 0xe8, 0xd8, 0xc0, 0x33, 0xaf, + 0x71, 0x2d, 0x53, 0xcd, 0x46, 0x71, 0x72, 0xb3, 0x73, 0x8b, 0xef, 0xa1, 0x3a, 0xe0, 0x1b, 0xe0, + 0x31, 0x4d, 0x66, 0xd9, 0xdb, 0xc2, 0xb6, 0x8d, 0xed, 0xe4, 0xa2, 0x65, 0x7e, 0x85, 0x43, 0xa8, + 0x7d, 0xbc, 0x99, 0x15, 0x40, 0x0f, 0x1a, 0x0d, 0x57, 0xc1, 0xa4, 0xc6, 0x5e, 0xf1, 0xa3, 0x75, + 0x52, 0x8d, 0x88, 0xe3, 0xd7, 0xcd, 0x59, 0xae, 0xf7, 0x42, 0xb2, 0xfb, 0x36, 0x35, 0x1e, 0xea, + 0x32, 0x06, 0xbe, 0xdc, 0xa2, 0x8d, 0x7f, 0xb8, 0xb0, 0xc2, 0x5b, 0xf8, 0x90, 0x9a, 0x4f, 0xf0, + 0xe2, 0x82, 0xaf, 0xf3, 0xa6, 0x46, 0x47, 0x5d, 0xe4, 0xe1, 0xb7, 0xc1, 0xf9, 0x0c, 0x87, 0xdd, + 0x2b, 0xcc, 0x27, 0xc5, 0x05, 0x81, 0x55, 0xa2, 0x9b, 0x09, 0x11, 0x75, 0x92, 0x84, 0xdf, 0x04, + 0x50, 0x23, 0xaf, 0x59, 0x21, 0x1f, 0xff, 0x94, 0xb8, 0xab, 0xb0, 0x15, 0xdd, 0x94, 0x34, 0xd4, + 0x41, 0x0e, 0x7e, 0x68, 0xb4, 0xcc, 0x24, 0xbd, 0xcd, 0x52, 0xf3, 0x3a, 0xdf, 0xb0, 0x2f, 0x1f, + 0x3f, 0x00, 0x53, 0x65, 0x28, 0x76, 0xb1, 0xe6, 0x61, 0x0d, 0x05, 0x75, 0x41, 0x9f, 0x62, 0x97, + 0xe9, 0x4c, 0x0e, 0x87, 0x63, 0xa0, 0x6f, 0x17, 0xcb, 0xcf, 0xc6, 0x88, 0xfd, 0x84, 0x6f, 0x82, + 0xfc, 0x9e, 0xe5, 0xc6, 0x49, 0x2b, 0xa0, 0x77, 0x67, 0x3d, 0x12, 0x7a, 0x5f, 0xcc, 0xdd, 0x30, + 0xa6, 0xde, 0x37, 0xc0, 0x64, 0xe7, 0x53, 0xe5, 0x8b, 0xb2, 0xe8, 0x17, 0x06, 0x18, 0x6f, 0x3b, + 0x40, 0x3a, 0x18, 0xe3, 0xb6, 0x1a, 0x73, 0xaf, 0x87, 0x27, 0x81, 0xd8, 0x08, 0xbc, 0xa2, 0xd5, + 0x2d, 0xfb, 0x89, 0x01, 0xc6, 0xb2, 0x89, 0xf9, 0x0b, 0xf2, 0x52, 0xe9, 0xbd, 0x1c, 0x98, 0xec, + 0x5c, 0x83, 0x43, 0x4f, 0x75, 0x17, 0x7a, 0xde, 0xa0, 0xe9, 0xd4, 0xb2, 0x7d, 0xc7, 0x00, 0xc3, + 0x6f, 0x2b, 0xb9, 0xe4, 0x6b, 0x66, 0x2f, 0xbb, 0x42, 0xc9, 0xd1, 0x97, 0x32, 0x28, 0xd2, 0x21, + 0x4b, 0xbf, 0x37, 0xc0, 0x44, 0xc7, 0xe3, 0x1c, 0x5e, 0x03, 0x03, 0x96, 0xeb, 0x06, 0xfb, 0xa2, + 0x9b, 0xa7, 0xb5, 0xe5, 0x17, 0x38, 0x15, 0x49, 0xae, 0xe6, 0xb3, 0xdc, 0xe7, 0xe0, 0xb3, 0xd2, + 0x9f, 0x0c, 0x70, 0xe9, 0x41, 0x51, 0xf7, 0x79, 0xaf, 0xe1, 0x2c, 0x28, 0xc8, 0x62, 0xfb, 0x90, + 0xaf, 0x9f, 0xcc, 0xae, 0x32, 0x23, 0xf0, 0xd7, 0x32, 0xe2, 0x57, 0xe9, 0xd7, 0x06, 0x18, 0xab, + 0x62, 0xb2, 0xe7, 0xd4, 0x30, 0xc2, 0xdb, 0x98, 0x60, 0xbf, 0x86, 0xe1, 0x1c, 0x18, 0xe2, 0x5f, + 0x1b, 0x43, 0xab, 0x96, 0x7c, 0x23, 0x19, 0x97, 0x8e, 0x1e, 0xba, 0x9d, 0x30, 0x50, 0x2a, 0xa3, + 0xbe, 0xa7, 0xe4, 0xba, 0x7e, 0x4f, 0xb9, 0x04, 0xfa, 0xc3, 0xb4, 0x01, 0x5c, 0x60, 0x5c, 0xde, + 0xf3, 0xe5, 0x54, 0xce, 0x0d, 0x48, 0xc4, 0xbb, 0x5c, 0x79, 0xc9, 0x0d, 0x48, 0x84, 0x38, 0xb5, + 0xf4, 0x41, 0x0e, 0x9c, 0x6b, 0xcd, 0xcf, 0x0c, 0x90, 0xc4, 0x6e, 0xdb, 0x07, 0x1c, 0xc6, 0x43, + 0x9c, 0xa3, 0xbf, 0x1b, 0xc8, 0x3d, 0xf8, 0xdd, 0x00, 0x7c, 0x09, 0x8c, 0xcb, 0x9f, 0xcb, 0x07, + 0x21, 0xc1, 0x94, 0x7f, 0x99, 0xec, 0x6b, 0x7d, 0xef, 0xb7, 0x96, 0x15, 0x40, 0xed, 0x63, 0xe0, + 0x37, 0x32, 0x6f, 0x1a, 0xae, 0xa6, 0xef, 0x19, 0x58, 0x6d, 0xc7, 0x4b, 0x87, 0x7b, 0x6c, 0xcb, + 0x2f, 0x13, 0x12, 0x90, 0xcc, 0x43, 0x87, 0x39, 0x30, 0xb4, 0xcd, 0x04, 0x78, 0x9f, 0x3c, 0xdf, + 0xea, 0xf4, 0x9b, 0x09, 0x03, 0xa5, 0x32, 0xa5, 0x3f, 0x1b, 0xe0, 0x7c, 0xf2, 0x1a, 0xc8, 0x75, + 0xb0, 0x1f, 0x2d, 0x06, 0xfe, 0xb6, 0x53, 0x87, 0x17, 0x45, 0xff, 0x53, 0x6b, 0x2a, 0x26, 0xbd, + 0x4f, 0x78, 0x1f, 0x0c, 0x52, 0xb1, 0xd8, 0x32, 0x0e, 0x5f, 0x39, 0x7e, 0x1c, 0x66, 0xa3, 0x46, + 0x94, 0x6f, 0x09, 0x35, 0xc1, 0x61, 0xa1, 0x58, 0xb3, 0x2a, 0xb1, 0x6f, 0xcb, 0x1e, 0xf8, 0x88, + 0x08, 0xc5, 0xc5, 0x05, 0x41, 0x43, 0x8a, 0x5b, 0xfa, 0xa7, 0x01, 0xc6, 0xdb, 0x5e, 0x37, 0xc1, + 0x1f, 0x1a, 0x60, 0xa4, 0xa6, 0x4d, 0x4f, 0x6e, 0xe8, 0xb5, 0x93, 0xbf, 0xa0, 0xd2, 0x94, 0x8a, + 0x1a, 0x48, 0xa7, 0xa0, 0x16, 0x50, 0xb8, 0x09, 0xcc, 0x5a, 0xe6, 0x21, 0x61, 0xe6, 0xd3, 0xe4, + 0xa5, 0x66, 0xa3, 0x68, 0x2e, 0x76, 0x91, 0x41, 0x5d, 0x47, 0x57, 0xbe, 0xfb, 0xf1, 0x67, 0xd3, + 0x67, 0x3e, 0xf9, 0x6c, 0xfa, 0xcc, 0xa7, 0x9f, 0x4d, 0x9f, 0x79, 0xa7, 0x39, 0x6d, 0x7c, 0xdc, + 0x9c, 0x36, 0x3e, 0x69, 0x4e, 0x1b, 0x9f, 0x36, 0xa7, 0x8d, 0xbf, 0x35, 0xa7, 0x8d, 0x9f, 0xff, + 0x7d, 0xfa, 0xcc, 0xeb, 0x37, 0x8e, 0xfb, 0x7c, 0xf8, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1d, + 0x01, 0xc1, 0x04, 0x92, 0x2c, 0x00, 0x00, } func (m *ConversionRequest) Marshal() (dAtA []byte, err error) { @@ -2635,16 +2633,6 @@ func (m *ValidationRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.OptionalOldSelf != nil { - i-- - if *m.OptionalOldSelf { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } i -= len(m.FieldPath) copy(dAtA[i:], m.FieldPath) i = encodeVarintGenerated(dAtA, i, uint64(len(m.FieldPath))) @@ -3379,9 +3367,6 @@ func (m *ValidationRule) Size() (n int) { } l = len(m.FieldPath) n += 1 + l + sovGenerated(uint64(l)) - if m.OptionalOldSelf != nil { - n += 2 - } return n } @@ -3860,7 +3845,6 @@ func (this *ValidationRule) String() string { `MessageExpression:` + fmt.Sprintf("%v", this.MessageExpression) + `,`, `Reason:` + valueToStringGenerated(this.Reason) + `,`, `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, - `OptionalOldSelf:` + valueToStringGenerated(this.OptionalOldSelf) + `,`, `}`, }, "") return s @@ -9024,27 +9008,6 @@ func (m *ValidationRule) Unmarshal(dAtA []byte) error { } m.FieldPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OptionalOldSelf", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalOldSelf = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto index 3c39d63a5f2..578d018a7b1 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto @@ -658,18 +658,6 @@ message ValidationRule { // - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with // non-intersecting keys are appended, retaining their partial order. - // - // If `rule` makes use of the `oldSelf` variable it is implicitly a - // `transition rule`. - // - // By default, the `oldSelf` variable is the same type as `self`. - // When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional - // variable whose value() is the same type as `self`. - // See the documentation for the `optionalOldSelf` field for details. - // - // Transition rules by default are applied only on UPDATE requests and are - // skipped if an old value could not be found. You can opt a transition - // rule into unconditional evaluation by setting `optionalOldSelf` to true. optional string rule = 1; // Message represents the message displayed when validation fails. The message is required if the Rule contains @@ -710,24 +698,6 @@ message ValidationRule { // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` // +optional optional string fieldPath = 5; - - // optionalOldSelf is used to opt a transition rule into evaluation - // even when the object is first created, or if the old object is - // missing the value. - // - // When enabled `oldSelf` will be a CEL optional whose value will be - // `None` if there is no old value, or when the object is initially created. - // - // You may check for presence of oldSelf using `oldSelf.hasValue()` and - // unwrap it after checking using `oldSelf.value()`. Check the CEL - // documentation for Optional types for more information: - // https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes - // - // May not be set unless `oldSelf` is used in `rule`. - // - // +featureGate=CRDValidationRatcheting - // +optional - optional bool optionalOldSelf = 6; } // WebhookClientConfig contains the information to make a TLS connection with the webhook. diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go index a81451ad6ef..1c90d464a9d 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go @@ -249,19 +249,6 @@ type ValidationRule struct { // - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with // non-intersecting keys are appended, retaining their partial order. - // - // If `rule` makes use of the `oldSelf` variable it is implicitly a - // `transition rule`. - // - // By default, the `oldSelf` variable is the same type as `self`. - // When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional - // variable whose value() is the same type as `self`. - // See the documentation for the `optionalOldSelf` field for details. - // - // Transition rules by default are applied only on UPDATE requests and are - // skipped if an old value could not be found. You can opt a transition - // rule into unconditional evaluation by setting `optionalOldSelf` to true. - // Rule string `json:"rule" protobuf:"bytes,1,opt,name=rule"` // Message represents the message displayed when validation fails. The message is required if the Rule contains // line breaks. The message must not contain line breaks. @@ -298,24 +285,6 @@ type ValidationRule struct { // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` // +optional FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,5,opt,name=fieldPath"` - - // optionalOldSelf is used to opt a transition rule into evaluation - // even when the object is first created, or if the old object is - // missing the value. - // - // When enabled `oldSelf` will be a CEL optional whose value will be - // `None` if there is no old value, or when the object is initially created. - // - // You may check for presence of oldSelf using `oldSelf.hasValue()` and - // unwrap it after checking using `oldSelf.value()`. Check the CEL - // documentation for Optional types for more information: - // https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes - // - // May not be set unless `oldSelf` is used in `rule`. - // - // +featureGate=CRDValidationRatcheting - // +optional - OptionalOldSelf *bool `json:"optionalOldSelf,omitempty" protobuf:"bytes,6,opt,name=optionalOldSelf"` } // JSON represents any valid JSON value. diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go index 405021bf389..0a82e4d8c3f 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go @@ -1261,7 +1261,6 @@ func autoConvert_v1_ValidationRule_To_apiextensions_ValidationRule(in *Validatio out.MessageExpression = in.MessageExpression out.Reason = (*apiextensions.FieldValueErrorReason)(unsafe.Pointer(in.Reason)) out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) return nil } @@ -1276,7 +1275,6 @@ func autoConvert_apiextensions_ValidationRule_To_v1_ValidationRule(in *apiextens out.MessageExpression = in.MessageExpression out.Reason = (*FieldValueErrorReason)(unsafe.Pointer(in.Reason)) out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) return nil } diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go index bc23fcd86ff..b4347b8db19 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go @@ -619,11 +619,6 @@ func (in *ValidationRule) DeepCopyInto(out *ValidationRule) { *out = new(FieldValueErrorReason) **out = **in } - if in.OptionalOldSelf != nil { - in, out := &in.OptionalOldSelf, &out.OptionalOldSelf - *out = new(bool) - **out = **in - } return } diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go index c81fa6bc31b..981f6adbdbc 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go @@ -785,206 +785,204 @@ func init() { } var fileDescriptor_98a4cc6918394e53 = []byte{ - // 3170 bytes of a gzipped FileDescriptorProto + // 3144 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcd, 0x73, 0x1c, 0x47, - 0xd9, 0xf7, 0xec, 0x6a, 0xa5, 0x55, 0x4b, 0xb6, 0xa4, 0xb6, 0xa5, 0x8c, 0x15, 0x47, 0x2b, 0xaf, - 0xdf, 0xf8, 0x55, 0x12, 0x67, 0x95, 0xf8, 0x4d, 0xde, 0xe4, 0xcd, 0x4b, 0x8a, 0xd2, 0x4a, 0x72, - 0x50, 0x62, 0x59, 0xa2, 0xd7, 0x76, 0x04, 0xf9, 0x1c, 0xed, 0xf4, 0xae, 0x27, 0x9a, 0x9d, 0x19, - 0x77, 0xcf, 0xac, 0xa4, 0x0a, 0x50, 0x7c, 0x54, 0x0a, 0x8a, 0x02, 0x42, 0x91, 0x5c, 0x28, 0xe0, - 0x10, 0x28, 0x2e, 0x1c, 0xe0, 0x00, 0x37, 0xf8, 0x03, 0x72, 0x4c, 0x01, 0x87, 0x1c, 0xa8, 0x85, - 0x2c, 0x57, 0x8e, 0x54, 0x51, 0xa5, 0x13, 0xd5, 0x1f, 0xd3, 0xd3, 0x3b, 0xbb, 0x6b, 0xbb, 0xa2, - 0xdd, 0x98, 0xdb, 0xee, 0xf3, 0xf5, 0x7b, 0xe6, 0xe9, 0xa7, 0x9f, 0x7e, 0xfa, 0x99, 0x01, 0xb5, - 0xbd, 0x67, 0x69, 0xc9, 0xf1, 0x97, 0xf7, 0xa2, 0x5d, 0x4c, 0x3c, 0x1c, 0x62, 0xba, 0xdc, 0xc4, - 0x9e, 0xed, 0x93, 0x65, 0xc9, 0xb0, 0x02, 0x07, 0x1f, 0x84, 0xd8, 0xa3, 0x8e, 0xef, 0xd1, 0xc7, - 0xad, 0xc0, 0xa1, 0x98, 0x34, 0x31, 0x59, 0x0e, 0xf6, 0xea, 0x8c, 0x47, 0x3b, 0x05, 0x96, 0x9b, - 0x4f, 0xee, 0xe2, 0xd0, 0x7a, 0x72, 0xb9, 0x8e, 0x3d, 0x4c, 0xac, 0x10, 0xdb, 0xa5, 0x80, 0xf8, - 0xa1, 0x0f, 0x9f, 0x17, 0xe6, 0x4a, 0x1d, 0xd2, 0x6f, 0x28, 0x73, 0xa5, 0x60, 0xaf, 0xce, 0x78, - 0xb4, 0x53, 0xa0, 0x24, 0xcd, 0xcd, 0x3f, 0x5e, 0x77, 0xc2, 0x5b, 0xd1, 0x6e, 0xa9, 0xea, 0x37, - 0x96, 0xeb, 0x7e, 0xdd, 0x5f, 0xe6, 0x56, 0x77, 0xa3, 0x1a, 0xff, 0xc7, 0xff, 0xf0, 0x5f, 0x02, - 0x6d, 0xfe, 0xa9, 0xc4, 0xf9, 0x86, 0x55, 0xbd, 0xe5, 0x78, 0x98, 0x1c, 0x26, 0x1e, 0x37, 0x70, - 0x68, 0x2d, 0x37, 0xbb, 0x7c, 0x9c, 0x5f, 0xee, 0xa7, 0x45, 0x22, 0x2f, 0x74, 0x1a, 0xb8, 0x4b, - 0xe1, 0x7f, 0xef, 0xa6, 0x40, 0xab, 0xb7, 0x70, 0xc3, 0x4a, 0xeb, 0x15, 0x8f, 0x0c, 0x30, 0xb3, - 0xea, 0x7b, 0x4d, 0x4c, 0xd8, 0x53, 0x22, 0x7c, 0x3b, 0xc2, 0x34, 0x84, 0x65, 0x90, 0x8d, 0x1c, - 0xdb, 0x34, 0x16, 0x8d, 0xa5, 0xf1, 0xf2, 0x13, 0x1f, 0xb6, 0x0a, 0x27, 0xda, 0xad, 0x42, 0xf6, - 0xc6, 0xc6, 0xda, 0x51, 0xab, 0x70, 0xbe, 0x1f, 0x52, 0x78, 0x18, 0x60, 0x5a, 0xba, 0xb1, 0xb1, - 0x86, 0x98, 0x32, 0x7c, 0x01, 0xcc, 0xd8, 0x98, 0x3a, 0x04, 0xdb, 0x2b, 0xdb, 0x1b, 0x37, 0x85, - 0x7d, 0x33, 0xc3, 0x2d, 0x9e, 0x95, 0x16, 0x67, 0xd6, 0xd2, 0x02, 0xa8, 0x5b, 0x07, 0xee, 0x80, - 0x31, 0x7f, 0xf7, 0x2d, 0x5c, 0x0d, 0xa9, 0x99, 0x5d, 0xcc, 0x2e, 0x4d, 0x5c, 0x7e, 0xbc, 0x94, - 0xac, 0xa0, 0x72, 0x81, 0x2f, 0x9b, 0x7c, 0xd8, 0x12, 0xb2, 0xf6, 0xd7, 0xe3, 0x95, 0x2b, 0x4f, - 0x49, 0xb4, 0xb1, 0x2d, 0x61, 0x05, 0xc5, 0xe6, 0x8a, 0xbf, 0xc8, 0x00, 0xa8, 0x3f, 0x3c, 0x0d, - 0x7c, 0x8f, 0xe2, 0x81, 0x3c, 0x3d, 0x05, 0xd3, 0x55, 0x6e, 0x39, 0xc4, 0xb6, 0xc4, 0x35, 0x33, - 0x9f, 0xc6, 0x7b, 0x53, 0xe2, 0x4f, 0xaf, 0xa6, 0xcc, 0xa1, 0x2e, 0x00, 0x78, 0x1d, 0x8c, 0x12, - 0x4c, 0x23, 0x37, 0x34, 0xb3, 0x8b, 0xc6, 0xd2, 0xc4, 0xe5, 0x4b, 0x7d, 0xa1, 0x78, 0x7e, 0xb3, - 0xe4, 0x2b, 0x35, 0x9f, 0x2c, 0x55, 0x42, 0x2b, 0x8c, 0x68, 0xf9, 0x94, 0x44, 0x1a, 0x45, 0xdc, - 0x06, 0x92, 0xb6, 0x8a, 0xdf, 0xc9, 0x80, 0x69, 0x3d, 0x4a, 0x4d, 0x07, 0xef, 0xc3, 0x7d, 0x30, - 0x46, 0x44, 0xb2, 0xf0, 0x38, 0x4d, 0x5c, 0xde, 0x2e, 0x1d, 0x6b, 0x5b, 0x95, 0xba, 0x92, 0xb0, - 0x3c, 0xc1, 0xd6, 0x4c, 0xfe, 0x41, 0x31, 0x1a, 0x7c, 0x1b, 0xe4, 0x89, 0x5c, 0x28, 0x9e, 0x4d, - 0x13, 0x97, 0xbf, 0x38, 0x40, 0x64, 0x61, 0xb8, 0x3c, 0xd9, 0x6e, 0x15, 0xf2, 0xf1, 0x3f, 0xa4, - 0x00, 0x8b, 0xef, 0x65, 0xc0, 0xc2, 0x6a, 0x44, 0x43, 0xbf, 0x81, 0x30, 0xf5, 0x23, 0x52, 0xc5, - 0xab, 0xbe, 0x1b, 0x35, 0xbc, 0x35, 0x5c, 0x73, 0x3c, 0x27, 0x64, 0xd9, 0xba, 0x08, 0x46, 0x3c, - 0xab, 0x81, 0x65, 0xf6, 0x4c, 0xca, 0x98, 0x8e, 0x5c, 0xb3, 0x1a, 0x18, 0x71, 0x0e, 0x93, 0x60, - 0xc9, 0x22, 0xf7, 0x82, 0x92, 0xb8, 0x7e, 0x18, 0x60, 0xc4, 0x39, 0xf0, 0x22, 0x18, 0xad, 0xf9, - 0xa4, 0x61, 0x89, 0x75, 0x1c, 0x4f, 0x56, 0xe6, 0x0a, 0xa7, 0x22, 0xc9, 0x85, 0x4f, 0x83, 0x09, - 0x1b, 0xd3, 0x2a, 0x71, 0x02, 0x06, 0x6d, 0x8e, 0x70, 0xe1, 0xd3, 0x52, 0x78, 0x62, 0x2d, 0x61, - 0x21, 0x5d, 0x0e, 0x5e, 0x02, 0xf9, 0x80, 0x38, 0x3e, 0x71, 0xc2, 0x43, 0x33, 0xb7, 0x68, 0x2c, - 0xe5, 0xca, 0xd3, 0x52, 0x27, 0xbf, 0x2d, 0xe9, 0x48, 0x49, 0xc0, 0x45, 0x90, 0x7f, 0xb1, 0xb2, - 0x75, 0x6d, 0xdb, 0x0a, 0x6f, 0x99, 0xa3, 0x1c, 0x61, 0x84, 0x49, 0x23, 0x45, 0x2d, 0xfe, 0x25, - 0x03, 0xcc, 0x74, 0x54, 0xe2, 0x90, 0xc2, 0x2b, 0x20, 0x4f, 0x43, 0x56, 0x71, 0xea, 0x87, 0x32, - 0x26, 0x8f, 0xc6, 0x60, 0x15, 0x49, 0x3f, 0x6a, 0x15, 0xe6, 0x12, 0x8d, 0x98, 0xca, 0xe3, 0xa1, - 0x74, 0xe1, 0xcf, 0x0c, 0x70, 0x7a, 0x1f, 0xef, 0xde, 0xf2, 0xfd, 0xbd, 0x55, 0xd7, 0xc1, 0x5e, - 0xb8, 0xea, 0x7b, 0x35, 0xa7, 0x2e, 0x73, 0x00, 0x1d, 0x33, 0x07, 0x5e, 0xee, 0xb6, 0x5c, 0x7e, - 0xa0, 0xdd, 0x2a, 0x9c, 0xee, 0xc1, 0x40, 0xbd, 0xfc, 0x80, 0x3b, 0xc0, 0xac, 0xa6, 0x36, 0x89, - 0x2c, 0x60, 0xa2, 0x6c, 0x8d, 0x97, 0xcf, 0xb5, 0x5b, 0x05, 0x73, 0xb5, 0x8f, 0x0c, 0xea, 0xab, - 0x5d, 0xfc, 0x56, 0x36, 0x1d, 0x5e, 0x2d, 0xdd, 0xde, 0x04, 0x79, 0xb6, 0x8d, 0x6d, 0x2b, 0xb4, - 0xe4, 0x46, 0x7c, 0xe2, 0xde, 0x36, 0xbd, 0xa8, 0x19, 0x9b, 0x38, 0xb4, 0xca, 0x50, 0x2e, 0x08, - 0x48, 0x68, 0x48, 0x59, 0x85, 0x5f, 0x05, 0x23, 0x34, 0xc0, 0x55, 0x19, 0xe8, 0x57, 0x8e, 0xbb, - 0xd9, 0xfa, 0x3c, 0x48, 0x25, 0xc0, 0xd5, 0x64, 0x2f, 0xb0, 0x7f, 0x88, 0xc3, 0xc2, 0x77, 0x0c, - 0x30, 0x4a, 0x79, 0x81, 0x92, 0x45, 0xed, 0xb5, 0x61, 0x79, 0x90, 0xaa, 0x82, 0xe2, 0x3f, 0x92, - 0xe0, 0xc5, 0x7f, 0x66, 0xc0, 0xf9, 0x7e, 0xaa, 0xab, 0xbe, 0x67, 0x8b, 0xe5, 0xd8, 0x90, 0x7b, - 0x5b, 0x64, 0xfa, 0xd3, 0xfa, 0xde, 0x3e, 0x6a, 0x15, 0x1e, 0xbe, 0xab, 0x01, 0xad, 0x08, 0xfc, - 0x9f, 0x7a, 0x6e, 0x51, 0x28, 0xce, 0x77, 0x3a, 0x76, 0xd4, 0x2a, 0x4c, 0x29, 0xb5, 0x4e, 0x5f, - 0x61, 0x13, 0x40, 0xd7, 0xa2, 0xe1, 0x75, 0x62, 0x79, 0x54, 0x98, 0x75, 0x1a, 0x58, 0x86, 0xef, - 0xd1, 0x7b, 0x4b, 0x0f, 0xa6, 0x51, 0x9e, 0x97, 0x90, 0xf0, 0x6a, 0x97, 0x35, 0xd4, 0x03, 0x81, - 0xd5, 0x2d, 0x82, 0x2d, 0xaa, 0x4a, 0x91, 0x76, 0xa2, 0x30, 0x2a, 0x92, 0x5c, 0xf8, 0x08, 0x18, - 0x6b, 0x60, 0x4a, 0xad, 0x3a, 0xe6, 0xf5, 0x67, 0x3c, 0x39, 0xa2, 0x37, 0x05, 0x19, 0xc5, 0x7c, - 0xd6, 0x9f, 0x9c, 0xeb, 0x17, 0xb5, 0xab, 0x0e, 0x0d, 0xe1, 0xab, 0x5d, 0x1b, 0xa0, 0x74, 0x6f, - 0x4f, 0xc8, 0xb4, 0x79, 0xfa, 0xab, 0xe2, 0x17, 0x53, 0xb4, 0xe4, 0xff, 0x0a, 0xc8, 0x39, 0x21, - 0x6e, 0xc4, 0x67, 0xf7, 0xcb, 0x43, 0xca, 0xbd, 0xf2, 0x49, 0xe9, 0x43, 0x6e, 0x83, 0xa1, 0x21, - 0x01, 0x5a, 0xfc, 0x65, 0x06, 0x3c, 0xd4, 0x4f, 0x85, 0x1d, 0x28, 0x94, 0x45, 0x3c, 0x70, 0x23, - 0x62, 0xb9, 0x32, 0xe3, 0x54, 0xc4, 0xb7, 0x39, 0x15, 0x49, 0x2e, 0x2b, 0xf9, 0xd4, 0xf1, 0xea, - 0x91, 0x6b, 0x11, 0x99, 0x4e, 0xea, 0xa9, 0x2b, 0x92, 0x8e, 0x94, 0x04, 0x2c, 0x01, 0x40, 0x6f, - 0xf9, 0x24, 0xe4, 0x18, 0xb2, 0x7a, 0x9d, 0x62, 0x05, 0xa2, 0xa2, 0xa8, 0x48, 0x93, 0x60, 0x27, - 0xda, 0x9e, 0xe3, 0xd9, 0x72, 0xd5, 0xd5, 0x2e, 0x7e, 0xc9, 0xf1, 0x6c, 0xc4, 0x39, 0x0c, 0xdf, - 0x75, 0x68, 0xc8, 0x28, 0x72, 0xc9, 0x3b, 0xa2, 0xce, 0x25, 0x95, 0x04, 0xc3, 0xaf, 0xb2, 0xaa, - 0xef, 0x13, 0x07, 0x53, 0x73, 0x34, 0xc1, 0x5f, 0x55, 0x54, 0xa4, 0x49, 0x14, 0xff, 0x91, 0xef, - 0x9f, 0x24, 0xac, 0x94, 0xc0, 0x0b, 0x20, 0x57, 0x27, 0x7e, 0x14, 0xc8, 0x28, 0xa9, 0x68, 0xbf, - 0xc0, 0x88, 0x48, 0xf0, 0x58, 0x56, 0x36, 0x3b, 0xda, 0x54, 0x95, 0x95, 0x71, 0x73, 0x1a, 0xf3, - 0xe1, 0x37, 0x0c, 0x90, 0xf3, 0x64, 0x70, 0x58, 0xca, 0xbd, 0x3a, 0xa4, 0xbc, 0xe0, 0xe1, 0x4d, - 0xdc, 0x15, 0x91, 0x17, 0xc8, 0xf0, 0x29, 0x90, 0xa3, 0x55, 0x3f, 0xc0, 0x32, 0xea, 0x0b, 0xb1, - 0x50, 0x85, 0x11, 0x8f, 0x5a, 0x85, 0x93, 0xb1, 0x39, 0x4e, 0x40, 0x42, 0x18, 0x7e, 0xdb, 0x00, - 0xa0, 0x69, 0xb9, 0x8e, 0x6d, 0xf1, 0x96, 0x21, 0xc7, 0xdd, 0x1f, 0x6c, 0x5a, 0xdf, 0x54, 0xe6, - 0xc5, 0xa2, 0x25, 0xff, 0x91, 0x06, 0x0d, 0xdf, 0x35, 0xc0, 0x24, 0x8d, 0x76, 0x89, 0xd4, 0xa2, - 0xbc, 0xb9, 0x98, 0xb8, 0xfc, 0xa5, 0x81, 0xfa, 0x52, 0xd1, 0x00, 0xca, 0xd3, 0xed, 0x56, 0x61, - 0x52, 0xa7, 0xa0, 0x0e, 0x07, 0xe0, 0xf7, 0x0c, 0x90, 0x6f, 0xc6, 0x67, 0xf6, 0x18, 0xdf, 0xf0, - 0xaf, 0x0f, 0x69, 0x61, 0x65, 0x46, 0x25, 0xbb, 0x40, 0xf5, 0x01, 0xca, 0x03, 0xf8, 0x7b, 0x03, - 0x98, 0x96, 0x2d, 0x0a, 0xbc, 0xe5, 0x6e, 0x13, 0xc7, 0x0b, 0x31, 0x11, 0xfd, 0x26, 0x35, 0xf3, - 0xdc, 0xbd, 0xc1, 0x9e, 0x85, 0xe9, 0x5e, 0xb6, 0xbc, 0x28, 0xbd, 0x33, 0x57, 0xfa, 0xb8, 0x81, - 0xfa, 0x3a, 0xc8, 0x13, 0x2d, 0x69, 0x69, 0xcc, 0xf1, 0x21, 0x24, 0x5a, 0xd2, 0x4b, 0xc9, 0xea, - 0x90, 0x74, 0x50, 0x1a, 0x34, 0xdc, 0x02, 0xb3, 0x01, 0xc1, 0x1c, 0xe0, 0x86, 0xb7, 0xe7, 0xf9, - 0xfb, 0xde, 0x15, 0x07, 0xbb, 0x36, 0x35, 0xc1, 0xa2, 0xb1, 0x94, 0x2f, 0x9f, 0x6d, 0xb7, 0x0a, - 0xb3, 0xdb, 0xbd, 0x04, 0x50, 0x6f, 0xbd, 0xe2, 0xbb, 0xd9, 0xf4, 0x2d, 0x20, 0xdd, 0x45, 0xc0, - 0xf7, 0xc5, 0xd3, 0x8b, 0xd8, 0x50, 0xd3, 0xe0, 0xab, 0xf5, 0xe6, 0x90, 0x92, 0x49, 0xb5, 0x01, - 0x49, 0x27, 0xa7, 0x48, 0x14, 0x69, 0x7e, 0xc0, 0x1f, 0x1b, 0xe0, 0xa4, 0x55, 0xad, 0xe2, 0x20, - 0xc4, 0xb6, 0x28, 0xee, 0x99, 0xcf, 0xa0, 0x7e, 0xcd, 0x4a, 0xaf, 0x4e, 0xae, 0xe8, 0xd0, 0xa8, - 0xd3, 0x13, 0xf8, 0x1c, 0x38, 0x45, 0x43, 0x9f, 0x60, 0x3b, 0xd5, 0x36, 0xc3, 0x76, 0xab, 0x70, - 0xaa, 0xd2, 0xc1, 0x41, 0x29, 0xc9, 0xe2, 0x5f, 0x73, 0xa0, 0x70, 0x97, 0xad, 0x76, 0x0f, 0x17, - 0xb3, 0x8b, 0x60, 0x94, 0x3f, 0xae, 0xcd, 0xa3, 0x92, 0xd7, 0x5a, 0x41, 0x4e, 0x45, 0x92, 0xcb, - 0x0e, 0x0a, 0x86, 0xcf, 0xda, 0x97, 0x2c, 0x17, 0x54, 0x07, 0x45, 0x45, 0x90, 0x51, 0xcc, 0x87, - 0x97, 0x01, 0xb0, 0x71, 0x40, 0x30, 0x3b, 0xac, 0x6c, 0x73, 0x8c, 0x4b, 0xab, 0x45, 0x5a, 0x53, - 0x1c, 0xa4, 0x49, 0xc1, 0x2b, 0x00, 0xc6, 0xff, 0x1c, 0xdf, 0x7b, 0xd9, 0x22, 0x9e, 0xe3, 0xd5, - 0xcd, 0x3c, 0x77, 0x7b, 0x8e, 0x75, 0x63, 0x6b, 0x5d, 0x5c, 0xd4, 0x43, 0x03, 0xbe, 0x0d, 0x46, - 0xc5, 0xd0, 0x87, 0x9f, 0x10, 0x43, 0xac, 0xf2, 0x80, 0xc7, 0x88, 0x43, 0x21, 0x09, 0xd9, 0x5d, - 0xdd, 0x73, 0xf7, 0xbb, 0xba, 0xdf, 0xb1, 0x9c, 0x8e, 0xfe, 0x87, 0x97, 0xd3, 0xe2, 0xbf, 0x8c, - 0x74, 0xcd, 0xd1, 0x1e, 0xb5, 0x52, 0xb5, 0x5c, 0x0c, 0xd7, 0xc0, 0x34, 0xbb, 0x31, 0x21, 0x1c, - 0xb8, 0x4e, 0xd5, 0xa2, 0xfc, 0xc2, 0x2e, 0x92, 0x5d, 0xcd, 0x90, 0x2a, 0x29, 0x3e, 0xea, 0xd2, - 0x80, 0x2f, 0x02, 0x28, 0x6e, 0x11, 0x1d, 0x76, 0x44, 0x43, 0xa4, 0xee, 0x03, 0x95, 0x2e, 0x09, - 0xd4, 0x43, 0x0b, 0xae, 0x82, 0x19, 0xd7, 0xda, 0xc5, 0x6e, 0x05, 0xbb, 0xb8, 0x1a, 0xfa, 0x84, - 0x9b, 0x12, 0x23, 0x8d, 0xd9, 0x76, 0xab, 0x30, 0x73, 0x35, 0xcd, 0x44, 0xdd, 0xf2, 0xc5, 0xf3, - 0xe9, 0xad, 0xad, 0x3f, 0xb8, 0xb8, 0x9b, 0x7d, 0x90, 0x01, 0xf3, 0xfd, 0x33, 0x03, 0x7e, 0x33, - 0xb9, 0x42, 0x8a, 0x1b, 0xc2, 0xeb, 0xc3, 0xca, 0x42, 0x79, 0x87, 0x04, 0xdd, 0xf7, 0x47, 0xf8, - 0x35, 0xd6, 0xae, 0x59, 0x6e, 0x3c, 0xb4, 0x7a, 0x6d, 0x68, 0x2e, 0x30, 0x90, 0xf2, 0xb8, 0xe8, - 0x04, 0x2d, 0x97, 0x37, 0x7e, 0x96, 0x8b, 0x8b, 0xbf, 0x32, 0xd2, 0x53, 0x84, 0x64, 0x07, 0xc3, - 0xef, 0x1b, 0x60, 0xca, 0x0f, 0xb0, 0xb7, 0xb2, 0xbd, 0x71, 0xf3, 0x7f, 0xc4, 0x4e, 0x96, 0xa1, - 0xba, 0x76, 0x4c, 0x3f, 0x5f, 0xac, 0x6c, 0x5d, 0x13, 0x06, 0xb7, 0x89, 0x1f, 0xd0, 0xf2, 0xe9, - 0x76, 0xab, 0x30, 0xb5, 0xd5, 0x09, 0x85, 0xd2, 0xd8, 0xc5, 0x06, 0x98, 0x5d, 0x3f, 0x08, 0x31, - 0xf1, 0x2c, 0x77, 0xcd, 0xaf, 0x46, 0x0d, 0xec, 0x85, 0xc2, 0xd1, 0xd4, 0xc4, 0xcb, 0xb8, 0xc7, - 0x89, 0xd7, 0x43, 0x20, 0x1b, 0x11, 0x57, 0x66, 0xf1, 0x84, 0x9a, 0xe8, 0xa2, 0xab, 0x88, 0xd1, - 0x8b, 0xe7, 0xc1, 0x08, 0xf3, 0x13, 0x9e, 0x05, 0x59, 0x62, 0xed, 0x73, 0xab, 0x93, 0xe5, 0x31, - 0x26, 0x82, 0xac, 0x7d, 0xc4, 0x68, 0xc5, 0x3f, 0x9f, 0x07, 0x53, 0xa9, 0x67, 0x81, 0xf3, 0x20, - 0xa3, 0xc6, 0xc4, 0x40, 0x1a, 0xcd, 0x6c, 0xac, 0xa1, 0x8c, 0x63, 0xc3, 0x67, 0x54, 0xf1, 0x15, - 0xa0, 0x05, 0x75, 0x96, 0x70, 0x2a, 0xeb, 0xcf, 0x13, 0x73, 0xcc, 0x91, 0xb8, 0x70, 0x32, 0x1f, - 0x70, 0x4d, 0xee, 0x12, 0xe1, 0x03, 0xae, 0x21, 0x46, 0xfb, 0xb4, 0xe3, 0xbe, 0x78, 0xde, 0x98, - 0xbb, 0x87, 0x79, 0xe3, 0xe8, 0x1d, 0xe7, 0x8d, 0x17, 0x40, 0x2e, 0x74, 0x42, 0x17, 0xf3, 0x83, - 0x4c, 0xbb, 0x46, 0x5d, 0x67, 0x44, 0x24, 0x78, 0xf0, 0x2d, 0x30, 0x66, 0xe3, 0x9a, 0x15, 0xb9, - 0x21, 0x3f, 0xb3, 0x26, 0x2e, 0xaf, 0x0e, 0x20, 0x85, 0xc4, 0x30, 0x78, 0x4d, 0xd8, 0x45, 0x31, - 0x00, 0x7c, 0x18, 0x8c, 0x35, 0xac, 0x03, 0xa7, 0x11, 0x35, 0x78, 0x83, 0x69, 0x08, 0xb1, 0x4d, - 0x41, 0x42, 0x31, 0x8f, 0x55, 0x46, 0x7c, 0x50, 0x75, 0x23, 0xea, 0x34, 0xb1, 0x64, 0xca, 0xe6, - 0x4f, 0x55, 0xc6, 0xf5, 0x14, 0x1f, 0x75, 0x69, 0x70, 0x30, 0xc7, 0xe3, 0xca, 0x13, 0x1a, 0x98, - 0x20, 0xa1, 0x98, 0xd7, 0x09, 0x26, 0xe5, 0x27, 0xfb, 0x81, 0x49, 0xe5, 0x2e, 0x0d, 0xf8, 0x18, - 0x18, 0x6f, 0x58, 0x07, 0x57, 0xb1, 0x57, 0x0f, 0x6f, 0x99, 0x27, 0x17, 0x8d, 0xa5, 0x6c, 0xf9, - 0x64, 0xbb, 0x55, 0x18, 0xdf, 0x8c, 0x89, 0x28, 0xe1, 0x73, 0x61, 0xc7, 0x93, 0xc2, 0xa7, 0x34, - 0xe1, 0x98, 0x88, 0x12, 0x3e, 0xeb, 0x5e, 0x02, 0x2b, 0x64, 0x9b, 0xcb, 0x9c, 0xea, 0xbc, 0xe6, - 0x6e, 0x0b, 0x32, 0x8a, 0xf9, 0x70, 0x09, 0xe4, 0x1b, 0xd6, 0x01, 0x1f, 0x49, 0x98, 0xd3, 0xdc, - 0x2c, 0x1f, 0x8c, 0x6f, 0x4a, 0x1a, 0x52, 0x5c, 0x2e, 0xe9, 0x78, 0x42, 0x72, 0x46, 0x93, 0x94, - 0x34, 0xa4, 0xb8, 0x2c, 0x89, 0x23, 0xcf, 0xb9, 0x1d, 0x61, 0x21, 0x0c, 0x79, 0x64, 0x54, 0x12, - 0xdf, 0x48, 0x58, 0x48, 0x97, 0x83, 0x25, 0x00, 0x1a, 0x91, 0x1b, 0x3a, 0x81, 0x8b, 0xb7, 0x6a, - 0xe6, 0x69, 0x1e, 0x7f, 0xde, 0xf4, 0x6f, 0x2a, 0x2a, 0xd2, 0x24, 0x20, 0x06, 0x23, 0xd8, 0x8b, - 0x1a, 0xe6, 0x19, 0x7e, 0xb0, 0x0f, 0x24, 0x05, 0xd5, 0xce, 0x59, 0xf7, 0xa2, 0x06, 0xe2, 0xe6, - 0xe1, 0x33, 0xe0, 0x64, 0xc3, 0x3a, 0x60, 0xe5, 0x00, 0x93, 0xd0, 0xc1, 0xd4, 0x9c, 0xe5, 0x0f, - 0x3f, 0xc3, 0xba, 0xdd, 0x4d, 0x9d, 0x81, 0x3a, 0xe5, 0xb8, 0xa2, 0xe3, 0x69, 0x8a, 0x73, 0x9a, - 0xa2, 0xce, 0x40, 0x9d, 0x72, 0x2c, 0xd2, 0x04, 0xdf, 0x8e, 0x1c, 0x82, 0x6d, 0xf3, 0x01, 0xde, - 0x20, 0xcb, 0x97, 0x15, 0x82, 0x86, 0x14, 0x17, 0x36, 0xe3, 0xd9, 0x95, 0xc9, 0xb7, 0xe1, 0x8d, - 0xc1, 0x56, 0xf2, 0x2d, 0xb2, 0x42, 0x88, 0x75, 0x28, 0x4e, 0x1a, 0x7d, 0x6a, 0x05, 0x29, 0xc8, - 0x59, 0xae, 0xbb, 0x55, 0x33, 0xcf, 0xf2, 0xd8, 0x0f, 0xfa, 0x04, 0x51, 0x55, 0x67, 0x85, 0x81, - 0x20, 0x81, 0xc5, 0x40, 0x7d, 0x8f, 0xa5, 0xc6, 0xfc, 0x70, 0x41, 0xb7, 0x18, 0x08, 0x12, 0x58, - 0xfc, 0x49, 0xbd, 0xc3, 0xad, 0x9a, 0xf9, 0xe0, 0x90, 0x9f, 0x94, 0x81, 0x20, 0x81, 0x05, 0x1d, - 0x90, 0xf5, 0xfc, 0xd0, 0x3c, 0x37, 0x94, 0xe3, 0x99, 0x1f, 0x38, 0xd7, 0xfc, 0x10, 0x31, 0x0c, - 0xf8, 0x23, 0x03, 0x80, 0x20, 0x49, 0xd1, 0x87, 0x06, 0x32, 0x12, 0x49, 0x41, 0x96, 0x92, 0xdc, - 0x5e, 0xf7, 0x42, 0x72, 0x98, 0x5c, 0x8f, 0xb4, 0x3d, 0xa0, 0x79, 0x01, 0x7f, 0x6e, 0x80, 0x33, - 0x7a, 0x9b, 0xac, 0xdc, 0x5b, 0xe0, 0x11, 0xb9, 0x3e, 0xe8, 0x34, 0x2f, 0xfb, 0xbe, 0x5b, 0x36, - 0xdb, 0xad, 0xc2, 0x99, 0x95, 0x1e, 0xa8, 0xa8, 0xa7, 0x2f, 0xf0, 0xd7, 0x06, 0x98, 0x91, 0x55, - 0x54, 0xf3, 0xb0, 0xc0, 0x03, 0x88, 0x07, 0x1d, 0xc0, 0x34, 0x8e, 0x88, 0xa3, 0x7a, 0xc9, 0xde, - 0xc5, 0x47, 0xdd, 0xae, 0xc1, 0xdf, 0x19, 0x60, 0xd2, 0xc6, 0x01, 0xf6, 0x6c, 0xec, 0x55, 0x99, - 0xaf, 0x8b, 0x03, 0x19, 0x59, 0xa4, 0x7d, 0x5d, 0xd3, 0x20, 0x84, 0x9b, 0x25, 0xe9, 0xe6, 0xa4, - 0xce, 0x3a, 0x6a, 0x15, 0xe6, 0x12, 0x55, 0x9d, 0x83, 0x3a, 0xbc, 0x84, 0xef, 0x19, 0x60, 0x2a, - 0x59, 0x00, 0x71, 0xa4, 0x9c, 0x1f, 0x62, 0x1e, 0xf0, 0xf6, 0x75, 0xa5, 0x13, 0x10, 0xa5, 0x3d, - 0x80, 0xbf, 0x31, 0x58, 0xa7, 0x16, 0xdf, 0xfb, 0xa8, 0x59, 0xe4, 0xb1, 0x7c, 0x63, 0xe0, 0xb1, - 0x54, 0x08, 0x22, 0x94, 0x97, 0x92, 0x56, 0x50, 0x71, 0x8e, 0x5a, 0x85, 0x59, 0x3d, 0x92, 0x8a, - 0x81, 0x74, 0x0f, 0xe1, 0x77, 0x0d, 0x30, 0x89, 0x93, 0x8e, 0x9b, 0x9a, 0x17, 0x06, 0x12, 0xc4, - 0x9e, 0x4d, 0xbc, 0xb8, 0xa9, 0x6b, 0x2c, 0x8a, 0x3a, 0xb0, 0x59, 0x07, 0x89, 0x0f, 0xac, 0x46, - 0xe0, 0x62, 0xf3, 0xbf, 0x06, 0xdc, 0x41, 0xae, 0x0b, 0xbb, 0x28, 0x06, 0x80, 0x97, 0x40, 0xde, - 0x8b, 0x5c, 0xd7, 0xda, 0x75, 0xb1, 0xf9, 0x30, 0xef, 0x45, 0xd4, 0x48, 0xf6, 0x9a, 0xa4, 0x23, - 0x25, 0x01, 0x6b, 0x60, 0xf1, 0xe0, 0x25, 0xf5, 0x79, 0x52, 0xcf, 0xa1, 0xa1, 0x79, 0x91, 0x5b, - 0x99, 0x6f, 0xb7, 0x0a, 0x73, 0x3b, 0xbd, 0xc7, 0x8a, 0x77, 0xb5, 0x01, 0x5f, 0x01, 0x0f, 0x6a, - 0x32, 0xeb, 0x8d, 0x5d, 0x6c, 0xdb, 0xd8, 0x8e, 0x2f, 0x6e, 0xe6, 0x7f, 0x8b, 0xc1, 0x65, 0xbc, - 0xc1, 0x77, 0xd2, 0x02, 0xe8, 0x4e, 0xda, 0xf0, 0x2a, 0x98, 0xd3, 0xd8, 0x1b, 0x5e, 0xb8, 0x45, - 0x2a, 0x21, 0x71, 0xbc, 0xba, 0xb9, 0xc4, 0xed, 0x9e, 0x89, 0x77, 0xe4, 0x8e, 0xc6, 0x43, 0x7d, - 0x74, 0xe0, 0x17, 0x3a, 0xac, 0xf1, 0x57, 0x68, 0x56, 0xf0, 0x12, 0x3e, 0xa4, 0xe6, 0x23, 0xbc, - 0x3b, 0xe1, 0x8b, 0xbd, 0xa3, 0xd1, 0x51, 0x1f, 0x79, 0xf8, 0x79, 0x70, 0x3a, 0xc5, 0x61, 0x57, - 0x14, 0xf3, 0x51, 0x71, 0xd7, 0x60, 0xfd, 0xec, 0x4e, 0x4c, 0x44, 0xbd, 0x24, 0xe1, 0xe7, 0x00, - 0xd4, 0xc8, 0x9b, 0x56, 0xc0, 0xf5, 0x1f, 0x13, 0xd7, 0x1e, 0xb6, 0xa2, 0x3b, 0x92, 0x86, 0x7a, - 0xc8, 0xc1, 0x9f, 0x18, 0x1d, 0x4f, 0x92, 0xdc, 0x8e, 0xa9, 0x79, 0x89, 0xef, 0xdf, 0xcd, 0x63, - 0x66, 0xa1, 0xf6, 0x1e, 0x24, 0x72, 0xb1, 0x16, 0x66, 0x0d, 0x0a, 0xf5, 0x71, 0x61, 0x9e, 0xdd, - 0xd0, 0x53, 0x15, 0x1e, 0x4e, 0x83, 0xec, 0x1e, 0x96, 0x5f, 0x55, 0x20, 0xf6, 0x13, 0xda, 0x20, - 0xd7, 0xb4, 0xdc, 0x28, 0x1e, 0x32, 0x0c, 0xb8, 0x3b, 0x40, 0xc2, 0xf8, 0x73, 0x99, 0x67, 0x8d, - 0xf9, 0xf7, 0x0d, 0x30, 0xd7, 0xfb, 0xe0, 0xb9, 0xaf, 0x6e, 0xfd, 0xd4, 0x00, 0x33, 0x5d, 0x67, - 0x4c, 0x0f, 0x8f, 0x6e, 0x77, 0x7a, 0xf4, 0xca, 0xa0, 0x0f, 0x0b, 0xb1, 0x39, 0x78, 0x87, 0xac, - 0xbb, 0xf7, 0x03, 0x03, 0x4c, 0xa7, 0xcb, 0xf6, 0xfd, 0x8c, 0x57, 0xf1, 0xfd, 0x0c, 0x98, 0xeb, - 0xdd, 0xd8, 0x43, 0xa2, 0x26, 0x18, 0xc3, 0x99, 0x04, 0xf5, 0x9a, 0x1a, 0xbf, 0x63, 0x80, 0x89, - 0xb7, 0x94, 0x5c, 0xfc, 0xd6, 0x7d, 0xe0, 0x33, 0xa8, 0xf8, 0x9c, 0x4c, 0x18, 0x14, 0xe9, 0xb8, - 0xc5, 0xdf, 0x1a, 0x60, 0xb6, 0x67, 0x03, 0x00, 0x2f, 0x82, 0x51, 0xcb, 0x75, 0xfd, 0x7d, 0x31, - 0x4a, 0xd4, 0xde, 0x11, 0xac, 0x70, 0x2a, 0x92, 0x5c, 0x2d, 0x7a, 0x99, 0xcf, 0x2a, 0x7a, 0xc5, - 0x3f, 0x18, 0xe0, 0xdc, 0x9d, 0x32, 0xf1, 0xbe, 0x2c, 0xe9, 0x12, 0xc8, 0xcb, 0xe6, 0xfd, 0x90, - 0x2f, 0xa7, 0x2c, 0xc5, 0xb2, 0x68, 0xf0, 0x0f, 0xcd, 0xc4, 0xaf, 0xe2, 0x07, 0x06, 0x98, 0xae, - 0x60, 0xd2, 0x74, 0xaa, 0x18, 0xe1, 0x1a, 0x26, 0xd8, 0xab, 0x62, 0xb8, 0x0c, 0xc6, 0xf9, 0xeb, - 0xee, 0xc0, 0xaa, 0xc6, 0xaf, 0x6e, 0x66, 0x64, 0xc8, 0xc7, 0xaf, 0xc5, 0x0c, 0x94, 0xc8, 0xa8, - 0xd7, 0x3c, 0x99, 0xbe, 0xaf, 0x79, 0xce, 0x81, 0x91, 0x20, 0x19, 0x44, 0xe7, 0x19, 0x97, 0xcf, - 0x9e, 0x39, 0x95, 0x73, 0x7d, 0x12, 0xf2, 0xe9, 0x5a, 0x4e, 0x72, 0x7d, 0x12, 0x22, 0x4e, 0x2d, - 0xfe, 0x29, 0x03, 0x4e, 0x75, 0xd6, 0x71, 0x06, 0x48, 0x22, 0xb7, 0xeb, 0xbd, 0x12, 0xe3, 0x21, - 0xce, 0xd1, 0x3f, 0x77, 0xc9, 0xdc, 0xf9, 0x73, 0x17, 0xf8, 0x02, 0x98, 0x91, 0x3f, 0xd7, 0x0f, - 0x02, 0x82, 0x29, 0x7f, 0x77, 0x9a, 0xed, 0xfc, 0x68, 0x76, 0x33, 0x2d, 0x80, 0xba, 0x75, 0xe0, - 0xff, 0xa7, 0x3e, 0xc5, 0xb9, 0x90, 0x7c, 0x86, 0xc3, 0x5a, 0x42, 0xde, 0x67, 0xdc, 0x64, 0x65, - 0x60, 0x9d, 0x10, 0x9f, 0xa4, 0xbe, 0xcf, 0x59, 0x06, 0xe3, 0x35, 0x26, 0xc0, 0xe7, 0xf5, 0xb9, - 0xce, 0xa0, 0x5f, 0x89, 0x19, 0x28, 0x91, 0x81, 0xcf, 0x83, 0x29, 0x3f, 0x10, 0x1d, 0xf0, 0x96, - 0x6b, 0x57, 0xb0, 0x5b, 0xe3, 0x93, 0xc4, 0x7c, 0x3c, 0xee, 0xed, 0x60, 0xa1, 0xb4, 0x6c, 0xf1, - 0x8f, 0x06, 0xe8, 0xf5, 0xa1, 0x1d, 0x3c, 0x2b, 0xc6, 0xb6, 0xda, 0x2c, 0x34, 0x1e, 0xd9, 0xc2, - 0x26, 0x18, 0xa3, 0x22, 0x57, 0x64, 0x2e, 0x6f, 0x1d, 0x33, 0x97, 0xd3, 0x99, 0x27, 0xfa, 0xc5, - 0x98, 0x1a, 0x83, 0xb1, 0x74, 0xae, 0x5a, 0xe5, 0xc8, 0xb3, 0xe5, 0x24, 0x7f, 0x52, 0xa4, 0xf3, - 0xea, 0x8a, 0xa0, 0x21, 0xc5, 0x2d, 0x57, 0x3f, 0xfc, 0x64, 0xe1, 0xc4, 0x47, 0x9f, 0x2c, 0x9c, - 0xf8, 0xf8, 0x93, 0x85, 0x13, 0x5f, 0x6f, 0x2f, 0x18, 0x1f, 0xb6, 0x17, 0x8c, 0x8f, 0xda, 0x0b, - 0xc6, 0xc7, 0xed, 0x05, 0xe3, 0x6f, 0xed, 0x05, 0xe3, 0x87, 0x7f, 0x5f, 0x38, 0xf1, 0xe5, 0xe7, - 0x8f, 0xf5, 0x6d, 0xfb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x16, 0x56, 0x59, 0x35, 0x34, 0x2f, - 0x00, 0x00, + 0xd9, 0xf7, 0xec, 0x6a, 0xa5, 0x55, 0x4b, 0xb6, 0xa5, 0xb6, 0xa5, 0x8c, 0x15, 0x47, 0x2b, 0xaf, + 0xdf, 0xf8, 0x55, 0x12, 0x67, 0x95, 0xf8, 0x4d, 0xde, 0x84, 0x40, 0x8a, 0xd2, 0x4a, 0x72, 0x50, + 0x62, 0x59, 0xa2, 0xd7, 0x76, 0x04, 0xf9, 0x1c, 0xed, 0xf4, 0xae, 0x26, 0x9a, 0x9d, 0x19, 0x77, + 0xcf, 0xac, 0xa4, 0x0a, 0x50, 0x7c, 0x54, 0x0a, 0x8a, 0x02, 0x42, 0x91, 0x5c, 0x28, 0xe0, 0x10, + 0x28, 0x2e, 0x1c, 0xe0, 0x00, 0x37, 0xf8, 0x03, 0x72, 0x4c, 0x51, 0x1c, 0x72, 0xa0, 0x16, 0xb2, + 0x5c, 0x39, 0x52, 0x45, 0x95, 0x4e, 0x54, 0x7f, 0x4c, 0x4f, 0xef, 0xec, 0xae, 0xed, 0x8a, 0x76, + 0x63, 0x6e, 0xbb, 0xcf, 0xd7, 0xef, 0x99, 0xa7, 0x9f, 0x7e, 0xfa, 0xe9, 0x67, 0x06, 0xd4, 0xf6, + 0x9e, 0xa5, 0x25, 0xc7, 0x5f, 0xda, 0x8b, 0x76, 0x30, 0xf1, 0x70, 0x88, 0xe9, 0x52, 0x13, 0x7b, + 0xb6, 0x4f, 0x96, 0x24, 0xc3, 0x0a, 0x1c, 0x7c, 0x10, 0x62, 0x8f, 0x3a, 0xbe, 0x47, 0x1f, 0xb7, + 0x02, 0x87, 0x62, 0xd2, 0xc4, 0x64, 0x29, 0xd8, 0xab, 0x33, 0x1e, 0xed, 0x14, 0x58, 0x6a, 0x3e, + 0xb9, 0x83, 0x43, 0xeb, 0xc9, 0xa5, 0x3a, 0xf6, 0x30, 0xb1, 0x42, 0x6c, 0x97, 0x02, 0xe2, 0x87, + 0x3e, 0x7c, 0x5e, 0x98, 0x2b, 0x75, 0x48, 0xbf, 0xa1, 0xcc, 0x95, 0x82, 0xbd, 0x3a, 0xe3, 0xd1, + 0x4e, 0x81, 0x92, 0x34, 0x37, 0xf7, 0x78, 0xdd, 0x09, 0x77, 0xa3, 0x9d, 0x52, 0xd5, 0x6f, 0x2c, + 0xd5, 0xfd, 0xba, 0xbf, 0xc4, 0xad, 0xee, 0x44, 0x35, 0xfe, 0x8f, 0xff, 0xe1, 0xbf, 0x04, 0xda, + 0xdc, 0x53, 0x89, 0xf3, 0x0d, 0xab, 0xba, 0xeb, 0x78, 0x98, 0x1c, 0x26, 0x1e, 0x37, 0x70, 0x68, + 0x2d, 0x35, 0xbb, 0x7c, 0x9c, 0x5b, 0xea, 0xa7, 0x45, 0x22, 0x2f, 0x74, 0x1a, 0xb8, 0x4b, 0xe1, + 0xff, 0xef, 0xa6, 0x40, 0xab, 0xbb, 0xb8, 0x61, 0xa5, 0xf5, 0x8a, 0x47, 0x06, 0x98, 0x5e, 0xf1, + 0xbd, 0x26, 0x26, 0xec, 0x29, 0x11, 0xbe, 0x1d, 0x61, 0x1a, 0xc2, 0x32, 0xc8, 0x46, 0x8e, 0x6d, + 0x1a, 0x0b, 0xc6, 0xe2, 0x78, 0xf9, 0x89, 0x0f, 0x5b, 0x85, 0x13, 0xed, 0x56, 0x21, 0x7b, 0x73, + 0x7d, 0xf5, 0xa8, 0x55, 0xb8, 0xd0, 0x0f, 0x29, 0x3c, 0x0c, 0x30, 0x2d, 0xdd, 0x5c, 0x5f, 0x45, + 0x4c, 0x19, 0xbe, 0x00, 0xa6, 0x6d, 0x4c, 0x1d, 0x82, 0xed, 0xe5, 0xad, 0xf5, 0x5b, 0xc2, 0xbe, + 0x99, 0xe1, 0x16, 0xcf, 0x49, 0x8b, 0xd3, 0xab, 0x69, 0x01, 0xd4, 0xad, 0x03, 0xb7, 0xc1, 0x98, + 0xbf, 0xf3, 0x16, 0xae, 0x86, 0xd4, 0xcc, 0x2e, 0x64, 0x17, 0x27, 0xae, 0x3c, 0x5e, 0x4a, 0x56, + 0x50, 0xb9, 0xc0, 0x97, 0x4d, 0x3e, 0x6c, 0x09, 0x59, 0xfb, 0x6b, 0xf1, 0xca, 0x95, 0x4f, 0x4b, + 0xb4, 0xb1, 0x4d, 0x61, 0x05, 0xc5, 0xe6, 0x8a, 0xbf, 0xca, 0x00, 0xa8, 0x3f, 0x3c, 0x0d, 0x7c, + 0x8f, 0xe2, 0x81, 0x3c, 0x3d, 0x05, 0x53, 0x55, 0x6e, 0x39, 0xc4, 0xb6, 0xc4, 0x35, 0x33, 0x9f, + 0xc6, 0x7b, 0x53, 0xe2, 0x4f, 0xad, 0xa4, 0xcc, 0xa1, 0x2e, 0x00, 0x78, 0x03, 0x8c, 0x12, 0x4c, + 0x23, 0x37, 0x34, 0xb3, 0x0b, 0xc6, 0xe2, 0xc4, 0x95, 0xcb, 0x7d, 0xa1, 0x78, 0x7e, 0xb3, 0xe4, + 0x2b, 0x35, 0x9f, 0x2c, 0x55, 0x42, 0x2b, 0x8c, 0x68, 0xf9, 0x94, 0x44, 0x1a, 0x45, 0xdc, 0x06, + 0x92, 0xb6, 0x8a, 0xdf, 0xcb, 0x80, 0x29, 0x3d, 0x4a, 0x4d, 0x07, 0xef, 0xc3, 0x7d, 0x30, 0x46, + 0x44, 0xb2, 0xf0, 0x38, 0x4d, 0x5c, 0xd9, 0x2a, 0x1d, 0x6b, 0x5b, 0x95, 0xba, 0x92, 0xb0, 0x3c, + 0xc1, 0xd6, 0x4c, 0xfe, 0x41, 0x31, 0x1a, 0x7c, 0x1b, 0xe4, 0x89, 0x5c, 0x28, 0x9e, 0x4d, 0x13, + 0x57, 0xbe, 0x3c, 0x40, 0x64, 0x61, 0xb8, 0x3c, 0xd9, 0x6e, 0x15, 0xf2, 0xf1, 0x3f, 0xa4, 0x00, + 0x8b, 0xef, 0x65, 0xc0, 0xfc, 0x4a, 0x44, 0x43, 0xbf, 0x81, 0x30, 0xf5, 0x23, 0x52, 0xc5, 0x2b, + 0xbe, 0x1b, 0x35, 0xbc, 0x55, 0x5c, 0x73, 0x3c, 0x27, 0x64, 0xd9, 0xba, 0x00, 0x46, 0x3c, 0xab, + 0x81, 0x65, 0xf6, 0x4c, 0xca, 0x98, 0x8e, 0x5c, 0xb7, 0x1a, 0x18, 0x71, 0x0e, 0x93, 0x60, 0xc9, + 0x22, 0xf7, 0x82, 0x92, 0xb8, 0x71, 0x18, 0x60, 0xc4, 0x39, 0xf0, 0x12, 0x18, 0xad, 0xf9, 0xa4, + 0x61, 0x89, 0x75, 0x1c, 0x4f, 0x56, 0xe6, 0x2a, 0xa7, 0x22, 0xc9, 0x85, 0x4f, 0x83, 0x09, 0x1b, + 0xd3, 0x2a, 0x71, 0x02, 0x06, 0x6d, 0x8e, 0x70, 0xe1, 0x33, 0x52, 0x78, 0x62, 0x35, 0x61, 0x21, + 0x5d, 0x0e, 0x5e, 0x06, 0xf9, 0x80, 0x38, 0x3e, 0x71, 0xc2, 0x43, 0x33, 0xb7, 0x60, 0x2c, 0xe6, + 0xca, 0x53, 0x52, 0x27, 0xbf, 0x25, 0xe9, 0x48, 0x49, 0xc0, 0x05, 0x90, 0x7f, 0xb1, 0xb2, 0x79, + 0x7d, 0xcb, 0x0a, 0x77, 0xcd, 0x51, 0x8e, 0x30, 0xc2, 0xa4, 0x91, 0xa2, 0x16, 0xff, 0x9a, 0x01, + 0x66, 0x3a, 0x2a, 0x71, 0x48, 0xe1, 0x55, 0x90, 0xa7, 0x21, 0xab, 0x38, 0xf5, 0x43, 0x19, 0x93, + 0x47, 0x63, 0xb0, 0x8a, 0xa4, 0x1f, 0xb5, 0x0a, 0xb3, 0x89, 0x46, 0x4c, 0xe5, 0xf1, 0x50, 0xba, + 0xf0, 0x17, 0x06, 0x38, 0xb3, 0x8f, 0x77, 0x76, 0x7d, 0x7f, 0x6f, 0xc5, 0x75, 0xb0, 0x17, 0xae, + 0xf8, 0x5e, 0xcd, 0xa9, 0xcb, 0x1c, 0x40, 0xc7, 0xcc, 0x81, 0x97, 0xbb, 0x2d, 0x97, 0x1f, 0x68, + 0xb7, 0x0a, 0x67, 0x7a, 0x30, 0x50, 0x2f, 0x3f, 0xe0, 0x36, 0x30, 0xab, 0xa9, 0x4d, 0x22, 0x0b, + 0x98, 0x28, 0x5b, 0xe3, 0xe5, 0xf3, 0xed, 0x56, 0xc1, 0x5c, 0xe9, 0x23, 0x83, 0xfa, 0x6a, 0x17, + 0xbf, 0x93, 0x4d, 0x87, 0x57, 0x4b, 0xb7, 0x37, 0x41, 0x9e, 0x6d, 0x63, 0xdb, 0x0a, 0x2d, 0xb9, + 0x11, 0x9f, 0xb8, 0xb7, 0x4d, 0x2f, 0x6a, 0xc6, 0x06, 0x0e, 0xad, 0x32, 0x94, 0x0b, 0x02, 0x12, + 0x1a, 0x52, 0x56, 0xe1, 0xd7, 0xc1, 0x08, 0x0d, 0x70, 0x55, 0x06, 0xfa, 0x95, 0xe3, 0x6e, 0xb6, + 0x3e, 0x0f, 0x52, 0x09, 0x70, 0x35, 0xd9, 0x0b, 0xec, 0x1f, 0xe2, 0xb0, 0xf0, 0x1d, 0x03, 0x8c, + 0x52, 0x5e, 0xa0, 0x64, 0x51, 0x7b, 0x6d, 0x58, 0x1e, 0xa4, 0xaa, 0xa0, 0xf8, 0x8f, 0x24, 0x78, + 0xf1, 0x5f, 0x19, 0x70, 0xa1, 0x9f, 0xea, 0x8a, 0xef, 0xd9, 0x62, 0x39, 0xd6, 0xe5, 0xde, 0x16, + 0x99, 0xfe, 0xb4, 0xbe, 0xb7, 0x8f, 0x5a, 0x85, 0x87, 0xef, 0x6a, 0x40, 0x2b, 0x02, 0x9f, 0x53, + 0xcf, 0x2d, 0x0a, 0xc5, 0x85, 0x4e, 0xc7, 0x8e, 0x5a, 0x85, 0xd3, 0x4a, 0xad, 0xd3, 0x57, 0xd8, + 0x04, 0xd0, 0xb5, 0x68, 0x78, 0x83, 0x58, 0x1e, 0x15, 0x66, 0x9d, 0x06, 0x96, 0xe1, 0x7b, 0xf4, + 0xde, 0xd2, 0x83, 0x69, 0x94, 0xe7, 0x24, 0x24, 0xbc, 0xd6, 0x65, 0x0d, 0xf5, 0x40, 0x60, 0x75, + 0x8b, 0x60, 0x8b, 0xaa, 0x52, 0xa4, 0x9d, 0x28, 0x8c, 0x8a, 0x24, 0x17, 0x3e, 0x02, 0xc6, 0x1a, + 0x98, 0x52, 0xab, 0x8e, 0x79, 0xfd, 0x19, 0x4f, 0x8e, 0xe8, 0x0d, 0x41, 0x46, 0x31, 0x9f, 0xf5, + 0x27, 0xe7, 0xfb, 0x45, 0xed, 0x9a, 0x43, 0x43, 0xf8, 0x6a, 0xd7, 0x06, 0x28, 0xdd, 0xdb, 0x13, + 0x32, 0x6d, 0x9e, 0xfe, 0xaa, 0xf8, 0xc5, 0x14, 0x2d, 0xf9, 0xbf, 0x06, 0x72, 0x4e, 0x88, 0x1b, + 0xf1, 0xd9, 0xfd, 0xf2, 0x90, 0x72, 0xaf, 0x7c, 0x52, 0xfa, 0x90, 0x5b, 0x67, 0x68, 0x48, 0x80, + 0x16, 0x7f, 0x9d, 0x01, 0x0f, 0xf5, 0x53, 0x61, 0x07, 0x0a, 0x65, 0x11, 0x0f, 0xdc, 0x88, 0x58, + 0xae, 0xcc, 0x38, 0x15, 0xf1, 0x2d, 0x4e, 0x45, 0x92, 0xcb, 0x4a, 0x3e, 0x75, 0xbc, 0x7a, 0xe4, + 0x5a, 0x44, 0xa6, 0x93, 0x7a, 0xea, 0x8a, 0xa4, 0x23, 0x25, 0x01, 0x4b, 0x00, 0xd0, 0x5d, 0x9f, + 0x84, 0x1c, 0x43, 0x56, 0xaf, 0x53, 0xac, 0x40, 0x54, 0x14, 0x15, 0x69, 0x12, 0xec, 0x44, 0xdb, + 0x73, 0x3c, 0x5b, 0xae, 0xba, 0xda, 0xc5, 0x2f, 0x39, 0x9e, 0x8d, 0x38, 0x87, 0xe1, 0xbb, 0x0e, + 0x0d, 0x19, 0x45, 0x2e, 0x79, 0x47, 0xd4, 0xb9, 0xa4, 0x92, 0x60, 0xf8, 0x55, 0x56, 0xf5, 0x7d, + 0xe2, 0x60, 0x6a, 0x8e, 0x26, 0xf8, 0x2b, 0x8a, 0x8a, 0x34, 0x89, 0xe2, 0x3f, 0xf3, 0xfd, 0x93, + 0x84, 0x95, 0x12, 0x78, 0x11, 0xe4, 0xea, 0xc4, 0x8f, 0x02, 0x19, 0x25, 0x15, 0xed, 0x17, 0x18, + 0x11, 0x09, 0x1e, 0xcb, 0xca, 0x66, 0x47, 0x9b, 0xaa, 0xb2, 0x32, 0x6e, 0x4e, 0x63, 0x3e, 0xfc, + 0x96, 0x01, 0x72, 0x9e, 0x0c, 0x0e, 0x4b, 0xb9, 0x57, 0x87, 0x94, 0x17, 0x3c, 0xbc, 0x89, 0xbb, + 0x22, 0xf2, 0x02, 0x19, 0x3e, 0x05, 0x72, 0xb4, 0xea, 0x07, 0x58, 0x46, 0x7d, 0x3e, 0x16, 0xaa, + 0x30, 0xe2, 0x51, 0xab, 0x70, 0x32, 0x36, 0xc7, 0x09, 0x48, 0x08, 0xc3, 0xef, 0x1a, 0x00, 0x34, + 0x2d, 0xd7, 0xb1, 0x2d, 0xde, 0x32, 0xe4, 0xb8, 0xfb, 0x83, 0x4d, 0xeb, 0x5b, 0xca, 0xbc, 0x58, + 0xb4, 0xe4, 0x3f, 0xd2, 0xa0, 0xe1, 0xbb, 0x06, 0x98, 0xa4, 0xd1, 0x0e, 0x91, 0x5a, 0x94, 0x37, + 0x17, 0x13, 0x57, 0xbe, 0x32, 0x50, 0x5f, 0x2a, 0x1a, 0x40, 0x79, 0xaa, 0xdd, 0x2a, 0x4c, 0xea, + 0x14, 0xd4, 0xe1, 0x00, 0xfc, 0x81, 0x01, 0xf2, 0xcd, 0xf8, 0xcc, 0x1e, 0xe3, 0x1b, 0xfe, 0xf5, + 0x21, 0x2d, 0xac, 0xcc, 0xa8, 0x64, 0x17, 0xa8, 0x3e, 0x40, 0x79, 0x00, 0xff, 0x68, 0x00, 0xd3, + 0xb2, 0x45, 0x81, 0xb7, 0xdc, 0x2d, 0xe2, 0x78, 0x21, 0x26, 0xa2, 0xdf, 0xa4, 0x66, 0x9e, 0xbb, + 0x37, 0xd8, 0xb3, 0x30, 0xdd, 0xcb, 0x96, 0x17, 0xa4, 0x77, 0xe6, 0x72, 0x1f, 0x37, 0x50, 0x5f, + 0x07, 0x79, 0xa2, 0x25, 0x2d, 0x8d, 0x39, 0x3e, 0x84, 0x44, 0x4b, 0x7a, 0x29, 0x59, 0x1d, 0x92, + 0x0e, 0x4a, 0x83, 0x86, 0x9b, 0x60, 0x26, 0x20, 0x98, 0x03, 0xdc, 0xf4, 0xf6, 0x3c, 0x7f, 0xdf, + 0xbb, 0xea, 0x60, 0xd7, 0xa6, 0x26, 0x58, 0x30, 0x16, 0xf3, 0xe5, 0x73, 0xed, 0x56, 0x61, 0x66, + 0xab, 0x97, 0x00, 0xea, 0xad, 0x57, 0x7c, 0x37, 0x9b, 0xbe, 0x05, 0xa4, 0xbb, 0x08, 0xf8, 0xbe, + 0x78, 0x7a, 0x11, 0x1b, 0x6a, 0x1a, 0x7c, 0xb5, 0xde, 0x1c, 0x52, 0x32, 0xa9, 0x36, 0x20, 0xe9, + 0xe4, 0x14, 0x89, 0x22, 0xcd, 0x0f, 0xf8, 0x53, 0x03, 0x9c, 0xb4, 0xaa, 0x55, 0x1c, 0x84, 0xd8, + 0x16, 0xc5, 0x3d, 0xf3, 0x19, 0xd4, 0xaf, 0x19, 0xe9, 0xd5, 0xc9, 0x65, 0x1d, 0x1a, 0x75, 0x7a, + 0x02, 0x9f, 0x03, 0xa7, 0x68, 0xe8, 0x13, 0x6c, 0xa7, 0xda, 0x66, 0xd8, 0x6e, 0x15, 0x4e, 0x55, + 0x3a, 0x38, 0x28, 0x25, 0x59, 0xfc, 0x5b, 0x0e, 0x14, 0xee, 0xb2, 0xd5, 0xee, 0xe1, 0x62, 0x76, + 0x09, 0x8c, 0xf2, 0xc7, 0xb5, 0x79, 0x54, 0xf2, 0x5a, 0x2b, 0xc8, 0xa9, 0x48, 0x72, 0xd9, 0x41, + 0xc1, 0xf0, 0x59, 0xfb, 0x92, 0xe5, 0x82, 0xea, 0xa0, 0xa8, 0x08, 0x32, 0x8a, 0xf9, 0xf0, 0x0a, + 0x00, 0x36, 0x0e, 0x08, 0x66, 0x87, 0x95, 0x6d, 0x8e, 0x71, 0x69, 0xb5, 0x48, 0xab, 0x8a, 0x83, + 0x34, 0x29, 0x78, 0x15, 0xc0, 0xf8, 0x9f, 0xe3, 0x7b, 0x2f, 0x5b, 0xc4, 0x73, 0xbc, 0xba, 0x99, + 0xe7, 0x6e, 0xcf, 0xb2, 0x6e, 0x6c, 0xb5, 0x8b, 0x8b, 0x7a, 0x68, 0xc0, 0xb7, 0xc1, 0xa8, 0x18, + 0xfa, 0xf0, 0x13, 0x62, 0x88, 0x55, 0x1e, 0xf0, 0x18, 0x71, 0x28, 0x24, 0x21, 0xbb, 0xab, 0x7b, + 0xee, 0x7e, 0x57, 0xf7, 0x3b, 0x96, 0xd3, 0xd1, 0xff, 0xf2, 0x72, 0x5a, 0xfc, 0xb7, 0x91, 0xae, + 0x39, 0xda, 0xa3, 0x56, 0xaa, 0x96, 0x8b, 0xe1, 0x2a, 0x98, 0x62, 0x37, 0x26, 0x84, 0x03, 0xd7, + 0xa9, 0x5a, 0x94, 0x5f, 0xd8, 0x45, 0xb2, 0xab, 0x19, 0x52, 0x25, 0xc5, 0x47, 0x5d, 0x1a, 0xf0, + 0x45, 0x00, 0xc5, 0x2d, 0xa2, 0xc3, 0x8e, 0x68, 0x88, 0xd4, 0x7d, 0xa0, 0xd2, 0x25, 0x81, 0x7a, + 0x68, 0xc1, 0x15, 0x30, 0xed, 0x5a, 0x3b, 0xd8, 0xad, 0x60, 0x17, 0x57, 0x43, 0x9f, 0x70, 0x53, + 0x62, 0xa4, 0x31, 0xd3, 0x6e, 0x15, 0xa6, 0xaf, 0xa5, 0x99, 0xa8, 0x5b, 0xbe, 0x78, 0x21, 0xbd, + 0xb5, 0xf5, 0x07, 0x17, 0x77, 0xb3, 0x0f, 0x32, 0x60, 0xae, 0x7f, 0x66, 0xc0, 0x6f, 0x27, 0x57, + 0x48, 0x71, 0x43, 0x78, 0x7d, 0x58, 0x59, 0x28, 0xef, 0x90, 0xa0, 0xfb, 0xfe, 0x08, 0xbf, 0xc1, + 0xda, 0x35, 0xcb, 0x8d, 0x87, 0x56, 0xaf, 0x0d, 0xcd, 0x05, 0x06, 0x52, 0x1e, 0x17, 0x9d, 0xa0, + 0xe5, 0xf2, 0xc6, 0xcf, 0x72, 0x71, 0xf1, 0x37, 0x46, 0x7a, 0x8a, 0x90, 0xec, 0x60, 0xf8, 0x43, + 0x03, 0x9c, 0xf6, 0x03, 0xec, 0x2d, 0x6f, 0xad, 0xdf, 0xfa, 0x3f, 0xb1, 0x93, 0x65, 0xa8, 0xae, + 0x1f, 0xd3, 0xcf, 0x17, 0x2b, 0x9b, 0xd7, 0x85, 0xc1, 0x2d, 0xe2, 0x07, 0xb4, 0x7c, 0xa6, 0xdd, + 0x2a, 0x9c, 0xde, 0xec, 0x84, 0x42, 0x69, 0xec, 0x62, 0x03, 0xcc, 0xac, 0x1d, 0x84, 0x98, 0x78, + 0x96, 0xbb, 0xea, 0x57, 0xa3, 0x06, 0xf6, 0x42, 0xe1, 0x68, 0x6a, 0xe2, 0x65, 0xdc, 0xe3, 0xc4, + 0xeb, 0x21, 0x90, 0x8d, 0x88, 0x2b, 0xb3, 0x78, 0x42, 0x4d, 0x74, 0xd1, 0x35, 0xc4, 0xe8, 0xc5, + 0x0b, 0x60, 0x84, 0xf9, 0x09, 0xcf, 0x81, 0x2c, 0xb1, 0xf6, 0xb9, 0xd5, 0xc9, 0xf2, 0x18, 0x13, + 0x41, 0xd6, 0x3e, 0x62, 0xb4, 0xe2, 0x5f, 0x2e, 0x80, 0xd3, 0xa9, 0x67, 0x81, 0x73, 0x20, 0xa3, + 0xc6, 0xc4, 0x40, 0x1a, 0xcd, 0xac, 0xaf, 0xa2, 0x8c, 0x63, 0xc3, 0x67, 0x54, 0xf1, 0x15, 0xa0, + 0x05, 0x75, 0x96, 0x70, 0x2a, 0xeb, 0xcf, 0x13, 0x73, 0xcc, 0x91, 0xb8, 0x70, 0x32, 0x1f, 0x70, + 0x4d, 0xee, 0x12, 0xe1, 0x03, 0xae, 0x21, 0x46, 0xfb, 0xb4, 0xe3, 0xbe, 0x78, 0xde, 0x98, 0xbb, + 0x87, 0x79, 0xe3, 0xe8, 0x1d, 0xe7, 0x8d, 0x17, 0x41, 0x2e, 0x74, 0x42, 0x17, 0xf3, 0x83, 0x4c, + 0xbb, 0x46, 0xdd, 0x60, 0x44, 0x24, 0x78, 0xf0, 0x2d, 0x30, 0x66, 0xe3, 0x9a, 0x15, 0xb9, 0x21, + 0x3f, 0xb3, 0x26, 0xae, 0xac, 0x0c, 0x20, 0x85, 0xc4, 0x30, 0x78, 0x55, 0xd8, 0x45, 0x31, 0x00, + 0x7c, 0x18, 0x8c, 0x35, 0xac, 0x03, 0xa7, 0x11, 0x35, 0x78, 0x83, 0x69, 0x08, 0xb1, 0x0d, 0x41, + 0x42, 0x31, 0x8f, 0x55, 0x46, 0x7c, 0x50, 0x75, 0x23, 0xea, 0x34, 0xb1, 0x64, 0xca, 0xe6, 0x4f, + 0x55, 0xc6, 0xb5, 0x14, 0x1f, 0x75, 0x69, 0x70, 0x30, 0xc7, 0xe3, 0xca, 0x13, 0x1a, 0x98, 0x20, + 0xa1, 0x98, 0xd7, 0x09, 0x26, 0xe5, 0x27, 0xfb, 0x81, 0x49, 0xe5, 0x2e, 0x0d, 0xf8, 0x18, 0x18, + 0x6f, 0x58, 0x07, 0xd7, 0xb0, 0x57, 0x0f, 0x77, 0xcd, 0x93, 0x0b, 0xc6, 0x62, 0xb6, 0x7c, 0xb2, + 0xdd, 0x2a, 0x8c, 0x6f, 0xc4, 0x44, 0x94, 0xf0, 0xb9, 0xb0, 0xe3, 0x49, 0xe1, 0x53, 0x9a, 0x70, + 0x4c, 0x44, 0x09, 0x9f, 0x75, 0x2f, 0x81, 0x15, 0xb2, 0xcd, 0x65, 0x9e, 0xee, 0xbc, 0xe6, 0x6e, + 0x09, 0x32, 0x8a, 0xf9, 0x70, 0x11, 0xe4, 0x1b, 0xd6, 0x01, 0x1f, 0x49, 0x98, 0x53, 0xdc, 0x2c, + 0x1f, 0x8c, 0x6f, 0x48, 0x1a, 0x52, 0x5c, 0x2e, 0xe9, 0x78, 0x42, 0x72, 0x5a, 0x93, 0x94, 0x34, + 0xa4, 0xb8, 0x2c, 0x89, 0x23, 0xcf, 0xb9, 0x1d, 0x61, 0x21, 0x0c, 0x79, 0x64, 0x54, 0x12, 0xdf, + 0x4c, 0x58, 0x48, 0x97, 0x83, 0x25, 0x00, 0x1a, 0x91, 0x1b, 0x3a, 0x81, 0x8b, 0x37, 0x6b, 0xe6, + 0x19, 0x1e, 0x7f, 0xde, 0xf4, 0x6f, 0x28, 0x2a, 0xd2, 0x24, 0x20, 0x06, 0x23, 0xd8, 0x8b, 0x1a, + 0xe6, 0x59, 0x7e, 0xb0, 0x0f, 0x24, 0x05, 0xd5, 0xce, 0x59, 0xf3, 0xa2, 0x06, 0xe2, 0xe6, 0xe1, + 0x33, 0xe0, 0x64, 0xc3, 0x3a, 0x60, 0xe5, 0x00, 0x93, 0xd0, 0xc1, 0xd4, 0x9c, 0xe1, 0x0f, 0x3f, + 0xcd, 0xba, 0xdd, 0x0d, 0x9d, 0x81, 0x3a, 0xe5, 0xb8, 0xa2, 0xe3, 0x69, 0x8a, 0xb3, 0x9a, 0xa2, + 0xce, 0x40, 0x9d, 0x72, 0x2c, 0xd2, 0x04, 0xdf, 0x8e, 0x1c, 0x82, 0x6d, 0xf3, 0x01, 0xde, 0x20, + 0xcb, 0x97, 0x15, 0x82, 0x86, 0x14, 0x17, 0x36, 0xe3, 0xd9, 0x95, 0xc9, 0xb7, 0xe1, 0xcd, 0xc1, + 0x56, 0xf2, 0x4d, 0xb2, 0x4c, 0x88, 0x75, 0x28, 0x4e, 0x1a, 0x7d, 0x6a, 0x05, 0x29, 0xc8, 0x59, + 0xae, 0xbb, 0x59, 0x33, 0xcf, 0xf1, 0xd8, 0x0f, 0xfa, 0x04, 0x51, 0x55, 0x67, 0x99, 0x81, 0x20, + 0x81, 0xc5, 0x40, 0x7d, 0x8f, 0xa5, 0xc6, 0xdc, 0x70, 0x41, 0x37, 0x19, 0x08, 0x12, 0x58, 0xfc, + 0x49, 0xbd, 0xc3, 0xcd, 0x9a, 0xf9, 0xe0, 0x90, 0x9f, 0x94, 0x81, 0x20, 0x81, 0x05, 0x1d, 0x90, + 0xf5, 0xfc, 0xd0, 0x3c, 0x3f, 0x94, 0xe3, 0x99, 0x1f, 0x38, 0xd7, 0xfd, 0x10, 0x31, 0x0c, 0xf8, + 0x13, 0x03, 0x80, 0x20, 0x49, 0xd1, 0x87, 0x06, 0x32, 0x12, 0x49, 0x41, 0x96, 0x92, 0xdc, 0x5e, + 0xf3, 0x42, 0x72, 0x98, 0x5c, 0x8f, 0xb4, 0x3d, 0xa0, 0x79, 0x01, 0x7f, 0x69, 0x80, 0xb3, 0x7a, + 0x9b, 0xac, 0xdc, 0x9b, 0xe7, 0x11, 0xb9, 0x31, 0xe8, 0x34, 0x2f, 0xfb, 0xbe, 0x5b, 0x36, 0xdb, + 0xad, 0xc2, 0xd9, 0xe5, 0x1e, 0xa8, 0xa8, 0xa7, 0x2f, 0xf0, 0xb7, 0x06, 0x98, 0x96, 0x55, 0x54, + 0xf3, 0xb0, 0xc0, 0x03, 0x88, 0x07, 0x1d, 0xc0, 0x34, 0x8e, 0x88, 0xa3, 0x7a, 0xc9, 0xde, 0xc5, + 0x47, 0xdd, 0xae, 0xc1, 0x3f, 0x18, 0x60, 0xd2, 0xc6, 0x01, 0xf6, 0x6c, 0xec, 0x55, 0x99, 0xaf, + 0x0b, 0x03, 0x19, 0x59, 0xa4, 0x7d, 0x5d, 0xd5, 0x20, 0x84, 0x9b, 0x25, 0xe9, 0xe6, 0xa4, 0xce, + 0x3a, 0x6a, 0x15, 0x66, 0x13, 0x55, 0x9d, 0x83, 0x3a, 0xbc, 0x84, 0xef, 0x19, 0xe0, 0x74, 0xb2, + 0x00, 0xe2, 0x48, 0xb9, 0x30, 0xc4, 0x3c, 0xe0, 0xed, 0xeb, 0x72, 0x27, 0x20, 0x4a, 0x7b, 0x00, + 0x7f, 0x67, 0xb0, 0x4e, 0x2d, 0xbe, 0xf7, 0x51, 0xb3, 0xc8, 0x63, 0xf9, 0xc6, 0xc0, 0x63, 0xa9, + 0x10, 0x44, 0x28, 0x2f, 0x27, 0xad, 0xa0, 0xe2, 0x1c, 0xb5, 0x0a, 0x33, 0x7a, 0x24, 0x15, 0x03, + 0xe9, 0x1e, 0xc2, 0xef, 0x1b, 0x60, 0x12, 0x27, 0x1d, 0x37, 0x35, 0x2f, 0x0e, 0x24, 0x88, 0x3d, + 0x9b, 0x78, 0x71, 0x53, 0xd7, 0x58, 0x14, 0x75, 0x60, 0xb3, 0x0e, 0x12, 0x1f, 0x58, 0x8d, 0xc0, + 0xc5, 0xe6, 0xff, 0x0c, 0xb8, 0x83, 0x5c, 0x13, 0x76, 0x51, 0x0c, 0x00, 0x2f, 0x83, 0xbc, 0x17, + 0xb9, 0xae, 0xb5, 0xe3, 0x62, 0xf3, 0x61, 0xde, 0x8b, 0xa8, 0x91, 0xec, 0x75, 0x49, 0x47, 0x4a, + 0x02, 0xd6, 0xc0, 0xc2, 0xc1, 0x4b, 0xea, 0xf3, 0xa4, 0x9e, 0x43, 0x43, 0xf3, 0x12, 0xb7, 0x32, + 0xd7, 0x6e, 0x15, 0x66, 0xb7, 0x7b, 0x8f, 0x15, 0xef, 0x6a, 0x03, 0xbe, 0x02, 0x1e, 0xd4, 0x64, + 0xd6, 0x1a, 0x3b, 0xd8, 0xb6, 0xb1, 0x1d, 0x5f, 0xdc, 0xcc, 0xff, 0x15, 0x83, 0xcb, 0x78, 0x83, + 0x6f, 0xa7, 0x05, 0xd0, 0x9d, 0xb4, 0xe1, 0x35, 0x30, 0xab, 0xb1, 0xd7, 0xbd, 0x70, 0x93, 0x54, + 0x42, 0xe2, 0x78, 0x75, 0x73, 0x91, 0xdb, 0x3d, 0x1b, 0xef, 0xc8, 0x6d, 0x8d, 0x87, 0xfa, 0xe8, + 0xc0, 0x2f, 0x75, 0x58, 0xe3, 0xaf, 0xd0, 0xac, 0xe0, 0x25, 0x7c, 0x48, 0xcd, 0x47, 0x78, 0x77, + 0xc2, 0x17, 0x7b, 0x5b, 0xa3, 0xa3, 0x3e, 0xf2, 0xf0, 0x8b, 0xe0, 0x4c, 0x8a, 0xc3, 0xae, 0x28, + 0xe6, 0xa3, 0xe2, 0xae, 0xc1, 0xfa, 0xd9, 0xed, 0x98, 0x88, 0x7a, 0x49, 0xc2, 0x2f, 0x00, 0xa8, + 0x91, 0x37, 0xac, 0x80, 0xeb, 0x3f, 0x26, 0xae, 0x3d, 0x6c, 0x45, 0xb7, 0x25, 0x0d, 0xf5, 0x90, + 0x83, 0x3f, 0x33, 0x3a, 0x9e, 0x24, 0xb9, 0x1d, 0x53, 0xf3, 0x32, 0xdf, 0xbf, 0x1b, 0xc7, 0xcc, + 0x42, 0xed, 0x3d, 0x48, 0xe4, 0x62, 0x2d, 0xcc, 0x1a, 0x14, 0xea, 0xe3, 0xc2, 0x1c, 0xbb, 0xa1, + 0xa7, 0x2a, 0x3c, 0x9c, 0x02, 0xd9, 0x3d, 0x2c, 0xbf, 0xaa, 0x40, 0xec, 0x27, 0xb4, 0x41, 0xae, + 0x69, 0xb9, 0x51, 0x3c, 0x64, 0x18, 0x70, 0x77, 0x80, 0x84, 0xf1, 0xe7, 0x32, 0xcf, 0x1a, 0x73, + 0xef, 0x1b, 0x60, 0xb6, 0xf7, 0xc1, 0x73, 0x5f, 0xdd, 0xfa, 0xb9, 0x01, 0xa6, 0xbb, 0xce, 0x98, + 0x1e, 0x1e, 0xdd, 0xee, 0xf4, 0xe8, 0x95, 0x41, 0x1f, 0x16, 0x62, 0x73, 0xf0, 0x0e, 0x59, 0x77, + 0xef, 0x47, 0x06, 0x98, 0x4a, 0x97, 0xed, 0xfb, 0x19, 0xaf, 0xe2, 0xfb, 0x19, 0x30, 0xdb, 0xbb, + 0xb1, 0x87, 0x44, 0x4d, 0x30, 0x86, 0x33, 0x09, 0xea, 0x35, 0x35, 0x7e, 0xc7, 0x00, 0x13, 0x6f, + 0x29, 0xb9, 0xf8, 0xad, 0xfb, 0xc0, 0x67, 0x50, 0xf1, 0x39, 0x99, 0x30, 0x28, 0xd2, 0x71, 0x8b, + 0xbf, 0x37, 0xc0, 0x4c, 0xcf, 0x06, 0x00, 0x5e, 0x02, 0xa3, 0x96, 0xeb, 0xfa, 0xfb, 0x62, 0x94, + 0xa8, 0xbd, 0x23, 0x58, 0xe6, 0x54, 0x24, 0xb9, 0x5a, 0xf4, 0x32, 0x9f, 0x55, 0xf4, 0x8a, 0x7f, + 0x32, 0xc0, 0xf9, 0x3b, 0x65, 0xe2, 0x7d, 0x59, 0xd2, 0x45, 0x90, 0x97, 0xcd, 0xfb, 0x21, 0x5f, + 0x4e, 0x59, 0x8a, 0x65, 0xd1, 0xe0, 0x1f, 0x9a, 0x89, 0x5f, 0xc5, 0x0f, 0x0c, 0x30, 0x55, 0xc1, + 0xa4, 0xe9, 0x54, 0x31, 0xc2, 0x35, 0x4c, 0xb0, 0x57, 0xc5, 0x70, 0x09, 0x8c, 0xf3, 0xd7, 0xdd, + 0x81, 0x55, 0x8d, 0x5f, 0xdd, 0x4c, 0xcb, 0x90, 0x8f, 0x5f, 0x8f, 0x19, 0x28, 0x91, 0x51, 0xaf, + 0x79, 0x32, 0x7d, 0x5f, 0xf3, 0x9c, 0x07, 0x23, 0x41, 0x32, 0x88, 0xce, 0x33, 0x2e, 0x9f, 0x3d, + 0x73, 0x2a, 0xe7, 0xfa, 0x24, 0xe4, 0xd3, 0xb5, 0x9c, 0xe4, 0xfa, 0x24, 0x44, 0x9c, 0xca, 0xf6, + 0xcb, 0xa9, 0xce, 0x3a, 0xce, 0x00, 0x49, 0xe4, 0x76, 0xbd, 0x57, 0x62, 0x3c, 0xc4, 0x39, 0xfa, + 0xe7, 0x2e, 0x99, 0x3b, 0x7f, 0xee, 0x02, 0x5f, 0x00, 0xd3, 0xf2, 0xe7, 0xda, 0x41, 0x40, 0x30, + 0xe5, 0xef, 0x4e, 0xb3, 0x9d, 0x1f, 0xcd, 0x6e, 0xa4, 0x05, 0x50, 0xb7, 0x0e, 0xfc, 0x7c, 0xea, + 0x53, 0x9c, 0x8b, 0xc9, 0x67, 0x38, 0xac, 0x25, 0xe4, 0x7d, 0xc6, 0x2d, 0x56, 0x06, 0xd6, 0x08, + 0xf1, 0x49, 0xea, 0xfb, 0x9c, 0x25, 0x30, 0x5e, 0x63, 0x02, 0x7c, 0x5e, 0x9f, 0xeb, 0x0c, 0xfa, + 0xd5, 0x98, 0x81, 0x12, 0x99, 0xe2, 0x9f, 0x0d, 0xd0, 0xeb, 0x4b, 0x39, 0x78, 0x4e, 0xcc, 0x5d, + 0xb5, 0x61, 0x66, 0x3c, 0x73, 0x85, 0x4d, 0x30, 0x46, 0xc5, 0x62, 0xcb, 0x64, 0xdc, 0x3c, 0x66, + 0x32, 0xa6, 0x53, 0x47, 0x34, 0x7c, 0x31, 0x35, 0x06, 0x63, 0xf9, 0x58, 0xb5, 0xca, 0x91, 0x67, + 0xcb, 0x51, 0xfc, 0xa4, 0xc8, 0xc7, 0x95, 0x65, 0x41, 0x43, 0x8a, 0x5b, 0xae, 0x7e, 0xf8, 0xc9, + 0xfc, 0x89, 0x8f, 0x3e, 0x99, 0x3f, 0xf1, 0xf1, 0x27, 0xf3, 0x27, 0xbe, 0xd9, 0x9e, 0x37, 0x3e, + 0x6c, 0xcf, 0x1b, 0x1f, 0xb5, 0xe7, 0x8d, 0x8f, 0xdb, 0xf3, 0xc6, 0xdf, 0xdb, 0xf3, 0xc6, 0x8f, + 0xff, 0x31, 0x7f, 0xe2, 0xab, 0xcf, 0x1f, 0xeb, 0xe3, 0xf4, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xde, 0xe9, 0x15, 0xbf, 0xf5, 0x2e, 0x00, 0x00, } func (m *ConversionRequest) Marshal() (dAtA []byte, err error) { @@ -2662,16 +2660,6 @@ func (m *ValidationRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.OptionalOldSelf != nil { - i-- - if *m.OptionalOldSelf { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } i -= len(m.FieldPath) copy(dAtA[i:], m.FieldPath) i = encodeVarintGenerated(dAtA, i, uint64(len(m.FieldPath))) @@ -3386,9 +3374,6 @@ func (m *ValidationRule) Size() (n int) { } l = len(m.FieldPath) n += 1 + l + sovGenerated(uint64(l)) - if m.OptionalOldSelf != nil { - n += 2 - } return n } @@ -3858,7 +3843,6 @@ func (this *ValidationRule) String() string { `MessageExpression:` + fmt.Sprintf("%v", this.MessageExpression) + `,`, `Reason:` + valueToStringGenerated(this.Reason) + `,`, `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, - `OptionalOldSelf:` + valueToStringGenerated(this.OptionalOldSelf) + `,`, `}`, }, "") return s @@ -9182,27 +9166,6 @@ func (m *ValidationRule) Unmarshal(dAtA []byte) error { } m.FieldPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OptionalOldSelf", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OptionalOldSelf = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto index b8477322b70..7cfb9c4dd5d 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto @@ -710,18 +710,6 @@ message ValidationRule { // - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with // non-intersecting keys are appended, retaining their partial order. - // - // If `rule` makes use of the `oldSelf` variable it is implicitly a - // `transition rule`. - // - // By default, the `oldSelf` variable is the same type as `self`. - // When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional - // variable whose value() is the same type as `self`. - // See the documentation for the `optionalOldSelf` field for details. - // - // Transition rules by default are applied only on UPDATE requests and are - // skipped if an old value could not be found. You can opt a transition - // rule into unconditional evaluation by setting `optionalOldSelf` to true. optional string rule = 1; // Message represents the message displayed when validation fails. The message is required if the Rule contains @@ -762,24 +750,6 @@ message ValidationRule { // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` // +optional optional string fieldPath = 5; - - // optionalOldSelf is used to opt a transition rule into evaluation - // even when the object is first created, or if the old object is - // missing the value. - // - // When enabled `oldSelf` will be a CEL optional whose value will be - // `None` if there is no old value, or when the object is initially created. - // - // You may check for presence of oldSelf using `oldSelf.hasValue()` and - // unwrap it after checking using `oldSelf.value()`. Check the CEL - // documentation for Optional types for more information: - // https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes - // - // May not be set unless `oldSelf` is used in `rule`. - // - // +featureGate=CRDValidationRatcheting - // +optional - optional bool optionalOldSelf = 6; } // WebhookClientConfig contains the information to make a TLS connection with the webhook. diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go index 24c45bb04eb..59a0932276d 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go @@ -249,19 +249,6 @@ type ValidationRule struct { // - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values // are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with // non-intersecting keys are appended, retaining their partial order. - // - // If `rule` makes use of the `oldSelf` variable it is implicitly a - // `transition rule`. - // - // By default, the `oldSelf` variable is the same type as `self`. - // When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional - // variable whose value() is the same type as `self`. - // See the documentation for the `optionalOldSelf` field for details. - // - // Transition rules by default are applied only on UPDATE requests and are - // skipped if an old value could not be found. You can opt a transition - // rule into unconditional evaluation by setting `optionalOldSelf` to true. - // Rule string `json:"rule" protobuf:"bytes,1,opt,name=rule"` // Message represents the message displayed when validation fails. The message is required if the Rule contains // line breaks. The message must not contain line breaks. @@ -298,24 +285,6 @@ type ValidationRule struct { // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` // +optional FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,5,opt,name=fieldPath"` - - // optionalOldSelf is used to opt a transition rule into evaluation - // even when the object is first created, or if the old object is - // missing the value. - // - // When enabled `oldSelf` will be a CEL optional whose value will be - // `None` if there is no old value, or when the object is initially created. - // - // You may check for presence of oldSelf using `oldSelf.hasValue()` and - // unwrap it after checking using `oldSelf.value()`. Check the CEL - // documentation for Optional types for more information: - // https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes - // - // May not be set unless `oldSelf` is used in `rule`. - // - // +featureGate=CRDValidationRatcheting - // +optional - OptionalOldSelf *bool `json:"optionalOldSelf,omitempty" protobuf:"bytes,6,opt,name=optionalOldSelf"` } // JSON represents any valid JSON value. diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go index fa6e0ef24e7..65c023f06ad 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go @@ -1309,7 +1309,6 @@ func autoConvert_v1beta1_ValidationRule_To_apiextensions_ValidationRule(in *Vali out.MessageExpression = in.MessageExpression out.Reason = (*apiextensions.FieldValueErrorReason)(unsafe.Pointer(in.Reason)) out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) return nil } @@ -1324,7 +1323,6 @@ func autoConvert_apiextensions_ValidationRule_To_v1beta1_ValidationRule(in *apie out.MessageExpression = in.MessageExpression out.Reason = (*FieldValueErrorReason)(unsafe.Pointer(in.Reason)) out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) return nil } diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go index bb8ab06cb95..9eeef6ca460 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go @@ -644,11 +644,6 @@ func (in *ValidationRule) DeepCopyInto(out *ValidationRule) { *out = new(FieldValueErrorReason) **out = **in } - if in.OptionalOldSelf != nil { - in, out := &in.OptionalOldSelf, &out.OptionalOldSelf - *out = new(bool) - **out = **in - } return } diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go index b5e5c35c550..f8a5ffbfbb0 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go @@ -536,11 +536,6 @@ func (in *ValidationRule) DeepCopyInto(out *ValidationRule) { *out = new(FieldValueErrorReason) **out = **in } - if in.OptionalOldSelf != nil { - in, out := &in.OptionalOldSelf, &out.OptionalOldSelf - *out = new(bool) - **out = **in - } return } diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go index c0eb0b51bd8..1d38873daef 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go @@ -30,7 +30,6 @@ type ValidationRuleApplyConfiguration struct { MessageExpression *string `json:"messageExpression,omitempty"` Reason *v1.FieldValueErrorReason `json:"reason,omitempty"` FieldPath *string `json:"fieldPath,omitempty"` - OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"` } // ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with @@ -78,11 +77,3 @@ func (b *ValidationRuleApplyConfiguration) WithFieldPath(value string) *Validati b.FieldPath = &value return b } - -// WithOptionalOldSelf sets the OptionalOldSelf field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the OptionalOldSelf field is set to the value of the last call. -func (b *ValidationRuleApplyConfiguration) WithOptionalOldSelf(value bool) *ValidationRuleApplyConfiguration { - b.OptionalOldSelf = &value - return b -} diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go index 1b0df078b5b..e52c203034c 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go @@ -30,7 +30,6 @@ type ValidationRuleApplyConfiguration struct { MessageExpression *string `json:"messageExpression,omitempty"` Reason *v1beta1.FieldValueErrorReason `json:"reason,omitempty"` FieldPath *string `json:"fieldPath,omitempty"` - OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"` } // ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with @@ -78,11 +77,3 @@ func (b *ValidationRuleApplyConfiguration) WithFieldPath(value string) *Validati b.FieldPath = &value return b } - -// WithOptionalOldSelf sets the OptionalOldSelf field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the OptionalOldSelf field is set to the value of the last call. -func (b *ValidationRuleApplyConfiguration) WithOptionalOldSelf(value bool) *ValidationRuleApplyConfiguration { - b.OptionalOldSelf = &value - return b -} diff --git a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go index 90319bd215a..9ccfd710c9c 100644 --- a/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go +++ b/upstream/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go @@ -42,7 +42,6 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration - transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -81,14 +80,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client clientset.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -193,7 +184,6 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go b/upstream/vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go index cbdf2eeb831..60c8209de02 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go @@ -22,15 +22,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// SetStatusCondition sets the corresponding condition in conditions to newCondition and returns true -// if the conditions are changed by this call. +// SetStatusCondition sets the corresponding condition in conditions to newCondition. // conditions must be non-nil. // 1. if the condition of the specified type already exists (all fields of the existing condition are updated to // newCondition, LastTransitionTime is set to now if the new status differs from the old status) // 2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended) -func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Condition) (changed bool) { +func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Condition) { if conditions == nil { - return false + return } existingCondition := FindStatusCondition(*conditions, newCondition.Type) if existingCondition == nil { @@ -38,7 +37,7 @@ func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Cond newCondition.LastTransitionTime = metav1.NewTime(time.Now()) } *conditions = append(*conditions, newCondition) - return true + return } if existingCondition.Status != newCondition.Status { @@ -48,31 +47,18 @@ func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Cond } else { existingCondition.LastTransitionTime = metav1.NewTime(time.Now()) } - changed = true } - if existingCondition.Reason != newCondition.Reason { - existingCondition.Reason = newCondition.Reason - changed = true - } - if existingCondition.Message != newCondition.Message { - existingCondition.Message = newCondition.Message - changed = true - } - if existingCondition.ObservedGeneration != newCondition.ObservedGeneration { - existingCondition.ObservedGeneration = newCondition.ObservedGeneration - changed = true - } - - return changed + existingCondition.Reason = newCondition.Reason + existingCondition.Message = newCondition.Message + existingCondition.ObservedGeneration = newCondition.ObservedGeneration } -// RemoveStatusCondition removes the corresponding conditionType from conditions if present. Returns -// true if it was present and got removed. +// RemoveStatusCondition removes the corresponding conditionType from conditions. // conditions must be non-nil. -func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string) (removed bool) { +func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string) { if conditions == nil || len(*conditions) == 0 { - return false + return } newConditions := make([]metav1.Condition, 0, len(*conditions)-1) for _, condition := range *conditions { @@ -81,10 +67,7 @@ func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string) } } - removed = len(*conditions) != len(newConditions) *conditions = newConditions - - return removed } // FindStatusCondition finds the conditionType in conditions. diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/amount.go b/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/amount.go index 2eebec667d3..a8866a43e10 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/amount.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/amount.go @@ -203,44 +203,6 @@ func (a *int64Amount) Sub(b int64Amount) bool { return a.Add(int64Amount{value: -b.value, scale: b.scale}) } -// Mul multiplies the provided b to the current amount, or -// returns false if overflow or underflow would result. -func (a *int64Amount) Mul(b int64) bool { - switch { - case a.value == 0: - return true - case b == 0: - a.value = 0 - a.scale = 0 - return true - case a.scale == 0: - c, ok := int64Multiply(a.value, b) - if !ok { - return false - } - a.value = c - case a.scale > 0: - c, ok := int64Multiply(a.value, b) - if !ok { - return false - } - if _, ok = positiveScaleInt64(c, a.scale); !ok { - return false - } - a.value = c - default: - c, ok := int64Multiply(a.value, b) - if !ok { - return false - } - if _, ok = negativeScaleInt64(c, -a.scale); !ok { - return false - } - a.value = c - } - return true -} - // AsScale adjusts this amount to set a minimum scale, rounding up, and returns true iff no precision // was lost. (1.1e5).AsScale(5) would return 1.1e5, but (1.1e5).AsScale(6) would return 1e6. func (a int64Amount) AsScale(scale Scale) (int64Amount, bool) { diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go index 69f1bc336d3..b47d554b3c5 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go @@ -592,16 +592,6 @@ func (q *Quantity) Sub(y Quantity) { q.ToDec().d.Dec.Sub(q.d.Dec, y.AsDec()) } -// Mul multiplies the provided y to the current value. -// It will return false if the result is inexact. Otherwise, it will return true. -func (q *Quantity) Mul(y int64) bool { - q.s = "" - if q.d.Dec == nil && q.i.Mul(y) { - return true - } - return q.ToDec().d.Dec.Mul(q.d.Dec, inf.NewDec(y, inf.Scale(0))).UnscaledBig().IsInt64() -} - // Cmp returns 0 if the quantity is equal to y, -1 if the quantity is less than y, or 1 if the // quantity is greater than y. func (q *Quantity) Cmp(y Quantity) int { diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go b/upstream/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go index 0f58d66c094..2e33283ef22 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go @@ -173,7 +173,7 @@ func NestedStringMap(obj map[string]interface{}, fields ...string) (map[string]s if str, ok := v.(string); ok { strMap[k] = str } else { - return nil, false, fmt.Errorf("%v accessor error: contains non-string value in the map under key %q: %v is of the type %T, expected string", jsonPath(fields), k, v, v) + return nil, false, fmt.Errorf("%v accessor error: contains non-string key in the map: %v is of the type %T, expected string", jsonPath(fields), v, v) } } return strMap, true, nil diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/runtime/helper.go b/upstream/vendor/k8s.io/apimachinery/pkg/runtime/helper.go index f46a24cc6c3..7bd1a3a6a5b 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/runtime/helper.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/runtime/helper.go @@ -257,26 +257,3 @@ func (d WithoutVersionDecoder) Decode(data []byte, defaults *schema.GroupVersion } return obj, gvk, err } - -type encoderWithAllocator struct { - encoder EncoderWithAllocator - memAllocator MemoryAllocator -} - -// NewEncoderWithAllocator returns a new encoder -func NewEncoderWithAllocator(e EncoderWithAllocator, a MemoryAllocator) Encoder { - return &encoderWithAllocator{ - encoder: e, - memAllocator: a, - } -} - -// Encode writes the provided object to the nested writer -func (e *encoderWithAllocator) Encode(obj Object, w io.Writer) error { - return e.encoder.EncodeWithAllocator(obj, w, e.memAllocator) -} - -// Identifier returns identifier of this encoder. -func (e *encoderWithAllocator) Identifier() Identifier { - return e.encoder.Identifier() -} diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming.go b/upstream/vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming.go index 971c46d496a..87b3fec3f2d 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming.go @@ -134,3 +134,23 @@ func (e *encoder) Encode(obj runtime.Object) error { e.buf.Reset() return err } + +type encoderWithAllocator struct { + writer io.Writer + encoder runtime.EncoderWithAllocator + memAllocator runtime.MemoryAllocator +} + +// NewEncoderWithAllocator returns a new streaming encoder +func NewEncoderWithAllocator(w io.Writer, e runtime.EncoderWithAllocator, a runtime.MemoryAllocator) Encoder { + return &encoderWithAllocator{ + writer: w, + encoder: e, + memAllocator: a, + } +} + +// Encode writes the provided object to the nested writer +func (e *encoderWithAllocator) Encode(obj runtime.Object) error { + return e.encoder.EncodeWithAllocator(obj, e.writer, e.memAllocator) +} diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/cache/lruexpirecache.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/cache/lruexpirecache.go index ad486d580f0..1328dd61202 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/cache/lruexpirecache.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/cache/lruexpirecache.go @@ -136,19 +136,6 @@ func (c *LRUExpireCache) Remove(key interface{}) { delete(c.entries, key) } -// RemoveAll removes all keys that match predicate. -func (c *LRUExpireCache) RemoveAll(predicate func(key any) bool) { - c.lock.Lock() - defer c.lock.Unlock() - - for key, element := range c.entries { - if predicate(key) { - c.evictionList.Remove(element) - delete(c.entries, key) - } - } -} - // Keys returns all unexpired keys in the cache. // // Keep in mind that subsequent calls to Get() for any of the returned keys diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go index a32fce5a0c1..32f075782a9 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go @@ -17,7 +17,6 @@ limitations under the License. package httpstream import ( - "errors" "fmt" "io" "net/http" @@ -96,26 +95,6 @@ type Stream interface { Identifier() uint32 } -// UpgradeFailureError encapsulates the cause for why the streaming -// upgrade request failed. Implements error interface. -type UpgradeFailureError struct { - Cause error -} - -func (u *UpgradeFailureError) Error() string { - return fmt.Sprintf("unable to upgrade streaming request: %s", u.Cause) -} - -// IsUpgradeFailure returns true if the passed error is (or wrapped error contains) -// the UpgradeFailureError. -func IsUpgradeFailure(err error) bool { - if err == nil { - return false - } - var upgradeErr *UpgradeFailureError - return errors.As(err, &upgradeErr) -} - // IsUpgradeRequest returns true if the given request is a connection upgrade request func IsUpgradeRequest(req *http.Request) bool { for _, h := range req.Header[http.CanonicalHeaderKey(HeaderConnection)] { diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go index c78326fa3b5..7fe52ee568e 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go @@ -38,7 +38,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/httpstream" utilnet "k8s.io/apimachinery/pkg/util/net" - apiproxy "k8s.io/apimachinery/pkg/util/proxy" "k8s.io/apimachinery/third_party/forked/golang/netutil" ) @@ -69,10 +68,6 @@ type SpdyRoundTripper struct { // pingPeriod is a period for sending Ping frames over established // connections. pingPeriod time.Duration - - // upgradeTransport is an optional substitute for dialing if present. This field is - // mutually exclusive with the "tlsConfig", "Dialer", and "proxier". - upgradeTransport http.RoundTripper } var _ utilnet.TLSClientConfigHolder = &SpdyRoundTripper{} @@ -81,61 +76,43 @@ var _ utilnet.Dialer = &SpdyRoundTripper{} // NewRoundTripper creates a new SpdyRoundTripper that will use the specified // tlsConfig. -func NewRoundTripper(tlsConfig *tls.Config) (*SpdyRoundTripper, error) { +func NewRoundTripper(tlsConfig *tls.Config) *SpdyRoundTripper { return NewRoundTripperWithConfig(RoundTripperConfig{ - TLS: tlsConfig, - UpgradeTransport: nil, + TLS: tlsConfig, }) } // NewRoundTripperWithProxy creates a new SpdyRoundTripper that will use the // specified tlsConfig and proxy func. -func NewRoundTripperWithProxy(tlsConfig *tls.Config, proxier func(*http.Request) (*url.URL, error)) (*SpdyRoundTripper, error) { +func NewRoundTripperWithProxy(tlsConfig *tls.Config, proxier func(*http.Request) (*url.URL, error)) *SpdyRoundTripper { return NewRoundTripperWithConfig(RoundTripperConfig{ - TLS: tlsConfig, - Proxier: proxier, - UpgradeTransport: nil, + TLS: tlsConfig, + Proxier: proxier, }) } // NewRoundTripperWithConfig creates a new SpdyRoundTripper with the specified -// configuration. Returns an error if the SpdyRoundTripper is misconfigured. -func NewRoundTripperWithConfig(cfg RoundTripperConfig) (*SpdyRoundTripper, error) { - // Process UpgradeTransport, which is mutually exclusive to TLSConfig and Proxier. - if cfg.UpgradeTransport != nil { - if cfg.TLS != nil || cfg.Proxier != nil { - return nil, fmt.Errorf("SpdyRoundTripper: UpgradeTransport is mutually exclusive to TLSConfig or Proxier") - } - tlsConfig, err := utilnet.TLSClientConfig(cfg.UpgradeTransport) - if err != nil { - return nil, fmt.Errorf("SpdyRoundTripper: Unable to retrieve TLSConfig from UpgradeTransport: %v", err) - } - cfg.TLS = tlsConfig - } +// configuration. +func NewRoundTripperWithConfig(cfg RoundTripperConfig) *SpdyRoundTripper { if cfg.Proxier == nil { cfg.Proxier = utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment) } return &SpdyRoundTripper{ - tlsConfig: cfg.TLS, - proxier: cfg.Proxier, - pingPeriod: cfg.PingPeriod, - upgradeTransport: cfg.UpgradeTransport, - }, nil + tlsConfig: cfg.TLS, + proxier: cfg.Proxier, + pingPeriod: cfg.PingPeriod, + } } // RoundTripperConfig is a set of options for an SpdyRoundTripper. type RoundTripperConfig struct { - // TLS configuration used by the round tripper if UpgradeTransport not present. + // TLS configuration used by the round tripper. TLS *tls.Config // Proxier is a proxy function invoked on each request. Optional. Proxier func(*http.Request) (*url.URL, error) // PingPeriod is a period for sending SPDY Pings on the connection. // Optional. PingPeriod time.Duration - // UpgradeTransport is a subtitute transport used for dialing. If set, - // this field will be used instead of "TLS" and "Proxier" for connection creation. - // Optional. - UpgradeTransport http.RoundTripper } // TLSClientConfig implements pkg/util/net.TLSClientConfigHolder for proper TLS checking during @@ -146,13 +123,7 @@ func (s *SpdyRoundTripper) TLSClientConfig() *tls.Config { // Dial implements k8s.io/apimachinery/pkg/util/net.Dialer. func (s *SpdyRoundTripper) Dial(req *http.Request) (net.Conn, error) { - var conn net.Conn - var err error - if s.upgradeTransport != nil { - conn, err = apiproxy.DialURL(req.Context(), req.URL, s.upgradeTransport) - } else { - conn, err = s.dial(req) - } + conn, err := s.dial(req) if err != nil { return nil, err } diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go index f358c794d10..0ea88156bef 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -72,14 +72,14 @@ func FromString(val string) IntOrString { return IntOrString{Type: String, StrVal: val} } -// Parse the given string and try to convert it to an int32 integer before +// Parse the given string and try to convert it to an integer before // setting it as a string value. func Parse(val string) IntOrString { - i, err := strconv.ParseInt(val, 10, 32) + i, err := strconv.Atoi(val) if err != nil { return FromString(val) } - return FromInt32(int32(i)) + return FromInt(i) } // UnmarshalJSON implements the json.Unmarshaller interface. diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go index 786ad991c23..2112c9ab7e9 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go @@ -25,7 +25,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/structured-merge-diff/v4/fieldpath" "sigs.k8s.io/structured-merge-diff/v4/merge" - "sigs.k8s.io/structured-merge-diff/v4/typed" ) type structuredMergeManager struct { @@ -96,11 +95,11 @@ func (f *structuredMergeManager) Update(liveObj, newObj runtime.Object, managed if err != nil { return nil, nil, fmt.Errorf("failed to convert live object (%v) to proper version: %v", objectGVKNN(liveObj), err) } - newObjTyped, err := f.typeConverter.ObjectToTyped(newObjVersioned, typed.AllowDuplicates) + newObjTyped, err := f.typeConverter.ObjectToTyped(newObjVersioned) if err != nil { return nil, nil, fmt.Errorf("failed to convert new object (%v) to smd typed: %v", objectGVKNN(newObjVersioned), err) } - liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned, typed.AllowDuplicates) + liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned) if err != nil { return nil, nil, fmt.Errorf("failed to convert live object (%v) to smd typed: %v", objectGVKNN(liveObjVersioned), err) } @@ -140,13 +139,11 @@ func (f *structuredMergeManager) Apply(liveObj, patchObj runtime.Object, managed return nil, nil, fmt.Errorf("failed to convert live object (%v) to proper version: %v", objectGVKNN(liveObj), err) } - // Don't allow duplicates in the applied object. patchObjTyped, err := f.typeConverter.ObjectToTyped(patchObj) if err != nil { return nil, nil, fmt.Errorf("failed to create typed patch object (%v): %v", objectGVKNN(patchObj), err) } - - liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned, typed.AllowDuplicates) + liveObjTyped, err := f.typeConverter.ObjectToTyped(liveObjVersioned) if err != nil { return nil, nil, fmt.Errorf("failed to create typed live object (%v): %v", objectGVKNN(liveObjVersioned), err) } diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go index c6449467cf8..1ac96d7f7bd 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go @@ -32,7 +32,7 @@ import ( // TypeConverter allows you to convert from runtime.Object to // typed.TypedValue and the other way around. type TypeConverter interface { - ObjectToTyped(runtime.Object, ...typed.ValidationOptions) (*typed.TypedValue, error) + ObjectToTyped(runtime.Object) (*typed.TypedValue, error) TypedToObject(*typed.TypedValue) (runtime.Object, error) } @@ -54,7 +54,7 @@ func NewTypeConverter(openapiSpec map[string]*spec.Schema, preserveUnknownFields return &typeConverter{parser: tr}, nil } -func (c *typeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) { +func (c *typeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { gvk := obj.GetObjectKind().GroupVersionKind() t := c.parser[gvk] if t == nil { @@ -62,9 +62,9 @@ func (c *typeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.Validati } switch o := obj.(type) { case *unstructured.Unstructured: - return t.FromUnstructured(o.UnstructuredContent(), opts...) + return t.FromUnstructured(o.UnstructuredContent()) default: - return t.FromStructured(obj, opts...) + return t.FromStructured(obj) } } @@ -84,12 +84,12 @@ func NewDeducedTypeConverter() TypeConverter { } // ObjectToTyped converts an object into a TypedValue with a "deduced type". -func (deducedTypeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) { +func (deducedTypeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { switch o := obj.(type) { case *unstructured.Unstructured: - return typed.DeducedParseableType.FromUnstructured(o.UnstructuredContent(), opts...) + return typed.DeducedParseableType.FromUnstructured(o.UnstructuredContent()) default: - return typed.DeducedParseableType.FromStructured(obj, opts...) + return typed.DeducedParseableType.FromStructured(obj) } } diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go deleted file mode 100644 index e5196d1ee83..00000000000 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package proxy - -import ( - "context" - "crypto/tls" - "fmt" - "net" - "net/http" - "net/url" - - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/third_party/forked/golang/netutil" - "k8s.io/klog/v2" -) - -// DialURL will dial the specified URL using the underlying dialer held by the passed -// RoundTripper. The primary use of this method is to support proxying upgradable connections. -// For this reason this method will prefer to negotiate http/1.1 if the URL scheme is https. -// If you wish to ensure ALPN negotiates http2 then set NextProto=[]string{"http2"} in the -// TLSConfig of the http.Transport -func DialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (net.Conn, error) { - dialAddr := netutil.CanonicalAddr(url) - - dialer, err := utilnet.DialerFor(transport) - if err != nil { - klog.V(5).Infof("Unable to unwrap transport %T to get dialer: %v", transport, err) - } - - switch url.Scheme { - case "http": - if dialer != nil { - return dialer(ctx, "tcp", dialAddr) - } - var d net.Dialer - return d.DialContext(ctx, "tcp", dialAddr) - case "https": - // Get the tls config from the transport if we recognize it - tlsConfig, err := utilnet.TLSClientConfig(transport) - if err != nil { - klog.V(5).Infof("Unable to unwrap transport %T to get at TLS config: %v", transport, err) - } - - if dialer != nil { - // We have a dialer; use it to open the connection, then - // create a tls client using the connection. - netConn, err := dialer(ctx, "tcp", dialAddr) - if err != nil { - return nil, err - } - if tlsConfig == nil { - // tls.Client requires non-nil config - klog.Warning("using custom dialer with no TLSClientConfig. Defaulting to InsecureSkipVerify") - // tls.Handshake() requires ServerName or InsecureSkipVerify - tlsConfig = &tls.Config{ - InsecureSkipVerify: true, - } - } else if len(tlsConfig.ServerName) == 0 && !tlsConfig.InsecureSkipVerify { - // tls.HandshakeContext() requires ServerName or InsecureSkipVerify - // infer the ServerName from the hostname we're connecting to. - inferredHost := dialAddr - if host, _, err := net.SplitHostPort(dialAddr); err == nil { - inferredHost = host - } - // Make a copy to avoid polluting the provided config - tlsConfigCopy := tlsConfig.Clone() - tlsConfigCopy.ServerName = inferredHost - tlsConfig = tlsConfigCopy - } - - // Since this method is primarily used within a "Connection: Upgrade" call we assume the caller is - // going to write HTTP/1.1 request to the wire. http2 should not be allowed in the TLSConfig.NextProtos, - // so we explicitly set that here. We only do this check if the TLSConfig support http/1.1. - if supportsHTTP11(tlsConfig.NextProtos) { - tlsConfig = tlsConfig.Clone() - tlsConfig.NextProtos = []string{"http/1.1"} - } - - tlsConn := tls.Client(netConn, tlsConfig) - if err := tlsConn.HandshakeContext(ctx); err != nil { - netConn.Close() - return nil, err - } - return tlsConn, nil - } else { - // Dial. - tlsDialer := tls.Dialer{ - Config: tlsConfig, - } - return tlsDialer.DialContext(ctx, "tcp", dialAddr) - } - default: - return nil, fmt.Errorf("unknown scheme: %s", url.Scheme) - } -} - -func supportsHTTP11(nextProtos []string) bool { - if len(nextProtos) == 0 { - return true - } - for _, proto := range nextProtos { - if proto == "http/1.1" { - return true - } - } - return false -} diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/doc.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/doc.go deleted file mode 100644 index d14ecfad544..00000000000 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package proxy provides transport and upgrade support for proxies. -package proxy // import "k8s.io/apimachinery/pkg/util/proxy" diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go deleted file mode 100644 index 5a2dd6e14c8..00000000000 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package proxy - -import ( - "bytes" - "compress/flate" - "compress/gzip" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - - "golang.org/x/net/html" - "golang.org/x/net/html/atom" - "k8s.io/klog/v2" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/sets" -) - -// atomsToAttrs states which attributes of which tags require URL substitution. -// Sources: http://www.w3.org/TR/REC-html40/index/attributes.html -// -// http://www.w3.org/html/wg/drafts/html/master/index.html#attributes-1 -var atomsToAttrs = map[atom.Atom]sets.String{ - atom.A: sets.NewString("href"), - atom.Applet: sets.NewString("codebase"), - atom.Area: sets.NewString("href"), - atom.Audio: sets.NewString("src"), - atom.Base: sets.NewString("href"), - atom.Blockquote: sets.NewString("cite"), - atom.Body: sets.NewString("background"), - atom.Button: sets.NewString("formaction"), - atom.Command: sets.NewString("icon"), - atom.Del: sets.NewString("cite"), - atom.Embed: sets.NewString("src"), - atom.Form: sets.NewString("action"), - atom.Frame: sets.NewString("longdesc", "src"), - atom.Head: sets.NewString("profile"), - atom.Html: sets.NewString("manifest"), - atom.Iframe: sets.NewString("longdesc", "src"), - atom.Img: sets.NewString("longdesc", "src", "usemap"), - atom.Input: sets.NewString("src", "usemap", "formaction"), - atom.Ins: sets.NewString("cite"), - atom.Link: sets.NewString("href"), - atom.Object: sets.NewString("classid", "codebase", "data", "usemap"), - atom.Q: sets.NewString("cite"), - atom.Script: sets.NewString("src"), - atom.Source: sets.NewString("src"), - atom.Video: sets.NewString("poster", "src"), - - // TODO: css URLs hidden in style elements. -} - -// Transport is a transport for text/html content that replaces URLs in html -// content with the prefix of the proxy server -type Transport struct { - Scheme string - Host string - PathPrepend string - - http.RoundTripper -} - -// RoundTrip implements the http.RoundTripper interface -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - // Add reverse proxy headers. - forwardedURI := path.Join(t.PathPrepend, req.URL.EscapedPath()) - if strings.HasSuffix(req.URL.Path, "/") { - forwardedURI = forwardedURI + "/" - } - req.Header.Set("X-Forwarded-Uri", forwardedURI) - if len(t.Host) > 0 { - req.Header.Set("X-Forwarded-Host", t.Host) - } - if len(t.Scheme) > 0 { - req.Header.Set("X-Forwarded-Proto", t.Scheme) - } - - rt := t.RoundTripper - if rt == nil { - rt = http.DefaultTransport - } - resp, err := rt.RoundTrip(req) - - if err != nil { - return nil, errors.NewServiceUnavailable(fmt.Sprintf("error trying to reach service: %v", err)) - } - - if redirect := resp.Header.Get("Location"); redirect != "" { - targetURL, err := url.Parse(redirect) - if err != nil { - return nil, errors.NewInternalError(fmt.Errorf("error trying to parse Location header: %v", err)) - } - resp.Header.Set("Location", t.rewriteURL(targetURL, req.URL, req.Host)) - return resp, nil - } - - cType := resp.Header.Get("Content-Type") - cType = strings.TrimSpace(strings.SplitN(cType, ";", 2)[0]) - if cType != "text/html" { - // Do nothing, simply pass through - return resp, nil - } - - return t.rewriteResponse(req, resp) -} - -var _ = net.RoundTripperWrapper(&Transport{}) - -func (rt *Transport) WrappedRoundTripper() http.RoundTripper { - return rt.RoundTripper -} - -// rewriteURL rewrites a single URL to go through the proxy, if the URL refers -// to the same host as sourceURL, which is the page on which the target URL -// occurred, or if the URL matches the sourceRequestHost. -func (t *Transport) rewriteURL(url *url.URL, sourceURL *url.URL, sourceRequestHost string) string { - // Example: - // When API server processes a proxy request to a service (e.g. /api/v1/namespace/foo/service/bar/proxy/), - // the sourceURL.Host (i.e. req.URL.Host) is the endpoint IP address of the service. The - // sourceRequestHost (i.e. req.Host) is the Host header that specifies the host on which the - // URL is sought, which can be different from sourceURL.Host. For example, if user sends the - // request through "kubectl proxy" locally (i.e. localhost:8001/api/v1/namespace/foo/service/bar/proxy/), - // sourceRequestHost is "localhost:8001". - // - // If the service's response URL contains non-empty host, and url.Host is equal to either sourceURL.Host - // or sourceRequestHost, we should not consider the returned URL to be a completely different host. - // It's the API server's responsibility to rewrite a same-host-and-absolute-path URL and append the - // necessary URL prefix (i.e. /api/v1/namespace/foo/service/bar/proxy/). - isDifferentHost := url.Host != "" && url.Host != sourceURL.Host && url.Host != sourceRequestHost - isRelative := !strings.HasPrefix(url.Path, "/") - if isDifferentHost || isRelative { - return url.String() - } - - // Do not rewrite scheme and host if the Transport has empty scheme and host - // when targetURL already contains the sourceRequestHost - if !(url.Host == sourceRequestHost && t.Scheme == "" && t.Host == "") { - url.Scheme = t.Scheme - url.Host = t.Host - } - - origPath := url.Path - // Do not rewrite URL if the sourceURL already contains the necessary prefix. - if strings.HasPrefix(url.Path, t.PathPrepend) { - return url.String() - } - url.Path = path.Join(t.PathPrepend, url.Path) - if strings.HasSuffix(origPath, "/") { - // Add back the trailing slash, which was stripped by path.Join(). - url.Path += "/" - } - - return url.String() -} - -// rewriteHTML scans the HTML for tags with url-valued attributes, and updates -// those values with the urlRewriter function. The updated HTML is output to the -// writer. -func rewriteHTML(reader io.Reader, writer io.Writer, urlRewriter func(*url.URL) string) error { - // Note: This assumes the content is UTF-8. - tokenizer := html.NewTokenizer(reader) - - var err error - for err == nil { - tokenType := tokenizer.Next() - switch tokenType { - case html.ErrorToken: - err = tokenizer.Err() - case html.StartTagToken, html.SelfClosingTagToken: - token := tokenizer.Token() - if urlAttrs, ok := atomsToAttrs[token.DataAtom]; ok { - for i, attr := range token.Attr { - if urlAttrs.Has(attr.Key) { - url, err := url.Parse(attr.Val) - if err != nil { - // Do not rewrite the URL if it isn't valid. It is intended not - // to error here to prevent the inability to understand the - // content of the body to cause a fatal error. - continue - } - token.Attr[i].Val = urlRewriter(url) - } - } - } - _, err = writer.Write([]byte(token.String())) - default: - _, err = writer.Write(tokenizer.Raw()) - } - } - if err != io.EOF { - return err - } - return nil -} - -// rewriteResponse modifies an HTML response by updating absolute links referring -// to the original host to instead refer to the proxy transport. -func (t *Transport) rewriteResponse(req *http.Request, resp *http.Response) (*http.Response, error) { - origBody := resp.Body - defer origBody.Close() - - newContent := &bytes.Buffer{} - var reader io.Reader = origBody - var writer io.Writer = newContent - encoding := resp.Header.Get("Content-Encoding") - switch encoding { - case "gzip": - var err error - reader, err = gzip.NewReader(reader) - if err != nil { - return nil, fmt.Errorf("errorf making gzip reader: %v", err) - } - gzw := gzip.NewWriter(writer) - defer gzw.Close() - writer = gzw - case "deflate": - var err error - reader = flate.NewReader(reader) - flw, err := flate.NewWriter(writer, flate.BestCompression) - if err != nil { - return nil, fmt.Errorf("errorf making flate writer: %v", err) - } - defer func() { - flw.Close() - flw.Flush() - }() - writer = flw - case "": - // This is fine - default: - // Some encoding we don't understand-- don't try to parse this - klog.Errorf("Proxy encountered encoding %v for text/html; can't understand this so not fixing links.", encoding) - return resp, nil - } - - urlRewriter := func(targetUrl *url.URL) string { - return t.rewriteURL(targetUrl, req.URL, req.Host) - } - err := rewriteHTML(reader, writer, urlRewriter) - if err != nil { - klog.Errorf("Failed to rewrite URLs: %v", err) - return resp, err - } - - resp.Body = io.NopCloser(newContent) - // Update header node with new content-length - // TODO: Remove any hash/signature headers here? - resp.Header.Del("Content-Length") - resp.ContentLength = int64(newContent.Len()) - - return resp, err -} diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go deleted file mode 100644 index 76acdfb4aca..00000000000 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go +++ /dev/null @@ -1,556 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package proxy - -import ( - "bufio" - "bytes" - "fmt" - "io" - "log" - "net" - "net/http" - "net/http/httputil" - "net/url" - "os" - "strings" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/util/httpstream" - utilnet "k8s.io/apimachinery/pkg/util/net" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - - "github.com/mxk/go-flowrate/flowrate" - "k8s.io/klog/v2" -) - -// UpgradeRequestRoundTripper provides an additional method to decorate a request -// with any authentication or other protocol level information prior to performing -// an upgrade on the server. Any response will be handled by the intercepting -// proxy. -type UpgradeRequestRoundTripper interface { - http.RoundTripper - // WrapRequest takes a valid HTTP request and returns a suitably altered version - // of request with any HTTP level values required to complete the request half of - // an upgrade on the server. It does not get a chance to see the response and - // should bypass any request side logic that expects to see the response. - WrapRequest(*http.Request) (*http.Request, error) -} - -// UpgradeAwareHandler is a handler for proxy requests that may require an upgrade -type UpgradeAwareHandler struct { - // UpgradeRequired will reject non-upgrade connections if true. - UpgradeRequired bool - // Location is the location of the upstream proxy. It is used as the location to Dial on the upstream server - // for upgrade requests unless UseRequestLocationOnUpgrade is true. - Location *url.URL - // AppendLocationPath determines if the original path of the Location should be appended to the upstream proxy request path - AppendLocationPath bool - // Transport provides an optional round tripper to use to proxy. If nil, the default proxy transport is used - Transport http.RoundTripper - // UpgradeTransport, if specified, will be used as the backend transport when upgrade requests are provided. - // This allows clients to disable HTTP/2. - UpgradeTransport UpgradeRequestRoundTripper - // WrapTransport indicates whether the provided Transport should be wrapped with default proxy transport behavior (URL rewriting, X-Forwarded-* header setting) - WrapTransport bool - // UseRequestLocation will use the incoming request URL when talking to the backend server. - UseRequestLocation bool - // UseLocationHost overrides the HTTP host header in requests to the backend server to use the Host from Location. - // This will override the req.Host field of a request, while UseRequestLocation will override the req.URL field - // of a request. The req.URL.Host specifies the server to connect to, while the req.Host field - // specifies the Host header value to send in the HTTP request. If this is false, the incoming req.Host header will - // just be forwarded to the backend server. - UseLocationHost bool - // FlushInterval controls how often the standard HTTP proxy will flush content from the upstream. - FlushInterval time.Duration - // MaxBytesPerSec controls the maximum rate for an upstream connection. No rate is imposed if the value is zero. - MaxBytesPerSec int64 - // Responder is passed errors that occur while setting up proxying. - Responder ErrorResponder - // Reject to forward redirect response - RejectForwardingRedirects bool -} - -const defaultFlushInterval = 200 * time.Millisecond - -// ErrorResponder abstracts error reporting to the proxy handler to remove the need to hardcode a particular -// error format. -type ErrorResponder interface { - Error(w http.ResponseWriter, req *http.Request, err error) -} - -// SimpleErrorResponder is the legacy implementation of ErrorResponder for callers that only -// service a single request/response per proxy. -type SimpleErrorResponder interface { - Error(err error) -} - -func NewErrorResponder(r SimpleErrorResponder) ErrorResponder { - return simpleResponder{r} -} - -type simpleResponder struct { - responder SimpleErrorResponder -} - -func (r simpleResponder) Error(w http.ResponseWriter, req *http.Request, err error) { - r.responder.Error(err) -} - -// upgradeRequestRoundTripper implements proxy.UpgradeRequestRoundTripper. -type upgradeRequestRoundTripper struct { - http.RoundTripper - upgrader http.RoundTripper -} - -var ( - _ UpgradeRequestRoundTripper = &upgradeRequestRoundTripper{} - _ utilnet.RoundTripperWrapper = &upgradeRequestRoundTripper{} -) - -// WrappedRoundTripper returns the round tripper that a caller would use. -func (rt *upgradeRequestRoundTripper) WrappedRoundTripper() http.RoundTripper { - return rt.RoundTripper -} - -// WriteToRequest calls the nested upgrader and then copies the returned request -// fields onto the passed request. -func (rt *upgradeRequestRoundTripper) WrapRequest(req *http.Request) (*http.Request, error) { - resp, err := rt.upgrader.RoundTrip(req) - if err != nil { - return nil, err - } - return resp.Request, nil -} - -// onewayRoundTripper captures the provided request - which is assumed to have -// been modified by other round trippers - and then returns a fake response. -type onewayRoundTripper struct{} - -// RoundTrip returns a simple 200 OK response that captures the provided request. -func (onewayRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - return &http.Response{ - Status: "200 OK", - StatusCode: http.StatusOK, - Body: io.NopCloser(&bytes.Buffer{}), - Request: req, - }, nil -} - -// MirrorRequest is a round tripper that can be called to get back the calling request as -// the core round tripper in a chain. -var MirrorRequest http.RoundTripper = onewayRoundTripper{} - -// NewUpgradeRequestRoundTripper takes two round trippers - one for the underlying TCP connection, and -// one that is able to write headers to an HTTP request. The request rt is used to set the request headers -// and that is written to the underlying connection rt. -func NewUpgradeRequestRoundTripper(connection, request http.RoundTripper) UpgradeRequestRoundTripper { - return &upgradeRequestRoundTripper{ - RoundTripper: connection, - upgrader: request, - } -} - -// normalizeLocation returns the result of parsing the full URL, with scheme set to http if missing -func normalizeLocation(location *url.URL) *url.URL { - normalized, _ := url.Parse(location.String()) - if len(normalized.Scheme) == 0 { - normalized.Scheme = "http" - } - return normalized -} - -// NewUpgradeAwareHandler creates a new proxy handler with a default flush interval. Responder is required for returning -// errors to the caller. -func NewUpgradeAwareHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder ErrorResponder) *UpgradeAwareHandler { - return &UpgradeAwareHandler{ - Location: normalizeLocation(location), - Transport: transport, - WrapTransport: wrapTransport, - UpgradeRequired: upgradeRequired, - FlushInterval: defaultFlushInterval, - Responder: responder, - } -} - -func proxyRedirectsforRootPath(path string, w http.ResponseWriter, req *http.Request) bool { - redirect := false - method := req.Method - - // From pkg/genericapiserver/endpoints/handlers/proxy.go#ServeHTTP: - // Redirect requests with an empty path to a location that ends with a '/' - // This is essentially a hack for https://issue.k8s.io/4958. - // Note: Keep this code after tryUpgrade to not break that flow. - if len(path) == 0 && (method == http.MethodGet || method == http.MethodHead) { - var queryPart string - if len(req.URL.RawQuery) > 0 { - queryPart = "?" + req.URL.RawQuery - } - w.Header().Set("Location", req.URL.Path+"/"+queryPart) - w.WriteHeader(http.StatusMovedPermanently) - redirect = true - } - return redirect -} - -// ServeHTTP handles the proxy request -func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - if h.tryUpgrade(w, req) { - return - } - if h.UpgradeRequired { - h.Responder.Error(w, req, errors.NewBadRequest("Upgrade request required")) - return - } - - loc := *h.Location - loc.RawQuery = req.URL.RawQuery - - // If original request URL ended in '/', append a '/' at the end of the - // of the proxy URL - if !strings.HasSuffix(loc.Path, "/") && strings.HasSuffix(req.URL.Path, "/") { - loc.Path += "/" - } - - proxyRedirect := proxyRedirectsforRootPath(loc.Path, w, req) - if proxyRedirect { - return - } - - if h.Transport == nil || h.WrapTransport { - h.Transport = h.defaultProxyTransport(req.URL, h.Transport) - } - - // WithContext creates a shallow clone of the request with the same context. - newReq := req.WithContext(req.Context()) - newReq.Header = utilnet.CloneHeader(req.Header) - if !h.UseRequestLocation { - newReq.URL = &loc - } - if h.UseLocationHost { - // exchanging req.Host with the backend location is necessary for backends that act on the HTTP host header (e.g. API gateways), - // because req.Host has preference over req.URL.Host in filling this header field - newReq.Host = h.Location.Host - } - - // create the target location to use for the reverse proxy - reverseProxyLocation := &url.URL{Scheme: h.Location.Scheme, Host: h.Location.Host} - if h.AppendLocationPath { - reverseProxyLocation.Path = h.Location.Path - } - - proxy := httputil.NewSingleHostReverseProxy(reverseProxyLocation) - proxy.Transport = h.Transport - proxy.FlushInterval = h.FlushInterval - proxy.ErrorLog = log.New(noSuppressPanicError{}, "", log.LstdFlags) - if h.RejectForwardingRedirects { - oldModifyResponse := proxy.ModifyResponse - proxy.ModifyResponse = func(response *http.Response) error { - code := response.StatusCode - if code >= 300 && code <= 399 && len(response.Header.Get("Location")) > 0 { - // close the original response - response.Body.Close() - msg := "the backend attempted to redirect this request, which is not permitted" - // replace the response - *response = http.Response{ - StatusCode: http.StatusBadGateway, - Status: fmt.Sprintf("%d %s", response.StatusCode, http.StatusText(response.StatusCode)), - Body: io.NopCloser(strings.NewReader(msg)), - ContentLength: int64(len(msg)), - } - } else { - if oldModifyResponse != nil { - if err := oldModifyResponse(response); err != nil { - return err - } - } - } - return nil - } - } - if h.Responder != nil { - // if an optional error interceptor/responder was provided wire it - // the custom responder might be used for providing a unified error reporting - // or supporting retry mechanisms by not sending non-fatal errors to the clients - proxy.ErrorHandler = h.Responder.Error - } - proxy.ServeHTTP(w, newReq) -} - -type noSuppressPanicError struct{} - -func (noSuppressPanicError) Write(p []byte) (n int, err error) { - // skip "suppressing panic for copyResponse error in test; copy error" error message - // that ends up in CI tests on each kube-apiserver termination as noise and - // everybody thinks this is fatal. - if strings.Contains(string(p), "suppressing panic") { - return len(p), nil - } - return os.Stderr.Write(p) -} - -// tryUpgrade returns true if the request was handled. -func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Request) bool { - if !httpstream.IsUpgradeRequest(req) { - klog.V(6).Infof("Request was not an upgrade") - return false - } - - var ( - backendConn net.Conn - rawResponse []byte - err error - ) - - location := *h.Location - if h.UseRequestLocation { - location = *req.URL - location.Scheme = h.Location.Scheme - location.Host = h.Location.Host - if h.AppendLocationPath { - location.Path = singleJoiningSlash(h.Location.Path, location.Path) - } - } - - clone := utilnet.CloneRequest(req) - // Only append X-Forwarded-For in the upgrade path, since httputil.NewSingleHostReverseProxy - // handles this in the non-upgrade path. - utilnet.AppendForwardedForHeader(clone) - klog.V(6).Infof("Connecting to backend proxy (direct dial) %s\n Headers: %v", &location, clone.Header) - if h.UseLocationHost { - clone.Host = h.Location.Host - } - clone.URL = &location - backendConn, err = h.DialForUpgrade(clone) - if err != nil { - klog.V(6).Infof("Proxy connection error: %v", err) - h.Responder.Error(w, req, err) - return true - } - defer backendConn.Close() - - // determine the http response code from the backend by reading from rawResponse+backendConn - backendHTTPResponse, headerBytes, err := getResponse(io.MultiReader(bytes.NewReader(rawResponse), backendConn)) - if err != nil { - klog.V(6).Infof("Proxy connection error: %v", err) - h.Responder.Error(w, req, err) - return true - } - if len(headerBytes) > len(rawResponse) { - // we read beyond the bytes stored in rawResponse, update rawResponse to the full set of bytes read from the backend - rawResponse = headerBytes - } - - // If the backend did not upgrade the request, return an error to the client. If the response was - // an error, the error is forwarded directly after the connection is hijacked. Otherwise, just - // return a generic error here. - if backendHTTPResponse.StatusCode != http.StatusSwitchingProtocols && backendHTTPResponse.StatusCode < 400 { - err := fmt.Errorf("invalid upgrade response: status code %d", backendHTTPResponse.StatusCode) - klog.Errorf("Proxy upgrade error: %v", err) - h.Responder.Error(w, req, err) - return true - } - - // Once the connection is hijacked, the ErrorResponder will no longer work, so - // hijacking should be the last step in the upgrade. - requestHijacker, ok := w.(http.Hijacker) - if !ok { - klog.V(6).Infof("Unable to hijack response writer: %T", w) - h.Responder.Error(w, req, fmt.Errorf("request connection cannot be hijacked: %T", w)) - return true - } - requestHijackedConn, _, err := requestHijacker.Hijack() - if err != nil { - klog.V(6).Infof("Unable to hijack response: %v", err) - h.Responder.Error(w, req, fmt.Errorf("error hijacking connection: %v", err)) - return true - } - defer requestHijackedConn.Close() - - if backendHTTPResponse.StatusCode != http.StatusSwitchingProtocols { - // If the backend did not upgrade the request, echo the response from the backend to the client and return, closing the connection. - klog.V(6).Infof("Proxy upgrade error, status code %d", backendHTTPResponse.StatusCode) - // set read/write deadlines - deadline := time.Now().Add(10 * time.Second) - backendConn.SetReadDeadline(deadline) - requestHijackedConn.SetWriteDeadline(deadline) - // write the response to the client - err := backendHTTPResponse.Write(requestHijackedConn) - if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - klog.Errorf("Error proxying data from backend to client: %v", err) - } - // Indicate we handled the request - return true - } - - // Forward raw response bytes back to client. - if len(rawResponse) > 0 { - klog.V(6).Infof("Writing %d bytes to hijacked connection", len(rawResponse)) - if _, err = requestHijackedConn.Write(rawResponse); err != nil { - utilruntime.HandleError(fmt.Errorf("Error proxying response from backend to client: %v", err)) - } - } - - // Proxy the connection. This is bidirectional, so we need a goroutine - // to copy in each direction. Once one side of the connection exits, we - // exit the function which performs cleanup and in the process closes - // the other half of the connection in the defer. - writerComplete := make(chan struct{}) - readerComplete := make(chan struct{}) - - go func() { - var writer io.WriteCloser - if h.MaxBytesPerSec > 0 { - writer = flowrate.NewWriter(backendConn, h.MaxBytesPerSec) - } else { - writer = backendConn - } - _, err := io.Copy(writer, requestHijackedConn) - if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - klog.Errorf("Error proxying data from client to backend: %v", err) - } - close(writerComplete) - }() - - go func() { - var reader io.ReadCloser - if h.MaxBytesPerSec > 0 { - reader = flowrate.NewReader(backendConn, h.MaxBytesPerSec) - } else { - reader = backendConn - } - _, err := io.Copy(requestHijackedConn, reader) - if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - klog.Errorf("Error proxying data from backend to client: %v", err) - } - close(readerComplete) - }() - - // Wait for one half the connection to exit. Once it does the defer will - // clean up the other half of the connection. - select { - case <-writerComplete: - case <-readerComplete: - } - klog.V(6).Infof("Disconnecting from backend proxy %s\n Headers: %v", &location, clone.Header) - - return true -} - -// FIXME: Taken from net/http/httputil/reverseproxy.go as singleJoiningSlash is not exported to be re-used. -// See-also: https://github.com/golang/go/issues/44290 -func singleJoiningSlash(a, b string) string { - aslash := strings.HasSuffix(a, "/") - bslash := strings.HasPrefix(b, "/") - switch { - case aslash && bslash: - return a + b[1:] - case !aslash && !bslash: - return a + "/" + b - } - return a + b -} - -func (h *UpgradeAwareHandler) DialForUpgrade(req *http.Request) (net.Conn, error) { - if h.UpgradeTransport == nil { - return dial(req, h.Transport) - } - updatedReq, err := h.UpgradeTransport.WrapRequest(req) - if err != nil { - return nil, err - } - return dial(updatedReq, h.UpgradeTransport) -} - -// getResponseCode reads a http response from the given reader, returns the response, -// the bytes read from the reader, and any error encountered -func getResponse(r io.Reader) (*http.Response, []byte, error) { - rawResponse := bytes.NewBuffer(make([]byte, 0, 256)) - // Save the bytes read while reading the response headers into the rawResponse buffer - resp, err := http.ReadResponse(bufio.NewReader(io.TeeReader(r, rawResponse)), nil) - if err != nil { - return nil, nil, err - } - // return the http response and the raw bytes consumed from the reader in the process - return resp, rawResponse.Bytes(), nil -} - -// dial dials the backend at req.URL and writes req to it. -func dial(req *http.Request, transport http.RoundTripper) (net.Conn, error) { - conn, err := DialURL(req.Context(), req.URL, transport) - if err != nil { - return nil, fmt.Errorf("error dialing backend: %v", err) - } - - if err = req.Write(conn); err != nil { - conn.Close() - return nil, fmt.Errorf("error sending request: %v", err) - } - - return conn, err -} - -func (h *UpgradeAwareHandler) defaultProxyTransport(url *url.URL, internalTransport http.RoundTripper) http.RoundTripper { - scheme := url.Scheme - host := url.Host - suffix := h.Location.Path - if strings.HasSuffix(url.Path, "/") && !strings.HasSuffix(suffix, "/") { - suffix += "/" - } - pathPrepend := strings.TrimSuffix(url.Path, suffix) - rewritingTransport := &Transport{ - Scheme: scheme, - Host: host, - PathPrepend: pathPrepend, - RoundTripper: internalTransport, - } - return &corsRemovingTransport{ - RoundTripper: rewritingTransport, - } -} - -// corsRemovingTransport is a wrapper for an internal transport. It removes CORS headers -// from the internal response. -// Implements pkg/util/net.RoundTripperWrapper -type corsRemovingTransport struct { - http.RoundTripper -} - -var _ = utilnet.RoundTripperWrapper(&corsRemovingTransport{}) - -func (rt *corsRemovingTransport) RoundTrip(req *http.Request) (*http.Response, error) { - resp, err := rt.RoundTripper.RoundTrip(req) - if err != nil { - return nil, err - } - removeCORSHeaders(resp) - return resp, nil -} - -func (rt *corsRemovingTransport) WrappedRoundTripper() http.RoundTripper { - return rt.RoundTripper -} - -// removeCORSHeaders strip CORS headers sent from the backend -// This should be called on all responses before returning -func removeCORSHeaders(resp *http.Response) { - resp.Header.Del("Access-Control-Allow-Credentials") - resp.Header.Del("Access-Control-Allow-Headers") - resp.Header.Del("Access-Control-Allow-Methods") - resp.Header.Del("Access-Control-Allow-Origin") -} diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/meta.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/meta.go index 85b0cfc0728..df305b712c5 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/meta.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/meta.go @@ -20,17 +20,12 @@ import ( "errors" "fmt" "reflect" - "strings" "k8s.io/apimachinery/pkg/util/mergepatch" forkedjson "k8s.io/apimachinery/third_party/forked/golang/json" openapi "k8s.io/kube-openapi/pkg/util/proto" - "k8s.io/kube-openapi/pkg/validation/spec" ) -const patchMergeKey = "x-kubernetes-patch-merge-key" -const patchStrategy = "x-kubernetes-patch-strategy" - type PatchMeta struct { patchStrategies []string patchMergeKey string @@ -153,90 +148,6 @@ func GetTagStructTypeOrDie(dataStruct interface{}) reflect.Type { return t } -type PatchMetaFromOpenAPIV3 struct { - // SchemaList is required to resolve OpenAPI V3 references - SchemaList map[string]*spec.Schema - Schema *spec.Schema -} - -func (s PatchMetaFromOpenAPIV3) traverse(key string) (PatchMetaFromOpenAPIV3, error) { - if s.Schema == nil { - return PatchMetaFromOpenAPIV3{}, nil - } - if len(s.Schema.Properties) == 0 { - return PatchMetaFromOpenAPIV3{}, fmt.Errorf("unable to find api field \"%s\"", key) - } - subschema, ok := s.Schema.Properties[key] - if !ok { - return PatchMetaFromOpenAPIV3{}, fmt.Errorf("unable to find api field \"%s\"", key) - } - return PatchMetaFromOpenAPIV3{SchemaList: s.SchemaList, Schema: &subschema}, nil -} - -func resolve(l *PatchMetaFromOpenAPIV3) error { - if len(l.Schema.AllOf) > 0 { - l.Schema = &l.Schema.AllOf[0] - } - if refString := l.Schema.Ref.String(); refString != "" { - str := strings.TrimPrefix(refString, "#/components/schemas/") - sch, ok := l.SchemaList[str] - if ok { - l.Schema = sch - } else { - return fmt.Errorf("unable to resolve %s in OpenAPI V3", refString) - } - } - return nil -} - -func (s PatchMetaFromOpenAPIV3) LookupPatchMetadataForStruct(key string) (LookupPatchMeta, PatchMeta, error) { - l, err := s.traverse(key) - if err != nil { - return l, PatchMeta{}, err - } - p := PatchMeta{} - f, ok := l.Schema.Extensions[patchMergeKey] - if ok { - p.SetPatchMergeKey(f.(string)) - } - g, ok := l.Schema.Extensions[patchStrategy] - if ok { - p.SetPatchStrategies(strings.Split(g.(string), ",")) - } - - err = resolve(&l) - return l, p, err -} - -func (s PatchMetaFromOpenAPIV3) LookupPatchMetadataForSlice(key string) (LookupPatchMeta, PatchMeta, error) { - l, err := s.traverse(key) - if err != nil { - return l, PatchMeta{}, err - } - p := PatchMeta{} - f, ok := l.Schema.Extensions[patchMergeKey] - if ok { - p.SetPatchMergeKey(f.(string)) - } - g, ok := l.Schema.Extensions[patchStrategy] - if ok { - p.SetPatchStrategies(strings.Split(g.(string), ",")) - } - if l.Schema.Items != nil { - l.Schema = l.Schema.Items.Schema - } - err = resolve(&l) - return l, p, err -} - -func (s PatchMetaFromOpenAPIV3) Name() string { - schema := s.Schema - if len(schema.Type) > 0 { - return strings.Join(schema.Type, "") - } - return "Struct" -} - type PatchMetaFromOpenAPI struct { Schema openapi.Schema } diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go index bc387d01163..ae73bda9666 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go @@ -200,12 +200,12 @@ func Invalid(field *Path, value interface{}, detail string) *Error { // NotSupported returns a *Error indicating "unsupported value". // This is used to report unknown values for enumerated fields (e.g. a list of // valid values). -func NotSupported[T ~string](field *Path, value interface{}, validValues []T) *Error { +func NotSupported(field *Path, value interface{}, validValues []string) *Error { detail := "" if len(validValues) > 0 { quotedValues := make([]string, len(validValues)) for i, v := range validValues { - quotedValues[i] = strconv.Quote(fmt.Sprint(v)) + quotedValues[i] = strconv.Quote(v) } detail = "supported values: " + strings.Join(quotedValues, ", ") } diff --git a/upstream/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go b/upstream/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go index 107bfc132fd..0dd13c626c8 100644 --- a/upstream/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go +++ b/upstream/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go @@ -40,10 +40,6 @@ func loopConditionUntilContext(ctx context.Context, t Timer, immediate, sliding var timeCh <-chan time.Time doneCh := ctx.Done() - if !sliding { - timeCh = t.C() - } - // if immediate is true the condition is // guaranteed to be executed at least once, // if we haven't requested immediate execution, delay once @@ -54,27 +50,17 @@ func loopConditionUntilContext(ctx context.Context, t Timer, immediate, sliding }(); err != nil || ok { return err } - } - - if sliding { + } else { timeCh = t.C() - } - - for { - - // Wait for either the context to be cancelled or the next invocation be called select { case <-doneCh: return ctx.Err() case <-timeCh: } + } - // IMPORTANT: Because there is no channel priority selection in golang - // it is possible for very short timers to "win" the race in the previous select - // repeatedly even when the context has been canceled. We therefore must - // explicitly check for context cancellation on every loop and exit if true to - // guarantee that we don't invoke condition more than once after context has - // been cancelled. + for { + // checking ctx.Err() is slightly faster than checking a select if err := ctx.Err(); err != nil { return err } @@ -91,5 +77,21 @@ func loopConditionUntilContext(ctx context.Context, t Timer, immediate, sliding if sliding { t.Next() } + + if timeCh == nil { + timeCh = t.C() + } + + // NOTE: b/c there is no priority selection in golang + // it is possible for this to race, meaning we could + // trigger t.C and doneCh, and t.C select falls through. + // In order to mitigate we re-check doneCh at the beginning + // of every loop to guarantee at-most one extra execution + // of condition. + select { + case <-doneCh: + return ctx.Err() + case <-timeCh: + } } } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go deleted file mode 100644 index 5aa686782b4..00000000000 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ClusterTrustBundleProjectionApplyConfiguration represents an declarative configuration of the ClusterTrustBundleProjection type for use -// with apply. -type ClusterTrustBundleProjectionApplyConfiguration struct { - Name *string `json:"name,omitempty"` - SignerName *string `json:"signerName,omitempty"` - LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` - Optional *bool `json:"optional,omitempty"` - Path *string `json:"path,omitempty"` -} - -// ClusterTrustBundleProjectionApplyConfiguration constructs an declarative configuration of the ClusterTrustBundleProjection type for use with -// apply. -func ClusterTrustBundleProjection() *ClusterTrustBundleProjectionApplyConfiguration { - return &ClusterTrustBundleProjectionApplyConfiguration{} -} - -// 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 *ClusterTrustBundleProjectionApplyConfiguration) WithName(value string) *ClusterTrustBundleProjectionApplyConfiguration { - b.Name = &value - return b -} - -// WithSignerName sets the SignerName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the SignerName field is set to the value of the last call. -func (b *ClusterTrustBundleProjectionApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleProjectionApplyConfiguration { - b.SignerName = &value - return b -} - -// WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LabelSelector field is set to the value of the last call. -func (b *ClusterTrustBundleProjectionApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *ClusterTrustBundleProjectionApplyConfiguration { - b.LabelSelector = value - return b -} - -// WithOptional sets the Optional field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Optional field is set to the value of the last call. -func (b *ClusterTrustBundleProjectionApplyConfiguration) WithOptional(value bool) *ClusterTrustBundleProjectionApplyConfiguration { - b.Optional = &value - return b -} - -// 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 *ClusterTrustBundleProjectionApplyConfiguration) WithPath(value string) *ClusterTrustBundleProjectionApplyConfiguration { - b.Path = &value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecyclehandler.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecyclehandler.go index e4ae9c49f79..6e373dd4ed1 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecyclehandler.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecyclehandler.go @@ -24,7 +24,6 @@ type LifecycleHandlerApplyConfiguration struct { Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"` TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` - Sleep *SleepActionApplyConfiguration `json:"sleep,omitempty"` } // LifecycleHandlerApplyConfiguration constructs an declarative configuration of the LifecycleHandler type for use with @@ -56,11 +55,3 @@ func (b *LifecycleHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActio b.TCPSocket = value return b } - -// WithSleep sets the Sleep field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Sleep field is set to the value of the last call. -func (b *LifecycleHandlerApplyConfiguration) WithSleep(value *SleepActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { - b.Sleep = value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/loadbalanceringress.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/loadbalanceringress.go index a48dac68107..64d27bdad50 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/loadbalanceringress.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/loadbalanceringress.go @@ -18,16 +18,11 @@ limitations under the License. package v1 -import ( - v1 "k8s.io/api/core/v1" -) - // LoadBalancerIngressApplyConfiguration represents an declarative configuration of the LoadBalancerIngress type for use // with apply. type LoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` - IPMode *v1.LoadBalancerIPMode `json:"ipMode,omitempty"` Ports []PortStatusApplyConfiguration `json:"ports,omitempty"` } @@ -53,14 +48,6 @@ func (b *LoadBalancerIngressApplyConfiguration) WithHostname(value string) *Load return b } -// WithIPMode sets the IPMode field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IPMode field is set to the value of the last call. -func (b *LoadBalancerIngressApplyConfiguration) WithIPMode(value v1.LoadBalancerIPMode) *LoadBalancerIngressApplyConfiguration { - b.IPMode = &value - return b -} - // WithPorts adds the given value to the Ports 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 Ports field. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go deleted file mode 100644 index 4ff1d040cf3..00000000000 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// ModifyVolumeStatusApplyConfiguration represents an declarative configuration of the ModifyVolumeStatus type for use -// with apply. -type ModifyVolumeStatusApplyConfiguration struct { - TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` - Status *v1.PersistentVolumeClaimModifyVolumeStatus `json:"status,omitempty"` -} - -// ModifyVolumeStatusApplyConfiguration constructs an declarative configuration of the ModifyVolumeStatus type for use with -// apply. -func ModifyVolumeStatus() *ModifyVolumeStatusApplyConfiguration { - return &ModifyVolumeStatusApplyConfiguration{} -} - -// WithTargetVolumeAttributesClassName sets the TargetVolumeAttributesClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TargetVolumeAttributesClassName field is set to the value of the last call. -func (b *ModifyVolumeStatusApplyConfiguration) WithTargetVolumeAttributesClassName(value string) *ModifyVolumeStatusApplyConfiguration { - b.TargetVolumeAttributesClassName = &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 *ModifyVolumeStatusApplyConfiguration) WithStatus(value v1.PersistentVolumeClaimModifyVolumeStatus) *ModifyVolumeStatusApplyConfiguration { - b.Status = &value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go index 4db12fadb38..f324584aba2 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go @@ -26,15 +26,14 @@ import ( // PersistentVolumeClaimSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimSpec type for use // with apply. type PersistentVolumeClaimSpecApplyConfiguration struct { - AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` - Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` - Resources *VolumeResourceRequirementsApplyConfiguration `json:"resources,omitempty"` - VolumeName *string `json:"volumeName,omitempty"` - StorageClassName *string `json:"storageClassName,omitempty"` - VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` - DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"` - DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"` - VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` + AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` + Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` + DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"` + DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"` } // PersistentVolumeClaimSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimSpec type for use with @@ -64,7 +63,7 @@ func (b *PersistentVolumeClaimSpecApplyConfiguration) WithSelector(value *metav1 // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. -func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *VolumeResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { b.Resources = value return b } @@ -108,11 +107,3 @@ func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSourceRef(value *T b.DataSourceRef = value return b } - -// WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. -func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration { - b.VolumeAttributesClassName = &value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go index 1f6d5ae3238..c29b2a9a155 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go @@ -25,14 +25,12 @@ import ( // PersistentVolumeClaimStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimStatus type for use // with apply. type PersistentVolumeClaimStatusApplyConfiguration struct { - Phase *v1.PersistentVolumeClaimPhase `json:"phase,omitempty"` - AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` - Capacity *v1.ResourceList `json:"capacity,omitempty"` - Conditions []PersistentVolumeClaimConditionApplyConfiguration `json:"conditions,omitempty"` - AllocatedResources *v1.ResourceList `json:"allocatedResources,omitempty"` - AllocatedResourceStatuses map[v1.ResourceName]v1.ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty"` - CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"` - ModifyVolumeStatus *ModifyVolumeStatusApplyConfiguration `json:"modifyVolumeStatus,omitempty"` + Phase *v1.PersistentVolumeClaimPhase `json:"phase,omitempty"` + AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` + Capacity *v1.ResourceList `json:"capacity,omitempty"` + Conditions []PersistentVolumeClaimConditionApplyConfiguration `json:"conditions,omitempty"` + AllocatedResources *v1.ResourceList `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[v1.ResourceName]v1.ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty"` } // PersistentVolumeClaimStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimStatus type for use with @@ -101,19 +99,3 @@ func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResourceSta } return b } - -// WithCurrentVolumeAttributesClassName sets the CurrentVolumeAttributesClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CurrentVolumeAttributesClassName field is set to the value of the last call. -func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCurrentVolumeAttributesClassName(value string) *PersistentVolumeClaimStatusApplyConfiguration { - b.CurrentVolumeAttributesClassName = &value - return b -} - -// WithModifyVolumeStatus sets the ModifyVolumeStatus field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ModifyVolumeStatus field is set to the value of the last call. -func (b *PersistentVolumeClaimStatusApplyConfiguration) WithModifyVolumeStatus(value *ModifyVolumeStatusApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { - b.ModifyVolumeStatus = value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go index 8a30dab6495..b3a72b1c3ef 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go @@ -34,7 +34,6 @@ type PersistentVolumeSpecApplyConfiguration struct { MountOptions []string `json:"mountOptions,omitempty"` VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` NodeAffinity *VolumeNodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` - VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` } // PersistentVolumeSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeSpec type for use with @@ -286,11 +285,3 @@ func (b *PersistentVolumeSpecApplyConfiguration) WithNodeAffinity(value *VolumeN b.NodeAffinity = value return b } - -// WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. -func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeSpecApplyConfiguration { - b.VolumeAttributesClassName = &value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/podaffinityterm.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/podaffinityterm.go index ac1eab3d8c7..7d2492203ee 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/podaffinityterm.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/podaffinityterm.go @@ -29,8 +29,6 @@ type PodAffinityTermApplyConfiguration struct { Namespaces []string `json:"namespaces,omitempty"` TopologyKey *string `json:"topologyKey,omitempty"` NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` - MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` - MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` } // PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with @@ -72,23 +70,3 @@ func (b *PodAffinityTermApplyConfiguration) WithNamespaceSelector(value *v1.Labe b.NamespaceSelector = value return b } - -// WithMatchLabelKeys adds the given value to the MatchLabelKeys 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 MatchLabelKeys field. -func (b *PodAffinityTermApplyConfiguration) WithMatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { - for i := range values { - b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) - } - return b -} - -// WithMismatchLabelKeys adds the given value to the MismatchLabelKeys 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 MismatchLabelKeys field. -func (b *PodAffinityTermApplyConfiguration) WithMismatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { - for i := range values { - b.MismatchLabelKeys = append(b.MismatchLabelKeys, values[i]) - } - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeprojection.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeprojection.go index a2ef0a9943d..8d16ea79eb2 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeprojection.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeprojection.go @@ -25,7 +25,6 @@ type VolumeProjectionApplyConfiguration struct { DownwardAPI *DownwardAPIProjectionApplyConfiguration `json:"downwardAPI,omitempty"` ConfigMap *ConfigMapProjectionApplyConfiguration `json:"configMap,omitempty"` ServiceAccountToken *ServiceAccountTokenProjectionApplyConfiguration `json:"serviceAccountToken,omitempty"` - ClusterTrustBundle *ClusterTrustBundleProjectionApplyConfiguration `json:"clusterTrustBundle,omitempty"` } // VolumeProjectionApplyConfiguration constructs an declarative configuration of the VolumeProjection type for use with @@ -65,11 +64,3 @@ func (b *VolumeProjectionApplyConfiguration) WithServiceAccountToken(value *Serv b.ServiceAccountToken = value return b } - -// WithClusterTrustBundle sets the ClusterTrustBundle field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ClusterTrustBundle field is set to the value of the last call. -func (b *VolumeProjectionApplyConfiguration) WithClusterTrustBundle(value *ClusterTrustBundleProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { - b.ClusterTrustBundle = value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go deleted file mode 100644 index 89ad1da8b33..00000000000 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// VolumeResourceRequirementsApplyConfiguration represents an declarative configuration of the VolumeResourceRequirements type for use -// with apply. -type VolumeResourceRequirementsApplyConfiguration struct { - Limits *v1.ResourceList `json:"limits,omitempty"` - Requests *v1.ResourceList `json:"requests,omitempty"` -} - -// VolumeResourceRequirementsApplyConfiguration constructs an declarative configuration of the VolumeResourceRequirements type for use with -// apply. -func VolumeResourceRequirements() *VolumeResourceRequirementsApplyConfiguration { - return &VolumeResourceRequirementsApplyConfiguration{} -} - -// WithLimits sets the Limits field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Limits field is set to the value of the last call. -func (b *VolumeResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { - b.Limits = &value - return b -} - -// WithRequests sets the Requests field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Requests field is set to the value of the last call. -func (b *VolumeResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { - b.Requests = &value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/exemptprioritylevelconfiguration.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/exemptprioritylevelconfiguration.go index cd21214f5ad..3535d747877 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/exemptprioritylevelconfiguration.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowdistinguishermethod.go similarity index 87% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowdistinguishermethod.go index d9c8a79cc88..507f8e9abe7 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowdistinguishermethod.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" ) // FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { - Type *v1.FlowDistinguisherMethodType `json:"type,omitempty"` + Type *v1alpha1.FlowDistinguisherMethodType `json:"type,omitempty"` } // FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with @@ -37,7 +37,7 @@ func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { // 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 *FlowDistinguisherMethodApplyConfiguration) WithType(value v1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { +func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1alpha1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { b.Type = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go similarity index 94% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go index 8809fafbaeb..20251d08bff 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -42,7 +42,7 @@ func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} b.WithName(name) b.WithKind("FlowSchema") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") return b } @@ -57,27 +57,27 @@ func FlowSchema(name string) *FlowSchemaApplyConfiguration { // 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 ExtractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { +func ExtractFlowSchema(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "") } // ExtractFlowSchemaStatus is the same as ExtractFlowSchema except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractFlowSchemaStatus(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { +func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "status") } -func extractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { +func extractFlowSchema(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { b := &FlowSchemaApplyConfiguration{} - err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1.FlowSchema"), fieldManager, b, subresource) + err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1alpha1.FlowSchema"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(flowSchema.Name) b.WithKind("FlowSchema") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") return b, nil } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemacondition.go similarity index 81% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemacondition.go index 808ab09a551..31f5dc13ed3 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemacondition.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { - Type *v1.FlowSchemaConditionType `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"` + Type *v1alpha1.FlowSchemaConditionType `json:"type,omitempty"` + Status *v1alpha1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` } // FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with @@ -42,7 +42,7 @@ func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { // 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 *FlowSchemaConditionApplyConfiguration) WithType(value v1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { +func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1alpha1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { b.Type = &value return b } @@ -50,7 +50,7 @@ func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1.FlowSchemaCond // 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 *FlowSchemaConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { +func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1alpha1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { b.Status = &value return b } @@ -58,7 +58,7 @@ func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1.ConditionSta // 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 *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *FlowSchemaConditionApplyConfiguration { +func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *FlowSchemaConditionApplyConfiguration { b.LastTransitionTime = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemaspec.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemaspec.go index 2785f5baf3b..fd5fc0ae9aa 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemaspec.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemastatus.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemastatus.go index 7c61360a535..db2dacf13af 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschemastatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/groupsubject.go similarity index 98% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/groupsubject.go index 92a03d86282..0421f3f5999 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/groupsubject.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitedprioritylevelconfiguration.go similarity index 90% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitedprioritylevelconfiguration.go index c19f0970357..10660e81aaf 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitedprioritylevelconfiguration.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` + AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"` LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` @@ -33,11 +33,11 @@ func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApply return &LimitedPriorityLevelConfigurationApplyConfiguration{} } -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value +// WithAssuredConcurrencyShares sets the AssuredConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value +// If called multiple times, the AssuredConcurrencyShares field is set to the value of the last call. +func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithAssuredConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { + b.AssuredConcurrencyShares = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitresponse.go similarity index 88% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitresponse.go index 03ff6d91035..5edaa025cdb 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/limitresponse.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" ) // LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { - Type *v1.LimitResponseType `json:"type,omitempty"` + Type *v1alpha1.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } @@ -38,7 +38,7 @@ func LimitResponse() *LimitResponseApplyConfiguration { // 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 *LimitResponseApplyConfiguration) WithType(value v1.LimitResponseType) *LimitResponseApplyConfiguration { +func (b *LimitResponseApplyConfiguration) WithType(value v1alpha1.LimitResponseType) *LimitResponseApplyConfiguration { b.Type = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/nonresourcepolicyrule.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/nonresourcepolicyrule.go index d9f8c2eccf6..b1f09f5304c 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/nonresourcepolicyrule.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/policyruleswithsubjects.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/policyruleswithsubjects.go index b193efa8bf0..84110406446 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/policyruleswithsubjects.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go similarity index 94% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go index e8a1b97c9f8..a40db75dcb5 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -42,7 +42,7 @@ func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyCon b := &PriorityLevelConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("PriorityLevelConfiguration") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") return b } @@ -57,27 +57,27 @@ func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyCon // 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 ExtractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { +func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") } // ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { +func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") } -func extractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { +func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { b := &PriorityLevelConfigurationApplyConfiguration{} - err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration"), fieldManager, b, subresource) + err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityLevelConfiguration.Name) b.WithKind("PriorityLevelConfiguration") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") return b, nil } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationcondition.go similarity index 81% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationcondition.go index 6ce588c8d94..bd91b80f21f 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationcondition.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { - Type *v1.PriorityLevelConfigurationConditionType `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"` + Type *v1alpha1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` + Status *v1alpha1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` } // PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with @@ -42,7 +42,7 @@ func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionA // 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 *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1alpha1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { b.Type = &value return b } @@ -50,7 +50,7 @@ func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v // 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 *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1alpha1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { b.Status = &value return b } @@ -58,7 +58,7 @@ func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value // 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 *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { b.LastTransitionTime = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationreference.go similarity index 98% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationreference.go index 0638aee8b80..b477c04df53 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationreference.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationspec.go similarity index 92% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationspec.go index 5d88749593c..ade920a7556 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationspec.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" ) // PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { - Type *v1.PriorityLevelEnablement `json:"type,omitempty"` + Type *v1alpha1.PriorityLevelEnablement `json:"type,omitempty"` Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } @@ -39,7 +39,7 @@ func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfig // 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 *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { +func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1alpha1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { b.Type = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationstatus.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationstatus.go index 322871edc69..eb3ef3d61d1 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfigurationstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/queuingconfiguration.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/queuingconfiguration.go index 69fd2c23ccb..0fccc3f08be 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/queuingconfiguration.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/resourcepolicyrule.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/resourcepolicyrule.go index 0991ce94454..d2c6f4eed6d 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/resourcepolicyrule.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/serviceaccountsubject.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/serviceaccountsubject.go index 55787ca7673..270b5225e14 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/serviceaccountsubject.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/subject.go similarity index 92% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/subject.go index f02b03bdc7c..83c09d644b2 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/subject.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" ) // SubjectApplyConfiguration represents an declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { - Kind *v1.SubjectKind `json:"kind,omitempty"` + Kind *v1alpha1.SubjectKind `json:"kind,omitempty"` User *UserSubjectApplyConfiguration `json:"user,omitempty"` Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` @@ -40,7 +40,7 @@ func Subject() *SubjectApplyConfiguration { // 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 *SubjectApplyConfiguration) WithKind(value v1.SubjectKind) *SubjectApplyConfiguration { +func (b *SubjectApplyConfiguration) WithKind(value v1alpha1.SubjectKind) *SubjectApplyConfiguration { b.Kind = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/usersubject.go similarity index 98% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/usersubject.go index 2d17c111c6a..a762c249e09 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/usersubject.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1alpha1 // UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use // with apply. diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go index 2ceb262217d..3ed553662f6 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -1013,6 +1013,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1074,6 +1075,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: data type: namedType: __untyped_atomic_ + default: {} - name: kind type: scalar: string @@ -1112,6 +1114,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1224,9 +1227,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1338,6 +1343,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1449,6 +1455,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1579,6 +1586,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: data type: namedType: __untyped_atomic_ + default: {} - name: kind type: scalar: string @@ -1617,9 +1625,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1758,6 +1768,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -1888,6 +1899,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: data type: namedType: __untyped_atomic_ + default: {} - name: kind type: scalar: string @@ -1926,6 +1938,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -2038,9 +2051,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -2152,6 +2167,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -2263,6 +2279,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -2589,6 +2606,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -2842,6 +2860,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: name type: scalar: string @@ -2885,6 +2904,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: metricName type: scalar: string @@ -2919,6 +2939,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -3046,6 +3067,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: targetValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus map: fields: @@ -3055,6 +3077,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: metricName type: scalar: string @@ -3079,12 +3102,14 @@ var schemaYAML = typed.YAMLObject(`types: - name: targetAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: io.k8s.api.autoscaling.v2beta1.PodsMetricStatus map: fields: - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: metricName type: scalar: string @@ -3114,6 +3139,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: name type: scalar: string @@ -3250,6 +3276,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -3564,9 +3591,11 @@ 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 @@ -3847,9 +3876,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -3971,9 +4002,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -4371,25 +4404,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: timeoutSeconds type: scalar: numeric -- name: io.k8s.api.core.v1.ClusterTrustBundleProjection - map: - fields: - - name: labelSelector - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - - name: name - type: - scalar: string - - name: optional - type: - scalar: boolean - - name: path - type: - scalar: string - default: "" - - name: signerName - type: - scalar: string - name: io.k8s.api.core.v1.ComponentCondition map: fields: @@ -4702,6 +4716,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: startedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: io.k8s.api.core.v1.ContainerStateTerminated map: fields: @@ -4715,6 +4730,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: finishedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -4727,6 +4743,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: startedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: io.k8s.api.core.v1.ContainerStateWaiting map: fields: @@ -5082,9 +5099,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: firstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: involvedObject type: namedType: io.k8s.api.core.v1.ObjectReference @@ -5095,6 +5114,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -5135,6 +5155,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: io.k8s.api.core.v1.EventSource map: fields: @@ -5317,6 +5338,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} - name: scheme type: scalar: string @@ -5475,9 +5497,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: httpGet type: namedType: io.k8s.api.core.v1.HTTPGetAction - - name: sleep - type: - namedType: io.k8s.api.core.v1.SleepAction - name: tcpSocket type: namedType: io.k8s.api.core.v1.TCPSocketAction @@ -5548,9 +5567,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: ip type: scalar: string - - name: ipMode - type: - scalar: string - name: ports type: list: @@ -5583,16 +5599,6 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.core.v1.ModifyVolumeStatus - map: - fields: - - name: status - type: - scalar: string - default: "" - - name: targetVolumeAttributesClassName - type: - scalar: string - name: io.k8s.api.core.v1.NFSVolumeSource map: fields: @@ -5634,6 +5640,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -5721,9 +5728,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastHeartbeatTime 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 @@ -6027,9 +6036,11 @@ 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 @@ -6061,7 +6072,7 @@ var schemaYAML = typed.YAMLObject(`types: namedType: io.k8s.api.core.v1.TypedObjectReference - name: resources type: - namedType: io.k8s.api.core.v1.VolumeResourceRequirements + namedType: io.k8s.api.core.v1.ResourceRequirements default: {} - name: selector type: @@ -6069,9 +6080,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: storageClassName type: scalar: string - - name: volumeAttributesClassName - type: - scalar: string - name: volumeMode type: scalar: string @@ -6111,12 +6119,6 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - type - - name: currentVolumeAttributesClassName - type: - scalar: string - - name: modifyVolumeStatus - type: - namedType: io.k8s.api.core.v1.ModifyVolumeStatus - name: phase type: scalar: string @@ -6237,9 +6239,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: storageos type: namedType: io.k8s.api.core.v1.StorageOSPersistentVolumeSource - - name: volumeAttributesClassName - type: - scalar: string - name: volumeMode type: scalar: string @@ -6313,18 +6312,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: labelSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - - name: matchLabelKeys - type: - list: - elementType: - scalar: string - elementRelationship: atomic - - name: mismatchLabelKeys - type: - list: - elementType: - scalar: string - elementRelationship: atomic - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector @@ -6359,9 +6346,11 @@ 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 @@ -6971,6 +6960,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -7046,6 +7036,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: divisor type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} - name: resource type: scalar: string @@ -7468,6 +7459,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: targetPort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} - name: io.k8s.api.core.v1.ServiceSpec map: fields: @@ -7570,13 +7562,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: clientIP type: namedType: io.k8s.api.core.v1.ClientIPConfig -- name: io.k8s.api.core.v1.SleepAction - map: - fields: - - name: seconds - type: - scalar: numeric - default: 0 - name: io.k8s.api.core.v1.StorageOSPersistentVolumeSource map: fields: @@ -7633,6 +7618,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} - name: io.k8s.api.core.v1.Taint map: fields: @@ -7893,9 +7879,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.core.v1.VolumeProjection map: fields: - - name: clusterTrustBundle - type: - namedType: io.k8s.api.core.v1.ClusterTrustBundleProjection - name: configMap type: namedType: io.k8s.api.core.v1.ConfigMapProjection @@ -7908,19 +7891,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: serviceAccountToken type: namedType: io.k8s.api.core.v1.ServiceAccountTokenProjection -- name: io.k8s.api.core.v1.VolumeResourceRequirements - map: - fields: - - name: limits - type: - map: - elementType: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - - name: requests - type: - map: - elementType: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource map: fields: @@ -8186,9 +8156,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: deprecatedFirstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: deprecatedLastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: deprecatedSource type: namedType: io.k8s.api.core.v1.EventSource @@ -8196,6 +8168,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: kind type: scalar: string @@ -8238,6 +8211,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: io.k8s.api.events.v1beta1.Event map: fields: @@ -8253,9 +8227,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: deprecatedFirstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: deprecatedLastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: deprecatedSource type: namedType: io.k8s.api.core.v1.EventSource @@ -8263,6 +8239,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: kind type: scalar: string @@ -8305,6 +8282,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} - name: io.k8s.api.extensions.v1beta1.DaemonSet map: fields: @@ -8332,6 +8310,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -8447,9 +8426,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -8605,6 +8586,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: servicePort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} - name: io.k8s.api.extensions.v1beta1.IngressLoadBalancerIngress map: fields: @@ -8815,6 +8797,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -8896,7 +8879,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString -- name: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration +- name: io.k8s.api.flowcontrol.v1alpha1.ExemptPriorityLevelConfiguration map: fields: - name: lendablePercent @@ -8905,14 +8888,14 @@ var schemaYAML = typed.YAMLObject(`types: - name: nominalConcurrencyShares type: scalar: numeric -- name: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod +- name: io.k8s.api.flowcontrol.v1alpha1.FlowDistinguisherMethod map: fields: - name: type type: scalar: string default: "" -- name: io.k8s.api.flowcontrol.v1.FlowSchema +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchema map: fields: - name: apiVersion @@ -8927,18 +8910,19 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.flowcontrol.v1.FlowSchemaSpec + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaSpec default: {} - name: status type: - namedType: io.k8s.api.flowcontrol.v1.FlowSchemaStatus + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaStatus default: {} -- name: io.k8s.api.flowcontrol.v1.FlowSchemaCondition +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -8951,50 +8935,50 @@ var schemaYAML = typed.YAMLObject(`types: - name: type type: scalar: string -- name: io.k8s.api.flowcontrol.v1.FlowSchemaSpec +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaSpec map: fields: - name: distinguisherMethod type: - namedType: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowDistinguisherMethod - name: matchingPrecedence type: scalar: numeric default: 0 - name: priorityLevelConfiguration type: - namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference default: {} - name: rules type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects + namedType: io.k8s.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects elementRelationship: atomic -- name: io.k8s.api.flowcontrol.v1.FlowSchemaStatus +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaStatus map: fields: - name: conditions type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.FlowSchemaCondition + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaCondition elementRelationship: associative keys: - type -- name: io.k8s.api.flowcontrol.v1.GroupSubject +- name: io.k8s.api.flowcontrol.v1alpha1.GroupSubject map: fields: - name: name type: scalar: string default: "" -- name: io.k8s.api.flowcontrol.v1.LimitResponse +- name: io.k8s.api.flowcontrol.v1alpha1.LimitResponse map: fields: - name: queuing type: - namedType: io.k8s.api.flowcontrol.v1.QueuingConfiguration + namedType: io.k8s.api.flowcontrol.v1alpha1.QueuingConfiguration - name: type type: scalar: string @@ -9004,9 +8988,13 @@ var schemaYAML = typed.YAMLObject(`types: fields: - fieldName: queuing discriminatorValue: Queuing -- name: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration +- name: io.k8s.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration map: fields: + - name: assuredConcurrencyShares + type: + scalar: numeric + default: 0 - name: borrowingLimitPercent type: scalar: numeric @@ -9015,12 +9003,9 @@ var schemaYAML = typed.YAMLObject(`types: scalar: numeric - name: limitResponse type: - namedType: io.k8s.api.flowcontrol.v1.LimitResponse + namedType: io.k8s.api.flowcontrol.v1alpha1.LimitResponse default: {} - - name: nominalConcurrencyShares - type: - scalar: numeric -- name: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule +- name: io.k8s.api.flowcontrol.v1alpha1.NonResourcePolicyRule map: fields: - name: nonResourceURLs @@ -9035,28 +9020,28 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative -- name: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects +- name: io.k8s.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects map: fields: - name: nonResourceRules type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule + namedType: io.k8s.api.flowcontrol.v1alpha1.NonResourcePolicyRule elementRelationship: atomic - name: resourceRules type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.ResourcePolicyRule + namedType: io.k8s.api.flowcontrol.v1alpha1.ResourcePolicyRule elementRelationship: atomic - name: subjects type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.Subject + namedType: io.k8s.api.flowcontrol.v1alpha1.Subject elementRelationship: atomic -- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfiguration map: fields: - name: apiVersion @@ -9071,18 +9056,19 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec default: {} - name: status type: - namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus default: {} -- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -9095,22 +9081,22 @@ var schemaYAML = typed.YAMLObject(`types: - name: type type: scalar: string -- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference map: fields: - name: name type: scalar: string default: "" -- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec map: fields: - name: exempt type: - namedType: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration + namedType: io.k8s.api.flowcontrol.v1alpha1.ExemptPriorityLevelConfiguration - name: limited type: - namedType: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration + namedType: io.k8s.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration - name: type type: scalar: string @@ -9122,18 +9108,18 @@ var schemaYAML = typed.YAMLObject(`types: discriminatorValue: Exempt - fieldName: limited discriminatorValue: Limited -- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus map: fields: - name: conditions type: list: elementType: - namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition elementRelationship: associative keys: - type -- name: io.k8s.api.flowcontrol.v1.QueuingConfiguration +- name: io.k8s.api.flowcontrol.v1alpha1.QueuingConfiguration map: fields: - name: handSize @@ -9148,7 +9134,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 -- name: io.k8s.api.flowcontrol.v1.ResourcePolicyRule +- name: io.k8s.api.flowcontrol.v1alpha1.ResourcePolicyRule map: fields: - name: apiGroups @@ -9178,7 +9164,7 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative -- name: io.k8s.api.flowcontrol.v1.ServiceAccountSubject +- name: io.k8s.api.flowcontrol.v1alpha1.ServiceAccountSubject map: fields: - name: name @@ -9189,22 +9175,22 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.flowcontrol.v1.Subject +- name: io.k8s.api.flowcontrol.v1alpha1.Subject map: fields: - name: group type: - namedType: io.k8s.api.flowcontrol.v1.GroupSubject + namedType: io.k8s.api.flowcontrol.v1alpha1.GroupSubject - name: kind type: scalar: string default: "" - name: serviceAccount type: - namedType: io.k8s.api.flowcontrol.v1.ServiceAccountSubject + namedType: io.k8s.api.flowcontrol.v1alpha1.ServiceAccountSubject - name: user type: - namedType: io.k8s.api.flowcontrol.v1.UserSubject + namedType: io.k8s.api.flowcontrol.v1alpha1.UserSubject unions: - discriminator: kind fields: @@ -9214,7 +9200,7 @@ var schemaYAML = typed.YAMLObject(`types: discriminatorValue: ServiceAccount - fieldName: user discriminatorValue: User -- name: io.k8s.api.flowcontrol.v1.UserSubject +- name: io.k8s.api.flowcontrol.v1alpha1.UserSubject map: fields: - name: name @@ -9264,6 +9250,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -9409,6 +9396,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -9590,6 +9578,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -9735,6 +9724,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -9916,6 +9906,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -10061,6 +10052,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -10572,7 +10564,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: number type: scalar: numeric -- name: io.k8s.api.networking.v1alpha1.IPAddress +- name: io.k8s.api.networking.v1alpha1.ClusterCIDR map: fields: - name: apiVersion @@ -10587,30 +10579,27 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.networking.v1alpha1.IPAddressSpec + namedType: io.k8s.api.networking.v1alpha1.ClusterCIDRSpec default: {} -- name: io.k8s.api.networking.v1alpha1.IPAddressSpec +- name: io.k8s.api.networking.v1alpha1.ClusterCIDRSpec map: fields: - - name: parentRef - type: - namedType: io.k8s.api.networking.v1alpha1.ParentReference -- name: io.k8s.api.networking.v1alpha1.ParentReference - map: - fields: - - name: group + - name: ipv4 type: scalar: string - - name: name + default: "" + - name: ipv6 type: scalar: string - - name: namespace + default: "" + - name: nodeSelector type: - scalar: string - - name: resource + namedType: io.k8s.api.core.v1.NodeSelector + - name: perNodeHostBits type: - scalar: string -- name: io.k8s.api.networking.v1alpha1.ServiceCIDR + scalar: numeric + default: 0 +- name: io.k8s.api.networking.v1alpha1.IPAddress map: fields: - name: apiVersion @@ -10625,32 +10614,32 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.networking.v1alpha1.ServiceCIDRSpec - default: {} - - name: status - type: - namedType: io.k8s.api.networking.v1alpha1.ServiceCIDRStatus + namedType: io.k8s.api.networking.v1alpha1.IPAddressSpec default: {} -- name: io.k8s.api.networking.v1alpha1.ServiceCIDRSpec +- name: io.k8s.api.networking.v1alpha1.IPAddressSpec map: fields: - - name: cidrs + - name: parentRef type: - list: - elementType: - scalar: string - elementRelationship: atomic -- name: io.k8s.api.networking.v1alpha1.ServiceCIDRStatus + namedType: io.k8s.api.networking.v1alpha1.ParentReference +- name: io.k8s.api.networking.v1alpha1.ParentReference map: fields: - - name: conditions + - name: group type: - list: - elementType: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition - elementRelationship: associative - keys: - - type + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resource + type: + scalar: string + - name: uid + type: + scalar: string - name: io.k8s.api.networking.v1beta1.HTTPIngressPath map: fields: @@ -10706,6 +10695,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: servicePort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} - name: io.k8s.api.networking.v1beta1.IngressClass map: fields: @@ -11071,6 +11061,29 @@ var schemaYAML = typed.YAMLObject(`types: - name: observedGeneration type: scalar: numeric +- name: io.k8s.api.policy.v1beta1.AllowedCSIDriver + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.AllowedFlexVolume + map: + fields: + - name: driver + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.AllowedHostPath + map: + fields: + - name: pathPrefix + type: + scalar: string + - name: readOnly + type: + scalar: boolean - name: io.k8s.api.policy.v1beta1.Eviction map: fields: @@ -11087,6 +11100,40 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} +- name: io.k8s.api.policy.v1beta1.FSGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string +- name: io.k8s.api.policy.v1beta1.HostPortRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 +- name: io.k8s.api.policy.v1beta1.IDRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 - name: io.k8s.api.policy.v1beta1.PodDisruptionBudget map: fields: @@ -11158,6 +11205,195 @@ var schemaYAML = typed.YAMLObject(`types: - name: observedGeneration type: scalar: numeric +- name: io.k8s.api.policy.v1beta1.PodSecurityPolicy + 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: io.k8s.api.policy.v1beta1.PodSecurityPolicySpec + default: {} +- name: io.k8s.api.policy.v1beta1.PodSecurityPolicySpec + map: + fields: + - name: allowPrivilegeEscalation + type: + scalar: boolean + - name: allowedCSIDrivers + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedCSIDriver + elementRelationship: atomic + - name: allowedCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedFlexVolumes + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedFlexVolume + elementRelationship: atomic + - name: allowedHostPaths + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedHostPath + elementRelationship: atomic + - name: allowedProcMountTypes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedUnsafeSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAddCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAllowPrivilegeEscalation + type: + scalar: boolean + - name: forbiddenSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: fsGroup + type: + namedType: io.k8s.api.policy.v1beta1.FSGroupStrategyOptions + default: {} + - name: hostIPC + type: + scalar: boolean + - name: hostNetwork + type: + scalar: boolean + - name: hostPID + type: + scalar: boolean + - name: hostPorts + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.HostPortRange + elementRelationship: atomic + - name: privileged + type: + scalar: boolean + - name: readOnlyRootFilesystem + type: + scalar: boolean + - name: requiredDropCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: runAsGroup + type: + namedType: io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions + - name: runAsUser + type: + namedType: io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions + default: {} + - name: runtimeClass + type: + namedType: io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions + - name: seLinux + type: + namedType: io.k8s.api.policy.v1beta1.SELinuxStrategyOptions + default: {} + - name: supplementalGroups + type: + namedType: io.k8s.api.policy.v1beta1.SupplementalGroupsStrategyOptions + default: {} + - name: volumes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions + map: + fields: + - name: allowedRuntimeClassNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultRuntimeClassName + type: + scalar: string +- name: io.k8s.api.policy.v1beta1.SELinuxStrategyOptions + map: + fields: + - name: rule + type: + scalar: string + default: "" + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions +- name: io.k8s.api.policy.v1beta1.SupplementalGroupsStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string - name: io.k8s.api.rbac.v1.AggregationRule map: fields: @@ -11687,7 +11923,7 @@ var schemaYAML = typed.YAMLObject(`types: list: elementType: scalar: string - elementRelationship: atomic + elementRelationship: associative - name: selectedNode type: scalar: string @@ -11766,7 +12002,7 @@ var schemaYAML = typed.YAMLObject(`types: list: elementType: scalar: string - elementRelationship: atomic + elementRelationship: associative - name: io.k8s.api.resource.v1alpha2.ResourceClaimSpec map: fields: @@ -12204,6 +12440,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: io.k8s.api.storage.v1.VolumeNodeResources map: fields: @@ -12299,28 +12536,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: detachError type: namedType: io.k8s.api.storage.v1alpha1.VolumeError -- name: io.k8s.api.storage.v1alpha1.VolumeAttributesClass - map: - fields: - - name: apiVersion - type: - scalar: string - - name: driverName - type: - scalar: string - default: "" - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: parameters - type: - map: - elementType: - scalar: string - name: io.k8s.api.storage.v1alpha1.VolumeError map: fields: @@ -12330,6 +12545,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: io.k8s.api.storage.v1beta1.CSIDriver map: fields: @@ -12579,6 +12795,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: io.k8s.api.storage.v1beta1.VolumeNodeResources map: fields: @@ -12593,6 +12810,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} - name: message type: scalar: string @@ -12720,6 +12938,7 @@ 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/upstream/vendor/k8s.io/client-go/applyconfigurations/meta/v1/unstructured.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/meta/v1/unstructured.go index a206bd326ae..8a58d9e8705 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/meta/v1/unstructured.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/meta/v1/unstructured.go @@ -125,7 +125,7 @@ func (e *extractor) extractUnstructured(object *unstructured.Unstructured, field return nil, fmt.Errorf("failed to fetch the objectType: %v", err) } result := &unstructured.Unstructured{} - err = managedfields.ExtractInto(object, *objectType, fieldManager, result, subresource) //nolint:forbidigo + err = managedfields.ExtractInto(object, *objectType, fieldManager, result, subresource) if err != nil { return nil, fmt.Errorf("failed calling ExtractInto for unstructured: %v", err) } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidr.go similarity index 68% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidr.go index f6d0a91e009..ad0eae9198e 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidr.go @@ -27,56 +27,55 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceCIDRApplyConfiguration represents an declarative configuration of the ServiceCIDR type for use +// ClusterCIDRApplyConfiguration represents an declarative configuration of the ClusterCIDR type for use // with apply. -type ServiceCIDRApplyConfiguration struct { +type ClusterCIDRApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` - Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` + Spec *ClusterCIDRSpecApplyConfiguration `json:"spec,omitempty"` } -// ServiceCIDR constructs an declarative configuration of the ServiceCIDR type for use with +// ClusterCIDR constructs an declarative configuration of the ClusterCIDR type for use with // apply. -func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { - b := &ServiceCIDRApplyConfiguration{} +func ClusterCIDR(name string) *ClusterCIDRApplyConfiguration { + b := &ClusterCIDRApplyConfiguration{} b.WithName(name) - b.WithKind("ServiceCIDR") + b.WithKind("ClusterCIDR") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b } -// ExtractServiceCIDR extracts the applied configuration owned by fieldManager from -// serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a -// ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), +// ExtractClusterCIDR extracts the applied configuration owned by fieldManager from +// clusterCIDR. If no managedFields are found in clusterCIDR for fieldManager, a +// ClusterCIDRApplyConfiguration 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. -// serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. -// ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. +// clusterCIDR must be a unmodified ClusterCIDR API object that was retrieved from the Kubernetes API. +// ExtractClusterCIDR 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 ExtractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { - return extractServiceCIDR(serviceCIDR, fieldManager, "") +func ExtractClusterCIDR(clusterCIDR *networkingv1alpha1.ClusterCIDR, fieldManager string) (*ClusterCIDRApplyConfiguration, error) { + return extractClusterCIDR(clusterCIDR, fieldManager, "") } -// ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except +// ExtractClusterCIDRStatus is the same as ExtractClusterCIDR except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractServiceCIDRStatus(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { - return extractServiceCIDR(serviceCIDR, fieldManager, "status") +func ExtractClusterCIDRStatus(clusterCIDR *networkingv1alpha1.ClusterCIDR, fieldManager string) (*ClusterCIDRApplyConfiguration, error) { + return extractClusterCIDR(clusterCIDR, fieldManager, "status") } -func extractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { - b := &ServiceCIDRApplyConfiguration{} - err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1alpha1.ServiceCIDR"), fieldManager, b, subresource) +func extractClusterCIDR(clusterCIDR *networkingv1alpha1.ClusterCIDR, fieldManager string, subresource string) (*ClusterCIDRApplyConfiguration, error) { + b := &ClusterCIDRApplyConfiguration{} + err := managedfields.ExtractInto(clusterCIDR, internal.Parser().Type("io.k8s.api.networking.v1alpha1.ClusterCIDR"), fieldManager, b, subresource) if err != nil { return nil, err } - b.WithName(serviceCIDR.Name) + b.WithName(clusterCIDR.Name) - b.WithKind("ServiceCIDR") + b.WithKind("ClusterCIDR") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b, nil } @@ -84,7 +83,7 @@ func extractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManage // 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 *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithKind(value string) *ClusterCIDRApplyConfiguration { b.Kind = &value return b } @@ -92,7 +91,7 @@ func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApply // 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 *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithAPIVersion(value string) *ClusterCIDRApplyConfiguration { b.APIVersion = &value return b } @@ -100,7 +99,7 @@ func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCID // 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 *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithName(value string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b @@ -109,7 +108,7 @@ func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApply // 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 *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithGenerateName(value string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b @@ -118,7 +117,7 @@ func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceC // 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 *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithNamespace(value string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b @@ -127,7 +126,7 @@ func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDR // 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 *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithUID(value types.UID) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b @@ -136,7 +135,7 @@ func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApp // 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 *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithResourceVersion(value string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b @@ -145,7 +144,7 @@ func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *Servi // 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 *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithGeneration(value int64) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b @@ -154,7 +153,7 @@ func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDR // 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 *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b @@ -163,7 +162,7 @@ func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) // 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 *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b @@ -172,7 +171,7 @@ func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) // 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 *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b @@ -182,7 +181,7 @@ func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int // 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 *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithLabels(entries map[string]string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) @@ -197,7 +196,7 @@ func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *S // 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 *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) @@ -211,7 +210,7 @@ func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]strin // 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 *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -225,7 +224,7 @@ func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerR // 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 *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithFinalizers(values ...string) *ClusterCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) @@ -233,7 +232,7 @@ func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *Servic return b } -func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *ClusterCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } @@ -242,15 +241,7 @@ func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists // 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 *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { +func (b *ClusterCIDRApplyConfiguration) WithSpec(value *ClusterCIDRSpecApplyConfiguration) *ClusterCIDRApplyConfiguration { 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 *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { - b.Status = value - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidrspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidrspec.go new file mode 100644 index 00000000000..8d5fa406b09 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidrspec.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// ClusterCIDRSpecApplyConfiguration represents an declarative configuration of the ClusterCIDRSpec type for use +// with apply. +type ClusterCIDRSpecApplyConfiguration struct { + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + PerNodeHostBits *int32 `json:"perNodeHostBits,omitempty"` + IPv4 *string `json:"ipv4,omitempty"` + IPv6 *string `json:"ipv6,omitempty"` +} + +// ClusterCIDRSpecApplyConfiguration constructs an declarative configuration of the ClusterCIDRSpec type for use with +// apply. +func ClusterCIDRSpec() *ClusterCIDRSpecApplyConfiguration { + return &ClusterCIDRSpecApplyConfiguration{} +} + +// 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 *ClusterCIDRSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ClusterCIDRSpecApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithPerNodeHostBits sets the PerNodeHostBits field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerNodeHostBits field is set to the value of the last call. +func (b *ClusterCIDRSpecApplyConfiguration) WithPerNodeHostBits(value int32) *ClusterCIDRSpecApplyConfiguration { + b.PerNodeHostBits = &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 *ClusterCIDRSpecApplyConfiguration) WithIPv4(value string) *ClusterCIDRSpecApplyConfiguration { + 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 *ClusterCIDRSpecApplyConfiguration) WithIPv6(value string) *ClusterCIDRSpecApplyConfiguration { + b.IPv6 = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/parentreference.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/parentreference.go index ce1049709a0..14b10b19ff6 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/parentreference.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/parentreference.go @@ -18,13 +18,18 @@ limitations under the License. package v1alpha1 +import ( + types "k8s.io/apimachinery/pkg/types" +) + // ParentReferenceApplyConfiguration represents an declarative configuration of the ParentReference type for use // with apply. type ParentReferenceApplyConfiguration struct { - Group *string `json:"group,omitempty"` - Resource *string `json:"resource,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name,omitempty"` + Group *string `json:"group,omitempty"` + Resource *string `json:"resource,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` } // ParentReferenceApplyConfiguration constructs an declarative configuration of the ParentReference type for use with @@ -64,3 +69,11 @@ func (b *ParentReferenceApplyConfiguration) WithName(value string) *ParentRefere b.Name = &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 *ParentReferenceApplyConfiguration) WithUID(value types.UID) *ParentReferenceApplyConfiguration { + b.UID = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go deleted file mode 100644 index 302d69194ce..00000000000 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ServiceCIDRSpecApplyConfiguration represents an declarative configuration of the ServiceCIDRSpec type for use -// with apply. -type ServiceCIDRSpecApplyConfiguration struct { - CIDRs []string `json:"cidrs,omitempty"` -} - -// ServiceCIDRSpecApplyConfiguration constructs an declarative configuration of the ServiceCIDRSpec type for use with -// apply. -func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { - return &ServiceCIDRSpecApplyConfiguration{} -} - -// WithCIDRs adds the given value to the CIDRs 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 CIDRs field. -func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { - for i := range values { - b.CIDRs = append(b.CIDRs, values[i]) - } - return b -} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go deleted file mode 100644 index 5afc549a650..00000000000 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ServiceCIDRStatusApplyConfiguration represents an declarative configuration of the ServiceCIDRStatus type for use -// with apply. -type ServiceCIDRStatusApplyConfiguration struct { - Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// ServiceCIDRStatusApplyConfiguration constructs an declarative configuration of the ServiceCIDRStatus type for use with -// apply. -func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { - return &ServiceCIDRStatusApplyConfiguration{} -} - -// 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 *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { - 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/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedcsidriver.go similarity index 51% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedcsidriver.go index 8b3284536ad..27b49bf1538 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedcsidriver.go @@ -16,24 +16,24 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1 +package v1beta1 -// SleepActionApplyConfiguration represents an declarative configuration of the SleepAction type for use +// AllowedCSIDriverApplyConfiguration represents an declarative configuration of the AllowedCSIDriver type for use // with apply. -type SleepActionApplyConfiguration struct { - Seconds *int64 `json:"seconds,omitempty"` +type AllowedCSIDriverApplyConfiguration struct { + Name *string `json:"name,omitempty"` } -// SleepActionApplyConfiguration constructs an declarative configuration of the SleepAction type for use with +// AllowedCSIDriverApplyConfiguration constructs an declarative configuration of the AllowedCSIDriver type for use with // apply. -func SleepAction() *SleepActionApplyConfiguration { - return &SleepActionApplyConfiguration{} +func AllowedCSIDriver() *AllowedCSIDriverApplyConfiguration { + return &AllowedCSIDriverApplyConfiguration{} } -// WithSeconds sets the Seconds field in the declarative configuration to the given value +// 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 Seconds field is set to the value of the last call. -func (b *SleepActionApplyConfiguration) WithSeconds(value int64) *SleepActionApplyConfiguration { - b.Seconds = &value +// If called multiple times, the Name field is set to the value of the last call. +func (b *AllowedCSIDriverApplyConfiguration) WithName(value string) *AllowedCSIDriverApplyConfiguration { + b.Name = &value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedflexvolume.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedflexvolume.go new file mode 100644 index 00000000000..30c3724cfee --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedflexvolume.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// AllowedFlexVolumeApplyConfiguration represents an 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 +// apply. +func AllowedFlexVolume() *AllowedFlexVolumeApplyConfiguration { + return &AllowedFlexVolumeApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *AllowedFlexVolumeApplyConfiguration) WithDriver(value string) *AllowedFlexVolumeApplyConfiguration { + b.Driver = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedhostpath.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedhostpath.go new file mode 100644 index 00000000000..493815d8d4a --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedhostpath.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// AllowedHostPathApplyConfiguration represents an declarative configuration of the AllowedHostPath type for use +// with apply. +type AllowedHostPathApplyConfiguration struct { + PathPrefix *string `json:"pathPrefix,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// AllowedHostPathApplyConfiguration constructs an declarative configuration of the AllowedHostPath type for use with +// apply. +func AllowedHostPath() *AllowedHostPathApplyConfiguration { + return &AllowedHostPathApplyConfiguration{} +} + +// WithPathPrefix sets the PathPrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PathPrefix field is set to the value of the last call. +func (b *AllowedHostPathApplyConfiguration) WithPathPrefix(value string) *AllowedHostPathApplyConfiguration { + b.PathPrefix = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *AllowedHostPathApplyConfiguration) WithReadOnly(value bool) *AllowedHostPathApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/fsgroupstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/fsgroupstrategyoptions.go new file mode 100644 index 00000000000..06803b439df --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/fsgroupstrategyoptions.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" +) + +// FSGroupStrategyOptionsApplyConfiguration represents an declarative configuration of the FSGroupStrategyOptions type for use +// with apply. +type FSGroupStrategyOptionsApplyConfiguration struct { + Rule *v1beta1.FSGroupStrategyType `json:"rule,omitempty"` + Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"` +} + +// FSGroupStrategyOptionsApplyConfiguration constructs an declarative configuration of the FSGroupStrategyOptions type for use with +// apply. +func FSGroupStrategyOptions() *FSGroupStrategyOptionsApplyConfiguration { + return &FSGroupStrategyOptionsApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *FSGroupStrategyOptionsApplyConfiguration) WithRule(value v1beta1.FSGroupStrategyType) *FSGroupStrategyOptionsApplyConfiguration { + b.Rule = &value + return b +} + +// WithRanges adds the given value to the Ranges 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 Ranges field. +func (b *FSGroupStrategyOptionsApplyConfiguration) WithRanges(values ...*IDRangeApplyConfiguration) *FSGroupStrategyOptionsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRanges") + } + b.Ranges = append(b.Ranges, *values[i]) + } + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/hostportrange.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/hostportrange.go new file mode 100644 index 00000000000..7c796881393 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/hostportrange.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// HostPortRangeApplyConfiguration represents an declarative configuration of the HostPortRange type for use +// with apply. +type HostPortRangeApplyConfiguration struct { + Min *int32 `json:"min,omitempty"` + Max *int32 `json:"max,omitempty"` +} + +// HostPortRangeApplyConfiguration constructs an declarative configuration of the HostPortRange type for use with +// apply. +func HostPortRange() *HostPortRangeApplyConfiguration { + return &HostPortRangeApplyConfiguration{} +} + +// WithMin sets the Min field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Min field is set to the value of the last call. +func (b *HostPortRangeApplyConfiguration) WithMin(value int32) *HostPortRangeApplyConfiguration { + b.Min = &value + return b +} + +// WithMax sets the Max field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Max field is set to the value of the last call. +func (b *HostPortRangeApplyConfiguration) WithMax(value int32) *HostPortRangeApplyConfiguration { + b.Max = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/idrange.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/idrange.go new file mode 100644 index 00000000000..af46f76581a --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/idrange.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// IDRangeApplyConfiguration represents an 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 +// apply. +func IDRange() *IDRangeApplyConfiguration { + return &IDRangeApplyConfiguration{} +} + +// WithMin sets the Min field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Min field is set to the value of the last call. +func (b *IDRangeApplyConfiguration) WithMin(value int64) *IDRangeApplyConfiguration { + b.Min = &value + return b +} + +// WithMax sets the Max field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Max field is set to the value of the last call. +func (b *IDRangeApplyConfiguration) WithMax(value int64) *IDRangeApplyConfiguration { + b.Max = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go similarity index 59% rename from upstream/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go rename to upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go index 9d4c476259e..46cfc4de1ec 100644 --- a/upstream/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "k8s.io/api/storage/v1alpha1" + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -27,64 +27,63 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeAttributesClassApplyConfiguration represents an declarative configuration of the VolumeAttributesClass type for use +// PodSecurityPolicyApplyConfiguration represents an declarative configuration of the PodSecurityPolicy type for use // with apply. -type VolumeAttributesClassApplyConfiguration struct { +type PodSecurityPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - DriverName *string `json:"driverName,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` + Spec *PodSecurityPolicySpecApplyConfiguration `json:"spec,omitempty"` } -// VolumeAttributesClass constructs an declarative configuration of the VolumeAttributesClass type for use with +// PodSecurityPolicy constructs an declarative configuration of the PodSecurityPolicy type for use with // apply. -func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { - b := &VolumeAttributesClassApplyConfiguration{} +func PodSecurityPolicy(name string) *PodSecurityPolicyApplyConfiguration { + b := &PodSecurityPolicyApplyConfiguration{} b.WithName(name) - b.WithKind("VolumeAttributesClass") - b.WithAPIVersion("storage.k8s.io/v1alpha1") + b.WithKind("PodSecurityPolicy") + b.WithAPIVersion("policy/v1beta1") return b } -// ExtractVolumeAttributesClass extracts the applied configuration owned by fieldManager from -// volumeAttributesClass. If no managedFields are found in volumeAttributesClass for fieldManager, a -// VolumeAttributesClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// ExtractPodSecurityPolicy extracts the applied configuration owned by fieldManager from +// podSecurityPolicy. If no managedFields are found in podSecurityPolicy for fieldManager, a +// PodSecurityPolicyApplyConfiguration 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. -// volumeAttributesClass must be a unmodified VolumeAttributesClass API object that was retrieved from the Kubernetes API. -// ExtractVolumeAttributesClass provides a way to perform a extract/modify-in-place/apply workflow. +// podSecurityPolicy must be a unmodified PodSecurityPolicy API object that was retrieved from the Kubernetes API. +// ExtractPodSecurityPolicy 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 ExtractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { - return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "") +func ExtractPodSecurityPolicy(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "") } -// ExtractVolumeAttributesClassStatus is the same as ExtractVolumeAttributesClass except +// ExtractPodSecurityPolicyStatus is the same as ExtractPodSecurityPolicy except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractVolumeAttributesClassStatus(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { - return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "status") +func ExtractPodSecurityPolicyStatus(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "status") } -func extractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string, subresource string) (*VolumeAttributesClassApplyConfiguration, error) { - b := &VolumeAttributesClassApplyConfiguration{} - err := managedfields.ExtractInto(volumeAttributesClass, internal.Parser().Type("io.k8s.api.storage.v1alpha1.VolumeAttributesClass"), fieldManager, b, subresource) +func extractPodSecurityPolicy(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string, subresource string) (*PodSecurityPolicyApplyConfiguration, error) { + b := &PodSecurityPolicyApplyConfiguration{} + err := managedfields.ExtractInto(podSecurityPolicy, internal.Parser().Type("io.k8s.api.policy.v1beta1.PodSecurityPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } - b.WithName(volumeAttributesClass.Name) + b.WithName(podSecurityPolicy.Name) - b.WithKind("VolumeAttributesClass") - b.WithAPIVersion("storage.k8s.io/v1alpha1") + b.WithKind("PodSecurityPolicy") + b.WithAPIVersion("policy/v1beta1") 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 *VolumeAttributesClassApplyConfiguration) WithKind(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithKind(value string) *PodSecurityPolicyApplyConfiguration { b.Kind = &value return b } @@ -92,7 +91,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithKind(value string) *Volume // 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 *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithAPIVersion(value string) *PodSecurityPolicyApplyConfiguration { b.APIVersion = &value return b } @@ -100,7 +99,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) * // 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 *VolumeAttributesClassApplyConfiguration) WithName(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithName(value string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b @@ -109,7 +108,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithName(value string) *Volume // 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 *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithGenerateName(value string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b @@ -118,7 +117,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) // 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 *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithNamespace(value string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b @@ -127,7 +126,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *V // 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 *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithUID(value types.UID) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b @@ -136,7 +135,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *Volu // 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 *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithResourceVersion(value string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b @@ -145,7 +144,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value stri // 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 *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithGeneration(value int64) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b @@ -154,7 +153,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *V // 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 *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b @@ -163,7 +162,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value me // 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 *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b @@ -172,7 +171,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value me // 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 *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b @@ -182,7 +181,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds // 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 *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithLabels(entries map[string]string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) @@ -197,7 +196,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string] // 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 *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) @@ -211,7 +210,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[st // 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 *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -225,7 +224,7 @@ func (b *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ... // 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 *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...string) *VolumeAttributesClassApplyConfiguration { +func (b *PodSecurityPolicyApplyConfiguration) WithFinalizers(values ...string) *PodSecurityPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) @@ -233,30 +232,16 @@ func (b *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...strin return b } -func (b *VolumeAttributesClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *PodSecurityPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } -// WithDriverName sets the DriverName field in the declarative configuration to the given value +// 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 DriverName field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithDriverName(value string) *VolumeAttributesClassApplyConfiguration { - b.DriverName = &value - return b -} - -// WithParameters puts the entries into the Parameters 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 Parameters field, -// overwriting an existing map entries in Parameters field with the same key. -func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[string]string) *VolumeAttributesClassApplyConfiguration { - if b.Parameters == nil && len(entries) > 0 { - b.Parameters = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Parameters[k] = v - } +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodSecurityPolicyApplyConfiguration) WithSpec(value *PodSecurityPolicySpecApplyConfiguration) *PodSecurityPolicyApplyConfiguration { + b.Spec = value return b } diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicyspec.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicyspec.go new file mode 100644 index 00000000000..bf951cf56b6 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicyspec.go @@ -0,0 +1,285 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + v1beta1 "k8s.io/api/policy/v1beta1" +) + +// PodSecurityPolicySpecApplyConfiguration represents an declarative configuration of the PodSecurityPolicySpec type for use +// with apply. +type PodSecurityPolicySpecApplyConfiguration struct { + Privileged *bool `json:"privileged,omitempty"` + DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty"` + RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty"` + AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty"` + Volumes []v1beta1.FSType `json:"volumes,omitempty"` + HostNetwork *bool `json:"hostNetwork,omitempty"` + HostPorts []HostPortRangeApplyConfiguration `json:"hostPorts,omitempty"` + HostPID *bool `json:"hostPID,omitempty"` + HostIPC *bool `json:"hostIPC,omitempty"` + SELinux *SELinuxStrategyOptionsApplyConfiguration `json:"seLinux,omitempty"` + RunAsUser *RunAsUserStrategyOptionsApplyConfiguration `json:"runAsUser,omitempty"` + RunAsGroup *RunAsGroupStrategyOptionsApplyConfiguration `json:"runAsGroup,omitempty"` + SupplementalGroups *SupplementalGroupsStrategyOptionsApplyConfiguration `json:"supplementalGroups,omitempty"` + FSGroup *FSGroupStrategyOptionsApplyConfiguration `json:"fsGroup,omitempty"` + ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"` + DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"` + AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` + AllowedHostPaths []AllowedHostPathApplyConfiguration `json:"allowedHostPaths,omitempty"` + AllowedFlexVolumes []AllowedFlexVolumeApplyConfiguration `json:"allowedFlexVolumes,omitempty"` + AllowedCSIDrivers []AllowedCSIDriverApplyConfiguration `json:"allowedCSIDrivers,omitempty"` + AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` + ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty"` + AllowedProcMountTypes []v1.ProcMountType `json:"allowedProcMountTypes,omitempty"` + RuntimeClass *RuntimeClassStrategyOptionsApplyConfiguration `json:"runtimeClass,omitempty"` +} + +// PodSecurityPolicySpecApplyConfiguration constructs an declarative configuration of the PodSecurityPolicySpec type for use with +// apply. +func PodSecurityPolicySpec() *PodSecurityPolicySpecApplyConfiguration { + return &PodSecurityPolicySpecApplyConfiguration{} +} + +// WithPrivileged sets the Privileged field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Privileged field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithPrivileged(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.Privileged = &value + return b +} + +// WithDefaultAddCapabilities adds the given value to the DefaultAddCapabilities 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 DefaultAddCapabilities field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithDefaultAddCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.DefaultAddCapabilities = append(b.DefaultAddCapabilities, values[i]) + } + return b +} + +// WithRequiredDropCapabilities adds the given value to the RequiredDropCapabilities 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 RequiredDropCapabilities field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithRequiredDropCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.RequiredDropCapabilities = append(b.RequiredDropCapabilities, values[i]) + } + return b +} + +// WithAllowedCapabilities adds the given value to the AllowedCapabilities 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 AllowedCapabilities field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.AllowedCapabilities = append(b.AllowedCapabilities, values[i]) + } + return b +} + +// WithVolumes adds the given value to the Volumes 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 Volumes field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithVolumes(values ...v1beta1.FSType) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.Volumes = append(b.Volumes, values[i]) + } + 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 *PodSecurityPolicySpecApplyConfiguration) WithHostNetwork(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.HostNetwork = &value + return b +} + +// WithHostPorts adds the given value to the HostPorts 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 HostPorts field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithHostPorts(values ...*HostPortRangeApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostPorts") + } + b.HostPorts = append(b.HostPorts, *values[i]) + } + return b +} + +// WithHostPID sets the HostPID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPID field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithHostPID(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.HostPID = &value + return b +} + +// WithHostIPC sets the HostIPC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostIPC field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithHostIPC(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.HostIPC = &value + return b +} + +// WithSELinux sets the SELinux field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SELinux field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithSELinux(value *SELinuxStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.SELinux = value + return b +} + +// WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsUser field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithRunAsUser(value *RunAsUserStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.RunAsUser = value + return b +} + +// WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsGroup field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithRunAsGroup(value *RunAsGroupStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.RunAsGroup = value + return b +} + +// WithSupplementalGroups sets the SupplementalGroups field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SupplementalGroups field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithSupplementalGroups(value *SupplementalGroupsStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.SupplementalGroups = value + return b +} + +// WithFSGroup sets the FSGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSGroup field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithFSGroup(value *FSGroupStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.FSGroup = value + return b +} + +// WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.ReadOnlyRootFilesystem = &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. +func (b *PodSecurityPolicySpecApplyConfiguration) WithDefaultAllowPrivilegeEscalation(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.DefaultAllowPrivilegeEscalation = &value + return b +} + +// WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *PodSecurityPolicySpecApplyConfiguration { + b.AllowPrivilegeEscalation = &value + return b +} + +// WithAllowedHostPaths adds the given value to the AllowedHostPaths 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 AllowedHostPaths field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedHostPaths(values ...*AllowedHostPathApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllowedHostPaths") + } + b.AllowedHostPaths = append(b.AllowedHostPaths, *values[i]) + } + return b +} + +// WithAllowedFlexVolumes adds the given value to the AllowedFlexVolumes 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 AllowedFlexVolumes field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedFlexVolumes(values ...*AllowedFlexVolumeApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllowedFlexVolumes") + } + b.AllowedFlexVolumes = append(b.AllowedFlexVolumes, *values[i]) + } + return b +} + +// WithAllowedCSIDrivers adds the given value to the AllowedCSIDrivers 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 AllowedCSIDrivers field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedCSIDrivers(values ...*AllowedCSIDriverApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllowedCSIDrivers") + } + b.AllowedCSIDrivers = append(b.AllowedCSIDrivers, *values[i]) + } + return b +} + +// WithAllowedUnsafeSysctls adds the given value to the AllowedUnsafeSysctls 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 AllowedUnsafeSysctls field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedUnsafeSysctls(values ...string) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.AllowedUnsafeSysctls = append(b.AllowedUnsafeSysctls, values[i]) + } + return b +} + +// WithForbiddenSysctls adds the given value to the ForbiddenSysctls 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 ForbiddenSysctls field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithForbiddenSysctls(values ...string) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.ForbiddenSysctls = append(b.ForbiddenSysctls, values[i]) + } + return b +} + +// WithAllowedProcMountTypes adds the given value to the AllowedProcMountTypes 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 AllowedProcMountTypes field. +func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedProcMountTypes(values ...v1.ProcMountType) *PodSecurityPolicySpecApplyConfiguration { + for i := range values { + b.AllowedProcMountTypes = append(b.AllowedProcMountTypes, values[i]) + } + return b +} + +// WithRuntimeClass sets the RuntimeClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuntimeClass field is set to the value of the last call. +func (b *PodSecurityPolicySpecApplyConfiguration) WithRuntimeClass(value *RuntimeClassStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { + b.RuntimeClass = value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasgroupstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasgroupstrategyoptions.go new file mode 100644 index 00000000000..fcfcfbe6b92 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasgroupstrategyoptions.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" +) + +// RunAsGroupStrategyOptionsApplyConfiguration represents an declarative configuration of the RunAsGroupStrategyOptions type for use +// with apply. +type RunAsGroupStrategyOptionsApplyConfiguration struct { + Rule *v1beta1.RunAsGroupStrategy `json:"rule,omitempty"` + Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"` +} + +// RunAsGroupStrategyOptionsApplyConfiguration constructs an declarative configuration of the RunAsGroupStrategyOptions type for use with +// apply. +func RunAsGroupStrategyOptions() *RunAsGroupStrategyOptionsApplyConfiguration { + return &RunAsGroupStrategyOptionsApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *RunAsGroupStrategyOptionsApplyConfiguration) WithRule(value v1beta1.RunAsGroupStrategy) *RunAsGroupStrategyOptionsApplyConfiguration { + b.Rule = &value + return b +} + +// WithRanges adds the given value to the Ranges 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 Ranges field. +func (b *RunAsGroupStrategyOptionsApplyConfiguration) WithRanges(values ...*IDRangeApplyConfiguration) *RunAsGroupStrategyOptionsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRanges") + } + b.Ranges = append(b.Ranges, *values[i]) + } + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasuserstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasuserstrategyoptions.go new file mode 100644 index 00000000000..a6d6ee58e37 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasuserstrategyoptions.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" +) + +// RunAsUserStrategyOptionsApplyConfiguration represents an declarative configuration of the RunAsUserStrategyOptions type for use +// with apply. +type RunAsUserStrategyOptionsApplyConfiguration struct { + Rule *v1beta1.RunAsUserStrategy `json:"rule,omitempty"` + Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"` +} + +// RunAsUserStrategyOptionsApplyConfiguration constructs an declarative configuration of the RunAsUserStrategyOptions type for use with +// apply. +func RunAsUserStrategyOptions() *RunAsUserStrategyOptionsApplyConfiguration { + return &RunAsUserStrategyOptionsApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *RunAsUserStrategyOptionsApplyConfiguration) WithRule(value v1beta1.RunAsUserStrategy) *RunAsUserStrategyOptionsApplyConfiguration { + b.Rule = &value + return b +} + +// WithRanges adds the given value to the Ranges 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 Ranges field. +func (b *RunAsUserStrategyOptionsApplyConfiguration) WithRanges(values ...*IDRangeApplyConfiguration) *RunAsUserStrategyOptionsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRanges") + } + b.Ranges = append(b.Ranges, *values[i]) + } + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runtimeclassstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runtimeclassstrategyoptions.go new file mode 100644 index 00000000000..c19a7ce6175 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runtimeclassstrategyoptions.go @@ -0,0 +1,50 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// RuntimeClassStrategyOptionsApplyConfiguration represents an declarative configuration of the RuntimeClassStrategyOptions type for use +// with apply. +type RuntimeClassStrategyOptionsApplyConfiguration struct { + AllowedRuntimeClassNames []string `json:"allowedRuntimeClassNames,omitempty"` + DefaultRuntimeClassName *string `json:"defaultRuntimeClassName,omitempty"` +} + +// RuntimeClassStrategyOptionsApplyConfiguration constructs an declarative configuration of the RuntimeClassStrategyOptions type for use with +// apply. +func RuntimeClassStrategyOptions() *RuntimeClassStrategyOptionsApplyConfiguration { + return &RuntimeClassStrategyOptionsApplyConfiguration{} +} + +// WithAllowedRuntimeClassNames adds the given value to the AllowedRuntimeClassNames 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 AllowedRuntimeClassNames field. +func (b *RuntimeClassStrategyOptionsApplyConfiguration) WithAllowedRuntimeClassNames(values ...string) *RuntimeClassStrategyOptionsApplyConfiguration { + for i := range values { + b.AllowedRuntimeClassNames = append(b.AllowedRuntimeClassNames, values[i]) + } + return b +} + +// WithDefaultRuntimeClassName sets the DefaultRuntimeClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultRuntimeClassName field is set to the value of the last call. +func (b *RuntimeClassStrategyOptionsApplyConfiguration) WithDefaultRuntimeClassName(value string) *RuntimeClassStrategyOptionsApplyConfiguration { + b.DefaultRuntimeClassName = &value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/selinuxstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/selinuxstrategyoptions.go new file mode 100644 index 00000000000..de7ede618e9 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/selinuxstrategyoptions.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// SELinuxStrategyOptionsApplyConfiguration represents an declarative configuration of the SELinuxStrategyOptions type for use +// with apply. +type SELinuxStrategyOptionsApplyConfiguration struct { + Rule *v1beta1.SELinuxStrategy `json:"rule,omitempty"` + SELinuxOptions *v1.SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` +} + +// SELinuxStrategyOptionsApplyConfiguration constructs an declarative configuration of the SELinuxStrategyOptions type for use with +// apply. +func SELinuxStrategyOptions() *SELinuxStrategyOptionsApplyConfiguration { + return &SELinuxStrategyOptionsApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *SELinuxStrategyOptionsApplyConfiguration) WithRule(value v1beta1.SELinuxStrategy) *SELinuxStrategyOptionsApplyConfiguration { + b.Rule = &value + return b +} + +// WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SELinuxOptions field is set to the value of the last call. +func (b *SELinuxStrategyOptionsApplyConfiguration) WithSELinuxOptions(value *v1.SELinuxOptionsApplyConfiguration) *SELinuxStrategyOptionsApplyConfiguration { + b.SELinuxOptions = value + return b +} diff --git a/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/supplementalgroupsstrategyoptions.go b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/supplementalgroupsstrategyoptions.go new file mode 100644 index 00000000000..9e4a9bb2ca3 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/supplementalgroupsstrategyoptions.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" +) + +// SupplementalGroupsStrategyOptionsApplyConfiguration represents an declarative configuration of the SupplementalGroupsStrategyOptions type for use +// with apply. +type SupplementalGroupsStrategyOptionsApplyConfiguration struct { + Rule *v1beta1.SupplementalGroupsStrategyType `json:"rule,omitempty"` + Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"` +} + +// SupplementalGroupsStrategyOptionsApplyConfiguration constructs an declarative configuration of the SupplementalGroupsStrategyOptions type for use with +// apply. +func SupplementalGroupsStrategyOptions() *SupplementalGroupsStrategyOptionsApplyConfiguration { + return &SupplementalGroupsStrategyOptionsApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *SupplementalGroupsStrategyOptionsApplyConfiguration) WithRule(value v1beta1.SupplementalGroupsStrategyType) *SupplementalGroupsStrategyOptionsApplyConfiguration { + b.Rule = &value + return b +} + +// WithRanges adds the given value to the Ranges 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 Ranges field. +func (b *SupplementalGroupsStrategyOptionsApplyConfiguration) WithRanges(values ...*IDRangeApplyConfiguration) *SupplementalGroupsStrategyOptionsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRanges") + } + b.Ranges = append(b.Ranges, *values[i]) + } + return b +} diff --git a/upstream/vendor/k8s.io/client-go/discovery/discovery_client.go b/upstream/vendor/k8s.io/client-go/discovery/discovery_client.go index df0e0f9974e..102ce49bf59 100644 --- a/upstream/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/upstream/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -19,7 +19,6 @@ package discovery import ( "context" "encoding/json" - goerrors "errors" "fmt" "mime" "net/http" @@ -420,12 +419,6 @@ func (e *ErrGroupDiscoveryFailed) Error() string { return fmt.Sprintf("unable to retrieve the complete list of server APIs: %s", strings.Join(groups, ", ")) } -// Is makes it possible for the callers to use `errors.Is(` helper on errors wrapped with ErrGroupDiscoveryFailed error. -func (e *ErrGroupDiscoveryFailed) Is(target error) bool { - _, ok := target.(*ErrGroupDiscoveryFailed) - return ok -} - // IsGroupDiscoveryFailedError returns true if the provided error indicates the server was unable to discover // a complete list of APIs for the client to use. func IsGroupDiscoveryFailedError(err error) bool { @@ -433,16 +426,6 @@ func IsGroupDiscoveryFailedError(err error) bool { return err != nil && ok } -// GroupDiscoveryFailedErrorGroups returns true if the error is an ErrGroupDiscoveryFailed error, -// along with the map of group versions that failed discovery. -func GroupDiscoveryFailedErrorGroups(err error) (map[schema.GroupVersion]error, bool) { - var groupDiscoveryError *ErrGroupDiscoveryFailed - if err != nil && goerrors.As(err, &groupDiscoveryError) { - return groupDiscoveryError.Groups, true - } - return nil, false -} - func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { var sgs *metav1.APIGroupList var resources []*metav1.APIResourceList @@ -654,7 +637,16 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", openAPIV2mimePb).Do(context.TODO()).Raw() if err != nil { - return nil, err + if errors.IsForbidden(err) || errors.IsNotFound(err) || errors.IsNotAcceptable(err) { + // single endpoint not found/registered in old server, try to fetch old endpoint + // TODO: remove this when kubectl/client-go don't work with 1.9 server + data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do(context.TODO()).Raw() + if err != nil { + return nil, err + } + } else { + return nil, err + } } document := &openapi_v2.Document{} err = proto.Unmarshal(data, document) diff --git a/upstream/vendor/k8s.io/client-go/informers/factory.go b/upstream/vendor/k8s.io/client-go/informers/factory.go index 9fc86441a19..7dd0ae6353c 100644 --- a/upstream/vendor/k8s.io/client-go/informers/factory.go +++ b/upstream/vendor/k8s.io/client-go/informers/factory.go @@ -60,7 +60,6 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration - transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -99,14 +98,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client kubernetes.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -211,7 +202,6 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/interface.go b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/interface.go index 48dd9a8a117..1d3ca09efc9 100644 --- a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/interface.go +++ b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/interface.go @@ -19,7 +19,7 @@ limitations under the License. package flowcontrol import ( - v1 "k8s.io/client-go/informers/flowcontrol/v1" + v1alpha1 "k8s.io/client-go/informers/flowcontrol/v1alpha1" v1beta1 "k8s.io/client-go/informers/flowcontrol/v1beta1" v1beta2 "k8s.io/client-go/informers/flowcontrol/v1beta2" v1beta3 "k8s.io/client-go/informers/flowcontrol/v1beta3" @@ -28,8 +28,8 @@ import ( // Interface provides access to each of this group's versions. type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface // V1beta2 provides access to shared informers for resources in V1beta2. @@ -49,9 +49,9 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. diff --git a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go similarity index 78% rename from upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go rename to upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go index 30c41b189b8..9a4a904481d 100644 --- a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go +++ b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" time "time" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1 "k8s.io/client-go/listers/flowcontrol/v1" + v1alpha1 "k8s.io/client-go/listers/flowcontrol/v1alpha1" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // FlowSchemas. type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.FlowSchemaLister + Lister() v1alpha1.FlowSchemaLister } type flowSchemaInformer struct { @@ -57,20 +57,20 @@ func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Durati func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1alpha1().FlowSchemas().List(context.TODO(), options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1alpha1().FlowSchemas().Watch(context.TODO(), options) }, }, - &flowcontrolv1.FlowSchema{}, + &flowcontrolv1alpha1.FlowSchema{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resync } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer) + return f.factory.InformerFor(&flowcontrolv1alpha1.FlowSchema{}, f.defaultInformer) } -func (f *flowSchemaInformer) Lister() v1.FlowSchemaLister { - return v1.NewFlowSchemaLister(f.Informer().GetIndexer()) +func (f *flowSchemaInformer) Lister() v1alpha1.FlowSchemaLister { + return v1alpha1.NewFlowSchemaLister(f.Informer().GetIndexer()) } diff --git a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/interface.go similarity index 99% rename from upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go rename to upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/interface.go index 3de934900fe..7097c0058bf 100644 --- a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go +++ b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" diff --git a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go similarity index 76% rename from upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go index 7092c257259..b81f5c9c36b 100644 --- a/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" time "time" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1 "k8s.io/client-go/listers/flowcontrol/v1" + v1alpha1 "k8s.io/client-go/listers/flowcontrol/v1alpha1" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // PriorityLevelConfigurations. type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.PriorityLevelConfigurationLister + Lister() v1alpha1.PriorityLevelConfigurationLister } type priorityLevelConfigurationInformer struct { @@ -57,20 +57,20 @@ func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPe func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(context.TODO(), options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, - &flowcontrolv1.PriorityLevelConfiguration{}, + &flowcontrolv1alpha1.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.I } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) + return f.factory.InformerFor(&flowcontrolv1alpha1.PriorityLevelConfiguration{}, f.defaultInformer) } -func (f *priorityLevelConfigurationInformer) Lister() v1.PriorityLevelConfigurationLister { - return v1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) +func (f *priorityLevelConfigurationInformer) Lister() v1alpha1.PriorityLevelConfigurationLister { + return v1alpha1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } diff --git a/upstream/vendor/k8s.io/client-go/informers/generic.go b/upstream/vendor/k8s.io/client-go/informers/generic.go index 680768815bd..5495239b29d 100644 --- a/upstream/vendor/k8s.io/client-go/informers/generic.go +++ b/upstream/vendor/k8s.io/client-go/informers/generic.go @@ -45,7 +45,7 @@ import ( eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1beta3 "k8s.io/api/flowcontrol/v1beta3" @@ -259,11 +259,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case extensionsv1beta1.SchemeGroupVersion.WithResource("replicasets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil - // Group=flowcontrol.apiserver.k8s.io, Version=v1 - case flowcontrolv1.SchemeGroupVersion.WithResource("flowschemas"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().FlowSchemas().Informer()}, nil - case flowcontrolv1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().PriorityLevelConfigurations().Informer()}, nil + // Group=flowcontrol.apiserver.k8s.io, Version=v1alpha1 + case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("flowschemas"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().FlowSchemas().Informer()}, nil + case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().PriorityLevelConfigurations().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=v1beta1 case flowcontrolv1beta1.SchemeGroupVersion.WithResource("flowschemas"): @@ -296,10 +296,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().NetworkPolicies().Informer()}, nil // Group=networking.k8s.io, Version=v1alpha1 + case networkingv1alpha1.SchemeGroupVersion.WithResource("clustercidrs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ClusterCIDRs().Informer()}, nil case networkingv1alpha1.SchemeGroupVersion.WithResource("ipaddresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().IPAddresses().Informer()}, nil - case networkingv1alpha1.SchemeGroupVersion.WithResource("servicecidrs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ServiceCIDRs().Informer()}, nil // Group=networking.k8s.io, Version=v1beta1 case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"): @@ -326,6 +326,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=policy, Version=v1beta1 case policyv1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil + case policyv1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1 case rbacv1.SchemeGroupVersion.WithResource("clusterroles"): @@ -396,8 +398,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().CSIStorageCapacities().Informer()}, nil case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttachments().Informer()}, nil - case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttributesClasses().Informer()}, nil // Group=storage.k8s.io, Version=v1beta1 case storagev1beta1.SchemeGroupVersion.WithResource("csidrivers"): diff --git a/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go b/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/clustercidr.go similarity index 69% rename from upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go rename to upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/clustercidr.go index 57e6021431e..cefd0f8a1ee 100644 --- a/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go +++ b/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/clustercidr.go @@ -32,58 +32,58 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// ServiceCIDRInformer provides access to a shared informer and lister for -// ServiceCIDRs. -type ServiceCIDRInformer interface { +// ClusterCIDRInformer provides access to a shared informer and lister for +// ClusterCIDRs. +type ClusterCIDRInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.ServiceCIDRLister + Lister() v1alpha1.ClusterCIDRLister } -type serviceCIDRInformer struct { +type clusterCIDRInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// NewClusterCIDRInformer constructs a new informer for ClusterCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) +func NewClusterCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterCIDRInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// NewFilteredClusterCIDRInformer constructs a new informer for ClusterCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredClusterCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options) + return client.NetworkingV1alpha1().ClusterCIDRs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options) + return client.NetworkingV1alpha1().ClusterCIDRs().Watch(context.TODO(), options) }, }, - &networkingv1alpha1.ServiceCIDR{}, + &networkingv1alpha1.ClusterCIDR{}, resyncPeriod, indexers, ) } -func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *clusterCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1alpha1.ServiceCIDR{}, f.defaultInformer) +func (f *clusterCIDRInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1alpha1.ClusterCIDR{}, f.defaultInformer) } -func (f *serviceCIDRInformer) Lister() v1alpha1.ServiceCIDRLister { - return v1alpha1.NewServiceCIDRLister(f.Informer().GetIndexer()) +func (f *clusterCIDRInformer) Lister() v1alpha1.ClusterCIDRLister { + return v1alpha1.NewClusterCIDRLister(f.Informer().GetIndexer()) } diff --git a/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/interface.go b/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/interface.go index ae9883b55fe..07e7d208ca2 100644 --- a/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/interface.go +++ b/upstream/vendor/k8s.io/client-go/informers/networking/v1alpha1/interface.go @@ -24,10 +24,10 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // ClusterCIDRs returns a ClusterCIDRInformer. + ClusterCIDRs() ClusterCIDRInformer // IPAddresses returns a IPAddressInformer. IPAddresses() IPAddressInformer - // ServiceCIDRs returns a ServiceCIDRInformer. - ServiceCIDRs() ServiceCIDRInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// ClusterCIDRs returns a ClusterCIDRInformer. +func (v *version) ClusterCIDRs() ClusterCIDRInformer { + return &clusterCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // IPAddresses returns a IPAddressInformer. func (v *version) IPAddresses() IPAddressInformer { return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } - -// ServiceCIDRs returns a ServiceCIDRInformer. -func (v *version) ServiceCIDRs() ServiceCIDRInformer { - return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go b/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go index 055c8adc55d..a6c1825d278 100644 --- a/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go +++ b/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. PodDisruptionBudgets() PodDisruptionBudgetInformer + // PodSecurityPolicies returns a PodSecurityPolicyInformer. + PodSecurityPolicies() PodSecurityPolicyInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// PodSecurityPolicies returns a PodSecurityPolicyInformer. +func (v *version) PodSecurityPolicies() PodSecurityPolicyInformer { + return &podSecurityPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go b/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 00000000000..b87d23434ef --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + policyv1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/policy/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// PodSecurityPolicyInformer provides access to a shared informer and lister for +// PodSecurityPolicies. +type PodSecurityPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.PodSecurityPolicyLister +} + +type podSecurityPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPodSecurityPolicyInformer constructs a new informer for PodSecurityPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPodSecurityPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPodSecurityPolicyInformer constructs a new informer for PodSecurityPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1beta1().PodSecurityPolicies().Watch(context.TODO(), options) + }, + }, + &policyv1beta1.PodSecurityPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *podSecurityPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *podSecurityPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&policyv1beta1.PodSecurityPolicy{}, f.defaultInformer) +} + +func (f *podSecurityPolicyInformer) Lister() v1beta1.PodSecurityPolicyLister { + return v1beta1.NewPodSecurityPolicyLister(f.Informer().GetIndexer()) +} diff --git a/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go b/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go index bda3b1add97..033d3b10aa1 100644 --- a/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go +++ b/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go @@ -28,8 +28,6 @@ type Interface interface { CSIStorageCapacities() CSIStorageCapacityInformer // VolumeAttachments returns a VolumeAttachmentInformer. VolumeAttachments() VolumeAttachmentInformer - // VolumeAttributesClasses returns a VolumeAttributesClassInformer. - VolumeAttributesClasses() VolumeAttributesClassInformer } type version struct { @@ -52,8 +50,3 @@ func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { func (v *version) VolumeAttachments() VolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } - -// VolumeAttributesClasses returns a VolumeAttributesClassInformer. -func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { - return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go b/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index 5e62e2f4230..00000000000 --- a/upstream/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - storagev1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" - cache "k8s.io/client-go/tools/cache" -) - -// VolumeAttributesClassInformer provides access to a shared informer and lister for -// VolumeAttributesClasses. -type VolumeAttributesClassInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VolumeAttributesClassLister -} - -type volumeAttributesClassInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options) - }, - }, - &storagev1alpha1.VolumeAttributesClass{}, - resyncPeriod, - indexers, - ) -} - -func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&storagev1alpha1.VolumeAttributesClass{}, f.defaultInformer) -} - -func (f *volumeAttributesClassInformer) Lister() v1alpha1.VolumeAttributesClassLister { - return v1alpha1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) -} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/clientset.go b/upstream/vendor/k8s.io/client-go/kubernetes/clientset.go index a0095d086fd..6345f2fb626 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -52,7 +52,7 @@ import ( eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" @@ -109,7 +109,7 @@ type Interface interface { EventsV1() eventsv1.EventsV1Interface EventsV1beta1() eventsv1beta1.EventsV1beta1Interface ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface - FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface + FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface @@ -165,7 +165,7 @@ type Clientset struct { eventsV1 *eventsv1.EventsV1Client eventsV1beta1 *eventsv1beta1.EventsV1beta1Client extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client - flowcontrolV1 *flowcontrolv1.FlowcontrolV1Client + flowcontrolV1alpha1 *flowcontrolv1alpha1.FlowcontrolV1alpha1Client flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1Client flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2Client flowcontrolV1beta3 *flowcontrolv1beta3.FlowcontrolV1beta3Client @@ -334,9 +334,9 @@ func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Inter return c.extensionsV1beta1 } -// FlowcontrolV1 retrieves the FlowcontrolV1Client -func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { - return c.flowcontrolV1 +// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client +func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + return c.flowcontrolV1alpha1 } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client @@ -604,7 +604,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.flowcontrolV1, err = flowcontrolv1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.flowcontrolV1alpha1, err = flowcontrolv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -742,7 +742,7 @@ func New(c rest.Interface) *Clientset { cs.eventsV1 = eventsv1.New(c) cs.eventsV1beta1 = eventsv1beta1.New(c) cs.extensionsV1beta1 = extensionsv1beta1.New(c) - cs.flowcontrolV1 = flowcontrolv1.New(c) + cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.New(c) cs.flowcontrolV1beta1 = flowcontrolv1beta1.New(c) cs.flowcontrolV1beta2 = flowcontrolv1beta2.New(c) cs.flowcontrolV1beta3 = flowcontrolv1beta3.New(c) diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/upstream/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index fc529873f18..25de81caa8a 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -82,8 +82,8 @@ import ( fakeeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1/fake" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" fakeextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake" - flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" - fakeflowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake" + flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + fakeflowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" fakeflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" @@ -324,9 +324,9 @@ func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Inter return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} } -// FlowcontrolV1 retrieves the FlowcontrolV1Client -func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { - return &fakeflowcontrolv1.FakeFlowcontrolV1{Fake: &c.Fake} +// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client +func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + return &fakeflowcontrolv1alpha1.FakeFlowcontrolV1alpha1{Fake: &c.Fake} } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/fake/register.go b/upstream/vendor/k8s.io/client-go/kubernetes/fake/register.go index 6b80d683391..00918418585 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/fake/register.go @@ -48,7 +48,7 @@ import ( eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" @@ -110,7 +110,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ eventsv1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, - flowcontrolv1.AddToScheme, + flowcontrolv1alpha1.AddToScheme, flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/upstream/vendor/k8s.io/client-go/kubernetes/scheme/register.go index f44055fbfc7..64d3ce2a7b7 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -48,7 +48,7 @@ import ( eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" @@ -110,7 +110,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ eventsv1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, - flowcontrolv1.AddToScheme, + flowcontrolv1alpha1.AddToScheme, flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go similarity index 97% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go index 3af5d054f10..df51baa4d4c 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1 +package v1alpha1 diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/doc.go similarity index 100% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/doc.go diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowcontrol_client.go similarity index 72% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowcontrol_client.go index d15f4b24264..72d5eff0c26 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowcontrol_client.go @@ -19,26 +19,26 @@ limitations under the License. package fake import ( - v1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" + v1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeFlowcontrolV1 struct { +type FakeFlowcontrolV1alpha1 struct { *testing.Fake } -func (c *FakeFlowcontrolV1) FlowSchemas() v1.FlowSchemaInterface { +func (c *FakeFlowcontrolV1alpha1) FlowSchemas() v1alpha1.FlowSchemaInterface { return &FakeFlowSchemas{c} } -func (c *FakeFlowcontrolV1) PriorityLevelConfigurations() v1.PriorityLevelConfigurationInterface { +func (c *FakeFlowcontrolV1alpha1) PriorityLevelConfigurations() v1alpha1.PriorityLevelConfigurationInterface { return &FakePriorityLevelConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeFlowcontrolV1) RESTClient() rest.Interface { +func (c *FakeFlowcontrolV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go similarity index 67% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go index 922a60d89be..f3676388923 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go @@ -23,38 +23,38 @@ import ( json "encoding/json" "fmt" - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeFlowSchemas implements FlowSchemaInterface type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1 + Fake *FakeFlowcontrolV1alpha1 } -var flowschemasResource = v1.SchemeGroupVersion.WithResource("flowschemas") +var flowschemasResource = v1alpha1.SchemeGroupVersion.WithResource("flowschemas") -var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") +var flowschemasKind = v1alpha1.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FlowSchema, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1.FlowSchema{}) + Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { +func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FlowSchemaList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1.FlowSchemaList{}) + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1alpha1.FlowSchemaList{}) if obj == nil { return nil, err } @@ -63,8 +63,8 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &v1.FlowSchemaList{ListMeta: obj.(*v1.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1.FlowSchemaList).Items { + list := &v1alpha1.FlowSchemaList{ListMeta: obj.(*v1alpha1.FlowSchemaList).ListMeta} + for _, item := range obj.(*v1alpha1.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -73,69 +73,69 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (re } // Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (result *v1alpha1.FlowSchema, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (result *v1alpha1.FlowSchema, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) { +func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1.FlowSchema{}) + Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1alpha1.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) - _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) + _, err := c.Fake.Invokes(action, &v1alpha1.FlowSchemaList{}) return err } // Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } @@ -148,16 +148,16 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.F return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { +func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } @@ -170,9 +170,9 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.FlowSchema{}) if obj == nil { return nil, err } - return obj.(*v1.FlowSchema), err + return obj.(*v1alpha1.FlowSchema), err } diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go similarity index 64% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go index 27d95867488..6512c36f69b 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go @@ -23,38 +23,38 @@ import ( json "encoding/json" "fmt" - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" testing "k8s.io/client-go/testing" ) // FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1 + Fake *FakeFlowcontrolV1alpha1 } -var prioritylevelconfigurationsResource = v1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") +var prioritylevelconfigurationsResource = v1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") -var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") +var prioritylevelconfigurationsKind = v1alpha1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { +func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1.PriorityLevelConfigurationList{}) + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1alpha1.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -63,8 +63,8 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1. if label == nil { label = labels.Everything() } - list := &v1.PriorityLevelConfigurationList{ListMeta: obj.(*v1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1.PriorityLevelConfigurationList).Items { + list := &v1alpha1.PriorityLevelConfigurationList{ListMeta: obj.(*v1alpha1.PriorityLevelConfigurationList).ListMeta} + for _, item := range obj.(*v1alpha1.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -73,69 +73,69 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1. } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) { +func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1alpha1.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) - _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) + _, err := c.Fake.Invokes(action, &v1alpha1.PriorityLevelConfigurationList{}) return err } // Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } @@ -148,16 +148,16 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } @@ -170,9 +170,9 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } - return obj.(*v1.PriorityLevelConfiguration), err + return obj.(*v1alpha1.PriorityLevelConfiguration), err } diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go similarity index 64% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go index 3d7d93ef147..c6f2d940560 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go @@ -16,39 +16,39 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "net/http" - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) -type FlowcontrolV1Interface interface { +type FlowcontrolV1alpha1Interface interface { RESTClient() rest.Interface FlowSchemasGetter PriorityLevelConfigurationsGetter } -// FlowcontrolV1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. -type FlowcontrolV1Client struct { +// FlowcontrolV1alpha1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. +type FlowcontrolV1alpha1Client struct { restClient rest.Interface } -func (c *FlowcontrolV1Client) FlowSchemas() FlowSchemaInterface { +func (c *FlowcontrolV1alpha1Client) FlowSchemas() FlowSchemaInterface { return newFlowSchemas(c) } -func (c *FlowcontrolV1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { +func (c *FlowcontrolV1alpha1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { return newPriorityLevelConfigurations(c) } -// NewForConfig creates a new FlowcontrolV1Client for the given config. +// NewForConfig creates a new FlowcontrolV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { +func NewForConfig(c *rest.Config) (*FlowcontrolV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -60,9 +60,9 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new FlowcontrolV1Client for the given config and http client. +// NewForConfigAndClient creates a new FlowcontrolV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -71,12 +71,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client if err != nil { return nil, err } - return &FlowcontrolV1Client{client}, nil + return &FlowcontrolV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new FlowcontrolV1Client for the given config and +// NewForConfigOrDie creates a new FlowcontrolV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1Client { +func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -84,13 +84,13 @@ func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1Client { return client } -// New creates a new FlowcontrolV1Client for the given RESTClient. -func New(c rest.Interface) *FlowcontrolV1Client { - return &FlowcontrolV1Client{c} +// New creates a new FlowcontrolV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *FlowcontrolV1alpha1Client { + return &FlowcontrolV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -104,7 +104,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FlowcontrolV1Client) RESTClient() rest.Interface { +func (c *FlowcontrolV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go similarity index 69% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go index bd36c5e6a4e..95baf825191 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" @@ -24,11 +24,11 @@ import ( "fmt" "time" - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -41,17 +41,17 @@ type FlowSchemasGetter interface { // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { - Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (*v1.FlowSchema, error) - Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) - UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FlowSchema, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) - 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.FlowSchema, err error) - Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) - ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) + Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (*v1alpha1.FlowSchema, error) + Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) + UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.FlowSchema, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error) + Apply(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) + ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) FlowSchemaExpansion } @@ -61,15 +61,15 @@ type flowSchemas struct { } // newFlowSchemas returns a FlowSchemas -func newFlowSchemas(c *FlowcontrolV1Client) *flowSchemas { +func newFlowSchemas(c *FlowcontrolV1alpha1Client) *flowSchemas { return &flowSchemas{ client: c.RESTClient(), } } // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} +func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} err = c.client.Get(). Resource("flowschemas"). Name(name). @@ -80,12 +80,12 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { +func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1.FlowSchemaList{} + result = &v1alpha1.FlowSchemaList{} err = c.client.Get(). Resource("flowschemas"). VersionedParams(&opts, scheme.ParameterCodec). @@ -96,7 +96,7 @@ func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result } // Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *flowSchemas) 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 @@ -110,8 +110,8 @@ func (c *flowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} +func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} err = c.client.Post(). Resource("flowschemas"). VersionedParams(&opts, scheme.ParameterCodec). @@ -122,8 +122,8 @@ func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opt } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} +func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} err = c.client.Put(). Resource("flowschemas"). Name(flowSchema.Name). @@ -136,8 +136,8 @@ func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opt // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} +func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} err = c.client.Put(). Resource("flowschemas"). Name(flowSchema.Name). @@ -150,7 +150,7 @@ func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchem } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("flowschemas"). Name(name). @@ -160,7 +160,7 @@ func (c *flowSchemas) Delete(ctx context.Context, name string, opts metav1.Delet } // DeleteCollection deletes a collection of objects. -func (c *flowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *flowSchemas) 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 @@ -175,8 +175,8 @@ func (c *flowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOp } // Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} +func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} err = c.client.Patch(pt). Resource("flowschemas"). Name(name). @@ -189,7 +189,7 @@ func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { +func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } @@ -202,7 +202,7 @@ func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowS if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } - result = &v1.FlowSchema{} + result = &v1alpha1.FlowSchema{} err = c.client.Patch(types.ApplyPatchType). Resource("flowschemas"). Name(*name). @@ -215,7 +215,7 @@ func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowS // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { +func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } @@ -230,7 +230,7 @@ func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1 return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } - result = &v1.FlowSchema{} + result = &v1alpha1.FlowSchema{} err = c.client.Patch(types.ApplyPatchType). Resource("flowschemas"). Name(*name). diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go similarity index 97% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go index 99067738873..065b5e6b42d 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 type FlowSchemaExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go similarity index 69% rename from upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go index 797fe94035e..327b727c182 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" @@ -24,11 +24,11 @@ import ( "fmt" "time" - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -41,17 +41,17 @@ type PriorityLevelConfigurationsGetter interface { // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { - Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*v1.PriorityLevelConfiguration, error) - Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) - UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityLevelConfiguration, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) - 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.PriorityLevelConfiguration, err error) - Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) - ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) + Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityLevelConfiguration, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) + Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) + ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } @@ -61,15 +61,15 @@ type priorityLevelConfigurations struct { } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations -func newPriorityLevelConfigurations(c *FlowcontrolV1Client) *priorityLevelConfigurations { +func newPriorityLevelConfigurations(c *FlowcontrolV1alpha1Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ client: c.RESTClient(), } } // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} +func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Get(). Resource("prioritylevelconfigurations"). Name(name). @@ -80,12 +80,12 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1.PriorityLevelConfigurationList{} + result = &v1alpha1.PriorityLevelConfigurationList{} err = c.client.Get(). Resource("prioritylevelconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). @@ -96,7 +96,7 @@ func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.List } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *priorityLevelConfigurations) 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 @@ -110,8 +110,8 @@ func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.Lis } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} +func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Post(). Resource("prioritylevelconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). @@ -122,8 +122,8 @@ func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelC } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} +func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Put(). Resource("prioritylevelconfigurations"). Name(priorityLevelConfiguration.Name). @@ -136,8 +136,8 @@ func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelC // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} +func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Put(). Resource("prioritylevelconfigurations"). Name(priorityLevelConfiguration.Name). @@ -150,7 +150,7 @@ func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priority } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("prioritylevelconfigurations"). Name(name). @@ -160,7 +160,7 @@ func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, o } // DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *priorityLevelConfigurations) 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 @@ -175,8 +175,8 @@ func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts } // Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} +func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Patch(pt). Resource("prioritylevelconfigurations"). Name(name). @@ -189,7 +189,7 @@ func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } @@ -202,7 +202,7 @@ func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelCo if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } - result = &v1.PriorityLevelConfiguration{} + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Patch(types.ApplyPatchType). Resource("prioritylevelconfigurations"). Name(*name). @@ -215,7 +215,7 @@ func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelCo // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } @@ -230,7 +230,7 @@ func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityL return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } - result = &v1.PriorityLevelConfiguration{} + result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Patch(types.ApplyPatchType). Resource("prioritylevelconfigurations"). Name(*name). diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/clustercidr.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/clustercidr.go new file mode 100644 index 00000000000..9df76351db8 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/clustercidr.go @@ -0,0 +1,197 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha1 "k8s.io/api/networking/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ClusterCIDRsGetter has a method to return a ClusterCIDRInterface. +// A group's client should implement this interface. +type ClusterCIDRsGetter interface { + ClusterCIDRs() ClusterCIDRInterface +} + +// ClusterCIDRInterface has methods to work with ClusterCIDR resources. +type ClusterCIDRInterface interface { + Create(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.CreateOptions) (*v1alpha1.ClusterCIDR, error) + Update(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.UpdateOptions) (*v1alpha1.ClusterCIDR, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterCIDR, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterCIDRList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDR, err error) + Apply(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDR, err error) + ClusterCIDRExpansion +} + +// clusterCIDRs implements ClusterCIDRInterface +type clusterCIDRs struct { + client rest.Interface +} + +// newClusterCIDRs returns a ClusterCIDRs +func newClusterCIDRs(c *NetworkingV1alpha1Client) *clusterCIDRs { + return &clusterCIDRs{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterCIDR, and returns the corresponding clusterCIDR object, and an error if there is any. +func (c *clusterCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterCIDR, err error) { + result = &v1alpha1.ClusterCIDR{} + err = c.client.Get(). + Resource("clustercidrs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterCIDRs that match those selectors. +func (c *clusterCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterCIDRList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ClusterCIDRList{} + err = c.client.Get(). + Resource("clustercidrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterCIDRs. +func (c *clusterCIDRs) 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("clustercidrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterCIDR and creates it. Returns the server's representation of the clusterCIDR, and an error, if there is any. +func (c *clusterCIDRs) Create(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.CreateOptions) (result *v1alpha1.ClusterCIDR, err error) { + result = &v1alpha1.ClusterCIDR{} + err = c.client.Post(). + Resource("clustercidrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterCIDR). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterCIDR and updates it. Returns the server's representation of the clusterCIDR, and an error, if there is any. +func (c *clusterCIDRs) Update(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.UpdateOptions) (result *v1alpha1.ClusterCIDR, err error) { + result = &v1alpha1.ClusterCIDR{} + err = c.client.Put(). + Resource("clustercidrs"). + Name(clusterCIDR.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterCIDR). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterCIDR and deletes it. Returns an error if one occurs. +func (c *clusterCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustercidrs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterCIDRs) 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("clustercidrs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterCIDR. +func (c *clusterCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDR, err error) { + result = &v1alpha1.ClusterCIDR{} + err = c.client.Patch(pt). + Resource("clustercidrs"). + 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 clusterCIDR. +func (c *clusterCIDRs) Apply(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDR, err error) { + if clusterCIDR == nil { + return nil, fmt.Errorf("clusterCIDR provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(clusterCIDR) + if err != nil { + return nil, err + } + name := clusterCIDR.Name + if name == nil { + return nil, fmt.Errorf("clusterCIDR.Name must be provided to Apply") + } + result = &v1alpha1.ClusterCIDR{} + err = c.client.Patch(types.ApplyPatchType). + Resource("clustercidrs"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_clustercidr.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_clustercidr.go new file mode 100644 index 00000000000..592e9fc63dc --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_clustercidr.go @@ -0,0 +1,145 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha1 "k8s.io/api/networking/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" + testing "k8s.io/client-go/testing" +) + +// FakeClusterCIDRs implements ClusterCIDRInterface +type FakeClusterCIDRs struct { + Fake *FakeNetworkingV1alpha1 +} + +var clustercidrsResource = v1alpha1.SchemeGroupVersion.WithResource("clustercidrs") + +var clustercidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterCIDR") + +// Get takes name of the clusterCIDR, and returns the corresponding clusterCIDR object, and an error if there is any. +func (c *FakeClusterCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterCIDR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustercidrsResource, name), &v1alpha1.ClusterCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterCIDR), err +} + +// List takes label and field selectors, and returns the list of ClusterCIDRs that match those selectors. +func (c *FakeClusterCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterCIDRList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustercidrsResource, clustercidrsKind, opts), &v1alpha1.ClusterCIDRList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ClusterCIDRList{ListMeta: obj.(*v1alpha1.ClusterCIDRList).ListMeta} + for _, item := range obj.(*v1alpha1.ClusterCIDRList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterCIDRs. +func (c *FakeClusterCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustercidrsResource, opts)) +} + +// Create takes the representation of a clusterCIDR and creates it. Returns the server's representation of the clusterCIDR, and an error, if there is any. +func (c *FakeClusterCIDRs) Create(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.CreateOptions) (result *v1alpha1.ClusterCIDR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustercidrsResource, clusterCIDR), &v1alpha1.ClusterCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterCIDR), err +} + +// Update takes the representation of a clusterCIDR and updates it. Returns the server's representation of the clusterCIDR, and an error, if there is any. +func (c *FakeClusterCIDRs) Update(ctx context.Context, clusterCIDR *v1alpha1.ClusterCIDR, opts v1.UpdateOptions) (result *v1alpha1.ClusterCIDR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustercidrsResource, clusterCIDR), &v1alpha1.ClusterCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterCIDR), err +} + +// Delete takes name of the clusterCIDR and deletes it. Returns an error if one occurs. +func (c *FakeClusterCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(clustercidrsResource, name, opts), &v1alpha1.ClusterCIDR{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustercidrsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.ClusterCIDRList{}) + return err +} + +// Patch applies the patch and returns the patched clusterCIDR. +func (c *FakeClusterCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustercidrsResource, name, pt, data, subresources...), &v1alpha1.ClusterCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterCIDR), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied clusterCIDR. +func (c *FakeClusterCIDRs) Apply(ctx context.Context, clusterCIDR *networkingv1alpha1.ClusterCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDR, err error) { + if clusterCIDR == nil { + return nil, fmt.Errorf("clusterCIDR provided to Apply must not be nil") + } + data, err := json.Marshal(clusterCIDR) + if err != nil { + return nil, err + } + name := clusterCIDR.Name + if name == nil { + return nil, fmt.Errorf("clusterCIDR.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustercidrsResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterCIDR{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterCIDR), err +} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go index 80ad184bbfa..2d063836b53 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go @@ -28,12 +28,12 @@ type FakeNetworkingV1alpha1 struct { *testing.Fake } -func (c *FakeNetworkingV1alpha1) IPAddresses() v1alpha1.IPAddressInterface { - return &FakeIPAddresses{c} +func (c *FakeNetworkingV1alpha1) ClusterCIDRs() v1alpha1.ClusterCIDRInterface { + return &FakeClusterCIDRs{c} } -func (c *FakeNetworkingV1alpha1) ServiceCIDRs() v1alpha1.ServiceCIDRInterface { - return &FakeServiceCIDRs{c} +func (c *FakeNetworkingV1alpha1) IPAddresses() v1alpha1.IPAddressInterface { + return &FakeIPAddresses{c} } // RESTClient returns a RESTClient that is used to communicate diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go deleted file mode 100644 index 653ef631af1..00000000000 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeServiceCIDRs implements ServiceCIDRInterface -type FakeServiceCIDRs struct { - Fake *FakeNetworkingV1alpha1 -} - -var servicecidrsResource = v1alpha1.SchemeGroupVersion.WithResource("servicecidrs") - -var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(servicecidrsResource, name), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(servicecidrsResource, servicecidrsKind, opts), &v1alpha1.ServiceCIDRList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ServiceCIDRList{ListMeta: obj.(*v1alpha1.ServiceCIDRList).ListMeta} - for _, item := range obj.(*v1alpha1.ServiceCIDRList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(servicecidrsResource, opts)) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), 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 *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(servicecidrsResource, "status", serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1alpha1.ServiceCIDR{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(servicecidrsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ServiceCIDRList{}) - return err -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, name, pt, data, subresources...), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. -func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/generated_expansion.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/generated_expansion.go index df12a463da8..9c2979d6c44 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/generated_expansion.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/generated_expansion.go @@ -18,6 +18,6 @@ limitations under the License. package v1alpha1 -type IPAddressExpansion interface{} +type ClusterCIDRExpansion interface{} -type ServiceCIDRExpansion interface{} +type IPAddressExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go index c730e624685..884c846f598 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go @@ -28,8 +28,8 @@ import ( type NetworkingV1alpha1Interface interface { RESTClient() rest.Interface + ClusterCIDRsGetter IPAddressesGetter - ServiceCIDRsGetter } // NetworkingV1alpha1Client is used to interact with features provided by the networking.k8s.io group. @@ -37,12 +37,12 @@ type NetworkingV1alpha1Client struct { restClient rest.Interface } -func (c *NetworkingV1alpha1Client) IPAddresses() IPAddressInterface { - return newIPAddresses(c) +func (c *NetworkingV1alpha1Client) ClusterCIDRs() ClusterCIDRInterface { + return newClusterCIDRs(c) } -func (c *NetworkingV1alpha1Client) ServiceCIDRs() ServiceCIDRInterface { - return newServiceCIDRs(c) +func (c *NetworkingV1alpha1Client) IPAddresses() IPAddressInterface { + return newIPAddresses(c) } // NewForConfig creates a new NetworkingV1alpha1Client for the given config. diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go deleted file mode 100644 index 100f290a19f..00000000000 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. -// A group's client should implement this interface. -type ServiceCIDRsGetter interface { - ServiceCIDRs() ServiceCIDRInterface -} - -// ServiceCIDRInterface has methods to work with ServiceCIDR resources. -type ServiceCIDRInterface interface { - Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (*v1alpha1.ServiceCIDR, error) - Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) - UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ServiceCIDR, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) - Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) - ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) - ServiceCIDRExpansion -} - -// serviceCIDRs implements ServiceCIDRInterface -type serviceCIDRs struct { - client rest.Interface -} - -// newServiceCIDRs returns a ServiceCIDRs -func newServiceCIDRs(c *NetworkingV1alpha1Client) *serviceCIDRs { - return &serviceCIDRs{ - client: c.RESTClient(), - } -} - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Get(). - Resource("servicecidrs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ServiceCIDRList{} - err = c.client.Get(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *serviceCIDRs) 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("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Post(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - 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 *serviceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *serviceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("servicecidrs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceCIDRs) 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("servicecidrs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *serviceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(pt). - Resource("servicecidrs"). - 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 serviceCIDR. -func (c *serviceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - 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 *serviceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go new file mode 100644 index 00000000000..ade1aab7f02 --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go @@ -0,0 +1,145 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" + testing "k8s.io/client-go/testing" +) + +// FakePodSecurityPolicies implements PodSecurityPolicyInterface +type FakePodSecurityPolicies struct { + Fake *FakePolicyV1beta1 +} + +var podsecuritypoliciesResource = v1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies") + +var podsecuritypoliciesKind = v1beta1.SchemeGroupVersion.WithKind("PodSecurityPolicy") + +// Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. +func (c *FakePodSecurityPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. +func (c *FakePodSecurityPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(podsecuritypoliciesResource, podsecuritypoliciesKind, opts), &v1beta1.PodSecurityPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PodSecurityPolicyList{ListMeta: obj.(*v1beta1.PodSecurityPolicyList).ListMeta} + for _, item := range obj.(*v1beta1.PodSecurityPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested podSecurityPolicies. +func (c *FakePodSecurityPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(podsecuritypoliciesResource, opts)) +} + +// Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *FakePodSecurityPolicies) Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(podsecuritypoliciesResource, podSecurityPolicy), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *FakePodSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(podsecuritypoliciesResource, podSecurityPolicy), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. +func (c *FakePodSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(podsecuritypoliciesResource, name, opts), &v1beta1.PodSecurityPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PodSecurityPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched podSecurityPolicy. +func (c *FakePodSecurityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(podsecuritypoliciesResource, name, pt, data, subresources...), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied podSecurityPolicy. +func (c *FakePodSecurityPolicies) Apply(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error) { + if podSecurityPolicy == nil { + return nil, fmt.Errorf("podSecurityPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(podSecurityPolicy) + if err != nil { + return nil, err + } + name := podSecurityPolicy.Name + if name == nil { + return nil, fmt.Errorf("podSecurityPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(podsecuritypoliciesResource, *name, types.ApplyPatchType, data), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go index 90670b113f9..9c780bf1f06 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go @@ -36,6 +36,10 @@ func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDi return &FakePodDisruptionBudgets{c, namespace} } +func (c *FakePolicyV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { + return &FakePodSecurityPolicies{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1beta1) RESTClient() rest.Interface { diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go index 6fce70c4eb8..078c16d5cb1 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1beta1 type PodDisruptionBudgetExpansion interface{} + +type PodSecurityPolicyExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 00000000000..944b61de47f --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,197 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// PodSecurityPoliciesGetter has a method to return a PodSecurityPolicyInterface. +// A group's client should implement this interface. +type PodSecurityPoliciesGetter interface { + PodSecurityPolicies() PodSecurityPolicyInterface +} + +// PodSecurityPolicyInterface has methods to work with PodSecurityPolicy resources. +type PodSecurityPolicyInterface interface { + Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (*v1beta1.PodSecurityPolicy, error) + Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (*v1beta1.PodSecurityPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) + Apply(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error) + PodSecurityPolicyExpansion +} + +// podSecurityPolicies implements PodSecurityPolicyInterface +type podSecurityPolicies struct { + client rest.Interface +} + +// newPodSecurityPolicies returns a PodSecurityPolicies +func newPodSecurityPolicies(c *PolicyV1beta1Client) *podSecurityPolicies { + return &podSecurityPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. +func (c *podSecurityPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Get(). + Resource("podsecuritypolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. +func (c *podSecurityPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PodSecurityPolicyList{} + err = c.client.Get(). + Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podSecurityPolicies. +func (c *podSecurityPolicies) 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("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *podSecurityPolicies) Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Post(). + Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *podSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Put(). + Resource("podsecuritypolicies"). + Name(podSecurityPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. +func (c *podSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("podsecuritypolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podSecurityPolicies) 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("podsecuritypolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched podSecurityPolicy. +func (c *podSecurityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Patch(pt). + Resource("podsecuritypolicies"). + 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 podSecurityPolicy. +func (c *podSecurityPolicies) Apply(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error) { + if podSecurityPolicy == nil { + return nil, fmt.Errorf("podSecurityPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(podSecurityPolicy) + if err != nil { + return nil, err + } + name := podSecurityPolicy.Name + if name == nil { + return nil, fmt.Errorf("podSecurityPolicy.Name must be provided to Apply") + } + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Resource("podsecuritypolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go index fdb50932167..5b65c9c0aa1 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go @@ -30,6 +30,7 @@ type PolicyV1beta1Interface interface { RESTClient() rest.Interface EvictionsGetter PodDisruptionBudgetsGetter + PodSecurityPoliciesGetter } // PolicyV1beta1Client is used to interact with features provided by the policy group. @@ -45,6 +46,10 @@ func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisrupti return newPodDisruptionBudgets(c, namespace) } +func (c *PolicyV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface { + return newPodSecurityPolicies(c) +} + // NewForConfig creates a new PolicyV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go index 0e078f34861..c26190aa01a 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go @@ -36,10 +36,6 @@ func (c *FakeStorageV1alpha1) VolumeAttachments() v1alpha1.VolumeAttachmentInter return &FakeVolumeAttachments{c} } -func (c *FakeStorageV1alpha1) VolumeAttributesClasses() v1alpha1.VolumeAttributesClassInterface { - return &FakeVolumeAttributesClasses{c} -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1alpha1) RESTClient() rest.Interface { diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go deleted file mode 100644 index d25263df48c..00000000000 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttributesClasses implements VolumeAttributesClassInterface -type FakeVolumeAttributesClasses struct { - Fake *FakeStorageV1alpha1 -} - -var volumeattributesclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses") - -var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass") - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattributesclassesResource, name), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattributesclassesResource, volumeattributesclassesKind, opts), &v1alpha1.VolumeAttributesClassList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VolumeAttributesClassList{ListMeta: obj.(*v1alpha1.VolumeAttributesClassList).ListMeta} - for _, item := range obj.(*v1alpha1.VolumeAttributesClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattributesclassesResource, opts)) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1alpha1.VolumeAttributesClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattributesclassesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttributesClassList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, name, pt, data, subresources...), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go index 436e910f244..0f51c85f9e7 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go @@ -21,5 +21,3 @@ package v1alpha1 type CSIStorageCapacityExpansion interface{} type VolumeAttachmentExpansion interface{} - -type VolumeAttributesClassExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go index 63e3fc243f9..c9bf11d766c 100644 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -30,7 +30,6 @@ type StorageV1alpha1Interface interface { RESTClient() rest.Interface CSIStorageCapacitiesGetter VolumeAttachmentsGetter - VolumeAttributesClassesGetter } // StorageV1alpha1Client is used to interact with features provided by the storage.k8s.io group. @@ -46,10 +45,6 @@ func (c *StorageV1alpha1Client) VolumeAttachments() VolumeAttachmentInterface { return newVolumeAttachments(c) } -func (c *StorageV1alpha1Client) VolumeAttributesClasses() VolumeAttributesClassInterface { - return newVolumeAttributesClasses(c) -} - // NewForConfig creates a new StorageV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index 6633a4dc150..00000000000 --- a/upstream/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. -// A group's client should implement this interface. -type VolumeAttributesClassesGetter interface { - VolumeAttributesClasses() VolumeAttributesClassInterface -} - -// VolumeAttributesClassInterface has methods to work with VolumeAttributesClass resources. -type VolumeAttributesClassInterface interface { - Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (*v1alpha1.VolumeAttributesClass, error) - Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (*v1alpha1.VolumeAttributesClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttributesClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttributesClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) - Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) - VolumeAttributesClassExpansion -} - -// volumeAttributesClasses implements VolumeAttributesClassInterface -type volumeAttributesClasses struct { - client rest.Interface -} - -// newVolumeAttributesClasses returns a VolumeAttributesClasses -func newVolumeAttributesClasses(c *StorageV1alpha1Client) *volumeAttributesClasses { - return &volumeAttributesClasses{ - client: c.RESTClient(), - } -} - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *volumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttributesClassList{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *volumeAttributesClasses) 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("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Post(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Put(). - Resource("volumeattributesclasses"). - Name(volumeAttributesClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *volumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattributesclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttributesClasses) 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("volumeattributesclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *volumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(pt). - Resource("volumeattributesclasses"). - 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 volumeAttributesClass. -func (c *volumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattributesclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/expansion_generated.go similarity index 98% rename from upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go rename to upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/expansion_generated.go index 70b5eb5b171..3e74051681c 100644 --- a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go +++ b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v1alpha1 // FlowSchemaListerExpansion allows custom methods to be added to // FlowSchemaLister. diff --git a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/flowschema.go similarity index 79% rename from upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go rename to upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/flowschema.go index 43ccd4e5ff9..c8a595cd29c 100644 --- a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go +++ b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/flowschema.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -30,10 +30,10 @@ import ( type FlowSchemaLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.FlowSchema, err error) + List(selector labels.Selector) (ret []*v1alpha1.FlowSchema, err error) // Get retrieves the FlowSchema from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.FlowSchema, error) + Get(name string) (*v1alpha1.FlowSchema, error) FlowSchemaListerExpansion } @@ -48,21 +48,21 @@ func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { } // List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1.FlowSchema, err error) { +func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1alpha1.FlowSchema, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FlowSchema)) + ret = append(ret, m.(*v1alpha1.FlowSchema)) }) return ret, err } // Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1.FlowSchema, error) { +func (s *flowSchemaLister) Get(name string) (*v1alpha1.FlowSchema, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1.Resource("flowschema"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("flowschema"), name) } - return obj.(*v1.FlowSchema), nil + return obj.(*v1alpha1.FlowSchema), nil } diff --git a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go similarity index 79% rename from upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go rename to upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go index 61189b9cf98..daa4ff31d93 100644 --- a/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go +++ b/upstream/vendor/k8s.io/client-go/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( - v1 "k8s.io/api/flowcontrol/v1" + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -30,10 +30,10 @@ import ( type PriorityLevelConfigurationLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) + List(selector labels.Selector) (ret []*v1alpha1.PriorityLevelConfiguration, err error) // Get retrieves the PriorityLevelConfiguration from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.PriorityLevelConfiguration, error) + Get(name string) (*v1alpha1.PriorityLevelConfiguration, error) PriorityLevelConfigurationListerExpansion } @@ -48,21 +48,21 @@ func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelCon } // List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) { +func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.PriorityLevelConfiguration, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PriorityLevelConfiguration)) + ret = append(ret, m.(*v1alpha1.PriorityLevelConfiguration)) }) return ret, err } // Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1.PriorityLevelConfiguration, error) { +func (s *priorityLevelConfigurationLister) Get(name string) (*v1alpha1.PriorityLevelConfiguration, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1.Resource("prioritylevelconfiguration"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("prioritylevelconfiguration"), name) } - return obj.(*v1.PriorityLevelConfiguration), nil + return obj.(*v1alpha1.PriorityLevelConfiguration), nil } diff --git a/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go b/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/clustercidr.go similarity index 54% rename from upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go rename to upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/clustercidr.go index 8bc2b10e681..dca9d7bf0cb 100644 --- a/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go +++ b/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/clustercidr.go @@ -25,44 +25,44 @@ import ( "k8s.io/client-go/tools/cache" ) -// ServiceCIDRLister helps list ServiceCIDRs. +// ClusterCIDRLister helps list ClusterCIDRs. // All objects returned here must be treated as read-only. -type ServiceCIDRLister interface { - // List lists all ServiceCIDRs in the indexer. +type ClusterCIDRLister interface { + // List lists all ClusterCIDRs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) - // Get retrieves the ServiceCIDR from the index for a given name. + List(selector labels.Selector) (ret []*v1alpha1.ClusterCIDR, err error) + // Get retrieves the ClusterCIDR from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.ServiceCIDR, error) - ServiceCIDRListerExpansion + Get(name string) (*v1alpha1.ClusterCIDR, error) + ClusterCIDRListerExpansion } -// serviceCIDRLister implements the ServiceCIDRLister interface. -type serviceCIDRLister struct { +// clusterCIDRLister implements the ClusterCIDRLister interface. +type clusterCIDRLister struct { indexer cache.Indexer } -// NewServiceCIDRLister returns a new ServiceCIDRLister. -func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { - return &serviceCIDRLister{indexer: indexer} +// NewClusterCIDRLister returns a new ClusterCIDRLister. +func NewClusterCIDRLister(indexer cache.Indexer) ClusterCIDRLister { + return &clusterCIDRLister{indexer: indexer} } -// List lists all ServiceCIDRs in the indexer. -func (s *serviceCIDRLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) { +// List lists all ClusterCIDRs in the indexer. +func (s *clusterCIDRLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterCIDR, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ServiceCIDR)) + ret = append(ret, m.(*v1alpha1.ClusterCIDR)) }) return ret, err } -// Get retrieves the ServiceCIDR from the index for a given name. -func (s *serviceCIDRLister) Get(name string) (*v1alpha1.ServiceCIDR, error) { +// Get retrieves the ClusterCIDR from the index for a given name. +func (s *clusterCIDRLister) Get(name string) (*v1alpha1.ClusterCIDR, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("servicecidr"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("clustercidr"), name) } - return obj.(*v1alpha1.ServiceCIDR), nil + return obj.(*v1alpha1.ClusterCIDR), nil } diff --git a/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/expansion_generated.go b/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/expansion_generated.go index fc7316521bf..d57b71b0059 100644 --- a/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/expansion_generated.go +++ b/upstream/vendor/k8s.io/client-go/listers/networking/v1alpha1/expansion_generated.go @@ -18,10 +18,10 @@ limitations under the License. package v1alpha1 +// ClusterCIDRListerExpansion allows custom methods to be added to +// ClusterCIDRLister. +type ClusterCIDRListerExpansion interface{} + // IPAddressListerExpansion allows custom methods to be added to // IPAddressLister. type IPAddressListerExpansion interface{} - -// ServiceCIDRListerExpansion allows custom methods to be added to -// ServiceCIDRLister. -type ServiceCIDRListerExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go b/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go index eba5e2f72d6..9a005f20bb8 100644 --- a/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go +++ b/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go @@ -25,3 +25,7 @@ type EvictionListerExpansion interface{} // EvictionNamespaceListerExpansion allows custom methods to be added to // EvictionNamespaceLister. type EvictionNamespaceListerExpansion interface{} + +// PodSecurityPolicyListerExpansion allows custom methods to be added to +// PodSecurityPolicyLister. +type PodSecurityPolicyListerExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go b/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 00000000000..7e73161b25a --- /dev/null +++ b/upstream/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PodSecurityPolicyLister helps list PodSecurityPolicies. +// All objects returned here must be treated as read-only. +type PodSecurityPolicyLister interface { + // List lists all PodSecurityPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.PodSecurityPolicy, err error) + // Get retrieves the PodSecurityPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.PodSecurityPolicy, error) + PodSecurityPolicyListerExpansion +} + +// podSecurityPolicyLister implements the PodSecurityPolicyLister interface. +type podSecurityPolicyLister struct { + indexer cache.Indexer +} + +// NewPodSecurityPolicyLister returns a new PodSecurityPolicyLister. +func NewPodSecurityPolicyLister(indexer cache.Indexer) PodSecurityPolicyLister { + return &podSecurityPolicyLister{indexer: indexer} +} + +// List lists all PodSecurityPolicies in the indexer. +func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*v1beta1.PodSecurityPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.PodSecurityPolicy)) + }) + return ret, err +} + +// Get retrieves the PodSecurityPolicy from the index for a given name. +func (s *podSecurityPolicyLister) Get(name string) (*v1beta1.PodSecurityPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("podsecuritypolicy"), name) + } + return obj.(*v1beta1.PodSecurityPolicy), nil +} diff --git a/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go b/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go index 327fb6e31cd..edefe6d05ed 100644 --- a/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go +++ b/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go @@ -29,7 +29,3 @@ type CSIStorageCapacityNamespaceListerExpansion interface{} // VolumeAttachmentListerExpansion allows custom methods to be added to // VolumeAttachmentLister. type VolumeAttachmentListerExpansion interface{} - -// VolumeAttributesClassListerExpansion allows custom methods to be added to -// VolumeAttributesClassLister. -type VolumeAttributesClassListerExpansion interface{} diff --git a/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go b/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index f30b4a89ba1..00000000000 --- a/upstream/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VolumeAttributesClassLister helps list VolumeAttributesClasses. -// All objects returned here must be treated as read-only. -type VolumeAttributesClassLister interface { - // List lists all VolumeAttributesClasses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) - // Get retrieves the VolumeAttributesClass from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VolumeAttributesClass, error) - VolumeAttributesClassListerExpansion -} - -// volumeAttributesClassLister implements the VolumeAttributesClassLister interface. -type volumeAttributesClassLister struct { - indexer cache.Indexer -} - -// NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. -func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { - return &volumeAttributesClassLister{indexer: indexer} -} - -// List lists all VolumeAttributesClasses in the indexer. -func (s *volumeAttributesClassLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumeAttributesClass)) - }) - return ret, err -} - -// Get retrieves the VolumeAttributesClass from the index for a given name. -func (s *volumeAttributesClassLister) Get(name string) (*v1alpha1.VolumeAttributesClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumeattributesclass"), name) - } - return obj.(*v1alpha1.VolumeAttributesClass), nil -} diff --git a/upstream/vendor/k8s.io/client-go/tools/cache/reflector.go b/upstream/vendor/k8s.io/client-go/tools/cache/reflector.go index c1ea13de574..45eaff52853 100644 --- a/upstream/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/upstream/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -334,9 +334,12 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { return nil } if err != nil { - klog.Warningf("The watchlist request ended with an error, falling back to the standard LIST/WATCH semantics because making progress is better than deadlocking, err = %v", err) + if !apierrors.IsInvalid(err) { + return err + } + klog.Warning("the watch-list feature is not supported by the server, falling back to the previous LIST/WATCH semantic") fallbackToList = true - // ensure that we won't accidentally pass some garbage down the watch. + // Ensure that we won't accidentally pass some garbage down the watch. w = nil } } @@ -348,8 +351,6 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { } } - klog.V(2).Infof("Caches populated for %v from %s", r.typeDescription, r.name) - resyncerrc := make(chan error, 1) cancelCh := make(chan struct{}) defer close(cancelCh) @@ -394,11 +395,6 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc // give the stopCh a chance to stop the loop, even in case of continue statements further down on errors select { case <-stopCh: - // we can only end up here when the stopCh - // was closed after a successful watchlist or list request - if w != nil { - w.Stop() - } return nil default: } @@ -674,12 +670,6 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // "k8s.io/initial-events-end" bookmark. initTrace.Step("Objects streamed", trace.Field{Key: "count", Value: len(temporaryStore.List())}) r.setIsLastSyncResourceVersionUnavailable(false) - - // we utilize the temporaryStore to ensure independence from the current store implementation. - // as of today, the store is implemented as a queue and will be drained by the higher-level - // component as soon as it finishes replacing the content. - checkWatchListConsistencyIfRequested(stopCh, r.name, resourceVersion, r.listerWatcher, temporaryStore) - if err = r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { return nil, fmt.Errorf("unable to sync watch-list result: %v", err) } @@ -772,7 +762,7 @@ loop: } case watch.Bookmark: // A `Bookmark` means watch has synced here, just update the resourceVersion - if meta.GetAnnotations()["k8s.io/initial-events-end"] == "true" { + if _, ok := meta.GetAnnotations()["k8s.io/initial-events-end"]; ok { if exitOnInitialEventsEndBookmark != nil { *exitOnInitialEventsEndBookmark = true } diff --git a/upstream/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go b/upstream/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go deleted file mode 100644 index aa3027d714e..00000000000 --- a/upstream/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cache - -import ( - "context" - "os" - "sort" - "strconv" - "time" - - "github.com/google/go-cmp/cmp" - - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" -) - -var dataConsistencyDetectionEnabled = false - -func init() { - dataConsistencyDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) -} - -// checkWatchListConsistencyIfRequested performs a data consistency check only when -// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. -// -// The consistency check is meant to be enforced only in the CI, not in production. -// The check ensures that data retrieved by the watch-list api call -// is exactly the same as data received by the standard list api call. -// -// Note that this function will panic when data inconsistency is detected. -// This is intentional because we want to catch it in the CI. -func checkWatchListConsistencyIfRequested(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - if !dataConsistencyDetectionEnabled { - return - } - checkWatchListConsistency(stopCh, identity, lastSyncedResourceVersion, listerWatcher, store) -} - -// checkWatchListConsistency exists solely for testing purposes. -// we cannot use checkWatchListConsistencyIfRequested because -// it is guarded by an environmental variable. -// we cannot manipulate the environmental variable because -// it will affect other tests in this package. -func checkWatchListConsistency(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - klog.Warningf("%s: data consistency check for the watch-list feature is enabled, this will result in an additional call to the API server.", identity) - opts := metav1.ListOptions{ - ResourceVersion: lastSyncedResourceVersion, - ResourceVersionMatch: metav1.ResourceVersionMatchExact, - } - var list runtime.Object - err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Second, true, func(_ context.Context) (done bool, err error) { - list, err = listerWatcher.List(opts) - if err != nil { - // the consistency check will only be enabled in the CI - // and LIST calls in general will be retired by the client-go library - // if we fail simply log and retry - klog.Errorf("failed to list data from the server, retrying until stopCh is closed, err: %v", err) - return false, nil - } - return true, nil - }) - if err != nil { - klog.Errorf("failed to list data from the server, the watch-list consistency check won't be performed, stopCh was closed, err: %v", err) - return - } - - rawListItems, err := meta.ExtractListWithAlloc(list) - if err != nil { - panic(err) // this should never happen - } - - listItems := toMetaObjectSliceOrDie(rawListItems) - storeItems := toMetaObjectSliceOrDie(store.List()) - - sort.Sort(byUID(listItems)) - sort.Sort(byUID(storeItems)) - - if !cmp.Equal(listItems, storeItems) { - klog.Infof("%s: data received by the new watch-list api call is different than received by the standard list api call, diff: %v", identity, cmp.Diff(listItems, storeItems)) - msg := "data inconsistency detected for the watch-list feature, panicking!" - panic(msg) - } -} - -type byUID []metav1.Object - -func (a byUID) Len() int { return len(a) } -func (a byUID) Less(i, j int) bool { return a[i].GetUID() < a[j].GetUID() } -func (a byUID) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -func toMetaObjectSliceOrDie[T any](s []T) []metav1.Object { - result := make([]metav1.Object, len(s)) - for i, v := range s { - m, err := meta.Accessor(v) - if err != nil { - panic(err) - } - result[i] = m - } - return result -} diff --git a/upstream/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/upstream/vendor/k8s.io/client-go/tools/cache/shared_informer.go index b3f37431d5c..be8694ddb62 100644 --- a/upstream/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/upstream/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -334,9 +334,11 @@ func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool }, stopCh) if err != nil { + klog.V(2).Infof("stop requested") return false } + klog.V(4).Infof("caches populated") return true } diff --git a/upstream/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go b/upstream/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go index 0fc2fd0a0ca..10744156b83 100644 --- a/upstream/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go +++ b/upstream/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go @@ -49,12 +49,12 @@ type InClusterConfig interface { Possible() bool } -// NewNonInteractiveDeferredLoadingClientConfig creates a ClientConfig using the passed context name +// NewNonInteractiveDeferredLoadingClientConfig creates a ConfigClientClientConfig using the passed context name func NewNonInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides) ClientConfig { return &DeferredLoadingClientConfig{loader: loader, overrides: overrides, icc: &inClusterClientConfig{overrides: overrides}} } -// NewInteractiveDeferredLoadingClientConfig creates a ClientConfig using the passed context name and the fallback auth reader +// NewInteractiveDeferredLoadingClientConfig creates a ConfigClientClientConfig using the passed context name and the fallback auth reader func NewInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides, fallbackReader io.Reader) ClientConfig { return &DeferredLoadingClientConfig{loader: loader, overrides: overrides, icc: &inClusterClientConfig{overrides: overrides}, fallbackReader: fallbackReader} } diff --git a/upstream/vendor/k8s.io/client-go/tools/internal/events/interfaces.go b/upstream/vendor/k8s.io/client-go/tools/internal/events/interfaces.go deleted file mode 100644 index be6261b531f..00000000000 --- a/upstream/vendor/k8s.io/client-go/tools/internal/events/interfaces.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package internal is needed to break an import cycle: record.EventRecorderAdapter -// needs this interface definition to implement it, but event.NewEventBroadcasterAdapter -// needs record.NewBroadcaster. Therefore this interface cannot be in event/interfaces.go. -package internal - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" -) - -// EventRecorder knows how to record events on behalf of an EventSource. -type EventRecorder interface { - // Eventf constructs an event from the given information and puts it in the queue for sending. - // 'regarding' is the object this event is about. Event will make a reference-- or you may also - // pass a reference to the object directly. - // 'related' is the secondary object for more complex actions. E.g. when regarding object triggers - // a creation or deletion of related object. - // 'type' of this event, and can be one of Normal, Warning. New types could be added in future - // 'reason' is the reason this event is generated. 'reason' should be short and unique; it - // should be in UpperCamelCase format (starting with a capital letter). "reason" will be used - // to automate handling of events, so imagine people writing switch statements to handle them. - // You want to make that easy. - // 'action' explains what happened with regarding/what action did the ReportingController - // (ReportingController is a type of a Controller reporting an Event, e.g. k8s.io/node-controller, k8s.io/kubelet.) - // take in regarding's name; it should be in UpperCamelCase format (starting with a capital letter). - // 'note' is intended to be human readable. - Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) -} - -// EventRecorderLogger extends EventRecorder such that a logger can -// be set for methods in EventRecorder. Normally, those methods -// uses the global default logger to record errors and debug messages. -// If that is not desired, use WithLogger to provide a logger instance. -type EventRecorderLogger interface { - EventRecorder - - // WithLogger replaces the context used for logging. This is a cheap call - // and meant to be used for contextual logging: - // recorder := ... - // logger := klog.FromContext(ctx) - // recorder.WithLogger(logger).Eventf(...) - WithLogger(logger klog.Logger) EventRecorderLogger -} diff --git a/upstream/vendor/k8s.io/client-go/tools/record/event.go b/upstream/vendor/k8s.io/client-go/tools/record/event.go index d1511696d0f..f176167dc80 100644 --- a/upstream/vendor/k8s.io/client-go/tools/record/event.go +++ b/upstream/vendor/k8s.io/client-go/tools/record/event.go @@ -29,7 +29,6 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" - internalevents "k8s.io/client-go/tools/internal/events" "k8s.io/client-go/tools/record/util" ref "k8s.io/client-go/tools/reference" "k8s.io/klog/v2" @@ -111,21 +110,6 @@ type EventRecorder interface { AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) } -// EventRecorderLogger extends EventRecorder such that a logger can -// be set for methods in EventRecorder. Normally, those methods -// uses the global default logger to record errors and debug messages. -// If that is not desired, use WithLogger to provide a logger instance. -type EventRecorderLogger interface { - EventRecorder - - // WithLogger replaces the context used for logging. This is a cheap call - // and meant to be used for contextual logging: - // recorder := ... - // logger := klog.FromContext(ctx) - // recorder.WithLogger(logger).Eventf(...) - WithLogger(logger klog.Logger) EventRecorderLogger -} - // EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log. type EventBroadcaster interface { // StartEventWatcher starts sending events received from this EventBroadcaster to the given @@ -147,7 +131,7 @@ type EventBroadcaster interface { // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster // with the event source set to the given event source. - NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorderLogger + NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder // Shutdown shuts down the broadcaster. Once the broadcaster is shut // down, it will only try to record an event in a sink once before @@ -158,14 +142,12 @@ type EventBroadcaster interface { // EventRecorderAdapter is a wrapper around a "k8s.io/client-go/tools/record".EventRecorder // implementing the new "k8s.io/client-go/tools/events".EventRecorder interface. type EventRecorderAdapter struct { - recorder EventRecorderLogger + recorder EventRecorder } -var _ internalevents.EventRecorder = &EventRecorderAdapter{} - // NewEventRecorderAdapter returns an adapter implementing the new // "k8s.io/client-go/tools/events".EventRecorder interface. -func NewEventRecorderAdapter(recorder EventRecorderLogger) *EventRecorderAdapter { +func NewEventRecorderAdapter(recorder EventRecorder) *EventRecorderAdapter { return &EventRecorderAdapter{ recorder: recorder, } @@ -176,76 +158,28 @@ func (a *EventRecorderAdapter) Eventf(regarding, _ runtime.Object, eventtype, re a.recorder.Eventf(regarding, eventtype, reason, note, args...) } -func (a *EventRecorderAdapter) WithLogger(logger klog.Logger) internalevents.EventRecorderLogger { - return &EventRecorderAdapter{ - recorder: a.recorder.WithLogger(logger), - } -} - // Creates a new event broadcaster. -func NewBroadcaster(opts ...BroadcasterOption) EventBroadcaster { - c := config{ - sleepDuration: defaultSleepDuration, - } - for _, opt := range opts { - opt(&c) - } - eventBroadcaster := &eventBroadcasterImpl{ - Broadcaster: watch.NewLongQueueBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), - sleepDuration: c.sleepDuration, - options: c.CorrelatorOptions, - } - ctx := c.Context - if ctx == nil { - ctx = context.Background() - } else { - // Calling Shutdown is not required when a context was provided: - // when the context is canceled, this goroutine will shut down - // the broadcaster. - go func() { - <-ctx.Done() - eventBroadcaster.Broadcaster.Shutdown() - }() - } - eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(ctx) - return eventBroadcaster +func NewBroadcaster() EventBroadcaster { + return newEventBroadcaster(watch.NewLongQueueBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), defaultSleepDuration) } func NewBroadcasterForTests(sleepDuration time.Duration) EventBroadcaster { - return NewBroadcaster(WithSleepDuration(sleepDuration)) + return newEventBroadcaster(watch.NewLongQueueBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), sleepDuration) } func NewBroadcasterWithCorrelatorOptions(options CorrelatorOptions) EventBroadcaster { - return NewBroadcaster(WithCorrelatorOptions(options)) -} - -func WithCorrelatorOptions(options CorrelatorOptions) BroadcasterOption { - return func(c *config) { - c.CorrelatorOptions = options - } -} - -// WithContext sets a context for the broadcaster. Canceling the context will -// shut down the broadcaster, Shutdown doesn't need to be called. The context -// can also be used to provide a logger. -func WithContext(ctx context.Context) BroadcasterOption { - return func(c *config) { - c.Context = ctx - } + eventBroadcaster := newEventBroadcaster(watch.NewLongQueueBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), defaultSleepDuration) + eventBroadcaster.options = options + return eventBroadcaster } -func WithSleepDuration(sleepDuration time.Duration) BroadcasterOption { - return func(c *config) { - c.sleepDuration = sleepDuration +func newEventBroadcaster(broadcaster *watch.Broadcaster, sleepDuration time.Duration) *eventBroadcasterImpl { + eventBroadcaster := &eventBroadcasterImpl{ + Broadcaster: broadcaster, + sleepDuration: sleepDuration, } -} - -type BroadcasterOption func(*config) - -type config struct { - CorrelatorOptions - context.Context - sleepDuration time.Duration + eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(context.Background()) + return eventBroadcaster } type eventBroadcasterImpl struct { @@ -286,12 +220,12 @@ func (e *eventBroadcasterImpl) recordToSink(sink EventSink, event *v1.Event, eve } tries := 0 for { - if recordEvent(e.cancelationCtx, sink, result.Event, result.Patch, result.Event.Count > 1, eventCorrelator) { + if recordEvent(sink, result.Event, result.Patch, result.Event.Count > 1, eventCorrelator) { break } tries++ if tries >= maxTriesPerEvent { - klog.FromContext(e.cancelationCtx).Error(nil, "Unable to write event (retry limit exceeded!)", "event", event) + klog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) break } @@ -303,7 +237,7 @@ func (e *eventBroadcasterImpl) recordToSink(sink EventSink, event *v1.Event, eve } select { case <-e.cancelationCtx.Done(): - klog.FromContext(e.cancelationCtx).Error(nil, "Unable to write event (broadcaster is shut down)", "event", event) + klog.Errorf("Unable to write event '%#v' (broadcaster is shut down)", event) return case <-time.After(delay): } @@ -314,7 +248,7 @@ func (e *eventBroadcasterImpl) recordToSink(sink EventSink, event *v1.Event, eve // was successfully recorded or discarded, false if it should be retried. // If updateExistingEvent is false, it creates a new event, otherwise it updates // existing event. -func recordEvent(ctx context.Context, sink EventSink, event *v1.Event, patch []byte, updateExistingEvent bool, eventCorrelator *EventCorrelator) bool { +func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEvent bool, eventCorrelator *EventCorrelator) bool { var newEvent *v1.Event var err error if updateExistingEvent { @@ -337,13 +271,13 @@ func recordEvent(ctx context.Context, sink EventSink, event *v1.Event, patch []b switch err.(type) { case *restclient.RequestConstructionError: // We will construct the request the same next time, so don't keep trying. - klog.FromContext(ctx).Error(err, "Unable to construct event (will not retry!)", "event", event) + klog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) return true case *errors.StatusError: if errors.IsAlreadyExists(err) || errors.HasStatusCause(err, v1.NamespaceTerminatingCause) { - klog.FromContext(ctx).V(5).Info("Server rejected event (will not retry!)", "event", event, "err", err) + klog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) } else { - klog.FromContext(ctx).Error(err, "Server rejected event (will not retry!)", "event", event) + klog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) } return true case *errors.UnexpectedObjectError: @@ -352,7 +286,7 @@ func recordEvent(ctx context.Context, sink EventSink, event *v1.Event, patch []b default: // This case includes actual http transport errors. Go ahead and retry. } - klog.FromContext(ctx).Error(err, "Unable to write event (may retry after sleeping)", "event", event) + klog.Errorf("Unable to write event: '%#v': '%v'(may retry after sleeping)", event, err) return false } @@ -365,15 +299,12 @@ func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...int }) } -// StartStructuredLogging starts sending events received from this EventBroadcaster to a structured logger. -// The logger is retrieved from a context if the broadcaster was constructed with a context, otherwise -// the global default is used. +// StartStructuredLogging starts sending events received from this EventBroadcaster to the structured logging function. // The return value can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface { - loggerV := klog.FromContext(e.cancelationCtx).V(int(verbosity)) return e.StartEventWatcher( func(e *v1.Event) { - loggerV.Info("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.FieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) + klog.V(verbosity).InfoS("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.FieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) }) } @@ -382,32 +313,26 @@ func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watc func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { watcher, err := e.Watch() if err != nil { - klog.FromContext(e.cancelationCtx).Error(err, "Unable start event watcher (will not retry!)") + klog.Errorf("Unable start event watcher: '%v' (will not retry!)", err) } go func() { defer utilruntime.HandleCrash() - for { - select { - case <-e.cancelationCtx.Done(): - watcher.Stop() - return - case watchEvent := <-watcher.ResultChan(): - event, ok := watchEvent.Object.(*v1.Event) - if !ok { - // This is all local, so there's no reason this should - // ever happen. - continue - } - eventHandler(event) + for watchEvent := range watcher.ResultChan() { + event, ok := watchEvent.Object.(*v1.Event) + if !ok { + // This is all local, so there's no reason this should + // ever happen. + continue } + eventHandler(event) } }() return watcher } // NewRecorder returns an EventRecorder that records events with the given event source. -func (e *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorderLogger { - return &recorderImplLogger{recorderImpl: &recorderImpl{scheme, source, e.Broadcaster, clock.RealClock{}}, logger: klog.Background()} +func (e *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder { + return &recorderImpl{scheme, source, e.Broadcaster, clock.RealClock{}} } type recorderImpl struct { @@ -417,17 +342,15 @@ type recorderImpl struct { clock clock.PassiveClock } -var _ EventRecorder = &recorderImpl{} - -func (recorder *recorderImpl) generateEvent(logger klog.Logger, object runtime.Object, annotations map[string]string, eventtype, reason, message string) { +func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations map[string]string, eventtype, reason, message string) { ref, err := ref.GetReference(recorder.scheme, object) if err != nil { - logger.Error(err, "Could not construct reference, will not report event", "object", object, "eventType", eventtype, "reason", reason, "message", message) + klog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) return } if !util.ValidateEventType(eventtype) { - logger.Error(nil, "Unsupported event type", "eventType", eventtype) + klog.Errorf("Unsupported event type: '%v'", eventtype) return } @@ -444,16 +367,16 @@ func (recorder *recorderImpl) generateEvent(logger klog.Logger, object runtime.O // outgoing events anyway). sent, err := recorder.ActionOrDrop(watch.Added, event) if err != nil { - logger.Error(err, "Unable to record event (will not retry!)") + klog.Errorf("unable to record event: %v (will not retry!)", err) return } if !sent { - logger.Error(nil, "Unable to record event: too many queued events, dropped event", "event", event) + klog.Errorf("unable to record event: too many queued events, dropped event %#v", event) } } func (recorder *recorderImpl) Event(object runtime.Object, eventtype, reason, message string) { - recorder.generateEvent(klog.Background(), object, nil, eventtype, reason, message) + recorder.generateEvent(object, nil, eventtype, reason, message) } func (recorder *recorderImpl) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { @@ -461,7 +384,7 @@ func (recorder *recorderImpl) Eventf(object runtime.Object, eventtype, reason, m } func (recorder *recorderImpl) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { - recorder.generateEvent(klog.Background(), object, annotations, eventtype, reason, fmt.Sprintf(messageFmt, args...)) + recorder.generateEvent(object, annotations, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, annotations map[string]string, eventtype, reason, message string) *v1.Event { @@ -485,26 +408,3 @@ func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, annotations map Type: eventtype, } } - -type recorderImplLogger struct { - *recorderImpl - logger klog.Logger -} - -var _ EventRecorderLogger = &recorderImplLogger{} - -func (recorder recorderImplLogger) Event(object runtime.Object, eventtype, reason, message string) { - recorder.recorderImpl.generateEvent(recorder.logger, object, nil, eventtype, reason, message) -} - -func (recorder recorderImplLogger) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { - recorder.Event(object, eventtype, reason, fmt.Sprintf(messageFmt, args...)) -} - -func (recorder recorderImplLogger) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { - recorder.generateEvent(recorder.logger, object, annotations, eventtype, reason, fmt.Sprintf(messageFmt, args...)) -} - -func (recorder recorderImplLogger) WithLogger(logger klog.Logger) EventRecorderLogger { - return recorderImplLogger{recorderImpl: recorder.recorderImpl, logger: logger} -} diff --git a/upstream/vendor/k8s.io/client-go/tools/record/fake.go b/upstream/vendor/k8s.io/client-go/tools/record/fake.go index 67eac481712..fda4ad8ff8a 100644 --- a/upstream/vendor/k8s.io/client-go/tools/record/fake.go +++ b/upstream/vendor/k8s.io/client-go/tools/record/fake.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" ) // FakeRecorder is used as a fake during tests. It is thread safe. It is usable @@ -32,8 +31,6 @@ type FakeRecorder struct { IncludeObject bool } -var _ EventRecorderLogger = &FakeRecorder{} - func objectString(object runtime.Object, includeObject bool) string { if !includeObject { return "" @@ -71,10 +68,6 @@ func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[st f.writeEvent(object, annotations, eventtype, reason, messageFmt, args...) } -func (f *FakeRecorder) WithLogger(logger klog.Logger) EventRecorderLogger { - return f -} - // NewFakeRecorder creates new fake event recorder with event channel with // buffer of given size. func NewFakeRecorder(bufferSize int) *FakeRecorder { diff --git a/upstream/vendor/k8s.io/client-go/transport/spdy/spdy.go b/upstream/vendor/k8s.io/client-go/transport/spdy/spdy.go index 9fddc6c5f23..f50b68e5ffb 100644 --- a/upstream/vendor/k8s.io/client-go/transport/spdy/spdy.go +++ b/upstream/vendor/k8s.io/client-go/transport/spdy/spdy.go @@ -43,15 +43,11 @@ func RoundTripperFor(config *restclient.Config) (http.RoundTripper, Upgrader, er if config.Proxy != nil { proxy = config.Proxy } - upgradeRoundTripper, err := spdy.NewRoundTripperWithConfig(spdy.RoundTripperConfig{ - TLS: tlsConfig, - Proxier: proxy, - PingPeriod: time.Second * 5, - UpgradeTransport: nil, + upgradeRoundTripper := spdy.NewRoundTripperWithConfig(spdy.RoundTripperConfig{ + TLS: tlsConfig, + Proxier: proxy, + PingPeriod: time.Second * 5, }) - if err != nil { - return nil, nil, err - } wrapper, err := restclient.HTTPWrappersForConfig(config, upgradeRoundTripper) if err != nil { return nil, nil, err diff --git a/upstream/vendor/k8s.io/client-go/transport/transport.go b/upstream/vendor/k8s.io/client-go/transport/transport.go index 4770331a0e1..78060719a98 100644 --- a/upstream/vendor/k8s.io/client-go/transport/transport.go +++ b/upstream/vendor/k8s.io/client-go/transport/transport.go @@ -96,32 +96,6 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { } if c.HasCA() { - /* - kubernetes mutual (2-way) x509 between client and apiserver: - - 1. apiserver sending its apiserver certificate along with its publickey to client - >2. client verifies the apiserver certificate sent against its cluster certificate authority data - 3. client sending its client certificate along with its public key to the apiserver - 4. apiserver verifies the client certificate sent against its cluster certificate authority data - - description: - here, with this block, - cluster certificate authority data gets loaded into TLS before the handshake process - for client to later during the handshake verify the apiserver certificate - - normal args related to this stage: - --certificate-authority='': - Path to a cert file for the certificate authority - - (retrievable from "kubectl options" command) - (suggested by @deads2k) - - see also: - - for the step 1, see: staging/src/k8s.io/apiserver/pkg/server/options/serving.go - - for the step 3, see: a few lines below in this file - - for the step 4, see: staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go - */ - rootCAs, err := rootCertPool(c.TLS.CAData) if err != nil { return nil, fmt.Errorf("unable to load root certificates: %w", err) @@ -147,35 +121,6 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { } if c.HasCertAuth() || c.HasCertCallback() { - - /* - kubernetes mutual (2-way) x509 between client and apiserver: - - 1. apiserver sending its apiserver certificate along with its publickey to client - 2. client verifies the apiserver certificate sent against its cluster certificate authority data - >3. client sending its client certificate along with its public key to the apiserver - 4. apiserver verifies the client certificate sent against its cluster certificate authority data - - description: - here, with this callback function, - client certificate and pub key get loaded into TLS during the handshake process - for apiserver to later in the step 4 verify the client certificate - - normal args related to this stage: - --client-certificate='': - Path to a client certificate file for TLS - --client-key='': - Path to a client key file for TLS - - (retrievable from "kubectl options" command) - (suggested by @deads2k) - - see also: - - for the step 1, see: staging/src/k8s.io/apiserver/pkg/server/options/serving.go - - for the step 2, see: a few lines above in this file - - for the step 4, see: staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go - */ - tlsConfig.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { // Note: static key/cert data always take precedence over cert // callback. diff --git a/upstream/vendor/k8s.io/client-go/util/workqueue/queue.go b/upstream/vendor/k8s.io/client-go/util/workqueue/queue.go index a363d1afb4f..380c0645526 100644 --- a/upstream/vendor/k8s.io/client-go/util/workqueue/queue.go +++ b/upstream/vendor/k8s.io/client-go/util/workqueue/queue.go @@ -238,12 +238,8 @@ func (q *Type) Done(item interface{}) { // ShutDown will cause q to ignore all new items added to it and // immediately instruct the worker goroutines to exit. func (q *Type) ShutDown() { - q.cond.L.Lock() - defer q.cond.L.Unlock() - - q.drain = false - q.shuttingDown = true - q.cond.Broadcast() + q.setDrain(false) + q.shutdown() } // ShutDownWithDrain will cause q to ignore all new items added to it. As soon @@ -256,16 +252,53 @@ func (q *Type) ShutDown() { // ShutDownWithDrain, as to force the queue shut down to terminate immediately // without waiting for the drainage. func (q *Type) ShutDownWithDrain() { + q.setDrain(true) + q.shutdown() + for q.isProcessing() && q.shouldDrain() { + q.waitForProcessing() + } +} + +// isProcessing indicates if there are still items on the work queue being +// processed. It's used to drain the work queue on an eventual shutdown. +func (q *Type) isProcessing() bool { + q.cond.L.Lock() + defer q.cond.L.Unlock() + return q.processing.len() != 0 +} + +// waitForProcessing waits for the worker goroutines to finish processing items +// and call Done on them. +func (q *Type) waitForProcessing() { + q.cond.L.Lock() + defer q.cond.L.Unlock() + // Ensure that we do not wait on a queue which is already empty, as that + // could result in waiting for Done to be called on items in an empty queue + // which has already been shut down, which will result in waiting + // indefinitely. + if q.processing.len() == 0 { + return + } + q.cond.Wait() +} + +func (q *Type) setDrain(shouldDrain bool) { + q.cond.L.Lock() + defer q.cond.L.Unlock() + q.drain = shouldDrain +} + +func (q *Type) shouldDrain() bool { q.cond.L.Lock() defer q.cond.L.Unlock() + return q.drain +} - q.drain = true +func (q *Type) shutdown() { + q.cond.L.Lock() + defer q.cond.L.Unlock() q.shuttingDown = true q.cond.Broadcast() - - for q.processing.len() != 0 && q.drain { - q.cond.Wait() - } } func (q *Type) ShuttingDown() bool { diff --git a/upstream/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/upstream/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go index 28b829cc139..dce920ad199 100644 --- a/upstream/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ b/upstream/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -77,7 +77,7 @@ func genStatus(t *types.Type) bool { // hasObjectMeta returns true if the type has a ObjectMeta field. func hasObjectMeta(t *types.Type) bool { for _, m := range t.Members { - if m.Embedded && m.Name == "ObjectMeta" { + if m.Embedded == true && m.Name == "ObjectMeta" { return true } } diff --git a/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go b/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go index 4875393913b..f8ee7d07090 100644 --- a/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go +++ b/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go @@ -75,7 +75,6 @@ func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w i } m := map[string]interface{}{ "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "cacheTransformFunc": c.Universe.Type(cacheTransformFunc), "groupVersions": g.groupVersions, "gvInterfaces": gvInterfaces, "gvNewFuncs": gvNewFuncs, @@ -110,7 +109,6 @@ type sharedInformerFactory struct { lock {{.syncMutex|raw}} defaultResync {{.timeDuration|raw}} customResync map[{{.reflectType|raw}}]{{.timeDuration|raw}} - transform {{.cacheTransformFunc|raw}} informers map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}} // startedInformers is used for tracking which informers have been started. @@ -149,14 +147,6 @@ func WithNamespace(namespace string) SharedInformerOption { } } -// WithTransform sets a transform on all informers. -func WithTransform(transform {{.cacheTransformFunc|raw}}) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -262,11 +252,11 @@ func (f *sharedInformerFactory) InformerFor(obj {{.runtimeObject|raw}}, newFunc } informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) f.informers[informerType] = informer return informer } + ` var sharedInformerFactoryInterface = ` diff --git a/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go b/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go index fc1f7786f66..27d4bd51ab1 100644 --- a/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go +++ b/upstream/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go @@ -28,7 +28,6 @@ var ( cacheNewGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewGenericLister"} cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"} cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"} - cacheTransformFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "TransformFunc"} listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"} reflectType = types.Name{Package: "reflect", Name: "Type"} runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"} diff --git a/upstream/vendor/k8s.io/gengo/args/args.go b/upstream/vendor/k8s.io/gengo/args/args.go index 48fe806cd9e..93d863f0e20 100644 --- a/upstream/vendor/k8s.io/gengo/args/args.go +++ b/upstream/vendor/k8s.io/gengo/args/args.go @@ -23,6 +23,7 @@ import ( "fmt" "io/ioutil" "os" + "path" "path/filepath" "strconv" "strings" @@ -31,6 +32,7 @@ import ( "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/parser" + "k8s.io/gengo/types" "github.com/spf13/pflag" ) @@ -120,9 +122,7 @@ func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) { if len(b) != 0 { b = append(b, byte('\n')) } - generatorName := filepath.Base(os.Args[0]) - // Strip the extension from the name to normalize output between *nix and Windows. - generatorName = generatorName[:len(generatorName)-len(filepath.Ext(generatorName))] + generatorName := path.Base(os.Args[0]) generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1) s := fmt.Sprintf("%s\n\n", generatedByComment) b = append(b, []byte(s)...) @@ -155,6 +155,24 @@ func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { return b, nil } +// InputIncludes returns true if the given package is a (sub) package of one of +// the InputDirs. +func (g *GeneratorArgs) InputIncludes(p *types.Package) bool { + for _, dir := range g.InputDirs { + d := dir + if strings.HasSuffix(d, "...") { + d = strings.TrimSuffix(d, "...") + } + if strings.HasPrefix(d, "./vendor/") { + d = strings.TrimPrefix(d, "./vendor/") + } + if strings.HasPrefix(p.Path, d) { + return true + } + } + return false +} + // DefaultSourceTree returns the /src directory of the first entry in $GOPATH. // If $GOPATH is empty, it returns "./". Useful as a default output location. func DefaultSourceTree() string { diff --git a/upstream/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go b/upstream/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go index 8d5942081ec..170f6d7f162 100644 --- a/upstream/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go +++ b/upstream/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go @@ -24,6 +24,7 @@ import ( "strings" "k8s.io/gengo/args" + "k8s.io/gengo/examples/set-gen/sets" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -130,6 +131,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat klog.Fatalf("Failed loading boilerplate: %v", err) } + inputs := sets.NewString(context.Inputs...) packages := generator.Packages{} header := append([]byte(fmt.Sprintf("//go:build !%s\n// +build !%s\n\n", arguments.GeneratedBuildTag, arguments.GeneratedBuildTag)), boilerplate...) @@ -145,7 +147,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } } - for _, i := range context.Inputs { + for i := range inputs { klog.V(5).Infof("Considering pkg %q", i) pkg := context.Universe[i] if pkg == nil { diff --git a/upstream/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go b/upstream/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go index c31d09f7b53..48566aee542 100644 --- a/upstream/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go +++ b/upstream/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go @@ -442,8 +442,6 @@ func newCallTreeForType(existingDefaulters, newDefaulters defaulterFuncMap) *cal } } -// resolveType follows pointers and aliases of `t` until reaching the first -// non-pointer type in `t's` herarchy func resolveTypeAndDepth(t *types.Type) (*types.Type, int) { var prev *types.Type depth := 0 @@ -459,42 +457,6 @@ func resolveTypeAndDepth(t *types.Type) (*types.Type, int) { return t, depth } -// getPointerElementPath follows pointers and aliases to returns all -// pointer elements in the path from the given type, to its base value type. -// -// Example: -// -// type MyString string -// type MyStringPointer *MyString -// type MyStringPointerPointer *MyStringPointer -// type MyStringAlias MyStringPointer -// type MyStringAliasPointer *MyStringAlias -// type MyStringAliasDoublePointer **MyStringAlias -// -// t | defaultPointerElementPath(t) -// ---------------------------|---------------------------------------- -// MyString | [] -// MyStringPointer | [MyString] -// MyStringPointerPointer | [MyStringPointer, MyString] -// MyStringAlias | [MyStringPointer, MyString] -// MyStringAliasPointer | [MyStringAlias, MyStringPointer, MyString] -// MyStringAliasDoublePointer | [*MyStringAlias, MyStringAlias, MyStringPointer, MyString] -func getPointerElementPath(t *types.Type) []*types.Type { - var path []*types.Type - for t != nil { - switch t.Kind { - case types.Alias: - t = t.Underlying - case types.Pointer: - t = t.Elem - path = append(path, t) - default: - t = nil - } - } - return path -} - // getNestedDefault returns the first default value when resolving alias types func getNestedDefault(t *types.Type) string { var prev *types.Type @@ -513,61 +475,84 @@ func getNestedDefault(t *types.Type) string { return "" } +func mustEnforceDefault(t *types.Type, depth int, omitEmpty bool) (interface{}, error) { + if depth > 0 { + return nil, nil + } + switch t.Kind { + case types.Pointer, types.Map, types.Slice, types.Array, types.Interface: + return nil, nil + case types.Struct: + return map[string]interface{}{}, nil + case types.Builtin: + if !omitEmpty { + if zero, ok := typeZeroValue[t.String()]; ok { + return zero, nil + } else { + return nil, fmt.Errorf("please add type %v to typeZeroValue struct", t) + } + } + return nil, nil + default: + return nil, fmt.Errorf("not sure how to enforce default for %v", t.Kind) + } +} + var refRE = regexp.MustCompile(`^ref\((?P<reference>[^"]+)\)$`) var refREIdentIndex = refRE.SubexpIndex("reference") -// ParseSymbolReference looks for strings that match one of the following: +// parseAsRef looks for strings that match one of the following: // - ref(Ident) // - ref(pkgpath.Ident) // If the input string matches either of these, it will return the (optional) // pkgpath, the Ident, and true. Otherwise it will return empty strings and // false. -func ParseSymbolReference(s, sourcePackage string) (types.Name, bool) { +func parseAsRef(s string) (string, bool) { matches := refRE.FindStringSubmatch(s) if len(matches) < refREIdentIndex || matches[refREIdentIndex] == "" { - return types.Name{}, false - } - - contents := matches[refREIdentIndex] - name := types.ParseFullyQualifiedName(contents) - if len(name.Package) == 0 { - name.Package = sourcePackage + return "", false } - return name, true + return matches[refREIdentIndex], true } -func populateDefaultValue(node *callNode, t *types.Type, tags string, commentLines []string, commentPackage string) *callNode { +func populateDefaultValue(node *callNode, t *types.Type, tags string, commentLines []string) *callNode { defaultMap := extractDefaultTag(commentLines) var defaultString string if len(defaultMap) == 1 { defaultString = defaultMap[0] - } else if len(defaultMap) > 1 { - klog.Fatalf("Found more than one default tag for %v", t.Kind) } - baseT, depth := resolveTypeAndDepth(t) + t, depth := resolveTypeAndDepth(t) if depth > 0 && defaultString == "" { defaultString = getNestedDefault(t) } - - if len(defaultString) == 0 { + if len(defaultMap) > 1 { + klog.Fatalf("Found more than one default tag for %v", t.Kind) + } else if len(defaultMap) == 0 { return node } - var symbolReference types.Name + var symbolReference string var defaultValue interface{} - if id, ok := ParseSymbolReference(defaultString, commentPackage); ok { + if id, ok := parseAsRef(defaultString); ok { symbolReference = id defaultString = "" } else if err := json.Unmarshal([]byte(defaultString), &defaultValue); err != nil { klog.Fatalf("Failed to unmarshal default: %v", err) } - if defaultValue != nil { - zero := typeZeroValue[t.String()] - if reflect.DeepEqual(defaultValue, zero) { - // If the default value annotation matches the default value for the type, - // do not generate any defaulting function - return node + omitEmpty := strings.Contains(reflect.StructTag(tags).Get("json"), "omitempty") + if enforced, err := mustEnforceDefault(t, depth, omitEmpty); err != nil { + klog.Fatal(err) + } else if enforced != nil { + if defaultValue != nil { + if reflect.DeepEqual(defaultValue, enforced) { + // If the default value annotation matches the default value for the type, + // do not generate any defaulting function + return node + } else { + enforcedJSON, _ := json.Marshal(enforced) + klog.Fatalf("Invalid default value (%#v) for non-pointer/non-omitempty. If specified, must be: %v", defaultValue, string(enforcedJSON)) + } } } @@ -577,11 +562,11 @@ func populateDefaultValue(node *callNode, t *types.Type, tags string, commentLin node.markerOnly = true } - node.defaultIsPrimitive = baseT.IsPrimitive() - node.defaultType = baseT - node.defaultTopLevelType = t + node.defaultIsPrimitive = t.IsPrimitive() + node.defaultType = t.String() node.defaultValue.InlineConstant = defaultString node.defaultValue.SymbolReference = symbolReference + node.defaultDepth = depth return node } @@ -657,7 +642,7 @@ func (c *callTreeForType) build(t *types.Type, root bool) *callNode { child.elem = true } parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines, t.Elem.Name.Package); member != nil { + } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines); member != nil { member.index = true parent.children = append(parent.children, *member) } @@ -665,7 +650,7 @@ func (c *callTreeForType) build(t *types.Type, root bool) *callNode { if child := c.build(t.Elem, false); child != nil { child.key = true parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines, t.Elem.Name.Package); member != nil { + } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines); member != nil { member.key = true parent.children = append(parent.children, *member) } @@ -682,9 +667,9 @@ func (c *callTreeForType) build(t *types.Type, root bool) *callNode { } if child := c.build(field.Type, false); child != nil { child.field = name - populateDefaultValue(child, field.Type, field.Tags, field.CommentLines, field.Type.Name.Package) + populateDefaultValue(child, field.Type, field.Tags, field.CommentLines) parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, field.Type, field.Tags, field.CommentLines, t.Name.Package); member != nil { + } else if member := populateDefaultValue(nil, field.Type, field.Tags, field.CommentLines); member != nil { member.field = name parent.children = append(parent.children, *member) } @@ -706,6 +691,11 @@ const ( conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" ) +type symbolTracker interface { + namer.ImportTracker + AddSymbol(types.Name) +} + // genDefaulter produces a file with a autogenerated conversions. type genDefaulter struct { generator.DefaultGen @@ -714,7 +704,7 @@ type genDefaulter struct { peerPackages []string newDefaulters defaulterFuncMap existingDefaulters defaulterFuncMap - imports namer.ImportTracker + imports symbolTracker typesForInit []*types.Type } @@ -728,7 +718,7 @@ func NewGenDefaulter(sanitizedName, typesPackage, outputPackage string, existing peerPackages: peerPkgs, newDefaulters: newDefaulters, existingDefaulters: existingDefaulters, - imports: generator.NewImportTrackerForPackage(outputPackage), + imports: generator.NewImportTracker(), typesForInit: make([]*types.Type, 0), } } @@ -804,13 +794,22 @@ func (g *genDefaulter) GenerateType(c *generator.Context, t *types.Type, w io.Wr } i := 0 callTree.VisitInOrder(func(ancestors []*callNode, current *callNode) { - if ref := &current.defaultValue.SymbolReference; len(ref.Name) > 0 { - // Ensure package for symbol is imported in output generation - g.imports.AddSymbol(*ref) + if len(current.defaultValue.SymbolReference) > 0 { + // If the defaultValue was a reference to a symbol instead of a constant, + // make sure to add it to imports and resolve the name of the symbol + // before generating the defaults. + parsedName := types.ParseFullyQualifiedName(current.defaultValue.SymbolReference) + g.imports.AddSymbol(parsedName) // Rewrite the fully qualified name using the local package name // from the imports - ref.Package = g.imports.LocalNameOf(ref.Package) + localPackage := g.imports.LocalNameOf(parsedName.Package) + if len(localPackage) > 0 { + current.defaultValue.SymbolReference = localPackage + "." + parsedName.Name + } else { + current.defaultValue.SymbolReference = parsedName.Name + } + } if len(current.call) == 0 { @@ -892,19 +891,21 @@ type callNode struct { // markerOnly is true if the callNode exists solely to fill in a default value markerOnly bool - // defaultType is the transitive underlying/element type of the node. - // The provided default value literal or reference is expected to be - // convertible to this type. + // defaultDepth is used to determine pointer level of the default value + // For example 1 corresponds to setting a default value and taking its pointer while + // 2 corresponds to setting a default value and taking its pointer's pointer + // 0 implies that no pointers are used + // This is used in situations where a field is a pointer to a primitive value rather than a primitive value itself. // - // e.g: - // node type = *string -> defaultType = string - // node type = StringPointerAlias -> defaultType = string - // Only populated if defaultIsPrimitive is true - defaultType *types.Type + // type A { + // +default="foo" + // Field *string + // } + defaultDepth int - // defaultTopLevelType is the final type the value should resolve to - // This is in constrast with default type, which resolves aliases and pointers. - defaultTopLevelType *types.Type + // defaultType is the type of the default value. + // Only populated if defaultIsPrimitive is true + defaultType string } type defaultValue struct { @@ -914,7 +915,7 @@ type defaultValue struct { // The name of the symbol relative to the parsed package path // i.e. k8s.io/pkg.apis.v1.Foo if from another package or simply `Foo` // if within the same package. - SymbolReference types.Name + SymbolReference string } func (d defaultValue) IsEmpty() bool { @@ -926,7 +927,7 @@ func (d defaultValue) Resolved() string { if len(d.InlineConstant) > 0 { return d.InlineConstant } - return d.SymbolReference.String() + return d.SymbolReference } // CallNodeVisitorFunc is a function for visiting a call tree. ancestors is the list of all parents @@ -1003,7 +1004,8 @@ func (n *callNode) writeDefaulter(varName string, index string, isVarPointer boo "defaultValue": n.defaultValue.Resolved(), "varName": varName, "index": index, - "varTopType": n.defaultTopLevelType, + "varDepth": n.defaultDepth, + "varType": n.defaultType, } variablePlaceholder := "" @@ -1027,72 +1029,25 @@ func (n *callNode) writeDefaulter(varName string, index string, isVarPointer boo if n.defaultIsPrimitive { // If the default value is a primitive when the assigned type is a pointer // keep using the address-of operator on the primitive value until the types match - if pointerPath := getPointerElementPath(n.defaultTopLevelType); len(pointerPath) > 0 { - // If the destination is a pointer, the last element in - // defaultDepth is the element type of the bottommost pointer: - // the base type of our default value. - destElemType := pointerPath[len(pointerPath)-1] - pointerArgs := args.WithArgs(generator.Args{ - "varDepth": len(pointerPath), - "baseElemType": destElemType, - }) - - sw.Do(fmt.Sprintf("if %s == nil {\n", variablePlaceholder), pointerArgs) - if len(n.defaultValue.InlineConstant) > 0 { - // If default value is a literal then it can be assigned via var stmt - sw.Do("var ptrVar$.varDepth$ $.baseElemType|raw$ = $.defaultValue$\n", pointerArgs) - } else { - // If default value is not a literal then it may need to be casted - // to the base type of the destination pointer - sw.Do("ptrVar$.varDepth$ := $.baseElemType|raw$($.defaultValue$)\n", pointerArgs) - } - - for i := len(pointerPath); i >= 1; i-- { - dest := fmt.Sprintf("ptrVar%d", i-1) - assignment := ":=" - if i == 1 { - // Last assignment is into the storage destination - dest = variablePlaceholder - assignment = "=" - } - - sourceType := "*" + destElemType.String() - if i == len(pointerPath) { - // Initial value is not a pointer - sourceType = destElemType.String() - } - destElemType = pointerPath[i-1] - - // Cannot include `dest` into args since its value may be - // `variablePlaceholder` which is a template, not a value - elementArgs := pointerArgs.WithArgs(generator.Args{ - "assignment": assignment, - "source": fmt.Sprintf("ptrVar%d", i), - "destElemType": destElemType, - }) - - // Skip cast if type is exact match - if destElemType.String() == sourceType { - sw.Do(fmt.Sprintf("%v $.assignment$ &$.source$\n", dest), elementArgs) - } else { - sw.Do(fmt.Sprintf("%v $.assignment$ (*$.destElemType|raw$)(&$.source$)\n", dest), elementArgs) - } + if n.defaultDepth > 0 { + sw.Do(fmt.Sprintf("if %s == nil {\n", variablePlaceholder), args) + sw.Do("var ptrVar$.varDepth$ $.varType$ = $.defaultValue$\n", args) + // We iterate until a depth of 1 instead of 0 because the following line + // `if $.varName$ == &ptrVar1` accounts for 1 level already + for i := n.defaultDepth; i > 1; i-- { + sw.Do("ptrVar$.ptri$ := &ptrVar$.i$\n", generator.Args{"i": fmt.Sprintf("%d", i), "ptri": fmt.Sprintf("%d", (i - 1))}) } + sw.Do(fmt.Sprintf("%s = &ptrVar1", variablePlaceholder), args) } else { // For primitive types, nil checks cannot be used and the zero value must be determined - defaultZero, err := getTypeZeroValue(n.defaultType.String()) + defaultZero, err := getTypeZeroValue(n.defaultType) if err != nil { klog.Error(err) } args["defaultZero"] = defaultZero sw.Do(fmt.Sprintf("if %s == $.defaultZero$ {\n", variablePlaceholder), args) - - if len(n.defaultValue.InlineConstant) > 0 { - sw.Do(fmt.Sprintf("%s = $.defaultValue$", variablePlaceholder), args) - } else { - sw.Do(fmt.Sprintf("%s = $.varTopType|raw$($.defaultValue$)", variablePlaceholder), args) - } + sw.Do(fmt.Sprintf("%s = $.defaultValue$", variablePlaceholder), args) } } else { sw.Do(fmt.Sprintf("if %s == nil {\n", variablePlaceholder), args) diff --git a/upstream/vendor/k8s.io/gengo/generator/import_tracker.go b/upstream/vendor/k8s.io/gengo/generator/import_tracker.go index 99525c40ba0..f7c25a01f27 100644 --- a/upstream/vendor/k8s.io/gengo/generator/import_tracker.go +++ b/upstream/vendor/k8s.io/gengo/generator/import_tracker.go @@ -26,34 +26,15 @@ import ( "k8s.io/gengo/types" ) -// NewImportTrackerForPackage creates a new import tracker which is aware -// of a generator's output package. The tracker will not add import lines -// when symbols or types are added from the same package, and LocalNameOf -// will return empty string for the output package. -// -// e.g.: -// -// tracker := NewImportTrackerForPackage("bar.com/pkg/foo") -// tracker.AddSymbol(types.Name{"bar.com/pkg/foo.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz/baz.MyType"}) -// -// tracker.LocalNameOf("bar.com/pkg/foo") -> "" -// tracker.LocalNameOf("bar.com/pkg/baz") -> "baz" -// tracker.LocalNameOf("bar.com/pkg/baz/baz") -> "bazbaz" -// tracker.ImportLines() -> {`baz "bar.com/pkg/baz"`, `bazbaz "bar.com/pkg/baz/baz"`} -func NewImportTrackerForPackage(local string, typesToAdd ...*types.Type) *namer.DefaultImportTracker { - tracker := namer.NewDefaultImportTracker(types.Name{Package: local}) +func NewImportTracker(typesToAdd ...*types.Type) *namer.DefaultImportTracker { + tracker := namer.NewDefaultImportTracker(types.Name{}) tracker.IsInvalidType = func(*types.Type) bool { return false } tracker.LocalName = func(name types.Name) string { return golangTrackerLocalName(&tracker, name) } tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } tracker.AddTypes(typesToAdd...) return &tracker -} -func NewImportTracker(typesToAdd ...*types.Type) *namer.DefaultImportTracker { - return NewImportTrackerForPackage("", typesToAdd...) } func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { diff --git a/upstream/vendor/k8s.io/gengo/namer/import_tracker.go b/upstream/vendor/k8s.io/gengo/namer/import_tracker.go index 567c1fffcd9..2bf1d503f94 100644 --- a/upstream/vendor/k8s.io/gengo/namer/import_tracker.go +++ b/upstream/vendor/k8s.io/gengo/namer/import_tracker.go @@ -99,7 +99,7 @@ func (tracker *DefaultImportTracker) ImportLines() []string { for path := range tracker.pathToName { importPaths = append(importPaths, path) } - sort.Strings(importPaths) + sort.Sort(sort.StringSlice(importPaths)) out := []string{} for _, path := range importPaths { out = append(out, tracker.PrintImport(path, tracker.pathToName[path])) diff --git a/upstream/vendor/k8s.io/gengo/namer/namer.go b/upstream/vendor/k8s.io/gengo/namer/namer.go index a0f1a24abe9..6feb2d0c464 100644 --- a/upstream/vendor/k8s.io/gengo/namer/namer.go +++ b/upstream/vendor/k8s.io/gengo/namer/namer.go @@ -300,7 +300,6 @@ func (ns *NameStrategy) Name(t *types.Type) string { // import. You can implement yourself or use the one in the generation package. type ImportTracker interface { AddType(*types.Type) - AddSymbol(types.Name) LocalNameOf(packagePath string) string PathOf(localName string) (string, bool) ImportLines() []string diff --git a/upstream/vendor/k8s.io/klog/v2/.golangci.yaml b/upstream/vendor/k8s.io/klog/v2/.golangci.yaml deleted file mode 100644 index 0d77d65f063..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/.golangci.yaml +++ /dev/null @@ -1,6 +0,0 @@ -linters: - disable-all: true - enable: # sorted alphabetical - - gofmt - - misspell - - revive diff --git a/upstream/vendor/k8s.io/klog/v2/OWNERS b/upstream/vendor/k8s.io/klog/v2/OWNERS index 7500475a64a..a2fe8f351bf 100644 --- a/upstream/vendor/k8s.io/klog/v2/OWNERS +++ b/upstream/vendor/k8s.io/klog/v2/OWNERS @@ -1,16 +1,14 @@ # See the OWNERS docs at https://go.k8s.io/owners reviewers: - harshanarayana - - mengjiao-liu - pohly approvers: - dims - - pohly - thockin + - serathius emeritus_approvers: - brancz - justinsb - lavalamp - piosz - - serathius - tallclair diff --git a/upstream/vendor/k8s.io/klog/v2/contextual_slog.go b/upstream/vendor/k8s.io/klog/v2/contextual_slog.go deleted file mode 100644 index d3b562521db..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/contextual_slog.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package klog - -import ( - "log/slog" - - "github.com/go-logr/logr" -) - -// SetSlogLogger reconfigures klog to log through the slog logger. The logger must not be nil. -func SetSlogLogger(logger *slog.Logger) { - SetLoggerWithOptions(logr.FromSlogHandler(logger.Handler()), ContextualLogger(true)) -} diff --git a/upstream/vendor/k8s.io/klog/v2/internal/buffer/buffer.go b/upstream/vendor/k8s.io/klog/v2/internal/buffer/buffer.go index 46de00fb06c..f325ded5e9e 100644 --- a/upstream/vendor/k8s.io/klog/v2/internal/buffer/buffer.go +++ b/upstream/vendor/k8s.io/klog/v2/internal/buffer/buffer.go @@ -30,16 +30,14 @@ import ( var ( // Pid is inserted into log headers. Can be overridden for tests. Pid = os.Getpid() - - // Time, if set, will be used instead of the actual current time. - Time *time.Time ) // Buffer holds a single byte.Buffer for reuse. The zero value is ready for // use. It also provides some helper methods for output formatting. type Buffer struct { bytes.Buffer - Tmp [64]byte // temporary byte array for creating headers. + Tmp [64]byte // temporary byte array for creating headers. + next *Buffer } var buffers = sync.Pool{ @@ -124,9 +122,6 @@ func (buf *Buffer) FormatHeader(s severity.Severity, file string, line int, now // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. // It's worth about 3X. Fprintf is hard. - if Time != nil { - now = *Time - } _, month, day := now.Date() hour, minute, second := now.Clock() // Lmmdd hh:mm:ss.uuuuuu threadid file:line] @@ -162,9 +157,6 @@ func (buf *Buffer) SprintHeader(s severity.Severity, now time.Time) string { // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. // It's worth about 3X. Fprintf is hard. - if Time != nil { - now = *Time - } _, month, day := now.Date() hour, minute, second := now.Clock() // Lmmdd hh:mm:ss.uuuuuu threadid file:line] diff --git a/upstream/vendor/k8s.io/klog/v2/internal/clock/clock.go b/upstream/vendor/k8s.io/klog/v2/internal/clock/clock.go index cc11bb4802a..b8b6af5c817 100644 --- a/upstream/vendor/k8s.io/klog/v2/internal/clock/clock.go +++ b/upstream/vendor/k8s.io/klog/v2/internal/clock/clock.go @@ -39,6 +39,16 @@ type Clock interface { // Sleep sleeps for the provided duration d. // Consider making the sleep interruptible by using 'select' on a context channel and a timer channel. Sleep(d time.Duration) + // Tick returns the channel of a new Ticker. + // This method does not allow to free/GC the backing ticker. Use + // NewTicker from WithTicker instead. + Tick(d time.Duration) <-chan time.Time +} + +// WithTicker allows for injecting fake or real clocks into code that +// needs to do arbitrary things based on time. +type WithTicker interface { + Clock // NewTicker returns a new Ticker. NewTicker(time.Duration) Ticker } @@ -56,7 +66,7 @@ type WithDelayedExecution interface { // WithTickerAndDelayedExecution allows for injecting fake or real clocks // into code that needs Ticker and AfterFunc functionality type WithTickerAndDelayedExecution interface { - Clock + WithTicker // AfterFunc executes f in its own goroutine after waiting // for d duration and returns a Timer whose channel can be // closed by calling Stop() on the Timer. @@ -69,7 +79,7 @@ type Ticker interface { Stop() } -var _ Clock = RealClock{} +var _ = WithTicker(RealClock{}) // RealClock really calls time.Now() type RealClock struct{} @@ -105,6 +115,13 @@ func (RealClock) AfterFunc(d time.Duration, f func()) Timer { } } +// Tick is the same as time.Tick(d) +// This method does not allow to free/GC the backing ticker. Use +// NewTicker instead. +func (RealClock) Tick(d time.Duration) <-chan time.Time { + return time.Tick(d) +} + // NewTicker returns a new Ticker. func (RealClock) NewTicker(d time.Duration) Ticker { return &realTicker{ diff --git a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go b/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go index d1a4751c94b..bcdf5f8ee12 100644 --- a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go +++ b/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go @@ -172,6 +172,73 @@ func KVListFormat(b *bytes.Buffer, keysAndValues ...interface{}) { Formatter{}.KVListFormat(b, keysAndValues...) } +// KVFormat serializes one key/value pair into the provided buffer. +// A space gets inserted before the pair. +func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { + b.WriteByte(' ') + // Keys are assumed to be well-formed according to + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments + // for the sake of performance. Keys with spaces, + // special characters, etc. will break parsing. + if sK, ok := k.(string); ok { + // Avoid one allocation when the key is a string, which + // normally it should be. + b.WriteString(sK) + } else { + b.WriteString(fmt.Sprintf("%s", k)) + } + + // The type checks are sorted so that more frequently used ones + // come first because that is then faster in the common + // cases. In Kubernetes, ObjectRef (a Stringer) is more common + // than plain strings + // (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235). + switch v := v.(type) { + case textWriter: + writeTextWriterValue(b, v) + case fmt.Stringer: + writeStringValue(b, StringerToString(v)) + case string: + writeStringValue(b, v) + case error: + writeStringValue(b, ErrorToString(v)) + case logr.Marshaler: + value := MarshalerToValue(v) + // A marshaler that returns a string is useful for + // delayed formatting of complex values. We treat this + // case like a normal string. This is useful for + // multi-line support. + // + // We could do this by recursively formatting a value, + // but that comes with the risk of infinite recursion + // if a marshaler returns itself. Instead we call it + // only once and rely on it returning the intended + // value directly. + switch value := value.(type) { + case string: + writeStringValue(b, value) + default: + f.formatAny(b, value) + } + case []byte: + // In https://github.com/kubernetes/klog/pull/237 it was decided + // to format byte slices with "%+q". The advantages of that are: + // - readable output if the bytes happen to be printable + // - non-printable bytes get represented as unicode escape + // sequences (\uxxxx) + // + // The downsides are that we cannot use the faster + // strconv.Quote here and that multi-line output is not + // supported. If developers know that a byte array is + // printable and they want multi-line output, they can + // convert the value to string before logging it. + b.WriteByte('=') + b.WriteString(fmt.Sprintf("%+q", v)) + default: + f.formatAny(b, v) + } +} + func KVFormat(b *bytes.Buffer, k, v interface{}) { Formatter{}.KVFormat(b, k, v) } @@ -184,10 +251,6 @@ func (f Formatter) formatAny(b *bytes.Buffer, v interface{}) { b.WriteString(f.AnyToStringHook(v)) return } - formatAsJSON(b, v) -} - -func formatAsJSON(b *bytes.Buffer, v interface{}) { encoder := json.NewEncoder(b) l := b.Len() if err := encoder.Encode(v); err != nil { diff --git a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go b/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go deleted file mode 100644 index d9c7d15467c..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build !go1.21 -// +build !go1.21 - -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package serialize - -import ( - "bytes" - "fmt" - - "github.com/go-logr/logr" -) - -// KVFormat serializes one key/value pair into the provided buffer. -// A space gets inserted before the pair. -func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { - // This is the version without slog support. Must be kept in sync with - // the version in keyvalues_slog.go. - - b.WriteByte(' ') - // Keys are assumed to be well-formed according to - // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments - // for the sake of performance. Keys with spaces, - // special characters, etc. will break parsing. - if sK, ok := k.(string); ok { - // Avoid one allocation when the key is a string, which - // normally it should be. - b.WriteString(sK) - } else { - b.WriteString(fmt.Sprintf("%s", k)) - } - - // The type checks are sorted so that more frequently used ones - // come first because that is then faster in the common - // cases. In Kubernetes, ObjectRef (a Stringer) is more common - // than plain strings - // (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235). - switch v := v.(type) { - case textWriter: - writeTextWriterValue(b, v) - case fmt.Stringer: - writeStringValue(b, StringerToString(v)) - case string: - writeStringValue(b, v) - case error: - writeStringValue(b, ErrorToString(v)) - case logr.Marshaler: - value := MarshalerToValue(v) - // A marshaler that returns a string is useful for - // delayed formatting of complex values. We treat this - // case like a normal string. This is useful for - // multi-line support. - // - // We could do this by recursively formatting a value, - // but that comes with the risk of infinite recursion - // if a marshaler returns itself. Instead we call it - // only once and rely on it returning the intended - // value directly. - switch value := value.(type) { - case string: - writeStringValue(b, value) - default: - f.formatAny(b, value) - } - case []byte: - // In https://github.com/kubernetes/klog/pull/237 it was decided - // to format byte slices with "%+q". The advantages of that are: - // - readable output if the bytes happen to be printable - // - non-printable bytes get represented as unicode escape - // sequences (\uxxxx) - // - // The downsides are that we cannot use the faster - // strconv.Quote here and that multi-line output is not - // supported. If developers know that a byte array is - // printable and they want multi-line output, they can - // convert the value to string before logging it. - b.WriteByte('=') - b.WriteString(fmt.Sprintf("%+q", v)) - default: - f.formatAny(b, v) - } -} diff --git a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go b/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go deleted file mode 100644 index 89acf977230..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package serialize - -import ( - "bytes" - "fmt" - "log/slog" - "strconv" - - "github.com/go-logr/logr" -) - -// KVFormat serializes one key/value pair into the provided buffer. -// A space gets inserted before the pair. -func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { - // This is the version without slog support. Must be kept in sync with - // the version in keyvalues_slog.go. - - b.WriteByte(' ') - // Keys are assumed to be well-formed according to - // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments - // for the sake of performance. Keys with spaces, - // special characters, etc. will break parsing. - if sK, ok := k.(string); ok { - // Avoid one allocation when the key is a string, which - // normally it should be. - b.WriteString(sK) - } else { - b.WriteString(fmt.Sprintf("%s", k)) - } - - // The type checks are sorted so that more frequently used ones - // come first because that is then faster in the common - // cases. In Kubernetes, ObjectRef (a Stringer) is more common - // than plain strings - // (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235). - // - // slog.LogValuer does not need to be handled here because the handler will - // already have resolved such special values to the final value for logging. - switch v := v.(type) { - case textWriter: - writeTextWriterValue(b, v) - case slog.Value: - // This must come before fmt.Stringer because slog.Value implements - // fmt.Stringer, but does not produce the output that we want. - b.WriteByte('=') - generateJSON(b, v) - case fmt.Stringer: - writeStringValue(b, StringerToString(v)) - case string: - writeStringValue(b, v) - case error: - writeStringValue(b, ErrorToString(v)) - case logr.Marshaler: - value := MarshalerToValue(v) - // A marshaler that returns a string is useful for - // delayed formatting of complex values. We treat this - // case like a normal string. This is useful for - // multi-line support. - // - // We could do this by recursively formatting a value, - // but that comes with the risk of infinite recursion - // if a marshaler returns itself. Instead we call it - // only once and rely on it returning the intended - // value directly. - switch value := value.(type) { - case string: - writeStringValue(b, value) - default: - f.formatAny(b, value) - } - case slog.LogValuer: - value := slog.AnyValue(v).Resolve() - if value.Kind() == slog.KindString { - writeStringValue(b, value.String()) - } else { - b.WriteByte('=') - generateJSON(b, value) - } - case []byte: - // In https://github.com/kubernetes/klog/pull/237 it was decided - // to format byte slices with "%+q". The advantages of that are: - // - readable output if the bytes happen to be printable - // - non-printable bytes get represented as unicode escape - // sequences (\uxxxx) - // - // The downsides are that we cannot use the faster - // strconv.Quote here and that multi-line output is not - // supported. If developers know that a byte array is - // printable and they want multi-line output, they can - // convert the value to string before logging it. - b.WriteByte('=') - b.WriteString(fmt.Sprintf("%+q", v)) - default: - f.formatAny(b, v) - } -} - -// generateJSON has the same preference for plain strings as KVFormat. -// In contrast to KVFormat it always produces valid JSON with no line breaks. -func generateJSON(b *bytes.Buffer, v interface{}) { - switch v := v.(type) { - case slog.Value: - switch v.Kind() { - case slog.KindGroup: - // Format as a JSON group. We must not involve f.AnyToStringHook (if there is any), - // because there is no guarantee that it produces valid JSON. - b.WriteByte('{') - for i, attr := range v.Group() { - if i > 0 { - b.WriteByte(',') - } - b.WriteString(strconv.Quote(attr.Key)) - b.WriteByte(':') - generateJSON(b, attr.Value) - } - b.WriteByte('}') - case slog.KindLogValuer: - generateJSON(b, v.Resolve()) - default: - // Peel off the slog.Value wrapper and format the actual value. - generateJSON(b, v.Any()) - } - case fmt.Stringer: - b.WriteString(strconv.Quote(StringerToString(v))) - case logr.Marshaler: - generateJSON(b, MarshalerToValue(v)) - case slog.LogValuer: - generateJSON(b, slog.AnyValue(v).Resolve().Any()) - case string: - b.WriteString(strconv.Quote(v)) - case error: - b.WriteString(strconv.Quote(v.Error())) - default: - formatAsJSON(b, v) - } -} diff --git a/upstream/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go b/upstream/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go deleted file mode 100644 index 21f1697d095..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sloghandler - -import ( - "context" - "log/slog" - "runtime" - "strings" - "time" - - "k8s.io/klog/v2/internal/severity" -) - -func Handle(_ context.Context, record slog.Record, groups string, printWithInfos func(file string, line int, now time.Time, err error, s severity.Severity, msg string, kvList []interface{})) error { - now := record.Time - if now.IsZero() { - // This format doesn't support printing entries without a time. - now = time.Now() - } - - // slog has numeric severity levels, with 0 as default "info", negative for debugging, and - // positive with some pre-defined levels for more important. Those ranges get mapped to - // the corresponding klog levels where possible, with "info" the default that is used - // also for negative debug levels. - level := record.Level - s := severity.InfoLog - switch { - case level >= slog.LevelError: - s = severity.ErrorLog - case level >= slog.LevelWarn: - s = severity.WarningLog - } - - var file string - var line int - if record.PC != 0 { - // Same as https://cs.opensource.google/go/x/exp/+/642cacee:slog/record.go;drc=642cacee5cc05231f45555a333d07f1005ffc287;l=70 - fs := runtime.CallersFrames([]uintptr{record.PC}) - f, _ := fs.Next() - if f.File != "" { - file = f.File - if slash := strings.LastIndex(file, "/"); slash >= 0 { - file = file[slash+1:] - } - line = f.Line - } - } else { - file = "???" - line = 1 - } - - kvList := make([]interface{}, 0, 2*record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - kvList = appendAttr(groups, kvList, attr) - return true - }) - - printWithInfos(file, line, now, nil, s, record.Message, kvList) - return nil -} - -func Attrs2KVList(groups string, attrs []slog.Attr) []interface{} { - kvList := make([]interface{}, 0, 2*len(attrs)) - for _, attr := range attrs { - kvList = appendAttr(groups, kvList, attr) - } - return kvList -} - -func appendAttr(groups string, kvList []interface{}, attr slog.Attr) []interface{} { - var key string - if groups != "" { - key = groups + "." + attr.Key - } else { - key = attr.Key - } - return append(kvList, key, attr.Value) -} diff --git a/upstream/vendor/k8s.io/klog/v2/k8s_references_slog.go b/upstream/vendor/k8s.io/klog/v2/k8s_references_slog.go deleted file mode 100644 index 5522c84c774..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/k8s_references_slog.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package klog - -import ( - "log/slog" -) - -func (ref ObjectRef) LogValue() slog.Value { - if ref.Namespace != "" { - return slog.GroupValue(slog.String("name", ref.Name), slog.String("namespace", ref.Namespace)) - } - return slog.GroupValue(slog.String("name", ref.Name)) -} - -var _ slog.LogValuer = ObjectRef{} - -func (ks kobjSlice) LogValue() slog.Value { - return slog.AnyValue(ks.MarshalLog()) -} - -var _ slog.LogValuer = kobjSlice{} diff --git a/upstream/vendor/k8s.io/klog/v2/klog.go b/upstream/vendor/k8s.io/klog/v2/klog.go index 026be9e3b19..152f8a6bd6d 100644 --- a/upstream/vendor/k8s.io/klog/v2/klog.go +++ b/upstream/vendor/k8s.io/klog/v2/klog.go @@ -14,26 +14,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package klog contains the following functionality: -// -// - output routing as defined via command line flags ([InitFlags]) -// - log formatting as text, either with a single, unstructured string ([Info], [Infof], etc.) -// or as a structured log entry with message and key/value pairs ([InfoS], etc.) -// - management of a go-logr [Logger] ([SetLogger], [Background], [TODO]) -// - helper functions for logging values ([Format]) and managing the state of klog ([CaptureState], [State.Restore]) -// - wrappers for [logr] APIs for contextual logging where the wrappers can -// be turned into no-ops ([EnableContextualLogging], [NewContext], [FromContext], -// [LoggerWithValues], [LoggerWithName]); if the ability to turn off -// contextual logging is not needed, then go-logr can also be used directly -// - type aliases for go-logr types to simplify imports in code which uses both (e.g. [Logger]) -// - [k8s.io/klog/v2/textlogger]: a logger which uses the same formatting as klog log with -// simpler output routing; beware that it comes with its own command line flags -// and does not use the ones from klog -// - [k8s.io/klog/v2/ktesting]: per-test output in Go unit tests -// - [k8s.io/klog/v2/klogr]: a deprecated, standalone [logr.Logger] on top of the main klog package; -// use [Background] instead if klog output routing is needed, [k8s.io/klog/v2/textlogger] if not -// - [k8s.io/klog/v2/examples]: demos of this functionality -// - [k8s.io/klog/v2/test]: reusable tests for [logr.Logger] implementations +// Package klog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. +// It provides functions Info, Warning, Error, Fatal, plus formatting variants such as +// Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. // // Basic examples: // @@ -432,7 +415,7 @@ func init() { logging.stderrThreshold = severityValue{ Severity: severity.ErrorLog, // Default stderrThreshold is ERROR. } - commandLine.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true)") + commandLine.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false)") commandLine.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") commandLine.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") @@ -535,7 +518,9 @@ type settings struct { func (s settings) deepCopy() settings { // vmodule is a slice and would be shared, so we have copy it. filter := make([]modulePat, len(s.vmodule.filter)) - copy(filter, s.vmodule.filter) + for i := range s.vmodule.filter { + filter[i] = s.vmodule.filter[i] + } s.vmodule.filter = filter if s.logger != nil { @@ -672,15 +657,16 @@ func (l *loggingT) header(s severity.Severity, depth int) (*buffer.Buffer, strin } } } - return l.formatHeader(s, file, line, timeNow()), file, line + return l.formatHeader(s, file, line), file, line } // formatHeader formats a log header using the provided file name and line number. -func (l *loggingT) formatHeader(s severity.Severity, file string, line int, now time.Time) *buffer.Buffer { +func (l *loggingT) formatHeader(s severity.Severity, file string, line int) *buffer.Buffer { buf := buffer.GetBuffer() if l.skipHeaders { return buf } + now := timeNow() buf.FormatHeader(s, file, line, now) return buf } @@ -690,10 +676,6 @@ func (l *loggingT) println(s severity.Severity, logger *logWriter, filter LogFil } func (l *loggingT) printlnDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, args ...interface{}) { - if false { - _ = fmt.Sprintln(args...) // cause vet to treat this function like fmt.Println - } - buf, file, line := l.header(s, depth) // If a logger is set and doesn't support writing a formatted buffer, // we clear the generated header as we rely on the backing @@ -714,15 +696,7 @@ func (l *loggingT) print(s severity.Severity, logger *logWriter, filter LogFilte } func (l *loggingT) printDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, args ...interface{}) { - if false { - _ = fmt.Sprint(args...) // // cause vet to treat this function like fmt.Print - } - buf, file, line := l.header(s, depth) - l.printWithInfos(buf, file, line, s, logger, filter, depth+1, args...) -} - -func (l *loggingT) printWithInfos(buf *buffer.Buffer, file string, line int, s severity.Severity, logger *logWriter, filter LogFilter, depth int, args ...interface{}) { // If a logger is set and doesn't support writing a formatted buffer, // we clear the generated header as we rely on the backing // logger implementation to print headers. @@ -745,10 +719,6 @@ func (l *loggingT) printf(s severity.Severity, logger *logWriter, filter LogFilt } func (l *loggingT) printfDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, format string, args ...interface{}) { - if false { - _ = fmt.Sprintf(format, args...) // cause vet to treat this function like fmt.Printf - } - buf, file, line := l.header(s, depth) // If a logger is set and doesn't support writing a formatted buffer, // we clear the generated header as we rely on the backing @@ -771,7 +741,7 @@ func (l *loggingT) printfDepth(s severity.Severity, logger *logWriter, filter Lo // alsoLogToStderr is true, the log message always appears on standard error; it // will also appear in the log file unless --logtostderr is set. func (l *loggingT) printWithFileLine(s severity.Severity, logger *logWriter, filter LogFilter, file string, line int, alsoToStderr bool, args ...interface{}) { - buf := l.formatHeader(s, file, line, timeNow()) + buf := l.formatHeader(s, file, line) // If a logger is set and doesn't support writing a formatted buffer, // we clear the generated header as we rely on the backing // logger implementation to print headers. @@ -789,7 +759,7 @@ func (l *loggingT) printWithFileLine(s severity.Severity, logger *logWriter, fil l.output(s, logger, buf, 2 /* depth */, file, line, alsoToStderr) } -// if logger is specified, will call logger.Error, otherwise output with logging module. +// if loggr is specified, will call loggr.Error, otherwise output with logging module. func (l *loggingT) errorS(err error, logger *logWriter, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) { if filter != nil { msg, keysAndValues = filter.FilterS(msg, keysAndValues) @@ -801,7 +771,7 @@ func (l *loggingT) errorS(err error, logger *logWriter, filter LogFilter, depth l.printS(err, severity.ErrorLog, depth+1, msg, keysAndValues...) } -// if logger is specified, will call logger.Info, otherwise output with logging module. +// if loggr is specified, will call loggr.Info, otherwise output with logging module. func (l *loggingT) infoS(logger *logWriter, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) { if filter != nil { msg, keysAndValues = filter.FilterS(msg, keysAndValues) @@ -813,7 +783,7 @@ func (l *loggingT) infoS(logger *logWriter, filter LogFilter, depth int, msg str l.printS(nil, severity.InfoLog, depth+1, msg, keysAndValues...) } -// printS is called from infoS and errorS if logger is not specified. +// printS is called from infoS and errorS if loggr is not specified. // set log severity by s func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, keysAndValues ...interface{}) { // Only create a new buffer if we don't have one cached. @@ -826,7 +796,7 @@ func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, serialize.KVListFormat(&b.Buffer, "err", err) } serialize.KVListFormat(&b.Buffer, keysAndValues...) - l.printDepth(s, nil, nil, depth+1, &b.Buffer) + l.printDepth(s, logging.logger, nil, depth+1, &b.Buffer) // Make the buffer available for reuse. buffer.PutBuffer(b) } @@ -903,9 +873,6 @@ func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Bu if logger.writeKlogBuffer != nil { logger.writeKlogBuffer(data) } else { - if len(data) > 0 && data[len(data)-1] == '\n' { - data = data[:len(data)-1] - } // TODO: set 'severity' and caller information as structured log info // keysAndValues := []interface{}{"severity", severityName[s], "file", file, "line", line} if s == severity.ErrorLog { @@ -930,7 +897,7 @@ func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Bu l.exit(err) } } - _, _ = l.file[severity.InfoLog].Write(data) + l.file[severity.InfoLog].Write(data) } else { if l.file[s] == nil { if err := l.createFiles(s); err != nil { @@ -940,20 +907,20 @@ func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Bu } if l.oneOutput { - _, _ = l.file[s].Write(data) + l.file[s].Write(data) } else { switch s { case severity.FatalLog: - _, _ = l.file[severity.FatalLog].Write(data) + l.file[severity.FatalLog].Write(data) fallthrough case severity.ErrorLog: - _, _ = l.file[severity.ErrorLog].Write(data) + l.file[severity.ErrorLog].Write(data) fallthrough case severity.WarningLog: - _, _ = l.file[severity.WarningLog].Write(data) + l.file[severity.WarningLog].Write(data) fallthrough case severity.InfoLog: - _, _ = l.file[severity.InfoLog].Write(data) + l.file[severity.InfoLog].Write(data) } } } @@ -979,7 +946,7 @@ func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Bu logExitFunc = func(error) {} // If we get a write error, we'll still exit below. for log := severity.FatalLog; log >= severity.InfoLog; log-- { if f := l.file[log]; f != nil { // Can be nil if -logtostderr is set. - _, _ = f.Write(trace) + f.Write(trace) } } l.mu.Unlock() @@ -1135,7 +1102,7 @@ const flushInterval = 5 * time.Second // flushDaemon periodically flushes the log file buffers. type flushDaemon struct { mu sync.Mutex - clock clock.Clock + clock clock.WithTicker flush func() stopC chan struct{} stopDone chan struct{} @@ -1143,7 +1110,7 @@ type flushDaemon struct { // newFlushDaemon returns a new flushDaemon. If the passed clock is nil, a // clock.RealClock is used. -func newFlushDaemon(flush func(), tickClock clock.Clock) *flushDaemon { +func newFlushDaemon(flush func(), tickClock clock.WithTicker) *flushDaemon { if tickClock == nil { tickClock = clock.RealClock{} } @@ -1234,8 +1201,8 @@ func (l *loggingT) flushAll() { for s := severity.FatalLog; s >= severity.InfoLog; s-- { file := l.file[s] if file != nil { - _ = file.Flush() // ignore error - _ = file.Sync() // ignore error + file.Flush() // ignore error + file.Sync() // ignore error } } if logging.loggerOptions.flush != nil { @@ -1314,7 +1281,9 @@ func (l *loggingT) setV(pc uintptr) Level { fn := runtime.FuncForPC(pc) file, _ := fn.FileLine(pc) // The file is something like /a/b/c/d.go. We want just the d. - file = strings.TrimSuffix(file, ".go") + if strings.HasSuffix(file, ".go") { + file = file[:len(file)-3] + } if slash := strings.LastIndex(file, "/"); slash >= 0 { file = file[slash+1:] } diff --git a/upstream/vendor/k8s.io/klog/v2/klog_file.go b/upstream/vendor/k8s.io/klog/v2/klog_file.go index 8bee16204db..1025d644f38 100644 --- a/upstream/vendor/k8s.io/klog/v2/klog_file.go +++ b/upstream/vendor/k8s.io/klog/v2/klog_file.go @@ -109,8 +109,8 @@ func create(tag string, t time.Time, startup bool) (f *os.File, filename string, f, err := openOrCreate(fname, startup) if err == nil { symlink := filepath.Join(dir, link) - _ = os.Remove(symlink) // ignore err - _ = os.Symlink(name, symlink) // ignore err + os.Remove(symlink) // ignore err + os.Symlink(name, symlink) // ignore err return f, fname, nil } lastErr = err diff --git a/upstream/vendor/k8s.io/klog/v2/klogr.go b/upstream/vendor/k8s.io/klog/v2/klogr.go index efec96fd45b..15de00e21fb 100644 --- a/upstream/vendor/k8s.io/klog/v2/klogr.go +++ b/upstream/vendor/k8s.io/klog/v2/klogr.go @@ -22,11 +22,6 @@ import ( "k8s.io/klog/v2/internal/serialize" ) -const ( - // nameKey is used to log the `WithName` values as an additional attribute. - nameKey = "logger" -) - // NewKlogr returns a logger that is functionally identical to // klogr.NewWithOptions(klogr.FormatKlog), i.e. it passes through to klog. The // difference is that it uses a simpler implementation. @@ -37,15 +32,10 @@ func NewKlogr() Logger { // klogger is a subset of klogr/klogr.go. It had to be copied to break an // import cycle (klogr wants to use klog, and klog wants to use klogr). type klogger struct { + level int callDepth int - - // hasPrefix is true if the first entry in values is the special - // nameKey key/value. Such an entry gets added and later updated in - // WithName. - hasPrefix bool - - values []interface{} - groups string + prefix string + values []interface{} } func (l *klogger) Init(info logr.RuntimeInfo) { @@ -54,40 +44,34 @@ func (l *klogger) Init(info logr.RuntimeInfo) { func (l *klogger) Info(level int, msg string, kvList ...interface{}) { merged := serialize.MergeKVs(l.values, kvList) + if l.prefix != "" { + msg = l.prefix + ": " + msg + } // Skip this function. VDepth(l.callDepth+1, Level(level)).InfoSDepth(l.callDepth+1, msg, merged...) } func (l *klogger) Enabled(level int) bool { - return VDepth(l.callDepth+1, Level(level)).Enabled() + // Skip this function and logr.Logger.Info where Enabled is called. + return VDepth(l.callDepth+2, Level(level)).Enabled() } func (l *klogger) Error(err error, msg string, kvList ...interface{}) { merged := serialize.MergeKVs(l.values, kvList) + if l.prefix != "" { + msg = l.prefix + ": " + msg + } ErrorSDepth(l.callDepth+1, err, msg, merged...) } // WithName returns a new logr.Logger with the specified name appended. klogr -// uses '.' characters to separate name elements. Callers should not pass '.' +// uses '/' characters to separate name elements. Callers should not pass '/' // in the provided name string, but this library does not actually enforce that. func (l klogger) WithName(name string) logr.LogSink { - if l.hasPrefix { - // Copy slice and modify value. No length checks and type - // assertions are needed because hasPrefix is only true if the - // first two elements exist and are key/value strings. - v := make([]interface{}, 0, len(l.values)) - v = append(v, l.values...) - prefix, _ := v[1].(string) - v[1] = prefix + "." + name - l.values = v - } else { - // Preprend new key/value pair. - v := make([]interface{}, 0, 2+len(l.values)) - v = append(v, nameKey, name) - v = append(v, l.values...) - l.values = v - l.hasPrefix = true + if len(l.prefix) > 0 { + l.prefix = l.prefix + "/" } + l.prefix += name return &l } diff --git a/upstream/vendor/k8s.io/klog/v2/klogr_slog.go b/upstream/vendor/k8s.io/klog/v2/klogr_slog.go deleted file mode 100644 index c77d7baafa6..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/klogr_slog.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package klog - -import ( - "context" - "log/slog" - "strconv" - "time" - - "github.com/go-logr/logr" - - "k8s.io/klog/v2/internal/buffer" - "k8s.io/klog/v2/internal/serialize" - "k8s.io/klog/v2/internal/severity" - "k8s.io/klog/v2/internal/sloghandler" -) - -func (l *klogger) Handle(ctx context.Context, record slog.Record) error { - if logging.logger != nil { - if slogSink, ok := logging.logger.GetSink().(logr.SlogSink); ok { - // Let that logger do the work. - return slogSink.Handle(ctx, record) - } - } - - return sloghandler.Handle(ctx, record, l.groups, slogOutput) -} - -// slogOutput corresponds to several different functions in klog.go. -// It goes through some of the same checks and formatting steps before -// it ultimately converges by calling logging.printWithInfos. -func slogOutput(file string, line int, now time.Time, err error, s severity.Severity, msg string, kvList []interface{}) { - // See infoS. - if logging.logger != nil { - // Taking this path happens when klog has a logger installed - // as backend which doesn't support slog. Not good, we have to - // guess about the call depth and drop the actual location. - logger := logging.logger.WithCallDepth(2) - if s > severity.ErrorLog { - logger.Error(err, msg, kvList...) - } else { - logger.Info(msg, kvList...) - } - return - } - - // See printS. - b := buffer.GetBuffer() - b.WriteString(strconv.Quote(msg)) - if err != nil { - serialize.KVListFormat(&b.Buffer, "err", err) - } - serialize.KVListFormat(&b.Buffer, kvList...) - - // See print + header. - buf := logging.formatHeader(s, file, line, now) - logging.printWithInfos(buf, file, line, s, nil, nil, 0, &b.Buffer) - - buffer.PutBuffer(b) -} - -func (l *klogger) WithAttrs(attrs []slog.Attr) logr.SlogSink { - clone := *l - clone.values = serialize.WithValues(l.values, sloghandler.Attrs2KVList(l.groups, attrs)) - return &clone -} - -func (l *klogger) WithGroup(name string) logr.SlogSink { - clone := *l - if clone.groups != "" { - clone.groups += "." + name - } else { - clone.groups = name - } - return &clone -} - -var _ logr.SlogSink = &klogger{} diff --git a/upstream/vendor/k8s.io/klog/v2/safeptr.go b/upstream/vendor/k8s.io/klog/v2/safeptr.go deleted file mode 100644 index bbe24c2e82c..00000000000 --- a/upstream/vendor/k8s.io/klog/v2/safeptr.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package klog - -// SafePtr is a function that takes a pointer of any type (T) as an argument. -// If the provided pointer is not nil, it returns the same pointer. If it is nil, it returns nil instead. -// -// This function is particularly useful to prevent nil pointer dereferencing when: -// -// - The type implements interfaces that are called by the logger, such as `fmt.Stringer`. -// - And these interface implementations do not perform nil checks themselves. -func SafePtr[T any](p *T) any { - if p == nil { - return nil - } - return p -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go b/upstream/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go new file mode 100644 index 00000000000..e0156692563 --- /dev/null +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "reflect" + + "k8s.io/kube-openapi/pkg/schemamutation" + "k8s.io/kube-openapi/pkg/validation/spec" +) + +// wrapRefs wraps OpenAPI V3 Schema refs that contain sibling elements. +// AllOf is used to wrap the Ref to prevent references from having sibling elements +// Please see https://github.com/kubernetes/kubernetes/issues/106387#issuecomment-967640388 +func WrapRefs(schema *spec.Schema) *spec.Schema { + walker := schemamutation.Walker{ + SchemaCallback: func(schema *spec.Schema) *spec.Schema { + orig := schema + clone := func() { + if orig == schema { + schema = new(spec.Schema) + *schema = *orig + } + } + if schema.Ref.String() != "" && !reflect.DeepEqual(*schema, spec.Schema{SchemaProps: spec.SchemaProps{Ref: schema.Ref}}) { + clone() + refSchema := new(spec.Schema) + refSchema.Ref = schema.Ref + schema.Ref = spec.Ref{} + schema.AllOf = []spec.Schema{*refSchema} + } + return schema + }, + RefCallback: schemamutation.RefCallbackNoop, + } + return walker.WalkSchema(schema) +} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/cached/cache.go b/upstream/vendor/k8s.io/kube-openapi/pkg/cached/cache.go index a66fe8a0958..76415b7830b 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/cached/cache.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/cached/cache.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package cached provides a cache mechanism based on etags to lazily +// Package cache provides a cache mechanism based on etags to lazily // build, and/or cache results from expensive operation such that those // operations are not repeated unnecessarily. The operations can be // created as a tree, and replaced dynamically as needed. @@ -25,18 +25,16 @@ limitations under the License. // // This package uses a source/transform/sink model of caches to build // the dependency tree, and can be used as follows: -// - [Func]: A source cache that recomputes the content every time. -// - [Once]: A source cache that always produces the +// - [NewSource]: A source cache that recomputes the content every time. +// - [NewStaticSource]: A source cache that always produces the // same content, it is only called once. -// - [Transform]: A cache that transforms data from one format to +// - [NewTransformer]: A cache that transforms data from one format to // another. It's only refreshed when the source changes. -// - [Merge]: A cache that aggregates multiple caches in a map into one. +// - [NewMerger]: A cache that aggregates multiple caches into one. // It's only refreshed when the source changes. -// - [MergeList]: A cache that aggregates multiple caches in a list into one. -// It's only refreshed when the source changes. -// - [Atomic]: A cache adapter that atomically replaces the source with a new one. -// - [LastSuccess]: A cache adapter that caches the last successful and returns -// it if the next call fails. It extends [Atomic]. +// - [Replaceable]: A cache adapter that can be atomically +// replaced with a new one, and saves the previous results in case an +// error pops-up. // // # Etags // @@ -56,45 +54,61 @@ import ( "sync/atomic" ) -// Value is wrapping a value behind a getter for lazy evaluation. -type Value[T any] interface { - Get() (value T, etag string, err error) -} - -// Result is wrapping T and error into a struct for cases where a tuple is more -// convenient or necessary in Golang. +// Result is the content returned from a call to a cache. It can either +// be created with [NewResultOK] if the call was a success, or +// [NewResultErr] if the call resulted in an error. type Result[T any] struct { - Value T - Etag string - Err error + Data T + Etag string + Err error } -func (r Result[T]) Get() (T, string, error) { - return r.Value, r.Etag, r.Err +// NewResultOK creates a new [Result] for a successful operation. +func NewResultOK[T any](data T, etag string) Result[T] { + return Result[T]{ + Data: data, + Etag: etag, + } } -// Func wraps a (thread-safe) function as a Value[T]. -func Func[T any](fn func() (T, string, error)) Value[T] { - return valueFunc[T](fn) +// NewResultErr creates a new [Result] when an error has happened. +func NewResultErr[T any](err error) Result[T] { + return Result[T]{ + Err: err, + } } -type valueFunc[T any] func() (T, string, error) - -func (c valueFunc[T]) Get() (T, string, error) { - return c() +// Result can be treated as a [Data] if necessary. +func (r Result[T]) Get() Result[T] { + return r } -// Static returns constant values. -func Static[T any](value T, etag string) Value[T] { - return Result[T]{Value: value, Etag: etag} +// Data is a cache that performs an action whose result data will be +// cached. It also returns an "etag" identifier to version the cache, so +// that the caller can know if they have the most recent version of the +// cache (and can decide to cache some operation based on that). +// +// The [NewMerger] and [NewTransformer] automatically handle +// that for you by checking if the etag is updated before calling the +// merging or transforming function. +type Data[T any] interface { + // Returns the cached data, as well as an "etag" to identify the + // version of the cache, or an error if something happened. + Get() Result[T] } -// Merge merges a of cached values. The merge function only gets called if any of -// the dependency has changed. +// NewMerger creates a new merge cache, a cache that merges the result +// of other caches. The function only gets called if any of the +// dependency has changed. // // If any of the dependency returned an error before, or any of the // dependency returned an error this time, or if the mergeFn failed -// before, then the function is run again. +// before, then the function is reran. +// +// The caches and results are mapped by K so that associated data can be +// retrieved. The map of dependencies can not be modified after +// creation, and a new merger should be created (and probably replaced +// using a [Replaceable]). // // Note that this assumes there is no "partial" merge, the merge // function will remerge all the dependencies together everytime. Since @@ -104,19 +118,18 @@ func Static[T any](value T, etag string) Value[T] { // Also note that Golang map iteration is not stable. If the mergeFn // depends on the order iteration to be stable, it will need to // implement its own sorting or iteration order. -func Merge[K comparable, T, V any](mergeFn func(results map[K]Result[T]) (V, string, error), caches map[K]Value[T]) Value[V] { - list := make([]Value[T], 0, len(caches)) - - // map from index to key +func NewMerger[K comparable, T, V any](mergeFn func(results map[K]Result[T]) Result[V], caches map[K]Data[T]) Data[V] { + listCaches := make([]Data[T], 0, len(caches)) + // maps from index to key indexes := make(map[int]K, len(caches)) i := 0 for k := range caches { - list = append(list, caches[k]) + listCaches = append(listCaches, caches[k]) indexes[i] = k i++ } - return MergeList(func(results []Result[T]) (V, string, error) { + return NewListMerger(func(results []Result[T]) Result[V] { if len(results) != len(indexes) { panic(fmt.Errorf("invalid result length %d, expected %d", len(results), len(indexes))) } @@ -125,11 +138,20 @@ func Merge[K comparable, T, V any](mergeFn func(results map[K]Result[T]) (V, str m[indexes[i]] = results[i] } return mergeFn(m) - }, list) + }, listCaches) +} + +type listMerger[T, V any] struct { + lock sync.Mutex + mergeFn func([]Result[T]) Result[V] + caches []Data[T] + cacheResults []Result[T] + result Result[V] } -// MergeList merges a list of cached values. The function only gets called if -// any of the dependency has changed. +// NewListMerger creates a new merge cache that merges the results of +// other caches in list form. The function only gets called if any of +// the dependency has changed. // // The benefit of ListMerger over the basic Merger is that caches are // stored in an ordered list so the order of the cache will be @@ -143,37 +165,31 @@ func Merge[K comparable, T, V any](mergeFn func(results map[K]Result[T]) (V, str // function will remerge all the dependencies together everytime. Since // the list of dependencies is constant, there is no way to save some // partial merge information either. -func MergeList[T, V any](mergeFn func(results []Result[T]) (V, string, error), delegates []Value[T]) Value[V] { +func NewListMerger[T, V any](mergeFn func(results []Result[T]) Result[V], caches []Data[T]) Data[V] { return &listMerger[T, V]{ - mergeFn: mergeFn, - delegates: delegates, + mergeFn: mergeFn, + caches: caches, } } -type listMerger[T, V any] struct { - lock sync.Mutex - mergeFn func([]Result[T]) (V, string, error) - delegates []Value[T] - cache []Result[T] - result Result[V] -} - func (c *listMerger[T, V]) prepareResultsLocked() []Result[T] { - cacheResults := make([]Result[T], len(c.delegates)) + cacheResults := make([]Result[T], len(c.caches)) ch := make(chan struct { int Result[T] - }, len(c.delegates)) - for i := range c.delegates { + }, len(c.caches)) + for i := range c.caches { go func(index int) { - value, etag, err := c.delegates[index].Get() ch <- struct { int Result[T] - }{index, Result[T]{Value: value, Etag: etag, Err: err}} + }{ + index, + c.caches[index].Get(), + } }(i) } - for i := 0; i < len(c.delegates); i++ { + for i := 0; i < len(c.caches); i++ { res := <-ch cacheResults[res.int] = res.Result } @@ -181,16 +197,16 @@ func (c *listMerger[T, V]) prepareResultsLocked() []Result[T] { } func (c *listMerger[T, V]) needsRunningLocked(results []Result[T]) bool { - if c.cache == nil { + if c.cacheResults == nil { return true } if c.result.Err != nil { return true } - if len(results) != len(c.cache) { - panic(fmt.Errorf("invalid number of results: %v (expected %v)", len(results), len(c.cache))) + if len(results) != len(c.cacheResults) { + panic(fmt.Errorf("invalid number of results: %v (expected %v)", len(results), len(c.cacheResults))) } - for i, oldResult := range c.cache { + for i, oldResult := range c.cacheResults { newResult := results[i] if newResult.Etag != oldResult.Etag || newResult.Err != nil || oldResult.Err != nil { return true @@ -199,92 +215,98 @@ func (c *listMerger[T, V]) needsRunningLocked(results []Result[T]) bool { return false } -func (c *listMerger[T, V]) Get() (V, string, error) { +func (c *listMerger[T, V]) Get() Result[V] { c.lock.Lock() defer c.lock.Unlock() cacheResults := c.prepareResultsLocked() if c.needsRunningLocked(cacheResults) { - c.cache = cacheResults - c.result.Value, c.result.Etag, c.result.Err = c.mergeFn(c.cache) + c.cacheResults = cacheResults + c.result = c.mergeFn(c.cacheResults) } - return c.result.Value, c.result.Etag, c.result.Err + return c.result } -// Transform the result of another cached value. The transformFn will only be called -// if the source has updated, otherwise, the result will be returned. +// NewTransformer creates a new cache that transforms the result of +// another cache. The transformFn will only be called if the source +// cache has updated the output, otherwise, the cached result will be +// returned. // // If the dependency returned an error before, or it returns an error // this time, or if the transformerFn failed before, the function is // reran. -func Transform[T, V any](transformerFn func(T, string, error) (V, string, error), source Value[T]) Value[V] { - return MergeList(func(delegates []Result[T]) (V, string, error) { - if len(delegates) != 1 { - panic(fmt.Errorf("invalid cache for transformer cache: %v", delegates)) +func NewTransformer[T, V any](transformerFn func(Result[T]) Result[V], source Data[T]) Data[V] { + return NewListMerger(func(caches []Result[T]) Result[V] { + if len(caches) != 1 { + panic(fmt.Errorf("invalid cache for transformer cache: %v", caches)) } - return transformerFn(delegates[0].Value, delegates[0].Etag, delegates[0].Err) - }, []Value[T]{source}) + return transformerFn(caches[0]) + }, []Data[T]{source}) +} + +// NewSource creates a new cache that generates some data. This +// will always be called since we don't know the origin of the data and +// if it needs to be updated or not. sourceFn MUST be thread-safe. +func NewSource[T any](sourceFn func() Result[T]) Data[T] { + c := source[T](sourceFn) + return &c } -// Once calls Value[T].Get() lazily and only once, even in case of an error result. -func Once[T any](d Value[T]) Value[T] { - return &once[T]{ - data: d, +type source[T any] func() Result[T] + +func (c *source[T]) Get() Result[T] { + return (*c)() +} + +// NewStaticSource creates a new cache that always generates the +// same data. This will only be called once (lazily). +func NewStaticSource[T any](staticFn func() Result[T]) Data[T] { + return &static[T]{ + fn: staticFn, } } -type once[T any] struct { +type static[T any] struct { once sync.Once - data Value[T] + fn func() Result[T] result Result[T] } -func (c *once[T]) Get() (T, string, error) { +func (c *static[T]) Get() Result[T] { c.once.Do(func() { - c.result.Value, c.result.Etag, c.result.Err = c.data.Get() + c.result = c.fn() }) - return c.result.Value, c.result.Etag, c.result.Err -} - -// Replaceable extends the Value[T] interface with the ability to change the -// underlying Value[T] after construction. -type Replaceable[T any] interface { - Value[T] - Store(Value[T]) + return c.result } -// Atomic wraps a Value[T] as an atomic value that can be replaced. It implements -// Replaceable[T]. -type Atomic[T any] struct { - value atomic.Pointer[Value[T]] +// Replaceable is a cache that carries the result even when the cache is +// replaced. This is the type that should typically be stored in +// structs. +type Replaceable[T any] struct { + cache atomic.Pointer[Data[T]] + result atomic.Pointer[Result[T]] } -var _ Replaceable[[]byte] = &Atomic[[]byte]{} - -func (x *Atomic[T]) Store(val Value[T]) { x.value.Store(&val) } -func (x *Atomic[T]) Get() (T, string, error) { return (*x.value.Load()).Get() } - -// LastSuccess calls Value[T].Get(), but hides errors by returning the last -// success if there has been any. -type LastSuccess[T any] struct { - Atomic[T] - success atomic.Pointer[Result[T]] -} - -var _ Replaceable[[]byte] = &LastSuccess[[]byte]{} - -func (c *LastSuccess[T]) Get() (T, string, error) { - success := c.success.Load() - value, etag, err := c.Atomic.Get() - if err == nil { - if success == nil { - c.success.CompareAndSwap(nil, &Result[T]{Value: value, Etag: etag, Err: err}) +// Get retrieves the data from the underlying source. [Replaceable] +// implements the [Data] interface itself. This is a pass-through +// that calls the most recent underlying cache. If the cache fails but +// previously had returned a success, that success will be returned +// instead. If the cache fails but we never returned a success, that +// failure is returned. +func (c *Replaceable[T]) Get() Result[T] { + result := (*c.cache.Load()).Get() + + for { + cResult := c.result.Load() + if result.Err != nil && cResult != nil && cResult.Err == nil { + return *cResult + } + if c.result.CompareAndSwap(cResult, &result) { + return result } - return value, etag, err - } - - if success != nil { - return success.Value, success.Etag, success.Err } +} - return value, etag, err +// Replace changes the cache. +func (c *Replaceable[T]) Replace(cache Data[T]) { + c.cache.Swap(&cache) } diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/common/common.go b/upstream/vendor/k8s.io/kube-openapi/pkg/common/common.go index 2e15e163c50..1a6c12e17a5 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/common/common.go @@ -22,6 +22,7 @@ import ( "github.com/emicklei/go-restful/v3" + "k8s.io/kube-openapi/pkg/openapiconv" "k8s.io/kube-openapi/pkg/spec3" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -171,6 +172,43 @@ type OpenAPIV3Config struct { DefaultSecurity []map[string][]string } +// ConvertConfigToV3 converts a Config object to an OpenAPIV3Config object +func ConvertConfigToV3(config *Config) *OpenAPIV3Config { + if config == nil { + return nil + } + + v3Config := &OpenAPIV3Config{ + Info: config.Info, + IgnorePrefixes: config.IgnorePrefixes, + GetDefinitions: config.GetDefinitions, + GetOperationIDAndTags: config.GetOperationIDAndTags, + GetOperationIDAndTagsFromRoute: config.GetOperationIDAndTagsFromRoute, + GetDefinitionName: config.GetDefinitionName, + Definitions: config.Definitions, + SecuritySchemes: make(spec3.SecuritySchemes), + DefaultSecurity: config.DefaultSecurity, + DefaultResponse: openapiconv.ConvertResponse(config.DefaultResponse, []string{"application/json"}), + + CommonResponses: make(map[int]*spec3.Response), + ResponseDefinitions: make(map[string]*spec3.Response), + } + + if config.SecurityDefinitions != nil { + for s, securityScheme := range *config.SecurityDefinitions { + v3Config.SecuritySchemes[s] = openapiconv.ConvertSecurityScheme(securityScheme) + } + } + for k, commonResponse := range config.CommonResponses { + v3Config.CommonResponses[k] = openapiconv.ConvertResponse(&commonResponse, []string{"application/json"}) + } + + for k, responseDefinition := range config.ResponseDefinitions { + v3Config.ResponseDefinitions[k] = openapiconv.ConvertResponse(&responseDefinition, []string{"application/json"}) + } + return v3Config +} + type typeInfo struct { name string format string diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/upstream/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go index a4bbe8b5e11..4654bbe9c7c 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go @@ -26,7 +26,6 @@ import ( "sort" "strings" - defaultergen "k8s.io/gengo/examples/defaulter-gen/generators" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -121,7 +120,7 @@ func newOpenAPIGen(sanitizedName string, targetPackage string) generator.Generat DefaultGen: generator.DefaultGen{ OptionalName: sanitizedName, }, - imports: generator.NewImportTrackerForPackage(targetPackage), + imports: generator.NewImportTracker(), targetPackage: targetPackage, } } @@ -554,83 +553,23 @@ func (g openAPITypeWriter) validatePatchTags(m *types.Member, parent *types.Type return nil } -func defaultFromComments(comments []string, commentPath string, t *types.Type) (interface{}, *types.Name, error) { - var tag string - - for { - var err error - tag, err = getSingleTagsValue(comments, tagDefault) - if err != nil { - return nil, nil, err - } - - if t == nil || len(tag) > 0 { - break - } - - comments = t.CommentLines - commentPath = t.Name.Package - switch t.Kind { - case types.Pointer: - t = t.Elem - case types.Alias: - t = t.Underlying - default: - t = nil - } - } - +func defaultFromComments(comments []string) (interface{}, error) { + tag, err := getSingleTagsValue(comments, tagDefault) if tag == "" { - return nil, nil, nil + return nil, err } - var i interface{} - if id, ok := defaultergen.ParseSymbolReference(tag, commentPath); ok { - klog.Errorf("%v, %v", id, commentPath) - return nil, &id, nil - } else if err := json.Unmarshal([]byte(tag), &i); err != nil { - return nil, nil, fmt.Errorf("failed to unmarshal default: %v", err) - } - return i, nil, nil -} - -func implementsCustomUnmarshalling(t *types.Type) bool { - switch t.Kind { - case types.Pointer: - unmarshaller, isUnmarshaller := t.Elem.Methods["UnmarshalJSON"] - return isUnmarshaller && unmarshaller.Signature.Receiver.Kind == types.Pointer - case types.Struct: - _, isUnmarshaller := t.Methods["UnmarshalJSON"] - return isUnmarshaller - default: - return false + if err := json.Unmarshal([]byte(tag), &i); err != nil { + return nil, fmt.Errorf("failed to unmarshal default: %v", err) } + return i, nil } func mustEnforceDefault(t *types.Type, omitEmpty bool) (interface{}, error) { - // Treat types with custom unmarshalling as a value - // (Can be alias, struct, or pointer) - if implementsCustomUnmarshalling(t) { - // Since Go JSON deserializer always feeds `null` when present - // to structs with custom UnmarshalJSON, the zero value for - // these structs is also null. - // - // In general, Kubernetes API types with custom marshalling should - // marshal their empty values to `null`. - return nil, nil - } - switch t.Kind { - case types.Alias: - return mustEnforceDefault(t.Underlying, omitEmpty) case types.Pointer, types.Map, types.Slice, types.Array, types.Interface: return nil, nil case types.Struct: - if len(t.Members) == 1 && t.Members[0].Embedded { - // Treat a struct with a single embedded member the same as an alias - return mustEnforceDefault(t.Members[0].Type, omitEmpty) - } - return map[string]interface{}{}, nil case types.Builtin: if !omitEmpty { @@ -646,8 +585,9 @@ func mustEnforceDefault(t *types.Type, omitEmpty bool) (interface{}, error) { } } -func (g openAPITypeWriter) generateDefault(comments []string, t *types.Type, omitEmpty bool, commentOwningType *types.Type) error { - def, ref, err := defaultFromComments(comments, commentOwningType.Name.Package, t) +func (g openAPITypeWriter) generateDefault(comments []string, t *types.Type, omitEmpty bool) error { + t = resolveAliasAndEmbeddedType(t) + def, err := defaultFromComments(comments) if err != nil { return err } @@ -663,8 +603,6 @@ func (g openAPITypeWriter) generateDefault(comments []string, t *types.Type, omi } if def != nil { g.Do("Default: $.$,\n", fmt.Sprintf("%#v", def)) - } else if ref != nil { - g.Do("Default: $.|raw$,\n", &types.Type{Name: *ref}) } return nil } @@ -738,7 +676,7 @@ func (g openAPITypeWriter) generateProperty(m *types.Member, parent *types.Type) return nil } omitEmpty := strings.Contains(reflect.StructTag(m.Tags).Get("json"), "omitempty") - if err := g.generateDefault(m.CommentLines, m.Type, omitEmpty, parent); err != nil { + if err := g.generateDefault(m.CommentLines, m.Type, omitEmpty); err != nil { return fmt.Errorf("failed to generate default in %v: %v: %v", parent, m.Name, err) } t := resolveAliasAndPtrType(m.Type) @@ -783,6 +721,22 @@ func (g openAPITypeWriter) generateReferenceProperty(t *types.Type) { g.Do("Ref: ref(\"$.$\"),\n", t.Name.String()) } +func resolveAliasAndEmbeddedType(t *types.Type) *types.Type { + var prev *types.Type + for prev != t { + prev = t + if t.Kind == types.Alias { + t = t.Underlying + } + if t.Kind == types.Struct { + if len(t.Members) == 1 && t.Members[0].Embedded { + t = t.Members[0].Type + } + } + } + return t +} + func resolveAliasAndPtrType(t *types.Type) *types.Type { var prev *types.Type for prev != t { @@ -808,7 +762,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { g.Do("Type: []string{\"object\"},\n", nil) g.Do("AdditionalProperties: &spec.SchemaOrBool{\nAllows: true,\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false, t.Elem); err != nil { + if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false); err != nil { return err } typeString, format := openapi.OpenAPITypeFormat(elemType.String()) @@ -841,7 +795,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { elemType := resolveAliasAndPtrType(t.Elem) g.Do("Type: []string{\"array\"},\n", nil) g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false, t.Elem); err != nil { + if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false); err != nil { return err } typeString, format := openapi.OpenAPITypeFormat(elemType.String()) diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go b/upstream/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go index fc45634887b..2263e2f32b7 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/handler3/handler.go @@ -33,7 +33,6 @@ import ( openapi_v3 "github.com/google/gnostic-models/openapiv3" "github.com/google/uuid" "github.com/munnerz/goautoneg" - "k8s.io/klog/v2" "k8s.io/kube-openapi/pkg/cached" "k8s.io/kube-openapi/pkg/common" @@ -74,38 +73,38 @@ type timedSpec struct { // This type is protected by the lock on OpenAPIService. type openAPIV3Group struct { - specCache cached.LastSuccess[*spec3.OpenAPI] - pbCache cached.Value[timedSpec] - jsonCache cached.Value[timedSpec] + specCache cached.Replaceable[*spec3.OpenAPI] + pbCache cached.Data[timedSpec] + jsonCache cached.Data[timedSpec] } func newOpenAPIV3Group() *openAPIV3Group { o := &openAPIV3Group{} - o.jsonCache = cached.Transform[*spec3.OpenAPI](func(spec *spec3.OpenAPI, etag string, err error) (timedSpec, string, error) { - if err != nil { - return timedSpec{}, "", err + o.jsonCache = cached.NewTransformer[*spec3.OpenAPI](func(result cached.Result[*spec3.OpenAPI]) cached.Result[timedSpec] { + if result.Err != nil { + return cached.NewResultErr[timedSpec](result.Err) } - json, err := json.Marshal(spec) + json, err := json.Marshal(result.Data) if err != nil { - return timedSpec{}, "", err + return cached.NewResultErr[timedSpec](err) } - return timedSpec{spec: json, lastModified: time.Now()}, computeETag(json), nil + return cached.NewResultOK(timedSpec{spec: json, lastModified: time.Now()}, computeETag(json)) }, &o.specCache) - o.pbCache = cached.Transform(func(ts timedSpec, etag string, err error) (timedSpec, string, error) { - if err != nil { - return timedSpec{}, "", err + o.pbCache = cached.NewTransformer(func(result cached.Result[timedSpec]) cached.Result[timedSpec] { + if result.Err != nil { + return cached.NewResultErr[timedSpec](result.Err) } - proto, err := ToV3ProtoBinary(ts.spec) + proto, err := ToV3ProtoBinary(result.Data.spec) if err != nil { - return timedSpec{}, "", err + return cached.NewResultErr[timedSpec](err) } - return timedSpec{spec: proto, lastModified: ts.lastModified}, etag, nil + return cached.NewResultOK(timedSpec{spec: proto, lastModified: result.Data.lastModified}, result.Etag) }, o.jsonCache) return o } -func (o *openAPIV3Group) UpdateSpec(openapi cached.Value[*spec3.OpenAPI]) { - o.specCache.Store(openapi) +func (o *openAPIV3Group) UpdateSpec(openapi cached.Data[*spec3.OpenAPI]) { + o.specCache.Replace(openapi) } // OpenAPIService is the service responsible for serving OpenAPI spec. It has @@ -115,7 +114,7 @@ type OpenAPIService struct { mutex sync.Mutex v3Schema map[string]*openAPIV3Group - discoveryCache cached.LastSuccess[timedSpec] + discoveryCache cached.Replaceable[timedSpec] } func computeETag(data []byte) string { @@ -138,20 +137,20 @@ func NewOpenAPIService() *OpenAPIService { o := &OpenAPIService{} o.v3Schema = make(map[string]*openAPIV3Group) // We're not locked because we haven't shared the structure yet. - o.discoveryCache.Store(o.buildDiscoveryCacheLocked()) + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) return o } -func (o *OpenAPIService) buildDiscoveryCacheLocked() cached.Value[timedSpec] { - caches := make(map[string]cached.Value[timedSpec], len(o.v3Schema)) +func (o *OpenAPIService) buildDiscoveryCacheLocked() cached.Data[timedSpec] { + caches := make(map[string]cached.Data[timedSpec], len(o.v3Schema)) for gvName, group := range o.v3Schema { caches[gvName] = group.jsonCache } - return cached.Merge(func(results map[string]cached.Result[timedSpec]) (timedSpec, string, error) { + return cached.NewMerger(func(results map[string]cached.Result[timedSpec]) cached.Result[timedSpec] { discovery := &OpenAPIV3Discovery{Paths: make(map[string]OpenAPIV3DiscoveryGroupVersion)} for gvName, result := range results { if result.Err != nil { - return timedSpec{}, "", result.Err + return cached.NewResultErr[timedSpec](result.Err) } discovery.Paths[gvName] = OpenAPIV3DiscoveryGroupVersion{ ServerRelativeURL: constructServerRelativeURL(gvName, result.Etag), @@ -159,9 +158,9 @@ func (o *OpenAPIService) buildDiscoveryCacheLocked() cached.Value[timedSpec] { } j, err := json.Marshal(discovery) if err != nil { - return timedSpec{}, "", err + return cached.NewResultErr[timedSpec](err) } - return timedSpec{spec: j, lastModified: time.Now()}, computeETag(j), nil + return cached.NewResultOK(timedSpec{spec: j, lastModified: time.Now()}, computeETag(j)) }, caches) } @@ -172,32 +171,32 @@ func (o *OpenAPIService) getSingleGroupBytes(getType string, group string) ([]by if !ok { return nil, "", time.Now(), fmt.Errorf("Cannot find CRD group %s", group) } + result := cached.Result[timedSpec]{} switch getType { case subTypeJSON: - ts, etag, err := v.jsonCache.Get() - return ts.spec, etag, ts.lastModified, err + result = v.jsonCache.Get() case subTypeProtobuf, subTypeProtobufDeprecated: - ts, etag, err := v.pbCache.Get() - return ts.spec, etag, ts.lastModified, err + result = v.pbCache.Get() default: return nil, "", time.Now(), fmt.Errorf("Invalid accept clause %s", getType) } + return result.Data.spec, result.Etag, result.Data.lastModified, result.Err } // UpdateGroupVersionLazy adds or updates an existing group with the new cached. -func (o *OpenAPIService) UpdateGroupVersionLazy(group string, openapi cached.Value[*spec3.OpenAPI]) { +func (o *OpenAPIService) UpdateGroupVersionLazy(group string, openapi cached.Data[*spec3.OpenAPI]) { o.mutex.Lock() defer o.mutex.Unlock() if _, ok := o.v3Schema[group]; !ok { o.v3Schema[group] = newOpenAPIV3Group() // Since there is a new item, we need to re-build the cache map. - o.discoveryCache.Store(o.buildDiscoveryCacheLocked()) + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) } o.v3Schema[group].UpdateSpec(openapi) } func (o *OpenAPIService) UpdateGroupVersion(group string, openapi *spec3.OpenAPI) { - o.UpdateGroupVersionLazy(group, cached.Static(openapi, uuid.New().String())) + o.UpdateGroupVersionLazy(group, cached.NewResultOK(openapi, uuid.New().String())) } func (o *OpenAPIService) DeleteGroupVersion(group string) { @@ -205,19 +204,19 @@ func (o *OpenAPIService) DeleteGroupVersion(group string) { defer o.mutex.Unlock() delete(o.v3Schema, group) // Rebuild the merge cache map since the items have changed. - o.discoveryCache.Store(o.buildDiscoveryCacheLocked()) + o.discoveryCache.Replace(o.buildDiscoveryCacheLocked()) } func (o *OpenAPIService) HandleDiscovery(w http.ResponseWriter, r *http.Request) { - ts, etag, err := o.discoveryCache.Get() - if err != nil { - klog.Errorf("Error serving discovery: %s", err) + result := o.discoveryCache.Get() + if result.Err != nil { + klog.Errorf("Error serving discovery: %s", result.Err) w.WriteHeader(http.StatusInternalServerError) return } - w.Header().Set("Etag", strconv.Quote(etag)) + w.Header().Set("Etag", strconv.Quote(result.Etag)) w.Header().Set("Content-Type", "application/json") - http.ServeContent(w, r, "/openapi/v3", ts.lastModified, bytes.NewReader(ts.spec)) + http.ServeContent(w, r, "/openapi/v3", result.Data.lastModified, bytes.NewReader(result.Data.spec)) } func (o *OpenAPIService) HandleGroupVersion(w http.ResponseWriter, r *http.Request) { diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/internal/flags.go b/upstream/vendor/k8s.io/kube-openapi/pkg/internal/flags.go index da5485f6a6f..bef60378231 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/internal/flags.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/internal/flags.go @@ -22,4 +22,3 @@ var UseOptimizedJSONUnmarshalingV3 bool = true // Used by tests to selectively disable experimental JSON marshaler var UseOptimizedJSONMarshaling bool = true -var UseOptimizedJSONMarshalingV3 bool = true diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/openapiconv/convert.go b/upstream/vendor/k8s.io/kube-openapi/pkg/openapiconv/convert.go new file mode 100644 index 00000000000..e993fe23d58 --- /dev/null +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/openapiconv/convert.go @@ -0,0 +1,322 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package openapiconv + +import ( + "strings" + + klog "k8s.io/klog/v2" + builderutil "k8s.io/kube-openapi/pkg/builder3/util" + "k8s.io/kube-openapi/pkg/spec3" + "k8s.io/kube-openapi/pkg/validation/spec" +) + +var OpenAPIV2DefPrefix = "#/definitions/" +var OpenAPIV3DefPrefix = "#/components/schemas/" + +// ConvertV2ToV3 converts an OpenAPI V2 object into V3. +// Certain references may be shared between the V2 and V3 objects in the conversion. +func ConvertV2ToV3(v2Spec *spec.Swagger) *spec3.OpenAPI { + v3Spec := &spec3.OpenAPI{ + Version: "3.0.0", + Info: v2Spec.Info, + ExternalDocs: ConvertExternalDocumentation(v2Spec.ExternalDocs), + Paths: ConvertPaths(v2Spec.Paths), + Components: ConvertComponents(v2Spec.SecurityDefinitions, v2Spec.Definitions, v2Spec.Responses, v2Spec.Produces), + } + + return v3Spec +} + +func ConvertExternalDocumentation(v2ED *spec.ExternalDocumentation) *spec3.ExternalDocumentation { + if v2ED == nil { + return nil + } + return &spec3.ExternalDocumentation{ + ExternalDocumentationProps: spec3.ExternalDocumentationProps{ + Description: v2ED.Description, + URL: v2ED.URL, + }, + } +} + +func ConvertComponents(v2SecurityDefinitions spec.SecurityDefinitions, v2Definitions spec.Definitions, v2Responses map[string]spec.Response, produces []string) *spec3.Components { + components := &spec3.Components{} + + if v2Definitions != nil { + components.Schemas = make(map[string]*spec.Schema) + } + for s, schema := range v2Definitions { + components.Schemas[s] = ConvertSchema(&schema) + } + if v2SecurityDefinitions != nil { + components.SecuritySchemes = make(spec3.SecuritySchemes) + } + for s, securityScheme := range v2SecurityDefinitions { + components.SecuritySchemes[s] = ConvertSecurityScheme(securityScheme) + } + if v2Responses != nil { + components.Responses = make(map[string]*spec3.Response) + } + for r, response := range v2Responses { + components.Responses[r] = ConvertResponse(&response, produces) + } + + return components +} + +func ConvertSchema(v2Schema *spec.Schema) *spec.Schema { + if v2Schema == nil { + return nil + } + v3Schema := spec.Schema{ + VendorExtensible: v2Schema.VendorExtensible, + SchemaProps: v2Schema.SchemaProps, + SwaggerSchemaProps: v2Schema.SwaggerSchemaProps, + ExtraProps: v2Schema.ExtraProps, + } + + if refString := v2Schema.Ref.String(); refString != "" { + if idx := strings.Index(refString, OpenAPIV2DefPrefix); idx != -1 { + v3Schema.Ref = spec.MustCreateRef(OpenAPIV3DefPrefix + refString[idx+len(OpenAPIV2DefPrefix):]) + } else { + klog.Errorf("Error: Swagger V2 Ref %s does not contain #/definitions\n", refString) + } + } + + if v2Schema.Properties != nil { + v3Schema.Properties = make(map[string]spec.Schema) + for key, property := range v2Schema.Properties { + v3Schema.Properties[key] = *ConvertSchema(&property) + } + } + if v2Schema.Items != nil { + v3Schema.Items = &spec.SchemaOrArray{ + Schema: ConvertSchema(v2Schema.Items.Schema), + Schemas: ConvertSchemaList(v2Schema.Items.Schemas), + } + } + + if v2Schema.AdditionalProperties != nil { + v3Schema.AdditionalProperties = &spec.SchemaOrBool{ + Schema: ConvertSchema(v2Schema.AdditionalProperties.Schema), + Allows: v2Schema.AdditionalProperties.Allows, + } + } + if v2Schema.AdditionalItems != nil { + v3Schema.AdditionalItems = &spec.SchemaOrBool{ + Schema: ConvertSchema(v2Schema.AdditionalItems.Schema), + Allows: v2Schema.AdditionalItems.Allows, + } + } + + return builderutil.WrapRefs(&v3Schema) +} + +func ConvertSchemaList(v2SchemaList []spec.Schema) []spec.Schema { + if v2SchemaList == nil { + return nil + } + v3SchemaList := []spec.Schema{} + for _, s := range v2SchemaList { + v3SchemaList = append(v3SchemaList, *ConvertSchema(&s)) + } + return v3SchemaList +} + +func ConvertSecurityScheme(v2securityScheme *spec.SecurityScheme) *spec3.SecurityScheme { + if v2securityScheme == nil { + return nil + } + securityScheme := &spec3.SecurityScheme{ + VendorExtensible: v2securityScheme.VendorExtensible, + SecuritySchemeProps: spec3.SecuritySchemeProps{ + Description: v2securityScheme.Description, + Type: v2securityScheme.Type, + Name: v2securityScheme.Name, + In: v2securityScheme.In, + }, + } + + if v2securityScheme.Flow != "" { + securityScheme.Flows = make(map[string]*spec3.OAuthFlow) + securityScheme.Flows[v2securityScheme.Flow] = &spec3.OAuthFlow{ + OAuthFlowProps: spec3.OAuthFlowProps{ + AuthorizationUrl: v2securityScheme.AuthorizationURL, + TokenUrl: v2securityScheme.TokenURL, + Scopes: v2securityScheme.Scopes, + }, + } + } + return securityScheme +} + +func ConvertPaths(v2Paths *spec.Paths) *spec3.Paths { + if v2Paths == nil { + return nil + } + paths := &spec3.Paths{ + VendorExtensible: v2Paths.VendorExtensible, + } + + if v2Paths.Paths != nil { + paths.Paths = make(map[string]*spec3.Path) + } + for k, v := range v2Paths.Paths { + paths.Paths[k] = ConvertPathItem(v) + } + return paths +} + +func ConvertPathItem(v2pathItem spec.PathItem) *spec3.Path { + path := &spec3.Path{ + Refable: v2pathItem.Refable, + PathProps: spec3.PathProps{ + Get: ConvertOperation(v2pathItem.Get), + Put: ConvertOperation(v2pathItem.Put), + Post: ConvertOperation(v2pathItem.Post), + Delete: ConvertOperation(v2pathItem.Delete), + Options: ConvertOperation(v2pathItem.Options), + Head: ConvertOperation(v2pathItem.Head), + Patch: ConvertOperation(v2pathItem.Patch), + }, + VendorExtensible: v2pathItem.VendorExtensible, + } + for _, param := range v2pathItem.Parameters { + path.Parameters = append(path.Parameters, ConvertParameter(param)) + } + return path +} + +func ConvertOperation(v2Operation *spec.Operation) *spec3.Operation { + if v2Operation == nil { + return nil + } + operation := &spec3.Operation{ + VendorExtensible: v2Operation.VendorExtensible, + OperationProps: spec3.OperationProps{ + Description: v2Operation.Description, + ExternalDocs: ConvertExternalDocumentation(v2Operation.OperationProps.ExternalDocs), + Tags: v2Operation.Tags, + Summary: v2Operation.Summary, + Deprecated: v2Operation.Deprecated, + OperationId: v2Operation.ID, + }, + } + + for _, param := range v2Operation.Parameters { + if param.ParamProps.Name == "body" && param.ParamProps.Schema != nil { + operation.OperationProps.RequestBody = &spec3.RequestBody{ + RequestBodyProps: spec3.RequestBodyProps{}, + } + if v2Operation.Consumes != nil { + operation.RequestBody.Content = make(map[string]*spec3.MediaType) + } + for _, consumer := range v2Operation.Consumes { + operation.RequestBody.Content[consumer] = &spec3.MediaType{ + MediaTypeProps: spec3.MediaTypeProps{ + Schema: ConvertSchema(param.ParamProps.Schema), + }, + } + } + } else { + operation.Parameters = append(operation.Parameters, ConvertParameter(param)) + } + } + + operation.Responses = &spec3.Responses{ResponsesProps: spec3.ResponsesProps{ + Default: ConvertResponse(v2Operation.Responses.Default, v2Operation.Produces), + }, + VendorExtensible: v2Operation.Responses.VendorExtensible, + } + + if v2Operation.Responses.StatusCodeResponses != nil { + operation.Responses.StatusCodeResponses = make(map[int]*spec3.Response) + } + for k, v := range v2Operation.Responses.StatusCodeResponses { + operation.Responses.StatusCodeResponses[k] = ConvertResponse(&v, v2Operation.Produces) + } + return operation +} + +func ConvertResponse(v2Response *spec.Response, produces []string) *spec3.Response { + if v2Response == nil { + return nil + } + response := &spec3.Response{ + Refable: ConvertRefableResponse(v2Response.Refable), + VendorExtensible: v2Response.VendorExtensible, + ResponseProps: spec3.ResponseProps{ + Description: v2Response.Description, + }, + } + + if v2Response.Schema != nil { + if produces != nil { + response.Content = make(map[string]*spec3.MediaType) + } + for _, producer := range produces { + response.ResponseProps.Content[producer] = &spec3.MediaType{ + MediaTypeProps: spec3.MediaTypeProps{ + Schema: ConvertSchema(v2Response.Schema), + }, + } + } + } + return response +} + +func ConvertParameter(v2Param spec.Parameter) *spec3.Parameter { + param := &spec3.Parameter{ + Refable: ConvertRefableParameter(v2Param.Refable), + VendorExtensible: v2Param.VendorExtensible, + ParameterProps: spec3.ParameterProps{ + Name: v2Param.Name, + Description: v2Param.Description, + In: v2Param.In, + Required: v2Param.Required, + Schema: ConvertSchema(v2Param.Schema), + AllowEmptyValue: v2Param.AllowEmptyValue, + }, + } + // Convert SimpleSchema into Schema + if param.Schema == nil { + param.Schema = &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{v2Param.Type}, + Format: v2Param.Format, + UniqueItems: v2Param.UniqueItems, + }, + } + } + + return param +} + +func ConvertRefableParameter(refable spec.Refable) spec.Refable { + if refable.Ref.String() != "" { + return spec.Refable{Ref: spec.MustCreateRef(strings.Replace(refable.Ref.String(), "#/parameters/", "#/components/parameters/", 1))} + } + return refable +} + +func ConvertRefableResponse(refable spec.Refable) spec.Refable { + if refable.Ref.String() != "" { + return spec.Refable{Ref: spec.MustCreateRef(strings.Replace(refable.Ref.String(), "#/responses/", "#/components/responses/", 1))} + } + return refable +} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go b/upstream/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go new file mode 100644 index 00000000000..3fac658e3c0 --- /dev/null +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go @@ -0,0 +1,519 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package schemamutation + +import ( + "k8s.io/kube-openapi/pkg/validation/spec" +) + +// Walker runs callback functions on all references of an OpenAPI spec, +// replacing the values when visiting corresponding types. +type Walker struct { + // SchemaCallback will be called on each schema, taking the original schema, + // and before any other callbacks of the Walker. + // If the schema needs to be mutated, DO NOT mutate it in-place, + // always create a copy, mutate, and return it. + SchemaCallback func(schema *spec.Schema) *spec.Schema + + // RefCallback will be called on each ref. + // If the ref needs to be mutated, DO NOT mutate it in-place, + // always create a copy, mutate, and return it. + RefCallback func(ref *spec.Ref) *spec.Ref +} + +type SchemaCallbackFunc func(schema *spec.Schema) *spec.Schema +type RefCallbackFunc func(ref *spec.Ref) *spec.Ref + +var SchemaCallBackNoop SchemaCallbackFunc = func(schema *spec.Schema) *spec.Schema { + return schema +} +var RefCallbackNoop RefCallbackFunc = func(ref *spec.Ref) *spec.Ref { + return ref +} + +// ReplaceReferences rewrites the references without mutating the input. +// The output might share data with the input. +func ReplaceReferences(walkRef func(ref *spec.Ref) *spec.Ref, sp *spec.Swagger) *spec.Swagger { + walker := &Walker{RefCallback: walkRef, SchemaCallback: SchemaCallBackNoop} + return walker.WalkRoot(sp) +} + +func (w *Walker) WalkSchema(schema *spec.Schema) *spec.Schema { + if schema == nil { + return nil + } + + orig := schema + clone := func() { + if orig == schema { + schema = &spec.Schema{} + *schema = *orig + } + } + + // Always run callback on the whole schema first + // so that SchemaCallback can take the original schema as input. + schema = w.SchemaCallback(schema) + + if r := w.RefCallback(&schema.Ref); r != &schema.Ref { + clone() + schema.Ref = *r + } + + definitionsCloned := false + for k, v := range schema.Definitions { + if s := w.WalkSchema(&v); s != &v { + if !definitionsCloned { + definitionsCloned = true + clone() + schema.Definitions = make(spec.Definitions, len(orig.Definitions)) + for k2, v2 := range orig.Definitions { + schema.Definitions[k2] = v2 + } + } + schema.Definitions[k] = *s + } + } + + propertiesCloned := false + for k, v := range schema.Properties { + if s := w.WalkSchema(&v); s != &v { + if !propertiesCloned { + propertiesCloned = true + clone() + schema.Properties = make(map[string]spec.Schema, len(orig.Properties)) + for k2, v2 := range orig.Properties { + schema.Properties[k2] = v2 + } + } + schema.Properties[k] = *s + } + } + + patternPropertiesCloned := false + for k, v := range schema.PatternProperties { + if s := w.WalkSchema(&v); s != &v { + if !patternPropertiesCloned { + patternPropertiesCloned = true + clone() + schema.PatternProperties = make(map[string]spec.Schema, len(orig.PatternProperties)) + for k2, v2 := range orig.PatternProperties { + schema.PatternProperties[k2] = v2 + } + } + schema.PatternProperties[k] = *s + } + } + + allOfCloned := false + for i := range schema.AllOf { + if s := w.WalkSchema(&schema.AllOf[i]); s != &schema.AllOf[i] { + if !allOfCloned { + allOfCloned = true + clone() + schema.AllOf = make([]spec.Schema, len(orig.AllOf)) + copy(schema.AllOf, orig.AllOf) + } + schema.AllOf[i] = *s + } + } + + anyOfCloned := false + for i := range schema.AnyOf { + if s := w.WalkSchema(&schema.AnyOf[i]); s != &schema.AnyOf[i] { + if !anyOfCloned { + anyOfCloned = true + clone() + schema.AnyOf = make([]spec.Schema, len(orig.AnyOf)) + copy(schema.AnyOf, orig.AnyOf) + } + schema.AnyOf[i] = *s + } + } + + oneOfCloned := false + for i := range schema.OneOf { + if s := w.WalkSchema(&schema.OneOf[i]); s != &schema.OneOf[i] { + if !oneOfCloned { + oneOfCloned = true + clone() + schema.OneOf = make([]spec.Schema, len(orig.OneOf)) + copy(schema.OneOf, orig.OneOf) + } + schema.OneOf[i] = *s + } + } + + if schema.Not != nil { + if s := w.WalkSchema(schema.Not); s != schema.Not { + clone() + schema.Not = s + } + } + + if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { + if s := w.WalkSchema(schema.AdditionalProperties.Schema); s != schema.AdditionalProperties.Schema { + clone() + schema.AdditionalProperties = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalProperties.Allows} + } + } + + if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { + if s := w.WalkSchema(schema.AdditionalItems.Schema); s != schema.AdditionalItems.Schema { + clone() + schema.AdditionalItems = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalItems.Allows} + } + } + + if schema.Items != nil { + if schema.Items.Schema != nil { + if s := w.WalkSchema(schema.Items.Schema); s != schema.Items.Schema { + clone() + schema.Items = &spec.SchemaOrArray{Schema: s} + } + } else { + itemsCloned := false + for i := range schema.Items.Schemas { + if s := w.WalkSchema(&schema.Items.Schemas[i]); s != &schema.Items.Schemas[i] { + if !itemsCloned { + clone() + schema.Items = &spec.SchemaOrArray{ + Schemas: make([]spec.Schema, len(orig.Items.Schemas)), + } + itemsCloned = true + copy(schema.Items.Schemas, orig.Items.Schemas) + } + schema.Items.Schemas[i] = *s + } + } + } + } + + return schema +} + +func (w *Walker) walkParameter(param *spec.Parameter) *spec.Parameter { + if param == nil { + return nil + } + + orig := param + cloned := false + clone := func() { + if !cloned { + cloned = true + param = &spec.Parameter{} + *param = *orig + } + } + + if r := w.RefCallback(&param.Ref); r != &param.Ref { + clone() + param.Ref = *r + } + if s := w.WalkSchema(param.Schema); s != param.Schema { + clone() + param.Schema = s + } + if param.Items != nil { + if r := w.RefCallback(&param.Items.Ref); r != &param.Items.Ref { + param.Items.Ref = *r + } + } + + return param +} + +func (w *Walker) walkParameters(params []spec.Parameter) ([]spec.Parameter, bool) { + if params == nil { + return nil, false + } + + orig := params + cloned := false + clone := func() { + if !cloned { + cloned = true + params = make([]spec.Parameter, len(params)) + copy(params, orig) + } + } + + for i := range params { + if s := w.walkParameter(&params[i]); s != &params[i] { + clone() + params[i] = *s + } + } + + return params, cloned +} + +func (w *Walker) walkResponse(resp *spec.Response) *spec.Response { + if resp == nil { + return nil + } + + orig := resp + cloned := false + clone := func() { + if !cloned { + cloned = true + resp = &spec.Response{} + *resp = *orig + } + } + + if r := w.RefCallback(&resp.Ref); r != &resp.Ref { + clone() + resp.Ref = *r + } + if s := w.WalkSchema(resp.Schema); s != resp.Schema { + clone() + resp.Schema = s + } + + return resp +} + +func (w *Walker) walkResponses(resps *spec.Responses) *spec.Responses { + if resps == nil { + return nil + } + + orig := resps + cloned := false + clone := func() { + if !cloned { + cloned = true + resps = &spec.Responses{} + *resps = *orig + } + } + + if r := w.walkResponse(resps.ResponsesProps.Default); r != resps.ResponsesProps.Default { + clone() + resps.Default = r + } + + responsesCloned := false + for k, v := range resps.ResponsesProps.StatusCodeResponses { + if r := w.walkResponse(&v); r != &v { + if !responsesCloned { + responsesCloned = true + clone() + resps.ResponsesProps.StatusCodeResponses = make(map[int]spec.Response, len(orig.StatusCodeResponses)) + for k2, v2 := range orig.StatusCodeResponses { + resps.ResponsesProps.StatusCodeResponses[k2] = v2 + } + } + resps.ResponsesProps.StatusCodeResponses[k] = *r + } + } + + return resps +} + +func (w *Walker) walkOperation(op *spec.Operation) *spec.Operation { + if op == nil { + return nil + } + + orig := op + cloned := false + clone := func() { + if !cloned { + cloned = true + op = &spec.Operation{} + *op = *orig + } + } + + parametersCloned := false + for i := range op.Parameters { + if s := w.walkParameter(&op.Parameters[i]); s != &op.Parameters[i] { + if !parametersCloned { + parametersCloned = true + clone() + op.Parameters = make([]spec.Parameter, len(orig.Parameters)) + copy(op.Parameters, orig.Parameters) + } + op.Parameters[i] = *s + } + } + + if r := w.walkResponses(op.Responses); r != op.Responses { + clone() + op.Responses = r + } + + return op +} + +func (w *Walker) walkPathItem(pathItem *spec.PathItem) *spec.PathItem { + if pathItem == nil { + return nil + } + + orig := pathItem + cloned := false + clone := func() { + if !cloned { + cloned = true + pathItem = &spec.PathItem{} + *pathItem = *orig + } + } + + if p, changed := w.walkParameters(pathItem.Parameters); changed { + clone() + pathItem.Parameters = p + } + if op := w.walkOperation(pathItem.Get); op != pathItem.Get { + clone() + pathItem.Get = op + } + if op := w.walkOperation(pathItem.Head); op != pathItem.Head { + clone() + pathItem.Head = op + } + if op := w.walkOperation(pathItem.Delete); op != pathItem.Delete { + clone() + pathItem.Delete = op + } + if op := w.walkOperation(pathItem.Options); op != pathItem.Options { + clone() + pathItem.Options = op + } + if op := w.walkOperation(pathItem.Patch); op != pathItem.Patch { + clone() + pathItem.Patch = op + } + if op := w.walkOperation(pathItem.Post); op != pathItem.Post { + clone() + pathItem.Post = op + } + if op := w.walkOperation(pathItem.Put); op != pathItem.Put { + clone() + pathItem.Put = op + } + + return pathItem +} + +func (w *Walker) walkPaths(paths *spec.Paths) *spec.Paths { + if paths == nil { + return nil + } + + orig := paths + cloned := false + clone := func() { + if !cloned { + cloned = true + paths = &spec.Paths{} + *paths = *orig + } + } + + pathsCloned := false + for k, v := range paths.Paths { + if p := w.walkPathItem(&v); p != &v { + if !pathsCloned { + pathsCloned = true + clone() + paths.Paths = make(map[string]spec.PathItem, len(orig.Paths)) + for k2, v2 := range orig.Paths { + paths.Paths[k2] = v2 + } + } + paths.Paths[k] = *p + } + } + + return paths +} + +func (w *Walker) WalkRoot(swagger *spec.Swagger) *spec.Swagger { + if swagger == nil { + return nil + } + + orig := swagger + cloned := false + clone := func() { + if !cloned { + cloned = true + swagger = &spec.Swagger{} + *swagger = *orig + } + } + + parametersCloned := false + for k, v := range swagger.Parameters { + if p := w.walkParameter(&v); p != &v { + if !parametersCloned { + parametersCloned = true + clone() + swagger.Parameters = make(map[string]spec.Parameter, len(orig.Parameters)) + for k2, v2 := range orig.Parameters { + swagger.Parameters[k2] = v2 + } + } + swagger.Parameters[k] = *p + } + } + + responsesCloned := false + for k, v := range swagger.Responses { + if r := w.walkResponse(&v); r != &v { + if !responsesCloned { + responsesCloned = true + clone() + swagger.Responses = make(map[string]spec.Response, len(orig.Responses)) + for k2, v2 := range orig.Responses { + swagger.Responses[k2] = v2 + } + } + swagger.Responses[k] = *r + } + } + + definitionsCloned := false + for k, v := range swagger.Definitions { + if s := w.WalkSchema(&v); s != &v { + if !definitionsCloned { + definitionsCloned = true + clone() + swagger.Definitions = make(spec.Definitions, len(orig.Definitions)) + for k2, v2 := range orig.Definitions { + swagger.Definitions[k2] = v2 + } + } + swagger.Definitions[k] = *s + } + } + + if swagger.Paths != nil { + if p := w.walkPaths(swagger.Paths); p != swagger.Paths { + clone() + swagger.Paths = p + } + } + + return swagger +} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go index 1f62c6e772e..699291f1d8e 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go @@ -32,9 +32,6 @@ type Encoding struct { // MarshalJSON is a custom marshal function that knows how to encode Encoding as JSON func (e *Encoding) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(e) - } b1, err := json.Marshal(e.EncodingProps) if err != nil { return nil, err @@ -46,16 +43,6 @@ func (e *Encoding) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (e *Encoding) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - EncodingProps encodingPropsOmitZero `json:",inline"` - spec.Extensions - } - x.Extensions = internal.SanitizeExtensions(e.Extensions) - x.EncodingProps = encodingPropsOmitZero(e.EncodingProps) - return opts.MarshalNext(enc, x) -} - func (e *Encoding) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, e) @@ -95,11 +82,3 @@ type EncodingProps struct { // AllowReserved determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 AllowReserved bool `json:"allowReserved,omitempty"` } - -type encodingPropsOmitZero struct { - ContentType string `json:"contentType,omitempty"` - Headers map[string]*Header `json:"headers,omitempty"` - Style string `json:"style,omitempty"` - Explode bool `json:"explode,omitzero"` - AllowReserved bool `json:"allowReserved,omitzero"` -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/example.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/example.go index 8834a92e6da..03b8727170f 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/example.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/example.go @@ -36,9 +36,6 @@ type Example struct { // MarshalJSON is a custom marshal function that knows how to encode RequestBody as JSON func (e *Example) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(e) - } b1, err := json.Marshal(e.Refable) if err != nil { return nil, err @@ -53,17 +50,6 @@ func (e *Example) MarshalJSON() ([]byte, error) { } return swag.ConcatJSON(b1, b2, b3), nil } -func (e *Example) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - ExampleProps `json:",inline"` - spec.Extensions - } - x.Ref = e.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(e.Extensions) - x.ExampleProps = e.ExampleProps - return opts.MarshalNext(enc, x) -} func (e *Example) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go index f0515496e4d..e79956721ac 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go @@ -39,9 +39,6 @@ type ExternalDocumentationProps struct { // MarshalJSON is a custom marshal function that knows how to encode Responses as JSON func (e *ExternalDocumentation) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(e) - } b1, err := json.Marshal(e.ExternalDocumentationProps) if err != nil { return nil, err @@ -53,16 +50,6 @@ func (e *ExternalDocumentation) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (e *ExternalDocumentation) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - ExternalDocumentationProps `json:",inline"` - spec.Extensions - } - x.Extensions = internal.SanitizeExtensions(e.Extensions) - x.ExternalDocumentationProps = e.ExternalDocumentationProps - return opts.MarshalNext(enc, x) -} - func (e *ExternalDocumentation) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, e) diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go index 08b6246cebb..bc19dd48ed6 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go @@ -35,18 +35,6 @@ var OpenAPIV3FuzzFuncs []interface{} = []interface{}{ func(o *OpenAPI, c fuzz.Continue) { c.FuzzNoCustom(o) o.Version = "3.0.0" - for i, val := range o.SecurityRequirement { - if val == nil { - o.SecurityRequirement[i] = make(map[string][]string) - } - - for k, v := range val { - if v == nil { - val[k] = make([]string, 0) - } - } - } - }, func(r *interface{}, c fuzz.Continue) { switch c.Intn(3) { @@ -181,21 +169,6 @@ var OpenAPIV3FuzzFuncs []interface{} = []interface{}{ c.Fuzz(&v.ResponseProps) c.Fuzz(&v.VendorExtensible) }, - func(v *Operation, c fuzz.Continue) { - c.FuzzNoCustom(v) - // Do not fuzz null values into the array. - for i, val := range v.SecurityRequirement { - if val == nil { - v.SecurityRequirement[i] = make(map[string][]string) - } - - for k, v := range val { - if v == nil { - val[k] = make([]string, 0) - } - } - } - }, func(v *spec.Extensions, c fuzz.Continue) { numChildren := c.Intn(5) for i := 0; i < numChildren; i++ { diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/header.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/header.go index 9ea30628ceb..ee5a30f797a 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/header.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/header.go @@ -36,9 +36,6 @@ type Header struct { // MarshalJSON is a custom marshal function that knows how to encode Header as JSON func (h *Header) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(h) - } b1, err := json.Marshal(h.Refable) if err != nil { return nil, err @@ -54,18 +51,6 @@ func (h *Header) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (h *Header) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - HeaderProps headerPropsOmitZero `json:",inline"` - spec.Extensions - } - x.Ref = h.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(h.Extensions) - x.HeaderProps = headerPropsOmitZero(h.HeaderProps) - return opts.MarshalNext(enc, x) -} - func (h *Header) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, h) @@ -124,19 +109,3 @@ type HeaderProps struct { // Examples of the header Examples map[string]*Example `json:"examples,omitempty"` } - -// Marshaling structure only, always edit along with corresponding -// struct (or compilation will fail). -type headerPropsOmitZero struct { - Description string `json:"description,omitempty"` - Required bool `json:"required,omitzero"` - Deprecated bool `json:"deprecated,omitzero"` - AllowEmptyValue bool `json:"allowEmptyValue,omitzero"` - Style string `json:"style,omitempty"` - Explode bool `json:"explode,omitzero"` - AllowReserved bool `json:"allowReserved,omitzero"` - Schema *spec.Schema `json:"schema,omitzero"` - Content map[string]*MediaType `json:"content,omitempty"` - Example interface{} `json:"example,omitempty"` - Examples map[string]*Example `json:"examples,omitempty"` -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go index 47eef1edb0a..d390e69bcf7 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go @@ -35,9 +35,6 @@ type MediaType struct { // MarshalJSON is a custom marshal function that knows how to encode MediaType as JSON func (m *MediaType) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(m) - } b1, err := json.Marshal(m.MediaTypeProps) if err != nil { return nil, err @@ -49,16 +46,6 @@ func (m *MediaType) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (e *MediaType) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - MediaTypeProps mediaTypePropsOmitZero `json:",inline"` - spec.Extensions - } - x.Extensions = internal.SanitizeExtensions(e.Extensions) - x.MediaTypeProps = mediaTypePropsOmitZero(e.MediaTypeProps) - return opts.MarshalNext(enc, x) -} - func (m *MediaType) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, m) @@ -97,10 +84,3 @@ type MediaTypeProps struct { // A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded Encoding map[string]*Encoding `json:"encoding,omitempty"` } - -type mediaTypePropsOmitZero struct { - Schema *spec.Schema `json:"schema,omitzero"` - Example interface{} `json:"example,omitempty"` - Examples map[string]*Example `json:"examples,omitempty"` - Encoding map[string]*Encoding `json:"encoding,omitempty"` -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go index f1e10254795..28230610bd4 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/operation.go @@ -35,9 +35,6 @@ type Operation struct { // MarshalJSON is a custom marshal function that knows how to encode Operation as JSON func (o *Operation) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(o) - } b1, err := json.Marshal(o.OperationProps) if err != nil { return nil, err @@ -49,16 +46,6 @@ func (o *Operation) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (o *Operation) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - spec.Extensions - OperationProps operationPropsOmitZero `json:",inline"` - } - x.Extensions = internal.SanitizeExtensions(o.Extensions) - x.OperationProps = operationPropsOmitZero(o.OperationProps) - return opts.MarshalNext(enc, x) -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (o *Operation) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { @@ -108,17 +95,3 @@ type OperationProps struct { // Servers contains an alternative server array to service this operation Servers []*Server `json:"servers,omitempty"` } - -type operationPropsOmitZero struct { - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - Description string `json:"description,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitzero"` - OperationId string `json:"operationId,omitempty"` - Parameters []*Parameter `json:"parameters,omitempty"` - RequestBody *RequestBody `json:"requestBody,omitzero"` - Responses *Responses `json:"responses,omitzero"` - Deprecated bool `json:"deprecated,omitzero"` - SecurityRequirement []map[string][]string `json:"security,omitempty"` - Servers []*Server `json:"servers,omitempty"` -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go index ada7edb6375..613da71a6d3 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go @@ -36,9 +36,6 @@ type Parameter struct { // MarshalJSON is a custom marshal function that knows how to encode Parameter as JSON func (p *Parameter) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(p) - } b1, err := json.Marshal(p.Refable) if err != nil { return nil, err @@ -54,18 +51,6 @@ func (p *Parameter) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (p *Parameter) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - ParameterProps parameterPropsOmitZero `json:",inline"` - spec.Extensions - } - x.Ref = p.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(p.Extensions) - x.ParameterProps = parameterPropsOmitZero(p.ParameterProps) - return opts.MarshalNext(enc, x) -} - func (p *Parameter) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, p) @@ -129,19 +114,3 @@ type ParameterProps struct { // Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding Examples map[string]*Example `json:"examples,omitempty"` } - -type parameterPropsOmitZero struct { - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Description string `json:"description,omitempty"` - Required bool `json:"required,omitzero"` - Deprecated bool `json:"deprecated,omitzero"` - AllowEmptyValue bool `json:"allowEmptyValue,omitzero"` - Style string `json:"style,omitempty"` - Explode bool `json:"explode,omitzero"` - AllowReserved bool `json:"allowReserved,omitzero"` - Schema *spec.Schema `json:"schema,omitzero"` - Content map[string]*MediaType `json:"content,omitempty"` - Example interface{} `json:"example,omitempty"` - Examples map[string]*Example `json:"examples,omitempty"` -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/path.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/path.go index 16fbbb4dd93..40d9061aceb 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/path.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/path.go @@ -35,41 +35,15 @@ type Paths struct { // MarshalJSON is a custom marshal function that knows how to encode Paths as JSON func (p *Paths) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(p) - } - b1, err := json.Marshal(p.VendorExtensible) + b1, err := json.Marshal(p.Paths) if err != nil { return nil, err } - - pths := make(map[string]*Path) - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - pths[k] = v - } - } - b2, err := json.Marshal(pths) + b2, err := json.Marshal(p.VendorExtensible) if err != nil { return nil, err } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -func (p *Paths) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - m := make(map[string]any, len(p.Extensions)+len(p.Paths)) - for k, v := range p.Extensions { - if internal.IsExtensionKey(k) { - m[k] = v - } - } - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - m[k] = v - } - } - return opts.MarshalNext(enc, m) + return swag.ConcatJSON(b1, b2), nil } // UnmarshalJSON hydrates this items instance with the data from JSON @@ -170,9 +144,6 @@ type Path struct { // MarshalJSON is a custom marshal function that knows how to encode Path as JSON func (p *Path) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(p) - } b1, err := json.Marshal(p.Refable) if err != nil { return nil, err @@ -188,18 +159,6 @@ func (p *Path) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (p *Path) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - spec.Extensions - PathProps - } - x.Ref = p.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(p.Extensions) - x.PathProps = p.PathProps - return opts.MarshalNext(enc, x) -} - func (p *Path) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, p) diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go index 6f8607e4009..33267ce675e 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go @@ -36,9 +36,6 @@ type RequestBody struct { // MarshalJSON is a custom marshal function that knows how to encode RequestBody as JSON func (r *RequestBody) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(r) - } b1, err := json.Marshal(r.Refable) if err != nil { return nil, err @@ -54,18 +51,6 @@ func (r *RequestBody) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (r *RequestBody) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - RequestBodyProps requestBodyPropsOmitZero `json:",inline"` - spec.Extensions - } - x.Ref = r.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(r.Extensions) - x.RequestBodyProps = requestBodyPropsOmitZero(r.RequestBodyProps) - return opts.MarshalNext(enc, x) -} - func (r *RequestBody) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, r) @@ -92,12 +77,6 @@ type RequestBodyProps struct { Required bool `json:"required,omitempty"` } -type requestBodyPropsOmitZero struct { - Description string `json:"description,omitempty"` - Content map[string]*MediaType `json:"content,omitempty"` - Required bool `json:"required,omitzero"` -} - func (r *RequestBody) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.Decoder) error { var x struct { spec.Extensions diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/response.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/response.go index 73e241fdc9c..95b388e6c60 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/response.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/response.go @@ -37,9 +37,6 @@ type Responses struct { // MarshalJSON is a custom marshal function that knows how to encode Responses as JSON func (r *Responses) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(r) - } b1, err := json.Marshal(r.ResponsesProps) if err != nil { return nil, err @@ -51,25 +48,6 @@ func (r *Responses) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (r Responses) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - type ArbitraryKeys map[string]interface{} - var x struct { - ArbitraryKeys - Default *Response `json:"default,omitzero"` - } - x.ArbitraryKeys = make(map[string]any, len(r.Extensions)+len(r.StatusCodeResponses)) - for k, v := range r.Extensions { - if internal.IsExtensionKey(k) { - x.ArbitraryKeys[k] = v - } - } - for k, v := range r.StatusCodeResponses { - x.ArbitraryKeys[strconv.Itoa(k)] = v - } - x.Default = r.Default - return opts.MarshalNext(enc, x) -} - func (r *Responses) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, r) @@ -201,9 +179,6 @@ type Response struct { // MarshalJSON is a custom marshal function that knows how to encode Response as JSON func (r *Response) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(r) - } b1, err := json.Marshal(r.Refable) if err != nil { return nil, err @@ -219,18 +194,6 @@ func (r *Response) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (r Response) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - spec.Extensions - ResponseProps `json:",inline"` - } - x.Ref = r.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(r.Extensions) - x.ResponseProps = r.ResponseProps - return opts.MarshalNext(enc, x) -} - func (r *Response) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, r) @@ -284,9 +247,6 @@ type Link struct { // MarshalJSON is a custom marshal function that knows how to encode Link as JSON func (r *Link) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(r) - } b1, err := json.Marshal(r.Refable) if err != nil { return nil, err @@ -302,18 +262,6 @@ func (r *Link) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (r *Link) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - spec.Extensions - LinkProps `json:",inline"` - } - x.Ref = r.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(r.Extensions) - x.LinkProps = r.LinkProps - return opts.MarshalNext(enc, x) -} - func (r *Link) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, r) diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go index dd1e98ed881..edf7e6de3f6 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go @@ -20,8 +20,6 @@ import ( "encoding/json" "github.com/go-openapi/swag" - "k8s.io/kube-openapi/pkg/internal" - jsonv2 "k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json" "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -34,9 +32,6 @@ type SecurityScheme struct { // MarshalJSON is a custom marshal function that knows how to encode SecurityScheme as JSON func (s *SecurityScheme) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(s) - } b1, err := json.Marshal(s.SecuritySchemeProps) if err != nil { return nil, err @@ -52,18 +47,6 @@ func (s *SecurityScheme) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2, b3), nil } -func (s *SecurityScheme) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - Ref string `json:"$ref,omitempty"` - SecuritySchemeProps `json:",inline"` - spec.Extensions - } - x.Ref = s.Refable.Ref.String() - x.Extensions = internal.SanitizeExtensions(s.Extensions) - x.SecuritySchemeProps = s.SecuritySchemeProps - return opts.MarshalNext(enc, x) -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (s *SecurityScheme) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/server.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/server.go index 654a42c06e4..d5df0a78110 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/server.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/server.go @@ -41,9 +41,6 @@ type ServerProps struct { // MarshalJSON is a custom marshal function that knows how to encode Responses as JSON func (s *Server) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(s) - } b1, err := json.Marshal(s.ServerProps) if err != nil { return nil, err @@ -55,16 +52,6 @@ func (s *Server) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (s *Server) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - ServerProps `json:",inline"` - spec.Extensions - } - x.Extensions = internal.SanitizeExtensions(s.Extensions) - x.ServerProps = s.ServerProps - return opts.MarshalNext(enc, x) -} - func (s *Server) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, s) @@ -109,9 +96,6 @@ type ServerVariableProps struct { // MarshalJSON is a custom marshal function that knows how to encode Responses as JSON func (s *ServerVariable) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(s) - } b1, err := json.Marshal(s.ServerVariableProps) if err != nil { return nil, err @@ -123,16 +107,6 @@ func (s *ServerVariable) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(b1, b2), nil } -func (s *ServerVariable) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - var x struct { - ServerVariableProps `json:",inline"` - spec.Extensions - } - x.Extensions = internal.SanitizeExtensions(s.Extensions) - x.ServerVariableProps = s.ServerVariableProps - return opts.MarshalNext(enc, x) -} - func (s *ServerVariable) UnmarshalJSON(data []byte) error { if internal.UseOptimizedJSONUnmarshalingV3 { return jsonv2.Unmarshal(data, s) diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go index 5db819c7f03..bed096fb76b 100644 --- a/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/spec3/spec.go @@ -36,8 +36,6 @@ type OpenAPI struct { Servers []*Server `json:"servers,omitempty"` // Components hold various schemas for the specification Components *Components `json:"components,omitempty"` - // SecurityRequirement holds a declaration of which security mechanisms can be used across the API - SecurityRequirement []map[string][]string `json:"security,omitempty"` // ExternalDocs holds additional external documentation ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } @@ -50,26 +48,3 @@ func (o *OpenAPI) UnmarshalJSON(data []byte) error { } return json.Unmarshal(data, &p) } - -func (o *OpenAPI) MarshalJSON() ([]byte, error) { - if internal.UseOptimizedJSONMarshalingV3 { - return internal.DeterministicMarshal(o) - } - type OpenAPIWithNoFunctions OpenAPI - p := (*OpenAPIWithNoFunctions)(o) - return json.Marshal(&p) -} - -func (o *OpenAPI) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error { - type OpenAPIOmitZero struct { - Version string `json:"openapi"` - Info *spec.Info `json:"info"` - Paths *Paths `json:"paths,omitzero"` - Servers []*Server `json:"servers,omitempty"` - Components *Components `json:"components,omitzero"` - SecurityRequirement []map[string][]string `json:"security,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitzero"` - } - x := (*OpenAPIOmitZero)(o) - return opts.MarshalNext(enc, x) -} diff --git a/upstream/vendor/k8s.io/kube-openapi/pkg/validation/spec/fuzz.go b/upstream/vendor/k8s.io/kube-openapi/pkg/validation/spec/fuzz.go new file mode 100644 index 00000000000..c66f998f519 --- /dev/null +++ b/upstream/vendor/k8s.io/kube-openapi/pkg/validation/spec/fuzz.go @@ -0,0 +1,502 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package spec + +import ( + "github.com/go-openapi/jsonreference" + "github.com/google/go-cmp/cmp" + fuzz "github.com/google/gofuzz" +) + +var SwaggerFuzzFuncs []interface{} = []interface{}{ + func(v *Responses, c fuzz.Continue) { + c.FuzzNoCustom(v) + if v.Default != nil { + // Check if we hit maxDepth and left an incomplete value + if v.Default.Description == "" { + v.Default = nil + v.StatusCodeResponses = nil + } + } + + // conversion has no way to discern empty statusCodeResponses from + // nil, since "default" is always included in the map. + // So avoid empty responses list + if len(v.StatusCodeResponses) == 0 { + v.StatusCodeResponses = nil + } + }, + func(v *Operation, c fuzz.Continue) { + c.FuzzNoCustom(v) + + if v != nil { + // force non-nil + v.Responses = &Responses{} + c.Fuzz(v.Responses) + + v.Schemes = nil + if c.RandBool() { + v.Schemes = append(v.Schemes, "http") + } + + if c.RandBool() { + v.Schemes = append(v.Schemes, "https") + } + + if c.RandBool() { + v.Schemes = append(v.Schemes, "ws") + } + + if c.RandBool() { + v.Schemes = append(v.Schemes, "wss") + } + + // Gnostic unconditionally makes security values non-null + // So do not fuzz null values into the array. + for i, val := range v.Security { + if val == nil { + v.Security[i] = make(map[string][]string) + } + + for k, v := range val { + if v == nil { + val[k] = make([]string, 0) + } + } + } + } + }, + func(v map[int]Response, c fuzz.Continue) { + n := 0 + c.Fuzz(&n) + if n == 0 { + // Test that fuzzer is not at maxDepth so we do not + // end up with empty elements + return + } + + // Prevent negative numbers + num := c.Intn(4) + for i := 0; i < num+2; i++ { + val := Response{} + c.Fuzz(&val) + + val.Description = c.RandString() + "x" + v[100*(i+1)+c.Intn(100)] = val + } + }, + func(v map[string]PathItem, c fuzz.Continue) { + n := 0 + c.Fuzz(&n) + if n == 0 { + // Test that fuzzer is not at maxDepth so we do not + // end up with empty elements + return + } + + num := c.Intn(5) + for i := 0; i < num+2; i++ { + val := PathItem{} + c.Fuzz(&val) + + // Ref params are only allowed in certain locations, so + // possibly add a few to PathItems + numRefsToAdd := c.Intn(5) + for i := 0; i < numRefsToAdd; i++ { + theRef := Parameter{} + c.Fuzz(&theRef.Refable) + + val.Parameters = append(val.Parameters, theRef) + } + + v["/"+c.RandString()] = val + } + }, + func(v *SchemaOrArray, c fuzz.Continue) { + *v = SchemaOrArray{} + // gnostic parser just doesn't support more + // than one Schema here + v.Schema = &Schema{} + c.Fuzz(&v.Schema) + + }, + func(v *SchemaOrBool, c fuzz.Continue) { + *v = SchemaOrBool{} + + if c.RandBool() { + v.Allows = c.RandBool() + } else { + v.Schema = &Schema{} + v.Allows = true + c.Fuzz(&v.Schema) + } + }, + func(v map[string]Response, c fuzz.Continue) { + n := 0 + c.Fuzz(&n) + if n == 0 { + // Test that fuzzer is not at maxDepth so we do not + // end up with empty elements + return + } + + // Response definitions are not allowed to + // be refs + for i := 0; i < c.Intn(5)+1; i++ { + resp := &Response{} + + c.Fuzz(resp) + resp.Ref = Ref{} + resp.Description = c.RandString() + "x" + + // Response refs are not vendor extensible by gnostic + resp.VendorExtensible.Extensions = nil + v[c.RandString()+"x"] = *resp + } + }, + func(v *Header, c fuzz.Continue) { + if v != nil { + c.FuzzNoCustom(v) + + // descendant Items of Header may not be refs + cur := v.Items + for cur != nil { + cur.Ref = Ref{} + cur = cur.Items + } + } + }, + func(v *Ref, c fuzz.Continue) { + *v = Ref{} + v.Ref, _ = jsonreference.New("http://asd.com/" + c.RandString()) + }, + func(v *Response, c fuzz.Continue) { + *v = Response{} + if c.RandBool() { + v.Ref = Ref{} + v.Ref.Ref, _ = jsonreference.New("http://asd.com/" + c.RandString()) + } else { + c.Fuzz(&v.VendorExtensible) + c.Fuzz(&v.Schema) + c.Fuzz(&v.ResponseProps) + + v.Headers = nil + v.Ref = Ref{} + + n := 0 + c.Fuzz(&n) + if n != 0 { + // Test that fuzzer is not at maxDepth so we do not + // end up with empty elements + num := c.Intn(4) + for i := 0; i < num; i++ { + if v.Headers == nil { + v.Headers = make(map[string]Header) + } + hdr := Header{} + c.Fuzz(&hdr) + if hdr.Type == "" { + // hit maxDepth, just abort trying to make haders + v.Headers = nil + break + } + v.Headers[c.RandString()+"x"] = hdr + } + } else { + v.Headers = nil + } + } + + v.Description = c.RandString() + "x" + + // Gnostic parses empty as nil, so to keep avoid putting empty + if len(v.Headers) == 0 { + v.Headers = nil + } + }, + func(v **Info, c fuzz.Continue) { + // Info is never nil + *v = &Info{} + c.FuzzNoCustom(*v) + + (*v).Title = c.RandString() + "x" + }, + func(v *Extensions, c fuzz.Continue) { + // gnostic parser only picks up x- vendor extensions + numChildren := c.Intn(5) + for i := 0; i < numChildren; i++ { + if *v == nil { + *v = Extensions{} + } + (*v)["x-"+c.RandString()] = c.RandString() + } + }, + func(v *Swagger, c fuzz.Continue) { + c.FuzzNoCustom(v) + + if v.Paths == nil { + // Force paths non-nil since it does not have omitempty in json tag. + // This means a perfect roundtrip (via json) is impossible, + // since we can't tell the difference between empty/unspecified paths + v.Paths = &Paths{} + c.Fuzz(v.Paths) + } + + v.Swagger = "2.0" + + // Gnostic support serializing ID at all + // unavoidable data loss + v.ID = "" + + v.Schemes = nil + if c.RandUint64()%2 == 1 { + v.Schemes = append(v.Schemes, "http") + } + + if c.RandUint64()%2 == 1 { + v.Schemes = append(v.Schemes, "https") + } + + if c.RandUint64()%2 == 1 { + v.Schemes = append(v.Schemes, "ws") + } + + if c.RandUint64()%2 == 1 { + v.Schemes = append(v.Schemes, "wss") + } + + // Gnostic unconditionally makes security values non-null + // So do not fuzz null values into the array. + for i, val := range v.Security { + if val == nil { + v.Security[i] = make(map[string][]string) + } + + for k, v := range val { + if v == nil { + val[k] = make([]string, 0) + } + } + } + }, + func(v *SecurityScheme, c fuzz.Continue) { + v.Description = c.RandString() + "x" + c.Fuzz(&v.VendorExtensible) + + switch c.Intn(3) { + case 0: + v.Type = "basic" + case 1: + v.Type = "apiKey" + switch c.Intn(2) { + case 0: + v.In = "header" + case 1: + v.In = "query" + default: + panic("unreachable") + } + v.Name = "x" + c.RandString() + case 2: + v.Type = "oauth2" + + switch c.Intn(4) { + case 0: + v.Flow = "accessCode" + v.TokenURL = "https://" + c.RandString() + v.AuthorizationURL = "https://" + c.RandString() + case 1: + v.Flow = "application" + v.TokenURL = "https://" + c.RandString() + case 2: + v.Flow = "implicit" + v.AuthorizationURL = "https://" + c.RandString() + case 3: + v.Flow = "password" + v.TokenURL = "https://" + c.RandString() + default: + panic("unreachable") + } + c.Fuzz(&v.Scopes) + default: + panic("unreachable") + } + }, + func(v *interface{}, c fuzz.Continue) { + *v = c.RandString() + "x" + }, + func(v *string, c fuzz.Continue) { + *v = c.RandString() + "x" + }, + func(v *ExternalDocumentation, c fuzz.Continue) { + v.Description = c.RandString() + "x" + v.URL = c.RandString() + "x" + }, + func(v *SimpleSchema, c fuzz.Continue) { + c.FuzzNoCustom(v) + + switch c.Intn(5) { + case 0: + v.Type = "string" + case 1: + v.Type = "number" + case 2: + v.Type = "boolean" + case 3: + v.Type = "integer" + case 4: + v.Type = "array" + default: + panic("unreachable") + } + + switch c.Intn(5) { + case 0: + v.CollectionFormat = "csv" + case 1: + v.CollectionFormat = "ssv" + case 2: + v.CollectionFormat = "tsv" + case 3: + v.CollectionFormat = "pipes" + case 4: + v.CollectionFormat = "" + default: + panic("unreachable") + } + + // None of the types which include SimpleSchema in our definitions + // actually support "example" in the official spec + v.Example = nil + + // unsupported by openapi + v.Nullable = false + }, + func(v *int64, c fuzz.Continue) { + c.Fuzz(v) + + // Gnostic does not differentiate between 0 and non-specified + // so avoid using 0 for fuzzer + if *v == 0 { + *v = 1 + } + }, + func(v *float64, c fuzz.Continue) { + c.Fuzz(v) + + // Gnostic does not differentiate between 0 and non-specified + // so avoid using 0 for fuzzer + if *v == 0.0 { + *v = 1.0 + } + }, + func(v *Parameter, c fuzz.Continue) { + if v == nil { + return + } + c.Fuzz(&v.VendorExtensible) + if c.RandBool() { + // body param + v.Description = c.RandString() + "x" + v.Name = c.RandString() + "x" + v.In = "body" + c.Fuzz(&v.Description) + c.Fuzz(&v.Required) + + v.Schema = &Schema{} + c.Fuzz(&v.Schema) + + } else { + c.Fuzz(&v.SimpleSchema) + c.Fuzz(&v.CommonValidations) + v.AllowEmptyValue = false + v.Description = c.RandString() + "x" + v.Name = c.RandString() + "x" + + switch c.Intn(4) { + case 0: + // Header param + v.In = "header" + case 1: + // Form data param + v.In = "formData" + v.AllowEmptyValue = c.RandBool() + case 2: + // Query param + v.In = "query" + v.AllowEmptyValue = c.RandBool() + case 3: + // Path param + v.In = "path" + v.Required = true + default: + panic("unreachable") + } + + // descendant Items of Parameter may not be refs + cur := v.Items + for cur != nil { + cur.Ref = Ref{} + cur = cur.Items + } + } + }, + func(v *Schema, c fuzz.Continue) { + if c.RandBool() { + // file schema + c.Fuzz(&v.Default) + c.Fuzz(&v.Description) + c.Fuzz(&v.Example) + c.Fuzz(&v.ExternalDocs) + + c.Fuzz(&v.Format) + c.Fuzz(&v.ReadOnly) + c.Fuzz(&v.Required) + c.Fuzz(&v.Title) + v.Type = StringOrArray{"file"} + + } else { + // normal schema + c.Fuzz(&v.SchemaProps) + c.Fuzz(&v.SwaggerSchemaProps) + c.Fuzz(&v.VendorExtensible) + // c.Fuzz(&v.ExtraProps) + // ExtraProps will not roundtrip - gnostic throws out + // unrecognized keys + } + + // Not supported by official openapi v2 spec + // and stripped by k8s apiserver + v.ID = "" + v.AnyOf = nil + v.OneOf = nil + v.Not = nil + v.Nullable = false + v.AdditionalItems = nil + v.Schema = "" + v.PatternProperties = nil + v.Definitions = nil + v.Dependencies = nil + }, +} + +var SwaggerDiffOptions = []cmp.Option{ + // cmp.Diff panics on Ref since jsonreference.Ref uses unexported fields + cmp.Comparer(func(a Ref, b Ref) bool { + return a.String() == b.String() + }), +} diff --git a/upstream/vendor/k8s.io/utils/integer/integer.go b/upstream/vendor/k8s.io/utils/integer/integer.go index e0811e8344c..e4e740cad4c 100644 --- a/upstream/vendor/k8s.io/utils/integer/integer.go +++ b/upstream/vendor/k8s.io/utils/integer/integer.go @@ -16,8 +16,6 @@ limitations under the License. package integer -import "math" - // IntMax returns the maximum of the params func IntMax(a, b int) int { if b > a { @@ -67,7 +65,9 @@ func Int64Min(a, b int64) int64 { } // RoundToInt32 rounds floats into integer numbers. -// Deprecated: use math.Round() and a cast directly. func RoundToInt32(a float64) int32 { - return int32(math.Round(a)) + if a < 0 { + return int32(a - 0.5) + } + return int32(a + 0.5) } diff --git a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go index 265b4e40ae0..7cd8122d52e 100644 --- a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go +++ b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go @@ -30,7 +30,6 @@ type CustomArgs struct { ListersPackage string ForceKinds string ListerHasPointerElem bool - DisableInformerInit bool } // NewDefaults returns default arguments for the generator. @@ -50,8 +49,6 @@ func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { fs.BoolVar(&ca.ListerHasPointerElem, "lister-has-pointer-elem", false, "") fs.MarkDeprecated("lister-has-pointer-elem", "this flag has no effect") - - fs.BoolVar(&ca.DisableInformerInit, "disable-informer-init", false, "disable generating the init function for the informer") } // Validate checks the given arguments. diff --git a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go index c0b3bf3eaf6..c4fb215f1de 100644 --- a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go +++ b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go @@ -37,7 +37,6 @@ type injectionGenerator struct { imports namer.ImportTracker typedInformerPackage string groupInformerFactoryPackage string - disableInformerInit bool } var _ generator.Generator = (*injectionGenerator)(nil) @@ -99,7 +98,6 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w Package: "context", Name: "WithValue", }), - "disableInformerInit": g.disableInformerInit, } sw.Do(injectionInformer, m) @@ -108,16 +106,14 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w } var injectionInformer = ` -{{ if not .disableInformerInit }} func init() { {{.injectionRegisterInformer|raw}}(withInformer) } -{{ end }} // Key is used for associating the Informer inside the context.Context. type Key struct{} -{{ if .disableInformerInit }} func WithInformer {{ else }} func withInformer {{ end }} (ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, {{.controllerInformer|raw}}) { +func withInformer(ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, {{.controllerInformer|raw}}) { f := {{.factoryGet|raw}}(ctx) inf := f.{{.groupGoName}}().{{.versionGoName}}().{{.type|publicPlural}}() return {{ .contextWithValue|raw }}(ctx, Key{}, inf), inf.Informer() diff --git a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go index f0ca43f2bf2..43768927a5b 100644 --- a/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go +++ b/upstream/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go @@ -412,7 +412,6 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg imports: generator.NewImportTracker(), typedInformerPackage: typedInformerPackage, groupInformerFactoryPackage: factoryPackagePath, - disableInformerInit: customArgs.DisableInformerInit, }) return generators }, diff --git a/upstream/vendor/knative.dev/pkg/injection/sharedmain/main.go b/upstream/vendor/knative.dev/pkg/injection/sharedmain/main.go index 348599f0966..25562e965eb 100644 --- a/upstream/vendor/knative.dev/pkg/injection/sharedmain/main.go +++ b/upstream/vendor/knative.dev/pkg/injection/sharedmain/main.go @@ -74,7 +74,7 @@ func GetLoggingConfig(ctx context.Context) (*logging.Config, error) { // These timeout and retry interval are set by heuristics. // e.g. istio sidecar needs a few seconds to configure the pod network. var lastErr error - if err := wait.PollUntilContextTimeout(ctx, 1*time.Second, 5*time.Second, true, func(ctx context.Context) (bool, error) { + if err := wait.PollImmediate(1*time.Second, 5*time.Second, func() (bool, error) { loggingConfigMap, lastErr = kubeclient.Get(ctx).CoreV1().ConfigMaps(system.Namespace()).Get(ctx, logging.ConfigMapName(), metav1.GetOptions{}) return lastErr == nil || apierrors.IsNotFound(lastErr), nil }); err != nil { @@ -290,12 +290,7 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, cto var wh *webhook.Webhook if len(webhooks) > 0 { // Register webhook metrics - opts := webhook.GetOptions(ctx) - if opts != nil { - webhook.RegisterMetrics(opts.StatsReporterOptions...) - } else { - webhook.RegisterMetrics() - } + webhook.RegisterMetrics() wh, err = webhook.New(ctx, webhooks) if err != nil { diff --git a/upstream/vendor/knative.dev/pkg/reconciler/testing/context.go b/upstream/vendor/knative.dev/pkg/reconciler/testing/context.go index 58b3b8d29ab..a1ea75903cc 100644 --- a/upstream/vendor/knative.dev/pkg/reconciler/testing/context.go +++ b/upstream/vendor/knative.dev/pkg/reconciler/testing/context.go @@ -120,7 +120,7 @@ func RunAndSyncInformers(ctx context.Context, informers ...controller.Informer) return wf, err } - err = wait.PollUntilContextTimeout(ctx, time.Microsecond, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) { + err = wait.PollImmediate(time.Microsecond, wait.ForeverTestTimeout, func() (bool, error) { if watchesPending.Load() == 0 { return true, nil } diff --git a/upstream/vendor/knative.dev/pkg/test/kube_checks.go b/upstream/vendor/knative.dev/pkg/test/kube_checks.go index 3b2b7101a08..3e295a55f3e 100644 --- a/upstream/vendor/knative.dev/pkg/test/kube_checks.go +++ b/upstream/vendor/knative.dev/pkg/test/kube_checks.go @@ -53,7 +53,7 @@ func WaitForDeploymentState(ctx context.Context, client kubernetes.Interface, na span := logging.GetEmitableSpan(ctx, fmt.Sprintf("WaitForDeploymentState/%s/%s", name, desc)) defer span.End() var lastState *appsv1.Deployment - waitErr := wait.PollUntilContextTimeout(ctx, interval, timeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, timeout, func() (bool, error) { var err error lastState, err = d.Get(ctx, name, metav1.GetOptions{}) if err != nil { @@ -78,7 +78,7 @@ func WaitForPodListState(ctx context.Context, client kubernetes.Interface, inSta defer span.End() var lastState *corev1.PodList - waitErr := wait.PollUntilContextTimeout(ctx, interval, podTimeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, podTimeout, func() (bool, error) { var err error lastState, err = p.List(ctx, metav1.ListOptions{}) if err != nil { @@ -103,7 +103,7 @@ func WaitForPodState(ctx context.Context, client kubernetes.Interface, inState f defer span.End() var lastState *corev1.Pod - waitErr := wait.PollUntilContextTimeout(ctx, interval, podTimeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, podTimeout, func() (bool, error) { var err error lastState, err = p.Get(ctx, name, metav1.GetOptions{}) if err != nil { @@ -139,7 +139,7 @@ func WaitForServiceEndpoints(ctx context.Context, client kubernetes.Interface, s defer span.End() var endpoints *corev1.Endpoints - waitErr := wait.PollUntilContextTimeout(ctx, interval, podTimeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, podTimeout, func() (bool, error) { var err error endpoints, err = endpointsService.Get(ctx, svcName, metav1.GetOptions{}) if apierrs.IsNotFound(err) { @@ -186,7 +186,7 @@ func GetEndpointAddresses(ctx context.Context, client kubernetes.Interface, svcN // WaitForChangedEndpoints waits until the endpoints for the given service differ from origEndpoints. func WaitForChangedEndpoints(ctx context.Context, client kubernetes.Interface, svcName, svcNamespace string, origEndpoints []string) error { var newEndpoints []string - waitErr := wait.PollUntilContextTimeout(ctx, 1*time.Second, 2*time.Minute, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(1*time.Second, 2*time.Minute, func() (bool, error) { var err error newEndpoints, err = GetEndpointAddresses(ctx, client, svcName, svcNamespace) return !cmp.Equal(origEndpoints, newEndpoints), err @@ -213,7 +213,7 @@ func DeploymentScaledToZeroFunc() func(d *appsv1.Deployment) (bool, error) { // If the content is not present within timeout it returns error. func WaitForLogContent(ctx context.Context, client kubernetes.Interface, podName, containerName, namespace, content string) error { var logs []byte - waitErr := wait.PollUntilContextTimeout(ctx, interval, logTimeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, logTimeout, func() (bool, error) { var err error logs, err = PodLogs(ctx, client, podName, containerName, namespace) if err != nil { @@ -236,7 +236,7 @@ func WaitForAllPodsRunning(ctx context.Context, client kubernetes.Interface, nam func WaitForPodRunning(ctx context.Context, client kubernetes.Interface, name string, namespace string) error { var p *corev1.Pod pods := client.CoreV1().Pods(namespace) - waitErr := wait.PollUntilContextTimeout(ctx, interval, podTimeout, true, func(ctx context.Context) (bool, error) { + waitErr := wait.PollImmediate(interval, podTimeout, func() (bool, error) { var err error p, err = pods.Get(ctx, name, metav1.GetOptions{}) if err != nil { diff --git a/upstream/vendor/knative.dev/pkg/test/spoof/spoof.go b/upstream/vendor/knative.dev/pkg/test/spoof/spoof.go index 716e5d83dbd..319e2ead86f 100644 --- a/upstream/vendor/knative.dev/pkg/test/spoof/spoof.go +++ b/upstream/vendor/knative.dev/pkg/test/spoof/spoof.go @@ -167,7 +167,7 @@ func (sc *SpoofingClient) Poll(req *http.Request, inState ResponseChecker, check } var resp *Response - err := wait.PollUntilContextTimeout(context.Background(), sc.RequestInterval, sc.RequestTimeout, true, func(ctx context.Context) (bool, error) { + err := wait.PollImmediate(sc.RequestInterval, sc.RequestTimeout, func() (bool, error) { // Starting span to capture zipkin trace. traceContext, span := trace.StartSpan(req.Context(), "SpoofingClient-Trace") defer span.End() diff --git a/upstream/vendor/knative.dev/pkg/version/version.go b/upstream/vendor/knative.dev/pkg/version/version.go index e47960f3102..c540888b863 100644 --- a/upstream/vendor/knative.dev/pkg/version/version.go +++ b/upstream/vendor/knative.dev/pkg/version/version.go @@ -33,7 +33,7 @@ const ( // NOTE: If you are changing this line, please also update the minimum kubernetes // version listed here: // https://github.com/knative/docs/blob/main/docs/snippets/prerequisites.md - defaultMinimumVersion = "v1.28.0" + defaultMinimumVersion = "v1.27.0" ) func getMinimumVersion() string { diff --git a/upstream/vendor/knative.dev/pkg/webhook/stats_reporter.go b/upstream/vendor/knative.dev/pkg/webhook/stats_reporter.go index 3f05d4a91c7..1fe30e8af16 100644 --- a/upstream/vendor/knative.dev/pkg/webhook/stats_reporter.go +++ b/upstream/vendor/knative.dev/pkg/webhook/stats_reporter.go @@ -26,7 +26,6 @@ import ( "go.opencensus.io/tag" admissionv1 "k8s.io/api/admission/v1" apixv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "k8s.io/apimachinery/pkg/util/sets" "knative.dev/pkg/metrics" ) @@ -66,83 +65,19 @@ var ( resultCodeKey = tag.MustNewKey("result_code") ) -type admissionToValue func(*admissionv1.AdmissionRequest, *admissionv1.AdmissionResponse) string -type conversionToValue func(*apixv1.ConversionRequest, *apixv1.ConversionResponse) string - -var ( - allAdmissionTags = map[tag.Key]admissionToValue{ - requestOperationKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return string(req.Operation) - }, - kindGroupKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Kind.Group - }, - kindVersionKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Kind.Version - }, - kindKindKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Kind.Kind - }, - resourceGroupKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Resource.Group - }, - resourceVersionKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Resource.Version - }, - resourceResourceKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Resource.Resource - }, - resourceNamespaceKey: func(req *admissionv1.AdmissionRequest, _ *admissionv1.AdmissionResponse) string { - return req.Namespace - }, - admissionAllowedKey: func(_ *admissionv1.AdmissionRequest, resp *admissionv1.AdmissionResponse) string { - return strconv.FormatBool(resp.Allowed) - }, - } - allConversionTags = map[tag.Key]conversionToValue{ - desiredAPIVersionKey: func(req *apixv1.ConversionRequest, _ *apixv1.ConversionResponse) string { - return req.DesiredAPIVersion - }, - resultStatusKey: func(_ *apixv1.ConversionRequest, resp *apixv1.ConversionResponse) string { - return resp.Result.Status - }, - resultReasonKey: func(_ *apixv1.ConversionRequest, resp *apixv1.ConversionResponse) string { - return string(resp.Result.Reason) - }, - resultCodeKey: func(_ *apixv1.ConversionRequest, resp *apixv1.ConversionResponse) string { - return strconv.Itoa(int(resp.Result.Code)) - }, - } -) - // StatsReporter reports webhook metrics type StatsReporter interface { ReportAdmissionRequest(request *admissionv1.AdmissionRequest, response *admissionv1.AdmissionResponse, d time.Duration) error ReportConversionRequest(request *apixv1.ConversionRequest, response *apixv1.ConversionResponse, d time.Duration) error } -type statsReporterOptions struct { - tagsToExclude sets.Set[string] -} - -type StatsReporterOption func(_ *statsReporterOptions) - -func WithoutTags(tags ...string) StatsReporterOption { - return func(opts *statsReporterOptions) { - opts.tagsToExclude.Insert(tags...) - } -} - // reporter implements StatsReporter interface type reporter struct { ctx context.Context - - admissionTags map[tag.Key]admissionToValue - conversionTags map[tag.Key]conversionToValue } // NewStatsReporter creates a reporter for webhook metrics -func NewStatsReporter(opts ...StatsReporterOption) (StatsReporter, error) { +func NewStatsReporter() (StatsReporter, error) { ctx, err := tag.New( context.Background(), ) @@ -150,44 +85,23 @@ func NewStatsReporter(opts ...StatsReporterOption) (StatsReporter, error) { return nil, err } - options := statsReporterOptions{ - tagsToExclude: sets.New[string](), - } - for _, opt := range opts { - opt(&options) - } - - admissionTags := make(map[tag.Key]admissionToValue) - for key, f := range allAdmissionTags { - if options.tagsToExclude.Has(key.Name()) { - continue - } - admissionTags[key] = f - } - conversionTags := make(map[tag.Key]conversionToValue) - for key, f := range allConversionTags { - if options.tagsToExclude.Has(key.Name()) { - continue - } - conversionTags[key] = f - } - - return &reporter{ - ctx: ctx, - admissionTags: admissionTags, - conversionTags: conversionTags, - }, nil + return &reporter{ctx: ctx}, nil } // Captures req count metric, recording the count and the duration func (r *reporter) ReportAdmissionRequest(req *admissionv1.AdmissionRequest, resp *admissionv1.AdmissionResponse, d time.Duration) error { - mutators := make([]tag.Mutator, 0, len(r.admissionTags)) - - for key, f := range r.admissionTags { - mutators = append(mutators, tag.Insert(key, f(req, resp))) - } - - ctx, err := tag.New(r.ctx, mutators...) + ctx, err := tag.New( + r.ctx, + tag.Insert(requestOperationKey, string(req.Operation)), + tag.Insert(kindGroupKey, req.Kind.Group), + tag.Insert(kindVersionKey, req.Kind.Version), + tag.Insert(kindKindKey, req.Kind.Kind), + tag.Insert(resourceGroupKey, req.Resource.Group), + tag.Insert(resourceVersionKey, req.Resource.Version), + tag.Insert(resourceResourceKey, req.Resource.Resource), + tag.Insert(resourceNamespaceKey, req.Namespace), + tag.Insert(admissionAllowedKey, strconv.FormatBool(resp.Allowed)), + ) if err != nil { return err } @@ -200,13 +114,13 @@ func (r *reporter) ReportAdmissionRequest(req *admissionv1.AdmissionRequest, res // Captures req count metric, recording the count and the duration func (r *reporter) ReportConversionRequest(req *apixv1.ConversionRequest, resp *apixv1.ConversionResponse, d time.Duration) error { - mutators := make([]tag.Mutator, 0, len(r.conversionTags)) - - for key, f := range r.conversionTags { - mutators = append(mutators, tag.Insert(key, f(req, resp))) - } - - ctx, err := tag.New(r.ctx, mutators...) + ctx, err := tag.New( + r.ctx, + tag.Insert(desiredAPIVersionKey, req.DesiredAPIVersion), + tag.Insert(resultStatusKey, resp.Result.Status), + tag.Insert(resultReasonKey, string(resp.Result.Reason)), + tag.Insert(resultCodeKey, strconv.Itoa(int(resp.Result.Code))), + ) if err != nil { return err } @@ -217,27 +131,21 @@ func (r *reporter) ReportConversionRequest(req *apixv1.ConversionRequest, resp * return nil } -func RegisterMetrics(opts ...StatsReporterOption) { - options := statsReporterOptions{ - tagsToExclude: sets.New[string](), - } - for _, opt := range opts { - opt(&options) - } - - tagKeys := []tag.Key{} - for tag := range allAdmissionTags { - if options.tagsToExclude.Has(tag.Name()) { - continue - } - tagKeys = append(tagKeys, tag) - } - for tag := range allConversionTags { - if options.tagsToExclude.Has(tag.Name()) { - continue - } - tagKeys = append(tagKeys, tag) - } +func RegisterMetrics() { + tagKeys := []tag.Key{ + requestOperationKey, + kindGroupKey, + kindVersionKey, + kindKindKey, + resourceGroupKey, + resourceVersionKey, + resourceResourceKey, + resourceNamespaceKey, + admissionAllowedKey, + desiredAPIVersionKey, + resultStatusKey, + resultReasonKey, + resultCodeKey} if err := view.Register( &view.View{ diff --git a/upstream/vendor/knative.dev/pkg/webhook/webhook.go b/upstream/vendor/knative.dev/pkg/webhook/webhook.go index d8842df35ae..eff693e80d2 100644 --- a/upstream/vendor/knative.dev/pkg/webhook/webhook.go +++ b/upstream/vendor/knative.dev/pkg/webhook/webhook.go @@ -70,9 +70,6 @@ type Options struct { // only a single port for the service. Port int - // StatsReporterOptions are the options used to initialize the default StatsReporter - StatsReporterOptions []StatsReporterOption - // StatsReporter reports metrics about the webhook. // This will be automatically initialized by the constructor if left uninitialized. StatsReporter StatsReporter @@ -147,7 +144,7 @@ func New( logger := logging.FromContext(ctx) if opts.StatsReporter == nil { - reporter, err := NewStatsReporter(opts.StatsReporterOptions...) + reporter, err := NewStatsReporter() if err != nil { return nil, err } diff --git a/upstream/vendor/modules.txt b/upstream/vendor/modules.txt index 6072be92567..3a790007301 100644 --- a/upstream/vendor/modules.txt +++ b/upstream/vendor/modules.txt @@ -1,42 +1,18 @@ -# cloud.google.com/go v0.113.0 +# cloud.google.com/go/compute v1.24.0 ## explicit; go 1.19 -cloud.google.com/go -# cloud.google.com/go/auth v0.4.1 +cloud.google.com/go/compute/internal +# cloud.google.com/go/compute/metadata v0.2.3 ## explicit; go 1.19 -cloud.google.com/go/auth -cloud.google.com/go/auth/credentials -cloud.google.com/go/auth/credentials/internal/externalaccount -cloud.google.com/go/auth/credentials/internal/externalaccountuser -cloud.google.com/go/auth/credentials/internal/gdch -cloud.google.com/go/auth/credentials/internal/impersonate -cloud.google.com/go/auth/credentials/internal/stsexchange -cloud.google.com/go/auth/grpctransport -cloud.google.com/go/auth/httptransport -cloud.google.com/go/auth/internal -cloud.google.com/go/auth/internal/credsfile -cloud.google.com/go/auth/internal/jwt -cloud.google.com/go/auth/internal/transport -cloud.google.com/go/auth/internal/transport/cert -# cloud.google.com/go/auth/oauth2adapt v0.2.2 -## explicit; go 1.19 -cloud.google.com/go/auth/oauth2adapt -# cloud.google.com/go/compute/metadata v0.5.0 -## explicit; go 1.20 cloud.google.com/go/compute/metadata -# cloud.google.com/go/iam v1.1.8 +# cloud.google.com/go/iam v1.1.6 ## explicit; go 1.19 cloud.google.com/go/iam cloud.google.com/go/iam/apiv1/iampb -# cloud.google.com/go/kms v1.17.1 -## explicit; go 1.20 +# cloud.google.com/go/kms v1.15.8 +## explicit; go 1.19 cloud.google.com/go/kms/apiv1 cloud.google.com/go/kms/apiv1/kmspb cloud.google.com/go/kms/internal -# cloud.google.com/go/longrunning v0.5.7 -## explicit; go 1.19 -cloud.google.com/go/longrunning -cloud.google.com/go/longrunning/autogen -cloud.google.com/go/longrunning/autogen/longrunningpb # code.gitea.io/sdk/gitea v0.18.0 ## explicit; go 1.18 code.gitea.io/sdk/gitea @@ -53,7 +29,7 @@ dario.cat/mergo ## explicit github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry github.com/Azure/azure-sdk-for-go/version -# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 +# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/azcore github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource @@ -75,11 +51,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming github.com/Azure/azure-sdk-for-go/sdk/azcore/to github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing -# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 +# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/azidentity github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal -# github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 +# github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/internal/diag github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo @@ -119,7 +95,7 @@ github.com/Azure/go-autorest/logger # github.com/Azure/go-autorest/tracing v0.6.0 ## explicit; go 1.12 github.com/Azure/go-autorest/tracing -# github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 +# github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 ## explicit; go 1.18 github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential @@ -142,15 +118,15 @@ github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version github.com/AzureAD/microsoft-authentication-library-for-go/apps/public -# github.com/Microsoft/go-winio v0.6.2 -## explicit; go 1.21 +# github.com/Microsoft/go-winio v0.6.1 +## explicit; go 1.17 github.com/Microsoft/go-winio github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid -# github.com/Microsoft/hcsshim v0.11.7 -## explicit; go 1.21 +# github.com/Microsoft/hcsshim v0.11.4 +## explicit; go 1.18 github.com/Microsoft/hcsshim/osversion # github.com/ProtonMail/go-crypto v1.0.0 ## explicit; go 1.13 @@ -178,7 +154,7 @@ github.com/ahmetb/gen-crd-api-reference-docs # github.com/antlr4-go/antlr/v4 v4.13.0 ## explicit; go 1.20 github.com/antlr4-go/antlr/v4 -# github.com/aws/aws-sdk-go-v2 v1.27.0 +# github.com/aws/aws-sdk-go-v2 v1.26.0 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults @@ -203,10 +179,10 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.27.16 +# github.com/aws/aws-sdk-go-v2/config v1.27.9 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.17.16 +# github.com/aws/aws-sdk-go-v2/credentials v1.17.9 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -215,56 +191,56 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 # github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/internal/ini -# github.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 => github.com/aws/aws-sdk-go-v2/service/ecr v1.27.3 -## explicit; go 1.20 +# github.com/aws/aws-sdk-go-v2/service/ecr v1.18.11 +## explicit; go 1.15 github.com/aws/aws-sdk-go-v2/service/ecr github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ecr/types -# github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 => github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.23.3 -## explicit; go 1.20 +# github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.2 +## explicit; go 1.15 github.com/aws/aws-sdk-go-v2/service/ecrpublic github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ecrpublic/types -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/kms v1.32.1 +# github.com/aws/aws-sdk-go-v2/service/kms v1.30.0 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/kms github.com/aws/aws-sdk-go-v2/service/kms/internal/endpoints github.com/aws/aws-sdk-go-v2/service/kms/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 +# github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 +# github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.20.2 +# github.com/aws/smithy-go v1.20.1 ## explicit; go 1.20 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -320,7 +296,7 @@ github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1 github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1 github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1 github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1 -# github.com/cespare/xxhash/v2 v2.3.0 +# github.com/cespare/xxhash/v2 v2.2.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 # github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 @@ -358,15 +334,14 @@ github.com/cloudflare/circl/math/mlsbset github.com/cloudflare/circl/sign github.com/cloudflare/circl/sign/ed25519 github.com/cloudflare/circl/sign/ed448 -# github.com/containerd/containerd v1.7.20 +# github.com/containerd/containerd v1.7.15 ## explicit; go 1.21 +github.com/containerd/containerd/errdefs +github.com/containerd/containerd/log github.com/containerd/containerd/platforms # github.com/containerd/log v0.1.0 ## explicit; go 1.20 github.com/containerd/log -# github.com/containerd/platforms v0.2.1 -## explicit; go 1.20 -github.com/containerd/platforms # github.com/containerd/stargz-snapshotter/estargz v0.14.3 ## explicit; go 1.19 github.com/containerd/stargz-snapshotter/estargz @@ -392,14 +367,14 @@ github.com/docker/cli/cli/config/types # github.com/docker/distribution v2.8.2+incompatible ## explicit github.com/docker/distribution/registry/client/auth/challenge -# github.com/docker/docker v26.1.5+incompatible +# github.com/docker/docker v26.0.0+incompatible ## explicit github.com/docker/docker/pkg/homedir # github.com/docker/docker-credential-helpers v0.7.0 ## explicit; go 1.18 github.com/docker/docker-credential-helpers/client github.com/docker/docker-credential-helpers/credentials -# github.com/emicklei/go-restful/v3 v3.11.0 +# github.com/emicklei/go-restful/v3 v3.10.2 ## explicit; go 1.13 github.com/emicklei/go-restful/v3 github.com/emicklei/go-restful/v3/log @@ -414,7 +389,7 @@ github.com/emirpasic/gods/utils # github.com/evanphx/json-patch v4.12.0+incompatible ## explicit github.com/evanphx/json-patch -# github.com/evanphx/json-patch/v5 v5.9.0 +# github.com/evanphx/json-patch/v5 v5.8.0 ## explicit; go 1.18 github.com/evanphx/json-patch/v5 github.com/evanphx/json-patch/v5/internal/json @@ -493,7 +468,7 @@ github.com/go-jose/go-jose/v3/cipher github.com/go-jose/go-jose/v3/cryptosigner github.com/go-jose/go-jose/v3/json github.com/go-jose/go-jose/v3/jwt -# github.com/go-jose/go-jose/v4 v4.0.2 +# github.com/go-jose/go-jose/v4 v4.0.1 ## explicit; go 1.21 github.com/go-jose/go-jose/v4 github.com/go-jose/go-jose/v4/cipher @@ -506,7 +481,7 @@ github.com/go-kit/log/level # github.com/go-logfmt/logfmt v0.5.1 ## explicit; go 1.17 github.com/go-logfmt/logfmt -# github.com/go-logr/logr v1.4.2 +# github.com/go-logr/logr v1.4.1 ## explicit; go 1.18 github.com/go-logr/logr github.com/go-logr/logr/funcr @@ -536,7 +511,7 @@ github.com/gogo/protobuf/sortkeys # github.com/golang-jwt/jwt/v4 v4.5.0 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 -# github.com/golang-jwt/jwt/v5 v5.2.1 +# github.com/golang-jwt/jwt/v5 v5.2.0 ## explicit; go 1.18 github.com/golang-jwt/jwt/v5 # github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da @@ -586,7 +561,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-containerregistry v0.19.2 +# github.com/google/go-containerregistry v0.19.1 ## explicit; go 1.18 github.com/google/go-containerregistry/internal/and github.com/google/go-containerregistry/internal/compression @@ -656,15 +631,15 @@ github.com/google/uuid ## explicit; go 1.19 github.com/googleapis/enterprise-certificate-proxy/client github.com/googleapis/enterprise-certificate-proxy/client/util -# github.com/googleapis/gax-go/v2 v2.12.4 +# github.com/googleapis/gax-go/v2 v2.12.3 ## explicit; go 1.19 github.com/googleapis/gax-go/v2 github.com/googleapis/gax-go/v2/apierror github.com/googleapis/gax-go/v2/apierror/internal/proto github.com/googleapis/gax-go/v2/callctx github.com/googleapis/gax-go/v2/internal -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 -## explicit; go 1.20 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 +## explicit; go 1.19 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities @@ -677,8 +652,8 @@ github.com/hashicorp/go-cleanhttp # github.com/hashicorp/go-multierror v1.1.1 ## explicit; go 1.13 github.com/hashicorp/go-multierror -# github.com/hashicorp/go-retryablehttp v0.7.7 -## explicit; go 1.19 +# github.com/hashicorp/go-retryablehttp v0.7.2 +## explicit; go 1.13 github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-rootcerts v1.0.2 ## explicit; go 1.12 @@ -692,7 +667,7 @@ github.com/hashicorp/go-secure-stdlib/strutil # github.com/hashicorp/go-sockaddr v1.0.2 ## explicit github.com/hashicorp/go-sockaddr -# github.com/hashicorp/go-version v1.7.0 +# github.com/hashicorp/go-version v1.6.0 ## explicit github.com/hashicorp/go-version # github.com/hashicorp/golang-lru v1.0.2 @@ -710,8 +685,8 @@ github.com/hashicorp/hcl/hcl/token github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token -# github.com/hashicorp/vault/api v1.14.0 -## explicit; go 1.21 +# github.com/hashicorp/vault/api v1.12.2 +## explicit; go 1.19 github.com/hashicorp/vault/api # github.com/imdario/mergo v0.3.13 ## explicit; go 1.13 @@ -722,8 +697,8 @@ github.com/jbenet/go-context/io # github.com/jellydator/ttlcache/v3 v3.2.0 ## explicit; go 1.18 github.com/jellydator/ttlcache/v3 -# github.com/jenkins-x/go-scm v1.14.37 -## explicit; go 1.22.3 +# github.com/jenkins-x/go-scm v1.14.30 +## explicit; go 1.19 github.com/jenkins-x/go-scm/pkg/hmac github.com/jenkins-x/go-scm/scm github.com/jenkins-x/go-scm/scm/driver/azure @@ -753,7 +728,7 @@ github.com/kelseyhightower/envconfig # github.com/kevinburke/ssh_config v1.2.0 ## explicit github.com/kevinburke/ssh_config -# github.com/klauspost/compress v1.16.7 +# github.com/klauspost/compress v1.16.6 ## explicit; go 1.18 github.com/klauspost/compress github.com/klauspost/compress/fse @@ -804,9 +779,6 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f -## explicit -github.com/mxk/go-flowrate/flowrate # github.com/opencontainers/go-digest v1.0.0 ## explicit; go 1.13 github.com/opencontainers/go-digest @@ -831,15 +803,15 @@ github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus/client_golang v1.19.0 -## explicit; go 1.20 +# github.com/prometheus/client_golang v1.18.0 +## explicit; go 1.19 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp -# github.com/prometheus/client_model v0.6.0 +# github.com/prometheus/client_model v0.5.0 ## explicit; go 1.19 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.52.3 +# github.com/prometheus/common v0.46.0 ## explicit; go 1.20 github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg @@ -874,25 +846,25 @@ github.com/shurcooL/githubv4 github.com/shurcooL/graphql github.com/shurcooL/graphql/ident github.com/shurcooL/graphql/internal/jsonutil -# github.com/sigstore/sigstore v1.8.4 -## explicit; go 1.21 +# github.com/sigstore/sigstore v1.8.3 +## explicit; go 1.20 github.com/sigstore/sigstore/pkg/cryptoutils github.com/sigstore/sigstore/pkg/signature github.com/sigstore/sigstore/pkg/signature/kms github.com/sigstore/sigstore/pkg/signature/kms/fake github.com/sigstore/sigstore/pkg/signature/options github.com/sigstore/sigstore/pkg/signature/payload -# github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.4 -## explicit; go 1.21 +# github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 +## explicit; go 1.20 github.com/sigstore/sigstore/pkg/signature/kms/aws -# github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.4 -## explicit; go 1.21 +# github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 +## explicit; go 1.20 github.com/sigstore/sigstore/pkg/signature/kms/azure -# github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.4 -## explicit; go 1.21 +# github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3 +## explicit; go 1.20 github.com/sigstore/sigstore/pkg/signature/kms/gcp -# github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.4 -## explicit; go 1.21 +# github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3 +## explicit; go 1.20 github.com/sigstore/sigstore/pkg/signature/kms/hashivault # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 @@ -903,7 +875,7 @@ github.com/skeema/knownhosts # github.com/spf13/pflag v1.0.5 ## explicit; go 1.12 github.com/spf13/pflag -# github.com/spiffe/go-spiffe/v2 v2.3.0 +# github.com/spiffe/go-spiffe/v2 v2.2.0 ## explicit; go 1.21 github.com/spiffe/go-spiffe/v2/bundle/jwtbundle github.com/spiffe/go-spiffe/v2/bundle/spiffebundle @@ -919,7 +891,7 @@ github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig github.com/spiffe/go-spiffe/v2/svid/jwtsvid github.com/spiffe/go-spiffe/v2/svid/x509svid github.com/spiffe/go-spiffe/v2/workloadapi -# github.com/spiffe/spire-api-sdk v1.10.0 +# github.com/spiffe/spire-api-sdk v1.9.4 ## explicit; go 1.12 github.com/spiffe/spire-api-sdk/proto/spire/api/server/entry/v1 github.com/spiffe/spire-api-sdk/proto/spire/api/types @@ -976,7 +948,7 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/inte ## explicit; go 1.20 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil -# go.opentelemetry.io/otel v1.28.0 +# go.opentelemetry.io/otel v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute @@ -991,32 +963,32 @@ go.opentelemetry.io/otel/semconv/internal go.opentelemetry.io/otel/semconv/v1.12.0 go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.20.0 -go.opentelemetry.io/otel/semconv/v1.26.0 -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 +go.opentelemetry.io/otel/semconv/v1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry -# go.opentelemetry.io/otel/metric v1.28.0 +# go.opentelemetry.io/otel/metric v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.28.0 +# go.opentelemetry.io/otel/sdk v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation +go.opentelemetry.io/otel/sdk/internal go.opentelemetry.io/otel/sdk/internal/env -go.opentelemetry.io/otel/sdk/internal/x go.opentelemetry.io/otel/sdk/resource go.opentelemetry.io/otel/sdk/trace -# go.opentelemetry.io/otel/trace v1.28.0 +# go.opentelemetry.io/otel/trace v1.26.0 ## explicit; go 1.21 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded @@ -1048,8 +1020,8 @@ go.uber.org/zap/internal/stacktrace go.uber.org/zap/internal/ztest go.uber.org/zap/zapcore go.uber.org/zap/zaptest -# golang.org/x/crypto v0.31.0 -## explicit; go 1.20 +# golang.org/x/crypto v0.22.0 +## explicit; go 1.18 golang.org/x/crypto/argon2 golang.org/x/crypto/blake2b golang.org/x/crypto/blake2s @@ -1060,6 +1032,7 @@ golang.org/x/crypto/chacha20poly1305 golang.org/x/crypto/cryptobyte golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/curve25519 +golang.org/x/crypto/curve25519/internal/field golang.org/x/crypto/ed25519 golang.org/x/crypto/hkdf golang.org/x/crypto/internal/alias @@ -1082,17 +1055,15 @@ golang.org/x/crypto/ssh/knownhosts golang.org/x/exp/constraints golang.org/x/exp/maps golang.org/x/exp/slices -# golang.org/x/mod v0.17.0 +# golang.org/x/mod v0.14.0 ## explicit; go 1.18 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.28.0 +# golang.org/x/net v0.24.0 ## explicit; go 1.18 golang.org/x/net/context golang.org/x/net/context/ctxhttp -golang.org/x/net/html -golang.org/x/net/html/atom golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/h2c @@ -1102,7 +1073,7 @@ golang.org/x/net/internal/socks golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/trace -# golang.org/x/oauth2 v0.22.0 +# golang.org/x/oauth2 v0.18.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/authhandler @@ -1115,12 +1086,12 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.10.0 +# golang.org/x/sync v0.7.0 ## explicit; go 1.18 golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.28.0 +# golang.org/x/sys v0.19.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/execabs @@ -1128,10 +1099,10 @@ golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.27.0 +# golang.org/x/term v0.19.0 ## explicit; go 1.18 golang.org/x/term -# golang.org/x/text v0.21.0 +# golang.org/x/text v0.14.0 ## explicit; go 1.18 golang.org/x/text/secure/bidirule golang.org/x/text/transform @@ -1141,23 +1112,35 @@ golang.org/x/text/width # golang.org/x/time v0.5.0 ## explicit; go 1.18 golang.org/x/time/rate -# golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d -## explicit; go 1.19 +# golang.org/x/tools v0.17.0 +## explicit; go 1.18 +golang.org/x/tools/cmd/stringer golang.org/x/tools/go/ast/astutil +golang.org/x/tools/go/gcexportdata +golang.org/x/tools/go/internal/packagesdriver +golang.org/x/tools/go/packages +golang.org/x/tools/go/types/objectpath golang.org/x/tools/imports golang.org/x/tools/internal/event golang.org/x/tools/internal/event/core golang.org/x/tools/internal/event/keys golang.org/x/tools/internal/event/label +golang.org/x/tools/internal/event/tag +golang.org/x/tools/internal/gcimporter golang.org/x/tools/internal/gocommand golang.org/x/tools/internal/gopathwalk golang.org/x/tools/internal/imports -golang.org/x/tools/internal/stdlib +golang.org/x/tools/internal/packagesinternal +golang.org/x/tools/internal/pkgbits +golang.org/x/tools/internal/tokeninternal +golang.org/x/tools/internal/typeparams +golang.org/x/tools/internal/typesinternal +golang.org/x/tools/internal/versions # gomodules.xyz/jsonpatch/v2 v2.4.0 ## explicit; go 1.20 gomodules.xyz/jsonpatch/v2 -# google.golang.org/api v0.181.0 -## explicit; go 1.20 +# google.golang.org/api v0.171.0 +## explicit; go 1.19 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport google.golang.org/api/internal @@ -1171,23 +1154,35 @@ google.golang.org/api/support/bundler google.golang.org/api/transport/grpc google.golang.org/api/transport/http google.golang.org/api/transport/http/internal/propagation -# google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda +# google.golang.org/appengine v1.6.8 +## explicit; go 1.11 +google.golang.org/appengine +google.golang.org/appengine/internal +google.golang.org/appengine/internal/app_identity +google.golang.org/appengine/internal/base +google.golang.org/appengine/internal/datastore +google.golang.org/appengine/internal/log +google.golang.org/appengine/internal/modules +google.golang.org/appengine/internal/remote_api +google.golang.org/appengine/internal/urlfetch +google.golang.org/appengine/urlfetch +# google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de ## explicit; go 1.19 google.golang.org/genproto/googleapis/cloud/location google.golang.org/genproto/googleapis/type/expr -# google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 -## explicit; go 1.21 +# google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 +## explicit; go 1.19 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 -## explicit; go 1.21 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda +## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.67.0 -## explicit; go 1.21 +# google.golang.org/grpc v1.63.2 +## explicit; go 1.19 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff @@ -1196,7 +1191,6 @@ google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/grpclb google.golang.org/grpc/balancer/grpclb/grpc_lb_v1 google.golang.org/grpc/balancer/grpclb/state -google.golang.org/grpc/balancer/pickfirst google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/channelz @@ -1216,9 +1210,7 @@ google.golang.org/grpc/credentials/oauth google.golang.org/grpc/encoding google.golang.org/grpc/encoding/gzip google.golang.org/grpc/encoding/proto -google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog -google.golang.org/grpc/grpclog/internal google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff @@ -1231,6 +1223,7 @@ google.golang.org/grpc/internal/credentials google.golang.org/grpc/internal/envconfig google.golang.org/grpc/internal/googlecloud google.golang.org/grpc/internal/grpclog +google.golang.org/grpc/internal/grpcrand google.golang.org/grpc/internal/grpcsync google.golang.org/grpc/internal/grpcutil google.golang.org/grpc/internal/idle @@ -1242,14 +1235,12 @@ google.golang.org/grpc/internal/resolver/dns/internal google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/resolver/unix google.golang.org/grpc/internal/serviceconfig -google.golang.org/grpc/internal/stats google.golang.org/grpc/internal/status google.golang.org/grpc/internal/syscall google.golang.org/grpc/internal/transport google.golang.org/grpc/internal/transport/networktype google.golang.org/grpc/internal/xds google.golang.org/grpc/keepalive -google.golang.org/grpc/mem google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver @@ -1259,8 +1250,8 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.34.2 -## explicit; go 1.20 +# google.golang.org/protobuf v1.33.0 +## explicit; go 1.17 google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext @@ -1269,7 +1260,6 @@ google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/editiondefaults -google.golang.org/protobuf/internal/editionssupport google.golang.org/protobuf/internal/encoding/defval google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset @@ -1320,8 +1310,8 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.29.6 -## explicit; go 1.21 +# k8s.io/api v0.28.5 => k8s.io/api v0.28.5 +## explicit; go 1.20 k8s.io/api/admission/v1 k8s.io/api/admissionregistration/v1 k8s.io/api/admissionregistration/v1alpha1 @@ -1353,7 +1343,7 @@ k8s.io/api/discovery/v1beta1 k8s.io/api/events/v1 k8s.io/api/events/v1beta1 k8s.io/api/extensions/v1beta1 -k8s.io/api/flowcontrol/v1 +k8s.io/api/flowcontrol/v1alpha1 k8s.io/api/flowcontrol/v1beta1 k8s.io/api/flowcontrol/v1beta2 k8s.io/api/flowcontrol/v1beta3 @@ -1375,8 +1365,8 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.29.2 -## explicit; go 1.21 +# k8s.io/apiextensions-apiserver v0.28.5 +## explicit; go 1.20 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 @@ -1393,8 +1383,8 @@ k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensio k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1 -# k8s.io/apimachinery v0.29.7 -## explicit; go 1.21 +# k8s.io/apimachinery v0.29.0 => k8s.io/apimachinery v0.28.5 +## explicit; go 1.20 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -1433,7 +1423,6 @@ k8s.io/apimachinery/pkg/util/managedfields/internal k8s.io/apimachinery/pkg/util/mergepatch k8s.io/apimachinery/pkg/util/naming k8s.io/apimachinery/pkg/util/net -k8s.io/apimachinery/pkg/util/proxy k8s.io/apimachinery/pkg/util/rand k8s.io/apimachinery/pkg/util/runtime k8s.io/apimachinery/pkg/util/sets @@ -1448,8 +1437,8 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/client-go v0.29.6 -## explicit; go 1.21 +# k8s.io/client-go v0.28.5 => k8s.io/client-go v0.28.5 +## explicit; go 1.20 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1474,7 +1463,7 @@ k8s.io/client-go/applyconfigurations/discovery/v1beta1 k8s.io/client-go/applyconfigurations/events/v1 k8s.io/client-go/applyconfigurations/events/v1beta1 k8s.io/client-go/applyconfigurations/extensions/v1beta1 -k8s.io/client-go/applyconfigurations/flowcontrol/v1 +k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3 @@ -1538,7 +1527,7 @@ k8s.io/client-go/informers/events/v1beta1 k8s.io/client-go/informers/extensions k8s.io/client-go/informers/extensions/v1beta1 k8s.io/client-go/informers/flowcontrol -k8s.io/client-go/informers/flowcontrol/v1 +k8s.io/client-go/informers/flowcontrol/v1alpha1 k8s.io/client-go/informers/flowcontrol/v1beta1 k8s.io/client-go/informers/flowcontrol/v1beta2 k8s.io/client-go/informers/flowcontrol/v1beta3 @@ -1629,8 +1618,8 @@ k8s.io/client-go/kubernetes/typed/events/v1beta1 k8s.io/client-go/kubernetes/typed/events/v1beta1/fake k8s.io/client-go/kubernetes/typed/extensions/v1beta1 k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake -k8s.io/client-go/kubernetes/typed/flowcontrol/v1 -k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake +k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1 +k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1 k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2 @@ -1697,7 +1686,7 @@ k8s.io/client-go/listers/discovery/v1beta1 k8s.io/client-go/listers/events/v1 k8s.io/client-go/listers/events/v1beta1 k8s.io/client-go/listers/extensions/v1beta1 -k8s.io/client-go/listers/flowcontrol/v1 +k8s.io/client-go/listers/flowcontrol/v1alpha1 k8s.io/client-go/listers/flowcontrol/v1beta1 k8s.io/client-go/listers/flowcontrol/v1beta2 k8s.io/client-go/listers/flowcontrol/v1beta3 @@ -1739,7 +1728,6 @@ k8s.io/client-go/tools/clientcmd k8s.io/client-go/tools/clientcmd/api k8s.io/client-go/tools/clientcmd/api/latest k8s.io/client-go/tools/clientcmd/api/v1 -k8s.io/client-go/tools/internal/events k8s.io/client-go/tools/leaderelection k8s.io/client-go/tools/leaderelection/resourcelock k8s.io/client-go/tools/metrics @@ -1757,8 +1745,8 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.29.7 -## explicit; go 1.21 +# k8s.io/code-generator v0.28.5 => k8s.io/code-generator v0.28.5 +## explicit; go 1.20 k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen/args k8s.io/code-generator/cmd/client-gen/generators @@ -1779,7 +1767,7 @@ k8s.io/code-generator/cmd/lister-gen/args k8s.io/code-generator/cmd/lister-gen/generators k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util -# k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 +# k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 ## explicit; go 1.13 k8s.io/gengo/args k8s.io/gengo/examples/deepcopy-gen/generators @@ -1792,19 +1780,19 @@ k8s.io/gengo/types # k8s.io/klog v1.0.0 ## explicit; go 1.12 k8s.io/klog -# k8s.io/klog/v2 v2.120.1 -## explicit; go 1.18 +# k8s.io/klog/v2 v2.100.1 +## explicit; go 1.13 k8s.io/klog/v2 k8s.io/klog/v2/internal/buffer k8s.io/klog/v2/internal/clock k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity -k8s.io/klog/v2/internal/sloghandler -# k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 +# k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 ## explicit; go 1.19 k8s.io/kube-openapi/cmd/openapi-gen k8s.io/kube-openapi/cmd/openapi-gen/args +k8s.io/kube-openapi/pkg/builder3/util k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/generators @@ -1812,12 +1800,14 @@ k8s.io/kube-openapi/pkg/generators/rules k8s.io/kube-openapi/pkg/handler3 k8s.io/kube-openapi/pkg/internal k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json +k8s.io/kube-openapi/pkg/openapiconv k8s.io/kube-openapi/pkg/schemaconv +k8s.io/kube-openapi/pkg/schemamutation k8s.io/kube-openapi/pkg/spec3 k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/sets k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/utils v0.0.0-20240102154912-e7106e64919e +# k8s.io/utils v0.0.0-20230726121419-3b25d923346b ## explicit; go 1.18 k8s.io/utils/buffer k8s.io/utils/clock @@ -1829,8 +1819,8 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20240416145024-0f34a8815650 -## explicit; go 1.21 +# knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 +## explicit; go 1.18 knative.dev/pkg/apis knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck/ducktypes @@ -1917,7 +1907,7 @@ knative.dev/pkg/webhook/resourcesemantics/validation ## explicit; go 1.18 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json -# sigs.k8s.io/structured-merge-diff/v4 v4.4.1 +# sigs.k8s.io/structured-merge-diff/v4 v4.2.3 ## explicit; go 1.13 sigs.k8s.io/structured-merge-diff/v4/fieldpath sigs.k8s.io/structured-merge-diff/v4/merge @@ -1928,6 +1918,8 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.12 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 -# github.com/aws/aws-sdk-go-v2/service/ecr => github.com/aws/aws-sdk-go-v2/service/ecr v1.27.3 -# github.com/aws/aws-sdk-go-v2/service/ecrpublic => github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.23.3 +# k8s.io/api => k8s.io/api v0.28.5 +# k8s.io/apimachinery => k8s.io/apimachinery v0.28.5 +# k8s.io/client-go => k8s.io/client-go v0.28.5 +# k8s.io/code-generator => k8s.io/code-generator v0.28.5 # github.com/ahmetb/gen-crd-api-reference-docs => github.com/tektoncd/ahmetb-gen-crd-api-reference-docs v0.3.1-0.20220729140133-6ce2d5aafcb4 diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/pathelementmap.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/pathelementmap.go index 41fc2474a43..9b14ca581b0 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/pathelementmap.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/pathelementmap.go @@ -28,15 +28,20 @@ import ( // for PathElementSet and SetNodeMap, so we could probably share the // code. type PathElementValueMap struct { - valueMap PathElementMap + members sortedPathElementValues } func MakePathElementValueMap(size int) PathElementValueMap { return PathElementValueMap{ - valueMap: MakePathElementMap(size), + members: make(sortedPathElementValues, 0, size), } } +type pathElementValue struct { + PathElement PathElement + Value value.Value +} + type sortedPathElementValues []pathElementValue // Implement the sort interface; this would permit bulk creation, which would @@ -48,40 +53,7 @@ func (spev sortedPathElementValues) Less(i, j int) bool { func (spev sortedPathElementValues) Swap(i, j int) { spev[i], spev[j] = spev[j], spev[i] } // Insert adds the pathelement and associated value in the map. -// If insert is called twice with the same PathElement, the value is replaced. func (s *PathElementValueMap) Insert(pe PathElement, v value.Value) { - s.valueMap.Insert(pe, v) -} - -// Get retrieves the value associated with the given PathElement from the map. -// (nil, false) is returned if there is no such PathElement. -func (s *PathElementValueMap) Get(pe PathElement) (value.Value, bool) { - v, ok := s.valueMap.Get(pe) - if !ok { - return nil, false - } - return v.(value.Value), true -} - -// PathElementValueMap is a map from PathElement to interface{}. -type PathElementMap struct { - members sortedPathElementValues -} - -type pathElementValue struct { - PathElement PathElement - Value interface{} -} - -func MakePathElementMap(size int) PathElementMap { - return PathElementMap{ - members: make(sortedPathElementValues, 0, size), - } -} - -// Insert adds the pathelement and associated value in the map. -// If insert is called twice with the same PathElement, the value is replaced. -func (s *PathElementMap) Insert(pe PathElement, v interface{}) { loc := sort.Search(len(s.members), func(i int) bool { return !s.members[i].PathElement.Less(pe) }) @@ -90,7 +62,6 @@ func (s *PathElementMap) Insert(pe PathElement, v interface{}) { return } if s.members[loc].PathElement.Equals(pe) { - s.members[loc].Value = v return } s.members = append(s.members, pathElementValue{}) @@ -100,7 +71,7 @@ func (s *PathElementMap) Insert(pe PathElement, v interface{}) { // Get retrieves the value associated with the given PathElement from the map. // (nil, false) is returned if there is no such PathElement. -func (s *PathElementMap) Get(pe PathElement) (interface{}, bool) { +func (s *PathElementValueMap) Get(pe PathElement) (value.Value, bool) { loc := sort.Search(len(s.members), func(i int) bool { return !s.members[i].PathElement.Less(pe) }) diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go index f1aa258609e..75a492d8ea8 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go @@ -112,7 +112,7 @@ func ConflictsFromManagers(sets fieldpath.ManagedFields) Conflicts { set.Set().Iterate(func(p fieldpath.Path) { conflicts = append(conflicts, Conflict{ Manager: manager, - Path: p.Copy(), + Path: p, }) }) } diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go index d5a977d607b..1b23dcbd5ef 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go @@ -18,7 +18,6 @@ import ( "sigs.k8s.io/structured-merge-diff/v4/fieldpath" "sigs.k8s.io/structured-merge-diff/v4/typed" - "sigs.k8s.io/structured-merge-diff/v4/value" ) // Converter is an interface to the conversion logic. The converter @@ -28,39 +27,19 @@ type Converter interface { IsMissingVersionError(error) bool } -// UpdateBuilder allows you to create a new Updater by exposing all of -// the options and setting them once. -type UpdaterBuilder struct { - Converter Converter - IgnoredFields map[fieldpath.APIVersion]*fieldpath.Set - - // Stop comparing the new object with old object after applying. - // This was initially used to avoid spurious etcd update, but - // since that's vastly inefficient, we've come-up with a better - // way of doing that. Create this flag to stop it. - // Comparing has become more expensive too now that we're not using - // `Compare` but `value.Equals` so this gives an option to avoid it. - ReturnInputOnNoop bool -} - -func (u *UpdaterBuilder) BuildUpdater() *Updater { - return &Updater{ - Converter: u.Converter, - IgnoredFields: u.IgnoredFields, - returnInputOnNoop: u.ReturnInputOnNoop, - } -} - // Updater is the object used to compute updated FieldSets and also // merge the object on Apply. type Updater struct { - // Deprecated: This will eventually become private. - Converter Converter - - // Deprecated: This will eventually become private. + Converter Converter IgnoredFields map[fieldpath.APIVersion]*fieldpath.Set - returnInputOnNoop bool + enableUnions bool +} + +// EnableUnionFeature turns on union handling. It is disabled by default until the +// feature is complete. +func (s *Updater) EnableUnionFeature() { + s.enableUnions = true } func (s *Updater) update(oldObject, newObject *typed.TypedValue, version fieldpath.APIVersion, managers fieldpath.ManagedFields, workflow string, force bool) (fieldpath.ManagedFields, *typed.Comparison, error) { @@ -147,6 +126,12 @@ func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldp if err != nil { return nil, fieldpath.ManagedFields{}, err } + if s.enableUnions { + newObject, err = liveObject.NormalizeUnions(newObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } managers, compare, err := s.update(liveObject, newObject, version, managers, manager, true) if err != nil { return nil, fieldpath.ManagedFields{}, err @@ -160,7 +145,7 @@ func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldp ignored = fieldpath.NewSet() } managers[manager] = fieldpath.NewVersionedSet( - managers[manager].Set().Difference(compare.Removed).Union(compare.Modified).Union(compare.Added).RecursiveDifference(ignored), + managers[manager].Set().Union(compare.Modified).Union(compare.Added).Difference(compare.Removed).RecursiveDifference(ignored), version, false, ) @@ -172,17 +157,30 @@ func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldp // Apply should be called when Apply is run, given the current object as // well as the configuration that is applied. This will merge the object -// and return it. +// and return it. If the object hasn't changed, nil is returned (the +// managers can still have changed though). func (s *Updater) Apply(liveObject, configObject *typed.TypedValue, version fieldpath.APIVersion, managers fieldpath.ManagedFields, manager string, force bool) (*typed.TypedValue, fieldpath.ManagedFields, error) { var err error managers, err = s.reconcileManagedFieldsWithSchemaChanges(liveObject, managers) if err != nil { return nil, fieldpath.ManagedFields{}, err } + if s.enableUnions { + configObject, err = configObject.NormalizeUnionsApply(configObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } newObject, err := liveObject.Merge(configObject) if err != nil { return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to merge config: %v", err) } + if s.enableUnions { + newObject, err = configObject.NormalizeUnionsApply(newObject) + if err != nil { + return nil, fieldpath.ManagedFields{}, err + } + } lastSet := managers[manager] set, err := configObject.ToFieldSet() if err != nil { @@ -202,11 +200,11 @@ func (s *Updater) Apply(liveObject, configObject *typed.TypedValue, version fiel if err != nil { return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to prune fields: %v", err) } - managers, _, err = s.update(liveObject, newObject, version, managers, manager, force) + managers, compare, err := s.update(liveObject, newObject, version, managers, manager, force) if err != nil { return nil, fieldpath.ManagedFields{}, err } - if !s.returnInputOnNoop && value.EqualsUsing(value.NewFreelistAllocator(), liveObject.AsValue(), newObject.AsValue()) { + if compare.IsSame() { newObject = nil } return newObject, managers, nil @@ -220,8 +218,7 @@ func (s *Updater) prune(merged *typed.TypedValue, managers fieldpath.ManagedFiel if lastSet == nil || lastSet.Set().Empty() { return merged, nil } - version := lastSet.APIVersion() - convertedMerged, err := s.Converter.Convert(merged, version) + convertedMerged, err := s.Converter.Convert(merged, lastSet.APIVersion()) if err != nil { if s.Converter.IsMissingVersionError(err) { return merged, nil @@ -231,7 +228,7 @@ func (s *Updater) prune(merged *typed.TypedValue, managers fieldpath.ManagedFiel sc, tr := convertedMerged.Schema(), convertedMerged.TypeRef() pruned := convertedMerged.RemoveItems(lastSet.Set().EnsureNamedFieldsAreMembers(sc, tr)) - pruned, err = s.addBackOwnedItems(convertedMerged, pruned, version, managers, applyingManager) + pruned, err = s.addBackOwnedItems(convertedMerged, pruned, managers, applyingManager) if err != nil { return nil, fmt.Errorf("failed add back owned items: %v", err) } @@ -244,7 +241,7 @@ func (s *Updater) prune(merged *typed.TypedValue, managers fieldpath.ManagedFiel // addBackOwnedItems adds back any fields, list and map items that were removed by prune, // but other appliers or updaters (or the current applier's new config) claim to own. -func (s *Updater) addBackOwnedItems(merged, pruned *typed.TypedValue, prunedVersion fieldpath.APIVersion, managedFields fieldpath.ManagedFields, applyingManager string) (*typed.TypedValue, error) { +func (s *Updater) addBackOwnedItems(merged, pruned *typed.TypedValue, managedFields fieldpath.ManagedFields, applyingManager string) (*typed.TypedValue, error) { var err error managedAtVersion := map[fieldpath.APIVersion]*fieldpath.Set{} for _, managerSet := range managedFields { @@ -255,6 +252,7 @@ func (s *Updater) addBackOwnedItems(merged, pruned *typed.TypedValue, prunedVers } // Add back owned items at pruned version first to avoid conversion failure // caused by pruned fields which are required for conversion. + prunedVersion := fieldpath.APIVersion(*pruned.TypeRef().NamedType) if managed, ok := managedAtVersion[prunedVersion]; ok { merged, pruned, err = s.addBackOwnedItemsForVersion(merged, pruned, prunedVersion, managed) if err != nil { diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/elements.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/elements.go index 5d3707a5b50..7e5dc758274 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/elements.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/elements.go @@ -73,7 +73,7 @@ type Atom struct { } // Scalar (AKA "primitive") represents a type which has a single value which is -// either numeric, string, or boolean, or untyped for any of them. +// either numeric, string, or boolean. // // TODO: split numeric into float/int? Something even more fine-grained? type Scalar string @@ -82,7 +82,6 @@ const ( Numeric = Scalar("numeric") String = Scalar("string") Boolean = Scalar("boolean") - Untyped = Scalar("untyped") ) // ElementRelationship is an enum of the different possible relationships diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/schemaschema.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/schemaschema.go index 6eb6c36df30..7d64d1308ce 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/schemaschema.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/schema/schemaschema.go @@ -110,7 +110,7 @@ var SchemaSchemaYAML = `types: scalar: string - name: deduceInvalidDiscriminator type: - scalar: boolean + scalar: bool - name: fields type: list: @@ -145,7 +145,6 @@ var SchemaSchemaYAML = `types: list: elementType: scalar: string - elementRelationship: atomic - name: untyped map: fields: diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go deleted file mode 100644 index ed483cbbc4d..00000000000 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go +++ /dev/null @@ -1,460 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package typed - -import ( - "fmt" - "strings" - - "sigs.k8s.io/structured-merge-diff/v4/fieldpath" - "sigs.k8s.io/structured-merge-diff/v4/schema" - "sigs.k8s.io/structured-merge-diff/v4/value" -) - -// Comparison is the return value of a TypedValue.Compare() operation. -// -// No field will appear in more than one of the three fieldsets. If all of the -// fieldsets are empty, then the objects must have been equal. -type Comparison struct { - // Removed contains any fields removed by rhs (the right-hand-side - // object in the comparison). - Removed *fieldpath.Set - // Modified contains fields present in both objects but different. - Modified *fieldpath.Set - // Added contains any fields added by rhs. - Added *fieldpath.Set -} - -// IsSame returns true if the comparison returned no changes (the two -// compared objects are similar). -func (c *Comparison) IsSame() bool { - return c.Removed.Empty() && c.Modified.Empty() && c.Added.Empty() -} - -// String returns a human readable version of the comparison. -func (c *Comparison) String() string { - bld := strings.Builder{} - if !c.Modified.Empty() { - bld.WriteString(fmt.Sprintf("- Modified Fields:\n%v\n", c.Modified)) - } - if !c.Added.Empty() { - bld.WriteString(fmt.Sprintf("- Added Fields:\n%v\n", c.Added)) - } - if !c.Removed.Empty() { - bld.WriteString(fmt.Sprintf("- Removed Fields:\n%v\n", c.Removed)) - } - return bld.String() -} - -// ExcludeFields fields from the compare recursively removes the fields -// from the entire comparison -func (c *Comparison) ExcludeFields(fields *fieldpath.Set) *Comparison { - if fields == nil || fields.Empty() { - return c - } - c.Removed = c.Removed.RecursiveDifference(fields) - c.Modified = c.Modified.RecursiveDifference(fields) - c.Added = c.Added.RecursiveDifference(fields) - return c -} - -type compareWalker struct { - lhs value.Value - rhs value.Value - schema *schema.Schema - typeRef schema.TypeRef - - // Current path that we are comparing - path fieldpath.Path - - // Resulting comparison. - comparison *Comparison - - // internal housekeeping--don't set when constructing. - inLeaf bool // Set to true if we're in a "big leaf"--atomic map/list - - // Allocate only as many walkers as needed for the depth by storing them here. - spareWalkers *[]*compareWalker - - allocator value.Allocator -} - -// compare compares stuff. -func (w *compareWalker) compare(prefixFn func() string) (errs ValidationErrors) { - if w.lhs == nil && w.rhs == nil { - // check this condidition here instead of everywhere below. - return errorf("at least one of lhs and rhs must be provided") - } - a, ok := w.schema.Resolve(w.typeRef) - if !ok { - return errorf("schema error: no type found matching: %v", *w.typeRef.NamedType) - } - - alhs := deduceAtom(a, w.lhs) - arhs := deduceAtom(a, w.rhs) - - // deduceAtom does not fix the type for nil values - // nil is a wildcard and will accept whatever form the other operand takes - if w.rhs == nil { - errs = append(errs, handleAtom(alhs, w.typeRef, w)...) - } else if w.lhs == nil || alhs.Equals(&arhs) { - errs = append(errs, handleAtom(arhs, w.typeRef, w)...) - } else { - w2 := *w - errs = append(errs, handleAtom(alhs, w.typeRef, &w2)...) - errs = append(errs, handleAtom(arhs, w.typeRef, w)...) - } - - if !w.inLeaf { - if w.lhs == nil { - w.comparison.Added.Insert(w.path) - } else if w.rhs == nil { - w.comparison.Removed.Insert(w.path) - } - } - return errs.WithLazyPrefix(prefixFn) -} - -// doLeaf should be called on leaves before descending into children, if there -// will be a descent. It modifies w.inLeaf. -func (w *compareWalker) doLeaf() { - if w.inLeaf { - // We're in a "big leaf", an atomic map or list. Ignore - // subsequent leaves. - return - } - w.inLeaf = true - - // We don't recurse into leaf fields for merging. - if w.lhs == nil { - w.comparison.Added.Insert(w.path) - } else if w.rhs == nil { - w.comparison.Removed.Insert(w.path) - } else if !value.EqualsUsing(w.allocator, w.rhs, w.lhs) { - // TODO: Equality is not sufficient for this. - // Need to implement equality check on the value type. - w.comparison.Modified.Insert(w.path) - } -} - -func (w *compareWalker) doScalar(t *schema.Scalar) ValidationErrors { - // Make sure at least one side is a valid scalar. - lerrs := validateScalar(t, w.lhs, "lhs: ") - rerrs := validateScalar(t, w.rhs, "rhs: ") - if len(lerrs) > 0 && len(rerrs) > 0 { - return append(lerrs, rerrs...) - } - - // All scalars are leaf fields. - w.doLeaf() - - return nil -} - -func (w *compareWalker) prepareDescent(pe fieldpath.PathElement, tr schema.TypeRef, cmp *Comparison) *compareWalker { - if w.spareWalkers == nil { - // first descent. - w.spareWalkers = &[]*compareWalker{} - } - var w2 *compareWalker - if n := len(*w.spareWalkers); n > 0 { - w2, *w.spareWalkers = (*w.spareWalkers)[n-1], (*w.spareWalkers)[:n-1] - } else { - w2 = &compareWalker{} - } - *w2 = *w - w2.typeRef = tr - w2.path = append(w2.path, pe) - w2.lhs = nil - w2.rhs = nil - w2.comparison = cmp - return w2 -} - -func (w *compareWalker) finishDescent(w2 *compareWalker) { - // if the descent caused a realloc, ensure that we reuse the buffer - // for the next sibling. - w.path = w2.path[:len(w2.path)-1] - *w.spareWalkers = append(*w.spareWalkers, w2) -} - -func (w *compareWalker) derefMap(prefix string, v value.Value) (value.Map, ValidationErrors) { - if v == nil { - return nil, nil - } - m, err := mapValue(w.allocator, v) - if err != nil { - return nil, errorf("%v: %v", prefix, err) - } - return m, nil -} - -func (w *compareWalker) visitListItems(t *schema.List, lhs, rhs value.List) (errs ValidationErrors) { - rLen := 0 - if rhs != nil { - rLen = rhs.Length() - } - lLen := 0 - if lhs != nil { - lLen = lhs.Length() - } - - maxLength := rLen - if lLen > maxLength { - maxLength = lLen - } - // Contains all the unique PEs between lhs and rhs, exactly once. - // Order doesn't matter since we're just tracking ownership in a set. - allPEs := make([]fieldpath.PathElement, 0, maxLength) - - // Gather all the elements from lhs, indexed by PE, in a list for duplicates. - lValues := fieldpath.MakePathElementMap(lLen) - for i := 0; i < lLen; i++ { - child := lhs.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, child) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - - if v, found := lValues.Get(pe); found { - list := v.([]value.Value) - lValues.Insert(pe, append(list, child)) - } else { - lValues.Insert(pe, []value.Value{child}) - allPEs = append(allPEs, pe) - } - } - - // Gather all the elements from rhs, indexed by PE, in a list for duplicates. - rValues := fieldpath.MakePathElementMap(rLen) - for i := 0; i < rLen; i++ { - rValue := rhs.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, rValue) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - if v, found := rValues.Get(pe); found { - list := v.([]value.Value) - rValues.Insert(pe, append(list, rValue)) - } else { - rValues.Insert(pe, []value.Value{rValue}) - if _, found := lValues.Get(pe); !found { - allPEs = append(allPEs, pe) - } - } - } - - for _, pe := range allPEs { - lList := []value.Value(nil) - if l, ok := lValues.Get(pe); ok { - lList = l.([]value.Value) - } - rList := []value.Value(nil) - if l, ok := rValues.Get(pe); ok { - rList = l.([]value.Value) - } - - switch { - case len(lList) == 0 && len(rList) == 0: - // We shouldn't be here anyway. - return - // Normal use-case: - // We have no duplicates for this PE, compare items one-to-one. - case len(lList) <= 1 && len(rList) <= 1: - lValue := value.Value(nil) - if len(lList) != 0 { - lValue = lList[0] - } - rValue := value.Value(nil) - if len(rList) != 0 { - rValue = rList[0] - } - errs = append(errs, w.compareListItem(t, pe, lValue, rValue)...) - // Duplicates before & after use-case: - // Compare the duplicates lists as if they were atomic, mark modified if they changed. - case len(lList) >= 2 && len(rList) >= 2: - listEqual := func(lList, rList []value.Value) bool { - if len(lList) != len(rList) { - return false - } - for i := range lList { - if !value.Equals(lList[i], rList[i]) { - return false - } - } - return true - } - if !listEqual(lList, rList) { - w.comparison.Modified.Insert(append(w.path, pe)) - } - // Duplicates before & not anymore use-case: - // Rcursively add new non-duplicate items, Remove duplicate marker, - case len(lList) >= 2: - if len(rList) != 0 { - errs = append(errs, w.compareListItem(t, pe, nil, rList[0])...) - } - w.comparison.Removed.Insert(append(w.path, pe)) - // New duplicates use-case: - // Recursively remove old non-duplicate items, add duplicate marker. - case len(rList) >= 2: - if len(lList) != 0 { - errs = append(errs, w.compareListItem(t, pe, lList[0], nil)...) - } - w.comparison.Added.Insert(append(w.path, pe)) - } - } - - return -} - -func (w *compareWalker) indexListPathElements(t *schema.List, list value.List) ([]fieldpath.PathElement, fieldpath.PathElementValueMap, ValidationErrors) { - var errs ValidationErrors - length := 0 - if list != nil { - length = list.Length() - } - observed := fieldpath.MakePathElementValueMap(length) - pes := make([]fieldpath.PathElement, 0, length) - for i := 0; i < length; i++ { - child := list.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, child) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - // Ignore repeated occurences of `pe`. - if _, found := observed.Get(pe); found { - continue - } - observed.Insert(pe, child) - pes = append(pes, pe) - } - return pes, observed, errs -} - -func (w *compareWalker) compareListItem(t *schema.List, pe fieldpath.PathElement, lChild, rChild value.Value) ValidationErrors { - w2 := w.prepareDescent(pe, t.ElementType, w.comparison) - w2.lhs = lChild - w2.rhs = rChild - errs := w2.compare(pe.String) - w.finishDescent(w2) - return errs -} - -func (w *compareWalker) derefList(prefix string, v value.Value) (value.List, ValidationErrors) { - if v == nil { - return nil, nil - } - l, err := listValue(w.allocator, v) - if err != nil { - return nil, errorf("%v: %v", prefix, err) - } - return l, nil -} - -func (w *compareWalker) doList(t *schema.List) (errs ValidationErrors) { - lhs, _ := w.derefList("lhs: ", w.lhs) - if lhs != nil { - defer w.allocator.Free(lhs) - } - rhs, _ := w.derefList("rhs: ", w.rhs) - if rhs != nil { - defer w.allocator.Free(rhs) - } - - // If both lhs and rhs are empty/null, treat it as a - // leaf: this helps preserve the empty/null - // distinction. - emptyPromoteToLeaf := (lhs == nil || lhs.Length() == 0) && (rhs == nil || rhs.Length() == 0) - - if t.ElementRelationship == schema.Atomic || emptyPromoteToLeaf { - w.doLeaf() - return nil - } - - if lhs == nil && rhs == nil { - return nil - } - - errs = w.visitListItems(t, lhs, rhs) - - return errs -} - -func (w *compareWalker) visitMapItem(t *schema.Map, out map[string]interface{}, key string, lhs, rhs value.Value) (errs ValidationErrors) { - fieldType := t.ElementType - if sf, ok := t.FindField(key); ok { - fieldType = sf.Type - } - pe := fieldpath.PathElement{FieldName: &key} - w2 := w.prepareDescent(pe, fieldType, w.comparison) - w2.lhs = lhs - w2.rhs = rhs - errs = append(errs, w2.compare(pe.String)...) - w.finishDescent(w2) - return errs -} - -func (w *compareWalker) visitMapItems(t *schema.Map, lhs, rhs value.Map) (errs ValidationErrors) { - out := map[string]interface{}{} - - value.MapZipUsing(w.allocator, lhs, rhs, value.Unordered, func(key string, lhsValue, rhsValue value.Value) bool { - errs = append(errs, w.visitMapItem(t, out, key, lhsValue, rhsValue)...) - return true - }) - - return errs -} - -func (w *compareWalker) doMap(t *schema.Map) (errs ValidationErrors) { - lhs, _ := w.derefMap("lhs: ", w.lhs) - if lhs != nil { - defer w.allocator.Free(lhs) - } - rhs, _ := w.derefMap("rhs: ", w.rhs) - if rhs != nil { - defer w.allocator.Free(rhs) - } - // If both lhs and rhs are empty/null, treat it as a - // leaf: this helps preserve the empty/null - // distinction. - emptyPromoteToLeaf := (lhs == nil || lhs.Empty()) && (rhs == nil || rhs.Empty()) - - if t.ElementRelationship == schema.Atomic || emptyPromoteToLeaf { - w.doLeaf() - return nil - } - - if lhs == nil && rhs == nil { - return nil - } - - errs = append(errs, w.visitMapItems(t, lhs, rhs)...) - - return errs -} diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/helpers.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/helpers.go index 78fdb0e75f7..19c77334f6c 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/helpers.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/helpers.go @@ -197,7 +197,7 @@ func getAssociativeKeyDefault(s *schema.Schema, list *schema.List, fieldName str return field.Default, nil } -func keyedAssociativeListItemToPathElement(a value.Allocator, s *schema.Schema, list *schema.List, child value.Value) (fieldpath.PathElement, error) { +func keyedAssociativeListItemToPathElement(a value.Allocator, s *schema.Schema, list *schema.List, index int, child value.Value) (fieldpath.PathElement, error) { pe := fieldpath.PathElement{} if child.IsNull() { // null entries are illegal. @@ -225,7 +225,7 @@ func keyedAssociativeListItemToPathElement(a value.Allocator, s *schema.Schema, return pe, nil } -func setItemToPathElement(child value.Value) (fieldpath.PathElement, error) { +func setItemToPathElement(list *schema.List, index int, child value.Value) (fieldpath.PathElement, error) { pe := fieldpath.PathElement{} switch { case child.IsMap(): @@ -245,15 +245,16 @@ func setItemToPathElement(child value.Value) (fieldpath.PathElement, error) { } } -func listItemToPathElement(a value.Allocator, s *schema.Schema, list *schema.List, child value.Value) (fieldpath.PathElement, error) { - if list.ElementRelationship != schema.Associative { - return fieldpath.PathElement{}, errors.New("invalid indexing of non-associative list") - } +func listItemToPathElement(a value.Allocator, s *schema.Schema, list *schema.List, index int, child value.Value) (fieldpath.PathElement, error) { + if list.ElementRelationship == schema.Associative { + if len(list.Keys) > 0 { + return keyedAssociativeListItemToPathElement(a, s, list, index, child) + } - if len(list.Keys) > 0 { - return keyedAssociativeListItemToPathElement(a, s, list, child) + // If there's no keys, then we must be a set of primitives. + return setItemToPathElement(list, index, child) } - // If there's no keys, then we must be a set of primitives. - return setItemToPathElement(child) + // Use the index as a key for atomic lists. + return fieldpath.PathElement{Index: &index}, nil } diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go index fa227ac405b..91364408307 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go @@ -113,12 +113,11 @@ func (w *mergingWalker) doLeaf() { w.rule(w) } -func (w *mergingWalker) doScalar(t *schema.Scalar) ValidationErrors { - // Make sure at least one side is a valid scalar. - lerrs := validateScalar(t, w.lhs, "lhs: ") - rerrs := validateScalar(t, w.rhs, "rhs: ") - if len(lerrs) > 0 && len(rerrs) > 0 { - return append(lerrs, rerrs...) +func (w *mergingWalker) doScalar(t *schema.Scalar) (errs ValidationErrors) { + errs = append(errs, validateScalar(t, w.lhs, "lhs: ")...) + errs = append(errs, validateScalar(t, w.rhs, "rhs: ")...) + if len(errs) > 0 { + return errs } // All scalars are leaf fields. @@ -180,18 +179,14 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err } out := make([]interface{}, 0, outLen) - rhsPEs, observedRHS, rhsErrs := w.indexListPathElements(t, rhs, false) + rhsOrder, observedRHS, rhsErrs := w.indexListPathElements(t, rhs) errs = append(errs, rhsErrs...) - lhsPEs, observedLHS, lhsErrs := w.indexListPathElements(t, lhs, true) + lhsOrder, observedLHS, lhsErrs := w.indexListPathElements(t, lhs) errs = append(errs, lhsErrs...) - if len(errs) != 0 { - return errs - } - sharedOrder := make([]*fieldpath.PathElement, 0, rLen) - for i := range rhsPEs { - pe := &rhsPEs[i] + for i := range rhsOrder { + pe := &rhsOrder[i] if _, ok := observedLHS.Get(*pe); ok { sharedOrder = append(sharedOrder, pe) } @@ -203,15 +198,13 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err sharedOrder = sharedOrder[1:] } - mergedRHS := fieldpath.MakePathElementMap(len(rhsPEs)) - lLen, rLen = len(lhsPEs), len(rhsPEs) + lLen, rLen = len(lhsOrder), len(rhsOrder) for lI, rI := 0, 0; lI < lLen || rI < rLen; { if lI < lLen && rI < rLen { - pe := lhsPEs[lI] - if pe.Equals(rhsPEs[rI]) { + pe := lhsOrder[lI] + if pe.Equals(rhsOrder[rI]) { // merge LHS & RHS items - mergedRHS.Insert(pe, struct{}{}) - lChild, _ := observedLHS.Get(pe) // may be nil if the PE is duplicaated. + lChild, _ := observedLHS.Get(pe) rChild, _ := observedRHS.Get(pe) mergeOut, errs := w.mergeListItem(t, pe, lChild, rChild) errs = append(errs, errs...) @@ -228,17 +221,17 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err } continue } - if _, ok := observedRHS.Get(pe); ok && nextShared != nil && !nextShared.Equals(lhsPEs[lI]) { + if _, ok := observedRHS.Get(pe); ok && nextShared != nil && !nextShared.Equals(lhsOrder[lI]) { // shared item, but not the one we want in this round lI++ continue } } if lI < lLen { - pe := lhsPEs[lI] + pe := lhsOrder[lI] if _, ok := observedRHS.Get(pe); !ok { - // take LHS item using At to make sure we get the right item (observed may not contain the right item). - lChild := lhs.AtUsing(w.allocator, lI) + // take LHS item + lChild, _ := observedLHS.Get(pe) mergeOut, errs := w.mergeListItem(t, pe, lChild, nil) errs = append(errs, errs...) if mergeOut != nil { @@ -246,16 +239,12 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err } lI++ continue - } else if _, ok := mergedRHS.Get(pe); ok { - // we've already merged it with RHS, we don't want to duplicate it, skip it. - lI++ } } if rI < rLen { // Take the RHS item, merge with matching LHS item if possible - pe := rhsPEs[rI] - mergedRHS.Insert(pe, struct{}{}) - lChild, _ := observedLHS.Get(pe) // may be nil if absent or duplicaated. + pe := rhsOrder[rI] + lChild, _ := observedLHS.Get(pe) // may be nil rChild, _ := observedRHS.Get(pe) mergeOut, errs := w.mergeListItem(t, pe, lChild, rChild) errs = append(errs, errs...) @@ -282,7 +271,7 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err return errs } -func (w *mergingWalker) indexListPathElements(t *schema.List, list value.List, allowDuplicates bool) ([]fieldpath.PathElement, fieldpath.PathElementValueMap, ValidationErrors) { +func (w *mergingWalker) indexListPathElements(t *schema.List, list value.List) ([]fieldpath.PathElement, fieldpath.PathElementValueMap, ValidationErrors) { var errs ValidationErrors length := 0 if list != nil { @@ -292,7 +281,7 @@ func (w *mergingWalker) indexListPathElements(t *schema.List, list value.List, a pes := make([]fieldpath.PathElement, 0, length) for i := 0; i < length; i++ { child := list.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, child) + pe, err := listItemToPathElement(w.allocator, w.schema, t, i, child) if err != nil { errs = append(errs, errorf("element %v: %v", i, err.Error())...) // If we can't construct the path element, we can't @@ -300,15 +289,11 @@ func (w *mergingWalker) indexListPathElements(t *schema.List, list value.List, a // this element. continue } - if _, found := observed.Get(pe); found && !allowDuplicates { + if _, found := observed.Get(pe); found { errs = append(errs, errorf("duplicate entries for key %v", pe.String())...) continue - } else if !found { - observed.Insert(pe, child) - } else { - // Duplicated items are not merged with the new value, make them nil. - observed.Insert(pe, value.NewValueInterface(nil)) } + observed.Insert(pe, child) pes = append(pes, pe) } return pes, observed, errs diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go index 4258ee5bab7..3949a78fc67 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go @@ -93,13 +93,13 @@ func (p ParseableType) IsValid() bool { // FromYAML parses a yaml string into an object with the current schema // and the type "typename" or an error if validation fails. -func (p ParseableType) FromYAML(object YAMLObject, opts ...ValidationOptions) (*TypedValue, error) { +func (p ParseableType) FromYAML(object YAMLObject) (*TypedValue, error) { var v interface{} err := yaml.Unmarshal([]byte(object), &v) if err != nil { return nil, err } - return AsTyped(value.NewValueInterface(v), p.Schema, p.TypeRef, opts...) + return AsTyped(value.NewValueInterface(v), p.Schema, p.TypeRef) } // FromUnstructured converts a go "interface{}" type, typically an @@ -108,8 +108,8 @@ func (p ParseableType) FromYAML(object YAMLObject, opts ...ValidationOptions) (* // The provided interface{} must be one of: map[string]interface{}, // map[interface{}]interface{}, []interface{}, int types, float types, // string or boolean. Nested interface{} must also be one of these types. -func (p ParseableType) FromUnstructured(in interface{}, opts ...ValidationOptions) (*TypedValue, error) { - return AsTyped(value.NewValueInterface(in), p.Schema, p.TypeRef, opts...) +func (p ParseableType) FromUnstructured(in interface{}) (*TypedValue, error) { + return AsTyped(value.NewValueInterface(in), p.Schema, p.TypeRef) } // FromStructured converts a go "interface{}" type, typically an structured object in @@ -117,12 +117,12 @@ func (p ParseableType) FromUnstructured(in interface{}, opts ...ValidationOption // schema validation. The provided "interface{}" value must be a pointer so that the // value can be modified via reflection. The provided "interface{}" may contain structs // and types that are converted to Values by the jsonMarshaler interface. -func (p ParseableType) FromStructured(in interface{}, opts ...ValidationOptions) (*TypedValue, error) { +func (p ParseableType) FromStructured(in interface{}) (*TypedValue, error) { v, err := value.NewValueReflect(in) if err != nil { return nil, fmt.Errorf("error creating struct value reflector: %v", err) } - return AsTyped(v, p.Schema, p.TypeRef, opts...) + return AsTyped(v, p.Schema, p.TypeRef) } // DeducedParseableType is a ParseableType that deduces the type from diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go index ad071ee8f3f..a338d761d43 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go @@ -74,9 +74,9 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { iter := l.RangeUsing(w.allocator) defer w.allocator.Free(iter) for iter.Next() { - _, item := iter.Item() + i, item := iter.Item() // Ignore error because we have already validated this list - pe, _ := listItemToPathElement(w.allocator, w.schema, t, item) + pe, _ := listItemToPathElement(w.allocator, w.schema, t, i, item) path, _ := fieldpath.MakePath(pe) // save items on the path when we shouldExtract // but ignore them when we are removing (i.e. !w.shouldExtract) diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/tofieldset.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/tofieldset.go index d563a87ee6b..047efff0530 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/tofieldset.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/tofieldset.go @@ -94,31 +94,9 @@ func (v *toFieldSetWalker) doScalar(t *schema.Scalar) ValidationErrors { } func (v *toFieldSetWalker) visitListItems(t *schema.List, list value.List) (errs ValidationErrors) { - // Keeps track of the PEs we've seen - seen := fieldpath.MakePathElementSet(list.Length()) - // Keeps tracks of the PEs we've counted as duplicates - duplicates := fieldpath.MakePathElementSet(list.Length()) for i := 0; i < list.Length(); i++ { child := list.At(i) - pe, _ := listItemToPathElement(v.allocator, v.schema, t, child) - if seen.Has(pe) { - if duplicates.Has(pe) { - // do nothing - } else { - v.set.Insert(append(v.path, pe)) - duplicates.Insert(pe) - } - } else { - seen.Insert(pe) - } - } - - for i := 0; i < list.Length(); i++ { - child := list.At(i) - pe, _ := listItemToPathElement(v.allocator, v.schema, t, child) - if duplicates.Has(pe) { - continue - } + pe, _ := listItemToPathElement(v.allocator, v.schema, t, i, child) v2 := v.prepareDescent(pe, t.ElementType) v2.value = child errs = append(errs, v2.toFieldSet()...) diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go index 9be90282806..d63a97fe20a 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go @@ -17,6 +17,8 @@ limitations under the License. package typed import ( + "fmt" + "strings" "sync" "sigs.k8s.io/structured-merge-diff/v4/fieldpath" @@ -24,24 +26,16 @@ import ( "sigs.k8s.io/structured-merge-diff/v4/value" ) -// ValidationOptions is the list of all the options available when running the validation. -type ValidationOptions int - -const ( - // AllowDuplicates means that sets and associative lists can have duplicate similar items. - AllowDuplicates ValidationOptions = iota -) - // AsTyped accepts a value and a type and returns a TypedValue. 'v' must have // type 'typeName' in the schema. An error is returned if the v doesn't conform // to the schema. -func AsTyped(v value.Value, s *schema.Schema, typeRef schema.TypeRef, opts ...ValidationOptions) (*TypedValue, error) { +func AsTyped(v value.Value, s *schema.Schema, typeRef schema.TypeRef) (*TypedValue, error) { tv := &TypedValue{ value: v, typeRef: typeRef, schema: s, } - if err := tv.Validate(opts...); err != nil { + if err := tv.Validate(); err != nil { return nil, err } return tv, nil @@ -51,10 +45,6 @@ func AsTyped(v value.Value, s *schema.Schema, typeRef schema.TypeRef, opts ...Va // conforms to the schema, for cases where that has already been checked or // where you're going to call a method that validates as a side-effect (like // ToFieldSet). -// -// Deprecated: This function was initially created because validation -// was expensive. Now that this has been solved, objects should always -// be created as validated, using `AsTyped`. func AsTypedUnvalidated(v value.Value, s *schema.Schema, typeRef schema.TypeRef) *TypedValue { tv := &TypedValue{ value: v, @@ -87,14 +77,8 @@ func (tv TypedValue) Schema() *schema.Schema { } // Validate returns an error with a list of every spec violation. -func (tv TypedValue) Validate(opts ...ValidationOptions) error { +func (tv TypedValue) Validate() error { w := tv.walker() - for _, opt := range opts { - switch opt { - case AllowDuplicates: - w.allowDuplicates = true - } - } defer w.finished() if errs := w.validate(nil); len(errs) != 0 { return errs @@ -129,10 +113,6 @@ func (tv TypedValue) Merge(pso *TypedValue) (*TypedValue, error) { return merge(&tv, pso, ruleKeepRHS, nil) } -var cmpwPool = sync.Pool{ - New: func() interface{} { return &compareWalker{} }, -} - // Compare compares the two objects. See the comments on the `Comparison` // struct for details on the return value. // @@ -140,44 +120,33 @@ var cmpwPool = sync.Pool{ // match), or an error will be returned. Validation errors will be returned if // the objects don't conform to the schema. func (tv TypedValue) Compare(rhs *TypedValue) (c *Comparison, err error) { - lhs := tv - if lhs.schema != rhs.schema { - return nil, errorf("expected objects with types from the same schema") - } - if !lhs.typeRef.Equals(&rhs.typeRef) { - return nil, errorf("expected objects of the same type, but got %v and %v", lhs.typeRef, rhs.typeRef) - } - - cmpw := cmpwPool.Get().(*compareWalker) - defer func() { - cmpw.lhs = nil - cmpw.rhs = nil - cmpw.schema = nil - cmpw.typeRef = schema.TypeRef{} - cmpw.comparison = nil - cmpw.inLeaf = false - - cmpwPool.Put(cmpw) - }() - - cmpw.lhs = lhs.value - cmpw.rhs = rhs.value - cmpw.schema = lhs.schema - cmpw.typeRef = lhs.typeRef - cmpw.comparison = &Comparison{ + c = &Comparison{ Removed: fieldpath.NewSet(), Modified: fieldpath.NewSet(), Added: fieldpath.NewSet(), } - if cmpw.allocator == nil { - cmpw.allocator = value.NewFreelistAllocator() + _, err = merge(&tv, rhs, func(w *mergingWalker) { + if w.lhs == nil { + c.Added.Insert(w.path) + } else if w.rhs == nil { + c.Removed.Insert(w.path) + } else if !value.Equals(w.rhs, w.lhs) { + // TODO: Equality is not sufficient for this. + // Need to implement equality check on the value type. + c.Modified.Insert(w.path) + } + }, func(w *mergingWalker) { + if w.lhs == nil { + c.Added.Insert(w.path) + } else if w.rhs == nil { + c.Removed.Insert(w.path) + } + }) + if err != nil { + return nil, err } - errs := cmpw.compare(nil) - if len(errs) > 0 { - return nil, errs - } - return cmpw.comparison, nil + return c, nil } // RemoveItems removes each provided list or map item from the value. @@ -192,6 +161,63 @@ func (tv TypedValue) ExtractItems(items *fieldpath.Set) *TypedValue { return &tv } +// NormalizeUnions takes the new object and normalizes the union: +// - If discriminator changed to non-nil, and a new field has been added +// that doesn't match, an error is returned, +// - If discriminator hasn't changed and two fields or more are set, an +// error is returned, +// - If discriminator changed to non-nil, all other fields but the +// discriminated one will be cleared, +// - Otherwise, If only one field is left, update discriminator to that value. +// +// Please note: union behavior isn't finalized yet and this is still experimental. +func (tv TypedValue) NormalizeUnions(new *TypedValue) (*TypedValue, error) { + var errs ValidationErrors + var normalizeFn = func(w *mergingWalker) { + if w.rhs != nil { + v := w.rhs.Unstructured() + w.out = &v + } + if err := normalizeUnions(w); err != nil { + errs = append(errs, errorf(err.Error())...) + } + } + out, mergeErrs := merge(&tv, new, func(w *mergingWalker) {}, normalizeFn) + if mergeErrs != nil { + errs = append(errs, mergeErrs.(ValidationErrors)...) + } + if len(errs) > 0 { + return nil, errs + } + return out, nil +} + +// NormalizeUnionsApply specifically normalize unions on apply. It +// validates that the applied union is correct (there should be no +// ambiguity there), and clear the fields according to the sent intent. +// +// Please note: union behavior isn't finalized yet and this is still experimental. +func (tv TypedValue) NormalizeUnionsApply(new *TypedValue) (*TypedValue, error) { + var errs ValidationErrors + var normalizeFn = func(w *mergingWalker) { + if w.rhs != nil { + v := w.rhs.Unstructured() + w.out = &v + } + if err := normalizeUnionsApply(w); err != nil { + errs = append(errs, errorf(err.Error())...) + } + } + out, mergeErrs := merge(&tv, new, func(w *mergingWalker) {}, normalizeFn) + if mergeErrs != nil { + errs = append(errs, mergeErrs.(ValidationErrors)...) + } + if len(errs) > 0 { + return nil, errs + } + return out, nil +} + func (tv TypedValue) Empty() *TypedValue { tv.value = value.NewValueInterface(nil) return &tv @@ -247,3 +273,50 @@ func merge(lhs, rhs *TypedValue, rule, postRule mergeRule) (*TypedValue, error) } return out, nil } + +// Comparison is the return value of a TypedValue.Compare() operation. +// +// No field will appear in more than one of the three fieldsets. If all of the +// fieldsets are empty, then the objects must have been equal. +type Comparison struct { + // Removed contains any fields removed by rhs (the right-hand-side + // object in the comparison). + Removed *fieldpath.Set + // Modified contains fields present in both objects but different. + Modified *fieldpath.Set + // Added contains any fields added by rhs. + Added *fieldpath.Set +} + +// IsSame returns true if the comparison returned no changes (the two +// compared objects are similar). +func (c *Comparison) IsSame() bool { + return c.Removed.Empty() && c.Modified.Empty() && c.Added.Empty() +} + +// String returns a human readable version of the comparison. +func (c *Comparison) String() string { + bld := strings.Builder{} + if !c.Modified.Empty() { + bld.WriteString(fmt.Sprintf("- Modified Fields:\n%v\n", c.Modified)) + } + if !c.Added.Empty() { + bld.WriteString(fmt.Sprintf("- Added Fields:\n%v\n", c.Added)) + } + if !c.Removed.Empty() { + bld.WriteString(fmt.Sprintf("- Removed Fields:\n%v\n", c.Removed)) + } + return bld.String() +} + +// ExcludeFields fields from the compare recursively removes the fields +// from the entire comparison +func (c *Comparison) ExcludeFields(fields *fieldpath.Set) *Comparison { + if fields == nil || fields.Empty() { + return c + } + c.Removed = c.Removed.RecursiveDifference(fields) + c.Modified = c.Modified.RecursiveDifference(fields) + c.Added = c.Added.RecursiveDifference(fields) + return c +} diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/union.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/union.go new file mode 100644 index 00000000000..1fa5d88ae63 --- /dev/null +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/union.go @@ -0,0 +1,276 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package typed + +import ( + "fmt" + "strings" + + "sigs.k8s.io/structured-merge-diff/v4/schema" + "sigs.k8s.io/structured-merge-diff/v4/value" +) + +func normalizeUnions(w *mergingWalker) error { + atom, found := w.schema.Resolve(w.typeRef) + if !found { + panic(fmt.Sprintf("Unable to resolve schema in normalize union: %v/%v", w.schema, w.typeRef)) + } + // Unions can only be in structures, and the struct must not have been removed + if atom.Map == nil || w.out == nil { + return nil + } + + var old value.Map + if w.lhs != nil && !w.lhs.IsNull() { + old = w.lhs.AsMap() + } + for _, union := range atom.Map.Unions { + if err := newUnion(&union).Normalize(old, w.rhs.AsMap(), value.NewValueInterface(*w.out).AsMap()); err != nil { + return err + } + } + return nil +} + +func normalizeUnionsApply(w *mergingWalker) error { + atom, found := w.schema.Resolve(w.typeRef) + if !found { + panic(fmt.Sprintf("Unable to resolve schema in normalize union: %v/%v", w.schema, w.typeRef)) + } + // Unions can only be in structures, and the struct must not have been removed + if atom.Map == nil || w.out == nil { + return nil + } + + var old value.Map + if w.lhs != nil && !w.lhs.IsNull() { + old = w.lhs.AsMap() + } + + for _, union := range atom.Map.Unions { + out := value.NewValueInterface(*w.out) + if err := newUnion(&union).NormalizeApply(old, w.rhs.AsMap(), out.AsMap()); err != nil { + return err + } + *w.out = out.Unstructured() + } + return nil +} + +type discriminated string +type field string + +type discriminatedNames struct { + f2d map[field]discriminated + d2f map[discriminated]field +} + +func newDiscriminatedName(f2d map[field]discriminated) discriminatedNames { + d2f := map[discriminated]field{} + for key, value := range f2d { + d2f[value] = key + } + return discriminatedNames{ + f2d: f2d, + d2f: d2f, + } +} + +func (dn discriminatedNames) toField(d discriminated) field { + if f, ok := dn.d2f[d]; ok { + return f + } + return field(d) +} + +func (dn discriminatedNames) toDiscriminated(f field) discriminated { + if d, ok := dn.f2d[f]; ok { + return d + } + return discriminated(f) +} + +type discriminator struct { + name string +} + +func (d *discriminator) Set(m value.Map, v discriminated) { + if d == nil { + return + } + m.Set(d.name, value.NewValueInterface(string(v))) +} + +func (d *discriminator) Get(m value.Map) discriminated { + if d == nil || m == nil { + return "" + } + val, ok := m.Get(d.name) + if !ok { + return "" + } + if !val.IsString() { + return "" + } + return discriminated(val.AsString()) +} + +type fieldsSet map[field]struct{} + +// newFieldsSet returns a map of the fields that are part of the union and are set +// in the given map. +func newFieldsSet(m value.Map, fields []field) fieldsSet { + if m == nil { + return nil + } + set := fieldsSet{} + for _, f := range fields { + if subField, ok := m.Get(string(f)); ok && !subField.IsNull() { + set.Add(f) + } + } + return set +} + +func (fs fieldsSet) Add(f field) { + if fs == nil { + fs = map[field]struct{}{} + } + fs[f] = struct{}{} +} + +func (fs fieldsSet) One() *field { + for f := range fs { + return &f + } + return nil +} + +func (fs fieldsSet) Has(f field) bool { + _, ok := fs[f] + return ok +} + +func (fs fieldsSet) List() []field { + fields := []field{} + for f := range fs { + fields = append(fields, f) + } + return fields +} + +func (fs fieldsSet) Difference(o fieldsSet) fieldsSet { + n := fieldsSet{} + for f := range fs { + if !o.Has(f) { + n.Add(f) + } + } + return n +} + +func (fs fieldsSet) String() string { + s := []string{} + for k := range fs { + s = append(s, string(k)) + } + return strings.Join(s, ", ") +} + +type union struct { + deduceInvalidDiscriminator bool + d *discriminator + dn discriminatedNames + f []field +} + +func newUnion(su *schema.Union) *union { + u := &union{} + if su.Discriminator != nil { + u.d = &discriminator{name: *su.Discriminator} + } + f2d := map[field]discriminated{} + for _, f := range su.Fields { + u.f = append(u.f, field(f.FieldName)) + f2d[field(f.FieldName)] = discriminated(f.DiscriminatorValue) + } + u.dn = newDiscriminatedName(f2d) + u.deduceInvalidDiscriminator = su.DeduceInvalidDiscriminator + return u +} + +// clear removes all the fields in map that are part of the union, but +// the one we decided to keep. +func (u *union) clear(m value.Map, f field) { + for _, fieldName := range u.f { + if field(fieldName) != f { + m.Delete(string(fieldName)) + } + } +} + +func (u *union) Normalize(old, new, out value.Map) error { + os := newFieldsSet(old, u.f) + ns := newFieldsSet(new, u.f) + diff := ns.Difference(os) + + if u.d.Get(old) != u.d.Get(new) && u.d.Get(new) != "" { + if len(diff) == 1 && u.d.Get(new) != u.dn.toDiscriminated(*diff.One()) { + return fmt.Errorf("discriminator (%v) and field changed (%v) don't match", u.d.Get(new), diff.One()) + } + if len(diff) > 1 { + return fmt.Errorf("multiple new fields added: %v", diff) + } + u.clear(out, u.dn.toField(u.d.Get(new))) + return nil + } + + if len(ns) > 1 { + return fmt.Errorf("multiple fields set without discriminator change: %v", ns) + } + + // Set discriminiator if it needs to be deduced. + if u.deduceInvalidDiscriminator && len(ns) == 1 { + u.d.Set(out, u.dn.toDiscriminated(*ns.One())) + } + + return nil +} + +func (u *union) NormalizeApply(applied, merged, out value.Map) error { + as := newFieldsSet(applied, u.f) + if len(as) > 1 { + return fmt.Errorf("more than one field of union applied: %v", as) + } + if len(as) == 0 { + // None is set, just leave. + return nil + } + // We have exactly one, discriminiator must match if set + if u.d.Get(applied) != "" && u.d.Get(applied) != u.dn.toDiscriminated(*as.One()) { + return fmt.Errorf("applied discriminator (%v) doesn't match applied field (%v)", u.d.Get(applied), *as.One()) + } + + // Update discriminiator if needed + if u.deduceInvalidDiscriminator { + u.d.Set(out, u.dn.toDiscriminated(*as.One())) + } + // Clear others fields. + u.clear(out, *as.One()) + + return nil +} diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/validate.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/validate.go index 652e24c819a..378d30219c4 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/validate.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/validate.go @@ -33,7 +33,6 @@ func (tv TypedValue) walker() *validatingObjectWalker { v.value = tv.value v.schema = tv.schema v.typeRef = tv.typeRef - v.allowDuplicates = false if v.allocator == nil { v.allocator = value.NewFreelistAllocator() } @@ -50,9 +49,6 @@ type validatingObjectWalker struct { value value.Value schema *schema.Schema typeRef schema.TypeRef - // If set to true, duplicates will be allowed in - // associativeLists/sets. - allowDuplicates bool // Allocate only as many walkers as needed for the depth by storing them here. spareWalkers *[]*validatingObjectWalker @@ -106,12 +102,6 @@ func validateScalar(t *schema.Scalar, v value.Value, prefix string) (errs Valida if !v.IsBool() { return errorf("%vexpected boolean, got %v", prefix, v) } - case schema.Untyped: - if !v.IsFloat() && !v.IsInt() && !v.IsString() && !v.IsBool() { - return errorf("%vexpected any scalar, got %v", prefix, v) - } - default: - return errorf("%vunexpected scalar type in schema: %v", prefix, *t) } return nil } @@ -133,7 +123,7 @@ func (v *validatingObjectWalker) visitListItems(t *schema.List, list value.List) pe.Index = &i } else { var err error - pe, err = listItemToPathElement(v.allocator, v.schema, t, child) + pe, err = listItemToPathElement(v.allocator, v.schema, t, i, child) if err != nil { errs = append(errs, errorf("element %v: %v", i, err.Error())...) // If we can't construct the path element, we can't @@ -141,7 +131,7 @@ func (v *validatingObjectWalker) visitListItems(t *schema.List, list value.List) // this element. return } - if observedKeys.Has(pe) && !v.allowDuplicates { + if observedKeys.Has(pe) { errs = append(errs, errorf("duplicate entries for key %v", pe.String())...) } observedKeys.Insert(pe) diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapreflect.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapreflect.go index c38402b99a3..dc8b8c72006 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapreflect.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapreflect.go @@ -136,7 +136,7 @@ func (r mapReflect) EqualsUsing(a Allocator, m Map) bool { if !ok { return false } - return EqualsUsing(a, vr.mustReuse(lhsVal, entry, nil, nil), value) + return Equals(vr.mustReuse(lhsVal, entry, nil, nil), value) }) } diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapunstructured.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapunstructured.go index c3ae00b180e..d8e208628de 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapunstructured.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/mapunstructured.go @@ -88,12 +88,12 @@ func (m mapUnstructuredInterface) EqualsUsing(a Allocator, other Map) bool { } vv := a.allocValueUnstructured() defer a.Free(vv) - return other.IterateUsing(a, func(key string, value Value) bool { + return other.Iterate(func(key string, value Value) bool { lhsVal, ok := m[key] if !ok { return false } - return EqualsUsing(a, vv.reuse(lhsVal), value) + return Equals(vv.reuse(lhsVal), value) }) } @@ -168,12 +168,12 @@ func (m mapUnstructuredString) EqualsUsing(a Allocator, other Map) bool { } vv := a.allocValueUnstructured() defer a.Free(vv) - return other.IterateUsing(a, func(key string, value Value) bool { + return other.Iterate(func(key string, value Value) bool { lhsVal, ok := m[key] if !ok { return false } - return EqualsUsing(a, vv.reuse(lhsVal), value) + return Equals(vv.reuse(lhsVal), value) }) } diff --git a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go index f0d58d42cb5..a5a467c0f00 100644 --- a/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go +++ b/upstream/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go @@ -154,9 +154,7 @@ func buildStructCacheEntry(t reflect.Type, infos map[string]*FieldCacheEntry, fi if field.Type.Kind() == reflect.Ptr { e = field.Type.Elem() } - if e.Kind() == reflect.Struct { - buildStructCacheEntry(e, infos, append(fieldPath, field.Index)) - } + buildStructCacheEntry(e, infos, append(fieldPath, field.Index)) continue } info := &FieldCacheEntry{JsonName: jsonName, isOmitEmpty: isOmitempty, fieldPath: append(fieldPath, field.Index), fieldType: field.Type}